fix merge
authorAlan Knowles <alan@roojs.com>
Sat, 20 Jan 2024 16:57:40 +0000 (00:57 +0800)
committerAlan Knowles <alan@roojs.com>
Sat, 20 Jan 2024 16:57:40 +0000 (00:57 +0800)
src/Builder4/DialogConfirm.bjs
src/Builder4/DialogConfirm.vala
src/Builder4/DialogFiles.bjs
src/Builder4/DialogFiles.vala
src/JsRender/Node.vala
src/Spawn.vala

index 045bf89..ac02d27 100644 (file)
@@ -15,7 +15,6 @@
      "   this.el.response(Gtk.ResponseType.CANCEL);",
      "    this.el.hide();",
      "    return true;",
-     " ",
      "}",
      ""
     ]
index dfb48ad..7a9bdb9 100644 (file)
@@ -1,53 +1,52 @@
-    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();
+          
+          
+       }
+}
index 224aafb..c7412a0 100644 (file)
    "| 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);",
     "    ",
     "    _this.projectselection.el.selected = Gtk.INVALID_LIST_POSITION; ",
     "\t_this.btn_delfile.el.hide();",
-    " ",
-    "  ",
     "}",
     ""
    ],
   }
  ],
  "name" : "DialogFiles"
-}
\ No newline at end of file
+}
index ede09f4..34294b2 100644 (file)
@@ -177,11 +177,9 @@ 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);
@@ -192,8 +190,6 @@ public class DialogFiles : Object
            
            _this.projectselection.el.selected = Gtk.INVALID_LIST_POSITION; 
                _this.btn_delfile.el.hide();
-        
-         
        }
        public class Xcls_Box2 : Object
        {
index 324f048..0f91ab8 100644 (file)
@@ -728,32 +728,36 @@ 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) +
                                                " <b>" + GLib.Markup.escape_text(i) +"</b> : " + 
-                                               GLib.Markup.escape_text(val.split("\n")[0]);
+                                               GLib.Markup.escape_text(val == "" ? "" : val.split("\n")[0]);
                                                
                                        break;
                                        
                        
                                
                                case METHOD :
+                                        
                                        funcs += "\n\t" + GLib.Markup.escape_text(prop.rtype) +
                                                " <b>" + GLib.Markup.escape_text(i) +"</b> : "  +
-                                               GLib.Markup.escape_text(val.split("\n")[0]);
+                                               GLib.Markup.escape_text(val == "" ? "" : val.split("\n")[0]);
                                        break;
                                        
                                 
                                case USER : // user defined.
+                                        
                                        uprops += "\n\t<b>" + 
                                                GLib.Markup.escape_text(i) +"</b> : " + 
-                                               GLib.Markup.escape_text(val.split("\n")[0]);
+                                               GLib.Markup.escape_text(val == "" ? "" : val.split("\n")[0]);
                                        break;
                                        
                                case SPECIAL : // * prop| args | ctor | init
+                                        
+                                               
                                        spec += "\n\t<b>" + 
                                                GLib.Markup.escape_text(i) +"</b> : " + 
-                                               GLib.Markup.escape_text(val.split("\n")[0]);
+                                               GLib.Markup.escape_text(val == "" ? "" : val.split("\n")[0]);
                                        break;
                                        
                                case LISTENER : return  "";  // always raw...
index dac2877..b4c4c20 100644 (file)
@@ -164,7 +164,7 @@ public class Spawn : Object
                        Process.spawn_async (   
                                this.cwd,
                                this.args,
-                               this.env.length > 0 ? this.env : null,
+                               this.env.length > 0 ? this.env : GLib.Environ.get (),
                                SpawnFlags.SEARCH_PATH | SpawnFlags.DO_NOT_REAP_CHILD,
                                null,
                                out pid);
@@ -234,6 +234,10 @@ 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");