src/Builder4/WindowRooView.bjs
authorAlan Knowles <alan@roojs.com>
Tue, 7 Jun 2016 07:42:30 +0000 (15:42 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 7 Jun 2016 07:42:30 +0000 (15:42 +0800)
src/Builder4/WindowRooView.vala

src/Builder4/WindowRooView.bjs
src/Builder4/WindowRooView.vala

index d9847bc..07ddd92 100644 (file)
            "listeners" : {
             "changed" : " () => {\n    // check syntax??\n    // ??needed..??\n   // _this.save_button.el.sensitive = true;\n    ///?? has changed occured during loading?\n    if (_this.sourceview.loading) {\n\t\treturn;\n\t}\n\t\n    print(\"- PREVIEW EDITOR CHANGED--\");\n    \n    \n    //this.checkSyntax();\n   \n    this.dirty = true;\n\n\n    return ;\n}\n\n \n"
            },
-           "bool check_queued" : false,
            "bool dirty" : false,
            "id" : "buffer",
            "int error_line" : "-1",
            "|   bool checkSyntax" : " () {\n \n    if (this.check_running) {\n        print(\"Check is running\\n\");\n        if (this.check_queued) { \n            print(\"Check is already queued\");\n            return true;\n        }\n        this.check_queued = true;\n        print(\"Adding queued Check \");\n        GLib.Timeout.add_seconds(1, () => {\n            this.check_queued = false;\n            \n            this.checkSyntax();\n            return false;\n        });\n    \n\n        return true;\n    }\n    var str = this.toString();\n    \n    // needed???\n    if (this.error_line > 0) {\n         Gtk.TextIter start;\n         Gtk.TextIter end;     \n        this.el.get_bounds (out start, out end);\n\n        this.el.remove_source_marks (start, end, null);\n    }\n    if (str.length < 1) {\n        print(\"checkSyntax - empty string?\\n\");\n        return true;\n    }\n    \n    if (_this.file.xtype == \"PlainFile\") {\n    \n        // assume it's gtk...\n           this.check_running = true;\n /*\n         if (!_this.window.windowstate.valasource.checkPlainFileSpawn(\n\t   _this.file,\n\t    str\n\t )) {\n            this.check_running = false;\n        }\n\t*/\n        return true;\n    \n    }\n   if (_this.file == null) {\n       return true;\n   }\n    var p = Palete.factory(_this.file.xtype);   \n    \n\n     \n    this.check_running = true;\n    \n    \n    if (_this.file.language == \"js\") {\n        this.check_running = false;\n        print(\"calling validate javascript\\n\"); \n      /*  return this.highlightErrors(p.validateJavascript(\n            str, \n             _this.key, \n            _this.ptype,\n            _this.file,\n            _this.node\n        ));    \n        */\n    }\n        \n        \n    print(\"calling validate vala\\n\");    \n    // clear the buttons.\n \n    /*\n   if (! _this.window.windowstate.valasource.checkFileWithNodePropChange(\n        _this.file,\n        _this.node,\n         _this.key,        \n         _this.ptype,\n            str\n        )) {\n        this.check_running = false;\n    } \n     \n    */\n    \n    //print(\"done mark line\\n\");\n     \n    return true; // at present allow saving - even if it's invalid..\n}\n",
            "* pack" : "set_buffer",
            "xtype" : "SourceBuffer",
-           "bool check_running" : false,
            "$ xns" : "Gtk"
           }
          ]
index 49a0d20..880316c 100644 (file)
@@ -1345,10 +1345,8 @@ public class Xcls_WindowRooView : Object
 
 
             // my vars (def)
-        public bool check_queued;
         public bool dirty;
         public int error_line;
-        public bool check_running;
 
         // ctor
         public Xcls_buffer(Xcls_WindowRooView _owner )
@@ -1358,10 +1356,8 @@ public class Xcls_WindowRooView : Object
             this.el = new Gtk.SourceBuffer( null );
 
             // my vars (dec)
-            this.check_queued = false;
             this.dirty = false;
             this.error_line = -1;
-            this.check_running = false;
 
             // set gobject values