diff --git a/src/qt/askpassphrasedialog.cpp b/src/qt/askpassphrasedialog.cpp index f934c5a..ff08947 100644 --- a/src/qt/askpassphrasedialog.cpp +++ b/src/qt/askpassphrasedialog.cpp @@ -41,6 +41,14 @@ AskPassphraseDialog::AskPassphraseDialog(Mode mode, QWidget *parent) : ui->passEdit3->hide(); setWindowTitle(tr("Unlock wallet")); break; + case UnlockForMint: // Ask passphrase to unlock wallet for minting + ui->warningLabel->setText(tr("This operation needs your wallet passphrase to unlock the wallet to allow PoS.")); + ui->passLabel2->hide(); + ui->passEdit2->hide(); + ui->passLabel3->hide(); + ui->passEdit3->hide(); + setWindowTitle(tr("Unlock wallet for Stake")); + break; case Decrypt: // Ask passphrase ui->warningLabel->setText(tr("This operation needs your wallet passphrase to decrypt the wallet.")); ui->passLabel2->hide(); @@ -139,26 +147,25 @@ void AskPassphraseDialog::accept() } } break; case Unlock: - if(!model->setWalletLocked(false, oldpass)) - { + if(!model->setWalletLocked(false, oldpass, false)) QMessageBox::critical(this, tr("Wallet unlock failed"), tr("The passphrase entered for the wallet decryption was incorrect.")); - } else - { QDialog::accept(); // Success - } break; + case UnlockForMint: + if(!model->setWalletLocked(false, oldpass,true)) + QMessageBox::critical(this, tr("Wallet unlock failed"), + tr("The passphrase entered for the wallet decryption was incorrect.")); + else + QDialog::accept(); // Success + break; case Decrypt: if(!model->setWalletEncrypted(false, oldpass)) - { QMessageBox::critical(this, tr("Wallet decryption failed"), tr("The passphrase entered for the wallet decryption was incorrect.")); - } else - { QDialog::accept(); // Success - } break; case ChangePass: if(newpass1 == newpass2) @@ -194,6 +201,7 @@ void AskPassphraseDialog::textChanged() acceptable = !ui->passEdit2->text().isEmpty() && !ui->passEdit3->text().isEmpty(); break; case Unlock: // Old passphrase x1 + case UnlockForMint: // Old passphrase x1 case Decrypt: acceptable = !ui->passEdit1->text().isEmpty(); break; diff --git a/src/qt/askpassphrasedialog.h b/src/qt/askpassphrasedialog.h index 338853c..42a58ff 100644 --- a/src/qt/askpassphrasedialog.h +++ b/src/qt/askpassphrasedialog.h @@ -17,10 +17,11 @@ class AskPassphraseDialog : public QDialog public: enum Mode { - Encrypt, /**< Ask passphrase twice and encrypt */ - Unlock, /**< Ask passphrase and unlock */ - ChangePass, /**< Ask old passphrase + new passphrase twice */ - Decrypt /**< Ask passphrase and decrypt wallet */ + Encrypt, /**< Ask passphrase twice and encrypt */ + Unlock, /**< Ask passphrase and unlock */ + UnlockForMint, /**< Ask passphrase and unlock for minting */ + ChangePass, /**< Ask old passphrase + new passphrase twice */ + Decrypt /**< Ask passphrase and decrypt wallet */ }; explicit AskPassphraseDialog(Mode mode, QWidget *parent = 0);