1 // Copyright (c) 2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2014 The Bitcoin developers
3 // Distributed under the MIT/X11 software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
8 #include "ui_interface.h"
15 static bool noui_ThreadSafeMessageBox(const std::string& message, const std::string& caption, unsigned int style)
17 std::string strCaption;
18 // Check for usage of predefined caption
20 case CClientUIInterface::MSG_ERROR:
21 strCaption += _("Error");
23 case CClientUIInterface::MSG_WARNING:
24 strCaption += _("Warning");
26 case CClientUIInterface::MSG_INFORMATION:
27 strCaption += _("Information");
30 strCaption += caption; // Use supplied caption (can be empty)
33 LogPrintf("%s: %s\n", strCaption, message);
34 fprintf(stderr, "%s: %s\n", strCaption.c_str(), message.c_str());
38 static void noui_InitMessage(const std::string &message)
40 LogPrintf("init message: %s\n", message);
45 // Connect bitcoind signal handlers
46 uiInterface.ThreadSafeMessageBox.connect(noui_ThreadSafeMessageBox);
47 uiInterface.InitMessage.connect(noui_InitMessage);