From a2e54ea3905f8f8cb3feeddde1d05209108be66a Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Mon, 1 Mar 2010 19:20:13 +0000 Subject: [PATCH] 3603: Make family option in reports default to the active family svn: r14554 --- src/PluginUtils/_GuiOptions.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/PluginUtils/_GuiOptions.py b/src/PluginUtils/_GuiOptions.py index 53e088133..eb42d10d7 100644 --- a/src/PluginUtils/_GuiOptions.py +++ b/src/PluginUtils/_GuiOptions.py @@ -541,11 +541,17 @@ class GuiFamilyOption(gtk.HBox): """ family_list = [] - # First try the family of the active person - person_handle = self.__uistate.get_active('Person') - person = self.__dbstate.db.get_person_from_handle(person_handle) - if person: - family_list = person.get_family_handle_list() + # Use the active family if one is selected + family = self.__uistate.get_active('Family') + if family: + family_list = [family] + + if not family_list: + # Next try the family of the active person + person_handle = self.__uistate.get_active('Person') + person = self.__dbstate.db.get_person_from_handle(person_handle) + if person: + family_list = person.get_family_handle_list() if not family_list: # Next try the family of the default person in the database. @@ -558,6 +564,8 @@ class GuiFamilyOption(gtk.HBox): for family in self.__db.iter_family_handles(): self.__update_family(family) break + else: + self.__update_family(family_list[0]) def __get_family_clicked(self, obj): # IGNORE:W0613 - obj is unused """