Feathercoin  0.5.0
P2P Digital Currency
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
noui.cpp
Go to the documentation of this file.
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 bool 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) {
18  strCaption += _("Error");
19  break;
21  strCaption += _("Warning");
22  break;
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 false;
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 
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 }
void noui_connect()
Definition: noui.cpp:45
#define printf
Definition: rpcdump.cpp:12
CClientUIInterface uiInterface
Definition: init.cpp:32
boost::signals2::signal< bool(int64 nFeeRequired), boost::signals2::last_value< bool > > ThreadSafeAskFee
Ask the user whether they want to pay a fee or not.
Definition: ui_interface.h:74
std::string _(const char *psz)
Translation function: Call Translate signal on UI interface, which returns a boost::optional result...
Definition: ui_interface.h:104
boost::signals2::signal< bool(const std::string &message, const std::string &caption, unsigned int style), boost::signals2::last_value< bool > > ThreadSafeMessageBox
Show message box.
Definition: ui_interface.h:71
boost::signals2::signal< void(const std::string &message)> InitMessage
Progress message during initialization.
Definition: ui_interface.h:80
Predefined combinations for certain default usage cases.
Definition: ui_interface.h:65
long long int64
Definition: serialize.h:25