From 597501a805771da231dbd77e795d0cd949c3f51f Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Sun, 21 Jan 2024 01:23:29 +0800 Subject: [PATCH] fix merges --- src/Builder4/DialogConfirm.bjs | 1 + src/Builder4/DialogConfirm.vala | 105 ++++++++++++----------- src/Builder4/DialogFiles.bjs | 11 ++- src/Builder4/DialogFiles.vala | 8 +- src/Builder4/Editor.bjs | 2 - src/Builder4/Editor.vala | 2 - src/JsRender/Node.vala | 14 ++- src/JsRender/NodeProp.vala | 1 - src/Palete/LanguageClientJavascript.vala | 13 ++- src/Spawn.vala | 6 +- 10 files changed, 86 insertions(+), 77 deletions(-) diff --git a/src/Builder4/DialogConfirm.bjs b/src/Builder4/DialogConfirm.bjs index ac02d27dd..045bf892d 100644 --- a/src/Builder4/DialogConfirm.bjs +++ b/src/Builder4/DialogConfirm.bjs @@ -15,6 +15,7 @@ " this.el.response(Gtk.ResponseType.CANCEL);", " this.el.hide();", " return true;", + " ", "}", "" ] diff --git a/src/Builder4/DialogConfirm.vala b/src/Builder4/DialogConfirm.vala index 7a9bdb956..dfb48adfd 100644 --- a/src/Builder4/DialogConfirm.vala +++ b/src/Builder4/DialogConfirm.vala @@ -1,52 +1,53 @@ -static DialogConfirm _DialogConfirm; - -public class DialogConfirm : Object -{ - public Gtk.MessageDialog el; - private DialogConfirm _this; - - public static DialogConfirm singleton() - { - if (_DialogConfirm == null) { - _DialogConfirm= new DialogConfirm(); - } - return _DialogConfirm; - } - - // my vars (def) - - // ctor - public DialogConfirm() - { - _this = this; - this.el = new Gtk.MessageDialog( null, Gtk.DialogFlags.MODAL, Gtk.MessageType.QUESTION, Gtk.ButtonsType.YES_NO, "Test" ); - - // my vars (dec) - - // set gobject values - this.el.title = "Please Confirm "; - this.el.name = "DialogConfirm"; - this.el.modal = true; - this.el.use_markup = true; - - //listeners - this.el.close_request.connect( (event) => { - this.el.response(Gtk.ResponseType.CANCEL); - this.el.hide(); - return true; - }); - } - - // user defined functions - public void showIt // caller needs to connect to the response - to get the result. - - (string title, string msg) { - //if (!this.el) { this.init(); } - //this.success = success; - this.el.title = title; - this.el.text = msg; - this.el.show(); - - - } -} + static DialogConfirm _DialogConfirm; + + public class DialogConfirm : Object + { + public Gtk.MessageDialog el; + private DialogConfirm _this; + + public static DialogConfirm singleton() + { + if (_DialogConfirm == null) { + _DialogConfirm= new DialogConfirm(); + } + return _DialogConfirm; + } + + // my vars (def) + + // ctor + public DialogConfirm() + { + _this = this; + this.el = new Gtk.MessageDialog( null, Gtk.DialogFlags.MODAL, Gtk.MessageType.QUESTION, Gtk.ButtonsType.YES_NO, "Test" ); + + // my vars (dec) + + // set gobject values + this.el.title = "Please Confirm "; + this.el.name = "DialogConfirm"; + this.el.modal = true; + this.el.use_markup = true; + + //listeners + this.el.close_request.connect( (event) => { + this.el.response(Gtk.ResponseType.CANCEL); + this.el.hide(); + return true; + + }); + } + + // user defined functions + public void showIt // caller needs to connect to the response - to get the result. + + (string title, string msg) { + //if (!this.el) { this.init(); } + //this.success = success; + this.el.title = title; + this.el.text = msg; + this.el.show(); + + + } + } diff --git a/src/Builder4/DialogFiles.bjs b/src/Builder4/DialogFiles.bjs index bc2d2975e..83b43dbec 100644 --- a/src/Builder4/DialogFiles.bjs +++ b/src/Builder4/DialogFiles.bjs @@ -1,4 +1,4 @@ -g{ +{ "build_module" : "builder", "gen_extended" : false, "items" : [ @@ -1184,8 +1184,11 @@ g{ "| void load" : [ "() {", " // cl list...", - " ", + " ", + " ", " _this.is_loading = true;", + " ", + "", " Project.Project.loadAll();", " _this.project_list.el.set_model(new Gtk.SingleSelection(null));", " Project.Project.loadIntoStore(this.projectmodel.el);", @@ -1196,6 +1199,8 @@ g{ " ", " _this.projectselection.el.selected = Gtk.INVALID_LIST_POSITION; ", "\t_this.btn_delfile.el.hide();", + " ", + " ", "}", "" ], @@ -1311,4 +1316,4 @@ g{ } ], "name" : "DialogFiles" -} +} \ No newline at end of file diff --git a/src/Builder4/DialogFiles.vala b/src/Builder4/DialogFiles.vala index 5035a6bc7..346b64f2f 100644 --- a/src/Builder4/DialogFiles.vala +++ b/src/Builder4/DialogFiles.vala @@ -177,9 +177,11 @@ public class DialogFiles : Object }// public void load () { // cl list... - + + _this.is_loading = true; - + + Project.Project.loadAll(); _this.project_list.el.set_model(new Gtk.SingleSelection(null)); Project.Project.loadIntoStore(this.projectmodel.el); @@ -190,6 +192,8 @@ public class DialogFiles : Object _this.projectselection.el.selected = Gtk.INVALID_LIST_POSITION; _this.btn_delfile.el.hide(); + + } public class Xcls_Box2 : Object { diff --git a/src/Builder4/Editor.bjs b/src/Builder4/Editor.bjs index 16e7df708..b1a00f997 100644 --- a/src/Builder4/Editor.bjs +++ b/src/Builder4/Editor.bjs @@ -309,9 +309,7 @@ "\tvar oldcode = _this.prop.val;", "\t", "\t_this.prop.val = str;", - "\t_this.node.updated_count++;", " _this.file.getLanguageServer().document_change(_this.file);", - " _this.node.updated_count++;", " _this.prop.val = oldcode;", " ", " ", diff --git a/src/Builder4/Editor.vala b/src/Builder4/Editor.vala index 2b47e9135..845175e2d 100644 --- a/src/Builder4/Editor.vala +++ b/src/Builder4/Editor.vala @@ -885,9 +885,7 @@ public class Editor : Object var oldcode = _this.prop.val; _this.prop.val = str; - _this.node.updated_count++; _this.file.getLanguageServer().document_change(_this.file); - _this.node.updated_count++; _this.prop.val = oldcode; diff --git a/src/JsRender/Node.vala b/src/JsRender/Node.vala index de6cba3af..497c435d4 100644 --- a/src/JsRender/Node.vala +++ b/src/JsRender/Node.vala @@ -731,36 +731,32 @@ public class JsRender.Node : GLib.Object { switch(prop.ptype) { case PROP: case RAW: // should they be the same? - + props += "\n\t" + GLib.Markup.escape_text(prop.rtype) + " " + GLib.Markup.escape_text(i) +" : " + - GLib.Markup.escape_text(val == "" ? "" : val.split("\n")[0]); + GLib.Markup.escape_text(val.split("\n")[0]); break; case METHOD : - funcs += "\n\t" + GLib.Markup.escape_text(prop.rtype) + " " + GLib.Markup.escape_text(i) +" : " + - GLib.Markup.escape_text(val == "" ? "" : val.split("\n")[0]); + GLib.Markup.escape_text(val.split("\n")[0]); break; case USER : // user defined. - uprops += "\n\t" + GLib.Markup.escape_text(i) +" : " + - GLib.Markup.escape_text(val == "" ? "" : val.split("\n")[0]); + GLib.Markup.escape_text(val.split("\n")[0]); break; case SPECIAL : // * prop| args | ctor | init - - spec += "\n\t" + GLib.Markup.escape_text(i) +" : " + - GLib.Markup.escape_text(val == "" ? "" : val.split("\n")[0]); + GLib.Markup.escape_text(val.split("\n")[0]); break; case LISTENER : return ""; // always raw... diff --git a/src/JsRender/NodeProp.vala b/src/JsRender/NodeProp.vala index 1cf7d32b5..9350212ab 100644 --- a/src/JsRender/NodeProp.vala +++ b/src/JsRender/NodeProp.vala @@ -215,7 +215,6 @@ public class JsRender.NodeProp : Object { this.rtype = rtype; this.val = val; this.childstore = new GLib.ListStore( typeof(NodeProp)); - } diff --git a/src/Palete/LanguageClientJavascript.vala b/src/Palete/LanguageClientJavascript.vala index 19371a4ae..87303aa68 100644 --- a/src/Palete/LanguageClientJavascript.vala +++ b/src/Palete/LanguageClientJavascript.vala @@ -16,7 +16,18 @@ namespace Palete { public override void startServer() { } - + string generateTempContents(JsRender.JsRender file, JsRender.NodeProp? prop, string alt_code) { + + var oldcode = ""; + var contents = alt_code; + if (prop != null) { + oldcode = prop.val; + prop.val = alt_code; + contents = file.toSourceCode(); + prop.val = oldcode; + } + return contents; + } diff --git a/src/Spawn.vala b/src/Spawn.vala index 7b63163e1..cac96f388 100644 --- a/src/Spawn.vala +++ b/src/Spawn.vala @@ -164,7 +164,7 @@ public class Spawn : Object Process.spawn_async ( this.cwd, this.args, - this.env.length > 0 ? this.env : GLib.Environ.get (), + this.env.length > 0 ? this.env : null, SpawnFlags.SEARCH_PATH | SpawnFlags.DO_NOT_REAP_CHILD, null, out pid); @@ -234,10 +234,6 @@ public class Spawn : Object this.ctx.quit(); this.ctx = null; } - // since it's closed - we might not need to remove the watches? - - this.err_src = -1; - this.out_src = -1; this.tidyup(); GLib.debug("DONE TIDYUP - calling complete"); -- 2.39.2