mirror of
https://github.com/status-im/snorenotify.git
synced 2025-02-16 18:36:45 +00:00
added missing file
This commit is contained in:
parent
bd80a4aea3
commit
97c405df58
19
src/core/trayiconnotifer.cpp
Normal file
19
src/core/trayiconnotifer.cpp
Normal file
@ -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){
|
||||||
|
|
||||||
|
}
|
23
src/core/trayiconnotifer.h
Normal file
23
src/core/trayiconnotifer.h
Normal file
@ -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…
x
Reference in New Issue
Block a user