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