Add option to not repeat popup message of locked up funds from failed trade

This commit is contained in:
jmacxx 2021-10-20 16:54:14 -05:00
parent 9f60146b96
commit 1dffec00f2
No known key found for this signature in database
GPG Key ID: 155297BABFE94A1B

View File

@ -77,11 +77,15 @@ import bisq.common.UserThread;
import bisq.common.app.DevEnv;
import bisq.common.app.Version;
import bisq.common.config.Config;
import bisq.common.crypto.Hash;
import bisq.common.file.CorruptedStorageFileHandler;
import bisq.common.util.Hex;
import bisq.common.util.Tuple2;
import com.google.inject.Inject;
import com.google.common.base.Charsets;
import org.fxmisc.easybind.EasyBind;
import org.fxmisc.easybind.monadic.MonadicBinding;
@ -340,7 +344,15 @@ public class MainViewModel implements ViewModel, BisqSetup.BisqSetupListener {
bisqSetup.setChainFileLockedExceptionHandler(msg -> new Popup().warning(msg)
.useShutDownButton()
.show());
bisqSetup.setLockedUpFundsHandler(msg -> new Popup().width(850).warning(msg).show());
bisqSetup.setLockedUpFundsHandler(msg -> {
// repeated popups of the same message text can be stopped by selecting the "Dont show again" checkbox
String key = Hex.encode(Hash.getSha256Ripemd160hash(msg.getBytes(Charsets.UTF_8)));
if (preferences.showAgain(key)) {
new Popup().width(850).warning(msg)
.dontShowAgainId(key)
.show();
}
});
bisqSetup.setShowFirstPopupIfResyncSPVRequestedHandler(this::showFirstPopupIfResyncSPVRequested);
bisqSetup.setRequestWalletPasswordHandler(aesKeyHandler -> walletPasswordWindow
.onAesKey(aesKeyHandler::accept)