mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-20 03:31:27 +00:00
Merge branch 'develop' into feature/simplified-workflow-results,
solving conflict with 5509033
# Conflicts:
# src/main/java/org/cryptomator/ui/keyloading/masterkeyfile/MasterkeyFileLoadingModule.java
This commit is contained in:
@@ -2,13 +2,16 @@ package org.cryptomator.ui.keyloading.masterkeyfile;
|
||||
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import org.cryptomator.common.vaults.Vault;
|
||||
import org.cryptomator.ui.common.DefaultSceneFactory;
|
||||
import org.cryptomator.ui.common.FxmlFile;
|
||||
import org.cryptomator.ui.common.FxmlLoaderFactory;
|
||||
import org.cryptomator.ui.keyloading.KeyLoading;
|
||||
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.stage.Stage;
|
||||
import java.io.IOException;
|
||||
import java.io.UncheckedIOException;
|
||||
import java.nio.file.Path;
|
||||
@@ -26,13 +29,19 @@ interface ChooseMasterkeyFileModule {
|
||||
|
||||
@Provides
|
||||
@ChooseMasterkeyFileScoped
|
||||
static Scene provideChooseMasterkeyScene(ChooseMasterkeyFileController controller, DefaultSceneFactory sceneFactory, ResourceBundle resourceBundle) {
|
||||
static Scene provideChooseMasterkeyScene(ChooseMasterkeyFileController controller, DefaultSceneFactory sceneFactory, ResourceBundle resourceBundle, @KeyLoading Stage window, @KeyLoading Vault v) {
|
||||
// TODO: simplify FxmlLoaderFactory
|
||||
try {
|
||||
var url = FxmlLoaderFactory.class.getResource(FxmlFile.UNLOCK_SELECT_MASTERKEYFILE.getRessourcePathString());
|
||||
var loader = new FXMLLoader(url, resourceBundle, null, clazz -> controller);
|
||||
Parent root = loader.load();
|
||||
return sceneFactory.apply(root);
|
||||
var scene = sceneFactory.apply(root);
|
||||
scene.windowProperty().addListener((prop, oldVal, newVal) -> {
|
||||
if (window.equals(newVal)) {
|
||||
window.setTitle(String.format(resourceBundle.getString("unlock.chooseMasterkey.title"), v.getDisplayName()));
|
||||
}
|
||||
});
|
||||
return scene;
|
||||
} catch (IOException e) {
|
||||
throw new UncheckedIOException("Failed to load UnlockScene", e);
|
||||
}
|
||||
|
||||
@@ -2,13 +2,16 @@ package org.cryptomator.ui.keyloading.masterkeyfile;
|
||||
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import org.cryptomator.common.vaults.Vault;
|
||||
import org.cryptomator.ui.common.DefaultSceneFactory;
|
||||
import org.cryptomator.ui.common.FxmlFile;
|
||||
import org.cryptomator.ui.common.FxmlLoaderFactory;
|
||||
import org.cryptomator.ui.keyloading.KeyLoading;
|
||||
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.stage.Stage;
|
||||
import java.io.IOException;
|
||||
import java.io.UncheckedIOException;
|
||||
import java.util.ResourceBundle;
|
||||
@@ -25,13 +28,19 @@ interface PassphraseEntryModule {
|
||||
|
||||
@Provides
|
||||
@PassphraseEntryScoped
|
||||
static Scene provideUnlockScene(PassphraseEntryController controller, DefaultSceneFactory sceneFactory, ResourceBundle resourceBundle) {
|
||||
static Scene provideUnlockScene(PassphraseEntryController controller, DefaultSceneFactory sceneFactory, ResourceBundle resourceBundle, @KeyLoading Stage window, @KeyLoading Vault v) {
|
||||
// TODO: simplify FxmlLoaderFactory
|
||||
try {
|
||||
var url = FxmlLoaderFactory.class.getResource(FxmlFile.UNLOCK_ENTER_PASSWORD.getRessourcePathString());
|
||||
var loader = new FXMLLoader(url, resourceBundle, null, clazz -> controller);
|
||||
Parent root = loader.load();
|
||||
return sceneFactory.apply(root);
|
||||
var scene = sceneFactory.apply(root);
|
||||
scene.windowProperty().addListener((prop, oldVal, newVal) -> {
|
||||
if (window.equals(newVal)) {
|
||||
window.setTitle(String.format(resourceBundle.getString("unlock.title"), v.getDisplayName()));
|
||||
}
|
||||
});
|
||||
return scene;
|
||||
} catch (IOException e) {
|
||||
throw new UncheckedIOException("Failed to load UnlockScene", e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user