[pitivi: 1/12] pitivi/timeline/timeline.py: allow adding TimelineObjects to selection



commit 44ba9fc0a4f1934f0d5be2c8ef3b1f876afc7516
Author: Brandon Lewis <brandon_lewis alum berkeley edu>
Date:   Wed Nov 25 10:35:01 2009 -0800

    pitivi/timeline/timeline.py: allow adding TimelineObjects to selection

 pitivi/timeline/timeline.py |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index 3f6f1ed..a12c7f3 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -480,7 +480,7 @@ class Selection(Signallable):
 
     # FIXME : it took me 10 mins to understand what this method does... a more obvious
     # name would be better :)
-    def setTo(self, selection, mode):
+    def setTo(self, objs, mode):
         """
         Update the current selection.
 
@@ -494,8 +494,13 @@ class Selection(Signallable):
 
         @see: L{setToObj}
         """
-        # get the L{TrackObject}s for the given TimelineObjects
-        selection = set([obj.timeline_object for obj in selection])
+        # get a list of timeline objects
+        selection = set()
+        for obj in objs:
+            if isinstance(obj, TrackObject):
+                selection.add(obj.timeline_object)
+            else:
+                selection.add(obj)
         old_selection = self.selected
         if mode == SELECT_ADD:
             selection = self.selected | selection



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