Fix #8045 - roo base template not getting set correctly, clear warnings in roo settin...
[roobuilder] / src / Builder4 / RooProjectSettings.bjs
index 6d0b226..1c0647f 100644 (file)
 {
- "name" : "RooProjectSettings",
- "parent" : "",
- "title" : "",
- "path" : "/home/alan/gitlive/roobuilder/src/Builder4/RooProjectSettings.bjs",
- "permname" : "",
- "modOrder" : "",
  "build_module" : "builder",
+ "gen_extended" : false,
  "items" : [
   {
-   "@ 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    \n        lm.get_language(\"html\"));\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    _this.base_template.el.set_text(_this.project.base_template);    \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      _this.project.runhtml = buf.get_text(s,e,true);\n      \n    _this.project.rootURL = _this.rootURL.el.get_text();\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}",
+   "# Project.Roo project" : "",
+   "# bool done" : false,
    "$ xns" : "Gtk",
-   "Project.Project project" : "",
+   "@ void buttonPressed" : "(string btn)",
    "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" : [
           {
-           "label" : "filename",
-           "id" : "path",
-           "xalign" : 0,
-           "* pack" : "pack_start,false,false,0",
-           "xtype" : "Label",
-           "gint margin" : 3,
-           "$ xns" : "Gtk"
-          },
-          {
-           "* pack" : "pack_start,false,false,0",
-           "xtype" : "Box",
-           "gboolean expand" : false,
+           "$ homogeneous" : true,
            "$ xns" : "Gtk",
-           "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
-           "$ homogeneous" : false,
+           "id" : "grid",
+           "int margin_end" : 4,
+           "int margin_start" : 4,
            "items" : [
             {
-             "label" : "HTML template file",
-             "* pack" : "pack_start,false,false,0",
-             "xtype" : "Label",
-             "gint margin" : 3,
-             "$ xns" : "Gtk"
+             "$ 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,
+             "xtype" : "Label"
             },
             {
-             "listeners" : {
-              "changed" : "() => {\n\tGtk.TreeIter iter;\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// 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",
-             "* init" : "this.el.add_attribute(_this.base_template_cellrenderer.el , \"markup\", 1 );",
+             "$ xns" : "Gtk",
              "* pack" : "attach,1,0,1,1",
-             "xtype" : "ComboBox",
+             "id" : "path",
+             "int margin_bottom" : 3,
+             "int margin_end" : 3,
+             "int margin_start" : 3,
+             "int margin_top" : 3,
+             "label" : "filename",
+             "xalign" : 0,
+             "xtype" : "Label"
+            },
+            {
              "$ xns" : "Gtk",
+             "* pack" : "attach,0,1,1,1",
+             "int margin_bottom" : 3,
+             "int margin_end" : 3,
+             "int margin_start" : 3,
+             "int margin_top" : 3,
+             "label" : "HTML template file",
+             "xtype" : "Label"
+            },
+            {
+             "# bool loading" : false,
+             "$ xns" : "Gtk",
+             "* pack" : "attach,1,1,1,1",
+             "id" : "base_template",
              "items" : [
               {
-               "id" : "base_template_cellrenderer",
-               "xtype" : "CellRendererText",
-               "* pack" : "pack_start,true",
-               "$ xns" : "Gtk"
-              },
-              {
-               "id" : "base_template_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   /// 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"
+               "* prop" : "model",
+               "strings" : [
+                "{ ",
+                "\t\"roo.builder.html\",",
+                "\t\"bootstrap.builder.html\",",
+                "\t\"bootstrap4.builder.html\",",
+                "\t\"mailer.builder.html\"",
+                "}"
+               ],
+               "xtype" : "StringList"
               }
-             ]
-            }
-           ]
-          },
-          {
-           "* pack" : "pack_start,false,false,0",
-           "xtype" : "Box",
-           "gboolean expand" : false,
-           "$ xns" : "Gtk",
-           "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
-           "$ homogeneous" : false,
-           "items" : [
+             ],
+             "listeners" : {
+              "notify[\"selected\"]" : [
+               "() => {",
+               "",
+               " ",
+               "\t// this get's called when we are filling in the data... ???",
+               "\tif (this.loading) {",
+               "\t\treturn;",
+               "\t}",
+               "\tvar sm = (Gtk.StringList) this.el.model;",
+               "\t_this.project.base_template = sm.get_string(this.el.selected);",
+               "\t\t",
+               "\t\t print(\"\\nSET base template to %s\\n\", _this.project.base_template );",
+               "\t\t// is_bjs = ((string)vfname) == \"bjs\";",
+               "",
+               "",
+               " }"
+              ]
+             },
+             "xtype" : "DropDown"
+            },
             {
+             "$ xns" : "Gtk",
+             "* pack" : "attach,0,2,1,1",
+             "int margin_bottom" : 3,
+             "int margin_end" : 3,
+             "int margin_start" : 3,
+             "int margin_top" : 3,
              "label" : "root URL",
-             "* pack" : "pack_start,false,false,0",
-             "xtype" : "Label",
-             "gint margin" : 3,
-             "$ xns" : "Gtk"
+             "xtype" : "Label"
             },
             {
+             "$ xns" : "Gtk",
+             "* pack" : "attach,1,2,1,1",
              "id" : "rootURL",
-             "* pack" : "add",
-             "xtype" : "Entry",
-             "$ xns" : "Gtk"
+             "xtype" : "Entry"
+            },
+            {
+             "$ xns" : "Gtk",
+             "* pack" : "attach,0,3,1,1",
+             "label" : "Generate HTML in",
+             "xtype" : "Label"
+            },
+            {
+             "# bool loading" : false,
+             "$ xns" : "Gtk",
+             "* pack" : "attach,1,3,1,1",
+             "id" : "html_gen",
+             "items" : [
+              {
+               "$ xns" : "Gtk",
+               "* prop" : "model",
+               "strings" : [
+                "{ ",
+                "\t\"Do not Generate\", // \"\"",
+                "\t\"same directory as BJS file\", // bjs",
+                "\t\"in templates subdirectory\"  // tmeplate",
+                " ",
+                "}  "
+               ],
+               "xtype" : "StringList"
+              }
+             ],
+             "listeners" : {
+              "notify[\"selected\"]" : [
+               "() => {",
+               "",
+               " ",
+               "\t// this get's called when we are filling in the data... ???",
+               "\tif (this.loading) {",
+               "\t\treturn;",
+               "\t}",
+               "\tvar sm = (Gtk.StringList) this.el.model;",
+               "\t_this.project.base_template = sm.get_string(this.el.selected);",
+               "\t\t",
+               "\t\t print(\"\\nSET base template to %s\\n\", _this.project.base_template );",
+               "\t\t// is_bjs = ((string)vfname) == \"bjs\";",
+               "",
+               "",
+               " }"
+              ]
+             },
+             "xtype" : "DropDown"
             }
-           ]
+           ],
+           "n_columns" : 2,
+           "n_rows" : 7,
+           "uint row_spacing" : 2,
+           "xtype" : "Grid"
           },
           {
+           "$ xns" : "Gtk",
            "label" : "HTML To insert at end of <HEAD>",
-           "* pack" : "pack_start,false,false,0",
-           "xtype" : "Label",
-           "$ 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",
+             "* pack" : "set_child",
+             "css_classes" : "{ \"code-editor\" }",
              "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"
+              }
+             ],
+             "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"
-          },
-          {
-           "label" : "Username",
-           "xalign" : 0,
-           "* pack" : "pack_start,false,false,0",
-           "xtype" : "Label",
-           "$ 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",
            "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"
+            "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();",
+             "  */",
+             "}"
+            ]
            },
-           "id" : "database_DBUSERNAME",
-           "xtype" : "Entry",
-           "* pack" : "pack_start,false,false,0",
-           "$ xns" : "Gtk"
-          },
-          {
-           "label" : "Password",
-           "xalign" : 0,
-           "* pack" : "pack_start,false,false,0",
-           "xtype" : "Label",
-           "$ xns" : "Gtk"
-          },
-          {
-           "id" : "database_DBPASSWORD",
-           "* pack" : "pack_start,false,false,0",
-           "xtype" : "Entry",
-           "$ xns" : "Gtk"
+           "utf8 label" : "Check Connection",
+           "xtype" : "Button"
           },
           {
-           "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}"
-           },
-           "* pack" : "pack_start,false,false,0",
-           "xtype" : "Button",
            "$ xns" : "Gtk",
-           "utf8 label" : "Check Connection"
-          },
-          {
-           "label" : " ",
            "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",
+   "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();",
+    "    ",
+    "     ",
+    "    ",
+    "      ",
+    "\tvar val  = \"\";",
+    "\tswitch (this.html_gen.el.selected) {",
+    "\t\tcase 1: val = \"bjs\"; break;",
+    "\t\tcase 2: val = \"template\"; break;",
+    "\t}",
+    "    ",
+    "    _this.project.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 );",
+    "    ",
+    " ",
+    "    var tv = 0;",
+    "    switch (this.project.html_gen) {",
+    "    \tcase \"bjs\": tv = 1; break;",
+    "    \tcase \"template\": tv = 2; break;",
+    "    }",
+    "    this.html_gen.el.selected = tv;",
+    "   ",
+    "    ",
+    "",
+    "\tvar sm = (Gtk.StringList)     _this.base_template.el.model;",
+    "\tthis.base_template.loading = true;",
+    "\tthis.base_template.el.selected = Gtk.INVALID_LIST_POSITION;",
+    "\tfor(var i=0;i< sm.get_n_items(); i++) {",
+    "\t\tif (sm.get_string( i ) ==  this.project.base_template) {",
+    "\t\t\tthis.base_template.el.selected = i;",
+    "\t\t\tbreak;",
+    "\t\t}",
+    "\t}",
+    "    this.base_template.loading = false;",
+    "     //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