[pitivi/ges: 148/287] projectmanager: Make use of the new GESFormatter::loaded signal



commit ef69b6c143f28b0aa590687d76d9687a3248daae
Author: Thibault Saunier <thibault saunier collabora com>
Date:   Sat Jan 7 14:26:24 2012 -0300

    projectmanager: Make use of the new GESFormatter::loaded signal
    
        + Do not forget to set timeline duration when setting a UITimeline.timeline

 pitivi/projectmanager.py |    8 ++++++--
 pitivi/ui/timeline.py    |    1 +
 2 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/pitivi/projectmanager.py b/pitivi/projectmanager.py
index 56e8502..2d64a5b 100644
--- a/pitivi/projectmanager.py
+++ b/pitivi/projectmanager.py
@@ -102,10 +102,9 @@ class ProjectManager(Signallable, Loggable):
         self.formatter = ges.PitiviFormatter()
 
         self.formatter.connect("source-moved", self._formatterMissingURICb)
+        self.formatter.connect("loaded", self._projectLoadedCb)
         if self.formatter.load_from_uri(self.timeline, uri):
             self.current.connect("project-changed", self._projectChangedCb)
-            self.emit("new-project-loaded", self.current)
-            self.current.sources.addUris(self.formatter.get_sources())
 
     def saveProject(self, project, uri=None, overwrite=False, formatter=None, backup=False):
         """
@@ -253,3 +252,8 @@ class ProjectManager(Signallable, Loggable):
 
     def _formatterMissingURICb(self, formatter, tfs):
         return self.emit("missing-uri", formatter, tfs)
+
+    def _projectLoadedCb(self, formatter, timeline):
+        self.debug("Project Loaded")
+        self.emit("new-project-loaded", self.current)
+        self.current.sources.addUris(self.formatter.get_sources())
diff --git a/pitivi/ui/timeline.py b/pitivi/ui/timeline.py
index 1a5ccdd..6697aa6 100644
--- a/pitivi/ui/timeline.py
+++ b/pitivi/ui/timeline.py
@@ -744,6 +744,7 @@ class Timeline(gtk.Table, Loggable, Zoomable):
 
         # Make sure to set the current layer in use
         self._layerAddedCb(None, None)
+        self.setDuration()
 
     def getTimeline(self):
         return self._timeline



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