diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2012-05-19 09:35:26 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2012-05-20 10:44:50 +0200 |
commit | 239c11d0dd4287e74286c40fb338aea85f4b1996 (patch) | |
tree | 4ad01e70d94768977f25a0129255ec3c84635f2e /src/init.cpp | |
parent | 0832c0d1669a3504b7ec21d583aecc79f84e8506 (diff) |
Make testcases build, prevent windows symbol collision
Diffstat (limited to 'src/init.cpp')
-rw-r--r-- | src/init.cpp | 55 |
1 files changed, 18 insertions, 37 deletions
diff --git a/src/init.cpp b/src/init.cpp index 096f289640..e0c0c893aa 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -91,41 +91,6 @@ void HandleSIGTERM(int) // Start // #if !defined(QT_GUI) -static int noui_ThreadSafeMessageBox(const std::string& message, const std::string& caption, int style) -{ - printf("%s: %s\n", caption.c_str(), message.c_str()); - fprintf(stderr, "%s: %s\n", caption.c_str(), message.c_str()); - return 4; -} - -static bool noui_ThreadSafeAskFee(int64 nFeeRequired, const std::string& strCaption) -{ - return true; -} - -static void noui_QueueShutdown() -{ - // Without UI, Shutdown can simply be started in a new thread - CreateThread(Shutdown, NULL); -} - -int main(int argc, char* argv[]) -{ - bool fRet = false; - - // Connect bitcoind signal handlers - uiInterface.ThreadSafeMessageBox.connect(noui_ThreadSafeMessageBox); - uiInterface.ThreadSafeAskFee.connect(noui_ThreadSafeAskFee); - uiInterface.QueueShutdown.connect(noui_QueueShutdown); - - fRet = AppInit(argc, argv); - - if (fRet && fDaemon) - return 0; - - return 1; -} - bool AppInit(int argc, char* argv[]) { bool fRet = false; @@ -181,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) { - uiInterface.ThreadSafeMessageBox(str, _("Bitcoin"), MF_OK|MF_MODAL); + uiInterface.ThreadSafeMessageBox(str, _("Bitcoin"), CClientUIInterface::OK | CClientUIInterface::MODAL); return false; } bool static InitWarning(const std::string &str) { - uiInterface.ThreadSafeMessageBox(str, _("Bitcoin"), MF_OK | MF_ICON_EXCLAMATION | MF_MODAL); + uiInterface.ThreadSafeMessageBox(str, _("Bitcoin"), CClientUIInterface::OK | CClientUIInterface::ICON_EXCLAMATION | CClientUIInterface::MODAL); return true; } |