diff --git a/applets/notifications/package/contents/ui/Notifications.qml b/applets/notifications/package/contents/ui/Notifications.qml --- a/applets/notifications/package/contents/ui/Notifications.qml +++ b/applets/notifications/package/contents/ui/Notifications.qml @@ -120,6 +120,16 @@ service.startOperationCall(op) } + function clearNotifications() { + for (var i = 0, length = notificationsSource.sources.length; i < length; ++i) { + var source = notificationsSource.sources[i]; + closeNotification(source) + notificationPositioner.closePopup(source); + } + + notificationsModel.clear() + } + Component { id: notificationPopupComponent NotificationPopup { } diff --git a/applets/notifications/package/contents/ui/main.qml b/applets/notifications/package/contents/ui/main.qml --- a/applets/notifications/package/contents/ui/main.qml +++ b/applets/notifications/package/contents/ui/main.qml @@ -172,11 +172,21 @@ ] } + function action_clearNotifications() { + notifications.clearNotifications() + } + function action_notificationskcm() { ProcessRunner.runNotificationsKCM() } Component.onCompleted: { + plasmoid.setAction("clearNotifications", i18n("Clear Notifications"), "edit-clear") + var clearAction = plasmoid.action("clearNotifications"); + clearAction.visible = Qt.binding(function() { + return notificationsApplet.notifications && notificationsApplet.notifications.count > 0 + }) + //var allApplications = new Object plasmoid.setAction("notificationskcm", i18n("&Configure Event Notifications and Actions..."), "preferences-desktop-notification") }