Skip to content

Commit

Permalink
Missed commit for UnlockForMint
Browse files Browse the repository at this point in the history
  • Loading branch information
Tranz5 committed May 28, 2014
1 parent 7d2d545 commit 1284d76
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
26 changes: 17 additions & 9 deletions src/qt/askpassphrasedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down
9 changes: 5 additions & 4 deletions src/qt/askpassphrasedialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1284d76

Please sign in to comment.