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 350580d98..1c081b5ad 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 @@ -1,19 +1,23 @@ package org.cryptomator.ui.wrongfilealert; import javafx.application.Application; -import javafx.beans.property.StringProperty; import javafx.fxml.FXML; +import javafx.scene.image.Image; import javafx.stage.Stage; +import org.apache.commons.lang3.SystemUtils; import org.cryptomator.ui.common.FxController; import javax.inject.Inject; +import java.io.IOException; +import java.io.InputStream; +import java.io.UncheckedIOException; @WrongFileAlertScoped public class WrongFileAlertController implements FxController { private static final String DOCUMENTATION_URI = "https://docs.cryptomator.org"; - private Application app; + private final Application app; private final Stage window; @Inject @@ -30,4 +34,15 @@ public class WrongFileAlertController implements FxController { public void openDocumentation() { app.getHostServices().showDocument(DOCUMENTATION_URI); } + + /* 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); + } + } } diff --git a/main/ui/src/main/resources/fxml/wrongfilealert.fxml b/main/ui/src/main/resources/fxml/wrongfilealert.fxml index b5861454e..06b2c50bf 100644 --- a/main/ui/src/main/resources/fxml/wrongfilealert.fxml +++ b/main/ui/src/main/resources/fxml/wrongfilealert.fxml @@ -5,7 +5,6 @@ - @@ -17,10 +16,11 @@ @@ -32,36 +32,33 @@ - - - - + - -