def add_menu_options(self, menu): """ Add options to the menu for the ancestor report. """ category_name = _("Report Options") pid = PersonOption(_("Center Person")) pid.set_help(_("The center person for the report")) menu.add_option(category_name, "pid", pid) maxgen = NumberOption(_("Generations"), 10, 1, 300) maxgen.set_help(_("The number of generations to include in the report")) menu.add_option(category_name, "maxgen", maxgen) Filleddigit = NumberOption(_("Filleddigit"), 10, 1, 50) Filleddigit.set_help(_("The number of digit after comma to include in the report for the percentage of ancestor found at a given generation")) menu.add_option(category_name, "Filleddigit", Filleddigit) Collapsedigit = NumberOption(_("Collapsedigit"), 10, 1, 50) Collapsedigit.set_help(_("The number of digit after comma to include in the report for the pedigree Collapse")) menu.add_option(category_name, "Collapsedigit", Collapsedigit) displayth = BooleanOption(_("Display theorical"), False) displayth.set_help(_("Display the theorical number of ancestor by generation")) menu.add_option(category_name, "Display theorical", displayth) trans = EnumeratedListOption(_("Translation"),"default") trans.add_item("default", _("English")) for language in get_available_translations(): trans.add_item(language, get_language_string(language)) trans.set_help(_("The translation to be used for the report.")) menu.add_option(category_name, "trans", trans)
def add_menu_options(self, menu): """ Add options to the menu for the ancestor report. """ category_name = _("Report Options") pid = PersonOption(_("Center Person")) pid.set_help(_("The center person for the report")) menu.add_option(category_name, "pid", pid) # We must figure out the value of the first option before we can # create the EnumeratedListOption fmt_list = global_name_display.get_name_format() name_format = EnumeratedListOption(_("Name format"), 0) name_format.add_item(0, _("Default")) for num, name, fmt_str, act in fmt_list: name_format.add_item(num, name) name_format.set_help(_("Select the format to display names")) menu.add_option(category_name, "name_format", name_format) maxgen = NumberOption(_("Generations"), 10, 1, 100) maxgen.set_help( _("The number of generations to include in the report")) menu.add_option(category_name, "maxgen", maxgen) pagebbg = BooleanOption(_("Page break between generations"), False) pagebbg.set_help( _("Whether to start a new page after each generation.")) menu.add_option(category_name, "pagebbg", pagebbg) namebrk = BooleanOption(_("Add linebreak after each name"), False) namebrk.set_help( _("Indicates if a line break should follow the name.")) menu.add_option(category_name, "namebrk", namebrk) trans = EnumeratedListOption(_("Translation"), Translator.DEFAULT_TRANSLATION_STR) trans.add_item(Translator.DEFAULT_TRANSLATION_STR, _("Default")) for language in TransUtils.get_available_translations(): trans.add_item(language, get_language_string(language)) trans.set_help(_("The translation to be used for the report.")) menu.add_option(category_name, "trans", trans)
def add_menu_options(self, menu): """ Add options to the menu for the detailed descendant report. """ # Report Options add_option = partial(menu.add_option, _("Report Options")) pid = PersonOption(_("Center Person")) pid.set_help(_("The center person for the report")) add_option("pid", pid) # We must figure out the value of the first option before we can # create the EnumeratedListOption fmt_list = global_name_display.get_name_format() name_format = EnumeratedListOption(_("Name format"), 0) name_format.add_item(0, _("Default")) for num, name, fmt_str, act in fmt_list: name_format.add_item(num, name) name_format.set_help(_("Select the format to display names")) add_option("name_format", name_format) numbering = EnumeratedListOption(_("Numbering system"), "Henry") numbering.set_items([("Henry", _("Henry numbering")), ("d'Aboville", _("d'Aboville numbering")), ("Record (Modified Register)", _("Record (Modified Register) numbering"))]) numbering.set_help(_("The numbering system to be used")) add_option("numbering", numbering) generations = NumberOption(_("Generations"), 10, 1, 100) generations.set_help( _("The number of generations to include in the report")) add_option("gen", generations) pagebbg = BooleanOption(_("Page break between generations"), False) pagebbg.set_help( _("Whether to start a new page after each generation.")) add_option("pagebbg", pagebbg) pageben = BooleanOption(_("Page break before end notes"), False) pageben.set_help( _("Whether to start a new page before the end notes.")) add_option("pageben", pageben) trans = EnumeratedListOption(_("Translation"), Translator.DEFAULT_TRANSLATION_STR) trans.add_item(Translator.DEFAULT_TRANSLATION_STR, _("Default")) for language in TransUtils.get_available_translations(): trans.add_item(language, get_language_string(language)) trans.set_help(_("The translation to be used for the report.")) add_option("trans", trans) # Content add_option = partial(menu.add_option, _("Content")) usecall = BooleanOption(_("Use callname for common name"), False) usecall.set_help(_("Whether to use the call name as the first name.")) add_option("usecall", usecall) fulldates = BooleanOption(_("Use full dates instead of only the year"), True) fulldates.set_help( _("Whether to use full dates instead of just year.")) add_option("fulldates", fulldates) listc = BooleanOption(_("List children"), True) listc.set_help(_("Whether to list children.")) add_option("listc", listc) computeage = BooleanOption(_("Compute death age"), True) computeage.set_help(_("Whether to compute a person's age at death.")) add_option("computeage", computeage) omitda = BooleanOption(_("Omit duplicate ancestors"), True) omitda.set_help(_("Whether to omit duplicate ancestors.")) add_option("omitda", omitda) verbose = BooleanOption(_("Use complete sentences"), True) verbose.set_help( _("Whether to use complete sentences or succinct language.")) add_option("verbose", verbose) desref = BooleanOption(_("Add descendant reference in child list"), True) desref.set_help( _("Whether to add descendant references in child list.")) add_option("desref", desref) category_name = _("Include") add_option = partial(menu.add_option, _("Include")) incnotes = BooleanOption(_("Include notes"), True) incnotes.set_help(_("Whether to include notes.")) add_option("incnotes", incnotes) incattrs = BooleanOption(_("Include attributes"), False) incattrs.set_help(_("Whether to include attributes.")) add_option("incattrs", incattrs) incphotos = BooleanOption(_("Include Photo/Images from Gallery"), False) incphotos.set_help(_("Whether to include images.")) add_option("incphotos", incphotos) incnames = BooleanOption(_("Include alternative names"), False) incnames.set_help(_("Whether to include other names.")) add_option("incnames", incnames) incevents = BooleanOption(_("Include events"), False) incevents.set_help(_("Whether to include events.")) add_option("incevents", incevents) incaddresses = BooleanOption(_("Include addresses"), False) incaddresses.set_help(_("Whether to include addresses.")) add_option("incaddresses", incaddresses) incsources = BooleanOption(_("Include sources"), False) incsources.set_help(_("Whether to include source references.")) add_option("incsources", incsources) incsrcnotes = BooleanOption(_("Include sources notes"), False) incsrcnotes.set_help( _("Whether to include source notes in the " "Endnotes section. Only works if Include sources is selected.")) add_option("incsrcnotes", incsrcnotes) incmates = BooleanOption(_("Include spouses"), False) incmates.set_help(_("Whether to include detailed spouse information.")) add_option("incmates", incmates) incmateref = BooleanOption(_("Include spouse reference"), False) incmateref.set_help(_("Whether to include reference to spouse.")) add_option("incmateref", incmateref) incssign = BooleanOption( _("Include sign of succession ('+')" " in child-list"), True) incssign.set_help( _("Whether to include a sign ('+') before the" " descendant number in the child-list to indicate" " a child has succession.")) add_option("incssign", incssign) incpaths = BooleanOption(_("Include path to start-person"), False) incpaths.set_help( _("Whether to include the path of descendancy " "from the start-person to each descendant.")) add_option("incpaths", incpaths) # Missing information add_option = partial(menu.add_option, _("Missing information")) repplace = BooleanOption(_("Replace missing places with ______"), False) repplace.set_help(_("Whether to replace missing Places with blanks.")) add_option("repplace", repplace) repdate = BooleanOption(_("Replace missing dates with ______"), False) repdate.set_help(_("Whether to replace missing Dates with blanks.")) add_option("repdate", repdate)