enable custom filters in reports to select the center person
This commit is contained in:
parent
90a513effa
commit
cdf6e0e3a3
@ -565,8 +565,8 @@ class CalendarOptions(MenuReportOptions):
|
||||
person = self.__db.get_person_from_gramps_id(gid)
|
||||
nfv = self._nf.get_value()
|
||||
filter_list = utils.get_person_filters(person,
|
||||
include_single=False,
|
||||
name_format=nfv)
|
||||
include_single=False,
|
||||
name_format=nfv)
|
||||
self.__filter.set_filters(filter_list)
|
||||
|
||||
def __filter_changed(self):
|
||||
@ -575,12 +575,11 @@ class CalendarOptions(MenuReportOptions):
|
||||
disable the person option
|
||||
"""
|
||||
filter_value = self.__filter.get_value()
|
||||
if filter_value in [1, 2, 3, 4]:
|
||||
# Filters 1, 2, 3 and 4 rely on the center person
|
||||
self.__pid.set_available(True)
|
||||
else:
|
||||
# The rest don't
|
||||
if filter_value == 0: # "Entire Database" (as "include_single=False")
|
||||
self.__pid.set_available(False)
|
||||
else:
|
||||
# The other filters need a center person (assume custom ones too)
|
||||
self.__pid.set_available(True)
|
||||
|
||||
def make_my_style(self, default_style, name, description,
|
||||
size=9, font=FONT_SERIF, justified ="left",
|
||||
|
@ -1102,7 +1102,7 @@ class StatisticsChartOptions(MenuReportOptions):
|
||||
if filter_value == 0: # "Entire Database" (as "include_single=False")
|
||||
self.__pid.set_available(False)
|
||||
else:
|
||||
# The other filters need a center person (assume custom ones do)
|
||||
# The other filters need a center person (assume custom ones too)
|
||||
self.__pid.set_available(True)
|
||||
|
||||
def make_default_style(self, default_style):
|
||||
|
@ -452,8 +452,8 @@ class TimeLineOptions(MenuReportOptions):
|
||||
person = self.__db.get_person_from_gramps_id(gid)
|
||||
nfv = self._nf.get_value()
|
||||
filter_list = utils.get_person_filters(person,
|
||||
include_single=False,
|
||||
name_format=nfv)
|
||||
include_single=False,
|
||||
name_format=nfv)
|
||||
self.__filter.set_filters(filter_list)
|
||||
|
||||
def __filter_changed(self):
|
||||
@ -462,12 +462,11 @@ class TimeLineOptions(MenuReportOptions):
|
||||
disable the person option
|
||||
"""
|
||||
filter_value = self.__filter.get_value()
|
||||
if filter_value in [1, 2, 3, 4]:
|
||||
# Filters 1, 2, 3 and 4 rely on the center person
|
||||
self.__pid.set_available(True)
|
||||
else:
|
||||
# The rest don't
|
||||
if filter_value == 0: # "Entire Database" (as "include_single=False")
|
||||
self.__pid.set_available(False)
|
||||
else:
|
||||
# The other filters need a center person (assume custom ones too)
|
||||
self.__pid.set_available(True)
|
||||
|
||||
def make_default_style(self, default_style):
|
||||
"""Make the default output style for the Timeline report."""
|
||||
|
@ -829,8 +829,8 @@ class RelGraphOptions(MenuReportOptions):
|
||||
person = self.__db.get_person_from_gramps_id(gid)
|
||||
nfv = self._nf.get_value()
|
||||
filter_list = utils.get_person_filters(person,
|
||||
include_single=False,
|
||||
name_format=nfv)
|
||||
include_single=False,
|
||||
name_format=nfv)
|
||||
self.__filter.set_filters(filter_list)
|
||||
|
||||
def __filter_changed(self):
|
||||
@ -838,15 +838,14 @@ class RelGraphOptions(MenuReportOptions):
|
||||
Handle filter change. If the filter is not specific to a person,
|
||||
disable the person option
|
||||
"""
|
||||
if self.__show_relships and self.__show_relships.get_value():
|
||||
self.__pid.set_available(True)
|
||||
filter_value = self.__filter.get_value()
|
||||
if filter_value in [1, 2, 3, 4]:
|
||||
# Filters 1, 2, 3 and 4 rely on the center person
|
||||
self.__pid.set_available(True)
|
||||
elif self.__show_relships and self.__show_relships.get_value():
|
||||
self.__pid.set_available(True)
|
||||
else:
|
||||
# The rest don't
|
||||
if filter_value == 0: # "Entire Database" (as "include_single=False")
|
||||
self.__pid.set_available(False)
|
||||
else:
|
||||
# The other filters need a center person (assume custom ones too)
|
||||
self.__pid.set_available(True)
|
||||
|
||||
def __image_changed(self):
|
||||
"""
|
||||
|
@ -526,7 +526,7 @@ class BirthdayOptions(MenuReportOptions):
|
||||
if filter_value == 0: # "Entire Database" (as "include_single=False")
|
||||
self.__pid.set_available(False)
|
||||
else:
|
||||
# The other filters need a center person (assume custom ones do)
|
||||
# The other filters need a center person (assume custom ones too)
|
||||
self.__pid.set_available(True)
|
||||
|
||||
def make_my_style(self, default_style, name, description,
|
||||
|
@ -821,7 +821,7 @@ class FamilyGroupOptions(MenuReportOptions):
|
||||
if filter_value == 1: # "Entire Database" (as "include_single=True")
|
||||
self.__fid.set_available(False)
|
||||
else:
|
||||
# The other filters need a center family (assume custom ones do)
|
||||
# The other filters need a center family (assume custom ones too)
|
||||
self.__fid.set_available(True)
|
||||
|
||||
# only allow recursion if the center family is the only family
|
||||
|
@ -1130,8 +1130,8 @@ class IndivCompleteOptions(MenuReportOptions):
|
||||
person = self.__db.get_person_from_gramps_id(gid)
|
||||
nfv = self._nf.get_value()
|
||||
filter_list = utils.get_person_filters(person,
|
||||
include_single=True,
|
||||
name_format=nfv)
|
||||
include_single=True,
|
||||
name_format=nfv)
|
||||
self.__filter.set_filters(filter_list)
|
||||
|
||||
def __filter_changed(self):
|
||||
@ -1140,12 +1140,11 @@ class IndivCompleteOptions(MenuReportOptions):
|
||||
disable the person option
|
||||
"""
|
||||
filter_value = self.__filter.get_value()
|
||||
if filter_value in [0, 2, 3, 4, 5]:
|
||||
# Filters 0, 2, 3, 4 and 5 rely on the center person
|
||||
self.__pid.set_available(True)
|
||||
else:
|
||||
# The rest don't
|
||||
if filter_value == 1: # "Entire Database" (as "include_single=True")
|
||||
self.__pid.set_available(False)
|
||||
else:
|
||||
# The other filters need a center person (assume custom ones too)
|
||||
self.__pid.set_available(True)
|
||||
|
||||
def __sources_changed(self):
|
||||
"""
|
||||
|
@ -293,7 +293,7 @@ class RecordsReportOptions(MenuReportOptions):
|
||||
if filter_value == 0: # "Entire Database" (as "include_single=False")
|
||||
self.__pid.set_available(False)
|
||||
else:
|
||||
# The other filters need a center person (assume custom ones do)
|
||||
# The other filters need a center person (assume custom ones too)
|
||||
self.__pid.set_available(True)
|
||||
|
||||
def make_default_style(self, default_style):
|
||||
|
@ -197,12 +197,11 @@ class SortEventOptions(MenuToolOptions):
|
||||
disable the person option
|
||||
"""
|
||||
filter_value = self.__filter.get_value()
|
||||
if filter_value in [1, 2, 3, 4]:
|
||||
# Filters 1, 2, 3 and 4 rely on the center person
|
||||
self.__pid.set_available(True)
|
||||
else:
|
||||
# The rest don't
|
||||
if filter_value == 0: # "Entire Database" (as "include_single=False")
|
||||
self.__pid.set_available(False)
|
||||
else:
|
||||
# The other filters need a center person (assume custom ones too)
|
||||
self.__pid.set_available(True)
|
||||
|
||||
def __update_filters(self):
|
||||
"""
|
||||
@ -210,5 +209,5 @@ class SortEventOptions(MenuToolOptions):
|
||||
"""
|
||||
gid = self.__pid.get_value()
|
||||
person = self.__db.get_person_from_gramps_id(gid)
|
||||
filter_list = utils.get_person_filters(person, False)
|
||||
filter_list = utils.get_person_filters(person, include_single=False)
|
||||
self.__filter.set_filters(filter_list)
|
||||
|
@ -10073,7 +10073,7 @@ class NavWebOptions(MenuReportOptions):
|
||||
"""
|
||||
gid = self.__pid.get_value()
|
||||
person = self.__db.get_person_from_gramps_id(gid)
|
||||
filter_list = utils.get_person_filters(person, False)
|
||||
filter_list = utils.get_person_filters(person, include_single=False)
|
||||
self.__filter.set_filters(filter_list)
|
||||
|
||||
def __filter_changed(self):
|
||||
@ -10082,12 +10082,11 @@ class NavWebOptions(MenuReportOptions):
|
||||
disable the person option
|
||||
"""
|
||||
filter_value = self.__filter.get_value()
|
||||
if filter_value in [1, 2, 3, 4]:
|
||||
# Filters 1, 2, 3 and 4 rely on the center person
|
||||
self.__pid.set_available(True)
|
||||
else:
|
||||
# The rest don't
|
||||
if filter_value == 0: # "Entire Database" (as "include_single=False")
|
||||
self.__pid.set_available(False)
|
||||
else:
|
||||
# The other filters need a center person (assume custom ones too)
|
||||
self.__pid.set_available(True)
|
||||
|
||||
def __stylesheet_changed(self):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user