"\t\t\t\t}",
"\t\t\t\tchild = child.get_first_child(); ",
"\t\t\t\treading_header = false;",
+ "\t\t\t\tcontinue;",
"\t }",
"\t\t if (child.get_type().name() != \"GtkColumnViewRowWidget\") {",
" \t\t child = child.get_next_sibling();",
"\t\t\t\theader_height = h;",
"\t\t\t\t",
"\t\t\t\treading_header = false;",
- "\t\t\t\t",
+ "\t\t\t\tcontinue;",
"\t }",
"\t ",
"\t\t if (child.get_type().name() != \"GtkColumnViewRowWidget\") {",
" ",
" \tthis.loading = false;",
" this.selmodel.el.set_selected(Gtk.INVALID_LIST_POSITION);",
+ " this.updateErrors();",
" // clear selection?",
" //this.model.el.set_sort_column_id(4,Gtk.SortType.ASCENDING); // sort by real key..",
" ",
" ",
"}",
""
+ ],
+ "| void removeErrors" : [
+ "() {",
+ "\tvar child = this.view.el.get_first_child(); ",
+ " ",
+ "\tvar reading_header = true;",
+ " ",
+ "\twhile (child != null) {",
+ "\t\tGLib.debug(\"Got %s\", child.get_type().name());",
+ "\t ",
+ "\t if (reading_header) {",
+ "\t\t\t",
+ "",
+ "\t\t\tif (child.get_type().name() != \"GtkColumnListView\") {",
+ "\t\t\t ",
+ "\t\t\t\tchild = child.get_next_sibling();",
+ "\t\t\t\tcontinue;",
+ "\t\t\t}",
+ "\t\t\t// should be columnlistview",
+ "\t\t\tchild = child.get_first_child(); ",
+ "\t\t ",
+ "\t\t ",
+ "\t\t\t",
+ "\t\t\treading_header = false;",
+ "\t\t\t ",
+ "\t }",
+ "\t ",
+ "\t \tif (!child.has_css_class(\"error-node\")) {",
+ "\t\t\tchild.remove_css_class(\"error-node\");",
+ "\t\t}",
+ "\t\t",
+ " child = child.get_next_sibling(); ",
+ "\t}",
+ "\t//GLib.debug(\"Rturning null\");",
+ " ",
+ "}"
+ ],
+ "| void updateErrors" : [
+ "() {",
+ "\tvar file = this.file;",
+ "\tvar ar = file.getErrors();",
+ "\tif (ar.size < 1) {",
+ "\t\tthis.removeErrors();",
+ "\t\tthis.last_error_counter = file.error_counter ;",
+ "",
+ "\t\treturn;",
+ "\t}",
+ " \tif (this.last_error_counter == file.error_counter) {",
+ "\t\treturn;",
+ "\t}",
+ "\tthis.removeErrors();",
+ "\t",
+ "\tforeach(var diag in ar) { ",
+ "\t",
+ "\t\t ",
+ "// print(\"get inter\\n\");",
+ "\t var node= file.lineToNode( (int)diag.range.start.line) ;",
+ "\t if (node == null || node.oid != this.node.oid) {",
+ "\t \tcontinue;",
+ " \t}",
+ " \tvar prop = node.lineToProp( (int)diag.range.start.line) ;",
+ " \t",
+ " \tvar row = _this.selmodel.propToRow(prop);",
+ " \tif (row < 0) {",
+ " \t\tcontinue;",
+ "\t\t}",
+ " \tvar w = this.view.getWidgetAtRow(row);",
+ " \tif (w == null) {",
+ " \t\treturn;",
+ "\t\t}",
+ "\t\tif (!w.has_css_class(\"node-error\")) {",
+ "\t\t\tw.add_css_class(\"node-error\");",
+ "\t\t}",
+ "\t\t",
+ "\t}",
+ "\t",
+ "}"
]
}
],
"name" : "WindowLeftProps"
-}
\ No newline at end of file
+}
}
+
+ public void updateErrors () {
+ var file = this.file;
+ var ar = file.getErrors();
+ if (ar.size < 1) {
+ this.removeErrors();
+ this.last_error_counter = file.error_counter ;
+
+ return;
+ }
+ if (this.last_error_counter == file.error_counter) {
+ return;
+ }
+ this.removeErrors();
+
+ foreach(var diag in ar) {
+
+
+ // print("get inter\n");
+ var node= file.lineToNode( (int)diag.range.start.line) ;
+ if (node == null || node.oid != this.node.oid) {
+ continue;
+ }
+ var prop = node.lineToProp( (int)diag.range.start.line) ;
+
+ var row = _this.selmodel.propToRow(prop);
+ if (row < 0) {
+ continue;
+ }
+ var w = this.view.getWidgetAtRow(row);
+ if (w == null) {
+ return;
+ }
+ if (!w.has_css_class("node-error")) {
+ w.add_css_class("node-error");
+ }
+
+ }
+
+ }
+
public string keyFormat (string val, string type) {
// Glib.markup_escape_text(val);
_this.changed();
*/
}
+ public void removeErrors () {
+ var child = this.view.el.get_first_child();
+
+ var reading_header = true;
+
+ while (child != null) {
+ GLib.debug("Got %s", child.get_type().name());
+
+ if (reading_header) {
+
+
+ if (child.get_type().name() != "GtkColumnListView") {
+
+ child = child.get_next_sibling();
+ continue;
+ }
+ // should be columnlistview
+ child = child.get_first_child();
+
+
+
+ reading_header = false;
+
+ }
+
+ if (!child.has_css_class("error-node")) {
+ child.remove_css_class("error-node");
+ }
+
+ child = child.get_next_sibling();
+ }
+ //GLib.debug("Rturning null");
+
+ }
public void a_addProp (JsRender.NodeProp prop) {
// info includes key, val, skel, etype..
//console.dump(info);
this.loading = false;
this.selmodel.el.set_selected(Gtk.INVALID_LIST_POSITION);
+ this.updateErrors();
// clear selection?
//this.model.el.set_sort_column_id(4,Gtk.SortType.ASCENDING); // sort by real key..
}
child = child.get_first_child();
reading_header = false;
+ continue;
}
if (child.get_type().name() != "GtkColumnViewRowWidget") {
child = child.get_next_sibling();
header_height = h;
reading_header = false;
-
+ continue;
}
if (child.get_type().name() != "GtkColumnViewRowWidget") {