# HG changeset patch # User Mark Doliner # Date 1119480378 0 # Node ID 86725cfe055028b992f87ea1a54abf1985f7e5f5 # Parent 04f280376f069a862000a873ffebd4ecf9d2b02e [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 diff -r 04f280376f06 -r 86725cfe0550 src/gtkimhtml.c --- a/src/gtkimhtml.c Wed Jun 22 22:41:59 2005 +0000 +++ b/src/gtkimhtml.c Wed Jun 22 22:46:18 2005 +0000 @@ -3118,16 +3118,20 @@ /* If I can't find a valid type, I will just tell the user about it and then assume it's a png */ if (!type){ - gtk_message_dialog_new(NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, - _("Unable to guess the image type based on the file extension supplied. Defaulting to PNG.")); + GtkWidget *dialog = gtk_message_dialog_new_with_markup(NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, + _("Unrecognized file type\n\nDefaulting to PNG.")); + g_signal_connect_swapped(dialog, "response", G_CALLBACK (gtk_widget_destroy), dialog); + gtk_widget_show(dialog); type = g_strdup("png"); } gdk_pixbuf_save(image->pixbuf, filename, type, &error, NULL); if (error){ - gtk_message_dialog_new(NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, - _("Error saving image: %s"), error->message); + GtkWidget *dialog = gtk_message_dialog_new_with_markup(NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, + _("Error saving image\n\n%s"), error->message); + g_signal_connect_swapped(dialog, "response", G_CALLBACK (gtk_widget_destroy), dialog); + gtk_widget_show(dialog); g_error_free(error); }