From d14ea4a207f1305a750ae428162a1ff466b1f440 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Thu, 21 Mar 2019 13:52:01 +0800 Subject: [PATCH] NewBranch.bjs NewBranch.vala --- NewBranch.bjs | 2 +- NewBranch.vala | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/NewBranch.bjs b/NewBranch.bjs index d6d557bc..5b203ff9 100644 --- a/NewBranch.bjs +++ b/NewBranch.bjs @@ -247,7 +247,7 @@ "bool homogeneous" : false, "xtype" : "Box", "* pack" : "append_page,_this.label_create_ticket.el", - "| void load_data" : "() {\n\n}\n", + "| void load_data" : "() {\n if (this.running) { // should not happen!!\n \tGLib.error(\"new branch show called, when already being displayed?\");\n\t}\n \tthis.running = true;\n \n \t \n\t\n Timeout.add_seconds(1, () => {\n\t\t \n\t\tRooProject? curproj = null;\n\t\tif (_this.repo != null) {\n\t\t\tcurproj = RooProject.getProjectByRepo(_this.repo);\n\t\t}\n\t\t_this.prmodel.loadProjects(curproj == null ? \"\" : curproj.id);\n\t\tif (curproj != null) {\n\t \n\t\t\t\n\t\t\tvar rt = RooTicket.singleton();\n\t\t\trt.loadProjectOptions(curproj.id);\n\t\t\t\n\t\t\t_this.msmodel.loadMilestones();\n\t\t\t_this.primodel.loadPriorities();\n\t\t\t_this.sevmodel.loadSeverities();\n\t\t\t_this.clmodel.loadClassifications();\t\n\t\t\t_this.devmodel.loadDevelopers();\t\n\t\t\t\n\t\t}\n\t\t_this.summary.el.set_text(\"\");\n\t\t_this.description.el.buffer.text = \"\"; \n\t\t_this.spinner.el.stop();\n\t\t_this.spinner.el.hide();\t\n\n\t\tthis.table.el.show();\n\t _this.summary.el.grab_focus();\n \n\t \treturn false;\n \t});\n}\n", "$ xns" : "Gtk", "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL", "items" : [ diff --git a/NewBranch.vala b/NewBranch.vala index d4b0e093..18c557b9 100644 --- a/NewBranch.vala +++ b/NewBranch.vala @@ -1101,7 +1101,43 @@ public class NewBranch : Object // user defined functions public void load_data () { + if (this.running) { // should not happen!! + GLib.error("new branch show called, when already being displayed?"); + } + this.running = true; + + + + Timeout.add_seconds(1, () => { + + RooProject? curproj = null; + if (_this.repo != null) { + curproj = RooProject.getProjectByRepo(_this.repo); + } + _this.prmodel.loadProjects(curproj == null ? "" : curproj.id); + if (curproj != null) { + + + var rt = RooTicket.singleton(); + rt.loadProjectOptions(curproj.id); + + _this.msmodel.loadMilestones(); + _this.primodel.loadPriorities(); + _this.sevmodel.loadSeverities(); + _this.clmodel.loadClassifications(); + _this.devmodel.loadDevelopers(); + + } + _this.summary.el.set_text(""); + _this.description.el.buffer.text = ""; + _this.spinner.el.stop(); + _this.spinner.el.hide(); + this.table.el.show(); + _this.summary.el.grab_focus(); + + return false; + }); } } public class Xcls_table : Object -- 2.39.2