Changeset View
Changeset View
Standalone View
Standalone View
kcms/notifications/package/contents/ui/main.qml
Show All 24 Lines | |||||
25 | import org.kde.kquickcontrols 2.0 as KQuickControls | 25 | import org.kde.kquickcontrols 2.0 as KQuickControls | ||
26 | import org.kde.kcm 1.2 as KCM | 26 | import org.kde.kcm 1.2 as KCM | ||
27 | 27 | | |||
28 | import org.kde.notificationmanager 1.0 as NotificationManager | 28 | import org.kde.notificationmanager 1.0 as NotificationManager | ||
29 | 29 | | |||
30 | KCM.SimpleKCM { | 30 | KCM.SimpleKCM { | ||
31 | id: root | 31 | id: root | ||
32 | KCM.ConfigModule.quickHelp: i18n("This module lets you manage application and system notifications.") | 32 | KCM.ConfigModule.quickHelp: i18n("This module lets you manage application and system notifications.") | ||
33 | KCM.ConfigModule.buttons: KCM.ConfigModule.Help | KCM.ConfigModule.Apply | 33 | | ||
34 | // Sidebar on SourcesPage is 1/3 of the width at a minimum of 12, so assume 3 * 12 = 36 as preferred | 34 | // Sidebar on SourcesPage is 1/3 of the width at a minimum of 12, so assume 3 * 12 = 36 as preferred | ||
35 | implicitWidth: Kirigami.Units.gridUnit * 36 | 35 | implicitWidth: Kirigami.Units.gridUnit * 36 | ||
36 | 36 | | |||
37 | readonly property string ourServerVendor: "KDE" | 37 | readonly property string ourServerVendor: "KDE" | ||
38 | readonly property string ourServerName: "Plasma" | 38 | readonly property string ourServerName: "Plasma" | ||
39 | 39 | | |||
40 | readonly property NotificationManager.ServerInfo currentOwnerInfo: NotificationManager.Server.currentOwner | 40 | readonly property NotificationManager.ServerInfo currentOwnerInfo: NotificationManager.Server.currentOwner | ||
41 | 41 | | |||
Show All 36 Lines | 66 | Kirigami.InlineMessage { | |||
78 | } | 78 | } | ||
79 | visible: root.currentOwnerInfo.status === NotificationManager.ServerInfo.Running | 79 | visible: root.currentOwnerInfo.status === NotificationManager.ServerInfo.Running | ||
80 | && (currentOwnerInfo.vendor !== root.ourServerVendor || currentOwnerInfo.name !== root.ourServerName) | 80 | && (currentOwnerInfo.vendor !== root.ourServerVendor || currentOwnerInfo.name !== root.ourServerName) | ||
81 | } | 81 | } | ||
82 | 82 | | |||
83 | QtControls.CheckBox { | 83 | QtControls.CheckBox { | ||
84 | Kirigami.FormData.label: i18n("Do Not Disturb mode:") | 84 | Kirigami.FormData.label: i18n("Do Not Disturb mode:") | ||
85 | text: i18nc("Do not disturb when screens are mirrored", "Enable when screens are mirrored") | 85 | text: i18nc("Do not disturb when screens are mirrored", "Enable when screens are mirrored") | ||
86 | checked: kcm.settings.inhibitNotificationsWhenScreensMirrored | 86 | checked: kcm.dndSettings.whenScreensMirrored | ||
87 | onClicked: kcm.settings.inhibitNotificationsWhenScreensMirrored = checked | 87 | onClicked: kcm.dndSettings.whenScreensMirrored = checked | ||
88 | enabled: root.notificationsAvailable | 88 | enabled: root.notificationsAvailable && !kcm.dndSettings.isImmutable("WhenScreensMirrored") | ||
89 | } | 89 | } | ||
90 | 90 | | |||
91 | QtControls.CheckBox { | 91 | QtControls.CheckBox { | ||
92 | text: i18n("Show critical notifications") | 92 | text: i18n("Show critical notifications") | ||
93 | checked: kcm.settings.criticalPopupsInDoNotDisturbMode | 93 | checked: kcm.notificationSettings.criticalInDndMode | ||
94 | onClicked: kcm.settings.criticalPopupsInDoNotDisturbMode = checked | 94 | onClicked: kcm.notificationSettings.criticalInDndMode = checked | ||
95 | enabled: root.notificationsAvailable | 95 | enabled: root.notificationsAvailable && !kcm.notificationSettings.isImmutable("CriticalInDndMode") | ||
96 | } | 96 | } | ||
97 | 97 | | |||
98 | RowLayout { | 98 | RowLayout { | ||
99 | enabled: root.notificationsAvailable | 99 | enabled: root.notificationsAvailable | ||
100 | 100 | | |||
101 | QtControls.Label { | 101 | QtControls.Label { | ||
102 | text: i18nc("Turn do not disturb mode on/off with keyboard shortcut", "Toggle with:") | 102 | text: i18nc("Turn do not disturb mode on/off with keyboard shortcut", "Toggle with:") | ||
103 | } | 103 | } | ||
104 | 104 | | |||
105 | KQuickControls.KeySequenceItem { | 105 | KQuickControls.KeySequenceItem { | ||
106 | keySequence: kcm.toggleDoNotDisturbShortcut | 106 | keySequence: kcm.toggleDoNotDisturbShortcut | ||
107 | onKeySequenceChanged: kcm.toggleDoNotDisturbShortcut = keySequence | 107 | onKeySequenceChanged: kcm.toggleDoNotDisturbShortcut = keySequence | ||
108 | } | 108 | } | ||
109 | } | 109 | } | ||
110 | 110 | | |||
111 | Kirigami.Separator { | 111 | Kirigami.Separator { | ||
112 | Kirigami.FormData.isSection: true | 112 | Kirigami.FormData.isSection: true | ||
113 | } | 113 | } | ||
114 | 114 | | |||
115 | QtControls.CheckBox { | 115 | QtControls.CheckBox { | ||
116 | Kirigami.FormData.label: i18n("Critical notifications:") | 116 | Kirigami.FormData.label: i18n("Critical notifications:") | ||
117 | text: i18n("Always keep on top") | 117 | text: i18n("Always keep on top") | ||
118 | checked: kcm.settings.keepCriticalAlwaysOnTop | 118 | checked: kcm.notificationSettings.criticalAlwaysOnTop | ||
119 | onClicked: kcm.settings.keepCriticalAlwaysOnTop = checked | 119 | onClicked: kcm.notificationSettings.criticalAlwaysOnTop = checked | ||
120 | enabled: root.notificationsAvailable | 120 | enabled: root.notificationsAvailable && !kcm.notificationSettings.isImmutable("CriticalAlwaysOnTop") | ||
121 | } | 121 | } | ||
122 | 122 | | |||
123 | Item { | 123 | Item { | ||
124 | Kirigami.FormData.isSection: true | 124 | Kirigami.FormData.isSection: true | ||
125 | } | 125 | } | ||
126 | 126 | | |||
127 | QtControls.CheckBox { | 127 | QtControls.CheckBox { | ||
128 | Kirigami.FormData.label: i18n("Low priority notifications:") | 128 | Kirigami.FormData.label: i18n("Low priority notifications:") | ||
129 | text: i18n("Show popup") | 129 | text: i18n("Show popup") | ||
130 | checked: kcm.settings.lowPriorityPopups | 130 | checked: kcm.notificationSettings.lowPriorityPopups | ||
131 | onClicked: kcm.settings.lowPriorityPopups = checked | 131 | onClicked: kcm.notificationSettings.lowPriorityPopups = checked | ||
132 | enabled: root.notificationsAvailable | 132 | enabled: root.notificationsAvailable && !kcm.notificationSettings.isImmutable("LowPriorityPopups") | ||
133 | } | 133 | } | ||
134 | 134 | | |||
135 | QtControls.CheckBox { | 135 | QtControls.CheckBox { | ||
136 | text: i18n("Show in history") | 136 | text: i18n("Show in history") | ||
137 | checked: kcm.settings.lowPriorityHistory | 137 | checked: kcm.notificationSettings.lowPriorityHistory | ||
138 | onClicked: kcm.settings.lowPriorityHistory = checked | 138 | onClicked: kcm.notificationSettings.lowPriorityHistory = checked | ||
139 | enabled: root.notificationsAvailable | 139 | enabled: root.notificationsAvailable && !kcm.notificationSettings.isImmutable("LowPriorityHistory") | ||
140 | } | 140 | } | ||
141 | 141 | | |||
142 | QtControls.ButtonGroup { | 142 | QtControls.ButtonGroup { | ||
143 | id: positionGroup | 143 | id: positionGroup | ||
144 | buttons: [positionCloseToWidget, positionCustomPosition] | 144 | buttons: [positionCloseToWidget, positionCustomPosition] | ||
145 | } | 145 | } | ||
146 | 146 | | |||
147 | Kirigami.Separator { | 147 | Kirigami.Separator { | ||
148 | Kirigami.FormData.isSection: true | 148 | Kirigami.FormData.isSection: true | ||
149 | } | 149 | } | ||
150 | 150 | | |||
151 | QtControls.RadioButton { | 151 | QtControls.RadioButton { | ||
152 | id: positionCloseToWidget | 152 | id: positionCloseToWidget | ||
153 | Kirigami.FormData.label: i18n("Popup:") | 153 | Kirigami.FormData.label: i18n("Popup:") | ||
154 | text: i18nc("Popup position near notification plasmoid", "Show near notification icon") // "widget" | 154 | text: i18nc("Popup position near notification plasmoid", "Show near notification icon") // "widget" | ||
155 | checked: kcm.settings.popupPosition === NotificationManager.Settings.CloseToWidget | 155 | checked: kcm.notificationSettings.popupPosition === NotificationManager.Settings.CloseToWidget | ||
156 | // Force binding re-evaluation when user returns from position selector | 156 | // Force binding re-evaluation when user returns from position selector | ||
157 | + kcm.currentIndex * 0 | 157 | + kcm.currentIndex * 0 | ||
158 | onClicked: kcm.settings.popupPosition = NotificationManager.Settings.CloseToWidget | 158 | onClicked: kcm.notificationSettings.popupPosition = NotificationManager.Settings.CloseToWidget | ||
159 | enabled: root.notificationsAvailable | 159 | enabled: root.notificationsAvailable && !kcm.notificationSettings.isImmutable("PopupPosition") | ||
160 | } | 160 | } | ||
161 | 161 | | |||
162 | RowLayout { | 162 | RowLayout { | ||
163 | spacing: 0 | 163 | spacing: 0 | ||
164 | enabled: root.notificationsAvailable | 164 | enabled: root.notificationsAvailable && !kcm.notificationSettings.isImmutable("PopupPosition") | ||
165 | 165 | | |||
166 | QtControls.RadioButton { | 166 | QtControls.RadioButton { | ||
167 | id: positionCustomPosition | 167 | id: positionCustomPosition | ||
168 | checked: kcm.settings.popupPosition !== NotificationManager.Settings.CloseToWidget | 168 | checked: kcm.notificationSettings.popupPosition !== NotificationManager.Settings.CloseToWidget | ||
169 | + kcm.currentIndex * 0 | 169 | + kcm.currentIndex * 0 | ||
170 | activeFocusOnTab: false | 170 | activeFocusOnTab: false | ||
171 | 171 | | |||
172 | MouseArea { | 172 | MouseArea { | ||
173 | anchors.fill: parent | 173 | anchors.fill: parent | ||
174 | onClicked: positionCustomButton.clicked() | 174 | onClicked: positionCustomButton.clicked() | ||
175 | } | 175 | } | ||
176 | } | 176 | } | ||
Show All 21 Lines | 195 | RowLayout { | |||
198 | } | 198 | } | ||
199 | 199 | | |||
200 | QtControls.SpinBox { | 200 | QtControls.SpinBox { | ||
201 | id: timeoutSpinner | 201 | id: timeoutSpinner | ||
202 | Layout.preferredWidth: timeoutSpinnerMetrics.width + leftPadding + rightPadding | 202 | Layout.preferredWidth: timeoutSpinnerMetrics.width + leftPadding + rightPadding | ||
203 | from: 1000 // 1 second | 203 | from: 1000 // 1 second | ||
204 | to: 120000 // 2 minutes | 204 | to: 120000 // 2 minutes | ||
205 | stepSize: 1000 | 205 | stepSize: 1000 | ||
206 | value: kcm.settings.popupTimeout | 206 | value: kcm.notificationSettings.popupTimeout | ||
207 | enabled: root.notificationsAvailable | 207 | enabled: root.notificationsAvailable && !kcm.notificationSettings.isImmutable("PopupTimeout") | ||
208 | editable: true | 208 | editable: true | ||
209 | valueFromText: function(text, locale) { | 209 | valueFromText: function(text, locale) { | ||
210 | return parseInt(text) * 1000; | 210 | return parseInt(text) * 1000; | ||
211 | } | 211 | } | ||
212 | textFromValue: function(value, locale) { | 212 | textFromValue: function(value, locale) { | ||
213 | return i18np("%1 second", "%1 seconds", Math.round(value / 1000)); | 213 | return i18np("%1 second", "%1 seconds", Math.round(value / 1000)); | ||
214 | } | 214 | } | ||
215 | onValueModified: kcm.settings.popupTimeout = value | 215 | onValueModified: kcm.notificationSettings.popupTimeout = value | ||
216 | } | 216 | } | ||
217 | } | 217 | } | ||
218 | 218 | | |||
219 | Kirigami.Separator { | 219 | Kirigami.Separator { | ||
220 | Kirigami.FormData.isSection: true | 220 | Kirigami.FormData.isSection: true | ||
221 | } | 221 | } | ||
222 | 222 | | |||
223 | QtControls.CheckBox { | 223 | QtControls.CheckBox { | ||
224 | Kirigami.FormData.label: i18n("Application progress:") | 224 | Kirigami.FormData.label: i18n("Application progress:") | ||
225 | text: i18n("Show in task manager") | 225 | text: i18n("Show in task manager") | ||
226 | checked: kcm.settings.jobsInTaskManager | 226 | checked: kcm.jobSettings.inTaskManager | ||
227 | onClicked: kcm.settings.jobsInTaskManager = checked | 227 | onClicked: kcm.jobSettings.inTaskManager = checked | ||
228 | enabled: !kcm.jobSettings.isImmutable("InTaskManager") | ||||
228 | } | 229 | } | ||
229 | 230 | | |||
230 | QtControls.CheckBox { | 231 | QtControls.CheckBox { | ||
231 | id: applicationJobsEnabledCheck | 232 | id: applicationJobsEnabledCheck | ||
232 | text: i18nc("Show application jobs in notification widget", "Show in notifications") | 233 | text: i18nc("Show application jobs in notification widget", "Show in notifications") | ||
233 | checked: kcm.settings.jobsInNotifications | 234 | checked: kcm.jobSettings.inNotifications | ||
234 | onClicked: kcm.settings.jobsInNotifications = checked | 235 | onClicked: kcm.jobSettings.inNotifications = checked | ||
236 | enabled: !kcm.jobSettings.isImmutable("InNotifications") | ||||
235 | } | 237 | } | ||
236 | 238 | | |||
237 | RowLayout { // just for indentation | 239 | RowLayout { // just for indentation | ||
238 | QtControls.CheckBox { | 240 | QtControls.CheckBox { | ||
239 | Layout.leftMargin: mirrored ? 0 : indicator.width | 241 | Layout.leftMargin: mirrored ? 0 : indicator.width | ||
240 | Layout.rightMargin: mirrored ? indicator.width : 0 | 242 | Layout.rightMargin: mirrored ? indicator.width : 0 | ||
241 | text: i18nc("Keep application job popup open for entire duration of job", "Keep popup open during progress") | 243 | text: i18nc("Keep application job popup open for entire duration of job", "Keep popup open during progress") | ||
242 | enabled: applicationJobsEnabledCheck.checked | 244 | enabled: applicationJobsEnabledCheck.checked && !kcm.jobSettings.isImmutable("PermanentPopups") | ||
243 | checked: kcm.settings.permanentJobPopups | 245 | checked: kcm.jobSettings.permanentPopups | ||
244 | onClicked: kcm.settings.permanentJobPopups = checked | 246 | onClicked: kcm.jobSettings.permanentPopups = checked | ||
245 | } | 247 | } | ||
246 | } | 248 | } | ||
247 | 249 | | |||
248 | Item { | 250 | Item { | ||
249 | Kirigami.FormData.isSection: true | 251 | Kirigami.FormData.isSection: true | ||
250 | } | 252 | } | ||
251 | 253 | | |||
252 | QtControls.CheckBox { | 254 | QtControls.CheckBox { | ||
253 | Kirigami.FormData.label: i18n("Notification badges:") | 255 | Kirigami.FormData.label: i18n("Notification badges:") | ||
254 | text: i18n("Show in task manager") | 256 | text: i18n("Show in task manager") | ||
255 | checked: kcm.settings.badgesInTaskManager | 257 | checked: kcm.badgeSettings.inTaskManager | ||
256 | onClicked: kcm.settings.badgesInTaskManager = checked | 258 | onClicked: kcm.badgeSettings.inTaskManager = checked | ||
259 | enabled: !kcm.badgeSettings.isImmutable("InTaskManager") | ||||
257 | } | 260 | } | ||
258 | 261 | | |||
259 | Kirigami.Separator { | 262 | Kirigami.Separator { | ||
260 | Kirigami.FormData.isSection: true | 263 | Kirigami.FormData.isSection: true | ||
261 | } | 264 | } | ||
262 | 265 | | |||
263 | QtControls.Button { | 266 | QtControls.Button { | ||
264 | Kirigami.FormData.label: i18n("Applications:") | 267 | Kirigami.FormData.label: i18n("Applications:") | ||
Show All 14 Lines |