diff options
| author | Wladimir J. van der Laan <[email protected]> | 2013-09-20 23:38:56 -0700 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2013-09-20 23:38:56 -0700 |
| commit | c2f41872638aaa097c2d0aec943ae8deeea667ad (patch) | |
| tree | 58938f82fb84ca93abcf995d19e3419fdadfad6e /src | |
| parent | Merge pull request #3020 from Diapolo/LogPrint_fixes (diff) | |
| parent | Bitcoin-Qt: BitcoinGUI::message() updates/fixes (diff) | |
| download | discoin-c2f41872638aaa097c2d0aec943ae8deeea667ad.tar.xz discoin-c2f41872638aaa097c2d0aec943ae8deeea667ad.zip | |
Merge pull request #2995 from Diapolo/GUI_message
Bitcoin-Qt: BitcoinGUI::message() updates/fixes
Diffstat (limited to 'src')
| -rw-r--r-- | src/qt/bitcoingui.cpp | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index bb9eb60e5..49eb35dfe 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -590,21 +590,28 @@ void BitcoinGUI::message(const QString &title, const QString &message, unsigned int nMBoxIcon = QMessageBox::Information; int nNotifyIcon = Notificator::Information; - // Override title based on style QString msgType; - switch (style) { - case CClientUIInterface::MSG_ERROR: - msgType = tr("Error"); - break; - case CClientUIInterface::MSG_WARNING: - msgType = tr("Warning"); - break; - case CClientUIInterface::MSG_INFORMATION: - msgType = tr("Information"); - break; - default: - msgType = title; // Use supplied title + + // Prefer supplied title over style based title + if (!title.isEmpty()) { + msgType = title; + } + else { + switch (style) { + case CClientUIInterface::MSG_ERROR: + msgType = tr("Error"); + break; + case CClientUIInterface::MSG_WARNING: + msgType = tr("Warning"); + break; + case CClientUIInterface::MSG_INFORMATION: + msgType = tr("Information"); + break; + default: + break; + } } + // Append title to "Bitcoin - " if (!msgType.isEmpty()) strTitle += " - " + msgType; @@ -625,7 +632,7 @@ void BitcoinGUI::message(const QString &title, const QString &message, unsigned if (!(buttons = (QMessageBox::StandardButton)(style & CClientUIInterface::BTN_MASK))) buttons = QMessageBox::Ok; - QMessageBox mBox((QMessageBox::Icon)nMBoxIcon, strTitle, message, buttons); + QMessageBox mBox((QMessageBox::Icon)nMBoxIcon, strTitle, message, buttons, this); int r = mBox.exec(); if (ret != NULL) *ret = r == QMessageBox::Ok; |