meson.build.o7QLX02
[roobuilder] / src / Builder4 / MainWindow.bjs
index d43dd8f..705b18b 100644 (file)
            "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(",
+             "\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}",
+             "\t",
+             "\tthis.last_request= new Palete.ValaCompileRequest(",
              "\t\tPalete.ValaCompileRequestType.RUN,",
              "\t\t_this.windowstate.file,",
              "\t\tnull,",
              "\t\tnull,",
              "\t\t\"\"",
              "\t);",
-             "\treq.run();",
+             "\tthis.last_request.run();",
              "\t ",
              "\t_this.windowstate.compile_results.el.set_parent(this.el);",
              "\t_this.windowstate.compile_results.show(this.el,true);",
          "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"