From d4442aca01a3ee2faabf0072daf3b5eb3f209ad2 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Thu, 6 Dec 2018 14:51:37 -0500 Subject: [PATCH] Merge #14783: gui: Fix boost::signals2::no_slots_error in early calls to InitWarning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6bbdb2077e squashme: connect thru node interface (João Barbosa) a0f8df365d qt: Call noui_connect to prevent boost::signals2::no_slots_error in early calls to InitWarning (João Barbosa) Pull request description: Adding the following to `bitcoin.conf` ``` [xxx] disablewallet=1 ``` And running `bitcoin-qt` gives: ``` libc++abi.dylib: terminating with uncaught exception of type boost::exception_detail::clone_impl >: boost::signals2::no_slots_error ``` Fixes regression in #14708. Tree-SHA512: 7c158376fad6ebcd80fc0dbe549d5b6e893fb82e7dc1e455825633d7f91b14dc34493487cab7642152e88f9eaf99bfa91988972d600e9fb289cf26afd64aff8a --- src/qt/bitcoingui.cpp | 4 ---- src/qt/dash.cpp | 13 +++++-------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index e94366e9a6..e884f29975 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include @@ -1775,9 +1774,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); diff --git a/src/qt/dash.cpp b/src/qt/dash.cpp index fb7c5cc19e..c2cc430ea5 100644 --- a/src/qt/dash.cpp +++ b/src/qt/dash.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("dash-core", psz).toStdString(); @@ -576,6 +571,11 @@ int main(int argc, char *argv[]) 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) @@ -804,9 +804,6 @@ int main(int argc, char *argv[]) "Warning: UI debug mode (-debug-ui) enabled" + QString(gArgs.IsArgSet("-custom-css-dir") ? "." : " without a custom css directory set with -custom-css-dir.")); } - // 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());