* src/NameEdit.py: integrate patches from Julio Sanchez to

fix surname prefix
* src/FamilyView.py: Handle add person post processing properly


svn: r3604
This commit is contained in:
Don Allingham 2004-10-07 17:48:29 +00:00
parent 2240ae6ef5
commit 9aded03912
3 changed files with 27 additions and 13 deletions

View File

@ -1,3 +1,8 @@
2004-10-07 Don Allingham <dallingham@users.sourceforge.net>
* src/NameEdit.py: integrate patches from Julio Sanchez to
fix surname prefix
* src/FamilyView.py: Handle add person post processing properly
2004-10-07 Alex Roitman <shura@alex.neuro.umn.edu>
* src/EventEdit.py (update_event): Typo.

View File

@ -624,21 +624,23 @@ class FamilyView:
except:
DisplayTrace.DisplayTrace()
def spouse_after_edit(self,epo,trans):
def spouse_after_edit(self,epo,val):
ap = self.parent.active_person
if epo:
self.parent.db.commit_person(epo.person,trans)
n = epo.person.get_primary_name().get_regular_name()
self.parent.db.transaction_commit(trans,_("Add Person (%s)") % n)
#trans = self.parent.db.transaction_begin()
#self.parent.db.commit_person(epo.person,trans)
#n = epo.person.get_primary_name().get_regular_name()
#self.parent.db.transaction_commit(trans,_("Add Spouse (%s)") % n)
self.parent.people_view.remove_from_person_list(epo.person)
self.parent.people_view.redisplay_person_list(epo.person)
self.parent.active_person = ap
self.load_family(self.family)
def new_spouse_after_edit(self,epo,trans):
def new_spouse_after_edit(self,epo,val):
self.parent.db.add_person(epo.person,trans)
#self.parent.db.add_person(epo.person,trans)
trans = self.parent.db.transaction_begin()
self.family = RelLib.Family()
self.parent.db.add_family(self.family,trans)
@ -658,7 +660,8 @@ class FamilyView:
self.parent.db.commit_family(self.family,trans)
self.load_family(self.family)
self.parent.db.transaction_commit(trans,_("Add Spouse"))
m = Marriage.Marriage(self.parent,self.family,self.parent.db,
self.parent.new_after_edit,
self.load_family)
@ -708,11 +711,8 @@ class FamilyView:
self.parent.db.commit_family(self.family,trans)
self.parent.db.transaction_commit(trans,_("Modify family"))
def new_child_after_edit(self,epo,trans):
self.parent.db.add_person(epo.person,trans)
self.parent.people_view.add_to_person_list(epo.person,0)
def new_child_after_edit(self,epo,value):
trans = self.parent.db.transaction_begin()
if not self.family:
self.family = RelLib.Family()
self.parent.db.add_family(self.family,trans)
@ -726,6 +726,7 @@ class FamilyView:
epo.person.add_parent_family_handle(self.family.get_handle(),"Birth","Birth")
self.parent.db.commit_person(epo.person,trans)
self.parent.db.commit_family(self.family,trans)
self.parent.db.transaction_commit(trans,_("Add Child to Family"))
self.display_marriage(self.family)
def select_child_clicked(self,obj):

View File

@ -74,6 +74,7 @@ class NameEditor:
AutoComp.fill_combo(self.combo,self.parent.db.get_surname_list())
self.surname_field = self.combo.get_child()
self.prefix_field = self.top.get_widget("alt_prefix")
self.type_combo = self.top.get_widget("name_type")
self.note_field = self.top.get_widget("alt_note")
@ -128,6 +129,7 @@ class NameEditor:
self.surname_field.set_text(name.get_surname())
self.title_field.set_text(name.get_title())
self.suffix_field.set_text(name.get_suffix())
self.prefix_field.set_text(name.get_surname_prefix())
self.type_field.set_text(_(name.get_type()))
self.priv.set_active(name.get_privacy())
if name.get_note():
@ -221,6 +223,7 @@ class NameEditor:
first = unicode(self.given_field.get_text())
last = unicode(self.surname_field.get_text())
title = unicode(self.title_field.get_text())
prefix = unicode(self.prefix_field.get_text())
suffix = unicode(self.suffix_field.get_text())
note = unicode(self.note_buffer.get_text(self.note_buffer.get_start_iter(),
self.note_buffer.get_end_iter(),gtk.FALSE))
@ -246,7 +249,12 @@ class NameEditor:
if self.name.get_display_as() != self.display_as.get_active():
self.name.set_display_as(self.display_as.get_active())
self.parent.lists_changed = 1
prefix = unicode(self.prefix_field.get_text())
if self.name.get_surname_prefix() != prefix:
self.name.set_surname_prefix(prefix)
self.parent.lists_changed = 1
if self.name.get_sort_as() != self.sort_as.get_active():
self.name.set_sort_as(self.sort_as.get_active())
self.parent.lists_changed = 1