draw avatar in roster tooltip. Fixes #1223

This commit is contained in:
Yann Leboulanger 2006-02-05 16:47:25 +00:00
parent c49a993e88
commit b5c94b71c6
1 changed files with 9 additions and 0 deletions

View File

@ -365,6 +365,7 @@ class RosterTooltip(NotificationAreaTooltip):
self.image.set_alignment(0, 0)
# padding is independent of the total length and better than alignment
self.image.set_padding(1, 2)
self.avatar_image = gtk.Image()
NotificationAreaTooltip.__init__(self)
def populate(self, contacts):
@ -459,9 +460,17 @@ class RosterTooltip(NotificationAreaTooltip):
# escape markup entities.
info += ' - ' + gtkgui_helpers.escape_for_pango_markup(status)
for type_ in ('jpeg', 'png'):
file = os.path.join(gajim.AVATAR_PATH, prim_contact.jid + '.' + type_)
if os.path.exists(file):
self.avatar_image.set_from_file(file)
break
else:
self.avatar_image.set_from_pixbuf(None)
self.text_label.set_markup(info)
self.hbox.pack_start(self.image, False, False)
self.hbox.pack_start(self.table, True, True)
self.hbox.pack_start(self.avatar_image, False, False)
self.win.add(self.hbox)
class FileTransfersTooltip(BaseTooltip):