2092: Problems when no database is open
This commit is contained in:
parent
235383e349
commit
33f8aa4d3d
@ -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, ))
|
||||
|
@ -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..."))
|
||||
|
Loading…
Reference in New Issue
Block a user