Add a payload argument to message dialog callbacks#17660
Merged
Conversation
See test results for failed build of commit 3ab8b6cd96 |
seanbudd
approved these changes
Jan 29, 2025
Co-authored-by: Sean Budd <sean@nvaccess.org>
LeonarddeR
pushed a commit
to LeonarddeR/nvda
that referenced
this pull request
Feb 4, 2025
Fixes nvaccess#17658 Summary of the issue: There is currently no way to pass information between message dialogs and their callbacks. This reduces the functionality available to callbacks in future. Description of user facing changes None. Description of development approach Add a `Payload` dataclass to `gui.message`. It currently has no fields, though these can be added without breaking the API in future, for example to implement nvaccess#17646 . In `MessageDialog._executeCommand`, if a command has a callback, instantiate a `Payload` and pass it to the callback when calling it. Update the few uses of the message dialog API in NVDA which use callbacks: * `synthDrivers.sapi4._sapi4DeprecationWarning` Updated the developer guide to note the new requirements for callback functions. Testing strategy: Ran NVDA from source, and triggered the affected dialogs. Ensured they worked as expected. Ran from source, with `versionInfo.updateVersionType` set to `"snapshot:alpha`, and checked that updating worked. Built and installed this branch, then ran the CRFT, cancelling and continuing, and ensured that no issues occured. Known issues with pull request: None known.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to issue number:
Fixes #17658
Summary of the issue:
There is currently no way to pass information between message dialogs and their callbacks. This reduces the functionality available to callbacks in future.
Description of user facing changes
None.
Description of development approach
Add a
Payloaddataclass togui.message. It currently has no fields, though these can be added without breaking the API in future, for example to implement #17646 .In
MessageDialog._executeCommand, if a command has a callback, instantiate aPayloadand pass it to the callback when calling it.Update the few uses of the message dialog API in NVDA which use callbacks:
synthDrivers.sapi4._sapi4DeprecationWarningUpdated the developer guide to note the new requirements for callback functions.
Testing strategy:
Ran NVDA from source, and triggered the affected dialogs. Ensured they worked as expected.
Ran from source, with
versionInfo.updateVersionTypeset to"snapshot:alpha, and checked that updating worked.Built and installed this branch, then ran the CRFT, cancelling and continuing, and ensured that no issues occured.
Known issues with pull request:
None known.
Code Review Checklist:
@coderabbitai summary