diff options
author | Andrew Chow <achow101-github@achow101.com> | 2019-01-18 17:05:32 -0500 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2019-01-23 15:18:03 -0500 |
commit | 2bc4c3eaf96f5f8490fc79280422916c5d14cde3 (patch) | |
tree | 743a1f80a4a38f55e13d02547373c94b0c2c0ace /src/qt/receivecoinsdialog.cpp | |
parent | 14bcdbe09cffaef9bcc51dd9de1645db3f0a93db (diff) |
Notify the GUI that the keypool has changed to set the receive button
Whenever the keypool changes (new keys generated, new seed set,
keypool runs out, etc.), notify the GUI that the keypool has changed. The
receive button can then be enabled and disabled as necessary.
Diffstat (limited to 'src/qt/receivecoinsdialog.cpp')
-rw-r--r-- | src/qt/receivecoinsdialog.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/qt/receivecoinsdialog.cpp b/src/qt/receivecoinsdialog.cpp index 8942188dc9..22a79a12bb 100644 --- a/src/qt/receivecoinsdialog.cpp +++ b/src/qt/receivecoinsdialog.cpp @@ -100,8 +100,13 @@ void ReceiveCoinsDialog::setModel(WalletModel *_model) ui->useBech32->setCheckState(Qt::Unchecked); } - // eventually disable the main receive button if private key operations are disabled + // Set the button to be enabled or disabled based on whether the wallet can give out new addresses. ui->receiveButton->setEnabled(model->canGetAddresses()); + + // Enable/disable the receive button if the wallet is now able/unable to give out new addresses. + connect(model, &WalletModel::canGetAddressesChanged, [this] { + ui->receiveButton->setEnabled(model->canGetAddresses()); + }); } } |