"xtype" : "Button",
"| void setNotices" : [
"(GLib.ListStore nots, GLib.ListStore fe ) {",
- " ",
+ " BuilderApplication.showSpinner(\"\");",
" if (nots.get_n_items() < 1 ) {",
" \tthis.el.hide();",
" \tif (this.popup != null) {",
" // 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" : [
" \treturn;",
"\t}",
"\t",
- "\tvar req = new Palete.ValaCompileRequest(",
- "\t\tPalete.ValaCompileRequestType.RUN,",
- "\t\t_this.windowstate.file,",
- "\t\tnull,",
- "\t\tnull,",
- "\t\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);",
- "\treq.run();",
- "\t ",
- "\t_this.windowstate.compile_results.el.set_parent(this.el);",
+ "\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"