From d8089f1b9d865efb4227f691b21844cb3c84cf28 Mon Sep 17 00:00:00 2001 From: crschnick Date: Tue, 13 Jun 2023 01:03:24 +0000 Subject: [PATCH] Improve error messages for missing external application --- .../java/io/xpipe/app/prefs/ExternalEditorType.java | 2 +- .../java/io/xpipe/app/prefs/ExternalTerminalType.java | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/io/xpipe/app/prefs/ExternalEditorType.java b/app/src/main/java/io/xpipe/app/prefs/ExternalEditorType.java index 2aa24c05..38917d0b 100644 --- a/app/src/main/java/io/xpipe/app/prefs/ExternalEditorType.java +++ b/app/src/main/java/io/xpipe/app/prefs/ExternalEditorType.java @@ -163,7 +163,7 @@ public interface ExternalEditorType extends PrefsChoiceValue { public void launch(Path file) throws Exception { var path = determinePath(); if (path.isEmpty()) { - throw new IOException("Unable to find installation of " + getId()); + throw new IOException("Unable to find installation of " + toTranslatedString()); } ApplicationHelper.executeLocalApplication( diff --git a/app/src/main/java/io/xpipe/app/prefs/ExternalTerminalType.java b/app/src/main/java/io/xpipe/app/prefs/ExternalTerminalType.java index de89130e..ff378228 100644 --- a/app/src/main/java/io/xpipe/app/prefs/ExternalTerminalType.java +++ b/app/src/main/java/io/xpipe/app/prefs/ExternalTerminalType.java @@ -90,7 +90,7 @@ public interface ExternalTerminalType extends PrefsChoiceValue { public void launch(String name, String file, boolean elevated) throws Exception { var path = determinePath(); if (path.isEmpty()) { - throw new IOException("Unable to find installation of " + getId()); + throw new IOException("Unable to find installation of " + toTranslatedString()); } ApplicationHelper.executeLocalApplication( @@ -181,6 +181,8 @@ public interface ExternalTerminalType extends PrefsChoiceValue { ExternalTerminalType WARP = new WarpType(); + ExternalTerminalType TABBY_MAC_OS = new TabbyMacOsType(); + ExternalTerminalType CUSTOM = new CustomType(); List ALL = Stream.of( @@ -193,7 +195,7 @@ public interface ExternalTerminalType extends PrefsChoiceValue { XFCE, GNOME_TERMINAL, ITERM2, - TABBY_WINDOWS, + TABBY_MAC_OS, WARP, MACOS_TERMINAL, 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"); }