From 0509177b08149bb364eeef4a8e28072f58839113 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Rapinat?= Date: Sat, 4 May 2013 06:14:08 +0000 Subject: [PATCH] 6576: add an optional helptext as tooltip on add_pos_int(); provide a list and sample of pango convenience markups and combinaisons svn: r22159 --- gramps/gui/configure.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/gramps/gui/configure.py b/gramps/gui/configure.py index 08baf06c7..ec1798a99 100644 --- a/gramps/gui/configure.py +++ b/gramps/gui/configure.py @@ -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>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') + ) return _('Dates'), table