From 7617b3f9fe7ab2d29f23babfa7bfbd1347253453 Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Mon, 3 Nov 2008 00:01:46 +0100 Subject: Add defaults only session loading --- portato/gui/windows/main.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'portato/gui/windows') diff --git a/portato/gui/windows/main.py b/portato/gui/windows/main.py index b76bb73..52786b3 100644 --- a/portato/gui/windows/main.py +++ b/portato/gui/windows/main.py @@ -704,6 +704,7 @@ class MainWindow (Window): self.load_session(e) except SessionException, e: warning(str(e)) + self.load_session(defaults_only = True) # last ressort splash(_("Finishing startup")) @@ -966,7 +967,7 @@ class MainWindow (Window): else: # no selCatName -> so no category selected --> ignore debug("No category selected --> should be no harm.") - def load_session(self, sessionEx = None): + def load_session(self, sessionEx = None, defaults_only = False): """ Loads the session data. """ @@ -979,7 +980,7 @@ class MainWindow (Window): oldVersion = SESSION_VERSION allowedVersions = (1,2) - if sessionEx and isinstance(sessionEx, SessionException): + if not defaults_only and sessionEx and isinstance(sessionEx, SessionException): if sessionEx.got in allowedVersions: info(_("Translating session from version %d to %d.") % (sessionEx.got, sessionEx.expected)) oldVersion = sessionEx.got @@ -1171,7 +1172,7 @@ class MainWindow (Window): self.session.add_handler(([(p.name.replace(" ","_"), "plugins")], load_plugin(p), save_plugin(p))) # now we have the handlers -> load - self.session.load() + self.session.load(defaults_only) def jump_to (self, cp, version = None): """ -- cgit v1.2.3-54-g00ecf