Index: gtk/gtkmessagedialog.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkmessagedialog.h,v
retrieving revision 1.9
diff -p -u -u -p -r1.9 gtkmessagedialog.h
--- gtk/gtkmessagedialog.h	20 Mar 2005 07:01:22 -0000	1.9
+++ gtk/gtkmessagedialog.h	1 May 2006 21:45:42 -0000
@@ -37,7 +37,8 @@ typedef enum
   GTK_MESSAGE_INFO,
   GTK_MESSAGE_WARNING,
   GTK_MESSAGE_QUESTION,
-  GTK_MESSAGE_ERROR
+  GTK_MESSAGE_ERROR,
+  GTK_MESSAGE_OTHER
 } GtkMessageType;
 
 typedef enum
@@ -97,6 +98,9 @@ GtkWidget* gtk_message_dialog_new_with_m
                                                  const gchar    *message_format,
                                                  ...) G_GNUC_PRINTF (5, 6);
 
+void       gtk_message_dialog_set_icon (GtkMessageDialog *dialog,
+					const gchar *stock_id);
+
 void       gtk_message_dialog_set_markup  (GtkMessageDialog *message_dialog,
                                            const gchar      *str);
 
Index: gtk/gtkmessagedialog.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkmessagedialog.c,v
retrieving revision 1.43
diff -p -u -u -p -r1.43 gtkmessagedialog.c
--- gtk/gtkmessagedialog.c	10 Mar 2006 21:37:43 -0000	1.43
+++ gtk/gtkmessagedialog.c	1 May 2006 21:45:42 -0000
@@ -46,8 +46,9 @@ typedef struct _GtkMessageDialogPrivate 
 struct _GtkMessageDialogPrivate
 {
   GtkWidget *secondary_label;
-  gboolean   has_primary_markup;
-  gboolean   has_secondary_text;
+  guint message_type : 3;
+  guint has_primary_markup : 1;
+  guint has_secondary_text : 1;
 };
 
 static void gtk_message_dialog_class_init (GtkMessageDialogClass *klass);
@@ -73,7 +74,8 @@ enum {
   PROP_TEXT,
   PROP_USE_MARKUP,
   PROP_SECONDARY_TEXT,
-  PROP_SECONDARY_USE_MARKUP
+  PROP_SECONDARY_USE_MARKUP,
+  PROP_ICON
 };
 
 static gpointer parent_class;
@@ -223,6 +225,21 @@ gtk_message_dialog_class_init (GtkMessag
 							 FALSE,
 							 GTK_PARAM_READWRITE));
 
+  /**
+   * GtkMessageDialog:icon:
+   * 
+   * The image for this dialog. This can be either a stock ID or an icon name.
+   *
+   * Since: 2.10
+   */
+  g_object_class_install_property (gobject_class,
+                                   PROP_ICON,
+                                   g_param_spec_string ("icon",
+                                                        P_("Icon"),
+                                                        P_("The icon"),
+                                                        NULL,
+                                                        GTK_PARAM_READWRITE));
+
   g_type_class_add_private (gobject_class,
 			    sizeof (GtkMessageDialogPrivate));
 }
@@ -286,35 +303,6 @@ gtk_message_dialog_init (GtkMessageDialo
   _gtk_dialog_set_ignore_separator (GTK_DIALOG (dialog), TRUE);
 }
 
-static GtkMessageType
-gtk_message_dialog_get_message_type (GtkMessageDialog *dialog)
-{
-  const gchar* stock_id = NULL;
-
-  g_return_val_if_fail (GTK_IS_MESSAGE_DIALOG (dialog), GTK_MESSAGE_INFO);
-  g_return_val_if_fail (GTK_IS_IMAGE(dialog->image), GTK_MESSAGE_INFO);
-
-  stock_id = GTK_IMAGE(dialog->image)->data.stock.stock_id;
-
-  /* Look at the stock id of the image to guess the
-   * GtkMessageType value that was used to choose it
-   * in setup_type()
-   */
-  if (strcmp (stock_id, GTK_STOCK_DIALOG_INFO) == 0)
-    return GTK_MESSAGE_INFO;
-  else if (strcmp (stock_id, GTK_STOCK_DIALOG_QUESTION) == 0)
-    return GTK_MESSAGE_QUESTION;
-  else if (strcmp (stock_id, GTK_STOCK_DIALOG_WARNING) == 0)
-    return GTK_MESSAGE_WARNING;
-  else if (strcmp (stock_id, GTK_STOCK_DIALOG_ERROR) == 0)
-    return GTK_MESSAGE_ERROR;
-  else
-    {
-      g_assert_not_reached (); 
-      return GTK_MESSAGE_INFO;
-    }
-}
-
 static void
 setup_primary_label_font (GtkMessageDialog *dialog)
 {
@@ -342,9 +330,11 @@ static void
 setup_type (GtkMessageDialog *dialog,
 	    GtkMessageType    type)
 {
+  GtkMessageDialogPrivate *priv = GTK_MESSAGE_DIALOG_GET_PRIVATE (dialog);
   const gchar *stock_id = NULL;
-  GtkStockItem item;
-  
+ 
+  priv->message_type = type;
+
   switch (type)
     {
     case GTK_MESSAGE_INFO:
@@ -363,19 +353,15 @@ setup_type (GtkMessageDialog *dialog,
       stock_id = GTK_STOCK_DIALOG_ERROR;
       break;
 
+    case GTK_MESSAGE_OTHER:
+      break;
+
     default:
       g_warning ("Unknown GtkMessageType %d", type);
       break;
     }
 
-  if (stock_id == NULL)
-    stock_id = GTK_STOCK_DIALOG_INFO;
-
-  if (gtk_stock_lookup (stock_id, &item))
-    gtk_image_set_from_stock (GTK_IMAGE (dialog->image), stock_id,
-                              GTK_ICON_SIZE_DIALOG);
-  else
-    g_warning ("Stock dialog ID doesn't exist?");  
+  gtk_message_dialog_set_icon (dialog, stock_id);
 }
 
 static void 
@@ -407,7 +393,7 @@ gtk_message_dialog_set_property (GObject
 			    g_value_get_string (value));
       break;
     case PROP_USE_MARKUP:
-      priv->has_primary_markup = g_value_get_boolean (value);
+      priv->has_primary_markup = g_value_get_boolean (value) != FALSE;
       gtk_label_set_use_markup (GTK_LABEL (dialog->label), 
 				priv->has_primary_markup);
       setup_primary_label_font (dialog);
@@ -438,7 +424,10 @@ gtk_message_dialog_set_property (GObject
       gtk_label_set_use_markup (GTK_LABEL (priv->secondary_label), 
 				g_value_get_boolean (value));
       break;
-      
+    case PROP_ICON:
+      gtk_message_dialog_set_icon (dialog, g_value_get_string (value));
+      break;
+
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
@@ -460,7 +449,7 @@ gtk_message_dialog_get_property (GObject
   switch (prop_id)
     {
     case PROP_MESSAGE_TYPE:
-      g_value_set_enum (value, gtk_message_dialog_get_message_type (dialog));
+      g_value_set_enum (value, (GtkMessageType) priv->message_type);
       break;
     case PROP_TEXT:
       g_value_set_string (value, gtk_label_get_label (GTK_LABEL (dialog->label)));
@@ -482,6 +471,20 @@ gtk_message_dialog_get_property (GObject
       else
 	g_value_set_boolean (value, FALSE);
       break;
+    case PROP_ICON:
+      {
+        GtkImageType type;
+
+        type = gtk_image_get_storage_type (GTK_IMAGE (dialog->image));
+
+        if (type == GTK_IMAGE_STOCK)
+          g_object_get_property (G_OBJECT (dialog->image), "stock", value);
+        else if (type == GTK_IMAGE_ICON_NAME)
+          g_object_get_property (G_OBJECT (dialog->image), "icon-name", value);
+        else
+          g_warning ("Dialog image is neither stock nor icon name!\n");
+      }
+
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
@@ -628,6 +631,39 @@ gtk_message_dialog_new_with_markup (GtkW
 }
 
 /**
+ * gtk_message_dialog_set_icon:
+ * @message_dialog: a #GtkMessageDialog
+ * @stock_id: the stock ID or icon name, or %NULL
+ * 
+ * Sets the dialog's icon to stock_id which can be either a stock ID or an
+ * icon name, or %NULL to hide the icon.
+ *
+ * Since: 2.10
+ **/
+void
+gtk_message_dialog_set_icon (GtkMessageDialog *dialog,
+                             const gchar *stock_id)
+{
+  g_return_if_fail (GTK_IS_MESSAGE_DIALOG (dialog));
+
+  if (stock_id)
+    {
+      if (gtk_icon_factory_lookup_default (stock_id))
+        gtk_image_set_from_stock (GTK_IMAGE (dialog->image), stock_id,
+                                  GTK_ICON_SIZE_DIALOG);
+      else
+        gtk_image_set_from_icon_name (GTK_IMAGE (dialog->image), stock_id,
+                                      GTK_ICON_SIZE_DIALOG);
+
+      gtk_widget_show (dialog->image);
+    }
+  else
+    {
+       gtk_widget_hide (dialog->image);
+    }
+}
+
+/**
  * gtk_message_dialog_set_markup:
  * @message_dialog: a #GtkMessageDialog
  * @str: markup string (see <link linkend="PangoMarkupFormat">Pango markup format</link>)
