diff --git a/main/ui/src/main/java/org/cryptomator/ui/mainwindow/VaultDetailController.java b/main/ui/src/main/java/org/cryptomator/ui/mainwindow/VaultDetailController.java index 580a9a825..9f4b7590e 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/mainwindow/VaultDetailController.java +++ b/main/ui/src/main/java/org/cryptomator/ui/mainwindow/VaultDetailController.java @@ -1,27 +1,24 @@ package org.cryptomator.ui.mainwindow; import javafx.beans.property.ObjectProperty; +import javafx.beans.property.ReadOnlyObjectProperty; import org.cryptomator.ui.FxApplicationScoped; import org.cryptomator.ui.FxController; import org.cryptomator.ui.model.Vault; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import javax.inject.Inject; @FxApplicationScoped public class VaultDetailController implements FxController { - - private static final Logger LOG = LoggerFactory.getLogger(VaultDetailController.class); - - private final ObjectProperty vault; + + private final ReadOnlyObjectProperty vault; @Inject VaultDetailController(ObjectProperty vault) { this.vault = vault; } - public ObjectProperty vaultProperty() { + public ReadOnlyObjectProperty vaultProperty() { return vault; } diff --git a/main/ui/src/main/java/org/cryptomator/ui/mainwindow/VaultListController.java b/main/ui/src/main/java/org/cryptomator/ui/mainwindow/VaultListController.java index e3e790663..6ad08016a 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/mainwindow/VaultListController.java +++ b/main/ui/src/main/java/org/cryptomator/ui/mainwindow/VaultListController.java @@ -4,22 +4,17 @@ import javafx.beans.binding.Bindings; import javafx.beans.property.ObjectProperty; import javafx.collections.ObservableList; import javafx.event.ActionEvent; -import javafx.fxml.FXML; import javafx.scene.control.ListView; import javafx.scene.layout.AnchorPane; import org.cryptomator.ui.FxApplicationScoped; import org.cryptomator.ui.FxController; import org.cryptomator.ui.model.Vault; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import javax.inject.Inject; @FxApplicationScoped public class VaultListController implements FxController { - private static final Logger LOG = LoggerFactory.getLogger(VaultListController.class); - private final ObservableList vaults; private final ObjectProperty selectedVault; public ListView vaultList; @@ -31,9 +26,7 @@ public class VaultListController implements FxController { this.selectedVault = selectedVault; } - @FXML public void initialize() { - LOG.debug("init VaultListController"); onboardingOverlay.visibleProperty().bind(Bindings.isEmpty(vaults)); vaultList.setItems(vaults); selectedVault.bind(vaultList.getSelectionModel().selectedItemProperty()); diff --git a/main/ui/src/main/java/org/cryptomator/ui/preferences/PreferencesController.java b/main/ui/src/main/java/org/cryptomator/ui/preferences/PreferencesController.java index 1265a3e9f..63a6fe390 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/preferences/PreferencesController.java +++ b/main/ui/src/main/java/org/cryptomator/ui/preferences/PreferencesController.java @@ -1,13 +1,38 @@ package org.cryptomator.ui.preferences; +import javafx.beans.binding.Bindings; +import javafx.beans.binding.BooleanBinding; +import javafx.scene.control.ChoiceBox; +import org.cryptomator.common.settings.Settings; +import org.cryptomator.common.settings.VolumeImpl; import org.cryptomator.ui.FxController; +import org.cryptomator.ui.model.Volume; import javax.inject.Inject; @PreferencesWindow public class PreferencesController implements FxController { + + private final Settings settings; + private final BooleanBinding showWebDavSettings; + public ChoiceBox volumeTypeChoicBox; @Inject - PreferencesController() {} + PreferencesController(Settings settings) { + this.settings = settings; + this.showWebDavSettings = Bindings.equal(settings.preferredVolumeImpl(), VolumeImpl.WEBDAV); + } + public void initialize() { + volumeTypeChoicBox.getItems().addAll(Volume.getCurrentSupportedAdapters()); + volumeTypeChoicBox.valueProperty().bindBidirectional(settings.preferredVolumeImpl()); + } + + public BooleanBinding showWebDavSettingsProperty() { + return showWebDavSettings; + } + + public Boolean getShowWebDavSettings() { + return showWebDavSettings.get(); + } } diff --git a/main/ui/src/main/resources/fxml/preferences.fxml b/main/ui/src/main/resources/fxml/preferences.fxml index fca37de6a..567902706 100644 --- a/main/ui/src/main/resources/fxml/preferences.fxml +++ b/main/ui/src/main/resources/fxml/preferences.fxml @@ -1,10 +1,42 @@ + + + + + + -