Merge pull request #6213 from jmacxx/check_trade_init_app_close

Improve wording & appearance of trade shutdown dialog.
This commit is contained in:
Christoph Atteneder 2022-05-19 09:21:37 +02:00 committed by GitHub
commit 0ced87cd22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 17 deletions

View File

@ -28,6 +28,8 @@ shared.readMore=Read more
shared.openHelp=Open Help
shared.warning=Warning
shared.close=Close
shared.closeAnywayDanger=Shut down anyway (DANGER!)
shared.okWait=Ok I'll wait
shared.cancel=Cancel
shared.ok=OK
shared.yes=Yes
@ -3080,10 +3082,8 @@ popup.info.shutDownWithOpenOffers=Bisq is being shut down, but there are open of
they will be re-published to the P2P network the next time you start Bisq.\n\n\
To keep your offers online, keep Bisq running and make sure this computer remains online too \
(i.e., make sure it doesn't go into standby mode...monitor standby is not a problem).
popup.info.shutDownWithTradeInit=Bisq is being shut down, but there are trades still being initialized. \n\n\
Specific trade affected: {0}\n\n\
If a trade is still in process of being initialized, shutting down can result in the trade missing some important state.\n\n\
Do not close Bisq if this trade has not had enough time to initialize correctly. One minute should be sufficient time.
popup.info.shutDownWithTradeInit={0}\n\
This trade has not finished initializing; shutting down now will probably make it corrupted. Please wait a minute and try again.
popup.info.qubesOSSetupInfo=It appears you are running Bisq on Qubes OS. \n\n\
Please make sure your Bisq qube is setup according to our Setup Guide at [HYPERLINK:https://bisq.wiki/Running_Bisq_on_Qubes].
popup.info.firewallSetupInfo=It appears this machine blocks incoming Tor connections. \

View File

@ -384,24 +384,19 @@ public class BisqApp extends Application implements UncaughtExceptionHandler {
if (trade.getTradePhase().equals(Trade.Phase.TAKER_FEE_PUBLISHED) &&
new Date(trade.getTakeOfferDate()).toInstant().isAfter(fiveMinutesAgo)) {
String tradeDateString = DisplayUtils.formatDateTime(new Date(trade.getTakeOfferDate()));
tradeIdsWithOperationsPending += System.lineSeparator() +
Res.get("shared.tradeId") + ": " + trade.getShortId() + " " +
Res.get("shared.dateTime") + ": " + tradeDateString;
tradeIdsWithOperationsPending += Res.get("shared.tradeId") + ": " + trade.getShortId() + " " +
Res.get("shared.dateTime") + ": " + tradeDateString + System.lineSeparator();
break;
}
}
if (tradeIdsWithOperationsPending.length() > 0) {
// We show a popup to inform user that some trades are still being initialised.
String key = "showInitTradeWarnPopupAtShutDown";
if (injector.getInstance(Preferences.class).showAgain(key) && !DevEnv.isDevMode()) {
new Popup().information(Res.get("popup.info.shutDownWithTradeInit", tradeIdsWithOperationsPending))
.dontShowAgainId(key)
.useShutDownButton()
.onAction(() -> asyncStatus.complete(true))
.closeButtonText(Res.get("shared.cancel"))
.onClose(() -> asyncStatus.complete(false))
.show();
}
new Popup().warning(Res.get("popup.info.shutDownWithTradeInit", tradeIdsWithOperationsPending))
.actionButtonText(Res.get("shared.okWait"))
.onAction(() -> asyncStatus.complete(false))
.closeButtonText(Res.get("shared.closeAnywayDanger"))
.onClose(() -> asyncStatus.complete(true))
.show();
} else {
asyncStatus.complete(true);
}