]> Pileus Git - ~andy/gtk/commitdiff
Fix an a11y regression
authorMatthias Clasen <matthiasc@src.gnome.org>
Mon, 4 Dec 2006 17:56:30 +0000 (17:56 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Mon, 4 Dec 2006 17:56:30 +0000 (17:56 +0000)
ChangeLog
gtk/gtkmessagedialog.c

index 113356aa293f8e74d25ec3f14bca928f4e95b747..3e2ab205be376645157d2162094f3e91c01cca7a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-12-04  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkmessagedialog.c (setup_type): Set a11y name and role
+       since we no longer set window titles.
+
 2006-12-04  Christian Persch  <chpe@cvs.gnome.org>
 
        * gtk/gtkpagesetup.c: (gtk_page_setup_get_paper_size),
index 9b3306328025d352c76dea73a73d2b5cbaa4a830..c67277ebafeeb1b29791f550175e4d64d836cb8a 100644 (file)
@@ -29,6 +29,7 @@
 #include <string.h>
 
 #include "gtkmessagedialog.h"
+#include "gtkaccessible.h"
 #include "gtklabel.h"
 #include "gtkhbox.h"
 #include "gtkvbox.h"
@@ -308,6 +309,7 @@ setup_type (GtkMessageDialog *dialog,
 {
   GtkMessageDialogPrivate *priv = GTK_MESSAGE_DIALOG_GET_PRIVATE (dialog);
   const gchar *stock_id = NULL;
+  AtkObject *atk_obj;
  
   priv->message_type = type;
 
@@ -340,6 +342,19 @@ setup_type (GtkMessageDialog *dialog,
   if (stock_id)
     gtk_image_set_from_stock (GTK_IMAGE (dialog->image), stock_id,
                               GTK_ICON_SIZE_DIALOG);
+      
+  atk_obj = gtk_widget_get_accessible (GTK_WIDGET (dialog));
+  if (GTK_IS_ACCESSIBLE (atk_obj))
+    {
+      atk_object_set_role (atk_obj, ATK_ROLE_ALERT);
+      if (stock_id)
+        {
+          GtkStockItem item;
+
+          gtk_stock_lookup (stock_id, &item);
+          atk_object_set_name (atk_obj, item.label);
+        }
+    }
 }
 
 static void