[gnome-music/wip/gbsneto/contained-playlists: 18/29] playlistview: Synchronize loading notification with Playlist:ready
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/gbsneto/contained-playlists: 18/29] playlistview: Synchronize loading notification with Playlist:ready
- Date: Thu, 1 Dec 2016 23:27:05 +0000 (UTC)
commit 2b073ffa04f41287127663a1c83bfa2822eec81d
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Thu Dec 1 11:40:41 2016 -0200
playlistview: Synchronize loading notification with Playlist:ready
This way, we have a real notification that's notifying a real state
of loading, instead of a arbitrary timeout that doesn't really inform
whether we're loading something.
gnomemusic/views/playlistview.py | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/gnomemusic/views/playlistview.py b/gnomemusic/views/playlistview.py
index 93c6cfe..73692b0 100644
--- a/gnomemusic/views/playlistview.py
+++ b/gnomemusic/views/playlistview.py
@@ -120,11 +120,21 @@ class PlaylistView(BaseView):
self.show_all()
+ # Sync the playlists' :ready property with the window notification
+ playlists.connect('notify::ready', self._playlist_ready_changed)
+
@log
def _on_changes_pending(self, data=None):
pass
@log
+ def _playlist_ready_changed(self, playlists, property):
+ if playlists.ready:
+ self.window.notification.show_all()
+ else:
+ self.window.notification.dismiss()
+
+ @log
def _add_list_renderers(self):
list_widget = self.view.get_generic_view()
cols = list_widget.get_columns()
@@ -260,7 +270,6 @@ class PlaylistView(BaseView):
@log
def _add_playlist_to_model(self, playlist, index=None):
- self.window.notification.set_timeout(0)
if index is None:
index = -1
_iter = self.playlists_model.insert_with_valuesv(
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]