Use growl on mac
This commit is contained in:
parent
6acb908c10
commit
b7a493b9eb
@ -2,7 +2,8 @@
|
||||
|
||||
OSD::OSD(QSystemTrayIcon* tray_icon, QObject* parent)
|
||||
: QObject(parent),
|
||||
tray_icon_(tray_icon)
|
||||
tray_icon_(tray_icon),
|
||||
timeout_(5000)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
@ -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
11
src/osd_mac.cpp
Normal 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_);
|
||||
}
|
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user