diff --git a/gramps/src/GrampsCfg.py b/gramps/src/GrampsCfg.py index 11d49d72d..db57fa3a5 100644 --- a/gramps/src/GrampsCfg.py +++ b/gramps/src/GrampsCfg.py @@ -359,11 +359,17 @@ def get_int(key,defval=0): else: return defval +def set_int(key,value): + gnome.config.set_int(key,value) + def set_bool(key,value): gnome.config.set_bool(key,value) def set_string(key,value): gnome.config.set_string(key,value) + +def sync(): + gnome.config.sync() #------------------------------------------------------------------------- # diff --git a/gramps/src/plugins/ReadGedcom.py b/gramps/src/plugins/ReadGedcom.py index 4893076ba..3f8d0fcca 100644 --- a/gramps/src/plugins/ReadGedcom.py +++ b/gramps/src/plugins/ReadGedcom.py @@ -135,7 +135,16 @@ def importData(database, filename, cb=None): gnome.ui.GnomeErrorDialog(_("%s could not be opened\n") % filename) return - close = g.parse_gedcom_file() + try: + close = g.parse_gedcom_file() + except GedcomParser.BadFile, msg: + Utils.destroy_passed_object(statusWindow) + gnome.ui.GnomeErrorDialog(_("Failure reading %s: %s\n" + "First line should have been '0 HEAD'\n" + "but was '%s'") % + (filename,GedcomParser.BadFile,msg)) + return + g.resolve_refns() statusTop.get_widget("close").set_sensitive(1)