After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 584529 - Refactor whereAmI to use the new formatting strings
Refactor whereAmI to use the new formatting strings
Status: RESOLVED FIXED
Product: orca
Classification: Applications
Component: general
2.27.x
Other All
: Normal normal
: 2.28.0
Assigned To: Joanmarie Diggs (IRC: joanie)
Orca Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-06-01 18:37 UTC by Joanmarie Diggs (IRC: joanie)
Modified: 2009-11-09 21:35 UTC
See Also:
GNOME target: ---
GNOME version: 2.27/2.28


Attachments
getting started (129.73 KB, patch)
2009-06-01 18:43 UTC, Joanmarie Diggs (IRC: joanie)
reviewed Details | Review
solution for the non speaking of header contents? (1020 bytes, patch)
2009-06-12 07:50 UTC, Joanmarie Diggs (IRC: joanie)
none Details | Review
Take 2 or 3 or whatever.... (1.09 KB, patch)
2009-06-12 07:59 UTC, Joanmarie Diggs (IRC: joanie)
none Details | Review
Patch that hopefully does the same as the previous ones, but simplifies the code much more (4.23 KB, patch)
2009-06-12 14:00 UTC, Willie Walker
committed Details | Review

Description Joanmarie Diggs (IRC: joanie) 2009-06-01 18:37:12 UTC
The where Am I code should make use of the new formatting strings. (See bug #570658)
Comment 1 Joanmarie Diggs (IRC: joanie) 2009-06-01 18:43:26 UTC
Created attachment 135756 [details] [review]
getting started

I've done quite a bit; quite a bit remains to be done. Putting this here for "safe keeping" because I need a break. Marking as needs-work because it's still in the "just get it working" phase.

Will feel free to take a gander just to be sure I'm not totally off in what I'm doing. :-) Also feel free to tackle the whereAmI text selection stuff if you're really bored. :-) :-) :-) :-)
Comment 2 Willie Walker 2009-06-05 10:35:54 UTC
Nice start Joanie!

I created a new branch, 570658-whereami.  I realize now it probably should have been called 584529 after this bug, but I guess my mind has been on "570658 is the table-driven refactor bug" mode for too long.  This branch is based off of master and starts with Joanie's patch for this bug followed by

* Reconciling the patch with the current master branch

* Updating the tests to answer some questions and remove others that Joanie had in the code

* Moving the tooltip code to the formatting string

* Making more use of the **args parameter for the generator methods and being more consistent with how the keys are named:

        args is a dictionary that may contain any of the following:
        - alreadyFocused: if True, we're getting speech for an object
          that previously had focus
        - priorObj: if set, represents the object that had focus before
          this object
        - includeContext: boolean (default=True) which says whether
          the context for an object should be included as a prefix
          and suffix
        - role: a role to override the object's role
        - formatType: the type of formatting, such as
          'focused', 'basicWhereAmI', etc.
        - forceMnemonic: boolean (default=False) which says if we
          should ignore the settings.enableMnemonicSpeaking setting
        - forceTutorial: boolean (default=False) which says if we
          should force a tutorial to be spoken or not

* Simplification of how formatting strings are obtained.  They are now obtained by an output mode, such as 'speech', 'braille' and a formatType, such as 'focused', 'basicWhereAmI', etc.  There's still some fallback code in formatting.py:getFormat, but it's better than it was.

* Moved a lot of code out of where_am_I and into the script and speech generator.

* Handled the text where am I (including selection)

There is still work to be done:

* All the modules for handling where am I should be renamed to where_am_i.py for consistency.  They also need to be migrated to the new formatting strings method.

* The current default where_am_I.py module has a huge section of code sandwiched between "WDW - all this can go..." comments.  This can be deleted and the "if True: self._oldSpeakText(..." stuff can go once we're sure the new stuff works.

* The current default where_am_I.py module still has some oddness in it for ROLE_ENTRY and getRealActiveDescendant.  I'm not sure what to do with this.

* We need to understand why the old where am I code is changing the spoken punctuation setting if text attributes are being spoken and make sure the new code provides the intended user presentation.

* I think the new speech_generator.py:_getDescription might need to be reworked because it is making some assumptions about the contents of the array returned by _getLabel.  We can tell by looking at _getLabel that we know what it is doing *now*, but the generators should feel free to return an array of strings and possibly voice and audio specifications.  We might just copy the logic from _getLabel into _getDescription, but I'm not quite sure what to do.

* Need to look at the ROLE_LINK questions Joanie had in where_am_I.py.

* The gtk-demo tests are working well, the Gecko tests need some work.
Comment 3 Willie Walker 2009-06-11 19:03:27 UTC
The 570658-whereami branch has been merged into master and then deleted.  There are a couple remaining issues which should be looked at:

http://mail.gnome.org/archives/orca-list/2009-June/msg00129.html

"""
I've done a little light testing and only found one problem so far. In Thunderbird's Write window, if you are in one of the recipient fields and press where am I, you don't hear the contents of the text field--I hear "toolbar list item 4 of 4".

The label "toolbar" is a problem in both Firefox and Thunderbird that has been around for a long time and I have never gotten around to filing as a bug. In Firefox, labels are not read for the Location and Search text fields on the toolbar when "where am I" is pressed, just the overall label "toolbar". In the Thunderbird Write window, the same thing is true for the recipient and subject fields. I've tested in only a few dialog boxes within Thunderbird, and text fields are read correctly with their labels.
"""

and

http://mail.gnome.org/archives/orca-list/2009-June/msg00134.html

"""
Yikes. Looks like we made a change that is going to cause existing user-settings.py files to be incompatible with the new version if you've customized some specific keybindings. I've just checked in a change to handle the stack trace, but the result is that your custom keybindings will still not work.

To work around this, you can edit your ~/.orca/user-settings.py file and change 'getStatusBarHandler' to 'presentStatusBarHandler' and also change 'getTitleHandler' to 'presentTitleHandler' if a line for that exists. Alternatively, you can launch the orca setup and redo your customizations.

I'd like to keep the name change if possible, but if there is enough of an outcry I can always put the status bar and title handler names back to what they were.
"""
Comment 4 Joanmarie Diggs (IRC: joanie) 2009-06-12 07:50:31 UTC
Created attachment 136399 [details] [review]
solution for the non speaking of header contents?

We seem to have an issue of not speaking the name of the field (e.g. To: From: etc) in tbird. :-( Independent of that issue, I can confirm that we are speaking "list item" and not speaking the field contents in tbird. I believe that these are two separate issues.

This patch causes us to speak the field contents.

Pylinted and regression tested (firefox). Will, please review. Thanks!
Comment 5 Joanmarie Diggs (IRC: joanie) 2009-06-12 07:53:07 UTC
Ah, yes, it's nearly 4 AM.  Let me de-stupify that patch....
Comment 6 Joanmarie Diggs (IRC: joanie) 2009-06-12 07:59:48 UTC
Created attachment 136400 [details] [review]
Take 2 or 3 or whatever....
Comment 7 Willie Walker 2009-06-12 11:07:52 UTC
(In reply to comment #6)
> Created an attachment (id=136400) [edit]
> Take 2 or 3 or whatever....

I have a patch in progress that further simplifies the Where Am I code and will attach it once the regression tests have finished.

Note also that bug #530784 is related to this one with respect to the "speaking the text contents" problem.
Comment 8 Willie Walker 2009-06-12 14:00:37 UTC
Created attachment 136423 [details] [review]
Patch that hopefully does the same as the previous ones, but simplifies the code much more

This patch makes it much clearer about what we're trying to accomplish and also seems to eliminate the text contents regression we've experienced in Thunderbird.
Comment 9 Willie Walker 2009-06-12 16:21:13 UTC
Where Am I patch committed for the Thunderbird To/CC/etc text contents and where_am_I.py module simplificatino.

Also committed http://git.gnome.org/cgit/orca/commit/?id=03901d011ad06485198b890098aaa7ec133d8841 to resolve the handler rename problem.

I think this bug is good to close.