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_HBox5( _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_Label9( _this );
47 this.el.pack_start ( child_3.el , false,false,0 );
48 var child_4 = new Xcls_HBox10( _this );
50 this.el.pack_start ( child_4.el , false,false,0 );
51 var child_5 = new Xcls_HBox13( _this );
53 this.el.pack_start ( child_5.el , false,false,0 );
54 var child_6 = new Xcls_ScrolledWindow16( _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 );
118 // user defined functions
120 public class Xcls_label_global : Object
123 private Xcls_ProjectSettings _this;
129 public Xcls_label_global(Xcls_ProjectSettings _owner )
132 _this.label_global = this;
133 this.el = new Gtk.Label( "Global" );
137 // set gobject values
140 // user defined functions
142 public class Xcls_label_database : Object
145 private Xcls_ProjectSettings _this;
151 public Xcls_label_database(Xcls_ProjectSettings _owner )
154 _this.label_database = this;
155 this.el = new Gtk.Label( "Targets" );
159 // set gobject values
162 // user defined functions
164 public class Xcls_HBox5 : Object
167 private Xcls_ProjectSettings _this;
173 public Xcls_HBox5(Xcls_ProjectSettings _owner )
176 this.el = new Gtk.HBox( true, 0 );
180 // set gobject values
181 this.el.expand = false;
182 this.el.vexpand = false;
183 var child_0 = new Xcls_Button6( _this );
185 this.el.add ( child_0.el );
186 var child_1 = new Xcls_Button7( _this );
188 this.el.add ( child_1.el );
191 // user defined functions
193 public class Xcls_Button6 : Object
195 public Gtk.Button el;
196 private Xcls_ProjectSettings _this;
202 public Xcls_Button6(Xcls_ProjectSettings _owner )
205 this.el = new Gtk.Button();
209 // set gobject values
210 this.el.label = "Apply";
213 this.el.button_press_event.connect( () => {
216 _this.buttonPressed("apply");
221 // user defined functions
223 public class Xcls_Button7 : Object
225 public Gtk.Button el;
226 private Xcls_ProjectSettings _this;
232 public Xcls_Button7(Xcls_ProjectSettings _owner )
235 this.el = new Gtk.Button();
239 // set gobject values
240 this.el.label = "Save";
243 this.el.button_press_event.connect( () => {
246 _this.buttonPressed("save");
251 // user defined functions
253 public class Xcls_path : Object
256 private Xcls_ProjectSettings _this;
262 public Xcls_path(Xcls_ProjectSettings _owner )
266 this.el = new Gtk.Label( "filename" );
270 // set gobject values
274 // user defined functions
276 public class Xcls_Label9 : Object
279 private Xcls_ProjectSettings _this;
285 public Xcls_Label9(Xcls_ProjectSettings _owner )
288 this.el = new Gtk.Label( "HTML To insert at end of <HEAD>" );
292 // set gobject values
295 // user defined functions
297 public class Xcls_HBox10 : Object
300 private Xcls_ProjectSettings _this;
306 public Xcls_HBox10(Xcls_ProjectSettings _owner )
309 this.el = new Gtk.HBox( false, 0 );
313 // set gobject values
314 this.el.expand = false;
315 var child_0 = new Xcls_Label11( _this );
317 this.el.pack_start ( child_0.el , false,false,0 );
318 var child_1 = new Xcls_base_template( _this );
320 this.el.add ( child_1.el );
323 // user defined functions
325 public class Xcls_Label11 : Object
328 private Xcls_ProjectSettings _this;
334 public Xcls_Label11(Xcls_ProjectSettings _owner )
337 this.el = new Gtk.Label( "HTML template file" );
341 // set gobject values
344 // user defined functions
346 public class Xcls_base_template : Object
349 private Xcls_ProjectSettings _this;
355 public Xcls_base_template(Xcls_ProjectSettings _owner )
358 _this.base_template = this;
359 this.el = new Gtk.Entry();
363 // set gobject values
366 // user defined functions
368 public class Xcls_HBox13 : Object
371 private Xcls_ProjectSettings _this;
377 public Xcls_HBox13(Xcls_ProjectSettings _owner )
380 this.el = new Gtk.HBox( false, 0 );
384 // set gobject values
385 this.el.expand = false;
386 var child_0 = new Xcls_Label14( _this );
388 this.el.pack_start ( child_0.el , false,false,0 );
389 var child_1 = new Xcls_rootURL( _this );
391 this.el.add ( child_1.el );
394 // user defined functions
396 public class Xcls_Label14 : Object
399 private Xcls_ProjectSettings _this;
405 public Xcls_Label14(Xcls_ProjectSettings _owner )
408 this.el = new Gtk.Label( "root URL" );
412 // set gobject values
415 // user defined functions
417 public class Xcls_rootURL : Object
420 private Xcls_ProjectSettings _this;
426 public Xcls_rootURL(Xcls_ProjectSettings _owner )
429 _this.rootURL = this;
430 this.el = new Gtk.Entry();
434 // set gobject values
437 // user defined functions
439 public class Xcls_ScrolledWindow16 : Object
441 public Gtk.ScrolledWindow el;
442 private Xcls_ProjectSettings _this;
448 public Xcls_ScrolledWindow16(Xcls_ProjectSettings _owner )
451 this.el = new Gtk.ScrolledWindow( null, null );
455 // set gobject values
456 var child_0 = new Xcls_view( _this );
458 this.el.add ( child_0.el );
461 // user defined functions
463 public class Xcls_view : Object
465 public Gtk.SourceView el;
466 private Xcls_ProjectSettings _this;
472 public Xcls_view(Xcls_ProjectSettings _owner )
476 this.el = new Gtk.SourceView();
480 // set gobject values
484 var description = Pango.FontDescription.from_string("monospace");
485 description.set_size(9000);
486 this.el.override_font(description);
489 this.el.key_release_event.connect( ( event) =>{
490 if (event.keyval != 115) {
494 if ( (event.state & Gdk.ModifierType.CONTROL_MASK ) < 1 ) {
497 var buf = this.el.get_buffer();
500 buf.get_start_iter(out s);
501 buf.get_end_iter(out e);
502 _this.project.runhtml = buf.get_text(s,e,true);
505 _this.buttonPressed("save");
512 // user defined functions