mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 02:33:24 -03:00
gui: don't remove wallet manually before migration
This commit is contained in:
parent
bfba63880f
commit
c3918583dd
1 changed files with 3 additions and 4 deletions
|
@ -150,9 +150,10 @@ WalletModel* WalletController::getOrCreateWallet(std::unique_ptr<interfaces::Wal
|
|||
assert(called);
|
||||
|
||||
connect(wallet_model, &WalletModel::unload, this, [this, wallet_model] {
|
||||
// Defer removeAndDeleteWallet when no modal widget is active.
|
||||
// Defer removeAndDeleteWallet when no modal widget is actively waiting for an action.
|
||||
// TODO: remove this workaround by removing usage of QDialog::exec.
|
||||
if (QApplication::activeModalWidget()) {
|
||||
QWidget* active_dialog = QApplication::activeModalWidget();
|
||||
if (active_dialog && dynamic_cast<QProgressDialog*>(active_dialog) == nullptr) {
|
||||
connect(qApp, &QApplication::focusWindowChanged, wallet_model, [this, wallet_model]() {
|
||||
if (!QApplication::activeModalWidget()) {
|
||||
removeAndDeleteWallet(wallet_model);
|
||||
|
@ -463,8 +464,6 @@ void MigrateWalletActivity::migrate(WalletModel* wallet_model)
|
|||
|
||||
// GUI needs to remove the wallet so that it can actually be unloaded by migration
|
||||
const std::string name = wallet_model->wallet().getWalletName();
|
||||
m_wallet_controller->removeAndDeleteWallet(wallet_model);
|
||||
|
||||
showProgressDialog(tr("Migrate Wallet"), tr("Migrating Wallet <b>%1</b>…").arg(GUIUtil::HtmlEscape(name)));
|
||||
|
||||
QTimer::singleShot(0, worker(), [this, name, passphrase] {
|
||||
|
|
Loading…
Add table
Reference in a new issue