mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-03 20:35:17 +02:00
Add warning messages to the debug window
This commit is contained in:
@@ -563,6 +563,17 @@ bool RPCConsole::eventFilter(QObject* obj, QEvent *event)
|
||||
void RPCConsole::setClientModel(ClientModel *model)
|
||||
{
|
||||
clientModel = model;
|
||||
|
||||
bool wallet_enabled{false};
|
||||
#ifdef ENABLE_WALLET
|
||||
wallet_enabled = WalletModel::isWalletEnabled();
|
||||
#endif // ENABLE_WALLET
|
||||
if (model && !wallet_enabled) {
|
||||
// Show warning, for example if this is a prerelease version
|
||||
connect(model, &ClientModel::alertsChanged, this, &RPCConsole::updateAlerts);
|
||||
updateAlerts(model->getStatusBarWarnings());
|
||||
}
|
||||
|
||||
ui->trafficGraph->setClientModel(model);
|
||||
if (model && clientModel->getPeerTableModel() && clientModel->getBanTableModel()) {
|
||||
// Keep up to date with client
|
||||
@@ -1289,3 +1300,9 @@ QString RPCConsole::tabTitle(TabTypes tab_type) const
|
||||
{
|
||||
return ui->tabWidget->tabText(tab_type);
|
||||
}
|
||||
|
||||
void RPCConsole::updateAlerts(const QString& warnings)
|
||||
{
|
||||
this->ui->label_alerts->setVisible(!warnings.isEmpty());
|
||||
this->ui->label_alerts->setText(warnings);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user