@@ -1038,9 +1038,10 @@ void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVer
1038
1038
progressBar->setToolTip (tooltip);
1039
1039
}
1040
1040
1041
- void BitcoinGUI::message (const QString & title, const QString & message, unsigned int style, bool * ret)
1041
+ void BitcoinGUI::message (const QString& title, QString message, unsigned int style, bool * ret)
1042
1042
{
1043
- QString strTitle = tr (" Bitcoin" ); // default title
1043
+ // Default title. On macOS, the window title is ignored (as required by the macOS Guidelines).
1044
+ QString strTitle{PACKAGE_NAME};
1044
1045
// Default to information icon
1045
1046
int nMBoxIcon = QMessageBox::Information;
1046
1047
int nNotifyIcon = Notificator::Information;
@@ -1050,37 +1051,37 @@ void BitcoinGUI::message(const QString &title, const QString &message, unsigned
1050
1051
// Prefer supplied title over style based title
1051
1052
if (!title.isEmpty ()) {
1052
1053
msgType = title;
1053
- }
1054
- else {
1054
+ } else {
1055
1055
switch (style) {
1056
1056
case CClientUIInterface::MSG_ERROR:
1057
1057
msgType = tr (" Error" );
1058
+ message = tr (" Error: %1" ).arg (message);
1058
1059
break ;
1059
1060
case CClientUIInterface::MSG_WARNING:
1060
1061
msgType = tr (" Warning" );
1062
+ message = tr (" Warning: %1" ).arg (message);
1061
1063
break ;
1062
1064
case CClientUIInterface::MSG_INFORMATION:
1063
1065
msgType = tr (" Information" );
1066
+ // No need to prepend the prefix here.
1064
1067
break ;
1065
1068
default :
1066
1069
break ;
1067
1070
}
1068
1071
}
1069
- // Append title to "Bitcoin - "
1070
- if (!msgType.isEmpty ())
1072
+
1073
+ if (!msgType.isEmpty ()) {
1071
1074
strTitle += " - " + msgType;
1075
+ }
1072
1076
1073
- // Check for error/warning icon
1074
1077
if (style & CClientUIInterface::ICON_ERROR) {
1075
1078
nMBoxIcon = QMessageBox::Critical;
1076
1079
nNotifyIcon = Notificator::Critical;
1077
- }
1078
- else if (style & CClientUIInterface::ICON_WARNING) {
1080
+ } else if (style & CClientUIInterface::ICON_WARNING) {
1079
1081
nMBoxIcon = QMessageBox::Warning;
1080
1082
nNotifyIcon = Notificator::Warning;
1081
1083
}
1082
1084
1083
- // Display message
1084
1085
if (style & CClientUIInterface::MODAL) {
1085
1086
// Check for buttons, use OK as default, if none was supplied
1086
1087
QMessageBox::StandardButton buttons;
@@ -1093,9 +1094,9 @@ void BitcoinGUI::message(const QString &title, const QString &message, unsigned
1093
1094
int r = mBox .exec ();
1094
1095
if (ret != nullptr )
1095
1096
*ret = r == QMessageBox::Ok;
1096
- }
1097
- else
1097
+ } else {
1098
1098
notificator->notify (static_cast <Notificator::Class>(nNotifyIcon), strTitle, message);
1099
+ }
1099
1100
}
1100
1101
1101
1102
void BitcoinGUI::changeEvent (QEvent *e)
0 commit comments