From fca793e403da8eeb2d735f02f3b4cb1f7ab2a7ce Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Fri, 6 Mar 2020 16:05:16 +0100 Subject: [PATCH] Added "Vault Missing" screen --- .idea/compiler.xml | 2 +- .../org/cryptomator/common/vaults/Vault.java | 10 +++++++ .../ui/controls/FontAwesome5Icon.java | 2 ++ .../ui/mainwindow/MainWindowModule.java | 5 ++++ .../VaultDetailMissingVaultController.java | 20 +++++++++++++ .../src/main/resources/fxml/vault_detail.fxml | 1 + .../resources/fxml/vault_detail_missing.fxml | 28 +++++++++++++++++++ .../main/resources/i18n/strings.properties | 2 ++ 8 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 main/ui/src/main/java/org/cryptomator/ui/mainwindow/VaultDetailMissingVaultController.java create mode 100644 main/ui/src/main/resources/fxml/vault_detail_missing.fxml diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 89ecef4de..943b0492d 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -32,9 +32,9 @@ + - diff --git a/main/commons/src/main/java/org/cryptomator/common/vaults/Vault.java b/main/commons/src/main/java/org/cryptomator/common/vaults/Vault.java index e9883dff4..59db806f4 100644 --- a/main/commons/src/main/java/org/cryptomator/common/vaults/Vault.java +++ b/main/commons/src/main/java/org/cryptomator/common/vaults/Vault.java @@ -66,6 +66,7 @@ public class Vault { private final BooleanBinding locked; private final BooleanBinding processing; private final BooleanBinding unlocked; + private final BooleanBinding missing; private final BooleanBinding needsMigration; private final ObjectBinding accessPoint; @@ -84,6 +85,7 @@ public class Vault { this.locked = Bindings.createBooleanBinding(this::isLocked, state); this.processing = Bindings.createBooleanBinding(this::isProcessing, state); this.unlocked = Bindings.createBooleanBinding(this::isUnlocked, state); + this.missing = Bindings.createBooleanBinding(this::isMissing, state); this.needsMigration = Bindings.createBooleanBinding(this::isNeedsMigration, state); this.accessPoint = Bindings.createObjectBinding(this::getAccessPoint, state); } @@ -177,6 +179,14 @@ public class Vault { public boolean isUnlocked() { return state.get() == VaultState.UNLOCKED; } + + public BooleanBinding missingProperty() { + return missing; + } + + public boolean isMissing() { + return state.get() == VaultState.MISSING; + } public BooleanBinding needsMigrationProperty() { return needsMigration; diff --git a/main/ui/src/main/java/org/cryptomator/ui/controls/FontAwesome5Icon.java b/main/ui/src/main/java/org/cryptomator/ui/controls/FontAwesome5Icon.java index 97d20ecdb..8cce36d0d 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/controls/FontAwesome5Icon.java +++ b/main/ui/src/main/java/org/cryptomator/ui/controls/FontAwesome5Icon.java @@ -16,6 +16,7 @@ public enum FontAwesome5Icon { EXCLAMATION_TRIANGLE("\uF071"), // EYE("\uF06E"), // EYE_SLASH("\uF070"), // + FILE("\uF15B"), // FILE_IMPORT("\uF56F"), // FOLDER_OPEN("\uF07C"), // HAND_HOLDING_HEART("\uF4BE"), // @@ -29,6 +30,7 @@ public enum FontAwesome5Icon { PLUS("\uF067"), // PRINT("\uF02F"), // QUESTION("\uF128"), // + SEARCH("\uF002"), // SPINNER("\uF110"), // SYNC("\uF021"), // TIMES("\uF00D"), // diff --git a/main/ui/src/main/java/org/cryptomator/ui/mainwindow/MainWindowModule.java b/main/ui/src/main/java/org/cryptomator/ui/mainwindow/MainWindowModule.java index 9a058ea85..2251903bc 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/mainwindow/MainWindowModule.java +++ b/main/ui/src/main/java/org/cryptomator/ui/mainwindow/MainWindowModule.java @@ -97,6 +97,11 @@ abstract class MainWindowModule { @IntoMap @FxControllerKey(VaultDetailUnlockedController.class) abstract FxController bindVaultDetailUnlockedController(VaultDetailUnlockedController controller); + + @Binds + @IntoMap + @FxControllerKey(VaultDetailMissingVaultController.class) + abstract FxController bindVaultDetailMissingVaultController(VaultDetailMissingVaultController controller); @Binds @IntoMap diff --git a/main/ui/src/main/java/org/cryptomator/ui/mainwindow/VaultDetailMissingVaultController.java b/main/ui/src/main/java/org/cryptomator/ui/mainwindow/VaultDetailMissingVaultController.java new file mode 100644 index 000000000..8036cbb3c --- /dev/null +++ b/main/ui/src/main/java/org/cryptomator/ui/mainwindow/VaultDetailMissingVaultController.java @@ -0,0 +1,20 @@ +package org.cryptomator.ui.mainwindow; + +import javafx.beans.property.ObjectProperty; +import javafx.beans.property.ReadOnlyObjectProperty; +import org.cryptomator.common.vaults.Vault; +import org.cryptomator.ui.common.FxController; + +import javax.inject.Inject; + +@MainWindowScoped +public class VaultDetailMissingVaultController implements FxController { + + private final ReadOnlyObjectProperty vault; + + @Inject + public VaultDetailMissingVaultController(ObjectProperty vault) { + this.vault = vault; + } + +} diff --git a/main/ui/src/main/resources/fxml/vault_detail.fxml b/main/ui/src/main/resources/fxml/vault_detail.fxml index 8438fc362..19a590cd6 100644 --- a/main/ui/src/main/resources/fxml/vault_detail.fxml +++ b/main/ui/src/main/resources/fxml/vault_detail.fxml @@ -50,6 +50,7 @@ + diff --git a/main/ui/src/main/resources/fxml/vault_detail_missing.fxml b/main/ui/src/main/resources/fxml/vault_detail_missing.fxml new file mode 100644 index 000000000..cc94063f5 --- /dev/null +++ b/main/ui/src/main/resources/fxml/vault_detail_missing.fxml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/main/ui/src/main/resources/i18n/strings.properties b/main/ui/src/main/resources/i18n/strings.properties index 9a029f29e..ace961512 100644 --- a/main/ui/src/main/resources/i18n/strings.properties +++ b/main/ui/src/main/resources/i18n/strings.properties @@ -167,6 +167,8 @@ main.vaultDetail.bytesPerSecondWritten=written: main.vaultDetail.throughput.idle=idle main.vaultDetail.throughput.kbps=%.1f kiB/s main.vaultDetail.throughput.mbps=%.1f MiB/s +### Missing +main.vaultDetail.missing.info=Cryptomator could not find a vault at this path. ### Needs Migration main.vaultDetail.migrateButton=Upgrade Vault main.vaultDetail.migratePrompt=Your vault needs to be upgraded to a new format, before you can access it