[gnome-music] Properly add notification to overlay and track timeout_adds



commit 42eadf3bb7a362a99a227e90bc7227a73889258f
Author: Vadim Rutkovsky <vrutkovs redhat com>
Date:   Tue Aug 11 19:39:43 2015 +0200

    Properly add notification to overlay and track timeout_adds

 gnomemusic/window.py |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gnomemusic/window.py b/gnomemusic/window.py
index 26cf94f..aab541b 100644
--- a/gnomemusic/window.py
+++ b/gnomemusic/window.py
@@ -72,6 +72,7 @@ class Window(Gtk.ApplicationWindow):
         self.add_action(selectNone)
         self.set_size_request(200, 100)
         self.set_icon_name('gnome-music')
+        self.notification_handler = None
 
         self.prev_view = None
         self.curr_view = None
@@ -331,8 +332,11 @@ class Window(Gtk.ApplicationWindow):
         label = Gtk.Label.new(_("Loading"))
         grid.add(label)
         self.notification.add(grid)
-        self.notification.show_all()
-        GLib.timeout_add(1000, self._overlay.add_overlay, self.notification)
+        self._overlay.add_overlay(self.notification)
+        if self.notification_handler:
+            GLib.Source.remove(self.notification_handler)
+            self.notification_handler = None
+        self.notification_handler = GLib.timeout_add(1000, self.notification.show_all)
 
     @log
     def _init_playlist_removal_notification(self):


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