[pitivi] undo: Start the timeline observer from the project observer



commit b4187e41ef844aeec6e8537819de734961c602e0
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Tue Jun 14 23:13:02 2016 +0200

    undo: Start the timeline observer from the project observer
    
    Differential Revision: https://phabricator.freedesktop.org/D1085

 pitivi/application.py  |    7 ++-----
 pitivi/undo/project.py |    3 +++
 2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/pitivi/application.py b/pitivi/application.py
index 02a98bd..1a33f58 100644
--- a/pitivi/application.py
+++ b/pitivi/application.py
@@ -40,7 +40,6 @@ from pitivi.settings import xdg_cache_home
 from pitivi.shortcutswindow import ShortcutsWindow
 from pitivi.shortcutswindow import show_shortcuts
 from pitivi.undo.project import ProjectObserver
-from pitivi.undo.timeline import TimelineObserver
 from pitivi.undo.undo import UndoableActionLog
 from pitivi.utils import loggable
 from pitivi.utils.loggable import Loggable
@@ -81,6 +80,7 @@ class Pitivi(Gtk.Application, Loggable):
         self.project_manager = ProjectManager(self)
 
         self.action_log = None
+        self.project_observer = None
         self._last_action_time = Gst.util_get_timestamp()
 
         self.gui = None
@@ -279,10 +279,7 @@ class Pitivi(Gtk.Application, Loggable):
         self.action_log.connect("commit", self._actionLogCommit)
         self.action_log.connect("move", self._action_log_move_cb)
 
-        timeline_observer = TimelineObserver(self.action_log)
-        timeline_observer.startObserving(project.ges_timeline)
-
-        project_observer = ProjectObserver(project, self.action_log)
+        self.project_observer = ProjectObserver(project, self.action_log)
 
     def _projectClosed(self, unused_project_manager, project):
         if project.loaded:
diff --git a/pitivi/undo/project.py b/pitivi/undo/project.py
index e946c5e..0b2f30e 100644
--- a/pitivi/undo/project.py
+++ b/pitivi/undo/project.py
@@ -19,6 +19,7 @@
 from gi.repository import GObject
 from gi.repository import Gst
 
+from pitivi.undo.timeline import TimelineObserver
 from pitivi.undo.undo import MetaContainerObserver
 from pitivi.undo.undo import UndoableAction
 
@@ -76,6 +77,8 @@ class ProjectObserver(MetaContainerObserver):
         MetaContainerObserver.__init__(self, project, action_log)
         project.connect("asset-added", self._assetAddedCb)
         project.connect("asset-removed", self._assetRemovedCb)
+        self.timeline_observer = TimelineObserver(action_log)
+        self.timeline_observer.startObserving(project.ges_timeline)
 
     def _assetAddedCb(self, project, asset):
         action = AssetAddedAction(project, asset)


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