Changeset 9990

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

Show user tune in conversation window.

Location:
trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/data/glade/message_window.glade

    r9986 r9990  
    7272                                    <property name="no_show_all">True</property> 
    7373                                    <property name="stock">gtk-missing-image</property> 
     74                                    <property name="icon_size">1</property> 
    7475                                  </widget> 
    7576                                </child> 
     
    7879                                    <property name="no_show_all">True</property> 
    7980                                    <property name="stock">gtk-missing-image</property> 
     81                                    <property name="icon_size">1</property> 
    8082                                  </widget> 
    8183                                  <packing> 
     
    8688                                  <widget class="GtkImage" id="tune_image"> 
    8789                                    <property name="no_show_all">True</property> 
    88                                     <property name="stock">gtk-missing-image</property> 
     90                                    <property name="pixbuf">music.png</property> 
     91                                    <property name="icon_size">1</property> 
    8992                                  </widget> 
    9093                                  <packing> 
  • 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): 
  • trunk/src/tooltips.py

    r9989 r9990  
    613613                        else: 
    614614                                source = _('Unknown Source') 
    615                         tune_string = _('Tune:') + ' ' + _('<b>"%(title)s"' + 
    616                                 '</b> by <i>%(artist)s</i>\nfrom ' + 
    617                                 '<i>%(source)s</i>') % {'title': title, 
     615                        tune_string = _('Tune:') + ' ' + \ 
     616                                _('<b>"%(title)s</b> by <i>%(artist)s</i>\n' + 
     617                                'from <i>%(source)s</i>') % {'title': title, 
    618618                                'artist': artist, 'source': source} 
    619619                        properties.append((tune_string, None))