src/Builder4/ValaProjectSettings.bjs
[app.Builder.js] / src / Builder4 / ValaProjectSettings.bjs
1 {
2  "name" : "ValaProjectSettings",
3  "parent" : "",
4  "title" : "",
5  "path" : "/home/alan/gitlive/app.Builder.js/src/Builder4/ValaProjectSettings.bjs",
6  "permname" : "",
7  "modOrder" : "",
8  "build_module" : "builder",
9  "items" : [
10   {
11    "# Project.Gtk project" : "null",
12    "# Xcls_MainWindow window" : "null",
13    "| void show" : "(Project.Gtk project) {\n    \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",
14    "bool hexpand" : true,
15    "xtype" : "Box",
16    "string id" : "ValaProjectSettings",
17    "| void save" : "()  {\n    this.project.writeConfig();\n}",
18    "$ xns" : "Gtk",
19    "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
20    "items" : [
21     {
22      "* pack" : "pack_start,true,true,0",
23      "xtype" : "Notebook",
24      "$ xns" : "Gtk",
25      "items" : [
26       {
27        "id" : "label_global",
28        "xtype" : "Label",
29        "* pack" : false,
30        "$ xns" : "Gtk",
31        "utf8 label" : "Global"
32       },
33       {
34        "id" : "label_targets",
35        "* pack" : false,
36        "xtype" : "Label",
37        "$ xns" : "Gtk",
38        "utf8 label" : "Targets"
39       },
40       {
41        "xtype" : "Box",
42        "* pack" : "append_page,_this.label_global.el",
43        "gboolean homogeneous" : false,
44        "$ xns" : "Gtk",
45        "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
46        "items" : [
47         {
48          "xtype" : "Label",
49          "* pack" : "pack_start,false,false,0",
50          "$ xns" : "Gtk",
51          "utf8 label" : "compile flags"
52         },
53         {
54          "listeners" : {
55           "changed" : "() => {\n    \n   _this.project.compilegroups.get(\"_default_\").compile_flags = this.el.text;\n   _this.project.writeConfig();\n//    _this.project.save();\n\n}"
56          },
57          "id" : "compile_flags",
58          "xtype" : "Entry",
59          "* pack" : "pack_start,false,false,0",
60          "$ xns" : "Gtk",
61          "utf8 placeholder_text" : "eg. -g --valasrc $BASEDIR "
62         },
63         {
64          "* pack" : "pack_start,true,true,0",
65          "xtype" : "Box",
66          "$ xns" : "Gtk",
67          "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
68          "items" : [
69           {
70            "* pack" : "add",
71            "xtype" : "ScrolledWindow",
72            "$ xns" : "Gtk",
73            "items" : [
74             {
75              "gboolean headers_visible" : true,
76              "* pack" : "add",
77              "xtype" : "TreeView",
78              "string id" : "default_packages_tree",
79              "$ xns" : "Gtk",
80              "items" : [
81               {
82                "id" : "default_packages_tree_store",
83                "* pack" : "set_model",
84                "xtype" : "ListStore",
85                "$ n_columns" : 2,
86                "| 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) Palete.factory(\"Gtk\");\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",
87                "$ columns" : "    typeof(string),  // 0 key type\n      typeof(bool)",
88                "$ xns" : "Gtk"
89               },
90               {
91                "utf8 title" : "package name",
92                "* init" : " \n this.el.add_attribute(_this.packages_render.el , \"text\", 0 );\n  ",
93                "* pack" : "append_column",
94                "xtype" : "TreeViewColumn",
95                "gboolean resizable" : true,
96                "gboolean expand" : true,
97                "$ xns" : "Gtk",
98                "items" : [
99                 {
100                  "id" : "packages_render",
101                  "* pack" : "pack_start,false",
102                  "xtype" : "CellRendererText",
103                  "$ xns" : "Gtk"
104                 }
105                ]
106               },
107               {
108                "utf8 title" : "use",
109                "* init" : "{\n this.el.add_attribute(_this.packages_render_use.el , \"active\", 1 );\n }",
110                "* pack" : "append_column",
111                "xtype" : "TreeViewColumn",
112                "gboolean resizable" : false,
113                "$ xns" : "Gtk",
114                "gint fixed_width" : 50,
115                "items" : [
116                 {
117                  "listeners" : {
118                   "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}"
119                  },
120                  "id" : "packages_render_use",
121                  "xtype" : "CellRendererToggle",
122                  "* pack" : "pack_start,false",
123                  "$ xns" : "Gtk",
124                  "gboolean activatable" : true
125                 }
126                ]
127               }
128              ]
129             }
130            ]
131           },
132           {
133            "* pack" : "add",
134            "xtype" : "ScrolledWindow",
135            "$ xns" : "Gtk",
136            "items" : [
137             {
138              "listeners" : {
139               "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}"
140              },
141              "gboolean headers_visible" : true,
142              "id" : "default_directory_tree",
143              "* pack" : "add",
144              "xtype" : "TreeView",
145              "$ xns" : "Gtk",
146              "items" : [
147               {
148                "id" : "default_directory_tree_store",
149                "* pack" : "set_model",
150                "xtype" : "ListStore",
151                "$ n_columns" : 1,
152                "| 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",
153                "$ columns" : "    typeof(string)\n     ",
154                "$ xns" : "Gtk"
155               },
156               {
157                "utf8 title" : "Available Directories (right click to add)",
158                "* init" : "\n this.el.add_attribute(_this.directory_render.el , \"text\", 0 );\n   ",
159                "* pack" : "append_column",
160                "xtype" : "TreeViewColumn",
161                "gboolean resizable" : true,
162                "$ xns" : "Gtk",
163                "items" : [
164                 {
165                  "id" : "directory_render",
166                  "* pack" : "pack_start,false",
167                  "xtype" : "CellRendererText",
168                  "$ xns" : "Gtk"
169                 }
170                ]
171               }
172              ]
173             },
174             {
175              "id" : "default_directory_menu",
176              "xtype" : "Menu",
177              "$ xns" : "Gtk",
178              "items" : [
179               {
180                "listeners" : {
181                 "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}"
182                },
183                "* pack" : "add",
184                "xtype" : "MenuItem",
185                "$ xns" : "Gtk",
186                "utf8 label" : "Add Directory"
187               },
188               {
189                "listeners" : {
190                 "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}"
191                },
192                "* pack" : "add",
193                "xtype" : "MenuItem",
194                "$ xns" : "Gtk",
195                "utf8 label" : "Add File"
196               },
197               {
198                "* pack" : "add",
199                "xtype" : "SeparatorMenuItem",
200                "$ xns" : "Gtk"
201               },
202               {
203                "listeners" : {
204                 "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}"
205                },
206                "* pack" : "add",
207                "xtype" : "MenuItem",
208                "$ xns" : "Gtk",
209                "utf8 label" : "Remove File/Directory"
210               }
211              ]
212             }
213            ]
214           }
215          ]
216         }
217        ]
218       },
219       {
220        "gint position" : 300,
221        "xtype" : "Paned",
222        "* pack" : "append_page,_this.label_targets.el",
223        "$ xns" : "Gtk",
224        "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
225        "items" : [
226         {
227          "* init" : "{  \nthis.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);\n\n}\n",
228          "xtype" : "ScrolledWindow",
229          "* pack" : "add1",
230          "$ xns" : "Gtk",
231          "items" : [
232           {
233            "id" : "targets_tree_menu",
234            "* pack" : "add",
235            "xtype" : "Menu",
236            "$ xns" : "Gtk",
237            "items" : [
238             {
239              "listeners" : {
240               "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}"
241              },
242              "* pack" : "add",
243              "xtype" : "MenuItem",
244              "$ xns" : "Gtk",
245              "utf8 label" : "Add Compile Target"
246             },
247             {
248              "* pack" : "add",
249              "xtype" : "SeparatorMenuItem",
250              "$ xns" : "Gtk"
251             },
252             {
253              "listeners" : {
254               "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}"
255              },
256              "* pack" : "add",
257              "xtype" : "MenuItem",
258              "$ xns" : "Gtk",
259              "utf8 label" : "Remove Target"
260             }
261            ]
262           },
263           {
264            "listeners" : {
265             "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}",
266             "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       _this.set_vbox.cgroup = cg;\n       _this.files_tree_store.update();\n       \n       // load the srouces\n       \n\n  }"
267            },
268            "id" : "targets_tree",
269            "# string cursor" : "",
270            "* pack" : "add",
271            "xtype" : "TreeView",
272            "$ xns" : "Gtk",
273            "items" : [
274             {
275              "id" : "targets_tree_store",
276              "xtype" : "ListStore",
277              "* pack" : "set_model",
278              "$ n_columns" : 2,
279              "| 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",
280              "$ columns" : "    typeof(string),  // 0 key type\n     typeof(string) // ??\n     ",
281              "$ xns" : "Gtk"
282             },
283             {
284              "utf8 title" : "name",
285              "* init" : " {\n     this.el.add_attribute(_this.targets_render.el , \"text\", 0 );\n }",
286              "* pack" : "append_column",
287              "xtype" : "TreeViewColumn",
288              "gboolean resizable" : true,
289              "$ xns" : "Gtk",
290              "items" : [
291               {
292                "listeners" : {
293                 "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  }"
294                },
295                "id" : "targets_render",
296                "xtype" : "CellRendererText",
297                "* pack" : "pack_start,false",
298                "$ xns" : "Gtk",
299                "gboolean editable" : true
300               }
301              ]
302             }
303            ]
304           }
305          ]
306         },
307         {
308          "id" : "set_vbox",
309          "xtype" : "Box",
310          "* pack" : "add2",
311          "gboolean homogeneous" : false,
312          "$ xns" : "Gtk",
313          "# Project.GtkValaSettings cgroup" : "null",
314          "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
315          "items" : [
316           {
317            "xtype" : "Label",
318            "* pack" : "pack_start,false,false,0",
319            "$ xns" : "Gtk",
320            "utf8 label" : "target filename"
321           },
322           {
323            "listeners" : {
324             "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}"
325            },
326            "id" : "build_pack_target",
327            "xtype" : "Entry",
328            "* pack" : "pack_start,false,false,0",
329            "$ xns" : "Gtk"
330           },
331           {
332            "xtype" : "Label",
333            "* pack" : "pack_start,false,false,0",
334            "$ xns" : "Gtk",
335            "utf8 label" : "compile flags"
336           },
337           {
338            "listeners" : {
339             "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}"
340            },
341            "id" : "build_compile_flags",
342            "xtype" : "Entry",
343            "* pack" : "pack_start,false,false,0",
344            "$ xns" : "Gtk"
345           },
346           {
347            "xtype" : "Label",
348            "* pack" : "pack_start,false,false,0",
349            "$ xns" : "Gtk",
350            "utf8 label" : "Files to compile"
351           },
352           {
353            "* pack" : "pack_start,true,true,0",
354            "xtype" : "ScrolledWindow",
355            "$ xns" : "Gtk",
356            "items" : [
357             {
358              "xtype" : "TreeView",
359              "* pack" : "add",
360              "string id" : "files_tree",
361              "$ xns" : "Gtk",
362              "items" : [
363               {
364                "id" : "files_tree_store",
365                "xtype" : "ListStore",
366                "* pack" : "set_model",
367                "| 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",
368                "$ n_columns" : 4,
369                "| 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    \n}\n ",
370                "$ columns" : "    typeof(string),  // 0 file name\n        typeof(string),  // 0 basename\n     typeof(string), // type (dir orfile)\n     typeof(bool)  // is checked.\n     ",
371                "$ xns" : "Gtk",
372                "| 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"
373               },
374               {
375                "utf8 title" : "name",
376                "* 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*/",
377                "* pack" : "append_column",
378                "xtype" : "TreeViewColumn",
379                "gboolean resizable" : true,
380                "$ xns" : "Gtk",
381                "items" : [
382                 {
383                  "id" : "files_render",
384                  "* pack" : "pack_start,false",
385                  "xtype" : "CellRendererText",
386                  "$ xns" : "Gtk"
387                 }
388                ]
389               },
390               {
391                "utf8 title" : "use",
392                "* init" : "{\n this.el.add_attribute(_this.files_render_use.el , \"active\", 3 );\n }",
393                "* pack" : "append_column",
394                "xtype" : "TreeViewColumn",
395                "gboolean resizable" : false,
396                "$ xns" : "Gtk",
397                "gint fixed_width" : 50,
398                "items" : [
399                 {
400                  "listeners" : {
401                   "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}"
402                  },
403                  "id" : "files_render_use",
404                  "xtype" : "CellRendererToggle",
405                  "* pack" : "pack_start,false",
406                  "$ xns" : "Gtk",
407                  "gboolean activatable" : true
408                 }
409                ]
410               }
411              ]
412             }
413            ]
414           }
415          ]
416         }
417        ]
418       }
419      ]
420     }
421    ]
422   }
423  ]
424 }