Skip to content

Persist remote connect dialog options#18601

Merged
SaschaCowley merged 11 commits intomasterfrom
rememberLastMode
Aug 8, 2025
Merged

Persist remote connect dialog options#18601
SaschaCowley merged 11 commits intomasterfrom
rememberLastMode

Conversation

@SaschaCowley
Copy link
Copy Markdown
Member

@SaschaCowley SaschaCowley commented Aug 1, 2025

Link to issue number:

Closes #18512

Summary of the issue:

Since most users use their device as either follower or leader consistently, NVDA Remote Access should remember their selection.
The same can also be said of the server type and port to use for self-hosted servers.

Description of user facing changes:

The "Connect to Another Computer" dialog persists the selection of the "Mode", "Server" and "Port" controls.

Description of developer facing changes:

NVDA now sets up wx.lib.agw.persist](https://docs.wxpython.org/wx.lib.agw.persist.html) as follows:

  • persisted GUI state is saved to "guiState.ini" in the NVDA config directory.
  • If NVDAState.shouldWriteToDisk returns False, saving is disabled.

Description of development approach:

  • Set up the PersistenceManager singleton in gui.initialize. Free it in gui.terminate out of an abundance of caution.
  • Add an (internal) list of controls that should be persisted to _remoteClient.dialogs.DirectConnectDialog.
  • Add (internal) methods to the same class to register and restore state, save state, and unregister these controls.
  • Register and restore state on init, save state on OK, and unregister on dialog destruction (used instead of window close as this is not fired on modal dialogs).

Testing strategy:

Connected to remote a number of times across a number of NVDA restarts and ensured mode was remembered.

Manually edited the guiState.ini file to contain illegal values, and ran NVDA to ensure the defaults were used in this case.

Ran NVDA with the --launcher flag and ensured that GUI state was read but not written.

Known issues with pull request:

None

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

@coderabbitai summary

Copilot AI review requested due to automatic review settings August 1, 2025 07:15
@SaschaCowley SaschaCowley requested a review from a team as a code owner August 1, 2025 07:15
@SaschaCowley SaschaCowley requested a review from seanbudd August 1, 2025 07:15

This comment was marked as outdated.

@SaschaCowley SaschaCowley marked this pull request as draft August 4, 2025 23:53
@SaschaCowley SaschaCowley added the conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review. label Aug 4, 2025
@SaschaCowley SaschaCowley changed the title Remember last used mode for manual Remote Access connections Persist remote connect dialog options Aug 6, 2025
@SaschaCowley SaschaCowley marked this pull request as ready for review August 6, 2025 06:44
@seanbudd seanbudd self-requested a review August 6, 2025 08:43
@SaschaCowley SaschaCowley enabled auto-merge (squash) August 8, 2025 05:00
@SaschaCowley SaschaCowley merged commit c8c1bd4 into master Aug 8, 2025
22 checks passed
@SaschaCowley SaschaCowley deleted the rememberLastMode branch August 8, 2025 05:30
@SaschaCowley SaschaCowley added this to the 2025.3 milestone Aug 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remember "Mode" in the Connect dialog of Remote access

3 participants