redraw the status image in tabbed chat window correctly

This commit is contained in:
Yann Leboulanger 2005-01-28 20:01:49 +00:00
parent ad4dea66f5
commit 726bf8cdd2

View file

@ -279,6 +279,14 @@ class tabbed_chat_Window:
child = self.xmls[jid].get_widget("vbox_tab") child = self.xmls[jid].get_widget("vbox_tab")
nb.set_tab_label_text(child, start + self.users[jid].name) nb.set_tab_label_text(child, start + self.users[jid].name)
def set_image(self, image, jid):
if image.get_storage_type() == gtk.IMAGE_ANIMATION:
self.xmls[jid].get_widget('image_status').\
set_from_animation(image.get_animation())
elif image.get_storage_type() == gtk.IMAGE_PIXBUF:
self.xmls[jid].get_widget('image_status').\
set_from_pixbuf(image.get_pixbuf())
def delete_event(self, widget): def delete_event(self, widget):
"""close window""" """close window"""
#clean self.plugin.windows[self.account]['chats'] #clean self.plugin.windows[self.account]['chats']
@ -560,6 +568,12 @@ class message_Window:
start = "* " start = "* "
self.window.set_title(start + self.user.name + " (" + self.account + ")") self.window.set_title(start + self.user.name + " (" + self.account + ")")
def set_image(self, image, jid):
if image.get_storage_type() == gtk.IMAGE_ANIMATION:
self.img.set_from_animation(image.get_animation())
elif image.get_storage_type() == gtk.IMAGE_PIXBUF:
self.img.set_from_pixbuf(image.get_pixbuf())
def read_queue(self, q): def read_queue(self, q):
"""read queue and print messages containted in it""" """read queue and print messages containted in it"""
while not q.empty(): while not q.empty():
@ -1455,12 +1469,8 @@ class roster_Window:
prio = u.priority prio = u.priority
sho = u.show sho = u.show
img = self.pixbufs[sho] img = self.pixbufs[sho]
if img.get_storage_type() == gtk.IMAGE_ANIMATION: self.plugin.windows[account]['chats'][user.jid].\
self.plugin.windows[account]['chats'][user.jid].\ set_image(img, user.jid)
img.set_from_animation(img.get_animation())
elif img.get_storage_type() == gtk.IMAGE_PIXBUF:
self.plugin.windows[account]['chats'][user.jid].\
img.set_from_pixbuf(img.get_pixbuf())
name = user.name name = user.name
if user.resource != '': if user.resource != '':
name += '/'+user.resource name += '/'+user.resource