]> Git Repo - VerusCoin.git/blame - src/noui.cpp
Merge pull request #5360
[VerusCoin.git] / src / noui.cpp
CommitLineData
239c11d0 1// Copyright (c) 2010 Satoshi Nakamoto
f914f1a7 2// Copyright (c) 2009-2014 The Bitcoin Core developers
78253fcb 3// Distributed under the MIT software license, see the accompanying
3a25a2b9 4// file COPYING or http://www.opensource.org/licenses/mit-license.php.
5350ea41 5
51ed9ec9
BD
6#include "noui.h"
7
239c11d0 8#include "ui_interface.h"
51ed9ec9 9#include "util.h"
239c11d0 10
ad49c256 11#include <cstdio>
51ed9ec9 12#include <stdint.h>
239c11d0
WL
13#include <string>
14
f7f3a96b 15static bool noui_ThreadSafeMessageBox(const std::string& message, const std::string& caption, unsigned int style)
239c11d0 16{
d4746d56
MF
17 bool fSecure = style & CClientUIInterface::SECURE;
18 style &= ~CClientUIInterface::SECURE;
19
5350ea41
PK
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:
37f070f5 33 strCaption += caption; // Use supplied caption (can be empty)
5350ea41
PK
34 }
35
d4746d56
MF
36 if (!fSecure)
37 LogPrintf("%s: %s\n", strCaption, message);
5350ea41 38 fprintf(stderr, "%s: %s\n", strCaption.c_str(), message.c_str());
f7f3a96b 39 return false;
239c11d0
WL
40}
41
20e01b1a 42static void noui_InitMessage(const std::string& message)
bb41a87d 43{
7d9d134b 44 LogPrintf("init message: %s\n", message);
bb41a87d
PK
45}
46
239c11d0
WL
47void noui_connect()
48{
49 // Connect bitcoind signal handlers
50 uiInterface.ThreadSafeMessageBox.connect(noui_ThreadSafeMessageBox);
bb41a87d 51 uiInterface.InitMessage.connect(noui_InitMessage);
239c11d0 52}
This page took 0.137294 seconds and 4 git commands to generate.