NETworkManager
NETworkManager copied to clipboard
Feature: DNS Lookup - Input server
Changes proposed in this pull request
- Add input to dns server combobox
Related issue(s)
- Fixes #3260
Copilot generated summary
Provide a Copilot generated summary of the changes in this pull request.
Copilot summary
This pull request refactors the DNS server selection logic in the DNS Lookup feature, improving usability and code maintainability. The main changes include replacing the custom value converter with a more direct approach to displaying DNS server names, supporting editable ComboBox input for custom DNS server entries, and updating model and viewmodel logic for clearer separation of concerns and easier custom profile handling.
UI and Usability Improvements
- The DNS server ComboBox in
DNSLookupView.xamlis now editable, allowing users to enter custom DNS server IPs directly. The selection logic was updated to bind to a newSelectedListProfileproperty and support custom input viaDNSServerQuickInput, removing the need for a value converter. [1] [2]
ViewModel and Data Handling
- The
DNSLookupViewModelnow distinguishes between selected list profiles and direct text input. When a user types an IP address, a custom profile is created and used for DNS queries. TheDNSServerproperty is now private set, and a newSelectedListProfileproperty manages selection from the ComboBox. [1] [2] - Initialization logic in the viewmodel ensures the selected DNS server and input field are synchronized with settings and user selection, and custom profiles are handled gracefully.
Model and Data Structure Updates
- The
DNSServerConnectionInfoProfileconstructor now sets a default name for the Windows DNS profile, and theServersproperty uses collection initializers for brevity and clarity. [1] [2] [3] - The default selected DNS server in settings and viewmodels is now initialized to
nullinstead of a new profile instance, preventing unintended default selections and improving state management. [1] [2]
Codebase Simplification
- The obsolete
DNSServerConnectionInfoProfileToStringvalue converter was removed as its functionality is now handled by the model'sToString()override and direct binding.
References:
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10]
To-Do
- [ ] Migrate DNS Server dialog
- [ ] Add validation to input (
ip:port; ip:port) - [ ] Select first dns server in settings (on startup)
- [ ] Review the PoC code again...
- [ ] Update documentation to reflect this changes
- [ ] Update changelog to reflect this changes
Contributing
By submitting this pull request, I confirm the following:
- [x] I have read and understood the contributing guidelines and the code of conduct.
- [x] I have have added my name, username or email to the contributors list or don't want to.
- [x] The code or resource is compatible with the GNU General Public License v3.0.