From 4078296052c522966e955e178a456cb662e68f23 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Wed, 13 Feb 2019 14:26:32 +0800 Subject: [PATCH] NewBranch.bjs NewBranch.vala --- NewBranch.bjs | 2 +- NewBranch.vala | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/NewBranch.bjs b/NewBranch.bjs index b73696d8..d70e8dd0 100644 --- a/NewBranch.bjs +++ b/NewBranch.bjs @@ -154,7 +154,7 @@ }, "label" : "Create Branch", "id" : "createbtn", - "| void updateState" : "() {\n\n\n\n}\n", + "| void updateState" : "() {\n\n\nif (_this.actionsel.selectedAction() == \"\") {\n\t\t// need to select an action..\n\t\tthis.el.set_sensitive(false);\n\t\treturn;\n\t\n\t\n\t}\n\t\tthis.el.set_sensitive(true);\n\t\treturn;\n}\n", "* init" : "{\n this.el.get_style_context().add_class(\"suggested-action\");\n}\n", "xtype" : "Button", "* pack" : "attach_defaults,4,5,4,5", diff --git a/NewBranch.vala b/NewBranch.vala index 70d2ecc6..16ba8cae 100644 --- a/NewBranch.vala +++ b/NewBranch.vala @@ -739,7 +739,15 @@ public class NewBranch : Object public void updateState () { - + if (_this.actionsel.selectedAction() == "") { + // need to select an action.. + this.el.set_sensitive(false); + return; + + + } + this.el.set_sensitive(true); + return; } } -- 2.39.2