[taskmanager applet] Fix MPRIS buttons in tooltip for CanPause==false

Authored by kossebau on Mar 4 2018, 5:30 PM.



Currently the media controller in the tooltup only works with MPRIS services
which support the PlayPause command. By the MPRIS spec this is an optional
feature though.
While most players out there support this, the MPRIS support in Gwenview
currently worked on does not (would need some more rewrite of internals).
Which makes the media controller in the tooltip and/or Gwenview look broken :)

To keep the current design with a central Play/Not Play button, this patch
changes its behaviour depending on the CanPause flag:
CanPause=true -> show either Play or Pause
CanPause=false -> show Play enabled/disabled

Diff Detail

R119 Plasma Desktop
No Linters Available
No Unit Test Coverage
kossebau created this revision.Mar 4 2018, 5:30 PM
Restricted Application added a project: Plasma. · View Herald TranscriptMar 4 2018, 5:30 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
kossebau requested review of this revision.Mar 4 2018, 5:30 PM
kossebau updated this revision to Diff 28616.Mar 4 2018, 5:52 PM
  • also disable play/pause icon, not just mousearea
  • add needed method in main.qml (addition shared with D11007)
broulik added a reviewer: hein.Mar 5 2018, 8:30 AM
broulik added inline comments.

Same as with media controller, please do not mix playPause with manual play+pause, it makes the code convoluted and hard to follow, just manually do it then.

kossebau updated this revision to Diff 28716.Mar 5 2018, 1:31 PM

use play() & pause() instead of playpause()

kossebau updated this revision to Diff 28778.Mar 6 2018, 3:09 AM
kossebau marked an inline comment as done.

don't use Stop for middle button, simply disable if CanPause==false

broulik accepted this revision.Mar 6 2018, 8:44 AM
This revision is now accepted and ready to land.Mar 6 2018, 8:44 AM
kossebau edited the summary of this revision. (Show Details)Mar 6 2018, 9:26 AM
kossebau edited the test plan for this revision. (Show Details)
This revision was automatically updated to reflect the committed changes.