aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhilip Kaufmann <phil.kaufmann@t-online.de>2013-09-14 11:44:12 +0200
committerPhilip Kaufmann <phil.kaufmann@t-online.de>2013-09-14 18:04:30 +0200
commitb26f9d893cb3b8b5ff74e7c71217181def1c2783 (patch)
treeca29061de0f0f91dd14184dc7eb0151e8e29f0ed /src
parent4c5969b367d2b8582abc3b0018e18456a7377497 (diff)
Bitcoin-Qt: BitcoinGUI::message() updates/fixes
- ensure message boxes are shown in center of our main window, not centered on the users desktop - always prefer user supplied titles for message boxes over the functions defaults (fixes a bug, where transaction info messages did not contain information, if it was incoming or outgoing)
Diffstat (limited to 'src')
-rw-r--r--src/qt/bitcoingui.cpp35
1 files changed, 21 insertions, 14 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index bb9eb60e5b..49eb35dfec 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;