1 static Xcls_RooProjectSettings _RooProjectSettings;
3 public class Xcls_RooProjectSettings : Object
6 private Xcls_RooProjectSettings _this;
8 public static Xcls_RooProjectSettings singleton()
10 if (_RooProjectSettings == null) {
11 _RooProjectSettings= new Xcls_RooProjectSettings();
13 return _RooProjectSettings;
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_base_template_cellrenderer base_template_cellrenderer;
20 public Xcls_base_template_model base_template_model;
21 public Xcls_rootURL rootURL;
22 public Xcls_grid grid;
23 public Xcls_filetypelbl filetypelbl;
24 public Xcls_filetype filetype;
25 public Xcls_ftdbcellrenderer ftdbcellrenderer;
26 public Xcls_ftdbmodel ftdbmodel;
28 public Xcls_dircellrenderer dircellrenderer;
29 public Xcls_dirmodel dirmodel;
30 public Xcls_path path;
31 public Xcls_base_template base_template;
32 public Xcls_base_template_cellrenderer base_template_cellrenderer;
33 public Xcls_base_template_model base_template_model;
34 public Xcls_view view;
35 public Xcls_database_DBTYPE database_DBTYPE;
36 public Xcls_database_DBNAME database_DBNAME;
37 public Xcls_database_DBUSERNAME database_DBUSERNAME;
38 public Xcls_database_DBPASSWORD database_DBPASSWORD;
39 public Xcls_database_ERROR database_ERROR;
42 public signal void buttonPressed (string btn);
43 public Project.Project project;
46 public Xcls_RooProjectSettings()
49 this.el = new Gtk.Popover( null );
54 this.el.border_width = 0;
56 this.el.position = Gtk.PositionType.RIGHT;
57 var child_0 = new Xcls_Box2( _this );
59 this.el.add ( child_0.el );
62 // user defined functions
63 public void show (Gtk.Widget btn, Project.Project project) {
64 _this.project = project;
65 _this.path.el.label = project.firstPath();
66 // get the active project.
67 var lm = Gtk.SourceLanguageManager.get_default();
69 ((Gtk.SourceBuffer)(_this.view.el.get_buffer())) .set_language(
70 lm.get_language("html")
74 //project.runhtml = project.runhtml || '';
75 _this.view.el.get_buffer().set_text(project.runhtml);
78 _this.rootURL.el.set_text( _this.project.rootURL );
81 _this.base_template_model.loadData();
83 var js = _this.project;
84 _this.database_DBTYPE.el.set_text( js.get_string_member("DBTYPE") );
85 _this.database_DBNAME.el.set_text( js.get_string_member("DBNAME") );
86 _this.database_DBUSERNAME.el.set_text( js.get_string_member("DBUSERNAME") );
87 _this.database_DBPASSWORD.el.set_text( js.get_string_member("DBPASSWORD") );
89 //console.log('show all');
90 this.el.set_modal(true);
91 this.el.set_relative_to(btn);
93 this.el.set_position(Gtk.PositionType.RIGHT);
96 print("SHOWALL - POPIP\n");
98 this.el.set_size_request(800,500);
99 this.view.el.grab_focus();
102 //this.el.show_all();
104 public void save () {
105 var buf = _this.view.el.get_buffer();
108 buf.get_start_iter(out s);
109 buf.get_end_iter(out e);
110 _this.project.runhtml = buf.get_text(s,e,true);
112 _this.project.rootURL = _this.rootURL.el.get_text();
113 // set by event changed...
114 //_this.project.base_template = _this.base_template.el.get_text();
116 var js = _this.project.json_project_data;
117 js.set_string_member("DBTYPE", _this.database_DBTYPE.el.get_text());
118 js.set_string_member("DBNAME", _this.database_DBNAME.el.get_text());
119 js.set_string_member("DBUSERNAME", _this.database_DBUSERNAME.el.get_text());
120 js.set_string_member("DBPASSWORD", _this.database_DBPASSWORD.el.get_text());
121 // _this.project.set_string_member("DBHOST", _this.DBTYPE.el.get_text());
123 // need to re-init the database
125 _this.project.initRooDatabase();
129 public class Xcls_Box2 : Object
132 private Xcls_RooProjectSettings _this;
138 public Xcls_Box2(Xcls_RooProjectSettings _owner )
141 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
145 // set gobject values
146 this.el.homogeneous = false;
147 this.el.border_width = 5;
148 var child_0 = new Xcls_Notebook3( _this );
150 this.el.pack_start ( child_0.el , true,true,0 );
151 var child_1 = new Xcls_Box45( _this );
153 this.el.pack_end ( child_1.el , false,false,0 );
156 // user defined functions
158 public class Xcls_Notebook3 : Object
160 public Gtk.Notebook el;
161 private Xcls_RooProjectSettings _this;
167 public Xcls_Notebook3(Xcls_RooProjectSettings _owner )
170 this.el = new Gtk.Notebook();
174 // set gobject values
175 var child_0 = new Xcls_label_global( _this );
177 var child_1 = new Xcls_label_database( _this );
179 var child_2 = new Xcls_Box6( _this );
181 this.el.append_page ( child_2.el , _this.label_global.el );
182 var child_3 = new Xcls_Box34( _this );
184 this.el.append_page ( child_3.el , _this.label_database.el );
187 // user defined functions
189 public class Xcls_label_global : Object
192 private Xcls_RooProjectSettings _this;
198 public Xcls_label_global(Xcls_RooProjectSettings _owner )
201 _this.label_global = this;
202 this.el = new Gtk.Label( "Global" );
206 // set gobject values
209 // user defined functions
212 public class Xcls_label_database : Object
215 private Xcls_RooProjectSettings _this;
221 public Xcls_label_database(Xcls_RooProjectSettings _owner )
224 _this.label_database = this;
225 this.el = new Gtk.Label( "Database" );
229 // set gobject values
232 // user defined functions
235 public class Xcls_Box6 : Object
238 private Xcls_RooProjectSettings _this;
244 public Xcls_Box6(Xcls_RooProjectSettings _owner )
247 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
251 // set gobject values
252 this.el.homogeneous = false;
253 var child_0 = new Xcls_path( _this );
255 this.el.pack_start ( child_0.el , false,false,0 );
256 var child_1 = new Xcls_Box8( _this );
258 this.el.pack_start ( child_1.el , false,false,0 );
259 var child_2 = new Xcls_Box13( _this );
261 this.el.pack_start ( child_2.el , false,false,0 );
262 var child_3 = new Xcls_Label16( _this );
264 this.el.pack_start ( child_3.el , false,false,0 );
265 var child_4 = new Xcls_grid( _this );
267 this.el.pack_start ( child_4.el , false,false,4 );
268 var child_5 = new Xcls_ScrolledWindow32( _this );
270 this.el.pack_start ( child_5.el , true,true,0 );
273 // user defined functions
275 public class Xcls_path : Object
278 private Xcls_RooProjectSettings _this;
284 public Xcls_path(Xcls_RooProjectSettings _owner )
288 this.el = new Gtk.Label( "filename" );
292 // set gobject values
297 // user defined functions
300 public class Xcls_Box8 : Object
303 private Xcls_RooProjectSettings _this;
309 public Xcls_Box8(Xcls_RooProjectSettings _owner )
312 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
316 // set gobject values
317 this.el.homogeneous = false;
318 this.el.expand = false;
319 var child_0 = new Xcls_Label9( _this );
321 this.el.pack_start ( child_0.el , false,false,0 );
322 var child_1 = new Xcls_base_template( _this );
324 this.el.add ( child_1.el );
327 // user defined functions
329 public class Xcls_Label9 : Object
332 private Xcls_RooProjectSettings _this;
338 public Xcls_Label9(Xcls_RooProjectSettings _owner )
341 this.el = new Gtk.Label( "HTML template file" );
345 // set gobject values
349 // user defined functions
352 public class Xcls_base_template : Object
354 public Gtk.ComboBox el;
355 private Xcls_RooProjectSettings _this;
362 public Xcls_base_template(Xcls_RooProjectSettings _owner )
365 _this.base_template = this;
366 this.el = new Gtk.ComboBox();
369 this.loading = false;
371 // set gobject values
372 var child_0 = new Xcls_base_template_cellrenderer( _this );
374 this.el.pack_start ( child_0.el , true );
375 var child_1 = new Xcls_base_template_model( _this );
377 this.el.set_model ( child_1.el );
381 this.el.add_attribute(_this.base_template_cellrenderer.el , "markup", 0 );
384 this.el.changed.connect( () => {
387 // this get's called when we are filling in the data... ???
393 if (this.el.get_active_iter(out iter)) {
395 _this.base_template_model.el.get_value (iter, 0, out vfname);
396 _this.project.base_template = ((string)vfname) ;
398 print("\nSET base template to %s\n", _this.project.base_template );
399 // is_bjs = ((string)vfname) == "bjs";
403 // directory is only available for non-bjs
410 // user defined functions
412 public class Xcls_base_template_cellrenderer : Object
414 public Gtk.CellRendererText el;
415 private Xcls_RooProjectSettings _this;
421 public Xcls_base_template_cellrenderer(Xcls_RooProjectSettings _owner )
424 _this.base_template_cellrenderer = this;
425 this.el = new Gtk.CellRendererText();
429 // set gobject values
432 // user defined functions
435 public class Xcls_base_template_model : Object
437 public Gtk.ListStore el;
438 private Xcls_RooProjectSettings _this;
444 public Xcls_base_template_model(Xcls_RooProjectSettings _owner )
447 _this.base_template_model = this;
448 this.el = new Gtk.ListStore( 1, typeof(string) );
452 // set gobject values
455 // user defined functions
456 public void loadData () {
457 _this.base_template.loading = true;
463 /// el.append(out iter);
467 el.set_value(iter, 0, "roo.builder.html");
468 _this.base_template.el.set_active_iter(iter);
469 if (_this.project.base_template == "roo.builder.html") {
470 _this.base_template.el.set_active_iter(iter);
474 el.set_value(iter, 0, "bootstrap.builder.html");
476 print("\ncur template = %s\n", _this.project.base_template);
478 if (_this.project.base_template == "bootstrap.builder.html") {
479 _this.base_template.el.set_active_iter(iter);
483 el.set_value(iter, 0, "mailer.builder.html");
485 if (_this.project.base_template == "mailer.builder.html") {
486 _this.base_template.el.set_active_iter(iter);
488 _this.base_template.loading = false;
495 public class Xcls_Box13 : Object
498 private Xcls_RooProjectSettings _this;
504 public Xcls_Box13(Xcls_RooProjectSettings _owner )
507 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
511 // set gobject values
512 this.el.homogeneous = false;
513 this.el.expand = false;
514 var child_0 = new Xcls_Label14( _this );
516 this.el.pack_start ( child_0.el , false,false,0 );
517 var child_1 = new Xcls_rootURL( _this );
519 this.el.add ( child_1.el );
522 // user defined functions
524 public class Xcls_Label14 : Object
527 private Xcls_RooProjectSettings _this;
533 public Xcls_Label14(Xcls_RooProjectSettings _owner )
536 this.el = new Gtk.Label( "root URL" );
540 // set gobject values
544 // user defined functions
547 public class Xcls_rootURL : Object
550 private Xcls_RooProjectSettings _this;
556 public Xcls_rootURL(Xcls_RooProjectSettings _owner )
559 _this.rootURL = this;
560 this.el = new Gtk.Entry();
564 // set gobject values
567 // user defined functions
571 public class Xcls_Label16 : Object
574 private Xcls_RooProjectSettings _this;
580 public Xcls_Label16(Xcls_RooProjectSettings _owner )
583 this.el = new Gtk.Label( "HTML To insert at end of <HEAD>" );
587 // set gobject values
590 // user defined functions
593 public class Xcls_grid : Object
596 private Xcls_RooProjectSettings _this;
602 public Xcls_grid(Xcls_RooProjectSettings _owner )
606 this.el = new Gtk.Grid();
610 // set gobject values
611 this.el.margin_right = 4;
612 this.el.margin_left = 4;
613 this.el.row_spacing = 2;
614 var child_0 = new Xcls_filetypelbl( _this );
616 this.el.attach ( child_0.el , 0,0,1,1 );
617 var child_1 = new Xcls_filetype( _this );
619 this.el.attach ( child_1.el , 1,0,1,1 );
620 var child_2 = new Xcls_Label22( _this );
622 this.el.attach ( child_2.el , 0,8,1,1 );
623 var child_3 = new Xcls_dir( _this );
625 this.el.attach ( child_3.el , 1,8,1,1 );
626 var child_4 = new Xcls_Label26( _this );
628 this.el.attach ( child_4.el , 0,0,1,1 );
629 var child_5 = new Xcls_path( _this );
631 this.el.attach ( child_5.el , 1,0,1,1 );
632 var child_6 = new Xcls_Label28( _this );
634 this.el.attach ( child_6.el , 0,1,1,1 );
635 var child_7 = new Xcls_base_template( _this );
637 this.el.attach ( child_7.el , 1,8,1,1 );
640 // user defined functions
642 public class Xcls_filetypelbl : Object
645 private Xcls_RooProjectSettings _this;
651 public Xcls_filetypelbl(Xcls_RooProjectSettings _owner )
654 _this.filetypelbl = this;
655 this.el = new Gtk.Label( "File type" );
659 // set gobject values
660 this.el.justify = Gtk.Justification.RIGHT;
661 this.el.xalign = 0.900000f;
664 // user defined functions
667 public class Xcls_filetype : Object
669 public Gtk.ComboBox el;
670 private Xcls_RooProjectSettings _this;
676 public Xcls_filetype(Xcls_RooProjectSettings _owner )
679 _this.filetype = this;
680 this.el = new Gtk.ComboBox();
684 // set gobject values
685 var child_0 = new Xcls_ftdbcellrenderer( _this );
687 this.el.pack_start ( child_0.el , true );
688 var child_1 = new Xcls_ftdbmodel( _this );
690 this.el.set_model ( child_1.el );
694 this.el.add_attribute(_this.ftdbcellrenderer.el , "markup", 1 );
697 this.el.changed.connect( () => {
700 if (this.el.get_active_iter(out iter)) {
702 _this.ftdbmodel.el.get_value (iter, 0, out vfname);
703 is_bjs = ((string)vfname) == "bjs";
707 // directory is only available for non-bjs
708 this.showhide(is_bjs);
714 // user defined functions
715 public void showhide (bool is_bjs) {
716 for (var i = 2; i < 9;i++) {
717 var el = _this.grid.el.get_child_at(0,i);
719 var showhide= is_bjs;
721 showhide = !showhide;
729 el = _this.grid.el.get_child_at(1,i);
736 // load up the directories
737 //??? why can we not create bjs files in other directories??
738 if (!is_bjs && _this.file.path.length < 1) {
739 _this.dirmodel.loadData();
747 public class Xcls_ftdbcellrenderer : Object
749 public Gtk.CellRendererText el;
750 private Xcls_RooProjectSettings _this;
756 public Xcls_ftdbcellrenderer(Xcls_RooProjectSettings _owner )
759 _this.ftdbcellrenderer = this;
760 this.el = new Gtk.CellRendererText();
764 // set gobject values
767 // user defined functions
770 public class Xcls_ftdbmodel : Object
772 public Gtk.ListStore el;
773 private Xcls_RooProjectSettings _this;
779 public Xcls_ftdbmodel(Xcls_RooProjectSettings _owner )
782 _this.ftdbmodel = this;
783 this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
787 // set gobject values
790 // user defined functions
791 public void loadData (string cur) {
796 /// el.append(out iter);
799 // el.set_value(iter, 0, "");
800 // el.set_value(iter, 1, "aaa - Just add Element - aaa");
805 el.set_value(iter, 0, "bjs");
806 el.set_value(iter, 1, "User Interface File (bjs)");
807 _this.filetype.el.set_active_iter(iter);
811 el.set_value(iter, 0, "vala");
812 el.set_value(iter, 1, "Vala");
814 _this.filetype.el.set_active_iter(iter);
821 el.set_value(iter, 0, "js");
822 el.set_value(iter, 1, "Javascript");
825 _this.filetype.el.set_active_iter(iter);
830 el.set_value(iter, 0, "css");
831 el.set_value(iter, 1, "CSS");
834 _this.filetype.el.set_active_iter(iter);
841 public class Xcls_Label22 : Object
844 private Xcls_RooProjectSettings _this;
850 public Xcls_Label22(Xcls_RooProjectSettings _owner )
853 this.el = new Gtk.Label( "Directory" );
857 // set gobject values
858 this.el.justify = Gtk.Justification.RIGHT;
859 this.el.xalign = 0.900000f;
860 this.el.visible = true;
863 // user defined functions
866 public class Xcls_dir : Object
868 public Gtk.ComboBox el;
869 private Xcls_RooProjectSettings _this;
875 public Xcls_dir(Xcls_RooProjectSettings _owner )
879 this.el = new Gtk.ComboBox();
883 // set gobject values
884 var child_0 = new Xcls_dircellrenderer( _this );
886 this.el.pack_start ( child_0.el , true );
887 var child_1 = new Xcls_dirmodel( _this );
889 this.el.set_model ( child_1.el );
893 this.el.add_attribute(_this.dircellrenderer.el , "markup", 1 );
896 // user defined functions
898 public class Xcls_dircellrenderer : Object
900 public Gtk.CellRendererText el;
901 private Xcls_RooProjectSettings _this;
907 public Xcls_dircellrenderer(Xcls_RooProjectSettings _owner )
910 _this.dircellrenderer = this;
911 this.el = new Gtk.CellRendererText();
915 // set gobject values
918 // user defined functions
921 public class Xcls_dirmodel : Object
923 public Gtk.ListStore el;
924 private Xcls_RooProjectSettings _this;
930 public Xcls_dirmodel(Xcls_RooProjectSettings _owner )
933 _this.dirmodel = this;
934 this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
938 // set gobject values
941 // user defined functions
942 public void loadData () {
948 if (!(_this.project is Project.Gtk)) {
951 var sd = ((Project.Gtk)_this.project).sourcedirs();
956 /// el.append(out iter);
959 // el.set_value(iter, 0, "");
960 // el.set_value(iter, 1, "aaa - Just add Element - aaa");
962 // el.append(out iter);
965 // el.set_value(iter, 0, "");
966 // el.set_value(iter, 1, "-- select a directoyr --");
967 //_this.build_module.el.set_active_iter(iter);
969 for (var i = 0; i < sd.length;i++) {
974 el.set_value(iter, 0, sd[i]);
975 el.set_value(iter, 1, sd[i]);
977 //if (data.get(i) == cur) {
978 // _this.build_module.el.set_active_iter(iter);
982 // this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);
988 public class Xcls_Label26 : Object
991 private Xcls_RooProjectSettings _this;
997 public Xcls_Label26(Xcls_RooProjectSettings _owner )
1000 this.el = new Gtk.Label( "Filename" );
1004 // set gobject values
1006 this.el.xalign = 0f;
1009 // user defined functions
1012 public class Xcls_path : Object
1014 public Gtk.Label el;
1015 private Xcls_RooProjectSettings _this;
1021 public Xcls_path(Xcls_RooProjectSettings _owner )
1025 this.el = new Gtk.Label( "filename" );
1029 // set gobject values
1031 this.el.xalign = 0f;
1034 // user defined functions
1037 public class Xcls_Label28 : Object
1039 public Gtk.Label el;
1040 private Xcls_RooProjectSettings _this;
1046 public Xcls_Label28(Xcls_RooProjectSettings _owner )
1049 this.el = new Gtk.Label( "HTML template file" );
1053 // set gobject values
1057 // user defined functions
1060 public class Xcls_base_template : Object
1062 public Gtk.ComboBox el;
1063 private Xcls_RooProjectSettings _this;
1067 public bool loading;
1070 public Xcls_base_template(Xcls_RooProjectSettings _owner )
1073 _this.base_template = this;
1074 this.el = new Gtk.ComboBox();
1077 this.loading = false;
1079 // set gobject values
1080 var child_0 = new Xcls_base_template_cellrenderer( _this );
1082 this.el.pack_start ( child_0.el , true );
1083 var child_1 = new Xcls_base_template_model( _this );
1085 this.el.set_model ( child_1.el );
1089 this.el.add_attribute(_this.base_template_cellrenderer.el , "markup", 0 );
1092 this.el.changed.connect( () => {
1095 // this get's called when we are filling in the data... ???
1101 if (this.el.get_active_iter(out iter)) {
1103 _this.base_template_model.el.get_value (iter, 0, out vfname);
1104 _this.project.base_template = ((string)vfname) ;
1106 print("\nSET base template to %s\n", _this.project.base_template );
1107 // is_bjs = ((string)vfname) == "bjs";
1111 // directory is only available for non-bjs
1118 // user defined functions
1120 public class Xcls_base_template_cellrenderer : Object
1122 public Gtk.CellRendererText el;
1123 private Xcls_RooProjectSettings _this;
1129 public Xcls_base_template_cellrenderer(Xcls_RooProjectSettings _owner )
1132 _this.base_template_cellrenderer = this;
1133 this.el = new Gtk.CellRendererText();
1137 // set gobject values
1140 // user defined functions
1143 public class Xcls_base_template_model : Object
1145 public Gtk.ListStore el;
1146 private Xcls_RooProjectSettings _this;
1152 public Xcls_base_template_model(Xcls_RooProjectSettings _owner )
1155 _this.base_template_model = this;
1156 this.el = new Gtk.ListStore( 1, typeof(string) );
1160 // set gobject values
1163 // user defined functions
1164 public void loadData () {
1165 _this.base_template.loading = true;
1171 /// el.append(out iter);
1174 el.append(out iter);
1175 el.set_value(iter, 0, "roo.builder.html");
1176 _this.base_template.el.set_active_iter(iter);
1177 if (_this.project.base_template == "roo.builder.html") {
1178 _this.base_template.el.set_active_iter(iter);
1181 el.append(out iter);
1182 el.set_value(iter, 0, "bootstrap.builder.html");
1184 print("\ncur template = %s\n", _this.project.base_template);
1186 if (_this.project.base_template == "bootstrap.builder.html") {
1187 _this.base_template.el.set_active_iter(iter);
1190 el.append(out iter);
1191 el.set_value(iter, 0, "mailer.builder.html");
1193 if (_this.project.base_template == "mailer.builder.html") {
1194 _this.base_template.el.set_active_iter(iter);
1196 _this.base_template.loading = false;
1203 public class Xcls_ScrolledWindow32 : Object
1205 public Gtk.ScrolledWindow el;
1206 private Xcls_RooProjectSettings _this;
1212 public Xcls_ScrolledWindow32(Xcls_RooProjectSettings _owner )
1215 this.el = new Gtk.ScrolledWindow( null, null );
1219 // set gobject values
1220 var child_0 = new Xcls_view( _this );
1222 this.el.add ( child_0.el );
1225 // user defined functions
1227 public class Xcls_view : Object
1229 public Gtk.SourceView el;
1230 private Xcls_RooProjectSettings _this;
1236 public Xcls_view(Xcls_RooProjectSettings _owner )
1240 this.el = new Gtk.SourceView();
1246 var description = Pango.FontDescription.from_string("monospace");
1247 description.set_size(9000);
1248 this.el.override_font(description);
1251 this.el.key_release_event.connect( ( event) =>{
1252 if (event.keyval != 115) {
1256 if ( (event.state & Gdk.ModifierType.CONTROL_MASK ) < 1 ) {
1259 var buf = this.el.get_buffer();
1262 buf.get_start_iter(out s);
1263 buf.get_end_iter(out e);
1264 _this.project.runhtml = buf.get_text(s,e,true);
1267 _this.buttonPressed("save");
1274 // user defined functions
1279 public class Xcls_Box34 : Object
1282 private Xcls_RooProjectSettings _this;
1288 public Xcls_Box34(Xcls_RooProjectSettings _owner )
1291 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
1295 // set gobject values
1296 this.el.homogeneous = false;
1297 var child_0 = new Xcls_Label35( _this );
1299 this.el.pack_start ( child_0.el , false,false,0 );
1300 var child_1 = new Xcls_database_DBTYPE( _this );
1302 this.el.pack_start ( child_1.el , false,false,0 );
1303 var child_2 = new Xcls_Label37( _this );
1305 this.el.pack_start ( child_2.el , false,false,0 );
1306 var child_3 = new Xcls_database_DBNAME( _this );
1308 this.el.pack_start ( child_3.el , false,false,0 );
1309 var child_4 = new Xcls_Label39( _this );
1311 this.el.pack_start ( child_4.el , false,false,0 );
1312 var child_5 = new Xcls_database_DBUSERNAME( _this );
1314 this.el.pack_start ( child_5.el , false,false,0 );
1315 var child_6 = new Xcls_Label41( _this );
1317 this.el.pack_start ( child_6.el , false,false,0 );
1318 var child_7 = new Xcls_database_DBPASSWORD( _this );
1320 this.el.pack_start ( child_7.el , false,false,0 );
1321 var child_8 = new Xcls_Button43( _this );
1323 this.el.pack_start ( child_8.el , false,false,0 );
1324 var child_9 = new Xcls_database_ERROR( _this );
1326 this.el.pack_start ( child_9.el , false,false,0 );
1329 // user defined functions
1331 public class Xcls_Label35 : Object
1333 public Gtk.Label el;
1334 private Xcls_RooProjectSettings _this;
1340 public Xcls_Label35(Xcls_RooProjectSettings _owner )
1343 this.el = new Gtk.Label( "Type (eg. MySQL or PostgreSQL)" );
1347 // set gobject values
1348 this.el.xalign = 0f;
1351 // user defined functions
1354 public class Xcls_database_DBTYPE : Object
1356 public Gtk.Entry el;
1357 private Xcls_RooProjectSettings _this;
1363 public Xcls_database_DBTYPE(Xcls_RooProjectSettings _owner )
1366 _this.database_DBTYPE = this;
1367 this.el = new Gtk.Entry();
1371 // set gobject values
1374 this.el.key_press_event.connect( (ev) => {
1376 if (ev.keyval == Gdk.Key.Tab) {
1377 _this.database_DBNAME.el.grab_focus();
1386 // user defined functions
1389 public class Xcls_Label37 : Object
1391 public Gtk.Label el;
1392 private Xcls_RooProjectSettings _this;
1398 public Xcls_Label37(Xcls_RooProjectSettings _owner )
1401 this.el = new Gtk.Label( "Name" );
1405 // set gobject values
1406 this.el.xalign = 0f;
1409 // user defined functions
1412 public class Xcls_database_DBNAME : Object
1414 public Gtk.Entry el;
1415 private Xcls_RooProjectSettings _this;
1421 public Xcls_database_DBNAME(Xcls_RooProjectSettings _owner )
1424 _this.database_DBNAME = this;
1425 this.el = new Gtk.Entry();
1429 // set gobject values
1432 this.el.key_press_event.connect( (ev) => {
1434 if (ev.keyval == Gdk.Key.Tab) {
1435 _this.database_DBUSERNAME.el.grab_focus();
1444 // user defined functions
1447 public class Xcls_Label39 : Object
1449 public Gtk.Label el;
1450 private Xcls_RooProjectSettings _this;
1456 public Xcls_Label39(Xcls_RooProjectSettings _owner )
1459 this.el = new Gtk.Label( "Username" );
1463 // set gobject values
1464 this.el.xalign = 0f;
1467 // user defined functions
1470 public class Xcls_database_DBUSERNAME : Object
1472 public Gtk.Entry el;
1473 private Xcls_RooProjectSettings _this;
1479 public Xcls_database_DBUSERNAME(Xcls_RooProjectSettings _owner )
1482 _this.database_DBUSERNAME = this;
1483 this.el = new Gtk.Entry();
1487 // set gobject values
1490 this.el.key_press_event.connect( (ev) => {
1492 if (ev.keyval == Gdk.Key.Tab) {
1493 _this.database_DBPASSWORD.el.grab_focus();
1502 // user defined functions
1505 public class Xcls_Label41 : Object
1507 public Gtk.Label el;
1508 private Xcls_RooProjectSettings _this;
1514 public Xcls_Label41(Xcls_RooProjectSettings _owner )
1517 this.el = new Gtk.Label( "Password" );
1521 // set gobject values
1522 this.el.xalign = 0f;
1525 // user defined functions
1528 public class Xcls_database_DBPASSWORD : Object
1530 public Gtk.Entry el;
1531 private Xcls_RooProjectSettings _this;
1537 public Xcls_database_DBPASSWORD(Xcls_RooProjectSettings _owner )
1540 _this.database_DBPASSWORD = this;
1541 this.el = new Gtk.Entry();
1545 // set gobject values
1548 // user defined functions
1551 public class Xcls_Button43 : Object
1553 public Gtk.Button el;
1554 private Xcls_RooProjectSettings _this;
1560 public Xcls_Button43(Xcls_RooProjectSettings _owner )
1563 this.el = new Gtk.Button();
1567 // set gobject values
1568 this.el.label = "Check Connection";
1571 this.el.clicked.connect( () => {
1574 _this.database_ERROR.el.label = "";
1577 // assumes localhost...
1578 cnc = Gda.Connection.open_from_string (
1579 _this.database_DBTYPE.el.get_text(),
1580 "DB_NAME=" + _this.database_DBNAME.el.get_text(),
1581 "USERNAME=" + _this.database_DBUSERNAME.el.get_text() +
1582 ";PASSWORD=" + _this.database_DBPASSWORD.el.get_text(),
1583 Gda.ConnectionOptions.NONE
1585 //} catch (Gda.ConnectionError ce) {
1586 // _this.database_ERROR.el.label = ce.message;
1587 } catch(Gda.ConnectionError ue) {
1588 _this.database_ERROR.el.label = ue.message;
1590 } catch(Gda.ConfigError ue) {
1591 _this.database_ERROR.el.label = ue.message;
1594 _this.database_ERROR.el.label = "Connection Succeeded";
1599 // user defined functions
1602 public class Xcls_database_ERROR : Object
1604 public Gtk.Label el;
1605 private Xcls_RooProjectSettings _this;
1611 public Xcls_database_ERROR(Xcls_RooProjectSettings _owner )
1614 _this.database_ERROR = this;
1615 this.el = new Gtk.Label( " " );
1619 // set gobject values
1621 this.el.xalign = 0f;
1624 // user defined functions
1629 public class Xcls_Box45 : Object
1632 private Xcls_RooProjectSettings _this;
1638 public Xcls_Box45(Xcls_RooProjectSettings _owner )
1641 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1645 // set gobject values
1646 this.el.homogeneous = true;
1647 this.el.expand = false;
1648 this.el.vexpand = false;
1649 var child_0 = new Xcls_Button46( _this );
1651 this.el.add ( child_0.el );
1652 var child_1 = new Xcls_Button47( _this );
1654 this.el.add ( child_1.el );
1657 // user defined functions
1659 public class Xcls_Button46 : Object
1661 public Gtk.Button el;
1662 private Xcls_RooProjectSettings _this;
1668 public Xcls_Button46(Xcls_RooProjectSettings _owner )
1671 this.el = new Gtk.Button();
1675 // set gobject values
1676 this.el.label = "Apply";
1679 this.el.button_press_event.connect( () => {
1682 _this.buttonPressed("apply");
1687 // user defined functions
1690 public class Xcls_Button47 : Object
1692 public Gtk.Button el;
1693 private Xcls_RooProjectSettings _this;
1699 public Xcls_Button47(Xcls_RooProjectSettings _owner )
1702 this.el = new Gtk.Button();
1706 // set gobject values
1707 this.el.label = "Save";
1710 this.el.button_press_event.connect( () => {
1713 _this.buttonPressed("save");
1718 // user defined functions