aboutsummaryrefslogtreecommitdiff
path: root/src/qt/clientmodel.cpp
diff options
context:
space:
mode:
authorCozz Lovan <cozzlovan@yahoo.com>2014-05-23 18:04:09 +0200
committerCozz Lovan <cozzlovan@yahoo.com>2014-06-03 15:21:47 +0200
commit06a91d9698762fe56fca3bd33484bddc9f020405 (patch)
tree5d494bb3f766e17f0abf1ee94b6c904cdf41b179 /src/qt/clientmodel.cpp
parent4c097f9669a28420da74b159a4d61e509da80d33 (diff)
VerifyDB progress
Diffstat (limited to 'src/qt/clientmodel.cpp')
-rw-r--r--src/qt/clientmodel.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp
index ce773e0f82..656c8bd113 100644
--- a/src/qt/clientmodel.cpp
+++ b/src/qt/clientmodel.cpp
@@ -206,6 +206,14 @@ QString ClientModel::formatClientStartupTime() const
}
// 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)
{
// 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()
{
// Connect signals to client
+ uiInterface.ShowProgress.connect(boost::bind(ShowProgress, this, _1, _2));
uiInterface.NotifyBlocksChanged.connect(boost::bind(NotifyBlocksChanged, this));
uiInterface.NotifyNumConnectionsChanged.connect(boost::bind(NotifyNumConnectionsChanged, this, _1));
uiInterface.NotifyAlertChanged.connect(boost::bind(NotifyAlertChanged, this, _1, _2));
@@ -238,6 +247,7 @@ void ClientModel::subscribeToCoreSignals()
void ClientModel::unsubscribeFromCoreSignals()
{
// Disconnect signals from client
+ uiInterface.ShowProgress.disconnect(boost::bind(ShowProgress, this, _1, _2));
uiInterface.NotifyBlocksChanged.disconnect(boost::bind(NotifyBlocksChanged, this));
uiInterface.NotifyNumConnectionsChanged.disconnect(boost::bind(NotifyNumConnectionsChanged, this, _1));
uiInterface.NotifyAlertChanged.disconnect(boost::bind(NotifyAlertChanged, this, _1, _2));