~exprez135/cryptomator-libre

fca793e403da8eeb2d735f02f3b4cb1f7ab2a7ce — Sebastian Stenzel 1 year, 8 months ago b5a8442
Added "Vault Missing" screen
M .idea/compiler.xml => .idea/compiler.xml +1 -1
@@ 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>

M main/commons/src/main/java/org/cryptomator/common/vaults/Vault.java => main/commons/src/main/java/org/cryptomator/common/vaults/Vault.java +10 -0
@@ 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;

M main/ui/src/main/java/org/cryptomator/ui/controls/FontAwesome5Icon.java => main/ui/src/main/java/org/cryptomator/ui/controls/FontAwesome5Icon.java +2 -0
@@ 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"), //

M main/ui/src/main/java/org/cryptomator/ui/mainwindow/MainWindowModule.java => main/ui/src/main/java/org/cryptomator/ui/mainwindow/MainWindowModule.java +5 -0
@@ 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

A main/ui/src/main/java/org/cryptomator/ui/mainwindow/VaultDetailMissingVaultController.java => main/ui/src/main/java/org/cryptomator/ui/mainwindow/VaultDetailMissingVaultController.java +20 -0
@@ 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;
	}

}

M main/ui/src/main/resources/fxml/vault_detail.fxml => main/ui/src/main/resources/fxml/vault_detail.fxml +1 -0
@@ 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>

A main/ui/src/main/resources/fxml/vault_detail_missing.fxml => main/ui/src/main/resources/fxml/vault_detail_missing.fxml +28 -0
@@ 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>
\ No newline at end of file

M main/ui/src/main/resources/i18n/strings.properties => main/ui/src/main/resources/i18n/strings.properties +2 -0
@@ 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