]> Git Repo - VerusCoin.git/blob - src/noui.cpp
Merge pull request #2162 from gavinandresen/spendfrom
[VerusCoin.git] / src / noui.cpp
1 // Copyright (c) 2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2012 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.
5
6 #include "ui_interface.h"
7 #include "init.h"
8 #include "bitcoinrpc.h"
9
10 #include <string>
11
12 static int noui_ThreadSafeMessageBox(const std::string& message, const std::string& caption, unsigned int style)
13 {
14     std::string strCaption;
15     // Check for usage of predefined caption
16     switch (style) {
17     case CClientUIInterface::MSG_ERROR:
18         strCaption += _("Error");
19         break;
20     case CClientUIInterface::MSG_WARNING:
21         strCaption += _("Warning");
22         break;
23     case CClientUIInterface::MSG_INFORMATION:
24         strCaption += _("Information");
25         break;
26     default:
27         strCaption += caption; // Use supplied caption (can be empty)
28     }
29
30     printf("%s: %s\n", strCaption.c_str(), message.c_str());
31     fprintf(stderr, "%s: %s\n", strCaption.c_str(), message.c_str());
32     return 4;
33 }
34
35 static bool noui_ThreadSafeAskFee(int64 /*nFeeRequired*/)
36 {
37     return true;
38 }
39
40 static void noui_InitMessage(const std::string &message)
41 {
42     printf("init message: %s\n", message.c_str());
43 }
44
45 void noui_connect()
46 {
47     // Connect bitcoind signal handlers
48     uiInterface.ThreadSafeMessageBox.connect(noui_ThreadSafeMessageBox);
49     uiInterface.ThreadSafeAskFee.connect(noui_ThreadSafeAskFee);
50     uiInterface.InitMessage.connect(noui_InitMessage);
51 }
This page took 0.026758 seconds and 4 git commands to generate.