X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=src%2FBuilder4%2FValaCompileErrors.bjs;h=5e4aeb35cae32c6ae56456af6e28b91842155d90;hb=67b4cca903e02417c1802b41c2fd8bb0da45c3e0;hp=3bf4b5583091a2f31bd06f351a65087a55516054;hpb=9455f25b400cc03a63b56f9fbfdea67776af7c95;p=roobuilder diff --git a/src/Builder4/ValaCompileErrors.bjs b/src/Builder4/ValaCompileErrors.bjs index 3bf4b5583..5e4aeb35c 100644 --- a/src/Builder4/ValaCompileErrors.bjs +++ b/src/Builder4/ValaCompileErrors.bjs @@ -3,12 +3,12 @@ "gen_extended" : false, "items" : [ { - "# GLib.ListStore notices" : "", "# Xcls_MainWindow window" : "", "$ xns" : "Gtk", "* ctor" : "new Gtk.Popover()", "Gtk.PositionType position" : "Gtk.PositionType.TOP", "bool autohide" : true, + "bool loaded" : false, "id" : "ValaCompileErrors", "int height_request" : 800, "int width_request" : 900, @@ -69,6 +69,27 @@ "* prop" : "model", "id" : "model", "xtype" : "TreeListModel" + }, + { + "$ xns" : "Gtk", + "* prop" : "sorter", + "items" : [ + { + "$ xns" : "Gtk", + "* prop" : "sorter", + "items" : [ + { + "$ xns" : "Gtk", + "* prop" : "expression", + "GLib.Type this_type" : "typeof(Palete.CompileError)", + "string property_name" : "linemsg", + "xtype" : "PropertyExpression" + } + ], + "xtype" : "StringSorter" + } + ], + "xtype" : "TreeListRowSorter" } ], "xtype" : "SortListModel", @@ -133,16 +154,20 @@ "\t", "\t", "\t//GLib.debug(\"change %s to %s\", lbl.label, np.name);", - "\tlbl.label = np.line_msg;", + "\tlbl.label = np.linemsg;", "\t//lbl.tooltip_markup = np.to_property_option_tooltip();", "\t ", " expand.set_hide_expander( np.lines.n_items < 1);", "\texpand.set_list_row(lr);", " ", " \t// expand current file.", - " \tif (_this.window.windowstate.file.path == np.file.path) {", - " \t\tlr.expanded = true;", - "\t}", + " \t// this causes problems? - critical errors?", + " \t// maybe do it on show", + " \t//if (_this.window.windowstate.file.path == np.file.path &&", + " \t//\tnp.line < 0) {", + " \t//\tlr.expanded = true;", + " \t", + "\t//}", " \t ", " \t// bind image...", " \t", @@ -201,9 +226,9 @@ "\t}", "\t ", "\t ", - " var fname = ce.parent.file;", + " var fname = ce.file;", " \tvar line = ce.line; ", - " GLib.debug(\"open %s @ %d\\n\", ce.parent.file.path, ce.line);", + " GLib.debug(\"open %s @ %d\\n\", ce.file.path, ce.line);", " ", " ", " var bjsf = \"\";", @@ -224,21 +249,19 @@ " _this.window.windowstate.fileViewOpen(jsr, true, line);", " ", " if (jsr.path == _this.window.windowstate.file.path) {", - " \t_this.el.hide();", - " \t}", " ", + " \t}", + " \t_this.el.hide();", " ", " return;", " ", " }", - " try {", - "\t\tvar pf = JsRender.JsRender.factory(\"PlainFile\", p, fname.path);", - "\t\t_this.window.windowstate.fileViewOpen(pf, true, line);", - " } catch (JsRender.Error e) {}", - " // try hiding the left nav..", - " ", - " return;", + " ", + "\tvar pf = p.getByPath(fname.path);", + "\t_this.el.hide();", + "\t_this.window.windowstate.fileViewOpen(pf, true, line);", "", + " ", "}", "" ] @@ -258,18 +281,22 @@ ], "xtype" : "Popover", "| void show" : [ - "( GLib.ListStore ls , Gtk.Widget onbtn) {", - "", - " ", + "( ) {", + "\tGLib.debug(\"errors : show\");", + "\t", + "\tif (_this.model.el.get_n_items() < 1) {", + " ", + " \t GLib.debug(\"errors : none available\");", + " \treturn;", + "\t}", " \t//this.el.present();", " //this.el.popup();", - " this.notices = ls;", - " ", + " ", " //print(\"looking for %s\\n\", id);", " // loop through parent childnre", " ", " ", - " this.tree.el.hide(); //<< very important!!!", + " ; //<< very important!!!", " ", " // store.set_sort_column_id(0,Gtk.SortType.ASCENDING);", " ", @@ -277,8 +304,7 @@ " var w = win.get_width();", " var h = win.get_height();", "", - " ", - " ", + " ", " // left tree = 250, editor area = 500?", " ", " // min 450?", @@ -286,6 +312,7 @@ " if (new_w > (w-100)) {", " new_w = w-100;", " }", + " GLib.debug(\"set size\");", " this.el.set_size_request( int.max(100, new_w), int.max(100, h-120));", " ", "", @@ -293,10 +320,36 @@ "\t//Gtk.Allocation rect;", "\t//onbtn.get_allocation(out rect);", " //this.el.set_pointing_to(rect);", - "\tthis.el.present();", + "\t//this.el.present();", + "\t", + "\tGLib.debug(\"call popup\");", " this.el.popup();", + " // only need to load once.", + " \t//if (!this.loaded) {", + " \t\t ", + "\t\t//this.loaded = true;", + "\t //}", + "\t ", + " ", " ", - " ", + " \t//if (expand != null) {", + " //\t_this.compile_tree.el.expand_row( store.get_path(expand) , true);", + "//\t}", + " ", + " // this.hpane.el.set_position( 0);", + "}", + "" + ], + "| void updateNotices" : [ + "( GLib.ListStore? ls) {", + "\tGLib.debug(\"errors : update\");", + " if (ls == null || ls.get_n_items() < 1) {", + " \t GLib.debug(\"errors : none available\");", + " \treturn;", + "\t}", + "\t", + "\tGLib.debug(\"Loading list into tree\");", + "\tthis.tree.el.hide();", "\tvar tm = new Gtk.TreeListModel(", "\t\tls, //..... << that's our store..", "\t\tfalse, // passthru", @@ -306,20 +359,13 @@ "\t\t\t return ((Palete.CompileError)item).lines;", "\t\t", "\t\t}", + "\t\t", "\t);", " ", - " _this.model.el = tm;", - " _this.sortmodel.el.set_model(tm);", - " ", - " this.tree.el.show(); ", - " ", - " \t//if (expand != null) {", - " //\t_this.compile_tree.el.expand_row( store.get_path(expand) , true);", - "//\t}", - " ", - " // this.hpane.el.set_position( 0);", - "}", - "" + "\t_this.model.el = tm;", + "\t_this.sortmodel.el.set_model(tm);", + "\t this.tree.el.show();", + "}" ] } ],