[gnome-music] notification: remove hanging notifications after 5 secs



commit 6ed4f1025555115576cf97a2428686a673c7b85e
Author: Vadim Rutkovsky <vrutkovs redhat com>
Date:   Thu Mar 5 14:24:51 2015 +0100

    notification: remove hanging notifications after 5 secs
    
    This would remove hanging notification after 5 seconds, unless
    there is something to add to the list - in this case the
    notification will be removed after the last element was added
    
    https://bugzilla.gnome.org/show_bug.cgi?id=744657

 gnomemusic/view.py    |    5 +++++
 gnomemusic/widgets.py |    1 +
 gnomemusic/window.py  |    1 +
 3 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/gnomemusic/view.py b/gnomemusic/view.py
index 9d188b3..ea1d70c 100644
--- a/gnomemusic/view.py
+++ b/gnomemusic/view.py
@@ -210,6 +210,7 @@ class ViewContainer(Gtk.Stack):
 
     @log
     def _add_item(self, source, param, item, remaining=0, data=None):
+        self.window.notification.set_timeout(0)
         if not item:
             if remaining == 0:
                 self.window.notification.dismiss()
@@ -423,6 +424,7 @@ class Songs(ViewContainer):
         return False
 
     def _add_item(self, source, param, item, remaining=0, data=None):
+        self.window.notification.set_timeout(0)
         if not item:
             if remaining == 0:
                 self.window.notification.dismiss()
@@ -696,6 +698,7 @@ class Artists (ViewContainer):
 
     @log
     def _add_item(self, source, param, item, remaining=0, data=None):
+        self.window.notification.set_timeout(0)
         if item is None:
             if remaining == 0:
                 self.window.notification.dismiss()
@@ -1005,6 +1008,7 @@ class Playlist(ViewContainer):
 
     @log
     def _add_playlist_item_to_model(self, item, index=None):
+        self.window.notification.set_timeout(0)
         if index is None:
             index = -1
         if not item:
@@ -1397,6 +1401,7 @@ class Search(ViewContainer):
 
     @log
     def _add_item(self, source, param, item, remaining=0, data=None):
+        self.window.notification.set_timeout(0)
         if data is None:
             return
 
diff --git a/gnomemusic/widgets.py b/gnomemusic/widgets.py
index a085541..0e6ca92 100644
--- a/gnomemusic/widgets.py
+++ b/gnomemusic/widgets.py
@@ -422,6 +422,7 @@ class ArtistAlbums(Gtk.Box):
 
     @log
     def add_album(self, album, is_last_album=False):
+        self.window.notification.set_timeout(0)
         widget = ArtistAlbumWidget(
             self.artist, album, self.player, self.model,
             self.header_bar, self.selectionModeAllowed
diff --git a/gnomemusic/window.py b/gnomemusic/window.py
index f2bc7e2..7129ac7 100644
--- a/gnomemusic/window.py
+++ b/gnomemusic/window.py
@@ -311,6 +311,7 @@ class Window(Gtk.ApplicationWindow):
     @log
     def _init_loading_notification(self):
         self.notification = Gd.Notification()
+        self.notification.set_timeout(5)
         grid = Gtk.Grid(valign=Gtk.Align.CENTER, margin_right=8)
         grid.set_column_spacing(8)
         spinner = Gtk.Spinner()


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