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