Add sample colored text to the list of column coloring rules

This commit is contained in:
Charles Haley 2014-04-04 16:06:27 +02:00
parent c043171f7c
commit 24b1ff3e9b

View File

@ -723,11 +723,15 @@ class RulesModel(QAbstractListModel): # {{{
conditions = [self.condition_to_html(c) for c in rule.conditions] conditions = [self.condition_to_html(c) for c in rule.conditions]
sample = '' if kind != 'color' else (
_('(<span style="color: %s;">sample</span>)') % rule.color)
return _('''\ return _('''\
<p>Set the <b>%(kind)s</b> of <b>%(col)s</b> to <b>%(color)s</b> if the following <p>Set the <b>%(kind)s</b> of <b>%(col)s</b> to <b>%(color)s</b> %(sample)s
conditions are met:</p> if the following conditions are met:</p>
<ul>%(rule)s</ul> <ul>%(rule)s</ul>
''') % dict(kind=trans_kind, col=col, color=rule.color, rule=''.join(conditions)) ''') % dict(kind=trans_kind, col=col, color=rule.color,
sample=sample, rule=''.join(conditions))
def condition_to_html(self, condition): def condition_to_html(self, condition):
col, a, v = condition col, a, v = condition