prevent traceback when opening change status dialog. Fixes #5985

This commit is contained in:
Yann Leboulanger 2010-10-19 21:43:09 +02:00
parent 435b6832cf
commit 2315d8a14a
1 changed files with 7 additions and 8 deletions

View File

@ -665,15 +665,14 @@ class ChangeStatusMessageDialog(TimeoutDialog):
label = self.xml.get_object('activity_button_label')
if 'activity' in self.pep_dict and self.pep_dict['activity'] in \
pep.ACTIVITIES:
if 'subactivity' in self.pep_dict and self.pep_dict['subactivity'] in \
pep.ACTIVITIES[self.pep_dict['activity']]:
if 'subactivity' in self.pep_dict and self.pep_dict['subactivity'] \
in pep.ACTIVITIES[self.pep_dict['activity']]:
img.set_from_pixbuf(gtkgui_helpers.load_activity_icon(
self.pep_dict['activity'], self.pep_dict['subactivity']).\
get_pixbuf())
self.pep_dict['activity'], self.pep_dict['subactivity']).\
get_pixbuf())
else:
img.set_from_pixbuf(gtkgui_helpers.load_activity_icon(
self.pep_dict['activity']).get_pixbuf())
# item.set_tooltip_text(pep.ACTIVITIES[category]['category'])
self.pep_dict['activity']).get_pixbuf())
if self.pep_dict['activity_text']:
label.set_text(self.pep_dict['activity_text'])
else:
@ -688,9 +687,9 @@ class ChangeStatusMessageDialog(TimeoutDialog):
"""
img = self.xml.get_object('mood_image')
label = self.xml.get_object('mood_button_label')
if self.pep_dict['mood'] in pep.MOODS:
if 'mood' in self.pep_dict and self.pep_dict['mood'] in pep.MOODS:
img.set_from_pixbuf(gtkgui_helpers.load_mood_icon(
self.pep_dict['mood']).get_pixbuf())
self.pep_dict['mood']).get_pixbuf())
if self.pep_dict['mood_text']:
label.set_text(self.pep_dict['mood_text'])
else: