summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKushal Das <kushal@fedoraproject.org>2008-10-03 17:50:25 +0530
committerKushal Das <kushal@fedoraproject.org>2008-10-03 17:50:25 +0530
commitcd5144a62cccdcdfa92f5623e15ea733b9c66049 (patch)
treebf17619bf34f8e16b5e957b6d2d3c152095d596b
parent8d3d573fc3182714bd5b456bc3ea1e481ff12bcb (diff)
downloadjukebox-activity.git-cd5144a62cccdcdfa92f5623e15ea733b9c66049.zip
jukebox-activity.git-cd5144a62cccdcdfa92f5623e15ea733b9c66049.tar.gz
jukebox-activity.git-cd5144a62cccdcdfa92f5623e15ea733b9c66049.tar.xz
now Next / Previous buttons are activated or deactivated accordingly
-rwxr-xr-xjukeboxactivity.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/jukeboxactivity.py b/jukeboxactivity.py
index fbb4e60..082bcdb 100755
--- a/jukeboxactivity.py
+++ b/jukeboxactivity.py
@@ -112,6 +112,17 @@ class JukeboxActivity(activity.Activity):
self.player.play_toggled()
except:
pass
+
+ def check_if_next_prev(self):
+ if self.currentplaying == 0:
+ self.toolbar.prev_button.set_sensitive(False)
+ else:
+ self.toolbar.prev_button.set_sensitive(True)
+ if self.currentplaying == len(self.playlist) - 1:
+ self.toolbar.next_button.set_sensitive(False)
+ else:
+ self.toolbar.next_button.set_sensitive(True)
+
def songchange(self,direction):
#if self.playflag:
@@ -146,6 +157,7 @@ class JukeboxActivity(activity.Activity):
self.play_toggled()
self.player.stop()
self.player.set_uri(None)
+ self.check_if_next_prev()
def _player_eos_cb(self, widget):
@@ -243,6 +255,7 @@ class JukeboxActivity(activity.Activity):
pass
self.play_toggled()
self.show_all()
+ self.check_if_next_prev()
return False
def play_toggled(self):