From ef56c32cbbca900aca2c242afb3c88a5d873d1d2 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Mon, 17 Dec 2018 14:08:27 +0800 Subject: [PATCH] Ticket.bjs Ticket.vala --- Ticket.bjs | 2 +- Ticket.vala | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Ticket.bjs b/Ticket.bjs index a517b510..ec2c34fd 100644 --- a/Ticket.bjs +++ b/Ticket.bjs @@ -59,7 +59,7 @@ }, { "listeners" : { - "changed" : "() => {\n\tif (this.loading) {\n\t\treturn;\n\t}\n\tvar project_id = this.selectedProjectId();\n\t\n\t// affects projects and milestones..\n\t\n\t\n\t/*if (this.loading) {\n\t\treturn;\n\t}\n\tvar ticket_id = this.selectedTicketId();\n\t\n\tvar name = RooTicket.singleton().usernameLocal();\n\t\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\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\n\t//GLib.debug (//\"Selection: %s, %s\\n\", (string) val1, (string) val2);\n\t*/\n}" + "changed" : "() => {\n\tif (this.loading) {\n\t\treturn;\n\t}\n\tvar project_id = this.selectedProjectId();\n\t\n\tvar rt = RooTicket.singleton();\n\trt.loadProjectOptions(project_id);\n\t\n\t_this.milestone_id.loadMilestones();\n\t_this.priority_id.loadPriorities();\n\t_this.severity_id.loadSeverities();\n\t_this.classification_id.loadClassifications();\t\n\t// affects projects and milestones..\n\t\n\t\n\t/*if (this.loading) {\n\t\treturn;\n\t}\n\tvar ticket_id = this.selectedTicketId();\n\t\n\tvar name = RooTicket.singleton().usernameLocal();\n\t\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\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\n\t//GLib.debug (//\"Selection: %s, %s\\n\", (string) val1, (string) val2);\n\t*/\n}" }, "* ctor" : "new Gtk.ComboBox.with_entry()", "id" : "project_id", diff --git a/Ticket.vala b/Ticket.vala index 79c3eaa4..2872a8fe 100644 --- a/Ticket.vala +++ b/Ticket.vala @@ -297,6 +297,13 @@ public class Ticket : Object } var project_id = this.selectedProjectId(); + var rt = RooTicket.singleton(); + rt.loadProjectOptions(project_id); + + _this.milestone_id.loadMilestones(); + _this.priority_id.loadPriorities(); + _this.severity_id.loadSeverities(); + _this.classification_id.loadClassifications(); // affects projects and milestones.. -- 2.39.2