6576: add an optional helptext as tooltip on add_pos_int(); provide a list and sample of pango convenience markups and combinaisons
svn: r22158
This commit is contained in:
parent
7c205bf7fc
commit
ce7181a96d
@ -363,7 +363,7 @@ class ConfigureDialog(ManagedWindow):
|
||||
return entry
|
||||
|
||||
def add_pos_int_entry(self, table, label, index, constant, callback=None,
|
||||
config=None, col_attach=1):
|
||||
config=None, col_attach=1, helptext=''):
|
||||
""" entry field for positive integers
|
||||
"""
|
||||
if not config:
|
||||
@ -371,6 +371,7 @@ class ConfigureDialog(ManagedWindow):
|
||||
lwidget = BasicLabel("%s: " % label)
|
||||
entry = Gtk.Entry()
|
||||
entry.set_text(str(config.get(constant)))
|
||||
entry.set_tooltip_markup(helptext)
|
||||
if callback:
|
||||
entry.connect('changed', callback, constant)
|
||||
table.attach(lwidget, col_attach, col_attach+1, index, index+1,
|
||||
@ -1188,7 +1189,21 @@ class GrampsPreferences(ConfigureDialog):
|
||||
6, 'behavior.avg-generation-gap', (10, 30))
|
||||
self.add_pos_int_entry(table,
|
||||
_('Markup for invalid date format'),
|
||||
7, 'preferences.invalid-date-format', self.update_markup_entry)
|
||||
7, 'preferences.invalid-date-format',
|
||||
self.update_markup_entry,
|
||||
helptext = _('Convenience markups are:\n'
|
||||
'<b><b>Bold</b></b>\n'
|
||||
'<big><big>Makes font relatively larger</big></big>\n'
|
||||
'<i><i>Italic</i></i>\n'
|
||||
'<s><s>Strikethrough</s></s>\n'
|
||||
'<sub><sub>Subscript</sub></sub>\n'
|
||||
'<sup><sup>Superscript</sup></sup>\n'
|
||||
'<small><small>Makes font relatively smaller</small></small>\n'
|
||||
'<tt><tt>Monospace font</tt></tt>\n'
|
||||
'<u><u>Underline</u></u>\n\n'
|
||||
'For example: <u><b>%s</b></u>\n'
|
||||
'will display <u><b>Underlined bold date</b></u>.\n')
|
||||
)
|
||||
|
||||
return _('Dates'), table
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user