* src/EditPerson.py (__init__): Refresh person object from handle,

if handle exists.
* src/Marriage.py (__init__): Refresh family object from handle,
if handle exists.


svn: r4902
This commit is contained in:
Alex Roitman 2005-07-05 14:42:51 +00:00
parent 5de8d6b2ec
commit 139ae5c305
3 changed files with 20 additions and 5 deletions

@ -1,5 +1,9 @@
2005-07-05 Alex Roitman <shura@gramps-project.org>
* src/system_filters.xml: Remove testing contents.
* src/EditPerson.py (__init__): Refresh person object from handle,
if handle exists.
* src/Marriage.py (__init__): Refresh family object from handle,
if handle exists.
2005-07-03 Alex Roitman <shura@gramps-project.org>
* src/plugins/GraphViz.py (dump_person): Correctly test for birth

@ -99,12 +99,17 @@ class EditPerson:
self.dp = DateHandler.parser
self.dd = DateHandler.displayer
self.orig_handle = person.get_handle()
# UGLY HACK to refresh person object from handle if that exists
# done to ensure that the person object is not stale, as it could
# have been changed by something external (merge, tool, etc).
if self.orig_handle:
person = db.get_person_from_handle(self.orig_handle)
self.person = person
self.orig_surname = person.get_primary_name().get_group_name()
self.orig_surname = self.person.get_primary_name().get_group_name()
self.parent = parent
self.orig_handle = self.person.get_handle()
if self.parent.child_windows.has_key(self.orig_handle):
self.parent.child_windows[self.person.get_handle()].present(None)
self.parent.child_windows[self.orig_handle].present(None)
return
self.db = db
self.callback = callback

@ -79,10 +79,16 @@ class Marriage:
def __init__(self,parent,family,db):
"""Initializes the Marriage class, and displays the window"""
family_handle = family.get_handle()
# UGLY HACK to refresh faimly object from handle if that exists
# done to ensure that the family object is not stale, as it could
# have been changed by something external (merge, tool, etc).
if family_handle:
family = db.get_family_from_handle(family_handle)
self.family = family
self.parent = parent
if self.parent.child_windows.has_key(family.get_handle()):
self.parent.child_windows[family.get_handle()].present(None)
if self.parent.child_windows.has_key(family_handle):
self.parent.child_windows[family_handle].present(None)
return
self.child_windows = {}
self.db = db