From 9e56adc00651fc597beff80e594accbfbf36644f Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Mon, 13 Oct 2003 03:26:05 +0000 Subject: [PATCH] * src/FamilyView.py (new_spouse_after_edit): Rename function (used to be called spouse_after_edit); (add_spouse): Call new_spouse_after_edit. (spouse_after_edit): Add function to be called after editing existing spouse's personal data. Takes care of display issues only; (new_child_after_edit): Rename function (used to be called child_after_edit); (add_child_clicked): Call new_child_after_edit. (edit_relationship): Change callback to get consistent behavior. svn: r2245 --- ChangeLog | 9 +++++++++ src/FamilyView.py | 25 +++++++++++++++++++------ 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index b6393dfcb..820c907cc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,15 @@ * src/gramps_main.py: Likewise. * src/Makefile.am, src/Makefile.in: Ship src/ArgHandler.py. * NEWS: More items. + * src/FamilyView.py (new_spouse_after_edit): Rename function (used + to be called spouse_after_edit); + (add_spouse): Call new_spouse_after_edit. + (spouse_after_edit): Add function to be called after editing existing + spouse's personal data. Takes care of display issues only; + (new_child_after_edit): Rename function (used to be called + child_after_edit); + (add_child_clicked): Call new_child_after_edit. + (edit_relationship): Change callback to get consistent behavior. 2003-10-12 Don Allingham * src/RelLib.py : support for capitalized name formats diff --git a/src/FamilyView.py b/src/FamilyView.py index 7ce39bc40..4ced05c4b 100644 --- a/src/FamilyView.py +++ b/src/FamilyView.py @@ -403,9 +403,10 @@ class FamilyView: def edit_relationship(self,obj,event): if event.state & gtk.gdk.SHIFT_MASK and \ - event.type == gtk.gdk.BUTTON_PRESS and \ - event.button == 1 and self.selected_spouse: - self.parent.load_person(self.selected_spouse) + event.type == gtk.gdk.BUTTON_PRESS and \ + event.button == 1 and self.selected_spouse: + self.edit_spouse_callback(None) + elif event.type == gtk.gdk.BUTTON_PRESS and event.button == 3: if self.selected_spouse: self.build_spouse_menu() @@ -443,11 +444,23 @@ class FamilyView: else: person.setGender(RelLib.Person.male) try: - EditPerson.EditPerson(person, self.parent.db, self.spouse_after_edit) + EditPerson.EditPerson(person, self.parent.db, self.new_spouse_after_edit) except: DisplayTrace.DisplayTrace() def spouse_after_edit(self,epo,plist): + ap = self.parent.active_person + if epo: + self.parent.db.buildPersonDisplay(epo.person.getId(),epo.original_id) + self.parent.people_view.remove_from_person_list(epo.person,epo.original_id) + self.parent.people_view.redisplay_person_list(epo.person) + for p in plist: + self.parent.place_view.new_place_after_edit(p) + + self.parent.active_person = ap + self.load_family(self.family) + + def new_spouse_after_edit(self,epo,plist): if epo.person.getId() == "": self.parent.db.addPerson(epo.person) else: @@ -491,7 +504,7 @@ class FamilyView: person.getPrimaryName().setSurnamePrefix(name[0]) try: - EditPerson.EditPerson(person, self.parent.db, self.child_after_edit) + EditPerson.EditPerson(person, self.parent.db, self.new_child_after_edit) except: DisplayTrace.DisplayTrace() @@ -509,7 +522,7 @@ class FamilyView: self.parent.update_person_list(person) self.load_family(self.family) - def child_after_edit(self,epo,plist): + def new_child_after_edit(self,epo,plist): if epo.person.getId() == "": self.parent.db.addPerson(epo.person)