From 2d3916792951b70fcb29ac8dc4a216af94f0b66f Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Tue, 14 Feb 2006 04:34:13 +0000 Subject: [PATCH] * src/EditPerson.py: don't double add a place svn: r5933 --- gramps2/ChangeLog | 3 +++ gramps2/src/EditPerson.py | 25 +++++++++++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index c895348e6..b44711426 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,6 @@ +2006-02-13 Don Allingham + * src/EditPerson.py: don't double add a place + 2006-02-13 Alex Roitman * src/ReportUtils.py (buried_partial_date_no_place): Typo. * src/ArgHandler.py (ArgHandler.cl_export): Do not strip path from diff --git a/gramps2/src/EditPerson.py b/gramps2/src/EditPerson.py index 81b8c6c8e..b92d3224a 100644 --- a/gramps2/src/EditPerson.py +++ b/gramps2/src/EditPerson.py @@ -1107,11 +1107,32 @@ class EditPerson: def event_edit_callback(self,event): """Birth and death events may not be in the map""" self.redraw_event_list() + self.update_pdmap(event) try: self.etree.select_iter(self.emap[str(event)]) except: pass + def update_pdmap(self,event): + p = event.get_place_handle() + if p: + place = self.db.get_place_from_handle(p) + self.pdmap[place.get_title()] = p + + def event_birth_callback(self,event): + """Birth and death events may not be in the map""" + self.update_birth = False + self.birth = event + self.update_birth_info() + self.update_pdmap(event) + + def event_death_callback(self,event): + """Birth and death events may not be in the map""" + self.update_death = False + self.death = event + self.update_death_info() + self.update_pdmap(event) + def attr_edit_callback(self,attr): self.redraw_attr_list() self.atree.select_iter(self.amap[str(attr)]) @@ -1212,7 +1233,7 @@ class EditPerson: if p: event.set_place_handle(p) EventEdit.PersonEventEditor(self,pname, event, def_placename, True, - self.event_edit_callback, noedit=self.db.readonly) + self.event_birth_callback, noedit=self.db.readonly) def on_edit_death_clicked(self,obj): """Brings up the EventEditor for the death record, event @@ -1229,7 +1250,7 @@ class EditPerson: if p: event.set_place_handle(p) EventEdit.PersonEventEditor(self, pname, event, def_placename, - True, self.event_edit_callback, + True, self.event_death_callback, noedit=self.db.readonly) def on_aka_delete_clicked(self,obj):