Add action to unmount all devices

This patch adds an action to unmount all mounted devices. Also it fixes the issue where an additional header appears if more than one device is mounted.

BUG: 434805
wilder-5.24
Eugene Popov 5 years ago committed by Nate Graham
parent f430123d8d
commit 8a1217fc0e
  1. 9
      applets/devicenotifier/package/contents/ui/DeviceItem.qml
  2. 7
      applets/devicenotifier/package/contents/ui/devicenotifier.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: {

@ -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;

Loading…
Cancel
Save