Changeset 9986 for trunk/src/chat_control.py
- Timestamp:
- 07/22/08 23:08:52 (4 months ago)
- Files:
-
- 1 modified
-
trunk/src/chat_control.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/chat_control.py
r9982 r9986 46 46 constants = Constants() 47 47 from common.rst_xhtml_generator import create_xhtml 48 from common.xmpp.protocol import NS_XHTML, NS_FILE, NS_MUC, NS_RECEIPTS, NS_ESESSION 48 from common.pep import MOODS 49 from common.xmpp.protocol import NS_XHTML, NS_FILE, NS_MUC, NS_RECEIPTS 50 from common.xmpp.protocol import NS_ESESSION 49 51 50 52 try: … … 1084 1086 self.update_toolbar() 1085 1087 1088 self._mood_image = self.xml.get_widget('mood_image') 1089 self._activity_image = self.xml.get_widget('activity_image') 1090 self._tune_image = self.xml.get_widget('tune_image') 1091 1092 self.update_mood() 1093 1086 1094 # keep timeout id and window obj for possible big avatar 1087 1095 # it is on enter-notify and leave-notify so no need to be … … 1186 1194 else: 1187 1195 self._convert_to_gc_button.set_sensitive(False) 1196 1197 def update_mood(self): 1198 if self.contact.mood.has_key('mood'): 1199 mood = gobject.markup_escape_text( 1200 self.contact.mood['mood']) 1201 else: 1202 mood = None 1203 1204 if self.contact.mood.has_key('text'): 1205 text = gobject.markup_escape_text( 1206 self.contact.mood['text']) 1207 else: 1208 text = '' 1209 1210 if mood is not None: 1211 if mood in MOODS: 1212 self._mood_image.set_from_pixbuf( 1213 gtkgui_helpers.load_mood_icon( 1214 mood).get_pixbuf()) 1215 # Translate standard moods 1216 mood = _(mood) 1217 else: 1218 self._mood_image.set_from_pixbuf( 1219 gtkgui_helpers.load_mood_icon( 1220 'unknown').get_pixbuf()) 1221 1222 self._mood_image.set_tooltip_markup('<b>%s</b>%s%s' % 1223 (mood, '\n' if text is not '' else '', text)) 1224 self._mood_image.show() 1225 else: 1226 self._mood_image.hide() 1188 1227 1189 1228 def on_avatar_eventbox_enter_notify_event(self, widget, event):
