[gnome-music] view: Implement selection mode in artist view in Search



commit 10c0e19812a1552b4a2dac666826c1b7f36b13d5
Author: Arnel Borja <arnelborja src gnome org>
Date:   Thu May 8 23:11:33 2014 +0800

    view: Implement selection mode in artist view in Search

 gnomemusic/view.py |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/gnomemusic/view.py b/gnomemusic/view.py
index 724d9c7..5aead15 100644
--- a/gnomemusic/view.py
+++ b/gnomemusic/view.py
@@ -1231,6 +1231,11 @@ class Search(ViewContainer):
                 self.player.set_playlist('Search Results', None, self.songs_model, child_iter, 5)
                 self.player.set_playing(True)
 
+    @log
+    def _on_selection_mode_changed(self, widget, data=None):
+        if self.get_visible_child() == self._artistAlbumsWidget:
+            self._artistAlbumsWidget.set_selection_mode(self.header_bar._selectionMode)
+
     def _add_item(self, source, param, item, remaining=0, data=None):
         if data is None:
             return
@@ -1322,6 +1327,12 @@ class Search(ViewContainer):
                 _iter = self._albumWidget.model.get_iter(path)
                 uris.append(self._albumWidget.model.get_value(_iter, 5).get_url())
             callback(uris)
+        elif self.get_visible_child() == self._artistAlbumsWidget:
+            uris = []
+            for row in self._artistAlbumsWidget.model:
+                if row[6]:
+                    uris.append(row[5].get_url())
+            callback(uris)
         else:
             self.items_selected = []
             self.items_selected_callback = callback


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