From 9726d358bda63a2e00c66e75a7c406d1f8b58c63 Mon Sep 17 00:00:00 2001 From: Gary Burton Date: Mon, 31 Dec 2007 19:23:16 +0000 Subject: [PATCH] 2007-12-31 Gary Burton * src/DataViews/RelationView.py: * src/Editors/_EditFamily.py: Add a signal handler for changes to events. bug #1416 and #1329. Also remove previous attempt at fixing #1416 now that I know a bit more about how signal handling works. svn: r9660 --- ChangeLog | 6 ++++++ src/DataViews/RelationView.py | 3 +++ src/Editors/_EditFamily.py | 14 ++++++-------- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index d28eb36e1..7ecaae777 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-12-31 Gary Burton + * src/DataViews/RelationView.py: + * src/Editors/_EditFamily.py: Add a signal handler for changes to events. + bug #1416 and #1329. Also remove previous attempt at fixing #1416 now that + I know a bit more about how signal handling works. + 2007-12-31 Douglas S. Blank * src/plugins/DefaultGadgets.py: added Date to environment * src/gen/lib/date.py: added new Date constructor type: Date(y,m,d) diff --git a/src/DataViews/RelationView.py b/src/DataViews/RelationView.py index 8b0c61d57..59c190bcc 100644 --- a/src/DataViews/RelationView.py +++ b/src/DataViews/RelationView.py @@ -161,6 +161,9 @@ class RelationshipView(PageView.PersonNavView): self.redraw() def connect_to_db(self, db): + # Add a signal to pick up event changes, bug #1416 + db.connect('event-update', self.family_update) + db.connect('person-update', self.person_update) db.connect('person-rebuild', self.person_rebuild) db.connect('family-update', self.family_update) diff --git a/src/Editors/_EditFamily.py b/src/Editors/_EditFamily.py index 9b9267365..d9d3ff05f 100644 --- a/src/Editors/_EditFamily.py +++ b/src/Editors/_EditFamily.py @@ -426,6 +426,9 @@ class EditFamily(EditPrimary): self._add_db_signal('family-update', self.check_for_family_change) self._add_db_signal('family-delete', self.check_for_close) + + # Add a signal pick up changes to events, bug #1329 + self._add_db_signal('event-update', self.event_updated) self.added = self.obj.handle == None if self.added: @@ -457,6 +460,9 @@ class EditFamily(EditPrimary): "database is not corrupted, GRAMPS has updated the family to " "reflect these changes. Any edits you have made may have been lost.")) + def event_updated(self, obj): + self.load_data() + def reload_people(self): fhandle = self.obj.get_father_handle() self.update_father(fhandle) @@ -942,14 +948,6 @@ class EditFamily(EditPrimary): else: self.db.commit_family(self.obj,trans) self.db.transaction_commit(trans,_("Edit Family")) - else: - # Signal an update to allow other windows that use family data to - # refresh. The family-update signal is normally only emitted when - # the family record itself changes, however the Relationship view - # needs to know to refresh when related data such as the marriage - # event may have been altered. - # Bug #1416 - self.db.emit('family-update', ([],)) self.close()