src/Builder4/PopoverEditor.bjs
authorAlan <alan@roojs.com>
Thu, 5 May 2022 02:21:22 +0000 (10:21 +0800)
committerAlan <alan@roojs.com>
Thu, 5 May 2022 02:21:22 +0000 (10:21 +0800)
src/Builder4/PopoverEditor.vala

src/Builder4/PopoverEditor.bjs
src/Builder4/PopoverEditor.vala

index e8c6d2d..b1aae6f 100644 (file)
      ],
      "string id" : "Editor",
      "xtype" : "Box",
-     "|   bool saveContents" : [
-      "  ()  {",
-      "    ",
-      "    ",
-      "    if (_this.file == null) {",
-      "        return true;",
-      "    }",
-      "    ",
-      "    ",
-      "   ",
-      "   ",
-      "     ",
-      "     var str = _this.buffer.toString();",
-      "     ",
-      "     _this.buffer.checkSyntax();",
-      "     ",
-      "     ",
-      "     ",
-      "     // LeftPanel.model.changed(  str , false);",
-      "     _this.dirty = false;",
-      "     _this.save_button.el.sensitive = false;",
-      "     ",
-      "    // find the text for the node..",
-      "    if (_this.file.xtype != \"PlainFile\") {",
-      "        if (ptype == \"listener\") {",
-      "            this.node.listeners.set(key,str);",
-      "        ",
-      "        } else {",
-      "             this.node.props.set(key,str);",
-      "        }",
-      "    } else {",
-      "        _this.file.setSource(  str );",
-      "     }",
-      "    ",
-      "    // call the signal..",
-      "    this.save();",
-      "    ",
-      "    return true;",
-      "",
-      "} "
-     ],
      "| void scroll_to_line" : [
       "(int line) {",
       "",
index f3b429a..e752205 100644 (file)
@@ -236,45 +236,6 @@ public class Xcls_PopoverEditor : Object
         }
 
         // user defined functions
-        public   bool saveContents ()  {
-            
-            
-            if (_this.file == null) {
-                return true;
-            }
-            
-            
-           
-           
-             
-             var str = _this.buffer.toString();
-             
-             _this.buffer.checkSyntax();
-             
-             
-             
-             // LeftPanel.model.changed(  str , false);
-             _this.dirty = false;
-             _this.save_button.el.sensitive = false;
-             
-            // find the text for the node..
-            if (_this.file.xtype != "PlainFile") {
-                if (ptype == "listener") {
-                    this.node.listeners.set(key,str);
-                
-                } else {
-                     this.node.props.set(key,str);
-                }
-            } else {
-                _this.file.setSource(  str );
-             }
-            
-            // call the signal..
-            this.save();
-            
-            return true;
-        
-        }
         public void scroll_to_line (int line) {
         
                GLib.Timeout.add(500, () => {