()
| 75 | } |
| 76 | |
| 77 | _update() { |
| 78 | if (this._updateRunning) |
| 79 | return; |
| 80 | |
| 81 | this._updateRunning = true; |
| 82 | |
| 83 | let envp = GLib.get_environ(); |
| 84 | envp.push("ARGOS_VERSION=2"); |
| 85 | envp.push("ARGOS_MENU_OPEN=" + (this.menu.isOpen ? "true" : "false")); |
| 86 | |
| 87 | try { |
| 88 | Utilities.spawnWithCallback(null, [this._file.get_path()], envp, 0, null, |
| 89 | (standardOutput) => { |
| 90 | this._updateRunning = false; |
| 91 | |
| 92 | if (this._isDestroyed) |
| 93 | return; |
| 94 | |
| 95 | this._processOutput(standardOutput.split("\n")); |
| 96 | |
| 97 | if (this._updateInterval !== null) { |
| 98 | this._updateTimeout = |
| 99 | GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, |
| 100 | this._updateInterval, |
| 101 | () => { |
| 102 | this._updateTimeout = null; |
| 103 | this._update(); |
| 104 | return false; |
| 105 | }); |
| 106 | } |
| 107 | }); |
| 108 | } catch (error) { |
| 109 | log("Unable to execute file '" + this._file.get_basename() + "': " + error); |
| 110 | this._updateRunning = false; |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | _processOutput(output) { |
| 115 | let buttonLines = []; |
no test coverage detected