From ab2d740722a920add5bfc3fbdb479e9398d27d0a Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Mon, 27 Jun 2022 19:04:14 +0200 Subject: [PATCH] adjust choose masterkeyfile dialog --- .../ChooseMasterkeyFileController.java | 12 ++++++- .../fxml/unlock_select_masterkeyfile.fxml | 34 +++++++++++++------ src/main/resources/i18n/strings.properties | 4 +-- 3 files changed, 36 insertions(+), 14 deletions(-) diff --git a/src/main/java/org/cryptomator/ui/keyloading/masterkeyfile/ChooseMasterkeyFileController.java b/src/main/java/org/cryptomator/ui/keyloading/masterkeyfile/ChooseMasterkeyFileController.java index d47f4e5b3..9b2231921 100644 --- a/src/main/java/org/cryptomator/ui/keyloading/masterkeyfile/ChooseMasterkeyFileController.java +++ b/src/main/java/org/cryptomator/ui/keyloading/masterkeyfile/ChooseMasterkeyFileController.java @@ -1,11 +1,13 @@ package org.cryptomator.ui.keyloading.masterkeyfile; +import org.cryptomator.common.vaults.Vault; import org.cryptomator.ui.common.FxController; import org.cryptomator.ui.keyloading.KeyLoading; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.inject.Inject; +import javafx.beans.binding.StringBinding; import javafx.fxml.FXML; import javafx.stage.FileChooser; import javafx.stage.Stage; @@ -23,12 +25,14 @@ public class ChooseMasterkeyFileController implements FxController { private static final Logger LOG = LoggerFactory.getLogger(ChooseMasterkeyFileController.class); private final Stage window; + private final Vault vault; private final CompletableFuture result; private final ResourceBundle resourceBundle; @Inject - public ChooseMasterkeyFileController(@KeyLoading Stage window, CompletableFuture result, ResourceBundle resourceBundle) { + public ChooseMasterkeyFileController(@KeyLoading Stage window, @KeyLoading Vault vault, CompletableFuture result, ResourceBundle resourceBundle) { this.window = window; + this.vault = vault; this.result = result; this.resourceBundle = resourceBundle; this.window.setOnHiding(this::windowClosed); @@ -56,4 +60,10 @@ public class ChooseMasterkeyFileController implements FxController { } } + //--- Setter & Getter --- + + public String getDisplayName(){ + return vault.getDisplayName(); + } + } diff --git a/src/main/resources/fxml/unlock_select_masterkeyfile.fxml b/src/main/resources/fxml/unlock_select_masterkeyfile.fxml index d37289fca..05581f122 100644 --- a/src/main/resources/fxml/unlock_select_masterkeyfile.fxml +++ b/src/main/resources/fxml/unlock_select_masterkeyfile.fxml @@ -9,28 +9,40 @@ - + + + + spacing="12" + alignment="TOP_LEFT"> - - + + + + + - + - - - + + + + + - +