3603: Make family option in reports default to the active family
svn: r14553
This commit is contained in:
parent
049698426e
commit
01c80b19db
@ -536,12 +536,18 @@ class GuiFamilyOption(gtk.HBox):
|
|||||||
|
|
||||||
def __initialize_family(self):
|
def __initialize_family(self):
|
||||||
"""
|
"""
|
||||||
Find a family to initialize the option with. Any family will do, but
|
Find a family to initialize the option with. If there is no active
|
||||||
try to find a family that the user is likely interested in.
|
family, try to find a family that the user is likely interested in.
|
||||||
"""
|
"""
|
||||||
family_list = []
|
family_list = []
|
||||||
|
|
||||||
# First try the family of the active person
|
# 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_handle = self.__uistate.get_active('Person')
|
||||||
person = self.__dbstate.db.get_person_from_handle(person_handle)
|
person = self.__dbstate.db.get_person_from_handle(person_handle)
|
||||||
if person:
|
if person:
|
||||||
@ -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
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user