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);
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 );
}
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
// set gobject values
this.el.label = "Add Repository";
- //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( () => {
-
-
-
-
-
-
- });
- }
-
- // 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)
+ // init method
- // set gobject values
- this.el.label = "Pull";
+ {
+ this.el.get_style_context().add_class("suggested-action");
+ }
//listeners
this.el.clicked.connect( () => {
+ Clone.singleton().show(this.el);
-
-
-
});
}
}
- public class Xcls_ScrolledWindow9 : Object
+ public class Xcls_ScrolledWindow5 : Object
{
public Gtk.ScrolledWindow el;
private Clones _this;
// my vars (def)
// ctor
- public Xcls_ScrolledWindow9(Clones _owner )
+ public Xcls_ScrolledWindow5(Clones _owner )
{
_this = _owner;
this.el = new Gtk.ScrolledWindow( null, null );
// set gobject values
this.el.search_column = 0;
+ this.el.activate_on_single_click = true;
this.el.enable_grid_lines = Gtk.TreeViewGridLines.HORIZONTAL;
var child_0 = new Xcls_reposStore( _this );
child_0.ref();
//listeners
this.el.row_activated.connect( (path, col) => {
- if (col.title != "Active Ticket") {
+ if (col.title != "Current Branch") {
return;
}
if ((cb.lastrev != cb.remoterev) && (repo.has_local_changes)) {
col = "#fcf8e3";
this.el.set_value( iter, 1, repo.currentBranch.name +"\n" +
- (repo.ahead_or_behind == "B" ? "Local is BEHIND remote" : "Local is AHEAD of remote")
+ (repo.ahead_or_behind == "B" ? "Local is BEHIND remote" : "Local is AHEAD of remote") +
"\nHas uncommitted changes" );
}