GNOME Bugzilla – Bug 487230
get{Speech,ShortBraille,LongBraille,Braille}ForRoleName should allow role to be overridden
Last modified: 2007-10-30 17:16:39 UTC
There are spots in Orca where we temporarily override the role of an object to fool the generator into giving us a different rolename for an object. The most notable examples of this include changing table cell roles into checkboxes. A possible solution to this would be to add an extra parameter to the rolenames.py methods to specify rolename to use. Another possible workaround might be to use the user_data field as a means to hold the overriding role value. The rolenames.py methods could then check for the existence of that. Another alternative is to do something even better, but which I'm not thinking of right now. :-)
We discussed this early on in the migration process, and we said that rolenames.py would be a good home for this kind of logic, do you still agree? If you look at rolenames.py I think I already started doing that kind of work, and it should be merged to trunk.
I'd really like for scripts to be able to override decision-making logic like this if they could. For example, if by change Gecko decided to implement something like checkboxes a little differently (e.g., expose a 'checkable' attribute or something like that), it would be nice if Gecko.py could provide the code to handle that rather than rolenames.py.
Created attachment 97393 [details] [review] Proposed fix This adds the ability in a few key methods to override the accessible's provided role name.
Looks wonderful and you say it is a "perfect patch" and tested in IRC :-). So, commit it to trunk. Thanks!
This patch seems to be causing icons on the desktop to be reported as checkboxes (as reported by Michael Whapples on the Orca list). From my debug.out: GENERATOR: _getSpeechForIcon obj = debug.out role = icon already_focused = False utterances: (debug.out) (plain text document) (check box) SPEECH OUTPUT: '' SPEECH OUTPUT: 'debug.out plain text document check box'
> GENERATOR: _getSpeechForIcon Looks like there was a cut/paste typo in this speechgenerator.py method. :-( It refers to ROLE_CHECK_BOX.
Looks like the icon problem was fixed with Eitan's commit: http://svn.gnome.org/viewvc/orca/trunk/src/orca/speechgenerator.py?view=diff&r1=3133&r2=3134 Can we close this bug?
Hopefully his issue is fixed.