aboutsummaryrefslogtreecommitdiff
path: root/src/qt/bitcoingui.cpp
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2019-04-30 20:55:12 +0300
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2019-06-19 19:22:34 +0300
commit96fd4ee02f6c3be21cade729b95a85c60634b0f8 (patch)
tree25cc4654e027e8e78671f7a523384c6405c4604d /src/qt/bitcoingui.cpp
parentf0641f274ffe94fbe7cae43c07a9373013739df2 (diff)
downloadbitcoin-96fd4ee02f6c3be21cade729b95a85c60634b0f8.tar.xz
Add MSG_NOPREFIX flag for user messages
It forces do not prepend error/warning prefix.
Diffstat (limited to 'src/qt/bitcoingui.cpp')
-rw-r--r--src/qt/bitcoingui.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index 59fe58a1e2..ee0680429a 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -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");