Replaced mockup image

This commit is contained in:
Sebastian Stenzel
2020-03-12 13:42:40 +01:00
parent f688db310f
commit cf668e820b
6 changed files with 38 additions and 9 deletions

View File

@@ -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<Scene> welcomeScene, @FxmlScene(FxmlFile.ADDVAULT_SUCCESS) Lazy<Scene> successScene, ErrorComponent.Builder errorComponent, ObjectProperty<Path> vaultPath, @AddVaultWizardWindow ObjectProperty<Vault> 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;
}
}

View File

@@ -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;
}
}

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -4,7 +4,6 @@
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ButtonBar?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.Region?>
<?import javafx.scene.layout.VBox?>
@@ -19,11 +18,10 @@
<Insets topRightBottomLeft="24"/>
</padding>
<children>
<ImageView VBox.vgrow="ALWAYS" fitHeight="200" preserveRatio="true" smooth="true" cache="true">
<ImageView VBox.vgrow="ALWAYS" fitWidth="400" preserveRatio="true" smooth="true" image="${controller.screenshot}">
<VBox.margin>
<Insets top="24"/>
</VBox.margin>
<Image url="/choose_existing_vault.png"/> <!-- TODO replace mockup -->
</ImageView>
<Label text="%addvaultwizard.existing.instruction" wrapText="true" labelFor="$finishButton"/>

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB