2007-06-17 Alex Roitman <shura@gramps-project.org>
* src/GrampsCfg.py (NameFormatEditDlg.cb_format_changed): Catch exception when format string is invalid. svn: r8571
This commit is contained in:
		@@ -1,3 +1,7 @@
 | 
			
		||||
2007-06-17  Alex Roitman  <shura@gramps-project.org>
 | 
			
		||||
	* src/GrampsCfg.py (NameFormatEditDlg.cb_format_changed): Catch
 | 
			
		||||
	exception when format string is invalid.
 | 
			
		||||
 | 
			
		||||
2007-06-16  Alex Roitman  <shura@gramps-project.org>
 | 
			
		||||
	* src/gramps.py (run): Catch SystemExit exception.
 | 
			
		||||
	* src/ArgHandler.py: Use sys.exit() for bailing out.
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
@@ -610,8 +610,12 @@ 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('<span weight="bold" style="italic">%s</span>' % t)
 | 
			
		||||
        try:
 | 
			
		||||
            t = (_nd.format_str(self.name,obj.get_text()))
 | 
			
		||||
        except ValueError, msg:
 | 
			
		||||
            t = _("Invalid format string: %s") % msg
 | 
			
		||||
        self.examplelabel.set_text(
 | 
			
		||||
            '<span weight="bold" style="italic">%s</span>' % t)
 | 
			
		||||
        self.examplelabel.set_use_markup(True)
 | 
			
		||||
        
 | 
			
		||||
    
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user