mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-11 21:22:47 +01:00
Update alert notification and GUI
This commit is contained in:
@@ -121,20 +121,8 @@ void ClientModel::updateNumConnections(int numConnections)
|
||||
Q_EMIT numConnectionsChanged(numConnections);
|
||||
}
|
||||
|
||||
void ClientModel::updateAlert(const QString &hash, int status)
|
||||
void ClientModel::updateAlert()
|
||||
{
|
||||
// Show error message notification for new alert
|
||||
if(status == CT_NEW)
|
||||
{
|
||||
uint256 hash_256;
|
||||
hash_256.SetHex(hash.toStdString());
|
||||
CAlert alert = CAlert::getAlertByHash(hash_256);
|
||||
if(!alert.IsNull())
|
||||
{
|
||||
Q_EMIT message(tr("Network Alert"), QString::fromStdString(alert.strStatusBar), CClientUIInterface::ICON_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
Q_EMIT alertsChanged(getStatusBarWarnings());
|
||||
}
|
||||
|
||||
@@ -226,12 +214,10 @@ static void NotifyNumConnectionsChanged(ClientModel *clientmodel, int newNumConn
|
||||
Q_ARG(int, newNumConnections));
|
||||
}
|
||||
|
||||
static void NotifyAlertChanged(ClientModel *clientmodel, const uint256 &hash, ChangeType status)
|
||||
static void NotifyAlertChanged(ClientModel *clientmodel)
|
||||
{
|
||||
qDebug() << "NotifyAlertChanged: " + QString::fromStdString(hash.GetHex()) + " status=" + QString::number(status);
|
||||
QMetaObject::invokeMethod(clientmodel, "updateAlert", Qt::QueuedConnection,
|
||||
Q_ARG(QString, QString::fromStdString(hash.GetHex())),
|
||||
Q_ARG(int, status));
|
||||
qDebug() << "NotifyAlertChanged";
|
||||
QMetaObject::invokeMethod(clientmodel, "updateAlert", Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
static void BannedListChanged(ClientModel *clientmodel)
|
||||
@@ -265,7 +251,7 @@ void ClientModel::subscribeToCoreSignals()
|
||||
// Connect signals to client
|
||||
uiInterface.ShowProgress.connect(boost::bind(ShowProgress, this, _1, _2));
|
||||
uiInterface.NotifyNumConnectionsChanged.connect(boost::bind(NotifyNumConnectionsChanged, this, _1));
|
||||
uiInterface.NotifyAlertChanged.connect(boost::bind(NotifyAlertChanged, this, _1, _2));
|
||||
uiInterface.NotifyAlertChanged.connect(boost::bind(NotifyAlertChanged, this));
|
||||
uiInterface.BannedListChanged.connect(boost::bind(BannedListChanged, this));
|
||||
uiInterface.NotifyBlockTip.connect(boost::bind(BlockTipChanged, this, _1, _2));
|
||||
}
|
||||
@@ -275,7 +261,7 @@ void ClientModel::unsubscribeFromCoreSignals()
|
||||
// Disconnect signals from client
|
||||
uiInterface.ShowProgress.disconnect(boost::bind(ShowProgress, this, _1, _2));
|
||||
uiInterface.NotifyNumConnectionsChanged.disconnect(boost::bind(NotifyNumConnectionsChanged, this, _1));
|
||||
uiInterface.NotifyAlertChanged.disconnect(boost::bind(NotifyAlertChanged, this, _1, _2));
|
||||
uiInterface.NotifyAlertChanged.disconnect(boost::bind(NotifyAlertChanged, this));
|
||||
uiInterface.BannedListChanged.disconnect(boost::bind(BannedListChanged, this));
|
||||
uiInterface.NotifyBlockTip.disconnect(boost::bind(BlockTipChanged, this, _1, _2));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user