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