[gnome-music] Selection mode on right click in album widget



commit 3d86e3f6d51b96f50525a0f4573b118b3c42f51e
Author: Sai Suman Prayaga <suman sai14 gmail com>
Date:   Mon May 19 00:19:49 2014 +0530

    Selection mode on right click in album widget
    
    https://bugzilla.gnome.org/show_bug.cgi?id=728407

 gnomemusic/view.py    |    2 --
 gnomemusic/widgets.py |    6 ++++++
 2 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gnomemusic/view.py b/gnomemusic/view.py
index 8fd5ad6..16427fe 100644
--- a/gnomemusic/view.py
+++ b/gnomemusic/view.py
@@ -347,7 +347,6 @@ class Albums(ViewContainer):
     def __init__(self, window, player):
         ViewContainer.__init__(self, 'albums', _("Albums"), window, Gd.MainViewType.ICON)
         self._albumWidget = Widgets.AlbumWidget(player)
-        self._albumWidget.view.connect('selection-mode-request', self._on_selection_mode_request)
         self.player = player
         self.add(self._albumWidget)
         self.albums_selected = []
@@ -1182,7 +1181,6 @@ class Search(ViewContainer):
         self.albums_selected = []
         self._albums = {}
         self._albumWidget = Widgets.AlbumWidget(player)
-        self._albumWidget.view.connect('selection-mode-request', self._on_selection_mode_request)
         self.add(self._albumWidget)
 
         self.artists_albums_selected = []
diff --git a/gnomemusic/widgets.py b/gnomemusic/widgets.py
index 0866713..9d96e09 100644
--- a/gnomemusic/widgets.py
+++ b/gnomemusic/widgets.py
@@ -80,11 +80,13 @@ class AlbumWidget(Gtk.EventBox):
         )
         self.view.set_view_type(Gd.MainViewType.LIST)
         self.album = None
+        self.header_bar = None
         self.view.connect('item-activated', self._on_item_activated)
         self.monitors = []
         view_box = self.ui.get_object('view')
         self.ui.get_object('scrolledWindow').set_placement(Gtk.CornerType.
                                                            TOP_LEFT)
+        self.view.connect('selection-mode-request', self._on_selection_mode_request)
         child_view = self.view.get_children()[0]
         child_view.set_margin_top(64)
         child_view.set_margin_bottom(64)
@@ -99,6 +101,10 @@ class AlbumWidget(Gtk.EventBox):
         self.show_all()
 
     @log
+    def _on_selection_mode_request(self, *args):
+        self.header_bar._select_button.clicked()
+
+    @log
     def _on_item_activated(self, widget, id, path):
         _iter = self.model.get_iter(path)
 


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