Feature: HostsFileEditor delete entry added #3094
Merged
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.
Changes proposed in this pull request
Related issue(s)
Copilot generated summary
Provide a Copilot generated summary of the changes in this pull request.
Copilot summary
This pull request introduces enhancements to the
HostsFileEditorfunctionality, refines user interface elements, and improves code maintainability. Key changes include the addition of a new enum for operation results, asynchronous methods for modifying hosts file entries, and updates to child window styling.Hosts File Editor Enhancements:
HostsFileEntryModifyResultenum to represent operation outcomes such as success, not found, write error, and backup error. (Source/NETworkManager.Models/HostsFileEditor/HostsFileEntryModifyResult.cs)EnableEntry,DisableEntry, andDeleteEntrymethods to returnHostsFileEntryModifyResultinstead of a boolean, improving error handling and logging. (Source/NETworkManager.Models/HostsFileEditor/HostsFileEditor.cs) [1] [2] [3]EnableEntryAsync,DisableEntryAsync,DeleteEntryAsync). (Source/NETworkManager.Models/HostsFileEditor/HostsFileEditor.cs) [1] [2]ViewModel Updates:
IsModifyingproperty inHostsFileEditorViewModelto track modification state and prevent concurrent operations. (Source/NETworkManager/ViewModels/HostsFileEditorViewModel.cs)ModifyEntry_CanExecuteandRefresh_CanExecutemethods to account for theIsModifyingstate. (Source/NETworkManager/ViewModels/HostsFileEditorViewModel.cs) [1] [2]DeleteEntryActionwith a confirmation dialog to delete hosts file entries. (Source/NETworkManager/ViewModels/HostsFileEditorViewModel.cs)Localization and UI Refinements:
DeleteHostsFileEntryMessage). (Source/NETworkManager.Localization/Resources/Strings.Designer.cs,Source/NETworkManager.Localization/Resources/Strings.resx) [1] [2]Source/NETworkManager/Views/ExportChildWindow.xaml,Source/NETworkManager/Views/GroupChildWindow.xaml,Source/NETworkManager/Views/ProfileChildWindow.xaml,Source/NETworkManager/Views/OKCancelInfoMessageChildWindow.xaml) [1] [2] [3] [4]OKCancelInfoMessageChildWindow.xaml. (Source/NETworkManager/Views/OKCancelInfoMessageChildWindow.xaml)To-Do
Contributing
By submitting this pull request, I confirm the following: