Remove duplicated Icon determination logic used when drawing accounts.
This commit is contained in:
parent
3b15d70782
commit
4c03c1ab85
|
@ -1022,55 +1022,21 @@ class RosterWindow:
|
||||||
|
|
||||||
self.model[child_iter][C_NAME] = account_name
|
self.model[child_iter][C_NAME] = account_name
|
||||||
|
|
||||||
if gajim.config.get('show_mood_in_roster') \
|
pep = gajim.connections[account].pep
|
||||||
and 'mood' in gajim.connections[account].mood \
|
if gajim.config.get('show_mood_in_roster') and 'mood' in pep:
|
||||||
and gajim.connections[account].mood['mood'].strip() in MOODS:
|
self.model[child_iter][C_MOOD_PIXBUF] = pep['mood'].asPixbufIcon()
|
||||||
|
|
||||||
self.model[child_iter][C_MOOD_PIXBUF] = gtkgui_helpers.load_mood_icon(
|
|
||||||
gajim.connections[account].mood['mood'].strip()).get_pixbuf()
|
|
||||||
|
|
||||||
elif gajim.config.get('show_mood_in_roster') \
|
|
||||||
and 'mood' in gajim.connections[account].mood:
|
|
||||||
self.model[child_iter][C_MOOD_PIXBUF] = \
|
|
||||||
gtkgui_helpers.load_mood_icon('unknown'). \
|
|
||||||
get_pixbuf()
|
|
||||||
else:
|
else:
|
||||||
self.model[child_iter][C_MOOD_PIXBUF] = None
|
self.model[child_iter][C_MOOD_PIXBUF] = None
|
||||||
|
|
||||||
if gajim.config.get('show_activity_in_roster') \
|
if gajim.config.get('show_activity_in_roster') and 'activity' in pep:
|
||||||
and 'activity' in gajim.connections[account].activity \
|
self.model[child_iter][C_ACTIVITY_PIXBUF] = pep['activity'].asPixbufIcon()
|
||||||
and gajim.connections[account].activity['activity'].strip() \
|
|
||||||
in ACTIVITIES:
|
|
||||||
if 'subactivity' in gajim.connections[account].activity \
|
|
||||||
and gajim.connections[account].activity['subactivity'].strip() \
|
|
||||||
in ACTIVITIES[gajim.connections[account].activity['activity'].strip()]:
|
|
||||||
self.model[child_iter][C_ACTIVITY_PIXBUF] = \
|
|
||||||
gtkgui_helpers.load_activity_icon(
|
|
||||||
gajim.connections[account].activity['activity'].strip(),
|
|
||||||
gajim.connections[account].activity['subactivity'].strip()). \
|
|
||||||
get_pixbuf()
|
|
||||||
else:
|
|
||||||
self.model[child_iter][C_ACTIVITY_PIXBUF] = \
|
|
||||||
gtkgui_helpers.load_activity_icon(
|
|
||||||
gajim.connections[account].activity['activity'].strip()). \
|
|
||||||
get_pixbuf()
|
|
||||||
elif gajim.config.get('show_activity_in_roster') \
|
|
||||||
and 'activity' in gajim.connections[account].activity:
|
|
||||||
self.model[child_iter][C_ACTIVITY_PIXBUF] = \
|
|
||||||
gtkgui_helpers.load_activity_icon('unknown'). \
|
|
||||||
get_pixbuf()
|
|
||||||
else:
|
else:
|
||||||
self.model[child_iter][C_ACTIVITY_PIXBUF] = None
|
self.model[child_iter][C_ACTIVITY_PIXBUF] = None
|
||||||
|
|
||||||
if gajim.config.get('show_tunes_in_roster') \
|
if gajim.config.get('show_tunes_in_roster') and 'tune' in pep:
|
||||||
and ('artist' in gajim.connections[account].tune \
|
self.model[child_iter][C_TUNE_PIXBUF] = pep['tune'].asPixbufIcon()
|
||||||
or 'title' in gajim.connections[account].tune):
|
|
||||||
path = os.path.join(gajim.DATA_DIR, 'emoticons', 'static', 'music.png')
|
|
||||||
self.model[child_iter][C_TUNE_PIXBUF] = \
|
|
||||||
gtk.gdk.pixbuf_new_from_file(path)
|
|
||||||
else:
|
else:
|
||||||
self.model[child_iter][C_TUNE_PIXBUF] = None
|
self.model[child_iter][C_TUNE_PIXBUF] = None
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def draw_group(self, group, account):
|
def draw_group(self, group, account):
|
||||||
|
|
Loading…
Reference in New Issue