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_name name;
16     public Xcls_title title;
17     public Xcls_region region;
18     public Xcls_parent parent;
19     public Xcls_permname permname;
20     public Xcls_modOrder modOrder;
21     public Xcls_build_module build_module;
22     public Xcls_dbcellrenderer dbcellrenderer;
23     public Xcls_dbmodel dbmodel;
24
25         // my vars (def)
26
27     // ctor
28     public Xcls_DialogNewComponent()
29     {
30         _this = this;
31         this.el = new Gtk.Dialog();
32
33         // my vars (dec)
34
35         // set gobject values
36         this.el.title = "New Component";
37         this.el.default_height = 200;
38         this.el.default_width = 500;
39         this.el.deletable = true;
40         this.el.modal = true;
41         var child_0 = new Xcls_VBox2( _this );
42         child_0.ref();
43         this.el.get_content_area().add (  child_0.el  );
44         var child_1 = new Xcls_Button20( _this );
45         child_1.ref();
46         this.el.add_action_widget (  child_1.el , 0 );
47         var child_2 = new Xcls_Button21( _this );
48         child_2.ref();
49         this.el.add_action_widget (  child_2.el , 1 );
50
51         //listeners
52         this.el.delete_event.connect( (self, event) => {
53             this.el.hide();
54             return true; 
55             //test  
56         });
57         this.el.response.connect( (self, response_id) =>  { 
58           
59                  
60         });
61         this.el.show.connect( (self)  => {
62           this.el.show_all();
63           //test
64         });
65     }
66
67     // user defined functions
68     public   void updateFileFromEntry () {
69     
70             _this.file.title = _this.title.el.get_text();
71             _this.file.region = _this.region.el.get_text();            
72             _this.file.parent = _this.parent.el.get_text();                        
73             _this.file.permname = _this.permname.el.get_text();                                    
74             _this.file.modOrder = _this.modOrder.el.get_text();
75             
76             if (_this.file.name.length  > 0 && _this.file.name != _this.name.el.get_text()) {
77                 _this.file.renameTo(_this.name.el.get_text());
78             }
79             // store the module...
80             _this.file.build_module = "";        
81              Gtk.TreeIter iter; 
82             if (_this.build_module.el.get_active_iter (out iter)) {
83                  Value vfname;
84                  this.dbmodel.el.get_value (iter, 0, out vfname);
85                  if (((string)vfname).length > 0) {
86                      _this.file.build_module = (string)vfname;
87                  }
88         
89             }
90             
91             
92     
93                                                         
94     }
95     public   void show ( ) 
96     {
97         
98         
99         //this.success = c.success;
100         
101         
102     }
103     public class Xcls_VBox2 : Object
104     {
105         public Gtk.VBox el;
106         private Xcls_DialogNewComponent  _this;
107
108
109             // my vars (def)
110
111         // ctor
112         public Xcls_VBox2(Xcls_DialogNewComponent _owner )
113         {
114             _this = _owner;
115             this.el = new Gtk.VBox( true, 0 );
116
117             // my vars (dec)
118
119             // set gobject values
120             var child_0 = new Xcls_Table3( _this );
121             child_0.ref();
122             this.el.pack_start (  child_0.el , false,false,0 );
123         }
124
125         // user defined functions
126     }
127     public class Xcls_Table3 : Object
128     {
129         public Gtk.Table el;
130         private Xcls_DialogNewComponent  _this;
131
132
133             // my vars (def)
134
135         // ctor
136         public Xcls_Table3(Xcls_DialogNewComponent _owner )
137         {
138             _this = _owner;
139             this.el = new Gtk.Table( 3, 2, true );
140
141             // my vars (dec)
142
143             // set gobject values
144             var child_0 = new Xcls_Label4( _this );
145             child_0.ref();
146             this.el.attach_defaults (  child_0.el , 0,1,0,1 );
147             var child_1 = new Xcls_name( _this );
148             child_1.ref();
149             this.el.attach_defaults (  child_1.el , 1,2,0,1 );
150             var child_2 = new Xcls_Label6( _this );
151             child_2.ref();
152             this.el.attach_defaults (  child_2.el , 0,1,1,2 );
153             var child_3 = new Xcls_title( _this );
154             child_3.ref();
155             this.el.attach_defaults (  child_3.el , 1,2,1,2 );
156             var child_4 = new Xcls_Label8( _this );
157             child_4.ref();
158             this.el.attach_defaults (  child_4.el , 0,1,2,3 );
159             var child_5 = new Xcls_region( _this );
160             child_5.ref();
161             this.el.attach_defaults (  child_5.el , 1,2,2,3 );
162             var child_6 = new Xcls_Label10( _this );
163             child_6.ref();
164             this.el.attach_defaults (  child_6.el , 0,1,3,4 );
165             var child_7 = new Xcls_parent( _this );
166             child_7.ref();
167             this.el.attach_defaults (  child_7.el , 1,2,3,4 );
168             var child_8 = new Xcls_Label12( _this );
169             child_8.ref();
170             this.el.attach_defaults (  child_8.el , 0,1,4,5 );
171             var child_9 = new Xcls_permname( _this );
172             child_9.ref();
173             this.el.attach_defaults (  child_9.el , 1,2,4,5 );
174             var child_10 = new Xcls_Label14( _this );
175             child_10.ref();
176             this.el.attach_defaults (  child_10.el , 0,1,5,6 );
177             var child_11 = new Xcls_modOrder( _this );
178             child_11.ref();
179             this.el.attach_defaults (  child_11.el , 1,2,5,6 );
180             var child_12 = new Xcls_Label16( _this );
181             child_12.ref();
182             this.el.attach_defaults (  child_12.el , 0,1,6,7 );
183             var child_13 = new Xcls_build_module( _this );
184             child_13.ref();
185             this.el.attach_defaults (  child_13.el , 1,2,6,7 );
186         }
187
188         // user defined functions
189     }
190     public class Xcls_Label4 : Object
191     {
192         public Gtk.Label el;
193         private Xcls_DialogNewComponent  _this;
194
195
196             // my vars (def)
197
198         // ctor
199         public Xcls_Label4(Xcls_DialogNewComponent _owner )
200         {
201             _this = _owner;
202             this.el = new Gtk.Label( "Component Name" );
203
204             // my vars (dec)
205
206             // set gobject values
207             this.el.justify = Gtk.Justification.RIGHT;
208             this.el.xalign = 0.900000f;
209         }
210
211         // user defined functions
212     }
213
214     public class Xcls_name : Object
215     {
216         public Gtk.Entry el;
217         private Xcls_DialogNewComponent  _this;
218
219
220             // my vars (def)
221
222         // ctor
223         public Xcls_name(Xcls_DialogNewComponent _owner )
224         {
225             _this = _owner;
226             _this.name = this;
227             this.el = new Gtk.Entry();
228
229             // my vars (dec)
230
231             // set gobject values
232             this.el.visible = true;
233         }
234
235         // user defined functions
236     }
237
238     public class Xcls_Label6 : Object
239     {
240         public Gtk.Label el;
241         private Xcls_DialogNewComponent  _this;
242
243
244             // my vars (def)
245
246         // ctor
247         public Xcls_Label6(Xcls_DialogNewComponent _owner )
248         {
249             _this = _owner;
250             this.el = new Gtk.Label( "Title" );
251
252             // my vars (dec)
253
254             // set gobject values
255             this.el.justify = Gtk.Justification.RIGHT;
256             this.el.xalign = 0.900000f;
257             this.el.visible = true;
258         }
259
260         // user defined functions
261     }
262
263     public class Xcls_title : Object
264     {
265         public Gtk.Entry el;
266         private Xcls_DialogNewComponent  _this;
267
268
269             // my vars (def)
270
271         // ctor
272         public Xcls_title(Xcls_DialogNewComponent _owner )
273         {
274             _this = _owner;
275             _this.title = this;
276             this.el = new Gtk.Entry();
277
278             // my vars (dec)
279
280             // set gobject values
281             this.el.visible = true;
282         }
283
284         // user defined functions
285     }
286
287     public class Xcls_Label8 : Object
288     {
289         public Gtk.Label el;
290         private Xcls_DialogNewComponent  _this;
291
292
293             // my vars (def)
294
295         // ctor
296         public Xcls_Label8(Xcls_DialogNewComponent _owner )
297         {
298             _this = _owner;
299             this.el = new Gtk.Label( "Region" );
300
301             // my vars (dec)
302
303             // set gobject values
304             this.el.justify = Gtk.Justification.RIGHT;
305             this.el.xalign = 0.900000f;
306             this.el.tooltip_text = "center, north, south, east, west";
307             this.el.visible = true;
308         }
309
310         // user defined functions
311     }
312
313     public class Xcls_region : Object
314     {
315         public Gtk.Entry el;
316         private Xcls_DialogNewComponent  _this;
317
318
319             // my vars (def)
320
321         // ctor
322         public Xcls_region(Xcls_DialogNewComponent _owner )
323         {
324             _this = _owner;
325             _this.region = this;
326             this.el = new Gtk.Entry();
327
328             // my vars (dec)
329
330             // set gobject values
331             this.el.visible = true;
332         }
333
334         // user defined functions
335     }
336
337     public class Xcls_Label10 : Object
338     {
339         public Gtk.Label el;
340         private Xcls_DialogNewComponent  _this;
341
342
343             // my vars (def)
344
345         // ctor
346         public Xcls_Label10(Xcls_DialogNewComponent _owner )
347         {
348             _this = _owner;
349             this.el = new Gtk.Label( "Parent Name" );
350
351             // my vars (dec)
352
353             // set gobject values
354             this.el.justify = Gtk.Justification.RIGHT;
355             this.el.xalign = 0.900000f;
356             this.el.visible = true;
357         }
358
359         // user defined functions
360     }
361
362     public class Xcls_parent : Object
363     {
364         public Gtk.Entry el;
365         private Xcls_DialogNewComponent  _this;
366
367
368             // my vars (def)
369
370         // ctor
371         public Xcls_parent(Xcls_DialogNewComponent _owner )
372         {
373             _this = _owner;
374             _this.parent = this;
375             this.el = new Gtk.Entry();
376
377             // my vars (dec)
378
379             // set gobject values
380             this.el.visible = true;
381         }
382
383         // user defined functions
384     }
385
386     public class Xcls_Label12 : Object
387     {
388         public Gtk.Label el;
389         private Xcls_DialogNewComponent  _this;
390
391
392             // my vars (def)
393
394         // ctor
395         public Xcls_Label12(Xcls_DialogNewComponent _owner )
396         {
397             _this = _owner;
398             this.el = new Gtk.Label( "Permission Name" );
399
400             // my vars (dec)
401
402             // set gobject values
403             this.el.justify = Gtk.Justification.RIGHT;
404             this.el.xalign = 0.900000f;
405             this.el.visible = true;
406         }
407
408         // user defined functions
409     }
410
411     public class Xcls_permname : Object
412     {
413         public Gtk.Entry el;
414         private Xcls_DialogNewComponent  _this;
415
416
417             // my vars (def)
418
419         // ctor
420         public Xcls_permname(Xcls_DialogNewComponent _owner )
421         {
422             _this = _owner;
423             _this.permname = this;
424             this.el = new Gtk.Entry();
425
426             // my vars (dec)
427
428             // set gobject values
429             this.el.visible = true;
430         }
431
432         // user defined functions
433     }
434
435     public class Xcls_Label14 : Object
436     {
437         public Gtk.Label el;
438         private Xcls_DialogNewComponent  _this;
439
440
441             // my vars (def)
442
443         // ctor
444         public Xcls_Label14(Xcls_DialogNewComponent _owner )
445         {
446             _this = _owner;
447             this.el = new Gtk.Label( "Order (for tabs)" );
448
449             // my vars (dec)
450
451             // set gobject values
452             this.el.justify = Gtk.Justification.RIGHT;
453             this.el.xalign = 0.900000f;
454             this.el.visible = true;
455         }
456
457         // user defined functions
458     }
459
460     public class Xcls_modOrder : Object
461     {
462         public Gtk.Entry el;
463         private Xcls_DialogNewComponent  _this;
464
465
466             // my vars (def)
467
468         // ctor
469         public Xcls_modOrder(Xcls_DialogNewComponent _owner )
470         {
471             _this = _owner;
472             _this.modOrder = this;
473             this.el = new Gtk.Entry();
474
475             // my vars (dec)
476
477             // set gobject values
478             this.el.visible = true;
479         }
480
481         // user defined functions
482     }
483
484     public class Xcls_Label16 : Object
485     {
486         public Gtk.Label el;
487         private Xcls_DialogNewComponent  _this;
488
489
490             // my vars (def)
491
492         // ctor
493         public Xcls_Label16(Xcls_DialogNewComponent _owner )
494         {
495             _this = _owner;
496             this.el = new Gtk.Label( "Module to build (Vala only)" );
497
498             // my vars (dec)
499
500             // set gobject values
501             this.el.justify = Gtk.Justification.RIGHT;
502             this.el.xalign = 0.900000f;
503             this.el.visible = true;
504         }
505
506         // user defined functions
507     }
508
509     public class Xcls_build_module : Object
510     {
511         public Gtk.ComboBox el;
512         private Xcls_DialogNewComponent  _this;
513
514
515             // my vars (def)
516
517         // ctor
518         public Xcls_build_module(Xcls_DialogNewComponent _owner )
519         {
520             _this = _owner;
521             _this.build_module = this;
522             this.el = new Gtk.ComboBox();
523
524             // my vars (dec)
525
526             // set gobject values
527             var child_0 = new Xcls_dbcellrenderer( _this );
528             child_0.ref();
529             this.el.pack_start (  child_0.el , true );
530             var child_1 = new Xcls_dbmodel( _this );
531             child_1.ref();
532             this.el.set_model (  child_1.el  );
533
534             // init method
535
536             this.el.add_attribute(_this.dbcellrenderer.el , "markup", 1 );
537         }
538
539         // user defined functions
540     }
541     public class Xcls_dbcellrenderer : Object
542     {
543         public Gtk.CellRendererText el;
544         private Xcls_DialogNewComponent  _this;
545
546
547             // my vars (def)
548
549         // ctor
550         public Xcls_dbcellrenderer(Xcls_DialogNewComponent _owner )
551         {
552             _this = _owner;
553             _this.dbcellrenderer = this;
554             this.el = new Gtk.CellRendererText();
555
556             // my vars (dec)
557
558             // set gobject values
559         }
560
561         // user defined functions
562     }
563
564     public class Xcls_dbmodel : Object
565     {
566         public Gtk.ListStore el;
567         private Xcls_DialogNewComponent  _this;
568
569
570             // my vars (def)
571
572         // ctor
573         public Xcls_dbmodel(Xcls_DialogNewComponent _owner )
574         {
575             _this = _owner;
576             _this.dbmodel = this;
577             this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
578
579             // my vars (dec)
580
581             // set gobject values
582         }
583
584         // user defined functions
585         public void loadData (Gee.ArrayList<string> data, string cur) {
586             this.el.clear();                                    
587             Gtk.TreeIter iter;
588             var el = this.el;
589             
590            /// el.append(out iter);
591             
592              
593            // el.set_value(iter, 0, "");
594            // el.set_value(iter, 1, "aaa  - Just add Element - aaa");
595         
596             el.append(out iter);
597         
598             
599             el.set_value(iter, 0, "");
600             el.set_value(iter, 1, "-- select a module --");
601             _this.build_module.el.set_active_iter(iter);
602             
603             for (var i = 0; i < data.size;i++) {
604             
605         
606                 el.append(out iter);
607                 
608                 el.set_value(iter, 0, data.get(i));
609                 el.set_value(iter, 1, data.get(i));
610                 
611                 if (data.get(i) == cur) {
612                     _this.build_module.el.set_active_iter(iter);
613                 }
614                 
615             }
616              this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);          
617                                              
618         }
619     }
620
621
622
623
624     public class Xcls_Button20 : Object
625     {
626         public Gtk.Button el;
627         private Xcls_DialogNewComponent  _this;
628
629
630             // my vars (def)
631
632         // ctor
633         public Xcls_Button20(Xcls_DialogNewComponent _owner )
634         {
635             _this = _owner;
636             this.el = new Gtk.Button();
637
638             // my vars (dec)
639
640             // set gobject values
641             this.el.label = "Cancel";
642         }
643
644         // user defined functions
645     }
646
647     public class Xcls_Button21 : Object
648     {
649         public Gtk.Button el;
650         private Xcls_DialogNewComponent  _this;
651
652
653             // my vars (def)
654
655         // ctor
656         public Xcls_Button21(Xcls_DialogNewComponent _owner )
657         {
658             _this = _owner;
659             this.el = new Gtk.Button();
660
661             // my vars (dec)
662
663             // set gobject values
664             this.el.label = "OK";
665         }
666
667         // user defined functions
668     }
669
670 }