[pitivi] medialibrary: Keep the selection when switching view types



commit 388f3d00f5c83b21d043a3f907272ae59e03600d
Author: Jean-FranÃois Fortin Tam <nekohayo gmail com>
Date:   Sat Sep 1 23:16:48 2012 -0400

    medialibrary: Keep the selection when switching view types

 pitivi/medialibrary.py |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/pitivi/medialibrary.py b/pitivi/medialibrary.py
index 46856ee..c5742ca 100644
--- a/pitivi/medialibrary.py
+++ b/pitivi/medialibrary.py
@@ -579,16 +579,15 @@ class MediaLibraryWidget(Gtk.VBox, Loggable):
         view_type: one of SHOW_TREEVIEW or SHOW_ICONVIEW
         """
         self.settings.lastClipView = view_type
-        self.clip_view = view_type
-
-        # transfer selection to next view
-        self._viewUnselectAll()
+        # Gather some info before switching views
         paths = self.getSelectedPaths()
+        self._viewUnselectAll()
+        # Now that we've got all the info, we can actually change the view type
+        self.clip_view = view_type
+        self._displayClipView()
         for path in paths:
             self._viewSelectPath(path)
 
-        self._displayClipView()
-
     def _displayClipView(self):
         if self.clip_view == SHOW_TREEVIEW:
             self.iconview_scrollwin.hide()



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