feat(core): 优化主窗口和UI管理功能

- 移除不再使用的UI组件,简化主窗口代码结构。
- 更新按钮状态管理,统一通过UIManager控制安装按钮状态,提升代码可读性。
- 优化解压和下载管理逻辑,确保在操作过程中提供清晰的用户反馈。
- 增强日志记录,确保在关键操作中提供详细的调试信息,便于后续排查和用户反馈。
This commit is contained in:
hyb-oyqq
2025-08-12 17:11:09 +08:00
parent 2c91319d5f
commit 4f2217ca95
10 changed files with 159 additions and 128 deletions

View File

@@ -268,7 +268,7 @@ class PatchDetector:
QMessageBox.critical(self.main_window, f"文件校验失败 - {APP_NAME}", message)
self.main_window.setEnabled(True)
self.main_window.ui.start_install_text.setText("开始安装")
self.main_window.ui_manager.set_install_button_state("ready")
QTimer.singleShot(100, self.main_window.show_result)
def on_offline_pre_hash_finished(self, updated_status, game_dirs):
@@ -333,7 +333,7 @@ class PatchDetector:
"\n未检测到任何需要安装补丁的游戏。\n\n请确保游戏文件夹位于选择的目录中。\n",
)
self.main_window.ui.start_install_text.setText("开始安装")
self.main_window.ui_manager.set_install_button_state("ready")
return
from PySide6 import QtWidgets
@@ -367,7 +367,7 @@ class PatchDetector:
result = dialog.exec()
if result != QtWidgets.QDialog.DialogCode.Accepted or not list_widget.selectedItems():
self.main_window.ui.start_install_text.setText("开始安装")
self.main_window.ui_manager.set_install_button_state("ready")
return
selected_games = [item.text() for item in list_widget.selectedItems()]