Skip to content

Commit 6dc1ac6

Browse files
hebastoknst
authored andcommitted
Merge bitcoin-core/gui#441: Add Create Unsigned button to SendConfirmationDialog
BACKPORT NOTE: Formatting in src/qt/optionsmodel.h has been changed in bitcoin#3267. These changes has not been backported on time; done with this backport 742918c qt: hide Create Unsigned button behind an expert mode option (Andrew Chow) 5c3b800 qt: Add Create Unsigned button to SendConfirmationDialog (Andrew Chow) Pull request description: Instead of having different buttons or changing button behavior for making a PSBT, just have SendConfirmationDialog return whether the user wants a PSBT or a broadcasted transaction. Since this dialog is used by both the bumpFeeAction and the SendCoinsDialog, changes to both to support the different behavior is needed. They will check the return value of the SendConfirmationDialog for whether a PSBT needs to be created instead of checking whether private keys are disabled. Strings used in this dialog are being slightly modified to work with both private keys enabled and disabled wallets. Moved from bitcoin#18789 ACKs for top commit: jarolrod: ACK 742918c ryanofsky: Code review ACK 742918c. Just suggested changes since last review. Looks great! hebasto: ACK 742918c, tested on Linux Mint 20.2 (Qt 5.12.8). Tree-SHA512: dd29f4364c7b4f15befe8fe63257b26187918786b005e0f8336183270b1a162680b93f6ced60f0285c6e607c084cc0d24950fc68a8f9c056521ede614041be66
1 parent d558437 commit 6dc1ac6

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/qt/sendcoinsdialog.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -376,18 +376,16 @@ bool SendCoinsDialog::send(const QList<SendCoinsRecipient>& recipients, QString&
376376
/*: Message displayed when attempting to create a transaction. Cautionary text to prompt the user to verify
377377
that the displayed transaction details represent the transaction the user intends to create. */
378378
question_string.append(tr("Do you want to create this transaction?"));
379-
question_string.append("<br /><span style='font-size:10pt;'>");
380379
if (model->wallet().privateKeysDisabled() && !model->wallet().hasExternalSigner()) {
381-
question_string.append(tr("Do you want to draft this transaction?"));
382380
/*: Text to inform a user attempting to create a transaction of their current options. At this stage,
383381
a user can only create a PSBT. This string is displayed when private keys are disabled and an external
384382
signer is not available. */
385-
question_string.append(tr("Please, review your transaction proposal. This will produce a Partially Signed Bitcoin Transaction (PSBT) which you can save or copy and then sign with e.g. an offline %1 wallet, or a PSBT-compatible hardware wallet.").arg(PACKAGE_NAME));
383+
question_string.append(tr("Please, review your transaction proposal. This will produce a Partially Signed Blockchain Transaction (PSBT) which you can save or copy and then sign with e.g. an offline %1 wallet, or a PSBT-compatible hardware wallet.").arg(PACKAGE_NAME));
386384
} else if (model->getOptionsModel()->getEnablePSBTControls()) {
387385
/*: Text to inform a user attempting to create a transaction of their current options. At this stage,
388386
a user can send their transaction or create a PSBT. This string is displayed when both private keys
389387
and PSBT controls are enabled. */
390-
question_string.append(tr("Please, review your transaction. You can create and send this transaction or create a Partially Signed Bitcoin Transaction (PSBT), which you can save or copy and then sign with, e.g., an offline %1 wallet, or a PSBT-compatible hardware wallet.").arg(PACKAGE_NAME));
388+
question_string.append(tr("Please, review your transaction. You can create and send this transaction or create a Partially Signed Blockchain Transaction (PSBT), which you can save or copy and then sign with, e.g., an offline %1 wallet, or a PSBT-compatible hardware wallet.").arg(PACKAGE_NAME));
391389
} else {
392390
/*: Text to prompt a user to review the details of the transaction they are attempting to send. */
393391
question_string.append(tr("Please, review your transaction."));
@@ -488,9 +486,8 @@ void SendCoinsDialog::sendButtonClicked([[maybe_unused]] bool checked)
488486
if (!PrepareSendText(question_string, informative_text, detailed_text)) return;
489487
assert(m_current_transaction);
490488

491-
const QString confirmation = model->wallet().privateKeysDisabled() && !model->wallet().hasExternalSigner() ? tr("Confirm transaction proposal") : tr("Confirm send coins");
492-
const QString confirmButtonText = model->wallet().privateKeysDisabled() && !model->wallet().hasExternalSigner() ? tr("Create Unsigned") : tr("Send");
493-
auto confirmationDialog = new SendConfirmationDialog(confirmation, question_string, informative_text, detailed_text, SEND_CONFIRM_DELAY, confirmButtonText, this);
489+
const QString confirmation = tr("Confirm send coins");
490+
auto confirmationDialog = new SendConfirmationDialog(confirmation, question_string, informative_text, detailed_text, SEND_CONFIRM_DELAY, !model->wallet().privateKeysDisabled(), model->getOptionsModel()->getEnablePSBTControls(), this);
494491
confirmationDialog->setAttribute(Qt::WA_DeleteOnClose);
495492
// TODO: Replace QDialog::exec() with safer QDialog::show().
496493
const auto retval = static_cast<QMessageBox::StandardButton>(confirmationDialog->exec());

0 commit comments

Comments
 (0)