Skip to content

AppModule: Customize retrieval of status bar object or TextInfo (#4640)#9792

Merged
feerrenrut merged 4 commits into
nvaccess:masterfrom
accessolutions:i4640
Apr 30, 2020
Merged

AppModule: Customize retrieval of status bar object or TextInfo (#4640)#9792
feerrenrut merged 4 commits into
nvaccess:masterfrom
accessolutions:i4640

Conversation

@JulienCochuyt

Copy link
Copy Markdown
Contributor

Link to issue number:

Fixes #2125
Fixes #4640

Summary of the issue:

In some cases, the standard way to retrieve a status bar is not satisfying.

Description of how this pull request fixes the issue:

Add at AppModule level:

  • _get_statusBar : For use by api.getStatusBar to retrieve a custom object
  • _get_statusBarTextInfo : For use by GlobalCommands.script_reportStatusLine when resorting to flat review.

Another approach would have been to allow AppModule to override script_reportStatusLine altogether, but every implementation should then take care to provide the whole standard behavior of moving review and supporting copy to clipboard.

This PR is just a humble bare proposal, but please mind the first report on this issue dates back to 2012.

Testing performed:

Known issues with pull request:

Change log entry:

Section: Changes for Developers
Status bar retrieval may now be customized by an AppModule.

@josephsl

Copy link
Copy Markdown
Contributor

Hi,

Which apps and scenarios did you test this against? The most prominent scenario is viewing file/folder information in File Explorer (Windows Explorer in Windows 7 and earlier).

Thanks.

@JulienCochuyt

Copy link
Copy Markdown
Contributor Author

Hi Joseph,

This PR is barely a proof of concept.
For custom development targeting business apps and with the lack of a standard mechanism, we have most often resorted to redefine the global command gestures at app module level. This approach is not suitable for wider spread development however, as the end user might have redefined the kb gesture or braille gestures aliases.

The scenarios for which this feature is beneficial are IMHO:

  • MDI applications in which the main window has no status bar, individual dialogs have, but are not promoted as the foreground object. Ex: SAM Broadcaster
  • Console-like applications on which the status bar info is not always at the bottom line. Ex: GVim
  • Applications with a standard status bar but with location info that tend to drift for whatever reason. In this case, the current implementation is often unable to retrieve the status bar unless the window is forcibly redrawn. Ex: Eclipse
  • Applications with no status bar that benefit for a standard way of retrieving status-related info. This last one is probably more controversial.

@JulienCochuyt

Copy link
Copy Markdown
Contributor Author

4f7c44c: Rebased onto latest master.

@JulienCochuyt

Copy link
Copy Markdown
Contributor Author

Rebased onto latest master and linted.

@lukaszgo1

Copy link
Copy Markdown
Contributor

While it is certainly too late to include it into 2019.3 it would be great if it could be considered for the next release. It is requested quite often and would unblock a few issues cc @feerrenrut @michaelDCurran

@feerrenrut feerrenrut added Addon/API Changes to NVDA's API for addons to support addon development. enhancement labels Apr 8, 2020
@lukaszgo1

Copy link
Copy Markdown
Contributor

@feerrenrut or @michaelDCurran Is this on your radar? This is requested for at least 8 years, and when someone finally has written the code for this the PR hasn't even been reviewed for 10 months.

@lukaszgo1

Copy link
Copy Markdown
Contributor

@JulienCochuyt Have you seen this commend by @jcsteh ?

@ruifontes

ruifontes commented Apr 28, 2020 via email

Copy link
Copy Markdown
Contributor

@lukaszgo1

Copy link
Copy Markdown
Contributor

@ruifontes Please note that status bar not being read on File Explorer is only one from countless examles for which being able to override status bar check would benefit.

@Adriani90

Copy link
Copy Markdown
Collaborator

And regarding the addon, global extension global plugin is not an official addon, it has not passed the review because it is too comprehensive and there are many conflicts with NVDA's default features and key strokes. While I understand users who use it for certain cases, I would not see that addon as an alternative solution in the mid- or long-term. At least not for solving this problem.

@ruifontes

ruifontes commented Apr 28, 2020 via email

Copy link
Copy Markdown
Contributor

@feerrenrut

Copy link
Copy Markdown
Contributor

This PR is barely a proof of concept.

@JulienCochuyt This approach looks fine to me. Is there remaining work / testing necessary, or do you believe it is ready?

@JulienCochuyt

Copy link
Copy Markdown
Contributor Author

@lukaszgo1 wrote:

@JulienCochuyt Have you seen this commend by @jcsteh ?

Thanks for pointing this out:

Doing this at the app module level is probably not ideal, as there could be multiple top level windows in an application. It's probably better to do it on the foreground NVDAObject.

I partly disagree.
Doing it at the sole foreground object level would force an AppModule author to overlay every single object that can be promoted as foreground object in order to customize retrieval of the "main status bar".
When these objects already have to be overlaid by an AppModule, its still fairly easy for the AppModule to forward the call to them.
Nevertheless, adding the statusBar and statusBarText properties also at NVDAObject level might pave the road for allowing custom status bar retrieval by the objects defined in NVDA core - that is, without the need for an AppModule at all.
I've first thought we would add this when we first encounter the need to, but I'd be happy to add it in this PR if it is deemed desirable.

@feerrenrut wrote:

This PR is barely a proof of concept.

@JulienCochuyt This approach looks fine to me. Is there remaining work / testing necessary, or do you believe it is ready?

I believe it is ready as the code is fairly simple.
Still, it has only been tested against regressions as we've resorted so far to less satisfying techniques as mentioned in #9792 (comment)

@feerrenrut feerrenrut left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JulienCochuyt Thanks for the update. I'm going to go ahead and merge this in that case.

@feerrenrut feerrenrut merged commit bdfa010 into nvaccess:master Apr 30, 2020
@nvaccessAuto nvaccessAuto added this to the 2020.1 milestone Apr 30, 2020
@feerrenrut feerrenrut modified the milestones: 2020.1, 2020.2 Apr 30, 2020
feerrenrut added a commit that referenced this pull request Apr 30, 2020
@JulienCochuyt JulienCochuyt deleted the i4640 branch April 30, 2020 14:24
@amirsol81

Copy link
Copy Markdown

Apparently this has broken NVDA's ability to report time-related info in Foobar2000 in Alpha 20080 -- see #11082

@josephsl

josephsl commented May 2, 2020 via email

Copy link
Copy Markdown
Contributor

@feerrenrut

Copy link
Copy Markdown
Contributor

Anyone interested in improving status bars or in Java applications, might also be interested in #5674

@amirsol81

Copy link
Copy Markdown

#11082 affecting Foobar2000 is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Addon/API Changes to NVDA's API for addons to support addon development. enhancement

Projects

None yet

8 participants