Merge pull request #2995 from Diapolo/GUI_message
Bitcoin-Qt: BitcoinGUI::message() updates/fixes
This commit is contained in:
commit
c2f4187263
1 changed files with 21 additions and 14 deletions
|
@ -590,8 +590,13 @@ void BitcoinGUI::message(const QString &title, const QString &message, unsigned
|
||||||
int nMBoxIcon = QMessageBox::Information;
|
int nMBoxIcon = QMessageBox::Information;
|
||||||
int nNotifyIcon = Notificator::Information;
|
int nNotifyIcon = Notificator::Information;
|
||||||
|
|
||||||
// Override title based on style
|
|
||||||
QString msgType;
|
QString msgType;
|
||||||
|
|
||||||
|
// Prefer supplied title over style based title
|
||||||
|
if (!title.isEmpty()) {
|
||||||
|
msgType = title;
|
||||||
|
}
|
||||||
|
else {
|
||||||
switch (style) {
|
switch (style) {
|
||||||
case CClientUIInterface::MSG_ERROR:
|
case CClientUIInterface::MSG_ERROR:
|
||||||
msgType = tr("Error");
|
msgType = tr("Error");
|
||||||
|
@ -603,8 +608,10 @@ void BitcoinGUI::message(const QString &title, const QString &message, unsigned
|
||||||
msgType = tr("Information");
|
msgType = tr("Information");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
msgType = title; // Use supplied title
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
// Append title to "Bitcoin - "
|
||||||
if (!msgType.isEmpty())
|
if (!msgType.isEmpty())
|
||||||
strTitle += " - " + msgType;
|
strTitle += " - " + msgType;
|
||||||
|
|
||||||
|
@ -625,7 +632,7 @@ void BitcoinGUI::message(const QString &title, const QString &message, unsigned
|
||||||
if (!(buttons = (QMessageBox::StandardButton)(style & CClientUIInterface::BTN_MASK)))
|
if (!(buttons = (QMessageBox::StandardButton)(style & CClientUIInterface::BTN_MASK)))
|
||||||
buttons = QMessageBox::Ok;
|
buttons = QMessageBox::Ok;
|
||||||
|
|
||||||
QMessageBox mBox((QMessageBox::Icon)nMBoxIcon, strTitle, message, buttons);
|
QMessageBox mBox((QMessageBox::Icon)nMBoxIcon, strTitle, message, buttons, this);
|
||||||
int r = mBox.exec();
|
int r = mBox.exec();
|
||||||
if (ret != NULL)
|
if (ret != NULL)
|
||||||
*ret = r == QMessageBox::Ok;
|
*ret = r == QMessageBox::Ok;
|
||||||
|
|
Loading…
Reference in a new issue