예제 #1
0
    def add_menu_options(self, menu):
        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)

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

        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)
예제 #2
0
    def add_menu_options(self, menu):
        """
        Add options to the menu for the End of Line 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)
예제 #3
0
    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)
예제 #4
0
    def add_menu_options(self, menu):
        """
        Add options to the menu for the kinship 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)

        maxdescend = NumberOption(_("Max Descendant Generations"), 2, 1, 20)
        maxdescend.set_help(_("The maximum number of descendant generations"))
        menu.add_option(category_name, "maxdescend", maxdescend)
        
        maxascend = NumberOption(_("Max Ancestor Generations"), 2, 1, 20)
        maxascend.set_help(_("The maximum number of ancestor generations"))
        menu.add_option(category_name, "maxascend", maxascend)
        
        incspouses = BooleanOption(_("Include spouses"), True)
        incspouses.set_help(_("Whether to include spouses"))
        menu.add_option(category_name, "incspouses", incspouses)
        
        inccousins = BooleanOption(_("Include cousins"), True)
        inccousins.set_help(_("Whether to include cousins"))
        menu.add_option(category_name, "inccousins", inccousins)
        
        incaunts = BooleanOption(_("Include aunts/uncles/nephews/nieces"), True)
        incaunts.set_help(_("Whether to include aunts/uncles/nephews/nieces"))
        menu.add_option(category_name, "incaunts", incaunts)        
예제 #5
0
    def add_menu_options(self, menu):
        """ Add the options for the graphical calendar """
        add_option = partial(menu.add_option, _("Report Options"))
        year = NumberOption(_("Year of calendar"),
                            time.localtime()[0], 1000, 3000)
        year.set_help(_("Year of calendar"))
        add_option("year", year)

        self.__filter = FilterOption(_("Filter"), 0)
        self.__filter.set_help(
            _("Select filter to restrict people that appear on calendar"))
        add_option("filter", self.__filter)

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

        self.__update_filters()

        # We must figure out the value of the first option before we can
        # create the EnumeratedListOption
        fmt_list = _nd.get_name_format()
        name_format = EnumeratedListOption(_("Name format"), fmt_list[0][0])
        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)

        country = EnumeratedListOption(_("Country for holidays"), 0)
        holiday_table = libholiday.HolidayTable()
        countries = holiday_table.get_countries()
        countries.sort()
        if (len(countries) == 0
                or (len(countries) > 0 and countries[0] != '')):
            countries.insert(0, '')
        count = 0
        for c in countries:
            country.add_item(count, c)
            count += 1
        country.set_help(_("Select the country to see associated holidays"))
        add_option("country", country)

        start_dow = EnumeratedListOption(_("First day of week"), 1)
        for count in range(1, 8):
            # conversion between gramps numbering (sun=1) and iso numbering (mon=1) of weekdays below
            start_dow.add_item((count + 5) % 7 + 1,
                               GrampsLocale.long_days[count].capitalize())
        start_dow.set_help(
            _("Select the first day of the week for the calendar"))
        add_option("start_dow", start_dow)

        maiden_name = EnumeratedListOption(_("Birthday surname"), "own")
        maiden_name.add_item(
            "spouse_first",
            _("Wives use husband's surname (from first family listed)"))
        maiden_name.add_item(
            "spouse_last",
            _("Wives use husband's surname (from last family listed)"))
        maiden_name.add_item("own", _("Wives use their own surname"))
        maiden_name.set_help(_("Select married women's displayed surname"))
        add_option("maiden_name", maiden_name)

        alive = BooleanOption(_("Include only living people"), True)
        alive.set_help(_("Include only living people in the calendar"))
        add_option("alive", alive)

        birthdays = BooleanOption(_("Include birthdays"), True)
        birthdays.set_help(_("Include birthdays in the calendar"))
        add_option("birthdays", birthdays)

        anniversaries = BooleanOption(_("Include anniversaries"), True)
        anniversaries.set_help(_("Include anniversaries in the calendar"))
        add_option("anniversaries", anniversaries)

        category_name = _("Text Options")
        add_option = partial(menu.add_option, _("Text Options"))

        text1 = StringOption(_("Text Area 1"), _("My Calendar"))
        text1.set_help(_("First line of text at bottom of calendar"))
        add_option("text1", text1)

        text2 = StringOption(_("Text Area 2"), _("Produced with Gramps"))
        text2.set_help(_("Second line of text at bottom of calendar"))
        add_option("text2", text2)

        text3 = StringOption(
            _("Text Area 3"),
            "http://gramps-project.org/",
        )
        text3.set_help(_("Third line of text at bottom of calendar"))
        add_option("text3", text3)
예제 #6
0
    def add_menu_options(self, menu):

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

        family_id = FamilyOption(_("Center Family"))
        family_id.set_help(_("The center family for the report"))
        add_option("family_id", family_id)

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

        recursive = BooleanOption(_('Recursive'), False)
        recursive.set_help(
            _("Create reports for all descendants "
              "of this family."))
        add_option("recursive", recursive)

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

        generations = BooleanOption(
            _("Generation numbers "
              "(recursive only)"), True)
        generations.set_help(
            _("Whether to include the generation on each "
              "report (recursive only)."))
        add_option("generations", generations)

        incParEvents = BooleanOption(_("Parent Events"), False)
        incParEvents.set_help(_("Whether to include events for parents."))
        add_option("incParEvents", incParEvents)

        incParAddr = BooleanOption(_("Parent Addresses"), False)
        incParAddr.set_help(_("Whether to include addresses for parents."))
        add_option("incParAddr", incParAddr)

        incParNotes = BooleanOption(_("Parent Notes"), False)
        incParNotes.set_help(_("Whether to include notes for parents."))
        add_option("incParNotes", incParNotes)

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

        incParNames = BooleanOption(_("Alternate Parent Names"), False)
        incParNames.set_help(
            _("Whether to include alternate "
              "names for parents."))
        add_option("incParNames", incParNames)

        incParMar = BooleanOption(_("Parent Marriage"), False)
        incParMar.set_help(
            _("Whether to include marriage information "
              "for parents."))
        add_option("incParMar", incParMar)

        incRelDates = BooleanOption(_("Dates of Relatives"), False)
        incRelDates.set_help(
            _("Whether to include dates for relatives "
              "(father, mother, spouse)."))
        add_option("incRelDates", incRelDates)

        incChiMar = BooleanOption(_("Children Marriages"), True)
        incChiMar.set_help(
            _("Whether to include marriage information "
              "for children."))
        add_option("incChiMar", incChiMar)

        ##########################
        add_option = partial(menu.add_option, _("Missing Information"))
        ##########################

        missinginfo = BooleanOption(
            _("Print fields for missing "
              "information"), True)
        missinginfo.set_help(
            _("Whether to include fields for missing "
              "information."))
        add_option("missinginfo", missinginfo)
예제 #7
0
    def _setup_fields(self):
        self.group_as = MonitoredEntry(self.top.get_object("group_as"),
                                       self.obj.set_group_as,
                                       self.obj.get_group_as, self.db.readonly)

        if not self.original_group_set:
            if self.global_group_set:
                self.group_as.force_value(self.global_group_as)
            else:
                self.group_as.force_value(
                    self.obj.get_primary_surname().get_surname())

        format_list = [
            (name, number)
            for (number, name, fmt_str,
                 act) in name_displayer.get_name_format(also_default=True)
        ]

        self.sort_as = MonitoredMenu(self.top.get_object('sort_as'),
                                     self.obj.set_sort_as,
                                     self.obj.get_sort_as, format_list,
                                     self.db.readonly)

        self.display_as = MonitoredMenu(self.top.get_object('display_as'),
                                        self.obj.set_display_as,
                                        self.obj.get_display_as, format_list,
                                        self.db.readonly)

        self.given_field = MonitoredEntry(self.top.get_object("given_name"),
                                          self.obj.set_first_name,
                                          self.obj.get_first_name,
                                          self.db.readonly)

        self.call_field = MonitoredEntry(self.top.get_object("call"),
                                         self.obj.set_call_name,
                                         self.obj.get_call_name,
                                         self.db.readonly)
        self.call_field.connect("validate", self._validate_call)
        #force validation now with initial entry
        self.call_field.obj.validate(force=True)

        self.title_field = MonitoredEntry(self.top.get_object("title_field"),
                                          self.obj.set_title,
                                          self.obj.get_title, self.db.readonly)

        self.suffix_field = MonitoredEntry(self.top.get_object("suffix"),
                                           self.obj.set_suffix,
                                           self.obj.get_suffix,
                                           self.db.readonly)

        self.nick = MonitoredEntry(self.top.get_object("nickname"),
                                   self.obj.set_nick_name,
                                   self.obj.get_nick_name, self.db.readonly)

        self.famnick = MonitoredEntry(self.top.get_object("familynickname"),
                                      self.obj.set_family_nick_name,
                                      self.obj.get_family_nick_name,
                                      self.db.readonly)

        #self.surname_field = MonitoredEntry(
        #    self.top.get_object("alt_surname"),
        #    self.obj.set_surname,
        #    self.obj.get_surname,
        #    self.db.readonly,
        #    autolist=self.db.get_surname_list() if not self.db.readonly else [],
        #    changed=self.update_group_as)

        self.date = MonitoredDate(self.top.get_object("date_entry"),
                                  self.top.get_object("date_stat"),
                                  self.obj.get_date_object(), self.uistate,
                                  self.track, self.db.readonly)

        self.obj_combo = MonitoredDataType(
            self.top.get_object("ntype"),
            self.obj.set_type,
            self.obj.get_type,
            self.db.readonly,
            self.db.get_name_types(),
        )

        self.privacy = PrivacyButton(self.top.get_object("priv"), self.obj,
                                     self.db.readonly)
예제 #8
0
    def add_menu_options(self, menu):
        ################################
        category_name = _("Report Options")
        ################################

        self.__filter = FilterOption(_("Filter"), 0)
        self.__filter.set_help(
            _("Select the filter to be applied to the report."))
        menu.add_option(category_name, "filter", self.__filter)
        self.__filter.connect('value-changed', self.__filter_changed)

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

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

        self.__update_filters()

        sort = BooleanOption(_("List events chronologically"), True)
        sort.set_help(_("Whether to sort events into chronological order."))
        menu.add_option(category_name, "sort", sort)

        pageben = BooleanOption(_("Page break before end notes"), False)
        pageben.set_help(
            _("Whether to start a new page before the end notes."))
        menu.add_option(category_name, "pageben", pageben)

        cites = BooleanOption(_("Include Source Information"), True)
        cites.set_help(_("Whether to cite sources."))
        menu.add_option(category_name, "cites", cites)

        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."))
        menu.add_option(category_name, "incsrcnotes", incsrcnotes)

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

        ################################
        category_name = SECTION_CATEGORY
        ################################
        opt = BooleanListOption(_("Event groups"))
        opt.set_help(_("Check if a separate section is required."))
        for section in SECTION_LIST:
            if section != SECTION_LIST[0]:
                opt.add_button(section, True)

        menu.add_option(category_name, "sections", opt)
예제 #9
0
    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)