diff --git a/gramps2/src/GrampsDb/__init__.py b/gramps2/src/GrampsDb/__init__.py index a0c614a25..fe85ca0b5 100644 --- a/gramps2/src/GrampsDb/__init__.py +++ b/gramps2/src/GrampsDb/__init__.py @@ -38,7 +38,7 @@ the database objects. Read the comments in _GrampsDBCallback.py for more information. """ -from _GrampsDbBase import DbState +from _GrampsDbBase import DbState, GrampsDbBase from _GrampsDbFactories import \ gramps_db_factory, \ diff --git a/gramps2/src/ViewManager.py b/gramps2/src/ViewManager.py index 57c35db53..87ce114d9 100644 --- a/gramps2/src/ViewManager.py +++ b/gramps2/src/ViewManager.py @@ -713,7 +713,7 @@ class ViewManager: def read_file(self,filename,callback=None): mode = "w" filename = os.path.normpath(os.path.abspath(filename)) - + if os.path.isdir(filename): ErrorDialog(_('Cannot open database'), _('The selected file is a directory, not ' @@ -736,6 +736,13 @@ class ViewManager: except: print "could not change directory" + + # emit the database change signal so the that models do not + # attempt to update the screen while we are loading the + # new data + + self.state.emit('database-changed',(GrampsDb.GrampsDbBase(),)) + try: if self.load_database(filename,callback,mode=mode): if filename[-1] == '/':