aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHernan Marino <hmarino@gmail.com>2023-03-14 14:01:17 -0300
committerHernan Marino <hernanmarino@protonmail.com>2024-02-13 18:32:13 -0300
commitcccddc03f0c625daeac7158eb20c1508aea5df39 (patch)
tree11827ac2c51d9e9bd375882b5ba37c6e2ec64708
parentbaed5edeb611d949982c849461949c645f8998a7 (diff)
Wallet encrypt on create, allow to navigate options
-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 246dff0069..f0efa250d7 100644
--- a/src/qt/askpassphrasedialog.cpp
+++ b/src/qt/askpassphrasedialog.cpp
@@ -104,10 +104,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)
@@ -116,10 +120,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)) {
@@ -145,11 +158,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)) {