X-Git-Url: http://git.roojs.org/?p=gitlive;a=blobdiff_plain;f=Clones.vala;h=befa7f30ed012ba691ca937d5ff87fd67b6ffa65;hp=78f86ca3645ff6a86dbf2b19a513148a35455bea;hb=2ac46b7e5e54b5382df0c55b865e47a9937e15f8;hpb=2d3bb6db4cf59fb23b8774360ee0f15ffb7dc975 diff --git a/Clones.vala b/Clones.vala index 78f86ca3..befa7f30 100644 --- a/Clones.vala +++ b/Clones.vala @@ -75,9 +75,9 @@ public class Clones : Object this.el.set_default_size( int.min(1024,Gdk.Screen.width()), - int.max(500,Gdk.Screen.width() - 300) + int.max(500,Gdk.Screen.height() - 300) ); - + this.el.show_all(); _this.reposStore.load(); this.el.set_keep_above(true); @@ -118,7 +118,7 @@ public class Clones : Object var child_0 = new Xcls_Box3( _this ); child_0.ref(); this.el.pack_start ( child_0.el , false,false,0 ); - var child_1 = new Xcls_ScrolledWindow9( _this ); + var child_1 = new Xcls_ScrolledWindow5( _this ); child_1.ref(); this.el.pack_end ( child_1.el , true,true,0 ); } @@ -146,18 +146,6 @@ public class Clones : Object var child_0 = new Xcls_Button4( _this ); child_0.ref(); this.el.add ( child_0.el ); - var child_1 = new Xcls_Button5( _this ); - child_1.ref(); - this.el.add ( child_1.el ); - var child_2 = new Xcls_Button6( _this ); - child_2.ref(); - this.el.add ( child_2.el ); - var child_3 = new Xcls_Button7( _this ); - child_3.ref(); - this.el.add ( child_3.el ); - var child_4 = new Xcls_Button8( _this ); - child_4.ref(); - this.el.add ( child_4.el ); } // user defined functions @@ -183,257 +171,9 @@ public class Clones : Object //listeners this.el.clicked.connect( () => { - - /* var rv = this.get('/reposView'); - var rs = this.get('/reposStore'); - if (rv.el.get_selection().count_selected_rows() != 1) { - //nothing? - // error condition. - return; - } - var Remotes = imports.Remotes.Remotes; - - - var ret = {}; - var s = rv.el.get_selection(); - var path = ''; - s.selected_foreach(function(model,p,iter) { - - path = model.get_value(iter, 6).value.get_string(); - - }); - - var repo = false; - rs.repos.forEach(function(r) { - if (r.repopath == path) { - repo = r; - - } - - }); - Remotes.repo = repo; - Remotes.el.set_transient_for(Clones.el); - Clones.el.set_title("Manage Clones - " + repo.repopath); - Remotes.show(); - Clones.el.set_title("Manage Clones"); - - */ - - - - - - - }); - } - - // user defined functions - } - - public class Xcls_Button5 : Object - { - public Gtk.Button el; - private Clones _this; - - - // my vars (def) - - // ctor - public Xcls_Button5(Clones _owner ) - { - _this = _owner; - this.el = new Gtk.Button(); - - // my vars (dec) - - // set gobject values - this.el.label = "Branches"; - this.el.visible = false; - - //listeners - this.el.clicked.connect( () => { - // - - //NewBranch.singleton().show(); - - /* - var rv = this.get('/reposView'); - var rs = this.get('/reposStore'); - if (rv.el.get_selection().count_selected_rows() != 1) { - //nothing? - // error condition. - return; - } - var Branches = imports.Branches.Branches; - - - var ret = {}; - var s = rv.el.get_selection(); - var path = ''; - s.selected_foreach(function(model,p,iter) { - - path = model.get_value(iter, 6).value.get_string(); - - }); - - var repo = false; - rs.repos.forEach(function(r) { - if (r.repopath == path) { - repo = r; - - } - - }); - Branches.repo = repo; - Branches.el.set_transient_for(Clones.el); - Clones.el.set_title("Manage Clones - " + repo.repopath); - Branches.show(); - Clones.el.set_title("Manage Clones"); - - - - - - - - */ - - }); - } - - // user defined functions - } - - public class Xcls_Button6 : Object - { - public Gtk.Button el; - private Clones _this; - - - // my vars (def) - - // ctor - public Xcls_Button6(Clones _owner ) - { - _this = _owner; - this.el = new Gtk.Button(); - - // my vars (dec) - - // set gobject values - this.el.label = "Merge"; - - //listeners - this.el.clicked.connect( () => { - - var rv = _this.reposView; - var rs = _this.reposStore; - var s =rv.el.get_selection(); - if (s.count_selected_rows() != 1) { - return; - } - Gtk.TreeIter iter; - Gtk.TreeModel tm; - s.get_selected(out tm, out iter); - GLib.Value val; - tm.get_value(iter, 6, out val); - var git_working_dir = (string)val; - - var repo = GitRepo.singleton().get(git_working_dir); - - // if you hit merge.... in master.. - // ignore.. - if (repo.currentBranch.name == "master") { - return; - } - MergeBranch.singleton().show(repo.activeTicket, repo); - _this.reposStore.load(); - - - - }); - } - - // user defined functions - } - - public class Xcls_Button7 : Object - { - public Gtk.Button el; - private Clones _this; - - - // my vars (def) - - // ctor - public Xcls_Button7(Clones _owner ) - { - _this = _owner; - this.el = new Gtk.Button(); - - // my vars (dec) - - // set gobject values - this.el.label = "Switch Branch"; - this.el.visible = false; - - //listeners - this.el.clicked.connect( () => { - + Clone.singleton().show(this.el); - - - - - }); - } - - // user defined functions - } - - public class Xcls_Button8 : Object - { - public Gtk.Button el; - private Clones _this; - - - // my vars (def) - - // ctor - public Xcls_Button8(Clones _owner ) - { - _this = _owner; - this.el = new Gtk.Button(); - - // my vars (dec) - - // set gobject values - this.el.label = "Pull"; - - //listeners - this.el.clicked.connect( () => { - - var rv = _this.reposView; - var rs = _this.reposStore; - var s =rv.el.get_selection(); - if (s.count_selected_rows() != 1) { - return; - } - Gtk.TreeIter iter; - Gtk.TreeModel tm; - s.get_selected(out tm, out iter); - GLib.Value val; - tm.get_value(iter, 6, out val); - var git_working_dir = (string)val; - var repo = GitRepo.singleton().get(git_working_dir); - GitMonitor.gitmonitor.pause(); - repo.pull(); - repo.loadStatus(); - _this.reposStore.load(); - GitMonitor.gitmonitor.start(); - - }); } @@ -442,7 +182,7 @@ public class Clones : Object } - public class Xcls_ScrolledWindow9 : Object + public class Xcls_ScrolledWindow5 : Object { public Gtk.ScrolledWindow el; private Clones _this; @@ -451,7 +191,7 @@ public class Clones : Object // my vars (def) // ctor - public Xcls_ScrolledWindow9(Clones _owner ) + public Xcls_ScrolledWindow5(Clones _owner ) { _this = _owner; this.el = new Gtk.ScrolledWindow( null, null );