Added "Vault Missing" screen

This commit is contained in:
Sebastian Stenzel 2020-03-06 16:05:16 +01:00
parent b5a8442ed2
commit fca793e403
No known key found for this signature in database
GPG Key ID: 667B866EA8240A09
8 changed files with 69 additions and 1 deletions

2
.idea/compiler.xml generated
View File

@ -32,9 +32,9 @@
<entry name="$MAVEN_REPOSITORY$/org/jetbrains/kotlinx/kotlinx-metadata-jvm/0.1.0/kotlinx-metadata-jvm-0.1.0.jar" />
</processorPath>
<module name="keychain" />
<module name="launcher" />
<module name="commons" />
<module name="ui" />
<module name="launcher" />
</profile>
</annotationProcessing>
</component>

View File

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

View File

@ -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"), //

View File

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

View File

@ -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> vault;
@Inject
public VaultDetailMissingVaultController(ObjectProperty<Vault> vault) {
this.vault = vault;
}
}

View File

@ -50,6 +50,7 @@
<fx:include VBox.vgrow="ALWAYS" source="vault_detail_locked.fxml" visible="${controller.vault.locked}" managed="${controller.vault.locked}"/>
<fx:include VBox.vgrow="ALWAYS" source="vault_detail_unlocked.fxml" visible="${controller.vault.unlocked}" managed="${controller.vault.unlocked}"/>
<fx:include VBox.vgrow="ALWAYS" source="vault_detail_missing.fxml" visible="${controller.vault.missing}" managed="${controller.vault.missing}"/>
<fx:include VBox.vgrow="ALWAYS" source="vault_detail_needsmigration.fxml" visible="${controller.vault.needsMigration}" managed="${controller.vault.needsMigration}"/>
</children>
</VBox>

View File

@ -0,0 +1,28 @@
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.StackPane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.shape.Circle?>
<?import org.cryptomator.ui.controls.FontAwesome5IconView?>
<VBox xmlns="http://javafx.com/javafx"
xmlns:fx="http://javafx.com/fxml"
fx:controller="org.cryptomator.ui.mainwindow.VaultDetailMissingVaultController"
alignment="TOP_CENTER"
spacing="9">
<padding>
<Insets topRightBottomLeft="24"/>
</padding>
<children>
<StackPane alignment="CENTER">
<Circle styleClass="glyph-icon-primary" radius="48"/>
<FontAwesome5IconView styleClass="glyph-icon-white" glyph="FILE" glyphSize="48"/>
<FontAwesome5IconView styleClass="glyph-icon-primary" glyph="SEARCH" glyphSize="24">
<StackPane.margin>
<Insets top="12"/>
</StackPane.margin>
</FontAwesome5IconView>
</StackPane>
<Label text="%main.vaultDetail.missing.info" wrapText="true"/>
</children>
</VBox>

View File

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