X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=src%2FBuilder4%2FWindowState.vala;h=08dd43b2dc4b8bf73a75238d7be2d4a031d64088;hb=071e6176bacac9fcc0f47eab7c4b6af448d0a654;hp=dc363e7a37188020ef4390e68d390d4cec2ba07e;hpb=1d29a27b257892e5cc852e04e9da461cc0ab0149;p=app.Builder.js diff --git a/src/Builder4/WindowState.vala b/src/Builder4/WindowState.vala index dc363e7a3..08dd43b2d 100644 --- a/src/Builder4/WindowState.vala +++ b/src/Builder4/WindowState.vala @@ -95,7 +95,7 @@ public class WindowState : Object this.valasource = new Palete.ValaSource(); - this.valasource.compiled.connect(this.valaCompiled); + this.valasource.compiled.connect(this.showCompileResult); this.compile_results = new Xcls_ValaCompileResults(); this.compile_results.window = this.win; @@ -120,6 +120,10 @@ public class WindowState : Object this.left_tree.el.show_all(); this.left_tree.before_node_change.connect(() => { + // if the node change is caused by the editor (code preview) + if (this.left_tree.view.lastEventSource == "editor") { + return true; + } return this.leftTreeBeforeChange(); }); @@ -129,18 +133,18 @@ public class WindowState : Object return; } if (this.file.xtype == "Roo") { - this.window_rooview.sourceview.nodeSelected(sel); + this.window_rooview.sourceview.nodeSelected(sel,true); // foce scroll. } else { this.window_gladeview.sourceview.nodeSelected(sel); } }); - this.left_tree.node_selected.connect((sel) => { - this.leftTreeNodeSelected(sel); + this.left_tree.node_selected.connect((sel, source) => { + this.leftTreeNodeSelected(sel, source); }); this.left_tree.changed.connect(() => { - + print("LEFT TREE: Changed fired\n"); this.file.save(); if (this.left_tree.getActiveFile().xtype == "Roo" ) { this.window_rooview.requestRedraw(); @@ -164,7 +168,7 @@ public class WindowState : Object return false; } - public void leftTreeNodeSelected(JsRender.Node? sel) + public void leftTreeNodeSelected(JsRender.Node? sel, string source) { print("node_selected called %s\n", (sel == null) ? "NULL" : "a value"); @@ -508,6 +512,7 @@ public class WindowState : Object } + // our project properties is different for Roo and Gtk // it would be better to change the above code to use this, public void attachProjectSettings() { @@ -524,9 +529,16 @@ public class WindowState : Object ctr_p.add(this.vala_projectsettings.el); this.vala_projectsettings.el.show_all(); } - - + } + /* + public void fileViewOpenPlain(string fname) + { + + this.switchState (State.CODEONLY); + this.code_editor.showPlainFile(fname); } + */ + // --------- webkit view public void webkitViewInit() { @@ -1123,7 +1135,7 @@ public class WindowState : Object } - public void valaCompiled(Json.Object obj) + public void showCompileResult(Json.Object obj) { // vala has finished compiling... print("vala compiled");