Final User interface tweaks to basic commit code (shows dialogs while it does stuff)
[gitlive] / FixBug.bjs
index aefe503..515e2a4 100644 (file)
@@ -1,5 +1,5 @@
 {
-    "id": "file-gtk-18",
+    "id": "file-gtk-1",
     "name": "FixBug",
     "parent": "",
     "title": false,
@@ -8,7 +8,7 @@
         {
             "listeners": {
                 "destroy_event": "function (self, event) {\n     this.el.hide();\n                return false;\n}",
-                "response": "function (self, id) {\n  // hide\n if (id < 1) {\n        this.el.hide();\n        return;\n    }\n    if (!this.get('bug').getValue().length) {\n        print(\"ERROR\");\n            return;\n        }\n \n        this.el.hide();\n        \n        var val = this.get('bug').getValue();\n        Seed.print(val);\n}"
+                "response": "function (self, id) {\n  // hide\n     if (id < 1) {\n        this.el.hide();\n        return;\n    }\n    if (typeof(this.get('bug').getValue()) != 'object') {\n        print(\"ERROR\");\n        return;\n    }\n \n    this.el.hide();\n        \n    //var val = this.get('bug').getValue();\n     //   Seed.print(val);\n}"
             },
             "border_width": 3,
             "default_height": 400,
@@ -17,7 +17,7 @@
             "xtype": "Dialog",
             "|deletable": true,
             "|modal": true,
-            "|show": "function(c) {\n    \n    if (!this.el) {\n        this.init();\n    }\n    var _this = this;\n    /*[ 'xtype'  ].forEach(function(k) {\n        _this.get(k).setValue(typeof(c[k]) == 'undefined' ? '' : c[k]);\n    });\n\t// shouild set path..\n    */\n    this.el.show_all();\n    \n    // block until we return.\n    this.el.run();\n    \n    //this.success = c.success;\n}\n",
+            "|show": "function(c) {\n    \n    if (!this.el) {\n        this.init();\n    }\n    var _this = this;\n    /*[ 'xtype'  ].forEach(function(k) {\n        _this.get(k).setValue(typeof(c[k]) == 'undefined' ? '' : c[k]);\n    });\n\t// shouild set path..\n    */\n\n    \n    this.el.show_all();\n    this.get('/ok_button').el.set_sensitive(false);\n    \n    // block until we return.\n    var run_ret = this.el.run();\n    if (run_ret < 1 ) {\n        return false;\n    }\n    print(\"RUN RETURN : \" + run_ret);\n    \n    //print(JSON.stringify(this.get('bug').getValue()));\n    return this.get('bug').getValue();\n    //this.success = c.success;\n}\n",
             "|xns": "Gtk",
             "items": [
                 {
@@ -38,7 +38,7 @@
                                 },
                                 {
                                     "listeners": {
-                                        "changed": "function (self) {\n    var d = this.getValue();\n    this.get('/view').load(d.description);\n}"
+                                        "changed": "function (self) {\n    var d = this.getValue();\n    this.get('/view').load(d.description);\n      this.get('/ok_button').el.set_sensitive(true);\n}"
                                     },
                                     "id": "bug",
                                     "pack": "pack_end,true,true,3",
                     ]
                 },
                 {
-                    "|xns": "Gtk",
+                    "label": "Cancel",
+                    "pack": "add_action_widget,0",
                     "xtype": "Button",
-                    "pack": "add_action_widget,1",
-                    "label": "OK"
+                    "|xns": "Gtk",
+                    "listeners": {}
                 },
                 {
-                    "|xns": "Gtk",
+                    "id": "ok_button",
+                    "label": "OK",
+                    "pack": "add_action_widget,1",
                     "xtype": "Button",
-                    "pack": "add_action_widget,0",
-                    "label": "Cancel"
+                    "|xns": "Gtk"
                 }
             ]
         }