[pitivi/ges] Clear the timeline immediately when creating a blank project



commit a5dc491f3fa3e0d7c526c006cbd420cf4a2c549d
Author: Jean-FranÃois Fortin Tam <nekohayo gmail com>
Date:   Tue Apr 3 20:32:47 2012 -0400

    Clear the timeline immediately when creating a blank project

 pitivi/timeline/timeline.py |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index a16438b..7bc891e 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -740,6 +740,7 @@ class Timeline(gtk.Table, Loggable, Zoomable):
         self.connect("drag-leave", self._dragLeaveCb)
         self.connect("drag-drop", self._dragDropCb)
         self.connect("drag-motion", self._dragMotionCb)
+        self.app.connect("new-project-created", self._newProjectCreatedCb)
         self._canvas.connect("key-press-event", self._keyPressEventCb)
         self._canvas.connect("scroll-event", self._scrollEventCb)
 
@@ -1095,6 +1096,16 @@ class Timeline(gtk.Table, Loggable, Zoomable):
 
 ## Project callbacks
 
+    def _newProjectCreatedCb(self, app, project):
+        """
+        When a new blank project is created, immediately clear the timeline.
+
+        Otherwise, we would sit around until a clip gets imported to the
+        media library, waiting for a "ready" signal.
+        """
+        self.debug("New blank project created, pre-emptively clearing the timeline")
+        self.setProject(self.app.current)
+
     def setProject(self, project):
         self.debug("Setting project %s", project)
         if self._project:



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