#926 replacing boolean by a string for current vault state

This commit is contained in:
Armin Schrenk
2019-08-16 15:54:08 +02:00
parent e32ddd07ea
commit fc51e5caff
3 changed files with 26 additions and 10 deletions

View File

@@ -1,5 +1,6 @@
package org.cryptomator.ui.mainwindow;
import javafx.beans.binding.BooleanBinding;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.ReadOnlyObjectProperty;
import javafx.fxml.FXML;
@@ -21,6 +22,7 @@ public class VaultDetailController implements FxController {
private static final Logger LOG = LoggerFactory.getLogger(VaultDetailController.class);
private final ReadOnlyObjectProperty<Vault> vault;
private final BooleanBinding anyVaultSelected;
private final ExecutorService executor;
private final FxApplication application;
private final VaultOptionsComponent.Builder vaultOptionsWindow;
@@ -33,6 +35,7 @@ public class VaultDetailController implements FxController {
this.application = application;
this.vaultOptionsWindow = vaultOptionsWindow;
this.changePasswordWindow = changePasswordWindow;
this.anyVaultSelected = vault.isNotNull();
}
@FXML
@@ -74,4 +77,12 @@ public class VaultDetailController implements FxController {
return vault.get();
}
public BooleanBinding anyVaultSelectedProperty() {
return anyVaultSelected;
}
public boolean isAnyVaultSelected() {
return anyVaultSelected.get();
}
}

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Text?>
<?import javafx.scene.text.TextFlow?>
<VBox xmlns="http://javafx.com/javafx"
@@ -14,18 +14,23 @@
</padding>
<children>
<!--TODO: add caption style class -->
<Text text="${controller.vault.displayableName}" />
<TextFlow><!--TODO: add visibility of the textflows -->
<Text text="%vaultDetail.info.storageLocation" />
<Text text="${controller.vault.displayableName}"/>
<TextFlow visible="${controller.anyVaultSelected}"><!--TODO: add visibility of the textflows -->
<Text text="%vaultDetail.info.storageLocation"/>
<Text text="&quot;"/>
<Text text="${controller.vault.displayablePath}"/>
<Text text="&quot;"/>
</TextFlow>
<TextFlow>
<Text text="%vaultDetail.info.accessLocation" />
<TextFlow visible="${controller.anyVaultSelected}">
<Text text="%vaultDetail.info.accessLocation"/>
<Text text="&quot;"/>
<Text text="${controller.vault.customMountPath}"/>
<Text text="&quot;"/>
</TextFlow>
<TextFlow>
<Text text="%vaultDetail.info.currentState" />
<Text text="${controller.vault.locked}"/>
<TextFlow visible="${controller.anyVaultSelected}">
<Text text="%vaultDetail.info.currentState"/>
<Text text="LOCKED" visible="${controller.vault.locked}" managed="${controller.vault.locked}"/><!-- hacky but working -->
<Text text="UNLOCKED" visible="${controller.vault.unlocked}" managed="${controller.vault.unlocked}"/>
</TextFlow>
<Button text="TODO unlock" onAction="#unlock" visible="${controller.vault.locked}" defaultButton="${controller.vault.locked}"/>

View File

@@ -65,7 +65,7 @@ main.closeBtn.tooltip=Close
main.settingsBtn.tooltip=Settings
vaultlist.emptyList.onboardingInstruction=Click here to add a vault
## Vault detail
vaultDetail.info.storageLocation=Stored at
vaultDetail.info.storageLocation=Stored at
vaultDetail.info.accessLocation=Accesssible at
vaultDetail.info.currentState=Currently