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_HBox8( _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_Label12( _this );
47 this.el.pack_start ( child_3.el , false,false,0 );
48 var child_4 = new Xcls_HBox13( _this );
50 this.el.pack_start ( child_4.el , false,false,0 );
51 var child_5 = new Xcls_HBox16( _this );
53 this.el.pack_start ( child_5.el , false,false,0 );
54 var child_6 = new Xcls_ScrolledWindow19( _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_HBox5( _this );
118 this.el.pack_start ( child_2.el , false,false,0 );
121 // user defined functions
123 public class Xcls_label_global : Object
126 private Xcls_ProjectSettings _this;
132 public Xcls_label_global(Xcls_ProjectSettings _owner )
135 _this.label_global = this;
136 this.el = new Gtk.Label( "Global" );
140 // set gobject values
143 // user defined functions
145 public class Xcls_label_database : Object
148 private Xcls_ProjectSettings _this;
154 public Xcls_label_database(Xcls_ProjectSettings _owner )
157 _this.label_database = this;
158 this.el = new Gtk.Label( "Database" );
162 // set gobject values
165 // user defined functions
167 public class Xcls_HBox5 : Object
170 private Xcls_ProjectSettings _this;
176 public Xcls_HBox5(Xcls_ProjectSettings _owner )
179 this.el = new Gtk.HBox( true, 0 );
183 // set gobject values
184 this.el.expand = false;
185 this.el.vexpand = false;
186 var child_0 = new Xcls_Button6( _this );
188 this.el.add ( child_0.el );
189 var child_1 = new Xcls_Button7( _this );
191 this.el.add ( child_1.el );
194 // user defined functions
196 public class Xcls_Button6 : Object
198 public Gtk.Button el;
199 private Xcls_ProjectSettings _this;
205 public Xcls_Button6(Xcls_ProjectSettings _owner )
208 this.el = new Gtk.Button();
212 // set gobject values
213 this.el.label = "Apply";
216 this.el.button_press_event.connect( () => {
219 _this.buttonPressed("apply");
224 // user defined functions
226 public class Xcls_Button7 : Object
228 public Gtk.Button el;
229 private Xcls_ProjectSettings _this;
235 public Xcls_Button7(Xcls_ProjectSettings _owner )
238 this.el = new Gtk.Button();
242 // set gobject values
243 this.el.label = "Save";
246 this.el.button_press_event.connect( () => {
249 _this.buttonPressed("save");
254 // user defined functions
256 public class Xcls_HBox8 : Object
259 private Xcls_ProjectSettings _this;
265 public Xcls_HBox8(Xcls_ProjectSettings _owner )
268 this.el = new Gtk.HBox( true, 0 );
272 // set gobject values
273 this.el.expand = false;
274 this.el.vexpand = false;
275 var child_0 = new Xcls_Button9( _this );
277 this.el.add ( child_0.el );
278 var child_1 = new Xcls_Button10( _this );
280 this.el.add ( child_1.el );
283 // user defined functions
285 public class Xcls_Button9 : Object
287 public Gtk.Button el;
288 private Xcls_ProjectSettings _this;
294 public Xcls_Button9(Xcls_ProjectSettings _owner )
297 this.el = new Gtk.Button();
301 // set gobject values
302 this.el.label = "Apply";
305 this.el.button_press_event.connect( () => {
308 _this.buttonPressed("apply");
313 // user defined functions
315 public class Xcls_Button10 : Object
317 public Gtk.Button el;
318 private Xcls_ProjectSettings _this;
324 public Xcls_Button10(Xcls_ProjectSettings _owner )
327 this.el = new Gtk.Button();
331 // set gobject values
332 this.el.label = "Save";
335 this.el.button_press_event.connect( () => {
338 _this.buttonPressed("save");
343 // user defined functions
345 public class Xcls_path : Object
348 private Xcls_ProjectSettings _this;
354 public Xcls_path(Xcls_ProjectSettings _owner )
358 this.el = new Gtk.Label( "filename" );
362 // set gobject values
366 // user defined functions
368 public class Xcls_Label12 : Object
371 private Xcls_ProjectSettings _this;
377 public Xcls_Label12(Xcls_ProjectSettings _owner )
380 this.el = new Gtk.Label( "HTML To insert at end of <HEAD>" );
384 // set gobject values
387 // user defined functions
389 public class Xcls_HBox13 : Object
392 private Xcls_ProjectSettings _this;
398 public Xcls_HBox13(Xcls_ProjectSettings _owner )
401 this.el = new Gtk.HBox( false, 0 );
405 // set gobject values
406 this.el.expand = false;
407 var child_0 = new Xcls_Label14( _this );
409 this.el.pack_start ( child_0.el , false,false,0 );
410 var child_1 = new Xcls_base_template( _this );
412 this.el.add ( child_1.el );
415 // user defined functions
417 public class Xcls_Label14 : Object
420 private Xcls_ProjectSettings _this;
426 public Xcls_Label14(Xcls_ProjectSettings _owner )
429 this.el = new Gtk.Label( "HTML template file" );
433 // set gobject values
436 // user defined functions
438 public class Xcls_base_template : Object
441 private Xcls_ProjectSettings _this;
447 public Xcls_base_template(Xcls_ProjectSettings _owner )
450 _this.base_template = this;
451 this.el = new Gtk.Entry();
455 // set gobject values
458 // user defined functions
460 public class Xcls_HBox16 : Object
463 private Xcls_ProjectSettings _this;
469 public Xcls_HBox16(Xcls_ProjectSettings _owner )
472 this.el = new Gtk.HBox( false, 0 );
476 // set gobject values
477 this.el.expand = false;
478 var child_0 = new Xcls_Label17( _this );
480 this.el.pack_start ( child_0.el , false,false,0 );
481 var child_1 = new Xcls_rootURL( _this );
483 this.el.add ( child_1.el );
486 // user defined functions
488 public class Xcls_Label17 : Object
491 private Xcls_ProjectSettings _this;
497 public Xcls_Label17(Xcls_ProjectSettings _owner )
500 this.el = new Gtk.Label( "root URL" );
504 // set gobject values
507 // user defined functions
509 public class Xcls_rootURL : Object
512 private Xcls_ProjectSettings _this;
518 public Xcls_rootURL(Xcls_ProjectSettings _owner )
521 _this.rootURL = this;
522 this.el = new Gtk.Entry();
526 // set gobject values
529 // user defined functions
531 public class Xcls_ScrolledWindow19 : Object
533 public Gtk.ScrolledWindow el;
534 private Xcls_ProjectSettings _this;
540 public Xcls_ScrolledWindow19(Xcls_ProjectSettings _owner )
543 this.el = new Gtk.ScrolledWindow( null, null );
547 // set gobject values
548 var child_0 = new Xcls_view( _this );
550 this.el.add ( child_0.el );
553 // user defined functions
555 public class Xcls_view : Object
557 public Gtk.SourceView el;
558 private Xcls_ProjectSettings _this;
564 public Xcls_view(Xcls_ProjectSettings _owner )
568 this.el = new Gtk.SourceView();
572 // set gobject values
576 var description = Pango.FontDescription.from_string("monospace");
577 description.set_size(9000);
578 this.el.override_font(description);
581 this.el.key_release_event.connect( ( event) =>{
582 if (event.keyval != 115) {
586 if ( (event.state & Gdk.ModifierType.CONTROL_MASK ) < 1 ) {
589 var buf = this.el.get_buffer();
592 buf.get_start_iter(out s);
593 buf.get_end_iter(out e);
594 _this.project.runhtml = buf.get_text(s,e,true);
597 _this.buttonPressed("save");
604 // user defined functions