src/Builder4/RooProjectSettings.bjs
[roobuilder] / src / Builder4 / RooProjectSettings.bjs
1 {
2  "name" : "RooProjectSettings",
3  "parent" : "",
4  "title" : "",
5  "path" : "/home/alan/gitlive/roobuilder/src/Builder4/RooProjectSettings.bjs",
6  "permname" : "",
7  "modOrder" : "",
8  "build_module" : "builder",
9  "items" : [
10   {
11    "@ void buttonPressed" : "(string btn)",
12    "id" : "RooProjectSettings",
13    "| void show" : " (Gtk.Widget btn, Project.Project project) {\n    _this.project = project;\n    _this.path.el.label = project.firstPath();\n    // get the active project.\n     var lm = Gtk.SourceLanguageManager.get_default();\n                \n    ((Gtk.SourceBuffer)(_this.view.el.get_buffer())) .set_language(\n        lm.get_language(\"html\")\n    );\n  \n    //print (project.fn);\n    //project.runhtml = project.runhtml || '';\n    _this.view.el.get_buffer().set_text(project.runhtml);\n    \n       \n    _this.rootURL.el.set_text( _this.project.rootURL );\n    \n\n    _this.base_template_model.loadData();\n    \n     var js = _this.project;\n    _this.database_DBTYPE.el.set_text(     js.get_string_member(\"DBTYPE\") );\n    _this.database_DBNAME.el.set_text(    js.get_string_member(\"DBNAME\") );\n    _this.database_DBUSERNAME.el.set_text(    js.get_string_member(\"DBUSERNAME\") );\n    _this.database_DBPASSWORD.el.set_text(    js.get_string_member(\"DBPASSWORD\") );\n    \n    \t//console.log('show all');\n\tthis.el.set_modal(true);\n\tthis.el.set_relative_to(btn);\n\n\tthis.el.set_position(Gtk.PositionType.RIGHT);\n\n\t// window + header?\n\t print(\"SHOWALL - POPIP\\n\");\n\tthis.el.show_all();\n\tthis.el.set_size_request(800,500);\n\tthis.view.el.grab_focus();\n\t\n    \n    //this.el.show_all();\n}\n",
14    "xtype" : "Popover",
15    "Gtk.PositionType position" : "Gtk.PositionType.RIGHT",
16    "| void save" : "() {\n   var buf =    _this.view.el.get_buffer();\n   Gtk.TextIter s;\n     Gtk.TextIter e;\n    buf.get_start_iter(out s);\n    buf.get_end_iter(out e);\n      _this.project.runhtml = buf.get_text(s,e,true);\n      \n    _this.project.rootURL = _this.rootURL.el.get_text();\n    // set by event changed...\n    //_this.project.base_template = _this.base_template.el.get_text();    \n    \n    var js = _this.project.json_project_data;\n    js.set_string_member(\"DBTYPE\", _this.database_DBTYPE.el.get_text());\n   js.set_string_member(\"DBNAME\", _this.database_DBNAME.el.get_text());\n    js.set_string_member(\"DBUSERNAME\", _this.database_DBUSERNAME.el.get_text());\n    js.set_string_member(\"DBPASSWORD\", _this.database_DBPASSWORD.el.get_text());\n//    _this.project.set_string_member(\"DBHOST\", _this.DBTYPE.el.get_text());    \n    \n    // need to re-init the database \n    \n    _this.project.initRooDatabase();\n     \n    \n}",
17    "$ xns" : "Gtk",
18    "Project.Project project" : "",
19    "bool modal" : true,
20    "uint border_width" : 0,
21    "items" : [
22     {
23      "xtype" : "Box",
24      "* pack" : "add",
25      "$ xns" : "Gtk",
26      "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
27      "border_width" : 5,
28      "$ homogeneous" : false,
29      "items" : [
30       {
31        "* pack" : "pack_start,true,true,0",
32        "xtype" : "Notebook",
33        "$ xns" : "Gtk",
34        "items" : [
35         {
36          "id" : "label_global",
37          "* pack" : false,
38          "xtype" : "Label",
39          "$ xns" : "Gtk",
40          "utf8 label" : "Global"
41         },
42         {
43          "id" : "label_database",
44          "xtype" : "Label",
45          "* pack" : false,
46          "$ xns" : "Gtk",
47          "utf8 label" : "Database"
48         },
49         {
50          "* pack" : "append_page,_this.label_global.el",
51          "xtype" : "Box",
52          "gboolean homogeneous" : false,
53          "$ xns" : "Gtk",
54          "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
55          "items" : [
56           {
57            "label" : "filename",
58            "id" : "path",
59            "xalign" : 0,
60            "* pack" : "pack_start,false,false,0",
61            "xtype" : "Label",
62            "gint margin" : 3,
63            "$ xns" : "Gtk"
64           },
65           {
66            "* pack" : "pack_start,false,false,0",
67            "xtype" : "Box",
68            "gboolean expand" : false,
69            "$ xns" : "Gtk",
70            "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
71            "$ homogeneous" : false,
72            "items" : [
73             {
74              "label" : "HTML template file",
75              "* pack" : "pack_start,false,false,0",
76              "xtype" : "Label",
77              "gint margin" : 3,
78              "$ xns" : "Gtk"
79             },
80             {
81              "listeners" : {
82               "changed" : "() => {\n\tGtk.TreeIter iter;\n \n\t// this get's called when we are filling in the data... ???\n\tif (this.loading) {\n\t\treturn;\n\t}\n\t\n \n\tif (this.el.get_active_iter(out iter)) {\n\t\tValue vfname;\n\t\t_this.base_template_model.el.get_value (iter, 0, out vfname);\n\t\t_this.project.base_template = ((string)vfname) ;\n\t\t\n\t\t print(\"\\nSET base template to %s\\n\", _this.project.base_template );\n\t\t// is_bjs = ((string)vfname) == \"bjs\";\n\t}\n    \n  \n    // directory is only available for non-bjs \n \n\n\n}\n"
83              },
84              "id" : "base_template",
85              "bool loading" : false,
86              "* init" : "this.el.add_attribute(_this.base_template_cellrenderer.el , \"markup\", 0 );",
87              "* pack" : "add",
88              "xtype" : "ComboBox",
89              "$ xns" : "Gtk",
90              "items" : [
91               {
92                "id" : "base_template_cellrenderer",
93                "xtype" : "CellRendererText",
94                "* pack" : "pack_start,true",
95                "$ xns" : "Gtk"
96               },
97               {
98                "id" : "base_template_model",
99                "xtype" : "ListStore",
100                "* pack" : "set_model",
101                "$ columns" : "typeof(string)",
102                "n_columns" : 1,
103                "$ xns" : "Gtk",
104                "| void loadData" : "  () {\n\t_this.base_template.loading = true;\n  \n    this.el.clear();                                    \n    Gtk.TreeIter iter;\n    var el = this.el;\n    \n   /// el.append(out iter);\n    \n   \n    el.append(out iter);\n    el.set_value(iter, 0, \"roo.builder.html\");\n    _this.base_template.el.set_active_iter(iter);\n\tif (_this.project.base_template == \"roo.builder.html\") {\n\t   _this.base_template.el.set_active_iter(iter);\n    }\n\n    el.append(out iter);\n    el.set_value(iter, 0, \"bootstrap.builder.html\");\n \n\tprint(\"\\ncur template = %s\\n\", _this.project.base_template);\n \n    if (_this.project.base_template == \"bootstrap.builder.html\") {\n\t   _this.base_template.el.set_active_iter(iter);\n    }\n\n\tel.append(out iter);\n    el.set_value(iter, 0, \"mailer.builder.html\");\n\n\tif (_this.project.base_template == \"mailer.builder.html\") {\n\t    _this.base_template.el.set_active_iter(iter);\n    }\n\t_this.base_template.loading = false;\n                                     \n}\n"
105               }
106              ]
107             }
108            ]
109           },
110           {
111            "* pack" : "pack_start,false,false,0",
112            "xtype" : "Box",
113            "gboolean expand" : false,
114            "$ xns" : "Gtk",
115            "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
116            "$ homogeneous" : false,
117            "items" : [
118             {
119              "label" : "root URL",
120              "* pack" : "pack_start,false,false,0",
121              "xtype" : "Label",
122              "gint margin" : 3,
123              "$ xns" : "Gtk"
124             },
125             {
126              "id" : "rootURL",
127              "* pack" : "add",
128              "xtype" : "Entry",
129              "$ xns" : "Gtk"
130             }
131            ]
132           },
133           {
134            "label" : "HTML To insert at end of <HEAD>",
135            "* pack" : "pack_start,false,false,0",
136            "xtype" : "Label",
137            "$ xns" : "Gtk"
138           },
139           {
140            "* pack" : "pack_start,true,true,0",
141            "xtype" : "ScrolledWindow",
142            "$ xns" : "Gtk",
143            "items" : [
144             {
145              "listeners" : {
146               "key_release_event" : " ( event) =>{\n    if (event.keyval != 115) {\n        return false;\n         \n    }\n    if   ( (event.state & Gdk.ModifierType.CONTROL_MASK ) < 1 ) {\n        return false;\n    }\n     var buf =    this.el.get_buffer();\n    Gtk.TextIter s;\n    Gtk.TextIter e;\n    buf.get_start_iter(out s);\n    buf.get_end_iter(out e);\n    _this.project.runhtml = buf.get_text(s,e,true);\n    \n          \n    _this.buttonPressed(\"save\");\n     \n    return false;\n         \n}"
147              },
148              "id" : "view",
149              "* init" : " \n    var description =   Pango.FontDescription.from_string(\"monospace\");\n    description.set_size(9000);\n    this.el.override_font(description);",
150              "xtype" : "View",
151              "* pack" : "add",
152              "$ xns" : "GtkSource"
153             }
154            ]
155           },
156           {
157            "id" : "grid",
158            "int margin_right" : 4,
159            "* pack" : "pack_start,false,false,4",
160            "xtype" : "Grid",
161            "uint row_spacing" : 2,
162            "n_columns" : 2,
163            "$ xns" : "Gtk",
164            "n_rows" : 7,
165            "$ homogeneous" : true,
166            "int margin_left" : 4,
167            "items" : [
168             {
169              "label" : "File type",
170              "id" : "filetypelbl",
171              "xalign" : 0.90000000000000002,
172              "* pack" : "attach,0,0,1,1",
173              "xtype" : "Label",
174              "$ justify" : "Gtk.Justification.RIGHT",
175              "x_options" : 4,
176              "$ xns" : "Gtk"
177             },
178             {
179              "listeners" : {
180               "changed" : "() => {\n\tGtk.TreeIter iter;\n\tbool is_bjs = true;\n\tif (this.el.get_active_iter(out iter)) {\n\t\tValue vfname;\n\t\t_this.ftdbmodel.el.get_value (iter, 0, out vfname);\n\t\t is_bjs = ((string)vfname) == \"bjs\";\n\t}\n    \n  \n    // directory is only available for non-bjs \n    this.showhide(is_bjs);\n\n\n}\n"
181              },
182              "id" : "filetype",
183              "* init" : "this.el.add_attribute(_this.ftdbcellrenderer.el , \"markup\", 1 );",
184              "* pack" : "attach,1,0,1,1",
185              "xtype" : "ComboBox",
186              "| void showhide" : "(bool is_bjs) {\n\tfor (var i = 2; i < 9;i++) {\n\t\tvar el = _this.grid.el.get_child_at(0,i);\n\t\t\n\t\tvar showhide= is_bjs;\n\t\tif (i> 7) {\n\t\t\tshowhide = !showhide;\n\t\t}\n\t\t\n\t\tif (showhide) {\n\t\t   el.show();\n\t\t} else {\n\t\t\tel.hide();\n\t\t}\n\t\t el = _this.grid.el.get_child_at(1,i);\n\t\tif (showhide) {\n\t\t   el.show();\n\t\t} else {\n\t\t\tel.hide();\n\t\t}     \n    }\n    // load up the directories\n    //??? why can we not create bjs files in other directories??\n\tif (!is_bjs && _this.file.path.length < 1) {\n\t\t_this.dirmodel.loadData();\n\t\t\n\t\t\n\t}\n   \n    \n}\n",
187              "$ xns" : "Gtk",
188              "items" : [
189               {
190                "id" : "ftdbcellrenderer",
191                "xtype" : "CellRendererText",
192                "* pack" : "pack_start,true",
193                "$ xns" : "Gtk"
194               },
195               {
196                "id" : "ftdbmodel",
197                "xtype" : "ListStore",
198                "* pack" : "set_model",
199                "$ columns" : "typeof(string),typeof(string)",
200                "n_columns" : 2,
201                "$ xns" : "Gtk",
202                "| void loadData" : "  (string cur) {\n    this.el.clear();                                    \n    Gtk.TreeIter iter;\n    var el = this.el;\n    \n   /// el.append(out iter);\n    \n     \n   // el.set_value(iter, 0, \"\");\n   // el.set_value(iter, 1, \"aaa  - Just add Element - aaa\");\n\n    el.append(out iter);\n\n    \n    el.set_value(iter, 0, \"bjs\");\n    el.set_value(iter, 1, \"User Interface File (bjs)\");\n    _this.filetype.el.set_active_iter(iter);\n\n    el.append(out iter);\n    \n    el.set_value(iter, 0, \"vala\");\n    el.set_value(iter, 1, \"Vala\");\n\tif (cur == \"vala\") {\n\t    _this.filetype.el.set_active_iter(iter);\n    }\n\n\n\n    el.append(out iter);\n    \n    el.set_value(iter, 0, \"js\");\n    el.set_value(iter, 1, \"Javascript\");\n\n\tif (cur == \"js\") {\n\t    _this.filetype.el.set_active_iter(iter);\n    }\n\n    el.append(out iter);\n    \n    el.set_value(iter, 0, \"css\");\n    el.set_value(iter, 1, \"CSS\");\n\n\tif (cur == \"css\") {\n\t    _this.filetype.el.set_active_iter(iter);\n    }\n                                     \n}\n"
203               }
204              ]
205             },
206             {
207              "label" : "Component Name",
208              "xalign" : 0.90000000000000002,
209              "* pack" : "attach,0,1,1,1",
210              "xtype" : "Label",
211              "$ justify" : "Gtk.Justification.RIGHT",
212              "x_options" : 4,
213              "$ xns" : "Gtk"
214             },
215             {
216              "id" : "name",
217              "$ visible" : true,
218              "xtype" : "Entry",
219              "* pack" : "attach,1,1,1,1",
220              "$ xns" : "Gtk"
221             },
222             {
223              "label" : "Title",
224              "$ visible" : true,
225              "xalign" : 0.90000000000000002,
226              "* pack" : "attach,0,2,1,1",
227              "xtype" : "Label",
228              "$ justify" : "Gtk.Justification.RIGHT",
229              "x_options" : 4,
230              "$ xns" : "Gtk"
231             },
232             {
233              "id" : "title",
234              "$ visible" : true,
235              "xtype" : "Entry",
236              "* pack" : "attach,1,2,1,1",
237              "$ xns" : "Gtk"
238             },
239             {
240              "label" : "Region",
241              "tooltip_text" : "center, north, south, east, west",
242              "$ visible" : true,
243              "xalign" : 0.90000000000000002,
244              "* pack" : "attach,0,3,1,1",
245              "xtype" : "Label",
246              "$ justify" : "Gtk.Justification.RIGHT",
247              "x_options" : 4,
248              "$ xns" : "Gtk"
249             },
250             {
251              "id" : "region",
252              "$ visible" : true,
253              "xtype" : "Entry",
254              "* pack" : "attach,1,3,1,1",
255              "$ xns" : "Gtk"
256             },
257             {
258              "label" : "Parent Name",
259              "$ visible" : true,
260              "xalign" : 0.90000000000000002,
261              "* pack" : "attach,0,4,1,1",
262              "xtype" : "Label",
263              "$ justify" : "Gtk.Justification.RIGHT",
264              "x_options" : 4,
265              "$ xns" : "Gtk"
266             },
267             {
268              "id" : "parent",
269              "$ visible" : true,
270              "xtype" : "Entry",
271              "* pack" : "attach,1,4,1,1",
272              "$ xns" : "Gtk"
273             },
274             {
275              "label" : "Permission Name",
276              "$ visible" : true,
277              "xalign" : 0.90000000000000002,
278              "* pack" : "attach,0,5,1,1",
279              "xtype" : "Label",
280              "$ justify" : "Gtk.Justification.RIGHT",
281              "x_options" : 4,
282              "$ xns" : "Gtk"
283             },
284             {
285              "id" : "permname",
286              "$ visible" : true,
287              "xtype" : "Entry",
288              "* pack" : "attach,1,5,1,1",
289              "$ xns" : "Gtk"
290             },
291             {
292              "label" : "Order (for tabs)",
293              "$ visible" : true,
294              "xalign" : 0.90000000000000002,
295              "* pack" : "attach,0,6,1,1",
296              "xtype" : "Label",
297              "$ justify" : "Gtk.Justification.RIGHT",
298              "x_options" : 4,
299              "$ xns" : "Gtk"
300             },
301             {
302              "id" : "modOrder",
303              "$ visible" : true,
304              "xtype" : "Entry",
305              "* pack" : "attach,1,6,1,1",
306              "$ xns" : "Gtk"
307             },
308             {
309              "label" : "Module to build (Vala only)",
310              "$ visible" : true,
311              "xalign" : 0.90000000000000002,
312              "* pack" : "attach,0,7,1,1",
313              "xtype" : "Label",
314              "$ justify" : "Gtk.Justification.RIGHT",
315              "x_options" : 4,
316              "$ xns" : "Gtk"
317             },
318             {
319              "id" : "build_module",
320              "* init" : "this.el.add_attribute(_this.dbcellrenderer.el , \"markup\", 1 );",
321              "* pack" : "attach,1,7,1,1",
322              "xtype" : "ComboBox",
323              "$ xns" : "Gtk",
324              "items" : [
325               {
326                "id" : "dbcellrenderer",
327                "* pack" : "pack_start,true",
328                "xtype" : "CellRendererText",
329                "$ xns" : "Gtk"
330               },
331               {
332                "id" : "dbmodel",
333                "* pack" : "set_model",
334                "xtype" : "ListStore",
335                "$ columns" : "typeof(string),typeof(string)",
336                "n_columns" : 2,
337                "$ xns" : "Gtk",
338                "| void loadData" : "  (Gee.ArrayList<string> data, string cur) {\n    this.el.clear();                                    \n    Gtk.TreeIter iter;\n    var el = this.el;\n    \n   /// el.append(out iter);\n    \n     \n   // el.set_value(iter, 0, \"\");\n   // el.set_value(iter, 1, \"aaa  - Just add Element - aaa\");\n\n    el.append(out iter);\n\n    \n    el.set_value(iter, 0, \"\");\n    el.set_value(iter, 1, \"-- select a module --\");\n    _this.build_module.el.set_active_iter(iter);\n    \n    for (var i = 0; i < data.size;i++) {\n    \n\n        el.append(out iter);\n        \n        el.set_value(iter, 0, data.get(i));\n        el.set_value(iter, 1, data.get(i));\n        \n        if (data.get(i) == cur) {\n            _this.build_module.el.set_active_iter(iter);\n        }\n        \n    }\n     this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);          \n                                     \n}\n"
339               }
340              ]
341             },
342             {
343              "label" : "Directory",
344              "$ visible" : true,
345              "xalign" : 0.90000000000000002,
346              "* pack" : "attach,0,8,1,1",
347              "xtype" : "Label",
348              "$ justify" : "Gtk.Justification.RIGHT",
349              "x_options" : 4,
350              "$ xns" : "Gtk"
351             },
352             {
353              "id" : "dir",
354              "* init" : "this.el.add_attribute(_this.dircellrenderer.el , \"markup\", 1 );",
355              "* pack" : "attach,1,8,1,1",
356              "xtype" : "ComboBox",
357              "$ xns" : "Gtk",
358              "items" : [
359               {
360                "id" : "dircellrenderer",
361                "xtype" : "CellRendererText",
362                "* pack" : "pack_start,true",
363                "$ xns" : "Gtk"
364               },
365               {
366                "id" : "dirmodel",
367                "xtype" : "ListStore",
368                "* pack" : "set_model",
369                "$ columns" : "typeof(string),typeof(string)",
370                "n_columns" : 2,
371                "$ xns" : "Gtk",
372                "| void loadData" : "  () {\n\t\n\t\n  \n    this.el.clear();                                    \n    \n    if (!(_this.project is Project.Gtk)) {\n\t\treturn;\n\t}\n    var sd = ((Project.Gtk)_this.project).sourcedirs();\n    \n    Gtk.TreeIter iter;\n    var el = this.el;\n    \n   /// el.append(out iter);\n    \n     \n   // el.set_value(iter, 0, \"\");\n   // el.set_value(iter, 1, \"aaa  - Just add Element - aaa\");\n\n//    el.append(out iter);\n\n    \n//    el.set_value(iter, 0, \"\");\n  //  el.set_value(iter, 1, \"-- select a directoyr --\");\n    //_this.build_module.el.set_active_iter(iter);\n    \n    for (var i = 0; i < sd.length;i++) {\n    \n\n        el.append(out iter);\n        \n        el.set_value(iter, 0, sd[i]);\n        el.set_value(iter, 1, sd[i]);\n        \n        //if (data.get(i) == cur) {\n        //    _this.build_module.el.set_active_iter(iter);\n       // }\n        \n    }\n  //  this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);          \n                                     \n}\n"
373               }
374              ]
375             }
376            ]
377           }
378          ]
379         },
380         {
381          "* pack" : "append_page,_this.label_database.el",
382          "xtype" : "Box",
383          "gboolean homogeneous" : false,
384          "$ xns" : "Gtk",
385          "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
386          "items" : [
387           {
388            "label" : "Type (eg. MySQL or PostgreSQL)",
389            "xalign" : 0,
390            "* pack" : "pack_start,false,false,0",
391            "xtype" : "Label",
392            "$ xns" : "Gtk"
393           },
394           {
395            "listeners" : {
396             "key_press_event" : "(ev) => {\n\n    if (ev.keyval == Gdk.Key.Tab) {\n        _this.database_DBNAME.el.grab_focus();\n        return true;\n    }\n\n\n    return false;\n}\n"
397            },
398            "id" : "database_DBTYPE",
399            "xtype" : "Entry",
400            "* pack" : "pack_start,false,false,0",
401            "$ xns" : "Gtk"
402           },
403           {
404            "label" : "Name",
405            "xalign" : 0,
406            "* pack" : "pack_start,false,false,0",
407            "xtype" : "Label",
408            "$ xns" : "Gtk"
409           },
410           {
411            "listeners" : {
412             "key_press_event" : "(ev) => {\n\n    if (ev.keyval == Gdk.Key.Tab) {\n        _this.database_DBUSERNAME.el.grab_focus();\n        return true;\n    }\n\n\n    return false;\n}\n"
413            },
414            "id" : "database_DBNAME",
415            "* pack" : "pack_start,false,false,0",
416            "xtype" : "Entry",
417            "$ xns" : "Gtk"
418           },
419           {
420            "label" : "Username",
421            "xalign" : 0,
422            "* pack" : "pack_start,false,false,0",
423            "xtype" : "Label",
424            "$ xns" : "Gtk"
425           },
426           {
427            "listeners" : {
428             "key_press_event" : "(ev) => {\n\n    if (ev.keyval == Gdk.Key.Tab) {\n        _this.database_DBPASSWORD.el.grab_focus();\n        return true;\n    }\n\n\n    return false;\n}\n"
429            },
430            "id" : "database_DBUSERNAME",
431            "xtype" : "Entry",
432            "* pack" : "pack_start,false,false,0",
433            "$ xns" : "Gtk"
434           },
435           {
436            "label" : "Password",
437            "xalign" : 0,
438            "* pack" : "pack_start,false,false,0",
439            "xtype" : "Label",
440            "$ xns" : "Gtk"
441           },
442           {
443            "id" : "database_DBPASSWORD",
444            "* pack" : "pack_start,false,false,0",
445            "xtype" : "Entry",
446            "$ xns" : "Gtk"
447           },
448           {
449            "listeners" : {
450             "clicked" : "() => {\n\n\n  _this.database_ERROR.el.label    = \"\";\n    Gda.Connection cnc;\n    try {\n        // assumes localhost...\n         cnc = Gda.Connection.open_from_string (\n\t\t\t_this.database_DBTYPE.el.get_text(),\n\t\t\t\"DB_NAME=\" + _this.database_DBNAME.el.get_text(), \n\t\t\t\"USERNAME=\" + _this.database_DBUSERNAME.el.get_text() + \n\t\t\t\";PASSWORD=\" + _this.database_DBPASSWORD.el.get_text(),\n\t\t\tGda.ConnectionOptions.NONE\n\t\t);\n   //} catch (Gda.ConnectionError ce) { \n   //   _this.database_ERROR.el.label = ce.message;        \n   } catch(Gda.ConnectionError ue) {\n      _this.database_ERROR.el.label = ue.message;\n        return;\n   }  catch(Gda.ConfigError ue) {\n      _this.database_ERROR.el.label = ue.message;\n        return;\n   }\n  _this.database_ERROR.el.label = \"Connection Succeeded\";\n   cnc.close();\n}"
451            },
452            "* pack" : "pack_start,false,false,0",
453            "xtype" : "Button",
454            "$ xns" : "Gtk",
455            "utf8 label" : "Check Connection"
456           },
457           {
458            "label" : " ",
459            "id" : "database_ERROR",
460            "xalign" : 0,
461            "* pack" : "pack_start,false,false,0",
462            "xtype" : "Label",
463            "gint margin" : 3,
464            "$ xns" : "Gtk"
465           }
466          ]
467         }
468        ]
469       },
470       {
471        "* pack" : "pack_end,false,false,0",
472        "xtype" : "Box",
473        "gboolean expand" : false,
474        "$ xns" : "Gtk",
475        "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
476        "$ homogeneous" : true,
477        "gboolean vexpand" : false,
478        "items" : [
479         {
480          "listeners" : {
481           "button_press_event" : "() => {\n    _this.save();\n          \n    _this.buttonPressed(\"apply\");\n        return false;\n}"
482          },
483          "label" : "Apply",
484          "xtype" : "Button",
485          "* pack" : "add",
486          "$ xns" : "Gtk"
487         },
488         {
489          "listeners" : {
490           "button_press_event" : "() => {\n       _this.save();\n          \n    _this.buttonPressed(\"save\");\n        return false;\n}"
491          },
492          "label" : "Save",
493          "xtype" : "Button",
494          "* pack" : "add",
495          "$ xns" : "Gtk"
496         }
497        ]
498       }
499      ]
500     }
501    ]
502   }
503  ]
504 }