diff options
| author | Jonas Schnelli <[email protected]> | 2013-05-10 22:20:51 +0200 |
|---|---|---|
| committer | Jonas Schnelli <[email protected]> | 2013-05-24 12:51:46 +0200 |
| commit | b4b017059514ed0157877984363ed94f5ab098e9 (patch) | |
| tree | b8bd52d5059231402fcd6df591e6169e6571e712 /src/qt/macnotificationhandler.h | |
| parent | Update version numbers for 0.8.2rc1 release (diff) | |
| download | discoin-b4b017059514ed0157877984363ed94f5ab098e9.tar.xz discoin-b4b017059514ed0157877984363ed94f5ab098e9.zip | |
osx: make use of the 10.8+ user notification center to display growl like notifications
- if 10.8, use user notification center, if <10.8, use growl
Signed-off-by: Jonas Schnelli <[email protected]>
Diffstat (limited to 'src/qt/macnotificationhandler.h')
| -rw-r--r-- | src/qt/macnotificationhandler.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/qt/macnotificationhandler.h b/src/qt/macnotificationhandler.h new file mode 100644 index 000000000..cd8064c61 --- /dev/null +++ b/src/qt/macnotificationhandler.h @@ -0,0 +1,25 @@ +#ifndef MACNOTIFICATIONHANDLER_H +#define MACNOTIFICATIONHANDLER_H +#include <QObject> + +/** Macintosh-specific notification handler (supports UserNotificationCenter and Growl). + */ +class MacNotificationHandler : public QObject +{ + Q_OBJECT + +public: + /** shows a 10.8+ UserNotification in the UserNotificationCenter + */ + void showNotification(const QString &title, const QString &text); + + /** executes AppleScript */ + void sendAppleScript(const QString &script); + + /** check if OS can handle UserNotifications */ + bool hasUserNotificationCenterSupport(void); + static MacNotificationHandler *instance(); +}; + + +#endif // MACNOTIFICATIONHANDLER_H |