Do not propose to save avatar in profile window if it's not on HD. Fixes #2428

This commit is contained in:
Yann Leboulanger 2006-09-22 14:24:26 +00:00
parent 74471acd95
commit 38c8ba58a3
1 changed files with 14 additions and 6 deletions

View File

@ -159,12 +159,20 @@ class ProfileWindow:
'''If right-clicked, show popup''' '''If right-clicked, show popup'''
if event.button == 3 and self.avatar_encoded: # right click if event.button == 3 and self.avatar_encoded: # right click
menu = gtk.Menu() menu = gtk.Menu()
nick = gajim.config.get_per('accounts', self.account, 'name')
menuitem = gtk.ImageMenuItem(gtk.STOCK_SAVE_AS) # Try to get pixbuf
menuitem.connect('activate', is_fake = False
gtkgui_helpers.on_avatar_save_as_menuitem_activate, if account and gajim.contacts.is_pm_from_jid(account, jid):
self.jid, None, nick + '.jpeg') is_fake = True
menu.append(menuitem) pixbuf = get_avatar_pixbuf_from_cache(jid, is_fake)
if pixbuf:
nick = gajim.config.get_per('accounts', self.account, 'name')
menuitem = gtk.ImageMenuItem(gtk.STOCK_SAVE_AS)
menuitem.connect('activate',
gtkgui_helpers.on_avatar_save_as_menuitem_activate,
self.jid, None, nick + '.jpeg')
menu.append(menuitem)
# show clear # show clear
menuitem = gtk.ImageMenuItem(gtk.STOCK_CLEAR) menuitem = gtk.ImageMenuItem(gtk.STOCK_CLEAR)
menuitem.connect('activate', self.on_clear_button_clicked) menuitem.connect('activate', self.on_clear_button_clicked)