Show
Ignore:
Timestamp:
07/23/08 01:06:58 (4 months ago)
Author:
js
Message:

Show user tune in conversation window.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/chat_control.py

    r9986 r9990  
    10911091 
    10921092                self.update_mood() 
     1093                self.update_tune() 
    10931094 
    10941095                # keep timeout id and window obj for possible big avatar 
     
    12251226                else: 
    12261227                        self._mood_image.hide() 
     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() 
    12271256 
    12281257        def on_avatar_eventbox_enter_notify_event(self, widget, event):