diff --git a/applets/devicenotifier/package/contents/ui/DeviceItem.qml b/applets/devicenotifier/package/contents/ui/DeviceItem.qml index f4259a6e1..7aaa011fa 100644 --- a/applets/devicenotifier/package/contents/ui/DeviceItem.qml +++ b/applets/devicenotifier/package/contents/ui/DeviceItem.qml @@ -73,6 +73,15 @@ PlasmaExtras.ExpandableListItem { } } + Connections { + target: plasmoid.action("unmountAllDevices") + function onTriggered() { + if (model["Removable"] && isMounted) { + actionTriggered(); + } + } + } + // this keeps the delegate around for 5 seconds after the device has been // removed in case there was a message, such as "you can now safely remove this" ListView.onRemove: { diff --git a/applets/devicenotifier/package/contents/ui/devicenotifier.qml b/applets/devicenotifier/package/contents/ui/devicenotifier.qml index f4bc400d7..ac7c6cc2b 100644 --- a/applets/devicenotifier/package/contents/ui/devicenotifier.qml +++ b/applets/devicenotifier/package/contents/ui/devicenotifier.qml @@ -235,6 +235,13 @@ Item { Plasmoid.status = PlasmaCore.Types.PassiveStatus; } + plasmoid.setAction("unmountAllDevices", i18n("Remove All"), "media-eject"); + plasmoid.action("unmountAllDevices").visible = Qt.binding(() => { + return devicenotifier.mountedRemovables > 1; + }); + + plasmoid.setActionSeparator("sep0"); + plasmoid.setAction("showRemovableDevices", i18n("Removable Devices"), "drive-removable-media"); devicenotifier.showRemovableDevicesAction = plasmoid.action("showRemovableDevices"); devicenotifier.showRemovableDevicesAction.checkable = true;