From 10d680cff4d0086bd9621438e5ac04740a38d106 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 2 Aug 2011 21:48:59 +0200 Subject: [PATCH] add splash screen --- src/init.cpp | 5 +++++ src/qt/bitcoin.cpp | 20 ++++++++++++++++++++ src/qt/bitcoin.qrc | 1 + src/qt/res/images/splash2.jpg | Bin 0 -> 5816 bytes src/qtui.h | 1 + 5 files changed, 27 insertions(+) create mode 100644 src/qt/res/images/splash2.jpg diff --git a/src/init.cpp b/src/init.cpp index fcb0c83340c..c328ca37d72 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -370,18 +370,21 @@ bool AppInit2(int argc, char* argv[]) strErrors = ""; int64 nStart; + InitMessage("Loading addresses..."); printf("Loading addresses...\n"); nStart = GetTimeMillis(); if (!LoadAddresses()) strErrors += _("Error loading addr.dat \n"); printf(" addresses %15"PRI64d"ms\n", GetTimeMillis() - nStart); + InitMessage("Loading block index..."); printf("Loading block index...\n"); nStart = GetTimeMillis(); if (!LoadBlockIndex()) strErrors += _("Error loading blkindex.dat \n"); printf(" block index %15"PRI64d"ms\n", GetTimeMillis() - nStart); + InitMessage("Loading wallet..."); printf("Loading wallet...\n"); nStart = GetTimeMillis(); bool fFirstRun; @@ -412,12 +415,14 @@ bool AppInit2(int argc, char* argv[]) } if (pindexBest != pindexRescan) { + InitMessage("Rescanning..."); printf("Rescanning last %i blocks (from block %i)...\n", pindexBest->nHeight - pindexRescan->nHeight, pindexRescan->nHeight); nStart = GetTimeMillis(); pwalletMain->ScanForWalletTransactions(pindexRescan, true); printf(" rescan %15"PRI64d"ms\n", GetTimeMillis() - nStart); } + InitMessage("Done loading"); printf("Done loading\n"); //// debug print diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index bc652d31b05..749afb4bc2b 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -15,9 +15,12 @@ #include #include #include +#include +#include // Need a global reference for the notifications to find the GUI BitcoinGUI *guiref; +QSplashScreen *splashref; int MyMessageBox(const std::string& message, const std::string& caption, int style, wxWindow* parent, int x, int y) { @@ -90,6 +93,15 @@ void MainFrameRepaint() { } +void InitMessage(const std::string &message) +{ + if(splashref) + { + splashref->showMessage(QString::fromStdString(message), Qt::AlignBottom, QColor(255,255,255)); + QApplication::instance()->processEvents(); + } +} + /* Translate string to current locale using Qt. */ @@ -109,6 +121,13 @@ int main(int argc, char *argv[]) translator.load("bitcoin_"+locale); app.installTranslator(&translator); + QSplashScreen splash(QPixmap(":/images/splash"), Qt::WindowStaysOnTopHint); + splash.show(); + splash.setAutoFillBackground(true); + splashref = &splash; + + app.processEvents(); + app.setQuitOnLastWindowClosed(false); try @@ -119,6 +138,7 @@ int main(int argc, char *argv[]) // Put this in a block, so that BitcoinGUI is cleaned up properly before // calling shutdown. BitcoinGUI window; + splash.finish(&window); OptionsModel optionsModel(pwalletMain); ClientModel clientModel(&optionsModel); WalletModel walletModel(pwalletMain, &optionsModel); diff --git a/src/qt/bitcoin.qrc b/src/qt/bitcoin.qrc index 8d4bab5462e..e56536199bc 100644 --- a/src/qt/bitcoin.qrc +++ b/src/qt/bitcoin.qrc @@ -37,6 +37,7 @@ res/images/about.png + res/images/splash2.jpg res/movies/update_spinner.mng diff --git a/src/qt/res/images/splash2.jpg b/src/qt/res/images/splash2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..3846e6f68de0ff1379fed451bb64d0271e175622 GIT binary patch literal 5816 zcmb7HcQl+)(|?pzqt|HBtrbzC6J=Q}cCq?OBxlABq6-ow(IQbo z^pX$}ghcq{{l4@5|IIz;nVB9l#dCw_9|+M^DmfWBEd>QF4>JQZ&;MI4djSRt01vz&A>s#!8Hh+2h%R3PTmV2! zOmcPF{|YGxAR!_qBd55E>e2&5#H1u7WYi#X5)#nW9wK5AfRup`#3-d$%E&U3Kx{8T0 z0K`|gmgq8I%&P%QGF0$wR6ApEL=)0?n@(#uc{!_rojj}p;)rWV29CqH)wZZooAi| zv*d-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Z|j#{ literal 0 HcmV?d00001 diff --git a/src/qtui.h b/src/qtui.h index a3b9eb01486..17fc44e94b6 100644 --- a/src/qtui.h +++ b/src/qtui.h @@ -43,6 +43,7 @@ extern bool ThreadSafeAskFee(int64 nFeeRequired, const std::string& strCaption, extern void CalledSetStatusBar(const std::string& strText, int nField); extern void UIThreadCall(boost::function0 fn); extern void MainFrameRepaint(); +extern void InitMessage(const std::string &message); extern std::string _(const char* psz); #endif