0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-09 10:43:19 -05:00

scripted-diff: Rename ShowModalDialogAndDeleteOnClose

-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.
This commit is contained in:
Hennadii Stepanov 2022-02-08 18:16:11 +02:00
parent 5d7666b151
commit f730bd7d58
No known key found for this signature in database
GPG key ID: 410108112E7EA81F
8 changed files with 11 additions and 11 deletions

View file

@ -189,7 +189,7 @@ void AddressBookPage::onEditAction()
dlg->setModel(model); dlg->setModel(model);
QModelIndex origIndex = proxyModel->mapToSource(indexes.at(0)); QModelIndex origIndex = proxyModel->mapToSource(indexes.at(0));
dlg->loadRow(origIndex.row()); dlg->loadRow(origIndex.row());
GUIUtil::ShowModalDialogAndDeleteOnClose(dlg); GUIUtil::ShowModalDialogAsynchronously(dlg);
} }
void AddressBookPage::on_newAddress_clicked() void AddressBookPage::on_newAddress_clicked()

View file

@ -853,7 +853,7 @@ void BitcoinGUI::aboutClicked()
return; return;
auto dlg = new HelpMessageDialog(this, /* about */ true); auto dlg = new HelpMessageDialog(this, /* about */ true);
GUIUtil::ShowModalDialogAndDeleteOnClose(dlg); GUIUtil::ShowModalDialogAsynchronously(dlg);
} }
void BitcoinGUI::showDebugWindow() void BitcoinGUI::showDebugWindow()
@ -998,7 +998,7 @@ void BitcoinGUI::openOptionsDialogWithTab(OptionsDialog::Tab tab)
connect(dlg, &OptionsDialog::quitOnReset, this, &BitcoinGUI::quitRequested); connect(dlg, &OptionsDialog::quitOnReset, this, &BitcoinGUI::quitRequested);
dlg->setCurrentTab(tab); dlg->setCurrentTab(tab);
dlg->setModel(clientModel->getOptionsModel()); dlg->setModel(clientModel->getOptionsModel());
GUIUtil::ShowModalDialogAndDeleteOnClose(dlg); GUIUtil::ShowModalDialogAsynchronously(dlg);
} }
void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVerificationProgress, bool header, SynchronizationState sync_state) void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVerificationProgress, bool header, SynchronizationState sync_state)

View file

@ -984,7 +984,7 @@ void PrintSlotException(
PrintExceptionContinue(exception, description.c_str()); PrintExceptionContinue(exception, description.c_str());
} }
void ShowModalDialogAndDeleteOnClose(QDialog* dialog) void ShowModalDialogAsynchronously(QDialog* dialog)
{ {
dialog->setAttribute(Qt::WA_DeleteOnClose); dialog->setAttribute(Qt::WA_DeleteOnClose);
dialog->setWindowModality(Qt::ApplicationModal); dialog->setWindowModality(Qt::ApplicationModal);

View file

@ -426,7 +426,7 @@ namespace GUIUtil
/** /**
* Shows a QDialog instance asynchronously, and deletes it on close. * Shows a QDialog instance asynchronously, and deletes it on close.
*/ */
void ShowModalDialogAndDeleteOnClose(QDialog* dialog); void ShowModalDialogAsynchronously(QDialog* dialog);
inline bool IsEscapeOrBack(int key) inline bool IsEscapeOrBack(int key)
{ {

View file

@ -930,7 +930,7 @@ void SendCoinsDialog::coinControlButtonClicked()
{ {
auto dlg = new CoinControlDialog(*m_coin_control, model, platformStyle); auto dlg = new CoinControlDialog(*m_coin_control, model, platformStyle);
connect(dlg, &QDialog::finished, this, &SendCoinsDialog::coinControlUpdateLabels); connect(dlg, &QDialog::finished, this, &SendCoinsDialog::coinControlUpdateLabels);
GUIUtil::ShowModalDialogAndDeleteOnClose(dlg); GUIUtil::ShowModalDialogAsynchronously(dlg);
} }
// Coin Control: checkbox custom change address // Coin Control: checkbox custom change address

View file

@ -511,7 +511,7 @@ void TransactionView::editLabel()
: EditAddressDialog::EditSendingAddress, this); : EditAddressDialog::EditSendingAddress, this);
dlg->setModel(addressBook); dlg->setModel(addressBook);
dlg->loadRow(idx); dlg->loadRow(idx);
GUIUtil::ShowModalDialogAndDeleteOnClose(dlg); GUIUtil::ShowModalDialogAsynchronously(dlg);
} }
else else
{ {
@ -520,7 +520,7 @@ void TransactionView::editLabel()
this); this);
dlg->setModel(addressBook); dlg->setModel(addressBook);
dlg->setAddress(address); dlg->setAddress(address);
GUIUtil::ShowModalDialogAndDeleteOnClose(dlg); GUIUtil::ShowModalDialogAsynchronously(dlg);
} }
} }
} }

View file

@ -226,7 +226,7 @@ void WalletFrame::gotoLoadPSBT(bool from_clipboard)
auto dlg = new PSBTOperationsDialog(this, currentWalletModel(), clientModel); auto dlg = new PSBTOperationsDialog(this, currentWalletModel(), clientModel);
dlg->openWithPSBT(psbtx); dlg->openWithPSBT(psbtx);
GUIUtil::ShowModalDialogAndDeleteOnClose(dlg); GUIUtil::ShowModalDialogAsynchronously(dlg);
} }
void WalletFrame::encryptWallet() void WalletFrame::encryptWallet()

View file

@ -208,7 +208,7 @@ void WalletView::encryptWallet()
auto dlg = new AskPassphraseDialog(AskPassphraseDialog::Encrypt, this); auto dlg = new AskPassphraseDialog(AskPassphraseDialog::Encrypt, this);
dlg->setModel(walletModel); dlg->setModel(walletModel);
connect(dlg, &QDialog::finished, this, &WalletView::encryptionStatusChanged); connect(dlg, &QDialog::finished, this, &WalletView::encryptionStatusChanged);
GUIUtil::ShowModalDialogAndDeleteOnClose(dlg); GUIUtil::ShowModalDialogAsynchronously(dlg);
} }
void WalletView::backupWallet() void WalletView::backupWallet()
@ -235,7 +235,7 @@ void WalletView::changePassphrase()
{ {
auto dlg = new AskPassphraseDialog(AskPassphraseDialog::ChangePass, this); auto dlg = new AskPassphraseDialog(AskPassphraseDialog::ChangePass, this);
dlg->setModel(walletModel); dlg->setModel(walletModel);
GUIUtil::ShowModalDialogAndDeleteOnClose(dlg); GUIUtil::ShowModalDialogAsynchronously(dlg);
} }
void WalletView::unlockWallet() void WalletView::unlockWallet()