Skip to content

Commit fa7e969

Browse files
author
MarcoFalke
committed
qt: Also log and print messages or questions like bitcoind
1 parent dd031e3 commit fa7e969

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/qt/bitcoin.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
#include <interfaces/handler.h>
3030
#include <interfaces/node.h>
31+
#include <noui.h>
3132
#include <rpc/server.h>
3233
#include <ui_interface.h>
3334
#include <uint256.h>
@@ -71,9 +72,9 @@ Q_DECLARE_METATYPE(bool*)
7172
Q_DECLARE_METATYPE(CAmount)
7273
Q_DECLARE_METATYPE(uint256)
7374

74-
static void InitMessage(const std::string &message)
75+
static void InitMessage(const std::string& message)
7576
{
76-
LogPrintf("init message: %s\n", message);
77+
noui_InitMessage(message);
7778
}
7879

7980
/** Translate string to current locale using Qt. */

src/qt/bitcoingui.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include <chainparams.h>
3232
#include <interfaces/handler.h>
3333
#include <interfaces/node.h>
34+
#include <noui.h>
3435
#include <ui_interface.h>
3536
#include <util.h>
3637

@@ -1217,8 +1218,11 @@ void BitcoinGUI::showModalOverlay()
12171218
modalOverlay->toggleVisibility();
12181219
}
12191220

1220-
static bool ThreadSafeMessageBox(BitcoinGUI *gui, const std::string& message, const std::string& caption, unsigned int style)
1221+
static bool ThreadSafeMessageBox(BitcoinGUI* gui, const std::string& message, const std::string& caption, unsigned int style)
12211222
{
1223+
// Redundantly log and print message in non-gui fashion
1224+
noui_ThreadSafeMessageBox(message, caption, style);
1225+
12221226
bool modal = (style & CClientUIInterface::MODAL);
12231227
// The SECURE flag has no effect in the Qt GUI.
12241228
// bool secure = (style & CClientUIInterface::SECURE);

0 commit comments

Comments
 (0)