From 3183f5f732945e1564889bbb94df590f192a1a36 Mon Sep 17 00:00:00 2001 From: Christoph Atteneder Date: Wed, 5 Feb 2020 10:29:55 +0100 Subject: [PATCH] Minor code cleanups --- .../settings/network/NetworkSettingsView.java | 28 +++++++------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/desktop/src/main/java/bisq/desktop/main/settings/network/NetworkSettingsView.java b/desktop/src/main/java/bisq/desktop/main/settings/network/NetworkSettingsView.java index 359e6864c2..2773fe996d 100644 --- a/desktop/src/main/java/bisq/desktop/main/settings/network/NetworkSettingsView.java +++ b/desktop/src/main/java/bisq/desktop/main/settings/network/NetworkSettingsView.java @@ -29,8 +29,8 @@ import bisq.desktop.main.overlays.windows.TorNetworkSettingsWindow; import bisq.desktop.util.GUIUtil; import bisq.desktop.util.validation.RegexValidator; -import bisq.core.btc.nodes.LocalBitcoinNode; import bisq.core.btc.nodes.BtcNodes; +import bisq.core.btc.nodes.LocalBitcoinNode; import bisq.core.btc.setup.WalletsSetup; import bisq.core.filter.Filter; import bisq.core.filter.FilterManager; @@ -246,9 +246,7 @@ public class NetworkSettingsView extends ActivatableView { showShutDownPopup(); } }; - filterPropertyListener = (observable, oldValue, newValue) -> { - applyPreventPublicBtcNetwork(); - }; + filterPropertyListener = (observable, oldValue, newValue) -> applyPreventPublicBtcNetwork(); //TODO sorting needs other NetworkStatisticListItem as columns type /* creationDateColumn.setComparator((o1, o2) -> @@ -402,9 +400,7 @@ public class NetworkSettingsView extends ActivatableView { if (calledFromUser) { if (isPreventPublicBtcNetwork()) { new Popup().warning(Res.get("settings.net.warn.useCustomNodes.B2XWarning")) - .onAction(() -> { - UserThread.runAfter(this::showShutDownPopup, 300, TimeUnit.MILLISECONDS); - }).show(); + .onAction(() -> UserThread.runAfter(this::showShutDownPopup, 300, TimeUnit.MILLISECONDS)).show(); } else { showShutDownPopup(); } @@ -420,18 +416,14 @@ public class NetworkSettingsView extends ActivatableView { new Popup() .warning(Res.get("settings.net.warn.usePublicNodes")) .actionButtonText(Res.get("settings.net.warn.usePublicNodes.useProvided")) - .onAction(() -> { - UserThread.runAfter(() -> { - selectedBitcoinNodesOption = BtcNodes.BitcoinNodesOption.PROVIDED; - preferences.setBitcoinNodesOptionOrdinal(selectedBitcoinNodesOption.ordinal()); - selectBitcoinPeersToggle(); - onBitcoinPeersToggleSelected(false); - }, 300, TimeUnit.MILLISECONDS); - }) + .onAction(() -> UserThread.runAfter(() -> { + selectedBitcoinNodesOption = BtcNodes.BitcoinNodesOption.PROVIDED; + preferences.setBitcoinNodesOptionOrdinal(selectedBitcoinNodesOption.ordinal()); + selectBitcoinPeersToggle(); + onBitcoinPeersToggleSelected(false); + }, 300, TimeUnit.MILLISECONDS)) .closeButtonText(Res.get("settings.net.warn.usePublicNodes.usePublic")) - .onClose(() -> { - UserThread.runAfter(this::showShutDownPopup, 300, TimeUnit.MILLISECONDS); - }) + .onClose(() -> UserThread.runAfter(this::showShutDownPopup, 300, TimeUnit.MILLISECONDS)) .show(); } }