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.
This commit is contained in:
Andrew Chow
2019-01-18 17:05:32 -05:00
parent 14bcdbe09c
commit 2bc4c3eaf9
7 changed files with 37 additions and 1 deletions

View File

@@ -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());
});
}
}