From 33f8aa4d3df5edaac2beeb457c5721d3c2d1f9db Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Thu, 28 Apr 2016 21:06:43 -0400 Subject: [PATCH] 2092: Problems when no database is open --- gramps/gen/dbstate.py | 7 +++++-- gramps/gui/viewmanager.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/gramps/gen/dbstate.py b/gramps/gen/dbstate.py index 078f4e40f..c2c192bea 100644 --- a/gramps/gen/dbstate.py +++ b/gramps/gen/dbstate.py @@ -65,7 +65,9 @@ class DbState(Callback): just a place holder until a real DB is assigned. """ Callback.__init__(self) - self.db = self.make_database("bsddb") + self.db = self.make_database("inmemorydb") + self.db.load(None) + self.db.db_is_open = False self.open = False self.stack = [] @@ -108,7 +110,8 @@ class DbState(Callback): """ self.emit('no-database', ()) self.db.close() - self.db = self.make_database("bsddb") + self.db = self.make_database("inmemorydb") + self.db.load(None) self.db.db_is_open = False self.open = False self.emit('database-changed', (self.db, )) diff --git a/gramps/gui/viewmanager.py b/gramps/gui/viewmanager.py index dd04c28ad..8f47be937 100644 --- a/gramps/gui/viewmanager.py +++ b/gramps/gui/viewmanager.py @@ -756,7 +756,7 @@ class ViewManager(CLIManager): """ Backup the current file as a backup file. """ - if self.dbstate.db.has_changed: + if self.dbstate.db.is_open() and self.dbstate.db.has_changed: self.uistate.set_busy_cursor(True) self.uistate.progress.show() self.uistate.push_message(self.dbstate, _("Autobackup..."))