mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-23 21:21:31 +00:00
WebDavScheme setting only shown under linux
This commit is contained in:
@@ -2,10 +2,12 @@ package org.cryptomator.ui.preferences;
|
||||
|
||||
import javafx.beans.binding.Bindings;
|
||||
import javafx.beans.binding.BooleanBinding;
|
||||
import javafx.beans.property.SimpleBooleanProperty;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.ChoiceBox;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.util.StringConverter;
|
||||
import org.apache.commons.lang3.SystemUtils;
|
||||
import org.cryptomator.common.settings.Settings;
|
||||
import org.cryptomator.common.settings.VolumeImpl;
|
||||
import org.cryptomator.common.settings.WebDavUrlScheme;
|
||||
@@ -19,6 +21,7 @@ public class VolumePreferencesController implements FxController {
|
||||
|
||||
private final Settings settings;
|
||||
private final BooleanBinding showWebDavSettings;
|
||||
private final BooleanBinding showWebDavScheme;
|
||||
public ChoiceBox<VolumeImpl> volumeTypeChoicBox;
|
||||
public TextField webDavPortField;
|
||||
public Button changeWebDavPortButton;
|
||||
@@ -28,6 +31,7 @@ public class VolumePreferencesController implements FxController {
|
||||
VolumePreferencesController(Settings settings) {
|
||||
this.settings = settings;
|
||||
this.showWebDavSettings = Bindings.equal(settings.preferredVolumeImpl(), VolumeImpl.WEBDAV);
|
||||
this.showWebDavScheme = showWebDavSettings.and(new SimpleBooleanProperty(SystemUtils.IS_OS_LINUX)); //TODO: remove SystemUtils
|
||||
}
|
||||
|
||||
public void initialize() {
|
||||
@@ -68,6 +72,14 @@ public class VolumePreferencesController implements FxController {
|
||||
return showWebDavSettings.get();
|
||||
}
|
||||
|
||||
public BooleanBinding showWebDavSchemeProperty() {
|
||||
return showWebDavScheme;
|
||||
}
|
||||
|
||||
public Boolean getShowWebDavScheme() {
|
||||
return showWebDavScheme.get();
|
||||
}
|
||||
|
||||
/* Helper classes */
|
||||
|
||||
private static class WebDavUrlSchemeConverter extends StringConverter<WebDavUrlScheme> {
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<Button text="%generic.button.apply" fx:id="changeWebDavPortButton" onAction="#doChangeWebDavPort"/>
|
||||
</HBox>
|
||||
|
||||
<HBox spacing="6" alignment="CENTER_LEFT" visible="${controller.showWebDavSettings}">
|
||||
<HBox spacing="6" alignment="CENTER_LEFT" visible="${controller.showWebDavScheme}">
|
||||
<Label text="%preferences.volume.webdav.scheme"/>
|
||||
<ChoiceBox fx:id="webDavUrlSchemeChoiceBox" maxWidth="Infinity"/>
|
||||
</HBox>
|
||||
|
||||
Reference in New Issue
Block a user