NewBranch.bjs
authorAlan Knowles <alan@roojs.com>
Thu, 21 Mar 2019 06:30:31 +0000 (14:30 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 21 Mar 2019 06:30:31 +0000 (14:30 +0800)
NewBranch.vala

NewBranch.bjs
NewBranch.vala

index 70bf5dd..5c39d8f 100644 (file)
            "* 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"
           }
          ]
         },
index 7fd6f64..bbdf786 100644 (file)
@@ -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);
+         
+        }
     }