Commit 3d2acdd5 authored by Nate Graham's avatar Nate Graham
Browse files

Revert "[applets/notifications] Move "Clear History" action out of burger menu"

This reverts commit 58935741.

The approach taken in this commit was sub-optimal and not consistent
with what we do for other applets, so it needs to be re-thought.
parent 9eafbd28
......@@ -173,18 +173,15 @@ PlasmaComponents3.Page {
}
PlasmaComponents3.ToolButton {
// TODO: Conditionalize visiblity again once support is added
// in plasma-framework for showing more than one action on the
// header so the clear button isn't always in the hamburger menu
visible: !(plasmoid.containmentDisplayHints & PlasmaCore.Types.ContainmentDrawsPlasmoidHeading)
text: i18nc("Clear all notifications", "Clear All")
Accessible.name: plasmoid.action("clearHistory").text
icon.name: "edit-clear-history"
enabled: historyModel.expiredNotificationsCount > 0
onClicked: {
historyModel.clear(NotificationManager.Notifications.ClearExpired);
if (historyModel.count === 0) {
root.closePassivePlasmoid();
}
enabled: plasmoid.action("clearHistory").visible
onClicked: action_clearHistory()
PlasmaComponents3.ToolTip {
text: parent.Accessible.name
}
}
}
......
......@@ -158,6 +158,13 @@ Item {
}
}
function action_clearHistory() {
historyModel.clear(NotificationManager.Notifications.ClearExpired);
if (historyModel.count === 0) {
closePassivePlasmoid();
}
}
function action_openKcm() {
KQCAddons.KCMShell.openSystemSettings("kcm_notifications");
}
......@@ -165,6 +172,11 @@ Item {
Component.onCompleted: {
Globals.adopt(plasmoid);
plasmoid.setAction("clearHistory", i18n("Clear History"), "edit-clear-history");
var clearAction = plasmoid.action("clearHistory");
clearAction.visible = Qt.binding(function() {
return historyModel.expiredNotificationsCount > 0;
});
// FIXME only while Multi-page KCMs are broken when embedded in plasmoid config
plasmoid.setAction("openKcm", i18n("&Configure Event Notifications and Actions..."), "notifications");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment