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

gui.messageBox does not allow button renaming #12344

Open
XLTechie opened this issue Apr 27, 2021 · 2 comments · Fixed by #17304
Open

gui.messageBox does not allow button renaming #12344

XLTechie opened this issue Apr 27, 2021 · 2 comments · Fixed by #17304

Comments

@XLTechie
Copy link
Collaborator

XLTechie commented Apr 27, 2021

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, the docstring for gui.messageBox states:

This should be used for all message dialogs rather than using C{wx.MessageDialog} and C{wx.MessageBox} directly.

Describe the solution you'd like

  1. I would like there to be an explanation in the docstring, to say why this requirement exists, rather than the next developer facing this having to hunt the reasoning down through code analysis and git blame.
  2. I would like gui.messageBox to accept keyword arguments allowing the restyling of buttons via wx.Set[BUTTON]Label calls.
  3. Obviously, this would necessitate a change from wx.MessageBox, to wx.MessageDialog internally. I don't know if doing that would present any complications (I don't know of any, but I am no wx expert).

Describe alternatives you've considered

See #12353 for a potentially more acceptable alternative.

Additional context

This appears to have been introduced by @jcsteh in 3ebc8fd, as a means of preventing message dialogs and settings dialogs from stepping on each other and causing strange behavior (freezes), by being open at the same time.

Therefore I'm not suggesting relaxing the requirement to use gui.messageBox. I merely ask that we be able to expand its capabilities a bit.

@XLTechie
Copy link
Collaborator Author

For what it's worth, I have made the change to wx.MessageDialog inside of gui.messageBox, and have added keyword arguments for the various Set*Label(s) calls, in a test build.
I have yet to notice any ill effects after several hours of use, but I will keep running it to see if anything unusual happens.

@XLTechie XLTechie reopened this Apr 29, 2021
@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 CyrilleB79 removed this from the 2025.1 milestone Dec 20, 2024
@CyrilleB79
Copy link
Collaborator

Reopening as #17304 has been reverted in #17561.

@CyrilleB79 CyrilleB79 reopened this Dec 20, 2024
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