qt: Also log and print messages or questions like bitcoind

This commit is contained in:
MarcoFalke 2018-09-06 15:21:00 -04:00
parent dd031e3839
commit fa7e9694e1
No known key found for this signature in database
GPG Key ID: CE2B75697E69A548
2 changed files with 8 additions and 3 deletions

View File

@ -28,6 +28,7 @@
#include <interfaces/handler.h>
#include <interfaces/node.h>
#include <noui.h>
#include <rpc/server.h>
#include <ui_interface.h>
#include <uint256.h>
@ -71,9 +72,9 @@ Q_DECLARE_METATYPE(bool*)
Q_DECLARE_METATYPE(CAmount)
Q_DECLARE_METATYPE(uint256)
static void InitMessage(const std::string &message)
static void InitMessage(const std::string& message)
{
LogPrintf("init message: %s\n", message);
noui_InitMessage(message);
}
/** Translate string to current locale using Qt. */

View File

@ -31,6 +31,7 @@
#include <chainparams.h>
#include <interfaces/handler.h>
#include <interfaces/node.h>
#include <noui.h>
#include <ui_interface.h>
#include <util.h>
@ -1217,8 +1218,11 @@ void BitcoinGUI::showModalOverlay()
modalOverlay->toggleVisibility();
}
static bool ThreadSafeMessageBox(BitcoinGUI *gui, const std::string& message, const std::string& caption, unsigned int style)
static bool ThreadSafeMessageBox(BitcoinGUI* gui, const std::string& message, const std::string& caption, unsigned int style)
{
// Redundantly log and print message in non-gui fashion
noui_ThreadSafeMessageBox(message, caption, style);
bool modal = (style & CClientUIInterface::MODAL);
// The SECURE flag has no effect in the Qt GUI.
// bool secure = (style & CClientUIInterface::SECURE);