From e011a98fa0d836eb010c10aefc2abc44bbc1acf3 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Mon, 4 Jul 2022 10:36:15 +0200 Subject: [PATCH] add window title to hub keyloading --- .../ui/keyloading/hub/HubKeyLoadingModule.java | 8 ++++++++ .../ui/keyloading/hub/HubKeyLoadingStrategy.java | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/cryptomator/ui/keyloading/hub/HubKeyLoadingModule.java b/src/main/java/org/cryptomator/ui/keyloading/hub/HubKeyLoadingModule.java index 4d4d810a3..eacdfc10b 100644 --- a/src/main/java/org/cryptomator/ui/keyloading/hub/HubKeyLoadingModule.java +++ b/src/main/java/org/cryptomator/ui/keyloading/hub/HubKeyLoadingModule.java @@ -43,6 +43,14 @@ public abstract class HubKeyLoadingModule { } } + @Provides + @KeyLoadingScoped + @Named("windowTitle") + static String provideWindowTitle(@KeyLoading Vault vault, ResourceBundle resourceBundle) { + return String.format(resourceBundle.getString("unlock.title"), vault.getDisplayName()); + } + + @Provides @KeyLoadingScoped @Named("deviceId") diff --git a/src/main/java/org/cryptomator/ui/keyloading/hub/HubKeyLoadingStrategy.java b/src/main/java/org/cryptomator/ui/keyloading/hub/HubKeyLoadingStrategy.java index 10d1399e2..dcb5722d2 100644 --- a/src/main/java/org/cryptomator/ui/keyloading/hub/HubKeyLoadingStrategy.java +++ b/src/main/java/org/cryptomator/ui/keyloading/hub/HubKeyLoadingStrategy.java @@ -13,6 +13,7 @@ import org.cryptomator.ui.keyloading.KeyLoadingStrategy; import org.cryptomator.ui.unlock.UnlockCancelledException; import javax.inject.Inject; +import javax.inject.Named; import javafx.application.Platform; import javafx.scene.Scene; import javafx.stage.Stage; @@ -35,8 +36,9 @@ public class HubKeyLoadingStrategy implements KeyLoadingStrategy { private final DeviceKey deviceKey; @Inject - public HubKeyLoadingStrategy(@KeyLoading Stage window, @FxmlScene(FxmlFile.HUB_AUTH_FLOW) Lazy authFlowScene, CompletableFuture result, DeviceKey deviceKey) { + public HubKeyLoadingStrategy(@KeyLoading Stage window, @FxmlScene(FxmlFile.HUB_AUTH_FLOW) Lazy authFlowScene, CompletableFuture result, DeviceKey deviceKey, @Named("windowTitle") String windowTitle) { this.window = window; + window.setTitle(windowTitle); this.authFlowScene = authFlowScene; this.result = result; this.deviceKey = deviceKey;