[gnome-music] Fix sensitivity prev & next buttons
- From: Seif Lotfy <seiflotfy src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music] Fix sensitivity prev & next buttons
- Date: Tue, 7 May 2013 11:37:15 +0000 (UTC)
commit e9b3f8575ce3c98b4263db605d797444971ecc1f
Author: Shivani Poddar <shivani poddar92 gmail com>
Date: Tue May 7 02:36:43 2013 +0530
Fix sensitivity prev & next buttons
Signed-off-by: Seif Lotfy <seif lotfy com>
src/player.js | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/src/player.js b/src/player.js
index 41e7f43..6e0a9b8 100644
--- a/src/player.js
+++ b/src/player.js
@@ -112,12 +112,19 @@ const Player = new Lang.Class({
this._setDuration(media.get_duration());
this.songTotalTimeLabel.set_label(this.secondsToString (media.get_duration()));
this.progressScale.sensitive = true;
- this.prevBtn.set_sensitive(true);
this.playBtn.set_sensitive(true);
- this.nextBtn.set_sensitive(true);
-
// FIXME: site contains the album's name. It's obviously a hack to remove
+ let tmp = this.currentTrack.copy();
+ if(this.playlist.iter_next(tmp))
+ this.nextBtn.set_sensitive(true);
+ else
+ this.nextBtn.set_sensitive(false);
+ tmp = this.currentTrack.copy();
+ if(this.playlist.iter_previous(tmp))
+ this.prevBtn.set_sensitive(true);
+ else
+ this.prevBtn.set_sensitive(false);
pixbuf = this.cache.lookup (ART_SIZE, media.get_artist (), media.get_string(Grl.METADATA_KEY_ALBUM));
this.coverImg.set_from_pixbuf (pixbuf);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]