def add_menu_options(self, menu): """ Add options to the menu for the place report. """ category_name = _("Report Options") # Reload filters to pick any new ones CustomFilters = None from gramps.gen.filters import CustomFilters, GenericFilter opt = FilterOption(_("Select using filter"), 0) opt.set_help(_("Select places using a filter")) filter_list = [] filter_list.append(GenericFilter()) filter_list.extend(CustomFilters.get_filters('Place')) opt.set_filters(filter_list) menu.add_option(category_name, "filter", opt) stdoptions.add_name_format_option(menu, category_name) places = PlaceListOption(_("Select places individually")) places.set_help(_("List of places to report on")) menu.add_option(category_name, "places", places) stdoptions.add_place_format_option(menu, category_name) incpriv = BooleanOption(_("Include private data"), True) incpriv.set_help(_("Whether to include private data")) menu.add_option(category_name, "incpriv", incpriv) showgodparents = BooleanOption(_("show godparents"), True) showgodparents.set_help(_("Whether to include and show godparents")) menu.add_option(category_name, "showgodparents", showgodparents) stdoptions.add_localization_option(menu, category_name)
def add_menu_options(self, menu): """ Add options to the menu for the tag report. """ category_name = _("Report Options") all_tags = [] for handle in self.__db.get_tag_handles(sort_handles=True): tag = self.__db.get_tag_from_handle(handle) all_tags.append(tag.get_name()) if len(all_tags) > 0: self.__tag_option = EnumeratedListOption(_('Tag'), all_tags[0]) for tag_name in all_tags: self.__tag_option.add_item(tag_name, tag_name) else: self.__tag_option = EnumeratedListOption(_('Tag'), '') self.__tag_option.add_item('', '') self.__tag_option.set_help(_("The tag to use for the report")) menu.add_option(category_name, "tag", self.__tag_option) stdoptions.add_name_format_option(menu, category_name) stdoptions.add_place_format_option(menu, category_name) stdoptions.add_private_data_option(menu, category_name) stdoptions.add_living_people_option(menu, category_name) locale_opt = stdoptions.add_localization_option(menu, category_name) stdoptions.add_date_format_option(menu, category_name, locale_opt)
def add_menu_options(self, menu): category_name = _("Report Options") self.__pid = PersonOption(_("Center Person")) self.__pid.set_help(_("The center person for the report")) menu.add_option(category_name, "pid", self.__pid) numbering = EnumeratedListOption(_("Numbering system"), "Simple") numbering.set_items([ ("Simple", _("Simple numbering")), ("d'Aboville", _("d'Aboville numbering")), ("Henry", _("Henry numbering")), ("Modified Henry", _("Modified Henry numbering")), ("de Villiers/Pama", _("de Villiers/Pama numbering")), ("Meurgey de Tupigny", _("Meurgey de Tupigny numbering")) ]) numbering.set_help(_("The numbering system to be used")) menu.add_option(category_name, "numbering", numbering) gen = NumberOption(_("Generations"), 10, 1, 15) gen.set_help(_("The number of generations to include in the report")) menu.add_option(category_name, "gen", gen) stdoptions.add_gramps_id_option(menu, category_name) marrs = BooleanOption(_('Show marriage info'), False) marrs.set_help( _("Whether to show marriage information in the report.")) menu.add_option(category_name, "marrs", marrs) divs = BooleanOption(_('Show divorce info'), False) divs.set_help(_("Whether to show divorce information in the report.")) menu.add_option(category_name, "divs", divs) dups = BooleanOption(_('Show duplicate trees'), True) dups.set_help( _("Whether to show duplicate Family Trees in the report.")) menu.add_option(category_name, "dups", dups) category_name = _("Report Options (2)") stdoptions.add_name_format_option(menu, category_name) stdoptions.add_place_format_option(menu, category_name) stdoptions.add_private_data_option(menu, category_name) stdoptions.add_living_people_option(menu, category_name) locale_opt = stdoptions.add_localization_option(menu, category_name) stdoptions.add_date_format_option(menu, category_name, locale_opt)
def add_menu_options(self, menu): category_name = _("Report Options") self.__pid = PersonOption(_("Center Person")) self.__pid.set_help(_("The center person for the report")) menu.add_option(category_name, "pid", self.__pid) numbering = EnumeratedListOption(_("Numbering system"), "Simple") numbering.set_items([ ("Simple", _("Simple numbering")), ("d'Aboville", _("d'Aboville numbering")), ("Henry", _("Henry numbering")), ("Modified Henry", _("Modified Henry numbering")), ("de Villiers/Pama", _("de Villiers/Pama numbering")), ("Meurgey de Tupigny", _("Meurgey de Tupigny numbering"))]) numbering.set_help(_("The numbering system to be used")) menu.add_option(category_name, "numbering", numbering) gen = NumberOption(_("Generations"), 10, 1, 15) gen.set_help(_("The number of generations to include in the report")) menu.add_option(category_name, "gen", gen) stdoptions.add_gramps_id_option(menu, category_name) marrs = BooleanOption(_('Show marriage info'), False) marrs.set_help( _("Whether to show marriage information in the report.")) menu.add_option(category_name, "marrs", marrs) divs = BooleanOption(_('Show divorce info'), False) divs.set_help(_("Whether to show divorce information in the report.")) menu.add_option(category_name, "divs", divs) dups = BooleanOption(_('Show duplicate trees'), True) dups.set_help( _("Whether to show duplicate Family Trees in the report.")) menu.add_option(category_name, "dups", dups) category_name = _("Report Options (2)") stdoptions.add_name_format_option(menu, category_name) stdoptions.add_place_format_option(menu, category_name) stdoptions.add_private_data_option(menu, category_name) stdoptions.add_living_people_option(menu, category_name) locale_opt = stdoptions.add_localization_option(menu, category_name) stdoptions.add_date_format_option(menu, category_name, locale_opt)
def add_menu_options(self, menu): """ Add options to the menu for the place report. """ category_name = _("Report Options") # Reload filters to pick any new ones CustomFilters = None from gramps.gen.filters import CustomFilters, GenericFilter self.__filter = FilterOption(_("Select using filter"), 0) self.__filter.set_help(_("Select places using a filter")) filter_list = [] filter_list.append(GenericFilter()) filter_list.extend(CustomFilters.get_filters('Place')) self.__filter.set_filters(filter_list) menu.add_option(category_name, "filter", self.__filter) self.__places = PlaceListOption(_("Select places individually")) self.__places.set_help(_("List of places to report on")) menu.add_option(category_name, "places", self.__places) center = EnumeratedListOption(_("Center on"), "Event") center.set_items([("Event", _("Event")), ("Person", _("Person"))]) center.set_help(_("If report is event or person centered")) menu.add_option(category_name, "center", center) category_name = _("Report Options (2)") stdoptions.add_name_format_option(menu, category_name) stdoptions.add_place_format_option(menu, category_name) stdoptions.add_private_data_option(menu, category_name) stdoptions.add_living_people_option(menu, category_name) locale_opt = stdoptions.add_localization_option(menu, category_name) stdoptions.add_date_format_option(menu, category_name, locale_opt)
def add_menu_options(self, menu): """ Add the options for this report """ category_name = _("Report Options") title = StringOption(_('book|Title'), _('Title of the Book')) title.set_help(_("Title string for the book.")) menu.add_option(category_name, "title", title) subtitle = StringOption(_('Subtitle'), _('Subtitle of the Book')) subtitle.set_help(_("Subtitle string for the book.")) menu.add_option(category_name, "subtitle", subtitle) dateinfo = time.localtime(time.time()) #rname = self.__db.get_researcher().get_name() rname = "researcher name" footer_string = _('Copyright %(year)d %(name)s') % { 'year': dateinfo[0], 'name': rname } footer = StringOption(_('Footer'), footer_string) footer.set_help(_("Footer string for the page.")) menu.add_option(category_name, "footer", footer) # Reload filters to pick any new ones CustomFilters = None #p- from Filters import CustomFilters, GenericFilter from gramps.gen.filters import CustomFilters, GenericFilter # opt = FilterOption(_("Select using filter"), 0) # opt.set_help(_("Select places using a filter")) # filter_list = [] # filter_list.append(GenericFilter()) # filter_list.extend(CustomFilters.get_filters('Source')) # opt.set_filters(filter_list) # menu.add_option(category_name, "filter", opt) # # showpersons = BooleanOption(_("Show persons"), True) # showpersons.set_help(_("Whether to show events and persons mentioned in the note")) # menu.add_option(category_name, "showpersons", showpersons) # # incphotos = BooleanOption(_("Include Photos"), True) # incphotos.set_help(_("Whether to show photos mentioned in the citation")) # menu.add_option(category_name, "incphotos", incphotos) category_name = _("Calc Options") # Reload filters to pick any new ones CustomFilters = None #p- from Filters import CustomFilters, GenericFilter from gramps.gen.filters import CustomFilters, GenericFilter opt = FilterOption(_("Select using filter"), 0) opt.set_help(_("Select places using a filter")) filter_list = [] filter_list.append(GenericFilter()) filter_list.extend(CustomFilters.get_filters('Source')) opt.set_filters(filter_list) menu.add_option(category_name, "filter", opt) showallfamilies = BooleanOption( _("Show surnames of all famiies in clans"), True) showallfamilies.set_help( _("Whether to show the names of all families as surname")) menu.add_option(category_name, "showallfamilies", showallfamilies) # self.pl_format = menu.get_option_by_name('placeformat').get_value() #places = PlaceListOption(_("Select places individually")) #places.set_help(_("List of places to report on")) #menu.add_option(category_name, "places", places) stdoptions.add_place_format_option(menu, category_name)
def add_menu_options(self, menu): """ Add Menu Options """ from functools import partial # Report Options category = _("Report Options") addopt = partial(menu.add_option, category) self.__pid = PersonOption(_("Center Person")) self.__pid.set_help(_("The center person for the report")) addopt("pid", self.__pid) start_number = NumberOption(_("Sosa-Stradonitz number"), 1, 1, 16384) start_number.set_help( _('The Sosa-Stradonitz number of the central person.')) addopt("initial_sosa", start_number) gen = NumberOption(_("Generations"), 10, 1, 100) gen.set_help(_("The number of generations to include in the report")) addopt("gen", gen) stdoptions.add_gramps_id_option(menu, category) pagebbg = BooleanOption(_("Page break between generations"), False) pagebbg.set_help( _("Whether to start a new page after each generation.")) addopt("pagebbg", pagebbg) pageben = BooleanOption(_("Page break before end notes"), False) pageben.set_help( _("Whether to start a new page before the end notes.")) addopt("pageben", pageben) category = _("Report Options (2)") addopt = partial(menu.add_option, category) stdoptions.add_name_format_option(menu, category) stdoptions.add_place_format_option(menu, category) stdoptions.add_private_data_option(menu, category) stdoptions.add_living_people_option(menu, category) locale_opt = stdoptions.add_localization_option(menu, category) stdoptions.add_date_format_option(menu, category, locale_opt) # Content options addopt = partial(menu.add_option, _("Content")) verbose = BooleanOption(_("Use complete sentences"), True) verbose.set_help( _("Whether to use complete sentences or succinct language.")) addopt("verbose", verbose) fulldates = BooleanOption(_("Use full dates instead of only the year"), True) fulldates.set_help( _("Whether to use full dates instead of just year.")) addopt("fulldates", fulldates) computeage = BooleanOption(_("Compute death age"), True) computeage.set_help(_("Whether to compute a person's age at death.")) addopt("computeage", computeage) omitda = BooleanOption(_("Omit duplicate ancestors"), True) omitda.set_help(_("Whether to omit duplicate ancestors.")) addopt("omitda", omitda) usecall = BooleanOption(_("Use callname for common name"), False) usecall.set_help(_("Whether to use the call name as the first name.")) addopt("usecall", usecall) # What to include addopt = partial(menu.add_option, _("Include")) listc = BooleanOption(_("Include children"), True) listc.set_help(_("Whether to list children.")) addopt("listc", listc) listc_spouses = BooleanOption(_("Include spouses of children"), False) listc_spouses.set_help( _("Whether to list the spouses of the children.")) addopt("listc_spouses", listc_spouses) incevents = BooleanOption(_("Include events"), False) incevents.set_help(_("Whether to include events.")) addopt("incevents", incevents) incotherevents = BooleanOption(_("Include other events"), False) incotherevents.set_help( _("Whether to include other events " "people participated in.")) addopt("incotherevents", incotherevents) desref = BooleanOption(_("Include descendant reference in child list"), True) desref.set_help( _("Whether to add descendant references in child list.")) addopt("desref", desref) incphotos = BooleanOption(_("Include Photo/Images from Gallery"), False) incphotos.set_help(_("Whether to include images.")) addopt("incphotos", incphotos) addopt = partial(menu.add_option, _("Include (2)")) incnotes = BooleanOption(_("Include notes"), True) incnotes.set_help(_("Whether to include notes.")) addopt("incnotes", incnotes) incsources = BooleanOption(_("Include sources"), False) incsources.set_help(_("Whether to include source references.")) addopt("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.")) addopt("incsrcnotes", incsrcnotes) incattrs = BooleanOption(_("Include attributes"), False) incattrs.set_help(_("Whether to include attributes.")) addopt("incattrs", incattrs) incaddresses = BooleanOption(_("Include addresses"), False) incaddresses.set_help(_("Whether to include addresses.")) addopt("incaddresses", incaddresses) incnames = BooleanOption(_("Include alternative names"), False) incnames.set_help(_("Whether to include other names.")) addopt("incnames", incnames) # How to handle missing information addopt = partial(menu.add_option, _("Missing information")) repplace = BooleanOption(_("Replace missing places with ______"), False) repplace.set_help(_("Whether to replace missing Places with blanks.")) addopt("repplace", repplace) repdate = BooleanOption(_("Replace missing dates with ______"), False) repdate.set_help(_("Whether to replace missing Dates with blanks.")) addopt("repdate", repdate)
def add_menu_options(self, menu): ########################## category_name = _("Report Options") add_option = partial(menu.add_option, category_name) ########################## self.__filter = FilterOption(_("Filter"), 0) self.__filter.set_help( _("Select the filter to be applied to the report.")) add_option("filter", self.__filter) self.__filter.connect('value-changed', self.__filter_changed) self.__fid = FamilyOption(_("Center Family")) self.__fid.set_help(_("The center family for the filter")) add_option("family_id", self.__fid) self.__fid.connect('value-changed', self.__update_filters) self.__recursive = BooleanOption(_('Recursive (down)'), False) self.__recursive.set_help(_("Create reports for all descendants " "of this family.")) add_option("recursive", self.__recursive) self.__recursive.connect('value-changed', self.__recursive_changed) ########################## category_name = _("Report Options (2)") add_option = partial(menu.add_option, category_name) ########################## self._nf = stdoptions.add_name_format_option(menu, category_name) self._nf.connect('value-changed', self.__update_filters) self.__update_filters() stdoptions.add_place_format_option(menu, category_name) stdoptions.add_private_data_option(menu, category_name) stdoptions.add_living_people_option(menu, category_name) locale_opt = stdoptions.add_localization_option(menu, category_name) stdoptions.add_date_format_option(menu, category_name, locale_opt) ########################## add_option = partial(menu.add_option, _("Include")) ########################## inc_par_mar = BooleanOption(_("Parent Marriage"), True) inc_par_mar.set_help( _("Whether to include marriage information for parents.")) add_option("incParMar", inc_par_mar) inc_par_events = BooleanOption(_("Parent Events"), False) inc_par_events.set_help(_("Whether to include events for parents.")) add_option("incParEvents", inc_par_events) inc_par_addr = BooleanOption(_("Parent Addresses"), False) inc_par_addr.set_help(_("Whether to include addresses for parents.")) add_option("incParAddr", inc_par_addr) inc_par_notes = BooleanOption(_("Parent Notes"), False) inc_par_notes.set_help(_("Whether to include notes for parents.")) add_option("incParNotes", inc_par_notes) incattrs = BooleanOption(_("Parent Attributes"), False) incattrs.set_help(_("Whether to include attributes.")) add_option("incattrs", incattrs) inc_par_names = BooleanOption(_("Alternate Parent Names"), False) inc_par_names.set_help( _("Whether to include alternate names for parents.")) add_option("incParNames", inc_par_names) ########################## category_name = _("Include (2)") add_option = partial(menu.add_option, category_name) ########################## stdoptions.add_gramps_id_option(menu, category_name) inc_fam_notes = BooleanOption(_("Family Notes"), False) inc_fam_notes.set_help(_("Whether to include notes for families.")) add_option("incFamNotes", inc_fam_notes) inc_rel_dates = BooleanOption(_("Dates of Relatives"), False) inc_rel_dates.set_help(_("Whether to include dates for relatives " "(father, mother, spouse).")) add_option("incRelDates", inc_rel_dates) inc_chi_mar = BooleanOption(_("Children Marriages"), True) inc_chi_mar.set_help( _("Whether to include marriage information for children.")) add_option("incChiMar", inc_chi_mar) self.__generations = BooleanOption(_("Generation numbers " "(recursive only)"), False) self.__generations.set_help(_("Whether to include the generation " "on each report (recursive only).")) add_option("generations", self.__generations) missinginfo = BooleanOption(_("Print fields for missing " "information"), True) missinginfo.set_help(_("Whether to include fields for missing " "information.")) add_option("missinginfo", missinginfo)
def add_menu_options(self, menu): """ Add Menu Options """ from functools import partial # Report Options category = _("Report Options") addopt = partial(menu.add_option, category) self.__pid = PersonOption(_("Center Person")) self.__pid.set_help(_("The center person for the report")) addopt("pid", self.__pid) start_number = NumberOption(_("Sosa-Stradonitz number"), 1, 1, 16384) start_number.set_help( _('The Sosa-Stradonitz number of the central person.')) addopt("initial_sosa", start_number) gen = NumberOption(_("Generations"), 10, 1, 100) gen.set_help(_("The number of generations to include in the report")) addopt("gen", gen) stdoptions.add_gramps_id_option(menu, category) pagebbg = BooleanOption(_("Page break between generations"), False) pagebbg.set_help( _("Whether to start a new page after each generation.")) addopt("pagebbg", pagebbg) pageben = BooleanOption(_("Page break before end notes"), False) pageben.set_help( _("Whether to start a new page before the end notes.")) addopt("pageben", pageben) category = _("Report Options (2)") addopt = partial(menu.add_option, category) stdoptions.add_name_format_option(menu, category) stdoptions.add_place_format_option(menu, category) stdoptions.add_private_data_option(menu, category) stdoptions.add_living_people_option(menu, category) locale_opt = stdoptions.add_localization_option(menu, category) stdoptions.add_date_format_option(menu, category, locale_opt) # Content options addopt = partial(menu.add_option, _("Content")) verbose = BooleanOption(_("Use complete sentences"), True) verbose.set_help( _("Whether to use complete sentences or succinct language.")) addopt("verbose", verbose) fulldates = BooleanOption( _("Use full dates instead of only the year"), True) fulldates.set_help( _("Whether to use full dates instead of just year.")) addopt("fulldates", fulldates) computeage = BooleanOption(_("Compute death age"), True) computeage.set_help(_("Whether to compute a person's age at death.")) addopt("computeage", computeage) omitda = BooleanOption(_("Omit duplicate ancestors"), True) omitda.set_help(_("Whether to omit duplicate ancestors.")) addopt("omitda", omitda) usecall = BooleanOption(_("Use callname for common name"), False) usecall.set_help(_("Whether to use the call name as the first name.")) addopt("usecall", usecall) # What to include addopt = partial(menu.add_option, _("Include")) listc = BooleanOption(_("Include children"), True) listc.set_help(_("Whether to list children.")) addopt("listc", listc) listc_spouses = BooleanOption(_("Include spouses of children"), False) listc_spouses.set_help( _("Whether to list the spouses of the children.")) addopt("listc_spouses", listc_spouses) incevents = BooleanOption(_("Include events"), False) incevents.set_help(_("Whether to include events.")) addopt("incevents", incevents) incotherevents = BooleanOption(_("Include other events"), False) incotherevents.set_help(_("Whether to include other events " "people participated in.")) addopt("incotherevents", incotherevents) desref = BooleanOption( _("Include descendant reference in child list"), True) desref.set_help( _("Whether to add descendant references in child list.")) addopt("desref", desref) incphotos = BooleanOption( _("Include Photo/Images from Gallery"), False) incphotos.set_help(_("Whether to include images.")) addopt("incphotos", incphotos) addopt = partial(menu.add_option, _("Include (2)")) incnotes = BooleanOption(_("Include notes"), True) incnotes.set_help(_("Whether to include notes.")) addopt("incnotes", incnotes) incsources = BooleanOption(_("Include sources"), False) incsources.set_help(_("Whether to include source references.")) addopt("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.")) addopt("incsrcnotes", incsrcnotes) incattrs = BooleanOption(_("Include attributes"), False) incattrs.set_help(_("Whether to include attributes.")) addopt("incattrs", incattrs) incaddresses = BooleanOption(_("Include addresses"), False) incaddresses.set_help(_("Whether to include addresses.")) addopt("incaddresses", incaddresses) incnames = BooleanOption(_("Include alternative names"), False) incnames.set_help(_("Whether to include other names.")) addopt("incnames", incnames) # How to handle missing information addopt = partial(menu.add_option, _("Missing information")) repplace = BooleanOption(_("Replace missing places with ______"), False) repplace.set_help(_("Whether to replace missing Places with blanks.")) addopt("repplace", repplace) repdate = BooleanOption(_("Replace missing dates with ______"), False) repdate.set_help(_("Whether to replace missing Dates with blanks.")) addopt("repdate", repdate)