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
=== modified file 'configure.ac'
--- configure.ac 2010-10-11 16:24:13 +0000
+++ configure.ac 2011-02-23 04:16:59 +0000
@@ -24,12 +24,14 @@
24AC_PROG_MAKE_SET24AC_PROG_MAKE_SET
2525
26GTK_REQUIRED=2.10.026GTK_REQUIRED=2.10.0
27ATK_REQUIRED=1.0
27AM_PATH_PYTHON([2.5])28AM_PATH_PYTHON([2.5])
2829
29if test "x$UBIQUITY_NO_GTK" = x; then30if test "x$UBIQUITY_NO_GTK" = x; then
30 PKG_CHECK_MODULES(PANEL, [glib-2.031 PKG_CHECK_MODULES(PANEL, [glib-2.0
31 gtk+-2.0 >= $GTK_REQUIRED32 gtk+-2.0 >= $GTK_REQUIRED
32 indicator33 indicator
34 atk >= $ATK_REQUIRED
33 x11])35 x11])
34 AC_SUBST(PANEL_CFLAGS)36 AC_SUBST(PANEL_CFLAGS)
35 AC_SUBST(PANEL_LIBS)37 AC_SUBST(PANEL_LIBS)
3638
=== modified file 'debian/changelog'
--- debian/changelog 2011-02-20 03:11:32 +0000
+++ debian/changelog 2011-02-23 04:16:59 +0000
@@ -1,3 +1,10 @@
1ubiquity (2.5.17) UNRELEASED; urgency=low
2
3 * src/panel/panel.c: Extend indicator code to support indicator accessible
4 descriptions
5
6 -- Luke Yelavich <themuso@ubuntu.com> Wed, 23 Feb 2011 14:39:52 +1100
7
1ubiquity (2.5.16) natty; urgency=low8ubiquity (2.5.16) natty; urgency=low
29
3 [ Evan Dandrea ]10 [ Evan Dandrea ]
411
=== modified file 'src/panel/panel.c'
--- src/panel/panel.c 2011-02-01 11:40:30 +0000
+++ src/panel/panel.c 2011-02-23 04:16:59 +0000
@@ -31,6 +31,7 @@
31#include <X11/Xlib.h>31#include <X11/Xlib.h>
32#include <X11/Xutil.h>32#include <X11/Xutil.h>
33#include <libindicator/indicator-object.h>33#include <libindicator/indicator-object.h>
34#include <atk/atk.h>
3435
35#include "na-tray-manager.h"36#include "na-tray-manager.h"
36#include "na-tray.h"37#include "na-tray.h"
@@ -111,6 +112,40 @@
111 gdk_error_trap_pop ();112 gdk_error_trap_pop ();
112}113}
113114
115static void
116update_accessible_desc(IndicatorObjectEntry * entry, GtkWidget * menuitem)
117{
118 /* FIXME: We need to deal with the use case where the contents of the
119 label overrides what is found in the atk object's name, or at least
120 orca speaks the label instead of the atk object name.
121 */
122 AtkObject * menuitem_obj = gtk_widget_get_accessible(menuitem);
123 if (entry->accessible_desc != NULL) {
124 atk_object_set_name(menuitem_obj, entry->accessible_desc);
125 } else {
126 atk_object_set_name(menuitem_obj, "");
127 }
128 return;
129}
130
131static void
132accessible_desc_update (IndicatorObject * io, IndicatorObjectEntry * entry, GtkWidget * menuitem)
133{
134 g_return_if_fail(GTK_IS_WIDGET(menuitem));
135
136 IndicatorObjectClass * class = INDICATOR_OBJECT_GET_CLASS(io);
137
138 /* Not all indicator entries have a get_accessible_desc method, such as
139 indicator-application entries */
140 if (class->get_accessible_desc != NULL) {
141 entry->accessible_desc = class->get_accessible_desc(io);
142 }
143
144 update_accessible_desc(entry, menuitem);
145
146 return;
147}
148
114/* Stolen from indicator-loader.c in unity. */149/* Stolen from indicator-loader.c in unity. */
115static void150static void
116entry_added (IndicatorObject * io, IndicatorObjectEntry * entry, gpointer user_data)151entry_added (IndicatorObject * io, IndicatorObjectEntry * entry, gpointer user_data)
@@ -134,6 +169,10 @@
134 }169 }
135170
136 gtk_menu_shell_append(GTK_MENU_SHELL(user_data), menuitem);171 gtk_menu_shell_append(GTK_MENU_SHELL(user_data), menuitem);
172 g_signal_connect(G_OBJECT(io), INDICATOR_OBJECT_SIGNAL_ACCESSIBLE_DESC_UPDATE, G_CALLBACK(accessible_desc_update), menuitem);
173 if (entry->accessible_desc != NULL) {
174 update_accessible_desc(entry, menuitem);
175 }
137 gtk_widget_show(menuitem);176 gtk_widget_show(menuitem);
138177
139 g_object_set_data(G_OBJECT(menuitem), ENTRY_DATA_NAME, entry);178 g_object_set_data(G_OBJECT(menuitem), ENTRY_DATA_NAME, entry);

Subscribers

People subscribed via source and target branches

to status/vote changes: