From 2315d8a14a4839fdcbd72546cdaea572ea83cdf4 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Tue, 19 Oct 2010 21:43:09 +0200 Subject: [PATCH] prevent traceback when opening change status dialog. Fixes #5985 --- src/dialogs.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/dialogs.py b/src/dialogs.py index cd8daed3e..2e727b8e6 100644 --- a/src/dialogs.py +++ b/src/dialogs.py @@ -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: