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         // 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( 2, 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         
442         
443             el.append(out iter);
444             el.set_value(iter, 0, "bootstrap.builder.html");
445             if (cur == "bootstrap.builder.html") {
446                    _this.base_template.el.set_active_iter(iter);
447            }
448         
449                 el.append(out iter);
450             el.set_value(iter, 0, "mailer.builder.html");
451         
452                 if (cur == "mailer.builder.html") {
453                     _this.base_template.el.set_active_iter(iter);
454             }
455         
456                                              
457         }
458     }
459
460
461
462     public class Xcls_Box13 : Object
463     {
464         public Gtk.Box el;
465         private Xcls_RooProjectSettings  _this;
466
467
468             // my vars (def)
469
470         // ctor
471         public Xcls_Box13(Xcls_RooProjectSettings _owner )
472         {
473             _this = _owner;
474             this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
475
476             // my vars (dec)
477
478             // set gobject values
479             this.el.homogeneous = false;
480             this.el.expand = false;
481             var child_0 = new Xcls_Label14( _this );
482             child_0.ref();
483             this.el.pack_start (  child_0.el , false,false,0 );
484             var child_1 = new Xcls_rootURL( _this );
485             child_1.ref();
486             this.el.add (  child_1.el  );
487         }
488
489         // user defined functions
490     }
491     public class Xcls_Label14 : Object
492     {
493         public Gtk.Label el;
494         private Xcls_RooProjectSettings  _this;
495
496
497             // my vars (def)
498
499         // ctor
500         public Xcls_Label14(Xcls_RooProjectSettings _owner )
501         {
502             _this = _owner;
503             this.el = new Gtk.Label( "root URL" );
504
505             // my vars (dec)
506
507             // set gobject values
508             this.el.margin = 3;
509         }
510
511         // user defined functions
512     }
513
514     public class Xcls_rootURL : Object
515     {
516         public Gtk.Entry el;
517         private Xcls_RooProjectSettings  _this;
518
519
520             // my vars (def)
521
522         // ctor
523         public Xcls_rootURL(Xcls_RooProjectSettings _owner )
524         {
525             _this = _owner;
526             _this.rootURL = this;
527             this.el = new Gtk.Entry();
528
529             // my vars (dec)
530
531             // set gobject values
532         }
533
534         // user defined functions
535     }
536
537
538     public class Xcls_Label16 : Object
539     {
540         public Gtk.Label el;
541         private Xcls_RooProjectSettings  _this;
542
543
544             // my vars (def)
545
546         // ctor
547         public Xcls_Label16(Xcls_RooProjectSettings _owner )
548         {
549             _this = _owner;
550             this.el = new Gtk.Label( "HTML To insert at end of <HEAD>" );
551
552             // my vars (dec)
553
554             // set gobject values
555         }
556
557         // user defined functions
558     }
559
560     public class Xcls_ScrolledWindow17 : Object
561     {
562         public Gtk.ScrolledWindow el;
563         private Xcls_RooProjectSettings  _this;
564
565
566             // my vars (def)
567
568         // ctor
569         public Xcls_ScrolledWindow17(Xcls_RooProjectSettings _owner )
570         {
571             _this = _owner;
572             this.el = new Gtk.ScrolledWindow( null, null );
573
574             // my vars (dec)
575
576             // set gobject values
577             var child_0 = new Xcls_view( _this );
578             child_0.ref();
579             this.el.add (  child_0.el  );
580         }
581
582         // user defined functions
583     }
584     public class Xcls_view : Object
585     {
586         public Gtk.SourceView el;
587         private Xcls_RooProjectSettings  _this;
588
589
590             // my vars (def)
591
592         // ctor
593         public Xcls_view(Xcls_RooProjectSettings _owner )
594         {
595             _this = _owner;
596             _this.view = this;
597             this.el = new Gtk.SourceView();
598
599             // my vars (dec)
600
601             // init method
602
603             var description =   Pango.FontDescription.from_string("monospace");
604                 description.set_size(9000);
605                 this.el.override_font(description);
606
607             //listeners
608             this.el.key_release_event.connect( ( event) =>{
609                 if (event.keyval != 115) {
610                     return false;
611                      
612                 }
613                 if   ( (event.state & Gdk.ModifierType.CONTROL_MASK ) < 1 ) {
614                     return false;
615                 }
616                  var buf =    this.el.get_buffer();
617                 Gtk.TextIter s;
618                 Gtk.TextIter e;
619                 buf.get_start_iter(out s);
620                 buf.get_end_iter(out e);
621                 _this.project.runhtml = buf.get_text(s,e,true);
622                 
623                       
624                 _this.buttonPressed("save");
625                  
626                 return false;
627                      
628             });
629         }
630
631         // user defined functions
632     }
633
634
635
636     public class Xcls_Box19 : Object
637     {
638         public Gtk.Box el;
639         private Xcls_RooProjectSettings  _this;
640
641
642             // my vars (def)
643
644         // ctor
645         public Xcls_Box19(Xcls_RooProjectSettings _owner )
646         {
647             _this = _owner;
648             this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
649
650             // my vars (dec)
651
652             // set gobject values
653             this.el.homogeneous = false;
654             var child_0 = new Xcls_Label20( _this );
655             child_0.ref();
656             this.el.pack_start (  child_0.el , false,false,0 );
657             var child_1 = new Xcls_database_DBTYPE( _this );
658             child_1.ref();
659             this.el.pack_start (  child_1.el , false,false,0 );
660             var child_2 = new Xcls_Label22( _this );
661             child_2.ref();
662             this.el.pack_start (  child_2.el , false,false,0 );
663             var child_3 = new Xcls_database_DBNAME( _this );
664             child_3.ref();
665             this.el.pack_start (  child_3.el , false,false,0 );
666             var child_4 = new Xcls_Label24( _this );
667             child_4.ref();
668             this.el.pack_start (  child_4.el , false,false,0 );
669             var child_5 = new Xcls_database_DBUSERNAME( _this );
670             child_5.ref();
671             this.el.pack_start (  child_5.el , false,false,0 );
672             var child_6 = new Xcls_Label26( _this );
673             child_6.ref();
674             this.el.pack_start (  child_6.el , false,false,0 );
675             var child_7 = new Xcls_database_DBPASSWORD( _this );
676             child_7.ref();
677             this.el.pack_start (  child_7.el , false,false,0 );
678             var child_8 = new Xcls_Button28( _this );
679             child_8.ref();
680             this.el.pack_start (  child_8.el , false,false,0 );
681             var child_9 = new Xcls_database_ERROR( _this );
682             child_9.ref();
683             this.el.pack_start (  child_9.el , false,false,0 );
684         }
685
686         // user defined functions
687     }
688     public class Xcls_Label20 : Object
689     {
690         public Gtk.Label el;
691         private Xcls_RooProjectSettings  _this;
692
693
694             // my vars (def)
695
696         // ctor
697         public Xcls_Label20(Xcls_RooProjectSettings _owner )
698         {
699             _this = _owner;
700             this.el = new Gtk.Label( "Type (eg. MySQL or PostgreSQL)" );
701
702             // my vars (dec)
703
704             // set gobject values
705             this.el.xalign = 0f;
706         }
707
708         // user defined functions
709     }
710
711     public class Xcls_database_DBTYPE : Object
712     {
713         public Gtk.Entry el;
714         private Xcls_RooProjectSettings  _this;
715
716
717             // my vars (def)
718
719         // ctor
720         public Xcls_database_DBTYPE(Xcls_RooProjectSettings _owner )
721         {
722             _this = _owner;
723             _this.database_DBTYPE = this;
724             this.el = new Gtk.Entry();
725
726             // my vars (dec)
727
728             // set gobject values
729
730             //listeners
731             this.el.key_press_event.connect( (ev) => {
732             
733                 if (ev.keyval == Gdk.Key.Tab) {
734                     _this.database_DBNAME.el.grab_focus();
735                     return true;
736                 }
737             
738             
739                 return false;
740             });
741         }
742
743         // user defined functions
744     }
745
746     public class Xcls_Label22 : Object
747     {
748         public Gtk.Label el;
749         private Xcls_RooProjectSettings  _this;
750
751
752             // my vars (def)
753
754         // ctor
755         public Xcls_Label22(Xcls_RooProjectSettings _owner )
756         {
757             _this = _owner;
758             this.el = new Gtk.Label( "Name" );
759
760             // my vars (dec)
761
762             // set gobject values
763             this.el.xalign = 0f;
764         }
765
766         // user defined functions
767     }
768
769     public class Xcls_database_DBNAME : Object
770     {
771         public Gtk.Entry el;
772         private Xcls_RooProjectSettings  _this;
773
774
775             // my vars (def)
776
777         // ctor
778         public Xcls_database_DBNAME(Xcls_RooProjectSettings _owner )
779         {
780             _this = _owner;
781             _this.database_DBNAME = this;
782             this.el = new Gtk.Entry();
783
784             // my vars (dec)
785
786             // set gobject values
787
788             //listeners
789             this.el.key_press_event.connect( (ev) => {
790             
791                 if (ev.keyval == Gdk.Key.Tab) {
792                     _this.database_DBUSERNAME.el.grab_focus();
793                     return true;
794                 }
795             
796             
797                 return false;
798             });
799         }
800
801         // user defined functions
802     }
803
804     public class Xcls_Label24 : Object
805     {
806         public Gtk.Label el;
807         private Xcls_RooProjectSettings  _this;
808
809
810             // my vars (def)
811
812         // ctor
813         public Xcls_Label24(Xcls_RooProjectSettings _owner )
814         {
815             _this = _owner;
816             this.el = new Gtk.Label( "Username" );
817
818             // my vars (dec)
819
820             // set gobject values
821             this.el.xalign = 0f;
822         }
823
824         // user defined functions
825     }
826
827     public class Xcls_database_DBUSERNAME : Object
828     {
829         public Gtk.Entry el;
830         private Xcls_RooProjectSettings  _this;
831
832
833             // my vars (def)
834
835         // ctor
836         public Xcls_database_DBUSERNAME(Xcls_RooProjectSettings _owner )
837         {
838             _this = _owner;
839             _this.database_DBUSERNAME = this;
840             this.el = new Gtk.Entry();
841
842             // my vars (dec)
843
844             // set gobject values
845
846             //listeners
847             this.el.key_press_event.connect( (ev) => {
848             
849                 if (ev.keyval == Gdk.Key.Tab) {
850                     _this.database_DBPASSWORD.el.grab_focus();
851                     return true;
852                 }
853             
854             
855                 return false;
856             });
857         }
858
859         // user defined functions
860     }
861
862     public class Xcls_Label26 : Object
863     {
864         public Gtk.Label el;
865         private Xcls_RooProjectSettings  _this;
866
867
868             // my vars (def)
869
870         // ctor
871         public Xcls_Label26(Xcls_RooProjectSettings _owner )
872         {
873             _this = _owner;
874             this.el = new Gtk.Label( "Password" );
875
876             // my vars (dec)
877
878             // set gobject values
879             this.el.xalign = 0f;
880         }
881
882         // user defined functions
883     }
884
885     public class Xcls_database_DBPASSWORD : Object
886     {
887         public Gtk.Entry el;
888         private Xcls_RooProjectSettings  _this;
889
890
891             // my vars (def)
892
893         // ctor
894         public Xcls_database_DBPASSWORD(Xcls_RooProjectSettings _owner )
895         {
896             _this = _owner;
897             _this.database_DBPASSWORD = this;
898             this.el = new Gtk.Entry();
899
900             // my vars (dec)
901
902             // set gobject values
903         }
904
905         // user defined functions
906     }
907
908     public class Xcls_Button28 : Object
909     {
910         public Gtk.Button el;
911         private Xcls_RooProjectSettings  _this;
912
913
914             // my vars (def)
915
916         // ctor
917         public Xcls_Button28(Xcls_RooProjectSettings _owner )
918         {
919             _this = _owner;
920             this.el = new Gtk.Button();
921
922             // my vars (dec)
923
924             // set gobject values
925             this.el.label = "Check Connection";
926
927             //listeners
928             this.el.clicked.connect( () => {
929             
930             
931               _this.database_ERROR.el.label    = "";
932                 Gda.Connection cnc;
933                 try {
934                     // assumes localhost...
935                      cnc = Gda.Connection.open_from_string (
936                                 _this.database_DBTYPE.el.get_text(),
937                                 "DB_NAME=" + _this.database_DBNAME.el.get_text(), 
938                                 "USERNAME=" + _this.database_DBUSERNAME.el.get_text() + 
939                                 ";PASSWORD=" + _this.database_DBPASSWORD.el.get_text(),
940                                 Gda.ConnectionOptions.NONE
941                         );
942                //} catch (Gda.ConnectionError ce) { 
943                //   _this.database_ERROR.el.label = ce.message;        
944                } catch(Gda.ConnectionError ue) {
945                   _this.database_ERROR.el.label = ue.message;
946                     return;
947                }  catch(Gda.ConfigError ue) {
948                   _this.database_ERROR.el.label = ue.message;
949                     return;
950                }
951               _this.database_ERROR.el.label = "Connection Succeeded";
952                cnc.close();
953             });
954         }
955
956         // user defined functions
957     }
958
959     public class Xcls_database_ERROR : Object
960     {
961         public Gtk.Label el;
962         private Xcls_RooProjectSettings  _this;
963
964
965             // my vars (def)
966
967         // ctor
968         public Xcls_database_ERROR(Xcls_RooProjectSettings _owner )
969         {
970             _this = _owner;
971             _this.database_ERROR = this;
972             this.el = new Gtk.Label( " " );
973
974             // my vars (dec)
975
976             // set gobject values
977             this.el.margin = 3;
978             this.el.xalign = 0f;
979         }
980
981         // user defined functions
982     }
983
984
985
986     public class Xcls_Box30 : Object
987     {
988         public Gtk.Box el;
989         private Xcls_RooProjectSettings  _this;
990
991
992             // my vars (def)
993
994         // ctor
995         public Xcls_Box30(Xcls_RooProjectSettings _owner )
996         {
997             _this = _owner;
998             this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
999
1000             // my vars (dec)
1001
1002             // set gobject values
1003             this.el.homogeneous = true;
1004             this.el.expand = false;
1005             this.el.vexpand = false;
1006             var child_0 = new Xcls_Button31( _this );
1007             child_0.ref();
1008             this.el.add (  child_0.el  );
1009             var child_1 = new Xcls_Button32( _this );
1010             child_1.ref();
1011             this.el.add (  child_1.el  );
1012         }
1013
1014         // user defined functions
1015     }
1016     public class Xcls_Button31 : Object
1017     {
1018         public Gtk.Button el;
1019         private Xcls_RooProjectSettings  _this;
1020
1021
1022             // my vars (def)
1023
1024         // ctor
1025         public Xcls_Button31(Xcls_RooProjectSettings _owner )
1026         {
1027             _this = _owner;
1028             this.el = new Gtk.Button();
1029
1030             // my vars (dec)
1031
1032             // set gobject values
1033             this.el.label = "Apply";
1034
1035             //listeners
1036             this.el.button_press_event.connect( () => {
1037                 _this.save();
1038                       
1039                 _this.buttonPressed("apply");
1040                     return false;
1041             });
1042         }
1043
1044         // user defined functions
1045     }
1046
1047     public class Xcls_Button32 : Object
1048     {
1049         public Gtk.Button el;
1050         private Xcls_RooProjectSettings  _this;
1051
1052
1053             // my vars (def)
1054
1055         // ctor
1056         public Xcls_Button32(Xcls_RooProjectSettings _owner )
1057         {
1058             _this = _owner;
1059             this.el = new Gtk.Button();
1060
1061             // my vars (dec)
1062
1063             // set gobject values
1064             this.el.label = "Save";
1065
1066             //listeners
1067             this.el.button_press_event.connect( () => {
1068                    _this.save();
1069                       
1070                 _this.buttonPressed("save");
1071                     return false;
1072             });
1073         }
1074
1075         // user defined functions
1076     }
1077
1078
1079
1080 }