make report dialog height less than 600, for smaller displays [RR]

This commit is contained in:
Paul Franklin 2016-12-09 19:51:43 -08:00
parent 9b5ef6d069
commit 2087f807f3

View File

@ -235,6 +235,10 @@ class RecordsReportOptions(MenuReportOptions):
stdoptions.add_living_people_option(menu, category_name) stdoptions.add_living_people_option(menu, category_name)
stdoptions.add_localization_option(menu, category_name)
category_name = _("Content")
top_size = NumberOption(_("Number of ranks to display"), 3, 1, 100) top_size = NumberOption(_("Number of ranks to display"), 3, 1, 100)
menu.add_option(category_name, "top_size", top_size) menu.add_option(category_name, "top_size", top_size)
@ -250,12 +254,20 @@ class RecordsReportOptions(MenuReportOptions):
footer = StringOption(_("Footer text"), "") footer = StringOption(_("Footer text"), "")
menu.add_option(category_name, "footer", footer) menu.add_option(category_name, "footer", footer)
stdoptions.add_localization_option(menu, category_name) p_count = 0
for (text, varname, default) in RECORDS:
if varname.startswith('person'):
p_count += 1
p_half = p_count // 2
p_idx = 0
for (text, varname, default) in RECORDS: for (text, varname, default) in RECORDS:
option = BooleanOption(_(text), default) option = BooleanOption(_(text), default)
if varname.startswith('person'): if varname.startswith('person'):
category_name = _("Person Records") if p_idx >= p_half:
category_name = _("Person Records 2")
else:
category_name = _("Person Records 1")
p_idx += 1
elif varname.startswith('family'): elif varname.startswith('family'):
category_name = _("Family Records") category_name = _("Family Records")
menu.add_option(category_name, varname, option) menu.add_option(category_name, varname, option)
@ -278,12 +290,11 @@ class RecordsReportOptions(MenuReportOptions):
disable the person option disable the person option
""" """
filter_value = self.__filter.get_value() filter_value = self.__filter.get_value()
if filter_value in [1, 2, 3, 4]: if filter_value == 0: # "Entire Database" (as "include_single=False")
# Filters 1, 2, 3 and 4 rely on the center person
self.__pid.set_available(True)
else:
# The rest don't
self.__pid.set_available(False) self.__pid.set_available(False)
else:
# The other filters need a center person (assume custom ones do)
self.__pid.set_available(True)
def make_default_style(self, default_style): def make_default_style(self, default_style):