* 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
This commit is contained in:
Alex Roitman 2005-02-25 17:06:04 +00:00
parent e67a66bf5a
commit 4c2ea76b9f
4 changed files with 29 additions and 7 deletions

View File

@ -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 <shura@alex.neuro.umn.edu>
* src/MediaView.py (on_select_row): Add garbage collection call.

View File

@ -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)

View File

@ -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())

View File

@ -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]