4198: Person view does not remove a row correctly when two people are merged.

This is a major patch by Michael Nauta. It means all writes happen immediately to bsddb, and the bsddb 
rollback is used on a crash. Transaction is no longer used to store changes and do them on commit.
Undo database is set on end. 
At the same time with statement is used throughout for transactions
At the same time, the original bug in merge code should be fixed
Still some issues, that will be ironed out


svn: r16523
This commit is contained in:
Benny Malengier
2011-01-31 21:54:58 +00:00
parent 28610b1ae3
commit 6d596ad987
49 changed files with 1842 additions and 1854 deletions

View File

@ -1500,14 +1500,14 @@ class RelationshipView(NavigationView):
family = self.dbstate.db.get_family_from_handle(family_handle)
family.add_child_ref(ref)
trans = self.dbstate.db.transaction_begin()
#add parentref to child
person.add_parent_family_handle(family_handle)
#default relationship is used
self.dbstate.db.commit_person(person, trans)
#add child to family
self.dbstate.db.commit_family(family, trans)
self.dbstate.db.transaction_commit(trans, _("Add Child to Family"))
with self.dbstate.db.transaction_begin(_("Add Child to Family")
) as trans:
#add parentref to child
person.add_parent_family_handle(family_handle)
#default relationship is used
self.dbstate.db.commit_person(person, trans)
#add child to family
self.dbstate.db.commit_family(family, trans)
def sel_child_to_fam(self, obj, event, handle, surname=None):
if button_activated(event, _LEFT_BUTTON):