src/Builder4/RooProjectSettings.bjs
[roobuilder] / src / Builder4 / RooProjectSettings.vala
1 static Xcls_RooProjectSettings  _RooProjectSettings;
2
3 public class Xcls_RooProjectSettings : Object
4 {
5     public Gtk.Popover el;
6     private Xcls_RooProjectSettings  _this;
7
8     public static Xcls_RooProjectSettings singleton()
9     {
10         if (_RooProjectSettings == null) {
11             _RooProjectSettings= new Xcls_RooProjectSettings();
12         }
13         return _RooProjectSettings;
14     }
15     public Xcls_label_global label_global;
16     public Xcls_label_database label_database;
17     public Xcls_path path;
18     public Xcls_base_template base_template;
19     public Xcls_base_template_cellrenderer base_template_cellrenderer;
20     public Xcls_base_template_model base_template_model;
21     public Xcls_rootURL rootURL;
22     public Xcls_view view;
23     public Xcls_database_DBTYPE database_DBTYPE;
24     public Xcls_database_DBNAME database_DBNAME;
25     public Xcls_database_DBUSERNAME database_DBUSERNAME;
26     public Xcls_database_DBPASSWORD database_DBPASSWORD;
27     public Xcls_database_ERROR database_ERROR;
28
29         // my vars (def)
30     public signal void buttonPressed (string btn);
31     public Project.Project project;
32
33     // ctor
34     public Xcls_RooProjectSettings()
35     {
36         _this = this;
37         this.el = new Gtk.Popover( null );
38
39         // my vars (dec)
40
41         // set gobject values
42         this.el.border_width = 0;
43         this.el.modal = true;
44         this.el.position = Gtk.PositionType.RIGHT;
45         var child_0 = new Xcls_Box2( _this );
46         child_0.ref();
47         this.el.add (  child_0.el  );
48     }
49
50     // user defined functions
51     public void show (Gtk.Widget btn, Project.Project project) {
52         _this.project = project;
53         _this.path.el.label = project.firstPath();
54         // get the active project.
55          var lm = Gtk.SourceLanguageManager.get_default();
56                     
57         ((Gtk.SourceBuffer)(_this.view.el.get_buffer())) .set_language(
58         
59             lm.get_language("html"));
60       
61         //print (project.fn);
62         //project.runhtml = project.runhtml || '';
63         _this.view.el.get_buffer().set_text(project.runhtml);
64         
65            
66         _this.rootURL.el.set_text( _this.project.rootURL );
67         
68         _this.base_template_model.loadData(_this.project.base_template);    
69         
70          var js = _this.project;
71         _this.database_DBTYPE.el.set_text(     js.get_string_member("DBTYPE") );
72         _this.database_DBNAME.el.set_text(    js.get_string_member("DBNAME") );
73         _this.database_DBUSERNAME.el.set_text(    js.get_string_member("DBUSERNAME") );
74         _this.database_DBPASSWORD.el.set_text(    js.get_string_member("DBPASSWORD") );
75         
76                 //console.log('show all');
77         this.el.set_modal(true);
78         this.el.set_relative_to(btn);
79     
80         this.el.set_position(Gtk.PositionType.RIGHT);
81     
82         // window + header?
83          print("SHOWALL - POPIP\n");
84         this.el.show_all();
85         this.el.set_size_request(800,500);
86         this.view.el.grab_focus();
87         
88         
89         //this.el.show_all();
90     }
91     public void save () {
92        var buf =    _this.view.el.get_buffer();
93        Gtk.TextIter s;
94          Gtk.TextIter e;
95         buf.get_start_iter(out s);
96         buf.get_end_iter(out e);
97           _this.project.runhtml = buf.get_text(s,e,true);
98           
99         _this.project.rootURL = _this.rootURL.el.get_text();
100         _this.project.base_template = _this.base_template.el.get_text();    
101         
102         var js = _this.project.json_project_data;
103         js.set_string_member("DBTYPE", _this.database_DBTYPE.el.get_text());
104        js.set_string_member("DBNAME", _this.database_DBNAME.el.get_text());
105         js.set_string_member("DBUSERNAME", _this.database_DBUSERNAME.el.get_text());
106         js.set_string_member("DBPASSWORD", _this.database_DBPASSWORD.el.get_text());
107     //    _this.project.set_string_member("DBHOST", _this.DBTYPE.el.get_text());    
108         
109         // need to re-init the database 
110         
111         _this.project.initRooDatabase();
112          
113         
114     }
115     public class Xcls_Box2 : Object
116     {
117         public Gtk.Box el;
118         private Xcls_RooProjectSettings  _this;
119
120
121             // my vars (def)
122
123         // ctor
124         public Xcls_Box2(Xcls_RooProjectSettings _owner )
125         {
126             _this = _owner;
127             this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
128
129             // my vars (dec)
130
131             // set gobject values
132             this.el.homogeneous = false;
133             this.el.border_width = 5;
134             var child_0 = new Xcls_Notebook3( _this );
135             child_0.ref();
136             this.el.pack_start (  child_0.el , true,true,0 );
137             var child_1 = new Xcls_Box30( _this );
138             child_1.ref();
139             this.el.pack_end (  child_1.el , false,false,0 );
140         }
141
142         // user defined functions
143     }
144     public class Xcls_Notebook3 : Object
145     {
146         public Gtk.Notebook el;
147         private Xcls_RooProjectSettings  _this;
148
149
150             // my vars (def)
151
152         // ctor
153         public Xcls_Notebook3(Xcls_RooProjectSettings _owner )
154         {
155             _this = _owner;
156             this.el = new Gtk.Notebook();
157
158             // my vars (dec)
159
160             // set gobject values
161             var child_0 = new Xcls_label_global( _this );
162             child_0.ref();
163             var child_1 = new Xcls_label_database( _this );
164             child_1.ref();
165             var child_2 = new Xcls_Box6( _this );
166             child_2.ref();
167             this.el.append_page (  child_2.el , _this.label_global.el );
168             var child_3 = new Xcls_Box19( _this );
169             child_3.ref();
170             this.el.append_page (  child_3.el , _this.label_database.el );
171         }
172
173         // user defined functions
174     }
175     public class Xcls_label_global : Object
176     {
177         public Gtk.Label el;
178         private Xcls_RooProjectSettings  _this;
179
180
181             // my vars (def)
182
183         // ctor
184         public Xcls_label_global(Xcls_RooProjectSettings _owner )
185         {
186             _this = _owner;
187             _this.label_global = this;
188             this.el = new Gtk.Label( "Global" );
189
190             // my vars (dec)
191
192             // set gobject values
193         }
194
195         // user defined functions
196     }
197
198     public class Xcls_label_database : Object
199     {
200         public Gtk.Label el;
201         private Xcls_RooProjectSettings  _this;
202
203
204             // my vars (def)
205
206         // ctor
207         public Xcls_label_database(Xcls_RooProjectSettings _owner )
208         {
209             _this = _owner;
210             _this.label_database = this;
211             this.el = new Gtk.Label( "Database" );
212
213             // my vars (dec)
214
215             // set gobject values
216         }
217
218         // user defined functions
219     }
220
221     public class Xcls_Box6 : Object
222     {
223         public Gtk.Box el;
224         private Xcls_RooProjectSettings  _this;
225
226
227             // my vars (def)
228
229         // ctor
230         public Xcls_Box6(Xcls_RooProjectSettings _owner )
231         {
232             _this = _owner;
233             this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
234
235             // my vars (dec)
236
237             // set gobject values
238             this.el.homogeneous = false;
239             var child_0 = new Xcls_path( _this );
240             child_0.ref();
241             this.el.pack_start (  child_0.el , false,false,0 );
242             var child_1 = new Xcls_Box8( _this );
243             child_1.ref();
244             this.el.pack_start (  child_1.el , false,false,0 );
245             var child_2 = new Xcls_Box13( _this );
246             child_2.ref();
247             this.el.pack_start (  child_2.el , false,false,0 );
248             var child_3 = new Xcls_Label16( _this );
249             child_3.ref();
250             this.el.pack_start (  child_3.el , false,false,0 );
251             var child_4 = new Xcls_ScrolledWindow17( _this );
252             child_4.ref();
253             this.el.pack_start (  child_4.el , true,true,0 );
254         }
255
256         // user defined functions
257     }
258     public class Xcls_path : Object
259     {
260         public Gtk.Label el;
261         private Xcls_RooProjectSettings  _this;
262
263
264             // my vars (def)
265
266         // ctor
267         public Xcls_path(Xcls_RooProjectSettings _owner )
268         {
269             _this = _owner;
270             _this.path = this;
271             this.el = new Gtk.Label( "filename" );
272
273             // my vars (dec)
274
275             // set gobject values
276             this.el.margin = 3;
277             this.el.xalign = 0f;
278         }
279
280         // user defined functions
281     }
282
283     public class Xcls_Box8 : Object
284     {
285         public Gtk.Box el;
286         private Xcls_RooProjectSettings  _this;
287
288
289             // my vars (def)
290
291         // ctor
292         public Xcls_Box8(Xcls_RooProjectSettings _owner )
293         {
294             _this = _owner;
295             this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
296
297             // my vars (dec)
298
299             // set gobject values
300             this.el.homogeneous = false;
301             this.el.expand = false;
302             var child_0 = new Xcls_Label9( _this );
303             child_0.ref();
304             this.el.pack_start (  child_0.el , false,false,0 );
305             var child_1 = new Xcls_base_template( _this );
306             child_1.ref();
307             this.el.attach (  child_1.el , 1,0,1,1 );
308         }
309
310         // user defined functions
311     }
312     public class Xcls_Label9 : Object
313     {
314         public Gtk.Label el;
315         private Xcls_RooProjectSettings  _this;
316
317
318             // my vars (def)
319
320         // ctor
321         public Xcls_Label9(Xcls_RooProjectSettings _owner )
322         {
323             _this = _owner;
324             this.el = new Gtk.Label( "HTML template file" );
325
326             // my vars (dec)
327
328             // set gobject values
329             this.el.margin = 3;
330         }
331
332         // user defined functions
333     }
334
335     public class Xcls_base_template : Object
336     {
337         public Gtk.ComboBox el;
338         private Xcls_RooProjectSettings  _this;
339
340
341             // my vars (def)
342
343         // ctor
344         public Xcls_base_template(Xcls_RooProjectSettings _owner )
345         {
346             _this = _owner;
347             _this.base_template = this;
348             this.el = new Gtk.ComboBox();
349
350             // my vars (dec)
351
352             // set gobject values
353             var child_0 = new Xcls_base_template_cellrenderer( _this );
354             child_0.ref();
355             this.el.pack_start (  child_0.el , true );
356             var child_1 = new Xcls_base_template_model( _this );
357             child_1.ref();
358             this.el.set_model (  child_1.el  );
359
360             // init method
361
362             this.el.add_attribute(_this.base_template_cellrenderer.el , "markup", 1 );
363
364             //listeners
365             this.el.changed.connect( () => {
366                 Gtk.TreeIter iter;
367              
368                 if (this.el.get_active_iter(out iter)) {
369                         Value vfname;
370                         _this.base_template_model.el.get_value (iter, 0, out vfname);
371                         // is_bjs = ((string)vfname) == "bjs";
372                 }
373                 
374               
375                 // directory is only available for non-bjs 
376              
377             
378             
379             });
380         }
381
382         // user defined functions
383     }
384     public class Xcls_base_template_cellrenderer : Object
385     {
386         public Gtk.CellRendererText el;
387         private Xcls_RooProjectSettings  _this;
388
389
390             // my vars (def)
391
392         // ctor
393         public Xcls_base_template_cellrenderer(Xcls_RooProjectSettings _owner )
394         {
395             _this = _owner;
396             _this.base_template_cellrenderer = this;
397             this.el = new Gtk.CellRendererText();
398
399             // my vars (dec)
400
401             // set gobject values
402         }
403
404         // user defined functions
405     }
406
407     public class Xcls_base_template_model : Object
408     {
409         public Gtk.ListStore el;
410         private Xcls_RooProjectSettings  _this;
411
412
413             // my vars (def)
414
415         // ctor
416         public Xcls_base_template_model(Xcls_RooProjectSettings _owner )
417         {
418             _this = _owner;
419             _this.base_template_model = this;
420             this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
421
422             // my vars (dec)
423
424             // set gobject values
425         }
426
427         // user defined functions
428         public void loadData (string cur) {
429             this.el.clear();                                    
430             Gtk.TreeIter iter;
431             var el = this.el;
432             
433            /// el.append(out iter);
434             
435              
436            // el.set_value(iter, 0, "");
437            // el.set_value(iter, 1, "aaa  - Just add Element - aaa");
438         
439             el.append(out iter);
440             el.set_value(iter, 0, "roo.builder.html");
441             _this.base_template.el.set_active_iter(iter);
442         
443         
444             el.append(out iter);
445             el.set_value(iter, 0, "bootstrap.builder.html");
446             if (cur == "bootstrap.builder.html") {
447                    _this.base_template.el.set_active_iter(iter);
448            }
449         
450                 el.append(out iter);
451             el.set_value(iter, 0, "mailer.builder.html");
452         
453                 if (cur == "mailer.builder.html") {
454                     _this.base_template.el.set_active_iter(iter);
455             }
456         
457                                              
458         }
459     }
460
461
462
463     public class Xcls_Box13 : Object
464     {
465         public Gtk.Box el;
466         private Xcls_RooProjectSettings  _this;
467
468
469             // my vars (def)
470
471         // ctor
472         public Xcls_Box13(Xcls_RooProjectSettings _owner )
473         {
474             _this = _owner;
475             this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
476
477             // my vars (dec)
478
479             // set gobject values
480             this.el.homogeneous = false;
481             this.el.expand = false;
482             var child_0 = new Xcls_Label14( _this );
483             child_0.ref();
484             this.el.pack_start (  child_0.el , false,false,0 );
485             var child_1 = new Xcls_rootURL( _this );
486             child_1.ref();
487             this.el.add (  child_1.el  );
488         }
489
490         // user defined functions
491     }
492     public class Xcls_Label14 : Object
493     {
494         public Gtk.Label el;
495         private Xcls_RooProjectSettings  _this;
496
497
498             // my vars (def)
499
500         // ctor
501         public Xcls_Label14(Xcls_RooProjectSettings _owner )
502         {
503             _this = _owner;
504             this.el = new Gtk.Label( "root URL" );
505
506             // my vars (dec)
507
508             // set gobject values
509             this.el.margin = 3;
510         }
511
512         // user defined functions
513     }
514
515     public class Xcls_rootURL : Object
516     {
517         public Gtk.Entry el;
518         private Xcls_RooProjectSettings  _this;
519
520
521             // my vars (def)
522
523         // ctor
524         public Xcls_rootURL(Xcls_RooProjectSettings _owner )
525         {
526             _this = _owner;
527             _this.rootURL = this;
528             this.el = new Gtk.Entry();
529
530             // my vars (dec)
531
532             // set gobject values
533         }
534
535         // user defined functions
536     }
537
538
539     public class Xcls_Label16 : Object
540     {
541         public Gtk.Label el;
542         private Xcls_RooProjectSettings  _this;
543
544
545             // my vars (def)
546
547         // ctor
548         public Xcls_Label16(Xcls_RooProjectSettings _owner )
549         {
550             _this = _owner;
551             this.el = new Gtk.Label( "HTML To insert at end of <HEAD>" );
552
553             // my vars (dec)
554
555             // set gobject values
556         }
557
558         // user defined functions
559     }
560
561     public class Xcls_ScrolledWindow17 : Object
562     {
563         public Gtk.ScrolledWindow el;
564         private Xcls_RooProjectSettings  _this;
565
566
567             // my vars (def)
568
569         // ctor
570         public Xcls_ScrolledWindow17(Xcls_RooProjectSettings _owner )
571         {
572             _this = _owner;
573             this.el = new Gtk.ScrolledWindow( null, null );
574
575             // my vars (dec)
576
577             // set gobject values
578             var child_0 = new Xcls_view( _this );
579             child_0.ref();
580             this.el.add (  child_0.el  );
581         }
582
583         // user defined functions
584     }
585     public class Xcls_view : Object
586     {
587         public Gtk.SourceView el;
588         private Xcls_RooProjectSettings  _this;
589
590
591             // my vars (def)
592
593         // ctor
594         public Xcls_view(Xcls_RooProjectSettings _owner )
595         {
596             _this = _owner;
597             _this.view = this;
598             this.el = new Gtk.SourceView();
599
600             // my vars (dec)
601
602             // init method
603
604             var description =   Pango.FontDescription.from_string("monospace");
605                 description.set_size(9000);
606                 this.el.override_font(description);
607
608             //listeners
609             this.el.key_release_event.connect( ( event) =>{
610                 if (event.keyval != 115) {
611                     return false;
612                      
613                 }
614                 if   ( (event.state & Gdk.ModifierType.CONTROL_MASK ) < 1 ) {
615                     return false;
616                 }
617                  var buf =    this.el.get_buffer();
618                 Gtk.TextIter s;
619                 Gtk.TextIter e;
620                 buf.get_start_iter(out s);
621                 buf.get_end_iter(out e);
622                 _this.project.runhtml = buf.get_text(s,e,true);
623                 
624                       
625                 _this.buttonPressed("save");
626                  
627                 return false;
628                      
629             });
630         }
631
632         // user defined functions
633     }
634
635
636
637     public class Xcls_Box19 : Object
638     {
639         public Gtk.Box el;
640         private Xcls_RooProjectSettings  _this;
641
642
643             // my vars (def)
644
645         // ctor
646         public Xcls_Box19(Xcls_RooProjectSettings _owner )
647         {
648             _this = _owner;
649             this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
650
651             // my vars (dec)
652
653             // set gobject values
654             this.el.homogeneous = false;
655             var child_0 = new Xcls_Label20( _this );
656             child_0.ref();
657             this.el.pack_start (  child_0.el , false,false,0 );
658             var child_1 = new Xcls_database_DBTYPE( _this );
659             child_1.ref();
660             this.el.pack_start (  child_1.el , false,false,0 );
661             var child_2 = new Xcls_Label22( _this );
662             child_2.ref();
663             this.el.pack_start (  child_2.el , false,false,0 );
664             var child_3 = new Xcls_database_DBNAME( _this );
665             child_3.ref();
666             this.el.pack_start (  child_3.el , false,false,0 );
667             var child_4 = new Xcls_Label24( _this );
668             child_4.ref();
669             this.el.pack_start (  child_4.el , false,false,0 );
670             var child_5 = new Xcls_database_DBUSERNAME( _this );
671             child_5.ref();
672             this.el.pack_start (  child_5.el , false,false,0 );
673             var child_6 = new Xcls_Label26( _this );
674             child_6.ref();
675             this.el.pack_start (  child_6.el , false,false,0 );
676             var child_7 = new Xcls_database_DBPASSWORD( _this );
677             child_7.ref();
678             this.el.pack_start (  child_7.el , false,false,0 );
679             var child_8 = new Xcls_Button28( _this );
680             child_8.ref();
681             this.el.pack_start (  child_8.el , false,false,0 );
682             var child_9 = new Xcls_database_ERROR( _this );
683             child_9.ref();
684             this.el.pack_start (  child_9.el , false,false,0 );
685         }
686
687         // user defined functions
688     }
689     public class Xcls_Label20 : Object
690     {
691         public Gtk.Label el;
692         private Xcls_RooProjectSettings  _this;
693
694
695             // my vars (def)
696
697         // ctor
698         public Xcls_Label20(Xcls_RooProjectSettings _owner )
699         {
700             _this = _owner;
701             this.el = new Gtk.Label( "Type (eg. MySQL or PostgreSQL)" );
702
703             // my vars (dec)
704
705             // set gobject values
706             this.el.xalign = 0f;
707         }
708
709         // user defined functions
710     }
711
712     public class Xcls_database_DBTYPE : Object
713     {
714         public Gtk.Entry el;
715         private Xcls_RooProjectSettings  _this;
716
717
718             // my vars (def)
719
720         // ctor
721         public Xcls_database_DBTYPE(Xcls_RooProjectSettings _owner )
722         {
723             _this = _owner;
724             _this.database_DBTYPE = this;
725             this.el = new Gtk.Entry();
726
727             // my vars (dec)
728
729             // set gobject values
730
731             //listeners
732             this.el.key_press_event.connect( (ev) => {
733             
734                 if (ev.keyval == Gdk.Key.Tab) {
735                     _this.database_DBNAME.el.grab_focus();
736                     return true;
737                 }
738             
739             
740                 return false;
741             });
742         }
743
744         // user defined functions
745     }
746
747     public class Xcls_Label22 : Object
748     {
749         public Gtk.Label el;
750         private Xcls_RooProjectSettings  _this;
751
752
753             // my vars (def)
754
755         // ctor
756         public Xcls_Label22(Xcls_RooProjectSettings _owner )
757         {
758             _this = _owner;
759             this.el = new Gtk.Label( "Name" );
760
761             // my vars (dec)
762
763             // set gobject values
764             this.el.xalign = 0f;
765         }
766
767         // user defined functions
768     }
769
770     public class Xcls_database_DBNAME : Object
771     {
772         public Gtk.Entry el;
773         private Xcls_RooProjectSettings  _this;
774
775
776             // my vars (def)
777
778         // ctor
779         public Xcls_database_DBNAME(Xcls_RooProjectSettings _owner )
780         {
781             _this = _owner;
782             _this.database_DBNAME = this;
783             this.el = new Gtk.Entry();
784
785             // my vars (dec)
786
787             // set gobject values
788
789             //listeners
790             this.el.key_press_event.connect( (ev) => {
791             
792                 if (ev.keyval == Gdk.Key.Tab) {
793                     _this.database_DBUSERNAME.el.grab_focus();
794                     return true;
795                 }
796             
797             
798                 return false;
799             });
800         }
801
802         // user defined functions
803     }
804
805     public class Xcls_Label24 : Object
806     {
807         public Gtk.Label el;
808         private Xcls_RooProjectSettings  _this;
809
810
811             // my vars (def)
812
813         // ctor
814         public Xcls_Label24(Xcls_RooProjectSettings _owner )
815         {
816             _this = _owner;
817             this.el = new Gtk.Label( "Username" );
818
819             // my vars (dec)
820
821             // set gobject values
822             this.el.xalign = 0f;
823         }
824
825         // user defined functions
826     }
827
828     public class Xcls_database_DBUSERNAME : Object
829     {
830         public Gtk.Entry el;
831         private Xcls_RooProjectSettings  _this;
832
833
834             // my vars (def)
835
836         // ctor
837         public Xcls_database_DBUSERNAME(Xcls_RooProjectSettings _owner )
838         {
839             _this = _owner;
840             _this.database_DBUSERNAME = this;
841             this.el = new Gtk.Entry();
842
843             // my vars (dec)
844
845             // set gobject values
846
847             //listeners
848             this.el.key_press_event.connect( (ev) => {
849             
850                 if (ev.keyval == Gdk.Key.Tab) {
851                     _this.database_DBPASSWORD.el.grab_focus();
852                     return true;
853                 }
854             
855             
856                 return false;
857             });
858         }
859
860         // user defined functions
861     }
862
863     public class Xcls_Label26 : Object
864     {
865         public Gtk.Label el;
866         private Xcls_RooProjectSettings  _this;
867
868
869             // my vars (def)
870
871         // ctor
872         public Xcls_Label26(Xcls_RooProjectSettings _owner )
873         {
874             _this = _owner;
875             this.el = new Gtk.Label( "Password" );
876
877             // my vars (dec)
878
879             // set gobject values
880             this.el.xalign = 0f;
881         }
882
883         // user defined functions
884     }
885
886     public class Xcls_database_DBPASSWORD : Object
887     {
888         public Gtk.Entry el;
889         private Xcls_RooProjectSettings  _this;
890
891
892             // my vars (def)
893
894         // ctor
895         public Xcls_database_DBPASSWORD(Xcls_RooProjectSettings _owner )
896         {
897             _this = _owner;
898             _this.database_DBPASSWORD = this;
899             this.el = new Gtk.Entry();
900
901             // my vars (dec)
902
903             // set gobject values
904         }
905
906         // user defined functions
907     }
908
909     public class Xcls_Button28 : Object
910     {
911         public Gtk.Button el;
912         private Xcls_RooProjectSettings  _this;
913
914
915             // my vars (def)
916
917         // ctor
918         public Xcls_Button28(Xcls_RooProjectSettings _owner )
919         {
920             _this = _owner;
921             this.el = new Gtk.Button();
922
923             // my vars (dec)
924
925             // set gobject values
926             this.el.label = "Check Connection";
927
928             //listeners
929             this.el.clicked.connect( () => {
930             
931             
932               _this.database_ERROR.el.label    = "";
933                 Gda.Connection cnc;
934                 try {
935                     // assumes localhost...
936                      cnc = Gda.Connection.open_from_string (
937                                 _this.database_DBTYPE.el.get_text(),
938                                 "DB_NAME=" + _this.database_DBNAME.el.get_text(), 
939                                 "USERNAME=" + _this.database_DBUSERNAME.el.get_text() + 
940                                 ";PASSWORD=" + _this.database_DBPASSWORD.el.get_text(),
941                                 Gda.ConnectionOptions.NONE
942                         );
943                //} catch (Gda.ConnectionError ce) { 
944                //   _this.database_ERROR.el.label = ce.message;        
945                } catch(Gda.ConnectionError ue) {
946                   _this.database_ERROR.el.label = ue.message;
947                     return;
948                }  catch(Gda.ConfigError ue) {
949                   _this.database_ERROR.el.label = ue.message;
950                     return;
951                }
952               _this.database_ERROR.el.label = "Connection Succeeded";
953                cnc.close();
954             });
955         }
956
957         // user defined functions
958     }
959
960     public class Xcls_database_ERROR : Object
961     {
962         public Gtk.Label el;
963         private Xcls_RooProjectSettings  _this;
964
965
966             // my vars (def)
967
968         // ctor
969         public Xcls_database_ERROR(Xcls_RooProjectSettings _owner )
970         {
971             _this = _owner;
972             _this.database_ERROR = this;
973             this.el = new Gtk.Label( " " );
974
975             // my vars (dec)
976
977             // set gobject values
978             this.el.margin = 3;
979             this.el.xalign = 0f;
980         }
981
982         // user defined functions
983     }
984
985
986
987     public class Xcls_Box30 : Object
988     {
989         public Gtk.Box el;
990         private Xcls_RooProjectSettings  _this;
991
992
993             // my vars (def)
994
995         // ctor
996         public Xcls_Box30(Xcls_RooProjectSettings _owner )
997         {
998             _this = _owner;
999             this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1000
1001             // my vars (dec)
1002
1003             // set gobject values
1004             this.el.homogeneous = true;
1005             this.el.expand = false;
1006             this.el.vexpand = false;
1007             var child_0 = new Xcls_Button31( _this );
1008             child_0.ref();
1009             this.el.add (  child_0.el  );
1010             var child_1 = new Xcls_Button32( _this );
1011             child_1.ref();
1012             this.el.add (  child_1.el  );
1013         }
1014
1015         // user defined functions
1016     }
1017     public class Xcls_Button31 : Object
1018     {
1019         public Gtk.Button el;
1020         private Xcls_RooProjectSettings  _this;
1021
1022
1023             // my vars (def)
1024
1025         // ctor
1026         public Xcls_Button31(Xcls_RooProjectSettings _owner )
1027         {
1028             _this = _owner;
1029             this.el = new Gtk.Button();
1030
1031             // my vars (dec)
1032
1033             // set gobject values
1034             this.el.label = "Apply";
1035
1036             //listeners
1037             this.el.button_press_event.connect( () => {
1038                 _this.save();
1039                       
1040                 _this.buttonPressed("apply");
1041                     return false;
1042             });
1043         }
1044
1045         // user defined functions
1046     }
1047
1048     public class Xcls_Button32 : Object
1049     {
1050         public Gtk.Button el;
1051         private Xcls_RooProjectSettings  _this;
1052
1053
1054             // my vars (def)
1055
1056         // ctor
1057         public Xcls_Button32(Xcls_RooProjectSettings _owner )
1058         {
1059             _this = _owner;
1060             this.el = new Gtk.Button();
1061
1062             // my vars (dec)
1063
1064             // set gobject values
1065             this.el.label = "Save";
1066
1067             //listeners
1068             this.el.button_press_event.connect( () => {
1069                    _this.save();
1070                       
1071                 _this.buttonPressed("save");
1072                     return false;
1073             });
1074         }
1075
1076         // user defined functions
1077     }
1078
1079
1080
1081 }