Improve error messages for missing external application

This commit is contained in:
crschnick 2023-06-13 01:03:24 +00:00
parent 06a0fefa8c
commit d8089f1b9d
2 changed files with 7 additions and 5 deletions

View file

@ -163,7 +163,7 @@ public interface ExternalEditorType extends PrefsChoiceValue {
public void launch(Path file) throws Exception { public void launch(Path file) throws Exception {
var path = determinePath(); var path = determinePath();
if (path.isEmpty()) { if (path.isEmpty()) {
throw new IOException("Unable to find installation of " + getId()); throw new IOException("Unable to find installation of " + toTranslatedString());
} }
ApplicationHelper.executeLocalApplication( ApplicationHelper.executeLocalApplication(

View file

@ -90,7 +90,7 @@ public interface ExternalTerminalType extends PrefsChoiceValue {
public void launch(String name, String file, boolean elevated) throws Exception { public void launch(String name, String file, boolean elevated) throws Exception {
var path = determinePath(); var path = determinePath();
if (path.isEmpty()) { if (path.isEmpty()) {
throw new IOException("Unable to find installation of " + getId()); throw new IOException("Unable to find installation of " + toTranslatedString());
} }
ApplicationHelper.executeLocalApplication( ApplicationHelper.executeLocalApplication(
@ -181,6 +181,8 @@ public interface ExternalTerminalType extends PrefsChoiceValue {
ExternalTerminalType WARP = new WarpType(); ExternalTerminalType WARP = new WarpType();
ExternalTerminalType TABBY_MAC_OS = new TabbyMacOsType();
ExternalTerminalType CUSTOM = new CustomType(); ExternalTerminalType CUSTOM = new CustomType();
List<ExternalTerminalType> ALL = Stream.of( List<ExternalTerminalType> ALL = Stream.of(
@ -193,7 +195,7 @@ public interface ExternalTerminalType extends PrefsChoiceValue {
XFCE, XFCE,
GNOME_TERMINAL, GNOME_TERMINAL,
ITERM2, ITERM2,
TABBY_WINDOWS, TABBY_MAC_OS,
WARP, WARP,
MACOS_TERMINAL, MACOS_TERMINAL,
CUSTOM) CUSTOM)
@ -300,9 +302,9 @@ public interface ExternalTerminalType extends PrefsChoiceValue {
} }
} }
class TabbyType extends ExternalApplicationType.MacApplication implements ExternalTerminalType { class TabbyMacOsType extends ExternalApplicationType.MacApplication implements ExternalTerminalType {
public TabbyType() { public TabbyMacOsType() {
super("app.tabbyMacOs", "Tabby"); super("app.tabbyMacOs", "Tabby");
} }