Clean up the presentation of errors in the run dialog

Removes redundant text, better icon, and shows are better error when
a command isn't found than "No such file or directory".
This commit is contained in:
William Jon McCann
2011-01-27 15:26:58 -05:00
parent 2cd84da835
commit 912a30c566
5 changed files with 22 additions and 242 deletions

View File

@ -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;
}
}