Author: asterix
Date: 2008-08-10 22:43:38 +0200 (Sun, 10 Aug 2008)
New Revision: 10176
Modified:
trunk/src/gtkgui_helpers.py
Log:
fix saving avatar in info window. Fixes #4188
Modified: trunk/src/gtkgui_helpers.py
===================================================================
--- trunk/src/gtkgui_helpers.py 2008-08-10 20:28:22 UTC (rev 10175)
+++ trunk/src/gtkgui_helpers.py 2008-08-10 20:43:38 UTC (rev 10176)
@@ -768,7 +768,7 @@
def on_avatar_save_as_menuitem_activate(widget, jid, account,
default_name = ''):
- def on_continue(response):
+ def on_continue(response, file_path):
if response < 0:
return
# Get pixbuf
@@ -795,9 +795,11 @@
if os.path.exists(file_path):
os.remove(file_path)
new_file_path = '.'.join(file_path.split('.')[:-1]) + '.jpeg'
+ def on_ok(file_path, pixbuf):
+ pixbuf.save(file_path, 'jpeg')
dialogs.ConfirmationDialog(_('Extension not supported'),
_('Image cannot be saved in %(type)s format. Save as %(new_filename)s?') % {'type': type_, 'new_filename': new_file_path},
- on_response_ok = (on_ok2, new_file_path, pixbuf))
+ on_response_ok = (on_ok, new_file_path, pixbuf))
else:
dialog.destroy()
@@ -819,7 +821,7 @@
return
dialog2 = dialogs.FTOverwriteConfirmationDialog(
_('This file already exists'), _('What do you want to do?'),
- propose_resume=False, on_response=on_continue)
+ propose_resume=False, on_response=(on_continue, file_path))
dialog2.set_transient_for(dialog)
dialog2.set_destroy_with_parent(True)
else:
@@ -830,7 +832,7 @@
' directory.'))
return
- on_continue(0)
+ on_continue(0, file_path)
def on_cancel(widget):
dialog.destroy()