[gnome-music] notificationspopup: Delete pending notifications when closing
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music] notificationspopup: Delete pending notifications when closing
- Date: Mon, 5 Feb 2018 12:10:54 +0000 (UTC)
commit 50392ad66a7f3faf29ae0fbfdb17d57e008cd7c5
Author: Jean Felder <jean felder gmail com>
Date: Wed Jan 31 11:00:32 2018 +0100
notificationspopup: Delete pending notifications when closing
Delete all pending songs and playlists when closing Music.
Closes: #106
gnomemusic/widgets/notificationspopup.py | 8 ++++++++
gnomemusic/window.py | 1 +
2 files changed, 9 insertions(+)
---
diff --git a/gnomemusic/widgets/notificationspopup.py b/gnomemusic/widgets/notificationspopup.py
index be16b1f..9aecef6 100644
--- a/gnomemusic/widgets/notificationspopup.py
+++ b/gnomemusic/widgets/notificationspopup.py
@@ -131,6 +131,14 @@ class NotificationsPopup(Gtk.Revealer):
self._set_visibility(notification, True)
notification.emit(signal)
+ @log
+ def terminate_pending(self):
+ """Terminate all pending playlists notifications"""
+ children = self._grid.get_children()
+ if len(children) > 1:
+ for notification in children[:-1]:
+ self.remove_notification(notification, 'finish-deletion')
+
class LoadingNotification(Gtk.Grid):
"""LoadingNotification displays a loading notification message
diff --git a/gnomemusic/window.py b/gnomemusic/window.py
index cd36f09..c57f3cb 100644
--- a/gnomemusic/window.py
+++ b/gnomemusic/window.py
@@ -392,6 +392,7 @@ class Window(Gtk.ApplicationWindow):
@log
def _notify_mode_disconnect(self, data=None):
self.player.Stop()
+ self.notifications_popup.terminate_pending()
self._stack.disconnect(self._on_notify_model_id)
@log
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]