From 3634f9b6a4f53b0da6a927cc1655e31ac2ee9382 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Thu, 24 May 2012 11:33:44 +0800 Subject: [PATCH] Clones.bjs Clones.js --- Clones.bjs | 8 ++++---- Clones.js | 15 ++++----------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/Clones.bjs b/Clones.bjs index e7e37094..645a3c74 100644 --- a/Clones.bjs +++ b/Clones.bjs @@ -90,15 +90,15 @@ "id": "reposView", "pack": "add", "xtype": "TreeView", - "|init": "function() {\n XObject.prototype.init.call(this);\n var description = new Pango.FontDescription.c_new();\n description.set_size(10000);\n this.el.modify_font(description);\n\n this.selection = this.el.get_selection();\n this.selection.set_mode( Gtk.SelectionMode.MULTIPLE);\n var _this = this;\n \n \n this.selection.signal['changed'].connect(function() {\n _this.listeners.cursor_changed.apply(\n _this, [ _this, '']\n );\n });\n \n \n this.el.set_tooltip_column(8); \n \n \n }\n", + "|init": "function() {\n XObject.prototype.init.call(this);\n var description = new Pango.FontDescription.c_new();\n description.set_size(10000);\n this.el.modify_font(description);\n\n this.selection = this.el.get_selection();\n this.selection.set_mode( Gtk.SelectionMode.MULTIPLE);\n var _this = this;\n \n \n this.selection.signal['changed'].connect(function() {\n _this.listeners.cursor_changed.apply(\n _this, [ _this, '']\n );\n });\n }\n", "|xns": "Gtk", "items": [ { "id": "reposStore", "pack": "set_model", "xtype": "ListStore", - "|init": "function() {\n XObject.prototype.init.call(this);\n this.el.set_column_types ( 9, [\n GObject.TYPE_STRING, // repo \n GObject.TYPE_STRING, // current branch\n GObject.TYPE_STRING, // all branch \n GObject.TYPE_STRING, // updated\n GObject.TYPE_BOOLEAN, // auto-commit\n GObject.TYPE_BOOLEAN, // auto-push\n GObject.TYPE_STRING, // repopath\n GObject.TYPE_STRING, // color highighling \n GObject.TYPE_STRING // uncommited. (tip) \n ] );\n}\n", - "|load": "function()\n{\n //this.insert(citer,iter,0);\n print(\"getting list\");\n this.repos = imports.Scm.Repo.Repo.list();\n var tr= this.repos;\n this.el.clear();\n \n for(var i =0 ; i < tr.length; i++) {\n var ret = { };\n \n this.el.append(ret);\n \n //print(JSON.stringify(ret,null,4));\n tr[i].getBranches();\n tr[i].getStatus();\n var hi;\n try {\n //tr[i].debug=1;\n hi = tr[i].history('/', 1, 'branch', tr[i].currentBranch.name );\n// print(JSON.stringify(hi,null,4));\n } catch(e) { print(e);}\n \n this.el.set_value(ret.iter, 0, '' + tr[i].repopath.split('/').pop() );\n this.el.set_value(ret.iter, 1, '' + tr[i].currentBranch.name );\n this.el.set_value(ret.iter, 2, '' + tr[i].branches.map(\n function(e) { return e.name; \n }).join(', ') \n );\n this.el.set_value(ret.iter, 3, '' + (!hi ? '??' : hi[0].changed_raw)); \n this.el.set_value(ret.iter, 4, tr[i].autocommit() ); \n this.el.set_value(ret.iter, 5, tr[i].autopush() ); \n this.el.set_value(ret.iter, 6, tr[i].repopath ); \n // highlight color.\n var cb = tr[i].currentBranch;\n //print(JSON.stringify(cb,null,4));\n var col = '#ffffff';\n if (cb.lastrev != cb.remoterev) {\n col = '#ff0000';\n }\n if (tr[i].hasLocalChanges) {\n col = '#0000ff';\n }\n if ((cb.lastrev != cb.remoterev) && (tr[i].hasLocalChanges)) {\n col = '#ff00ff';\n }\n \n this.el.set_value(ret.iter, 7, col );\n this.el.set_value(ret.iter, 8, tr[i].localChanges ); \n \n } \n}", + "|init": "function() {\n XObject.prototype.init.call(this);\n this.el.set_column_types ( 8, [\n GObject.TYPE_STRING, // repo \n GObject.TYPE_STRING, // current branch\n GObject.TYPE_STRING, // all branch \n GObject.TYPE_STRING, // updated\n GObject.TYPE_BOOLEAN, // auto-commit\n GObject.TYPE_BOOLEAN, // auto-push\n GObject.TYPE_STRING, // repopath\n GObject.TYPE_STRING // color highighling \n ] );\n}\n", + "|load": "function()\n{\n //this.insert(citer,iter,0);\n print(\"getting list\");\n this.repos = imports.Scm.Repo.Repo.list();\n var tr= this.repos;\n this.el.clear();\n \n for(var i =0 ; i < tr.length; i++) {\n var ret = { };\n \n this.el.append(ret);\n \n //print(JSON.stringify(ret,null,4));\n tr[i].getBranches();\n tr[i].getStatus();\n var hi;\n try {\n //tr[i].debug=1;\n hi = tr[i].history('/', 1, 'branch', tr[i].currentBranch.name );\n// print(JSON.stringify(hi,null,4));\n } catch(e) { print(e);}\n \n this.el.set_value(ret.iter, 0, '' + tr[i].repopath.split('/').pop() );\n this.el.set_value(ret.iter, 1, '' + tr[i].currentBranch.name );\n this.el.set_value(ret.iter, 2, '' + tr[i].branches.map(\n function(e) { return e.name; \n }).join(', ') \n );\n this.el.set_value(ret.iter, 3, '' + (!hi ? '??' : hi[0].changed_raw)); \n this.el.set_value(ret.iter, 4, tr[i].autocommit() ); \n this.el.set_value(ret.iter, 5, tr[i].autopush() ); \n this.el.set_value(ret.iter, 6, tr[i].repopath ); \n // highlight color.\n var cb = tr[i].currentBranch;\n //print(JSON.stringify(cb,null,4));\n var col = '#ffffff';\n if (cb.lastrev != cb.remoterev) {\n col = '#ff0000';\n }\n if (tr[i].hasLocalChanges) {\n col = '#0000ff';\n }\n if ((cb.lastrev != cb.remoterev) && (tr[i].hasLocalChanges)) {\n col = '#ff00ff';\n }\n \n this.el.set_value(ret.iter, 7, col ); \n \n } \n}", "|xns": "Gtk" }, { @@ -140,9 +140,9 @@ ] }, { - "resizable": true, "min_width": 200, "pack": "append_column", + "resizable": true, "title": "Repo", "xtype": "TreeViewColumn", "|init": "function() {\n XObject.prototype.init.call(this);\n this.el.add_attribute(this.items[0].el , 'markup', 0 );\n\n}\n", diff --git a/Clones.js b/Clones.js index 6e48f5db..6f644048 100644 --- a/Clones.js +++ b/Clones.js @@ -327,11 +327,6 @@ Clones=new XObject({ _this, [ _this, ''] ); }); - - - this.el.set_tooltip_column(8); - - }, items : [ { @@ -340,7 +335,7 @@ Clones=new XObject({ pack : "set_model", init : function() { XObject.prototype.init.call(this); - this.el.set_column_types ( 9, [ + this.el.set_column_types ( 8, [ GObject.TYPE_STRING, // repo GObject.TYPE_STRING, // current branch GObject.TYPE_STRING, // all branch @@ -348,8 +343,7 @@ Clones=new XObject({ GObject.TYPE_BOOLEAN, // auto-commit GObject.TYPE_BOOLEAN, // auto-push GObject.TYPE_STRING, // repopath - GObject.TYPE_STRING, // color highighling - GObject.TYPE_STRING // uncommited. (tip) + GObject.TYPE_STRING // color highighling ] ); }, load : function() @@ -399,8 +393,7 @@ Clones=new XObject({ col = '#ff00ff'; } - this.el.set_value(ret.iter, 7, col ); - this.el.set_value(ret.iter, 8, tr[i].localChanges ); + this.el.set_value(ret.iter, 7, col ); } } @@ -470,9 +463,9 @@ Clones=new XObject({ }, { xtype: Gtk.TreeViewColumn, - resizable : true, min_width : 200, pack : "append_column", + resizable : true, title : "Repo", init : function() { XObject.prototype.init.call(this); -- 2.39.2