X-Git-Url: http://git.roojs.org/?p=gitlive;a=blobdiff_plain;f=NewBranch.vala;fp=NewBranch.vala;h=1a3a0793fcae59235abe39dc83c5d653496ed528;hp=c2800e8af1a705b77407a1c7b225092518a6afa6;hb=48f4250d0b6d7d5b08c81514002948d44553173f;hpb=fb616d39f4753122f17876b285e232850e72631b diff --git a/NewBranch.vala b/NewBranch.vala index c2800e8a..1a3a0793 100644 --- a/NewBranch.vala +++ b/NewBranch.vala @@ -37,7 +37,7 @@ public class NewBranch : Object // my vars (dec) this.repo = null; - this.running = false; + this.running = true; this.queue = null; // set gobject values @@ -64,6 +64,10 @@ public class NewBranch : Object this.running = false; return; } + + + + // have they selected a ticket.. // make that the current active ticket? @@ -74,6 +78,11 @@ public class NewBranch : Object // -- initial load can check the contents of the ticket files on first scan. var ticket_id = _this.ticketsel.selectedTicketId(); + if (ticket_id == "") { + _this.ticketsel.el.get_child().get_style_context().add_class("warning"); + return; + } + if (this.repo != null) { var bn = _this.name.el.get_text(); @@ -127,13 +136,13 @@ public class NewBranch : Object _this.prmodel.loadProjects(curproj == null ? "" : curproj.id); _this.dbmodel.loadTickets(curproj == null ? "": curproj.id, tid); - - if (tid != "") { + _this.ticketsel.el.get_child().get_style_context().remove_class("warning"); + 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())); - - + } else { + _this.ticketsel.el.get_child().get_style_context().add_class("warning"); } _this.view.loadTicket(tid); this.el.run(); @@ -472,11 +481,15 @@ public class NewBranch : Object var name = RooTicket.singleton().usernameLocal(); + this.el.get_child().get_style_context().remove_class("warning"); if (ticket_id == "" || ticket_id == null) { var dt = new DateTime.now_local(); _this.name.el.set_text("wip_%s_%s".printf(name,dt.format("%Y_%b_%d"))); _this.view.loadTicket(""); + + this.el.get_child().get_style_context().add_class("warning"); + return; }