diff options
| author | Wladimir J. van der Laan <[email protected]> | 2014-04-03 11:50:29 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2014-04-03 11:51:02 +0200 |
| commit | 9bd1bdd08cd4e90f5004c40f2f3cee0f250b0811 (patch) | |
| tree | a650058b6950caf5d67dc468964b6eeeb158dc0c /src/qt/splashscreen.cpp | |
| parent | Merge pull request #3842 from ditto-b/master (diff) | |
| parent | [Qt] rescan progress (diff) | |
| download | discoin-9bd1bdd08cd4e90f5004c40f2f3cee0f250b0811.tar.xz discoin-9bd1bdd08cd4e90f5004c40f2f3cee0f250b0811.zip | |
Merge pull request #3928
3927836 [Qt] rescan progress (Cozz Lovan)
Diffstat (limited to 'src/qt/splashscreen.cpp')
| -rw-r--r-- | src/qt/splashscreen.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/qt/splashscreen.cpp b/src/qt/splashscreen.cpp index cacf5dc49..7c79b0efd 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 <QApplication> #include <QPainter> @@ -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 } |