Skip to content

Commit

Permalink
scripted-diff: Rename ShowModalDialogAndDeleteOnClose
Browse files Browse the repository at this point in the history
-BEGIN VERIFY SCRIPT-
sed -i 's/ShowModalDialogAndDeleteOnClose/ShowModalDialogAsynchronously/' -- $(git grep -l -e "ShowModalDialogAndDeleteOnClose")
-END VERIFY SCRIPT-

It is important to highlight that a modal dialog is showed
asynchronously as there are cases when the synchronous QDialog::exec()
is required.
  • Loading branch information
hebasto authored and UdjinM6 committed Feb 27, 2025
1 parent 2c312dc commit 8d6cfd7
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/qt/addressbookpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ void AddressBookPage::onEditAction()
dlg->setModel(model);
QModelIndex origIndex = proxyModel->mapToSource(indexes.at(0));
dlg->loadRow(origIndex.row());
GUIUtil::ShowModalDialogAndDeleteOnClose(dlg);
GUIUtil::ShowModalDialogAsynchronously(dlg);
}

void AddressBookPage::on_newAddress_clicked()
Expand Down
4 changes: 2 additions & 2 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1123,7 +1123,7 @@ void BitcoinGUI::aboutClicked()
return;

auto dlg = new HelpMessageDialog(this, HelpMessageDialog::about);
GUIUtil::ShowModalDialogAndDeleteOnClose(dlg);
GUIUtil::ShowModalDialogAsynchronously(dlg);
}

void BitcoinGUI::showDebugWindow()
Expand Down Expand Up @@ -1385,7 +1385,7 @@ void BitcoinGUI::openOptionsDialogWithTab(OptionsDialog::Tab tab)
connect(dlg, &OptionsDialog::appearanceChanged, [this]() {
updateWidth();
});
GUIUtil::ShowModalDialogAndDeleteOnClose(dlg);
GUIUtil::ShowModalDialogAsynchronously(dlg);

updateCoinJoinVisibility();
}
Expand Down
2 changes: 1 addition & 1 deletion src/qt/guiutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1950,7 +1950,7 @@ void PrintSlotException(
PrintExceptionContinue(std::make_exception_ptr(exception), description.c_str());
}

void ShowModalDialogAndDeleteOnClose(QDialog* dialog)
void ShowModalDialogAsynchronously(QDialog* dialog)
{
dialog->setAttribute(Qt::WA_DeleteOnClose);
dialog->setWindowModality(Qt::ApplicationModal);
Expand Down
2 changes: 1 addition & 1 deletion src/qt/guiutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ namespace GUIUtil
/**
* Shows a QDialog instance asynchronously, and deletes it on close.
*/
void ShowModalDialogAndDeleteOnClose(QDialog* dialog);
void ShowModalDialogAsynchronously(QDialog* dialog);

} // namespace GUIUtil

Expand Down
2 changes: 1 addition & 1 deletion src/qt/sendcoinsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@ void SendCoinsDialog::coinControlButtonClicked()
{
auto dlg = new CoinControlDialog(*m_coin_control, model);
connect(dlg, &QDialog::finished, this, &SendCoinsDialog::coinControlUpdateLabels);
GUIUtil::ShowModalDialogAndDeleteOnClose(dlg);
GUIUtil::ShowModalDialogAsynchronously(dlg);
}

// Coin Control: checkbox custom change address
Expand Down
4 changes: 2 additions & 2 deletions src/qt/transactionview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ void TransactionView::editLabel()
: EditAddressDialog::EditSendingAddress, this);
dlg->setModel(addressBook);
dlg->loadRow(idx);
GUIUtil::ShowModalDialogAndDeleteOnClose(dlg);
GUIUtil::ShowModalDialogAsynchronously(dlg);
}
else
{
Expand All @@ -525,7 +525,7 @@ void TransactionView::editLabel()
this);
dlg->setModel(addressBook);
dlg->setAddress(address);
GUIUtil::ShowModalDialogAndDeleteOnClose(dlg);
GUIUtil::ShowModalDialogAsynchronously(dlg);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/qt/walletframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ void WalletFrame::gotoLoadPSBT(bool from_clipboard)

auto dlg = new PSBTOperationsDialog(this, currentWalletModel(), clientModel);
dlg->openWithPSBT(psbtx);
GUIUtil::ShowModalDialogAndDeleteOnClose(dlg);
GUIUtil::ShowModalDialogAsynchronously(dlg);
}

void WalletFrame::encryptWallet()
Expand Down
4 changes: 2 additions & 2 deletions src/qt/walletview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ void WalletView::encryptWallet()
auto dlg = new AskPassphraseDialog(AskPassphraseDialog::Encrypt, this);
dlg->setModel(walletModel);
connect(dlg, &QDialog::finished, this, &WalletView::encryptionStatusChanged);
GUIUtil::ShowModalDialogAndDeleteOnClose(dlg);
GUIUtil::ShowModalDialogAsynchronously(dlg);
}

void WalletView::backupWallet()
Expand All @@ -326,7 +326,7 @@ void WalletView::changePassphrase()
{
auto dlg = new AskPassphraseDialog(AskPassphraseDialog::ChangePass, this);
dlg->setModel(walletModel);
GUIUtil::ShowModalDialogAndDeleteOnClose(dlg);
GUIUtil::ShowModalDialogAsynchronously(dlg);
}

void WalletView::unlockWallet(bool fForMixingOnly)
Expand Down

0 comments on commit 8d6cfd7

Please sign in to comment.