fixing ui bug: setting fields did not disappeared with mount adapter change

This commit is contained in:
Armin Schrenk
2018-10-05 17:42:35 +02:00
parent 8afa09007b
commit 50d2f16f71
2 changed files with 17 additions and 20 deletions

View File

@@ -8,12 +8,6 @@
******************************************************************************/
package org.cryptomator.ui.controllers;
import java.util.Optional;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
import com.google.common.base.CharMatcher;
import com.google.common.base.Strings;
import javafx.beans.binding.Bindings;
@@ -27,15 +21,19 @@ import javafx.scene.control.ChoiceBox;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.input.KeyEvent;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.VBox;
import javafx.util.StringConverter;
import org.apache.commons.lang3.SystemUtils;
import org.cryptomator.common.settings.VolumeImpl;
import org.cryptomator.common.settings.Settings;
import org.cryptomator.common.settings.VolumeImpl;
import org.cryptomator.ui.l10n.Localization;
import org.cryptomator.ui.model.Volume;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
import java.util.Optional;
@Singleton
public class SettingsController implements ViewController {
@@ -50,13 +48,13 @@ public class SettingsController implements ViewController {
this.localization = localization;
this.settings = settings;
this.applicationVersion = applicationVersion;
this.webdavSettings = new Group();
}
@FXML
private CheckBox checkForUpdatesCheckbox;
@FXML
private Group webdavVolume;
private Group webdavSettings;
@FXML
private Label portFieldLabel;
@@ -97,13 +95,15 @@ public class SettingsController implements ViewController {
volume.setConverter(new NioAdapterImplStringConverter());
//WEBDAV
webdavVolume.visibleProperty().bind(volume.valueProperty().isEqualTo(VolumeImpl.WEBDAV));
webdavVolume.managedProperty().bind(webdavVolume.visibleProperty());
prefGvfsScheme.managedProperty().bind(webdavVolume.visibleProperty());
prefGvfsSchemeLabel.managedProperty().bind(webdavVolume.visibleProperty());
portFieldLabel.managedProperty().bind(webdavVolume.visibleProperty());
changePortButton.managedProperty().bind(webdavVolume.visibleProperty());
portField.managedProperty().bind(webdavVolume.visibleProperty());
webdavSettings.visibleProperty().bind(volume.valueProperty().isEqualTo(VolumeImpl.WEBDAV));
webdavSettings.managedProperty().bind(webdavSettings.visibleProperty());
prefGvfsScheme.managedProperty().bind(webdavSettings.visibleProperty());
prefGvfsSchemeLabel.managedProperty().bind(webdavSettings.visibleProperty());
portFieldLabel.managedProperty().bind(webdavSettings.visibleProperty());
portFieldLabel.visibleProperty().bind(webdavSettings.visibleProperty());
changePortButton.managedProperty().bind(webdavSettings.visibleProperty());
portField.managedProperty().bind(webdavSettings.visibleProperty());
portField.visibleProperty().bind(webdavSettings.visibleProperty());
portField.setText(String.valueOf(settings.port().intValue()));
portField.addEventFilter(KeyEvent.KEY_TYPED, this::filterNumericKeyEvents);
changePortButton.visibleProperty().bind(settings.port().asString().isNotEqualTo(portField.textProperty()));

View File

@@ -45,9 +45,6 @@
<Label fx:id="volumeLabel" GridPane.rowIndex="2" GridPane.columnIndex="0" text="%settings.volume.label" cacheShape="true" cache="true" />
<ChoiceBox GridPane.rowIndex="2" GridPane.columnIndex="1" fx:id="volume" cacheShape="true" cache="true" />
<Group fx:id="webdavVolume">
</Group>
<!-- Row 3 Alt 1-->
<Label fx:id="portFieldLabel" GridPane.rowIndex="3" GridPane.columnIndex="0" text="%settings.webdav.port.label" cacheShape="true" cache="true" />
<HBox GridPane.rowIndex="3" GridPane.columnIndex="1" spacing="6.0">