[pitivi] projectmanager.py: check in ProjectSettingsChanged and ProjectLogObserver
- From: Edward Hervey <edwardrv src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [pitivi] projectmanager.py: check in ProjectSettingsChanged and ProjectLogObserver
- Date: Wed, 4 Nov 2009 15:43:58 +0000 (UTC)
commit 66cc5a00a7127c56f5551ba410ec96ebea19f7a6
Author: Brandon Lewis <brandon_lewis berkeley edu>
Date: Mon Oct 19 00:47:46 2009 -0700
projectmanager.py: check in ProjectSettingsChanged and ProjectLogObserver
pitivi/projectmanager.py | 33 +++++++++++++++++++++++++++++++++
1 files changed, 33 insertions(+), 0 deletions(-)
---
diff --git a/pitivi/projectmanager.py b/pitivi/projectmanager.py
index 0b3c67a..a9c1780 100644
--- a/pitivi/projectmanager.py
+++ b/pitivi/projectmanager.py
@@ -32,6 +32,39 @@ from pitivi.signalinterface import Signallable
from pitivi.log.loggable import Loggable
from pitivi.stream import AudioStream, VideoStream
from pitivi.timeline.track import Track
+from pitivi.undo import UndoableAction
+
+class ProjectSettingsChanged(UndoableAction):
+
+ def __init__(self, project, old, new):
+ self.project = project
+ self.oldsettings = old
+ self.newsettings = new
+
+ def do(self):
+ self.project.setSettings(self.newsettings)
+ self._done()
+
+ def undo(self):
+ self.project.setSettings(self.oldsettings)
+ self._undone()
+
+class ProjectLogObserver(UndoableAction):
+
+ def __init__(self, log):
+ self.log = log
+
+ def startObserving(self, project):
+ project.connect("settings-changed", self._settingsChangedCb)
+
+ def stopObserving(self, project):
+ project.disconnect_by_function(self._settingsChangedCb)
+
+ def _settingsChangedCb(self, project, old, new):
+ action = ProjectSettingsChanged(project, old, new)
+ self.log.begin("change project settings")
+ self.log.push(action)
+ self.log.commit()
class ProjectManager(Signallable, Loggable):
__signals__ = {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]