Skip to content
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

Add a gui.MessageDialog function, in order to gain the features of dialogs, while still protecting from calling wx.MessageDialog #12353

Closed
XLTechie opened this issue Apr 29, 2021 · 1 comment · Fixed by #17304 or #17582
Milestone

Comments

@XLTechie
Copy link
Collaborator

Alternate proposal to #12344

Is your feature request related to a problem? Please describe.

I was trying to implement some code for a proposal of a UX bug fix.
It would have been convenient to use a dialog containing "Cancel" and "Continue" buttons.

If I was to do that in an add-on, it would be straight forward:

  1. Call wx.messageDialog, with the wx.OK | wx.CANCEL flags, in a context handler.
  2. Then call .SetOKLabel("&Continue") on the context handler instance.

However, because of a freeze issue which occurs when a dialog and an NVDA settings dialog are open at the same time, gui.messageBox was created to run a locking scheme to prevent more than one dialog, and its docstring says not to use wx.MessageDialog.

Describe the solution you'd like

In #12344, I suggested modifying gui.messageBox to use wx.MessageDialog. I made a test build doing this, and changed a dialog by restyling its buttons.
Everything worked fine, and I could not cause any failures from it.

However if there is concern about making a change wholesale like that, I will suggest as an alternative:

Creating a gui.messageDialog function.
It can call wx.MessageDialog, but wrapped in the same protections that gui.messageBox uses.
It can then offer the styling, extended messages, and so on, that wx.MessageDialog offers, but only be used when developers find its use appropriate to the situation.
All calls to gui.messageBox can then continue unaffected.

Describe alternatives you've considered

See #12344

Additional context

@github-actions github-actions bot added this to the 2025.1 milestone Dec 18, 2024
michaelDCurran pushed a commit that referenced this issue Dec 20, 2024
This reverts commit 2477780.
Reverts #17304
Issues fixed
Fixes #17560
Fixes #17553
Issues reopened
Reopens #13007
Reopens #12344
Reopens #12353
Reason for revert
This PR broke two important NVDA functions, and there is insufficient time before the Christmas/New Years break to fix the issues, so we are temporarily reverting so that alphas work over the break:
• The CRFT no longer works, as gui.message.MessageDialog's inheritance from ContextHelpMixin was accidentally removed.
• Update checking no longer works, as runScriptModalDialog was modified to increment and decrement _messageBoxCounter, but UpdateAskInstallDialog attempts to restart NVDA before it has been closed, so the update fails as NVDA appears to be in an unsafe state.
@CyrilleB79
Copy link
Collaborator

Reopening as #17304 has been reverted in #17561.Reopening as #17304 has been reverted in #17561.

@CyrilleB79 CyrilleB79 reopened this Dec 20, 2024
@CyrilleB79 CyrilleB79 removed this from the 2025.1 milestone Dec 20, 2024
@github-actions github-actions bot added this to the 2025.1 milestone Jan 8, 2025
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 a pull request may close this issue.

2 participants