From 4c2ea76b9f45180af31586a420f24dab096aca14 Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Fri, 25 Feb 2005 17:06:04 +0000 Subject: [PATCH] * src/gramps_main.py (undo_callback): Enable underscore in a label. * src/NameDisplay (display_name): Return empty string for None. * src/NameEdit.py (__init__): Compare displayed name with empty string, (update_group_as): Only query grouping for existing name. svn: r4093 --- ChangeLog | 4 ++++ src/NameDisplay.py | 16 ++++++++++++++-- src/NameEdit.py | 15 ++++++++++----- src/gramps_main.py | 1 + 4 files changed, 29 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index dcd8c3a97..98fc8d6d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,10 @@ * src/Sources.py (SourceEditor.update_display): Do not add source for the second time. * src/EditPerson.py (EditPerson.__init__): Correct widget names. + * src/gramps_main.py (undo_callback): Enable underscore in a label. + * src/NameDisplay (display_name): Return empty string for None. + * src/NameEdit.py (__init__): Compare displayed name with empty string, + (update_group_as): Only query grouping for existing name. 2005-02-24 Alex Roitman * src/MediaView.py (on_select_row): Add garbage collection call. diff --git a/src/NameDisplay.py b/src/NameDisplay.py index 8ae541bba..d0b3e0563 100644 --- a/src/NameDisplay.py +++ b/src/NameDisplay.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2004 Donald N. Allingham +# Copyright (C) 2004-2005 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 @@ -32,8 +32,18 @@ Class handling language-specific displaying of names. import os import locale +#------------------------------------------------------------------------- +# +# GRAMPS modules +# +#------------------------------------------------------------------------- import RelLib +#------------------------------------------------------------------------- +# +# NameDisplay class +# +#------------------------------------------------------------------------- class NameDisplay: """ Base class for displaying of Name instances. @@ -122,7 +132,9 @@ class NameDisplay: @returns: Returns the L{RelLib.Name} string representation @rtype: str """ - if name.display_as == RelLib.Name.LNFN: + if name == None: + return "" + elif name.display_as == RelLib.Name.LNFN: return self._lnfn(name) else: return self._fnln(name) diff --git a/src/NameEdit.py b/src/NameEdit.py index a468859b8..399bda8ee 100644 --- a/src/NameEdit.py +++ b/src/NameEdit.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2004 Donald N. Allingham +# Copyright (C) 2000-2005 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 @@ -20,6 +20,13 @@ # $Id$ +#------------------------------------------------------------------------- +# +# Standard python modules +# +#------------------------------------------------------------------------- +from gettext import gettext as _ + #------------------------------------------------------------------------- # # GTK/Gnome modules @@ -40,8 +47,6 @@ import Sources import RelLib import NameDisplay -from gettext import gettext as _ - #------------------------------------------------------------------------- # # NameEditor class @@ -102,7 +107,7 @@ class NameEditor: alt_title = self.top.get_widget("title") - if full_name == ", ": + if full_name == "": tmsg = _("Name Editor") else: tmsg = _("Name Editor for %s") % full_name @@ -161,7 +166,7 @@ class NameEditor: def update_group_as(self,obj): if not self.group_over.get_active(): - if self.name.get_group_as() != self.name.get_surname(): + if self.name and self.name.get_group_as() != self.name.get_surname(): val = self.name.get_group_as() else: val = self.db.get_name_group_mapping(self.surname_field.get_text()) diff --git a/src/gramps_main.py b/src/gramps_main.py index 434d84503..0a17355b2 100755 --- a/src/gramps_main.py +++ b/src/gramps_main.py @@ -459,6 +459,7 @@ class Gramps: if text == None: self.undolabel.set_sensitive(0) self.undolabel.get_children()[0].set_text(_("_Undo")) + self.undolabel.get_children()[0].set_use_underline(1) else: self.undolabel.set_sensitive(1) label = self.undolabel.get_children()[0]