1 static Xcls_ProjectSettings _ProjectSettings;
3 public class Xcls_ProjectSettings : Object
6 private Xcls_ProjectSettings _this;
8 public static Xcls_ProjectSettings singleton()
10 if (_ProjectSettings == null) {
11 _ProjectSettings= new Xcls_ProjectSettings();
13 return _ProjectSettings;
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;
27 public signal void buttonPressed (string btn);
28 public Project.Project project;
31 public Xcls_ProjectSettings()
34 this.el = new Gtk.VBox( false, 0 );
39 this.el.border_width = 5;
40 var child_0 = new Xcls_HBox2( _this );
42 this.el.pack_start ( child_0.el , false,false,0 );
43 var child_1 = new Xcls_Notebook5( _this );
45 this.el.pack_end ( child_1.el , true,true,0 );
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();
55 ((Gtk.SourceBuffer)(_this.view.el.get_buffer())) .set_language(
57 lm.get_language("html"));
60 //project.runhtml = project.runhtml || '';
61 _this.view.el.get_buffer().set_text(project.runhtml);
64 _this.rootURL.el.set_text( _this.project.rootURL );
65 _this.base_template.el.set_text(_this.project.base_template);
72 var buf = _this.view.el.get_buffer();
75 buf.get_start_iter(out s);
76 buf.get_end_iter(out e);
77 _this.project.runhtml = buf.get_text(s,e,true);
79 _this.project.rootURL = _this.rootURL.el.get_text();
80 _this.project.base_template = _this.base_template.el.get_text();
84 public class Xcls_HBox2 : Object
87 private Xcls_ProjectSettings _this;
93 public Xcls_HBox2(Xcls_ProjectSettings _owner )
96 this.el = new Gtk.HBox( true, 0 );
100 // set gobject values
101 this.el.expand = false;
102 this.el.vexpand = false;
103 var child_0 = new Xcls_Button3( _this );
105 this.el.add ( child_0.el );
106 var child_1 = new Xcls_Button4( _this );
108 this.el.add ( child_1.el );
111 // user defined functions
113 public class Xcls_Button3 : Object
115 public Gtk.Button el;
116 private Xcls_ProjectSettings _this;
122 public Xcls_Button3(Xcls_ProjectSettings _owner )
125 this.el = new Gtk.Button();
129 // set gobject values
130 this.el.label = "Apply";
133 this.el.button_press_event.connect( () => {
136 _this.buttonPressed("apply");
141 // user defined functions
143 public class Xcls_Button4 : Object
145 public Gtk.Button el;
146 private Xcls_ProjectSettings _this;
152 public Xcls_Button4(Xcls_ProjectSettings _owner )
155 this.el = new Gtk.Button();
159 // set gobject values
160 this.el.label = "Save";
163 this.el.button_press_event.connect( () => {
166 _this.buttonPressed("save");
171 // user defined functions
173 public class Xcls_Notebook5 : Object
175 public Gtk.Notebook el;
176 private Xcls_ProjectSettings _this;
182 public Xcls_Notebook5(Xcls_ProjectSettings _owner )
185 this.el = new Gtk.Notebook();
189 // set gobject values
190 var child_0 = new Xcls_label_global( _this );
192 var child_1 = new Xcls_label_database( _this );
194 var child_2 = new Xcls_VBox8( _this );
196 this.el.append_page ( child_2.el , _this.label_global.el );
197 var child_3 = new Xcls_VBox19( _this );
199 this.el.append_page ( child_3.el , _this.label_database.el );
202 // user defined functions
204 public class Xcls_label_global : Object
207 private Xcls_ProjectSettings _this;
213 public Xcls_label_global(Xcls_ProjectSettings _owner )
216 _this.label_global = this;
217 this.el = new Gtk.Label( "Global" );
221 // set gobject values
224 // user defined functions
226 public class Xcls_label_database : Object
229 private Xcls_ProjectSettings _this;
235 public Xcls_label_database(Xcls_ProjectSettings _owner )
238 _this.label_database = this;
239 this.el = new Gtk.Label( "Database" );
243 // set gobject values
246 // user defined functions
248 public class Xcls_VBox8 : Object
251 private Xcls_ProjectSettings _this;
257 public Xcls_VBox8(Xcls_ProjectSettings _owner )
260 this.el = new Gtk.VBox( false, 0 );
264 // set gobject values
265 var child_0 = new Xcls_path( _this );
267 this.el.pack_start ( child_0.el , false,false,0 );
268 var child_1 = new Xcls_HBox10( _this );
270 this.el.pack_start ( child_1.el , false,false,0 );
271 var child_2 = new Xcls_HBox13( _this );
273 this.el.pack_start ( child_2.el , false,false,0 );
274 var child_3 = new Xcls_Label16( _this );
276 this.el.pack_start ( child_3.el , false,false,0 );
277 var child_4 = new Xcls_ScrolledWindow17( _this );
279 this.el.pack_start ( child_4.el , true,true,0 );
282 // user defined functions
284 public class Xcls_path : Object
287 private Xcls_ProjectSettings _this;
293 public Xcls_path(Xcls_ProjectSettings _owner )
297 this.el = new Gtk.Label( "filename" );
301 // set gobject values
306 // user defined functions
308 public class Xcls_HBox10 : Object
311 private Xcls_ProjectSettings _this;
317 public Xcls_HBox10(Xcls_ProjectSettings _owner )
320 this.el = new Gtk.HBox( false, 0 );
324 // set gobject values
325 this.el.expand = false;
326 var child_0 = new Xcls_Label11( _this );
328 this.el.pack_start ( child_0.el , false,false,0 );
329 var child_1 = new Xcls_base_template( _this );
331 this.el.add ( child_1.el );
334 // user defined functions
336 public class Xcls_Label11 : Object
339 private Xcls_ProjectSettings _this;
345 public Xcls_Label11(Xcls_ProjectSettings _owner )
348 this.el = new Gtk.Label( "HTML template file" );
352 // set gobject values
355 // user defined functions
357 public class Xcls_base_template : Object
360 private Xcls_ProjectSettings _this;
366 public Xcls_base_template(Xcls_ProjectSettings _owner )
369 _this.base_template = this;
370 this.el = new Gtk.Entry();
374 // set gobject values
377 // user defined functions
379 public class Xcls_HBox13 : Object
382 private Xcls_ProjectSettings _this;
388 public Xcls_HBox13(Xcls_ProjectSettings _owner )
391 this.el = new Gtk.HBox( false, 0 );
395 // set gobject values
396 this.el.expand = false;
397 var child_0 = new Xcls_Label14( _this );
399 this.el.pack_start ( child_0.el , false,false,0 );
400 var child_1 = new Xcls_rootURL( _this );
402 this.el.add ( child_1.el );
405 // user defined functions
407 public class Xcls_Label14 : Object
410 private Xcls_ProjectSettings _this;
416 public Xcls_Label14(Xcls_ProjectSettings _owner )
419 this.el = new Gtk.Label( "root URL" );
423 // set gobject values
426 // user defined functions
428 public class Xcls_rootURL : Object
431 private Xcls_ProjectSettings _this;
437 public Xcls_rootURL(Xcls_ProjectSettings _owner )
440 _this.rootURL = this;
441 this.el = new Gtk.Entry();
445 // set gobject values
448 // user defined functions
450 public class Xcls_Label16 : Object
453 private Xcls_ProjectSettings _this;
459 public Xcls_Label16(Xcls_ProjectSettings _owner )
462 this.el = new Gtk.Label( "HTML To insert at end of <HEAD>" );
466 // set gobject values
469 // user defined functions
471 public class Xcls_ScrolledWindow17 : Object
473 public Gtk.ScrolledWindow el;
474 private Xcls_ProjectSettings _this;
480 public Xcls_ScrolledWindow17(Xcls_ProjectSettings _owner )
483 this.el = new Gtk.ScrolledWindow( null, null );
487 // set gobject values
488 var child_0 = new Xcls_view( _this );
490 this.el.add ( child_0.el );
493 // user defined functions
495 public class Xcls_view : Object
497 public Gtk.SourceView el;
498 private Xcls_ProjectSettings _this;
504 public Xcls_view(Xcls_ProjectSettings _owner )
508 this.el = new Gtk.SourceView();
512 // set gobject values
516 var description = Pango.FontDescription.from_string("monospace");
517 description.set_size(9000);
518 this.el.override_font(description);
521 this.el.key_release_event.connect( ( event) =>{
522 if (event.keyval != 115) {
526 if ( (event.state & Gdk.ModifierType.CONTROL_MASK ) < 1 ) {
529 var buf = this.el.get_buffer();
532 buf.get_start_iter(out s);
533 buf.get_end_iter(out e);
534 _this.project.runhtml = buf.get_text(s,e,true);
537 _this.buttonPressed("save");
544 // user defined functions
546 public class Xcls_VBox19 : Object
549 private Xcls_ProjectSettings _this;
555 public Xcls_VBox19(Xcls_ProjectSettings _owner )
558 this.el = new Gtk.VBox( false, 0 );
562 // set gobject values
563 var child_0 = new Xcls_Label20( _this );
565 this.el.pack_start ( child_0.el , false,false,0 );
566 var child_1 = new Xcls_database_DBTYPE( _this );
568 this.el.pack_start ( child_1.el , false,false,0 );
569 var child_2 = new Xcls_Label22( _this );
571 this.el.pack_start ( child_2.el , false,false,0 );
572 var child_3 = new Xcls_database_DBTYPE( _this );
574 this.el.pack_start ( child_3.el , false,false,0 );
575 var child_4 = new Xcls_Label24( _this );
577 this.el.pack_start ( child_4.el , false,false,0 );
578 var child_5 = new Xcls_database_DBUSERNAME( _this );
580 this.el.pack_start ( child_5.el , false,false,0 );
581 var child_6 = new Xcls_Label26( _this );
583 this.el.pack_start ( child_6.el , false,false,0 );
584 var child_7 = new Xcls_database_DBPASSWORD( _this );
586 this.el.pack_start ( child_7.el , false,false,0 );
587 var child_8 = new Xcls_Button28( _this );
589 this.el.pack_start ( child_8.el , false,false,0 );
592 // user defined functions
594 public class Xcls_Label20 : Object
597 private Xcls_ProjectSettings _this;
603 public Xcls_Label20(Xcls_ProjectSettings _owner )
606 this.el = new Gtk.Label( "Type (eg. MySQL or PostgreSQL)" );
610 // set gobject values
614 // user defined functions
616 public class Xcls_database_DBTYPE : Object
619 private Xcls_ProjectSettings _this;
625 public Xcls_database_DBTYPE(Xcls_ProjectSettings _owner )
628 _this.database_DBTYPE = this;
629 this.el = new Gtk.Entry();
633 // set gobject values
636 // user defined functions
638 public class Xcls_Label22 : Object
641 private Xcls_ProjectSettings _this;
647 public Xcls_Label22(Xcls_ProjectSettings _owner )
650 this.el = new Gtk.Label( "Name" );
654 // set gobject values
658 // user defined functions
660 public class Xcls_database_DBTYPE : Object
663 private Xcls_ProjectSettings _this;
669 public Xcls_database_DBTYPE(Xcls_ProjectSettings _owner )
672 _this.database_DBTYPE = this;
673 this.el = new Gtk.Entry();
677 // set gobject values
680 // user defined functions
682 public class Xcls_Label24 : Object
685 private Xcls_ProjectSettings _this;
691 public Xcls_Label24(Xcls_ProjectSettings _owner )
694 this.el = new Gtk.Label( "Username" );
698 // set gobject values
702 // user defined functions
704 public class Xcls_database_DBUSERNAME : Object
707 private Xcls_ProjectSettings _this;
713 public Xcls_database_DBUSERNAME(Xcls_ProjectSettings _owner )
716 _this.database_DBUSERNAME = this;
717 this.el = new Gtk.Entry();
721 // set gobject values
724 // user defined functions
726 public class Xcls_Label26 : Object
729 private Xcls_ProjectSettings _this;
735 public Xcls_Label26(Xcls_ProjectSettings _owner )
738 this.el = new Gtk.Label( "Password" );
742 // set gobject values
746 // user defined functions
748 public class Xcls_database_DBPASSWORD : Object
751 private Xcls_ProjectSettings _this;
757 public Xcls_database_DBPASSWORD(Xcls_ProjectSettings _owner )
760 _this.database_DBPASSWORD = this;
761 this.el = new Gtk.Entry();
765 // set gobject values
768 // user defined functions
770 public class Xcls_Button28 : Object
772 public Gtk.Button el;
773 private Xcls_ProjectSettings _this;
779 public Xcls_Button28(Xcls_ProjectSettings _owner )
782 this.el = new Gtk.Button();
786 // set gobject values
787 this.el.label = "Check Connection";
790 // user defined functions