From cccc2784a3bb10fa8e43be7e68207cafb12bd915 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Fri, 19 Jun 2020 18:14:17 -0400 Subject: scripted-diff: Move ui_interface to the node lib -BEGIN VERIFY SCRIPT- # Move files git mv src/ui_interface.h src/node/ui_interface.h git mv src/ui_interface.cpp src/node/ui_interface.cpp sed -i -e 's/BITCOIN_UI_INTERFACE_H/BITCOIN_NODE_UI_INTERFACE_H/g' src/node/ui_interface.h # Adjust includes and makefile sed -i -e 's|ui_interface|node/ui_interface|g' $(git grep -l ui_interface) # Sort includes git diff -U0 | clang-format-diff -p1 -i -v -END VERIFY SCRIPT- --- src/Makefile.am | 4 +- src/banman.cpp | 2 +- src/bitcoind.cpp | 2 +- src/httpserver.cpp | 2 +- src/index/base.cpp | 2 +- src/index/txindex.cpp | 2 +- src/init.cpp | 2 +- src/interfaces/chain.cpp | 2 +- src/interfaces/node.cpp | 2 +- src/net.cpp | 4 +- src/node/ui_interface.cpp | 65 ++++++++++++++++++++++++ src/node/ui_interface.h | 121 +++++++++++++++++++++++++++++++++++++++++++++ src/noui.cpp | 2 +- src/qt/bitcoingui.cpp | 2 +- src/qt/paymentserver.cpp | 4 +- src/qt/sendcoinsdialog.cpp | 2 +- src/qt/transactionview.cpp | 2 +- src/qt/walletmodel.cpp | 2 +- src/qt/walletview.cpp | 2 +- src/timedata.cpp | 2 +- src/txdb.cpp | 2 +- src/ui_interface.cpp | 65 ------------------------ src/ui_interface.h | 121 --------------------------------------------- src/validation.cpp | 2 +- src/wallet/init.cpp | 2 +- 25 files changed, 210 insertions(+), 210 deletions(-) create mode 100644 src/node/ui_interface.cpp create mode 100644 src/node/ui_interface.h delete mode 100644 src/ui_interface.cpp delete mode 100644 src/ui_interface.h diff --git a/src/Makefile.am b/src/Makefile.am index d94d829e2b..6658dfcd46 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -212,7 +212,7 @@ BITCOIN_CORE_H = \ torcontrol.h \ txdb.h \ txmempool.h \ - ui_interface.h \ + node/ui_interface.h \ undo.h \ util/asmap.h \ util/bip32.h \ @@ -323,7 +323,7 @@ libbitcoin_server_a_SOURCES = \ torcontrol.cpp \ txdb.cpp \ txmempool.cpp \ - ui_interface.cpp \ + node/ui_interface.cpp \ validation.cpp \ validationinterface.cpp \ versionbits.cpp \ diff --git a/src/banman.cpp b/src/banman.cpp index 9cc584f0e4..422904bb33 100644 --- a/src/banman.cpp +++ b/src/banman.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index b8e8717896..3dcce92ab5 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -13,9 +13,9 @@ #include #include #include +#include #include #include -#include #include #include #include diff --git a/src/httpserver.cpp b/src/httpserver.cpp index 5e78fd1d71..1e5ea2de83 100644 --- a/src/httpserver.cpp +++ b/src/httpserver.cpp @@ -7,10 +7,10 @@ #include #include #include +#include #include // For HTTP status codes #include #include -#include #include #include #include diff --git a/src/index/base.cpp b/src/index/base.cpp index a93b67395d..f587205a28 100644 --- a/src/index/base.cpp +++ b/src/index/base.cpp @@ -4,9 +4,9 @@ #include #include +#include #include #include -#include #include #include #include diff --git a/src/index/txindex.cpp b/src/index/txindex.cpp index 59d1888fff..64472714cc 100644 --- a/src/index/txindex.cpp +++ b/src/index/txindex.cpp @@ -3,8 +3,8 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include +#include #include -#include #include #include #include diff --git a/src/init.cpp b/src/init.cpp index 8d9566edc3..b4c40c8155 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -48,7 +49,6 @@ #include #include #include -#include #include #include #include diff --git a/src/interfaces/chain.cpp b/src/interfaces/chain.cpp index d1e04b114d..d49e4454af 100644 --- a/src/interfaces/chain.cpp +++ b/src/interfaces/chain.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -25,7 +26,6 @@ #include #include #include -#include #include #include #include diff --git a/src/interfaces/node.cpp b/src/interfaces/node.cpp index d420788dbe..5b9a15f268 100644 --- a/src/interfaces/node.cpp +++ b/src/interfaces/node.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -26,7 +27,6 @@ #include #include #include -#include #include #include #include diff --git a/src/net.cpp b/src/net.cpp index 371fbeed59..281232d801 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -14,12 +14,12 @@ #include #include #include -#include #include +#include +#include #include #include #include -#include #include #include diff --git a/src/node/ui_interface.cpp b/src/node/ui_interface.cpp new file mode 100644 index 0000000000..9ccd8e27e2 --- /dev/null +++ b/src/node/ui_interface.cpp @@ -0,0 +1,65 @@ +// Copyright (c) 2010-2020 The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include + +#include + +#include +#include + +CClientUIInterface uiInterface; + +struct UISignals { + boost::signals2::signal> ThreadSafeMessageBox; + boost::signals2::signal> ThreadSafeQuestion; + boost::signals2::signal InitMessage; + boost::signals2::signal NotifyNumConnectionsChanged; + boost::signals2::signal NotifyNetworkActiveChanged; + boost::signals2::signal NotifyAlertChanged; + boost::signals2::signal ShowProgress; + boost::signals2::signal NotifyBlockTip; + boost::signals2::signal NotifyHeaderTip; + boost::signals2::signal BannedListChanged; +}; +static UISignals g_ui_signals; + +#define ADD_SIGNALS_IMPL_WRAPPER(signal_name) \ + boost::signals2::connection CClientUIInterface::signal_name##_connect(std::function fn) \ + { \ + return g_ui_signals.signal_name.connect(fn); \ + } + +ADD_SIGNALS_IMPL_WRAPPER(ThreadSafeMessageBox); +ADD_SIGNALS_IMPL_WRAPPER(ThreadSafeQuestion); +ADD_SIGNALS_IMPL_WRAPPER(InitMessage); +ADD_SIGNALS_IMPL_WRAPPER(NotifyNumConnectionsChanged); +ADD_SIGNALS_IMPL_WRAPPER(NotifyNetworkActiveChanged); +ADD_SIGNALS_IMPL_WRAPPER(NotifyAlertChanged); +ADD_SIGNALS_IMPL_WRAPPER(ShowProgress); +ADD_SIGNALS_IMPL_WRAPPER(NotifyBlockTip); +ADD_SIGNALS_IMPL_WRAPPER(NotifyHeaderTip); +ADD_SIGNALS_IMPL_WRAPPER(BannedListChanged); + +bool CClientUIInterface::ThreadSafeMessageBox(const bilingual_str& message, const std::string& caption, unsigned int style) { return g_ui_signals.ThreadSafeMessageBox(message, caption, style); } +bool CClientUIInterface::ThreadSafeQuestion(const bilingual_str& message, const std::string& non_interactive_message, const std::string& caption, unsigned int style) { return g_ui_signals.ThreadSafeQuestion(message, non_interactive_message, caption, style); } +void CClientUIInterface::InitMessage(const std::string& message) { return g_ui_signals.InitMessage(message); } +void CClientUIInterface::NotifyNumConnectionsChanged(int newNumConnections) { return g_ui_signals.NotifyNumConnectionsChanged(newNumConnections); } +void CClientUIInterface::NotifyNetworkActiveChanged(bool networkActive) { return g_ui_signals.NotifyNetworkActiveChanged(networkActive); } +void CClientUIInterface::NotifyAlertChanged() { return g_ui_signals.NotifyAlertChanged(); } +void CClientUIInterface::ShowProgress(const std::string& title, int nProgress, bool resume_possible) { return g_ui_signals.ShowProgress(title, nProgress, resume_possible); } +void CClientUIInterface::NotifyBlockTip(SynchronizationState s, const CBlockIndex* i) { return g_ui_signals.NotifyBlockTip(s, i); } +void CClientUIInterface::NotifyHeaderTip(SynchronizationState s, const CBlockIndex* i) { return g_ui_signals.NotifyHeaderTip(s, i); } +void CClientUIInterface::BannedListChanged() { return g_ui_signals.BannedListChanged(); } + +bool InitError(const bilingual_str& str) +{ + uiInterface.ThreadSafeMessageBox(str, "", CClientUIInterface::MSG_ERROR); + return false; +} + +void InitWarning(const bilingual_str& str) +{ + uiInterface.ThreadSafeMessageBox(str, "", CClientUIInterface::MSG_WARNING); +} diff --git a/src/node/ui_interface.h b/src/node/ui_interface.h new file mode 100644 index 0000000000..d574ab879f --- /dev/null +++ b/src/node/ui_interface.h @@ -0,0 +1,121 @@ +// Copyright (c) 2010 Satoshi Nakamoto +// Copyright (c) 2012-2020 The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_NODE_UI_INTERFACE_H +#define BITCOIN_NODE_UI_INTERFACE_H + +#include +#include +#include + +class CBlockIndex; +enum class SynchronizationState; +struct bilingual_str; + +namespace boost { +namespace signals2 { +class connection; +} +} // namespace boost + +/** Signals for UI communication. */ +class CClientUIInterface +{ +public: + /** Flags for CClientUIInterface::ThreadSafeMessageBox */ + enum MessageBoxFlags + { + ICON_INFORMATION = 0, + ICON_WARNING = (1U << 0), + ICON_ERROR = (1U << 1), + /** + * Mask of all available icons in CClientUIInterface::MessageBoxFlags + * This needs to be updated, when icons are changed there! + */ + ICON_MASK = (ICON_INFORMATION | ICON_WARNING | ICON_ERROR), + + /** These values are taken from qmessagebox.h "enum StandardButton" to be directly usable */ + BTN_OK = 0x00000400U, // QMessageBox::Ok + BTN_YES = 0x00004000U, // QMessageBox::Yes + BTN_NO = 0x00010000U, // QMessageBox::No + BTN_ABORT = 0x00040000U, // QMessageBox::Abort + BTN_RETRY = 0x00080000U, // QMessageBox::Retry + BTN_IGNORE = 0x00100000U, // QMessageBox::Ignore + BTN_CLOSE = 0x00200000U, // QMessageBox::Close + BTN_CANCEL = 0x00400000U, // QMessageBox::Cancel + BTN_DISCARD = 0x00800000U, // QMessageBox::Discard + BTN_HELP = 0x01000000U, // QMessageBox::Help + BTN_APPLY = 0x02000000U, // QMessageBox::Apply + BTN_RESET = 0x04000000U, // QMessageBox::Reset + /** + * Mask of all available buttons in CClientUIInterface::MessageBoxFlags + * This needs to be updated, when buttons are changed there! + */ + BTN_MASK = (BTN_OK | BTN_YES | BTN_NO | BTN_ABORT | BTN_RETRY | BTN_IGNORE | + BTN_CLOSE | BTN_CANCEL | BTN_DISCARD | BTN_HELP | BTN_APPLY | BTN_RESET), + + /** Force blocking, modal message box dialog (not just OS notification) */ + MODAL = 0x10000000U, + + /** Do not print contents of message to debug log */ + SECURE = 0x40000000U, + + /** Predefined combinations for certain default usage cases */ + MSG_INFORMATION = ICON_INFORMATION, + MSG_WARNING = (ICON_WARNING | BTN_OK | MODAL), + MSG_ERROR = (ICON_ERROR | BTN_OK | MODAL) + }; + +#define ADD_SIGNALS_DECL_WRAPPER(signal_name, rtype, ...) \ + rtype signal_name(__VA_ARGS__); \ + using signal_name##Sig = rtype(__VA_ARGS__); \ + boost::signals2::connection signal_name##_connect(std::function fn); + + /** Show message box. */ + ADD_SIGNALS_DECL_WRAPPER(ThreadSafeMessageBox, bool, const bilingual_str& message, const std::string& caption, unsigned int style); + + /** If possible, ask the user a question. If not, falls back to ThreadSafeMessageBox(noninteractive_message, caption, style) and returns false. */ + ADD_SIGNALS_DECL_WRAPPER(ThreadSafeQuestion, bool, const bilingual_str& message, const std::string& noninteractive_message, const std::string& caption, unsigned int style); + + /** Progress message during initialization. */ + ADD_SIGNALS_DECL_WRAPPER(InitMessage, void, const std::string& message); + + /** Number of network connections changed. */ + ADD_SIGNALS_DECL_WRAPPER(NotifyNumConnectionsChanged, void, int newNumConnections); + + /** Network activity state changed. */ + ADD_SIGNALS_DECL_WRAPPER(NotifyNetworkActiveChanged, void, bool networkActive); + + /** + * Status bar alerts changed. + */ + ADD_SIGNALS_DECL_WRAPPER(NotifyAlertChanged, void, ); + + /** + * Show progress e.g. for verifychain. + * resume_possible indicates shutting down now will result in the current progress action resuming upon restart. + */ + ADD_SIGNALS_DECL_WRAPPER(ShowProgress, void, const std::string& title, int nProgress, bool resume_possible); + + /** New block has been accepted */ + ADD_SIGNALS_DECL_WRAPPER(NotifyBlockTip, void, SynchronizationState, const CBlockIndex*); + + /** Best header has changed */ + ADD_SIGNALS_DECL_WRAPPER(NotifyHeaderTip, void, SynchronizationState, const CBlockIndex*); + + /** Banlist did change. */ + ADD_SIGNALS_DECL_WRAPPER(BannedListChanged, void, void); +}; + +/** Show warning message **/ +void InitWarning(const bilingual_str& str); + +/** Show error message **/ +bool InitError(const bilingual_str& str); +constexpr auto AbortError = InitError; + +extern CClientUIInterface uiInterface; + +#endif // BITCOIN_NODE_UI_INTERFACE_H diff --git a/src/noui.cpp b/src/noui.cpp index 821d10e3bc..3c82512fac 100644 --- a/src/noui.cpp +++ b/src/noui.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index b4182e8524..3c5e8d0d07 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp index beca78a021..a1da85bda7 100644 --- a/src/qt/paymentserver.cpp +++ b/src/qt/paymentserver.cpp @@ -14,9 +14,9 @@ #include #include -#include #include -#include +#include +#include #include #include diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index 0ac61f3adc..97fb88d71c 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -21,9 +21,9 @@ #include #include #include +#include #include #include -#include #include #include #include diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp index 3df81807f0..54ecfc38ec 100644 --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index 1143969352..e374dd191c 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -21,8 +21,8 @@ #include #include #include +#include #include -#include #include // for GetBoolArg #include #include diff --git a/src/qt/walletview.cpp b/src/qt/walletview.cpp index cec9b0eeb8..2fc883a5f5 100644 --- a/src/qt/walletview.cpp +++ b/src/qt/walletview.cpp @@ -20,8 +20,8 @@ #include #include +#include #include -#include #include #include diff --git a/src/timedata.cpp b/src/timedata.cpp index 16dac24a48..6b3a79017b 100644 --- a/src/timedata.cpp +++ b/src/timedata.cpp @@ -9,8 +9,8 @@ #include #include +#include #include -#include #include #include #include diff --git a/src/txdb.cpp b/src/txdb.cpp index 6f652c1375..047560f45d 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -5,10 +5,10 @@ #include +#include #include #include #include -#include #include #include #include diff --git a/src/ui_interface.cpp b/src/ui_interface.cpp deleted file mode 100644 index 15795bd67f..0000000000 --- a/src/ui_interface.cpp +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) 2010-2020 The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#include - -#include - -#include -#include - -CClientUIInterface uiInterface; - -struct UISignals { - boost::signals2::signal> ThreadSafeMessageBox; - boost::signals2::signal> ThreadSafeQuestion; - boost::signals2::signal InitMessage; - boost::signals2::signal NotifyNumConnectionsChanged; - boost::signals2::signal NotifyNetworkActiveChanged; - boost::signals2::signal NotifyAlertChanged; - boost::signals2::signal ShowProgress; - boost::signals2::signal NotifyBlockTip; - boost::signals2::signal NotifyHeaderTip; - boost::signals2::signal BannedListChanged; -}; -static UISignals g_ui_signals; - -#define ADD_SIGNALS_IMPL_WRAPPER(signal_name) \ - boost::signals2::connection CClientUIInterface::signal_name##_connect(std::function fn) \ - { \ - return g_ui_signals.signal_name.connect(fn); \ - } - -ADD_SIGNALS_IMPL_WRAPPER(ThreadSafeMessageBox); -ADD_SIGNALS_IMPL_WRAPPER(ThreadSafeQuestion); -ADD_SIGNALS_IMPL_WRAPPER(InitMessage); -ADD_SIGNALS_IMPL_WRAPPER(NotifyNumConnectionsChanged); -ADD_SIGNALS_IMPL_WRAPPER(NotifyNetworkActiveChanged); -ADD_SIGNALS_IMPL_WRAPPER(NotifyAlertChanged); -ADD_SIGNALS_IMPL_WRAPPER(ShowProgress); -ADD_SIGNALS_IMPL_WRAPPER(NotifyBlockTip); -ADD_SIGNALS_IMPL_WRAPPER(NotifyHeaderTip); -ADD_SIGNALS_IMPL_WRAPPER(BannedListChanged); - -bool CClientUIInterface::ThreadSafeMessageBox(const bilingual_str& message, const std::string& caption, unsigned int style) { return g_ui_signals.ThreadSafeMessageBox(message, caption, style); } -bool CClientUIInterface::ThreadSafeQuestion(const bilingual_str& message, const std::string& non_interactive_message, const std::string& caption, unsigned int style) { return g_ui_signals.ThreadSafeQuestion(message, non_interactive_message, caption, style); } -void CClientUIInterface::InitMessage(const std::string& message) { return g_ui_signals.InitMessage(message); } -void CClientUIInterface::NotifyNumConnectionsChanged(int newNumConnections) { return g_ui_signals.NotifyNumConnectionsChanged(newNumConnections); } -void CClientUIInterface::NotifyNetworkActiveChanged(bool networkActive) { return g_ui_signals.NotifyNetworkActiveChanged(networkActive); } -void CClientUIInterface::NotifyAlertChanged() { return g_ui_signals.NotifyAlertChanged(); } -void CClientUIInterface::ShowProgress(const std::string& title, int nProgress, bool resume_possible) { return g_ui_signals.ShowProgress(title, nProgress, resume_possible); } -void CClientUIInterface::NotifyBlockTip(SynchronizationState s, const CBlockIndex* i) { return g_ui_signals.NotifyBlockTip(s, i); } -void CClientUIInterface::NotifyHeaderTip(SynchronizationState s, const CBlockIndex* i) { return g_ui_signals.NotifyHeaderTip(s, i); } -void CClientUIInterface::BannedListChanged() { return g_ui_signals.BannedListChanged(); } - -bool InitError(const bilingual_str& str) -{ - uiInterface.ThreadSafeMessageBox(str, "", CClientUIInterface::MSG_ERROR); - return false; -} - -void InitWarning(const bilingual_str& str) -{ - uiInterface.ThreadSafeMessageBox(str, "", CClientUIInterface::MSG_WARNING); -} diff --git a/src/ui_interface.h b/src/ui_interface.h deleted file mode 100644 index 48f454c6cf..0000000000 --- a/src/ui_interface.h +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) 2010 Satoshi Nakamoto -// Copyright (c) 2012-2020 The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#ifndef BITCOIN_UI_INTERFACE_H -#define BITCOIN_UI_INTERFACE_H - -#include -#include -#include - -class CBlockIndex; -enum class SynchronizationState; -struct bilingual_str; - -namespace boost { -namespace signals2 { -class connection; -} -} // namespace boost - -/** Signals for UI communication. */ -class CClientUIInterface -{ -public: - /** Flags for CClientUIInterface::ThreadSafeMessageBox */ - enum MessageBoxFlags - { - ICON_INFORMATION = 0, - ICON_WARNING = (1U << 0), - ICON_ERROR = (1U << 1), - /** - * Mask of all available icons in CClientUIInterface::MessageBoxFlags - * This needs to be updated, when icons are changed there! - */ - ICON_MASK = (ICON_INFORMATION | ICON_WARNING | ICON_ERROR), - - /** These values are taken from qmessagebox.h "enum StandardButton" to be directly usable */ - BTN_OK = 0x00000400U, // QMessageBox::Ok - BTN_YES = 0x00004000U, // QMessageBox::Yes - BTN_NO = 0x00010000U, // QMessageBox::No - BTN_ABORT = 0x00040000U, // QMessageBox::Abort - BTN_RETRY = 0x00080000U, // QMessageBox::Retry - BTN_IGNORE = 0x00100000U, // QMessageBox::Ignore - BTN_CLOSE = 0x00200000U, // QMessageBox::Close - BTN_CANCEL = 0x00400000U, // QMessageBox::Cancel - BTN_DISCARD = 0x00800000U, // QMessageBox::Discard - BTN_HELP = 0x01000000U, // QMessageBox::Help - BTN_APPLY = 0x02000000U, // QMessageBox::Apply - BTN_RESET = 0x04000000U, // QMessageBox::Reset - /** - * Mask of all available buttons in CClientUIInterface::MessageBoxFlags - * This needs to be updated, when buttons are changed there! - */ - BTN_MASK = (BTN_OK | BTN_YES | BTN_NO | BTN_ABORT | BTN_RETRY | BTN_IGNORE | - BTN_CLOSE | BTN_CANCEL | BTN_DISCARD | BTN_HELP | BTN_APPLY | BTN_RESET), - - /** Force blocking, modal message box dialog (not just OS notification) */ - MODAL = 0x10000000U, - - /** Do not print contents of message to debug log */ - SECURE = 0x40000000U, - - /** Predefined combinations for certain default usage cases */ - MSG_INFORMATION = ICON_INFORMATION, - MSG_WARNING = (ICON_WARNING | BTN_OK | MODAL), - MSG_ERROR = (ICON_ERROR | BTN_OK | MODAL) - }; - -#define ADD_SIGNALS_DECL_WRAPPER(signal_name, rtype, ...) \ - rtype signal_name(__VA_ARGS__); \ - using signal_name##Sig = rtype(__VA_ARGS__); \ - boost::signals2::connection signal_name##_connect(std::function fn); - - /** Show message box. */ - ADD_SIGNALS_DECL_WRAPPER(ThreadSafeMessageBox, bool, const bilingual_str& message, const std::string& caption, unsigned int style); - - /** If possible, ask the user a question. If not, falls back to ThreadSafeMessageBox(noninteractive_message, caption, style) and returns false. */ - ADD_SIGNALS_DECL_WRAPPER(ThreadSafeQuestion, bool, const bilingual_str& message, const std::string& noninteractive_message, const std::string& caption, unsigned int style); - - /** Progress message during initialization. */ - ADD_SIGNALS_DECL_WRAPPER(InitMessage, void, const std::string& message); - - /** Number of network connections changed. */ - ADD_SIGNALS_DECL_WRAPPER(NotifyNumConnectionsChanged, void, int newNumConnections); - - /** Network activity state changed. */ - ADD_SIGNALS_DECL_WRAPPER(NotifyNetworkActiveChanged, void, bool networkActive); - - /** - * Status bar alerts changed. - */ - ADD_SIGNALS_DECL_WRAPPER(NotifyAlertChanged, void, ); - - /** - * Show progress e.g. for verifychain. - * resume_possible indicates shutting down now will result in the current progress action resuming upon restart. - */ - ADD_SIGNALS_DECL_WRAPPER(ShowProgress, void, const std::string& title, int nProgress, bool resume_possible); - - /** New block has been accepted */ - ADD_SIGNALS_DECL_WRAPPER(NotifyBlockTip, void, SynchronizationState, const CBlockIndex*); - - /** Best header has changed */ - ADD_SIGNALS_DECL_WRAPPER(NotifyHeaderTip, void, SynchronizationState, const CBlockIndex*); - - /** Banlist did change. */ - ADD_SIGNALS_DECL_WRAPPER(BannedListChanged, void, void); -}; - -/** Show warning message **/ -void InitWarning(const bilingual_str& str); - -/** Show error message **/ -bool InitError(const bilingual_str& str); -constexpr auto AbortError = InitError; - -extern CClientUIInterface uiInterface; - -#endif // BITCOIN_UI_INTERFACE_H diff --git a/src/validation.cpp b/src/validation.cpp index 8bb03fdb97..630da3872a 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -36,7 +37,6 @@ #include #include #include -#include #include #include #include diff --git a/src/wallet/init.cpp b/src/wallet/init.cpp index 3885eb6185..f173b5e62b 100644 --- a/src/wallet/init.cpp +++ b/src/wallet/init.cpp @@ -7,8 +7,8 @@ #include #include #include +#include #include -#include #include #include #include -- cgit v1.2.3