NewBranch.bjs
[gitlive] / NewBranch.vala
1 static Xcls_DialogNewComponent  _DialogNewComponent;
2
3 public class Xcls_DialogNewComponent : Object
4 {
5     public Gtk.Dialog el;
6     private Xcls_DialogNewComponent  _this;
7
8     public static Xcls_DialogNewComponent singleton()
9     {
10         if (_DialogNewComponent == null) {
11             _DialogNewComponent= new Xcls_DialogNewComponent();
12         }
13         return _DialogNewComponent;
14     }
15     public Xcls_build_module build_module;
16     public Xcls_dbcellrenderer dbcellrenderer;
17     public Xcls_dbmodel dbmodel;
18     public Xcls_name name;
19
20         // my vars (def)
21
22     // ctor
23     public Xcls_DialogNewComponent()
24     {
25         _this = this;
26         this.el = new Gtk.Dialog();
27
28         // my vars (dec)
29
30         // set gobject values
31         this.el.title = "Create a working branch ";
32         this.el.default_height = 200;
33         this.el.default_width = 500;
34         this.el.deletable = true;
35         this.el.modal = true;
36         var child_0 = new Xcls_VBox2( _this );
37         child_0.ref();
38         this.el.get_content_area().add (  child_0.el  );
39         var child_1 = new Xcls_Button10( _this );
40         child_1.ref();
41         this.el.add_action_widget (  child_1.el , 0 );
42         var child_2 = new Xcls_Button11( _this );
43         child_2.ref();
44         this.el.add_action_widget (  child_2.el , 1 );
45
46         //listeners
47         this.el.delete_event.connect( (self, event) => {
48             this.el.hide();
49             return true; 
50             //test  
51         });
52         this.el.response.connect( (self, response_id) =>  { 
53           
54                  
55         });
56         this.el.show.connect( (self)  => {
57           this.el.show_all();
58           //test
59         });
60     }
61
62     // user defined functions
63     public   void show ( ) 
64     {
65         
66         
67         //this.success = c.success;
68         
69         
70     }
71     public class Xcls_VBox2 : Object
72     {
73         public Gtk.VBox el;
74         private Xcls_DialogNewComponent  _this;
75
76
77             // my vars (def)
78
79         // ctor
80         public Xcls_VBox2(Xcls_DialogNewComponent _owner )
81         {
82             _this = _owner;
83             this.el = new Gtk.VBox( true, 0 );
84
85             // my vars (dec)
86
87             // set gobject values
88             var child_0 = new Xcls_Table3( _this );
89             child_0.ref();
90             this.el.pack_start (  child_0.el , false,false,0 );
91         }
92
93         // user defined functions
94     }
95     public class Xcls_Table3 : Object
96     {
97         public Gtk.Table el;
98         private Xcls_DialogNewComponent  _this;
99
100
101             // my vars (def)
102
103         // ctor
104         public Xcls_Table3(Xcls_DialogNewComponent _owner )
105         {
106             _this = _owner;
107             this.el = new Gtk.Table( 3, 2, true );
108
109             // my vars (dec)
110
111             // set gobject values
112             var child_0 = new Xcls_Label4( _this );
113             child_0.ref();
114             this.el.attach_defaults (  child_0.el , 0,1,0,1 );
115             var child_1 = new Xcls_build_module( _this );
116             child_1.ref();
117             this.el.attach_defaults (  child_1.el , 1,2,0,1 );
118             var child_2 = new Xcls_Label8( _this );
119             child_2.ref();
120             this.el.attach_defaults (  child_2.el , 0,1,1,2 );
121             var child_3 = new Xcls_name( _this );
122             child_3.ref();
123             this.el.attach_defaults (  child_3.el , 1,2,1,2 );
124         }
125
126         // user defined functions
127     }
128     public class Xcls_Label4 : Object
129     {
130         public Gtk.Label el;
131         private Xcls_DialogNewComponent  _this;
132
133
134             // my vars (def)
135
136         // ctor
137         public Xcls_Label4(Xcls_DialogNewComponent _owner )
138         {
139             _this = _owner;
140             this.el = new Gtk.Label( "Select Ticket" );
141
142             // my vars (dec)
143
144             // set gobject values
145             this.el.justify = Gtk.Justification.RIGHT;
146             this.el.xalign = 0.900000f;
147             this.el.visible = true;
148         }
149
150         // user defined functions
151     }
152
153     public class Xcls_build_module : Object
154     {
155         public Gtk.ComboBox el;
156         private Xcls_DialogNewComponent  _this;
157
158
159             // my vars (def)
160
161         // ctor
162         public Xcls_build_module(Xcls_DialogNewComponent _owner )
163         {
164             _this = _owner;
165             _this.build_module = this;
166             this.el = new Gtk.ComboBox();
167
168             // my vars (dec)
169
170             // set gobject values
171             var child_0 = new Xcls_dbcellrenderer( _this );
172             child_0.ref();
173             this.el.pack_start (  child_0.el , true );
174             var child_1 = new Xcls_dbmodel( _this );
175             child_1.ref();
176             this.el.set_model (  child_1.el  );
177
178             // init method
179
180             this.el.add_attribute(_this.dbcellrenderer.el , "markup", 1 );
181         }
182
183         // user defined functions
184     }
185     public class Xcls_dbcellrenderer : Object
186     {
187         public Gtk.CellRendererText el;
188         private Xcls_DialogNewComponent  _this;
189
190
191             // my vars (def)
192
193         // ctor
194         public Xcls_dbcellrenderer(Xcls_DialogNewComponent _owner )
195         {
196             _this = _owner;
197             _this.dbcellrenderer = this;
198             this.el = new Gtk.CellRendererText();
199
200             // my vars (dec)
201
202             // set gobject values
203         }
204
205         // user defined functions
206     }
207
208     public class Xcls_dbmodel : Object
209     {
210         public Gtk.ListStore el;
211         private Xcls_DialogNewComponent  _this;
212
213
214             // my vars (def)
215
216         // ctor
217         public Xcls_dbmodel(Xcls_DialogNewComponent _owner )
218         {
219             _this = _owner;
220             _this.dbmodel = this;
221             this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
222
223             // my vars (dec)
224
225             // set gobject values
226         }
227
228         // user defined functions
229         public void loadData (Gee.ArrayList<string> data, string cur) {
230             this.el.clear();                                    
231             Gtk.TreeIter iter;
232             var el = this.el;
233             
234            /// el.append(out iter);
235             
236              
237            // el.set_value(iter, 0, "");
238            // el.set_value(iter, 1, "aaa  - Just add Element - aaa");
239         
240             el.append(out iter);
241         
242             
243             el.set_value(iter, 0, "");
244             el.set_value(iter, 1, "-- select a module --");
245             _this.build_module.el.set_active_iter(iter);
246             
247             for (var i = 0; i < data.size;i++) {
248             
249         
250                 el.append(out iter);
251                 
252                 el.set_value(iter, 0, data.get(i));
253                 el.set_value(iter, 1, data.get(i));
254                 
255                 if (data.get(i) == cur) {
256                     _this.build_module.el.set_active_iter(iter);
257                 }
258                 
259             }
260              this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);          
261                                              
262         }
263     }
264
265
266     public class Xcls_Label8 : Object
267     {
268         public Gtk.Label el;
269         private Xcls_DialogNewComponent  _this;
270
271
272             // my vars (def)
273
274         // ctor
275         public Xcls_Label8(Xcls_DialogNewComponent _owner )
276         {
277             _this = _owner;
278             this.el = new Gtk.Label( "or use this as branch name" );
279
280             // my vars (dec)
281
282             // set gobject values
283             this.el.justify = Gtk.Justification.RIGHT;
284             this.el.xalign = 0.900000f;
285         }
286
287         // user defined functions
288     }
289
290     public class Xcls_name : Object
291     {
292         public Gtk.Entry el;
293         private Xcls_DialogNewComponent  _this;
294
295
296             // my vars (def)
297
298         // ctor
299         public Xcls_name(Xcls_DialogNewComponent _owner )
300         {
301             _this = _owner;
302             _this.name = this;
303             this.el = new Gtk.Entry();
304
305             // my vars (dec)
306
307             // set gobject values
308             this.el.visible = true;
309         }
310
311         // user defined functions
312     }
313
314
315
316     public class Xcls_Button10 : Object
317     {
318         public Gtk.Button el;
319         private Xcls_DialogNewComponent  _this;
320
321
322             // my vars (def)
323
324         // ctor
325         public Xcls_Button10(Xcls_DialogNewComponent _owner )
326         {
327             _this = _owner;
328             this.el = new Gtk.Button();
329
330             // my vars (dec)
331
332             // set gobject values
333             this.el.label = "Do not create Branch";
334         }
335
336         // user defined functions
337     }
338
339     public class Xcls_Button11 : Object
340     {
341         public Gtk.Button el;
342         private Xcls_DialogNewComponent  _this;
343
344
345             // my vars (def)
346
347         // ctor
348         public Xcls_Button11(Xcls_DialogNewComponent _owner )
349         {
350             _this = _owner;
351             this.el = new Gtk.Button();
352
353             // my vars (dec)
354
355             // set gobject values
356             this.el.label = "Create Branch";
357         }
358
359         // user defined functions
360     }
361
362 }