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