[gnome-music] view: Show newly created playlist if it's the only playlist
- From: Arnel A. Borja <arnelborja src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music] view: Show newly created playlist if it's the only playlist
- Date: Wed, 2 Apr 2014 10:37:09 +0000 (UTC)
commit c02a458ba6e77587d48813d2c72637c32ce60d07
Author: Arnel A. Borja <arnelborja src gnome org>
Date: Wed Apr 2 17:55:46 2014 +0800
view: Show newly created playlist if it's the only playlist
gnomemusic/view.py | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/gnomemusic/view.py b/gnomemusic/view.py
index ec9b132..5d8d562 100644
--- a/gnomemusic/view.py
+++ b/gnomemusic/view.py
@@ -1021,6 +1021,12 @@ class Playlist(ViewContainer):
def _on_playlist_created(self, playlists, name):
self._add_playlist_item(name)
+ if self.playlists_model.iter_n_children(None) == 1:
+ _iter = self.playlists_model.get_iter_first()
+ selection = self.playlists_sidebar.get_generic_view().get_selection()
+ selection.select_iter(_iter)
+ self.playlists_sidebar.emit('item-activated', '0',
+ self.playlists_model.get_path(_iter))
def _on_song_added_to_playlist(self, playlists, name, item):
if name == self.current_playlist:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]