Esempio n. 1
0
    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)
Esempio n. 2
0
    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)
Esempio n. 3
0
    def add_menu_options(self, menu):
        """
        Add options to the menu for the ancestor report.
        """
        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)

        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)

        stdoptions.add_gramps_id_option(menu, category_name)

        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(_("Whether a line break should follow the name."))
        menu.add_option(category_name, "namebrk", namebrk)

        category_name = _("Report Options (2)")

        stdoptions.add_name_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)
Esempio n. 4
0
    def add_menu_options(self, menu):
        """
        Add options to the menu for the ancestor report.
        """
        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)

        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)

        stdoptions.add_gramps_id_option(menu, category_name)

        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(_("Whether a line break should follow the name."))
        menu.add_option(category_name, "namebrk", namebrk)

        category_name = _("Report Options (2)")

        stdoptions.add_name_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)
Esempio n. 5
0
    def add_menu_options(self, menu):

        # ---------------------
        category_name = _('Report Options')
        add_option = partial(menu.add_option, category_name)
        # ---------------------

        followpar = BooleanOption(_('Follow parents to determine '
                                    '"family lines"'), True)
        followpar.set_help(_('Parents and their ancestors will be '
                             'considered when determining "family lines".'))
        add_option('followpar', followpar)

        followchild = BooleanOption(_('Follow children to determine '
                                      '"family lines"'), True)
        followchild.set_help(_('Children will be considered when '
                               'determining "family lines".'))
        add_option('followchild', followchild)

        remove_extra_people = BooleanOption(_('Try to remove extra '
                                              'people and families'), True)
        remove_extra_people.set_help(_('People and families not directly '
                                       'related to people of interest will '
                                       'be removed when determining '
                                       '"family lines".'))
        add_option('removeextra', remove_extra_people)

        arrow = EnumeratedListOption(_("Arrowhead direction"), 'd')
        for i in range( 0, len(_ARROWS) ):
            arrow.add_item(_ARROWS[i]["value"], _ARROWS[i]["name"])
        arrow.set_help(_("Choose the direction that the arrows point."))
        add_option("arrow", arrow)

        color = EnumeratedListOption(_("Graph coloring"), "filled")
        for i in range(len(_COLORS)):
            color.add_item(_COLORS[i]["value"], _COLORS[i]["name"])
        color.set_help(_("Males will be shown with blue, females "
                         "with red, unless otherwise set above for filled. "
                         "If the sex of an individual "
                         "is unknown it will be shown with gray."))
        add_option("color", color)

        roundedcorners = EnumeratedListOption(_("Rounded corners"), '')
        for i in range( 0, len(_CORNERS) ):
            roundedcorners.add_item(_CORNERS[i]["value"], _CORNERS[i]["name"])
        roundedcorners.set_help(_("Use rounded corners e.g. to differentiate "
                         "between women and men."))
        add_option("useroundedcorners", roundedcorners)

        stdoptions.add_gramps_id_option(menu, category_name, ownline=True)

        # ---------------------
        category_name = _('Report Options (2)')
        add_option = partial(menu.add_option, category_name)
        # ---------------------

        stdoptions.add_name_format_option(menu, category_name)

        stdoptions.add_private_data_option(menu, category_name, default=False)

        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, _('People of Interest'))
        # --------------------------------

        person_list = PersonListOption(_('People of interest'))
        person_list.set_help(_('People of interest are used as a starting '
                               'point when determining "family lines".'))
        add_option('gidlist', person_list)

        self.limit_parents = BooleanOption(_('Limit the number of ancestors'),
                                           False)
        self.limit_parents.set_help(_('Whether to '
                                      'limit the number of ancestors.'))
        add_option('limitparents', self.limit_parents)
        self.limit_parents.connect('value-changed', self.limit_changed)

        self.max_parents = NumberOption('', 50, 10, 9999)
        self.max_parents.set_help(_('The maximum number '
                                    'of ancestors to include.'))
        add_option('maxparents', self.max_parents)

        self.limit_children = BooleanOption(_('Limit the number '
                                              'of descendants'),
                                            False)
        self.limit_children.set_help(_('Whether to '
                                       'limit the number of descendants.'))
        add_option('limitchildren', self.limit_children)
        self.limit_children.connect('value-changed', self.limit_changed)

        self.max_children = NumberOption('', 50, 10, 9999)
        self.max_children.set_help(_('The maximum number '
                                     'of descendants to include.'))
        add_option('maxchildren', self.max_children)

        # --------------------
        category_name = _('Include')
        add_option = partial(menu.add_option, category_name)
        # --------------------

        self.include_dates = BooleanOption(_('Include dates'), True)
        self.include_dates.set_help(_('Whether to include dates for people '
                                      'and families.'))
        add_option('incdates', self.include_dates)
        self.include_dates.connect('value-changed', self.include_dates_changed)

        self.justyears = BooleanOption(_("Limit dates to years only"), False)
        self.justyears.set_help(_("Prints just dates' year, neither "
                                  "month or day nor date approximation "
                                  "or interval are shown."))
        add_option("justyears", self.justyears)

        include_places = BooleanOption(_('Include places'), True)
        include_places.set_help(_('Whether to include placenames for people '
                                  'and families.'))
        add_option('incplaces', include_places)

        include_num_children = BooleanOption(_('Include the number of '
                                               'children'), True)
        include_num_children.set_help(_('Whether to include the number of '
                                        'children for families with more '
                                        'than 1 child.'))
        add_option('incchildcnt', include_num_children)

        self.include_images = BooleanOption(_('Include '
                                              'thumbnail images of people'),
                                            True)
        self.include_images.set_help(_('Whether to '
                                       'include thumbnail images of people.'))
        add_option('incimages', self.include_images)
        self.include_images.connect('value-changed', self.images_changed)

        self.image_location = EnumeratedListOption(_('Thumbnail location'), 0)
        self.image_location.add_item(0, _('Above the name'))
        self.image_location.add_item(1, _('Beside the name'))
        self.image_location.set_help(_('Where the thumbnail image '
                                       'should appear relative to the name'))
        add_option('imageonside', self.image_location)

        self.image_size = EnumeratedListOption(_('Thumbnail size'), SIZE_NORMAL)
        self.image_size.add_item(SIZE_NORMAL, _('Normal'))
        self.image_size.add_item(SIZE_LARGE, _('Large'))
        self.image_size.set_help(_('Size of the thumbnail image'))
        add_option('imagesize', self.image_size)

        # ----------------------------
        add_option = partial(menu.add_option, _('Family Colors'))
        # ----------------------------

        surname_color = SurnameColorOption(_('Family colors'))
        surname_color.set_help(_('Colors to use for various family lines.'))
        add_option('surnamecolors', surname_color)

        # -------------------------
        add_option = partial(menu.add_option, _('Individuals'))
        # -------------------------

        color_males = ColorOption(_('Males'), '#e0e0ff')
        color_males.set_help(_('The color to use to display men.'))
        add_option('colormales', color_males)

        color_females = ColorOption(_('Females'), '#ffe0e0')
        color_females.set_help(_('The color to use to display women.'))
        add_option('colorfemales', color_females)

        color_unknown = ColorOption(_('Unknown'), '#e0e0e0')
        color_unknown.set_help(_('The color to use '
                                 'when the gender is unknown.'))
        add_option('colorunknown', color_unknown)

        color_family = ColorOption(_('Families'), '#ffffe0')
        color_family.set_help(_('The color to use to display families.'))
        add_option('colorfamilies', color_family)

        self.limit_changed()
        self.images_changed()
Esempio n. 6
0
    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(
            _("Determines what people are included in the graph"))
        add_option("filter", self.__filter)
        self.__filter.connect('value-changed', self.__filter_changed)

        self.__pid = PersonOption(_("Center Person"))
        self.__pid.set_help(_("The center person for the report"))
        menu.add_option(category_name, "pid", self.__pid)
        self.__pid.connect('value-changed', self.__update_filters)

        arrow = EnumeratedListOption(_("Arrowhead direction"), 'd')
        for i in range(0, len(_ARROWS)):
            arrow.add_item(_ARROWS[i]["value"], _ARROWS[i]["name"])
        arrow.set_help(_("Choose the direction that the arrows point."))
        add_option("arrow", arrow)

        color = EnumeratedListOption(_("Graph coloring"), 'filled')
        for i in range(0, len(_COLORS)):
            color.add_item(_COLORS[i]["value"], _COLORS[i]["name"])
        color.set_help(_("Males will be shown with blue, females "
                         "with red.  If the sex of an individual "
                         "is unknown it will be shown with gray."))
        add_option("color", color)

        # see bug report #2180
        roundedcorners = BooleanOption(_("Use rounded corners"), False)
        roundedcorners.set_help(_("Use rounded corners to differentiate "
                                  "between women and men."))
        add_option("useroundedcorners", roundedcorners)

        stdoptions.add_gramps_id_option(menu, category_name, ownline=True)

        ################################
        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_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"))
        ################################

        self.event_choice = EnumeratedListOption(_('Dates and/or Places'), 0)
        self.event_choice.add_item(0, _('Do not include any dates or places'))
        self.event_choice.add_item(1, _('Include (birth, marriage, death) '
                                        'dates, but no places'))
        self.event_choice.add_item(2, _('Include (birth, marriage, death) '
                                        'dates, and places'))
        self.event_choice.add_item(3, _('Include (birth, marriage, death) '
                                        'dates, and places if no dates'))
        self.event_choice.add_item(4, _('Include (birth, marriage, death) '
                                        'years, but no places'))
        self.event_choice.add_item(5, _('Include (birth, marriage, death) '
                                        'years, and places'))
        self.event_choice.add_item(6, _('Include (birth, marriage, death) '
                                        'places, but no dates'))
        self.event_choice.add_item(7, _('Include (birth, marriage, death) '
                                        'dates and places on same line'))
        self.event_choice.set_help(
            _("Whether to include dates and/or places"))
        add_option("event_choice", self.event_choice)

        url = BooleanOption(_("Include URLs"), False)
        url.set_help(_("Include a URL in each graph node so "
                       "that PDF and imagemap files can be "
                       "generated that contain active links "
                       "to the files generated by the 'Narrated "
                       "Web Site' report."))
        add_option("url", url)

        self.__show_relships = BooleanOption(
            _("Include relationship to center person"), False)
        self.__show_relships.set_help(_("Whether to show every person's "
                                        "relationship to the center person"))
        add_option("increlname", self.__show_relships)
        self.__show_relships.connect('value-changed',
                                     self.__show_relships_changed)

        self.__include_images = BooleanOption(
            _('Include thumbnail images of people'), False)
        self.__include_images.set_help(
            _("Whether to include thumbnails of people."))
        add_option("includeImages", self.__include_images)
        self.__include_images.connect('value-changed', self.__image_changed)

        self.__image_on_side = EnumeratedListOption(_("Thumbnail Location"), 0)
        self.__image_on_side.add_item(0, _('Above the name'))
        self.__image_on_side.add_item(1, _('Beside the name'))
        self.__image_on_side.set_help(
            _("Where the thumbnail image should appear relative to the name"))
        add_option("imageOnTheSide", self.__image_on_side)

        #occupation = BooleanOption(_("Include occupation"), False)
        occupation = EnumeratedListOption(_('Include occupation'), 0)
        occupation.add_item(0, _('Do not include any occupation'))
        occupation.add_item(1, _('Include description '
                                 'of most recent occupation'))
        occupation.add_item(2, _('Include date, description and place '
                                 'of all occupations'))
        occupation.set_help(_("Whether to include the last occupation"))
        add_option("occupation", occupation)

        if __debug__:
            self.__show_ga_gb = BooleanOption(_("Include relationship "
                                                "debugging numbers also"),
                                              False)
            self.__show_ga_gb.set_help(_("Whether to include 'Ga' and 'Gb' "
                                         "also, to debug the relationship "
                                         "calculator"))
            add_option("advrelinfo", self.__show_ga_gb)

        ################################
        add_option = partial(menu.add_option, _("Graph Style"))
        ################################

        color_males = ColorOption(_('Males'), '#e0e0ff')
        color_males.set_help(_('The color to use to display men.'))
        add_option('colormales', color_males)

        color_females = ColorOption(_('Females'), '#ffe0e0')
        color_females.set_help(_('The color to use to display women.'))
        add_option('colorfemales', color_females)

        color_unknown = ColorOption(_('Unknown'), '#e0e0e0')
        color_unknown.set_help(
            _('The color to use when the gender is unknown.')
            )
        add_option('colorunknown', color_unknown)

        color_family = ColorOption(_('Families'), '#ffffe0')
        color_family.set_help(_('The color to use to display families.'))
        add_option('colorfamilies', color_family)

        dashed = BooleanOption(
            _("Indicate non-birth relationships with dotted lines"), True)
        dashed.set_help(_("Non-birth relationships will show up "
                          "as dotted lines in the graph."))
        add_option("dashed", dashed)

        showfamily = BooleanOption(_("Show family nodes"), True)
        showfamily.set_help(_("Families will show up as ellipses, linked "
                              "to parents and children."))
        add_option("showfamily", showfamily)
Esempio n. 7
0
    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)
Esempio n. 8
0
    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(
            _("Determines what people are included in the graph"))
        add_option("filter", self.__filter)
        self.__filter.connect('value-changed', self.__filter_changed)

        self.__pid = PersonOption(_("Center Person"))
        self.__pid.set_help(_("The center person for the report"))
        menu.add_option(category_name, "pid", self.__pid)
        self.__pid.connect('value-changed', self.__update_filters)

        arrow = EnumeratedListOption(_("Arrowhead direction"), 'd')
        for i in range(0, len(_ARROWS)):
            arrow.add_item(_ARROWS[i]["value"], _ARROWS[i]["name"])
        arrow.set_help(_("Choose the direction that the arrows point."))
        add_option("arrow", arrow)

        color = EnumeratedListOption(_("Graph coloring"), 'filled')
        for i in range(0, len(_COLORS)):
            color.add_item(_COLORS[i]["value"], _COLORS[i]["name"])
        color.set_help(_("Males will be shown with blue, females "
                         "with red.  If the sex of an individual "
                         "is unknown it will be shown with gray."))
        add_option("color", color)

        # see bug report #2180
        roundedcorners = BooleanOption(_("Use rounded corners"), False)
        roundedcorners.set_help(_("Use rounded corners to differentiate "
                                  "between women and men."))
        add_option("useroundedcorners", roundedcorners)

        stdoptions.add_gramps_id_option(menu, category_name, ownline=True)

        ################################
        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_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"))
        ################################

        self.event_choice = EnumeratedListOption(_('Dates and/or Places'), 0)
        self.event_choice.add_item(0, _('Do not include any dates or places'))
        self.event_choice.add_item(1, _('Include (birth, marriage, death) '
                                        'dates, but no places'))
        self.event_choice.add_item(2, _('Include (birth, marriage, death) '
                                        'dates, and places'))
        self.event_choice.add_item(3, _('Include (birth, marriage, death) '
                                        'dates, and places if no dates'))
        self.event_choice.add_item(4, _('Include (birth, marriage, death) '
                                        'years, but no places'))
        self.event_choice.add_item(5, _('Include (birth, marriage, death) '
                                        'years, and places'))
        self.event_choice.add_item(6, _('Include (birth, marriage, death) '
                                        'places, but no dates'))
        self.event_choice.add_item(7, _('Include (birth, marriage, death) '
                                        'dates and places on same line'))
        self.event_choice.set_help(
            _("Whether to include dates and/or places"))
        add_option("event_choice", self.event_choice)

        url = BooleanOption(_("Include URLs"), False)
        url.set_help(_("Include a URL in each graph node so "
                       "that PDF and imagemap files can be "
                       "generated that contain active links "
                       "to the files generated by the 'Narrated "
                       "Web Site' report."))
        add_option("url", url)

        self.__show_relships = BooleanOption(
            _("Include relationship to center person"), False)
        self.__show_relships.set_help(_("Whether to show every person's "
                                        "relationship to the center person"))
        add_option("increlname", self.__show_relships)
        self.__show_relships.connect('value-changed',
                                     self.__show_relships_changed)

        self.__include_images = BooleanOption(
            _('Include thumbnail images of people'), False)
        self.__include_images.set_help(
            _("Whether to include thumbnails of people."))
        add_option("includeImages", self.__include_images)
        self.__include_images.connect('value-changed', self.__image_changed)

        self.__image_on_side = EnumeratedListOption(_("Thumbnail Location"), 0)
        self.__image_on_side.add_item(0, _('Above the name'))
        self.__image_on_side.add_item(1, _('Beside the name'))
        self.__image_on_side.set_help(
            _("Where the thumbnail image should appear relative to the name"))
        add_option("imageOnTheSide", self.__image_on_side)

        #occupation = BooleanOption(_("Include occupation"), False)
        occupation = EnumeratedListOption(_('Include occupation'), 0)
        occupation.add_item(0, _('Do not include any occupation'))
        occupation.add_item(1, _('Include description '
                                 'of most recent occupation'))
        occupation.add_item(2, _('Include date, description and place '
                                 'of all occupations'))
        occupation.set_help(_("Whether to include the last occupation"))
        add_option("occupation", occupation)

        if __debug__:
            self.__show_ga_gb = BooleanOption(_("Include relationship "
                                                "debugging numbers also"),
                                              False)
            self.__show_ga_gb.set_help(_("Whether to include 'Ga' and 'Gb' "
                                         "also, to debug the relationship "
                                         "calculator"))
            add_option("advrelinfo", self.__show_ga_gb)

        ################################
        add_option = partial(menu.add_option, _("Graph Style"))
        ################################

        color_males = ColorOption(_('Males'), '#e0e0ff')
        color_males.set_help(_('The color to use to display men.'))
        add_option('colormales', color_males)

        color_females = ColorOption(_('Females'), '#ffe0e0')
        color_females.set_help(_('The color to use to display women.'))
        add_option('colorfemales', color_females)

        color_unknown = ColorOption(_('Unknown'), '#e0e0e0')
        color_unknown.set_help(
            _('The color to use when the gender is unknown.')
            )
        add_option('colorunknown', color_unknown)

        color_family = ColorOption(_('Families'), '#ffffe0')
        color_family.set_help(_('The color to use to display families.'))
        add_option('colorfamilies', color_family)

        dashed = BooleanOption(
            _("Indicate non-birth relationships with dotted lines"), True)
        dashed.set_help(_("Non-birth relationships will show up "
                          "as dotted lines in the graph."))
        add_option("dashed", dashed)

        showfamily = BooleanOption(_("Show family nodes"), True)
        showfamily.set_help(_("Families will show up as ellipses, linked "
                              "to parents and children."))
        add_option("showfamily", showfamily)
Esempio n. 9
0
    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_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)
Esempio n. 10
0
    def add_menu_options(self, menu):
        """
        Create all the menu options for this report.
        """
        category_name = _("Report Options")

        pid = PersonOption(_("Center Person"))
        pid.set_help(_("The Center person for the graph"))
        menu.add_option(category_name, "pid", pid)

        max_gen_d = NumberOption(_('Max Descendant Generations'), 10, 1, 15)
        max_gen_d.set_help(_("The number of generations of descendants to "
                           "include in the graph"))
        menu.add_option(category_name, "maxdescend", max_gen_d)

        max_gen_a = NumberOption(_('Max Ancestor Generations'), 10, 1, 15)
        max_gen_a.set_help(_("The number of generations of ancestors to "
                           "include in the graph"))
        menu.add_option(category_name, "maxascend", max_gen_a)

        arrow = EnumeratedListOption(_("Arrowhead direction"), 'o')
        for i in range( 0, len(_ARROWS) ):
            arrow.add_item(_ARROWS[i]["value"], _ARROWS[i]["name"])
        arrow.set_help(_("Choose the direction that the arrows point."))
        menu.add_option(category_name, "arrow", arrow)

        color = EnumeratedListOption(_("Graph coloring"), "filled")
        for i in range(0, len(_COLORS)):
            color.add_item(_COLORS[i]["value"], _COLORS[i]["name"])
        color.set_help(_("Males will be shown with blue, females "
                         "with red.  If the sex of an individual "
                         "is unknown it will be shown with gray."))
        menu.add_option(category_name, "color", color)

        roundedcorners = BooleanOption(_("Use rounded corners"), False) # 2180
        roundedcorners.set_help(
            _("Use rounded corners to differentiate between women and men."))
        menu.add_option(category_name, "roundcorners", roundedcorners)

        stdoptions.add_gramps_id_option(menu, category_name, ownline=True)

        category_name = _("Report Options (2)")

        stdoptions.add_name_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)

        ################################
        category_name = _("Graph Style")
        ################################

        color_males = ColorOption(_('Males'), '#e0e0ff')
        color_males.set_help(_('The color to use to display men.'))
        menu.add_option(category_name, 'colormales', color_males)

        color_females = ColorOption(_('Females'), '#ffe0e0')
        color_females.set_help(_('The color to use to display women.'))
        menu.add_option(category_name, 'colorfemales', color_females)

        color_unknown = ColorOption(_('Unknown'), '#e0e0e0')
        color_unknown.set_help(_('The color to use '
                                 'when the gender is unknown.'))
        menu.add_option(category_name, 'colorunknown', color_unknown)

        color_family = ColorOption(_('Families'), '#ffffe0')
        color_family.set_help(_('The color to use to display families.'))
        menu.add_option(category_name, 'colorfamilies', color_family)
Esempio n. 11
0
    def add_menu_options(self, menu):
        """
        Add options to the menu for the detailed descendant report.
        """

        # Report Options
        category = _("Report Options")
        add_option = partial(menu.add_option, category)

        self.__pid = PersonOption(_("Center Person"))
        self.__pid.set_help(_("The center person for the report"))
        add_option("pid", self.__pid)


        numbering = EnumeratedListOption(_("Numbering system"), "Henry")
        numbering.set_items([
            ("Henry", _("Henry numbering")),
            ("Modified Henry", _("Modified 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)

        structure = EnumeratedListOption(_("Report structure"),
                                         "by generation")
        structure.set_items([
            ("by generation", _("show people by generations")),
            ("by lineage", _("show people by lineage"))])
        structure.set_help(_("How people are organized in the report"))
        add_option("structure", structure)

        gen = NumberOption(_("Generations"), 10, 1, 100)
        gen.set_help(_("The number of generations to include in the report"))
        add_option("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."))
        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)

        category = _("Report Options (2)")
        add_option = partial(menu.add_option, category)

        stdoptions.add_name_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

        add_option = partial(menu.add_option, _("Content"))

        verbose = BooleanOption(_("Use complete sentences"), True)
        verbose.set_help(
            _("Whether to use complete sentences or succinct language."))
        add_option("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."))
        add_option("fulldates", fulldates)

        computeage = BooleanOption(_("Compute death age"), True)
        computeage.set_help(_("Whether to compute a person's age at death."))
        add_option("computeage", computeage)

        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)

        # What to include

        add_option = partial(menu.add_option, _("Include"))

        listc = BooleanOption(_("Include children"), True)
        listc.set_help(_("Whether to list children."))
        add_option("listc", listc)

        listc_spouses = BooleanOption(_("Include spouses of children"), False)
        listc_spouses.set_help(
            _("Whether to list the spouses of the children."))
        add_option("listc_spouses", listc_spouses)

        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)

        incevents = BooleanOption(_("Include events"), False)
        incevents.set_help(_("Whether to include events."))
        add_option("incevents", incevents)

        desref = BooleanOption(
            _("Include descendant reference in child list"), True)
        desref.set_help(
            _("Whether to add descendant references in child list."))
        add_option("desref", desref)

        incphotos = BooleanOption(
            _("Include Photo/Images from Gallery"), False)
        incphotos.set_help(_("Whether to include images."))
        add_option("incphotos", incphotos)

        add_option = partial(menu.add_option, _("Include (2)"))

        incnotes = BooleanOption(_("Include notes"), True)
        incnotes.set_help(_("Whether to include notes."))
        add_option("incnotes", incnotes)

        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)

        incattrs = BooleanOption(_("Include attributes"), False)
        incattrs.set_help(_("Whether to include attributes."))
        add_option("incattrs", incattrs)

        incaddresses = BooleanOption(_("Include addresses"), False)
        incaddresses.set_help(_("Whether to include addresses."))
        add_option("incaddresses", incaddresses)

        incnames = BooleanOption(_("Include alternative names"), False)
        incnames.set_help(_("Whether to include other names."))
        add_option("incnames", incnames)

        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)

        # How to handle 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)
Esempio n. 12
0
    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)
Esempio n. 13
0
    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)
Esempio n. 14
0
    def add_menu_options(self, menu):
        """
        Create all the menu options for this report.
        """
        category_name = _("Report Options")

        pid = PersonOption(_("Center Person"))
        pid.set_help(_("The Center person for the graph"))
        menu.add_option(category_name, "pid", pid)

        max_gen_d = NumberOption(_('Max Descendant Generations'), 10, 1, 15)
        max_gen_d.set_help(_("The number of generations of descendants to "
                           "include in the graph"))
        menu.add_option(category_name, "maxdescend", max_gen_d)

        max_gen_a = NumberOption(_('Max Ancestor Generations'), 10, 1, 15)
        max_gen_a.set_help(_("The number of generations of ancestors to "
                           "include in the graph"))
        menu.add_option(category_name, "maxascend", max_gen_a)

        arrow = EnumeratedListOption(_("Arrowhead direction"), 'o')
        for i in range( 0, len(_ARROWS) ):
            arrow.add_item(_ARROWS[i]["value"], _ARROWS[i]["name"])
        arrow.set_help(_("Choose the direction that the arrows point."))
        menu.add_option(category_name, "arrow", arrow)

        color = EnumeratedListOption(_("Graph coloring"), "filled")
        for i in range(0, len(_COLORS)):
            color.add_item(_COLORS[i]["value"], _COLORS[i]["name"])
        color.set_help(_("Males will be shown with blue, females "
                         "with red.  If the sex of an individual "
                         "is unknown it will be shown with gray."))
        menu.add_option(category_name, "color", color)

        roundedcorners = BooleanOption(_("Use rounded corners"), False) # 2180
        roundedcorners.set_help(
            _("Use rounded corners to differentiate between women and men."))
        menu.add_option(category_name, "roundcorners", roundedcorners)

        stdoptions.add_gramps_id_option(menu, category_name, ownline=True)

        category_name = _("Report Options (2)")

        stdoptions.add_name_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)

        ################################
        category_name = _("Graph Style")
        ################################

        color_males = ColorOption(_('Males'), '#e0e0ff')
        color_males.set_help(_('The color to use to display men.'))
        menu.add_option(category_name, 'colormales', color_males)

        color_females = ColorOption(_('Females'), '#ffe0e0')
        color_females.set_help(_('The color to use to display women.'))
        menu.add_option(category_name, 'colorfemales', color_females)

        color_unknown = ColorOption(_('Unknown'), '#e0e0e0')
        color_unknown.set_help(_('The color to use '
                                 'when the gender is unknown.'))
        menu.add_option(category_name, 'colorunknown', color_unknown)

        color_family = ColorOption(_('Families'), '#ffffe0')
        color_family.set_help(_('The color to use to display families.'))
        menu.add_option(category_name, 'colorfamilies', color_family)