Fix menus when db fails to open due to upgrade/downgrade etc.

Fixes #11604
This commit is contained in:
prculley 2020-07-03 16:41:15 -05:00 committed by Paul Culley
parent 97923e7530
commit f7be7ab63f

View File

@ -958,7 +958,6 @@ class ViewManager(CLIManager):
self.dbstate.db.close(user=self.user)
(filename, title) = value
self.db_loader.read_file(filename)
if self.dbstate.db.is_open():
self._post_load_newdb(filename, 'x-directory/normal', title)
else:
if dialog.after_change != "":
@ -1009,6 +1008,11 @@ class ViewManager(CLIManager):
if title:
name = title
isopen = self.dbstate.is_open()
if not isopen:
rw = False
msg = "Gramps"
else:
rw = not self.dbstate.db.readonly
if rw:
msg = "%s - Gramps" % name
@ -1032,7 +1036,7 @@ class ViewManager(CLIManager):
config.set('behavior.runcheck', False)
self.__change_page(self.notebook.get_current_page())
self.uimanager.set_actions_visible(self.actiongroup, rw)
self.uimanager.set_actions_visible(self.readonlygroup, True)
self.uimanager.set_actions_visible(self.readonlygroup, isopen)
self.uimanager.set_actions_visible(self.undoactions, rw)
self.uimanager.set_actions_visible(self.redoactions, rw)