Mercurial > trustbridge
annotate ui/trayicon.h @ 1170:37672abf0ca0
ui/img Icons: Cleanup.
Readded the infos lost with 1148:6ec64a30fd5f.
Moved src svg files to a src subdirectory.
author | Bernhard Reiter <bernhard@intevation.de> |
---|---|
date | Fri, 19 Sep 2014 12:49:18 +0200 |
parents | a4282bc67a8b |
children | 2a1aa9df8f11 |
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, |
1144
a4282bc67a8b
(issue99) Make OK button in message box notification configurable and change it for list updates
Andre Heinecke <andre.heinecke@intevation.de>
parents:
969
diff
changeset
|
37 QSystemTrayIcon::MessageIcon icon = QSystemTrayIcon::Information, int msecs = 10000, |
a4282bc67a8b
(issue99) Make OK button in message box notification configurable and change it for list updates
Andre Heinecke <andre.heinecke@intevation.de>
parents:
969
diff
changeset
|
38 const QString &okBtnText = QString()); |
969
c096881e8ed0
(issue50) Make message box a member variable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
871
diff
changeset
|
39 private Q_SLOTS: |
c096881e8ed0
(issue50) Make message box a member variable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
871
diff
changeset
|
40 void messageDestroyed(); |
c096881e8ed0
(issue50) Make message box a member variable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
871
diff
changeset
|
41 |
871
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
42 private: |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
43 bool useAlt; |
969
c096881e8ed0
(issue50) Make message box a member variable
Andre Heinecke <andre.heinecke@intevation.de>
parents:
871
diff
changeset
|
44 QMessageBox *mMessageBox; |
871
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 |
4efd6378c001
(issue51) Add fallback in case systemtray is unavailable.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
47 #endif // TRAYICON_H |