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