qt: Fix wallet encryption dialog (#3816)

Do not rely on `checked` status of `encryptWalletAction`
This commit is contained in:
UdjinM6 2020-11-16 00:19:03 +03:00
parent 67624ec21b
commit ccef3b4836
No known key found for this signature in database
GPG Key ID: 83592BD1400D58D9
5 changed files with 7 additions and 7 deletions

View File

@ -575,7 +575,7 @@ void BitcoinGUI::createActions()
#ifdef ENABLE_WALLET
if(walletFrame)
{
connect(encryptWalletAction, SIGNAL(triggered(bool)), walletFrame, SLOT(encryptWallet(bool)));
connect(encryptWalletAction, SIGNAL(triggered()), walletFrame, SLOT(encryptWallet()));
connect(backupWalletAction, SIGNAL(triggered()), walletFrame, SLOT(backupWallet()));
connect(changePassphraseAction, SIGNAL(triggered()), walletFrame, SLOT(changePassphrase()));
connect(unlockWalletAction, SIGNAL(triggered()), walletFrame, SLOT(unlockWallet()));

View File

@ -166,11 +166,11 @@ void WalletFrame::gotoVerifyMessageTab(QString addr)
walletView->gotoVerifyMessageTab(addr);
}
void WalletFrame::encryptWallet(bool status)
void WalletFrame::encryptWallet()
{
WalletView *walletView = currentWalletView();
if (walletView)
walletView->encryptWallet(status);
walletView->encryptWallet();
}
void WalletFrame::backupWallet()

View File

@ -79,7 +79,7 @@ public Q_SLOTS:
void gotoVerifyMessageTab(QString addr = "");
/** Encrypt the wallet */
void encryptWallet(bool status);
void encryptWallet();
/** Backup the wallet */
void backupWallet();
/** Change encrypted wallet passphrase */

View File

@ -299,11 +299,11 @@ void WalletView::updateEncryptionStatus()
Q_EMIT encryptionStatusChanged(walletModel->getEncryptionStatus());
}
void WalletView::encryptWallet(bool status)
void WalletView::encryptWallet()
{
if(!walletModel)
return;
AskPassphraseDialog dlg(status ? AskPassphraseDialog::Encrypt : AskPassphraseDialog::Decrypt, this);
AskPassphraseDialog dlg(AskPassphraseDialog::Encrypt, this);
dlg.setModel(walletModel);
dlg.exec();

View File

@ -99,7 +99,7 @@ public Q_SLOTS:
*/
void processNewTransaction(const QModelIndex& parent, int start, int /*end*/);
/** Encrypt the wallet */
void encryptWallet(bool status);
void encryptWallet();
/** Backup the wallet */
void backupWallet();
/** Change encrypted wallet passphrase */