Mercurial > trustbridge
annotate ui/trayicon.h @ 1091:0ae3c99b82ee 0.9.2
Use release version urls again
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Fri, 12 Sep 2014 16:11:03 +0200 |
parents | c096881e8ed0 |
children | a4282bc67a8b |
rev | line source |
---|---|
871
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
1 #ifndef TRAYICON_H |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
2 #define TRAYICON_H |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
3 /* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
4 * Software engineering by Intevation GmbH |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
5 * |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
6 * This file is Free Software under the GNU GPL (v>=2) |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
7 * and comes with ABSOLUTELY NO WARRANTY! |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
8 * See LICENSE.txt for details. |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
9 */ |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
10 |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
11 #include <QWidget> |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
12 #include <QSystemTrayIcon> |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
13 |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
14 |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
15 /**@brief Notification interface. |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
16 * |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
17 * This class provides an inherited implmentation of QSystemTrayIcon |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
18 * to be more flexible on platforms where no SystemTray is available. |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
19 * |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
20 * This class should become obsolete once Qt improves the support for |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
21 * StatusNotifier icons that are used in Plasma 5 and Unity. |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
22 */ |
969
c096881e8ed0
(issue50) Make message box a member variable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
871
diff
changeset
|
23 |
c096881e8ed0
(issue50) Make message box a member variable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
871
diff
changeset
|
24 class QMessageBox; |
c096881e8ed0
(issue50) Make message box a member variable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
871
diff
changeset
|
25 |
871
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
26 class TrayIcon : public QSystemTrayIcon |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
27 { |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
28 Q_OBJECT |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
29 public: |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
30 TrayIcon (QObject *parent); |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
31 |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
32 void show(); |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
33 bool isAlternative() {return useAlt;} |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
34 |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
35 public Q_SLOTS: |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
36 void showMessage(const QString &title, const QString &msg, |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
37 QSystemTrayIcon::MessageIcon icon = QSystemTrayIcon::Information, int msecs = 10000); |
969
c096881e8ed0
(issue50) Make message box a member variable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
871
diff
changeset
|
38 private Q_SLOTS: |
c096881e8ed0
(issue50) Make message box a member variable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
871
diff
changeset
|
39 void messageDestroyed(); |
c096881e8ed0
(issue50) Make message box a member variable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
871
diff
changeset
|
40 |
871
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
41 private: |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
42 bool useAlt; |
969
c096881e8ed0
(issue50) Make message box a member variable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
871
diff
changeset
|
43 QMessageBox *mMessageBox; |
871
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
44 }; |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
45 |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
46 #endif // TRAYICON_H |