Skip to content

applets/systemtray: prompt user only when entries actually changed

Christoph Wolk requested to merge cwo/plasma-workspace:systray_unsaved2 into master

Reason for the change

  • applets/systemtray: prompt user only when entries actually changed

The Entries config page currently always prompts the user if anything was changed, even if the original state was manually restored – but only for entry visibility, not for shortcuts, which are always applied immediately despite the explicit Apply button in the dialog.

This change makes the page consistently and only prompt the user if the current state was changed. This is somewhat more involved compared to usual applet config pages, due to the complex representation of state and the fact that the underlying model can change while the dialog is open and modified (by adding/removing open apps with SNIs), and we should handle this in a reasonable way. To do this, we keep separate lists of proposed changes, then apply them when saving. This also allows us to handle InlineMessages for particular states in a more declarative way.

Test plan

  1. Open System tray config -> Entries
  2. Change visibility / shortcuts
  3. Undo changes manually
  4. (without) apply enabled (with) apply disabled

Also worth testing: 1-2, add a SNI (e.g. enabling it in Neochat), remove it again, test both apply and manual undo still work correctly.

Screenshots or screen recordings

N/A

Bugs fixed

N/A


Supersedes !5390 (closed)

Merge request reports

Loading