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;
21 public Xcls_database_DBTYPE database_DBTYPE;
22 public Xcls_database_DBTYPE database_DBTYPE;
23 public Xcls_database_DBUSERNAME database_DBUSERNAME;
24 public Xcls_database_DBPASSWORD database_DBPASSWORD;
27 public signal void buttonPressed (string btn);
28 public Project.Project project;
31 public Xcls_ProjectSettings()
34 this.el = new Gtk.VBox( false, 0 );
39 this.el.border_width = 5;
40 var child_0 = new Xcls_HBox2( _this );
42 this.el.pack_start ( child_0.el , false,false,0 );
43 var child_1 = new Xcls_Notebook5( _this );
45 this.el.pack_end ( child_1.el , true,true,0 );
48 // user defined functions
49 public void show (Project.Project project) {
50 _this.project = project;
51 _this.path.el.label = project.firstPath();
52 // get the active project.
53 var lm = Gtk.SourceLanguageManager.get_default();
55 ((Gtk.SourceBuffer)(_this.view.el.get_buffer())) .set_language(
57 lm.get_language("html"));
60 //project.runhtml = project.runhtml || '';
61 _this.view.el.get_buffer().set_text(project.runhtml);
64 _this.rootURL.el.set_text( _this.project.rootURL );
65 _this.base_template.el.set_text(_this.project.base_template);
72 var buf = _this.view.el.get_buffer();
75 buf.get_start_iter(out s);
76 buf.get_end_iter(out e);
77 _this.project.runhtml = buf.get_text(s,e,true);
79 _this.project.rootURL = _this.rootURL.el.get_text();
80 _this.project.base_template = _this.base_template.el.get_text();
84 public class Xcls_HBox2 : Object
87 private Xcls_ProjectSettings _this;
93 public Xcls_HBox2(Xcls_ProjectSettings _owner )
96 this.el = new Gtk.HBox( true, 0 );
100 // set gobject values
101 this.el.expand = false;
102 this.el.vexpand = false;
103 var child_0 = new Xcls_Button3( _this );
105 this.el.add ( child_0.el );
106 var child_1 = new Xcls_Button4( _this );
108 this.el.add ( child_1.el );
111 // user defined functions
113 public class Xcls_Button3 : Object
115 public Gtk.Button el;
116 private Xcls_ProjectSettings _this;
122 public Xcls_Button3(Xcls_ProjectSettings _owner )
125 this.el = new Gtk.Button();
129 // set gobject values
130 this.el.label = "Apply";
133 this.el.button_press_event.connect( () => {
136 _this.buttonPressed("apply");
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 = "Save";
163 this.el.button_press_event.connect( () => {
166 _this.buttonPressed("save");
171 // user defined functions
173 public class Xcls_Notebook5 : Object
175 public Gtk.Notebook el;
176 private Xcls_ProjectSettings _this;
182 public Xcls_Notebook5(Xcls_ProjectSettings _owner )
185 this.el = new Gtk.Notebook();
189 // set gobject values
190 var child_0 = new Xcls_label_global( _this );
192 var child_1 = new Xcls_label_database( _this );
194 var child_2 = new Xcls_VBox8( _this );
196 this.el.append_page ( child_2.el , _this.label_global.el );
197 var child_3 = new Xcls_VBox19( _this );
199 this.el.append_page ( child_3.el , _this.label_database.el );
202 // user defined functions
204 public class Xcls_label_global : Object
207 private Xcls_ProjectSettings _this;
213 public Xcls_label_global(Xcls_ProjectSettings _owner )
216 _this.label_global = this;
217 this.el = new Gtk.Label( "Global" );
221 // set gobject values
224 // user defined functions
226 public class Xcls_label_database : Object
229 private Xcls_ProjectSettings _this;
235 public Xcls_label_database(Xcls_ProjectSettings _owner )
238 _this.label_database = this;
239 this.el = new Gtk.Label( "Database" );
243 // set gobject values
246 // user defined functions
248 public class Xcls_VBox8 : Object
251 private Xcls_ProjectSettings _this;
257 public Xcls_VBox8(Xcls_ProjectSettings _owner )
260 this.el = new Gtk.VBox( false, 0 );
264 // set gobject values
265 var child_0 = new Xcls_path( _this );
267 this.el.pack_start ( child_0.el , false,false,0 );
268 var child_1 = new Xcls_HBox10( _this );
270 this.el.pack_start ( child_1.el , false,false,0 );
271 var child_2 = new Xcls_HBox13( _this );
273 this.el.pack_start ( child_2.el , false,false,0 );
274 var child_3 = new Xcls_Label16( _this );
276 this.el.pack_start ( child_3.el , false,false,0 );
277 var child_4 = new Xcls_ScrolledWindow17( _this );
279 this.el.pack_start ( child_4.el , true,true,0 );
282 // user defined functions
284 public class Xcls_path : Object
287 private Xcls_ProjectSettings _this;
293 public Xcls_path(Xcls_ProjectSettings _owner )
297 this.el = new Gtk.Label( "filename" );
301 // set gobject values
306 // user defined functions
308 public class Xcls_HBox10 : Object
311 private Xcls_ProjectSettings _this;
317 public Xcls_HBox10(Xcls_ProjectSettings _owner )
320 this.el = new Gtk.HBox( false, 0 );
324 // set gobject values
325 this.el.expand = false;
326 var child_0 = new Xcls_Label11( _this );
328 this.el.pack_start ( child_0.el , false,false,0 );
329 var child_1 = new Xcls_base_template( _this );
331 this.el.add ( child_1.el );
334 // user defined functions
336 public class Xcls_Label11 : Object
339 private Xcls_ProjectSettings _this;
345 public Xcls_Label11(Xcls_ProjectSettings _owner )
348 this.el = new Gtk.Label( "HTML template file" );
352 // set gobject values
356 // user defined functions
358 public class Xcls_base_template : Object
361 private Xcls_ProjectSettings _this;
367 public Xcls_base_template(Xcls_ProjectSettings _owner )
370 _this.base_template = this;
371 this.el = new Gtk.Entry();
375 // set gobject values
378 // user defined functions
380 public class Xcls_HBox13 : Object
383 private Xcls_ProjectSettings _this;
389 public Xcls_HBox13(Xcls_ProjectSettings _owner )
392 this.el = new Gtk.HBox( false, 0 );
396 // set gobject values
397 this.el.expand = false;
398 var child_0 = new Xcls_Label14( _this );
400 this.el.pack_start ( child_0.el , false,false,0 );
401 var child_1 = new Xcls_rootURL( _this );
403 this.el.add ( child_1.el );
406 // user defined functions
408 public class Xcls_Label14 : Object
411 private Xcls_ProjectSettings _this;
417 public Xcls_Label14(Xcls_ProjectSettings _owner )
420 this.el = new Gtk.Label( "root URL" );
424 // set gobject values
428 // user defined functions
430 public class Xcls_rootURL : Object
433 private Xcls_ProjectSettings _this;
439 public Xcls_rootURL(Xcls_ProjectSettings _owner )
442 _this.rootURL = this;
443 this.el = new Gtk.Entry();
447 // set gobject values
450 // user defined functions
452 public class Xcls_Label16 : Object
455 private Xcls_ProjectSettings _this;
461 public Xcls_Label16(Xcls_ProjectSettings _owner )
464 this.el = new Gtk.Label( "HTML To insert at end of <HEAD>" );
468 // set gobject values
471 // user defined functions
473 public class Xcls_ScrolledWindow17 : Object
475 public Gtk.ScrolledWindow el;
476 private Xcls_ProjectSettings _this;
482 public Xcls_ScrolledWindow17(Xcls_ProjectSettings _owner )
485 this.el = new Gtk.ScrolledWindow( null, null );
489 // set gobject values
490 var child_0 = new Xcls_view( _this );
492 this.el.add ( child_0.el );
495 // user defined functions
497 public class Xcls_view : Object
499 public Gtk.SourceView el;
500 private Xcls_ProjectSettings _this;
506 public Xcls_view(Xcls_ProjectSettings _owner )
510 this.el = new Gtk.SourceView();
514 // set gobject values
518 var description = Pango.FontDescription.from_string("monospace");
519 description.set_size(9000);
520 this.el.override_font(description);
523 this.el.key_release_event.connect( ( event) =>{
524 if (event.keyval != 115) {
528 if ( (event.state & Gdk.ModifierType.CONTROL_MASK ) < 1 ) {
531 var buf = this.el.get_buffer();
534 buf.get_start_iter(out s);
535 buf.get_end_iter(out e);
536 _this.project.runhtml = buf.get_text(s,e,true);
539 _this.buttonPressed("save");
546 // user defined functions
548 public class Xcls_VBox19 : Object
551 private Xcls_ProjectSettings _this;
557 public Xcls_VBox19(Xcls_ProjectSettings _owner )
560 this.el = new Gtk.VBox( false, 0 );
564 // set gobject values
565 var child_0 = new Xcls_Label20( _this );
567 this.el.pack_start ( child_0.el , false,false,0 );
568 var child_1 = new Xcls_database_DBTYPE( _this );
570 this.el.pack_start ( child_1.el , false,false,0 );
571 var child_2 = new Xcls_Label22( _this );
573 this.el.pack_start ( child_2.el , false,false,0 );
574 var child_3 = new Xcls_database_DBTYPE( _this );
576 this.el.pack_start ( child_3.el , false,false,0 );
577 var child_4 = new Xcls_Label24( _this );
579 this.el.pack_start ( child_4.el , false,false,0 );
580 var child_5 = new Xcls_database_DBUSERNAME( _this );
582 this.el.pack_start ( child_5.el , false,false,0 );
583 var child_6 = new Xcls_Label26( _this );
585 this.el.pack_start ( child_6.el , false,false,0 );
586 var child_7 = new Xcls_database_DBPASSWORD( _this );
588 this.el.pack_start ( child_7.el , false,false,0 );
589 var child_8 = new Xcls_Button28( _this );
591 this.el.pack_start ( child_8.el , false,false,0 );
594 // user defined functions
596 public class Xcls_Label20 : Object
599 private Xcls_ProjectSettings _this;
605 public Xcls_Label20(Xcls_ProjectSettings _owner )
608 this.el = new Gtk.Label( "Type (eg. MySQL or PostgreSQL)" );
612 // set gobject values
616 // user defined functions
618 public class Xcls_database_DBTYPE : Object
621 private Xcls_ProjectSettings _this;
627 public Xcls_database_DBTYPE(Xcls_ProjectSettings _owner )
630 _this.database_DBTYPE = this;
631 this.el = new Gtk.Entry();
635 // set gobject values
638 // user defined functions
640 public class Xcls_Label22 : Object
643 private Xcls_ProjectSettings _this;
649 public Xcls_Label22(Xcls_ProjectSettings _owner )
652 this.el = new Gtk.Label( "Name" );
656 // set gobject values
660 // user defined functions
662 public class Xcls_database_DBTYPE : Object
665 private Xcls_ProjectSettings _this;
671 public Xcls_database_DBTYPE(Xcls_ProjectSettings _owner )
674 _this.database_DBTYPE = this;
675 this.el = new Gtk.Entry();
679 // set gobject values
682 // user defined functions
684 public class Xcls_Label24 : Object
687 private Xcls_ProjectSettings _this;
693 public Xcls_Label24(Xcls_ProjectSettings _owner )
696 this.el = new Gtk.Label( "Username" );
700 // set gobject values
704 // user defined functions
706 public class Xcls_database_DBUSERNAME : Object
709 private Xcls_ProjectSettings _this;
715 public Xcls_database_DBUSERNAME(Xcls_ProjectSettings _owner )
718 _this.database_DBUSERNAME = this;
719 this.el = new Gtk.Entry();
723 // set gobject values
726 // user defined functions
728 public class Xcls_Label26 : Object
731 private Xcls_ProjectSettings _this;
737 public Xcls_Label26(Xcls_ProjectSettings _owner )
740 this.el = new Gtk.Label( "Password" );
744 // set gobject values
748 // user defined functions
750 public class Xcls_database_DBPASSWORD : Object
753 private Xcls_ProjectSettings _this;
759 public Xcls_database_DBPASSWORD(Xcls_ProjectSettings _owner )
762 _this.database_DBPASSWORD = this;
763 this.el = new Gtk.Entry();
767 // set gobject values
770 // user defined functions
772 public class Xcls_Button28 : Object
774 public Gtk.Button el;
775 private Xcls_ProjectSettings _this;
781 public Xcls_Button28(Xcls_ProjectSettings _owner )
784 this.el = new Gtk.Button();
788 // set gobject values
789 this.el.label = "Check Connection";
792 this.el.clicked.connect( );
795 // user defined functions