X-Git-Url: http://git.roojs.org/?p=gitlive;a=blobdiff_plain;f=NewBranch.vala;h=c9bff826a4caa8360aae952afaf7682bb1e837ae;hp=34662cd47fb31e56c053990a1e75cda7fe651a47;hb=ce5337e4ad3400605415fb497dbbced99ed35860;hpb=2ac46b7e5e54b5382df0c55b865e47a9937e15f8 diff --git a/NewBranch.vala b/NewBranch.vala index 34662cd4..c9bff826 100644 --- a/NewBranch.vala +++ b/NewBranch.vala @@ -97,7 +97,7 @@ public class NewBranch : Object } // user defined functions - public void show ( GitRepo repo, Gee.ArrayList queue ) + public void show ( GitRepo repo, Gee.ArrayList queue, string tid = "" ) { // this.el.set_gravity(Gdk.Gravity.NORTH); if (this.running) { // should not happen!! @@ -110,8 +110,7 @@ public class NewBranch : Object this.repo = repo; - - + this.el.move((Gdk.Screen.width() / 2)- 250 ,0); this.el.set_default_size( 500,200); // not sure why it grows.. @@ -125,7 +124,13 @@ public class NewBranch : Object var curproj = RooTicket.singleton().getProjectByRepo(this.repo); _this.prmodel.loadProjects(curproj == null ? "" : curproj.id); - _this.dbmodel.loadTickets(curproj == null ? "": curproj.id); + _this.dbmodel.loadTickets(curproj == null ? "": curproj.id, tid); + if (tid != "") { + var name = RooTicket.singleton().usernameLocal(); + var ticket = RooTicket.singleton().getById(tid); + _this.name.el.set_text("wip_%s_T%s_%s".printf(name,ticket.id, ticket.summaryToBranchName())); + } + this.el.run(); } @@ -536,7 +541,7 @@ public class NewBranch : Object } // user defined functions - public void loadTickets (string project_id) { + public void loadTickets (string project_id , string tid = "") { @@ -544,8 +549,8 @@ public class NewBranch : Object RooTicket.singleton().loadTickets( project_id, - _this.btn_not_me.el.active ? RooTicket.NotMe.TRUE : RooTicket.NotMe.FALSE, - _this.btn_closed.el.active ? RooTicket.Closed.TRUE : RooTicket.Closed.FALSE + _this.btn_not_me.el.active ? RooTicket.Who.ANYBODY : RooTicket.Who.ME, + _this.btn_closed.el.active ? RooTicket.Status.ALL : RooTicket.Status.ACTIVE ); _this.ticketsel.loading = true; @@ -569,9 +574,9 @@ public class NewBranch : Object el.set_value(iter, 0, ticket.id); el.set_value(iter, 1, "#%s [%s] %s".printf( ticket.id, ticket.project_id_name , ticket.summary)); - //if (data.get(i) == cur) { - // _this.build_module.el.set_active_iter(iter); - // } + if (ticket.id == tid) { + _this.ticketsel.el.set_active_iter(iter); + } } @@ -601,6 +606,13 @@ public class NewBranch : Object // set gobject values this.el.expand = false; this.el.label = "New Ticket"; + + //listeners + this.el.clicked.connect( () => { + _this.el.response(-1); + Ticket.singleton().show(_this.repo); + + }); } // user defined functions @@ -681,7 +693,8 @@ public class NewBranch : Object } //listeners - this.el.activate.connect( () => { + this.el.clicked.connect( () => { + GLib.debug("fire response = 1"); _this.el.response(1); }); }