src/Builder4/Editor.bjs
authorAlan Knowles <alan@roojs.com>
Thu, 21 May 2015 07:12:38 +0000 (15:12 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 21 May 2015 07:12:38 +0000 (15:12 +0800)
src/Builder4/Editor.vala

src/Builder4/Editor.bjs
src/Builder4/Editor.vala

index 78200e7..eda35c5 100644 (file)
@@ -10,7 +10,7 @@
   {
    "# Xcls_MainWindow window" : "null",
    "# string activeEditor" : "\"\"",
-   "|   bool saveContents" : "  ()  {\n    \n    \n    \n    \n    \n    \n    \n   \n     \n     var str = _this.buffer.toString();\n     \n      \n     \n     \n     if (!_this.buffer.checkSyntax()) {\n         print(\"check syntax failed\");\n         //this.get('/StandardErrorDialog').show(\"Fix errors in code and save..\"); \n         //return false;\n     }\n     \n     // LeftPanel.model.changed(  str , false);\n     _this.dirty = false;\n     _this.save_button.el.sensitive = false;\n     \n     \n        \n     \n    // find the text for the node..\n    if (ptype == \"listener\") {\n        this.node.listeners.set(key,str);\n    \n    } else {\n         this.node.props.set(key,str);\n    }\n\n     \n    \n    // call the signal..\n    this.save();\n    \n    return true;\n\n} ",
+   "|   bool saveContents" : "  ()  {\n    \n    \n    if (_this.file == null) {\n        return;\n    }\n    \n    \n    \n    \n   \n     \n     var str = _this.buffer.toString();\n     \n      \n     \n     \n     if (!_this.buffer.checkSyntax()) {\n         print(\"check syntax failed\");\n         //this.get('/StandardErrorDialog').show(\"Fix errors in code and save..\"); \n         //return false;\n     }\n     \n     // LeftPanel.model.changed(  str , false);\n     _this.dirty = false;\n     _this.save_button.el.sensitive = false;\n     \n     \n        \n     \n    // find the text for the node..\n    if (ptype == \"listener\") {\n        this.node.listeners.set(key,str);\n    \n    } else {\n         this.node.props.set(key,str);\n    }\n\n     \n    \n    // call the signal..\n    this.save();\n    \n    return true;\n\n} ",
    "# int pos_root_x" : "",
    "# int pos_root_y" : "",
    "# string ptype" : "\"\"",
index 9aeef65..740f4da 100644 (file)
@@ -63,7 +63,9 @@ public class Editor : Object
     public   bool saveContents ()  {
         
         
-        
+        if (_this.file == null) {
+            return;
+        }