nvda
Message Dialog API take 2
#17582
Merged

Message Dialog API take 2 #17582

SaschaCowley merged 221 commits into master from messageDialogApi
SaschaCowley
SaschaCowley Working refactored message dialog based on extant message dialog and …
dfdd299a
SaschaCowley Improve positioning
38c99cb2
SaschaCowley Explicitly focus default item
07ba293b
SaschaCowley Improved types and type hints
a479a4f0
SaschaCowley Switched to setLabelText to avoid mnemonic issue
3326a983
SaschaCowley Switched to icon bundles
1a8f82f1
SaschaCowley Renamed private methods to be dunder
99dd6051
SaschaCowley Some manual test cases
2a3df490
SaschaCowley Added check for default item before focusing
947f669a
SaschaCowley Minor changes to make temp code work better
6bd8c8a0
SaschaCowley Implementation of addButton, addOkButton and addCancelButton
2e255cba
SaschaCowley Return self for chaining, and add a option to set as default
ce826f25
SaschaCowley Added close functionality
9a7dbf87
SaschaCowley Fixed layout issues and updated test case
768e0520
SaschaCowley Added post popup call
7e6754f0
SaschaCowley Added infrastructure for updates to API not yet implemented
601a193f
SaschaCowley Merge branch 'master' into messageDialogApi
64801d96
SaschaCowley Swiutch to using partials for callback calling
a44063d6
SaschaCowley Added translator comments and some docstrings
3e5b03c1
SaschaCowley Added type checking to `__call_callback`
e7e1d29f
SaschaCowley Made `addButton` a `singledispatchmethod` that will add a `MessageDia…
08360fd6
SaschaCowley Refactored `addOkButton` and `addCancelButton` to be `partialmethod`s…
917d8e46
SaschaCowley Added multi button add method
273d771d
SaschaCowley Documentation improvements
8f1bcba0
SaschaCowley Added deque to track open MessageDialog instances
5e9d4c5e
SaschaCowley Refactored to use a registry oif callbacks
f8cde120
SaschaCowley Added adders for oother default button types
ac2be855
SaschaCowley Added custom button IDs
bcc49f91
SaschaCowley Various code clean-ups
1a95e060
SaschaCowley Partially working modal dialogs
5ec943eb
SaschaCowley Better handling of modal dialogs (still not woroking properly as bloc…
dbca1440
SaschaCowley Fixed problem with blocking instances exist
c0d0f35e
SaschaCowley WIP better performance tracing and layout encapsulation
2140a454
SaschaCowley Reorganised MessageDialog code
0beba174
SaschaCowley Fixed return codes not working
648ad0a4
SaschaCowley Explicitly hide dialog when closing
2f82b4b3
SaschaCowley Added escape code enum to support ID_NONE and ID_ANY
30535148
SaschaCowley Changed MessageDialogButton.default to MessageDialogButton.default_fo…
b0b24492
SaschaCowley Corrected variable names
898c24e4
SaschaCowley Removed staticmethods to classmethods
92bc0ffd
SaschaCowley Made isBlocking a property
0a66a760
SaschaCowley Improved type annotations
1ee10c39
SaschaCowley Documentation improvements
c302f728
SaschaCowley Made Show and ShowModal work in line with wx.Dialog expectations
0010195d
SaschaCowley Added help id argument
23172ad0
SaschaCowley Added exception for trying to show a MessageDialog without buttons
bbe7c332
SaschaCowley Renamed DefaultMessageDialogButtons to DefaultMessageDialogButton
81ba8cbe
SaschaCowley Added an enumeration of common button combinations, and a buttons par…
a79d98d2
SaschaCowley Used MessageDialog for about dialog
58edca29
SaschaCowley Added deprecation warning to gui.message.messageBox
c9c4eff3
SaschaCowley Re-enabled system test "Quits from keyboard with about dialog open"
e740ac7f
SaschaCowley Updated block action to bring blocking dialogs to foreground
335f58f5
SaschaCowley Default action forces close
db03d56a
SaschaCowley Added a docstring
6766cf50
SaschaCowley Added a draft class-level docstring
d0ff5cf5
SaschaCowley Respect CloseEvent.CanVeto
cb247abf
SaschaCowley Initial message dialog unit tests
0f4a4f51
SaschaCowley Refactored to use a common base class
1d02fffc
SaschaCowley Removed default button assignment (reimplement later)
7987c300
SaschaCowley Tests for adding standard buttons
eca4e670
SaschaCowley Added support for adding DefaultMessageDialogButtons with MessageDial…
9fdd6039
SaschaCowley Added methods to easily add default buttons and unit tests for same
b5a928cc
SaschaCowley Add hasDefaultAction property
214e62b7
SaschaCowley Add docstrings
8c11e0b1
SaschaCowley Improved implementation of default action getters
2e836aea
SaschaCowley Slightly refactored tests and improved docstrings for some tests
561e9d09
SaschaCowley Slight refacter to closing logic
86fc6748
SaschaCowley Re-implemented get default action and tests for same
725ef748
SaschaCowley Made _getDefaultActionOrFallback comply with the return type opf _get…
48ec32b6
SaschaCowley Added additional setters and tests
4114a0a5
SaschaCowley Call default callback when closing programatically
b4ff1e1a
SaschaCowley Added docstrings to tests
a1faa51f
SaschaCowley Made fallback default action more robust
d7518048
SaschaCowley Renamed several double-underscored variables and methods to be single…
abb5a6db
SaschaCowley Added tests and docstrings
90117c31
SaschaCowley Added lots of docstrings.
734703f4
SaschaCowley Made a bunch of class names more usable
a4b708a7
SaschaCowley Fixed some type info
540b1bcd
SaschaCowley Added tests for _flatten_buttons
ed30a0c9
SaschaCowley Made the Show method comply with that of wx.Dialog
7577e915
SaschaCowley Documentation improvements
e7b5f602
SaschaCowley Restored behaviour of having an OK button as default
e0917b8b
SaschaCowley Fixed label not being applied to buttons.
e422e266
SaschaCowley Made id and button positional-only
403fed68
SaschaCowley Rename several button properties to bring them into line with NVDA co…
dc7b4597
SaschaCowley Parameterized tests for the default button adders to make code more DRY
bd63423c
SaschaCowley Test that buttons are unique when adding
3efdb806
SaschaCowley Changed addButtons to accept an Collection of Buttons, rather than an…
67d59705
SaschaCowley Remove _flattenButtons
14016401
SaschaCowley Fixed some types
3c59af3b
SaschaCowley Tightened some logic and made the close box enabled only when there i…
b095d2e0
SaschaCowley Fixed test dialog
904befd8
SaschaCowley Formatted
59ea918a
SaschaCowley Reimplemented gui.message.messageBox using MessageDialog
49c6a2da
SaschaCowley Re-implemented the message box shim
d567f1f7
SaschaCowley Refactored and documented.
fca7eb82
SaschaCowley Added a helper function for calling wx functions on the main thread a…
0bcb7dc6
SaschaCowley Used new wxCallOnMain function foor message box shim
51748264
SaschaCowley Tidied up message box shim
c24b49e4
SaschaCowley Added new function to changes
209b6537
SaschaCowley Only allow instantiating message dialogs from the GUI thread
b0e686dd
SaschaCowley Fixed implementation of isBlocking and FocusBlockingInstances
9757bb2c
SaschaCowley Added helper methods for alert, confirm and query dialogs
2c164308
SaschaCowley Added some methods to be implemented
594c943a
SaschaCowley Added more main thread checks
9072f3aa
SaschaCowley Started implementation of message.MessageDialog -> messageDialog.Mess…
f3331c36
SaschaCowley Fixed duplicate superclass of gui.nvdaControls._ContinueCancelDialog
e266bc97
SaschaCowley Refactored show checks into their own private method
5655da1c
SaschaCowley Old message dialog shimmed to new one and working with screen curtain…
27352c3c
SaschaCowley Refactor checks to make them easier to override in subclasses.
e65e74bf
SaschaCowley Shim for gui.nvdaControls.MessageDialog seems to work fine.
e72cf5d3
SaschaCowley Add sentinel value to allow discrimination of `None` and "not provided".
5cb75b94
SaschaCowley Allow overriding the implicit return code of the action ID by providi…
6cabca8b
SaschaCowley Update shims of gui.nvdaControls.MessageDialog and gui.nvdaControls._…
d99f5a40
SaschaCowley Update changelog
c4dc3f94
SaschaCowley Added means of changing button labels.
1278d16f
SaschaCowley Added the ability to set the message text independent of the __init__
c55c6e16
SaschaCowley Improve logic of alert, confirm and ask classmethods.
cc5274a1
SaschaCowley Slight reorganisation in some methods.
17fd510e
SaschaCowley Code documentation improvements.
3e9850a1
SaschaCowley Docstring for MessageDialog._commands
9d804590
SaschaCowley Improved logic for whether dialogs are blocking
ff61f9d9
SaschaCowley Added callback field to gui.blockAction._Context, and refactored the …
86c472a3
SaschaCowley Code style and documentation for gui.guiHelper.wxCallOnMain.
01284dea
SaschaCowley Code clean up and documentation improvements to gui.message.messageBox.
1f0cfba8
SaschaCowley Documentation improvements to gui.nvdaControls.MessageDialog
e9942ce3
SaschaCowley Removed old gui.nvdaControls.MessageDialog code.
129fcead
SaschaCowley Added commit references to changes
fc9e35b7
SaschaCowley Fixed type hints for MethodCall
d2eef13a
SaschaCowley Changed getDialogState to return a dictionary of button IDs and their…
b55c0e5c
SaschaCowley Fixed return from getDialogState
90655247
SaschaCowley Added tests for setting button labels.
0782453f
SaschaCowley Parameterised tests of setIcon and playSound to cover all dialog types.
c5f55b33
SaschaCowley Fixed test name
b947d208
SaschaCowley Added test for adding buttons with custom overrides.
acd12402
SaschaCowley Removed use of deprecated log.warn
adc2d238
SaschaCowley Added test for adding buttons with non-unique IDs
2cfa0f8b
SaschaCowley Fixed use of FindWindowById to FindWindow(id)
8816470c
SaschaCowley Added tests for setting default focus.
371848ac
SaschaCowley Removed unnecessary error case from _getFallbackAction
7a28c4bb
SaschaCowley Fixed logic for when the default focus is not in command registry
1d033db1
SaschaCowley Added further fallback action tests
a4a4e7c8
SaschaCowley Added more tests for setting button labels
acad2ffe
SaschaCowley Refactored MdTestBase into WxTestBase -> MdTestBase
b5a38950
SaschaCowley Added tests for threading
614e6495
SaschaCowley Fixed test case name
b1a34578
SaschaCowley Added unittests for showing and hiding
020a78b5
SaschaCowley Improved modal show tests.
7559b3fe
SaschaCowley Added tests for showEvent
428a6ed7
SaschaCowley Fixed implementation of _getFallbackAction, _getFallbackActionOrFallb…
f4ed2d12
SaschaCowley Added tests for blocking dialogs.
30b8c64b
SaschaCowley Fixed issue when force-closing non-modal dialog
6f2d760f
SaschaCowley Renamed _execute_command to _executeCommand
e5054ab4
SaschaCowley Added tests for _onCloseEvent
ca5e0ad2
SaschaCowley Added test for closeInstances
d8073b4b
SaschaCowley Added tests for isBlocking
32308601
SaschaCowley Renamed hasDefaultAction to hasFallback to match rename of defaultAct…
05c7540a
SaschaCowley Added tests for executeCommand
8b22b047
SaschaCowley Added guidance on dialog types
c419a589
SaschaCowley Renamed setDefaultAction to setFallbackAction
c26dfb53
SaschaCowley Doocstring improvements
3b3be1b8
SaschaCowley Renamed EscapeCode members to be more self documenting
679b2a74
SaschaCowley Renamed _realize_layout to _realizeLayout in line with NV Access style
57ca1542
SaschaCowley Added a bunch of missing docstrings
d00e5ea8
SaschaCowley Removed some commented out code
b38630a4
SaschaCowley Initial docs
aa207b5d
SaschaCowley Added docstring to __init__
ec434463
SaschaCowley Added documentation of convenience methods to dev docs
6b5e084c
SaschaCowley Moved DialogType to gui.message
ead1ec56
SaschaCowley Moved EscapeCode to gui.message
0cf5f156
SaschaCowley Moved DialogType to gui.message
4f86bfda
SaschaCowley Moved over the rest of gui.messageDialog to gui.message
6bb8a4c6
SaschaCowley Updated copyright years
9ebe8cc4
SaschaCowley Improvements to tests
8df35533
SaschaCowley Renamed tests to be more in line with NVDA style
e9b95d0b
SaschaCowley Removed testing items from NVDA menu.
a8505855
SaschaCowley Updated dev docs with information on importing
a4b82e62
SaschaCowley Updated changes
2ce68392
SaschaCowley Deleted old messageDialog.py file
18f8fc9d
SaschaCowley Merge branch 'master' into messageDialogApi
23a6114b
pre-commit-ci[bot] Pre-commit auto-fix
be3f2239
SaschaCowley Made delay before block message a constant
1bb02f7f
SaschaCowley Fixed misspelling
81be5238
SaschaCowley Added explicit import to first example in developer guide for clarity
581dc332
SaschaCowley Made thread safety warning more prominant
3dc12063
SaschaCowley Added note on custom button IDs
e256e4f6
SaschaCowley Fixed outdated docstring
7db3eb19
SaschaCowley Added error checking to _onCloseEvent
c29ecf6e
SaschaCowley Renamed event handlers to be more consistant
20f0e59d
SaschaCowley Update requirements.txt
6c68ce66
SaschaCowley Update source/gui/blockAction.py
c296eb9c
SaschaCowley Rewrote wxCallOnMain to use nonlocal rather than helper class
39fbd5b3
SaschaCowley Update source/gui/guiHelper.py
c5d775e2
SaschaCowley Update source/gui/guiHelper.py
a59912a0
SaschaCowley Update user_docs/en/changes.md
85cbef9c
SaschaCowley Made dialog destruction and deletion more robust
21614a99
SaschaCowley Fixed incorrect call to warn
8ae47bc6
SaschaCowley Made runScriptModal safer, and marked it for removal
81cc995f
SaschaCowley Merge branch 'i13007' of https://github.com/nvaccess/nvda into messag…
448630bf
SaschaCowley Added type hints to _onActivateEvent and _onShowEvent for the screen …
41c01f5f
SaschaCowley Apply suggestions from code review
8990d9c7
SaschaCowley Changed some methods to use lower camel case
08bbbd16
SaschaCowley Improved logging
db53c838
SaschaCowley Apply suggestions from code review
ca09d428
SaschaCowley Removed footnotes from the developer guide
da2fe290
SaschaCowley Removed __del__ that was failing
451f3705
SaschaCowley Corrects to dev guide
fcafc8a7
SaschaCowley Corrections to dev guide
0c7a6c7d
SaschaCowley Merge branch 'i13007' of https://github.com/nvaccess/nvda into messag…
65ced3cd
SaschaCowley Apply suggestions from code review
8b02b720
SaschaCowley Made several parameterized argument lists namedtuples for readability
0dce0e97
SaschaCowley Merge branch 'master' into messageDialogApi
0c991518
SaschaCowley Fixed up admonissions
f52a07e8
SaschaCowley Added notes on thread safety
f4377238
SaschaCowley Restore MessageDialog inheriting from ContextHelpMixin
ba888840
SaschaCowley Merge branch 'master' into messageDialogApi2
374dc7ea
SaschaCowley Slightly refactor `UpdateAskInstallDialog` not to take any action on …
3893564f
SaschaCowley Documentation
28931c28
SaschaCowley Updated other instances to use new call style
20a56dbd
SaschaCowley Update changes
ae893e4f
SaschaCowley SaschaCowley marked this pull request as ready for review 1 year ago
SaschaCowley SaschaCowley requested a review 1 year ago
SaschaCowley SaschaCowley requested a review from seanbudd seanbudd 1 year ago
seanbudd
seanbudd approved these changes on 2025-01-06
SaschaCowley
SaschaCowley commented on 2025-01-06
SaschaCowley Update source/updateCheck.py
0a258056
SaschaCowley SaschaCowley added conceptApproved
SaschaCowley SaschaCowley merged bd45d8e0 into master 1 year ago
SaschaCowley SaschaCowley deleted the messageDialogApi branch 1 year ago
github-actions github-actions added this to the 2025.1 milestone 1 year ago
seanbudd

Login to write a write a comment.

Login via GitHub

Reviewers
Assignees
No one assigned
Labels
Milestone