mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-12 05:34:57 +01:00
Add MSG_NOPREFIX flag for user messages
It forces do not prepend error/warning prefix.
This commit is contained in:
@@ -1046,20 +1046,21 @@ void BitcoinGUI::message(const QString& title, QString message, unsigned int sty
|
||||
int nMBoxIcon = QMessageBox::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()) {
|
||||
msgType = title;
|
||||
} else {
|
||||
switch (style) {
|
||||
case CClientUIInterface::MSG_ERROR:
|
||||
msgType = tr("Error");
|
||||
message = tr("Error: %1").arg(message);
|
||||
if (prefix) message = tr("Error: %1").arg(message);
|
||||
break;
|
||||
case CClientUIInterface::MSG_WARNING:
|
||||
msgType = tr("Warning");
|
||||
message = tr("Warning: %1").arg(message);
|
||||
if (prefix) message = tr("Warning: %1").arg(message);
|
||||
break;
|
||||
case CClientUIInterface::MSG_INFORMATION:
|
||||
msgType = tr("Information");
|
||||
|
||||
Reference in New Issue
Block a user