Merge lp:~themuso/ubiquity/indicator-accessible-desc into lp:ubiquity

Proposed by Luke Yelavich
Status: Work in progress
Proposed branch: lp:~themuso/ubiquity/indicator-accessible-desc
Merge into: lp:ubiquity
Diff against target: 97 lines (+48/-0)
3 files modified
configure.ac (+2/-0)
debian/changelog (+7/-0)
src/panel/panel.c (+39/-0)
To merge this branch: bzr merge lp:~themuso/ubiquity/indicator-accessible-desc
Reviewer Review Type Date Requested Status
Dimitri John Ledkov Needs Resubmitting
Review via email: mp+50866@code.launchpad.net

Description of the change

I can commit myself, but I'd like another pair of eyes over this. This is the same code as can be found in indicator-applet for dealing with accessible descriptions of indicators.

To post a comment you must log in.
Revision history for this message
Stéphane Graber (stgraber) wrote :

It looks good but I haven't tested.

As the branch has been around for a while, I'm wondering if it's still relevant. I'll try it tomorrow.

Revision history for this message
Luke Yelavich (themuso) wrote :

It will be relevant once we have keyboard navigation working properly for the panel, i.e press a shortcut key and move keyboard focus to the panel. I'd like to get that sorted next cycle.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

The development of ubiquity has moved to git, still hosted on launchpad. If this merge proposal is still relevant, please resubmit it against the git branches found at https://code.launchpad.net/ubiquity

Sorry for any inconvenience caused.

review: Needs Resubmitting

Unmerged revisions

4516. By Luke Yelavich

src/panel/panel.c: Extend indicator code to support indicator accessible
descriptions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'configure.ac'
2--- configure.ac 2010-10-11 16:24:13 +0000
3+++ configure.ac 2011-02-23 04:16:59 +0000
4@@ -24,12 +24,14 @@
5 AC_PROG_MAKE_SET
6
7 GTK_REQUIRED=2.10.0
8+ATK_REQUIRED=1.0
9 AM_PATH_PYTHON([2.5])
10
11 if test "x$UBIQUITY_NO_GTK" = x; then
12 PKG_CHECK_MODULES(PANEL, [glib-2.0
13 gtk+-2.0 >= $GTK_REQUIRED
14 indicator
15+ atk >= $ATK_REQUIRED
16 x11])
17 AC_SUBST(PANEL_CFLAGS)
18 AC_SUBST(PANEL_LIBS)
19
20=== modified file 'debian/changelog'
21--- debian/changelog 2011-02-20 03:11:32 +0000
22+++ debian/changelog 2011-02-23 04:16:59 +0000
23@@ -1,3 +1,10 @@
24+ubiquity (2.5.17) UNRELEASED; urgency=low
25+
26+ * src/panel/panel.c: Extend indicator code to support indicator accessible
27+ descriptions
28+
29+ -- Luke Yelavich <themuso@ubuntu.com> Wed, 23 Feb 2011 14:39:52 +1100
30+
31 ubiquity (2.5.16) natty; urgency=low
32
33 [ Evan Dandrea ]
34
35=== modified file 'src/panel/panel.c'
36--- src/panel/panel.c 2011-02-01 11:40:30 +0000
37+++ src/panel/panel.c 2011-02-23 04:16:59 +0000
38@@ -31,6 +31,7 @@
39 #include <X11/Xlib.h>
40 #include <X11/Xutil.h>
41 #include <libindicator/indicator-object.h>
42+#include <atk/atk.h>
43
44 #include "na-tray-manager.h"
45 #include "na-tray.h"
46@@ -111,6 +112,40 @@
47 gdk_error_trap_pop ();
48 }
49
50+static void
51+update_accessible_desc(IndicatorObjectEntry * entry, GtkWidget * menuitem)
52+{
53+ /* FIXME: We need to deal with the use case where the contents of the
54+ label overrides what is found in the atk object's name, or at least
55+ orca speaks the label instead of the atk object name.
56+ */
57+ AtkObject * menuitem_obj = gtk_widget_get_accessible(menuitem);
58+ if (entry->accessible_desc != NULL) {
59+ atk_object_set_name(menuitem_obj, entry->accessible_desc);
60+ } else {
61+ atk_object_set_name(menuitem_obj, "");
62+ }
63+ return;
64+}
65+
66+static void
67+accessible_desc_update (IndicatorObject * io, IndicatorObjectEntry * entry, GtkWidget * menuitem)
68+{
69+ g_return_if_fail(GTK_IS_WIDGET(menuitem));
70+
71+ IndicatorObjectClass * class = INDICATOR_OBJECT_GET_CLASS(io);
72+
73+ /* Not all indicator entries have a get_accessible_desc method, such as
74+ indicator-application entries */
75+ if (class->get_accessible_desc != NULL) {
76+ entry->accessible_desc = class->get_accessible_desc(io);
77+ }
78+
79+ update_accessible_desc(entry, menuitem);
80+
81+ return;
82+}
83+
84 /* Stolen from indicator-loader.c in unity. */
85 static void
86 entry_added (IndicatorObject * io, IndicatorObjectEntry * entry, gpointer user_data)
87@@ -134,6 +169,10 @@
88 }
89
90 gtk_menu_shell_append(GTK_MENU_SHELL(user_data), menuitem);
91+ g_signal_connect(G_OBJECT(io), INDICATOR_OBJECT_SIGNAL_ACCESSIBLE_DESC_UPDATE, G_CALLBACK(accessible_desc_update), menuitem);
92+ if (entry->accessible_desc != NULL) {
93+ update_accessible_desc(entry, menuitem);
94+ }
95 gtk_widget_show(menuitem);
96
97 g_object_set_data(G_OBJECT(menuitem), ENTRY_DATA_NAME, entry);

Subscribers

People subscribed via source and target branches

to status/vote changes: