X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=NewBranch.vala;h=13e34ec948d2d7100467451ed78d7b3e3e2d66ad;hb=fdb9c0a88dcdf59110aa8f1d5a3589a1b77fe38a;hp=f27c90509acc08dd6c7d29b80d7822434c923e11;hpb=0e9fc3ea0deeb29e7023b0410cf7713f7adec001;p=gitlive diff --git a/NewBranch.vala b/NewBranch.vala index f27c9050..13e34ec9 100644 --- a/NewBranch.vala +++ b/NewBranch.vala @@ -52,6 +52,8 @@ public class NewBranch : Object this.el.response.connect( (self, response_id) => { GLib.debug("got %d", (int) response_id); + _this.el.hide(); + }); this.el.show.connect( (self) => { @@ -199,7 +201,22 @@ public class NewBranch : Object _this.dbmodel.el.get_value (iter, 0, out val1); _this.dbmodel.el.get_value (iter, 1, out val2); - print ("Selection: %s, %d\n", (string) val1, (int) val2); + var ticket_id = (string) val1; + + var name = RooTicket.singleton().usernameLocal(); + + if (ticket_id == "") { + + var dt = new DateTime.now_local(); + _this.name.el.set_text("wip_%s_%s".printf(name,dt.format("%Y_%b_%d"))); + return; + } + + var ticket = RooTicket.singleton().getById(ticket_id); + + _this.name.el.set_text("wip_%s_T%s_%s".printf(name,ticket.id, ticket.summaryToBranchName())); + + //GLib.debug (//"Selection: %s, %s\n", (string) val1, (string) val2); }); }