Builder4/DialogNewComponent.bjs
authorAlan Knowles <alan@roojs.com>
Tue, 10 Jun 2014 11:13:58 +0000 (19:13 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 10 Jun 2014 11:13:58 +0000 (19:13 +0800)
Builder4/DialogNewComponent.js
Builder4/DialogNewComponent.vala

Builder4/DialogNewComponent.bjs
Builder4/DialogNewComponent.js
Builder4/DialogNewComponent.vala

index 16c48e1..b328221 100644 (file)
@@ -8,7 +8,7 @@
         {
             "listeners": {
                 "delete_event": "(self, event) => {\n    this.el.hide();\n    return true;\n}\n\n",
-                "response": "  (self, response_id) =>  {\n  \n\tif (response_id < 1) { // cancel!\n            this.el.hide();\n            return;\n        }\n\n        if (_this.name.el.get_text().length  < 1) {\n            StandardErrorDialog.show(\n                \"You have to set Project name \"\n            );\n             \n            return;\n        }\n        // what does this do?\n        \n        var isNew = _this.file.name.length  > 0 ? false : true;\n        \n        if (_this.file.name.length > 0 && this.file.name != _this.name.el.get_text()) {\n            StandardErrorDialog.show(\n                \"Sorry changing names does not work yet. \"\n            );\n             \n            return;\n        }\n\n        // FIXME - this may be more complicated...\n        //for (var i in this.def) {\n        //    this.file[i] =  this.get(i).el.get_text();\n        //}\n\n        if (!isNew) {\n            _this.file.save();\n            this.el.hide();\n            return;\n        }\n\n    \n\tvar dir = _this.project.firstPath();\n\t//FIXME...\n        //for (var i in this.project.paths) {\n \t//\tdir = i;\n\t//\tbreak;\n\t//}\n\n \n        \n        // what about .js ?\n        if (GLib.FileUtil.test(_this.file.name + \".bjs\", GLib.FileTest.EXISTS)) {\n            StandardErrorDialog.show(\n                \"That file already exists\"\n            ); \n            return;\n        }\n        this.el.hide();\n        \n        \n        //var tmpl = this.project.loadFileOnly(DialogNewComponent.get('template').getValue());\n         \n        var nf = _this.project.create(dir + \"/\" + _this.file.name + \".bjs\");\n        //for (var i in this.file) {\n        //    nf[i] = this.file[i];\n        //}\n        /*\n        -- fixme -- needs to be a signal..\n        if (DialogNewComponent.success != null) {\n            DialogNewComponent.success(_this.project, nf);\n        }\n        */\n}",
+                "response": "  (self, response_id) =>  {\n  \n\tif (response_id < 1) { // cancel!\n            this.el.hide();\n            return;\n        }\n\n        if (_this.name.el.get_text().length  < 1) {\n            StandardErrorDialog.show(\n                \"You have to set Project name \"\n            );\n             \n            return;\n        }\n        // what does this do?\n        \n        var isNew = _this.file.name.length  > 0 ? false : true;\n        \n        if (_this.file.name.length > 0 && this.file.name != _this.name.el.get_text()) {\n            StandardErrorDialog.show(\n                \"Sorry changing names does not work yet. \"\n            );\n             \n            return;\n        }\n\n        // FIXME - this may be more complicated...\n        //for (var i in this.def) {\n        //    this.file[i] =  this.get(i).el.get_text();\n        //}\n\n        if (!isNew) {\n            _this.file.save();\n            this.el.hide();\n            return;\n        }\n\n    \n\tvar dir = _this.project.firstPath();\n\t//FIXME...\n        //for (var i in this.project.paths) {\n \t//\tdir = i;\n\t//\tbreak;\n\t//}\n\n \n        \n        // what about .js ?\n        if (GLib.FileUtil.test(_this.file.name + \".bjs\", GLib.FileTest.EXISTS)) {\n            StandardErrorDialog.show(\n                \"That file already exists\"\n            ); \n            return;\n        }\n        this.el.hide();\n        \n        \n        //var tmpl = this.project.loadFileOnly(DialogNewComponent.get('template').getValue());\n         \n        var nf = _this.project.create(dir + \"/\" + _this.file.name + \".bjs\");\n        //for (var i in this.file) {\n        //    nf[i] = this.file[i];\n        //}\n        _this.success(_this.project, nf);\n        /*\n\n        -- fixme -- needs to be a signal..\n        if (DialogNewComponent.success != null) {\n            DialogNewComponent.success(_this.project, nf);\n        }\n        */\n}",
                 "show": "(self)  => {\n  this.el.show_all();\n}"
             },
             ".signal:void:success": "()",
index 8e7c351..0020640 100644 (file)
@@ -79,7 +79,9 @@ DialogNewComponent=new XObject({
                 //for (var i in this.file) {
                 //    nf[i] = this.file[i];
                 //}
+                _this.success(_this.project, nf);
                 /*
+        
                 -- fixme -- needs to be a signal..
                 if (DialogNewComponent.success != null) {
                     DialogNewComponent.success(_this.project, nf);
index 0de1ea2..f140fe7 100644 (file)
@@ -127,7 +127,9 @@ public class Xcls_DialogNewComponent
                 //for (var i in this.file) {
                 //    nf[i] = this.file[i];
                 //}
+                _this.success(_this.project, nf);
                 /*
+        
                 -- fixme -- needs to be a signal..
                 if (DialogNewComponent.success != null) {
                     DialogNewComponent.success(_this.project, nf);