diff --git a/main/ui/src/main/java/org/cryptomator/ui/addvaultwizard/ChooseExistingVaultController.java b/main/ui/src/main/java/org/cryptomator/ui/addvaultwizard/ChooseExistingVaultController.java index 5e0ab64fa..3717a844f 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/addvaultwizard/ChooseExistingVaultController.java +++ b/main/ui/src/main/java/org/cryptomator/ui/addvaultwizard/ChooseExistingVaultController.java @@ -4,8 +4,10 @@ import dagger.Lazy; import javafx.beans.property.ObjectProperty; import javafx.fxml.FXML; import javafx.scene.Scene; +import javafx.scene.image.Image; import javafx.stage.FileChooser; import javafx.stage.Stage; +import org.apache.commons.lang3.SystemUtils; import org.cryptomator.common.vaults.Vault; import org.cryptomator.common.vaults.VaultListManager; import org.cryptomator.ui.common.ErrorComponent; @@ -18,6 +20,9 @@ import org.slf4j.LoggerFactory; import javax.inject.Inject; import javax.inject.Named; import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UncheckedIOException; import java.nio.file.NoSuchFileException; import java.nio.file.Path; import java.util.ResourceBundle; @@ -36,6 +41,8 @@ public class ChooseExistingVaultController implements FxController { private final VaultListManager vaultListManager; private final ResourceBundle resourceBundle; + private Image screenshot; + @Inject ChooseExistingVaultController(@AddVaultWizardWindow Stage window, @FxmlScene(FxmlFile.ADDVAULT_WELCOME) Lazy welcomeScene, @FxmlScene(FxmlFile.ADDVAULT_SUCCESS) Lazy successScene, ErrorComponent.Builder errorComponent, ObjectProperty vaultPath, @AddVaultWizardWindow ObjectProperty vault, VaultListManager vaultListManager, ResourceBundle resourceBundle) { this.window = window; @@ -48,6 +55,16 @@ public class ChooseExistingVaultController implements FxController { this.resourceBundle = resourceBundle; } + @FXML + public void initialize() { + final String resource = SystemUtils.IS_OS_MAC ? "/select-masterkey-mac.png" : "/select-masterkey-win.png"; + try (InputStream in = getClass().getResourceAsStream(resource)) { + this.screenshot = new Image(in); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + @FXML public void back() { window.setScene(welcomeScene.get()); @@ -72,4 +89,10 @@ public class ChooseExistingVaultController implements FxController { } } + /* Getter */ + + public Image getScreenshot() { + return screenshot; + } + } diff --git a/main/ui/src/main/java/org/cryptomator/ui/wrongfilealert/WrongFileAlertController.java b/main/ui/src/main/java/org/cryptomator/ui/wrongfilealert/WrongFileAlertController.java index 1c081b5ad..82eec9d28 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/wrongfilealert/WrongFileAlertController.java +++ b/main/ui/src/main/java/org/cryptomator/ui/wrongfilealert/WrongFileAlertController.java @@ -20,12 +20,25 @@ public class WrongFileAlertController implements FxController { private final Application app; private final Stage window; + private Image screenshot; + @Inject public WrongFileAlertController(@WrongFileAlertWindow Stage window, Application app) { this.window = window; this.app = app; } + @FXML + public void initialize() { + final String resource = SystemUtils.IS_OS_MAC ? "/vault-volume-mac.png" : "/vault-volume-win.png"; + try (InputStream in = getClass().getResourceAsStream(resource)) { + this.screenshot = new Image(in); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + + @FXML public void close() { window.close(); } @@ -38,11 +51,6 @@ public class WrongFileAlertController implements FxController { /* Getter */ public Image getScreenshot() { - final String resource = SystemUtils.IS_OS_MAC ? "/vault-volume-mac.png" : "/vault-volume-win.png"; - try (InputStream in = getClass().getResourceAsStream(resource)) { - return new Image(in); - } catch (IOException e) { - throw new UncheckedIOException(e); - } + return screenshot; } } diff --git a/main/ui/src/main/resources/choose_existing_vault.png b/main/ui/src/main/resources/choose_existing_vault.png deleted file mode 100644 index 1447d33c5..000000000 Binary files a/main/ui/src/main/resources/choose_existing_vault.png and /dev/null differ diff --git a/main/ui/src/main/resources/fxml/addvault_existing.fxml b/main/ui/src/main/resources/fxml/addvault_existing.fxml index e9c64f88a..b432c84a4 100644 --- a/main/ui/src/main/resources/fxml/addvault_existing.fxml +++ b/main/ui/src/main/resources/fxml/addvault_existing.fxml @@ -4,7 +4,6 @@ - @@ -19,11 +18,10 @@ - + -