qtui: Rework the attention state behavior of the tray icon
[quassel.git] / src / qtui / systrayanimationnotificationbackend.h
index cbe934d..c9155e7 100644 (file)
@@ -22,7 +22,8 @@
 
 #include "abstractnotificationbackend.h"
 #include "settingspage.h"
-#include "systemtray.h"
+
+#include "ui_systrayanimationconfigwidget.h"
 
 class QCheckBox;
 
@@ -31,18 +32,18 @@ class SystrayAnimationNotificationBackend : public AbstractNotificationBackend
     Q_OBJECT
 
 public:
-    SystrayAnimationNotificationBackend(QObject *parent = 0);
+    SystrayAnimationNotificationBackend(QObject *parent = nullptr);
 
-    void notify(const Notification &);
-    void close(uint notificationId);
-    virtual SettingsPage *createConfigWidget() const;
+    void notify(const Notification &) override;
+    void close(uint notificationId) override;
+    virtual SettingsPage *createConfigWidget() const override;
 
 private slots:
-    void animateChanged(const QVariant &);
+    void alertChanged(const QVariant &);
 
 private:
+    bool _alert{false};
     class ConfigWidget;
-    bool _animate;
 };
 
 
@@ -51,16 +52,13 @@ class SystrayAnimationNotificationBackend::ConfigWidget : public SettingsPage
     Q_OBJECT
 
 public:
-    ConfigWidget(QWidget *parent = 0);
-    void save();
-    void load();
-    bool hasDefaults() const;
-    void defaults();
+    ConfigWidget(QWidget *parent = nullptr);
+    QString settingsKey() const override;
 
-private slots:
-    void widgetChanged();
+private:
+    QVariant loadAutoWidgetValue(const QString &widgetName) override;
+    void saveAutoWidgetValue(const QString &widgetName, const QVariant &value) override;
 
 private:
-    QCheckBox *_animateBox;
-    bool _animate;
-};
\ No newline at end of file
+    Ui::SystrayAnimationConfigWidget ui;
+};