src/Builder4/ProjectSettings.bjs
[app.Builder.js] / src / Builder4 / ProjectSettings.vala
1 static Xcls_ProjectSettings  _ProjectSettings;
2
3 public class Xcls_ProjectSettings : Object 
4 {
5     public Gtk.VBox el;
6     private Xcls_ProjectSettings  _this;
7
8     public static Xcls_ProjectSettings singleton()
9     {
10         if (_ProjectSettings == null) {
11             _ProjectSettings= new Xcls_ProjectSettings();
12         }
13         return _ProjectSettings;
14     }
15     public Xcls_label_global label_global;
16     public Xcls_label_database label_database;
17     public Xcls_path path;
18     public Xcls_base_template base_template;
19     public Xcls_rootURL rootURL;
20     public Xcls_view view;
21     public Xcls_database_DBTYPE database_DBTYPE;
22     public Xcls_database_DBTYPE database_DBTYPE;
23     public Xcls_database_DBUSERNAME database_DBUSERNAME;
24     public Xcls_database_DBPASSWORD database_DBPASSWORD;
25
26         // my vars (def)
27     public signal void buttonPressed (string btn);
28     public Project.Project project;
29
30     // ctor 
31     public Xcls_ProjectSettings()
32     {
33         _this = this;
34         this.el = new Gtk.VBox( false, 0 );
35
36         // my vars (dec)
37
38         // set gobject values
39         this.el.border_width = 5;
40         var child_0 = new Xcls_HBox2( _this );
41         child_0.ref();
42         this.el.pack_start (  child_0.el , false,false,0 );
43         var child_1 = new Xcls_Notebook5( _this );
44         child_1.ref();
45         this.el.pack_end (  child_1.el , true,true,0 );
46     }
47
48     // user defined functions 
49     public void show (Project.Project project) {
50         _this.project = project;
51         _this.path.el.label = project.firstPath();
52         // get the active project.
53          var lm = Gtk.SourceLanguageManager.get_default();
54                     
55         ((Gtk.SourceBuffer)(_this.view.el.get_buffer())) .set_language(
56         
57             lm.get_language("html"));
58       
59         //print (project.fn);
60         //project.runhtml = project.runhtml || '';
61         _this.view.el.get_buffer().set_text(project.runhtml);
62         
63            
64         _this.rootURL.el.set_text( _this.project.rootURL );
65         _this.base_template.el.set_text(_this.project.base_template);    
66        
67         
68         //this.el.show_all();
69     }
70     public void save ()
71     {
72        var buf =    _this.view.el.get_buffer();
73        Gtk.TextIter s;
74          Gtk.TextIter e;
75         buf.get_start_iter(out s);
76         buf.get_end_iter(out e);
77           _this.project.runhtml = buf.get_text(s,e,true);
78           
79         _this.project.rootURL = _this.rootURL.el.get_text();
80         _this.project.base_template = _this.base_template.el.get_text();    
81         
82         
83     }
84     public class Xcls_HBox2 : Object 
85     {
86         public Gtk.HBox el;
87         private Xcls_ProjectSettings  _this;
88
89
90             // my vars (def)
91
92         // ctor 
93         public Xcls_HBox2(Xcls_ProjectSettings _owner )
94         {
95             _this = _owner;
96             this.el = new Gtk.HBox( true, 0 );
97
98             // my vars (dec)
99
100             // set gobject values
101             this.el.expand = false;
102             this.el.vexpand = false;
103             var child_0 = new Xcls_Button3( _this );
104             child_0.ref();
105             this.el.add (  child_0.el  );
106             var child_1 = new Xcls_Button4( _this );
107             child_1.ref();
108             this.el.add (  child_1.el  );
109         }
110
111         // user defined functions 
112     }
113     public class Xcls_Button3 : Object 
114     {
115         public Gtk.Button el;
116         private Xcls_ProjectSettings  _this;
117
118
119             // my vars (def)
120
121         // ctor 
122         public Xcls_Button3(Xcls_ProjectSettings _owner )
123         {
124             _this = _owner;
125             this.el = new Gtk.Button();
126
127             // my vars (dec)
128
129             // set gobject values
130             this.el.label = "Apply";
131
132             // listeners 
133             this.el.button_press_event.connect( () => {
134                 _this.save();
135                       
136                 _this.buttonPressed("apply");
137                     return false;
138             });
139         }
140
141         // user defined functions 
142     }
143     public class Xcls_Button4 : Object 
144     {
145         public Gtk.Button el;
146         private Xcls_ProjectSettings  _this;
147
148
149             // my vars (def)
150
151         // ctor 
152         public Xcls_Button4(Xcls_ProjectSettings _owner )
153         {
154             _this = _owner;
155             this.el = new Gtk.Button();
156
157             // my vars (dec)
158
159             // set gobject values
160             this.el.label = "Save";
161
162             // listeners 
163             this.el.button_press_event.connect( () => {
164                    _this.save();
165                       
166                 _this.buttonPressed("save");
167                     return false;
168             });
169         }
170
171         // user defined functions 
172     }
173     public class Xcls_Notebook5 : Object 
174     {
175         public Gtk.Notebook el;
176         private Xcls_ProjectSettings  _this;
177
178
179             // my vars (def)
180
181         // ctor 
182         public Xcls_Notebook5(Xcls_ProjectSettings _owner )
183         {
184             _this = _owner;
185             this.el = new Gtk.Notebook();
186
187             // my vars (dec)
188
189             // set gobject values
190             var child_0 = new Xcls_label_global( _this );
191             child_0.ref();
192             var child_1 = new Xcls_label_database( _this );
193             child_1.ref();
194             var child_2 = new Xcls_VBox8( _this );
195             child_2.ref();
196             this.el.append_page (  child_2.el , _this.label_global.el );
197             var child_3 = new Xcls_VBox19( _this );
198             child_3.ref();
199             this.el.append_page (  child_3.el , _this.label_database.el );
200         }
201
202         // user defined functions 
203     }
204     public class Xcls_label_global : Object 
205     {
206         public Gtk.Label el;
207         private Xcls_ProjectSettings  _this;
208
209
210             // my vars (def)
211
212         // ctor 
213         public Xcls_label_global(Xcls_ProjectSettings _owner )
214         {
215             _this = _owner;
216             _this.label_global = this;
217             this.el = new Gtk.Label( "Global" );
218
219             // my vars (dec)
220
221             // set gobject values
222         }
223
224         // user defined functions 
225     }
226     public class Xcls_label_database : Object 
227     {
228         public Gtk.Label el;
229         private Xcls_ProjectSettings  _this;
230
231
232             // my vars (def)
233
234         // ctor 
235         public Xcls_label_database(Xcls_ProjectSettings _owner )
236         {
237             _this = _owner;
238             _this.label_database = this;
239             this.el = new Gtk.Label( "Database" );
240
241             // my vars (dec)
242
243             // set gobject values
244         }
245
246         // user defined functions 
247     }
248     public class Xcls_VBox8 : Object 
249     {
250         public Gtk.VBox el;
251         private Xcls_ProjectSettings  _this;
252
253
254             // my vars (def)
255
256         // ctor 
257         public Xcls_VBox8(Xcls_ProjectSettings _owner )
258         {
259             _this = _owner;
260             this.el = new Gtk.VBox( false, 0 );
261
262             // my vars (dec)
263
264             // set gobject values
265             var child_0 = new Xcls_path( _this );
266             child_0.ref();
267             this.el.pack_start (  child_0.el , false,false,0 );
268             var child_1 = new Xcls_HBox10( _this );
269             child_1.ref();
270             this.el.pack_start (  child_1.el , false,false,0 );
271             var child_2 = new Xcls_HBox13( _this );
272             child_2.ref();
273             this.el.pack_start (  child_2.el , false,false,0 );
274             var child_3 = new Xcls_Label16( _this );
275             child_3.ref();
276             this.el.pack_start (  child_3.el , false,false,0 );
277             var child_4 = new Xcls_ScrolledWindow17( _this );
278             child_4.ref();
279             this.el.pack_start (  child_4.el , true,true,0 );
280         }
281
282         // user defined functions 
283     }
284     public class Xcls_path : Object 
285     {
286         public Gtk.Label el;
287         private Xcls_ProjectSettings  _this;
288
289
290             // my vars (def)
291
292         // ctor 
293         public Xcls_path(Xcls_ProjectSettings _owner )
294         {
295             _this = _owner;
296             _this.path = this;
297             this.el = new Gtk.Label( "filename" );
298
299             // my vars (dec)
300
301             // set gobject values
302             this.el.margin = 3;
303             this.el.xalign = 0f;
304         }
305
306         // user defined functions 
307     }
308     public class Xcls_HBox10 : Object 
309     {
310         public Gtk.HBox el;
311         private Xcls_ProjectSettings  _this;
312
313
314             // my vars (def)
315
316         // ctor 
317         public Xcls_HBox10(Xcls_ProjectSettings _owner )
318         {
319             _this = _owner;
320             this.el = new Gtk.HBox( false, 0 );
321
322             // my vars (dec)
323
324             // set gobject values
325             this.el.expand = false;
326             var child_0 = new Xcls_Label11( _this );
327             child_0.ref();
328             this.el.pack_start (  child_0.el , false,false,0 );
329             var child_1 = new Xcls_base_template( _this );
330             child_1.ref();
331             this.el.add (  child_1.el  );
332         }
333
334         // user defined functions 
335     }
336     public class Xcls_Label11 : Object 
337     {
338         public Gtk.Label el;
339         private Xcls_ProjectSettings  _this;
340
341
342             // my vars (def)
343
344         // ctor 
345         public Xcls_Label11(Xcls_ProjectSettings _owner )
346         {
347             _this = _owner;
348             this.el = new Gtk.Label( "HTML template file" );
349
350             // my vars (dec)
351
352             // set gobject values
353         }
354
355         // user defined functions 
356     }
357     public class Xcls_base_template : Object 
358     {
359         public Gtk.Entry el;
360         private Xcls_ProjectSettings  _this;
361
362
363             // my vars (def)
364
365         // ctor 
366         public Xcls_base_template(Xcls_ProjectSettings _owner )
367         {
368             _this = _owner;
369             _this.base_template = this;
370             this.el = new Gtk.Entry();
371
372             // my vars (dec)
373
374             // set gobject values
375         }
376
377         // user defined functions 
378     }
379     public class Xcls_HBox13 : Object 
380     {
381         public Gtk.HBox el;
382         private Xcls_ProjectSettings  _this;
383
384
385             // my vars (def)
386
387         // ctor 
388         public Xcls_HBox13(Xcls_ProjectSettings _owner )
389         {
390             _this = _owner;
391             this.el = new Gtk.HBox( false, 0 );
392
393             // my vars (dec)
394
395             // set gobject values
396             this.el.expand = false;
397             var child_0 = new Xcls_Label14( _this );
398             child_0.ref();
399             this.el.pack_start (  child_0.el , false,false,0 );
400             var child_1 = new Xcls_rootURL( _this );
401             child_1.ref();
402             this.el.add (  child_1.el  );
403         }
404
405         // user defined functions 
406     }
407     public class Xcls_Label14 : Object 
408     {
409         public Gtk.Label el;
410         private Xcls_ProjectSettings  _this;
411
412
413             // my vars (def)
414
415         // ctor 
416         public Xcls_Label14(Xcls_ProjectSettings _owner )
417         {
418             _this = _owner;
419             this.el = new Gtk.Label( "root URL" );
420
421             // my vars (dec)
422
423             // set gobject values
424         }
425
426         // user defined functions 
427     }
428     public class Xcls_rootURL : Object 
429     {
430         public Gtk.Entry el;
431         private Xcls_ProjectSettings  _this;
432
433
434             // my vars (def)
435
436         // ctor 
437         public Xcls_rootURL(Xcls_ProjectSettings _owner )
438         {
439             _this = _owner;
440             _this.rootURL = this;
441             this.el = new Gtk.Entry();
442
443             // my vars (dec)
444
445             // set gobject values
446         }
447
448         // user defined functions 
449     }
450     public class Xcls_Label16 : Object 
451     {
452         public Gtk.Label el;
453         private Xcls_ProjectSettings  _this;
454
455
456             // my vars (def)
457
458         // ctor 
459         public Xcls_Label16(Xcls_ProjectSettings _owner )
460         {
461             _this = _owner;
462             this.el = new Gtk.Label( "HTML To insert at end of <HEAD>" );
463
464             // my vars (dec)
465
466             // set gobject values
467         }
468
469         // user defined functions 
470     }
471     public class Xcls_ScrolledWindow17 : Object 
472     {
473         public Gtk.ScrolledWindow el;
474         private Xcls_ProjectSettings  _this;
475
476
477             // my vars (def)
478
479         // ctor 
480         public Xcls_ScrolledWindow17(Xcls_ProjectSettings _owner )
481         {
482             _this = _owner;
483             this.el = new Gtk.ScrolledWindow( null, null );
484
485             // my vars (dec)
486
487             // set gobject values
488             var child_0 = new Xcls_view( _this );
489             child_0.ref();
490             this.el.add (  child_0.el  );
491         }
492
493         // user defined functions 
494     }
495     public class Xcls_view : Object 
496     {
497         public Gtk.SourceView el;
498         private Xcls_ProjectSettings  _this;
499
500
501             // my vars (def)
502
503         // ctor 
504         public Xcls_view(Xcls_ProjectSettings _owner )
505         {
506             _this = _owner;
507             _this.view = this;
508             this.el = new Gtk.SourceView();
509
510             // my vars (dec)
511
512             // set gobject values
513
514             // init method 
515
516             var description =   Pango.FontDescription.from_string("monospace");
517                 description.set_size(9000);
518                 this.el.override_font(description);
519
520             // listeners 
521             this.el.key_release_event.connect( ( event) =>{
522                 if (event.keyval != 115) {
523                     return false;
524                      
525                 }
526                 if   ( (event.state & Gdk.ModifierType.CONTROL_MASK ) < 1 ) {
527                     return false;
528                 }
529                  var buf =    this.el.get_buffer();
530                 Gtk.TextIter s;
531                 Gtk.TextIter e;
532                 buf.get_start_iter(out s);
533                 buf.get_end_iter(out e);
534                 _this.project.runhtml = buf.get_text(s,e,true);
535                 
536                       
537                 _this.buttonPressed("save");
538                  
539                 return false;
540                      
541             });
542         }
543
544         // user defined functions 
545     }
546     public class Xcls_VBox19 : Object 
547     {
548         public Gtk.VBox el;
549         private Xcls_ProjectSettings  _this;
550
551
552             // my vars (def)
553
554         // ctor 
555         public Xcls_VBox19(Xcls_ProjectSettings _owner )
556         {
557             _this = _owner;
558             this.el = new Gtk.VBox( false, 0 );
559
560             // my vars (dec)
561
562             // set gobject values
563             var child_0 = new Xcls_Label20( _this );
564             child_0.ref();
565             this.el.pack_start (  child_0.el , false,false,0 );
566             var child_1 = new Xcls_database_DBTYPE( _this );
567             child_1.ref();
568             this.el.pack_start (  child_1.el , false,false,0 );
569             var child_2 = new Xcls_Label22( _this );
570             child_2.ref();
571             this.el.pack_start (  child_2.el , false,false,0 );
572             var child_3 = new Xcls_database_DBTYPE( _this );
573             child_3.ref();
574             this.el.pack_start (  child_3.el , false,false,0 );
575             var child_4 = new Xcls_Label24( _this );
576             child_4.ref();
577             this.el.pack_start (  child_4.el , false,false,0 );
578             var child_5 = new Xcls_database_DBUSERNAME( _this );
579             child_5.ref();
580             this.el.pack_start (  child_5.el , false,false,0 );
581             var child_6 = new Xcls_Label26( _this );
582             child_6.ref();
583             this.el.pack_start (  child_6.el , false,false,0 );
584             var child_7 = new Xcls_database_DBPASSWORD( _this );
585             child_7.ref();
586             this.el.pack_start (  child_7.el , false,false,0 );
587             var child_8 = new Xcls_Button28( _this );
588             child_8.ref();
589             this.el.pack_start (  child_8.el , false,false,0 );
590         }
591
592         // user defined functions 
593     }
594     public class Xcls_Label20 : Object 
595     {
596         public Gtk.Label el;
597         private Xcls_ProjectSettings  _this;
598
599
600             // my vars (def)
601
602         // ctor 
603         public Xcls_Label20(Xcls_ProjectSettings _owner )
604         {
605             _this = _owner;
606             this.el = new Gtk.Label( "Type (eg. MySQL or PostgreSQL)" );
607
608             // my vars (dec)
609
610             // set gobject values
611             this.el.xalign = 0f;
612         }
613
614         // user defined functions 
615     }
616     public class Xcls_database_DBTYPE : Object 
617     {
618         public Gtk.Entry el;
619         private Xcls_ProjectSettings  _this;
620
621
622             // my vars (def)
623
624         // ctor 
625         public Xcls_database_DBTYPE(Xcls_ProjectSettings _owner )
626         {
627             _this = _owner;
628             _this.database_DBTYPE = this;
629             this.el = new Gtk.Entry();
630
631             // my vars (dec)
632
633             // set gobject values
634         }
635
636         // user defined functions 
637     }
638     public class Xcls_Label22 : Object 
639     {
640         public Gtk.Label el;
641         private Xcls_ProjectSettings  _this;
642
643
644             // my vars (def)
645
646         // ctor 
647         public Xcls_Label22(Xcls_ProjectSettings _owner )
648         {
649             _this = _owner;
650             this.el = new Gtk.Label( "Name" );
651
652             // my vars (dec)
653
654             // set gobject values
655             this.el.xalign = 0f;
656         }
657
658         // user defined functions 
659     }
660     public class Xcls_database_DBTYPE : Object 
661     {
662         public Gtk.Entry el;
663         private Xcls_ProjectSettings  _this;
664
665
666             // my vars (def)
667
668         // ctor 
669         public Xcls_database_DBTYPE(Xcls_ProjectSettings _owner )
670         {
671             _this = _owner;
672             _this.database_DBTYPE = this;
673             this.el = new Gtk.Entry();
674
675             // my vars (dec)
676
677             // set gobject values
678         }
679
680         // user defined functions 
681     }
682     public class Xcls_Label24 : Object 
683     {
684         public Gtk.Label el;
685         private Xcls_ProjectSettings  _this;
686
687
688             // my vars (def)
689
690         // ctor 
691         public Xcls_Label24(Xcls_ProjectSettings _owner )
692         {
693             _this = _owner;
694             this.el = new Gtk.Label( "Username" );
695
696             // my vars (dec)
697
698             // set gobject values
699             this.el.xalign = 0f;
700         }
701
702         // user defined functions 
703     }
704     public class Xcls_database_DBUSERNAME : Object 
705     {
706         public Gtk.Entry el;
707         private Xcls_ProjectSettings  _this;
708
709
710             // my vars (def)
711
712         // ctor 
713         public Xcls_database_DBUSERNAME(Xcls_ProjectSettings _owner )
714         {
715             _this = _owner;
716             _this.database_DBUSERNAME = this;
717             this.el = new Gtk.Entry();
718
719             // my vars (dec)
720
721             // set gobject values
722         }
723
724         // user defined functions 
725     }
726     public class Xcls_Label26 : Object 
727     {
728         public Gtk.Label el;
729         private Xcls_ProjectSettings  _this;
730
731
732             // my vars (def)
733
734         // ctor 
735         public Xcls_Label26(Xcls_ProjectSettings _owner )
736         {
737             _this = _owner;
738             this.el = new Gtk.Label( "Password" );
739
740             // my vars (dec)
741
742             // set gobject values
743             this.el.xalign = 0f;
744         }
745
746         // user defined functions 
747     }
748     public class Xcls_database_DBPASSWORD : Object 
749     {
750         public Gtk.Entry el;
751         private Xcls_ProjectSettings  _this;
752
753
754             // my vars (def)
755
756         // ctor 
757         public Xcls_database_DBPASSWORD(Xcls_ProjectSettings _owner )
758         {
759             _this = _owner;
760             _this.database_DBPASSWORD = this;
761             this.el = new Gtk.Entry();
762
763             // my vars (dec)
764
765             // set gobject values
766         }
767
768         // user defined functions 
769     }
770     public class Xcls_Button28 : Object 
771     {
772         public Gtk.Button el;
773         private Xcls_ProjectSettings  _this;
774
775
776             // my vars (def)
777
778         // ctor 
779         public Xcls_Button28(Xcls_ProjectSettings _owner )
780         {
781             _this = _owner;
782             this.el = new Gtk.Button();
783
784             // my vars (dec)
785
786             // set gobject values
787             this.el.label = "Check Connection";
788         }
789
790         // user defined functions 
791     }
792 }