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