[pitivi] mainwindow: Reset the window title when the project is closed



commit 629770cfff7cfe4d898166bd464156e728e416e2
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Sun Feb 14 00:37:58 2016 +0100

    mainwindow: Reset the window title when the project is closed
    
    Set the project_manager.current_project to None faster. This way the
    updateTitle method can be used to reset the title of the main window
    when the current project is closed (Ctrl-O).
    
    Differential Revision: https://phabricator.freedesktop.org/D773

 pitivi/mainwindow.py |    1 +
 pitivi/project.py    |   13 +++++++------
 2 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/pitivi/mainwindow.py b/pitivi/mainwindow.py
index 8960a0f..86e1cd9 100644
--- a/pitivi/mainwindow.py
+++ b/pitivi/mainwindow.py
@@ -858,6 +858,7 @@ class PitiviMainWindow(Gtk.ApplicationWindow, Loggable):
             project.pipeline.deactivatePositionListener()
 
         self.info("Project closed")
+        self.updateTitle()
         self._disconnectFromProject(project)
         self.timeline_ui.setProject(None)
         self.render_button.set_sensitive(False)
diff --git a/pitivi/project.py b/pitivi/project.py
index 8454d92..78caa35 100644
--- a/pitivi/project.py
+++ b/pitivi/project.py
@@ -559,22 +559,23 @@ class ProjectManager(GObject.Object, Loggable):
 
         self.current_project.finalize()
 
-        self.emit("project-closed", self.current_project)
+        project = self.current_project
+        self.current_project = None
+        self.emit("project-closed", project)
         # We should never choke on silly stuff like disconnecting signals
         # that were already disconnected. It blocks the UI for nothing.
         # This can easily happen when a project load/creation failed.
         try:
-            self.current_project.disconnect_by_function(self._projectChangedCb)
+            project.disconnect_by_function(self._projectChangedCb)
         except Exception:
             self.debug(
                 "Tried disconnecting signals, but they were not connected")
         try:
-            self.current_project.pipeline.disconnect_by_function(self._projectPipelineDiedCb)
+            project.pipeline.disconnect_by_function(self._projectPipelineDiedCb)
         except Exception:
             self.fixme("Handle better the errors and not get to this point")
-        self._cleanBackup(self.current_project.uri)
-        self.exitcode = self.current_project.release()
-        self.current_project = None
+        self._cleanBackup(project.uri)
+        self.exitcode = project.release()
 
         return True
 


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