Remove buddy icons from the buddy menu

This commit is contained in:
Dan Williams 2007-07-30 23:36:14 -04:00
parent 782d603f0b
commit 37e8a2ad0d

View File

@ -16,7 +16,7 @@
from gettext import gettext as _ from gettext import gettext as _
import logging import logging
import gtk #import gtk
import gobject import gobject
import hippo import hippo
@ -32,20 +32,21 @@ class BuddyMenu(Palette):
Palette.__init__(self, buddy.get_nick()) Palette.__init__(self, buddy.get_nick())
pixbuf = None # FIXME: re-enable when buddy avatars are re-enabled
try: # pixbuf = None
pixbuf = self._get_buddy_icon_pixbuf() # try:
except gobject.GError, e: # pixbuf = self._get_buddy_icon_pixbuf()
pass # except gobject.GError, e:
if pixbuf: # pass
scaled_pixbuf = pixbuf.scale_simple(units.grid_to_pixels(1), # if pixbuf:
units.grid_to_pixels(1), # scaled_pixbuf = pixbuf.scale_simple(units.grid_to_pixels(1),
gtk.gdk.INTERP_BILINEAR) # units.grid_to_pixels(1),
del pixbuf # gtk.gdk.INTERP_BILINEAR)
image = gtk.Image() # del pixbuf
image.set_from_pixbuf(scaled_pixbuf) # image = gtk.Image()
self.set_content(image) # image.set_from_pixbuf(scaled_pixbuf)
image.show() # self.set_content(image)
# image.show()
self._buddy.connect('icon-changed', self._buddy_icon_changed_cb) self._buddy.connect('icon-changed', self._buddy_icon_changed_cb)
self._buddy.connect('nick-changed', self._buddy_nick_changed_cb) self._buddy.connect('nick-changed', self._buddy_nick_changed_cb)
@ -54,24 +55,25 @@ class BuddyMenu(Palette):
if buddy.get_nick() != owner.get_nick(): if buddy.get_nick() != owner.get_nick():
self._add_items() self._add_items()
def _get_buddy_icon_pixbuf(self): # FIXME: re-enable when buddy avatars are re-enabled
buddy_object = self._buddy.get_buddy() # def _get_buddy_icon_pixbuf(self):
if not buddy_object: # buddy_object = self._buddy.get_buddy()
return None # if not buddy_object:
# return None
icon_data = buddy_object.props.icon #
if not icon_data: # icon_data = buddy_object.props.icon
return None # if not icon_data:
pbl = gtk.gdk.PixbufLoader() # return None
pbl.write(icon_data) # pbl = gtk.gdk.PixbufLoader()
pixbuf = None # pbl.write(icon_data)
try: # pixbuf = None
pbl.close() # try:
pixbuf = pbl.get_pixbuf() # pbl.close()
except gobject.GError: # pixbuf = pbl.get_pixbuf()
pass # except gobject.GError:
del pbl # pass
return pixbuf # del pbl
# return pixbuf
def _add_items(self): def _add_items(self):
shell_model = self._shell.get_model() shell_model = self._shell.get_model()