-
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 1 commit
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 |
---|---|---|
|
@@ -811,7 +811,7 @@ settings.net.roundTripTimeColumn=Roundtrip | |
settings.net.sentBytesColumn=Sent | ||
settings.net.receivedBytesColumn=Received | ||
settings.net.peerTypeColumn=Peer type | ||
settings.net.openTorSettingsButton=Open Tor network settings | ||
settings.net.openTorSettingsButton=Open Tor settings | ||
|
||
settings.net.needRestart=You need to restart the application to apply that change.\nDo you want to do that now? | ||
settings.net.notKnownYet=Not known yet... | ||
|
@@ -1248,7 +1248,12 @@ torNetworkSettingWindow.enterBridge=Enter one or more bridge relays (one per lin | |
torNetworkSettingWindow.enterBridgePrompt=type address:port | ||
torNetworkSettingWindow.restartInfo=You need to restart to apply the changes | ||
torNetworkSettingWindow.openTorWebPage=Open Tor project web page | ||
torNetworkSettingWindow.info=If Tor is blocked by your internet provider or in your country you can try to use Tor bridges.\n\ | ||
torNetworkSettingWindow.deleteFiles.header=Connection problems? | ||
torNetworkSettingWindow.deleteFiles.info=If you have repeated connection problems at start up, deleting outdated Tor files might help. To do that click the button below and restart afterwards. | ||
torNetworkSettingWindow.deleteFiles.button=Deleting outdated Tor files and shut down | ||
torNetworkSettingWindow.deleteFiles.success=Deleting outdated Tor files wa successful. Please restart. | ||
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. s/wa/was/ |
||
torNetworkSettingWindow.bridges.header=Is Tor blocked? | ||
torNetworkSettingWindow.bridges.info=If Tor is blocked by your internet provider or in your country you can try to use Tor bridges.\n\ | ||
Visit the Tor web page at: https://bridges.torproject.org/bridges to learn more about \ | ||
bridges and pluggable transports. | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,6 @@ | |
import io.bisq.gui.main.offer.BuyOfferView; | ||
import io.bisq.gui.main.offer.SellOfferView; | ||
import io.bisq.gui.main.overlays.popups.Popup; | ||
import io.bisq.gui.main.overlays.windows.TorNetworkSettingsWindow; | ||
import io.bisq.gui.main.portfolio.PortfolioView; | ||
import io.bisq.gui.main.settings.SettingsView; | ||
import io.bisq.gui.util.BSFormatter; | ||
|
@@ -100,12 +99,15 @@ public static void removeEffect() { | |
transitions.removeEffect(MainView.rootContainer); | ||
} | ||
|
||
private final ToggleGroup navButtons = new ToggleGroup(); | ||
private static Transitions transitions; | ||
private static StackPane rootContainer; | ||
|
||
|
||
private final ViewLoader viewLoader; | ||
private final Navigation navigation; | ||
private static Transitions transitions; | ||
private final BSFormatter formatter; | ||
|
||
private final ToggleGroup navButtons = new ToggleGroup(); | ||
private ChangeListener<String> walletServiceErrorMsgListener; | ||
private ChangeListener<String> btcSyncIconIdListener; | ||
private ChangeListener<String> splashP2PNetworkErrorMsgListener; | ||
|
@@ -117,11 +119,13 @@ public static void removeEffect() { | |
private Label btcSplashInfo; | ||
private List<String> persistedFilesCorrupted; | ||
private Popup<?> p2PNetworkWarnMsgPopup, btcNetworkWarnMsgPopup; | ||
private static StackPane rootContainer; | ||
|
||
@SuppressWarnings("WeakerAccess") | ||
@Inject | ||
public MainView(MainViewModel model, CachingViewLoader viewLoader, Navigation navigation, Transitions transitions, | ||
public MainView(MainViewModel model, | ||
CachingViewLoader viewLoader, | ||
Navigation navigation, | ||
Transitions transitions, | ||
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. Avoid one per line ctor parameter stacking (see other, more detailed comment) |
||
BSFormatter formatter) { | ||
super(model); | ||
this.viewLoader = viewLoader; | ||
|
@@ -478,7 +482,7 @@ private VBox createSplashScreen() { | |
showTorNetworkSettingsButton.setVisible(false); | ||
showTorNetworkSettingsButton.setManaged(false); | ||
showTorNetworkSettingsButton.setOnAction(e -> { | ||
new TorNetworkSettingsWindow(model.preferences).show(); | ||
model.torNetworkSettingsWindow.show(); | ||
}); | ||
|
||
ImageView splashP2PNetworkIcon = new ImageView(); | ||
|
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.
s/Deleting/Delete/