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_HBox2( _this );
38 this.el.pack_start ( child_0.el , false,false,0 );
39 var child_1 = new Xcls_Notebook5( _this );
41 this.el.pack_start ( child_1.el , true,true,0 );
44 // user defined functions
45 public void show (Project.Project project) {
46 _this.project = project;
47 _this.path.el.label = project.firstPath();
48 // get the active project.
49 var lm = Gtk.SourceLanguageManager.get_default();
51 ((Gtk.SourceBuffer)(_this.view.el.get_buffer())) .set_language(
53 lm.get_language("html"));
56 //project.runhtml = project.runhtml || '';
57 _this.view.el.get_buffer().set_text(project.runhtml);
60 _this.rootURL.el.set_text( _this.project.rootURL );
61 _this.base_template.el.set_text(_this.project.base_template);
68 var buf = _this.view.el.get_buffer();
71 buf.get_start_iter(out s);
72 buf.get_end_iter(out e);
73 _this.project.runhtml = buf.get_text(s,e,true);
75 _this.project.rootURL = _this.rootURL.el.get_text();
76 _this.project.base_template = _this.base_template.el.get_text();
80 public class Xcls_HBox2 : Object
83 private Xcls_ProjectSettings _this;
89 public Xcls_HBox2(Xcls_ProjectSettings _owner )
92 this.el = new Gtk.HBox( true, 0 );
97 this.el.expand = false;
98 this.el.vexpand = false;
99 var child_0 = new Xcls_Button3( _this );
101 this.el.add ( child_0.el );
102 var child_1 = new Xcls_Button4( _this );
104 this.el.add ( child_1.el );
107 // user defined functions
109 public class Xcls_Button3 : Object
111 public Gtk.Button el;
112 private Xcls_ProjectSettings _this;
118 public Xcls_Button3(Xcls_ProjectSettings _owner )
121 this.el = new Gtk.Button();
125 // set gobject values
126 this.el.label = "Apply";
129 this.el.button_press_event.connect( () => {
132 _this.buttonPressed("apply");
137 // user defined functions
139 public class Xcls_Button4 : Object
141 public Gtk.Button el;
142 private Xcls_ProjectSettings _this;
148 public Xcls_Button4(Xcls_ProjectSettings _owner )
151 this.el = new Gtk.Button();
155 // set gobject values
156 this.el.label = "Save";
159 this.el.button_press_event.connect( () => {
162 _this.buttonPressed("save");
167 // user defined functions
169 public class Xcls_Notebook5 : Object
171 public Gtk.Notebook el;
172 private Xcls_ProjectSettings _this;
178 public Xcls_Notebook5(Xcls_ProjectSettings _owner )
181 this.el = new Gtk.Notebook();
185 // set gobject values
186 var child_0 = new Xcls_label_global( _this );
188 var child_1 = new Xcls_label_database( _this );
190 var child_2 = new Xcls_VBox8( _this );
192 this.el.append_page ( child_2.el , _this.label_global.el );
195 // user defined functions
197 public class Xcls_label_global : Object
200 private Xcls_ProjectSettings _this;
206 public Xcls_label_global(Xcls_ProjectSettings _owner )
209 _this.label_global = this;
210 this.el = new Gtk.Label( "Global" );
214 // set gobject values
217 // user defined functions
219 public class Xcls_label_database : Object
222 private Xcls_ProjectSettings _this;
228 public Xcls_label_database(Xcls_ProjectSettings _owner )
231 _this.label_database = this;
232 this.el = new Gtk.Label( "Database" );
236 // set gobject values
239 // user defined functions
241 public class Xcls_VBox8 : Object
244 private Xcls_ProjectSettings _this;
250 public Xcls_VBox8(Xcls_ProjectSettings _owner )
253 this.el = new Gtk.VBox( false, 0 );
257 // set gobject values
258 var child_0 = new Xcls_path( _this );
260 this.el.pack_start ( child_0.el , false,false,0 );
261 var child_1 = new Xcls_Label10( _this );
263 this.el.pack_start ( child_1.el , false,false,0 );
264 var child_2 = new Xcls_HBox11( _this );
266 this.el.pack_start ( child_2.el , false,false,0 );
267 var child_3 = new Xcls_HBox14( _this );
269 this.el.pack_start ( child_3.el , false,false,0 );
270 var child_4 = new Xcls_ScrolledWindow17( _this );
272 this.el.pack_start ( child_4.el , true,true,0 );
275 // user defined functions
277 public class Xcls_path : Object
280 private Xcls_ProjectSettings _this;
286 public Xcls_path(Xcls_ProjectSettings _owner )
290 this.el = new Gtk.Label( "filename" );
294 // set gobject values
298 // user defined functions
300 public class Xcls_Label10 : Object
303 private Xcls_ProjectSettings _this;
309 public Xcls_Label10(Xcls_ProjectSettings _owner )
312 this.el = new Gtk.Label( "HTML To insert at end of <HEAD>" );
316 // set gobject values
319 // user defined functions
321 public class Xcls_HBox11 : Object
324 private Xcls_ProjectSettings _this;
330 public Xcls_HBox11(Xcls_ProjectSettings _owner )
333 this.el = new Gtk.HBox( false, 0 );
337 // set gobject values
338 this.el.expand = false;
339 var child_0 = new Xcls_Label12( _this );
341 this.el.pack_start ( child_0.el , false,false,0 );
342 var child_1 = new Xcls_base_template( _this );
344 this.el.add ( child_1.el );
347 // user defined functions
349 public class Xcls_Label12 : Object
352 private Xcls_ProjectSettings _this;
358 public Xcls_Label12(Xcls_ProjectSettings _owner )
361 this.el = new Gtk.Label( "HTML template file" );
365 // set gobject values
368 // user defined functions
370 public class Xcls_base_template : Object
373 private Xcls_ProjectSettings _this;
379 public Xcls_base_template(Xcls_ProjectSettings _owner )
382 _this.base_template = this;
383 this.el = new Gtk.Entry();
387 // set gobject values
390 // user defined functions
392 public class Xcls_HBox14 : Object
395 private Xcls_ProjectSettings _this;
401 public Xcls_HBox14(Xcls_ProjectSettings _owner )
404 this.el = new Gtk.HBox( false, 0 );
408 // set gobject values
409 this.el.expand = false;
410 var child_0 = new Xcls_Label15( _this );
412 this.el.pack_start ( child_0.el , false,false,0 );
413 var child_1 = new Xcls_rootURL( _this );
415 this.el.add ( child_1.el );
418 // user defined functions
420 public class Xcls_Label15 : Object
423 private Xcls_ProjectSettings _this;
429 public Xcls_Label15(Xcls_ProjectSettings _owner )
432 this.el = new Gtk.Label( "root URL" );
436 // set gobject values
439 // user defined functions
441 public class Xcls_rootURL : Object
444 private Xcls_ProjectSettings _this;
450 public Xcls_rootURL(Xcls_ProjectSettings _owner )
453 _this.rootURL = this;
454 this.el = new Gtk.Entry();
458 // set gobject values
461 // user defined functions
463 public class Xcls_ScrolledWindow17 : Object
465 public Gtk.ScrolledWindow el;
466 private Xcls_ProjectSettings _this;
472 public Xcls_ScrolledWindow17(Xcls_ProjectSettings _owner )
475 this.el = new Gtk.ScrolledWindow( null, null );
479 // set gobject values
480 var child_0 = new Xcls_view( _this );
482 this.el.add ( child_0.el );
485 // user defined functions
487 public class Xcls_view : Object
489 public Gtk.SourceView el;
490 private Xcls_ProjectSettings _this;
496 public Xcls_view(Xcls_ProjectSettings _owner )
500 this.el = new Gtk.SourceView();
504 // set gobject values
508 var description = Pango.FontDescription.from_string("monospace");
509 description.set_size(9000);
510 this.el.override_font(description);
513 this.el.key_release_event.connect( ( event) =>{
514 if (event.keyval != 115) {
518 if ( (event.state & Gdk.ModifierType.CONTROL_MASK ) < 1 ) {
521 var buf = this.el.get_buffer();
524 buf.get_start_iter(out s);
525 buf.get_end_iter(out e);
526 _this.project.runhtml = buf.get_text(s,e,true);
529 _this.buttonPressed("save");
536 // user defined functions