pitivi r1206 - in branches/SOC_2008_BLEWIS: . pitivi/ui



Author: blewis
Date: Mon Jul 21 01:46:38 2008
New Revision: 1206
URL: http://svn.gnome.org/viewvc/pitivi?rev=1206&view=rev

Log:
* pitivi/ui/complextimeline.py:
implemented deleting selected items


Modified:
   branches/SOC_2008_BLEWIS/ChangeLog
   branches/SOC_2008_BLEWIS/pitivi/ui/complextimeline.py

Modified: branches/SOC_2008_BLEWIS/pitivi/ui/complextimeline.py
==============================================================================
--- branches/SOC_2008_BLEWIS/pitivi/ui/complextimeline.py	(original)
+++ branches/SOC_2008_BLEWIS/pitivi/ui/complextimeline.py	Mon Jul 21 01:46:38 2008
@@ -199,7 +199,7 @@
                 self.height = AUDIO_TRACK_HEIGHT
 
     def _objectAdded(self, timeline, element):
-        w = ComplexTimelineObject(element, self.object_style)
+        w = ComplexTimelineObject(element, self.comp, self.object_style)
         make_dragable(self.canvas, w, start=self._start_drag,
             end=self._end_drag, moved=self._move_source_cb)
         element.connect("start-duration-changed", self.start_duration_cb, w)
@@ -283,9 +283,10 @@
     height = gobject.property(type=float)
     width = gobject.property(type=float)
 
-    def __init__(self, element, style):
+    def __init__(self, element, composition, style):
         goocanvas.Group.__init__(self)
         self.element = element
+        self.comp = composition
         self.bg = make_item(style)
         self.name = make_item(LABEL)
         self.name.props.text = os.path.basename(unquote(
@@ -357,6 +358,7 @@
 
     def __init__(self, leftsizegroup, layerinfolist):
         goocanvas.Canvas.__init__(self)
+        self._selected_sources = set()
         self._editpoints = []
         self._deadband = 0
         self._block_size_request = False
@@ -451,7 +453,8 @@
 ## Editing Operations
 
     def deleteSelected(self, unused_action):
-        pass
+        for obj in self._selected_sources:
+            obj.comp.removeSource(obj.element, False, False)
 
     def activateRazor(self, unused_action):
         pass
@@ -466,10 +469,17 @@
 ## ZoomableWidgetInterface overrides
 
     def _selection_changed_cb(self, selected, deselected):
+        
+        # TODO: filter this list for things other than sources, and put them
+        # into appropriate lists
         for item in selected:
             item.props.fill_color_rgba = item.get_data("selected_color")
+            parent = item.get_parent()
+            self._selected_sources.add(parent)
         for item in deselected:
             item.props.fill_color_rgba = item.get_data("normal_color")
+            parent = item.get_parent()
+            self._selected_sources.remove(parent)
 
     def getDuration(self):
         return max([layer.composition.duration for layer in



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