Added a default avatar image for users without one

This commit is contained in:
Anna 2010-06-01 17:30:58 -04:00
parent f51d187610
commit 124a7411e2
3 changed files with 10 additions and 1 deletions

View File

@ -36,4 +36,5 @@ If things get really mucked up, deleting ~/.hrafn.db will reset the application
### Notes ### Notes
The system tray icon is Public Domain from: http://commons.wikimedia.org/wiki/File:Capi_x_Raven.svg The system tray icon is Public Domain from http://commons.wikimedia.org/wiki/File:Capi_x_Raven.svg
The question mark icon is Public Domain from http://commons.wikimedia.org/wiki/File:Question_mark.svg

3
ui/question_mark.svg Normal file
View File

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="220px" height="385px">
<text font-size="500" y="360" font-family="Times New Roman">?</text>
</svg>

After

Width:  |  Height:  |  Size: 188 B

View File

@ -99,6 +99,11 @@ def add_to_av_cache(user):
loader.write(str(data)) loader.write(str(data))
image = loader.get_pixbuf() image = loader.get_pixbuf()
loader.close() loader.close()
if image is None:
image = gtk.gdk.pixbuf_new_from_file('ui/question_mark.svg')
image = image.scale_simple(48, 48, gtk.gdk.INTERP_BILINEAR)
with AvCache().lock: with AvCache().lock:
AvCache().map[user.screen_name] = image AvCache().map[user.screen_name] = image
except (URLError, ValueError): except (URLError, ValueError):