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_path path;
16 public Xcls_base_template base_template;
17 public Xcls_rootURL rootURL;
18 public Xcls_view view;
21 public signal void buttonPressed (string btn);
22 public Project.Project project;
25 public Xcls_ProjectSettings()
28 this.el = new Gtk.VBox( false, 0 );
33 this.el.border_width = 5;
34 var child_0 = new Xcls_Notebook2( _this );
36 this.el.pack_start ( child_0.el , true,true,0 );
37 var child_1 = new Xcls_HBox3( _this );
39 this.el.pack_start ( child_1.el , false,false,0 );
40 var child_2 = new Xcls_path( _this );
42 this.el.pack_start ( child_2.el , false,false,0 );
43 var child_3 = new Xcls_Label7( _this );
45 this.el.pack_start ( child_3.el , false,false,0 );
46 var child_4 = new Xcls_HBox8( _this );
48 this.el.pack_start ( child_4.el , false,false,0 );
49 var child_5 = new Xcls_HBox11( _this );
51 this.el.pack_start ( child_5.el , false,false,0 );
52 var child_6 = new Xcls_ScrolledWindow14( _this );
54 this.el.pack_start ( child_6.el , true,true,0 );
57 // user defined functions
58 public void show (Project.Project project) {
59 _this.project = project;
60 _this.path.el.label = project.firstPath();
61 // get the active project.
62 var lm = Gtk.SourceLanguageManager.get_default();
64 ((Gtk.SourceBuffer)(_this.view.el.get_buffer())) .set_language(
66 lm.get_language("html"));
69 //project.runhtml = project.runhtml || '';
70 _this.view.el.get_buffer().set_text(project.runhtml);
73 _this.rootURL.el.set_text( _this.project.rootURL );
74 _this.base_template.el.set_text(_this.project.base_template);
81 var buf = _this.view.el.get_buffer();
84 buf.get_start_iter(out s);
85 buf.get_end_iter(out e);
86 _this.project.runhtml = buf.get_text(s,e,true);
88 _this.project.rootURL = _this.rootURL.el.get_text();
89 _this.project.base_template = _this.base_template.el.get_text();
93 public class Xcls_Notebook2 : Object
95 public Gtk.Notebook el;
96 private Xcls_ProjectSettings _this;
102 public Xcls_Notebook2(Xcls_ProjectSettings _owner )
105 this.el = new Gtk.Notebook();
109 // set gobject values
112 // user defined functions
114 public class Xcls_HBox3 : Object
117 private Xcls_ProjectSettings _this;
123 public Xcls_HBox3(Xcls_ProjectSettings _owner )
126 this.el = new Gtk.HBox( true, 0 );
130 // set gobject values
131 this.el.expand = false;
132 this.el.vexpand = false;
133 var child_0 = new Xcls_Button4( _this );
135 this.el.add ( child_0.el );
136 var child_1 = new Xcls_Button5( _this );
138 this.el.add ( child_1.el );
141 // user defined functions
143 public class Xcls_Button4 : Object
145 public Gtk.Button el;
146 private Xcls_ProjectSettings _this;
152 public Xcls_Button4(Xcls_ProjectSettings _owner )
155 this.el = new Gtk.Button();
159 // set gobject values
160 this.el.label = "Apply";
163 this.el.button_press_event.connect( () => {
166 _this.buttonPressed("apply");
171 // user defined functions
173 public class Xcls_Button5 : Object
175 public Gtk.Button el;
176 private Xcls_ProjectSettings _this;
182 public Xcls_Button5(Xcls_ProjectSettings _owner )
185 this.el = new Gtk.Button();
189 // set gobject values
190 this.el.label = "Save";
193 this.el.button_press_event.connect( () => {
196 _this.buttonPressed("save");
201 // user defined functions
203 public class Xcls_path : Object
206 private Xcls_ProjectSettings _this;
212 public Xcls_path(Xcls_ProjectSettings _owner )
216 this.el = new Gtk.Label( "filename" );
220 // set gobject values
224 // user defined functions
226 public class Xcls_Label7 : Object
229 private Xcls_ProjectSettings _this;
235 public Xcls_Label7(Xcls_ProjectSettings _owner )
238 this.el = new Gtk.Label( "HTML To insert at end of <HEAD>" );
242 // set gobject values
245 // user defined functions
247 public class Xcls_HBox8 : Object
250 private Xcls_ProjectSettings _this;
256 public Xcls_HBox8(Xcls_ProjectSettings _owner )
259 this.el = new Gtk.HBox( false, 0 );
263 // set gobject values
264 this.el.expand = false;
265 var child_0 = new Xcls_Label9( _this );
267 this.el.pack_start ( child_0.el , false,false,0 );
268 var child_1 = new Xcls_base_template( _this );
270 this.el.add ( child_1.el );
273 // user defined functions
275 public class Xcls_Label9 : Object
278 private Xcls_ProjectSettings _this;
284 public Xcls_Label9(Xcls_ProjectSettings _owner )
287 this.el = new Gtk.Label( "HTML template file" );
291 // set gobject values
294 // user defined functions
296 public class Xcls_base_template : Object
299 private Xcls_ProjectSettings _this;
305 public Xcls_base_template(Xcls_ProjectSettings _owner )
308 _this.base_template = this;
309 this.el = new Gtk.Entry();
313 // set gobject values
316 // user defined functions
318 public class Xcls_HBox11 : Object
321 private Xcls_ProjectSettings _this;
327 public Xcls_HBox11(Xcls_ProjectSettings _owner )
330 this.el = new Gtk.HBox( false, 0 );
334 // set gobject values
335 this.el.expand = false;
336 var child_0 = new Xcls_Label12( _this );
338 this.el.pack_start ( child_0.el , false,false,0 );
339 var child_1 = new Xcls_rootURL( _this );
341 this.el.add ( child_1.el );
344 // user defined functions
346 public class Xcls_Label12 : Object
349 private Xcls_ProjectSettings _this;
355 public Xcls_Label12(Xcls_ProjectSettings _owner )
358 this.el = new Gtk.Label( "root URL" );
362 // set gobject values
365 // user defined functions
367 public class Xcls_rootURL : Object
370 private Xcls_ProjectSettings _this;
376 public Xcls_rootURL(Xcls_ProjectSettings _owner )
379 _this.rootURL = this;
380 this.el = new Gtk.Entry();
384 // set gobject values
387 // user defined functions
389 public class Xcls_ScrolledWindow14 : Object
391 public Gtk.ScrolledWindow el;
392 private Xcls_ProjectSettings _this;
398 public Xcls_ScrolledWindow14(Xcls_ProjectSettings _owner )
401 this.el = new Gtk.ScrolledWindow( null, null );
405 // set gobject values
406 var child_0 = new Xcls_view( _this );
408 this.el.add ( child_0.el );
411 // user defined functions
413 public class Xcls_view : Object
415 public Gtk.SourceView el;
416 private Xcls_ProjectSettings _this;
422 public Xcls_view(Xcls_ProjectSettings _owner )
426 this.el = new Gtk.SourceView();
430 // set gobject values
434 var description = Pango.FontDescription.from_string("monospace");
435 description.set_size(9000);
436 this.el.override_font(description);
439 this.el.key_release_event.connect( ( event) =>{
440 if (event.keyval != 115) {
444 if ( (event.state & Gdk.ModifierType.CONTROL_MASK ) < 1 ) {
447 var buf = this.el.get_buffer();
450 buf.get_start_iter(out s);
451 buf.get_end_iter(out e);
452 _this.project.runhtml = buf.get_text(s,e,true);
455 _this.buttonPressed("save");
462 // user defined functions