From c3fb9c0c4e1e0e13fea3bf1a8afcf4aa8988cf16 Mon Sep 17 00:00:00 2001 From: Paul Franklin Date: Mon, 22 May 2017 06:17:26 -0700 Subject: [PATCH] restore missing (since January) "import statistics" dialog --- gramps/gui/dbloader.py | 13 ++++++++++--- gramps/plugins/importer/importgedcom.py | 4 +++- gramps/plugins/importer/importvcard.py | 4 +++- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/gramps/gui/dbloader.py b/gramps/gui/dbloader.py index b0710f1ae..2b15382e9 100644 --- a/gramps/gui/dbloader.py +++ b/gramps/gui/dbloader.py @@ -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 diff --git a/gramps/plugins/importer/importgedcom.py b/gramps/plugins/importer/importgedcom.py index 9e87136ee..f1d866f28 100644 --- a/gramps/plugins/importer/importgedcom.py +++ b/gramps/plugins/importer/importgedcom.py @@ -149,4 +149,6 @@ def importData(database, filename, user): except GedcomError as msg: user.notify_error(_('Error reading GEDCOM file'), str(msg)) return - return ImportInfo({_("Results"): _("done")}) + ## a "GEDCOM import report" happens in GedcomParser so this is not needed: + ## return ImportInfo({_("Results"): _("done")}) + return None diff --git a/gramps/plugins/importer/importvcard.py b/gramps/plugins/importer/importvcard.py index e8bbf2897..e8cb4684c 100644 --- a/gramps/plugins/importer/importvcard.py +++ b/gramps/plugins/importer/importvcard.py @@ -71,7 +71,9 @@ def importData(database, filename, user): except GrampsImportError as msg: user.notify_error(_("%s could not be opened\n") % filename, str(msg)) return - return ImportInfo({_("Results"): _("done")}) + ## a "VCARD import report" happens in VCardParser so this is not needed: + ## return ImportInfo({_("Results"): _("done")}) + return None def splitof_nameprefix(name):