Mercurial > trustbridge
comparison ui/trayicon.h @ 871:4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
If no systemtray is available it will now show a message box
as notification.
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Wed, 06 Aug 2014 18:03:23 +0200 |
parents | |
children | c096881e8ed0 |
comparison
equal
deleted
inserted
replaced
870:e93ae5233217 | 871:4efd6378c001 |
---|---|
1 #ifndef TRAYICON_H | |
2 #define TRAYICON_H | |
3 /* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik | |
4 * Software engineering by Intevation GmbH | |
5 * | |
6 * This file is Free Software under the GNU GPL (v>=2) | |
7 * and comes with ABSOLUTELY NO WARRANTY! | |
8 * See LICENSE.txt for details. | |
9 */ | |
10 | |
11 #include <QWidget> | |
12 #include <QSystemTrayIcon> | |
13 | |
14 | |
15 /**@brief Notification interface. | |
16 * | |
17 * This class provides an inherited implmentation of QSystemTrayIcon | |
18 * to be more flexible on platforms where no SystemTray is available. | |
19 * | |
20 * This class should become obsolete once Qt improves the support for | |
21 * StatusNotifier icons that are used in Plasma 5 and Unity. | |
22 */ | |
23 class TrayIcon : public QSystemTrayIcon | |
24 { | |
25 Q_OBJECT | |
26 public: | |
27 TrayIcon (QObject *parent); | |
28 | |
29 void show(); | |
30 bool isAlternative() {return useAlt;} | |
31 | |
32 public Q_SLOTS: | |
33 void showMessage(const QString &title, const QString &msg, | |
34 QSystemTrayIcon::MessageIcon icon = QSystemTrayIcon::Information, int msecs = 10000); | |
35 private: | |
36 bool useAlt; | |
37 }; | |
38 | |
39 #endif // TRAYICON_H |