mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-08-03 12:16:27 -04:00
prompt to fall back on startup error with custom node
This commit is contained in:
parent
1aef8a6bab
commit
7f6d28f1fb
8 changed files with 89 additions and 20 deletions
|
@ -674,6 +674,7 @@ public class MainView extends InitializableView<StackPane, MainViewModel> {
|
|||
}
|
||||
} else {
|
||||
xmrInfoLabel.setId("footer-pane");
|
||||
xmrInfoLabel.getStyleClass().remove("error-text");
|
||||
if (xmrNetworkWarnMsgPopup != null)
|
||||
xmrNetworkWarnMsgPopup.hide();
|
||||
}
|
||||
|
|
|
@ -140,6 +140,7 @@ public class MainViewModel implements ViewModel, HavenoSetup.HavenoSetupListener
|
|||
@SuppressWarnings("FieldCanBeLocal")
|
||||
private MonadicBinding<Boolean> tradesAndUIReady;
|
||||
private final Queue<Overlay<?>> popupQueue = new PriorityQueue<>(Comparator.comparing(Overlay::getDisplayOrderPriority));
|
||||
private Popup moneroConnectionFallbackPopup;
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -334,9 +335,38 @@ public class MainViewModel implements ViewModel, HavenoSetup.HavenoSetupListener
|
|||
tacWindow.onAction(acceptedHandler::run).show();
|
||||
}, 1));
|
||||
|
||||
havenoSetup.setDisplayMoneroConnectionFallbackHandler(show -> {
|
||||
if (moneroConnectionFallbackPopup == null) {
|
||||
moneroConnectionFallbackPopup = new Popup()
|
||||
.headLine(Res.get("connectionFallback.headline"))
|
||||
.warning(Res.get("connectionFallback.msg"))
|
||||
.closeButtonText(Res.get("shared.no"))
|
||||
.actionButtonText(Res.get("shared.yes"))
|
||||
.onAction(() -> {
|
||||
havenoSetup.getConnectionServiceFallbackHandlerActive().set(false);
|
||||
new Thread(() -> HavenoUtils.xmrConnectionService.fallbackToBestConnection()).start();
|
||||
})
|
||||
.onClose(() -> {
|
||||
log.warn("User has declined to fallback to the next best available Monero node.");
|
||||
havenoSetup.getConnectionServiceFallbackHandlerActive().set(false);
|
||||
});
|
||||
}
|
||||
if (show) {
|
||||
moneroConnectionFallbackPopup.show();
|
||||
} else if (moneroConnectionFallbackPopup.isDisplayed()) {
|
||||
moneroConnectionFallbackPopup.hide();
|
||||
}
|
||||
});
|
||||
|
||||
havenoSetup.setDisplayTorNetworkSettingsHandler(show -> {
|
||||
if (show) {
|
||||
torNetworkSettingsWindow.show();
|
||||
|
||||
// bring connection fallback popup to front if displayed
|
||||
if (moneroConnectionFallbackPopup != null && moneroConnectionFallbackPopup.isDisplayed()) {
|
||||
moneroConnectionFallbackPopup.hide();
|
||||
moneroConnectionFallbackPopup.show();
|
||||
}
|
||||
} else if (torNetworkSettingsWindow.isDisplayed()) {
|
||||
torNetworkSettingsWindow.hide();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue