Ubuntu

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

Reported by Ruslan Kamaldinov on 2010-09-04
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Exaile
Low
Mathias Brodala
exaile (Ubuntu)
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'.

Ruslan Kamaldinov (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

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
Aren Olson (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 - 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  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers