From f98796432213235fdfb6d2b312116f87ca8ddb79 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Tue, 24 Aug 2004 04:14:08 +0000 Subject: [PATCH] * src/PeopleModel.py: enhanced column_spouse * src/RelLib.py: enhance probably_alive to check for "Cause of Death", "Burial", and "Cremation" events to indicate that a person is not alive. * src/const.py.in: add support for "Marriage Banns" * src/ReadXML.py: set last change time, support handles svn: r3499 --- gramps2/ChangeLog | 9 ++++++++- gramps2/src/PeopleModel.py | 27 ++++++++++++++------------- gramps2/src/const.py.in | 2 ++ 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index ad602237f..c21304a67 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,10 @@ +2004-08-23 Jim Smart + * src/PeopleModel.py: enhanced column_spouse + * src/RelLib.py: enhance probably_alive to check for "Cause + of Death", "Burial", and "Cremation" events to indicate that + a person is not alive. + * src/const.py.in: add support for "Marriage Banns" + 2004-08-23 Don Allingham * src/Utils.py: produce less line noise when generating handles @@ -13,7 +20,7 @@ * src/EditPerson.py: display last change timestamps * src/EditPlace.py: display last change timestamps * src/Marriage.py: display last change timestamps - * src/ReadXML.py: set last change time + * src/ReadXML.py: set last change time, support handles * src/gramps.glade: updates for last change display 2004-08-23 Alex Roitman diff --git a/gramps2/src/PeopleModel.py b/gramps2/src/PeopleModel.py index f0c692813..7f3553aa7 100644 --- a/gramps2/src/PeopleModel.py +++ b/gramps2/src/PeopleModel.py @@ -273,19 +273,20 @@ class PeopleModel(gtk.GenericTreeModel): return data[_NAME_COL].get_sort_name() def column_spouse(self,data): - id = data[0] - if data[_FAMILY_COL]: - fid = data[_FAMILY_COL][0] - else: - return u"" - d2 = self.db.family_map.get(str(fid)) - if fid and d2 : - if d2[1] == id: - return self.db.person_map.get(str(d2[2]))[_NAME_COL].get_name() - else: - return self.db.person_map.get(str(d2[1]))[_NAME_COL].get_name() - else: - return u"" + spouses_names = u"" + handle = data[0] + for family_handle in data[_FAMILY_COL]: + family = self.db.get_family_from_handle(family_handle) + for spouse_id in [family.get_father_handle(), family.get_mother_handle()]: + if not spouse_id: + continue + if spouse_id == handle: + continue + spouse = self.db.get_person_from_handle(spouse_id) + if len(spouses_names) > 0: + spouses_names += ", " + spouses_names += spouse.get_primary_name().get_regular_name() + return spouses_names def column_name(self,data): return data[_NAME_COL].get_name() diff --git a/gramps2/src/const.py.in b/gramps2/src/const.py.in index 9f3741859..46d804f47 100644 --- a/gramps2/src/const.py.in +++ b/gramps2/src/const.py.in @@ -234,6 +234,7 @@ familyConstantEvents = { "Divorce Filing" : "DIVF", "Divorce" : "DIV", "Engagement" : "ENGA", + "Marriage Banns" : "MARB", "Marriage Contract" : "MARC", "Marriage License" : "MARL", "Marriage Settlement" : "MARS", @@ -252,6 +253,7 @@ family_events = TransTable( { "Divorce Filing" : _("Divorce Filing"), "Divorce" : _("Divorce"), "Engagement" : _("Engagement"), + "Marriage Banns" : _("Marriage Banns"), "Marriage Contract" : _("Marriage Contract"), "Marriage License" : _("Marriage License"), "Marriage Settlement" : _("Marriage Settlement"),