[pitivi] undo: Properly make remove layer undoable
- From: Thibault Saunier <tsaunier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] undo: Properly make remove layer undoable
- Date: Sat, 13 Dec 2014 19:11:31 +0000 (UTC)
commit bc2272f672a330435248e1f94af2e779424c0d42
Author: Thibault Saunier <tsaunier gnome org>
Date: Mon Dec 1 00:55:56 2014 +0100
undo: Properly make remove layer undoable
And make sure to wait for ASYNC_DONE before commiting timeline
when undoing actions
pitivi/timeline/layer.py | 2 ++
pitivi/undo/timeline.py | 14 ++++++++------
2 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/pitivi/timeline/layer.py b/pitivi/timeline/layer.py
index 8247568..0174f35 100644
--- a/pitivi/timeline/layer.py
+++ b/pitivi/timeline/layer.py
@@ -218,8 +218,10 @@ class BaseLayerControl(Gtk.VBox, Loggable):
return True
def _deleteLayerCb(self, unused_widget):
+ self._app.action_log.begin("delete layer")
self._control_container.timeline.bTimeline.remove_layer(self.layer)
self._control_container.timeline.bTimeline.get_asset().pipeline.commit_timeline()
+ self._app.action_log.commit()
def _moveLayerCb(self, unused_widget, step):
index = self.layer.get_priority()
diff --git a/pitivi/undo/timeline.py b/pitivi/undo/timeline.py
index 410bee6..a7f2709 100644
--- a/pitivi/undo/timeline.py
+++ b/pitivi/undo/timeline.py
@@ -134,7 +134,7 @@ class TrackElementAdded(UndoableAction):
self.track_element = self.clip.add_asset(self.asset)
for prop_name, prop_value in self.track_element_props:
self.track_element.set_child_property(prop_name, prop_value)
- self.clip.get_layer().get_timeline().commit()
+ self.clip.get_layer().get_timeline().get_asset().pipeline.commit_timeline()
self._props_changed = []
self._done()
@@ -194,7 +194,7 @@ class TrackElementRemoved(UndoableAction):
self.track_element = self.clip.add_asset(self.asset)
for prop_name, prop_value in self.track_element_props:
self.track_element.set_child_property(prop_name, prop_value)
- self.clip.get_layer().get_timeline().commit()
+ self.clip.get_layer().get_timeline().get_asset().pipeline.commit_timeline()
self._props_changed = []
self._undone()
@@ -308,12 +308,12 @@ class ClipAdded(UndoableAction):
def do(self):
self.clip.set_name(None)
self.layer.add_clip(self.clip)
- self.layer.get_timeline().commit()
+ self.layer.get_timeline().get_asset().pipeline.commit_timeline()
self._done()
def undo(self):
self.layer.remove_clip(self.clip)
- self.layer.get_timeline().commit()
+ self.layer.get_timeline().get_asset().pipeline.commit_timeline()
self._undone()
def asScenarioAction(self):
@@ -341,13 +341,13 @@ class ClipRemoved(UndoableAction):
def do(self):
self.layer.remove_clip(self.clip)
- self.layer.get_timeline().commit()
+ self.layer.get_timeline().get_asset().pipeline.commit_timeline()
self._done()
def undo(self):
self.clip.set_name(None)
self.layer.add_clip(self.clip)
- self.layer.get_timeline().commit()
+ self.layer.get_timeline().get_asset().pipeline.commit_timeline()
self._undone()
def asScenarioAction(self):
@@ -367,6 +367,7 @@ class LayerAdded(UndoableAction):
def undo(self):
self.timeline.remove_layer(self.layer)
+ self.timeline.get_asset().pipeline.commit_timeline()
def asScenarioAction(self):
st = Gst.Structure.new_empty("add-layer")
@@ -382,6 +383,7 @@ class LayerRemoved(UndoableAction):
def do(self):
self.timeline.remove_layer(self.layer)
+ self.timeline.get_asset().pipeline.commit_timeline()
def undo(self):
self.timeline.add_layer(self.layer)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]