X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=blobdiff_plain;f=src%2Fqt%2Faskpassphrasedialog.cpp;h=adaf0f4a1343c623123e379eaf48c436d1f39a48;hp=1ae43c12e3881816f24f9c717d0573a6130aa3e2;hb=2c2107310f7c2f50fbb257283f223ec9b7007f41;hpb=65da4c5bc57ef7c9fd86994bd08208e48a6165ab diff --git a/src/qt/askpassphrasedialog.cpp b/src/qt/askpassphrasedialog.cpp index 1ae43c1..adaf0f4 100644 --- a/src/qt/askpassphrasedialog.cpp +++ b/src/qt/askpassphrasedialog.cpp @@ -8,6 +8,8 @@ #include #include +extern bool fWalletUnlockMintOnly; + AskPassphraseDialog::AskPassphraseDialog(Mode mode, QWidget *parent) : QDialog(parent), ui(new Ui::AskPassphraseDialog), @@ -34,6 +36,7 @@ AskPassphraseDialog::AskPassphraseDialog(Mode mode, QWidget *parent) : setWindowTitle(tr("Encrypt wallet")); break; case Unlock: // Ask passphrase + case UnlockMining: ui->warningLabel->setText(tr("This operation needs your wallet passphrase to unlock the wallet.")); ui->passLabel2->hide(); ui->passEdit2->hide(); @@ -149,6 +152,18 @@ void AskPassphraseDialog::accept() QDialog::accept(); // Success } break; + case UnlockMining: + if(!model->setWalletLocked(false, oldpass)) + { + QMessageBox::critical(this, tr("Wallet unlock failed"), + tr("The passphrase entered for the wallet decryption was incorrect.")); + } + else + { + QDialog::accept(); // Success + fWalletUnlockMintOnly = true; + } + break; case Decrypt: if(!model->setWalletEncrypted(false, oldpass)) { @@ -194,6 +209,7 @@ void AskPassphraseDialog::textChanged() acceptable = !ui->passEdit2->text().isEmpty() && !ui->passEdit3->text().isEmpty(); break; case Unlock: // Old passphrase x1 + case UnlockMining: case Decrypt: acceptable = !ui->passEdit1->text().isEmpty(); break;