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