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;
25 public signal void buttonPressed (string btn);
26 public Project.Project project;
29 public Xcls_ProjectSettings()
32 this.el = new Gtk.VBox( false, 0 );
37 this.el.border_width = 5;
38 var child_0 = new Xcls_HBox2( _this );
40 this.el.pack_start ( child_0.el , false,false,0 );
41 var child_1 = new Xcls_Notebook5( _this );
43 this.el.pack_end ( child_1.el , true,true,0 );
46 // user defined functions
47 public void show (Project.Project project) {
48 _this.project = project;
49 _this.path.el.label = project.firstPath();
50 // get the active project.
51 var lm = Gtk.SourceLanguageManager.get_default();
53 ((Gtk.SourceBuffer)(_this.view.el.get_buffer())) .set_language(
55 lm.get_language("html"));
58 //project.runhtml = project.runhtml || '';
59 _this.view.el.get_buffer().set_text(project.runhtml);
62 _this.rootURL.el.set_text( _this.project.rootURL );
63 _this.base_template.el.set_text(_this.project.base_template);
70 var buf = _this.view.el.get_buffer();
73 buf.get_start_iter(out s);
74 buf.get_end_iter(out e);
75 _this.project.runhtml = buf.get_text(s,e,true);
77 _this.project.rootURL = _this.rootURL.el.get_text();
78 _this.project.base_template = _this.base_template.el.get_text();
82 public class Xcls_HBox2 : Object
85 private Xcls_ProjectSettings _this;
91 public Xcls_HBox2(Xcls_ProjectSettings _owner )
94 this.el = new Gtk.HBox( true, 0 );
99 this.el.expand = false;
100 this.el.vexpand = false;
101 var child_0 = new Xcls_Button3( _this );
103 this.el.add ( child_0.el );
104 var child_1 = new Xcls_Button4( _this );
106 this.el.add ( child_1.el );
109 // user defined functions
111 public class Xcls_Button3 : Object
113 public Gtk.Button el;
114 private Xcls_ProjectSettings _this;
120 public Xcls_Button3(Xcls_ProjectSettings _owner )
123 this.el = new Gtk.Button();
127 // set gobject values
128 this.el.label = "Apply";
131 this.el.button_press_event.connect( () => {
134 _this.buttonPressed("apply");
139 // user defined functions
141 public class Xcls_Button4 : Object
143 public Gtk.Button el;
144 private Xcls_ProjectSettings _this;
150 public Xcls_Button4(Xcls_ProjectSettings _owner )
153 this.el = new Gtk.Button();
157 // set gobject values
158 this.el.label = "Save";
161 this.el.button_press_event.connect( () => {
164 _this.buttonPressed("save");
169 // user defined functions
171 public class Xcls_Notebook5 : Object
173 public Gtk.Notebook el;
174 private Xcls_ProjectSettings _this;
180 public Xcls_Notebook5(Xcls_ProjectSettings _owner )
183 this.el = new Gtk.Notebook();
187 // set gobject values
188 var child_0 = new Xcls_label_global( _this );
190 var child_1 = new Xcls_label_database( _this );
192 var child_2 = new Xcls_VBox8( _this );
194 this.el.append_page ( child_2.el , _this.label_global.el );
195 var child_3 = new Xcls_VBox19( _this );
197 this.el.append_page ( child_3.el , _this.label_database.el );
200 // user defined functions
202 public class Xcls_label_global : Object
205 private Xcls_ProjectSettings _this;
211 public Xcls_label_global(Xcls_ProjectSettings _owner )
214 _this.label_global = this;
215 this.el = new Gtk.Label( "Global" );
219 // set gobject values
222 // user defined functions
224 public class Xcls_label_database : Object
227 private Xcls_ProjectSettings _this;
233 public Xcls_label_database(Xcls_ProjectSettings _owner )
236 _this.label_database = this;
237 this.el = new Gtk.Label( "Database" );
241 // set gobject values
244 // user defined functions
246 public class Xcls_VBox8 : Object
249 private Xcls_ProjectSettings _this;
255 public Xcls_VBox8(Xcls_ProjectSettings _owner )
258 this.el = new Gtk.VBox( false, 0 );
262 // set gobject values
263 var child_0 = new Xcls_path( _this );
265 this.el.pack_start ( child_0.el , false,false,0 );
266 var child_1 = new Xcls_Label10( _this );
268 this.el.pack_start ( child_1.el , false,false,0 );
269 var child_2 = new Xcls_HBox11( _this );
271 this.el.pack_start ( child_2.el , false,false,0 );
272 var child_3 = new Xcls_HBox14( _this );
274 this.el.pack_start ( child_3.el , false,false,0 );
275 var child_4 = new Xcls_ScrolledWindow17( _this );
277 this.el.pack_start ( child_4.el , true,true,0 );
280 // user defined functions
282 public class Xcls_path : Object
285 private Xcls_ProjectSettings _this;
291 public Xcls_path(Xcls_ProjectSettings _owner )
295 this.el = new Gtk.Label( "filename" );
299 // set gobject values
303 // user defined functions
305 public class Xcls_Label10 : Object
308 private Xcls_ProjectSettings _this;
314 public Xcls_Label10(Xcls_ProjectSettings _owner )
317 this.el = new Gtk.Label( "HTML To insert at end of <HEAD>" );
321 // set gobject values
324 // user defined functions
326 public class Xcls_HBox11 : Object
329 private Xcls_ProjectSettings _this;
335 public Xcls_HBox11(Xcls_ProjectSettings _owner )
338 this.el = new Gtk.HBox( false, 0 );
342 // set gobject values
343 this.el.expand = false;
344 var child_0 = new Xcls_Label12( _this );
346 this.el.pack_start ( child_0.el , false,false,0 );
347 var child_1 = new Xcls_base_template( _this );
349 this.el.add ( child_1.el );
352 // user defined functions
354 public class Xcls_Label12 : Object
357 private Xcls_ProjectSettings _this;
363 public Xcls_Label12(Xcls_ProjectSettings _owner )
366 this.el = new Gtk.Label( "HTML template file" );
370 // set gobject values
373 // user defined functions
375 public class Xcls_base_template : Object
378 private Xcls_ProjectSettings _this;
384 public Xcls_base_template(Xcls_ProjectSettings _owner )
387 _this.base_template = this;
388 this.el = new Gtk.Entry();
392 // set gobject values
395 // user defined functions
397 public class Xcls_HBox14 : Object
400 private Xcls_ProjectSettings _this;
406 public Xcls_HBox14(Xcls_ProjectSettings _owner )
409 this.el = new Gtk.HBox( false, 0 );
413 // set gobject values
414 this.el.expand = false;
415 var child_0 = new Xcls_Label15( _this );
417 this.el.pack_start ( child_0.el , false,false,0 );
418 var child_1 = new Xcls_rootURL( _this );
420 this.el.add ( child_1.el );
423 // user defined functions
425 public class Xcls_Label15 : Object
428 private Xcls_ProjectSettings _this;
434 public Xcls_Label15(Xcls_ProjectSettings _owner )
437 this.el = new Gtk.Label( "root URL" );
441 // set gobject values
444 // user defined functions
446 public class Xcls_rootURL : Object
449 private Xcls_ProjectSettings _this;
455 public Xcls_rootURL(Xcls_ProjectSettings _owner )
458 _this.rootURL = this;
459 this.el = new Gtk.Entry();
463 // set gobject values
466 // user defined functions
468 public class Xcls_ScrolledWindow17 : Object
470 public Gtk.ScrolledWindow el;
471 private Xcls_ProjectSettings _this;
477 public Xcls_ScrolledWindow17(Xcls_ProjectSettings _owner )
480 this.el = new Gtk.ScrolledWindow( null, null );
484 // set gobject values
485 var child_0 = new Xcls_view( _this );
487 this.el.add ( child_0.el );
490 // user defined functions
492 public class Xcls_view : Object
494 public Gtk.SourceView el;
495 private Xcls_ProjectSettings _this;
501 public Xcls_view(Xcls_ProjectSettings _owner )
505 this.el = new Gtk.SourceView();
509 // set gobject values
513 var description = Pango.FontDescription.from_string("monospace");
514 description.set_size(9000);
515 this.el.override_font(description);
518 this.el.key_release_event.connect( ( event) =>{
519 if (event.keyval != 115) {
523 if ( (event.state & Gdk.ModifierType.CONTROL_MASK ) < 1 ) {
526 var buf = this.el.get_buffer();
529 buf.get_start_iter(out s);
530 buf.get_end_iter(out e);
531 _this.project.runhtml = buf.get_text(s,e,true);
534 _this.buttonPressed("save");
541 // user defined functions
543 public class Xcls_VBox19 : Object
546 private Xcls_ProjectSettings _this;
552 public Xcls_VBox19(Xcls_ProjectSettings _owner )
555 this.el = new Gtk.VBox( false, 0 );
559 // set gobject values
560 var child_0 = new Xcls_Label20( _this );
562 this.el.pack_start ( child_0.el , false,false,0 );
563 var child_1 = new Xcls_database_DBTYPE( _this );
565 this.el.pack_start ( child_1.el , false,false,0 );
566 var child_2 = new Xcls_Label22( _this );
568 this.el.pack_start ( child_2.el , false,false,0 );
569 var child_3 = new Xcls_database_DBTYPE( _this );
571 this.el.pack_start ( child_3.el , false,false,0 );
574 // user defined functions
576 public class Xcls_Label20 : Object
579 private Xcls_ProjectSettings _this;
585 public Xcls_Label20(Xcls_ProjectSettings _owner )
588 this.el = new Gtk.Label( "Database Type" );
592 // set gobject values
596 // user defined functions
598 public class Xcls_database_DBTYPE : Object
601 private Xcls_ProjectSettings _this;
607 public Xcls_database_DBTYPE(Xcls_ProjectSettings _owner )
610 _this.database_DBTYPE = this;
611 this.el = new Gtk.Entry();
615 // set gobject values
618 // user defined functions
620 public class Xcls_Label22 : Object
623 private Xcls_ProjectSettings _this;
629 public Xcls_Label22(Xcls_ProjectSettings _owner )
632 this.el = new Gtk.Label( "Database Name" );
636 // set gobject values
640 // user defined functions
642 public class Xcls_database_DBTYPE : Object
645 private Xcls_ProjectSettings _this;
651 public Xcls_database_DBTYPE(Xcls_ProjectSettings _owner )
654 _this.database_DBTYPE = this;
655 this.el = new Gtk.Entry();
659 // set gobject values
662 // user defined functions