Add UpdatedBlockTip signal to CMainSignals and CValidationInterface
[bitcoinplatinum.git] / src / noui.cpp
blob3a77361919e63fb0a9980dd31d391c51e49f5fb9
1 // Copyright (c) 2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2014 The Bitcoin Core developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
6 #include "noui.h"
8 #include "ui_interface.h"
9 #include "util.h"
11 #include <cstdio>
12 #include <stdint.h>
13 #include <string>
15 static bool noui_ThreadSafeMessageBox(const std::string& message, const std::string& caption, unsigned int style)
17 bool fSecure = style & CClientUIInterface::SECURE;
18 style &= ~CClientUIInterface::SECURE;
20 std::string strCaption;
21 // Check for usage of predefined caption
22 switch (style) {
23 case CClientUIInterface::MSG_ERROR:
24 strCaption += _("Error");
25 break;
26 case CClientUIInterface::MSG_WARNING:
27 strCaption += _("Warning");
28 break;
29 case CClientUIInterface::MSG_INFORMATION:
30 strCaption += _("Information");
31 break;
32 default:
33 strCaption += caption; // Use supplied caption (can be empty)
36 if (!fSecure)
37 LogPrintf("%s: %s\n", strCaption, message);
38 fprintf(stderr, "%s: %s\n", strCaption.c_str(), message.c_str());
39 return false;
42 static void noui_InitMessage(const std::string& message)
44 LogPrintf("init message: %s\n", message);
47 void noui_connect()
49 // Connect bitcoind signal handlers
50 uiInterface.ThreadSafeMessageBox.connect(noui_ThreadSafeMessageBox);
51 uiInterface.InitMessage.connect(noui_InitMessage);