[pitivi] Add undo/redo support for trimming clips at start.



commit 92bd1b4442fe28b7429babe9c12ab682a00c4924
Author: Alessandro Decina <alessandro d gmail com>
Date:   Wed Jun 10 17:12:16 2009 +0200

    Add undo/redo support for trimming clips at start.

 pitivi/ui/trackobject.py |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/pitivi/ui/trackobject.py b/pitivi/ui/trackobject.py
index 95ccfd3..c86d613 100644
--- a/pitivi/ui/trackobject.py
+++ b/pitivi/ui/trackobject.py
@@ -110,7 +110,8 @@ class TrimHandle(View, goocanvas.Image, Zoomable):
 
     element = receiver()
 
-    def __init__(self, element, timeline, **kwargs):
+    def __init__(self, instance, element, timeline, **kwargs):
+        self.app = instance
         self.element = element
         self.timeline = timeline
         goocanvas.Image.__init__(self,
@@ -135,6 +136,14 @@ class StartHandle(TrimHandle):
 
         _cursor = LEFT_SIDE
 
+        def drag_start(self):
+            TimelineController.drag_start(self)
+            self._view.app.action_log.begin("trim object")
+
+        def drag_end(self):
+            TimelineController.drag_end(self)
+            self._view.app.action_log.commit()
+
         def set_pos(self, obj, pos):
             new_start = max(self._view.pixelToNs(pos[0]), 0)
             self._view.element.trimStart(new_start, snap=True)
@@ -237,9 +246,9 @@ class TrackObject(View, goocanvas.Group, Zoomable):
             y = 3,
             line_width = 0)
 
-        self.start_handle = StartHandle(element, timeline,
+        self.start_handle = StartHandle(self.app, element, timeline,
             height=self.height)
-        self.end_handle = EndHandle(element, timeline,
+        self.end_handle = EndHandle(self.app, element, timeline,
             height=self.height)
 
         self.selection_indicator = goocanvas.Rect(



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