[gnome-music/freeze-break] Runtime check for libnotify



commit b6eca19bb281e1bfaceffb72b86aa39a5209161a
Author: Vadim Rutkovsky <vrutkovs redhat com>
Date:   Thu Sep 12 11:37:57 2013 +0200

    Runtime check for libnotify

 gnomemusic/notification.py |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)
---
diff --git a/gnomemusic/notification.py b/gnomemusic/notification.py
index 01ec513..c17bfc7 100644
--- a/gnomemusic/notification.py
+++ b/gnomemusic/notification.py
@@ -121,16 +121,17 @@ class NotificationManager:
     def _set_actions(self, playing):
         self._notification.clear_actions()
 
-        self._notification.add_action('media-skip-backward', _("Previous"),
-                                      self._go_previous, None)
-        if playing:
-            self._notification.add_action('media-playback-pause', _("Pause"),
-                                          self._pause, None)
-        else:
-            self._notification.add_action('media-playback-start', _("Play"),
-                                          self._play, None)
-        self._notification.add_action('media-skip-forward', _("Next"),
-                                      self._go_next, None)
+        if len(self._notification) > 4:
+            self._notification.add_action('media-skip-backward', _("Previous"),
+                                          self._go_previous, None)
+            if playing:
+                self._notification.add_action('media-playback-pause', _("Pause"),
+                                              self._pause, None)
+            else:
+                self._notification.add_action('media-playback-start', _("Play"),
+                                              self._play, None)
+            self._notification.add_action('media-skip-forward', _("Next"),
+                                          self._go_next, None)
 
     def _go_previous(self, notification, action, data):
         self._player.play_previous()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]