Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann Leboulanger <asterix@lagaule.org>2008-08-11 00:43:38 +0400
committerYann Leboulanger <asterix@lagaule.org>2008-08-11 00:43:38 +0400
commit2315fa2b4a3947e7a7dce42bbf9ff1e9459833fd (patch)
tree47e4ae33c09927e1698fbe70fa39a9a623af2b51
parent3c7e7f505236c01fff0dde3d52968579e2eefd3b (diff)
fix saving avatar in info window. Fixes #4188
-rw-r--r--src/gtkgui_helpers.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gtkgui_helpers.py b/src/gtkgui_helpers.py
index a0a2e2d17..5e3d37957 100644
--- a/src/gtkgui_helpers.py
+++ b/src/gtkgui_helpers.py
@@ -768,7 +768,7 @@ def destroy_widget(widget):
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 @@ default_name = ''):
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 @@ default_name = ''):
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 @@ default_name = ''):
' directory.'))
return
- on_continue(0)
+ on_continue(0, file_path)
def on_cancel(widget):
dialog.destroy()