From a3aeb555d2bf1cafb62d2166683766c07ab42d74 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Thu, 21 Mar 2019 14:30:31 +0800 Subject: [PATCH] NewBranch.bjs NewBranch.vala --- NewBranch.bjs | 3 ++- NewBranch.vala | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/NewBranch.bjs b/NewBranch.bjs index 70bf5dda..5c39d8f6 100644 --- a/NewBranch.bjs +++ b/NewBranch.bjs @@ -554,7 +554,8 @@ "* init" : "{\n this.el.get_style_context().add_class(\"suggested-action\");\n}\n", "xtype" : "Button", "* pack" : "attach_defaults,0,5,2,3", - "$ xns" : "Gtk" + "$ xns" : "Gtk", + "| return_type XXXX" : "() {\n\n\tvar ticket_id = _this.ticketsel.selectedTicketId();\n\t\n\tif (ticket_id == \"\") {\n\t\tthis.el.set_sensitive(false);\n\t\treturn;\n\t}\n \n\tthis.el.set_sensitive(true);\n \n}\n" } ] }, diff --git a/NewBranch.vala b/NewBranch.vala index 7fd6f64d..bbdf7867 100644 --- a/NewBranch.vala +++ b/NewBranch.vala @@ -2419,6 +2419,18 @@ public class NewBranch : Object } // user defined functions + public return_type XXXX () { + + var ticket_id = _this.ticketsel.selectedTicketId(); + + if (ticket_id == "") { + this.el.set_sensitive(false); + return; + } + + this.el.set_sensitive(true); + + } } -- 2.39.2