From 95db864a64602764c4627a03a95a8fe04310e5c4 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Wed, 4 Mar 2015 16:14:01 +0800 Subject: [PATCH] src/Builder4/ValaProjectSettings.bjs src/Builder4/ValaProjectSettings.vala --- src/Builder4/ValaProjectSettings.bjs | 40 +++++++++++++-------------- src/Builder4/ValaProjectSettings.vala | 21 +++++--------- 2 files changed, 27 insertions(+), 34 deletions(-) diff --git a/src/Builder4/ValaProjectSettings.bjs b/src/Builder4/ValaProjectSettings.bjs index d74f3a9fe..d97af7f27 100644 --- a/src/Builder4/ValaProjectSettings.bjs +++ b/src/Builder4/ValaProjectSettings.bjs @@ -22,15 +22,15 @@ "items" : [ { "id" : "label_global", - "xtype" : "Label", "* pack" : false, + "xtype" : "Label", "$ xns" : "Gtk", "utf8 label" : "Global" }, { "id" : "label_targets", - "* pack" : false, "xtype" : "Label", + "* pack" : false, "$ xns" : "Gtk", "utf8 label" : "Targets" }, @@ -51,8 +51,8 @@ "changed" : "() => {\n \n _this.project.compilegroups.get(\"_default_\").compile_flags = this.el.text;\n _this.project.writeConfig();\n// _this.project.save();\n\n}" }, "id" : "compile_flags", - "xtype" : "Entry", "* pack" : "pack_start,false,false,0", + "xtype" : "Entry", "$ xns" : "Gtk", "utf8 placeholder_text" : "eg. -g --valasrc $BASEDIR " }, @@ -69,15 +69,15 @@ "items" : [ { "gboolean headers_visible" : false, - "* pack" : "add", "xtype" : "TreeView", + "* pack" : "add", "string id" : "default_packages_tree", "$ xns" : "Gtk", "items" : [ { "id" : "default_packages_tree_store", - "* pack" : "set_model", "xtype" : "ListStore", + "* pack" : "set_model", "$ n_columns" : 2, "| 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();\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", "$ columns" : " typeof(string), // 0 key type\n typeof(bool)", @@ -94,8 +94,8 @@ "items" : [ { "id" : "packages_render", - "* pack" : "pack_start,false", "xtype" : "CellRendererText", + "* pack" : "pack_start,false", "$ xns" : "Gtk" } ] @@ -114,8 +114,8 @@ "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}" }, "id" : "packages_render_use", - "xtype" : "CellRendererToggle", "* pack" : "pack_start,false", + "xtype" : "CellRendererToggle", "$ xns" : "Gtk", "gboolean activatable" : true } @@ -148,8 +148,8 @@ "items" : [ { "id" : "default_directory_tree_store", - "* pack" : "set_model", "xtype" : "ListStore", + "* pack" : "set_model", "$ n_columns" : 1, "| 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", "$ columns" : " typeof(string)\n ", @@ -165,8 +165,8 @@ "items" : [ { "id" : "directory_render", - "* pack" : "pack_start,false", "xtype" : "CellRendererText", + "* pack" : "pack_start,false", "$ xns" : "Gtk" } ] @@ -218,20 +218,20 @@ }, { "gint position" : 300, - "xtype" : "HPaned", "* pack" : "append_page,_this.label_targets.el", + "xtype" : "HPaned", "$ xns" : "Gtk", "items" : [ { "* init" : "{ \nthis.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);\n\n}\n", - "xtype" : "ScrolledWindow", "* pack" : "add1", + "xtype" : "ScrolledWindow", "$ xns" : "Gtk", "items" : [ { "id" : "targets_tree_menu", - "* pack" : "add", "xtype" : "Menu", + "* pack" : "add", "$ xns" : "Gtk", "items" : [ { @@ -272,8 +272,8 @@ "items" : [ { "id" : "targets_tree_store", - "xtype" : "ListStore", "* pack" : "set_model", + "xtype" : "ListStore", "$ n_columns" : 2, "| 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 \n}\n", "$ columns" : " typeof(string), // 0 key type\n typeof(string) // ??\n ", @@ -292,8 +292,8 @@ "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 }" }, "id" : "targets_render", - "xtype" : "CellRendererText", "* pack" : "pack_start,false", + "xtype" : "CellRendererText", "$ xns" : "Gtk", "gboolean editable" : true } @@ -305,8 +305,8 @@ }, { "id" : "set_vbox", - "xtype" : "VBox", "* pack" : "add2", + "xtype" : "VBox", "gboolean homogeneous" : false, "$ xns" : "Gtk", "items" : [ @@ -321,8 +321,8 @@ "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}" }, "id" : "build_pack_target", - "xtype" : "Entry", "* pack" : "pack_start,false,false,0", + "xtype" : "Entry", "$ xns" : "Gtk" }, { @@ -336,8 +336,8 @@ "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}" }, "id" : "build_compile_flags", - "xtype" : "Entry", "* pack" : "pack_start,false,false,0", + "xtype" : "Entry", "$ xns" : "Gtk" }, { @@ -359,8 +359,8 @@ "items" : [ { "id" : "files_tree_store", - "xtype" : "ListStore", "* pack" : "set_model", + "xtype" : "ListStore", "$ n_columns" : 4, "| 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 this.el.append(out citer); \n \n this.el.set_value(citer, 0, items.get(i) ); // title \n this.el.set_value(citer, 1, \"\" + \n GLib.Markup.escape_text(items.get(i)) + \"\"\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 var files = _this.project.files(items.get(i));\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 ", "$ columns" : " typeof(string), // 0 file name\n typeof(string), // 0 basename\n typeof(string), // type (dir orfile)\n typeof(bool) // is checked.\n ", @@ -376,8 +376,8 @@ "items" : [ { "id" : "files_render", - "* pack" : "pack_start,false", "xtype" : "CellRendererText", + "* pack" : "pack_start,false", "$ xns" : "Gtk" } ] @@ -396,8 +396,8 @@ "toggled" : "( path_string) => { \n\n\n\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, 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 // what's the sleected target?\n // update the list..\n // if ftype is a dir == then toggle all the bellow.\n // if ftype is a file .. see if all the files in that directory are check and check the dir.\n return;\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}" }, "id" : "files_render_use", - "xtype" : "CellRendererToggle", "* pack" : "pack_start,false", + "xtype" : "CellRendererToggle", "$ xns" : "Gtk", "gboolean activatable" : true } diff --git a/src/Builder4/ValaProjectSettings.vala b/src/Builder4/ValaProjectSettings.vala index 3dad64630..9d18d4cef 100644 --- a/src/Builder4/ValaProjectSettings.vala +++ b/src/Builder4/ValaProjectSettings.vala @@ -385,8 +385,7 @@ public class ValaProjectSettings : Object // init method - this.el.add_attribute(_this.packages_render.el , "text", 0 ); - } + this.el.add_attribute(_this.packages_render.el , "text", 0 ); } // user defined functions } @@ -440,8 +439,7 @@ public class ValaProjectSettings : Object { this.el.add_attribute(_this.packages_render_use.el , "active", 1 ); - } - } + } } // user defined functions } @@ -663,8 +661,7 @@ public class ValaProjectSettings : Object // init method - this.el.add_attribute(_this.directory_render.el , "text", 0 ); - } + this.el.add_attribute(_this.directory_render.el , "text", 0 ); } // user defined functions } @@ -934,8 +931,7 @@ public class ValaProjectSettings : Object { this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC); - } - } + } } // user defined functions } @@ -1242,8 +1238,7 @@ public class ValaProjectSettings : Object { this.el.add_attribute(_this.targets_render.el , "text", 0 ); - } - } + } } // user defined functions } @@ -1602,8 +1597,7 @@ public class ValaProjectSettings : Object this.el.add_attribute(_this.files_render.el , "markup", 1 ); // basnemae /* this.el.add_attribute(_this.files_render.el , "markup", 2 ); - */ - } + */ } // user defined functions } @@ -1657,8 +1651,7 @@ public class ValaProjectSettings : Object { this.el.add_attribute(_this.files_render_use.el , "active", 2 ); - } - } + } } // user defined functions } -- 2.39.2