From 7d9dac90ff53288778be3d5ba74572192bb8fc6a Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Tue, 23 Nov 2010 06:03:14 +0000 Subject: [PATCH] 4413: Selecting a Family record does not cause the Relationship view to show that relationship svn: r16229 --- src/plugins/view/familyview.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/plugins/view/familyview.py b/src/plugins/view/familyview.py index c6629267d..474f9a585 100644 --- a/src/plugins/view/familyview.py +++ b/src/plugins/view/familyview.py @@ -181,6 +181,9 @@ class FamilyView(ListView): + + + @@ -197,6 +200,10 @@ class FamilyView(ListView): self.all_action = gtk.ActionGroup(self.title + "/FamilyAll") self.all_action.add_actions([ + ('MakeFatherActive', gtk.STOCK_APPLY, _("Make Father Active"), + None, None, self._make_father_active), + ('MakeMotherActive', gtk.STOCK_APPLY, _("Make Mother Active"), + None, None, self._make_mother_active), ('QuickReport', None, _("Quick View"), None, None, None), ('Dummy', None, ' ', None, None, self.dummy_report), ]) @@ -275,6 +282,26 @@ class FamilyView(ListView): import Merge Merge.MergeFamilies(self.dbstate, self.uistate, mlist[0], mlist[1]) + def _make_father_active(self, obj): + """ + Make the father of the family the active person. + """ + fhandle = self.first_selected() + if fhandle: + family = self.dbstate.db.get_family_from_handle(fhandle) + if family: + self.uistate.set_active(family.father_handle, 'Person') + + def _make_mother_active(self, obj): + """ + Make the mother of the family the active person. + """ + fhandle = self.first_selected() + if fhandle: + family = self.dbstate.db.get_family_from_handle(fhandle) + if family: + self.uistate.set_active(family.mother_handle, 'Person') + def dummy_report(self, obj): """ For the xml UI definition of popup to work, the submenu Quick Report must have an entry in the xml