diff --git a/ChangeLog b/ChangeLog index fe264ba09..53f649932 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2007-06-17 Alex Roitman * src/plugins/Verify.py: Clarification in wording: #1071. + * src/GrampsCfg.py (NameFormatEditDlg.cb_format_changed): Catch + exception when format string is invalid. 2007-06-16 Don Allingham * src/DbManager.py: add user sorting to manager lists diff --git a/src/GrampsCfg.py b/src/GrampsCfg.py index e1ed9a43c..f6664a560 100644 --- a/src/GrampsCfg.py +++ b/src/GrampsCfg.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2006 Donald N. Allingham +# Copyright (C) 2000-2007 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -626,8 +626,10 @@ class NameFormatEditDlg: return (self.response, self.fmt_name, self.fmt_str) def cb_format_changed(self,obj): - t = (_nd.format_str(self.name,obj.get_text())) - self.examplelabel.set_text('%s' % t) + try: + t = (_nd.format_str(self.name,obj.get_text())) + except ValueError, msg: + t = _("Invalid format string: %s") % msg + self.examplelabel.set_text( + '%s' % t) self.examplelabel.set_use_markup(True) - -