From: Christian Dywan Date: Thu, 26 Mar 2009 23:40:28 +0000 (+0100) Subject: Use the file icon in the download dialog if possible X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e68d8fa4079c8b5bca4571f2c4ad65797b72278;p=midori Use the file icon in the download dialog if possible --- diff --git a/midori/midori-view.c b/midori/midori-view.c index 633b8312..7d710178 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -1178,6 +1178,10 @@ webkit_web_view_mime_type_decision_cb (GtkWidget* web_view, GtkWidget* dialog; gchar* content_type; gchar* description; + #if GTK_CHECK_VERSION (2, 14, 0) + GIcon* icon; + GtkWidget* image; + #endif gchar* title; GdkScreen* screen; GtkIconTheme* icon_theme; @@ -1207,6 +1211,13 @@ webkit_web_view_mime_type_decision_cb (GtkWidget* web_view, content_type = g_strdup (mime_type); #endif description = g_content_type_get_description (content_type); + #if GTK_CHECK_VERSION (2, 14, 0) + icon = g_content_type_get_icon (content_type); + image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_DIALOG); + g_object_unref (icon); + gtk_widget_show (image); + gtk_message_dialog_set_image (GTK_MESSAGE_DIALOG (dialog), image); + #endif g_free (content_type); if (g_strrstr (description, mime_type)) gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),