aboutsummaryrefslogtreecommitdiff
path: root/src/qt
diff options
context:
space:
mode:
authormerge-script <32963518+hebasto@users.noreply.github.com>2024-05-15 18:41:15 +0100
committermerge-script <32963518+hebasto@users.noreply.github.com>2024-05-15 18:41:15 +0100
commit7a40f2a3f1cf744d136ecf534979114e79c5e71d (patch)
tree04d465ece8c8d841cd43ab1a59d6f4bce62eee61 /src/qt
parent33303b2b296cdb21b6ade3e95663e9ed58c08753 (diff)
parentcccddc03f0c625daeac7158eb20c1508aea5df39 (diff)
downloadbitcoin-7a40f2a3f1cf744d136ecf534979114e79c5e71d.tar.xz
Merge bitcoin-core/gui#722: wallet: Allow user to navigate options while encrypting at creation
cccddc03f0c625daeac7158eb20c1508aea5df39 Wallet encrypt on create, allow to navigate options (Hernan Marino) Pull request description: This fixes https://github.com/bitcoin-core/gui/issues/394. It adds a "Go back" button to the "Confirm wallet encryption" window, allowing the users to change the password if they want to. It also adds a Cancel button to the "Wallet to be encrypted" window. Prior to this change users had no option to alter the password, and were forced to either go ahead with wallet creation or cancel the whole process. Also, at the final window, they were shown a warning but with no option to cancel. The new workflow for wallet encryption and creation is similar to the following: ![videoNavigation](https://user-images.githubusercontent.com/87907936/225705434-22d3c678-fa01-4079-ba10-ca5a0e8d3922.gif) ACKs for top commit: alfonsoromanz: Re-Tested ACK https://github.com/bitcoin-core/gui/commit/cccddc03f0c625daeac7158eb20c1508aea5df39 BrandonOdiwuor: re-Tested ACK cccddc03f0c625daeac7158eb20c1508aea5df39 hebasto: ACK cccddc03f0c625daeac7158eb20c1508aea5df39, tested on Ubuntu 24.04. Tree-SHA512: d2856d75f75acbd7d51ede62b4abd317f6ed6a9b890fe0b73b63b921b4b3d61b49477e35dc74466a056a9e8c0c1598df7601111d36c57ef18fdfdf0b18f503e6
Diffstat (limited to 'src/qt')
-rw-r--r--src/qt/askpassphrasedialog.cpp35
1 files changed, 22 insertions, 13 deletions
diff --git a/src/qt/askpassphrasedialog.cpp b/src/qt/askpassphrasedialog.cpp
index a4771bbb82..70ed40b2a1 100644
--- a/src/qt/askpassphrasedialog.cpp
+++ b/src/qt/askpassphrasedialog.cpp
@@ -100,10 +100,14 @@ void AskPassphraseDialog::accept()
// Cannot encrypt with empty passphrase
break;
}
- QMessageBox::StandardButton retval = QMessageBox::question(this, tr("Confirm wallet encryption"),
- tr("Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>!") + "<br><br>" + tr("Are you sure you wish to encrypt your wallet?"),
- QMessageBox::Yes|QMessageBox::Cancel,
- QMessageBox::Cancel);
+ QMessageBox msgBoxConfirm(QMessageBox::Question,
+ tr("Confirm wallet encryption"),
+ tr("Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>!") + "<br><br>" + tr("Are you sure you wish to encrypt your wallet?"),
+ QMessageBox::Cancel | QMessageBox::Yes, this);
+ msgBoxConfirm.button(QMessageBox::Yes)->setText(tr("Continue"));
+ msgBoxConfirm.button(QMessageBox::Cancel)->setText(tr("Back"));
+ msgBoxConfirm.setDefaultButton(QMessageBox::Cancel);
+ QMessageBox::StandardButton retval = (QMessageBox::StandardButton)msgBoxConfirm.exec();
if(retval == QMessageBox::Yes)
{
if(newpass1 == newpass2)
@@ -112,10 +116,19 @@ void AskPassphraseDialog::accept()
"your bitcoins from being stolen by malware infecting your computer.");
if (m_passphrase_out) {
m_passphrase_out->assign(newpass1);
- QMessageBox::warning(this, tr("Wallet to be encrypted"),
- "<qt>" +
- tr("Your wallet is about to be encrypted. ") + encryption_reminder +
- "</b></qt>");
+ QMessageBox msgBoxWarning(QMessageBox::Warning,
+ tr("Wallet to be encrypted"),
+ "<qt>" +
+ tr("Your wallet is about to be encrypted. ") + encryption_reminder + " " +
+ tr("Are you sure you wish to encrypt your wallet?") +
+ "</b></qt>",
+ QMessageBox::Cancel | QMessageBox::Yes, this);
+ msgBoxWarning.setDefaultButton(QMessageBox::Cancel);
+ QMessageBox::StandardButton retval = (QMessageBox::StandardButton)msgBoxWarning.exec();
+ if (retval == QMessageBox::Cancel) {
+ QDialog::reject();
+ return;
+ }
} else {
assert(model != nullptr);
if (model->setWalletEncrypted(newpass1)) {
@@ -141,11 +154,7 @@ void AskPassphraseDialog::accept()
tr("The supplied passphrases do not match."));
}
}
- else
- {
- QDialog::reject(); // Cancelled
- }
- } break;
+ } break;
case Unlock:
try {
if (!model->setWalletLocked(false, oldpass)) {