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;
24 public signal void buttonPressed (string btn);
25 public Project.Project project;
28 public Xcls_ProjectSettings()
31 this.el = new Gtk.VBox( false, 0 );
36 this.el.border_width = 5;
37 var child_0 = new Xcls_HBox2( _this );
39 this.el.pack_start ( child_0.el , false,false,0 );
40 var child_1 = new Xcls_Notebook5( _this );
42 this.el.pack_end ( child_1.el , true,true,0 );
45 // user defined functions
46 public void show (Project.Project project) {
47 _this.project = project;
48 _this.path.el.label = project.firstPath();
49 // get the active project.
50 var lm = Gtk.SourceLanguageManager.get_default();
52 ((Gtk.SourceBuffer)(_this.view.el.get_buffer())) .set_language(
54 lm.get_language("html"));
57 //project.runhtml = project.runhtml || '';
58 _this.view.el.get_buffer().set_text(project.runhtml);
61 _this.rootURL.el.set_text( _this.project.rootURL );
62 _this.base_template.el.set_text(_this.project.base_template);
69 var buf = _this.view.el.get_buffer();
72 buf.get_start_iter(out s);
73 buf.get_end_iter(out e);
74 _this.project.runhtml = buf.get_text(s,e,true);
76 _this.project.rootURL = _this.rootURL.el.get_text();
77 _this.project.base_template = _this.base_template.el.get_text();
81 public class Xcls_HBox2 : Object
84 private Xcls_ProjectSettings _this;
90 public Xcls_HBox2(Xcls_ProjectSettings _owner )
93 this.el = new Gtk.HBox( true, 0 );
98 this.el.expand = false;
99 this.el.vexpand = false;
100 var child_0 = new Xcls_Button3( _this );
102 this.el.add ( child_0.el );
103 var child_1 = new Xcls_Button4( _this );
105 this.el.add ( child_1.el );
108 // user defined functions
110 public class Xcls_Button3 : Object
112 public Gtk.Button el;
113 private Xcls_ProjectSettings _this;
119 public Xcls_Button3(Xcls_ProjectSettings _owner )
122 this.el = new Gtk.Button();
126 // set gobject values
127 this.el.label = "Apply";
130 this.el.button_press_event.connect( () => {
133 _this.buttonPressed("apply");
138 // user defined functions
140 public class Xcls_Button4 : Object
142 public Gtk.Button el;
143 private Xcls_ProjectSettings _this;
149 public Xcls_Button4(Xcls_ProjectSettings _owner )
152 this.el = new Gtk.Button();
156 // set gobject values
157 this.el.label = "Save";
160 this.el.button_press_event.connect( () => {
163 _this.buttonPressed("save");
168 // user defined functions
170 public class Xcls_Notebook5 : Object
172 public Gtk.Notebook el;
173 private Xcls_ProjectSettings _this;
179 public Xcls_Notebook5(Xcls_ProjectSettings _owner )
182 this.el = new Gtk.Notebook();
186 // set gobject values
187 var child_0 = new Xcls_label_global( _this );
189 var child_1 = new Xcls_label_database( _this );
191 var child_2 = new Xcls_VBox8( _this );
193 this.el.append_page ( child_2.el , _this.label_global.el );
194 var child_3 = new Xcls_VBox19( _this );
196 this.el.append_page ( child_3.el , _this.label_database.el );
199 // user defined functions
201 public class Xcls_label_global : Object
204 private Xcls_ProjectSettings _this;
210 public Xcls_label_global(Xcls_ProjectSettings _owner )
213 _this.label_global = this;
214 this.el = new Gtk.Label( "Global" );
218 // set gobject values
221 // user defined functions
223 public class Xcls_label_database : Object
226 private Xcls_ProjectSettings _this;
232 public Xcls_label_database(Xcls_ProjectSettings _owner )
235 _this.label_database = this;
236 this.el = new Gtk.Label( "Database" );
240 // set gobject values
243 // user defined functions
245 public class Xcls_VBox8 : Object
248 private Xcls_ProjectSettings _this;
254 public Xcls_VBox8(Xcls_ProjectSettings _owner )
257 this.el = new Gtk.VBox( false, 0 );
261 // set gobject values
262 var child_0 = new Xcls_path( _this );
264 this.el.pack_start ( child_0.el , false,false,0 );
265 var child_1 = new Xcls_Label10( _this );
267 this.el.pack_start ( child_1.el , false,false,0 );
268 var child_2 = new Xcls_HBox11( _this );
270 this.el.pack_start ( child_2.el , false,false,0 );
271 var child_3 = new Xcls_HBox14( _this );
273 this.el.pack_start ( child_3.el , false,false,0 );
274 var child_4 = new Xcls_ScrolledWindow17( _this );
276 this.el.pack_start ( child_4.el , true,true,0 );
279 // user defined functions
281 public class Xcls_path : Object
284 private Xcls_ProjectSettings _this;
290 public Xcls_path(Xcls_ProjectSettings _owner )
294 this.el = new Gtk.Label( "filename" );
298 // set gobject values
302 // user defined functions
304 public class Xcls_Label10 : Object
307 private Xcls_ProjectSettings _this;
313 public Xcls_Label10(Xcls_ProjectSettings _owner )
316 this.el = new Gtk.Label( "HTML To insert at end of <HEAD>" );
320 // set gobject values
323 // user defined functions
325 public class Xcls_HBox11 : Object
328 private Xcls_ProjectSettings _this;
334 public Xcls_HBox11(Xcls_ProjectSettings _owner )
337 this.el = new Gtk.HBox( false, 0 );
341 // set gobject values
342 this.el.expand = false;
343 var child_0 = new Xcls_Label12( _this );
345 this.el.pack_start ( child_0.el , false,false,0 );
346 var child_1 = new Xcls_base_template( _this );
348 this.el.add ( child_1.el );
351 // user defined functions
353 public class Xcls_Label12 : Object
356 private Xcls_ProjectSettings _this;
362 public Xcls_Label12(Xcls_ProjectSettings _owner )
365 this.el = new Gtk.Label( "HTML template file" );
369 // set gobject values
372 // user defined functions
374 public class Xcls_base_template : Object
377 private Xcls_ProjectSettings _this;
383 public Xcls_base_template(Xcls_ProjectSettings _owner )
386 _this.base_template = this;
387 this.el = new Gtk.Entry();
391 // set gobject values
394 // user defined functions
396 public class Xcls_HBox14 : Object
399 private Xcls_ProjectSettings _this;
405 public Xcls_HBox14(Xcls_ProjectSettings _owner )
408 this.el = new Gtk.HBox( false, 0 );
412 // set gobject values
413 this.el.expand = false;
414 var child_0 = new Xcls_Label15( _this );
416 this.el.pack_start ( child_0.el , false,false,0 );
417 var child_1 = new Xcls_rootURL( _this );
419 this.el.add ( child_1.el );
422 // user defined functions
424 public class Xcls_Label15 : Object
427 private Xcls_ProjectSettings _this;
433 public Xcls_Label15(Xcls_ProjectSettings _owner )
436 this.el = new Gtk.Label( "root URL" );
440 // set gobject values
443 // user defined functions
445 public class Xcls_rootURL : Object
448 private Xcls_ProjectSettings _this;
454 public Xcls_rootURL(Xcls_ProjectSettings _owner )
457 _this.rootURL = this;
458 this.el = new Gtk.Entry();
462 // set gobject values
465 // user defined functions
467 public class Xcls_ScrolledWindow17 : Object
469 public Gtk.ScrolledWindow el;
470 private Xcls_ProjectSettings _this;
476 public Xcls_ScrolledWindow17(Xcls_ProjectSettings _owner )
479 this.el = new Gtk.ScrolledWindow( null, null );
483 // set gobject values
484 var child_0 = new Xcls_view( _this );
486 this.el.add ( child_0.el );
489 // user defined functions
491 public class Xcls_view : Object
493 public Gtk.SourceView el;
494 private Xcls_ProjectSettings _this;
500 public Xcls_view(Xcls_ProjectSettings _owner )
504 this.el = new Gtk.SourceView();
508 // set gobject values
512 var description = Pango.FontDescription.from_string("monospace");
513 description.set_size(9000);
514 this.el.override_font(description);
517 this.el.key_release_event.connect( ( event) =>{
518 if (event.keyval != 115) {
522 if ( (event.state & Gdk.ModifierType.CONTROL_MASK ) < 1 ) {
525 var buf = this.el.get_buffer();
528 buf.get_start_iter(out s);
529 buf.get_end_iter(out e);
530 _this.project.runhtml = buf.get_text(s,e,true);
533 _this.buttonPressed("save");
540 // user defined functions
542 public class Xcls_VBox19 : Object
545 private Xcls_ProjectSettings _this;
551 public Xcls_VBox19(Xcls_ProjectSettings _owner )
554 this.el = new Gtk.VBox( false, 0 );
558 // set gobject values
559 var child_0 = new Xcls_Label20( _this );
561 this.el.add ( child_0.el );
562 var child_1 = new Xcls_database_DBTYPE( _this );
564 this.el.add ( child_1.el );
565 var child_2 = new Xcls_Label22( _this );
567 this.el.add ( child_2.el );
570 // user defined functions
572 public class Xcls_Label20 : Object
575 private Xcls_ProjectSettings _this;
581 public Xcls_Label20(Xcls_ProjectSettings _owner )
584 this.el = new Gtk.Label( "Database Type" );
588 // set gobject values
592 // user defined functions
594 public class Xcls_database_DBTYPE : Object
597 private Xcls_ProjectSettings _this;
603 public Xcls_database_DBTYPE(Xcls_ProjectSettings _owner )
606 _this.database_DBTYPE = this;
607 this.el = new Gtk.Entry();
611 // set gobject values
614 // user defined functions
616 public class Xcls_Label22 : Object
619 private Xcls_ProjectSettings _this;
625 public Xcls_Label22(Xcls_ProjectSettings _owner )
628 this.el = new Gtk.Label( "Database Type" );
632 // set gobject values
636 // user defined functions