Repository navigation
Let users pin the server address in Server connectivity - #657
Draft
zandercattapreta wants to merge 1 commit into
Draft
zandercattapreta wants to merge 1 commit into
zandercattapreta wants to merge 1 commit into
Conversation
The address shown in the server connectivity dialog (QR code, web UI link) followed whatever interface address was first, and the selection was reset every time the dialog was shown or the theme changed. On networks where DHCP hands out a different IP the QR code kept changing. - Make the address combo box editable: an IPv4 address or a host name can be typed. - Add a pin button. A pinned address is stored in YACReaderLibrary.ini (libraryConfig/SERVER_PINNED_ADDRESS) and always used for the QR code, the web UI link and "Copy link", even if no interface currently has it, in which case a notice is shown. While pinned the field is locked. - Keep the selected address instead of resetting it each time. - Offer this computer's name (<name>.local, <name> and <name>.<dns domain>) next to the IPs, only when it resolves back to this machine. Lookups are asynchronous so a name that is not announced cannot block the dialog. - Add pin.svg, themed through the existing recoloring, and a unit test for the address helpers. Refs YACReader#384 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
Refs #384
Problem
In Server connectivity, the address used for the QR code, the web UI link and "Copy link" is the first interface address, and the combo box selection was reset every time the dialog was shown or the theme changed. On networks where DHCP hands out a different IP, the address clients have to use keeps changing, and there was no way to set one.
Changes
YACReaderLibrary.ini(libraryConfig/SERVER_PINNED_ADDRESS) and is always used for the QR code, the web UI link and "Copy link". While pinned the field is locked; unpin to change it. If a pinned IPv4 is not assigned to any interface right now, a notice is shown.<name>.local,<name>,<name>.<dns domain>) is offered at the end of the list, only if it resolves back to one of this machine's addresses (loopback does not count, so a127.0.1.1 hostentry in/etc/hostsis not enough). Lookups are asynchronous, so a name that is not announced cannot block the dialog.pin.svggoes through the existing theme recoloring; the pin button has its own QSS inServerConfigDialogTheme.The pure logic lives in
ip_config_helper(isValidServerHost,resolveServerAddress,localHostNameCandidates,resolvesToLocalAddress) with a newip_config_helper_test.Testing
ctest: 52/52 passing (including the new test)..local/ short name / domain candidates resolve there (mDNS needs avahi or systemd-resolved with mDNS enabled on Linux) still has to be checked on real machines. Light/dark themes were only checked on macOS.Notes
.ts) are not updated, since feature PRs here usually leave that to the periodic "Update translations" commits. New strings: "Pin this address so it never changes", "Unpin this address", "This address is not assigned to this computer on the current network."🤖 Generated with Claude Code