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

Bug #630221 reported by ruhe
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Exaile
Fix Released
Low
Mathias Brodala
exaile (Ubuntu)
Fix Released
Low
Andrew Starr-Bochicchio

Bug Description

Binary package hint: exaile

Ubuntu maverick (development branch) Release: 10.10

exaile:
  Installed: 0.3.2.0-0ubuntu2
  Candidate: 0.3.2.0-0ubuntu2
  Version table:
 *** 0.3.2.0-0ubuntu2 0
        500 http://archive.ubuntu.com/ubuntu/ maverick/universe amd64 Packages
        100 /var/lib/dpkg/status

Expected:
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'.

Revision history for this message
ruhe (ruhe) wrote :

I've tracked down cause of the problem:
There is a couple of bugs in tray.py 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:
  self.playpause_menuitem.set_label(stock_id)

Here is diff for tray.py:

149c149,152
< 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
151,156c154
< 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)
211a210
>

Changed in exaile:
status: New → Confirmed
importance: Undecided → Low
milestone: none → 0.3.2.1
Revision history for this message
Denis Fuenzalida (denis-fuenzalida) wrote :

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

Revision history for this message
Steve Dodier-Lazaro (sidi) wrote :

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

Changed in exaile:
assignee: nobody → Aren Olson (reacocard)
Revision history for this message
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)
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)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package exaile - 0.3.2.1-0buntu1

---------------
exaile (0.3.2.1-0buntu1) 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  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.