Skip to content

Conversation

@BornToBeRoot
Copy link
Owner

Changes proposed in this pull request

  • HostsFileEditor delete entry

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 HostsFileEditor functionality, 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:

  • Added HostsFileEntryModifyResult enum to represent operation outcomes such as success, not found, write error, and backup error. (Source/NETworkManager.Models/HostsFileEditor/HostsFileEntryModifyResult.cs)
  • Refactored EnableEntry, DisableEntry, and DeleteEntry methods to return HostsFileEntryModifyResult instead of a boolean, improving error handling and logging. (Source/NETworkManager.Models/HostsFileEditor/HostsFileEditor.cs) [1] [2] [3]
  • Implemented asynchronous methods for enabling, disabling, and deleting hosts file entries (EnableEntryAsync, DisableEntryAsync, DeleteEntryAsync). (Source/NETworkManager.Models/HostsFileEditor/HostsFileEditor.cs) [1] [2]

ViewModel Updates:

  • Introduced IsModifying property in HostsFileEditorViewModel to track modification state and prevent concurrent operations. (Source/NETworkManager/ViewModels/HostsFileEditorViewModel.cs)
  • Updated ModifyEntry_CanExecute and Refresh_CanExecute methods to account for the IsModifying state. (Source/NETworkManager/ViewModels/HostsFileEditorViewModel.cs) [1] [2]
  • Implemented DeleteEntryAction with a confirmation dialog to delete hosts file entries. (Source/NETworkManager/ViewModels/HostsFileEditorViewModel.cs)

Localization and UI Refinements:

  • Added localization support for delete entry confirmation message (DeleteHostsFileEntryMessage). (Source/NETworkManager.Localization/Resources/Strings.Designer.cs, Source/NETworkManager.Localization/Resources/Strings.resx) [1] [2]
  • Increased spacing between rows in child windows for better readability. (Source/NETworkManager/Views/ExportChildWindow.xaml, Source/NETworkManager/Views/GroupChildWindow.xaml, Source/NETworkManager/Views/ProfileChildWindow.xaml, Source/NETworkManager/Views/OKCancelInfoMessageChildWindow.xaml) [1] [2] [3] [4]
  • Removed unnecessary foreground styling from OKCancelInfoMessageChildWindow.xaml. (Source/NETworkManager/Views/OKCancelInfoMessageChildWindow.xaml)

To-Do

Contributing

By submitting this pull request, I confirm the following:

@mergify mergify bot merged commit 2383273 into main Jul 6, 2025
4 checks passed
@mergify mergify bot deleted the feature/hosts_file_editor_functions branch July 6, 2025 01:11
@BornToBeRoot BornToBeRoot added this to the next-release milestone Jul 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants