Builder4/DialogNewComponent.bjs
authorAlan Knowles <alan@roojs.com>
Tue, 10 Jun 2014 10:57:43 +0000 (18:57 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 10 Jun 2014 10:57:43 +0000 (18:57 +0800)
Builder4/DialogNewComponent.js
Builder4/DialogNewComponent.vala

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

index 497f395..df51965 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 (DialogNewComponent.name.el.get_text().length  < 1) {\n            StandardErrorDialog.show(\n                \"You have to set Project name \"\n            );\n             \n            return;\n        }\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        // 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 ='';\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.file_test (GLib.dir + \"/\" + 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        if (DialogNewComponent.success != null) {\n            DialogNewComponent.success(_this.project, nf);\n        }\n}",
+                "response": "  (self, response_id) =>  {\n  \n\tif (response_id < 1) { // cancel!\n            this.el.hide();\n            return;\n        }\n\n        if (DialogNewComponent.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\t//var dir ='';\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.file_test (GLib.dir + \"/\" + 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        if (DialogNewComponent.success != null) {\n            DialogNewComponent.success(_this.project, nf);\n        }\n}",
                 "show": "(self)  => {\n  this.el.show_all();\n}"
             },
             ".Project.Project:project": "",
index f0aec3e..ccf3e27 100644 (file)
@@ -30,7 +30,8 @@ DialogNewComponent=new XObject({
                      
                     return;
                 }
-                
+                // what does this do?
+                /*
                 var isNew = _this.file.name.length  > 0 ? false : true;
                 
                 if (this.file.name.length > 0 && this.file.name != _this.name.el.get_text()) {
@@ -40,19 +41,20 @@ DialogNewComponent=new XObject({
                      
                     return;
                 }
+                */
                 // FIXME - this may be more complicated...
                 //for (var i in this.def) {
                 //    this.file[i] =  this.get(i).el.get_text();
                 //}
-               
+               /*
                 if (!isNew) {
                     this.file.save();
                     this.el.hide();
                     return;
                 }
-               
+               */
             
-               var dir ='';
+               //var dir ='';
                //FIXME...
                 //for (var i in this.project.paths) {
                //      dir = i;
index a662008..4e59914 100644 (file)
@@ -75,7 +75,8 @@ public class Xcls_DialogNewComponent
                      
                     return;
                 }
-                
+                // what does this do?
+                /*
                 var isNew = _this.file.name.length  > 0 ? false : true;
                 
                 if (this.file.name.length > 0 && this.file.name != _this.name.el.get_text()) {
@@ -85,19 +86,20 @@ public class Xcls_DialogNewComponent
                      
                     return;
                 }
+                */
                 // FIXME - this may be more complicated...
                 //for (var i in this.def) {
                 //    this.file[i] =  this.get(i).el.get_text();
                 //}
-               
+               /*
                 if (!isNew) {
                     this.file.save();
                     this.el.hide();
                     return;
                 }
-               
+               */
             
-               var dir ='';
+               //var dir ='';
                //FIXME...
                 //for (var i in this.project.paths) {
                //      dir = i;