From 577f912998fab89ed46e3c65646b3362bf0c5210 Mon Sep 17 00:00:00 2001 From: Ushveen Kaur Date: Mon, 16 Oct 2006 13:25:56 +0000 Subject: ** Fixes bug#332908 2006-10-16 Ushveen Kaur ** Fixes bug#332908 * addressbook.error.xml : * gui/contact-editor/e-contact-editor.c : Prompt-resize dialog options changed. Three options given now, "Resize", "Use as it is" and "Do not save". svn path=/trunk/; revision=32889 --- addressbook/gui/contact-editor/e-contact-editor.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'addressbook/gui/contact-editor') diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index efd9b72503..367ae376ce 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -2274,15 +2274,14 @@ extract_simple_field (EContactEditor *editor, GtkWidget *widget, gint field_id) pixbuf = gdk_pixbuf_loader_get_pixbuf (loader); if (pixbuf) { - int width, height; - + int width, height, prompt_response; + g_object_ref (pixbuf); height = gdk_pixbuf_get_height (pixbuf); width = gdk_pixbuf_get_width (pixbuf); - - if ((height > 96 || width > 96) && e_error_run (GTK_WINDOW (editor->app), "addressbook:prompt-resize", NULL) == GTK_RESPONSE_YES) { - + prompt_response = e_error_run (GTK_WINDOW (editor->app), "addressbook:prompt-resize", NULL); + if ((height > 96 || width > 96) && prompt_response == GTK_RESPONSE_YES){ if ( width > height) { height = height * 96 / width; width = 96; @@ -2297,9 +2296,12 @@ extract_simple_field (EContactEditor *editor, GtkWidget *widget, gint field_id) gdk_pixbuf_save_to_buffer (new, (gchar **)&photo.data.inlined.data, &photo.data.inlined.length, "jpeg", NULL, "quality", "100", NULL); g_object_unref (new); } - } - + else if (prompt_response == GTK_RESPONSE_CANCEL) { + g_object_unref (pixbuf); + g_object_unref (loader); + return; + } g_object_unref (pixbuf); } editor->image_changed = FALSE; -- cgit