From 61ef781898485a7836101ced52c916d8458fb40c Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Sun, 15 Feb 2004 02:33:44 +0000 Subject: [PATCH] * src/Marriage.py: fix title and places * src/FamilyView.py: fix child relations and spouse's parents svn: r2829 --- src/FamilyView.py | 4 ++-- src/Marriage.py | 29 ++++++++++++++++++++++------- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/src/FamilyView.py b/src/FamilyView.py index ea3f6dfb2..19eb8126c 100644 --- a/src/FamilyView.py +++ b/src/FamilyView.py @@ -928,7 +928,7 @@ class FamilyView: if not family: return - if family.get_father_id() == self.person: + if family.get_father_id() == self.person.get_id(): self.selected_spouse = self.parent.db.find_person_from_id(family.get_mother_id()) else: self.selected_spouse = self.parent.db.find_person_from_id(family.get_father_id()) @@ -948,7 +948,7 @@ class FamilyView: child = self.parent.db.find_person_from_id(child_id) for fam in child.get_parent_family_id_list(): - if fam[0] == family: + if fam[0] == family.get_id(): if self.person == family.get_father_id(): status = "%s/%s" % (_(fam[2]),_(fam[1])) else: diff --git a/src/Marriage.py b/src/Marriage.py index f1f7fb4e1..f2108e194 100644 --- a/src/Marriage.py +++ b/src/Marriage.py @@ -122,8 +122,12 @@ class Marriage: "on_switch_page" : self.on_switch_page }) - title = _("%s and %s") % (GrampsCfg.nameof(family.get_father_id()), - GrampsCfg.nameof(family.get_mother_id())) + + father = self.db.find_person_from_id(family.get_father_id()) + mother = self.db.find_person_from_id(family.get_mother_id()) + + title = _("%s and %s") % (GrampsCfg.nameof(father), + GrampsCfg.nameof(mother)) Utils.set_title_label(self.top,title) @@ -410,7 +414,13 @@ class Marriage: self.etree.clear() self.emap = {} for data in self.elist: - iter = self.etree.add([const.display_fevent(data.get_name()),data.get_quote_date(),data.get_place_name()],data) + place_id = data.get_place_id() + if place_id: + place_name = self.db.find_place_from_id(place_id).get_title() + else: + place_name = "" + iter = self.etree.add([const.display_fevent(data.get_name()), + data.get_quote_date(),place_name],data) self.emap[str(data)] = iter if self.elist: self.etree.select_row(0) @@ -464,7 +474,7 @@ class Marriage: d.set(date) if Date.compare_dates(d,ord.get_date_object()) != 0 or \ ord.get_temple() != temple or \ - ord.get_place_id() != place or \ + ord.get_place_id() != place.get_id() or \ ord.get_status() != self.seal_stat: changed = 1 @@ -573,8 +583,8 @@ class Marriage: if ord.get_status() != self.seal_stat: ord.set_status(self.seal_stat) Utils.modified() - if ord.get_place_id() != place: - ord.set_place_id(place) + if ord.get_place_id() != place.get_id(): + ord.set_place_id(place.get_id()) Utils.modified() self.gallery.close(1) @@ -627,7 +637,12 @@ class Marriage: event = self.etree.get_object(iter) self.date_field.set_text(event.get_date()) - self.place_field.set_text(event.get_place_name()) + place_id = event.get_place_id() + if place_id: + place_name = self.db.find_place_from_id(place_id).get_title() + else: + place_name = u"" + self.place_field.set_text(place_name) self.cause_field.set_text(event.get_cause()) self.name_field.set_label(const.display_fevent(event.get_name())) if len(event.get_source_references()) > 0: