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