[pitivi/ges] project: Close running project when loading a new project



commit b5f94798981dd03af9cfb059ff7d202b13506e90
Author: Thibault Saunier <thibault saunier collabora com>
Date:   Tue May 1 09:17:02 2012 -0400

    project: Close running project when loading a new project

 pitivi/project.py |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/pitivi/project.py b/pitivi/project.py
index 49109dd..c32c7d9 100644
--- a/pitivi/project.py
+++ b/pitivi/project.py
@@ -120,6 +120,9 @@ class ProjectManager(Signallable, Loggable):
         should be loaded instead, and if so, force the user to use "Save as"
         afterwards.
         """
+        if self.current is not None and not self.closeRunningProject():
+            return False
+
         self.emit("new-project-loading", uri)
 
         # We really want a path for os.path to work
@@ -153,6 +156,8 @@ class ProjectManager(Signallable, Loggable):
         if self.formatter.load_from_uri(self.timeline, uri):
             self.current.connect("project-changed", self._projectChangedCb)
 
+        return True
+
     def _restoreFromBackupDialog(self, time_diff):
         """
         Ask if we need to load the autosaved project backup or not.



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