diff --git a/gramps/gui/configure.py b/gramps/gui/configure.py
index a612db7e0..38d1e394e 100644
--- a/gramps/gui/configure.py
+++ b/gramps/gui/configure.py
@@ -362,11 +362,11 @@ class ConfigureDialog(ManagedWindow):
text.set_text(label)
text.set_halign(align)
text.set_justify(justify)
- text.set_hexpand(True)
grid.attach(text, start, index, stop - start, 1)
return text
- def add_button(self, grid, label, index, constant, extra_callback=None, config=None):
+ def add_button(self, grid, label, index, constant, extra_callback=None,
+ config=None):
if not config:
config = self.__config
button = Gtk.Button(label=label)
@@ -558,16 +558,18 @@ class GrampsPreferences(ConfigureDialog):
def __init__(self, uistate, dbstate):
page_funcs = (
- self.add_behavior_panel,
+ self.add_data_panel,
+ self.add_general_panel,
+ self.add_addons_panel,
self.add_famtree_panel,
- self.add_formats_panel,
- self.add_text_panel,
- self.add_prefix_panel,
- self.add_date_panel,
- self.add_researcher_panel,
- self.add_advanced_panel,
+ self.add_import_panel,
+ self.add_limits_panel,
self.add_color_panel,
- self.add_symbols_panel
+ self.add_symbols_panel,
+ self.add_idformats_panel,
+ self.add_text_panel,
+ self.add_warnings_panel,
+ self.add_researcher_panel,
)
ConfigureDialog.__init__(self, uistate, dbstate, page_funcs,
GrampsPreferences, config,
@@ -592,80 +594,96 @@ class GrampsPreferences(ConfigureDialog):
Add the Researcher tab to the preferences.
"""
grid = self.create_grid()
- row = 0
- self.add_text(
- grid, _('Researcher information'), row,
- line_wrap=True, start=0, stop=2, justify=Gtk.Justification.CENTER,
- align=Gtk.Align.CENTER, bold=True)
- row += 1
- self.add_text(
- grid, _('Enter information about yourself so people can contact '
- 'you when you distribute your Family Tree'), row,
- line_wrap=True, start=0, stop=2, justify=Gtk.Justification.CENTER,
- align=Gtk.Align.CENTER)
+ label = self.add_text(
+ grid, _("Researcher"), 0,
+ line_wrap=True, bold=True, start=0, stop=7)
+ label.set_margin_top(10)
+
+ row = 1
+ self.add_entry(grid, _('Name'), row, 'researcher.researcher-name',
+ col_attach=1)
row += 1
- self.add_entry(grid, _('Name'), row, 'researcher.researcher-name')
- row += 1
- self.add_entry(grid, _('Address'), row, 'researcher.researcher-addr')
+ self.add_entry(grid, _('Address'), row, 'researcher.researcher-addr',
+ col_attach=1)
row += 1
self.add_entry(grid, _('Locality'), row,
- 'researcher.researcher-locality')
+ 'researcher.researcher-locality', col_attach=1)
row += 1
- self.add_entry(grid, _('City'), row, 'researcher.researcher-city')
+ self.add_entry(grid, _('City'), row, 'researcher.researcher-city',
+ col_attach=1)
row += 1
self.add_entry(grid, _('State/County'), row,
- 'researcher.researcher-state')
+ 'researcher.researcher-state', col_attach=1)
row += 1
self.add_entry(grid, _('Country'), row,
- 'researcher.researcher-country')
+ 'researcher.researcher-country', col_attach=1)
row += 1
self.add_entry(grid, _('ZIP/Postal Code'), row,
- 'researcher.researcher-postal')
+ 'researcher.researcher-postal', col_attach=1)
row += 1
- self.add_entry(grid, _('Phone'), row, 'researcher.researcher-phone')
+ self.add_entry(grid, _('Phone'), row, 'researcher.researcher-phone',
+ col_attach=1)
row += 1
- self.add_entry(grid, _('Email'), row, 'researcher.researcher-email')
+ self.add_entry(grid, _('Email'), row, 'researcher.researcher-email',
+ col_attach=1)
+
+ row += 1
+ label = self.add_text(
+ grid, _('Enter information about yourself so people can contact '
+ 'you when you distribute your Family Tree.'), row,
+ line_wrap=True, start=0, stop=9)
+ label.set_margin_top(10)
+
return _('Researcher'), grid
- def add_prefix_panel(self, configdialog):
+ def add_idformats_panel(self, configdialog):
"""
Add the ID prefix tab to the preferences.
"""
grid = self.create_grid()
- self.add_text(
- grid, _('Gramps ID format settings'), 0,
- line_wrap=True, start=0, stop=2, justify=Gtk.Justification.CENTER,
- align=Gtk.Align.CENTER, bold=True)
+ label = self.add_text(
+ grid, _("ID Formats"), 0,
+ line_wrap=True, bold=True, start=0, stop=7)
+ label.set_margin_top(10)
row = 1
self.add_entry(grid, _('Person'), row, 'preferences.iprefix',
- self.update_idformat_entry)
+ self.update_idformat_entry, col_attach=1)
row += 1
self.add_entry(grid, _('Family'), row, 'preferences.fprefix',
- self.update_idformat_entry)
+ self.update_idformat_entry, col_attach=1)
row += 1
self.add_entry(grid, _('Place'), row, 'preferences.pprefix',
- self.update_idformat_entry)
+ self.update_idformat_entry, col_attach=1)
row += 1
self.add_entry(grid, _('Source'), row, 'preferences.sprefix',
- self.update_idformat_entry)
+ self.update_idformat_entry, col_attach=1)
row += 1
self.add_entry(grid, _('Citation'), row, 'preferences.cprefix',
- self.update_idformat_entry)
+ self.update_idformat_entry, col_attach=1)
row += 1
self.add_entry(grid, _('Media Object'), row, 'preferences.oprefix',
- self.update_idformat_entry)
+ self.update_idformat_entry, col_attach=1)
row += 1
self.add_entry(grid, _('Event'), row, 'preferences.eprefix',
- self.update_idformat_entry)
+ self.update_idformat_entry, col_attach=1)
row += 1
self.add_entry(grid, _('Repository'), row, 'preferences.rprefix',
- self.update_idformat_entry)
+ self.update_idformat_entry, col_attach=1)
row += 1
self.add_entry(grid, _('Note'), row, 'preferences.nprefix',
- self.update_idformat_entry)
+ self.update_idformat_entry, col_attach=1)
+ row += 1
+ label = self.add_text(
+ grid, _('Default Gramps ID formats containing a letter prefix'
+ ' followed by a numerical string. "I%04d" creates IDs'
+ ' from I0000 to I9999. Large databases may need larger'
+ ' IDs. "I%06d" creates IDs from I000000 to I999999.\n'),
+ row, line_wrap=True, start=0, stop=9)
+ label.set_margin_top(10)
+
return _('ID Formats'), grid
def add_color_panel(self, configdialog):
@@ -673,10 +691,11 @@ class GrampsPreferences(ConfigureDialog):
Add the tab to set defaults colors for graph boxes.
"""
grid = self.create_grid()
- self.add_text(
+
+ label = self.add_text(
grid, _('Colors used for boxes in the graphical views'),
- 0, line_wrap=True, start=0, stop=7, bold=True,
- justify=Gtk.Justification.CENTER, align=Gtk.Align.CENTER)
+ 0, line_wrap=True, start=0, stop=7, bold=True)
+ label.set_margin_top(10)
hbox = Gtk.Box(spacing=12)
self.color_scheme_box = Gtk.ComboBoxText()
@@ -695,7 +714,7 @@ class GrampsPreferences(ConfigureDialog):
_('Restore colors for current theme to default.'))
restore_btn.connect('clicked', self.restore_colors)
hbox.pack_start(restore_btn, False, False, 0)
- hbox.set_halign(Gtk.Align.CENTER)
+ hbox.set_margin_start(6)
grid.attach(hbox, 0, 1, 7, 1)
color_type = {'Male': _('Colors for Male persons'),
@@ -745,6 +764,7 @@ class GrampsPreferences(ConfigureDialog):
# prepare scrolled window for colors settings
scroll_window = Gtk.ScrolledWindow()
colors_grid = self.create_grid()
+ colors_grid.set_border_width(0)
scroll_window.add(colors_grid)
scroll_window.set_vexpand(True)
scroll_window.set_policy(Gtk.PolicyType.NEVER,
@@ -784,34 +804,34 @@ class GrampsPreferences(ConfigureDialog):
Gdk.RGBA.parse(color, hexval)
widget.set_rgba(color)
- def add_advanced_panel(self, configdialog):
+ def add_warnings_panel(self, configdialog):
"""
Config tab for Warnings and Error dialogs.
"""
grid = self.create_grid()
- self.add_text(
- grid, _('Warnings and Error dialogs'), 0, line_wrap=True,
- justify=Gtk.Justification.CENTER, align=Gtk.Align.CENTER,
- bold=True)
+ label = self.add_text(
+ grid, _("Warnings and Error dialogs"), 0,
+ line_wrap=True, bold=True, start=0, stop=9)
+ label.set_margin_top(10)
row = 1
self.add_checkbox(
grid, _('Suppress warning when adding parents to a child'),
- row, 'preferences.family-warn')
+ row, 'preferences.family-warn', start=1)
row += 1
self.add_checkbox(
grid, _('Suppress warning when canceling with changed data'),
- row, 'interface.dont-ask')
+ row, 'interface.dont-ask', start=1)
row += 1
self.add_checkbox(
grid, _('Suppress warning about missing researcher when'
' exporting to GEDCOM'),
- row, 'behavior.owner-warn')
+ row, 'behavior.owner-warn', start=1)
row += 1
self.add_checkbox(
grid, _('Show plugin status dialog on plugin load error'),
- row, 'behavior.pop-plugin-status')
+ row, 'behavior.pop-plugin-status', start=1)
return _('Warnings'), grid
@@ -1143,18 +1163,43 @@ class GrampsPreferences(ConfigureDialog):
"""
self.uistate.emit('grampletbar-close-changed')
- def add_formats_panel(self, configdialog):
+ def add_data_panel(self, configdialog):
"""
- Config tab with Appearance and format settings.
+ Config tab with user Appearance and format settings.
"""
grid = self.create_grid()
- self.add_text(
- grid, _('Appearance and format settings'), 0,
- line_wrap=True, start=0, stop=3, justify=Gtk.Justification.CENTER,
- align=Gtk.Align.CENTER, bold=True)
+ label = self.add_text(
+ grid, _("Display Options"), 0,
+ line_wrap=True, bold=True, start=0, stop=3)
+ label.set_margin_top(10)
row = 1
+ # Place format:
+ self.pformat = Gtk.ComboBox()
+ self.pformat.set_hexpand(True)
+ renderer = Gtk.CellRendererText()
+ self.pformat.pack_start(renderer, True)
+ self.pformat.add_attribute(renderer, "text", 0)
+ self.cb_place_fmt_rebuild()
+ active = config.get('preferences.place-format')
+ self.pformat.set_active(active)
+ self.pformat.connect('changed', self.cb_place_fmt_changed)
+ hbox = Gtk.Box()
+ self.fmt_btn = Gtk.Button(label=("%s..." % _('Edit')))
+ self.fmt_btn.connect('clicked', self.cb_place_fmt_dialog)
+ cb_widget = self.add_checkbox(
+ grid, _("%s: ") % _('Automate Place format'),
+ row, 'preferences.place-auto', start=1, stop=2,
+ extra_callback=self.auto_title_changed,
+ tooltip=_("Enables automatic place title generation "
+ "using specified format."))
+ self.auto_title_changed(cb_widget)
+ hbox.pack_start(self.pformat, True, True, 0)
+ hbox.pack_start(self.fmt_btn, False, False, 0)
+ grid.attach(hbox, 2, row, 2, 1)
+
+ row += 1
# Display name:
self.examplename = Name()
examplesurname = Surname()
@@ -1199,14 +1244,21 @@ class GrampsPreferences(ConfigureDialog):
btn.connect('clicked', self.cb_name_dialog)
hbox.pack_start(self.fmt_obox, True, True, 0)
hbox.pack_start(btn, False, False, 0)
- grid.attach(lwidget, 0, row, 1, 1)
- grid.attach(hbox, 1, row, 2, 1)
+ grid.attach(lwidget, 1, row, 1, 1)
+ grid.attach(hbox, 2, row, 2, 1)
+
+ row += 1
+ label = self.add_text(
+ grid, _('Custom name display options are unique to'
+ ' each family tree.'), row,
+ line_wrap=True, start=2, stop=9)
+ #label.set_margin_top(6)
row += 1
# Pa/Matronymic surname handling
self.add_checkbox(
grid, _("Consider single pa/matronymic as surname"),
- row, 'preferences.patronimic-surname', start=0, stop=2,
+ row, 'preferences.patronimic-surname', start=2, stop=3,
extra_callback=self.cb_pa_sur_changed)
row += 1
@@ -1219,33 +1271,9 @@ class GrampsPreferences(ConfigureDialog):
active = 0
obox.set_active(active)
obox.connect('changed', self.date_format_changed)
- lwidget = BasicLabel(_("%s: ") % _('Date format'))
- grid.attach(lwidget, 0, row, 1, 1)
- grid.attach(obox, 1, row, 2, 1)
-
- row += 1
- # Place format:
- self.pformat = Gtk.ComboBox()
- renderer = Gtk.CellRendererText()
- self.pformat.pack_start(renderer, True)
- self.pformat.add_attribute(renderer, "text", 0)
- self.cb_place_fmt_rebuild()
- active = config.get('preferences.place-format')
- self.pformat.set_active(active)
- self.pformat.connect('changed', self.cb_place_fmt_changed)
- hbox = Gtk.Box()
- self.fmt_btn = Gtk.Button(label=("%s..." % _('Edit')))
- self.fmt_btn.connect('clicked', self.cb_place_fmt_dialog)
- cb_widget = self.add_checkbox(
- grid, _("%s: ") % _('Place format (auto place title)'),
- row, 'preferences.place-auto', start=0, stop=1,
- extra_callback=self.auto_title_changed,
- tooltip=_("Enables automatic place title generation "
- "using specified format."))
- self.auto_title_changed(cb_widget)
- hbox.pack_start(self.pformat, True, True, 0)
- hbox.pack_start(self.fmt_btn, False, False, 0)
- grid.attach(hbox, 1, row, 2, 1)
+ lwidget = BasicLabel(_("%s: ") % _('Date format *'))
+ grid.attach(lwidget, 1, row, 1, 1)
+ grid.attach(obox, 2, row, 2, 1)
row += 1
# Age precision:
@@ -1266,9 +1294,9 @@ class GrampsPreferences(ConfigureDialog):
lambda obj: config.set('preferences.age-display-precision',
obj.get_active() + 1))
lwidget = BasicLabel(_("%s: ")
- % _('Age display precision (requires restart)'))
- grid.attach(lwidget, 0, row, 1, 1)
- grid.attach(obox, 1, row, 2, 1)
+ % _('Age display precision *'))
+ grid.attach(lwidget, 1, row, 1, 1)
+ grid.attach(obox, 2, row, 2, 1)
row += 1
# Calendar format on report:
@@ -1280,41 +1308,8 @@ class GrampsPreferences(ConfigureDialog):
obox.set_active(active)
obox.connect('changed', self.date_calendar_changed)
lwidget = BasicLabel(_("%s: ") % _('Calendar on reports'))
- grid.attach(lwidget, 0, row, 1, 1)
- grid.attach(obox, 1, row, 2, 1)
-
- row += 1
- # Surname guessing:
- obox = Gtk.ComboBoxText()
- formats = _surname_styles
- list(map(obox.append_text, formats))
- obox.set_active(config.get('behavior.surname-guessing'))
- obox.connect('changed',
- lambda obj: config.set('behavior.surname-guessing',
- obj.get_active()))
- lwidget = BasicLabel(_("%s: ") % _('Surname guessing'))
- grid.attach(lwidget, 0, row, 1, 1)
- grid.attach(obox, 1, row, 2, 1)
-
- row += 1
- # Default Family Relationship
- obox = Gtk.ComboBoxText()
- formats = FamilyRelType().get_standard_names()
- list(map(obox.append_text, formats))
- obox.set_active(config.get('preferences.family-relation-type'))
- obox.connect('changed',
- lambda obj: config.set('preferences.family-relation-type',
- obj.get_active()))
- lwidget = BasicLabel(_("%s: ") % _('Default family relationship'))
- grid.attach(lwidget, 0, row, 1, 1)
- grid.attach(obox, 1, row, 2, 1)
-
- row += 1
- # height multiple surname table
- self.add_pos_int_entry(
- grid, _('Height multiple surname box (pixels)'),
- row, 'interface.surname-box-height', self.update_surn_height,
- col_attach=0)
+ grid.attach(lwidget, 1, row, 1, 1)
+ grid.attach(obox, 2, row, 2, 1)
row += 1
# Status bar:
@@ -1331,27 +1326,48 @@ class GrampsPreferences(ConfigureDialog):
lambda obj: config.set('interface.statusbar',
2 * obj.get_active()))
lwidget = BasicLabel(_("%s: ") % _('Status bar'))
- grid.attach(lwidget, 0, row, 1, 1)
- grid.attach(obox, 1, row, 2, 1)
+ grid.attach(lwidget, 1, row, 1, 1)
+ grid.attach(obox, 2, row, 2, 1)
row += 1
- # Text in sidebar:
- self.add_checkbox(
- grid, _("Show text label beside Navigator buttons "
- "(requires restart)"),
- row, 'interface.sidebar-text', start=0, stop=2,
- tooltip=_("Show or hide text beside Navigator buttons "
- "(People, Families, Events...).\n"
- "Requires Gramps restart to apply."))
+ label = self.add_text(
+ grid, _("\nInput Options"), row,
+ line_wrap=True, bold=True, start=0, stop=3)
+ label.set_margin_top(10)
+
row += 1
- # Gramplet bar close buttons:
- self.add_checkbox(
- grid, _("Show close button in gramplet bar tabs"),
- row, 'interface.grampletbar-close', start=0, stop=2,
- extra_callback=self.cb_grampletbar_close,
- tooltip=_("Show close button to simplify removing gramplets "
- "from bars."))
- return _('Display'), grid
+ # Surname guessing:
+ obox = Gtk.ComboBoxText()
+ formats = _surname_styles
+ list(map(obox.append_text, formats))
+ obox.set_active(config.get('behavior.surname-guessing'))
+ obox.connect('changed',
+ lambda obj: config.set('behavior.surname-guessing',
+ obj.get_active()))
+ lwidget = BasicLabel(_("%s: ") % _('Surname guessing'))
+ grid.attach(lwidget, 1, row, 1, 1)
+ grid.attach(obox, 2, row, 2, 1)
+
+ row += 1
+ # Default Family Relationship
+ obox = Gtk.ComboBoxText()
+ formats = FamilyRelType().get_standard_names()
+ list(map(obox.append_text, formats))
+ obox.set_active(config.get('preferences.family-relation-type'))
+ obox.connect('changed',
+ lambda obj: config.set('preferences.family-relation-type',
+ obj.get_active()))
+ lwidget = BasicLabel(_("%s: ") % _('Default family relationship'))
+ grid.attach(lwidget, 1, row, 1, 1)
+ grid.attach(obox, 2, row, 2, 1)
+
+ row += 1
+ label = self.add_text(
+ grid, _("* Requires Restart"), row,
+ line_wrap=True, bold=True, start=0, stop=3)
+ label.set_margin_top(10)
+
+ return _('Data'), grid
def auto_title_changed(self, obj):
"""
@@ -1367,31 +1383,31 @@ class GrampsPreferences(ConfigureDialog):
"""
grid = self.create_grid()
- self.add_text(
- grid, _('Default text used for conditions'), 0,
- line_wrap=True, start=0, stop=2, justify=Gtk.Justification.CENTER,
- align=Gtk.Align.CENTER, bold=True)
+ label = self.add_text(
+ grid, _("Conditional Text Replacements"), 0,
+ line_wrap=True, bold=True, start=0, stop=7)
+ label.set_margin_top(10)
row = 1
self.add_entry(grid, _('Missing surname'), row,
- 'preferences.no-surname-text')
+ 'preferences.no-surname-text', col_attach=1)
row += 1
self.add_entry(grid, _('Missing given name'), row,
- 'preferences.no-given-text')
+ 'preferences.no-given-text', col_attach=1)
row += 1
self.add_entry(grid, _('Missing record'), row,
- 'preferences.no-record-text')
+ 'preferences.no-record-text', col_attach=1)
row += 1
self.add_entry(grid, _('Private surname'), row,
'preferences.private-surname-text',
- localized_config=False)
+ col_attach=1, localized_config=False)
row += 1
self.add_entry(grid, _('Private given name'), row,
'preferences.private-given-text',
- localized_config=False)
+ col_attach=1, localized_config=False)
row += 1
self.add_entry(grid, _('Private record'), row,
- 'preferences.private-record-text')
+ 'preferences.private-record-text', col_attach=1)
row += 1
return _('Text'), grid
@@ -1470,6 +1486,12 @@ class GrampsPreferences(ConfigureDialog):
"""
config.set('preferences.calendar-format-report', obj.get_active())
+ def date_calendar_for_input_changed(self, obj):
+ """
+ Save "Date calendar for input" option.
+ """
+ config.set('preferences.calendar-format-input', obj.get_active())
+
def autobackup_changed(self, obj):
"""
Save "Autobackup" option on change.
@@ -1478,48 +1500,28 @@ class GrampsPreferences(ConfigureDialog):
config.set('database.autobackup', active)
self.uistate.set_backup_timer()
- def add_date_panel(self, configdialog):
+ def add_limits_panel(self, configdialog):
"""
- Config tab with Dates settings.
+ Config tab with 'about, before, after' limitation settings.
"""
grid = self.create_grid()
- self.add_text(
- grid, _('Dates settings used for calculation operations'), 0,
- line_wrap=True, start=1, stop=3, justify=Gtk.Justification.CENTER,
- align=Gtk.Align.CENTER, bold=True)
+ label = self.add_text(
+ grid, _("Calculation limits"), 0,
+ line_wrap=True, bold=True, start=0, stop=7)
+ label.set_margin_top(10)
row = 1
- self.add_pos_int_entry(
- grid, _('Markup for invalid date format'),
- row, 'preferences.invalid-date-format',
- self.update_markup_entry,
- helptext=_(
- 'Convenience markups are:\n'
- '<b>Bold</b>\n'
- '<big>'
- 'Makes font relatively larger</big>\n'
- '<i>Italic</i>\n'
- '<s>Strikethrough</s>\n'
- '<sub>Subscript</sub>\n'
- '<sup>Superscript</sup>\n'
- '<small>'
- 'Makes font relatively smaller</small>\n'
- '<tt>Monospace font</tt>\n'
- '<u>Underline</u>\n\n'
- 'For example: <u><b>%s</b></u>\n'
- 'will display Underlined bold date.\n'))
- row += 1
self.add_spinner(
- grid, _('Date about range'),
+ grid, _("Date 'about' year range: (date ± #)"),
row, 'behavior.date-about-range', (1, 9999))
row += 1
self.add_spinner(
- grid, _('Date after range'),
+ grid, _("Date 'after' year range: (date + #)"),
row, 'behavior.date-after-range', (1, 9999))
row += 1
self.add_spinner(
- grid, _('Date before range'),
+ grid, _("Date 'before' year range: (date - #)"),
row, 'behavior.date-before-range', (1, 9999))
row += 1
self.add_spinner(
@@ -1537,49 +1539,46 @@ class GrampsPreferences(ConfigureDialog):
self.add_spinner(
grid, _('Average years between generations'),
row, 'behavior.avg-generation-gap', (10, 30))
+ row += 1
+ self.add_spinner(
+ grid, _('Max generations for relationships'),
+ row, 'behavior.generation-depth', (5, 50),
+ self.update_gendepth)
- return _('Dates'), grid
+ return _('Limits'), grid
- def add_behavior_panel(self, configdialog):
+ def add_general_panel(self, configdialog):
"""
- Config tab with 'General' settings.
+ Config tab with 'General' Gramps settings.
"""
grid = self.create_grid()
- self.add_text(grid, _("General Gramps settings"), 0,
- line_wrap=True, start=1, stop=3, bold=True,
- justify=Gtk.Justification.CENTER, align=Gtk.Align.CENTER)
- current_line = 1
+ label = self.add_text(
+ grid, _("Environment Settings"), 0,
+ line_wrap=True, bold=True, start=0, stop=7)
+ label.set_margin_top(10)
- self.add_checkbox(grid, _('Add default source on GEDCOM import'),
- current_line, 'preferences.default-source', stop=3)
-
- current_line += 1
- cb_const = 'preferences.tag-on-import'
- # tag Entry
- self.tag_format_entry = Gtk.Entry()
- tag_const = 'preferences.tag-on-import-format'
- tag_data = _(config.get(tag_const))
- if not tag_data:
- # set default value if Entry is empty
- tag_data = config.get_default(tag_const)
- config.set(cb_const, False)
- config.set(tag_const, tag_data)
- self.tag_format_entry.set_text(tag_data)
- self.tag_format_entry.connect('changed', self.update_entry, tag_const)
- self.tag_format_entry.set_hexpand(True)
- self.tag_format_entry.set_sensitive(config.get(cb_const))
-
- self.add_checkbox(grid, _('Add tag on import'), current_line,
- cb_const, stop=2,
- extra_callback=self.toggle_tag_on_import,
- tooltip=_("Specified tag will be added on import.\n"
- "Clear to set default value."))
- grid.attach(self.tag_format_entry, 2, current_line, 1, 1)
-
- current_line += 1
- obj = self.add_checkbox(grid, _('Enable spelling checker'),
- current_line, 'behavior.spellcheck', stop=3)
+ row = 1
+ self.add_checkbox(grid, _('Display Tip of the Day'),
+ row, 'behavior.use-tips', start=1, stop=3,
+ tooltip=_("Show useful information about using "
+ "Gramps on startup."))
+ row += 1
+ self.add_checkbox(grid, _('Remember last Family Tree'),
+ row, 'behavior.autoload', start=1, stop=3,
+ tooltip=_("Don't open dialog to choose family "
+ "tree to load on startup, "
+ "just load last used."))
+ row += 1
+ self.add_checkbox(grid, _('Remember last view displayed'),
+ row, 'preferences.use-last-view', start=1, stop=3,
+ tooltip=_("Remember last view displayed "
+ "and open it next time."))
+ row += 1
+ obj = self.add_checkbox(grid, _('Enable spell checker'),
+ row, 'behavior.spellcheck', start=1, stop=3,
+ tooltip=_("Enable the spelling checker"
+ " for notes."))
if not HAVE_GTKSPELL:
obj.set_sensitive(False)
spell_dict = {'gramps_wiki_build_spell_url':
@@ -1592,35 +1591,82 @@ class GrampsPreferences(ConfigureDialog):
"To build it for Gramps see "
"%(gramps_wiki_build_spell_url)s") % spell_dict)
- current_line += 1
- self.add_checkbox(grid, _('Display Tip of the Day'),
- current_line, 'behavior.use-tips', stop=3,
- tooltip=_("Show useful information about using "
- "Gramps on startup."))
- current_line += 1
- self.add_checkbox(grid, _('Remember last view displayed'),
- current_line, 'preferences.use-last-view', stop=3,
- tooltip=_("Remember last view displayed "
- "and open it next time."))
- current_line += 1
- self.add_spinner(grid, _('Max generations for relationships'),
- current_line, 'behavior.generation-depth', (5, 50),
- self.update_gendepth)
- current_line += 1
- self.path_entry = Gtk.Entry()
- self.add_path_box(
- grid, _('Base path for relative media paths'),
- current_line, self.path_entry, self.dbstate.db.get_mediapath(),
- self.set_mediapath, self.select_mediapath)
+ row += 1
+ # Text in sidebar:
+ self.add_checkbox(
+ grid, _("Show text label beside Navigator buttons *"),
+ row, 'interface.sidebar-text', start=1, stop=3,
+ tooltip=_("Show or hide text beside Navigator buttons "
+ "(People, Families, Events...).\n"
+ "Requires Gramps restart to apply."))
- current_line += 1
+ row += 1
+ # Gramplet bar close buttons:
+ self.add_checkbox(
+ grid, _("Show close button in gramplet bar tabs"),
+ row, 'interface.grampletbar-close', start=1, stop=3,
+ extra_callback=self.cb_grampletbar_close,
+ tooltip=_("Show close button to simplify removing gramplets "
+ "from bars."))
+
+ row += 1
+ # Markup for invalid date format
+ self.add_pos_int_entry(
+ grid, _('Markup for invalid date format'),
+ row, 'preferences.invalid-date-format',
+ self.update_markup_entry,
+ col_attach=1,
+ helptext=_(
+ 'Convenience markups are:\n'
+ '<b>Bold</b>\n'
+ '<big>'
+ 'Makes font relatively larger</big>\n'
+ '<i>Italic</i>\n'
+ '<s>Strikethrough</s>\n'
+ '<sub>Subscript</sub>\n'
+ '<sup>Superscript</sup>\n'
+ '<small>'
+ 'Makes font relatively smaller</small>\n'
+ '<tt>Monospace font</tt>\n'
+ '<u>Underline</u>\n\n'
+ 'For example: <u><b>%s</b></u>\n'
+ 'will display Underlined bold date.\n'))
+
+ row += 1
+ # height multiple surname table
+ self.add_pos_int_entry(
+ grid, _('Multiple surname box height'),
+ row, 'interface.surname-box-height', self.update_surn_height,
+ col_attach=1,
+ helptext=_(
+ 'Enter height in pixels. When multiple surnames are'
+ ' entered, these names display in a box. This'
+ ' setting sets the size of this box.'))
+
+ row += 1
label = self.add_text(
- grid, _("Third party addons management"), current_line,
- line_wrap=True, start=1, stop=3, bold=True,
- justify=Gtk.Justification.CENTER, align=Gtk.Align.CENTER)
+ grid, _("* Requires Restart"), row,
+ line_wrap=True, bold=True, start=0, stop=3)
label.set_margin_top(10)
- current_line += 1
+ return _('General'), grid
+
+ def add_addons_panel(self, configdialog):
+ """
+ Config tab with 'Addons' install settings.
+ """
+ grid = self.create_grid()
+
+ row = 1
+ label = self.add_text(
+ grid, _('Configuration settings to have Gramps check for'
+ ' new or updated third party Addons and Plugins.'
+ ' The Plugin Manager has the complete list of installed'
+ ' Addons and Plugins and their activation status.\n'), row,
+ line_wrap=True, start=0, stop=9)
+ label.set_margin_top(10)
+
+ row += 1
# Check for addon updates:
obox = Gtk.ComboBoxText()
formats = [_("Never"),
@@ -1633,10 +1679,10 @@ class GrampsPreferences(ConfigureDialog):
obox.set_active(active)
obox.connect('changed', self.check_for_updates_changed)
lwidget = BasicLabel(_("%s: ") % _('Check for addon updates'))
- grid.attach(lwidget, 1, current_line, 1, 1)
- grid.attach(obox, 2, current_line, 1, 1)
+ grid.attach(lwidget, 2, row, 1, 1)
+ grid.attach(obox, 3, row, 1, 1)
- current_line += 1
+ row += 1
self.whattype_box = Gtk.ComboBoxText()
formats = [_("Updated addons only"),
_("New addons only"),
@@ -1651,27 +1697,27 @@ class GrampsPreferences(ConfigureDialog):
self.whattype_box.set_active(0)
self.whattype_box.connect('changed', self.check_for_type_changed)
lwidget = BasicLabel(_("%s: ") % _('What to check'))
- grid.attach(lwidget, 1, current_line, 1, 1)
- grid.attach(self.whattype_box, 2, current_line, 1, 1)
+ grid.attach(lwidget, 2, row, 1, 1)
+ grid.attach(self.whattype_box, 3, row, 1, 1)
- current_line += 1
- self.add_entry(grid, _('Where to check'), current_line,
- 'behavior.addons-url', col_attach=1)
+ row += 1
+ self.add_entry(grid, _('Where to check'), row,
+ 'behavior.addons-url', col_attach=2)
- current_line += 1
+ row += 1
self.add_checkbox(
grid, _('Do not ask about previously notified addons'),
- current_line, 'behavior.do-not-show-previously-seen-addon-updates',
- stop=3)
+ row, 'behavior.do-not-show-previously-seen-addon-updates',
+ start=2, stop=9)
- current_line += 1
+ row += 1
button = Gtk.Button(label=_("Check for updated addons now"))
button.connect("clicked", self.check_for_updates)
button.set_hexpand(False)
button.set_halign(Gtk.Align.CENTER)
- grid.attach(button, 1, current_line, 3, 1)
+ grid.attach(button, 1, row, 3, 1)
- return _('General'), grid
+ return _('Addons'), grid
def check_for_updates(self, button):
try:
@@ -1722,58 +1768,64 @@ class GrampsPreferences(ConfigureDialog):
def add_famtree_panel(self, configdialog):
"""
- Config tab for family tree and backup settings.
+ Config tab for family tree, backup and Media path settings.
"""
grid = self.create_grid()
- self.add_text(
- grid, _("Family tree database settings and Backup "
- "management"), 0, line_wrap=True, start=1, stop=3,
- justify=Gtk.Justification.CENTER, align=Gtk.Align.CENTER,
- bold=True)
+ label = self.add_text(
+ grid, _("Database Setting"), 0,
+ line_wrap=True, bold=True, start=0, stop=7)
+ label.set_margin_top(10)
- current_line = 1
+ row = 1
lwidget = BasicLabel(_("%s: ") % _('Database backend'))
- grid.attach(lwidget, 1, current_line, 1, 1)
+ grid.attach(lwidget, 1, row, 1, 1)
obox = self.__create_backend_combo()
- grid.attach(obox, 2, current_line, 1, 1)
+ grid.attach(obox, 2, row, 1, 1)
- current_line += 1
+ row += 1
+ label = self.add_text(
+ grid, _("\nDatabase Location"), row,
+ line_wrap=True, bold=True, start=0, stop=7)
+ label.set_margin_top(10)
+
+ row += 1
self.connection_widgets = []
- entry = self.add_entry(grid, _('Host'), current_line,
+ entry = self.add_entry(grid, _('Host'), row,
'database.host', col_attach=1)
self.connection_widgets.append(entry)
- current_line += 1
- entry = self.add_entry(grid, _('Port'), current_line,
+ row += 1
+ entry = self.add_entry(grid, _('Port'), row,
'database.port', col_attach=1)
self.connection_widgets.append(entry)
- current_line += 1
+ row += 1
self.set_connection_widgets(config.get('database.backend'))
self.dbpath_entry = Gtk.Entry()
- self.add_path_box(grid, _('Family Tree Database path'), current_line,
+ self.add_path_box(grid, _('Database path'), row,
self.dbpath_entry, config.get('database.path'),
self.set_dbpath, self.select_dbpath)
- current_line += 1
- self.add_checkbox(grid, _('Automatically load last Family Tree'),
- current_line, 'behavior.autoload', stop=3,
- tooltip=_("Don't open dialog to choose family "
- "tree to load on startup, "
- "just load last used."))
- current_line += 1
+
+ row += 1
+ label = self.add_text(
+ grid, _("\nBackup Management"), row,
+ line_wrap=True, bold=True, start=0, stop=7)
+ label.set_margin_top(10)
+
+ row += 1
self.backup_path_entry = Gtk.Entry()
self.add_path_box(grid, _('Backup path'),
- current_line, self.backup_path_entry,
+ row, self.backup_path_entry,
config.get('database.backup-path'),
self.set_backup_path, self.select_backup_path)
- current_line += 1
- self.add_checkbox(grid, _('Backup on exit'), current_line,
+ row += 1
+ self.add_checkbox(grid, _('Backup on exit'), row,
'database.backup-on-exit', stop=3,
tooltip=_("Backup Your family tree on exit "
"to Backup path specified above."))
- current_line += 1
+ row += 1
# Check for updates:
obox = Gtk.ComboBoxText()
formats = [_("Never"),
@@ -1787,11 +1839,79 @@ class GrampsPreferences(ConfigureDialog):
obox.set_active(active)
obox.connect('changed', self.autobackup_changed)
lwidget = BasicLabel(_("%s: ") % _('Autobackup'))
- grid.attach(lwidget, 1, current_line, 1, 1)
- grid.attach(obox, 2, current_line, 1, 1)
+ grid.attach(lwidget, 1, row, 1, 1)
+ grid.attach(obox, 2, row, 1, 1)
+
+ row += 1
+ label = self.add_text(
+ grid, _("\nFamily Tree\'s Media path"), row,
+ line_wrap=True, bold=True, start=0, stop=7)
+ label.set_margin_top(10)
+
+ row += 1
+ self.path_entry = Gtk.Entry()
+ self.add_path_box(
+ grid, _('Base media path'),
+ row, self.path_entry, self.dbstate.db.get_mediapath(),
+ self.set_mediapath, self.select_mediapath)
+
+ row += 1
+ label = self.add_text(
+ grid, _('The base relative media path is specific to the active'
+ ' family tree. It is not a global setting. Each family'
+ ' tree is able to have a unique relative media path that'
+ ' is stored with the database.'), row,
+ line_wrap=True, start=1, stop=3)
+ label.set_margin_top(10)
return _('Family Tree'), grid
+ def add_import_panel(self, configdialog):
+ """
+ Config tab for Import settings.
+ """
+ grid = self.create_grid()
+
+ label = self.add_text(
+ grid, _("Tag Records"), 0,
+ line_wrap=True, bold=True, start=0, stop=7)
+ label.set_margin_top(10)
+
+ row = 1
+ cb_const = 'preferences.tag-on-import'
+ # tag Entry
+ self.tag_format_entry = Gtk.Entry()
+ tag_const = 'preferences.tag-on-import-format'
+ tag_data = _(config.get(tag_const))
+ if not tag_data:
+ # set default value if Entry is empty
+ tag_data = config.get_default(tag_const)
+ config.set(cb_const, False)
+ config.set(tag_const, tag_data)
+ self.tag_format_entry.set_text(tag_data)
+ self.tag_format_entry.connect('changed', self.update_entry, tag_const)
+ self.tag_format_entry.set_hexpand(True)
+ self.tag_format_entry.set_sensitive(config.get(cb_const))
+
+ self.add_checkbox(grid, _('Add tag on import'), row,
+ cb_const, start=1, stop=2,
+ extra_callback=self.toggle_tag_on_import,
+ tooltip=_("Specified tag will be added to all records on import.\n"
+ "Clear to set default value."))
+ grid.attach(self.tag_format_entry, 2, row, 1, 1)
+
+ row += 1
+ label = self.add_text(
+ grid, _("\nSource GEDCOM import"), row,
+ line_wrap=True, bold=True, start=0, stop=7)
+ label.set_margin_top(10)
+
+ row += 1
+ self.add_checkbox(grid, _('Add default source on GEDCOM import'),
+ row, 'preferences.default-source', start=1, stop=3)
+
+ return _('Import'), grid
+
def __create_backend_combo(self):
"""
Create backend selection widget.
@@ -2010,7 +2130,7 @@ class GrampsPreferences(ConfigureDialog):
if config.get('utf8.selected-font') != "":
self.utf8_show_example()
- return _('Genealogical Symbols'), self.grid
+ return _('Symbols'), self.grid
def can_we_use_genealogical_fonts(self, obj):
try:
@@ -2193,4 +2313,3 @@ class GrampsPreferences(ConfigureDialog):
entry = obj.get_active()
config.set(constant, entry)
self.utf8_show_example()
-