Bitcoin Core 31.99.0
P2P Digital Currency
interface_ui.cpp
Go to the documentation of this file.
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
12
14
15bool InitError(const bilingual_str& str)
16{
18 return false;
19}
20
21bool InitError(const bilingual_str& str, const std::vector<std::string>& details)
22{
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 return InitError(details.empty() ? str : str + Untranslated(strprintf(":\n%s", MakeUnorderedList(details))));
31}
32
33void InitWarning(const bilingual_str& str)
34{
36}
Signals for UI communication.
Definition: interface_ui.h:22
btcsignals::signal< void(const bilingual_str &message, unsigned int style)> ThreadSafeMessageBox
Show message box.
Definition: interface_ui.h:68
CClientUIInterface uiInterface
void InitWarning(const bilingual_str &str)
Show warning message.
bool InitError(const bilingual_str &str)
Show error message.
std::string MakeUnorderedList(const std::vector< std::string > &items)
Create an unordered multi-line list of items.
Definition: string.h:227
Bilingual messages:
Definition: translation.h:24
#define strprintf
Format arguments and return the string or write to given std::ostream (see tinyformat::format doc for...
Definition: tinyformat.h:1172
bilingual_str Untranslated(std::string original)
Mark a bilingual_str as untranslated.
Definition: translation.h:82