Changeset View
Changeset View
Standalone View
Standalone View
applets/notifications/package/contents/ui/FullRepresentation.qml
Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Line(s) | 89 | if (!Globals.inhibited) { | |||
---|---|---|---|---|---|
93 | dndMenu.open(0, 0); | 93 | dndMenu.open(0, 0); | ||
94 | } | 94 | } | ||
95 | } | 95 | } | ||
96 | // but disable only on click | 96 | // but disable only on click | ||
97 | onClicked: { | 97 | onClicked: { | ||
98 | if (Globals.inhibited) { | 98 | if (Globals.inhibited) { | ||
99 | notificationSettings.notificationsInhibitedUntil = undefined; | 99 | notificationSettings.notificationsInhibitedUntil = undefined; | ||
100 | notificationSettings.revokeApplicationInhibitions(); | 100 | notificationSettings.revokeApplicationInhibitions(); | ||
101 | // overrules current mirrored screen setup, updates again when screen configuration changes | ||||
102 | notificationSettings.screensMirrored = false; | ||||
101 | 103 | | |||
102 | notificationSettings.save(); | 104 | notificationSettings.save(); | ||
103 | } | 105 | } | ||
104 | } | 106 | } | ||
105 | 107 | | |||
106 | contentItem: RowLayout { | 108 | contentItem: RowLayout { | ||
107 | spacing: dndCheck.spacing | 109 | spacing: dndCheck.spacing | ||
108 | 110 | | |||
▲ Show 20 Lines • Show All 108 Lines • ▼ Show 20 Line(s) | 214 | PlasmaExtras.DescriptiveLabel { | |||
217 | textFormat: Text.PlainText | 219 | textFormat: Text.PlainText | ||
218 | text: { | 220 | text: { | ||
219 | if (!Globals.inhibited) { | 221 | if (!Globals.inhibited) { | ||
220 | return ""; | 222 | return ""; | ||
221 | } | 223 | } | ||
222 | 224 | | |||
223 | var inhibitedUntil = notificationSettings.notificationsInhibitedUntil; | 225 | var inhibitedUntil = notificationSettings.notificationsInhibitedUntil; | ||
224 | var inhibitedByApp = notificationSettings.notificationsInhibitedByApplication; | 226 | var inhibitedByApp = notificationSettings.notificationsInhibitedByApplication; | ||
227 | var inhibitedByMirroredScreens = notificationSettings.inhibitNotificationsWhenScreensMirrored | ||||
228 | && notificationSettings.screensMirrored; | ||||
225 | 229 | | |||
226 | var sections = []; | 230 | var sections = []; | ||
227 | 231 | | |||
228 | // Show until time if valid but not if too far int he future | 232 | // Show until time if valid but not if too far int he future | ||
229 | if (!isNaN(inhibitedUntil.getTime()) && inhibitedUntil.getTime() - new Date().getTime() < 365 * 24 * 60 * 60 * 1000 /* 1 year*/) { | 233 | if (!isNaN(inhibitedUntil.getTime()) && inhibitedUntil.getTime() - new Date().getTime() < 365 * 24 * 60 * 60 * 1000 /* 1 year*/) { | ||
230 | sections.push(i18nc("Do not disturb until date", "Until %1", | 234 | sections.push(i18nc("Do not disturb until date", "Until %1", | ||
231 | KCoreAddons.Format.formatRelativeDateTime(inhibitedUntil, Locale.ShortFormat))); | 235 | KCoreAddons.Format.formatRelativeDateTime(inhibitedUntil, Locale.ShortFormat))); | ||
232 | } | 236 | } | ||
Show All 9 Lines | 242 | for (var i = 0, length = inhibitionAppNames.length; i < length; ++i) { | |||
242 | if (reason) { | 246 | if (reason) { | ||
243 | sections.push(i18nc("Do not disturb until app has finished (reason)", "While %1 is active (%2)", name, reason)); | 247 | sections.push(i18nc("Do not disturb until app has finished (reason)", "While %1 is active (%2)", name, reason)); | ||
244 | } else { | 248 | } else { | ||
245 | sections.push(i18nc("Do not disturb until app has finished", "While %1 is active", name)); | 249 | sections.push(i18nc("Do not disturb until app has finished", "While %1 is active", name)); | ||
246 | } | 250 | } | ||
247 | } | 251 | } | ||
248 | } | 252 | } | ||
249 | 253 | | |||
254 | if (inhibitedByMirroredScreens) { | ||||
255 | sections.push(i18nc("Do not disturb because external mirrored screens connected", "Screens are mirrored")) | ||||
256 | } | ||||
257 | | ||||
250 | return sections.join(" · "); | 258 | return sections.join(" · "); | ||
251 | } | 259 | } | ||
252 | visible: text !== "" | 260 | visible: text !== "" | ||
253 | } | 261 | } | ||
254 | } | 262 | } | ||
255 | 263 | | |||
256 | PlasmaCore.SvgItem { | 264 | PlasmaCore.SvgItem { | ||
257 | elementId: "horizontal-line" | 265 | elementId: "horizontal-line" | ||
▲ Show 20 Lines • Show All 304 Lines • Show Last 20 Lines |