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;
23 public signal void buttonPressed (string btn);
24 public Project.Project project;
27 public Xcls_ProjectSettings()
30 this.el = new Gtk.VBox( false, 0 );
35 this.el.border_width = 5;
36 var child_0 = new Xcls_Notebook2( _this );
38 this.el.pack_start ( child_0.el , true,true,0 );
39 var child_1 = new Xcls_HBox9( _this );
41 this.el.pack_start ( child_1.el , false,false,0 );
42 var child_2 = new Xcls_path( _this );
44 this.el.pack_start ( child_2.el , false,false,0 );
45 var child_3 = new Xcls_Label13( _this );
47 this.el.pack_start ( child_3.el , false,false,0 );
48 var child_4 = new Xcls_HBox14( _this );
50 this.el.pack_start ( child_4.el , false,false,0 );
51 var child_5 = new Xcls_HBox17( _this );
53 this.el.pack_start ( child_5.el , false,false,0 );
54 var child_6 = new Xcls_ScrolledWindow20( _this );
56 this.el.pack_start ( child_6.el , true,true,0 );
59 // user defined functions
60 public void show (Project.Project project) {
61 _this.project = project;
62 _this.path.el.label = project.firstPath();
63 // get the active project.
64 var lm = Gtk.SourceLanguageManager.get_default();
66 ((Gtk.SourceBuffer)(_this.view.el.get_buffer())) .set_language(
68 lm.get_language("html"));
71 //project.runhtml = project.runhtml || '';
72 _this.view.el.get_buffer().set_text(project.runhtml);
75 _this.rootURL.el.set_text( _this.project.rootURL );
76 _this.base_template.el.set_text(_this.project.base_template);
83 var buf = _this.view.el.get_buffer();
86 buf.get_start_iter(out s);
87 buf.get_end_iter(out e);
88 _this.project.runhtml = buf.get_text(s,e,true);
90 _this.project.rootURL = _this.rootURL.el.get_text();
91 _this.project.base_template = _this.base_template.el.get_text();
95 public class Xcls_Notebook2 : Object
97 public Gtk.Notebook el;
98 private Xcls_ProjectSettings _this;
104 public Xcls_Notebook2(Xcls_ProjectSettings _owner )
107 this.el = new Gtk.Notebook();
111 // set gobject values
112 var child_0 = new Xcls_label_global( _this );
114 var child_1 = new Xcls_label_database( _this );
116 var child_2 = new Xcls_VBox5( _this );
118 this.el.append_page ( child_2.el , _this.label_global.el );
119 var child_3 = new Xcls_HBox6( _this );
121 this.el.pack_start ( child_3.el , false,false,0 );
124 // user defined functions
126 public class Xcls_label_global : Object
129 private Xcls_ProjectSettings _this;
135 public Xcls_label_global(Xcls_ProjectSettings _owner )
138 _this.label_global = this;
139 this.el = new Gtk.Label( "Global" );
143 // set gobject values
146 // user defined functions
148 public class Xcls_label_database : Object
151 private Xcls_ProjectSettings _this;
157 public Xcls_label_database(Xcls_ProjectSettings _owner )
160 _this.label_database = this;
161 this.el = new Gtk.Label( "Database" );
165 // set gobject values
168 // user defined functions
170 public class Xcls_VBox5 : Object
173 private Xcls_ProjectSettings _this;
179 public Xcls_VBox5(Xcls_ProjectSettings _owner )
182 this.el = new Gtk.VBox( false, 0 );
186 // set gobject values
189 // user defined functions
191 public class Xcls_HBox6 : Object
194 private Xcls_ProjectSettings _this;
200 public Xcls_HBox6(Xcls_ProjectSettings _owner )
203 this.el = new Gtk.HBox( true, 0 );
207 // set gobject values
208 this.el.expand = false;
209 this.el.vexpand = false;
210 var child_0 = new Xcls_Button7( _this );
212 this.el.add ( child_0.el );
213 var child_1 = new Xcls_Button8( _this );
215 this.el.add ( child_1.el );
218 // user defined functions
220 public class Xcls_Button7 : Object
222 public Gtk.Button el;
223 private Xcls_ProjectSettings _this;
229 public Xcls_Button7(Xcls_ProjectSettings _owner )
232 this.el = new Gtk.Button();
236 // set gobject values
237 this.el.label = "Apply";
240 this.el.button_press_event.connect( () => {
243 _this.buttonPressed("apply");
248 // user defined functions
250 public class Xcls_Button8 : Object
252 public Gtk.Button el;
253 private Xcls_ProjectSettings _this;
259 public Xcls_Button8(Xcls_ProjectSettings _owner )
262 this.el = new Gtk.Button();
266 // set gobject values
267 this.el.label = "Save";
270 this.el.button_press_event.connect( () => {
273 _this.buttonPressed("save");
278 // user defined functions
280 public class Xcls_HBox9 : Object
283 private Xcls_ProjectSettings _this;
289 public Xcls_HBox9(Xcls_ProjectSettings _owner )
292 this.el = new Gtk.HBox( true, 0 );
296 // set gobject values
297 this.el.expand = false;
298 this.el.vexpand = false;
299 var child_0 = new Xcls_Button10( _this );
301 this.el.add ( child_0.el );
302 var child_1 = new Xcls_Button11( _this );
304 this.el.add ( child_1.el );
307 // user defined functions
309 public class Xcls_Button10 : Object
311 public Gtk.Button el;
312 private Xcls_ProjectSettings _this;
318 public Xcls_Button10(Xcls_ProjectSettings _owner )
321 this.el = new Gtk.Button();
325 // set gobject values
326 this.el.label = "Apply";
329 this.el.button_press_event.connect( () => {
332 _this.buttonPressed("apply");
337 // user defined functions
339 public class Xcls_Button11 : Object
341 public Gtk.Button el;
342 private Xcls_ProjectSettings _this;
348 public Xcls_Button11(Xcls_ProjectSettings _owner )
351 this.el = new Gtk.Button();
355 // set gobject values
356 this.el.label = "Save";
359 this.el.button_press_event.connect( () => {
362 _this.buttonPressed("save");
367 // user defined functions
369 public class Xcls_path : Object
372 private Xcls_ProjectSettings _this;
378 public Xcls_path(Xcls_ProjectSettings _owner )
382 this.el = new Gtk.Label( "filename" );
386 // set gobject values
390 // user defined functions
392 public class Xcls_Label13 : Object
395 private Xcls_ProjectSettings _this;
401 public Xcls_Label13(Xcls_ProjectSettings _owner )
404 this.el = new Gtk.Label( "HTML To insert at end of <HEAD>" );
408 // set gobject values
411 // user defined functions
413 public class Xcls_HBox14 : Object
416 private Xcls_ProjectSettings _this;
422 public Xcls_HBox14(Xcls_ProjectSettings _owner )
425 this.el = new Gtk.HBox( false, 0 );
429 // set gobject values
430 this.el.expand = false;
431 var child_0 = new Xcls_Label15( _this );
433 this.el.pack_start ( child_0.el , false,false,0 );
434 var child_1 = new Xcls_base_template( _this );
436 this.el.add ( child_1.el );
439 // user defined functions
441 public class Xcls_Label15 : Object
444 private Xcls_ProjectSettings _this;
450 public Xcls_Label15(Xcls_ProjectSettings _owner )
453 this.el = new Gtk.Label( "HTML template file" );
457 // set gobject values
460 // user defined functions
462 public class Xcls_base_template : Object
465 private Xcls_ProjectSettings _this;
471 public Xcls_base_template(Xcls_ProjectSettings _owner )
474 _this.base_template = this;
475 this.el = new Gtk.Entry();
479 // set gobject values
482 // user defined functions
484 public class Xcls_HBox17 : Object
487 private Xcls_ProjectSettings _this;
493 public Xcls_HBox17(Xcls_ProjectSettings _owner )
496 this.el = new Gtk.HBox( false, 0 );
500 // set gobject values
501 this.el.expand = false;
502 var child_0 = new Xcls_Label18( _this );
504 this.el.pack_start ( child_0.el , false,false,0 );
505 var child_1 = new Xcls_rootURL( _this );
507 this.el.add ( child_1.el );
510 // user defined functions
512 public class Xcls_Label18 : Object
515 private Xcls_ProjectSettings _this;
521 public Xcls_Label18(Xcls_ProjectSettings _owner )
524 this.el = new Gtk.Label( "root URL" );
528 // set gobject values
531 // user defined functions
533 public class Xcls_rootURL : Object
536 private Xcls_ProjectSettings _this;
542 public Xcls_rootURL(Xcls_ProjectSettings _owner )
545 _this.rootURL = this;
546 this.el = new Gtk.Entry();
550 // set gobject values
553 // user defined functions
555 public class Xcls_ScrolledWindow20 : Object
557 public Gtk.ScrolledWindow el;
558 private Xcls_ProjectSettings _this;
564 public Xcls_ScrolledWindow20(Xcls_ProjectSettings _owner )
567 this.el = new Gtk.ScrolledWindow( null, null );
571 // set gobject values
572 var child_0 = new Xcls_view( _this );
574 this.el.add ( child_0.el );
577 // user defined functions
579 public class Xcls_view : Object
581 public Gtk.SourceView el;
582 private Xcls_ProjectSettings _this;
588 public Xcls_view(Xcls_ProjectSettings _owner )
592 this.el = new Gtk.SourceView();
596 // set gobject values
600 var description = Pango.FontDescription.from_string("monospace");
601 description.set_size(9000);
602 this.el.override_font(description);
605 this.el.key_release_event.connect( ( event) =>{
606 if (event.keyval != 115) {
610 if ( (event.state & Gdk.ModifierType.CONTROL_MASK ) < 1 ) {
613 var buf = this.el.get_buffer();
616 buf.get_start_iter(out s);
617 buf.get_end_iter(out e);
618 _this.project.runhtml = buf.get_text(s,e,true);
621 _this.buttonPressed("save");
628 // user defined functions