From 9361a75cd88a6c6393c9c9d8561dc29d796f13c3 Mon Sep 17 00:00:00 2001 From: JaniruTEC <52893617+JaniruTEC@users.noreply.github.com> Date: Tue, 11 Jul 2023 21:21:16 +0200 Subject: [PATCH] Refactored UnlockInvalidMountPointController to use improved Exceptions --- .../ui/unlock/UnlockInvalidMountPointController.java | 6 +++++- src/main/resources/i18n/strings.properties | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/cryptomator/ui/unlock/UnlockInvalidMountPointController.java b/src/main/java/org/cryptomator/ui/unlock/UnlockInvalidMountPointController.java index 1af21a5e0..22812ec0f 100644 --- a/src/main/java/org/cryptomator/ui/unlock/UnlockInvalidMountPointController.java +++ b/src/main/java/org/cryptomator/ui/unlock/UnlockInvalidMountPointController.java @@ -14,6 +14,7 @@ import org.cryptomator.ui.vaultoptions.SelectedVaultOptionsTab; import javax.inject.Inject; import javafx.fxml.FXML; import javafx.stage.Stage; +import java.nio.file.Path; import java.util.ResourceBundle; import java.util.concurrent.atomic.AtomicReference; @@ -26,6 +27,7 @@ public class UnlockInvalidMountPointController implements FxController { private final FxApplicationWindows appWindows; private final ResourceBundle resourceBundle; private final ExceptionType exceptionType; + private final Path exceptionPath; private final String exceptionMessage; public FormattedLabel dialogDescription; @@ -39,13 +41,15 @@ public class UnlockInvalidMountPointController implements FxController { var exc = illegalMountPointException.get(); this.exceptionType = getExceptionType(exc); + this.exceptionPath = exc.getMountpoint(); this.exceptionMessage = exc.getMessage(); } @FXML public void initialize() { dialogDescription.setFormat(resourceBundle.getString(exceptionType.translationKey)); - dialogDescription.setArg1(exceptionMessage); + dialogDescription.setArg1(exceptionPath); + dialogDescription.setArg2(exceptionMessage); } @FXML diff --git a/src/main/resources/i18n/strings.properties b/src/main/resources/i18n/strings.properties index ca051269a..a9942eb51 100644 --- a/src/main/resources/i18n/strings.properties +++ b/src/main/resources/i18n/strings.properties @@ -131,7 +131,7 @@ unlock.error.customPath.message=Unable to mount vault to custom path unlock.error.customPath.description.notSupported=If you wish to keep using the custom path, please go to the preferences and select a volume type that supports it. Otherwise, go to the vault options and choose a supported mount point. unlock.error.customPath.description.notExists=The custom mount path does not exist. Either create it in your local filesystem or change it in the vault options. unlock.error.customPath.description.inUse=Drive letter "%s" is already in use. -unlock.error.customPath.description.generic=You have selected a custom mount path for this vault, but using it failed with the message: %s +unlock.error.customPath.description.generic=You have selected a custom mount path for this vault, but using it failed with the message: %2$s ## Hub hub.noKeychain.message=Unable to access device key hub.noKeychain.description=In order to unlock Hub vaults, a device key is required, which is secured using a keychain. To proceed, enable ā€œ%sā€ and select a keychain in the preferences.