Merge lp:~rodrigo-moya/unity/accessible-name-for-indicators into lp:unity

Proposed by Rodrigo Moya
Status: Merged
Approved by: Mirco Müller
Approved revision: no longer in the source branch.
Merged at revision: 898
Proposed branch: lp:~rodrigo-moya/unity/accessible-name-for-indicators
Merge into: lp:unity
Diff against target: 58 lines (+11/-4)
3 files modified
services/CMakeLists.txt (+1/-1)
services/panel-indicator-accessible.c (+2/-2)
services/panel-indicator-entry-accessible.c (+8/-1)
To merge this branch: bzr merge lp:~rodrigo-moya/unity/accessible-name-for-indicators
Reviewer Review Type Date Requested Status
Mirco Müller (community) Approve
Alejandro Piñeiro (community) Approve
Review via email: mp+51120@code.launchpad.net

Description of the change

Use the accessible name from the entries to set the name for PanelIndicatorAccessible class

To post a comment you must log in.
Revision history for this message
Alejandro Piñeiro (apinheiro) wrote :

The code seems ok.

review: Approve
Revision history for this message
Mirco Müller (macslow) wrote :

A paranoia-check against NULL for l->data before IndicatorObjectEntry *entry = (IndicatorObjectEntry *) l->data; would be nice. Apart form that approved.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'services/CMakeLists.txt'
2--- services/CMakeLists.txt 2011-02-23 17:22:58 +0000
3+++ services/CMakeLists.txt 2011-02-28 11:26:42 +0000
4@@ -2,7 +2,7 @@
5 # Panel Service
6 #
7 find_package(PkgConfig)
8-pkg_check_modules(SERVICE_DEPS REQUIRED gobject-2.0 gio-2.0 gtk+-2.0 gthread-2.0 indicator x11 gconf-2.0)
9+pkg_check_modules(SERVICE_DEPS REQUIRED gobject-2.0 gio-2.0 gtk+-2.0 gthread-2.0 indicator>=0.3.19 x11 gconf-2.0)
10
11 execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} indicator --variable indicatordir OUTPUT_VARIABLE _indicatordir OUTPUT_STRIP_TRAILING_WHITESPACE)
12 execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} indicator --variable iconsdir OUTPUT_VARIABLE _iconsdir OUTPUT_STRIP_TRAILING_WHITESPACE)
13
14=== modified file 'services/panel-indicator-accessible.c'
15--- services/panel-indicator-accessible.c 2011-02-15 12:51:44 +0000
16+++ services/panel-indicator-accessible.c 2011-02-28 11:26:42 +0000
17@@ -147,7 +147,6 @@
18 ATK_OBJECT_CLASS (panel_indicator_accessible_parent_class)->initialize (accessible, data);
19
20 pia = PANEL_INDICATOR_ACCESSIBLE (accessible);
21- atk_object_set_name (accessible, _("An indicator")); /* FIXME */
22 atk_object_set_role (accessible, ATK_ROLE_PANEL);
23
24 /* Setup the indicator object */
25@@ -162,8 +161,9 @@
26 for (l = entries; l != NULL; l = l->next)
27 {
28 AtkObject *accessible;
29+ IndicatorObjectEntry *entry = (IndicatorObjectEntry *) l->data;
30
31- accessible = panel_indicator_entry_accessible_new ((IndicatorObjectEntry *) l->data);
32+ accessible = panel_indicator_entry_accessible_new (entry);
33 pia->priv->a11y_children = g_slist_append (pia->priv->a11y_children, accessible);
34 }
35
36
37=== modified file 'services/panel-indicator-entry-accessible.c'
38--- services/panel-indicator-entry-accessible.c 2011-02-15 12:51:44 +0000
39+++ services/panel-indicator-entry-accessible.c 2011-02-28 11:26:42 +0000
40@@ -92,11 +92,18 @@
41 if (GTK_IS_LABEL (piea->priv->entry->label))
42 {
43 atk_object_set_role (accessible, ATK_ROLE_LABEL);
44- atk_object_set_name (accessible, gtk_label_get_text (piea->priv->entry->label));
45+ atk_object_set_name (accessible,
46+ piea->priv->entry->accessible_desc ?
47+ piea->priv->entry->accessible_desc :
48+ gtk_label_get_text (piea->priv->entry->label));
49 }
50 if (GTK_IS_IMAGE (piea->priv->entry->image))
51 {
52 atk_object_set_role (accessible, ATK_ROLE_IMAGE);
53+ if (piea->priv->entry->accessible_desc != NULL)
54+ {
55+ atk_object_set_name (accessible, piea->priv->entry->accessible_desc);
56+ }
57 }
58 }
59