Browse Source

Qt/splash: Specifically keep track of which wallet(s) we are connected to for later disconnecting

0.14
Luke Dashjr 8 years ago
parent
commit
178cd887ec
  1. 12
      src/qt/splashscreen.cpp
  2. 5
      src/qt/splashscreen.h

12
src/qt/splashscreen.cpp

@ -151,9 +151,10 @@ static void ShowProgress(SplashScreen *splash, const std::string &title, int nPr
} }
#ifdef ENABLE_WALLET #ifdef ENABLE_WALLET
static void ConnectWallet(SplashScreen *splash, CWallet* wallet) void SplashScreen::ConnectWallet(CWallet* wallet)
{ {
wallet->ShowProgress.connect(boost::bind(ShowProgress, splash, _1, _2)); wallet->ShowProgress.connect(boost::bind(ShowProgress, this, _1, _2));
connectedWallets.push_back(wallet);
} }
#endif #endif
@ -163,7 +164,7 @@ void SplashScreen::subscribeToCoreSignals()
uiInterface.InitMessage.connect(boost::bind(InitMessage, this, _1)); uiInterface.InitMessage.connect(boost::bind(InitMessage, this, _1));
uiInterface.ShowProgress.connect(boost::bind(ShowProgress, this, _1, _2)); uiInterface.ShowProgress.connect(boost::bind(ShowProgress, this, _1, _2));
#ifdef ENABLE_WALLET #ifdef ENABLE_WALLET
uiInterface.LoadWallet.connect(boost::bind(ConnectWallet, this, _1)); uiInterface.LoadWallet.connect(boost::bind(&SplashScreen::ConnectWallet, this, _1));
#endif #endif
} }
@ -173,8 +174,9 @@ void SplashScreen::unsubscribeFromCoreSignals()
uiInterface.InitMessage.disconnect(boost::bind(InitMessage, this, _1)); uiInterface.InitMessage.disconnect(boost::bind(InitMessage, this, _1));
uiInterface.ShowProgress.disconnect(boost::bind(ShowProgress, this, _1, _2)); uiInterface.ShowProgress.disconnect(boost::bind(ShowProgress, this, _1, _2));
#ifdef ENABLE_WALLET #ifdef ENABLE_WALLET
if(pwalletMain) Q_FOREACH(CWallet* const & pwallet, connectedWallets) {
pwalletMain->ShowProgress.disconnect(boost::bind(ShowProgress, this, _1, _2)); pwallet->ShowProgress.disconnect(boost::bind(ShowProgress, this, _1, _2));
}
#endif #endif
} }

5
src/qt/splashscreen.h

@ -7,6 +7,7 @@
#include <QSplashScreen> #include <QSplashScreen>
class CWallet;
class NetworkStyle; class NetworkStyle;
/** Class for the splashscreen with information of the running client. /** Class for the splashscreen with information of the running client.
@ -39,11 +40,15 @@ private:
void subscribeToCoreSignals(); void subscribeToCoreSignals();
/** Disconnect core signals to splash screen */ /** Disconnect core signals to splash screen */
void unsubscribeFromCoreSignals(); void unsubscribeFromCoreSignals();
/** Connect wallet signals to splash screen */
void ConnectWallet(CWallet*);
QPixmap pixmap; QPixmap pixmap;
QString curMessage; QString curMessage;
QColor curColor; QColor curColor;
int curAlignment; int curAlignment;
QList<CWallet*> connectedWallets;
}; };
#endif // BITCOIN_QT_SPLASHSCREEN_H #endif // BITCOIN_QT_SPLASHSCREEN_H

Loading…
Cancel
Save