-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add cleanup tor files button to tor network settings #1301
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -144,6 +144,7 @@ public class MainViewModel implements ViewModel { | |
private final FailedTradesManager failedTradesManager; | ||
private final ClosedTradableManager closedTradableManager; | ||
private final AccountAgeWitnessService accountAgeWitnessService; | ||
final TorNetworkSettingsWindow torNetworkSettingsWindow; | ||
private final BSFormatter formatter; | ||
|
||
// BTC network | ||
|
@@ -197,7 +198,6 @@ public class MainViewModel implements ViewModel { | |
private MonadicBinding<String> marketPriceBinding; | ||
@SuppressWarnings({"unused", "FieldCanBeLocal"}) | ||
private Subscription priceFeedAllLoadedSubscription; | ||
private TorNetworkSettingsWindow torNetworkSettingsWindow; | ||
private BooleanProperty p2pNetWorkReady; | ||
private final BooleanProperty walletInitialized = new SimpleBooleanProperty(); | ||
private boolean allBasicServicesInitialized; | ||
|
@@ -219,7 +219,7 @@ public MainViewModel(WalletsManager walletsManager, WalletsSetup walletsSetup, | |
DaoManager daoManager, EncryptionService encryptionService, | ||
KeyRing keyRing, BisqEnvironment bisqEnvironment, FailedTradesManager failedTradesManager, | ||
ClosedTradableManager closedTradableManager, AccountAgeWitnessService accountAgeWitnessService, | ||
BSFormatter formatter) { | ||
TorNetworkSettingsWindow torNetworkSettingsWindow, BSFormatter formatter) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a good example of adding a constructor parameter (see other comments) |
||
this.walletsManager = walletsManager; | ||
this.walletsSetup = walletsSetup; | ||
this.btcWalletService = btcWalletService; | ||
|
@@ -247,6 +247,7 @@ public MainViewModel(WalletsManager walletsManager, WalletsSetup walletsSetup, | |
this.failedTradesManager = failedTradesManager; | ||
this.closedTradableManager = closedTradableManager; | ||
this.accountAgeWitnessService = accountAgeWitnessService; | ||
this.torNetworkSettingsWindow = torNetworkSettingsWindow; | ||
this.formatter = formatter; | ||
|
||
TxIdTextField.setPreferences(preferences); | ||
|
@@ -332,7 +333,6 @@ private void startBasicServices() { | |
|
||
private void showTorNetworkSettingsWindow() { | ||
MainView.blur(); | ||
torNetworkSettingsWindow = new TorNetworkSettingsWindow(preferences).useShutDownButton(); | ||
torNetworkSettingsWindow.show(); | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,6 +90,7 @@ public class NetworkSettingsView extends ActivatableViewAndModel<GridPane, Activ | |
private final BitcoinNodes bitcoinNodes; | ||
private final FilterManager filterManager; | ||
private final BisqEnvironment bisqEnvironment; | ||
private final TorNetworkSettingsWindow torNetworkSettingsWindow; | ||
private final Clock clock; | ||
private final BSFormatter formatter; | ||
private final WalletsSetup walletsSetup; | ||
|
@@ -109,15 +110,23 @@ public class NetworkSettingsView extends ActivatableViewAndModel<GridPane, Activ | |
private ChangeListener<Filter> filterPropertyListener; | ||
|
||
@Inject | ||
public NetworkSettingsView(WalletsSetup walletsSetup, P2PService p2PService, Preferences preferences, BitcoinNodes bitcoinNodes, | ||
FilterManager filterManager, BisqEnvironment bisqEnvironment, Clock clock, BSFormatter formatter) { | ||
public NetworkSettingsView(WalletsSetup walletsSetup, | ||
P2PService p2PService, | ||
Preferences preferences, | ||
BitcoinNodes bitcoinNodes, | ||
FilterManager filterManager, | ||
BisqEnvironment bisqEnvironment, | ||
TorNetworkSettingsWindow torNetworkSettingsWindow, | ||
Clock clock, | ||
BSFormatter formatter) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we want to move to one-parameter per line parameter stacking like this. Creates a lot of vertical noise, and constructors with a zillion parameters are usually a signal of something needing to be refactored anyway. I'd prefer that we keep parameters aligned with the opening paren, but not stack one per line. Just go to the 120 margin, and create a new line as necessary. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Re typos: Re Popup: Re why it changes anything: Re ctor params: Re deleteDirectory: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense, re popup. I didn't realize that before. Thanks. On |
||
super(); | ||
this.walletsSetup = walletsSetup; | ||
this.p2PService = p2PService; | ||
this.preferences = preferences; | ||
this.bitcoinNodes = bitcoinNodes; | ||
this.filterManager = filterManager; | ||
this.bisqEnvironment = bisqEnvironment; | ||
this.torNetworkSettingsWindow = torNetworkSettingsWindow; | ||
this.clock = clock; | ||
this.formatter = formatter; | ||
} | ||
|
@@ -260,7 +269,7 @@ public void activate() { | |
btcNodesInputTextField.textProperty().addListener(btcNodesInputTextFieldListener); | ||
btcNodesInputTextField.focusedProperty().addListener(btcNodesInputTextFieldFocusListener); | ||
|
||
openTorSettingsButton.setOnAction(e -> new TorNetworkSettingsWindow(preferences).show()); | ||
openTorSettingsButton.setOnAction(e -> torNetworkSettingsWindow.show()); | ||
} | ||
|
||
@Override | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid one per line ctor parameter stacking (see other, more detailed comment)