aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog8
-rw-r--r--calendar/gui/dialogs/cal-prefs-dialog.glade5
-rw-r--r--calendar/gui/e-timezone-entry.c44
3 files changed, 56 insertions, 1 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index c83af061d5..9d6bf2584b 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,11 @@
+2006-06-05 Li Yuan <li.yuan@sun.com>
+
+ * gui/dialogs/cal-prefs-dialog.glade:
+ add labelled by relationship between label and e-timezone-entry.
+ * gui/e-timezone-entry.c: (add_relation),
+ (e_timezone_entry_set_timezone):
+ add relationship between label and entry.
+
2006-06-05 Srinivasa Ragavan <sragavan@novell.com>
** Fixed bug #268884
diff --git a/calendar/gui/dialogs/cal-prefs-dialog.glade b/calendar/gui/dialogs/cal-prefs-dialog.glade
index 068c157087..86333965bd 100644
--- a/calendar/gui/dialogs/cal-prefs-dialog.glade
+++ b/calendar/gui/dialogs/cal-prefs-dialog.glade
@@ -103,7 +103,7 @@
<property name="column_spacing">6</property>
<child>
- <widget class="GtkLabel" id="label10">
+ <widget class="GtkLabel" id="timezone_label">
<property name="visible">True</property>
<property name="label" translatable="yes">Time _zone:</property>
<property name="use_underline">True</property>
@@ -165,6 +165,9 @@
<property name="int1">0</property>
<property name="int2">0</property>
<property name="last_modification_time">Thu, 13 Jan 2005 04:18:03 GMT</property>
+ <accessibility>
+ <atkrelation target="timezone_label" type="labelled-by"/>
+ </accessibility>
</widget>
<packing>
<property name="left_attach">1</property>
diff --git a/calendar/gui/e-timezone-entry.c b/calendar/gui/e-timezone-entry.c
index fe57453540..e708a03618 100644
--- a/calendar/gui/e-timezone-entry.c
+++ b/calendar/gui/e-timezone-entry.c
@@ -71,6 +71,8 @@ static void on_entry_changed (GtkEntry *entry,
ETimezoneEntry *tentry);
static void on_button_clicked (GtkWidget *widget,
ETimezoneEntry *tentry);
+static void add_relation (ETimezoneEntry *tentry,
+ GtkWidget *widget);
static void e_timezone_entry_set_entry (ETimezoneEntry *tentry);
@@ -224,6 +226,46 @@ e_timezone_entry_get_timezone (ETimezoneEntry *tentry)
return priv->zone;
}
+static void
+add_relation (ETimezoneEntry *tentry,
+ GtkWidget *widget)
+{
+ AtkObject *a11ytentry, *a11yWidget;
+ AtkRelationSet *set;
+ AtkRelation *relation;
+ GPtrArray *target;
+ gpointer target_object;
+
+ /* add a labelled_by relation for widget for accessibility */
+
+ a11ytentry = gtk_widget_get_accessible (GTK_WIDGET (tentry));
+ a11yWidget = gtk_widget_get_accessible (widget);
+
+ set = atk_object_ref_relation_set (a11yWidget);
+ if (set != NULL) {
+ relation = atk_relation_set_get_relation_by_type (set,
+ ATK_RELATION_LABELLED_BY);
+ /* check whether has a labelled_by relation already */
+ if (relation != NULL)
+ return;
+ }
+
+ set = atk_object_ref_relation_set (a11ytentry);
+ if (!set)
+ return;
+
+ relation = atk_relation_set_get_relation_by_type (set,
+ ATK_RELATION_LABELLED_BY);
+ if (relation != NULL) {
+ target = atk_relation_get_target (relation);
+ target_object = g_ptr_array_index (target, 0);
+ if (ATK_IS_OBJECT (target_object)) {
+ atk_object_add_relationship (a11yWidget,
+ ATK_RELATION_LABELLED_BY,
+ ATK_OBJECT (target_object));
+ }
+ }
+}
void
e_timezone_entry_set_timezone (ETimezoneEntry *tentry,
@@ -238,6 +280,8 @@ e_timezone_entry_set_timezone (ETimezoneEntry *tentry,
priv->zone = zone;
e_timezone_entry_set_entry (tentry);
+
+ add_relation (tentry, priv->entry);
}