hide soem functions
This commit is contained in:
parent
f8df055192
commit
345f63a793
|
@ -122,15 +122,6 @@ const Notification::Action &Notification::actionInvoked() const
|
||||||
return d->m_actionInvoked;
|
return d->m_actionInvoked;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Notification::setSource(SnoreFrontend *source){
|
|
||||||
d->m_source = source;
|
|
||||||
}
|
|
||||||
|
|
||||||
SnoreFrontend *Notification::source() const
|
|
||||||
{
|
|
||||||
return d->m_source;
|
|
||||||
}
|
|
||||||
|
|
||||||
Application Notification::application() const
|
Application Notification::application() const
|
||||||
{
|
{
|
||||||
return d->m_application;
|
return d->m_application;
|
||||||
|
@ -181,10 +172,6 @@ const NotificationEnums::CloseReasons::closeReasons &Notification::closeReason()
|
||||||
return d->m_closeReason;
|
return d->m_closeReason;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Notification::setCloseReason(const NotificationEnums::CloseReasons::closeReasons &r){
|
|
||||||
d->m_closeReason = r;
|
|
||||||
}
|
|
||||||
|
|
||||||
Hint &Notification::hints()
|
Hint &Notification::hints()
|
||||||
{
|
{
|
||||||
return d->m_hints;
|
return d->m_hints;
|
||||||
|
|
|
@ -71,8 +71,6 @@ public:
|
||||||
const uint &updateID() const;
|
const uint &updateID() const;
|
||||||
|
|
||||||
const Action &actionInvoked() const;
|
const Action &actionInvoked() const;
|
||||||
void setSource(class SnoreFrontend *source);
|
|
||||||
class SnoreFrontend *source() const;
|
|
||||||
Application application() const;
|
Application application() const;
|
||||||
QString title() const;
|
QString title() const;
|
||||||
QString text() const;
|
QString text() const;
|
||||||
|
@ -84,7 +82,6 @@ public:
|
||||||
const QHash<int, Action> &actions() const;
|
const QHash<int, Action> &actions() const;
|
||||||
void addAction(const Action &a);
|
void addAction(const Action &a);
|
||||||
const NotificationEnums::CloseReasons::closeReasons &closeReason();
|
const NotificationEnums::CloseReasons::closeReasons &closeReason();
|
||||||
void setCloseReason(const NotificationEnums::CloseReasons::closeReasons &r);
|
|
||||||
Hint &hints();
|
Hint &hints();
|
||||||
|
|
||||||
void setSilent(bool silent);
|
void setSilent(bool silent);
|
||||||
|
|
|
@ -65,3 +65,19 @@ void NotificationData::setActionInvoked ( const int &id)
|
||||||
{
|
{
|
||||||
m_actionInvoked = m_actions[id];
|
m_actionInvoked = m_actions[id];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NotificationData::setSource(SnoreFrontend *source)
|
||||||
|
{
|
||||||
|
m_source = source;
|
||||||
|
}
|
||||||
|
|
||||||
|
SnoreFrontend *NotificationData::source() const
|
||||||
|
{
|
||||||
|
return m_source;
|
||||||
|
}
|
||||||
|
|
||||||
|
void NotificationData::setCloseReason(const NotificationEnums::CloseReasons::closeReasons &r)
|
||||||
|
{
|
||||||
|
m_closeReason = r;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,9 +38,16 @@ public:
|
||||||
int timeout,NotificationEnums::Prioritys::prioritys priority );
|
int timeout,NotificationEnums::Prioritys::prioritys priority );
|
||||||
|
|
||||||
~NotificationData();
|
~NotificationData();
|
||||||
|
|
||||||
|
void setSource(class SnoreFrontend *source);
|
||||||
|
class SnoreFrontend *source() const;
|
||||||
|
|
||||||
void setActionInvoked( const Notification::Action &action );
|
void setActionInvoked( const Notification::Action &action );
|
||||||
void setActionInvoked( const int &actionID);
|
void setActionInvoked( const int &actionID);
|
||||||
|
|
||||||
|
|
||||||
|
void setCloseReason(const NotificationEnums::CloseReasons::closeReasons &r);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(NotificationData)
|
Q_DISABLE_COPY(NotificationData)
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include "../snore_p.h"
|
#include "../snore_p.h"
|
||||||
#include "../application.h"
|
#include "../application.h"
|
||||||
#include "../notification/notification.h"
|
#include "../notification/notification.h"
|
||||||
|
#include "../notification/notification_p.h"
|
||||||
|
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
@ -86,7 +87,7 @@ void SnoreBackend::closeNotification(Notification n, NotificationEnums::CloseRea
|
||||||
{
|
{
|
||||||
m_activeNotifications.remove(n.id());
|
m_activeNotifications.remove(n.id());
|
||||||
}
|
}
|
||||||
n.setCloseReason(reason);
|
n.data()->setCloseReason(reason);
|
||||||
slotCloseNotification(n);
|
slotCloseNotification(n);
|
||||||
emit notificationClosed(n);
|
emit notificationClosed(n);
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include "plugins/plugins.h"
|
#include "plugins/plugins.h"
|
||||||
#include "plugins/snorebackend.h"
|
#include "plugins/snorebackend.h"
|
||||||
#include "plugins/snorefrontend.h"
|
#include "plugins/snorefrontend.h"
|
||||||
|
#include "notification/notification_p.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
|
||||||
|
@ -63,9 +64,9 @@ void SnoreCorePrivate::notificationActionInvoked(Notification notification) cons
|
||||||
{
|
{
|
||||||
Q_Q(const SnoreCore);
|
Q_Q(const SnoreCore);
|
||||||
emit const_cast<SnoreCore*>(q)->actionInvoked(notification);
|
emit const_cast<SnoreCore*>(q)->actionInvoked(notification);
|
||||||
if ( notification.source() )
|
if ( notification.data()->source() )
|
||||||
{
|
{
|
||||||
notification.source()->actionInvoked ( notification );
|
notification.data()->source()->actionInvoked ( notification );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,9 +74,9 @@ void SnoreCorePrivate::slotNotificationClosed(Notification n)
|
||||||
{
|
{
|
||||||
Q_Q(SnoreCore);
|
Q_Q(SnoreCore);
|
||||||
emit q->notificationClosed(n);
|
emit q->notificationClosed(n);
|
||||||
if(n.source())
|
if(n.data()->source())
|
||||||
{
|
{
|
||||||
n.source()->notificationClosed(n);
|
n.data()->source()->notificationClosed(n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include "plugins/backends/freedesktop/fredesktopnotification.h"
|
#include "plugins/backends/freedesktop/fredesktopnotification.h"
|
||||||
#include "core/snore.h"
|
#include "core/snore.h"
|
||||||
#include "core/version.h"
|
#include "core/version.h"
|
||||||
|
#include "core/notification/notification_p.h"
|
||||||
|
|
||||||
#include <QtCore>
|
#include <QtCore>
|
||||||
#include <QtDBus>
|
#include <QtDBus>
|
||||||
|
@ -111,7 +112,7 @@ uint FreedesktopFrontend::Notify(const QString &app_name, uint replaces_id,
|
||||||
{
|
{
|
||||||
noti.setUpdateID(replaces_id);
|
noti.setUpdateID(replaces_id);
|
||||||
}
|
}
|
||||||
noti.setSource(this);
|
noti.data()->setSource(this);
|
||||||
for(int i = 0;i < actions.length(); i+=2)
|
for(int i = 0;i < actions.length(); i+=2)
|
||||||
{
|
{
|
||||||
noti.addAction(Notification::Action(actions.at(i).toInt(),actions.at(i+1)));
|
noti.addAction(Notification::Action(actions.at(i).toInt(),actions.at(i+1)));
|
||||||
|
|
|
@ -22,6 +22,8 @@
|
||||||
|
|
||||||
#include "core/snore.h"
|
#include "core/snore.h"
|
||||||
#include "core/notification/notification.h"
|
#include "core/notification/notification.h"
|
||||||
|
#include "core/notification/notification_p.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -142,8 +144,7 @@ SnarlNotification Parser::parse(QString &msg,QTcpSocket* client){
|
||||||
}
|
}
|
||||||
|
|
||||||
sNotification.notification = Notification(app,alert,title,text,icon,timeout);
|
sNotification.notification = Notification(app,alert,title,text,icon,timeout);
|
||||||
qDebug() << sNotification.notification.title() << sNotification.notification.icon() << sNotification.notification.icon().isValid();
|
sNotification.notification.data()->setSource(snarl);
|
||||||
sNotification.notification.setSource(snarl);
|
|
||||||
|
|
||||||
|
|
||||||
switch(action)
|
switch(action)
|
||||||
|
|
Loading…
Reference in New Issue