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