From 523bc4c1bccc2646bf820af500317faa60e3667d Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Tue, 30 Oct 2018 13:03:03 +0800 Subject: [PATCH] Clones.bjs Clones.vala --- Clones.bjs | 2 ++ Clones.vala | 16 ++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Clones.bjs b/Clones.bjs index d8710741..6b319bc6 100644 --- a/Clones.bjs +++ b/Clones.bjs @@ -121,6 +121,7 @@ "listeners" : { "toggled" : " (self, path) => {\n/* var ret ={} ;\n var store = this.get('/reposStore');\n store.el.get_iter_from_string(ret, path);\n \n var value = store.el.get_value(ret.iter,4).value.get_boolean();\n \n //print(JSON.stringify(value));\n store.el.set_value(ret.iter,4, !value);\n \n var path = store.el.get_value(ret.iter, 6).value.get_string();\n var repo = imports.Scm.Repo.Repo.get(path);\n repo.autocommit(!value);\n */ \n \n \n}" }, + "id" : "cr_autocommit", "* pack" : "pack_start,false", "xtype" : "CellRendererToggle", "$ xns" : "Gtk", @@ -141,6 +142,7 @@ "listeners" : { "toggled" : "function (self, path) {\n var ret ={} ;\n var store = this.get('/reposStore');\n store.el.get_iter_from_string(ret, path);\n \n var value = store.el.get_value(ret.iter,5).value.get_boolean();\n \n //print(JSON.stringify(value));\n store.el.set_value(ret.iter,5, !value);\n var path = store.el.get_value(ret.iter, 6).value.get_string();\n var repo = imports.Scm.Repo.Repo.get(path);\n repo.autopush(!value);\n \n}" }, + "id" : "cr_autopush", "* pack" : "pack_start", "xtype" : "CellRendererToggle", "$ xns" : "Gtk", diff --git a/Clones.vala b/Clones.vala index a41fb367..5fc09036 100644 --- a/Clones.vala +++ b/Clones.vala @@ -16,7 +16,9 @@ public class Clones : Object public Xcls_reposView reposView; public Xcls_reposStore reposStore; public Xcls_tv_autocommit tv_autocommit; + public Xcls_cr_autocommit cr_autocommit; public Xcls_tv_autopush tv_autopush; + public Xcls_cr_autopush cr_autopush; public Xcls_tv_repo tv_repo; public Xcls_tv_current_branch tv_current_branch; public Xcls_tv_last_updated tv_last_updated; @@ -589,7 +591,7 @@ public class Clones : Object // set gobject values this.el.title = "Auto Commit"; this.el.min_width = 50; - var child_0 = new Xcls_CellRendererToggle13( _this ); + var child_0 = new Xcls_cr_autocommit( _this ); child_0.ref(); this.el.pack_start ( child_0.el , false ); @@ -601,7 +603,7 @@ public class Clones : Object // user defined functions } - public class Xcls_CellRendererToggle13 : Object + public class Xcls_cr_autocommit : Object { public Gtk.CellRendererToggle el; private Clones _this; @@ -610,9 +612,10 @@ public class Clones : Object // my vars (def) // ctor - public Xcls_CellRendererToggle13(Clones _owner ) + public Xcls_cr_autocommit(Clones _owner ) { _this = _owner; + _this.cr_autocommit = this; this.el = new Gtk.CellRendererToggle(); // my vars (dec) @@ -664,7 +667,7 @@ public class Clones : Object // set gobject values this.el.title = "Auto Push"; this.el.min_width = 50; - var child_0 = new Xcls_CellRendererToggle15( _this ); + var child_0 = new Xcls_cr_autopush( _this ); child_0.ref(); this.el.pack_start ( child_0.el ); @@ -676,7 +679,7 @@ public class Clones : Object // user defined functions } - public class Xcls_CellRendererToggle15 : Object + public class Xcls_cr_autopush : Object { public Gtk.CellRendererToggle el; private Clones _this; @@ -685,9 +688,10 @@ public class Clones : Object // my vars (def) // ctor - public Xcls_CellRendererToggle15(Clones _owner ) + public Xcls_cr_autopush(Clones _owner ) { _this = _owner; + _this.cr_autopush = this; this.el = new Gtk.CellRendererToggle(); // my vars (dec) -- 2.39.2