mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-17 02:01:27 +00:00
Add vault name in unlock window titles
This commit is contained in:
@@ -23,8 +23,10 @@ import org.slf4j.LoggerFactory;
|
|||||||
|
|
||||||
import javax.inject.Named;
|
import javax.inject.Named;
|
||||||
import javafx.scene.Scene;
|
import javafx.scene.Scene;
|
||||||
|
import javafx.stage.Stage;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
import java.util.ResourceBundle;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
|
||||||
@@ -93,15 +95,27 @@ public abstract class MasterkeyFileLoadingModule {
|
|||||||
@Provides
|
@Provides
|
||||||
@FxmlScene(FxmlFile.UNLOCK_ENTER_PASSWORD)
|
@FxmlScene(FxmlFile.UNLOCK_ENTER_PASSWORD)
|
||||||
@KeyLoadingScoped
|
@KeyLoadingScoped
|
||||||
static Scene provideUnlockScene(@KeyLoading FxmlLoaderFactory fxmlLoaders) {
|
static Scene provideUnlockScene(@KeyLoading FxmlLoaderFactory fxmlLoaders, @KeyLoading Stage window, @KeyLoading Vault v, ResourceBundle resourceBundle) {
|
||||||
return fxmlLoaders.createScene(FxmlFile.UNLOCK_ENTER_PASSWORD);
|
var scene = fxmlLoaders.createScene(FxmlFile.UNLOCK_ENTER_PASSWORD);
|
||||||
|
scene.windowProperty().addListener((prop, oldVal, newVal) -> {
|
||||||
|
if (window.equals(newVal)) {
|
||||||
|
window.setTitle(String.format(resourceBundle.getString("unlock.title"), v.getDisplayName()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return scene;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@FxmlScene(FxmlFile.UNLOCK_SELECT_MASTERKEYFILE)
|
@FxmlScene(FxmlFile.UNLOCK_SELECT_MASTERKEYFILE)
|
||||||
@KeyLoadingScoped
|
@KeyLoadingScoped
|
||||||
static Scene provideUnlockSelectMasterkeyFileScene(@KeyLoading FxmlLoaderFactory fxmlLoaders) {
|
static Scene provideUnlockSelectMasterkeyFileScene(@KeyLoading FxmlLoaderFactory fxmlLoaders, @KeyLoading Stage window, @KeyLoading Vault v, ResourceBundle resourceBundle) {
|
||||||
return fxmlLoaders.createScene(FxmlFile.UNLOCK_SELECT_MASTERKEYFILE);
|
var scene = fxmlLoaders.createScene(FxmlFile.UNLOCK_SELECT_MASTERKEYFILE);
|
||||||
|
scene.windowProperty().addListener((prop, oldVal, newVal) -> {
|
||||||
|
if (window.equals(newVal)) {
|
||||||
|
window.setTitle(String.format(resourceBundle.getString("unlock.chooseMasterkey.title"), v.getDisplayName()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return scene;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Binds
|
@Binds
|
||||||
|
|||||||
@@ -103,7 +103,8 @@ unlock.title=Unlock "%s"
|
|||||||
unlock.passwordPrompt=Enter password for "%s":
|
unlock.passwordPrompt=Enter password for "%s":
|
||||||
unlock.savePassword=Remember Password
|
unlock.savePassword=Remember Password
|
||||||
unlock.unlockBtn=Unlock
|
unlock.unlockBtn=Unlock
|
||||||
##
|
## Select
|
||||||
|
unlock.chooseMasterkey.title=Select Masterkey of "%s"
|
||||||
unlock.chooseMasterkey.prompt=Could not find the masterkey file for this vault at its expected location. Please choose the key file manually.
|
unlock.chooseMasterkey.prompt=Could not find the masterkey file for this vault at its expected location. Please choose the key file manually.
|
||||||
unlock.chooseMasterkey.filePickerTitle=Select Masterkey File
|
unlock.chooseMasterkey.filePickerTitle=Select Masterkey File
|
||||||
## Success
|
## Success
|
||||||
|
|||||||
Reference in New Issue
Block a user