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 committed Dec 26, 2021
1 parent a632303 commit 356e21f
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 @@ -189,7 +189,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 @@ -848,7 +848,7 @@ void BitcoinGUI::aboutClicked()
return;

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

void BitcoinGUI::showDebugWindow()
Expand Down Expand Up @@ -993,7 +993,7 @@ void BitcoinGUI::openOptionsDialogWithTab(OptionsDialog::Tab tab)
connect(dlg, &OptionsDialog::quitOnReset, this, &BitcoinGUI::quitRequested);
dlg->setCurrentTab(tab);
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)
Expand Down
2 changes: 1 addition & 1 deletion src/qt/guiutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,7 @@ void PrintSlotException(
PrintExceptionContinue(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 @@ -426,7 +426,7 @@ namespace GUIUtil
/**
* Shows a QDialog instance asynchronously, and deletes it on close.
*/
void ShowModalDialogAndDeleteOnClose(QDialog* dialog);
void ShowModalDialogAsynchronously(QDialog* dialog);

inline bool IsEscapeOrBack(int key)
{
Expand Down
2 changes: 1 addition & 1 deletion src/qt/sendcoinsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,7 @@ void SendCoinsDialog::coinControlButtonClicked()
{
auto dlg = new CoinControlDialog(*m_coin_control, model, platformStyle);
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 @@ -510,7 +510,7 @@ void TransactionView::editLabel()
: EditAddressDialog::EditSendingAddress, this);
dlg->setModel(addressBook);
dlg->loadRow(idx);
GUIUtil::ShowModalDialogAndDeleteOnClose(dlg);
GUIUtil::ShowModalDialogAsynchronously(dlg);
}
else
{
Expand All @@ -519,7 +519,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 @@ -223,7 +223,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 @@ -208,7 +208,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 @@ -235,7 +235,7 @@ void WalletView::changePassphrase()
{
auto dlg = new AskPassphraseDialog(AskPassphraseDialog::ChangePass, this);
dlg->setModel(walletModel);
GUIUtil::ShowModalDialogAndDeleteOnClose(dlg);
GUIUtil::ShowModalDialogAsynchronously(dlg);
}

void WalletView::unlockWallet()
Expand Down

0 comments on commit 356e21f

Please sign in to comment.