Changeset View
Changeset View
Standalone View
Standalone View
kcms/notifications/kcm.h
Show All 14 Lines | |||||
15 | * GNU General Public License for more details. | 15 | * GNU General Public License for more details. | ||
16 | * | 16 | * | ||
17 | * You should have received a copy of the GNU General Public License | 17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | #pragma once | 21 | #pragma once | ||
22 | 22 | | |||
23 | #include <KQuickAddons/ConfigModule> | 23 | #include <KQuickAddons/ManagedConfigModule> | ||
24 | 24 | | |||
25 | #include <QKeySequence> | 25 | #include <QKeySequence> | ||
26 | 26 | | |||
27 | class QAction; | 27 | class QAction; | ||
28 | 28 | | |||
29 | class SourcesModel; | 29 | class SourcesModel; | ||
30 | class FilterProxyModel; | 30 | class FilterProxyModel; | ||
31 | 31 | | |||
32 | namespace NotificationManager { | 32 | namespace NotificationManager { | ||
33 | class Settings; | 33 | class Settings; | ||
34 | class DoNotDisturbSettings; | ||||
35 | class NotificationSettings; | ||||
36 | class JobSettings; | ||||
37 | class BadgeSettings; | ||||
34 | } | 38 | } | ||
35 | 39 | | |||
36 | class KCMNotifications : public KQuickAddons::ConfigModule | 40 | class KCMNotifications : public KQuickAddons::ManagedConfigModule | ||
37 | { | 41 | { | ||
38 | Q_OBJECT | 42 | Q_OBJECT | ||
39 | 43 | | |||
40 | Q_PROPERTY(SourcesModel *sourcesModel READ sourcesModel CONSTANT) | 44 | Q_PROPERTY(SourcesModel *sourcesModel READ sourcesModel CONSTANT) | ||
41 | Q_PROPERTY(FilterProxyModel *filteredModel READ filteredModel CONSTANT) | 45 | Q_PROPERTY(FilterProxyModel *filteredModel READ filteredModel CONSTANT) | ||
42 | 46 | | |||
43 | Q_PROPERTY(NotificationManager::Settings *settings READ settings CONSTANT) | 47 | Q_PROPERTY(NotificationManager::Settings *settings READ settings CONSTANT) | ||
48 | Q_PROPERTY(NotificationManager::DoNotDisturbSettings *dndSettings READ dndSettings CONSTANT) | ||||
49 | Q_PROPERTY(NotificationManager::NotificationSettings *notificationSettings READ notificationSettings CONSTANT) | ||||
50 | Q_PROPERTY(NotificationManager::JobSettings *jobSettings READ jobSettings CONSTANT) | ||||
51 | Q_PROPERTY(NotificationManager::BadgeSettings *badgeSettings READ badgeSettings CONSTANT) | ||||
44 | 52 | | |||
45 | Q_PROPERTY(QKeySequence toggleDoNotDisturbShortcut | 53 | Q_PROPERTY(QKeySequence toggleDoNotDisturbShortcut | ||
46 | READ toggleDoNotDisturbShortcut | 54 | READ toggleDoNotDisturbShortcut | ||
47 | WRITE setToggleDoNotDisturbShortcut | 55 | WRITE setToggleDoNotDisturbShortcut | ||
48 | NOTIFY toggleDoNotDisturbShortcutChanged) | 56 | NOTIFY toggleDoNotDisturbShortcutChanged) | ||
49 | 57 | | |||
50 | // So it can show the respective settings module right away | 58 | // So it can show the respective settings module right away | ||
51 | Q_PROPERTY(QString initialDesktopEntry READ initialDesktopEntry WRITE setInitialDesktopEntry NOTIFY initialDesktopEntryChanged) | 59 | Q_PROPERTY(QString initialDesktopEntry READ initialDesktopEntry WRITE setInitialDesktopEntry NOTIFY initialDesktopEntryChanged) | ||
52 | Q_PROPERTY(QString initialNotifyRcName READ initialNotifyRcName WRITE setInitialNotifyRcName NOTIFY initialNotifyRcNameChanged) | 60 | Q_PROPERTY(QString initialNotifyRcName READ initialNotifyRcName WRITE setInitialNotifyRcName NOTIFY initialNotifyRcNameChanged) | ||
53 | Q_PROPERTY(QString initialEventId READ initialEventId WRITE setInitialEventId NOTIFY initialEventIdChanged) | 61 | Q_PROPERTY(QString initialEventId READ initialEventId WRITE setInitialEventId NOTIFY initialEventIdChanged) | ||
54 | 62 | | |||
55 | public: | 63 | public: | ||
56 | KCMNotifications(QObject *parent, const QVariantList &args); | 64 | KCMNotifications(QObject *parent, const QVariantList &args); | ||
57 | ~KCMNotifications() override; | 65 | ~KCMNotifications() override; | ||
58 | 66 | | |||
59 | SourcesModel *sourcesModel() const; | 67 | SourcesModel *sourcesModel() const; | ||
60 | FilterProxyModel *filteredModel() const; | 68 | FilterProxyModel *filteredModel() const; | ||
61 | 69 | | |||
62 | NotificationManager::Settings *settings() const; | 70 | NotificationManager::Settings *settings() const; | ||
71 | NotificationManager::DoNotDisturbSettings *dndSettings() const; | ||||
72 | NotificationManager::NotificationSettings *notificationSettings() const; | ||||
73 | NotificationManager::JobSettings *jobSettings() const; | ||||
74 | NotificationManager::BadgeSettings *badgeSettings() const; | ||||
63 | 75 | | |||
64 | QKeySequence toggleDoNotDisturbShortcut() const; | 76 | QKeySequence toggleDoNotDisturbShortcut() const; | ||
65 | void setToggleDoNotDisturbShortcut(const QKeySequence &shortcut); | 77 | void setToggleDoNotDisturbShortcut(const QKeySequence &shortcut); | ||
66 | Q_SIGNAL void toggleDoNotDisturbShortcutChanged(); | 78 | Q_SIGNAL void toggleDoNotDisturbShortcutChanged(); | ||
67 | 79 | | |||
68 | QString initialDesktopEntry() const; | 80 | QString initialDesktopEntry() const; | ||
69 | void setInitialDesktopEntry(const QString &desktopEntry); | 81 | void setInitialDesktopEntry(const QString &desktopEntry); | ||
70 | 82 | | |||
Show All 17 Lines | |||||
88 | 100 | | |||
89 | private: | 101 | private: | ||
90 | void processPendingDeletions(); | 102 | void processPendingDeletions(); | ||
91 | 103 | | |||
92 | SourcesModel *m_sourcesModel; | 104 | SourcesModel *m_sourcesModel; | ||
93 | FilterProxyModel *m_filteredModel; | 105 | FilterProxyModel *m_filteredModel; | ||
94 | 106 | | |||
95 | NotificationManager::Settings *m_settings; | 107 | NotificationManager::Settings *m_settings; | ||
108 | NotificationManager::DoNotDisturbSettings *m_dndSettings; | ||||
109 | NotificationManager::NotificationSettings *m_notificationSettings; | ||||
110 | NotificationManager::JobSettings *m_jobSettings; | ||||
111 | NotificationManager::BadgeSettings *m_badgeSettings; | ||||
96 | 112 | | |||
97 | QAction *m_toggleDoNotDisturbAction; | 113 | QAction *m_toggleDoNotDisturbAction; | ||
98 | QKeySequence m_toggleDoNotDisturbShortcut; | 114 | QKeySequence m_toggleDoNotDisturbShortcut; | ||
99 | bool m_toggleDoNotDisturbShortcutDirty = false; | 115 | bool m_toggleDoNotDisturbShortcutDirty = false; | ||
100 | 116 | | |||
101 | QString m_initialDesktopEntry; | 117 | QString m_initialDesktopEntry; | ||
102 | QString m_initialNotifyRcName; | 118 | QString m_initialNotifyRcName; | ||
103 | QString m_initialEventId; | 119 | QString m_initialEventId; | ||
104 | 120 | | |||
105 | }; | 121 | }; |