X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fsnorenotificationbackend.h;h=7b5b910b29169c73856f4e9a14359ed4db182f76;hp=bfdb25dc5838d064176fa051b6eace63cab99e5a;hb=16f22647e6890d3eb8c3e94f7a0700e12fa29e44;hpb=041cba001b691df0d67aaec5fbf220f5503cdaa3 diff --git a/src/qtui/snorenotificationbackend.h b/src/qtui/snorenotificationbackend.h index bfdb25dc..7b5b910b 100644 --- a/src/qtui/snorenotificationbackend.h +++ b/src/qtui/snorenotificationbackend.h @@ -1,22 +1,22 @@ /*************************************************************************** -* Copyright (C) 2011-2013 by Patrick von Reth * -* vonreth@kde.org * -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) version 3. * -* * -* This program is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -* GNU General Public License for more details. * -* * -* You should have received a copy of the GNU General Public License * -* along with this program; if not, write to the * -* Free Software Foundation, Inc., * -* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * -***************************************************************************/ + * Copyright (C) 2011-2016 by Hannah von Reth * + * vonreth@kde.org * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) version 3. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ #ifndef SNORENOTIFICATIONBACKEND_H_ #define SNORENOTIFICATIONBACKEND_H_ @@ -27,13 +27,10 @@ #include "ui_snorentificationconfigwidget.h" -namespace Snore{ -class SnoreCore; -class Icon; -} -class SystrayNotificationBackend; +#include +#include -#include +class SystrayNotificationBackend; class SnoreNotificationBackend : public AbstractNotificationBackend { Q_OBJECT @@ -44,51 +41,41 @@ public: void notify(const Notification &); void close(uint notificationId); - virtual SettingsPage *createConfigWidget()const; - -signals: - void activated(uint notificationId = 0); + virtual SettingsPage *createConfigWidget() const; public slots: void actionInvoked(Snore::Notification); + private slots: - void backendChanged(const QVariant &); - void timeoutChanged(const QVariant &); + void setTraybackend(const QVariant &b); private: - void setTraybackend(); - bool setSnoreBackend(const QString &backend); class ConfigWidget; - SystrayNotificationBackend * m_systrayBackend; - Snore::SnoreCore *m_snore; - QHash m_notificationIds; +#ifndef HAVE_KDE + SystrayNotificationBackend * m_systrayBackend = nullptr; +#endif + QHash m_notificationIds; Snore::Icon m_icon; - int m_timeout; + Snore::Application m_application; + Snore::Alert m_alert; }; class SnoreNotificationBackend::ConfigWidget : public SettingsPage { Q_OBJECT public: - ConfigWidget(Snore::SnoreCore *snore,QWidget *parent = 0); - void save(); - void load(); + ConfigWidget(QWidget *parent = 0); + bool hasDefaults() const; void defaults(); - + void load(); + void save(); private slots: - void backendChanged(const QString&); - void timeoutChanged(int); + void useSnnoreChanged(bool); private: Ui::SnoreNotificationConfigWidget ui; - Snore::SnoreCore *m_snore; - - // QSpinBox *timeoutBox; - - // bool enabled; - // int timeout; }; #endif