From b81ad505a3eb434399228b8a3bb80185cd9a299a Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Thu, 21 Mar 2019 14:24:48 +0800 Subject: [PATCH] NewBranch.bjs NewBranch.vala --- NewBranch.bjs | 4 ++-- NewBranch.vala | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/NewBranch.bjs b/NewBranch.bjs index af89d200..219a9fa9 100644 --- a/NewBranch.bjs +++ b/NewBranch.bjs @@ -17,7 +17,7 @@ "title" : "Create a working branch ", "xtype" : "Dialog", "# GitRepo? repo" : "null", - "| void show" : "( GitRepo repo, Gee.ArrayList queue, string tid = \"\" ) \n{\n // this.el.set_gravity(Gdk.Gravity.NORTH);\n if (this.running) { // should not happen!!\n \tGLib.error(\"new branch show called, when already being displayed?\");\n\t}\n\t\n\t\n\tthis.queue = queue;\n\tthis.running = true;\n\tGitMonitor.gitmonitor.stop();\n\t\n\t\n this.repo = repo;\n\tthis.el.move((Gdk.Screen.width() / 2)- 250 ,0);\n\tthis.el.set_default_size( 500,200); // not sure why it grows..\n\t\n\t\n\t\n\t\n \n\n this.el.show_all();\n this.el.set_keep_above(true);\n\t\n\t_this.select_ticket_tab.load_data(tid);\n\t_this.create_ticket_tab.load_data();\n\t_this.quick_commit_tab.load_data();\n \n \n \n \n \n \n \n \tthis.el.run();\n\n}", + "| void show" : "( GitRepo repo, Gee.ArrayList queue, string tid = \"\" ) \n{\n // this.el.set_gravity(Gdk.Gravity.NORTH);\n if (this.running) { // should not happen!!\n \tGLib.error(\"new branch show called, when already being displayed?\");\n\t}\n\t\n\t\n\tthis.queue = queue;\n\tthis.running = true;\n\tGitMonitor.gitmonitor.stop();\n\t\n\t\n this.repo = repo;\n\tthis.el.move((Gdk.Screen.width() / 2)- 250 ,0);\n\tthis.el.set_default_size( 500,200); // not sure why it grows..\n\t\n\t\n\t\n\t\n \n\n this.el.show_all();\n this.el.set_keep_above(true);\n\t\n\t_this.notebook.el.set_current_page(0);\n\t\n\t_this.select_ticket_tab.load_data(tid);\n\t_this.create_ticket_tab.load_data();\n\t_this.quick_commit_tab.load_data();\n \n \n \n \n \n \n \n \tthis.el.run();\n\n}", "default_height" : 500, "$ xns" : "Gtk", "# bool running" : false, @@ -26,7 +26,7 @@ "items" : [ { "listeners" : { - "switch_page" : "(page, page_num) => {\n\tGLib.debug(\"Switch to page: %d\", (int)page_num);\n\t\n}\n" + "switch_page" : "(page, page_num) => {\n\tGLib.debug(\"Switch to page: %d\", (int)page_num);\n\tswitch(page_num) {\n\t\tcase 0: \n\t\t\tbreak; // do nothing.. it's already loaded at start.\n\t\tcase 1: \n\t\t\t_this.create_ticket_tab.load_data();\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\t_this.quick_commit_tab.load_data();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t}\n}\n" }, "* pack" : "get_content_area().add", "xtype" : "Notebook", diff --git a/NewBranch.vala b/NewBranch.vala index b8fbe5ab..cecc6bd7 100644 --- a/NewBranch.vala +++ b/NewBranch.vala @@ -156,6 +156,8 @@ public class NewBranch : Object this.el.show_all(); this.el.set_keep_above(true); + _this.notebook.el.set_current_page(0); + _this.select_ticket_tab.load_data(tid); _this.create_ticket_tab.load_data(); _this.quick_commit_tab.load_data(); @@ -206,7 +208,18 @@ public class NewBranch : Object //listeners this.el.switch_page.connect( (page, page_num) => { GLib.debug("Switch to page: %d", (int)page_num); - + switch(page_num) { + case 0: + break; // do nothing.. it's already loaded at start. + case 1: + _this.create_ticket_tab.load_data(); + break; + case 2: + _this.quick_commit_tab.load_data(); + break; + default: + break; + } }); } -- 2.39.2