mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-22 14:42:37 +01:00
Warn user when closing with open offers
Fixes https://github.com/bisq-network/bisq/issues/1663
This commit is contained in:
parent
ef289a2898
commit
f0471bccfd
2 changed files with 31 additions and 2 deletions
|
@ -1787,6 +1787,13 @@ popup.info.securityDepositInfo=To ensure that both traders follow the trade prot
|
|||
popup.info.cashDepositInfo=Please be sure that you have a bank branch in your area to be able to make the cash deposit.\n\
|
||||
The bank ID (BIC/SWIFT) of the seller''s bank is: {0}.
|
||||
popup.info.cashDepositInfo.confirm=I confirm that I can make the deposit
|
||||
popup.info.shutDownWithOpenOffers=You try to shut down Bisq with open offers. \n\n\
|
||||
When you shut down Bisq your offers are not available anymore in the P2P network. \
|
||||
The next time you start up Bisq again your offers will get re-published to the P2P network.\n\n\
|
||||
If you want to keep your offers online you need to leave Bisq running. \
|
||||
Be sure that your computer does not switch to standby mode when not active. \
|
||||
Standby mode of the monitor is not a problem.
|
||||
|
||||
|
||||
popup.privateNotification.headline=Important private notification!
|
||||
|
||||
|
|
|
@ -39,6 +39,8 @@ import bisq.core.btc.wallet.BtcWalletService;
|
|||
import bisq.core.btc.wallet.WalletsManager;
|
||||
import bisq.core.filter.FilterManager;
|
||||
import bisq.core.locale.Res;
|
||||
import bisq.core.offer.OpenOfferManager;
|
||||
import bisq.core.user.Preferences;
|
||||
|
||||
import bisq.common.UserThread;
|
||||
import bisq.common.app.DevEnv;
|
||||
|
@ -212,7 +214,7 @@ public class BisqApp extends Application implements UncaughtExceptionHandler {
|
|||
|
||||
stage.setOnCloseRequest(event -> {
|
||||
event.consume();
|
||||
stop();
|
||||
shutDownByUser();
|
||||
});
|
||||
|
||||
// configure the primary stage
|
||||
|
@ -247,7 +249,7 @@ public class BisqApp extends Application implements UncaughtExceptionHandler {
|
|||
scene.addEventHandler(KeyEvent.KEY_RELEASED, keyEvent -> {
|
||||
if (Utilities.isCtrlPressed(KeyCode.W, keyEvent) ||
|
||||
Utilities.isCtrlPressed(KeyCode.Q, keyEvent)) {
|
||||
stop();
|
||||
shutDownByUser();
|
||||
} else {
|
||||
if (Utilities.isAltOrCtrlPressed(KeyCode.E, keyEvent)) {
|
||||
showBtcEmergencyWalletPopup(injector);
|
||||
|
@ -280,6 +282,26 @@ public class BisqApp extends Application implements UncaughtExceptionHandler {
|
|||
});
|
||||
}
|
||||
|
||||
private void shutDownByUser() {
|
||||
if (injector.getInstance(OpenOfferManager.class).getObservableList().isEmpty()) {
|
||||
// No open offers, so no need to show the popup.
|
||||
stop();
|
||||
return;
|
||||
}
|
||||
|
||||
// We show a popup to inform user that open offers will be removed if Bisq is not running.
|
||||
String key = "showOpenOfferWarnPopupAtShutDown";
|
||||
if (injector.getInstance(Preferences.class).showAgain(key)) {
|
||||
new Popup<>().information(Res.get("popup.info.shutDownWithOpenOffers"))
|
||||
.dontShowAgainId(key)
|
||||
.useShutDownButton()
|
||||
.closeButtonText(Res.get("shared.cancel"))
|
||||
.show();
|
||||
} else {
|
||||
stop();
|
||||
}
|
||||
}
|
||||
|
||||
private void showSendAlertMessagePopup(Injector injector) {
|
||||
AlertManager alertManager = injector.getInstance(AlertManager.class);
|
||||
boolean useDevPrivilegeKeys = injector.getInstance(Key.get(Boolean.class, Names.named(AppOptionKeys.USE_DEV_PRIVILEGE_KEYS)));
|
||||
|
|
Loading…
Add table
Reference in a new issue