From 392783697c21a0c4cf3db6b0946d3d44d7fed537 Mon Sep 17 00:00:00 2001 From: Cozz Lovan Date: Wed, 19 Mar 2014 00:26:14 +0100 Subject: [Qt] rescan progress --- src/qt/splashscreen.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/qt/splashscreen.cpp') diff --git a/src/qt/splashscreen.cpp b/src/qt/splashscreen.cpp index cacf5dc49b..7c79b0efd0 100644 --- a/src/qt/splashscreen.cpp +++ b/src/qt/splashscreen.cpp @@ -5,8 +5,12 @@ #include "splashscreen.h" #include "clientversion.h" +#include "init.h" #include "ui_interface.h" #include "util.h" +#ifdef ENABLE_WALLET +#include "wallet.h" +#endif #include #include @@ -109,14 +113,33 @@ static void InitMessage(SplashScreen *splash, const std::string &message) Q_ARG(QColor, QColor(55,55,55))); } +static void ShowProgress(SplashScreen *splash, const std::string &title, int nProgress) +{ + InitMessage(splash, title + strprintf("%d", nProgress) + "%"); +} + +#ifdef ENABLE_WALLET +static void ConnectWallet(SplashScreen *splash, CWallet* wallet) +{ + wallet->ShowProgress.connect(boost::bind(ShowProgress, splash, _1, _2)); +} +#endif + void SplashScreen::subscribeToCoreSignals() { // Connect signals to client uiInterface.InitMessage.connect(boost::bind(InitMessage, this, _1)); +#ifdef ENABLE_WALLET + uiInterface.LoadWallet.connect(boost::bind(ConnectWallet, this, _1)); +#endif } void SplashScreen::unsubscribeFromCoreSignals() { // Disconnect signals from client uiInterface.InitMessage.disconnect(boost::bind(InitMessage, this, _1)); +#ifdef ENABLE_WALLET + if(pwalletMain) + pwalletMain->ShowProgress.disconnect(boost::bind(ShowProgress, this, _1, _2)); +#endif } -- cgit v1.2.3