From 97accac9bb07e3c06a189e7b7cb709681ec950c4 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Mon, 1 Jun 2015 17:39:20 +0800 Subject: [PATCH] src/Builder4/WindowLeftProps.bjs src/Builder4/WindowLeftProps.vala --- src/Builder4/WindowLeftProps.bjs | 2 +- src/Builder4/WindowLeftProps.vala | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Builder4/WindowLeftProps.bjs b/src/Builder4/WindowLeftProps.bjs index 2b585bd25..263406730 100644 --- a/src/Builder4/WindowLeftProps.bjs +++ b/src/Builder4/WindowLeftProps.bjs @@ -30,7 +30,7 @@ "$ homogeneous" : "false ", "# Xcls_MainWindow main_window" : "null", "| void addProp" : " (string in_type, string key, string value, string value_type) {\n // info includes key, val, skel, etype..\n //console.dump(info);\n //type = info.type.toLowerCase();\n //var data = this.toJS();\n \n var type = in_type == \"signals\" ? \"listener\" : in_type;\n \n var fkey = (value_type.length > 0 ? value_type + \" \" : \"\") + key;\n \n if (type == \"listener\") {\n if (this.node.listeners.has_key(key)) {\n return;\n }\n this.node.listeners.set(key,value);\n } else {\n \n if (this.node.props.has_key(fkey)) {\n return;\n }\n this.node.props.set(fkey,value);\n }\n \n \n // add a row???\n this.load(this.file, this.node);\n \n \n \n /// need to find the row which I've just added..\n \n \n var s = this.view.el.get_selection();\n s.unselect_all();\n \n print(\"trying to find new iter\");\n \n this.model.el.foreach((model, path, iter) => {\n GLib.Value gval;\n \n this.model.el.get_value(iter, 0 , out gval);\n if ((string)gval != type) {\n print(\"not type: %s = %s\\n\", (string)gval , type);\n return false;\n }\n this.model.el.get_value(iter, 1 , out gval);\n if ((string)gval != fkey) {\n print(\"not key: %s = %s\\n\", (string)gval , fkey);\n return false;\n }\n // delay this?\n GLib.Timeout.add_full(GLib.Priority.DEFAULT,40 , () => {\n \n this.startEditingValue(this.model.el.get_path(iter));\n return false;\n });\n //s.select_iter(iter);\n return true; \n });\n \n \n \n \n}\n", - "| void updateIter" : "(Gtk.TreeIter iter, string type, string key, string kvalue) {\n\n print(\"update Iter %s, %s\\n\", key,value);\n //typeof(string), // 0 key type\n //typeof(string), // 1 key\n //typeof(string), // 2 key (display)\n //typeof(string), // 3 value\n //typeof(string), // 4 value (display)\n //typeof(string), // 5 both (tooltip)\n //typeof(string), // 6 key (sort)\n \n var dl = value.strip().split(\"\\n\");\n\n var dis_val = dl.length > 1 ? (dl[0].strip()+ \"...\") : dl[0];\n \n if (type == \"listener\") {\n \n \n \n this.model.el.set(iter, \n 0, type,\n 1, key,\n 2, this.keyFormat(key ,type),\n 3, kvalue,\n 4, dis_val,\n 5, \"\" + GLib.Markup.escape_text(key + \" \" +kvalue) + \"\",\n 6, \"0 \" + key\n ); \n return;\n }\n \n\n\n this.model.el.set(iter, \n 0, \"props\",\n 1, key,\n 2, this.keyFormat(key , \"prop\"),\n 3, kvalue,\n 4, dis_val,\n 5, \"\" + GLib.Markup.escape_text(key + \" \" + kvalue) + \"\",\n 6, this.keySortFormat(key)\n ); \n}", + "| void updateIter" : "(Gtk.TreeIter iter, string type, string key, string kvalue) {\n\n print(\"update Iter %s, %s\\n\", key,kvalue);\n //typeof(string), // 0 key type\n //typeof(string), // 1 key\n //typeof(string), // 2 key (display)\n //typeof(string), // 3 value\n //typeof(string), // 4 value (display)\n //typeof(string), // 5 both (tooltip)\n //typeof(string), // 6 key (sort)\n \n var dl = kvalue.strip().split(\"\\n\");\n\n var dis_val = dl.length > 1 ? (dl[0].strip()+ \"...\") : dl[0];\n \n if (type == \"listener\") {\n \n \n \n this.model.el.set(iter, \n 0, type,\n 1, key,\n 2, this.keyFormat(key ,type),\n 3, kvalue,\n 4, dis_val,\n 5, \"\" + GLib.Markup.escape_text(key + \" \" +kvalue) + \"\",\n 6, \"0 \" + key\n ); \n return;\n }\n \n\n\n this.model.el.set(iter, \n 0, \"props\",\n 1, key,\n 2, this.keyFormat(key , \"prop\"),\n 3, kvalue,\n 4, dis_val,\n 5, \"\" + GLib.Markup.escape_text(key + \" \" + kvalue) + \"\",\n 6, this.keySortFormat(key)\n ); \n}", "# JsRender.Node node" : "", "items" : [ { diff --git a/src/Builder4/WindowLeftProps.vala b/src/Builder4/WindowLeftProps.vala index b47aaac3f..970746468 100644 --- a/src/Builder4/WindowLeftProps.vala +++ b/src/Builder4/WindowLeftProps.vala @@ -530,7 +530,7 @@ public class Xcls_LeftProps : Object } public void updateIter (Gtk.TreeIter iter, string type, string key, string kvalue) { - print("update Iter %s, %s\n", key,value); + print("update Iter %s, %s\n", key,kvalue); //typeof(string), // 0 key type //typeof(string), // 1 key //typeof(string), // 2 key (display) @@ -539,7 +539,7 @@ public class Xcls_LeftProps : Object //typeof(string), // 5 both (tooltip) //typeof(string), // 6 key (sort) - var dl = value.strip().split("\n"); + var dl = kvalue.strip().split("\n"); var dis_val = dl.length > 1 ? (dl[0].strip()+ "...") : dl[0]; -- 2.39.2