added missing file
This commit is contained in:
parent
bd80a4aea3
commit
97c405df58
|
@ -0,0 +1,19 @@
|
|||
#include "trayiconnotifer.h"
|
||||
|
||||
#include <QSystemTrayIcon>
|
||||
|
||||
TrayIconNotifer::TrayIconNotifer(SnoreServer *snore, QSystemTrayIcon *icon):
|
||||
Notification_Backend("TrayiconNotifer",snore),
|
||||
_trayIcon(icon),
|
||||
_id(0)
|
||||
{}
|
||||
|
||||
|
||||
int TrayIconNotifer::notify(QSharedPointer<Notification> notification){
|
||||
_trayIcon->showMessage(notification->title(),notification->text(),QSystemTrayIcon::NoIcon,notification->timeout()*1000);
|
||||
return _id++;
|
||||
}
|
||||
|
||||
void TrayIconNotifer::closeNotification(int id){
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
#ifndef TRAYICONNOTIFER_H
|
||||
#define TRAYICONNOTIFER_H
|
||||
|
||||
#include "interface.h"
|
||||
#include "notification.h"
|
||||
|
||||
class TrayIconNotifer:public Notification_Backend
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
TrayIconNotifer(class SnoreServer *snore=0,class QSystemTrayIcon *icon=0);
|
||||
bool isPrimaryNotificationBackend(){return true;}
|
||||
|
||||
public slots:
|
||||
int notify(QSharedPointer<Notification> notification);
|
||||
void closeNotification(int id);
|
||||
|
||||
private:
|
||||
class QSystemTrayIcon *_trayIcon;
|
||||
int _id;
|
||||
};
|
||||
|
||||
#endif // TRAYICONNOTIFER_H
|
Loading…
Reference in New Issue