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