feat(core): 集成补丁检测器以增强补丁管理功能

- 在主窗口中添加补丁检测器,支持补丁的检测和验证。
- 更新补丁管理器以使用补丁检测器进行补丁安装状态检查。
- 优化下载管理器和离线模式管理器,整合补丁检测逻辑,提升用户体验。
- 添加进度窗口以显示下载状态,增强用户反馈。
- 重构相关逻辑以支持新功能,确保代码可维护性和可读性。
This commit is contained in:
hyb-oyqq
2025-08-07 15:24:22 +08:00
parent d12739baab
commit bf80c19fe1
10 changed files with 874 additions and 554 deletions

View File

@@ -567,14 +567,17 @@ class HostsManager:
self.auto_restore_disabled = auto_restore_disabled
return auto_restore_disabled
def check_and_clean_all_entries(self):
def check_and_clean_all_entries(self, force_clean=False):
"""检查并清理所有由本应用程序添加的hosts记录
Args:
force_clean: 是否强制清理,即使禁用了自动还原
Returns:
bool: 清理是否成功
"""
# 如果禁用了自动还原,则不执行清理操作
if self.is_auto_restore_disabled():
# 如果禁用了自动还原,且不是强制清理,则不执行清理操作
if self.is_auto_restore_disabled() and not force_clean:
logger.info("已禁用自动还原hosts跳过清理操作")
return True