Escape pep in tooltips without breaking tooltips, third try :p

This commit is contained in:
Jean-Marie Traissard 2007-12-28 22:04:17 +00:00
parent fef742c863
commit a995c09977
1 changed files with 12 additions and 5 deletions

View File

@ -500,42 +500,49 @@ class RosterTooltip(NotificationAreaTooltip):
# we append show below
if contact.mood.has_key('mood'):
mood_string = _('Mood:') + ' <b>%s</b>' % contact.mood['mood'].strip()
mood = contact.mood['mood'].strip()
mood = gobject.markup_escape_text(mood)
mood_string = _('Mood:') + ' <b>%s</b>' % mood
if contact.mood.has_key('text') and contact.mood['text'] != '':
mood_string += ' (%s)' % contact.mood['text'].strip()
mood_string = gobject.markup_escape_text(mood_string)
mood_text = contact.mood['text'].strip()
mood_text = gobject.markup_escape_text(mood_text)
mood_string += ' (%s)' % mood_text
properties.append((mood_string, None))
if contact.activity.has_key('activity'):
activity = contact.activity['activity'].strip()
activity = gobject.markup_escape_text(activity)
activity_string = _('Activity:') + ' <b>%s' % activity
if contact.activity.has_key('subactivity'):
activity_sub = contact.activity['subactivity'].strip()
activity_sub = gobject.markup_escape_text(activity_sub)
activity_string += ' (%s)</b>' % activity_sub
else:
activity_string += '</b>'
if contact.activity.has_key('text'):
activity_text = contact.activity['text'].strip()
activity_text = gobject.markup_escape_text(activity_text)
activity_string += ' (%s)' % activity_text
activity_string = gobject.markup_escape_text(activity_string)
properties.append((activity_string, None))
if contact.tune.has_key('artist') or contact.tune.has_key('title'):
if contact.tune.has_key('artist'):
artist = contact.tune['artist'].strip()
artist = gobject.markup_escape_text(artist)
else:
artist = _('Unknown Artist')
if contact.tune.has_key('title'):
title = contact.tune['title'].strip()
title = gobject.markup_escape_text(title)
else:
title = _('Unknown Title')
if contact.tune.has_key('source'):
source = contact.tune['source'].strip()
source = gobject.markup_escape_text(source)
else:
source = _('Unknown Source')
tune_string = _('Tune:') + ' ' + _('<b>"%(title)s"</b> by <i>%(artist)s</i>\nfrom <i>%(source)s</i>' %\
{'title': title, 'artist': artist, 'source': source})
tune_string = gobject.markup_escape_text(tune_string)
properties.append((tune_string, None))
if contact.status: