From a0f8df365d46d5ef1a397c755e3366899d759efc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Barbosa?= Date: Thu, 22 Nov 2018 17:40:41 +0000 Subject: qt: Call noui_connect to prevent boost::signals2::no_slots_error in early calls to InitWarning --- src/qt/bitcoin.cpp | 3 +++ src/qt/bitcoingui.cpp | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'src/qt') diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index de236a016f..ab8b7a1792 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -561,6 +561,9 @@ int main(int argc, char *argv[]) #endif SetupEnvironment(); + // Connect bitcoind signal handlers + noui_connect(); + std::unique_ptr node = interfaces::MakeNode(); // Do not refer to data directory yet, this can be overridden by Intro::pickDataDirectory diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index ef82351551..859d207d75 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -31,7 +31,6 @@ #include #include #include -#include #include #include @@ -1226,9 +1225,6 @@ void BitcoinGUI::showModalOverlay() 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); -- cgit v1.2.3 From 6bbdb2077eb4dae9f7a1938bdbcffab884719cbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Barbosa?= Date: Fri, 23 Nov 2018 16:06:32 +0000 Subject: squashme: connect thru node interface --- src/qt/bitcoin.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'src/qt') diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index ab8b7a1792..9d2ff6909e 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -71,11 +71,6 @@ Q_DECLARE_METATYPE(bool*) Q_DECLARE_METATYPE(CAmount) Q_DECLARE_METATYPE(uint256) -static void InitMessage(const std::string& message) -{ - noui_InitMessage(message); -} - /** Translate string to current locale using Qt. */ const std::function G_TRANSLATION_FUN = [](const char* psz) { return QCoreApplication::translate("bitcoin-core", psz).toStdString(); @@ -561,11 +556,13 @@ int main(int argc, char *argv[]) #endif SetupEnvironment(); - // Connect bitcoind signal handlers - noui_connect(); - std::unique_ptr node = interfaces::MakeNode(); + // Subscribe to global signals from core + std::unique_ptr handler_message_box = node->handleMessageBox(noui_ThreadSafeMessageBox); + std::unique_ptr handler_question = node->handleQuestion(noui_ThreadSafeQuestion); + std::unique_ptr handler_init_message = node->handleInitMessage(noui_InitMessage); + // Do not refer to data directory yet, this can be overridden by Intro::pickDataDirectory /// 1. Basic Qt initialization (not dependent on parameters or configuration) @@ -699,9 +696,6 @@ int main(int argc, char *argv[]) // Load GUI settings from QSettings app.createOptionsModel(gArgs.GetBoolArg("-resetguisettings", false)); - // Subscribe to global signals from core - std::unique_ptr handler = node->handleInitMessage(InitMessage); - if (gArgs.GetBoolArg("-splash", DEFAULT_SPLASHSCREEN) && !gArgs.GetBoolArg("-min", false)) app.createSplashScreen(networkStyle.data()); -- cgit v1.2.3