Use bindBidirectional
This commit is contained in:
@@ -105,17 +105,10 @@ public final class SettingsPage extends StackPane implements DecoratorPage {
|
|||||||
|
|
||||||
FXUtils.smoothScrolling(scroll);
|
FXUtils.smoothScrolling(scroll);
|
||||||
|
|
||||||
txtProxyHost.setText(ConfigHolder.CONFIG.proxyHost.get());
|
txtProxyHost.textProperty().bindBidirectional(ConfigHolder.CONFIG.proxyHost);
|
||||||
txtProxyHost.textProperty().addListener((a, b, newValue) -> ConfigHolder.CONFIG.proxyHost.set(newValue));
|
txtProxyPort.textProperty().bindBidirectional(ConfigHolder.CONFIG.proxyPort);
|
||||||
|
txtProxyUsername.textProperty().bindBidirectional(ConfigHolder.CONFIG.proxyUser);
|
||||||
txtProxyPort.setText(ConfigHolder.CONFIG.proxyPort.get());
|
txtProxyPassword.textProperty().bindBidirectional(ConfigHolder.CONFIG.proxyPass);
|
||||||
txtProxyPort.textProperty().addListener((a, b, newValue) -> ConfigHolder.CONFIG.proxyPort.set(newValue));
|
|
||||||
|
|
||||||
txtProxyUsername.setText(ConfigHolder.CONFIG.proxyUser.get());
|
|
||||||
txtProxyUsername.textProperty().addListener((a, b, newValue) -> ConfigHolder.CONFIG.proxyUser.set(newValue));
|
|
||||||
|
|
||||||
txtProxyPassword.setText(ConfigHolder.CONFIG.proxyPass.get());
|
|
||||||
txtProxyPassword.textProperty().addListener((a, b, newValue) -> ConfigHolder.CONFIG.proxyPass.set(newValue));
|
|
||||||
|
|
||||||
cboDownloadSource.getSelectionModel().select(DownloadProviders.DOWNLOAD_PROVIDERS.indexOf(Settings.INSTANCE.getDownloadProvider()));
|
cboDownloadSource.getSelectionModel().select(DownloadProviders.DOWNLOAD_PROVIDERS.indexOf(Settings.INSTANCE.getDownloadProvider()));
|
||||||
cboDownloadSource.getSelectionModel().selectedIndexProperty().addListener((a, b, newValue) -> Settings.INSTANCE.setDownloadProvider(DownloadProviders.getDownloadProvider(newValue.intValue())));
|
cboDownloadSource.getSelectionModel().selectedIndexProperty().addListener((a, b, newValue) -> Settings.INSTANCE.setDownloadProvider(DownloadProviders.getDownloadProvider(newValue.intValue())));
|
||||||
@@ -173,8 +166,7 @@ public final class SettingsPage extends StackPane implements DecoratorPage {
|
|||||||
proxyConfigurationGroup.selectedToggleProperty().addListener((a, b, newValue) ->
|
proxyConfigurationGroup.selectedToggleProperty().addListener((a, b, newValue) ->
|
||||||
ConfigHolder.CONFIG.proxyType.set((Proxy.Type) newValue.getUserData()));
|
ConfigHolder.CONFIG.proxyType.set((Proxy.Type) newValue.getUserData()));
|
||||||
|
|
||||||
chkProxyAuthentication.setSelected(ConfigHolder.CONFIG.hasProxyAuth.get());
|
chkProxyAuthentication.selectedProperty().bindBidirectional(ConfigHolder.CONFIG.hasProxyAuth);
|
||||||
chkProxyAuthentication.selectedProperty().addListener((a, b, newValue) -> ConfigHolder.CONFIG.hasProxyAuth.set(newValue));
|
|
||||||
authPane.disableProperty().bind(chkProxyAuthentication.selectedProperty().not());
|
authPane.disableProperty().bind(chkProxyAuthentication.selectedProperty().not());
|
||||||
|
|
||||||
fileCommonLocation.pathProperty().bindBidirectional(ConfigHolder.CONFIG.commonDirectory);
|
fileCommonLocation.pathProperty().bindBidirectional(ConfigHolder.CONFIG.commonDirectory);
|
||||||
|
|||||||
Reference in New Issue
Block a user