@@ -18,26 +18,30 @@ bool noui_ThreadSafeMessageBox(const std::string& message, const std::string& ca
1818{
1919 bool fSecure = style & CClientUIInterface::SECURE;
2020 style &= ~CClientUIInterface::SECURE;
21+ bool prefix = !(style & CClientUIInterface::MSG_NOPREFIX);
22+ style &= ~CClientUIInterface::MSG_NOPREFIX;
2123
2224 std::string strCaption;
23- // Check for usage of predefined caption
24- switch (style) {
25- case CClientUIInterface::MSG_ERROR:
26- strCaption += _ (" Error" );
27- break ;
28- case CClientUIInterface::MSG_WARNING:
29- strCaption += _ (" Warning" );
30- break ;
31- case CClientUIInterface::MSG_INFORMATION:
32- strCaption += _ (" Information" );
33- break ;
34- default :
35- strCaption += caption; // Use supplied caption (can be empty)
25+ if (prefix) {
26+ switch (style) {
27+ case CClientUIInterface::MSG_ERROR:
28+ strCaption = " Error: " ;
29+ break ;
30+ case CClientUIInterface::MSG_WARNING:
31+ strCaption = " Warning: " ;
32+ break ;
33+ case CClientUIInterface::MSG_INFORMATION:
34+ strCaption = " Information: " ;
35+ break ;
36+ default :
37+ strCaption = caption + " : " ; // Use supplied caption (can be empty)
38+ }
3639 }
3740
38- if (!fSecure )
39- LogPrintf (" %s: %s\n " , strCaption, message);
40- tfm::format (std::cerr, " %s: %s\n " , strCaption.c_str (), message.c_str ());
41+ if (!fSecure ) {
42+ LogPrintf (" %s%s\n " , strCaption, message);
43+ }
44+ tfm::format (std::cerr, " %s%s\n " , strCaption.c_str (), message.c_str ());
4145 return false ;
4246}
4347
0 commit comments