瀏覽代碼

Revert "Add disable all keyrings setting checkbox"

This reverts commit d037c6bc140495b5469c2a25ae2a7a2752bc35dc.
Ralph Plawetzki 2 年之前
父節點
當前提交
23fad16742

+ 1 - 5
src/main/java/org/cryptomator/common/settings/VaultSettings.java

@@ -32,7 +32,6 @@ public class VaultSettings {
 
 	public static final boolean DEFAULT_UNLOCK_AFTER_STARTUP = false;
 	public static final boolean DEFAULT_REVEAL_AFTER_MOUNT = true;
-	public static final boolean DEFAULT_DISABLE_ALL_KEYRINGS = false;
 	public static final boolean DEFAULT_USES_INDIVIDUAL_MOUNTPATH = false;
 	public static final boolean DEFAULT_USES_READONLY_MODE = false;
 	public static final String DEFAULT_MOUNT_FLAGS = "";
@@ -49,7 +48,6 @@ public class VaultSettings {
 	private final StringProperty winDriveLetter = new SimpleStringProperty();
 	private final BooleanProperty unlockAfterStartup = new SimpleBooleanProperty(DEFAULT_UNLOCK_AFTER_STARTUP);
 	private final BooleanProperty revealAfterMount = new SimpleBooleanProperty(DEFAULT_REVEAL_AFTER_MOUNT);
-	private final BooleanProperty disableAllKeyrings = new SimpleBooleanProperty(DEFAULT_DISABLE_ALL_KEYRINGS);
 	private final BooleanProperty useCustomMountPath = new SimpleBooleanProperty(DEFAULT_USES_INDIVIDUAL_MOUNTPATH);
 	private final StringProperty customMountPath = new SimpleStringProperty();
 	private final BooleanProperty usesReadOnlyMode = new SimpleBooleanProperty(DEFAULT_USES_READONLY_MODE);
@@ -66,7 +64,7 @@ public class VaultSettings {
 	}
 
 	Observable[] observables() {
-		return new Observable[]{path, displayName, winDriveLetter, unlockAfterStartup, revealAfterMount, disableAllKeyrings, useCustomMountPath, customMountPath, usesReadOnlyMode, mountFlags, maxCleartextFilenameLength, actionAfterUnlock, autoLockWhenIdle, autoLockIdleSeconds};
+		return new Observable[]{path, displayName, winDriveLetter, unlockAfterStartup, revealAfterMount, useCustomMountPath, customMountPath, usesReadOnlyMode, mountFlags, maxCleartextFilenameLength, actionAfterUnlock, autoLockWhenIdle, autoLockIdleSeconds};
 	}
 
 	public static VaultSettings withRandomId() {
@@ -131,8 +129,6 @@ public class VaultSettings {
 		return revealAfterMount;
 	}
 
-	public BooleanProperty disableAllKeyrings() {return disableAllKeyrings; }
-
 	public BooleanProperty useCustomMountPath() {
 		return useCustomMountPath;
 	}

+ 0 - 4
src/main/java/org/cryptomator/common/settings/VaultSettingsJsonAdapter.java

@@ -33,7 +33,6 @@ class VaultSettingsJsonAdapter {
 		out.name("actionAfterUnlock").value(value.actionAfterUnlock().get().name());
 		out.name("autoLockWhenIdle").value(value.autoLockWhenIdle().get());
 		out.name("autoLockIdleSeconds").value(value.autoLockIdleSeconds().get());
-		out.name("disableAllKeyrings").value(value.disableAllKeyrings().get());
 		out.endObject();
 	}
 
@@ -53,7 +52,6 @@ class VaultSettingsJsonAdapter {
 		WhenUnlocked actionAfterUnlock = VaultSettings.DEFAULT_ACTION_AFTER_UNLOCK;
 		boolean autoLockWhenIdle = VaultSettings.DEFAULT_AUTOLOCK_WHEN_IDLE;
 		int autoLockIdleSeconds = VaultSettings.DEFAULT_AUTOLOCK_IDLE_SECONDS;
-		boolean disableAllKeyrings = VaultSettings.DEFAULT_DISABLE_ALL_KEYRINGS;
 
 		in.beginObject();
 		while (in.hasNext()) {
@@ -74,7 +72,6 @@ class VaultSettingsJsonAdapter {
 				case "actionAfterUnlock" -> actionAfterUnlock = parseActionAfterUnlock(in.nextString());
 				case "autoLockWhenIdle" -> autoLockWhenIdle = in.nextBoolean();
 				case "autoLockIdleSeconds" -> autoLockIdleSeconds = in.nextInt();
-				case "disableAllKeyrings" -> disableAllKeyrings = in.nextBoolean();
 				default -> {
 					LOG.warn("Unsupported vault setting found in JSON: {}", name);
 					in.skipValue();
@@ -101,7 +98,6 @@ class VaultSettingsJsonAdapter {
 		vaultSettings.actionAfterUnlock().set(actionAfterUnlock);
 		vaultSettings.autoLockWhenIdle().set(autoLockWhenIdle);
 		vaultSettings.autoLockIdleSeconds().set(autoLockIdleSeconds);
-		vaultSettings.disableAllKeyrings().set(disableAllKeyrings);
 		return vaultSettings;
 	}
 

+ 5 - 7
src/main/java/org/cryptomator/ui/vaultoptions/MasterkeyOptionsController.java

@@ -2,28 +2,31 @@ package org.cryptomator.ui.vaultoptions;
 
 import org.cryptomator.common.keychain.KeychainManager;
 import org.cryptomator.common.vaults.Vault;
+import org.cryptomator.integrations.keychain.KeychainAccessException;
 import org.cryptomator.ui.changepassword.ChangePasswordComponent;
 import org.cryptomator.ui.common.FxController;
 import org.cryptomator.ui.forgetPassword.ForgetPasswordComponent;
 import org.cryptomator.ui.recoverykey.RecoveryKeyComponent;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.inject.Inject;
 import javafx.beans.binding.Bindings;
 import javafx.beans.binding.BooleanExpression;
 import javafx.beans.property.SimpleBooleanProperty;
 import javafx.fxml.FXML;
-import javafx.scene.control.CheckBox;
 import javafx.stage.Stage;
 
 @VaultOptionsScoped
 public class MasterkeyOptionsController implements FxController {
 
+	private static final Logger LOG = LoggerFactory.getLogger(MasterkeyOptionsController.class);
+
 	private final Vault vault;
 	private final Stage window;
 	private final ChangePasswordComponent.Builder changePasswordWindow;
 	private final RecoveryKeyComponent.Builder recoveryKeyWindow;
 	private final ForgetPasswordComponent.Builder forgetPasswordWindow;
-	public CheckBox disableAllKeyringsCheckbox;
 	private final KeychainManager keychain;
 	private final BooleanExpression passwordSaved;
 
@@ -43,11 +46,6 @@ public class MasterkeyOptionsController implements FxController {
 		}
 	}
 
-	@FXML
-	public void initialize() {
-		this.disableAllKeyringsCheckbox.selectedProperty().bindBidirectional(vault.getVaultSettings().disableAllKeyrings());
-	}
-
 	@FXML
 	public void changePassword() {
 		changePasswordWindow.vault(vault).owner(window).build().showChangePasswordWindow();

+ 0 - 4
src/main/resources/fxml/vault_options_masterkey.fxml

@@ -6,7 +6,6 @@
 <?import javafx.scene.control.Label?>
 <?import javafx.scene.layout.Region?>
 <?import javafx.scene.layout.VBox?>
-<?import javafx.scene.control.CheckBox?>
 <VBox xmlns:fx="http://javafx.com/fxml"
 	  xmlns="http://javafx.com/javafx"
 	  fx:controller="org.cryptomator.ui.vaultoptions.MasterkeyOptionsController"
@@ -29,9 +28,6 @@
 				</graphic>
 			</Button>
 		</VBox>
-
-		<CheckBox text="%vaultOptions.masterkey.disableAllKeyrings" fx:id="disableAllKeyringsCheckbox"/>
-
 		<Region VBox.vgrow="ALWAYS"/>
 		<Label maxWidth="-Infinity" text="%vaultOptions.masterkey.recoveryKeyExplanation" wrapText="true"/>
 		<VBox spacing="6" alignment="CENTER">

+ 0 - 1
src/main/resources/i18n/strings.properties

@@ -390,7 +390,6 @@ vaultOptions.mount.mountPoint.directoryPickerTitle=Pick an empty directory
 vaultOptions.masterkey=Password
 vaultOptions.masterkey.changePasswordBtn=Change Password
 vaultOptions.masterkey.forgetSavedPasswordBtn=Forget Saved Password
-vaultOptions.masterkey.disableAllKeyrings=Disable all keyrings
 vaultOptions.masterkey.recoveryKeyExplanation=A recovery key is your only means to restore access to a vault if you lose your password.
 vaultOptions.masterkey.showRecoveryKeyBtn=Display Recovery Key
 vaultOptions.masterkey.recoverPasswordBtn=Reset Password