New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't handle profile switching when no profile is activated #8611
Conversation
What happens when you manually activated a profile, then open the configuration profile window again and press ok? Will it call _handleProfileSwitch in that case? A proper solution would be not to call _handleProfileSwitch when the chosen profile is equal to the earlier activated profile. I don't think that this is the case in your code now, right? |
leonardder commented?
If the profile is not None, it is deactivated. If it's None, that is, if I active normal configuration, the profile is not activated again, that is, nothing occurs, but NVDA executes ConfigManager._handleProfileSwitch.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've actually looked at the code now, and it seems that there is an underlying issue that causes this.
In gui/configProfiles, there are two relevant buttons, the manual activate button (self.changeStateButton) and the close button. self.changeStateButton is set as the default button, and self.AffirmativeId is set to the ID of the self.changeStateButton. This means that, even though normal configuration can be the activated profile and self.changeStateButton is disabled, enter will still trigger this button. This is obviously not what should happen.
@josephsl. You know much more about wx than I do, so you might be able to explain what is the difference between setting a particular button as a default button and setting the afirmative id of a dialog. In any case, I'd prefer having this fixed in the gui as well. Your current change makes perfect sense though, so feel free to keep that.
Thanks. |
Comparing the profiles dialog with a similar one of an add-on, I've noticed that when a profile can't be activated, profile name is not shown in the error dialog. Anyway, I think my previous question is stil valid.
|
@nvdaes commented on 9 aug. 2018 08:36 CEST:
I think I don't understand this question. You should not be able to activate a profile that is already active. For normal configuration, the change state button is disabled, and enter should no longer trigger it. |
OK, if the underlying issue is fixed too, and self.AffirmativeId is not longer set to the ID of the self.changeStateButton, since this is disabled for the normal configuration, this would be fixed. |
* This prevents to try normal configuration to be activated. * This avoids a warning when change state button is activated on normal configuration. * This is not fixed removing this line: self.AffirmativeId = self.changeStateButton.Id
@LeonarddeR, seems this is not fixed changing the gui, but my last commit works as expected and the warning is not shown. |
@nvdaes Is this ptyhon 3 ready yet? |
Hi, this is not ready, since when switching to normal configuration this should be handled. |
Closing this PR since there are some issues with it and it has been open a long time. In particular it looks like it will cause a bug when returning to "no profile", handleProfileSwitch will not be called. We agree the behavior described in the bug (#8610) could be improved, and would be happy to accept a PR that fixes the issue. |
Perfect.
2020-07-03 9:19 GMT+02:00, Reef Turner <notifications@github.com>:
… Closing this PR since there are some issues with it and it has been open a
long time. In particular it looks like it will cause a bug when returning to
"no profile", handleProfileSwitch will not be called. We agree the behavior
described in the bug (#8610) could be improved, and would be happy to accept
a PR that fixes the issue.
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#8611 (comment)
|
Link to issue number:
Fixes #8610
Summary of the issue:
When pressing enter on normal configuration item from the profile list of profiles dialog and no profile is active, NVDA tries to handle profile switching.
Description of how this pull request fixes the issue:
In the config.ConfigManager.manualActivateProfile(), check if a profile has been changed before calling self._handleProfileSwitch().
This is done checking if is profile, since this variable is set when the active profiles are more than 1, that is, a profile different to normal is active, or when the profile to change has a name, so this doesn't happen when no profile is active and none will be changed, which is the case related to this issue.
Testing performed:
Unit tests, run NVDA from source.
Known issues with pull request:
None.
NVDA shows a dialog warning that the profile can't be activated.
Change log entry:
Section: Bug fixes.