diff options
author | Anton Khirnov <wyskas@gmail.com> | 2009-04-13 11:14:44 +0200 |
---|---|---|
committer | Anton Khirnov <wyskas@gmail.com> | 2009-04-13 11:14:44 +0200 |
commit | d03647012a5f15773495c53d8573d19fb25fb941 (patch) | |
tree | 292058d2045539b94121b02fa9090acdc9a4f5e9 /nephilim/winMain.py | |
parent | 45647fead64ff7000c9cdc446dc6baa837ebb423 (diff) |
winMain: correctly show current state and song.
Diffstat (limited to 'nephilim/winMain.py')
-rw-r--r-- | nephilim/winMain.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/nephilim/winMain.py b/nephilim/winMain.py index 09b3580..2529d8c 100644 --- a/nephilim/winMain.py +++ b/nephilim/winMain.py @@ -255,9 +255,11 @@ class winMain(QtGui.QMainWindow): def update_state_messages(self): song = self.mpclient.current_song() - if song and self.mpclient.is_playing(): - self.setWindowTitle('%s by %s - %s'%(song.title(), song.artist(), APPNAME)) - self.statuslabel.setText('Now playing %s by %s on %s'%(song.title(), song.artist(),song.album())) + state = self.mpclient.status()['state'] + state = 'playing' if state == 'play' else 'paused' if state == 'pause' else 'stopped' + if song: + self.setWindowTitle('%s by %s - %s [%s]'%(song.title(), song.artist(), APPNAME, state)) + self.statuslabel.setText('%s by %s on %s [%s]'%(song.title(), song.artist(),song.album(), state)) else: self.setWindowTitle(APPNAME) self.statuslabel.setText('') |