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