Tray 'Play/Pause' item doesn't reflect current state

Bug #630221 reported by Ruslan Kamaldinov on 2010-09-04
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Fix Released
Mathias Brodala
exaile (Ubuntu)
Andrew Starr-Bochicchio

Bug Description

Binary package hint: exaile

Ubuntu maverick (development branch) Release: 10.10

  Version table:
 *** 0
        500 maverick/universe amd64 Packages
        100 /var/lib/dpkg/status

1. Player is currently playing a track, right-click tray icon. 'Play/Pause' item's label should be 'Pause'.
2. Player is currently paused or stopped, right-click tray icon. 'Play/Pause' item's label should be 'Play'.

Current behavior:
'Play/Pause' item's label is always 'Play'.

Ruslan Kamaldinov (ruhe) wrote :

I've tracked down cause of the problem:
There is a couple of bugs in update_menu()
1. There is a wrong if statement:
if self.player.is_stopped() or self.player.is_playing():
            stock_id = gtk.STOCK_MEDIA_PLAY
        elif self.player.is_paused():
            stock_id = gtk.STOCK_MEDIA_PAUSE
2. I'm not familiar with pygtk, but it seems that item's label should be updated another way:
Instead of:
  playpause_image = self.playpause_menuitem.get_image()
  playpause_image.set_from_stock(stock_id, gtk.ICON_SIZE_MENU)
should use:

Here is diff for

< playpause_image = self.playpause_menuitem.get_image()
> if self.player.is_playing():
> stock_id = gtk.STOCK_MEDIA_PAUSE
> elif self.player.is_paused() or self.player.is_stopped():
> stock_id = gtk.STOCK_MEDIA_PLAY
< if self.player.is_stopped() or self.player.is_playing():
< stock_id = gtk.STOCK_MEDIA_PLAY
< elif self.player.is_paused():
< stock_id = gtk.STOCK_MEDIA_PAUSE
< playpause_image.set_from_stock(stock_id, gtk.ICON_SIZE_MENU)
> self.playpause_menuitem.set_label(stock_id)

Changed in exaile:
status: New → Confirmed
importance: Undecided → Low
milestone: none →

I confirm that the change suggested by Ruhe fixes this issue.

Steve Dodier-Lazaro (sidi) wrote :

Aren, if you could please review and apply the patch.

Changed in exaile:
assignee: nobody → Aren Olson (reacocard)
Mathias Brodala (mathbr) wrote :

Fixed with r3450 inspired by the implementation in trunk.

Changed in exaile:
assignee: Aren Olson (reacocard) → Mathias Brodala (mathbr)
status: Confirmed → Fix Committed
reacocard (reacocard) on 2011-02-13
Changed in exaile:
status: Fix Committed → Fix Released
Changed in exaile (Ubuntu):
status: New → In Progress
importance: Undecided → Low
assignee: nobody → Andrew Starr-Bochicchio (andrewsomething)
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package exaile -

exaile ( natty; urgency=low

  * New upstream release (LP: #714484, LP: #630221).
  * Drop debian/patches/jamendo_plugin_fix.diff,
    fixed upstream.
  * debian/patches/10_ubuntu_defaults.diff:
   - Don't enable shoutcast plugin.
  * debian/exaile.install: Don't install shoutcast plugin.
 -- Andrew Starr-Bochicchio <email address hidden> Sun, 13 Feb 2011 12:33:27 -0500

Changed in exaile (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers