|
@@ -2,6 +2,8 @@ package org.cryptomator.ui.vaultoptions;
|
|
|
|
|
|
import org.cryptomator.common.vaults.Vault;
|
|
|
import org.cryptomator.ui.common.FxController;
|
|
|
+import org.cryptomator.ui.keyloading.hub.HubKeyLoadingStrategy;
|
|
|
+import org.cryptomator.ui.keyloading.masterkeyfile.MasterkeyFileLoadingStrategy;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
@@ -25,6 +27,7 @@ public class VaultOptionsController implements FxController {
|
|
|
public Tab generalTab;
|
|
|
public Tab mountTab;
|
|
|
public Tab keyTab;
|
|
|
+ public Tab hubTab;
|
|
|
|
|
|
@Inject
|
|
|
VaultOptionsController(@VaultOptionsWindow Stage window, @VaultOptionsWindow Vault vault, ObjectProperty<SelectedVaultOptionsTab> selectedTabProperty) {
|
|
@@ -38,9 +41,13 @@ public class VaultOptionsController implements FxController {
|
|
|
window.setOnShowing(this::windowWillAppear);
|
|
|
selectedTabProperty.addListener(observable -> this.selectChosenTab());
|
|
|
tabPane.getSelectionModel().selectedItemProperty().addListener(observable -> this.selectedTabChanged());
|
|
|
- if(!vault.getVaultConfigCache().getUnchecked().getKeyId().getScheme().equals("masterkeyfile")){
|
|
|
+ var vaultScheme = vault.getVaultConfigCache().getUnchecked().getKeyId().getScheme();
|
|
|
+ if(!vaultScheme.equals(MasterkeyFileLoadingStrategy.SCHEME)){
|
|
|
tabPane.getTabs().remove(keyTab);
|
|
|
}
|
|
|
+ if(!(vaultScheme.equals(HubKeyLoadingStrategy.SCHEME_HUB_HTTP) || vaultScheme.equals(HubKeyLoadingStrategy.SCHEME_HUB_HTTPS))){
|
|
|
+ tabPane.getTabs().remove(hubTab);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private void selectChosenTab() {
|
|
@@ -53,6 +60,7 @@ public class VaultOptionsController implements FxController {
|
|
|
case ANY, GENERAL -> generalTab;
|
|
|
case MOUNT -> mountTab;
|
|
|
case KEY -> keyTab;
|
|
|
+ case HUB -> hubTab;
|
|
|
};
|
|
|
}
|
|
|
|