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
356 // user defined functions
358 public class Xcls_base_template : Object
361 private Xcls_ProjectSettings _this;
367 public Xcls_base_template(Xcls_ProjectSettings _owner )
370 _this.base_template = this;
371 this.el = new Gtk.Entry();
375 // set gobject values
378 // user defined functions
380 public class Xcls_HBox13 : Object
383 private Xcls_ProjectSettings _this;
389 public Xcls_HBox13(Xcls_ProjectSettings _owner )
392 this.el = new Gtk.HBox( false, 0 );
396 // set gobject values
397 this.el.expand = false;
398 var child_0 = new Xcls_Label14( _this );
400 this.el.pack_start ( child_0.el , false,false,0 );
401 var child_1 = new Xcls_rootURL( _this );
403 this.el.add ( child_1.el );
406 // user defined functions
408 public class Xcls_Label14 : Object
411 private Xcls_ProjectSettings _this;
417 public Xcls_Label14(Xcls_ProjectSettings _owner )
420 this.el = new Gtk.Label( "root URL" );
424 // set gobject values
427 // user defined functions
429 public class Xcls_rootURL : Object
432 private Xcls_ProjectSettings _this;
438 public Xcls_rootURL(Xcls_ProjectSettings _owner )
441 _this.rootURL = this;
442 this.el = new Gtk.Entry();
446 // set gobject values
449 // user defined functions
451 public class Xcls_Label16 : Object
454 private Xcls_ProjectSettings _this;
460 public Xcls_Label16(Xcls_ProjectSettings _owner )
463 this.el = new Gtk.Label( "HTML To insert at end of <HEAD>" );
467 // set gobject values
470 // user defined functions
472 public class Xcls_ScrolledWindow17 : Object
474 public Gtk.ScrolledWindow el;
475 private Xcls_ProjectSettings _this;
481 public Xcls_ScrolledWindow17(Xcls_ProjectSettings _owner )
484 this.el = new Gtk.ScrolledWindow( null, null );
488 // set gobject values
489 var child_0 = new Xcls_view( _this );
491 this.el.add ( child_0.el );
494 // user defined functions
496 public class Xcls_view : Object
498 public Gtk.SourceView el;
499 private Xcls_ProjectSettings _this;
505 public Xcls_view(Xcls_ProjectSettings _owner )
509 this.el = new Gtk.SourceView();
513 // set gobject values
517 var description = Pango.FontDescription.from_string("monospace");
518 description.set_size(9000);
519 this.el.override_font(description);
522 this.el.key_release_event.connect( ( event) =>{
523 if (event.keyval != 115) {
527 if ( (event.state & Gdk.ModifierType.CONTROL_MASK ) < 1 ) {
530 var buf = this.el.get_buffer();
533 buf.get_start_iter(out s);
534 buf.get_end_iter(out e);
535 _this.project.runhtml = buf.get_text(s,e,true);
538 _this.buttonPressed("save");
545 // user defined functions
547 public class Xcls_VBox19 : Object
550 private Xcls_ProjectSettings _this;
556 public Xcls_VBox19(Xcls_ProjectSettings _owner )
559 this.el = new Gtk.VBox( false, 0 );
563 // set gobject values
564 var child_0 = new Xcls_Label20( _this );
566 this.el.pack_start ( child_0.el , false,false,0 );
567 var child_1 = new Xcls_database_DBTYPE( _this );
569 this.el.pack_start ( child_1.el , false,false,0 );
570 var child_2 = new Xcls_Label22( _this );
572 this.el.pack_start ( child_2.el , false,false,0 );
573 var child_3 = new Xcls_database_DBTYPE( _this );
575 this.el.pack_start ( child_3.el , false,false,0 );
576 var child_4 = new Xcls_Label24( _this );
578 this.el.pack_start ( child_4.el , false,false,0 );
579 var child_5 = new Xcls_database_DBUSERNAME( _this );
581 this.el.pack_start ( child_5.el , false,false,0 );
582 var child_6 = new Xcls_Label26( _this );
584 this.el.pack_start ( child_6.el , false,false,0 );
585 var child_7 = new Xcls_database_DBPASSWORD( _this );
587 this.el.pack_start ( child_7.el , false,false,0 );
588 var child_8 = new Xcls_Button28( _this );
590 this.el.pack_start ( child_8.el , false,false,0 );
593 // user defined functions
595 public class Xcls_Label20 : Object
598 private Xcls_ProjectSettings _this;
604 public Xcls_Label20(Xcls_ProjectSettings _owner )
607 this.el = new Gtk.Label( "Type (eg. MySQL or PostgreSQL)" );
611 // set gobject values
615 // user defined functions
617 public class Xcls_database_DBTYPE : Object
620 private Xcls_ProjectSettings _this;
626 public Xcls_database_DBTYPE(Xcls_ProjectSettings _owner )
629 _this.database_DBTYPE = this;
630 this.el = new Gtk.Entry();
634 // set gobject values
637 // user defined functions
639 public class Xcls_Label22 : Object
642 private Xcls_ProjectSettings _this;
648 public Xcls_Label22(Xcls_ProjectSettings _owner )
651 this.el = new Gtk.Label( "Name" );
655 // set gobject values
659 // user defined functions
661 public class Xcls_database_DBTYPE : Object
664 private Xcls_ProjectSettings _this;
670 public Xcls_database_DBTYPE(Xcls_ProjectSettings _owner )
673 _this.database_DBTYPE = this;
674 this.el = new Gtk.Entry();
678 // set gobject values
681 // user defined functions
683 public class Xcls_Label24 : Object
686 private Xcls_ProjectSettings _this;
692 public Xcls_Label24(Xcls_ProjectSettings _owner )
695 this.el = new Gtk.Label( "Username" );
699 // set gobject values
703 // user defined functions
705 public class Xcls_database_DBUSERNAME : Object
708 private Xcls_ProjectSettings _this;
714 public Xcls_database_DBUSERNAME(Xcls_ProjectSettings _owner )
717 _this.database_DBUSERNAME = this;
718 this.el = new Gtk.Entry();
722 // set gobject values
725 // user defined functions
727 public class Xcls_Label26 : Object
730 private Xcls_ProjectSettings _this;
736 public Xcls_Label26(Xcls_ProjectSettings _owner )
739 this.el = new Gtk.Label( "Password" );
743 // set gobject values
747 // user defined functions
749 public class Xcls_database_DBPASSWORD : Object
752 private Xcls_ProjectSettings _this;
758 public Xcls_database_DBPASSWORD(Xcls_ProjectSettings _owner )
761 _this.database_DBPASSWORD = this;
762 this.el = new Gtk.Entry();
766 // set gobject values
769 // user defined functions
771 public class Xcls_Button28 : Object
773 public Gtk.Button el;
774 private Xcls_ProjectSettings _this;
780 public Xcls_Button28(Xcls_ProjectSettings _owner )
783 this.el = new Gtk.Button();
787 // set gobject values
788 this.el.label = "Check Connection";
791 // user defined functions