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_HBox2( _this );
36 this.el.pack_start ( child_0.el , false,false,0 );
37 var child_1 = new Xcls_path( _this );
39 this.el.pack_start ( child_1.el , false,false,0 );
40 var child_2 = new Xcls_Label6( _this );
42 this.el.pack_start ( child_2.el , false,false,0 );
43 var child_3 = new Xcls_HBox7( _this );
45 this.el.pack_start ( child_3.el , false,false,0 );
46 var child_4 = new Xcls_HBox10( _this );
48 this.el.pack_start ( child_4.el , false,false,0 );
49 var child_5 = new Xcls_ScrolledWindow13( _this );
51 this.el.pack_start ( child_5.el , true,true,0 );
54 // user defined functions
55 public void show (Project.Project project) {
56 _this.project = project;
57 _this.path.el.label = project.firstPath();
58 // get the active project.
59 var lm = Gtk.SourceLanguageManager.get_default();
61 ((Gtk.SourceBuffer)(_this.view.el.get_buffer())) .set_language(
63 lm.get_language("html"));
66 //project.runhtml = project.runhtml || '';
67 _this.view.el.get_buffer().set_text(project.runhtml);
70 _this.rootURL.el.set_text( _this.project.rootURL );
71 _this.base_template.el.set_text(_this.project.base_template);
78 var buf = _this.view.el.get_buffer();
81 buf.get_start_iter(out s);
82 buf.get_end_iter(out e);
83 _this.project.runhtml = buf.get_text(s,e,true);
85 _this.project.rootURL = _this.rootURL.el.get_text();
86 _this.project.base_template = _this.base_template.el.get_text();
90 public class Xcls_HBox2 : Object
93 private Xcls_ProjectSettings _this;
99 public Xcls_HBox2(Xcls_ProjectSettings _owner )
102 this.el = new Gtk.HBox( true, 0 );
106 // set gobject values
107 this.el.expand = false;
108 this.el.vexpand = false;
109 var child_0 = new Xcls_Button3( _this );
111 this.el.add ( child_0.el );
112 var child_1 = new Xcls_Button4( _this );
114 this.el.add ( child_1.el );
117 // user defined functions
119 public class Xcls_Button3 : Object
121 public Gtk.Button el;
122 private Xcls_ProjectSettings _this;
128 public Xcls_Button3(Xcls_ProjectSettings _owner )
131 this.el = new Gtk.Button();
135 // set gobject values
136 this.el.label = "Apply";
139 this.el.button_press_event.connect( () => {
142 _this.buttonPressed("apply");
147 // user defined functions
149 public class Xcls_Button4 : Object
151 public Gtk.Button el;
152 private Xcls_ProjectSettings _this;
158 public Xcls_Button4(Xcls_ProjectSettings _owner )
161 this.el = new Gtk.Button();
165 // set gobject values
166 this.el.label = "Save";
169 this.el.button_press_event.connect( () => {
172 _this.buttonPressed("save");
177 // user defined functions
179 public class Xcls_path : Object
182 private Xcls_ProjectSettings _this;
188 public Xcls_path(Xcls_ProjectSettings _owner )
192 this.el = new Gtk.Label( "filename" );
196 // set gobject values
200 // user defined functions
202 public class Xcls_Label6 : Object
205 private Xcls_ProjectSettings _this;
211 public Xcls_Label6(Xcls_ProjectSettings _owner )
214 this.el = new Gtk.Label( "HTML To insert at end of <HEAD>" );
218 // set gobject values
221 // user defined functions
223 public class Xcls_HBox7 : Object
226 private Xcls_ProjectSettings _this;
232 public Xcls_HBox7(Xcls_ProjectSettings _owner )
235 this.el = new Gtk.HBox( false, 0 );
239 // set gobject values
240 this.el.expand = false;
241 var child_0 = new Xcls_Label8( _this );
243 this.el.pack_start ( child_0.el , false,false,0 );
244 var child_1 = new Xcls_base_template( _this );
246 this.el.add ( child_1.el );
249 // user defined functions
251 public class Xcls_Label8 : Object
254 private Xcls_ProjectSettings _this;
260 public Xcls_Label8(Xcls_ProjectSettings _owner )
263 this.el = new Gtk.Label( "HTML template file" );
267 // set gobject values
270 // user defined functions
272 public class Xcls_base_template : Object
275 private Xcls_ProjectSettings _this;
281 public Xcls_base_template(Xcls_ProjectSettings _owner )
284 _this.base_template = this;
285 this.el = new Gtk.Entry();
289 // set gobject values
292 // user defined functions
294 public class Xcls_HBox10 : Object
297 private Xcls_ProjectSettings _this;
303 public Xcls_HBox10(Xcls_ProjectSettings _owner )
306 this.el = new Gtk.HBox( false, 0 );
310 // set gobject values
311 this.el.expand = false;
312 var child_0 = new Xcls_Label11( _this );
314 this.el.pack_start ( child_0.el , false,false,0 );
315 var child_1 = new Xcls_rootURL( _this );
317 this.el.add ( child_1.el );
320 // user defined functions
322 public class Xcls_Label11 : Object
325 private Xcls_ProjectSettings _this;
331 public Xcls_Label11(Xcls_ProjectSettings _owner )
334 this.el = new Gtk.Label( "root URL" );
338 // set gobject values
341 // user defined functions
343 public class Xcls_rootURL : Object
346 private Xcls_ProjectSettings _this;
352 public Xcls_rootURL(Xcls_ProjectSettings _owner )
355 _this.rootURL = this;
356 this.el = new Gtk.Entry();
360 // set gobject values
363 // user defined functions
365 public class Xcls_ScrolledWindow13 : Object
367 public Gtk.ScrolledWindow el;
368 private Xcls_ProjectSettings _this;
374 public Xcls_ScrolledWindow13(Xcls_ProjectSettings _owner )
377 this.el = new Gtk.ScrolledWindow( null, null );
381 // set gobject values
382 var child_0 = new Xcls_view( _this );
384 this.el.add ( child_0.el );
387 // user defined functions
389 public class Xcls_view : Object
391 public Gtk.SourceView el;
392 private Xcls_ProjectSettings _this;
398 public Xcls_view(Xcls_ProjectSettings _owner )
402 this.el = new Gtk.SourceView();
406 // set gobject values
410 var description = Pango.FontDescription.from_string("monospace");
411 description.set_size(9000);
412 this.el.override_font(description);
414 this.el.key_release_event.connect( ( event) =>{
415 if (event.keyval != 115) {
419 if ( (event.state & Gdk.ModifierType.CONTROL_MASK ) < 1 ) {
422 var buf = this.el.get_buffer();
425 buf.get_start_iter(out s);
426 buf.get_end_iter(out e);
427 _this.project.runhtml = buf.get_text(s,e,true);
430 _this.buttonPressed("save");
437 // user defined functions