fix popup debug file/line sorting + font size
authorAlan <alan@roojs.com>
Tue, 19 Jul 2022 09:21:32 +0000 (17:21 +0800)
committerAlan <alan@roojs.com>
Tue, 19 Jul 2022 09:21:32 +0000 (17:21 +0800)
src/Builder4/PopoverAddObject.vala
src/Builder4/PopoverProperty.vala
src/Builder4/ValaCompileErrors.bjs
src/Builder4/ValaCompileErrors.vala

index bacdca7..85b5b02 100644 (file)
@@ -17,11 +17,11 @@ public class Xcls_PopoverAddObject : Object
     public Xcls_txtrender txtrender;
 
         // my vars (def)
-    public bool active;
     public signal void before_node_change (JsRender.Node? node);
+    public signal void after_node_change (JsRender.Node? node);
     public signal void drag_end ();
     public Xcls_MainWindow mainwindow;
-    public signal void after_node_change (JsRender.Node? node);
+    public bool active;
 
     // ctor
     public Xcls_PopoverAddObject()
@@ -115,13 +115,13 @@ public class Xcls_PopoverAddObject : Object
         }       
      //   this.hpane.el.set_position( 0);
     }
+    public void clear () {
+     this.model.el.clear();
+    }
     public void hide () {
      
        this.el.hide();
     }
-    public void clear () {
-     this.model.el.clear();
-    }
     public class Xcls_ScrolledWindow2 : Object
     {
         public Gtk.ScrolledWindow el;
@@ -286,7 +286,7 @@ public class Xcls_PopoverAddObject : Object
         {
             _this = _owner;
             _this.model = this;
-            this.el = new Gtk.ListStore( 3, typeof(string),typeof(string),typeof(Gdk.Pixbuf) );
+            this.el = new Gtk.ListStore.newv(  { typeof(string),typeof(string),typeof(Gdk.Pixbuf) }  );
 
             // my vars (dec)
 
index 87f502d..d72fa93 100644 (file)
@@ -22,14 +22,14 @@ public class Xcls_PopoverProperty : Object
     public Xcls_buttonbar buttonbar;
 
         // my vars (def)
-    public string old_keyname;
     public bool is_new;
     public signal void success (Project.Project pr, JsRender.JsRender file);
-    public bool done;
-    public JsRender.NodeProp? prop;
-    public Xcls_MainWindow mainwindow;
     public string key_type;
+    public JsRender.NodeProp? prop;
     public JsRender.Node node;
+    public Xcls_MainWindow mainwindow;
+    public bool done;
+    public string old_keyname;
 
     // ctor
     public Xcls_PopoverProperty()
@@ -39,8 +39,8 @@ public class Xcls_PopoverProperty : Object
 
         // my vars (dec)
         this.is_new = false;
-        this.done = false;
         this.mainwindow = null;
+        this.done = false;
 
         // set gobject values
         this.el.border_width = 0;
@@ -48,7 +48,7 @@ public class Xcls_PopoverProperty : Object
         this.el.position = Gtk.PositionType.LEFT;
         var child_0 = new Xcls_Box2( _this );
         child_0.ref();
-        this.el.add (  child_0.el  );
+        this.el.add(  child_0.el );
 
         //listeners
         this.el.closed.connect( () => {
@@ -103,6 +103,19 @@ public class Xcls_PopoverProperty : Object
     }
 
     // user defined functions
+    public void updateProp () {
+     
+       Gtk.TreeIter citer;
+       GLib.Value gval;
+       this.kflag.el.get_active_iter(out citer);
+       this.dbmodel.el.get_value(citer, 0, out  gval);
+    
+    
+       _this.prop.name = this.kname.el.get_text().strip(); 
+       _this.prop.rtype = this.ktype.el.get_text().strip(); 
+       _this.prop.ptype =  (JsRender.NodePropType) gval;
+    
+    }
     public void show (
        Gtk.Widget btn, 
        JsRender.Node node, 
@@ -160,19 +173,6 @@ public class Xcls_PopoverProperty : Object
     
        //this.success = c.success;
      
-    }
-    public void updateProp () {
-     
-       Gtk.TreeIter citer;
-       GLib.Value gval;
-       this.kflag.el.get_active_iter(out citer);
-       this.dbmodel.el.get_value(citer, 0, out  gval);
-    
-    
-       _this.prop.name = this.kname.el.get_text().strip(); 
-       _this.prop.rtype = this.ktype.el.get_text().strip(); 
-       _this.prop.ptype =  (JsRender.NodePropType) gval;
-    
     }
     public class Xcls_Box2 : Object
     {
@@ -340,7 +340,7 @@ public class Xcls_PopoverProperty : Object
         {
             _this = _owner;
             _this.dbmodel = this;
-            this.el = new Gtk.ListStore( 2, typeof(JsRender.NodePropType),typeof(string) );
+            this.el = new Gtk.ListStore.newv(  { typeof(JsRender.NodePropType),typeof(string) }  );
 
             // my vars (dec)
 
index db659cd..f91ee75 100644 (file)
@@ -53,7 +53,7 @@
          "* init" : [
           "{",
           " var description = new Pango.FontDescription();",
-          "    description.set_size(8000);",
+          "    description.set_size(10000);",
           "    this.el.override_font(description);",
           "",
           "}",
           {
            "$ xns" : "Gtk",
            "* pack" : "set_model",
-           "columns" : "  typeof(string), typeof(int), typeof(string), typeof(string) ",
+           "columns" : [
+            "  typeof(string), ",
+            "  typeof(int),",
+            "   typeof(string),",
+            "    typeof(string) "
+           ],
            "gint n_columns" : 4,
            "id" : "compile_result_store",
            "xtype" : "TreeStore"
     "        store.append(out iter, null);",
     "        var lines = tree.get_object_member(file);",
     "        title += \" (\" + lines.get_size().to_string() + \")\";",
-    "        store.set(iter, 0, file, 1, -1, 2, title, 3, file,-1);",
+    "        store.set(iter, ",
+    "        \t0, file, ",
+    "        \t1, -1, ",
+    "        \t2, title, ",
+    "        \t3, file,",
+    "    \t-1);",
     "        ",
     "        lines.foreach_member((obja, line, nodea) => {",
     "            var msg  = \"\";",
     "            var ar = lines.get_array_member(line);",
     "            for (var i = 0 ; i < ar.get_length(); i++) {",
-    "\t\t    msg += (msg.length > 0) ? \"\\n\" : \"\";",
-    "\t\t    msg += ar.get_string_element(i);",
-    "        }",
-    "            Gtk.TreeIter citer;  ",
-    "            print(\"Add line %s\", line);",
-    "            store.append(out citer, iter);",
-    "            store.set(citer, ",
-    "                0, file + \":\" + line, ",
-    "                1, int.parse(line), ",
-    "                2, GLib.Markup.escape_text(line + \": \" + msg), ",
-    "                3, file,-1);",
+    "\t\t\t\tmsg += (msg.length > 0) ? \"\\n\" : \"\";",
+    "\t\t\t\tmsg += ar.get_string_element(i);",
+    "\t\t    }",
+    "\t\t    Gtk.TreeIter citer;  ",
+    "\t\t    print(\"Add line %s\", line);",
+    "\t\t    store.append(out citer, iter);",
+    "\t\t    store.set(citer, ",
+    "\t\t            0, file + \":\" + line, ",
+    "\t\t            1, int.parse(line), ",
+    "\t\t            2, GLib.Markup.escape_text(line + \": \" + msg), ",
+    "\t\t            3, file, ",
+    "\t\t            -1);",
     "        ",
     "        });",
     "        ",
     "        ",
     "    ",
     "    });",
+    "      ",
+    "    store.set_sort_column_id(0,Gtk.SortType.ASCENDING);",
+    "",
     "        ",
     "    int w,h;",
     "    this.window.el.get_size(out w, out h);",
index 3ec52b4..b0f05c4 100644 (file)
@@ -69,29 +69,38 @@ public class Xcls_ValaCompileErrors : Object
             store.append(out iter, null);
             var lines = tree.get_object_member(file);
             title += " (" + lines.get_size().to_string() + ")";
-            store.set(iter, 0, file, 1, -1, 2, title, 3, file,-1);
+            store.set(iter, 
+               0, file, 
+               1, -1, 
+               2, title, 
+               3, file,
+               -1);
             
             lines.foreach_member((obja, line, nodea) => {
                 var msg  = "";
                 var ar = lines.get_array_member(line);
                 for (var i = 0 ; i < ar.get_length(); i++) {
-                   msg += (msg.length > 0) ? "\n" : "";
-                   msg += ar.get_string_element(i);
-            }
-                Gtk.TreeIter citer;  
-                print("Add line %s", line);
-                store.append(out citer, iter);
-                store.set(citer, 
-                    0, file + ":" + line, 
-                    1, int.parse(line), 
-                    2, GLib.Markup.escape_text(line + ": " + msg), 
-                    3, file,-1);
+                               msg += (msg.length > 0) ? "\n" : "";
+                               msg += ar.get_string_element(i);
+                   }
+                   Gtk.TreeIter citer;  
+                   print("Add line %s", line);
+                   store.append(out citer, iter);
+                   store.set(citer, 
+                           0, file + ":" + line, 
+                           1, int.parse(line), 
+                           2, GLib.Markup.escape_text(line + ": " + msg), 
+                           3, file, 
+                           -1);
             
             });
             
             
         
         });
+          
+        store.set_sort_column_id(0,Gtk.SortType.ASCENDING);
+    
             
         int w,h;
         this.window.el.get_size(out w, out h);
@@ -256,7 +265,7 @@ public class Xcls_ValaCompileErrors : Object
 
             {
              var description = new Pango.FontDescription();
-                description.set_size(8000);
+                description.set_size(10000);
                 this.el.override_font(description);
             
             }
@@ -345,7 +354,10 @@ public class Xcls_ValaCompileErrors : Object
         {
             _this = _owner;
             _this.compile_result_store = this;
-            this.el = new Gtk.TreeStore.newv(  {   typeof(string), typeof(int), typeof(string), typeof(string)  }  );
+            this.el = new Gtk.TreeStore.newv(  {   typeof(string), 
+  typeof(int),
+   typeof(string),
+    typeof(string)  }  );
 
             // my vars (dec)