2012-05-19 09:35:26 +02:00
|
|
|
// Copyright (c) 2010 Satoshi Nakamoto
|
|
|
|
// Copyright (c) 2009-2012 The Bitcoin developers
|
|
|
|
// Distributed under the MIT/X11 software license, see the accompanying
|
2012-05-18 16:02:28 +02:00
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
2012-11-05 08:04:21 +01:00
|
|
|
|
2012-05-19 09:35:26 +02:00
|
|
|
#include "ui_interface.h"
|
|
|
|
#include "init.h"
|
|
|
|
#include "bitcoinrpc.h"
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
2012-11-05 08:04:21 +01:00
|
|
|
static int noui_ThreadSafeMessageBox(const std::string& message, const std::string& caption, unsigned int style)
|
2012-05-19 09:35:26 +02:00
|
|
|
{
|
2012-11-05 08:04:21 +01:00
|
|
|
std::string strCaption;
|
|
|
|
// Check for usage of predefined caption
|
|
|
|
switch (style) {
|
|
|
|
case CClientUIInterface::MSG_ERROR:
|
|
|
|
strCaption += _("Error");
|
|
|
|
break;
|
|
|
|
case CClientUIInterface::MSG_WARNING:
|
|
|
|
strCaption += _("Warning");
|
|
|
|
break;
|
|
|
|
case CClientUIInterface::MSG_INFORMATION:
|
|
|
|
strCaption += _("Information");
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
strCaption += caption; // Use supplied caption
|
|
|
|
}
|
|
|
|
|
2012-05-19 09:35:26 +02:00
|
|
|
printf("%s: %s\n", caption.c_str(), message.c_str());
|
2012-11-05 08:04:21 +01:00
|
|
|
fprintf(stderr, "%s: %s\n", strCaption.c_str(), message.c_str());
|
2012-05-19 09:35:26 +02:00
|
|
|
return 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool noui_ThreadSafeAskFee(int64 nFeeRequired, const std::string& strCaption)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void noui_connect()
|
|
|
|
{
|
|
|
|
// Connect bitcoind signal handlers
|
|
|
|
uiInterface.ThreadSafeMessageBox.connect(noui_ThreadSafeMessageBox);
|
|
|
|
uiInterface.ThreadSafeAskFee.connect(noui_ThreadSafeAskFee);
|
|
|
|
}
|