From 29bb97bbe42adf39eeb647ab098a019cabf8cee2 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Tue, 30 Oct 2018 16:07:20 +0800 Subject: [PATCH] Clones.bjs Clones.vala --- Clones.bjs | 4 ++-- Clones.vala | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Clones.bjs b/Clones.bjs index 04e9ddb4..b789553b 100644 --- a/Clones.bjs +++ b/Clones.bjs @@ -107,7 +107,7 @@ "$ pathToRepo" : "function(path) {\n\n var tr= this.repos;\n\n \n for(var i =0 ; i < tr.length; i++) {\n if (tr[i].repopath == path) {\n return tr[i];\n }\n } \n return false; \n}\n", "xtype" : "ListStore", "* pack" : "set_model", - "| void load" : "()\n{\n //this.insert(citer,iter,0);\n print(\"getting list\");\n var tr = GitRepo.list();\n \n this.el.clear();\n \n // fixme .. sort by last updated ...\n \n \n for(var i =0 ; i < tr.length; i++) {\n\t var repo = tr.index(i);\n\t repo.loadBranches();\n\t \n\t Gtk.TreeIter iter;\n\t this.el.append(out iter);\n \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(iter, 0, repo.name );\n// this.el.set_value(ret.iter, 1, '' + repo.currentBranch.name );\n// this.el.set_value(ret.iter, 2, '' + repo.branches.map(\n// function(e) { return e.name; \n// }).join(', ') \n // );\n// this.el.set_value(iter, 3, '' + (!hi ? '??' : hi[0].changed_raw)); \n this.el.set_value(iter, 4, repo.is_autocommit() ); \n this.el.set_value(iter, 5, repo.is_autopush() ); \n this.el.set_value(iter, 6, repo.gitdir ); \n // highlight color.\n var cb = repo.currentBranch;\n //print(JSON.stringify(cb,null,4));\n var col = \"#ffffff\";\n /*\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(iter, 7, col ); \n \n } \n} ", + "| void load" : "()\n{\n //this.insert(citer,iter,0);\n print(\"getting list\");\n var tr = GitRepo.list();\n \n this.el.clear();\n \n // fixme .. sort by last updated ...\n \n \n for(var i =0 ; i < tr.length; i++) {\n\t var repo = tr.index(i);\n\t repo.loadBranches();\n\t \n\t Gtk.TreeIter iter;\n\t this.el.append(out iter);\n \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(iter, 0, repo.name );\n this.el.set_value( ter, 1, '' + repo.currentBranch.name );\n// this.el.set_value(ret.iter, 2, '' + repo.branches.map(\n// function(e) { return e.name; \n// }).join(', ') \n // );\n// this.el.set_value(iter, 3, '' + (!hi ? '??' : hi[0].changed_raw)); \n this.el.set_value(iter, 4, repo.is_autocommit() ); \n this.el.set_value(iter, 5, repo.is_autopush() ); \n this.el.set_value(iter, 6, repo.gitdir ); \n // highlight color.\n var cb = repo.currentBranch;\n //print(JSON.stringify(cb,null,4));\n var col = \"#ffffff\";\n /*\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(iter, 7, col ); \n \n } \n this.el.set_sort_column_id (0, Gtk.SortType.ASCENDING);\n} ", "$ xns" : "Gtk" }, { @@ -159,7 +159,7 @@ "title" : "Repo", "* pack" : "append_column", "xtype" : "TreeViewColumn", - "int sort_column_id" : 3, + "int sort_column_id" : 0, "min_width" : 200, "$ xns" : "Gtk", "resizable" : true, diff --git a/Clones.vala b/Clones.vala index 109dd6d0..8950c3b1 100644 --- a/Clones.vala +++ b/Clones.vala @@ -606,7 +606,7 @@ public class Clones : Object // } catch(e) { print(e);} this.el.set_value(iter, 0, repo.name ); - // this.el.set_value(ret.iter, 1, '' + repo.currentBranch.name ); + this.el.set_value( ter, 1, '' + repo.currentBranch.name ); // this.el.set_value(ret.iter, 2, '' + repo.branches.map( // function(e) { return e.name; // }).join(', ') @@ -633,6 +633,7 @@ public class Clones : Object this.el.set_value(iter, 7, col ); } + this.el.set_sort_column_id (0, Gtk.SortType.ASCENDING); } } @@ -803,7 +804,7 @@ public class Clones : Object // my vars (dec) // set gobject values - this.el.sort_column_id = 3; + this.el.sort_column_id = 0; this.el.title = "Repo"; this.el.min_width = 200; this.el.sort_order = Gtk.SortType.ASCENDING; -- 2.39.2