Skip to content

Fix-up of #11456: Fix for messages when context help is not available#11711

Merged
feerrenrut merged 2 commits into
nvaccess:masterfrom
CyrilleB79:contextHelpFromSource
Oct 5, 2020
Merged

Fix-up of #11456: Fix for messages when context help is not available#11711
feerrenrut merged 2 commits into
nvaccess:masterfrom
CyrilleB79:contextHelpFromSource

Conversation

@CyrilleB79

Copy link
Copy Markdown
Contributor

Link to issue number:

Fixes #7757 (follow-up)
Fix-up of PR #11456:

Summary of the issue:

The code integrated with #11456 has defined two messages when no context help is available in the following cases:

  1. The user guide cannot be found, e.g. because NVDA is running from source and the documentation has not yet been compiled.
  2. The UI element on which context help is requested has no associated context sensitive help.
    However, these messages cannot be heard.

Case 1

STR:

  • Run NVDA from source; documentation should not have been compiled before
  • Open General settings panel
  • Press F1
    The following error occurs:
IO - inputCore.InputManager.executeGesture (13:53:44.662) - winInputHook (11948):
Input: kb(desktop):f1
IO - speech.speak (13:53:44.662) - MainThread (5156):
Speaking ['No context sensitive help is available here at this time.']
ERROR - unhandled exception (13:53:44.678) - MainThread (5156):
Traceback (most recent call last):
  File "gui\contextHelp.py", line 66, in <lambda>
    lambda evt: _onEvtHelp(helpId, evt),
  File "gui\contextHelp.py", line 74, in _onEvtHelp
    showHelp(helpId)
  File "gui\contextHelp.py", line 36, in showHelp
    if not os.path.exists(helpFile):
  File "C:\Users\Cyrille\AppData\Local\Programs\Python\Python37-32\lib\genericpath.py", line 19, in exists
    os.stat(path)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType

Case 2

STR:

  • Run NVDA from source with doc compiled (or probably from launcher, portable or installed version)
  • Install an add-on having a setting panel, e.g. Instant Translate
  • Open the add-on's setting panel
  • Press F1
    The following message should be spoken by NVDA:

"No context sensitive help is available here at this time."
However it cannot be heard and the browser starts up with NVDA User Guide opened at the beginning of the document.
NVDA userguide is opened in the browser with the following address:
file:///C:/Users/Cyrille/Documents/DevP/GIT/nvda/user_docs/fr/userGuide.html#

Description of how this pull request fixes the issue:

  • call ui.message in main thread since calling it from wx thread is not working
  • when an error message is reported (ui.message calls), return immediately and do not open the browser since opening the browser cuts off the reported message.
  • modified the condition to test if the help file could be found since gui.getDocFilePath returns None if no file has been found.
  • gui.getDocFilePath: if it does not find any localized or not localized file, return None explicitely. It was already returning None in this case since no return instruction was called if the for loop did not find anything.

Possible additional change

When pressing F1 in an add-on setting panel the following message is reported:
"No context sensitive help is available here at this time."
I suggest to change this message since:

  • "context sensitive help" seems a developer term
  • I do not understand why it is specified "at this time"
    So I suggest to replace the message with:
    "No help available here"
    May I add it to this PR?

Testing performed:

Tested successfully STR of cases 1 and 2: the messages can be heard correctly.
Also tested that user guide opens at the correct anchor when the doc is compiled in General setting panel language list.

Known issues with pull request:

None

Change log entry:

None: context help is not yet released.

Cc @feerrenrut; @ThomasStivers

@feerrenrut

Copy link
Copy Markdown
Contributor

I'm happy for you to change that message, though it's not obvious to me what a good message is. There are several reasons why this might be missing:

  • The control doesn't have a specific help Id assigned (but it does exist in the help document)
    • In this case we want to encourage the user to go look in the help file.
  • The user guide does not contain help for this specific control, still there might be more general help that answers their question.

@CyrilleB79

Copy link
Copy Markdown
Contributor Author

Comment PR :

I'm happy for you to change that message, though it's not obvious to me what a good message is.

I will change it more generically. We can change or remove it later if you want.

There are several reasons why this might be missing:

* The control doesn't have a specific help Id assigned (but it does exist in the help document)
  * In this case we want to encourage the user to go look in the help file.

Instead of reporting the message, we can open the user guide without going to a specific anchor. But this does not seemd the intention of the developer of this part of the code (was it you or @ThomasStivers?)
The drawback with this solution is that a setting panel or dialog created by an add-on will trigger the opening of NVDA User Guide if F1 is pressed.

* The user guide does not contain help for this specific control, still there might be more general help that answers their question.

In this second case, for setting panel at least, the general section of the panel will be opened in the user guide, since the event is not skipped but passes to the container.

I am also preparing another branch with corrections on help id association. I have originally thought that it would be more clear in 2 separate branches/PRs. However, I may include all the work in this same PR.
Let me know what you prefer.

@OzancanKaratas

Copy link
Copy Markdown
Collaborator

Hello @CyrilleB79,

The Vision category doesn't call anything, instead it goes to the end of the user guide. Can you fix it? I don't want to accumulate issues for this.

@feerrenrut

Copy link
Copy Markdown
Contributor

Instead of reporting the message, we can open the user guide without going to a specific anchor.

I think it's best to report a message and not open the user guide.

I am also preparing another branch with corrections on help id association. I have originally thought that it would be more clear in 2 separate branches/PRs. However, I may include all the work in this same PR.
Let me know what you prefer.

Please open a second PR for this.

@CyrilleB79

Copy link
Copy Markdown
Contributor Author

@feerrenrut: I have modified the message and will not open the browser in this case.
The PR is ready for review.

I will open a new PR containing the various fixes associating controls to paragraphs in the help doc. @OzancanKaratas, the issue of the vision panel will be fixed in this new PR.

@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.

Thanks @CyrilleB79

@feerrenrut feerrenrut merged commit 1c2598e into nvaccess:master Oct 5, 2020
@nvaccessAuto nvaccessAuto added this to the 2020.4 milestone Oct 5, 2020
@CyrilleB79 CyrilleB79 deleted the contextHelpFromSource branch October 14, 2020 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Context Sensitive Help in NVDA Dialogs

4 participants