Changeset View
Changeset View
Standalone View
Standalone View
src/noui.cpp
Show All 15 Lines | |||||
boost::signals2::connection noui_ThreadSafeMessageBoxConn; | boost::signals2::connection noui_ThreadSafeMessageBoxConn; | ||||
boost::signals2::connection noui_ThreadSafeQuestionConn; | boost::signals2::connection noui_ThreadSafeQuestionConn; | ||||
boost::signals2::connection noui_InitMessageConn; | boost::signals2::connection noui_InitMessageConn; | ||||
bool noui_ThreadSafeMessageBox(const bilingual_str &message, | bool noui_ThreadSafeMessageBox(const bilingual_str &message, | ||||
const std::string &caption, unsigned int style) { | const std::string &caption, unsigned int style) { | ||||
bool fSecure = style & CClientUIInterface::SECURE; | bool fSecure = style & CClientUIInterface::SECURE; | ||||
style &= ~CClientUIInterface::SECURE; | style &= ~CClientUIInterface::SECURE; | ||||
bool prefix = !(style & CClientUIInterface::MSG_NOPREFIX); | |||||
style &= ~CClientUIInterface::MSG_NOPREFIX; | |||||
std::string strCaption; | std::string strCaption; | ||||
if (prefix) { | |||||
switch (style) { | switch (style) { | ||||
case CClientUIInterface::MSG_ERROR: | case CClientUIInterface::MSG_ERROR: | ||||
strCaption = "Error: "; | strCaption = "Error: "; | ||||
break; | break; | ||||
case CClientUIInterface::MSG_WARNING: | case CClientUIInterface::MSG_WARNING: | ||||
strCaption = "Warning: "; | strCaption = "Warning: "; | ||||
break; | break; | ||||
case CClientUIInterface::MSG_INFORMATION: | case CClientUIInterface::MSG_INFORMATION: | ||||
strCaption = "Information: "; | strCaption = "Information: "; | ||||
break; | break; | ||||
default: | default: | ||||
// Use supplied caption (can be empty) | // Use supplied caption (can be empty) | ||||
strCaption = caption + ": "; | strCaption = caption + ": "; | ||||
} | } | ||||
} | |||||
if (!fSecure) { | if (!fSecure) { | ||||
LogPrintf("%s%s\n", strCaption, message.original); | LogPrintf("%s%s\n", strCaption, message.original); | ||||
} | } | ||||
tfm::format(std::cerr, "%s%s\n", strCaption, message.original); | tfm::format(std::cerr, "%s%s\n", strCaption, message.original); | ||||
return false; | return false; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 56 Lines • Show Last 20 Lines |