Mercurial > trustbridge
comparison ui/trayicon.h @ 969:c096881e8ed0
(issue50) Make message box a member variable
This only shows the message box again if no old
message box still exists.
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Thu, 28 Aug 2014 14:43:47 +0200 |
parents | 4efd6378c001 |
children | a4282bc67a8b |
comparison
equal
deleted
inserted
replaced
968:5e43b9a4e926 | 969:c096881e8ed0 |
---|---|
18 * to be more flexible on platforms where no SystemTray is available. | 18 * to be more flexible on platforms where no SystemTray is available. |
19 * | 19 * |
20 * This class should become obsolete once Qt improves the support for | 20 * This class should become obsolete once Qt improves the support for |
21 * StatusNotifier icons that are used in Plasma 5 and Unity. | 21 * StatusNotifier icons that are used in Plasma 5 and Unity. |
22 */ | 22 */ |
23 | |
24 class QMessageBox; | |
25 | |
23 class TrayIcon : public QSystemTrayIcon | 26 class TrayIcon : public QSystemTrayIcon |
24 { | 27 { |
25 Q_OBJECT | 28 Q_OBJECT |
26 public: | 29 public: |
27 TrayIcon (QObject *parent); | 30 TrayIcon (QObject *parent); |
30 bool isAlternative() {return useAlt;} | 33 bool isAlternative() {return useAlt;} |
31 | 34 |
32 public Q_SLOTS: | 35 public Q_SLOTS: |
33 void showMessage(const QString &title, const QString &msg, | 36 void showMessage(const QString &title, const QString &msg, |
34 QSystemTrayIcon::MessageIcon icon = QSystemTrayIcon::Information, int msecs = 10000); | 37 QSystemTrayIcon::MessageIcon icon = QSystemTrayIcon::Information, int msecs = 10000); |
38 private Q_SLOTS: | |
39 void messageDestroyed(); | |
40 | |
35 private: | 41 private: |
36 bool useAlt; | 42 bool useAlt; |
43 QMessageBox *mMessageBox; | |
37 }; | 44 }; |
38 | 45 |
39 #endif // TRAYICON_H | 46 #endif // TRAYICON_H |