Changeset View
Changeset View
Standalone View
Standalone View
src/qt/bitcoingui.cpp
Show First 20 Lines • Show All 1,105 Lines • ▼ Show 20 Lines | void BitcoinGUI::message(const QString &title, QString message, | ||||
unsigned int style, bool *ret) { | unsigned int style, bool *ret) { | ||||
// Default title. On macOS, the window title is ignored (as required by the | // Default title. On macOS, the window title is ignored (as required by the | ||||
// macOS Guidelines). | // macOS Guidelines). | ||||
QString strTitle{PACKAGE_NAME}; | QString strTitle{PACKAGE_NAME}; | ||||
// Default to information icon | // Default to information icon | ||||
int nMBoxIcon = QMessageBox::Information; | int nMBoxIcon = QMessageBox::Information; | ||||
int nNotifyIcon = Notificator::Information; | int nNotifyIcon = Notificator::Information; | ||||
QString msgType; | bool prefix = !(style & CClientUIInterface::MSG_NOPREFIX); | ||||
style &= ~CClientUIInterface::MSG_NOPREFIX; | |||||
// Prefer supplied title over style based title | QString msgType; | ||||
if (!title.isEmpty()) { | if (!title.isEmpty()) { | ||||
msgType = title; | msgType = title; | ||||
} else { | } else { | ||||
switch (style) { | switch (style) { | ||||
case CClientUIInterface::MSG_ERROR: | case CClientUIInterface::MSG_ERROR: | ||||
msgType = tr("Error"); | msgType = tr("Error"); | ||||
if (prefix) { | |||||
message = tr("Error: %1").arg(message); | message = tr("Error: %1").arg(message); | ||||
} | |||||
break; | break; | ||||
case CClientUIInterface::MSG_WARNING: | case CClientUIInterface::MSG_WARNING: | ||||
msgType = tr("Warning"); | msgType = tr("Warning"); | ||||
if (prefix) { | |||||
message = tr("Warning: %1").arg(message); | message = tr("Warning: %1").arg(message); | ||||
} | |||||
break; | break; | ||||
case CClientUIInterface::MSG_INFORMATION: | case CClientUIInterface::MSG_INFORMATION: | ||||
msgType = tr("Information"); | msgType = tr("Information"); | ||||
// No need to prepend the prefix here. | // No need to prepend the prefix here. | ||||
break; | break; | ||||
default: | default: | ||||
break; | break; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 410 Lines • Show Last 20 Lines |