示例#1
0
def add_name_format_option(menu, category):
    """
    Insert an option for changing the report's name format to a
    report-specific format instead of the user's Edit=>Preferences choice
    """
    name_format = EnumeratedListOption(_("Name format"), 0)
    name_format.add_item(0, _("Default"))
    format_list = global_name_display.get_name_format()
    for number, name, format_string, whether_active in format_list:
        name_format.add_item(number, name)
    name_format.set_help(_("Select the format to display names"))
    menu.add_option(category, "name_format", name_format)
示例#2
0
    def add_menu_options(self, menu):
        category_name = _("Report Options")

        self.__filter = FilterOption(_("Filter"), 0)
        self.__filter.set_help(
            _("Select filter to restrict people that appear in the report"))
        menu.add_option(category_name, "filter", self.__filter)

        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)

        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)

        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)
    def add_menu_options(self, menu):
        category_name = _("Report Options")

        self.__filter = FilterOption(_("Filter"), 0)
        self.__filter.set_help(
               _("Select filter to restrict people that appear in the report"))
        menu.add_option(category_name, "filter", self.__filter)

        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)

        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)

        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)
示例#4
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)
示例#5
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)
示例#6
0
def add_name_format_option(menu, category):
    """
    Insert an option for changing the report's name format to a
    report-specific format instead of the user's Edit=>Preferences choice
    """
    name_format = EnumeratedListOption(_("Name format"), 0)
    name_format.add_item(0, _("Default"))
    format_list = global_name_display.get_name_format()
    for number, name, format_string, whether_active in format_list:
        name_format.add_item(number, name)
    name_format.set_help(_("Select the format to display names"))
    current_format = config.get('preferences.name-format')
    # if this report hasn't ever been run, start with user's current setting
    name_format.set_value(current_format)
    # if the report has been run, this line will get the user's old setting
    menu.add_option(category, "name_format", name_format)
    return name_format
示例#7
0
def add_name_format_option(menu, category):
    """
    Insert an option for changing the report's name format to a
    report-specific format instead of the user's Edit=>Preferences choice
    """
    name_format = EnumeratedListOption(_("Name format"), 0)
    name_format.add_item(0, _("Default"))
    format_list = global_name_display.get_name_format()
    for number, name, format_string, whether_active in format_list:
        name_format.add_item(number, name)
    name_format.set_help(_("Select the format to display names"))
    current_format = config.get('preferences.name-format')
    # if this report hasn't ever been run, start with user's current setting
    name_format.set_value(current_format)
    # if the report has been run, this line will get the user's old setting
    menu.add_option(category, "name_format", name_format)
    return name_format
示例#8
0
    def add_menu_options(self, menu):
        """
        Add options to the menu for the ancestral fan chart report.
        """
        category_name = _("Ancestral Fan Chart 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)

        self._maxgen = NumberOption(_("Include Generations"), 10, 1, 100)
        self._maxgen.set_help(
            _("The number of generations to include in " + "the report"))
        menu.add_option(category_name, "maxgen", self._maxgen)
        self._maxgen.connect('value-changed', self.validate_gen)

        pat_bg = ColorOption(_("Paternal Background Color"), "#ccddff")
        pat_bg.set_help(_("RGB-color for paternal box background."))
        menu.add_option(category_name, "pat_bg", pat_bg)

        mat_bg = ColorOption(_("Maternal Background"), "#ffb2a1")
        mat_bg.set_help(_("RGB-color for maternal box background."))
        menu.add_option(category_name, "mat_bg", mat_bg)

        dest_path = DestinationOption(_("Destination"),
                                      config.get('paths.website-directory'))
        dest_path.set_help(_("The destination path for generated files."))
        dest_path.set_directory_entry(True)
        menu.add_option(category_name, "dest_path", dest_path)

        dest_file = StringOption(_("Filename"), "AncestralFanchart.html")
        dest_file.set_help(_("The destination file name for html content."))
        menu.add_option(category_name, "dest_file", dest_file)
    def add_menu_options(self, menu):
        """
        Add options to the menu for the ancestral fan chart report.
        """
        category_name = _("Ancestral Fan Chart 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)

        self._maxgen = NumberOption(_("Include Generations"), 10, 1, 100)
        self._maxgen.set_help(_("The number of generations to include in " +
            "the report"))
        menu.add_option(category_name, "maxgen", self._maxgen)
        self._maxgen.connect('value-changed', self.validate_gen)

        pat_bg = ColorOption(_("Paternal Background Color"), "#ccddff")
        pat_bg.set_help(_("RGB-color for paternal box background."))
        menu.add_option(category_name, "pat_bg", pat_bg)

        mat_bg = ColorOption(_("Maternal Background"), "#ffb2a1")
        mat_bg.set_help(_("RGB-color for maternal box background."))
        menu.add_option(category_name, "mat_bg", mat_bg)

        dest_path = DestinationOption(_("Destination"),
            config.get('paths.website-directory'))
        dest_path.set_help(_("The destination path for generated files."))
        dest_path.set_directory_entry(True)
        menu.add_option(category_name, "dest_path", dest_path)

        dest_file = StringOption(_("Filename"), "AncestralFanchart.html")
        dest_file.set_help(_("The destination file name for html content."))
        menu.add_option(category_name, "dest_file", dest_file)
示例#10
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)
    def add_menu_options(self, menu):
        """
        Add options to the menu for the ancestral collapsible tree report.
        """
        category_name = _("Ancestral Collapsible Tree Options")

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

        pid = menu.get_option_by_name('pid').get_value()
        center_person = self._dbase.get_person_from_gramps_id(
            menu.get_option_by_name('pid').get_value())
        if center_person :
            name_str = global_name_display.display_formal(center_person)
        else:
            name_str = ""

        # 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.maxgen = NumberOption(_("Include Generations"), 10, 1, 100)
        self.maxgen.set_help(_("The number of generations to include in the " +
            "report"))
        menu.add_option(category_name, "maxgen", self.maxgen)
        self.maxgen.connect('value-changed', self.validate_gen)

        male_bg = ColorOption(_("Male Background Color"), "#ffffff")
        male_bg.set_help(_("RGB-color for male box background."))
        menu.add_option(category_name, "male_bg", male_bg)

        exp_male_bg = ColorOption(_("Male Expandable Background Color"),
            "#B4C4D9")
        exp_male_bg.set_help(_("RGB-color for male expandable box background."))
        menu.add_option(category_name, "exp_male_bg", exp_male_bg)

        female_bg = ColorOption(_("Female Background"), "#ffffff")
        female_bg.set_help(_("RGB-color for female box background."))
        menu.add_option(category_name, "female_bg", female_bg)

        exp_female_bg = ColorOption(_("Female Expandable Background"),
            "#F0D5D7")
        exp_female_bg.set_help(_("RGB-color for female expandable box " +
            "background."))
        menu.add_option(category_name, "exp_female_bg", exp_female_bg)

        dest_path = DestinationOption(_("Destination"),
            config.get('paths.website-directory'))
        dest_path.set_help(_("The destination path for generated files."))
        dest_path.set_directory_entry(True)
        menu.add_option(category_name, "dest_path", dest_path)

        dest_file = StringOption(_("Filename"), "AncestralCollapsible.html")
        dest_file.set_help(_("The destination file name for html content."))
        menu.add_option(category_name, "dest_file", dest_file)
示例#12
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)
示例#13
0
    def add_menu_options(self, menu):
        """
        Add options to the menu for the ancestral collapsible tree report.
        """
        category_name = _("Ancestral Collapsible Tree Options")

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

        pid = menu.get_option_by_name('pid').get_value()
        center_person = self._dbase.get_person_from_gramps_id(
            menu.get_option_by_name('pid').get_value())
        if center_person:
            name_str = global_name_display.display_formal(center_person)
        else:
            name_str = ""

        # 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.maxgen = NumberOption(_("Include Generations"), 10, 1, 100)
        self.maxgen.set_help(
            _("The number of generations to include in the " + "report"))
        menu.add_option(category_name, "maxgen", self.maxgen)
        self.maxgen.connect('value-changed', self.validate_gen)

        male_bg = ColorOption(_("Male Background Color"), "#ffffff")
        male_bg.set_help(_("RGB-color for male box background."))
        menu.add_option(category_name, "male_bg", male_bg)

        exp_male_bg = ColorOption(_("Male Expandable Background Color"),
                                  "#B4C4D9")
        exp_male_bg.set_help(
            _("RGB-color for male expandable box background."))
        menu.add_option(category_name, "exp_male_bg", exp_male_bg)

        female_bg = ColorOption(_("Female Background"), "#ffffff")
        female_bg.set_help(_("RGB-color for female box background."))
        menu.add_option(category_name, "female_bg", female_bg)

        exp_female_bg = ColorOption(_("Female Expandable Background"),
                                    "#F0D5D7")
        exp_female_bg.set_help(
            _("RGB-color for female expandable box " + "background."))
        menu.add_option(category_name, "exp_female_bg", exp_female_bg)

        dest_path = DestinationOption(_("Destination"),
                                      config.get('paths.website-directory'))
        dest_path.set_help(_("The destination path for generated files."))
        dest_path.set_directory_entry(True)
        menu.add_option(category_name, "dest_path", dest_path)

        dest_file = StringOption(_("Filename"), "AncestralCollapsible.html")
        dest_file.set_help(_("The destination file name for html content."))
        menu.add_option(category_name, "dest_file", dest_file)