Fix #8046 - meson generation option (so we can edit the language server..)
[roobuilder] / src / Builder4 / ValaProjectSettingsPopover.bjs
index 34188c6..9299b40 100644 (file)
 {
- "name" : "ValaProjectSettingsPopover",
- "parent" : "",
- "title" : "",
- "path" : "/home/alan/gitlive/roobuilder/src/Builder4/ValaProjectSettingsPopover.bjs",
- "permname" : "",
- "modOrder" : "",
  "build_module" : "builder",
+ "gen_extended" : false,
  "items" : [
   {
-   "listeners" : {
-    "hide" : "() => {\n\t_this.project.writeConfig();\n\n}"
-   },
-   "id" : "ValaProjectSettingsPopover",
-   "Xcls_MainWindow window" : "null",
-   "| void show" : "(Gtk.Widget btn, Project.Gtk project) {\n     \n    //print(\"ValaProjectSettings show\\n\");\n    \n    this.project=  project;\n\n    this.compile_flags.el.text = _this.project.compilegroups.get(\"_default_\").compile_flags;\n    \n    this.default_directory_tree_store.load();    \n    this.default_packages_tree_store.load();            \n    this.targets_tree_store.load();\n    this.files_tree_store.load();\n\n\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.set_size_request(800,500);\n\tthis.el.show_all();\n\t//this.view.el.grab_focus();\n\n}\n",
-   "Project.Gtk project" : "null",
-   "xtype" : "Popover",
-   "Gtk.PositionType position" : "Gtk.PositionType.RIGHT",
-   "| void save" : "()  {\n    this.project.writeConfig(); \n}",
+   "# Project.Gtk project" : "null",
+   "# Project.GtkValaSettings? selected_target" : "null",
+   "# Xcls_MainWindow window" : "null",
+   "# bool cg_loading" : false,
+   "# bool done" : false,
+   "$ Project.Callback doneObj" : "null",
    "$ xns" : "Gtk",
    "bool modal" : true,
-   "uint border_width" : 0,
    "items" : [
     {
-     "bool hexpand" : true,
-     "* pack" : "add",
-     "xtype" : "Box",
      "$ xns" : "Gtk",
+     "* prop" : "titlebar",
+     "* title" : "Edit Project Details",
+     "items" : [
+      {
+       "$ xns" : "Gtk",
+       "* prop" : "title_widget",
+       "string label" : "Change Vala  Compile settings",
+       "xtype" : "Label"
+      }
+     ],
+     "xtype" : "HeaderBar"
+    },
+    {
+     "$ xns" : "Gtk",
+     "* pack" : "set_child",
      "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
+     "bool hexpand" : true,
+     "bool vexpand" : true,
      "items" : [
       {
-       "* pack" : "pack_start,true,true,0",
-       "xtype" : "Notebook",
        "$ xns" : "Gtk",
+       "bool vexpand" : true,
+       "id" : "notebook",
        "items" : [
         {
-         "id" : "label_global",
-         "xtype" : "Label",
-         "* pack" : false,
          "$ xns" : "Gtk",
-         "utf8 label" : "Global"
+         "* pack" : false,
+         "id" : "label_global",
+         "utf8 label" : "Global",
+         "xtype" : "Label"
         },
         {
-         "id" : "label_targets",
-         "* pack" : false,
-         "xtype" : "Label",
          "$ xns" : "Gtk",
-         "utf8 label" : "Targets"
+         "* pack" : false,
+         "id" : "label_targets",
+         "utf8 label" : "Targets",
+         "xtype" : "Label"
         },
         {
-         "xtype" : "Box",
-         "* pack" : "append_page,_this.label_global.el",
-         "gboolean homogeneous" : false,
          "$ xns" : "Gtk",
+         "* pack" : "append_page,_this.label_global.el",
          "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
+         "gboolean homogeneous" : false,
          "items" : [
           {
-           "xtype" : "Label",
-           "* pack" : "pack_start,false,false,0",
            "$ xns" : "Gtk",
-           "utf8 label" : "compile flags"
+           "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
+           "int spacing" : 10,
+           "items" : [
+            {
+             "$ xns" : "Gtk",
+             "Gtk.Align halign" : "Gtk.Align.START",
+             "bool hexpand" : false,
+             "utf8 label" : "Compile flags:",
+             "xtype" : "Label"
+            },
+            {
+             "$ xns" : "Gtk",
+             "id" : "compile_flags",
+             "listeners" : {
+              "changed" : [
+               "() => {",
+               "    ",
+               "   _this.project.compile_flags = this.el.buffer.text;",
+               "   _this.project.save();",
+               "//    _this.project.save();",
+               "",
+               "}"
+              ]
+             },
+             "utf8 placeholder_text" : "eg. -g --valasrc $BASEDIR ",
+             "xtype" : "Entry"
+            },
+            {
+             "$ xns" : "Gtk",
+             "id" : "generate_meson",
+             "listeners" : {
+              "activate" : [
+               "( ) => {",
+               "",
+               "\t_this.project.generate_meson = this.el.active;",
+               "}",
+               "\t"
+              ]
+             },
+             "string label" : "Generate Meson",
+             "xtype" : "CheckButton"
+            }
+           ],
+           "xtype" : "Box"
           },
           {
-           "listeners" : {
-            "changed" : "() => {\n    \n   _this.project.compilegroups.get(\"_default_\").compile_flags = this.el.text;\n   _this.project.writeConfig();\n//    _this.project.save();\n\n}"
-           },
-           "id" : "compile_flags",
-           "xtype" : "Entry",
-           "* pack" : "pack_start,false,false,0",
            "$ xns" : "Gtk",
-           "utf8 placeholder_text" : "eg. -g --valasrc $BASEDIR "
+           "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
+           "int spacing" : 10,
+           "items" : [
+            {
+             "$ xns" : "Gtk",
+             "Gtk.Align halign" : "Gtk.Align.START",
+             "bool hexpand" : false,
+             "utf8 label" : "Version:",
+             "xtype" : "Label"
+            },
+            {
+             "$ xns" : "Gtk",
+             "id" : "version",
+             "listeners" : {
+              "changed" : [
+               "() => {",
+               "    ",
+               "   _this.project.version = this.el.buffer.text;",
+               "   _this.project.save();",
+               "//    _this.project.save();",
+               "",
+               "}"
+              ]
+             },
+             "utf8 placeholder_text" : "eg. 1.5",
+             "xtype" : "Entry"
+            },
+            {
+             "$ xns" : "Gtk",
+             "Gtk.Align halign" : "Gtk.Align.START",
+             "bool hexpand" : false,
+             "utf8 label" : "Licence:",
+             "xtype" : "Label"
+            },
+            {
+             "$ xns" : "Gtk",
+             "id" : "licence",
+             "listeners" : {
+              "changed" : [
+               "() => {",
+               "    ",
+               "   _this.project.licence = this.el.buffer.text;",
+               "   _this.project.save();",
+               "//    _this.project.save();",
+               "",
+               "}"
+              ]
+             },
+             "utf8 placeholder_text" : "eg. LGPL",
+             "xtype" : "Entry"
+            }
+           ],
+           "xtype" : "Box"
           },
           {
-           "* pack" : "pack_start,true,true,0",
-           "xtype" : "Paned",
            "$ xns" : "Gtk",
-           "int position" : 300,
-           "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
+           "Gtk.PolicyType hscrollbar_policy" : "Gtk.PolicyType.AUTOMATIC",
+           "Gtk.PolicyType vscrollbar_policy" : "Gtk.PolicyType.AUTOMATIC",
+           "bool has_frame" : true,
+           "bool hexpand" : true,
+           "bool vexpand" : true,
+           "id" : "vapi_scroll",
            "items" : [
             {
-             "bool hexpand" : true,
-             "xtype" : "ScrolledWindow",
-             "* pack" : "add",
              "$ xns" : "Gtk",
+             "* prop" : "child",
              "items" : [
               {
-               "gboolean headers_visible" : true,
-               "* pack" : "add",
-               "xtype" : "TreeView",
-               "string id" : "default_packages_tree",
                "$ xns" : "Gtk",
+               "* prop" : "model",
                "items" : [
                 {
-                 "id" : "default_packages_tree_store",
-                 "* pack" : "set_model",
-                 "xtype" : "ListStore",
-                 "$ n_columns" : 2,
-                 "| void load" : "() {\n \n    var def = _this.project.compilegroups.get(\"_default_\");\n    var items  = def.packages;\n    \n    this.el.clear();\n    var pal = (Palete.Gtk) _this.project.palete;\n    var pkgs = pal.packages(_this.project);\n    print(\"ValaProjectSettings:packages load %d\\n\", pkgs.size);\n\n    Gtk.TreeIter citer;\n\n    for(var i =0 ; i < pkgs.size; i++) {\n         this.el.append(out citer);   \n         \n        this.el.set_value(citer, 0,   pkgs.get(i) ); // title \n        this.el.set_value(citer, 1,   items.contains(pkgs.get(i)) );\n    }\n    this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);\n    \n}\n",
-                 "$ columns" : "    typeof(string),  // 0 key type\n      typeof(bool)",
-                 "$ xns" : "Gtk"
-                },
-                {
-                 "utf8 title" : "package name",
-                 "* init" : " \n this.el.add_attribute(_this.packages_render.el , \"text\", 0 );\n  ",
-                 "* pack" : "append_column",
-                 "xtype" : "TreeViewColumn",
-                 "gboolean resizable" : true,
-                 "gboolean expand" : true,
                  "$ xns" : "Gtk",
+                 "* prop" : "model",
                  "items" : [
                   {
-                   "id" : "packages_render",
-                   "* pack" : "pack_start,false",
-                   "xtype" : "CellRendererText",
-                   "$ xns" : "Gtk"
-                  }
-                 ]
-                },
-                {
-                 "utf8 title" : "use",
-                 "* init" : "{\n this.el.add_attribute(_this.packages_render_use.el , \"active\", 1 );\n }",
-                 "* pack" : "append_column",
-                 "xtype" : "TreeViewColumn",
-                 "gboolean resizable" : false,
-                 "$ xns" : "Gtk",
-                 "gint fixed_width" : 50,
-                 "items" : [
+                   "$ xns" : "Gtk",
+                   "* prop" : "model",
+                   "items" : [
+                    {
+                     "$ xns" : "GLib",
+                     "* prop" : "model",
+                     "GLib.Type item_type" : "typeof(Project.VapiSelection)",
+                     "id" : "vapimodel",
+                     "xtype" : "ListStore"
+                    },
+                    {
+                     "$ xns" : "Gtk",
+                     "* prop" : "sorter",
+                     "items" : [
+                      {
+                       "$ xns" : "Gtk",
+                       "* prop" : "expression",
+                       "GLib.Type this_type" : "typeof(Project.VapiSelection)",
+                       "string property_name" : "sortkey",
+                       "xtype" : "PropertyExpression"
+                      }
+                     ],
+                     "xtype" : "StringSorter"
+                    }
+                   ],
+                   "xtype" : "SortListModel"
+                  },
                   {
-                   "listeners" : {
-                    "toggled" : "(  path_string) =>  { \n    var m = _this.default_packages_tree_store.el;\n   Gtk.TreeIter iter;\n   Gtk.TreePath path = new Gtk.TreePath.from_string (path_string);\n   m.get_iter (out iter, path);\n   GLib.Value val;\n   m.get_value(iter, 1, out val);\n   m.set_value(iter, 1,  ((bool) val) ? false :true); \n     GLib.Value fval;  \n   m.get_value(iter, 0, out fval);\n   var fn = (string)fval;\n    \n    var def = _this.project.compilegroups.get(\"_default_\");\n    var items  = def.packages;\n    if ((bool)val) {\n        // renive\n        items.remove(fn);\n    } else {\n        items.add(fn);\n    }\n    \n}"
-                   },
-                   "id" : "packages_render_use",
-                   "xtype" : "CellRendererToggle",
-                   "* pack" : "pack_start,false",
                    "$ xns" : "Gtk",
-                   "gboolean activatable" : true
+                   "* prop" : "filter",
+                   "id" : "vapi_filter",
+                   "items" : [
+                    {
+                     "$ xns" : "Gtk",
+                     "* prop" : "expression",
+                     "GLib.Type this_type" : "typeof(Project.VapiSelection)",
+                     "string property_name" : "sortkey",
+                     "xtype" : "PropertyExpression"
+                    }
+                   ],
+                   "xtype" : "StringFilter"
                   }
-                 ]
+                 ],
+                 "xtype" : "FilterListModel"
                 }
-               ]
-              }
-             ]
-            },
-            {
-             "bool hexpand" : true,
-             "xtype" : "ScrolledWindow",
-             "* pack" : "add2",
-             "$ xns" : "Gtk",
-             "items" : [
+               ],
+               "xtype" : "NoSelection"
+              },
               {
-               "listeners" : {
-                "button_press_event" : " ( ev) => {\n    //console.log(\"button press?\");\n   \n    \n    if (ev.type != Gdk.EventType.BUTTON_PRESS  || ev.button != 3) {\n        //print(\"click\" + ev.type);\n        return false;\n    }\n    //Gtk.TreePath res;\n    //if (!this.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {\n    //    return true;\n    //}\n     \n  //  this.el.get_selection().select_path(res);\n     \n      //if (!this.get('/LeftTreeMenu').el)  { \n      //      this.get('/LeftTreeMenu').init(); \n      //  }\n        \n     _this.default_directory_menu.el.set_screen(Gdk.Screen.get_default());\n     _this.default_directory_menu.el.show_all();\n      _this.default_directory_menu.el.popup(null, null, null,  3, ev.time);\n     //   print(\"click:\" + res.path.to_string());\n      return true;\n}"
-               },
-               "gboolean headers_visible" : true,
-               "id" : "default_directory_tree",
-               "* pack" : "add",
-               "xtype" : "TreeView",
                "$ xns" : "Gtk",
+               "* pack" : "append_column",
+               "bool expand" : true,
                "items" : [
                 {
-                 "id" : "default_directory_tree_store",
-                 "* pack" : "set_model",
-                 "xtype" : "ListStore",
-                 "$ n_columns" : 1,
-                 "| void load" : "() {\n \n  this.el.clear();\n  \n    \n     var def = _this.project.compilegroups.get(\"_default_\");\n     var items  = def.sources;\n     \n \n    Gtk.TreeIter citer;\n\n    for(var i =0 ; i < items.size; i++) {\n         this.el.append(out citer);   \n         \n        this.el.set_value(citer, 0,   items.get(i) ); // title \n        //this.el.set_value(citer, 1,   items.get(i) );\n    }\n    this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);\n    \n}\n",
-                 "$ columns" : "    typeof(string)\n     ",
-                 "$ xns" : "Gtk"
-                },
-                {
-                 "utf8 title" : "Available Directories (right click to add)",
-                 "* init" : "\n this.el.add_attribute(_this.directory_render.el , \"text\", 0 );\n   ",
-                 "* pack" : "append_column",
-                 "xtype" : "TreeViewColumn",
-                 "gboolean resizable" : true,
                  "$ xns" : "Gtk",
-                 "items" : [
-                  {
-                   "id" : "directory_render",
-                   "* pack" : "pack_start,false",
-                   "xtype" : "CellRendererText",
-                   "$ xns" : "Gtk"
-                  }
-                 ]
+                 "* prop" : "factory",
+                 "listeners" : {
+                  "bind" : [
+                   "(listitem) => {",
+                   " ",
+                   "\tvar lbl = (Gtk.Label)  ((Gtk.ListItem)listitem).get_child();",
+                   "\t   ",
+                   "\tvar item = (Project.VapiSelection)  ((Gtk.ListItem)listitem).get_item();",
+                   "",
+                   "\titem.bind_property(\"name\",",
+                   "                lbl, \"label\",",
+                   "           GLib.BindingFlags.SYNC_CREATE);",
+                   "",
+                   "\t  ",
+                   "}",
+                   ""
+                  ],
+                  "setup" : [
+                   "(item) => {",
+                   "\t//var j = (JsRender.JsRender) item;",
+                   "\tvar gi = (Gtk.ListItem)item;",
+                   "\t ",
+                   "\tvar lbl = new Gtk.Label(\"\");",
+                   "\tlbl.halign = Gtk.Align.START;",
+                   "\tgi.set_child(lbl);",
+                   "",
+                   "",
+                   "",
+                   "}",
+                   ""
+                  ]
+                 },
+                 "xtype" : "SignalListItemFactory"
                 }
-               ]
+               ],
+               "string title" : "Vapi Package",
+               "xtype" : "ColumnViewColumn"
               },
               {
-               "id" : "default_directory_menu",
-               "xtype" : "Menu",
                "$ xns" : "Gtk",
+               "* pack" : "append_column",
                "items" : [
                 {
-                 "listeners" : {
-                  "activate" : "()  => {\n    \n    var  chooser = new Gtk.FileChooserDialog (\n\t\"Add a directory\", _this.window.el, Gtk.FileChooserAction.SELECT_FOLDER ,\n\t\"_Cancel\",\n\tGtk.ResponseType.CANCEL,\n\t\"_Add\",\n\tGtk.ResponseType.ACCEPT);\n    if (chooser.run () != Gtk.ResponseType.ACCEPT) {\n        chooser.close ();\n           return;\n       }\n       chooser.close ();\n       // add the directory..\n       var fn = _this.project.relPath(chooser.get_filename());\n       _this.project.compilegroups.get(\"_default_\").sources.add(fn);\n       _this.default_directory_tree_store.load();\n}"
-                 },
-                 "* pack" : "add",
-                 "xtype" : "MenuItem",
-                 "$ xns" : "Gtk",
-                 "utf8 label" : "Add Directory"
-                },
-                {
-                 "listeners" : {
-                  "activate" : "()  => {\n    \n    var  chooser = new Gtk.FileChooserDialog (\n\t\"Add a directory\", _this.window.el, Gtk.FileChooserAction.OPEN ,\n\t\"_Cancel\",\n\tGtk.ResponseType.CANCEL,\n\t\"_Add\",\n\tGtk.ResponseType.ACCEPT);\n    if (chooser.run () != Gtk.ResponseType.ACCEPT) {\n        chooser.close ();\n           return;\n       }\n       chooser.close ();\n       // add the directory..\n       var fn = _this.project.relPath(chooser.get_filename());\n       _this.project.compilegroups.get(\"_default_\").sources.add(fn);\n       _this.default_directory_tree_store.load();\n}"
-                 },
-                 "* pack" : "add",
-                 "xtype" : "MenuItem",
                  "$ xns" : "Gtk",
-                 "utf8 label" : "Add File"
-                },
-                {
-                 "* pack" : "add",
-                 "xtype" : "SeparatorMenuItem",
-                 "$ xns" : "Gtk"
-                },
-                {
+                 "* prop" : "factory",
                  "listeners" : {
-                  "activate" : "()  => {\n    \n     //\n        Gtk.TreeModel mod;\n        Gtk.TreeIter iter;\n        if (!_this.default_directory_tree.el.get_selection().get_selected(out mod, out iter)) {\n               print(\"nothing selected\\n\");\n            return;\n        }\n\n            \n       // add the directory..\n       \n       \n       GLib.Value val;\n        mod.get_value(iter,0, out val);\n       var fn =  (string) val;\n       \n       print(\"remove: %s\\n\", fn);\n       if (!_this.project.compilegroups.get(\"_default_\").sources.remove(fn)) {\n                  print(\"remove failed\");\n              }\n       _this.default_directory_tree_store.load();\n}"
+                  "bind" : [
+                   "(listitem) => {",
+                   "\t //GLib.debug(\"listitme is is %s\", ((Gtk.ListItem)listitem).get_type().name());",
+                   "\t",
+                   "\t",
+                   "\t",
+                   "\t//var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
+                   "\tvar btn = (Gtk.CheckButton)  ((Gtk.ListItem)listitem).get_child();",
+                   "\t  ",
+                   " ",
+                   "\tvar vs = (Project.VapiSelection)((Gtk.ListItem)listitem).get_item();",
+                   "",
+                   "\t//GLib.debug(\"change  %s to %s\", lbl.label, np.name);",
+                   "",
+                   "\tbtn.active = vs.selected; ",
+                   "\t",
+                   "\tvs.btn = btn;",
+                   " \t// bind image...",
+                   " \t",
+                   "}"
+                  ],
+                  "setup" : [
+                   "",
+                   "(listitem) => {",
+                   "",
+                   "\tvar btn = new Gtk.CheckButton();",
+                   " ",
+                   "\t((Gtk.ListItem)listitem).set_child(btn);",
+                   "\t",
+                   "\tbtn.toggled.connect(() =>  {",
+                   "\t ",
+                   "\t\tvar jr = (Project.VapiSelection) ((Gtk.ListItem)listitem).get_item();",
+                   "\t\tjr.selected = btn.active;",
+                   "\t});",
+                   "}",
+                   ""
+                  ]
                  },
-                 "* pack" : "add",
-                 "xtype" : "MenuItem",
-                 "$ xns" : "Gtk",
-                 "utf8 label" : "Remove File/Directory"
+                 "xtype" : "SignalListItemFactory"
                 }
-               ]
+               ],
+               "string title" : "use",
+               "xtype" : "ColumnViewColumn"
               }
-             ]
+             ],
+             "xtype" : "ColumnView"
             }
-           ]
+           ],
+           "xtype" : "ScrolledWindow"
+          },
+          {
+           "$ xns" : "Gtk",
+           "id" : "vapi_search",
+           "listeners" : {
+            "search_changed" : [
+             "( ) => {",
+             "",
+             " _this.vapi_filter.el.set_search(this.el.get_text());",
+             " ",
+             "}",
+             ""
+            ]
+           },
+           "string placeholder_text" : "Search Libraries (Vapi)",
+           "uint search_delay" : 500,
+           "xtype" : "SearchEntry"
           }
-         ]
+         ],
+         "xtype" : "Box"
         },
         {
-         "gint position" : 300,
-         "xtype" : "Paned",
-         "* pack" : "append_page,_this.label_targets.el",
          "$ xns" : "Gtk",
+         "* pack" : "append_page,_this.label_targets.el",
          "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
+         "bool vexpand" : true,
+         "gint position" : 300,
          "items" : [
           {
-           "* init" : "{  \nthis.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);\n\n}\n",
-           "xtype" : "ScrolledWindow",
-           "* pack" : "add1",
            "$ xns" : "Gtk",
+           "* pack" : "set_end_child",
+           "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
+           "gboolean homogeneous" : false,
+           "id" : "set_vbox",
            "items" : [
             {
-             "id" : "targets_tree_menu",
-             "* pack" : "add",
-             "xtype" : "Menu",
              "$ xns" : "Gtk",
+             "bool vexpand" : true,
              "items" : [
               {
-               "listeners" : {
-                "activate" : "()  => {\n    \n       if (_this.project.compilegroups.has_key(\"NEW GROUP\")) {\n        return;\n    }\n      \n       // add the directory..\n       \n       _this.project.compilegroups.set(\"NEW GROUP\", new Project.GtkValaSettings(\"NEW GROUP\"));\n       _this.targets_tree_store.load();\n}"
-               },
-               "* pack" : "add",
-               "xtype" : "MenuItem",
-               "$ xns" : "Gtk",
-               "utf8 label" : "Add Compile Target"
-              },
-              {
-               "* pack" : "add",
-               "xtype" : "SeparatorMenuItem",
-               "$ xns" : "Gtk"
-              },
-              {
-               "listeners" : {
-                "activate" : "()  => {\n    \n     //\n        Gtk.TreeModel mod;\n        Gtk.TreeIter iter;\n        if (!_this.targets_tree.el.get_selection().get_selected(out mod, out iter)) {\n               print(\"nothing selected\\n\");\n            return;\n        }\n\n            \n       // add the directory..\n       \n       \n       GLib.Value val;\n        mod.get_value(iter,0, out val);\n       var fn =  (string) val;\n       \n       print(\"remove: %s\\n\", fn);\n       if (!_this.project.compilegroups.unset(fn)) {\n                  print(\"remove failed\");\n      }\n       _this.targets_tree_store.load();\n}"
-               },
-               "* pack" : "add",
-               "xtype" : "MenuItem",
-               "$ xns" : "Gtk",
-               "utf8 label" : "Remove Target"
-              }
-             ]
-            },
-            {
-             "listeners" : {
-              "button_press_event" : " ( ev) => {\n    //console.log(\"button press?\");\n   \n    \n    if (ev.type != Gdk.EventType.BUTTON_PRESS  || ev.button != 3) {\n        //print(\"click\" + ev.type);\n        return false;\n    }\n    //Gtk.TreePath res;\n    //if (!this.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {\n    //    return true;\n    //}\n     \n  //  this.el.get_selection().select_path(res);\n     \n      //if (!this.get('/LeftTreeMenu').el)  { \n      //      this.get('/LeftTreeMenu').init(); \n      //  }\n        \n     _this.targets_tree_menu.el.set_screen(Gdk.Screen.get_default());\n     _this.targets_tree_menu.el.show_all();\n      _this.targets_tree_menu.el.popup(null, null, null,  3, ev.time);\n     //   print(\"click:\" + res.path.to_string());\n      return true;\n}",
-              "cursor_changed" : " ( ) => {\n\n    if (this.cursor != \"\") {\n         // save the values..\n     }\n     \n     // load the new values.\n     \n\n         Gtk.TreeModel mod;\n        Gtk.TreeIter iter;\n        if (!this.el.get_selection().get_selected(out mod, out iter)) {\n            print(\"nothing selected\\n\");\n            // should disable the right hand side..\n            _this.set_vbox.el.hide();\n            return;\n        }\n        _this.set_vbox.el.show();\n            \n       // add the directory..\n       \n       \n       GLib.Value val;\n        mod.get_value(iter,0, out val);\n       var fn =  (string) val;\n       \n       this.cursor = fn;\n       var cg = _this.project.compilegroups.get(fn);\n       \n       _this.build_pack_target.el.set_text(cg.target_bin);\n       _this.build_compile_flags.el.set_text(cg.compile_flags);\n\t\t_this.build_execute_args.el.set_text(cg.execute_args);\n       \n       _this.set_vbox.cgroup = cg;\n       _this.files_tree_store.update();\n       \n       // load the srouces\n       \n\n  }"
-             },
-             "id" : "targets_tree",
-             "# string cursor" : "",
-             "* pack" : "add",
-             "xtype" : "TreeView",
-             "$ xns" : "Gtk",
-             "items" : [
-              {
-               "id" : "targets_tree_store",
-               "xtype" : "ListStore",
-               "* pack" : "set_model",
-               "$ n_columns" : 2,
-               "| void load" : "() {\n \n  this.el.clear();\n  \n    \n     var cg = _this.project.compilegroups;\n     \n   _this.targets_tree.cursor = \"\";\n    Gtk.TreeIter citer;\n    var iter = cg.map_iterator();\n   while(iter.next()) {\n        var key = iter.get_key();\n        if (key == \"_default_\") {\n            continue;\n        }\n    \n         this.el.append(out citer);   \n         \n        this.el.set_value(citer, 0,   key ); // title \n        //this.el.set_value(citer, 1,   items.get(i) );\n    };\n    this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);\n    _this.set_vbox.el.hide();\n}\n",
-               "$ columns" : "    typeof(string),  // 0 key type\n     typeof(string) // ??\n     ",
-               "$ xns" : "Gtk"
-              },
-              {
-               "utf8 title" : "name",
-               "* init" : " {\n     this.el.add_attribute(_this.targets_render.el , \"text\", 0 );\n }",
-               "* pack" : "append_column",
-               "xtype" : "TreeViewColumn",
-               "gboolean resizable" : true,
                "$ xns" : "Gtk",
+               "* prop" : "child",
+               "id" : "treeview",
                "items" : [
                 {
-                 "listeners" : {
-                  "edited" : "  (path, newtext) => {\n     \n     Gtk.TreeIter  iter;\n        _this.targets_tree_store.el.get_iter(out iter, new Gtk.TreePath.from_string(path));\n       GLib.Value gval;\n        _this.targets_tree_store.el.get_value(iter,0, out gval);\n        var oldval = (string)gval;\n       if (oldval == newtext) {\n          return;\n        }\n         var cg = _this.project.compilegroups.get(oldval);\n        cg.name = newtext;\n        _this.project.compilegroups.unset(oldval);\n        _this.project.compilegroups.set(newtext, cg);\n       _this.targets_tree_store.load();\n  }"
-                 },
-                 "id" : "targets_render",
-                 "xtype" : "CellRendererText",
-                 "* pack" : "pack_start,false",
                  "$ xns" : "Gtk",
-                 "gboolean editable" : true
+                 "* prop" : "model",
+                 "id" : "treeselmodel",
+                 "items" : [
+                  {
+                   "$ xns" : "Gtk",
+                   "* prop" : "model",
+                   "items" : [
+                    {
+                     "$ xns" : "Gtk",
+                     "* init" : [
+                      "{",
+                      "\t//this.el.set_sorter(new Gtk.TreeListRowSorter(_this.treeview.el.sorter));",
+                      "}",
+                      ""
+                     ],
+                     "* prop" : "model",
+                     "id" : "treelistsort",
+                     "items" : [
+                      {
+                       "$ xns" : "Gtk",
+                       "* prop" : "model",
+                       "Gtk.TreeListModelCreateModelFunc create_func" : [
+                        "(item) => {",
+                        "\t//GLib.debug(\"liststore got %s\", item.get_type().name());",
+                        "\treturn ((JsRender.JsRender)item).childfiles;",
+                        "} "
+                       ],
+                       "bool autoexpand" : true,
+                       "bool passthrough" : false,
+                       "id" : "treelistmodel",
+                       "items" : [
+                        {
+                         "$ xns" : "GLib",
+                         "* prop" : "root",
+                         "GLib.Type item_type" : "typeof(JsRender.JsRender)",
+                         "id" : "treemodel",
+                         "xtype" : "ListStore"
+                        }
+                       ],
+                       "xtype" : "TreeListModel"
+                      },
+                      {
+                       "$ xns" : "Gtk",
+                       "* prop" : "sorter",
+                       "items" : [
+                        {
+                         "$ xns" : "Gtk",
+                         "* prop" : "sorter",
+                         "items" : [
+                          {
+                           "$ xns" : "Gtk",
+                           "* prop" : "expression",
+                           "GLib.Type this_type" : "typeof(JsRender.JsRender)",
+                           "string property_name" : "name",
+                           "xtype" : "PropertyExpression"
+                          }
+                         ],
+                         "xtype" : "StringSorter"
+                        }
+                       ],
+                       "xtype" : "TreeListRowSorter"
+                      }
+                     ],
+                     "xtype" : "SortListModel"
+                    },
+                    {
+                     "$ xns" : "Gtk",
+                     "* prop" : "filter",
+                     "Gtk.CustomFilterFunc match_func" : [
+                      "(item) => { ",
+                      "\t",
+                      "\tvar tr = ((Gtk.TreeListRow)item).get_item();",
+                      "\t//GLib.debug(\"filter %s\", tr.get_type().name());",
+                      "\tvar j =  (JsRender.JsRender) tr;",
+                      "\tif (j.xtype == \"Gtk\") {",
+                      "\t\treturn true;",
+                      "\t}",
+                      "\tif (j.xtype != \"Dir\") {",
+                      "\t\treturn j.path.has_suffix(\".vala\") ||  j.path.has_suffix(\".c\");",
+                      "\t}",
+                      "\t// dirs..",
+                      "\t ",
+                      "\tfor (var i =0 ; i < j.childfiles.n_items; i++) {",
+                      "\t\tvar f = (JsRender.JsRender) j.childfiles.get_item(i);",
+                      "\t\tif (f.xtype == \"Gtk\") {",
+                      "\t\t\treturn true;",
+                      "\t\t}",
+                      "\t\tif (f.path.has_suffix(\".vala\") ||  f.path.has_suffix(\".c\")) {",
+                      "\t\t\treturn true;",
+                      "\t\t}",
+                      "\t}",
+                      "\treturn false;",
+                      "",
+                      "}"
+                     ],
+                     "xtype" : "CustomFilter"
+                    }
+                   ],
+                   "xtype" : "FilterListModel"
+                  }
+                 ],
+                 "xtype" : "SingleSelection"
+                },
+                {
+                 "$ xns" : "Gtk",
+                 "* init" : [
+                  "{",
+                  "\t this.el.set_sorter(  new Gtk.StringSorter(",
+                  "\t \tnew Gtk.PropertyExpression(typeof(JsRender.JsRender), null, \"name\")",
+                  " \t));",
+                  "\t\t;",
+                  "\t\t",
+                  "}",
+                  ""
+                 ],
+                 "* pack" : "append_column",
+                 "bool expand" : true,
+                 "bool resizable" : true,
+                 "id" : "name",
+                 "items" : [
+                  {
+                   "$ xns" : "Gtk",
+                   "* prop" : "factory",
+                   "listeners" : {
+                    "bind" : [
+                     "(listitem) => {",
+                     "\t //GLib.debug(\"listitme is is %s\", ((Gtk.ListItem)listitem).get_type().name());",
+                     "\t",
+                     "\t",
+                     "\t",
+                     "\t//var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
+                     "\tvar expand = (Gtk.TreeExpander)  ((Gtk.ListItem)listitem).get_child();",
+                     "\t  ",
+                     " ",
+                     "\tvar lbl = (Gtk.Label) expand.child;",
+                     "\t",
+                     "\t if (lbl.label != \"\") { // do not update",
+                     "\t \treturn;",
+                     " \t}",
+                     "\t",
+                     "",
+                     "\tvar lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();",
+                     "\tvar jr = (JsRender.JsRender) lr.get_item();",
+                     "\t//GLib.debug(\"change  %s to %s\", lbl.label, np.name);",
+                     "\tlbl.label = jr.name; // for dir's we could hsow the sub path..",
+                     "\tlbl.tooltip_markup = jr.path;",
+                     "\t ",
+                     "    expand.set_hide_expander(  jr.childfiles.n_items < 1);",
+                     " \texpand.set_list_row(lr);",
+                     " ",
+                     "  \texpand.set_hide_expander(  jr.xtype != \"Dir\" );",
+                     " \t expand.set_list_row(lr);",
+                     " ",
+                     " \t// bind image...",
+                     " \t",
+                     "}",
+                     ""
+                    ],
+                    "setup" : [
+                     "(listitem) => {",
+                     "\t",
+                     "\tvar expand = new Gtk.TreeExpander();",
+                     "\t ",
+                     "\texpand.set_indent_for_depth(true);",
+                     "\texpand.set_indent_for_icon(true);",
+                     "\t ",
+                     "\tvar lbl = new Gtk.Label(\"\");",
+                     "\tlbl.use_markup = true;",
+                     "\t",
+                     "\t",
+                     " \tlbl.justify = Gtk.Justification.LEFT;",
+                     " \tlbl.xalign = 0;",
+                     "",
+                     " ",
+                     "\texpand.set_child(lbl);",
+                     "\t((Gtk.ListItem)listitem).set_child(expand);",
+                     "\t((Gtk.ListItem)listitem).activatable = false;",
+                     "}",
+                     ""
+                    ]
+                   },
+                   "xtype" : "SignalListItemFactory"
+                  }
+                 ],
+                 "string title" : "Other Files",
+                 "xtype" : "ColumnViewColumn"
+                },
+                {
+                 "$ xns" : "Gtk",
+                 "* pack" : "append_column",
+                 "items" : [
+                  {
+                   "$ xns" : "Gtk",
+                   "* prop" : "factory",
+                   "listeners" : {
+                    "bind" : [
+                     "(listitem) => {",
+                     "\t //GLib.debug(\"listitme is is %s\", ((Gtk.ListItem)listitem).get_type().name());",
+                     "\t",
+                     "\t",
+                     "\t",
+                     "\t//var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
+                     "\tvar btn = (Gtk.CheckButton)  ((Gtk.ListItem)listitem).get_child();",
+                     "\t  ",
+                     " ",
+                     "\tvar lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();",
+                     "\tvar jr = (JsRender.JsRender) lr.get_item();",
+                     "\t//GLib.debug(\"change  %s to %s\", lbl.label, np.name);",
+                     "",
+                     "\t//btn.active = jr.compile_group_selected;",
+                     "\tbtn.active = _this.selected_target.has_file(jr);",
+                     "\t",
+                     " \t//jr.bind_property(\"compile_group_selected\",",
+                     "    //                btn, \"active\",",
+                     "    //               GLib.BindingFlags.BIDIRECTIONAL); ",
+                     " \t// bind image...",
+                     " \t",
+                     "}"
+                    ],
+                    "setup" : [
+                     "(listitem) => {",
+                     "",
+                     "\tvar btn = new Gtk.CheckButton();",
+                     " ",
+                     "\t((Gtk.ListItem)listitem).set_child(btn);",
+                     "\t",
+                     "\tbtn.toggled.connect(() =>  {",
+                     "\t \tif (_this.cg_loading) {",
+                     "\t \t\treturn;",
+                     " \t\t}",
+                     "\t\tvar lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();",
+                     "\t\tvar jr = (JsRender.JsRender) lr.get_item();",
+                     "\t\tjr.compile_group_selected = btn.active;",
+                     "\t\t",
+                     "\t\t",
+                     "\t});",
+                     "}",
+                     ""
+                    ]
+                   },
+                   "xtype" : "SignalListItemFactory"
+                  }
+                 ],
+                 "string title" : "use",
+                 "xtype" : "ColumnViewColumn"
                 }
-               ]
+               ],
+               "xtype" : "ColumnView"
               }
-             ]
+             ],
+             "xtype" : "ScrolledWindow"
             }
-           ]
+           ],
+           "xtype" : "Box"
           },
           {
-           "id" : "set_vbox",
-           "xtype" : "Box",
-           "* pack" : "add2",
-           "gboolean homogeneous" : false,
            "$ xns" : "Gtk",
-           "# Project.GtkValaSettings cgroup" : "null",
+           "* prop" : "start_child",
            "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
+           "int spacing" : 0,
            "items" : [
             {
-             "xtype" : "Label",
-             "* pack" : "pack_start,false,false,0",
-             "$ xns" : "Gtk",
-             "utf8 label" : "target filename"
-            },
-            {
-             "listeners" : {
-              "changed" : "()  => {\n        if (_this.targets_tree.cursor.length < 1) {\n        return;\n    }\n    _this.project.compilegroups.get(_this.targets_tree.cursor).target_bin = this.el.text;\n}"
-             },
-             "id" : "build_pack_target",
-             "xtype" : "Entry",
-             "* pack" : "pack_start,false,false,0",
-             "$ xns" : "Gtk"
-            },
-            {
-             "xtype" : "Label",
-             "* pack" : "pack_start,false,false,0",
              "$ xns" : "Gtk",
-             "utf8 label" : "compile flags"
-            },
-            {
-             "listeners" : {
-              "changed" : "() => {\n    if (_this.targets_tree.cursor.length < 1) {\n        return;\n    }\n    _this.project.compilegroups.get(_this.targets_tree.cursor).compile_flags = this.el.text;\n}"
-             },
-             "id" : "build_compile_flags",
-             "xtype" : "Entry",
-             "* pack" : "pack_start,false,false,0",
-             "$ xns" : "Gtk"
-            },
-            {
-             "xtype" : "Label",
-             "* pack" : "pack_start,false,false,0",
-             "$ xns" : "Gtk",
-             "utf8 label" : "test argments - when run after a build"
-            },
-            {
-             "listeners" : {
-              "changed" : "() => {\n    if (_this.targets_tree.cursor.length < 1) {\n        return;\n    }\n    _this.project.compilegroups.get(_this.targets_tree.cursor).execute_args = this.el.text;\n}"
-             },
-             "id" : "build_execute_args",
-             "string placeholder_text" : "eg.  -f somefile -g ",
-             "xtype" : "Entry",
-             "* pack" : "pack_start,false,false,0",
-             "$ xns" : "Gtk"
-            },
-            {
-             "xtype" : "Label",
-             "* pack" : "pack_start,false,false,0",
-             "$ xns" : "Gtk",
-             "utf8 label" : "Files to compile"
+             "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
+             "bool hexpand" : true,
+             "int spacing" : 0,
+             "items" : [
+              {
+               "$ xns" : "Gtk",
+               "bool hexpand" : true,
+               "listeners" : {
+                "clicked" : [
+                 "()  => {",
+                 "    ",
+                 "       if (_this.project.compilegroups.has_key(\"NEW GROUP\")) {",
+                 "        return;",
+                 "    }",
+                 "    var cg = new Project.GtkValaSettings(_this.project, \"NEW GROUP\");",
+                 "    _this.project.compilegroups.set(cg.name, cg);",
+                 "     _this.project.loadTargetsIntoStore(_this.target_model.el);",
+                 "     //  select it.. ?? should load it??",
+                 "     for(var i =0;i < _this.target_model.el.n_items; i++) {",
+                 "     \tvar ncg = (Project.GtkValaSettings) _this.target_model.el.get_item(i);",
+                 "     \tif (ncg.name == cg.name) {",
+                 "     \t\t_this.target_sel.el.selected = i;",
+                 "     \t\t_this.target_sel.selectTarget(cg);",
+                 "     \t\tbreak;",
+                 " \t\t}",
+                 "\t} ",
+                 "\t",
+                 "\t",
+                 "\t ",
+                 "}"
+                ]
+               },
+               "utf8 label" : "Add Compile Target",
+               "xtype" : "Button"
+              },
+              {
+               "$ xns" : "Gtk",
+               "bool hexpand" : true,
+               "listeners" : {
+                "clicked" : [
+                 "()  => {",
+                 "    // load the new values.",
+                 "\tif (_this.target_sel.el.selected == Gtk.INVALID_LIST_POSITION) {",
+                 "\t\tGLib.debug(\"nothing selected\");",
+                 "\t\treturn;",
+                 "\t}",
+                 "\t",
+                 "\t ",
+                 "\t// add the directory..",
+                 "\tvar cg = (Project.GtkValaSettings) _this.target_model.el.get_item(_this.target_sel.el.selected);",
+                 "\t ",
+                 "\t ",
+                 "\tGLib.debug(\"remove: %s\\n\", cg.name);",
+                 "\tif (!_this.project.compilegroups.unset(cg.name)) {",
+                 "\t\tGLib.debug(\"remove failed\");",
+                 "\t}",
+                 " \t_this.project.loadTargetsIntoStore(_this.target_model.el);",
+                 "}"
+                ]
+               },
+               "utf8 label" : "Remove Target",
+               "xtype" : "Button"
+              }
+             ],
+             "xtype" : "Box"
             },
             {
-             "* pack" : "pack_start,true,true,0",
-             "xtype" : "ScrolledWindow",
              "$ xns" : "Gtk",
+             "* init" : [
+              "{  ",
+              "this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);",
+              "",
+              "}",
+              ""
+             ],
+             "bool vexpand" : true,
              "items" : [
               {
-               "xtype" : "TreeView",
-               "* pack" : "add",
-               "string id" : "files_tree",
                "$ xns" : "Gtk",
+               "* prop" : "child",
                "items" : [
                 {
-                 "id" : "files_tree_store",
-                 "xtype" : "ListStore",
-                 "* pack" : "set_model",
-                 "| void updateDir" : "(string dname, bool bval) {\n  \n  Gtk.TreeIter citer;\n\n    var cg =   _this.set_vbox.cgroup;\n  for(var i =0 ; i < this.el.iter_n_children(null); i++) {\n        this.el.iter_nth_child(out citer,null,i);\n\n        GLib.Value val;\n        this.el.get_value(citer,0, out val);\n        var fn = (string) val;\n        \n        if ( Path.get_dirname (fn) == dname) {\n        \n            this.el.set_value(citer, 3,   bval ); // checked \n           \n     \n     \n            if (!bval) {\n                // renive\n                if (cg.sources.contains(fn)) {\n                    cg.sources.remove(fn);\n                }\n            } else {\n                if (!cg.sources.contains(fn)) {\n                    cg.sources.add(fn);\n                }\n            }\n            \n            \n        }\n    }\n\n}\n",
-                 "$ n_columns" : 4,
-                 "| void load" : "() {\n \n      this.el.clear();\n  \n    \n     var def = _this.project.compilegroups.get(\"_default_\");\n     var items  = def.sources;\n     \n     \n     \n     \n \n    Gtk.TreeIter citer;\n\n    for(var i =0 ; i < items.size; i++) {\n    \n         var files = _this.project.filesForCompile(items.get(i), false);\n         if (files.size < 1) {\n            continue;\n         }\n    \n         this.el.append(out citer);   \n         \n        this.el.set_value(citer, 0,   items.get(i) ); // title \n        this.el.set_value(citer, 1,   \"<span foreground=\\\"green\\\" font_weight=\\\"bold\\\">\" + \n                    GLib.Markup.escape_text(items.get(i)) + \"</span>\"\n            ); // title \n        print(\"ADD item %s\", items.get(i));\n        this.el.set_value(citer, 2,   \"dir\"); // type         \n        this.el.set_value(citer, 3,   false ); // checked \n\n       \n        \n         for(var j =0 ; j < files.size; j++) {\n            this.el.append(out citer);   \n             print(\"ADD item %s\", files.get(j));\n            this.el.set_value(citer, 0,   files.get(j) ); // title \n            this.el.set_value(citer, 1,   GLib.Markup.escape_text( Path.get_basename (files.get(j))) ); // title             \n            this.el.set_value(citer, 2,   \"file\"); // type         \n            this.el.set_value(citer, 3,   false ); // checked \n\n        }\n        \n        \n        //this.el.set_value(citer, 1,   items.get(i) );\n    }\n    this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);\n    if (_this.set_vbox.cgroup == null) {\n\t\t_this.files_tree.set_sensitive(false);\n    \n    }\n}\n ",
-                 "$ columns" : "    typeof(string),  // 0 file name\n        typeof(string),  // 0 basename\n     typeof(string), // type (dir orfile)\n     typeof(bool)  // is checked.\n     ",
-                 "$ xns" : "Gtk",
-                 "| void update" : "() {\n\n\n    Gtk.TreeIter citer;\n\n    for(var i =0 ; i < this.el.iter_n_children(null); i++) {\n        this.el.iter_nth_child(out citer,null,i);\n\n        GLib.Value val;\n        this.el.get_value(citer,0, out val);\n        var fn = (string) val;\n        \n        var active = false;\n        if (_this.set_vbox.cgroup.sources.contains(fn)) {\n            active = true;\n        }\n        \n        this.el.set_value(citer, 3,   active ); // checked \n    }\n\n\n}\n"
-                },
-                {
-                 "utf8 title" : "name",
-                 "* init" : "\n this.el.add_attribute(_this.files_render.el , \"markup\", 1 ); // basnemae\n \n/*  this.el.add_attribute(_this.files_render.el , \"markup\", 2 );\n*/",
-                 "* pack" : "append_column",
-                 "xtype" : "TreeViewColumn",
-                 "gboolean resizable" : true,
                  "$ xns" : "Gtk",
+                 "* prop" : "model",
+                 "id" : "target_sel",
                  "items" : [
                   {
-                   "id" : "files_render",
-                   "* pack" : "pack_start,false",
-                   "xtype" : "CellRendererText",
-                   "$ xns" : "Gtk"
+                   "$ xns" : "GLib",
+                   "* prop" : "model",
+                   "GLib.Type item_type" : "typeof(Project.GtkValaSettings)",
+                   "id" : "target_model",
+                   "xtype" : "ListStore"
                   }
+                 ],
+                 "listeners" : {
+                  "selection_changed" : [
+                   "(position, n_items) => {",
+                   "",
+                   "\t ",
+                   "\t// load the new values.",
+                   "\tif (this.el.selected == Gtk.INVALID_LIST_POSITION) {",
+                   "\t\tthis.selectTarget(null);",
+                   "\t\treturn;",
+                   "\t}",
+                   "\tthis.selectTarget(null);",
+                   "\t",
+                   " ",
+                   "",
+                   "\t// add the directory..",
+                   "\tvar cg = (Project.GtkValaSettings) _this.target_model.el.get_item(this.el.selected);",
+                   "\t",
+                   "\tthis.selectTarget(cg);",
+                   "   ",
+                   "}",
+                   ""
+                  ]
+                 },
+                 "xtype" : "SingleSelection",
+                 "| void selectTarget" : [
+                  "(Project.GtkValaSettings? cg) {",
+                  "// load the new values",
+                  "\t _this.selected_target = cg;  ",
+                  "\t _this.project.active_cg = cg;",
+                  "\t ",
+                  "",
+                  "\tif (cg == null) {",
+                  "\t\t ",
+                  "\t\t_this.set_vbox.el.hide();\t",
+                  "\t\t_this.set_vboxb.el.hide();\t",
+                  "\t\treturn;",
+                  "\t}",
+                  "\t",
+                  "\t",
+                  "\t_this.set_vbox.el.show();",
+                  "\t_this.set_vboxb.el.show();",
+                  "\t// add the directory..",
+                  " ",
+                  "\t ",
+                  "\t GLib.debug(\"loading dirs into project list\");",
+                  "\t cg.loading_ui = true;",
+                  "\t _this.cg_loading = true;",
+                  "",
+                  "\t  _this.treeview.el.set_model(new Gtk.SingleSelection(null));",
+                  "\t  _this.project.loadDirsIntoStore(_this.treemodel.el);",
+                  " \t  _this.treeview.el.set_model(_this.treeselmodel.el);",
+                  "\t  ",
+                  "\t cg.loading_ui = false;",
+                  "\t ",
+                  "\t _this.cg_loading = false;",
+                  "\t GLib.debug(\"Set name to %s\", cg.name);",
+                  "\t ",
+                  " \t_this.build_name.el.buffer.set_text(cg.name.data);",
+                  " \t_this.build_as_library.el.active = cg.is_library;",
+                  " ",
+                  "\t_this.build_execute_args.el.buffer.set_text(  cg.execute_args.data );",
+                  " ",
+                  "}",
+                  ""
                  ]
                 },
                 {
-                 "utf8 title" : "use",
-                 "* init" : "{\n this.el.add_attribute(_this.files_render_use.el , \"active\", 3 );\n }",
-                 "* pack" : "append_column",
-                 "xtype" : "TreeViewColumn",
-                 "gboolean resizable" : false,
                  "$ xns" : "Gtk",
-                 "gint fixed_width" : 50,
+                 "* pack" : "append_column",
+                 "bool expand" : true,
                  "items" : [
                   {
+                   "$ xns" : "Gtk",
+                   "* prop" : "factory",
                    "listeners" : {
-                    "toggled" : "(  path_string) =>  { \n\n\n\n    var m = _this.files_tree_store.el;\n   Gtk.TreeIter iter;\n   Gtk.TreePath path = new Gtk.TreePath.from_string (path_string);\n   m.get_iter (out iter, path);\n   GLib.Value val;\n   m.get_value(iter, 3, out val);\n   m.set_value(iter, 3,  ((bool) val) ? false :true); \n   \n   // type.\n   GLib.Value ftval;  \n   m.get_value(iter, 2, out ftval);\n   var ftype = (string)ftval;   \n   \n   // full name...  \n   GLib.Value fval;     \n   m.get_value(iter, 0, out fval);\n   var fn = (string)fval;\n    \n    \n    var cg =   _this.set_vbox.cgroup;\n    // what's the sleected target?\n    // update the list..\n    // if ftype is a dir == then toggle all the bellow.\n    \n    if (ftype == \"dir\") {\n        _this.files_tree_store.updateDir(fn,  ((bool) val) ? false :true);\n    }\n    \n    // if ftype is a file .. see if all the files in that directory are check and check the dir.\n\n     \n    if ((bool)val) {\n        // renive\n        cg.sources.remove(fn);\n    } else {\n        cg.sources.add(fn);\n    }\n    \n}"
+                    "bind" : [
+                     "(listitem) => {",
+                     " ",
+                     "\tvar lbl = (Gtk.Label)  ((Gtk.ListItem)listitem).get_child();",
+                     "\t   ",
+                     "\tvar item = (Project.GtkValaSettings)  ((Gtk.ListItem)listitem).get_item();",
+                     "",
+                     "\titem.bind_property(\"name\",",
+                     "                lbl, \"label\",",
+                     "           GLib.BindingFlags.SYNC_CREATE);",
+                     "",
+                     "\t  ",
+                     "}",
+                     ""
+                    ],
+                    "setup" : [
+                     "(item) => {",
+                     "\t//var j = (JsRender.JsRender) item;",
+                     "\tvar gi = (Gtk.ListItem)item;",
+                     "\t ",
+                     "\tvar lbl = new Gtk.Label(\"\");",
+                     "\tlbl.halign = Gtk.Align.START;",
+                     "\tgi.set_child(lbl);",
+                     "",
+                     "",
+                     "",
+                     "}",
+                     ""
+                    ]
                    },
-                   "id" : "files_render_use",
-                   "xtype" : "CellRendererToggle",
-                   "* pack" : "pack_start,false",
-                   "$ xns" : "Gtk",
-                   "gboolean activatable" : true
+                   "xtype" : "SignalListItemFactory"
                   }
-                 ]
+                 ],
+                 "string title" : "Build Target",
+                 "xtype" : "ColumnViewColumn"
                 }
-               ]
+               ],
+               "xtype" : "ColumnView"
+              }
+             ],
+             "xtype" : "ScrolledWindow"
+            },
+            {
+             "$ xns" : "Gtk",
+             "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
+             "id" : "set_vboxb",
+             "int spacing" : 0,
+             "items" : [
+              {
+               "$ xns" : "Gtk",
+               "utf8 label" : "Build Name (executable name)",
+               "xtype" : "Label"
+              },
+              {
+               "# bool in_insert" : false,
+               "$ xns" : "Gtk",
+               "* init" : [
+                "",
+                "var ed = (this.el.get_delegate() as Gtk.Editable);",
+                "if (ed != null) {",
+                "\ted.insert_text.connect((text, length, ref position) => {",
+                "\t\tif (this.in_insert) {",
+                "\t\t\treturn;",
+                "\t\t}",
+                "\t\tGLib.debug(\"got insert text %s\", text);",
+                "\t\t",
+                "\t\tvar nt = \"\";",
+                "\t\tfor(var i = 0;i < text.length; i++){ ",
+                "\t\t\tif (Posix.isupper(text[i]) ||Posix.islower(text[i])  ) {",
+                "\t\t\t\tnt +=  text[i].to_string();",
+                "\t\t\t}\t",
+                "\t\t}",
+                "\t\tif (nt.length < 1) {",
+                "\t\t\tGLib.Signal.stop_emission_by_name(ed, \"insert_text\");",
+                "\t\t\treturn;",
+                "\t\t}",
+                "",
+                "\t\tthis.in_insert = true;",
+                "\t ",
+                "\t\tthis.el.insert_text(nt,nt.length, ref position);",
+                "\t\tthis.in_insert = false;",
+                "\t\tGLib.Signal.stop_emission_by_name(ed, \"insert_text\");",
+                "\t});",
+                "",
+                "}"
+               ],
+               "id" : "build_name",
+               "listeners" : {
+                "changed" : [
+                 "()  => {",
+                 "\tif (_this.selected_target == null) {",
+                 "\t\treturn;",
+                 "\t}",
+                 "\tvar name = this.el.text;",
+                 "\t// name ischanging.. probably always..",
+                 "\tif (_this.selected_target.name != name) {",
+                 "\t\t_this.project.compilegroups.unset(_this.selected_target.name);",
+                 "\t\t_this.project.compilegroups.set(name, _this.selected_target);",
+                 "\t}",
+                 "",
+                 "\t_this.selected_target.name = this.el.buffer.text;",
+                 "}"
+                ],
+                "insert_text" : [
+                 "(text, length, ref position) => {",
+                 "\tif (this.in_insert) {",
+                 "\t\treturn;",
+                 "\t}",
+                 "\tGLib.debug(\"got insert text %s\", text);",
+                 "\t",
+                 "\tvar nt = \"\";",
+                 "\tfor(var i = 0;i < text.length; i++){ ",
+                 "\t\tif (Posix.isalpha(text[i])) {",
+                 "\t\t\tnt +=  text[i].to_string();",
+                 "\t\t}\t",
+                 "\t}",
+                 "\tif (nt.length < 1) {",
+                 "\t\treturn;",
+                 "\t}",
+                 "",
+                 "\tthis.in_insert = true;",
+                 " ",
+                 "\tthis.el.insert_text(text,length, ref position);",
+                 "\tthis.in_insert = false;",
+                 "}",
+                 ""
+                ]
+               },
+               "xtype" : "Entry"
+              },
+              {
+               "$ xns" : "Gtk",
+               "utf8 label" : "test argments - when run after a build",
+               "xtype" : "Label"
+              },
+              {
+               "$ xns" : "Gtk",
+               "id" : "build_execute_args",
+               "listeners" : {
+                "changed" : [
+                 "() => {",
+                 "    if (_this.selected_target == null) {",
+                 "        return;",
+                 "    }",
+                 "    _this.selected_target.execute_args = this.el.buffer.text;",
+                 "    ",
+                 "}"
+                ]
+               },
+               "string placeholder_text" : "eg.  -f somefile -g ",
+               "xtype" : "Entry"
+              },
+              {
+               "$ xns" : "Gtk",
+               "id" : "build_as_library",
+               "listeners" : {
+                "notify[\"active\"]" : [
+                 "() => {",
+                 "    if (_this.selected_target == null) {",
+                 "        return;",
+                 "    }",
+                 "    _this.selected_target.is_library = this.el.active;",
+                 "    ",
+                 "}",
+                 ""
+                ]
+               },
+               "string label" : "build as library",
+               "xtype" : "CheckButton"
               }
-             ]
+             ],
+             "xtype" : "Box"
             }
-           ]
+           ],
+           "xtype" : "Box"
           }
-         ]
+         ],
+         "xtype" : "Paned"
         }
-       ]
+       ],
+       "xtype" : "Notebook"
+      },
+      {
+       "$ Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
+       "$ xns" : "Gtk",
+       "bool hexpand" : true,
+       "int margin_bottom" : 4,
+       "int margin_end" : 4,
+       "int margin_start" : 4,
+       "int margin_top" : 4,
+       "items" : [
+        {
+         "$ xns" : "Gtk",
+         "listeners" : {
+          "clicked" : [
+           "() => { ",
+           "",
+           "  _this.done = true;",
+           "    _this.el.hide(); ",
+           "}"
+          ]
+         },
+         "string label" : "Cancel",
+         "xtype" : "Button"
+        },
+        {
+         "$ xns" : "Gtk",
+         "bool hexpand" : true,
+         "string label" : "",
+         "xtype" : "Label"
+        },
+        {
+         "$ xns" : "Gtk",
+         "css_classes" : "{ \"suggested-action\" }",
+         "id" : "save_btn",
+         "listeners" : {
+          "clicked" : [
+           "( ) =>  { ",
+           "",
+           " ",
+           "_this.project.save(); ",
+           " ",
+           "\t// what about .js ?",
+           "_this.done = true;",
+           "_this.el.hide();",
+           "if (_this.doneObj != null) {",
+           "\t_this.doneObj.call(_this.project);",
+           "}",
+           " ",
+           "   ",
+           "}"
+          ]
+         },
+         "string label" : "Save",
+         "xtype" : "Button"
+        }
+       ],
+       "xtype" : "Box"
       }
-     ]
+     ],
+     "xtype" : "Box"
     }
+   ],
+   "listeners" : {
+    "close_request" : [
+     "( ) => {",
+     "\tif (!this.done) {",
+     "\t\treturn true;",
+     "\t}",
+     "\treturn false;",
+     "\t",
+     "}",
+     ""
+    ],
+    "hide" : [
+     "() => {",
+     "\t  if (!this.done) {",
+     "    _this.el.show();",
+     "  }",
+     "}"
+    ]
+   },
+   "uint border_width" : 0,
+   "xtype" : "Window",
+   "| void save" : [
+    "()  {",
+    "    this.project.save(); ",
+    "}"
+   ],
+   "| void show" : [
+    "(Gtk.Window pwin, Project.Gtk project, Project.Callback? doneObj) {",
+    "     ",
+    "    //print(\"ValaProjectSettings show\\n\");",
+    "    this.doneObj = doneObj;",
+    "    this.project=  project;",
+    "\t ",
+    "    this.compile_flags.el.buffer.set_text(",
+    "    \tproject.compile_flags.data",
+    "\t);",
+    "   this.version.el.buffer.set_text(",
+    "    \tproject.version.data",
+    "\t);",
+    "\t  this.licence.el.buffer.set_text(",
+    "    \tproject.licence.data",
+    "\t); ",
+    "    project.loadVapiIntoStore(_this.vapimodel.el);",
+    "     GLib.Timeout.add(500, () => {",
+    " \t\t this.vapi_scroll.el.vadjustment.value  = 0;\t ",
+    "\t     return false;",
+    "     });",
+    "    ",
+    "   this.generate_meson.el.active = this.project.generate_meson;",
+    " \t",
+    " \tproject.loadTargetsIntoStore(this.target_model.el);",
+    "\t",
+    " \t_this.target_sel.el.selected = Gtk.INVALID_LIST_POSITION;",
+    "\t_this.target_sel.selectTarget(null);",
+    "//\tGtk.Allocation rect;",
+    "\t//btn.get_allocation(out rect);",
+    " //   this.el.set_pointing_to(rect);",
+    " this.el.application = pwin.application; // ??? make it modal?",
+    "\t this.el.set_transient_for(pwin);",
+    "\t ",
+    "\t// window + header?",
+    "\t// print(\"SHOWALL - POPIP\\n\");",
+    "\tthis.el.set_size_request(800,800);",
+    "\tthis.el.show();",
+    "\tthis.notebook.el.page = 0; // first page.",
+    "\t",
+    "\t//this.view.el.grab_focus();",
+    "",
+    "}",
+    ""
    ]
   }
- ]
+ ],
+ "name" : "ValaProjectSettingsPopover"
 }
\ No newline at end of file