Tidy advanced gui panel#9239
Conversation
Attempt to use a known window ID to force a name change event to be spoken. Otherwise the warning is spoken when the dialog looses and gets focus again.
|
I think it should be a warning checkbox at the beginning of the Advanced panel that remembers its state for the lifetime of NVDA, but is not saved in the config. This is similar to Firefox. |
|
I second this idea, however, I wouldn't put the warning on the checkbox itself if possible. If I"m correct, you can do the following:
|
This … no, a checkbox alone, which value is stored in the "nvda.ini" doesn't solve this GUI issue at all, but a button called "Understood" like in Firefox when entering "about:config". All settings in this panel are unaccessible (= write protection) unless this button has pressed. Well, the checkbox for automatically pressing this button (= disables this button and makes all other settings writable) can be added in this panel too. But we should prevent the normal user for changing something in this panel without showing him the warning first. So a combination of a button and a checkbox should be the best way to solve this GUI issue. |
Takes a mapping of the prop and value to override.
This is handy when working on the NVDA GUI.
|
So after trying lots of options with little success, I think the only viable option is to use the AccPropServer to:
I am then setting the name of the panel using One remaining issue is that the alt+tabbing to the dialog results in This result is that we can have these bits of "dialog explaining text" announced. |
|
Is this considered ready for review, or are you still considering changing some things? |
|
Nevertheless, I have tested the code. Here are some thoughts you might want to consider:
|
To start with I wanted to get some feedback on whether this actually improves things, find out what issues there might be from a UX consideration. If we can agree on what is possible, and that it improves the UX then we can get it ready for an actual review.
Ah, yes. I'll take a look at that.
Good idea.
Yes, probably a good idea. Though, do you know of any disadvantages to having multiple accPropServers registered?
I was hoping to be able to remove stuff from the NVDA app module. It might not be possible yet. |
Not really, except for the fact that systems tend to break when an accPropServer isn't properly unregistered, which could possibly happen if NVDA crashes or when one of the panels refuses to load due to an error within the panel's class. While this is not likely to happen in stable versions, the breakage seems to be pretty major sometimes (#8916).
I'm pretty sure that gainFocus can be limited to do profile name changes only. I recall that I tested setting the current category's name on the container and then stopped with that because the name wasn't announced automatically when I changed categories, but that probably was because of the panel not having the role of property page. |
Simplifies the approach to speaking profile changes in NVDA settings.
Having a non space description overrides the getDialogText behaviour (in behaviours.py).
|
I've pushed a few fixes the concerns raised. I also found how to override the getDialogText behavior. This was causing the dialog to be spoken (up to first focused child). Now the dialog is speaking the current profile as the description. However, this information is also in the title. I am looking for a way to get the accessible name for the dialog to be spoken instead of the title. Another possibility, might be to change the getDialogText behavior so that when encountering a focused property page with a description the recursion stops there. |
| panel, | ||
| propertyAnnotations={ | ||
| oleacc.PROPID_ACC_ROLE: oleacc.ROLE_SYSTEM_PROPERTYPAGE, # change the role from pane to property page | ||
| oleacc.PROPID_ACC_DESCRIPTION: panel.panelDescription, # set a description |
There was a problem hiding this comment.
What I've just noticed is that the NVDAObjects.behaviors.Dialog overlay is also applied to property pages, so it looks like you can safely remove the accDescription override for panels like this and only override the accRole. I have commented out this line and it did not result in different behavior.
There was a problem hiding this comment.
Hmm, yeah, you are right. The hard question is what to do about the dialog description. Either we need a way to stop the getDialogText on these functions, or a way to override the dialog title.
There was a problem hiding this comment.
What part of the dialog description do you mean in this case?
I really like the setup where the config profile is pronounced as part of the dialog description.
How about doing something like this:
- Only have NVDA Settings in the dialog title.
- Add a statictext with "editing {profilename}". Then, add the categories list and all other controls. This will make the profile name the first child on the dialog, which will be automatically announced using getDialogText. You no longer have to override accDescription for the dialog
- When the current profile name changes, update the particular static text with the new profile name. Do something like this on the dialog:
winUser.user32.NotifyWinEvent(winUser.EVENT_OBJECT_DESCRIPTIONCHANGE, settingsDialog.Handle,winUser.OBJID_CLIENT,winUser.CHILDID_SELF)
On the appModule, the only thing you need to do is override event_descriptionChange on the dialog to speak even when the dialog isn't the focus object.
This has the advantage that the visual behavior and non visually perceived behavior match much more than before.
There was a problem hiding this comment.
The difficult part with what you are proposing is finding a way to make the profile text look right within the dialog. It's not obvious how to achieve that.
What part of the dialog description do you mean in this case?
I meant, after alt tab to the dialog. NVDA walks through to the focused control, speaking all static text until it gets there. I now realise that as long as PROPID_ACC_DESCRIPTION is set to something other than white space this will not happen.
I like the idea of using the accessible description for the dialog to announce the profile name. Next I'm going to look into why NVDA does not seem to be getting the PROPID_ACC_NAME for the dialog. Inspect.exe shows it, but its not in NVDA's dev info.
There was a problem hiding this comment.
The difficult part with what you are proposing is finding a way to make the profile text look right within the dialog. It's not obvious how to achieve that.
Isn't it possible to position it centered just below the window title?
There was a problem hiding this comment.
It's possible, I'll have to play with it to see how it looks. Because it's not editable it might look a little strange. I have been thinking it makes sense to be able to edit profiles that are not actually active, so maybe it should be a control at some stage.
|
I haven't worked out why yet, but it seems that inspect.exe will give the name that I set via the acc prop server. However NVDA dev info gives the window title. |
The windows title bar includes the profile name. This gets spoken as "NVDA Settings: (normal configuration) dialog" Instead we want this spoken as: "NVDA Settings dialog normal configuration" The other benefit of the description being set is that when the dialog receives focus, it uses the description rather than the getDialogText implemenation in behaviours.py. In the settings dialog, more is spoken by getDialogText than is necessary, because we have a property page with a description which also gets spoken. This is required, so that the explanation of the settings panels is spoken when moving from the category list to the panel.
The debugging comment is not necessary anymore. The wxInspection tool is going now part of another PR
|
What do you mean by saying
I was talking about NVDA +t. Currently to check which profile we are editing or in which category of the settings we are it is enough to check the title. bar. With the try build from this PR it is nessesary to alt+tab from and alt+tab back to the dialog. Adding to this the fact that when alt+tabbing to any of the settings dialog your position is lost I believe that it isn't an acceptable solution. |
|
Sorry, I meant NVDA+t. However, I do take your point that the category
cannot be read on demand anymore.
But, I'm not entirely sure of the use case where you would be in the
settings dialog and not know the category. either you alt+tabbed in
there and it spoke as part of the focus ancestry as focus was inside the
property page, or you had set the category from the list yourself.
I'm not convinced this problem is enough to block this change?
|
|
I don't know if it is an showstopper or not. I am merely pointing out that this change makes retrieving information about currently editing profile and the current category more difficult than it was before. |
|
Thanks for testing @lukaszgo1, and you raise a good point. Not something that had been considered yet. We would like to get this merged in, since it's holding back the release. For now we will go with the current approach. Please see #9321 which could be an approach to resolving this. |
|
I don't believe that #9321 would improve this situation. because there is no way to reread this control on demand like the title bar. |
I figured if there was an actual control, focus can be moved back to the control to read it. Obviously this is not as quick as just using |
|
I don't think that not having the active config profile and setting category dialog in the title bar is a big regression however it was nice to have and was intuitive. Introducing additional gesture to reread active profile is in my view an overkill. Is it really technically impossible to have the title bar to contain these information? If it is then simply leaving it as is seems to be the best solution. |
It's not technically impossible, but then there are other problems that would need to be solved. Right now, we are using the description of the dialog to report the configuration profile. If this is empty, then NVDA will try to describe the dialog automatically. On panels like the advanced panel or the document formatting panel, this results in the panel description being read twice. This happens because the panel has a description that matches the static text that describes the dialog, this is so the description is read when the panel gets focus. NVDA's dialog description logic reads all static text starting at the dialog title, descending down until it gets to the first active control. Adding a command to report the active profile is easy. I have a draft pull request: #9325 |
|
Actually, while testing this again I have noticed that |
|
I guess that for now, we should leave the title as is in current Alpha,
i.e. remove the title changes from this pr.
|
I'm wondering whether this behaviour of getDialogText is right. If there is a property page in the dialog that has a description retrieved by getDialogText, and that property page has a focusable (not focused) descendant, than the description of the property page shouldn't end up in the description of the dialog at all, since the user can have it read by focusing a decendant of the property page. Alternatively, there is some logic in this code that stops adding grouping descriptions to the dialog text. Overall, it is pretty complex and error prone. |
No longer stop a user from accessing settings when there is a destroyed but not deleted window. Instead raise an error. Also check for this error on when terminating the GUI.
Overriding with an empty description so that panel descriptions are not reported twice (when getDialogText runs). The panel descriptions are still reported when the panel gets focus.
Include the category name, so that it is easier to know what category one is in by using NVDA+t
|
I think for now we will be best to rely on the NVDA appmodule to override this behaviour. I believe this is ready for review. |
LeonarddeR
left a comment
There was a problem hiding this comment.
Some cosmetic comments that aren't really important and shuldn't block this.
* Make the warning bigger, and wrap the long text explaining the dialog.
* Add checkbox to enable the advanced controls
- This helps to ensure that users are aware of what they are changing.
- api.processPendingEvents is used before calling enable on the panel containing the controls, otherwise NVDA had a mismatch
with the reported and actual state of the checkbox.
* Add a restore defaults button to the advanced panel.
- This allows users who have previously changed settings, restore them to recommended settings.
* Change settings panels to use role "property page"
- Now when they get focus they are announced as "general property page"
* Speak extra info on advanced and document formatting categories.
- This is essentially a property page description. It is the static text at the start of the panel.
* Created a simplified, reusable acc prop server
- Takes a mapping of the prop and value to override.
* Fix multi-instance error for settings dialog.
- No longer stop a user from accessing settings when there is a destroyed but not deleted window. Instead
raise an error. Also check for this error on when terminating the GUI.
* Override the description property for the NVDA settings dialog
- Overriding with an empty description so that panel descriptions are not
reported twice (when getDialogText runs). The panel descriptions are still
reported when the panel gets focus.
* Make the warning bigger, and wrap the long text explaining the dialog.
* Add checkbox to enable the advanced controls
- This helps to ensure that users are aware of what they are changing.
- api.processPendingEvents is used before calling enable on the panel containing the controls, otherwise NVDA had a mismatch
with the reported and actual state of the checkbox.
* Add a restore defaults button to the advanced panel.
- This allows users who have previously changed settings, restore them to recommended settings.
* Change settings panels to use role "property page"
- Now when they get focus they are announced as "general property page"
* Speak extra info on advanced and document formatting categories.
- This is essentially a property page description. It is the static text at the start of the panel.
* Created a simplified, reusable acc prop server
- Takes a mapping of the prop and value to override.
* Fix multi-instance error for settings dialog.
- No longer stop a user from accessing settings when there is a destroyed but not deleted window. Instead
raise an error. Also check for this error on when terminating the GUI.
* Override the description property for the NVDA settings dialog
- Overriding with an empty description so that panel descriptions are not
reported twice (when getDialogText runs). The panel descriptions are still
reported when the panel gets focus.
Summary of the issue:
With the introduction of the advanced panel in the settings dialog #9200, there were a couple of UI issues, the text did not wrap properly, and the warning message was only announced when the dialog received focus (not when moving from the category list to the panel itself).
Several times during development, old settings dialog windows were not being destroyed, this meant that the settings dialog could not be opened a second time. The check for multiple instances was trying to serve two purposes:
Description of how this pull request fixes the issue:
The long text is now wrapped at the width of the panel. The "Warning!" text is larger and bold.
The warning text is announced when the panel receives focus.
A state is appended to the settings dialog instances, this keeps track of whether the dialog has been destroyed and it is removed when the dialog is deleted. We can then give the standard "user friendly" error when the settings dialog is already open, and log an error when the window is destroyed but not deleted.
Testing performed:
The settings dialog should be reported as prior versions.
The panel description should be reported when the dialog gets focus and the focused control is:
This description should only be reported once, regardless of whether the change in focus is due to alt+tab (swapping applications), ctrl+tab (swapping settings categories), or moving from the category list to the settings panel
Known issues with pull request:
Alternatives:
Change log entry:
Section: New features, Changes, Bug fixes
Changes: