From c5a9926652651a1942e8bfd338fc8a6222285f10 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Wed, 9 Oct 2019 15:15:13 +0200 Subject: [PATCH] Added localizable labels to recovery key display window --- .../ui/recoverykey/RecoveryKeyCreationController.java | 5 +++++ .../ui/recoverykey/RecoveryKeyDisplayController.java | 9 ++++++++- .../cryptomator/ui/recoverykey/RecoveryKeyModule.java | 2 +- .../main/resources/fxml/addvault_new_recoverykey.fxml | 5 ++--- main/ui/src/main/resources/fxml/recoverykey_create.fxml | 6 +++++- main/ui/src/main/resources/fxml/recoverykey_display.fxml | 9 ++++++--- .../src/main/resources/fxml/vault_options_general.fxml | 2 +- main/ui/src/main/resources/i18n/strings.properties | 6 ++++++ 8 files changed, 34 insertions(+), 10 deletions(-) diff --git a/main/ui/src/main/java/org/cryptomator/ui/recoverykey/RecoveryKeyCreationController.java b/main/ui/src/main/java/org/cryptomator/ui/recoverykey/RecoveryKeyCreationController.java index 4135d2318..3ddb9dd27 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/recoverykey/RecoveryKeyCreationController.java +++ b/main/ui/src/main/java/org/cryptomator/ui/recoverykey/RecoveryKeyCreationController.java @@ -63,4 +63,9 @@ public class RecoveryKeyCreationController implements FxController { window.close(); } + /* Getter/Setter */ + + public Vault getVault() { + return vault; + } } diff --git a/main/ui/src/main/java/org/cryptomator/ui/recoverykey/RecoveryKeyDisplayController.java b/main/ui/src/main/java/org/cryptomator/ui/recoverykey/RecoveryKeyDisplayController.java index b15978e3e..2d96d786f 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/recoverykey/RecoveryKeyDisplayController.java +++ b/main/ui/src/main/java/org/cryptomator/ui/recoverykey/RecoveryKeyDisplayController.java @@ -4,6 +4,7 @@ import javafx.beans.property.ReadOnlyStringProperty; import javafx.beans.property.StringProperty; import javafx.fxml.FXML; import javafx.stage.Stage; +import org.cryptomator.common.vaults.Vault; import org.cryptomator.ui.common.FxController; import javax.inject.Inject; @@ -12,11 +13,13 @@ import javax.inject.Inject; public class RecoveryKeyDisplayController implements FxController { private final Stage window; + private final Vault vault; private final StringProperty recoveryKeyProperty; @Inject - public RecoveryKeyDisplayController(@RecoveryKeyWindow Stage window, @RecoveryKeyWindow StringProperty recoveryKey) { + public RecoveryKeyDisplayController(@RecoveryKeyWindow Stage window, @RecoveryKeyWindow Vault vault, @RecoveryKeyWindow StringProperty recoveryKey) { this.window = window; + this.vault = vault; this.recoveryKeyProperty = recoveryKey; } @@ -27,6 +30,10 @@ public class RecoveryKeyDisplayController implements FxController { /* Getter/Setter */ + public Vault getVault() { + return vault; + } + public ReadOnlyStringProperty recoveryKeyProperty() { return recoveryKeyProperty; } diff --git a/main/ui/src/main/java/org/cryptomator/ui/recoverykey/RecoveryKeyModule.java b/main/ui/src/main/java/org/cryptomator/ui/recoverykey/RecoveryKeyModule.java index df8223314..261b50682 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/recoverykey/RecoveryKeyModule.java +++ b/main/ui/src/main/java/org/cryptomator/ui/recoverykey/RecoveryKeyModule.java @@ -38,7 +38,7 @@ abstract class RecoveryKeyModule { @RecoveryKeyScoped static Stage provideStage(ResourceBundle resourceBundle, @Named("windowIcon") Optional windowIcon, @Named("keyRecoveryOwner") Stage owner) { Stage stage = new Stage(); - stage.setTitle("TODO keyRecovery.title"); // TODO localize + stage.setTitle(resourceBundle.getString("recoveryKey.title")); stage.setResizable(false); stage.initModality(Modality.WINDOW_MODAL); stage.initOwner(owner); diff --git a/main/ui/src/main/resources/fxml/addvault_new_recoverykey.fxml b/main/ui/src/main/resources/fxml/addvault_new_recoverykey.fxml index c58436e69..9239fac8b 100644 --- a/main/ui/src/main/resources/fxml/addvault_new_recoverykey.fxml +++ b/main/ui/src/main/resources/fxml/addvault_new_recoverykey.fxml @@ -5,7 +5,7 @@ - + - - +