Skip to content

Commit f42103f

Browse files
committed
fix: refresh Family Events tab when participant is renamed
After editing a family member (eg the father) from within the Family editor and saving, the embedded Events tab must refresh to show the participant's current name in the "Main Participants" column. Currently, the person-update signal is routed to topdata_updated (editfamily.py:507), which calls load_data (editfamily.py:579–586) to refresh only the top father/mother panel. The embedded event list is never rebuilt, so its "Main Participants" column keeps showing the stale name. Route person-update to a new handler person_updated that calls both topdata_updated (preserving the existing top-panel refresh) and event_list.rebuild_callback (to rebuild the event-list model). This mirrors the pattern already used by the Children tab in the same editor (editfamily.py: 179, 185–190), which listens for person-update and calls rebuild. The fix reuses rebuild_callback, the same entry point that event-update already uses (eventembedlist.py:152–158), so no new API is introduced. Implementation spans two hunks in editfamily.py: signal mapping at line 509, and a new person_updated method at lines 588–602. A hasattr guard protects against person-update firing before _create_tabbed_pages constructs the tab. Fixes #8603 Signed-off-by: Eduard Ralph <eduard@ralphovi.net>
1 parent 0d9e148 commit f42103f

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

gramps/gui/editors/editfamily.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ def _connect_db_signals(self):
504504
"event-update": self.topdata_updated, # change eg birth event fath
505505
"event-rebuild": self.topdata_updated,
506506
"event-delete": self.topdata_updated, # delete eg birth event fath
507-
"person-update": self.topdata_updated, # change eg name of father
507+
"person-update": self.person_updated, # change eg name of father
508508
"person-delete": self.person_delete, # mother/father deleted?
509509
"person-rebuild": self._do_close,
510510
}
@@ -585,6 +585,22 @@ def topdata_updated(self, *obj):
585585
"""
586586
self.load_data()
587587

588+
def person_updated(self, *obj):
589+
"""
590+
Callback method called when a person shown in the family editor is
591+
updated (eg the name of the father or mother is changed and saved from
592+
within this dialog).
593+
594+
Besides the top father/mother panel (refreshed by load_data), the
595+
embedded Events tab renders participant names derived from the
596+
referenced persons in its "Main Participants" column. The event list
597+
only tracks event signals, not person-update, so it must be rebuilt
598+
here or that column keeps showing the participant's old name (bug 8603).
599+
"""
600+
self.topdata_updated()
601+
if hasattr(self, "event_list"):
602+
self.event_list.rebuild_callback()
603+
588604
def show_buttons(self):
589605
"""
590606
Used to reshow hidden/showing buttons.

0 commit comments

Comments
 (0)