diff ui/trayicon.cpp @ 1144:a4282bc67a8b

(issue99) Make OK button in message box notification configurable and change it for list updates
author Andre Heinecke <andre.heinecke@intevation.de>
date Thu, 18 Sep 2014 11:08:57 +0200
parents c80777457133
children 5f4e77acb2f3
line wrap: on
line diff
--- a/ui/trayicon.cpp	Wed Sep 17 18:56:29 2014 +0200
+++ b/ui/trayicon.cpp	Thu Sep 18 11:08:57 2014 +0200
@@ -37,7 +37,8 @@
 }
 
 void TrayIcon::showMessage(const QString &title, const QString &msg,
-                           QSystemTrayIcon::MessageIcon msg_icon, int msecs) {
+                           QSystemTrayIcon::MessageIcon msg_icon, int msecs,
+                           const QString &okBtnText) {
     if (!useAlt) {
         QSystemTrayIcon::showMessage(title, msg, msg_icon, msecs);
         return;
@@ -51,7 +52,11 @@
     }
     mMessageBox->setIconPixmap(icon().pixmap(mMessageBox->iconPixmap().size()));
     mMessageBox->setWindowIcon(icon());
-    mMessageBox->button(QMessageBox::Ok)->setText (tr("Install update"));
+    if (!okBtnText.isEmpty()) {
+        mMessageBox->button(QMessageBox::Ok)->setText (okBtnText);
+    } else {
+        mMessageBox->button(QMessageBox::Ok)->setText (tr("Install update"));
+    }
     mMessageBox->button(QMessageBox::No)->setText (tr("Remind me later"));
     mMessageBox->show();
 }

http://wald.intevation.org/projects/trustbridge/