[pitivi] pitivi: Port to the new commit based API in GES



commit 7154b0618229800b82b3efb6be1c01e9c6f6fb98
Author: Thibault Saunier <thibault saunier collabora com>
Date:   Sun Jun 16 21:54:58 2013 -0400

    pitivi: Port to the new commit based API in GES

 pitivi/timeline/controls.py |    4 +---
 pitivi/timeline/timeline.py |   19 +++++++++----------
 pitivi/utils/timeline.py    |    4 +---
 3 files changed, 11 insertions(+), 16 deletions(-)
---
diff --git a/pitivi/timeline/controls.py b/pitivi/timeline/controls.py
index 80e64f1..038e741 100644
--- a/pitivi/timeline/controls.py
+++ b/pitivi/timeline/controls.py
@@ -124,8 +124,6 @@ class ControlContainer(Clutter.ScrollActor):
         movedLayer = control.layer
         priority = movedLayer.get_priority()
 
-        self.timeline.bTimeline.enable_update(False)
-
         movedLayer.props.priority = 999  # Don't put 1000 layers or this breaks !
 
         if priority > target:
@@ -142,7 +140,7 @@ class ControlContainer(Clutter.ScrollActor):
         movedLayer.props.priority = target
 
         self._reorderLayerActors()
-        self.timeline.bTimeline.enable_update(True)
+        self.timeline.bTimeline.commit()
 
     def addTrackControl(self, layer, isAudio):
         if isAudio:
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index c5acd9f..95048c5 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -215,14 +215,13 @@ class TimelineStage(Clutter.ScrollActor, Zoomable):
     def insertLayer(self, ghostclip):
         layer = None
         if ghostclip.priority < len(self.bTimeline.get_layers()):
-            self.bTimeline.enable_update(False)
             for layer in self.bTimeline.get_layers():
                 if layer.get_priority() >= ghostclip.priority:
                     layer.props.priority += 1
 
             layer = self.bTimeline.append_layer()
             layer.props.priority = ghostclip.priority
-            self.bTimeline.enable_update(True)
+            self.bTimeline.commit()
             self._container.controls._reorderLayerActors()
         return layer
 
@@ -291,6 +290,7 @@ class TimelineStage(Clutter.ScrollActor, Zoomable):
                             0,
                             ghostclip.asset.get_duration(),
                             ghostclip.asset.get_supported_formats())
+        self.bTimeline.commit()
 
     """
     This is called at drag-leave. We don't empty the list on purpose.
@@ -300,6 +300,7 @@ class TimelineStage(Clutter.ScrollActor, Zoomable):
             for ghostclip in ghostCouple:
                 if ghostclip is not None and ghostclip.get_parent():
                     self.remove_child(ghostclip)
+        self.bTimeline.commit()
 
     # Internal API
 
@@ -604,6 +605,8 @@ class Timeline(Gtk.VBox, Zoomable):
         else:
             self.scrollToPosition(self.bTimeline.props.duration)
 
+        self.bTimeline.commit()
+
     def purgeObject(self, asset_id):
         """Remove all instances of an asset from the timeline."""
         layers = self.bTimeline.get_layers()
@@ -942,24 +945,22 @@ class Timeline(Gtk.VBox, Zoomable):
 
     def _ungroupSelected(self, unused_action):
         if self.bTimeline:
-            self.bTimeline.enable_update(False)
             self.app.action_log.begin("ungroup")
 
             for clip in self.timeline.selection:
                 clip.ungroup(False)
 
-            self.bTimeline.enable_update(True)
+            self.bTimeline.commit()
             self.app.action_log.commit()
 
     def _groupSelected(self, unused_action):
         if self.bTimeline:
-            self.bTimeline.enable_update(False)
             self.app.action_log.begin("group")
 
             GES.Container.group(self.timeline.selection)
 
             self.app.action_log.commit()
-            self.bTimeline.enable_update(True)
+            self.bTimeline.commit()
 
     def _alignSelected(self, unused_action):
         if "NumPy" in missing_soft_deps:
@@ -970,11 +971,10 @@ class Timeline(Gtk.VBox, Zoomable):
 
             progress_dialog.window.show()
             self.app.action_log.begin("align")
-            self.bTimeline.enable_update(False)
 
             def alignedCb():  # Called when alignment is complete
-                self.bTimeline.enable_update(True)
                 self.app.action_log.commit()
+                self.bTimeline.commit()
                 progress_dialog.window.destroy()
 
             auto_aligner = AutoAligner(self.timeline.selection, alignedCb)
@@ -985,7 +985,6 @@ class Timeline(Gtk.VBox, Zoomable):
         """
         Split clips at the current playhead position, regardless of selections.
         """
-        self.bTimeline.enable_update(False)
         position = self.app.current.pipeline.getPosition()
 
         for track in self.bTimeline.get_tracks():
@@ -996,7 +995,7 @@ class Timeline(Gtk.VBox, Zoomable):
                     clip = element.get_parent()
                     clip.split(position)
 
-        self.bTimeline.enable_update(True)
+        self.bTimeline.commit()
 
     def _keyframe(self, action):
         """
diff --git a/pitivi/utils/timeline.py b/pitivi/utils/timeline.py
index 8cad1f2..3bea9ae 100644
--- a/pitivi/utils/timeline.py
+++ b/pitivi/utils/timeline.py
@@ -255,12 +255,10 @@ class EditingContext(Signallable):
         self.edge = edge
         self.mode = mode
 
-        self.timeline.enable_update(False)
-
     def finish(self):
         """Clean up timeline for normal editing"""
         # TODO: post undo / redo action here
-        self.timeline.enable_update(True)
+        self.timeline.commit()
         self.emit("clip-trim-finished")
 
     def setMode(self, mode):


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