diff --git a/data/Makefile.am b/data/Makefile.am index 4e73e037a..62eed7c88 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -29,7 +29,6 @@ dist_theme_DATA = \ theme/close.svg \ theme/corner-ripple.png \ theme/dash-placeholder.svg \ - theme/dialog-error.svg \ theme/filter-selected.svg \ theme/gnome-shell.css \ theme/mosaic-view-active.svg \ diff --git a/data/theme/dialog-error.svg b/data/theme/dialog-error.svg deleted file mode 100644 index 88c4ef75d..000000000 --- a/data/theme/dialog-error.svg +++ /dev/null @@ -1,222 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - Stop Process - December 2006 - - - Jakub Steiner - - - - - Andreas Nilsson - - - - - - stop - halt - - - - - - - - - - - - - - - - - - - - - - - diff --git a/data/theme/gnome-shell.css b/data/theme/gnome-shell.css index cf6f1eb78..d6616aa14 100644 --- a/data/theme/gnome-shell.css +++ b/data/theme/gnome-shell.css @@ -1080,15 +1080,14 @@ StTooltip StLabel { color: white; } -.run-dialog-error-icon { - background-image: url("dialog-error.svg"); - width: 36px; - height: 36px; +.run-dialog-error-label { + font-size: 12px; + color: white; } -.run-dialog-error-label { - font-size: 16px; - color: white; +.run-dialog-error-box { + padding-top: 15px; + spacing: 5px; } .run-dialog-entry { diff --git a/js/misc/util.js b/js/misc/util.js index fc515eb7b..e2ec2c164 100644 --- a/js/misc/util.js +++ b/js/misc/util.js @@ -82,12 +82,17 @@ function trySpawn(argv) GLib.SpawnFlags.SEARCH_PATH, null, null); } catch (err) { - // The exception from gjs contains an error string like: - // Error invoking GLib.spawn_command_line_async: Failed to - // execute child process "foo" (No such file or directory) - // We are only interested in the part in the parentheses. (And - // we can't pattern match the text, since it gets localized.) - err.message = err.message.replace(/.*\((.+)\)/, '$1'); + if (err.code == GLib.SpawnError.G_SPAWN_ERROR_NOENT) { + err.message = _("Command not found"); + } else { + // The exception from gjs contains an error string like: + // Error invoking GLib.spawn_command_line_async: Failed to + // execute child process "foo" (No such file or directory) + // We are only interested in the part in the parentheses. (And + // we can't pattern match the text, since it gets localized.) + err.message = err.message.replace(/.*\((.+)\)/, '$1'); + } + throw err; } } diff --git a/js/ui/runDialog.js b/js/ui/runDialog.js index 6d07ee223..a86e9bdd4 100644 --- a/js/ui/runDialog.js +++ b/js/ui/runDialog.js @@ -219,20 +219,20 @@ __proto__: ModalDialog.ModalDialog.prototype, this._entryText.grab_key_focus(); })); - this._errorBox = new St.BoxLayout(); + this._errorBox = new St.BoxLayout({ style_class: 'run-dialog-error-box' }); this.contentLayout.add(this._errorBox, { expand: true }); - let errorIcon = new St.Button({ style_class: 'run-dialog-error-icon' }); + let errorIcon = new St.Icon({ icon_name: 'dialog-error', icon_size: 24, style_class: 'run-dialog-error-icon' }); - this._errorBox.add(errorIcon); + this._errorBox.add(errorIcon, { y_align: St.Align.MIDDLE }); this._commandError = false; this._errorMessage = new St.Label({ style_class: 'run-dialog-error-label' }); this._errorMessage.clutter_text.line_wrap = true; - this._errorBox.add(this._errorMessage, { expand: true }); + this._errorBox.add(this._errorMessage, { expand: true, y_align: St.Align.MIDDLE }); this._errorBox.hide(); @@ -348,8 +348,7 @@ __proto__: ModalDialog.ModalDialog.prototype, } else { this._commandError = true; - let errorStr = _("Execution of '%s' failed:").format(command) + '\n' + e.message; - this._errorMessage.set_text(errorStr); + this._errorMessage.set_text(e.message); if (!this._errorBox.visible) { let [errorBoxMinHeight, errorBoxNaturalHeight] = this._errorBox.get_preferred_height(-1);