Check for more than private keys disabled to show receive button

This commit is contained in:
Andrew Chow 2019-01-21 16:49:33 -05:00
parent 6e6b3b944d
commit 14bcdbe09c
3 changed files with 7 additions and 1 deletions

View file

@ -101,7 +101,7 @@ void ReceiveCoinsDialog::setModel(WalletModel *_model)
} }
// eventually disable the main receive button if private key operations are disabled // eventually disable the main receive button if private key operations are disabled
ui->receiveButton->setEnabled(!model->privateKeysDisabled()); ui->receiveButton->setEnabled(model->canGetAddresses());
} }
} }

View file

@ -571,6 +571,11 @@ bool WalletModel::privateKeysDisabled() const
return m_wallet->IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS); return m_wallet->IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS);
} }
bool WalletModel::canGetAddresses() const
{
return m_wallet->hdEnabled() || (!m_wallet->hdEnabled() && !m_wallet->IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS));
}
QString WalletModel::getWalletName() const QString WalletModel::getWalletName() const
{ {
return QString::fromStdString(m_wallet->getWalletName()); return QString::fromStdString(m_wallet->getWalletName());

View file

@ -214,6 +214,7 @@ public:
static bool isWalletEnabled(); static bool isWalletEnabled();
bool privateKeysDisabled() const; bool privateKeysDisabled() const;
bool canGetAddresses() const;
interfaces::Node& node() const { return m_node; } interfaces::Node& node() const { return m_node; }
interfaces::Wallet& wallet() const { return *m_wallet; } interfaces::Wallet& wallet() const { return *m_wallet; }