Bug 440846

Summary: Global settings inappropriately live in the applet
Product: [Plasma] plasma-pa Reporter: Nate Graham <nate>
Component: appletAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: kde, olib141, plasma-bugs
Priority: HI Keywords: usability
Version: 5.21.90   
Target Milestone: ---   
Platform: Other   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=418713
Latest Commit: Version Fixed In: 5.27
Sentry Crash Report:
Bug Depends on:    
Bug Blocks: 439992, 443356, 458977    

Description Nate Graham 2021-08-10 19:38:04 UTC
This is confusing for two reasons:
1. Since they are not applet-specific, the logical place for the user to try to find them is in the KCM, but they're not there.
2. If you have multiple plasma-pa applets (e.g. with a multi-monitor setup where each monitor has a panel with a system tray on it), their settings compete and it's not clear which applet wins.

We should move the settings to the KCM, like the Notifications applet does. It uses kconfig to store the settings data in an rc file rather than the applet config, and implements a global singleton to make this settings data available to all the Notifications applets and let them read the same settings together. To handle the use case of there not being any notifications applets present, the KCM displays an error message and disables the settings that affect the applet when opened with no applets present.

The plasma-pa applet could benefit from doing the same.
Comment 1 Nate Graham 2022-06-03 18:37:40 UTC
*** Bug 454789 has been marked as a duplicate of this bug. ***
Comment 2 Oliver Beard 2022-08-18 18:40:03 UTC
(In reply to Nate Graham from comment #0)
> We should move the settings to the KCM, like the Notifications applet does.
> It uses kconfig to store the settings data in an rc file rather than the
> applet config, and implements a global singleton to make this settings data
> available to all the Notifications applets and let them read the same
> settings together. To handle the use case of there not being any
> notifications applets present, the KCM displays an error message and
> disables the settings that affect the applet when opened with no applets
> present.

I suspect I might end up doing a lot of this work to implement a global 'Raise maximum volume' switch between KCM and applet. If I do - how might the applet settings living inside the KCM look? My first thought would be to add a section to the lower 1/3 of the page with these settings, but it would probably take too much height from the list view, or hide the presence of the playback streams' volume.

I think how it might have to work is to have two pages under the Audio category, one 'Volume and Devices' (as the default) and another 'Audio Settings', though the latter name is particularly poor.
Comment 3 Nate Graham 2022-08-18 20:39:29 UTC
Proposal:
- On the main page, we add a footer beneath the main view that holds the applet's "Volume Step" and "Raise Maximum Volume" settings. These are just two things so they shouldn't take up an excessive amount of space, hopefully.
- We group the applet's feedback/OSD-related settings in another page or an OverlaySheet that's shown by clicking on a button in the footer area that could be labeled "Change feedback settings" or something.
- The applet's "Show virtual devices" setting stays in the applet but migrates into its hamburger menu, taking the place of "Configure Audio Devices", and then we can delete the applet-specific settings window entirely.
- Optional: instead of deleting the "Raise Maximum Volume" setting from the applet and only having it live in the KCM, we move it to the hamburger menu as well, but keep it in sync with the global setting. Basically it just becomes a quick-access toggle for that global setting.
Comment 4 Bug Janitor Service 2022-10-26 08:47:08 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-pa/-/merge_requests/145
Comment 5 Nate Graham 2022-11-02 16:03:48 UTC
Git commit 586fb5c315d12a02f2a3e2a524a5b6bf39ba2b52 by Nate Graham, on behalf of Bharadwaj Raju.
Committed on 02/11/2022 at 16:03.
Pushed by ngraham into branch 'master'.

Move applet settings into KCM

Makes various applet-instance-specific settings global, and now configured via
the KCM.
FIXED-IN: 5.27

Fixes https://invent.kde.org/teams/usability/issue-board/-/issues/11

D  +0    -16   applet/contents/config/config.qml
M  +3    -0    applet/contents/config/main.xml
D  +0    -97   applet/contents/ui/ConfigGeneral.qml
M  +54   -14   applet/contents/ui/main.qml
M  +5    -0    src/CMakeLists.txt
A  +104  -0    src/kcm/package/contents/ui/VolumeControlsConfig.qml     [License: GPL(v3.0+)]
M  +6    -0    src/kcm/package/contents/ui/main.qml
A  +42   -0    src/qml/globalconfig.kcfg
A  +10   -0    src/qml/globalconfig.kcfgc
A  +36   -0    src/qml/globalconfigskeleton.h     [License: GPL(v3.0+)]
M  +2    -0    src/qml/plugin.cpp

https://invent.kde.org/plasma/plasma-pa/commit/586fb5c315d12a02f2a3e2a524a5b6bf39ba2b52