mirror of
https://github.com/QuasarApp/QuasarAppCoin.git
synced 2025-04-27 10:14:33 +00:00
Merge #15641: Backport #15614 to 0.18: gui: Defer removeAndDeleteWallet when no modal widget is active
98a24a262eceb8fddad363f4bb1459c2dd8608eb gui: Defer removeAndDeleteWallet when no modal widget is active (João Barbosa) Pull request description: 0.18 Backport of #15614 Tree-SHA512: 8f785705325364ecfa37045090f10ca615f457e279789b0ce0d61f2667f491bce9b44f5e5cdeeecf63d61356213d9a97a3578841295cc8480cf42e037c2decb2
This commit is contained in:
commit
b022242887
@ -9,9 +9,11 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QMessageBox>
|
||||
#include <QMutexLocker>
|
||||
#include <QThread>
|
||||
#include <QWindow>
|
||||
|
||||
WalletController::WalletController(interfaces::Node& node, const PlatformStyle* platform_style, OptionsModel* options_model, QObject* parent)
|
||||
: QObject(parent)
|
||||
@ -97,7 +99,17 @@ WalletModel* WalletController::getOrCreateWallet(std::unique_ptr<interfaces::Wal
|
||||
m_wallets.push_back(wallet_model);
|
||||
|
||||
connect(wallet_model, &WalletModel::unload, [this, wallet_model] {
|
||||
removeAndDeleteWallet(wallet_model);
|
||||
// Defer removeAndDeleteWallet when no modal widget is active.
|
||||
// TODO: remove this workaround by removing usage of QDiallog::exec.
|
||||
if (QApplication::activeModalWidget()) {
|
||||
connect(qApp, &QApplication::focusWindowChanged, wallet_model, [this, wallet_model]() {
|
||||
if (!QApplication::activeModalWidget()) {
|
||||
removeAndDeleteWallet(wallet_model);
|
||||
}
|
||||
}, Qt::QueuedConnection);
|
||||
} else {
|
||||
removeAndDeleteWallet(wallet_model);
|
||||
}
|
||||
});
|
||||
|
||||
// Re-emit coinsSent signal from wallet model.
|
||||
|
Loading…
x
Reference in New Issue
Block a user