From: Alan Knowles Date: Wed, 13 Feb 2019 06:25:32 +0000 (+0800) Subject: NewBranch.bjs X-Git-Url: http://git.roojs.org/?p=gitlive;a=commitdiff_plain;h=308014f9029f19155c3636059070f37e10bed1c6 NewBranch.bjs NewBranch.vala --- diff --git a/NewBranch.bjs b/NewBranch.bjs index 1bf39f12..92105bff 100644 --- a/NewBranch.bjs +++ b/NewBranch.bjs @@ -93,7 +93,7 @@ }, { "listeners" : { - "changed" : "() => {\n\tif (this.loading) {\n\t\treturn;\n\t}\n\tvar ticket_id = this.selectedTicketId();\n\t\n\tvar name = RooTicket.singleton().usernameLocal();\n\t\n\tthis.el.get_child().get_style_context().remove_class(\"warning\");\n\tif (ticket_id == \"\" || ticket_id == null) {\n\t\n\t\tvar dt = new DateTime.now_local();\n\t\t_this.name.el.set_text(\"wip_%s_%s\".printf(name,dt.format(\"%Y_%b_%d\")));\n\t\t_this.view.loadTicket(\"\");\t\t\n\t\t\n\t\tthis.el.get_child().get_style_context().add_class(\"warning\");\n\t\t\n\t\treturn;\n\t}\n\t\n\t\n\tvar ticket = RooTicket.singleton().getById(ticket_id);\n \n\t_this.name.el.set_text(\"wip_%s_T%s_%s\".printf(name,ticket.id, ticket.summaryToBranchName()));\n\t_this.scrolled_window.el.show();\n\t \n\t_this.view.loadTicket(ticket.id);\n\t//GLib.debug (//\"Selection: %s, %s\\n\", (string) val1, (string) val2);\n}" + "changed" : "() => {\n\tif (this.loading) {\n\t\treturn;\n\t}\n\tvar ticket_id = this.selectedTicketId();\n\t\n\tvar name = RooTicket.singleton().usernameLocal();\n\t\n\tthis.el.get_child().get_style_context().remove_class(\"warning\");\n\tif (ticket_id == \"\" || ticket_id == null) {\n\t\n\t\tvar dt = new DateTime.now_local();\n\t\t_this.name.el.set_text(\"wip_%s_%s\".printf(name,dt.format(\"%Y_%b_%d\")));\n\t\t_this.view.loadTicket(\"\");\t\t\n\t\t\n\t\tthis.el.get_child().get_style_context().add_class(\"warning\");\n\t\t\n\t\treturn;\n\t}\n\t\n\t\n\tvar ticket = RooTicket.singleton().getById(ticket_id);\n \n\t_this.name.el.set_text(\"wip_%s_T%s_%s\".printf(name,ticket.id, ticket.summaryToBranchName()));\n\t_this.scrolled_window.el.show();\n\t \n\t_this.view.loadTicket(ticket.id);\n\t_this.createbtn.updateState();\n\t\n\t//GLib.debug (//\"Selection: %s, %s\\n\", (string) val1, (string) val2);\n}" }, "* ctor" : "new Gtk.ComboBox.with_entry()", "id" : "ticketsel", diff --git a/NewBranch.vala b/NewBranch.vala index 7ae10955..f41abbcc 100644 --- a/NewBranch.vala +++ b/NewBranch.vala @@ -499,6 +499,8 @@ public class NewBranch : Object _this.scrolled_window.el.show(); _this.view.loadTicket(ticket.id); + _this.createbtn.updateState(); + //GLib.debug (//"Selection: %s, %s\n", (string) val1, (string) val2); }); }