X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=NewBranch.bjs;h=1d8ea4f0202a214679851e2f8ccfbfcecc834db4;hb=886d2cd45df8370ff1ff789ccab8fa8ef683fabb;hp=1fc586a5f2e14f86d425faca656360c4c8932cf9;hpb=ea4b51113117e3c0c2e53a6c6aeef754d2167168;p=gitlive diff --git a/NewBranch.bjs b/NewBranch.bjs index 1fc586a5..1d8ea4f0 100644 --- a/NewBranch.bjs +++ b/NewBranch.bjs @@ -28,6 +28,7 @@ "listeners" : { "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" }, + "id" : "notebook", "* pack" : "get_content_area().add", "xtype" : "Notebook", "$ xns" : "Gtk", @@ -511,7 +512,7 @@ "bool homogeneous" : false, "* pack" : "append_page,_this.label_quick_commit.el", "xtype" : "Box", - "| void load_data" : "() {\n _this.commit_message.el.set_text(\"\");\n \n}\n", + "| void load_data" : "() {\n _this.commit_message.el.set_text(\"\");\n _this.createbtn.updateState();\n}\n", "$ xns" : "Gtk", "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL", "items" : [ @@ -523,7 +524,7 @@ "uint column_spacing" : 4, "n_columns" : 5, "$ xns" : "Gtk", - "n_rows" : 2, + "n_rows" : 3, "bool vexpand" : false, "int margin" : 2, "items" : [ @@ -538,22 +539,25 @@ "$ xns" : "Gtk" }, { + "listeners" : { + "key_release_event" : "() => { \n\n\t_this.createbtn.updateState();\n}" + }, "id" : "commit_message", "$ visible" : true, "xtype" : "Entry", - "* pack" : "attach_defaults,0,4,1,2", + "* pack" : "attach_defaults,0,5,1,2", "$ xns" : "Gtk" }, { "listeners" : { - "clicked" : "() => {\n\n\tGLib.debug(\"fire response = 1\");\n\t\n\tvar ticket_id = _this.ticketsel.selectedTicketId();\n\t\n\tif (ticket_id == \"\") {\n\t\t_this.ticketsel.el.get_child().get_style_context().add_class(\"warning\");\n\t\treturn;\n\t}\n\t \n\t_this.el.response(1);\n}" + "clicked" : "() => {\n\n\tGLib.debug(\"fire response = 1\");\n\t\n\t \n\t \n\t_this.el.response(3);\n}" }, "label" : "Commit Changes", "id" : "createbtn", - "| void updateState" : "() {\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", + "| void updateState" : "() {\n\n\tvar msg = _this.commit_message.el.get_text();\n\t\n\tif (msg == \"\") {\n\t\tthis.el.set_sensitive(false);\n\t\treturn;\n\t}\n \n\tthis.el.set_sensitive(true);\n \n}\n", "* init" : "{\n this.el.get_style_context().add_class(\"suggested-action\");\n}\n", "xtype" : "Button", - "* pack" : "attach_defaults,4,5,1,2", + "* pack" : "attach_defaults,0,5,2,3", "$ xns" : "Gtk" } ]