/tmp/bitcoin/src/node/interface_ui.cpp
Line | Count | Source |
1 | | // Copyright (c) 2010-present The Bitcoin Core developers |
2 | | // Distributed under the MIT software license, see the accompanying |
3 | | // file COPYING or http://www.opensource.org/licenses/mit-license.php. |
4 | | |
5 | | #include <node/interface_ui.h> |
6 | | |
7 | | #include <util/btcsignals.h> |
8 | | #include <util/string.h> |
9 | | #include <util/translation.h> |
10 | | |
11 | | using util::MakeUnorderedList; |
12 | | |
13 | | CClientUIInterface uiInterface; |
14 | | |
15 | | bool InitError(const bilingual_str& str) |
16 | 164 | { |
17 | 164 | uiInterface.ThreadSafeMessageBox(str, CClientUIInterface::MSG_ERROR); |
18 | 164 | return false; |
19 | 164 | } |
20 | | |
21 | | bool InitError(const bilingual_str& str, const std::vector<std::string>& details) |
22 | 27 | { |
23 | | // For now just flatten the list of error details into a string to pass to |
24 | | // the base InitError overload. In the future, if more init code provides |
25 | | // error details, the details could be passed separately from the main |
26 | | // message for rich display in the GUI. But currently the only init |
27 | | // functions which provide error details are ones that run during early init |
28 | | // before the GUI uiInterface is registered, so there's no point passing |
29 | | // main messages and details separately to uiInterface yet. |
30 | 27 | return InitError(details.empty() ? str : str + Untranslated(strprintf(":\n%s", MakeUnorderedList(details)))); |
31 | 27 | } |
32 | | |
33 | | void InitWarning(const bilingual_str& str) |
34 | 8 | { |
35 | 8 | uiInterface.ThreadSafeMessageBox(str, CClientUIInterface::MSG_WARNING); |
36 | 8 | } |