Master Core  v0.0.9 - 2abfd2849db8ba7a83957c64eb976b406713c123
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
noui.cpp
Go to the documentation of this file.
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.
5 
6 #include "noui.h"
7 
8 #include "ui_interface.h"
9 #include "util.h"
10 
11 #include <stdint.h>
12 #include <string>
13 
14 static bool noui_ThreadSafeMessageBox(const std::string& message, const std::string& caption, unsigned int style)
15 {
16  std::string strCaption;
17  // Check for usage of predefined caption
18  switch (style) {
20  strCaption += _("Error");
21  break;
23  strCaption += _("Warning");
24  break;
26  strCaption += _("Information");
27  break;
28  default:
29  strCaption += caption; // Use supplied caption (can be empty)
30  }
31 
32  LogPrintf("%s: %s\n", strCaption, message);
33  fprintf(stderr, "%s: %s\n", strCaption.c_str(), message.c_str());
34  return false;
35 }
36 
37 static void noui_InitMessage(const std::string &message)
38 {
39  LogPrintf("init message: %s\n", message);
40 }
41 
43 {
44  // Connect bitcoind signal handlers
47 }
CClientUIInterface uiInterface
Definition: util.cpp:100
static bool noui_ThreadSafeMessageBox(const std::string &message, const std::string &caption, unsigned int style)
Definition: noui.cpp:14
void noui_connect()
Definition: noui.cpp:42
#define LogPrintf(...)
Definition: util.h:117
static void noui_InitMessage(const std::string &message)
Definition: noui.cpp:37
std::string _(const char *psz)
Translation function: Call Translate signal on UI interface, which returns a boost::optional result...
Definition: ui_interface.h:105
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:75
boost::signals2::signal< void(const std::string &message)> InitMessage
Progress message during initialization.
Definition: ui_interface.h:78
Predefined combinations for certain default usage cases.
Definition: ui_interface.h:69