Commit d9e8b4a7 authored by Nate Graham's avatar Nate Graham 🔩

[applets/devicenotifier] Re-add "show popup when new device is plugged in" option

This was removed in
!185,
however the original reasons for making the change no longer apply
because we now have a clean place to put the option--in the new popup
menu in the header. So let's re-add it, because hidden options are bad.
:)

BUG: 430017
FIXED-IN: 5.20
parent d946e324
......@@ -18,7 +18,6 @@
<label>If true it lists all kind of devices. Only one between removableDevices, nonRemovableDevices and allDevices should be set.</label>
<default>false</default>
</entry>
<!-- This option has no visible UI and is only accessible by adding "popupOnNewDevice=false" to the plasma-org.kde.plasma.desktop-appletsrc file-->
<entry name="popupOnNewDevice" type="Bool">
<label>If true it tries to open the plasmoid when a new device is inserted, as a kind of notification.</label>
<default>true</default>
......
......@@ -228,6 +228,7 @@ Item {
property var showRemovableDevicesAction
property var showNonRemovableDevicesAction
property var showAllDevicesAction
property var openAutomaticallyAction
Component.onCompleted: {
if (sdSource.connectedSources.count === 0) {
......@@ -254,6 +255,13 @@ Item {
plasmoid.setActionSeparator("sep");
plasmoid.setAction("openAutomatically", i18n("Show popup when new device is plugged in"));
devicenotifier.openAutomaticallyAction = plasmoid.action("openAutomatically");
devicenotifier.openAutomaticallyAction.checkable = true;
devicenotifier.openAutomaticallyAction.checked = Qt.binding(() => {return plasmoid.configuration.popupOnNewDevice;});
plasmoid.setActionSeparator("sep2");
if (devicenotifier.openAutomounterKcmAuthorized) {
plasmoid.setAction("openAutomounterKcm", i18nc("Open auto mounter kcm", "Configure Removable Devices..."), "configure")
}
......@@ -281,6 +289,10 @@ Item {
plasmoid.configuration.allDevices = true;
}
function action_openAutomatically() {
plasmoid.configuration.popupOnNewDevice = !plasmoid.configuration.popupOnNewDevice;
}
Plasmoid.onExpandedChanged: {
popupEventSlot(plasmoid.expanded);
}
......
Markdown is supported
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