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             this.el.margin = 3;
354         }
355
356         // user defined functions 
357     }
358     public class Xcls_base_template : Object 
359     {
360         public Gtk.Entry el;
361         private Xcls_ProjectSettings  _this;
362
363
364             // my vars (def)
365
366         // ctor 
367         public Xcls_base_template(Xcls_ProjectSettings _owner )
368         {
369             _this = _owner;
370             _this.base_template = this;
371             this.el = new Gtk.Entry();
372
373             // my vars (dec)
374
375             // set gobject values
376         }
377
378         // user defined functions 
379     }
380     public class Xcls_HBox13 : Object 
381     {
382         public Gtk.HBox el;
383         private Xcls_ProjectSettings  _this;
384
385
386             // my vars (def)
387
388         // ctor 
389         public Xcls_HBox13(Xcls_ProjectSettings _owner )
390         {
391             _this = _owner;
392             this.el = new Gtk.HBox( false, 0 );
393
394             // my vars (dec)
395
396             // set gobject values
397             this.el.expand = false;
398             var child_0 = new Xcls_Label14( _this );
399             child_0.ref();
400             this.el.pack_start (  child_0.el , false,false,0 );
401             var child_1 = new Xcls_rootURL( _this );
402             child_1.ref();
403             this.el.add (  child_1.el  );
404         }
405
406         // user defined functions 
407     }
408     public class Xcls_Label14 : Object 
409     {
410         public Gtk.Label el;
411         private Xcls_ProjectSettings  _this;
412
413
414             // my vars (def)
415
416         // ctor 
417         public Xcls_Label14(Xcls_ProjectSettings _owner )
418         {
419             _this = _owner;
420             this.el = new Gtk.Label( "root URL" );
421
422             // my vars (dec)
423
424             // set gobject values
425         }
426
427         // user defined functions 
428     }
429     public class Xcls_rootURL : Object 
430     {
431         public Gtk.Entry el;
432         private Xcls_ProjectSettings  _this;
433
434
435             // my vars (def)
436
437         // ctor 
438         public Xcls_rootURL(Xcls_ProjectSettings _owner )
439         {
440             _this = _owner;
441             _this.rootURL = this;
442             this.el = new Gtk.Entry();
443
444             // my vars (dec)
445
446             // set gobject values
447         }
448
449         // user defined functions 
450     }
451     public class Xcls_Label16 : Object 
452     {
453         public Gtk.Label el;
454         private Xcls_ProjectSettings  _this;
455
456
457             // my vars (def)
458
459         // ctor 
460         public Xcls_Label16(Xcls_ProjectSettings _owner )
461         {
462             _this = _owner;
463             this.el = new Gtk.Label( "HTML To insert at end of <HEAD>" );
464
465             // my vars (dec)
466
467             // set gobject values
468         }
469
470         // user defined functions 
471     }
472     public class Xcls_ScrolledWindow17 : Object 
473     {
474         public Gtk.ScrolledWindow el;
475         private Xcls_ProjectSettings  _this;
476
477
478             // my vars (def)
479
480         // ctor 
481         public Xcls_ScrolledWindow17(Xcls_ProjectSettings _owner )
482         {
483             _this = _owner;
484             this.el = new Gtk.ScrolledWindow( null, null );
485
486             // my vars (dec)
487
488             // set gobject values
489             var child_0 = new Xcls_view( _this );
490             child_0.ref();
491             this.el.add (  child_0.el  );
492         }
493
494         // user defined functions 
495     }
496     public class Xcls_view : Object 
497     {
498         public Gtk.SourceView el;
499         private Xcls_ProjectSettings  _this;
500
501
502             // my vars (def)
503
504         // ctor 
505         public Xcls_view(Xcls_ProjectSettings _owner )
506         {
507             _this = _owner;
508             _this.view = this;
509             this.el = new Gtk.SourceView();
510
511             // my vars (dec)
512
513             // set gobject values
514
515             // init method 
516
517             var description =   Pango.FontDescription.from_string("monospace");
518                 description.set_size(9000);
519                 this.el.override_font(description);
520
521             // listeners 
522             this.el.key_release_event.connect( ( event) =>{
523                 if (event.keyval != 115) {
524                     return false;
525                      
526                 }
527                 if   ( (event.state & Gdk.ModifierType.CONTROL_MASK ) < 1 ) {
528                     return false;
529                 }
530                  var buf =    this.el.get_buffer();
531                 Gtk.TextIter s;
532                 Gtk.TextIter e;
533                 buf.get_start_iter(out s);
534                 buf.get_end_iter(out e);
535                 _this.project.runhtml = buf.get_text(s,e,true);
536                 
537                       
538                 _this.buttonPressed("save");
539                  
540                 return false;
541                      
542             });
543         }
544
545         // user defined functions 
546     }
547     public class Xcls_VBox19 : Object 
548     {
549         public Gtk.VBox el;
550         private Xcls_ProjectSettings  _this;
551
552
553             // my vars (def)
554
555         // ctor 
556         public Xcls_VBox19(Xcls_ProjectSettings _owner )
557         {
558             _this = _owner;
559             this.el = new Gtk.VBox( false, 0 );
560
561             // my vars (dec)
562
563             // set gobject values
564             var child_0 = new Xcls_Label20( _this );
565             child_0.ref();
566             this.el.pack_start (  child_0.el , false,false,0 );
567             var child_1 = new Xcls_database_DBTYPE( _this );
568             child_1.ref();
569             this.el.pack_start (  child_1.el , false,false,0 );
570             var child_2 = new Xcls_Label22( _this );
571             child_2.ref();
572             this.el.pack_start (  child_2.el , false,false,0 );
573             var child_3 = new Xcls_database_DBTYPE( _this );
574             child_3.ref();
575             this.el.pack_start (  child_3.el , false,false,0 );
576             var child_4 = new Xcls_Label24( _this );
577             child_4.ref();
578             this.el.pack_start (  child_4.el , false,false,0 );
579             var child_5 = new Xcls_database_DBUSERNAME( _this );
580             child_5.ref();
581             this.el.pack_start (  child_5.el , false,false,0 );
582             var child_6 = new Xcls_Label26( _this );
583             child_6.ref();
584             this.el.pack_start (  child_6.el , false,false,0 );
585             var child_7 = new Xcls_database_DBPASSWORD( _this );
586             child_7.ref();
587             this.el.pack_start (  child_7.el , false,false,0 );
588             var child_8 = new Xcls_Button28( _this );
589             child_8.ref();
590             this.el.pack_start (  child_8.el , false,false,0 );
591         }
592
593         // user defined functions 
594     }
595     public class Xcls_Label20 : Object 
596     {
597         public Gtk.Label el;
598         private Xcls_ProjectSettings  _this;
599
600
601             // my vars (def)
602
603         // ctor 
604         public Xcls_Label20(Xcls_ProjectSettings _owner )
605         {
606             _this = _owner;
607             this.el = new Gtk.Label( "Type (eg. MySQL or PostgreSQL)" );
608
609             // my vars (dec)
610
611             // set gobject values
612             this.el.xalign = 0f;
613         }
614
615         // user defined functions 
616     }
617     public class Xcls_database_DBTYPE : Object 
618     {
619         public Gtk.Entry el;
620         private Xcls_ProjectSettings  _this;
621
622
623             // my vars (def)
624
625         // ctor 
626         public Xcls_database_DBTYPE(Xcls_ProjectSettings _owner )
627         {
628             _this = _owner;
629             _this.database_DBTYPE = this;
630             this.el = new Gtk.Entry();
631
632             // my vars (dec)
633
634             // set gobject values
635         }
636
637         // user defined functions 
638     }
639     public class Xcls_Label22 : Object 
640     {
641         public Gtk.Label el;
642         private Xcls_ProjectSettings  _this;
643
644
645             // my vars (def)
646
647         // ctor 
648         public Xcls_Label22(Xcls_ProjectSettings _owner )
649         {
650             _this = _owner;
651             this.el = new Gtk.Label( "Name" );
652
653             // my vars (dec)
654
655             // set gobject values
656             this.el.xalign = 0f;
657         }
658
659         // user defined functions 
660     }
661     public class Xcls_database_DBTYPE : Object 
662     {
663         public Gtk.Entry el;
664         private Xcls_ProjectSettings  _this;
665
666
667             // my vars (def)
668
669         // ctor 
670         public Xcls_database_DBTYPE(Xcls_ProjectSettings _owner )
671         {
672             _this = _owner;
673             _this.database_DBTYPE = this;
674             this.el = new Gtk.Entry();
675
676             // my vars (dec)
677
678             // set gobject values
679         }
680
681         // user defined functions 
682     }
683     public class Xcls_Label24 : Object 
684     {
685         public Gtk.Label el;
686         private Xcls_ProjectSettings  _this;
687
688
689             // my vars (def)
690
691         // ctor 
692         public Xcls_Label24(Xcls_ProjectSettings _owner )
693         {
694             _this = _owner;
695             this.el = new Gtk.Label( "Username" );
696
697             // my vars (dec)
698
699             // set gobject values
700             this.el.xalign = 0f;
701         }
702
703         // user defined functions 
704     }
705     public class Xcls_database_DBUSERNAME : Object 
706     {
707         public Gtk.Entry el;
708         private Xcls_ProjectSettings  _this;
709
710
711             // my vars (def)
712
713         // ctor 
714         public Xcls_database_DBUSERNAME(Xcls_ProjectSettings _owner )
715         {
716             _this = _owner;
717             _this.database_DBUSERNAME = this;
718             this.el = new Gtk.Entry();
719
720             // my vars (dec)
721
722             // set gobject values
723         }
724
725         // user defined functions 
726     }
727     public class Xcls_Label26 : Object 
728     {
729         public Gtk.Label el;
730         private Xcls_ProjectSettings  _this;
731
732
733             // my vars (def)
734
735         // ctor 
736         public Xcls_Label26(Xcls_ProjectSettings _owner )
737         {
738             _this = _owner;
739             this.el = new Gtk.Label( "Password" );
740
741             // my vars (dec)
742
743             // set gobject values
744             this.el.xalign = 0f;
745         }
746
747         // user defined functions 
748     }
749     public class Xcls_database_DBPASSWORD : Object 
750     {
751         public Gtk.Entry el;
752         private Xcls_ProjectSettings  _this;
753
754
755             // my vars (def)
756
757         // ctor 
758         public Xcls_database_DBPASSWORD(Xcls_ProjectSettings _owner )
759         {
760             _this = _owner;
761             _this.database_DBPASSWORD = this;
762             this.el = new Gtk.Entry();
763
764             // my vars (dec)
765
766             // set gobject values
767         }
768
769         // user defined functions 
770     }
771     public class Xcls_Button28 : Object 
772     {
773         public Gtk.Button el;
774         private Xcls_ProjectSettings  _this;
775
776
777             // my vars (def)
778
779         // ctor 
780         public Xcls_Button28(Xcls_ProjectSettings _owner )
781         {
782             _this = _owner;
783             this.el = new Gtk.Button();
784
785             // my vars (dec)
786
787             // set gobject values
788             this.el.label = "Check Connection";
789         }
790
791         // user defined functions 
792     }
793 }