[pitivi] [medialibrary] : fixes multiple clips selection
- From: Jean-FranÃois Fortin Tam <jfft src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] [medialibrary] : fixes multiple clips selection
- Date: Sun, 2 Sep 2012 04:05:02 +0000 (UTC)
commit 3d4466662256e2798e4ee1314835ce7a8b838be5
Author: Mathieu Duponchelle <mathieu duponchelle epitech eu>
Date: Sun Aug 26 21:18:52 2012 +0200
[medialibrary] : fixes multiple clips selection
pitivi/medialibrary.py | 32 +++++++++++++++++++++++++-------
1 files changed, 25 insertions(+), 7 deletions(-)
---
diff --git a/pitivi/medialibrary.py b/pitivi/medialibrary.py
index 55b1eab..e0073c8 100644
--- a/pitivi/medialibrary.py
+++ b/pitivi/medialibrary.py
@@ -277,7 +277,7 @@ class MediaLibraryWidget(gtk.VBox, Loggable):
self._errors = []
self._project = None
self.dummy_selected = []
- self._draggedItems = None
+ self._draggedPaths = None
self.dragged = False
# Store
@@ -1152,11 +1152,18 @@ class MediaLibraryWidget(gtk.VBox, Loggable):
chain_up = not self._rowUnderMouseSelected(treeview, event)
if not chain_up:
- self._draggedItems = self.getSelectedItems()
+ self._draggedPaths = self.getSelectedPaths()
else:
- self._draggedItems = None
+ self._draggedPaths = None
gtk.TreeView.do_button_press_event(treeview, event)
+
+ ts = self.treeview.get_selection()
+
+ if (self._draggedPaths):
+ for path in self._draggedPaths:
+ ts.select_path(path)
+
self._ignoreRelease = chain_up
return True
@@ -1190,10 +1197,16 @@ class MediaLibraryWidget(gtk.VBox, Loggable):
chain_up = not self._rowUnderMouseSelected(iconview, event)
if not chain_up:
- self._draggedItems = self.getSelectedItems()
+ self._draggedPaths = self.getSelectedPaths()
else:
- self._draggedItems = None
+ self._draggedPaths = None
+
gtk.IconView.do_button_press_event(iconview, event)
+
+ if self._draggedPaths:
+ for path in self._draggedPaths:
+ self.iconview.select_path(path)
+
self._ignoreRelease = chain_up
return True
@@ -1252,6 +1265,10 @@ class MediaLibraryWidget(gtk.VBox, Loggable):
self.info("tree drag_begin")
self.dragged = True
paths = self.getSelectedPaths()
+ ts = self.treeview.get_selection()
+
+ for path in self._draggedPaths:
+ ts.select_path(path)
if len(paths) < 1:
context.drag_abort(int(time.time()))
@@ -1280,8 +1297,9 @@ class MediaLibraryWidget(gtk.VBox, Loggable):
def getSelectedItems(self):
""" Returns a list of selected items URIs """
- if self._draggedItems:
- return self._draggedItems
+ if self._draggedPaths:
+ return [self.modelFilter[path][COL_URI]
+ for path in self._draggedPaths]
return [self.modelFilter[path][COL_URI]
for path in self.getSelectedPaths()]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]