Use growl on mac

This commit is contained in:
David Sansome 2010-01-08 15:37:35 +00:00
parent 6acb908c10
commit b7a493b9eb
5 changed files with 19 additions and 4 deletions

View File

@ -2,7 +2,8 @@
OSD::OSD(QSystemTrayIcon* tray_icon, QObject* parent)
: QObject(parent),
tray_icon_(tray_icon)
tray_icon_(tray_icon),
timeout_(5000)
{
Init();
}

View File

@ -31,6 +31,7 @@ class OSD : public QObject {
private:
QSystemTrayIcon* tray_icon_;
int timeout_;
#ifdef Q_WS_X11
NotifyNotification* notification_;

11
src/osd_mac.cpp Normal file
View File

@ -0,0 +1,11 @@
#include "osd.h"
#include <QtDebug>
void OSD::Init() {
}
void OSD::ShowMessage(const QString& summary, const QString& message,
const QString& icon) {
tray_icon_->showMessage(summary, message, QSystemTrayIcon::NoIcon, timeout_);
}

View File

@ -28,7 +28,7 @@ void OSD::ShowMessage(const QString& summary, const QString& message,
}
notify_notification_set_urgency(notification_, NOTIFY_URGENCY_LOW);
notify_notification_set_timeout(notification_, 5000);
notify_notification_set_timeout(notification_, timeout_);
GError* error = NULL;
notify_notification_show(notification_, &error);

View File

@ -44,8 +44,7 @@ SOURCES += main.cpp \
radioloadingindicator.cpp \
radioview.cpp \
lastfmstationdialog.cpp \
osd.cpp \
osd_x11.cpp
osd.cpp
HEADERS += mainwindow.h \
player.h \
library.h \
@ -118,6 +117,9 @@ win32 {
-lxine \
-lpthreadGC2
}
unix:!macx:SOURCES += osd_x11.cpp
macx:SOURCES += osd_mac.cpp
# QXT
INCLUDEPATH += ../3rdparty/qxt