From 3d0d2903f7e0fd4473244a625fd69dc57b16fb50 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Wed, 11 Mar 2020 17:25:25 +0100 Subject: [PATCH] Replaced dummy screenshot in "wrong file" dialog --- .../WrongFileAlertController.java | 19 +++++++- .../main/resources/fxml/wrongfilealert.fxml | 41 ++++++++---------- .../main/resources/i18n/strings.properties | 2 +- .../src/main/resources/vault-volume-mac.png | Bin 0 -> 32441 bytes .../src/main/resources/vault-volume-win.png | Bin 0 -> 23377 bytes 5 files changed, 37 insertions(+), 25 deletions(-) create mode 100644 main/ui/src/main/resources/vault-volume-mac.png create mode 100644 main/ui/src/main/resources/vault-volume-win.png 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 @@ - - - - + - -