Browse Source

queue pics on message receival, not on draw

master
Julio Biason 15 years ago
parent
commit
3af11b0704
  1. 21
      mitterlib/ui/ui_pygtk.py

21
mitterlib/ui/ui_pygtk.py

@ -552,16 +552,6 @@ class Interface(object):
data = store.get_value(position, 0) data = store.get_value(position, 0)
pic = data.avatar pic = data.avatar
if not pic in self._avatars:
# set the user avatar to the default image, so it won't get queued
# again. Once downloaded, the _post_download_pic will update the
# image and force a redraw.
self._avatars[pic] = self._images['avatar']
self._threads.add_work(self._post_download_pic,
self._exception_download_pic,
self._download_pic,
pic)
cell.set_property('pixbuf', self._avatars[pic]) cell.set_property('pixbuf', self._avatars[pic])
return return
@ -1056,6 +1046,17 @@ class Interface(object):
for message in results: for message in results:
_log.debug('Data: %s', str(message)) _log.debug('Data: %s', str(message))
message.read = False message.read = False
pic = message.avatar
if not pic in self._avatars:
# set the user avatar to the default image, so it won't get
# queued again. Once downloaded, the _post_download_pic will
# update the image and force a redraw.
self._avatars[pic] = self._images['avatar']
self._threads.add_work(self._post_download_pic,
self._exception_download_pic,
self._download_pic,
pic)
store.prepend([message]) store.prepend([message])
store.sort_column_changed() store.sort_column_changed()
self._grid.queue_draw() self._grid.queue_draw()

Loading…
Cancel
Save