mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-28 14:02:53 +02:00
qt, refactor: Allocate SendConfirmationDialog instances on heap
This change is require for the next commit.
This commit is contained in:
@@ -399,9 +399,10 @@ void SendCoinsDialog::sendButtonClicked([[maybe_unused]] bool checked)
|
|||||||
|
|
||||||
const QString confirmation = model->wallet().privateKeysDisabled() && !model->wallet().hasExternalSigner() ? tr("Confirm transaction proposal") : tr("Confirm send coins");
|
const QString confirmation = model->wallet().privateKeysDisabled() && !model->wallet().hasExternalSigner() ? tr("Confirm transaction proposal") : tr("Confirm send coins");
|
||||||
const QString confirmButtonText = model->wallet().privateKeysDisabled() && !model->wallet().hasExternalSigner() ? tr("Create Unsigned") : tr("Sign and send");
|
const QString confirmButtonText = model->wallet().privateKeysDisabled() && !model->wallet().hasExternalSigner() ? tr("Create Unsigned") : tr("Sign and send");
|
||||||
SendConfirmationDialog confirmationDialog(confirmation, question_string, informative_text, detailed_text, SEND_CONFIRM_DELAY, confirmButtonText, this);
|
auto confirmationDialog = new SendConfirmationDialog(confirmation, question_string, informative_text, detailed_text, SEND_CONFIRM_DELAY, confirmButtonText, this);
|
||||||
confirmationDialog.exec();
|
confirmationDialog->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
QMessageBox::StandardButton retval = static_cast<QMessageBox::StandardButton>(confirmationDialog.result());
|
// TODO: Replace QDialog::exec() with safer QDialog::show().
|
||||||
|
const auto retval = static_cast<QMessageBox::StandardButton>(confirmationDialog->exec());
|
||||||
|
|
||||||
if(retval != QMessageBox::Yes)
|
if(retval != QMessageBox::Yes)
|
||||||
{
|
{
|
||||||
|
@@ -506,9 +506,10 @@ bool WalletModel::bumpFee(uint256 hash, uint256& new_hash)
|
|||||||
questionString.append(tr("Warning: This may pay the additional fee by reducing change outputs or adding inputs, when necessary. It may add a new change output if one does not already exist. These changes may potentially leak privacy."));
|
questionString.append(tr("Warning: This may pay the additional fee by reducing change outputs or adding inputs, when necessary. It may add a new change output if one does not already exist. These changes may potentially leak privacy."));
|
||||||
}
|
}
|
||||||
|
|
||||||
SendConfirmationDialog confirmationDialog(tr("Confirm fee bump"), questionString);
|
auto confirmationDialog = new SendConfirmationDialog(tr("Confirm fee bump"), questionString);
|
||||||
confirmationDialog.exec();
|
confirmationDialog->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
QMessageBox::StandardButton retval = static_cast<QMessageBox::StandardButton>(confirmationDialog.result());
|
// TODO: Replace QDialog::exec() with safer QDialog::show().
|
||||||
|
const auto retval = static_cast<QMessageBox::StandardButton>(confirmationDialog->exec());
|
||||||
|
|
||||||
// cancel sign&broadcast if user doesn't want to bump the fee
|
// cancel sign&broadcast if user doesn't want to bump the fee
|
||||||
if (retval != QMessageBox::Yes) {
|
if (retval != QMessageBox::Yes) {
|
||||||
|
Reference in New Issue
Block a user