Fix displaying PEP icons
- Rename get_pep_as_pixbuf to get_pep_icon
This commit is contained in:
parent
61a791d67c
commit
bf9e01ee31
3 changed files with 11 additions and 7 deletions
|
@ -416,7 +416,11 @@ class ChatControl(ChatControlBase):
|
||||||
pep = self.contact.pep
|
pep = self.contact.pep
|
||||||
img = self._pep_images[pep_type]
|
img = self._pep_images[pep_type]
|
||||||
if pep_type in pep:
|
if pep_type in pep:
|
||||||
img.set_from_pixbuf(gtkgui_helpers.get_pep_as_pixbuf(pep[pep_type]))
|
icon = gtkgui_helpers.get_pep_icon(pep[pep_type])
|
||||||
|
if isinstance(icon, str):
|
||||||
|
img.set_from_icon_name(icon, Gtk.IconSize.MENU)
|
||||||
|
else:
|
||||||
|
img.set_from_pixbuf(icon)
|
||||||
img.set_tooltip_markup(pep[pep_type].as_markup_text())
|
img.set_tooltip_markup(pep[pep_type].as_markup_text())
|
||||||
img.show()
|
img.show()
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -383,7 +383,7 @@ def load_activity_icon(category, activity=None):
|
||||||
icon_list = _load_icon_list([activity], path)
|
icon_list = _load_icon_list([activity], path)
|
||||||
return icon_list[activity]
|
return icon_list[activity]
|
||||||
|
|
||||||
def get_pep_as_pixbuf(pep_class):
|
def get_pep_icon(pep_class):
|
||||||
if pep_class == PEPEventType.MOOD:
|
if pep_class == PEPEventType.MOOD:
|
||||||
received_mood = pep_class.data['mood']
|
received_mood = pep_class.data['mood']
|
||||||
mood = received_mood if received_mood in MOODS else 'unknown'
|
mood = received_mood if received_mood in MOODS else 'unknown'
|
||||||
|
|
|
@ -1088,27 +1088,27 @@ class RosterWindow:
|
||||||
pep_dict = app.connections[account].pep
|
pep_dict = app.connections[account].pep
|
||||||
if app.config.get('show_mood_in_roster') and 'mood' in pep_dict:
|
if app.config.get('show_mood_in_roster') and 'mood' in pep_dict:
|
||||||
self.model[child_iter][Column.MOOD_PIXBUF] = \
|
self.model[child_iter][Column.MOOD_PIXBUF] = \
|
||||||
gtkgui_helpers.get_pep_as_pixbuf(pep_dict['mood'])
|
gtkgui_helpers.get_pep_icon(pep_dict['mood'])
|
||||||
else:
|
else:
|
||||||
self.model[child_iter][Column.MOOD_PIXBUF] = None
|
self.model[child_iter][Column.MOOD_PIXBUF] = None
|
||||||
|
|
||||||
if app.config.get('show_activity_in_roster') and 'activity' in \
|
if app.config.get('show_activity_in_roster') and 'activity' in \
|
||||||
pep_dict:
|
pep_dict:
|
||||||
self.model[child_iter][Column.ACTIVITY_PIXBUF] = \
|
self.model[child_iter][Column.ACTIVITY_PIXBUF] = \
|
||||||
gtkgui_helpers.get_pep_as_pixbuf(pep_dict['activity'])
|
gtkgui_helpers.get_pep_icon(pep_dict['activity'])
|
||||||
else:
|
else:
|
||||||
self.model[child_iter][Column.ACTIVITY_PIXBUF] = None
|
self.model[child_iter][Column.ACTIVITY_PIXBUF] = None
|
||||||
|
|
||||||
if app.config.get('show_tunes_in_roster') and 'tune' in pep_dict:
|
if app.config.get('show_tunes_in_roster') and 'tune' in pep_dict:
|
||||||
self.model[child_iter][Column.TUNE_ICON] = \
|
self.model[child_iter][Column.TUNE_ICON] = \
|
||||||
gtkgui_helpers.get_pep_as_pixbuf(pep_dict['tune'])
|
gtkgui_helpers.get_pep_icon(pep_dict['tune'])
|
||||||
else:
|
else:
|
||||||
self.model[child_iter][Column.TUNE_ICON] = None
|
self.model[child_iter][Column.TUNE_ICON] = None
|
||||||
|
|
||||||
if app.config.get('show_location_in_roster') and 'geoloc' in \
|
if app.config.get('show_location_in_roster') and 'geoloc' in \
|
||||||
pep_dict:
|
pep_dict:
|
||||||
self.model[child_iter][Column.LOCATION_ICON] = \
|
self.model[child_iter][Column.LOCATION_ICON] = \
|
||||||
gtkgui_helpers.get_pep_as_pixbuf(pep_dict['geoloc'])
|
gtkgui_helpers.get_pep_icon(pep_dict['geoloc'])
|
||||||
else:
|
else:
|
||||||
self.model[child_iter][Column.LOCATION_ICON] = None
|
self.model[child_iter][Column.LOCATION_ICON] = None
|
||||||
|
|
||||||
|
@ -1392,7 +1392,7 @@ class RosterWindow:
|
||||||
|
|
||||||
pixbuf = None
|
pixbuf = None
|
||||||
if pep_type in contact.pep:
|
if pep_type in contact.pep:
|
||||||
pixbuf = gtkgui_helpers.get_pep_as_pixbuf(contact.pep[pep_type])
|
pixbuf = gtkgui_helpers.get_pep_icon(contact.pep[pep_type])
|
||||||
|
|
||||||
for child_iter in iters:
|
for child_iter in iters:
|
||||||
self.model[child_iter][model_column] = pixbuf
|
self.model[child_iter][model_column] = pixbuf
|
||||||
|
|
Loading…
Add table
Reference in a new issue