3603: Make family option in reports default to the active family

svn: r14554
This commit is contained in:
Nick Hall 2010-03-01 19:20:13 +00:00
parent 3e907c7e85
commit a2e54ea390

View File

@ -541,11 +541,17 @@ class GuiFamilyOption(gtk.HBox):
""" """
family_list = [] family_list = []
# First try the family of the active person # Use the active family if one is selected
person_handle = self.__uistate.get_active('Person') family = self.__uistate.get_active('Family')
person = self.__dbstate.db.get_person_from_handle(person_handle) if family:
if person: family_list = [family]
family_list = person.get_family_handle_list()
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: if not family_list:
# Next try the family of the default person in the database. # 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(): for family in self.__db.iter_family_handles():
self.__update_family(family) self.__update_family(family)
break break
else:
self.__update_family(family_list[0])
def __get_family_clicked(self, obj): # IGNORE:W0613 - obj is unused def __get_family_clicked(self, obj): # IGNORE:W0613 - obj is unused
""" """