mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-10 04:33:59 +01:00
Make ThreadSafe{MessageBox|Question} bilingual
This commit is contained in:
19
src/noui.cpp
19
src/noui.cpp
@@ -5,8 +5,9 @@
|
||||
|
||||
#include <noui.h>
|
||||
|
||||
#include <logging.h>
|
||||
#include <ui_interface.h>
|
||||
#include <util/system.h>
|
||||
#include <util/translation.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
@@ -18,7 +19,7 @@ boost::signals2::connection noui_ThreadSafeMessageBoxConn;
|
||||
boost::signals2::connection noui_ThreadSafeQuestionConn;
|
||||
boost::signals2::connection noui_InitMessageConn;
|
||||
|
||||
bool noui_ThreadSafeMessageBox(const std::string& message, const std::string& caption, unsigned int style)
|
||||
bool noui_ThreadSafeMessageBox(const bilingual_str& message, const std::string& caption, unsigned int style)
|
||||
{
|
||||
bool fSecure = style & CClientUIInterface::SECURE;
|
||||
style &= ~CClientUIInterface::SECURE;
|
||||
@@ -43,15 +44,15 @@ bool noui_ThreadSafeMessageBox(const std::string& message, const std::string& ca
|
||||
}
|
||||
|
||||
if (!fSecure) {
|
||||
LogPrintf("%s%s\n", strCaption, message);
|
||||
LogPrintf("%s%s\n", strCaption, message.original);
|
||||
}
|
||||
tfm::format(std::cerr, "%s%s\n", strCaption, message);
|
||||
tfm::format(std::cerr, "%s%s\n", strCaption, message.original);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool noui_ThreadSafeQuestion(const std::string& /* ignored interactive message */, const std::string& message, const std::string& caption, unsigned int style)
|
||||
bool noui_ThreadSafeQuestion(const bilingual_str& /* ignored interactive message */, const std::string& message, const std::string& caption, unsigned int style)
|
||||
{
|
||||
return noui_ThreadSafeMessageBox(message, caption, style);
|
||||
return noui_ThreadSafeMessageBox(Untranslated(message), caption, style);
|
||||
}
|
||||
|
||||
void noui_InitMessage(const std::string& message)
|
||||
@@ -66,13 +67,13 @@ void noui_connect()
|
||||
noui_InitMessageConn = uiInterface.InitMessage_connect(noui_InitMessage);
|
||||
}
|
||||
|
||||
bool noui_ThreadSafeMessageBoxRedirect(const std::string& message, const std::string& caption, unsigned int style)
|
||||
bool noui_ThreadSafeMessageBoxRedirect(const bilingual_str& message, const std::string& caption, unsigned int style)
|
||||
{
|
||||
LogPrintf("%s: %s\n", caption, message);
|
||||
LogPrintf("%s: %s\n", caption, message.original);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool noui_ThreadSafeQuestionRedirect(const std::string& /* ignored interactive message */, const std::string& message, const std::string& caption, unsigned int style)
|
||||
bool noui_ThreadSafeQuestionRedirect(const bilingual_str& /* ignored interactive message */, const std::string& message, const std::string& caption, unsigned int style)
|
||||
{
|
||||
LogPrintf("%s: %s\n", caption, message);
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user