diff --git a/main/commons/src/main/java/org/cryptomator/common/settings/Settings.java b/main/commons/src/main/java/org/cryptomator/common/settings/Settings.java index c66556461..5ef5df1c4 100644 --- a/main/commons/src/main/java/org/cryptomator/common/settings/Settings.java +++ b/main/commons/src/main/java/org/cryptomator/common/settings/Settings.java @@ -29,7 +29,6 @@ public class Settings { public static final int MAX_PORT = 65535; public static final boolean DEFAULT_CHECK_FOR_UDPATES = true; public static final int DEFAULT_PORT = 42427; - public static final boolean DEFAULT_USE_IPV6 = SystemUtils.IS_OS_WINDOWS; public static final int DEFAULT_NUM_TRAY_NOTIFICATIONS = 3; public static final String DEFAULT_GVFS_SCHEME = "dav"; public static final boolean DEFAULT_DEBUG_MODE = false; @@ -37,7 +36,6 @@ public class Settings { private final ObservableList directories = FXCollections.observableArrayList(VaultSettings::observables); private final BooleanProperty checkForUpdates = new SimpleBooleanProperty(DEFAULT_CHECK_FOR_UDPATES); private final IntegerProperty port = new SimpleIntegerProperty(DEFAULT_PORT); - private final BooleanProperty useIpv6 = new SimpleBooleanProperty(DEFAULT_USE_IPV6); private final IntegerProperty numTrayNotifications = new SimpleIntegerProperty(DEFAULT_NUM_TRAY_NOTIFICATIONS); private final StringProperty preferredGvfsScheme = new SimpleStringProperty(DEFAULT_GVFS_SCHEME); private final BooleanProperty debugMode = new SimpleBooleanProperty(DEFAULT_DEBUG_MODE); @@ -50,7 +48,6 @@ public class Settings { directories.addListener((ListChangeListener.Change change) -> this.save()); checkForUpdates.addListener(this::somethingChanged); port.addListener(this::somethingChanged); - useIpv6.addListener(this::somethingChanged); numTrayNotifications.addListener(this::somethingChanged); preferredGvfsScheme.addListener(this::somethingChanged); debugMode.addListener(this::somethingChanged); @@ -84,10 +81,6 @@ public class Settings { return port; } - public BooleanProperty useIpv6() { - return useIpv6; - } - public IntegerProperty numTrayNotifications() { return numTrayNotifications; } diff --git a/main/commons/src/main/java/org/cryptomator/common/settings/SettingsJsonAdapter.java b/main/commons/src/main/java/org/cryptomator/common/settings/SettingsJsonAdapter.java index cc1bc3792..e474fcf7c 100644 --- a/main/commons/src/main/java/org/cryptomator/common/settings/SettingsJsonAdapter.java +++ b/main/commons/src/main/java/org/cryptomator/common/settings/SettingsJsonAdapter.java @@ -30,7 +30,6 @@ public class SettingsJsonAdapter extends TypeAdapter { writeVaultSettingsArray(out, value.getDirectories()); out.name("checkForUpdatesEnabled").value(value.checkForUpdates().get()); out.name("port").value(value.port().get()); - out.name("useIpv6").value(value.useIpv6().get()); out.name("numTrayNotifications").value(value.numTrayNotifications().get()); out.name("preferredGvfsScheme").value(value.preferredGvfsScheme().get()); out.name("debugMode").value(value.debugMode().get()); @@ -62,12 +61,6 @@ public class SettingsJsonAdapter extends TypeAdapter { case "port": settings.port().set(in.nextInt()); break; - case "useIpv6": - // Temporarily we will disable loading this setting, as we want the default value on each app start. - // This setting might be removed completely in the future - // settings.useIpv6().set(in.nextBoolean()); - in.skipValue(); - break; case "numTrayNotifications": settings.numTrayNotifications().set(in.nextInt()); break; diff --git a/main/ui/src/main/java/org/cryptomator/ui/UiModule.java b/main/ui/src/main/java/org/cryptomator/ui/UiModule.java index cdc55a99f..60f6a76e7 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/UiModule.java +++ b/main/ui/src/main/java/org/cryptomator/ui/UiModule.java @@ -16,6 +16,7 @@ import java.util.function.Consumer; import javax.inject.Named; import javax.inject.Singleton; +import org.apache.commons.lang3.SystemUtils; import org.cryptomator.common.CommonsModule; import org.cryptomator.common.settings.Settings; import org.cryptomator.common.settings.SettingsProvider; @@ -50,8 +51,8 @@ public class UiModule { @Provides @Singleton Binding provideServerSocketAddressBinding(Settings settings) { - return EasyBind.combine(settings.useIpv6(), settings.port(), (useIpv6, port) -> { - String host = useIpv6 ? "::1" : "localhost"; + return EasyBind.map(settings.port(), (Number port) -> { + String host = SystemUtils.IS_OS_WINDOWS ? "127.0.0.1" : "localhost"; return InetSocketAddress.createUnresolved(host, port.intValue()); }); } diff --git a/main/ui/src/main/java/org/cryptomator/ui/controllers/SettingsController.java b/main/ui/src/main/java/org/cryptomator/ui/controllers/SettingsController.java index d43d9be35..20ac7cac6 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/controllers/SettingsController.java +++ b/main/ui/src/main/java/org/cryptomator/ui/controllers/SettingsController.java @@ -58,12 +58,6 @@ public class SettingsController implements ViewController { @FXML private Button changePortButton; - @FXML - private Label useIpv6Label; - - @FXML - private CheckBox useIpv6Checkbox; - @FXML private Label versionLabel; @@ -87,9 +81,6 @@ public class SettingsController implements ViewController { portField.addEventFilter(KeyEvent.KEY_TYPED, this::filterNumericKeyEvents); changePortButton.visibleProperty().bind(settings.port().asString().isNotEqualTo(portField.textProperty())); changePortButton.disableProperty().bind(Bindings.createBooleanBinding(this::isPortValid, portField.textProperty()).not()); - useIpv6Label.setVisible(SystemUtils.IS_OS_WINDOWS); - useIpv6Checkbox.setVisible(SystemUtils.IS_OS_WINDOWS); - useIpv6Checkbox.setSelected(SystemUtils.IS_OS_WINDOWS && settings.useIpv6().get()); versionLabel.setText(String.format(localization.getString("settings.version.label"), applicationVersion.orElse("SNAPSHOT"))); prefGvfsSchemeLabel.setVisible(SystemUtils.IS_OS_LINUX); prefGvfsScheme.setVisible(SystemUtils.IS_OS_LINUX); @@ -99,7 +90,6 @@ public class SettingsController implements ViewController { debugModeCheckbox.setSelected(settings.debugMode().get()); settings.checkForUpdates().bind(checkForUpdatesCheckbox.selectedProperty()); - settings.useIpv6().bind(useIpv6Checkbox.selectedProperty()); settings.preferredGvfsScheme().bind(prefGvfsScheme.valueProperty()); settings.debugMode().bind(debugModeCheckbox.selectedProperty()); } diff --git a/main/ui/src/main/resources/fxml/settings.fxml b/main/ui/src/main/resources/fxml/settings.fxml index 4f7fc3bfe..d3f9c7c12 100644 --- a/main/ui/src/main/resources/fxml/settings.fxml +++ b/main/ui/src/main/resources/fxml/settings.fxml @@ -43,18 +43,13 @@