From 45d7421e4f6ce96cc3ec0de3f0490e76b8fa1b8e Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Wed, 11 Mar 2026 20:24:56 +0100 Subject: [PATCH] add "reset trusted hosts" button to general preferences --- .../preferences/GeneralPreferencesController.java | 14 ++++++++++++++ .../fxml/hub_check_host_authenticity.fxml | 1 - src/main/resources/fxml/preferences_general.fxml | 3 +++ src/main/resources/i18n/strings.properties | 1 + 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/cryptomator/ui/preferences/GeneralPreferencesController.java b/src/main/java/org/cryptomator/ui/preferences/GeneralPreferencesController.java index c59d03846..54628265a 100644 --- a/src/main/java/org/cryptomator/ui/preferences/GeneralPreferencesController.java +++ b/src/main/java/org/cryptomator/ui/preferences/GeneralPreferencesController.java @@ -21,6 +21,7 @@ import javax.inject.Inject; import javafx.beans.Observable; import javafx.beans.binding.Bindings; import javafx.fxml.FXML; +import javafx.scene.control.Button; import javafx.scene.control.CheckBox; import javafx.scene.control.ChoiceBox; import javafx.scene.control.ToggleGroup; @@ -56,6 +57,7 @@ public class GeneralPreferencesController implements FxController { public CheckBox autoCloseVaultsCheckbox; public CheckBox debugModeCheckbox; public CheckBox autoStartCheckbox; + public Button resetTrustedHostsButton; public ToggleGroup nodeOrientation; private CompletionStage keychainMigrations = CompletableFuture.completedFuture(null); @@ -105,6 +107,9 @@ public class GeneralPreferencesController implements FxController { quickAccessServiceChoiceBox.setConverter(new NamedServiceConverter<>()); Bindings.bindBidirectional(settings.quickAccessService, quickAccessServiceChoiceBox.valueProperty(), quickAccessSettingsConverter); quickAccessServiceChoiceBox.disableProperty().bind(useQuickAccessCheckbox.selectedProperty().not()); + if (resetTrustedHostsButton != null) { + resetTrustedHostsButton.disableProperty().bind(Bindings.isEmpty(settings.trustedHosts)); + } } private void migrateKeychainEntries(Observable observable, KeychainAccessProvider oldProvider, KeychainAccessProvider newProvider) { @@ -131,6 +136,10 @@ public class GeneralPreferencesController implements FxController { return autoStartProvider.isPresent(); } + public boolean isUnknownHubHostsAllowed() { + return Boolean.getBoolean("cryptomator.allowUnknownHubHosts"); + } + @FXML public void toggleAutoStart() { autoStartProvider.ifPresent(autoStart -> { @@ -153,6 +162,11 @@ public class GeneralPreferencesController implements FxController { return !quickAccessServices.isEmpty(); } + @FXML + public void resetTrustedHosts() { + settings.trustedHosts.clear(); + } + @FXML public void showLogfileDirectory() { try { diff --git a/src/main/resources/fxml/hub_check_host_authenticity.fxml b/src/main/resources/fxml/hub_check_host_authenticity.fxml index b14089e18..39c28ae87 100644 --- a/src/main/resources/fxml/hub_check_host_authenticity.fxml +++ b/src/main/resources/fxml/hub_check_host_authenticity.fxml @@ -40,7 +40,6 @@ -