2092: Problems when no database is open

This commit is contained in:
Doug Blank 2016-04-28 21:06:43 -04:00
parent 235383e349
commit 33f8aa4d3d
2 changed files with 6 additions and 3 deletions

View File

@ -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, ))

View File

@ -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..."))