Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Remember last selected connection mode
  • Loading branch information
SaschaCowley committed Aug 1, 2025
commit 8c5c44a193a696e09f7778aefc2ed5ecc248896c
5 changes: 4 additions & 1 deletion source/_remoteClient/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def __init__(self, parent: wx.Window, id: int, title: str, hostnames: list[str]
wx.Choice,
choices=tuple(mode.displayString for mode in RemoteConnectionMode),
)
self._connectionModeControl.SetSelection(0)
self._connectionModeControl.SetSelection(configuration.getRemoteConfig()["ui"]["lastConnectionMode"])
self._clientOrServerControl = contentsSizerHelper.addLabeledControl(
# Translators: Label of the control allowing users to select whether to use a pre-existing Remote Access server, or to run their own.
pgettext("remote", "&Server:"),
Expand Down Expand Up @@ -387,6 +387,9 @@ def _onOk(self, evt: wx.CommandEvent) -> None:
if focusTarget is not None:
focusTarget.SetFocus()
else:
configuration.getRemoteConfig()["ui"]["lastConnectionMode"] = (
self._connectionModeControl.GetSelection()
)
evt.Skip()

def _getKey(self) -> str:
Expand Down
2 changes: 2 additions & 0 deletions source/config/configSpec.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,8 @@
__many__ = string(default="")
[[ui]]
confirmDisconnectAsFollower = boolean(default=True)
# 0: follower, 1: leader
Comment thread
SaschaCowley marked this conversation as resolved.
Outdated
lastConnectionMode = integer(default=0, min=0, max=1)
Comment thread
SaschaCowley marked this conversation as resolved.
Outdated
Comment thread
SaschaCowley marked this conversation as resolved.
Outdated
"""

#: The configuration specification
Expand Down