From d8ce8ecf8c73d34f59cb48a6c2e5e7f78cbf92ec Mon Sep 17 00:00:00 2001 From: crschnick Date: Wed, 3 Apr 2024 07:09:12 +0000 Subject: [PATCH] Add translate button and remove terminal tab option --- .../io/xpipe/app/comp/base/SideMenuBarComp.java | 13 ++++++++++++- .../main/java/io/xpipe/app/prefs/AppPrefs.java | 2 -- .../io/xpipe/app/prefs/TerminalCategory.java | 16 ---------------- .../main/java/io/xpipe/app/util/Hyperlinks.java | 1 + lang/app/strings/translations_en.properties | 6 ++---- 5 files changed, 15 insertions(+), 23 deletions(-) diff --git a/app/src/main/java/io/xpipe/app/comp/base/SideMenuBarComp.java b/app/src/main/java/io/xpipe/app/comp/base/SideMenuBarComp.java index 3dcea999e..458161552 100644 --- a/app/src/main/java/io/xpipe/app/comp/base/SideMenuBarComp.java +++ b/app/src/main/java/io/xpipe/app/comp/base/SideMenuBarComp.java @@ -167,8 +167,19 @@ public class SideMenuBarComp extends Comp> { } { - var b = new IconButtonComp("mdi2u-update", () -> UpdateAvailableAlert.showIfNeeded()) + var b = new IconButtonComp("mdi2t-translate", () -> Hyperlinks.open(Hyperlinks.TRANSLATE)) .shortcut(new KeyCodeCombination(KeyCode.values()[KeyCode.DIGIT1.ordinal() + entries.size() + 3])) + .apply(new FancyTooltipAugment<>("translate")) + .apply(simpleBorders) + .accessibleTextKey("translate"); + b.apply(struc -> { + AppFont.setSize(struc.get(), 2); + }); + vbox.getChildren().add(b.createRegion()); + } + + { + var b = new IconButtonComp("mdi2u-update", () -> UpdateAvailableAlert.showIfNeeded()) .apply(new FancyTooltipAugment<>("updateAvailableTooltip")) .accessibleTextKey("updateAvailableTooltip"); b.apply(struc -> { diff --git a/app/src/main/java/io/xpipe/app/prefs/AppPrefs.java b/app/src/main/java/io/xpipe/app/prefs/AppPrefs.java index 8a60e5f70..953fbc37f 100644 --- a/app/src/main/java/io/xpipe/app/prefs/AppPrefs.java +++ b/app/src/main/java/io/xpipe/app/prefs/AppPrefs.java @@ -52,8 +52,6 @@ public class AppPrefs { final DoubleProperty windowOpacity = map(new SimpleDoubleProperty(1.0), "windowOpacity", Double.class); final StringProperty customTerminalCommand = map(new SimpleStringProperty(""), "customTerminalCommand", String.class); - final BooleanProperty preferTerminalTabs = - map(new SimpleBooleanProperty(true), "preferTerminalTabs", Boolean.class); final BooleanProperty clearTerminalOnInit = map(new SimpleBooleanProperty(true), "clearTerminalOnInit", Boolean.class); public final BooleanProperty disableCertutilUse = diff --git a/app/src/main/java/io/xpipe/app/prefs/TerminalCategory.java b/app/src/main/java/io/xpipe/app/prefs/TerminalCategory.java index af2dbde99..a84b21b97 100644 --- a/app/src/main/java/io/xpipe/app/prefs/TerminalCategory.java +++ b/app/src/main/java/io/xpipe/app/prefs/TerminalCategory.java @@ -108,22 +108,6 @@ public class TerminalCategory extends AppPrefsCategory { .apply(struc -> struc.get().setPromptText("myterminal -e $CMD")) .hide(prefs.terminalType.isNotEqualTo(ExternalTerminalType.CUSTOM))) .addComp(terminalTest) - .name("preferTerminalTabs") - .description(Bindings.createStringBinding( - () -> { - var disabled = prefs.terminalType().getValue() != null - && !prefs.terminalType.get().supportsTabs(); - return !disabled - ? AppI18n.get("preferTerminalTabs") - : AppI18n.get( - "preferTerminalTabsDisabled", - prefs.terminalType() - .getValue() - .toTranslatedString() - .getValue()); - }, - prefs.terminalType())) - .addToggle(prefs.preferTerminalTabs) .disable(Bindings.createBooleanBinding( () -> { return prefs.terminalType().getValue() != null diff --git a/app/src/main/java/io/xpipe/app/util/Hyperlinks.java b/app/src/main/java/io/xpipe/app/util/Hyperlinks.java index 37b66fcb1..cc9f384d1 100644 --- a/app/src/main/java/io/xpipe/app/util/Hyperlinks.java +++ b/app/src/main/java/io/xpipe/app/util/Hyperlinks.java @@ -9,6 +9,7 @@ public class Hyperlinks { public static final String PRIVACY = "https://docs.xpipe.io/privacy-policy"; public static final String EULA = "https://docs.xpipe.io/end-user-license-agreement"; public static final String SECURITY = "https://docs.xpipe.io/security"; + public static final String TRANSLATE = "https://github.com/xpipe-io/xpipe/lang"; public static final String DISCORD = "https://discord.gg/8y89vS8cRb"; public static final String SLACK = "https://join.slack.com/t/XPipe/shared_invite/zt-1awjq0t5j-5i4UjNJfNe1VN4b_auu6Cg"; diff --git a/lang/app/strings/translations_en.properties b/lang/app/strings/translations_en.properties index 80ca0b428..94d08f250 100644 --- a/lang/app/strings/translations_en.properties +++ b/lang/app/strings/translations_en.properties @@ -394,13 +394,10 @@ terminalEmulator=Terminal emulator terminalConfiguration=Terminal configuration editorConfiguration=Editor configuration defaultApplication=Default application -terminalEmulatorDescription=The default terminal to use when opening any kind of shell connection. This application is only used for display purposes, the started shell program depends on the shell connection itself. +terminalEmulatorDescription=The default terminal to use when opening any kind of shell connection. This application is only used for display purposes, the started shell program depends on the shell connection itself.\n\nThe level of feature support varies by terminal, that is why each one is marked as either recommended or not recommended. All non-recommended terminals work with XPipe but might lack features like tabs, title colors, shell support, and more. Your user experience will be best when using a recommended terminal. program=Program customTerminalCommand=Custom terminal command customTerminalCommandDescription=The command to execute to open the custom terminal with a given command.\n\nXPipe will create a temporary launcher shell script for your terminal to execute. The placeholder string $CMD in the command you supply will be replaced by the actual launcher script when called. Remember to quote your terminal executable path if it contains spaces. -preferTerminalTabs=Prefer to open new tabs -preferTerminalTabsDisabled=Prefer to open new tabs.\n\nThe currently selected terminal $TERM$ does not support opening tabs from the CLI. -preferTerminalTabsDescription=Controls whether XPipe will try to open new tabs in your chosen terminal instead of new windows.\n\nNote that not every terminal supports this. clearTerminalOnInit=Clear terminal on init clearTerminalOnInitDescription=When enabled, XPipe will run a clear command when a new terminal session is launched to remove any unnecessary output. enableFastTerminalStartup=Enable fast terminal startup @@ -416,3 +413,4 @@ disableCertutilUseDescription=Due to several shortcomings and bugs in cmd.exe, t disableTerminalRemotePasswordPreparation=Disable terminal remote password preparation disableTerminalRemotePasswordPreparationDescription=In situations where a remote shell connection that goes through multiple intermediate systems should be established in the terminal, there might be a requirement to prepare any required passwords on one of the intermediate systems to allow for an automatic filling of any prompts.\n\nIf you don't want the passwords to ever be transferred to any intermediate system, you can disable this behavior. Any required intermediate password will then be queried in the terminal itself when opened. more=More +translate=Translate