|
|
@ -206,6 +206,14 @@ QString ClientModel::formatClientStartupTime() const |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Handlers for core signals
|
|
|
|
// Handlers for core signals
|
|
|
|
|
|
|
|
static void ShowProgress(ClientModel *clientmodel, const std::string &title, int nProgress) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// emits signal "showProgress"
|
|
|
|
|
|
|
|
QMetaObject::invokeMethod(clientmodel, "showProgress", Qt::QueuedConnection, |
|
|
|
|
|
|
|
Q_ARG(QString, QString::fromStdString(title)), |
|
|
|
|
|
|
|
Q_ARG(int, nProgress)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static void NotifyBlocksChanged(ClientModel *clientmodel) |
|
|
|
static void NotifyBlocksChanged(ClientModel *clientmodel) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// This notification is too frequent. Don't trigger a signal.
|
|
|
|
// This notification is too frequent. Don't trigger a signal.
|
|
|
@ -230,6 +238,7 @@ static void NotifyAlertChanged(ClientModel *clientmodel, const uint256 &hash, Ch |
|
|
|
void ClientModel::subscribeToCoreSignals() |
|
|
|
void ClientModel::subscribeToCoreSignals() |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Connect signals to client
|
|
|
|
// Connect signals to client
|
|
|
|
|
|
|
|
uiInterface.ShowProgress.connect(boost::bind(ShowProgress, this, _1, _2)); |
|
|
|
uiInterface.NotifyBlocksChanged.connect(boost::bind(NotifyBlocksChanged, this)); |
|
|
|
uiInterface.NotifyBlocksChanged.connect(boost::bind(NotifyBlocksChanged, this)); |
|
|
|
uiInterface.NotifyNumConnectionsChanged.connect(boost::bind(NotifyNumConnectionsChanged, this, _1)); |
|
|
|
uiInterface.NotifyNumConnectionsChanged.connect(boost::bind(NotifyNumConnectionsChanged, this, _1)); |
|
|
|
uiInterface.NotifyAlertChanged.connect(boost::bind(NotifyAlertChanged, this, _1, _2)); |
|
|
|
uiInterface.NotifyAlertChanged.connect(boost::bind(NotifyAlertChanged, this, _1, _2)); |
|
|
@ -238,6 +247,7 @@ void ClientModel::subscribeToCoreSignals() |
|
|
|
void ClientModel::unsubscribeFromCoreSignals() |
|
|
|
void ClientModel::unsubscribeFromCoreSignals() |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Disconnect signals from client
|
|
|
|
// Disconnect signals from client
|
|
|
|
|
|
|
|
uiInterface.ShowProgress.disconnect(boost::bind(ShowProgress, this, _1, _2)); |
|
|
|
uiInterface.NotifyBlocksChanged.disconnect(boost::bind(NotifyBlocksChanged, this)); |
|
|
|
uiInterface.NotifyBlocksChanged.disconnect(boost::bind(NotifyBlocksChanged, this)); |
|
|
|
uiInterface.NotifyNumConnectionsChanged.disconnect(boost::bind(NotifyNumConnectionsChanged, this, _1)); |
|
|
|
uiInterface.NotifyNumConnectionsChanged.disconnect(boost::bind(NotifyNumConnectionsChanged, this, _1)); |
|
|
|
uiInterface.NotifyAlertChanged.disconnect(boost::bind(NotifyAlertChanged, this, _1, _2)); |
|
|
|
uiInterface.NotifyAlertChanged.disconnect(boost::bind(NotifyAlertChanged, this, _1, _2)); |
|
|
|