restore missing (since January) "import statistics" dialog

This commit is contained in:
Paul Franklin 2017-05-22 12:42:23 -07:00
parent f035196b6c
commit b38f68496f
3 changed files with 14 additions and 3 deletions

View File

@ -127,7 +127,11 @@ class DbLoader(CLIDbLoader):
if not warn_dialog.run():
return False
GrampsImportFileDialog(self.dbstate, self.uistate)
GrampsImportFileDialog(self.dbstate, self.uistate,
callback=self.set_info)
def set_info(self, info):
self.import_info = info
def import_info_text(self):
"""
@ -378,7 +382,7 @@ def format_maker():
class GrampsImportFileDialog(ManagedWindow):
def __init__(self, dbstate, uistate):
def __init__(self, dbstate, uistate, callback=None):
"""
A dialog to import a file into Gramps
"""
@ -426,7 +430,8 @@ class GrampsImportFileDialog(ManagedWindow):
# the import_dialog.run() makes it modal, so any change to that
# line would require the ManagedWindow.__init__ to be changed also
response = import_dialog.run()
if response in (Gtk.ResponseType.CANCEL, Gtk.ResponseType.DELETE_EVENT):
if response in (Gtk.ResponseType.CANCEL,
Gtk.ResponseType.DELETE_EVENT):
break
elif response == Gtk.ResponseType.OK:
filename = import_dialog.get_filename()
@ -450,6 +455,8 @@ class GrampsImportFileDialog(ManagedWindow):
plugin.get_import_function(),
filename)
self.close()
if callback is not None:
callback(self.import_info)
return
# Finally, we give up and declare this an unknown format

View File

@ -149,4 +149,6 @@ def importData(database, filename, user):
except GedcomError as msg:
user.notify_error(_('Error reading GEDCOM file'), str(msg))
return
## a "GEDCOM import report" happens in GedcomParser so this is not needed:
## (but the imports_test.py unittest currently requires it, so here it is)
return ImportInfo({_("Results"): _("done")})

View File

@ -71,6 +71,8 @@ def importData(database, filename, user):
except GrampsImportError as msg:
user.notify_error(_("%s could not be opened\n") % filename, str(msg))
return
## a "VCARD import report" happens in VCardParser so this is not needed:
## (but the imports_test.py unittest currently requires it, so here it is)
return ImportInfo({_("Results"): _("done")})