comparison src/gtkimhtml.c @ 11019:86725cfe0550

[gaim-migrate @ 12890] sf patch #1223530, from Richard Laager When saving an image from a GtkImHtml, a couple different errors can occur. The existing code creates a dialog for these situations, but never shows it. This patch fixes that and also improves the formatting of the dialogs. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Wed, 22 Jun 2005 22:46:18 +0000
parents 5d3b0a920d83
children 65db26d0bc90
comparison
equal deleted inserted replaced
11018:04f280376f06 11019:86725cfe0550
3116 #endif 3116 #endif
3117 3117
3118 /* If I can't find a valid type, I will just tell the user about it and then assume 3118 /* If I can't find a valid type, I will just tell the user about it and then assume
3119 it's a png */ 3119 it's a png */
3120 if (!type){ 3120 if (!type){
3121 gtk_message_dialog_new(NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, 3121 GtkWidget *dialog = gtk_message_dialog_new_with_markup(NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
3122 _("Unable to guess the image type based on the file extension supplied. Defaulting to PNG.")); 3122 _("<span size='larger' weight='bold'>Unrecognized file type</span>\n\nDefaulting to PNG."));
3123 g_signal_connect_swapped(dialog, "response", G_CALLBACK (gtk_widget_destroy), dialog);
3124 gtk_widget_show(dialog);
3123 type = g_strdup("png"); 3125 type = g_strdup("png");
3124 } 3126 }
3125 3127
3126 gdk_pixbuf_save(image->pixbuf, filename, type, &error, NULL); 3128 gdk_pixbuf_save(image->pixbuf, filename, type, &error, NULL);
3127 3129
3128 if (error){ 3130 if (error){
3129 gtk_message_dialog_new(NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, 3131 GtkWidget *dialog = gtk_message_dialog_new_with_markup(NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
3130 _("Error saving image: %s"), error->message); 3132 _("<span size='larger' weight='bold'>Error saving image</span>\n\n%s"), error->message);
3133 g_signal_connect_swapped(dialog, "response", G_CALLBACK (gtk_widget_destroy), dialog);
3134 gtk_widget_show(dialog);
3131 g_error_free(error); 3135 g_error_free(error);
3132 } 3136 }
3133 3137
3134 g_free(type); 3138 g_free(type);
3135 } 3139 }