diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2012-05-20 01:53:24 -0700 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2012-05-20 01:53:24 -0700 |
commit | 5a8398e55a5f2bc0ce95c1e5da06c11365af0764 (patch) | |
tree | 4ad01e70d94768977f25a0129255ec3c84635f2e /src/init.cpp | |
parent | 563f3efda3d3230bc512b35f15598d5e4e3a5071 (diff) | |
parent | 239c11d0dd4287e74286c40fb338aea85f4b1996 (diff) |
Merge pull request #1205 from laanwj/2012_05_granular_ui_notifications
Finer-grained UI updates, move UI interface to boost::signals
Diffstat (limited to 'src/init.cpp')
-rw-r--r-- | src/init.cpp | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/src/init.cpp b/src/init.cpp index 47b6f92324..e0c0c893aa 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -22,6 +22,7 @@ using namespace std; using namespace boost; CWallet* pwalletMain; +CClientUIInterface uiInterface; ////////////////////////////////////////////////////////////////////////////// // @@ -90,17 +91,6 @@ void HandleSIGTERM(int) // Start // #if !defined(QT_GUI) -int main(int argc, char* argv[]) -{ - bool fRet = false; - fRet = AppInit(argc, argv); - - if (fRet && fDaemon) - return 0; - - return 1; -} - bool AppInit(int argc, char* argv[]) { bool fRet = false; @@ -156,17 +146,33 @@ bool AppInit(int argc, char* argv[]) Shutdown(NULL); return fRet; } + +extern void noui_connect(); +int main(int argc, char* argv[]) +{ + bool fRet = false; + + // Connect bitcoind signal handlers + noui_connect(); + + fRet = AppInit(argc, argv); + + if (fRet && fDaemon) + return 0; + + return 1; +} #endif bool static InitError(const std::string &str) { - ThreadSafeMessageBox(str, _("Bitcoin"), wxOK | wxMODAL); + uiInterface.ThreadSafeMessageBox(str, _("Bitcoin"), CClientUIInterface::OK | CClientUIInterface::MODAL); return false; } bool static InitWarning(const std::string &str) { - ThreadSafeMessageBox(str, _("Bitcoin"), wxOK | wxICON_EXCLAMATION | wxMODAL); + uiInterface.ThreadSafeMessageBox(str, _("Bitcoin"), CClientUIInterface::OK | CClientUIInterface::ICON_EXCLAMATION | CClientUIInterface::MODAL); return true; } @@ -367,7 +373,7 @@ bool AppInit2() fprintf(stdout, "Bitcoin server starting\n"); int64 nStart; - InitMessage(_("Loading addresses...")); + uiInterface.InitMessage(_("Loading addresses...")); printf("Loading addresses...\n"); nStart = GetTimeMillis(); @@ -380,7 +386,7 @@ bool AppInit2() printf("Loaded %i addresses from peers.dat %"PRI64d"ms\n", addrman.size(), GetTimeMillis() - nStart); - InitMessage(_("Loading block index...")); + uiInterface.InitMessage(_("Loading block index...")); printf("Loading block index...\n"); nStart = GetTimeMillis(); if (!LoadBlockIndex()) @@ -406,7 +412,7 @@ bool AppInit2() } } - InitMessage(_("Loading wallet...")); + uiInterface.InitMessage(_("Loading wallet...")); printf("Loading wallet...\n"); nStart = GetTimeMillis(); bool fFirstRun; @@ -474,14 +480,14 @@ bool AppInit2() } if (pindexBest != pindexRescan) { - InitMessage(_("Rescanning...")); + uiInterface.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")); + uiInterface.InitMessage(_("Done loading")); printf("Done loading\n"); //// debug print |