"clicked" : [
" ( ) => {",
" ",
- " _this.windowstate.projectPopoverShow(_this.el, null);",
+ " _this.windowstate.projectPopoverShow(_this.el, null, null);",
" ",
" ",
"}"
"xtype" : "Label"
},
{
- "# GLib.ListStore notices" : "null",
"$ xns" : "Gtk",
"Xcls_ValaCompileErrors popup" : "",
"id" : "statusbar_errors",
"listeners" : {
"clicked" : [
"() => {",
- " ",
- "",
- " ",
- " if (this.popup == null) {",
- " this.popup = new Xcls_ValaCompileErrors();",
- " this.popup.window = _this;",
- " //this.popup.el.application = _this.el.application;",
- "\t // this.popup.el.set_transient_for( _this.el );",
- " this.popup.el.set_parent(this.el);",
- " }",
- " if (_this.statusbar_compile_spinner.el.spinning) {",
- "\t\tthis.popup.el.show(); \t",
- " \treturn;",
- "\t} ",
- " this.popup.show(this.notices, this.el);",
- " return;",
+ " ",
+ "\tif (this.popup == null) {",
+ "\t\treturn;",
+ "\t}",
+ " ",
+ " this.popup.show();",
+ " ",
"}"
]
},
"string label" : "0 Errors",
"xtype" : "Button",
"| void setNotices" : [
- "(GLib.ListStore nots, int qty, int tf) {",
- " ",
- " if (qty < 1 ) {",
+ "(GLib.ListStore nots, GLib.ListStore fe ) {",
+ " BuilderApplication.showSpinner(\"\");",
+ " if (nots.get_n_items() < 1 ) {",
" \tthis.el.hide();",
- " \tif (this.popup != null && this.popup.el.visible) {",
+ " \tif (this.popup != null) {",
" \t\tthis.popup.el.hide();",
"\t\t}",
" \treturn;",
" }",
" ",
" this.el.show();",
- " this.el.label = \"%d/%d Errors\".printf(tf,qty);",
- " this.notices = nots;",
- "\tif (this.popup != null && this.popup.el.visible) {",
- "\t\t this.popup.show(this.notices, this.el);",
+ " this.el.label = \"%d/%d Errors\".printf((int)fe.get_n_items(),(int)nots.get_n_items());",
+ "",
+ " ",
+ " ",
+ "\tif (this.popup == null) {",
+ " this.popup = new Xcls_ValaCompileErrors();",
+ " this.popup.window = _this;",
+ " // this.popup.el.set_transient_for( _this.el );",
+ " this.popup.el.set_parent(this.el);",
" }",
+ " ",
+ "\tthis.popup.updateNotices(nots);",
+ "\t ",
"}",
""
]
},
{
- "# GLib.ListStore notices" : "null",
"$ xns" : "Gtk",
"Xcls_ValaCompileErrors popup" : "",
"id" : "statusbar_warnings",
"() => {",
" ",
"\tif (this.popup == null) {",
- " this.popup = new Xcls_ValaCompileErrors();",
- " this.popup.window = _this;",
- " // this.popup.el.set_transient_for( _this.el );",
- " this.popup.el.set_parent(this.el);",
- " }",
- " if (_this.statusbar_compile_spinner.el.spinning) {",
- "\t\tthis.popup.el.show(); \t",
- " \treturn;",
- "\t} ",
- " this.popup.show(this.notices, this.el);",
+ "\t\treturn;",
+ "\t}",
+ " ",
+ " this.popup.show();",
" return;",
"}"
]
"string label" : "0 Warnings",
"xtype" : "Button",
"| void setNotices" : [
- "(GLib.ListStore nots, int qty, int tf) {",
+ "(GLib.ListStore nots, GLib.ListStore fe ) {",
" ",
- " if (qty < 1 ) {",
+ " if (nots.get_n_items() < 1 ) {",
" \tthis.el.hide();",
- " \tif (this.popup != null && this.popup.el.visible) {",
+ " \tif (this.popup != null) {",
" \t\tthis.popup.el.hide();",
"\t\t}",
" \treturn;",
" }",
- " this.el.show();",
- " this.el.label = \"%d/%d Warnings\".printf(tf,qty);",
- " this.notices = nots;",
- " if (this.popup != null && this.popup.el.visible) {",
- "\t\t this.popup.show(this.notices, this.el);",
- " }",
" ",
+ " this.el.show();",
+ " this.el.label = \"%d/%d Warnings\".printf((int)fe.get_n_items(),(int)nots.get_n_items());",
"",
+ " ",
+ " ",
+ "\tif (this.popup == null) {",
+ " this.popup = new Xcls_ValaCompileErrors();",
+ " this.popup.window = _this;",
+ " // this.popup.el.set_transient_for( _this.el );",
+ " this.popup.el.set_parent(this.el);",
+ " }",
+ "\tthis.popup.updateNotices(nots);",
+ "\t ",
"}",
""
]
"listeners" : {
"clicked" : [
"() => {",
- " ",
+ " ",
"\tif (this.popup == null) {",
- " this.popup = new Xcls_ValaCompileErrors();",
- " this.popup.window = _this;",
- " // this.popup.el.set_transient_for( _this.el );",
- " this.popup.el.set_parent(this.el);",
- " }",
- " if (_this.statusbar_compile_spinner.el.spinning) {",
- "\t\tthis.popup.el.show(); \t",
- " \treturn;",
- "\t} ",
- " ",
- " this.popup.show(this.notices, this.el);",
- " return;",
+ "\t\treturn;",
+ "\t}",
+ " ",
+ " this.popup.show();",
+ " ",
"}"
]
},
"string label" : "0 Depricated",
"xtype" : "Button",
"| void setNotices" : [
- "(GLib.ListStore nots, int qty, int tf) {",
- " if (qty < 1) {",
+ "",
+ "(GLib.ListStore nots, GLib.ListStore fe ) {",
+ " ",
+ " if (nots.get_n_items() < 1 ) {",
" \tthis.el.hide();",
- " \tif (this.popup != null && this.popup.el.visible) {",
- "\t\t\t this.popup.el.hide();",
+ " \tif (this.popup != null) {",
+ " \t\tthis.popup.el.hide();",
"\t\t}",
- " ",
" \treturn;",
- "\t}",
+ " }",
" ",
" this.el.show();",
+ " this.el.label = \"%d/%d Depricated\".printf((int)fe.get_n_items(),(int)nots.get_n_items());",
+ "",
" ",
- " this.el.label = \"%d/%d Depricated\".printf(tf,qty);",
- " this.notices = nots;",
- "\tif (this.popup != null && this.popup.el.visible) {",
- "\t\t this.popup.show(this.notices, this.el);",
+ " ",
+ "\tif (this.popup == null) {",
+ " this.popup = new Xcls_ValaCompileErrors();",
+ " this.popup.window = _this;",
+ " // this.popup.el.set_transient_for( _this.el );",
+ " this.popup.el.set_parent(this.el);",
" }",
+ "\tthis.popup.updateNotices(nots);",
+ "\t ",
"}",
""
]
},
{
"$ xns" : "Gtk",
+ "Palete.ValaCompileRequest? last_request" : "null",
"Xcls_ValaCompileErrors popup" : "",
+ "bool visible" : false,
"id" : "statusbar_run",
"listeners" : {
"clicked" : [
"\t _this.windowstate.compile_results.el.show(); // show currently running.",
" \treturn;",
"\t}",
- "\tBuilderApplication.valacompilequeue.addFile( ",
- "\t \t\t\t\t\tPalete.ValaCompileRequestType.RUN, ",
- "\t \t\t\t\t\t_this.windowstate.file, \"\", true ) ;",
- "",
- "\t_this.windowstate.compile_results.el.set_parent(this.el);",
+ "\t",
+ "\tif (this.last_request != null) {",
+ "\t\tthis.last_request.cancel();",
+ "\t\tif (this.last_request.terminal_pid > 0) {",
+ "\t\t\tthis.last_request.killChildren(this.last_request.terminal_pid);",
+ "\t\t}",
+ "\t}",
+ "\tvar pr = _this.windowstate.project as Project.Gtk;",
+ "\tif (pr == null) {",
+ "\t\treturn;",
+ "\t}",
+ "\t",
+ "\t",
+ "\tthis.last_request= new Palete.ValaCompileRequest(",
+ "\t\tpr,",
+ "\t\tpr.firstBuildModuleWith(_this.windowstate.file)",
+ "\t);",
+ "\tthis.last_request.onOutput.connect( ( str) => {",
+ "\t\t_this.windowstate.compile_results.addLine(str);",
+ "\t});",
+ "\tthis.last_request.run.begin( ( a, r) => {",
+ "\t\tthis.last_request.run.end(r);",
+ "\t});",
+ "\t if (_this.windowstate.compile_results.el.parent == null) {",
+ "\t\t_this.windowstate.compile_results.el.set_parent(this.el);",
+ "\t}",
"\t_this.windowstate.compile_results.show(this.el,true);",
"\t ",
"}"
"string tooltip_text" : "Compiling",
"xtype" : "Spinner",
"| void start" : [
- "() {",
- " this.el.show();",
- " this.el.start(); ",
+ "(string icon, string tooltip) {",
+ "",
+ "\tif (icon == \"spinner\") {",
+ "\t this.el.show();",
+ "\t this.el.start(); ",
+ "\t this.el.tooltip_text = tooltip;",
+ "\t _this.statusbar_compile_icon.el.hide();",
+ " } else {",
+ "\t this.el.hide();",
+ "\t// GLib.debug(\"set status icon %s, %s\", icon, tooltip);",
+ "\t _this.statusbar_compile_icon.el.tooltip_text = tooltip;",
+ "\t _this.statusbar_compile_icon.el.icon_name = icon;",
+ "\t _this.statusbar_compile_icon.el.show();\t ",
+ " }",
" ",
"\t ",
"}",
"() {",
" this.el.stop();",
" this.el.hide();",
- " ",
+ " _this.statusbar_compile_icon.el.hide(); ",
"}",
""
]
+ },
+ {
+ "$ xns" : "Gtk",
+ "Gtk.IconSize icon_size" : "Gtk.IconSize.NORMAL",
+ "id" : "statusbar_compile_icon",
+ "int margin_end" : 4,
+ "int margin_start" : 4,
+ "xtype" : "Image"
}
],
"xtype" : "Box"
"listeners" : {
"close_request" : [
"( ) => {",
- "",
- "\treturn false;",
+ "\t Resources.singleton().disconnect(_this.statusbar.handler_id);",
+ "\t ",
+ "\t ",
+ "\t this.windowstate.file.getLanguageServer().document_close(",
+ "\t \tthis.windowstate.file",
+ " \t);",
+ "\t ",
+ "\t BuilderApplication.removeWindow(this);",
+ "\t ",
+ "\t if (BuilderApplication.windows.size < 1) {",
+ "\t\tthis.windowstate.file.getLanguageServer().exit();",
+ "\t\tBuilderApplication.singleton( null ).quit();",
+ "\t }",
+ "\treturn true;",
"}",
""
],
"() => {",
" ",
" ",
- " Resources.singleton().disconnect(_this.statusbar.handler_id);",
- " ",
- " BuilderApplication.removeWindow(this);",
- " ",
- " if (BuilderApplication.windows.size < 1) {",
"",
- " BuilderApplication.singleton( null ).quit();",
- " }",
"}"
],
"show" : [
"}"
],
"| void updateErrors" : [
- "(Palete.ValaCompileRequest? req) {",
+ "() {",
"",
- "\tif (req == null) {",
- " ",
- "\t _this.statusbar_errors.el.hide();",
- "\t\t_this.statusbar_warnings.el.hide();",
- "\t\t_this.statusbar_depricated.el.hide();",
- "\t\treturn;",
- "\t}",
+ "",
+ " \tGLib.debug(\"updateErrors\");",
"\t",
+ "\tvar pr = this.windowstate.project.getErrors(\"ERR\");",
"\t",
"\tthis.statusbar_errors.setNotices(",
- "\t\treq.errorByType.get(\"ERR\"),",
- "\t\treq.totalErrors(\"ERR\"),",
- "\t\treq.totalErrors(\"ERR\", this.windowstate.file)",
+ "\t\tpr,",
+ "\t\tthis.windowstate.file.getErrors(\"ERR\")",
"\t);",
+ "\t",
"\tthis.statusbar_warnings.setNotices(",
- "\t\treq.errorByType.get(\"WARN\"),",
- "\t\treq.totalErrors(\"WARN\"),",
- "\t\treq.totalErrors(\"WARN\", this.windowstate.file)",
+ "\t\tthis.windowstate.project.getErrors(\"WARN\"),",
+ "\t\tthis.windowstate.file.getErrors(\"WARN\")",
"\t);",
"\tthis.statusbar_depricated.setNotices(",
- "\t\treq.errorByType.get(\"DEPR\"),",
- "\t\treq.totalErrors(\"DEPR\"),",
- "\t\treq.totalErrors(\"DEPR\", this.windowstate.file)",
+ "\t\tthis.windowstate.project.getErrors(\"DEPR\"),",
+ "\t\tthis.windowstate.file.getErrors(\"DEPR\")",
"\t);",
+ " ",
+ "\t_this.statusbar_run.el.hide();",
+ "",
+ "\tif (pr.get_n_items() < 1) {",
+ "\t\t_this.statusbar_run.el.show();",
+ "\t} ",
+ "\t",
"}"
]
}