Fix #7963 - add gda back in
[roobuilder] / src / Builder4 / RooProjectSettings.bjs
index 586539d..90d969d 100644 (file)
 {
- "name" : "RooProjectSettings",
- "parent" : "",
- "title" : "",
- "path" : "/home/alan/gitlive/roobuilder/src/Builder4/RooProjectSettings.bjs",
- "permname" : "",
- "modOrder" : "",
  "build_module" : "builder",
+ "gen_extended" : false,
  "items" : [
   {
+   "$ xns" : "Gtk",
    "@ void buttonPressed" : "(string btn)",
-   "id" : "RooProjectSettings",
-   "| 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      \n    _this.rootURL.el.set_text( _this.project.rootURL );\n    \n    _this.html_gen_model.loadData(_this.project.html_gen);\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",
-   "xtype" : "Popover",
    "Gtk.PositionType position" : "Gtk.PositionType.RIGHT",
-   "| 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\t_this.project.runhtml = buf.get_text(s,e,true);\n      \n    _this.project.rootURL = _this.rootURL.el.get_text();\n    \n    \n    Gtk.TreeIter iter;\n    Value html_gen_val;\n    _this.html_gen_model.el.get_value (iter, 0, out html_gen_val);\n    \n    _this.project.html_gen = (string)html_gen_val;\n    \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}",
-   "$ xns" : "Gtk",
-   "Project.Project project" : "",
+   "Project.Roo project" : "",
+   "bool autohide" : false,
+   "bool done" : false,
    "bool modal" : true,
-   "uint border_width" : 0,
+   "id" : "RooProjectSettings",
    "items" : [
     {
-     "xtype" : "Box",
-     "* pack" : "add",
+     "$ homogeneous" : false,
      "$ xns" : "Gtk",
+     "* pack" : "set_child",
      "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
      "border_width" : 5,
-     "$ homogeneous" : false,
      "items" : [
       {
-       "* pack" : "pack_start,true,true,0",
-       "xtype" : "Notebook",
        "$ xns" : "Gtk",
        "items" : [
         {
-         "id" : "label_global",
-         "* pack" : false,
-         "xtype" : "Label",
          "$ xns" : "Gtk",
-         "utf8 label" : "Global"
+         "* pack" : false,
+         "id" : "label_global",
+         "utf8 label" : "Global",
+         "xtype" : "Label"
         },
         {
-         "id" : "label_database",
-         "xtype" : "Label",
-         "* pack" : false,
          "$ xns" : "Gtk",
-         "utf8 label" : "Database"
+         "* pack" : false,
+         "id" : "label_database",
+         "utf8 label" : "Database",
+         "xtype" : "Label"
         },
         {
-         "* pack" : "append_page,_this.label_global.el",
-         "xtype" : "Box",
-         "gboolean homogeneous" : false,
          "$ xns" : "Gtk",
+         "* pack" : "append_page,_this.label_global.el",
          "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
+         "gboolean homogeneous" : false,
          "items" : [
           {
-           "id" : "grid",
-           "int margin_right" : 4,
-           "* pack" : "pack_start,false,false,4",
-           "xtype" : "Grid",
-           "uint row_spacing" : 2,
-           "n_columns" : 2,
-           "$ xns" : "Gtk",
-           "n_rows" : 7,
            "$ homogeneous" : true,
-           "int margin_left" : 4,
+           "$ xns" : "Gtk",
+           "id" : "grid",
+           "int margin_end" : 4,
+           "int margin_start" : 4,
            "items" : [
             {
+             "$ xns" : "Gtk",
+             "* pack" : "attach,0,0,1,1",
+             "int margin_bottom" : 3,
+             "int margin_end" : 3,
+             "int margin_start" : 3,
+             "int margin_top" : 3,
              "label" : "Filename",
              "xalign" : 0,
-             "* pack" : "attach,0,0,1,1",
-             "xtype" : "Label",
-             "gint margin" : 3,
-             "$ xns" : "Gtk"
+             "xtype" : "Label"
             },
             {
-             "label" : "filename",
+             "$ xns" : "Gtk",
+             "* pack" : "attach,1,0,1,1",
              "id" : "path",
+             "int margin_bottom" : 3,
+             "int margin_end" : 3,
+             "int margin_start" : 3,
+             "int margin_top" : 3,
+             "label" : "filename",
              "xalign" : 0,
-             "* pack" : "attach,1,0,1,1",
-             "xtype" : "Label",
-             "gint margin" : 3,
-             "$ xns" : "Gtk"
+             "xtype" : "Label"
             },
             {
-             "label" : "HTML template file",
-             "xtype" : "Label",
+             "$ xns" : "Gtk",
              "* pack" : "attach,0,1,1,1",
-             "gint margin" : 3,
-             "$ xns" : "Gtk"
+             "int margin_bottom" : 3,
+             "int margin_end" : 3,
+             "int margin_start" : 3,
+             "int margin_top" : 3,
+             "label" : "HTML template file",
+             "xtype" : "Label"
             },
             {
-             "listeners" : {
-              "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"
-             },
-             "id" : "base_template",
+             "$ xns" : "Gtk",
              "* init" : "this.el.add_attribute(_this.base_template_cellrenderer.el , \"markup\", 0 );",
-             "bool loading" : false,
              "* pack" : "attach,1,1,1,1",
-             "xtype" : "ComboBox",
-             "$ xns" : "Gtk",
+             "bool loading" : false,
+             "id" : "base_template",
              "items" : [
               {
-               "id" : "base_template_cellrenderer",
+               "$ xns" : "Gtk",
                "* pack" : "pack_start,true",
-               "xtype" : "CellRendererText",
-               "$ xns" : "Gtk"
+               "id" : "base_template_cellrenderer",
+               "xtype" : "CellRendererText"
               },
               {
-               "id" : "base_template_model",
-               "* pack" : "set_model",
-               "xtype" : "ListStore",
                "$ columns" : "typeof(string)",
-               "n_columns" : 1,
                "$ xns" : "Gtk",
-               "| 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"
+               "* pack" : "set_model",
+               "id" : "base_template_model",
+               "n_columns" : 1,
+               "xtype" : "ListStore",
+               "| void loadData" : [
+                "  () {",
+                "\t_this.base_template.loading = true;",
+                "  ",
+                "    this.el.clear();                                    ",
+                "    Gtk.TreeIter iter;",
+                "    var el = this.el;",
+                "    ",
+                "   /// el.append(out iter);",
+                "    ",
+                "   ",
+                "    el.append(out iter);",
+                "    el.set_value(iter, 0, \"roo.builder.html\");",
+                "    _this.base_template.el.set_active_iter(iter);",
+                "\tif (_this.project.base_template == \"roo.builder.html\") {",
+                "\t   _this.base_template.el.set_active_iter(iter);",
+                "    }",
+                "",
+                "    el.append(out iter);",
+                "    el.set_value(iter, 0, \"bootstrap.builder.html\");",
+                "  ",
+                "\tprint(\"\\ncur template = %s\\n\", _this.project.base_template);",
+                " ",
+                "    if (_this.project.base_template == \"bootstrap.builder.html\") {",
+                "\t   _this.base_template.el.set_active_iter(iter);",
+                "    }",
+                "\t  el.append(out iter);",
+                "    el.set_value(iter, 0, \"bootstrap4.builder.html\");",
+                "     if (_this.project.base_template == \"bootstrap4.builder.html\") {",
+                "\t   _this.base_template.el.set_active_iter(iter);",
+                "    }",
+                "    ",
+                "",
+                "\tel.append(out iter);",
+                "    el.set_value(iter, 0, \"mailer.builder.html\");",
+                "",
+                "\tif (_this.project.base_template == \"mailer.builder.html\") {",
+                "\t    _this.base_template.el.set_active_iter(iter);",
+                "    }",
+                "\t_this.base_template.loading = false;",
+                "                                     ",
+                "}",
+                ""
+               ]
               }
-             ]
+             ],
+             "listeners" : {
+              "changed" : [
+               "() => {",
+               "\tGtk.TreeIter iter;",
+               " ",
+               "\t// this get's called when we are filling in the data... ???",
+               "\tif (this.loading) {",
+               "\t\treturn;",
+               "\t}",
+               "\t",
+               " ",
+               "\tif (this.el.get_active_iter(out iter)) {",
+               "\t\tValue vfname;",
+               "\t\t_this.base_template_model.el.get_value (iter, 0, out vfname);",
+               "\t\t_this.project.base_template = ((string)vfname) ;",
+               "\t\t",
+               "\t\t print(\"\\nSET base template to %s\\n\", _this.project.base_template );",
+               "\t\t// is_bjs = ((string)vfname) == \"bjs\";",
+               "\t}",
+               "    ",
+               "  ",
+               "    // directory is only available for non-bjs ",
+               " ",
+               "",
+               "",
+               "}",
+               ""
+              ]
+             },
+             "xtype" : "ComboBox"
             },
             {
-             "label" : "root URL",
-             "xtype" : "Label",
+             "$ xns" : "Gtk",
              "* pack" : "attach,0,2,1,1",
-             "gint margin" : 3,
-             "$ xns" : "Gtk"
+             "int margin_bottom" : 3,
+             "int margin_end" : 3,
+             "int margin_start" : 3,
+             "int margin_top" : 3,
+             "label" : "root URL",
+             "xtype" : "Label"
             },
             {
-             "id" : "rootURL",
-             "xtype" : "Entry",
+             "$ xns" : "Gtk",
              "* pack" : "attach,1,2,1,1",
-             "$ xns" : "Gtk"
+             "id" : "rootURL",
+             "xtype" : "Entry"
             },
             {
-             "label" : "Generate HTML in",
+             "$ xns" : "Gtk",
              "* pack" : "attach,0,3,1,1",
-             "xtype" : "Label",
-             "gint margin" : 3,
-             "$ xns" : "Gtk"
+             "label" : "Generate HTML in",
+             "xtype" : "Label"
             },
             {
-             "id" : "html_gen",
+             "$ xns" : "Gtk",
              "* init" : "this.el.add_attribute(_this.html_gen_cellrenderer.el , \"markup\", 1 );",
              "* pack" : "attach,1,3,1,1",
-             "xtype" : "ComboBox",
-             "$ xns" : "Gtk",
+             "id" : "html_gen",
              "items" : [
               {
-               "id" : "html_gen_cellrenderer",
-               "xtype" : "CellRendererText",
+               "$ xns" : "Gtk",
                "* pack" : "pack_start,true",
-               "$ xns" : "Gtk"
+               "id" : "html_gen_cellrenderer",
+               "xtype" : "CellRendererText"
               },
               {
-               "id" : "html_gen_model",
-               "xtype" : "ListStore",
-               "* pack" : "set_model",
                "$ columns" : "typeof(string),typeof(string)",
-               "n_columns" : 2,
                "$ xns" : "Gtk",
-               "| void loadData" : "  (string cur) {\n    this.el.clear();                                    \n    Gtk.TreeIter iter;\n    var el = this.el;\n    \n \n    el.append(out iter);\n\n    \n    el.set_value(iter, 0, \"\");\n    el.set_value(iter, 1, \"Do not Generate\");\n    _this.filetype.el.set_active_iter(iter);\n\n    el.append(out iter);\n    \n    el.set_value(iter, 0, \"same directory as BJS file\");\n    el.set_value(iter, 1, \"bjs\");\n\tif (cur == \"bjs\") {\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, \"template\");\n    el.set_value(iter, 1, \"in template subdirectory\");\n\n\tif (cur == \"template\") {\n\t    _this.filetype.el.set_active_iter(iter);\n    }\n\n                                     \n}\n"
+               "* pack" : "set_model",
+               "id" : "html_gen_model",
+               "n_columns" : 2,
+               "xtype" : "ListStore",
+               "| void loadData" : [
+                "  (string cur) {",
+                "    this.el.clear();                                    ",
+                "    Gtk.TreeIter iter;",
+                "    var el = this.el;",
+                "    ",
+                " ",
+                "    el.append(out iter);",
+                "",
+                "    ",
+                "    el.set_value(iter, 0, \"\");",
+                "    el.set_value(iter, 1, \"Do not Generate\");",
+                "    _this.html_gen.el.set_active_iter(iter);",
+                "",
+                "    el.append(out iter);",
+                "    ",
+                "    el.set_value(iter, 0, \"bjs\");",
+                "    el.set_value(iter, 1, \"same directory as BJS file\");",
+                "\tif (cur == \"bjs\") {",
+                "\t    _this.html_gen.el.set_active_iter(iter);",
+                "    }",
+                "",
+                "",
+                "",
+                "    el.append(out iter);",
+                "    ",
+                "    el.set_value(iter, 0, \"templates\");",
+                "    el.set_value(iter, 1, \"in templates subdirectory\");",
+                "",
+                "\tif (cur == \"template\") {",
+                "\t    _this.html_gen.el.set_active_iter(iter);",
+                "    }",
+                "",
+                "                                     ",
+                "}",
+                ""
+               ]
               }
-             ]
+             ],
+             "xtype" : "ComboBox"
             }
-           ]
+           ],
+           "n_columns" : 2,
+           "n_rows" : 7,
+           "uint row_spacing" : 2,
+           "xtype" : "Grid"
           },
           {
+           "$ xns" : "Gtk",
            "label" : "HTML To insert at end of <HEAD>",
-           "xtype" : "Label",
-           "* pack" : "pack_start,false,false,0",
-           "$ xns" : "Gtk"
+           "xtype" : "Label"
           },
           {
-           "* pack" : "pack_start,true,true,0",
-           "xtype" : "ScrolledWindow",
            "$ xns" : "Gtk",
+           "bool vexpand" : true,
            "items" : [
             {
-             "listeners" : {
-              "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}"
-             },
+             "$ xns" : "GtkSource",
+             "* init" : [
+              " ",
+              "    ",
+              "this.css = new Gtk.CssProvider();",
+              " ",
+              "\tthis.css.load_from_string(",
+              "\t\"#roo-project-settings-view{ font:  10px monospace;}\"",
+              ");",
+              " ",
+              "//this.el.get_style_context().add_provider(this.css,Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);",
+              "        ",
+              "       Gtk.StyleContext.add_provider_for_display(",
+              "\t       Gdk.Display.get_default(), ",
+              "\t       this.css,",
+              "\t       Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION",
+              "       );"
+             ],
+             "* pack" : "set_child",
+             "Gtk.CssProvider css" : "",
              "id" : "view",
-             "* init" : " \n    var description =   Pango.FontDescription.from_string(\"monospace\");\n    description.set_size(9000);\n    this.el.override_font(description);",
-             "xtype" : "View",
-             "* pack" : "add",
-             "$ xns" : "GtkSource"
+             "items" : [
+              {
+               "$ xns" : "Gtk",
+               "listeners" : {
+                "key_released" : [
+                 "(keyval, keycode, state) => {",
+                 "",
+                 "",
+                 "    if (keyval != 115) {",
+                 "        return;",
+                 "         ",
+                 "    }",
+                 "    if   ( (state & Gdk.ModifierType.CONTROL_MASK ) < 1 ) {",
+                 "        return;",
+                 "    }",
+                 "     var buf =    _this.view.el.get_buffer();",
+                 "    Gtk.TextIter s;",
+                 "    Gtk.TextIter e;",
+                 "    buf.get_start_iter(out s);",
+                 "    buf.get_end_iter(out e);",
+                 "    _this.project.runhtml = buf.get_text(s,e,true);",
+                 "    ",
+                 "          ",
+                 "    _this.buttonPressed(\"save\");",
+                 "   ",
+                 "         ",
+                 "",
+                 "}",
+                 ""
+                ]
+               },
+               "xtype" : "EventControllerKey"
+              }
+             ],
+             "string name" : "roo-project-settings-view",
+             "xtype" : "View"
             }
-           ]
+           ],
+           "xtype" : "ScrolledWindow"
           }
-         ]
+         ],
+         "xtype" : "Box"
         },
         {
-         "* pack" : "append_page,_this.label_database.el",
-         "xtype" : "Box",
-         "gboolean homogeneous" : false,
          "$ xns" : "Gtk",
+         "* pack" : "append_page,_this.label_database.el",
          "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
+         "gboolean homogeneous" : false,
          "items" : [
           {
+           "$ xns" : "Gtk",
            "label" : "Type (eg. MySQL or PostgreSQL)",
            "xalign" : 0,
-           "* pack" : "pack_start,false,false,0",
-           "xtype" : "Label",
-           "$ xns" : "Gtk"
+           "xtype" : "Label"
           },
           {
-           "listeners" : {
-            "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"
-           },
+           "$ xns" : "Gtk",
            "id" : "database_DBTYPE",
-           "xtype" : "Entry",
-           "* pack" : "pack_start,false,false,0",
-           "$ xns" : "Gtk"
+           "items" : [
+            {
+             "$ xns" : "Gtk",
+             "listeners" : {
+              "key_pressed" : [
+               "(keyval, keycode, state) => {",
+               "    if (keyval == Gdk.Key.Tab) {",
+               "        _this.database_DBNAME.el.grab_focus();",
+               "        return true;",
+               "    }",
+               "",
+               "",
+               "\treturn false;",
+               "}",
+               ""
+              ]
+             },
+             "xtype" : "EventControllerKey"
+            }
+           ],
+           "xtype" : "Entry"
           },
           {
+           "$ xns" : "Gtk",
            "label" : "Name",
            "xalign" : 0,
-           "* pack" : "pack_start,false,false,0",
-           "xtype" : "Label",
-           "$ xns" : "Gtk"
+           "xtype" : "Label"
           },
           {
-           "listeners" : {
-            "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"
-           },
+           "$ xns" : "Gtk",
            "id" : "database_DBNAME",
-           "* pack" : "pack_start,false,false,0",
-           "xtype" : "Entry",
-           "$ xns" : "Gtk"
+           "items" : [
+            {
+             "$ xns" : "Gtk",
+             "listeners" : {
+              "key_pressed" : [
+               "(keyval, keycode, state) => {",
+               "    if (keyval == Gdk.Key.Tab) {",
+               "        _this.database_DBUSERNAME.el.grab_focus();",
+               "        return true;",
+               "    }",
+               "",
+               "",
+               "\treturn false;",
+               "\t ",
+               "}",
+               ""
+              ]
+             },
+             "xtype" : "EventControllerKey"
+            }
+           ],
+           "xtype" : "Entry"
           },
           {
+           "$ xns" : "Gtk",
            "label" : "Username",
            "xalign" : 0,
-           "* pack" : "pack_start,false,false,0",
-           "xtype" : "Label",
-           "$ xns" : "Gtk"
+           "xtype" : "Label"
           },
           {
-           "listeners" : {
-            "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"
-           },
+           "$ xns" : "Gtk",
            "id" : "database_DBUSERNAME",
-           "xtype" : "Entry",
-           "* pack" : "pack_start,false,false,0",
-           "$ xns" : "Gtk"
+           "items" : [
+            {
+             "$ xns" : "Gtk",
+             "listeners" : {
+              "key_pressed" : [
+               "(keyval, keycode, state) => {",
+               "    if (keyval == Gdk.Key.Tab) {",
+               "        _this.database_DBPASSWORD.el.grab_focus();",
+               "        return true;",
+               "    }",
+               "",
+               "",
+               "\treturn false;",
+               "\t ",
+               "",
+               "}",
+               ""
+              ]
+             },
+             "xtype" : "EventControllerKey"
+            }
+           ],
+           "xtype" : "Entry"
           },
           {
+           "$ xns" : "Gtk",
            "label" : "Password",
            "xalign" : 0,
-           "* pack" : "pack_start,false,false,0",
-           "xtype" : "Label",
-           "$ xns" : "Gtk"
+           "xtype" : "Label"
           },
           {
+           "$ xns" : "Gtk",
            "id" : "database_DBPASSWORD",
-           "* pack" : "pack_start,false,false,0",
-           "xtype" : "Entry",
-           "$ xns" : "Gtk"
+           "xtype" : "Entry"
           },
           {
+           "$ xns" : "Gtk",
            "listeners" : {
-            "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}"
+            "clicked" : [
+             "() => {",
+             "",
+             "",
+             "  _this.database_ERROR.el.label    = \"\";",
+             " ",
+             "    Gda.Connection cnc;",
+             "    try {",
+             "        // assumes localhost...",
+             "         cnc = Gda.Connection.open_from_string (",
+             "\t\t\t_this.database_DBTYPE.el.get_text(),",
+             "\t\t\t\"DB_NAME=\" + _this.database_DBNAME.el.get_text(), ",
+             "\t\t\t\"USERNAME=\" + _this.database_DBUSERNAME.el.get_text() + ",
+             "\t\t\t\";PASSWORD=\" + _this.database_DBPASSWORD.el.get_text(),",
+             "\t\t\tGda.ConnectionOptions.NONE",
+             "\t\t);",
+             "   //} catch (Gda.ConnectionError ce) { ",
+             "   //   _this.database_ERROR.el.label = ce.message;        ",
+             "   } catch(GLib.Error ue) {",
+             "      _this.database_ERROR.el.label = ue.message;",
+             "        return;",
+             "   }  ",
+             "  _this.database_ERROR.el.label = \"Connection Succeeded\";",
+             "   cnc.close();",
+             "  ",
+             "}"
+            ]
            },
-           "* pack" : "pack_start,false,false,0",
-           "xtype" : "Button",
-           "$ xns" : "Gtk",
-           "utf8 label" : "Check Connection"
+           "utf8 label" : "Check Connection",
+           "xtype" : "Button"
           },
           {
-           "label" : " ",
+           "$ xns" : "Gtk",
            "id" : "database_ERROR",
+           "label" : " ",
            "xalign" : 0,
-           "* pack" : "pack_start,false,false,0",
-           "xtype" : "Label",
-           "gint margin" : 3,
-           "$ xns" : "Gtk"
+           "xtype" : "Label"
           }
-         ]
+         ],
+         "xtype" : "Box"
         }
-       ]
+       ],
+       "xtype" : "Notebook"
+      }
+     ],
+     "xtype" : "Box"
+    },
+    {
+     "$ xns" : "Gtk",
+     "* prop" : "titlebar",
+     "bool show_title_buttons" : false,
+     "items" : [
+      {
+       "$ xns" : "Gtk",
+       "* pack" : "pack_start",
+       "listeners" : {
+        "clicked" : [
+         "() => { ",
+         "",
+         "  _this.done = true;",
+         "    _this.el.hide(); ",
+         "}"
+        ]
+       },
+       "string label" : "Cancel",
+       "xtype" : "Button"
       },
       {
-       "* pack" : "pack_end,false,false,0",
-       "xtype" : "Box",
-       "gboolean expand" : false,
        "$ xns" : "Gtk",
-       "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
-       "$ homogeneous" : true,
-       "gboolean vexpand" : false,
-       "items" : [
-        {
-         "listeners" : {
-          "button_press_event" : "() => {\n    _this.save();\n          \n    _this.buttonPressed(\"apply\");\n        return false;\n}"
-         },
-         "label" : "Apply",
-         "xtype" : "Button",
-         "* pack" : "add",
-         "$ xns" : "Gtk"
-        },
-        {
-         "listeners" : {
-          "button_press_event" : "() => {\n       _this.save();\n          \n    _this.buttonPressed(\"save\");\n        return false;\n}"
-         },
-         "label" : "Save",
-         "xtype" : "Button",
-         "* pack" : "add",
-         "$ xns" : "Gtk"
-        }
-       ]
+       "* pack" : "pack_end",
+       "css_classes" : "{ \"suggested-action\" }",
+       "listeners" : {
+        "clicked" : [
+         "( ) =>  { ",
+         "",
+         " ",
+         " _this.buttonPressed(\"save\");",
+         " ",
+         "\t// what about .js ?",
+         "   _this.done = true;",
+         "\t_this.el.hide();",
+         "",
+         "// hopefull this will work with bjs files..",
+         "\t",
+         " ",
+         "   ",
+         "}"
+        ]
+       },
+       "string label" : "Save",
+       "xtype" : "Button"
       }
-     ]
+     ],
+     "xtype" : "HeaderBar"
     }
+   ],
+   "string title" : "Edit Project settings",
+   "uint border_width" : 0,
+   "xtype" : "Window",
+   "| void save" : [
+    "() {",
+    "   var buf =    _this.view.el.get_buffer();",
+    "   Gtk.TextIter s;",
+    "     Gtk.TextIter e;",
+    "    buf.get_start_iter(out s);",
+    "    buf.get_end_iter(out e);",
+    "\t_this.project.runhtml = buf.get_text(s,e,true);",
+    "      ",
+    "    _this.project.rootURL = _this.rootURL.el.get_text();",
+    "    ",
+    "    ",
+    "    Gtk.TreeIter iter;",
+    "    Value html_gen_val;",
+    "    _this.html_gen.el.get_active_iter(out iter);",
+    "    _this.html_gen_model.el.get_value (iter, 0, out html_gen_val);",
+    "    ",
+    "    _this.project.html_gen = (string)html_gen_val;",
+    "    ",
+    "    // set by event changed...",
+    "    //_this.project.base_template = _this.base_template.el.get_text();    ",
+    "    ",
+    "    var js = _this.project;",
+    "    js.DBTYPE = _this.database_DBTYPE.el.get_text();",
+    "   js.DBNAME= _this.database_DBNAME.el.get_text();",
+    "    js.DBUSERNAME= _this.database_DBUSERNAME.el.get_text();",
+    "    js.DBPASSWORD= _this.database_DBPASSWORD.el.get_text();",
+    "//    _this.project.set_string_member(\"DBHOST\", _this.DBTYPE.el.get_text());    ",
+    "    ",
+    "    // need to re-init the database ",
+    "    \tjs.save();",
+    "    _this.project.initDatabase();",
+    "     ",
+    "    ",
+    "}"
+   ],
+   "| void show" : [
+    " (Gtk.Window pwin, Project.Roo project) {",
+    "    _this.done = false;",
+    "    ",
+    "    _this.project = project;",
+    "    _this.path.el.label = project.path;",
+    "    // get the active project.",
+    "     var lm = GtkSource.LanguageManager.get_default();",
+    "                ",
+    "    ((GtkSource.Buffer)(_this.view.el.get_buffer())) .set_language(",
+    "        lm.get_language(\"html\")",
+    "    );",
+    "  ",
+    "    //print (project.fn);",
+    "    //project.runhtml = project.runhtml || '';",
+    "    _this.view.el.get_buffer().set_text(project.runhtml);",
+    "     ",
+    "      ",
+    "    _this.rootURL.el.set_text( _this.project.rootURL );",
+    "    ",
+    "    _this.html_gen_model.loadData(_this.project.html_gen);",
+    "",
+    "    _this.base_template_model.loadData();",
+    "    ",
+    "     //var js = _this.project;",
+    "    _this.database_DBTYPE.el.set_text(    _this.project.DBTYPE );",
+    "    _this.database_DBNAME.el.set_text(    _this.project.DBNAME );",
+    "    _this.database_DBUSERNAME.el.set_text(  _this.project.DBUSERNAME );",
+    "    _this.database_DBPASSWORD.el.set_text(  _this.project.DBPASSWORD );",
+    "    ",
+    "    \t//console.log('show all');",
+    "",
+    "\t",
+    "    this.el.set_transient_for(pwin);",
+    "\t// window + header?",
+    "\t print(\"SHOWALL - POPIP\\n\");",
+    "\tthis.el.show();",
+    "\tthis.el.set_size_request(800,600);",
+    "\tthis.view.el.grab_focus();",
+    "\t",
+    "    ",
+    "    //this.el.show_all();",
+    "}",
+    ""
    ]
   }
- ]
+ ],
+ "name" : "RooProjectSettings"
 }
\ No newline at end of file