aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui
diff options
context:
space:
mode:
authorUshveen Kaur <kushveen@novell.com>2006-10-16 21:25:56 +0800
committerHarish Krishnaswamy <kharish@src.gnome.org>2006-10-16 21:25:56 +0800
commit577f912998fab89ed46e3c65646b3362bf0c5210 (patch)
tree5b3fefdfa83864e0eb9f838120402a3a57073375 /addressbook/gui
parent9d380670b832884d236d9f3e47ec363b16355c9f (diff)
downloadgsoc2013-evolution-577f912998fab89ed46e3c65646b3362bf0c5210.tar.gz
gsoc2013-evolution-577f912998fab89ed46e3c65646b3362bf0c5210.tar.zst
gsoc2013-evolution-577f912998fab89ed46e3c65646b3362bf0c5210.zip
** Fixes bug#332908
2006-10-16 Ushveen Kaur <kushveen@novell.com> ** 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
Diffstat (limited to 'addressbook/gui')
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c16
1 files changed, 9 insertions, 7 deletions
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;