From 38183c6024ab3b65ff48d12626653f2d4fb19b7c Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Wed, 9 Mar 2005 16:06:22 +0000 Subject: [PATCH] * src/PedView.py: Import RelLib for accessing relationship constants. * src/NameEdit.py: Use empty Date for newly created name. svn: r4143 --- gramps2/ChangeLog | 4 ++++ gramps2/src/NameEdit.py | 15 +++++++++------ gramps2/src/PedView.py | 14 +++++++++++++- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 10b5ea17a..df0312088 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,7 @@ +2005-03-09 Alex Roitman + * src/PedView.py: Import RelLib for accessing relationship constants. + * src/NameEdit.py: Use empty Date for newly created name. + 2005-03-08 Don Allingham * src/ChooseParents.py: change _nsort to _model * src/GrampsBSDDB.py: fix event secondary index function to that diff --git a/gramps2/src/NameEdit.py b/gramps2/src/NameEdit.py index 5669860e4..f19d49a2c 100644 --- a/gramps2/src/NameEdit.py +++ b/gramps2/src/NameEdit.py @@ -46,6 +46,7 @@ import AutoComp import Sources import RelLib import NameDisplay +import Date import DateEdit import DateHandler @@ -84,7 +85,14 @@ class NameEditor: self.patronymic_field = self.top.get_widget("patronymic") self.combo = self.top.get_widget("alt_surname_list") self.date = self.top.get_widget('date') - self.date_obj = self.name.get_date_object() + + if self.name: + self.srcreflist = self.name.get_source_references() + self.date_obj = self.name.get_date_object() + else: + self.srcreflist = [] + self.date_obj = Date.Date() + self.date.set_text(DateHandler.displayer.display(self.date_obj)) self.date_check = DateEdit.DateEdit( @@ -110,11 +118,6 @@ class NameEditor: AutoComp.fill_combo(self.type_combo,types) self.type_field = self.type_combo.get_child() - if self.name: - self.srcreflist = self.name.get_source_references() - else: - self.srcreflist = [] - full_name = NameDisplay.displayer.display_name(name) alt_title = self.top.get_widget("title") diff --git a/gramps2/src/PedView.py b/gramps2/src/PedView.py index e3e70d244..5fe5e6583 100644 --- a/gramps2/src/PedView.py +++ b/gramps2/src/PedView.py @@ -20,6 +20,13 @@ # $Id$ +#------------------------------------------------------------------------- +# +# Python modules +# +#------------------------------------------------------------------------- +from gettext import gettext as _ + #------------------------------------------------------------------------- # # GTK/Gnome modules @@ -40,10 +47,15 @@ except: # #------------------------------------------------------------------------- import GrampsCfg -from gettext import gettext as _ import Relationship import NameDisplay +import RelLib +#------------------------------------------------------------------------- +# +# Constants +# +#------------------------------------------------------------------------- _PAD = 3 _CANVASPAD = 3 _PERSON = "p"