| | 1228 | |
| | 1229 | def update_tune(self): |
| | 1230 | artist = None |
| | 1231 | title = None |
| | 1232 | source = None |
| | 1233 | |
| | 1234 | if self.contact.tune.has_key('artist'): |
| | 1235 | artist = gobject.markup_escape_text( |
| | 1236 | self.contact.tune['artist'].strip()) |
| | 1237 | if self.contact.tune.has_key('title'): |
| | 1238 | title = gobject.markup_escape_text( |
| | 1239 | self.contact.tune['title'].strip()) |
| | 1240 | if self.contact.tune.has_key('source'): |
| | 1241 | title = gobject.markup_escape_text( |
| | 1242 | self.contact.tune['source'].strip()) |
| | 1243 | |
| | 1244 | if artist or title: |
| | 1245 | artist = artist if artist else _('Unknown Artist') |
| | 1246 | title = title if title else _('Unknown Title') |
| | 1247 | source = source if source else _('Unknown Source') |
| | 1248 | |
| | 1249 | self._tune_image.set_tooltip_markup(_( |
| | 1250 | '<b>"%(title)s"</b> by <i>%(artist)s</i>\n' + |
| | 1251 | 'from <i>%(source)s</i>') % {'title': title, |
| | 1252 | 'artist': artist, 'source': source}) |
| | 1253 | self._tune_image.show() |
| | 1254 | else: |
| | 1255 | self._tune_image.hide() |