diff ui/mainwindow.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 1a5f9e260099
children a41338b18273
line wrap: on
line diff
--- a/ui/mainwindow.cpp	Wed Sep 17 18:56:29 2014 +0200
+++ b/ui/mainwindow.cpp	Thu Sep 18 11:08:57 2014 +0200
@@ -174,8 +174,17 @@
          * the trayicon. So we delay here.*/
         QTimer::singleShot(2000, this, SLOT(showMessage()));
     } else if (mCurState == NewSoftwareAvailable || !isVisible()) {
-        mTrayIcon->showMessage(QApplication::applicationName(), mCurMessage,
-                               QSystemTrayIcon::Information, 10000);
+        if (mCurState == NewListAvailable) {
+            mTrayIcon->showMessage(QApplication::applicationName(), mCurMessage,
+                                   QSystemTrayIcon::Information, 10000,
+                                   tr("Show recommendations"));
+        } else if (mCurState == NewSoftwareAvailable || !mTrayIcon->isAlternative()) {
+            /* Only show new list or new software in alternative as
+             * the current tray icon alternative is too invasive for pure
+             * informational messages. */
+            mTrayIcon->showMessage(QApplication::applicationName(), mCurMessage,
+                                   QSystemTrayIcon::Information, 10000);
+        }
         mMessageTimer->start(); // Restart the timer so that we don't spam
     }
 }

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