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