mirror of
https://github.com/hyb-oyqq/FRAISEMOE-Addons-Installer-NEXT.git
synced 2025-12-19 05:20:28 +00:00
feat(core): 更新窗口状态管理,统一使用window_manager
- 在多个模块中,将安装按钮状态管理从ui_manager迁移至window_manager,确保窗口状态的一致性和可维护性。 - 优化了ExtractionHandler、CloudflareOptimizer、DownloadManager、OfflineModeManager、PatchDetector等类中的状态更新逻辑,提升了代码的可读性和一致性。
This commit is contained in:
@@ -268,7 +268,8 @@ class PatchDetector:
|
||||
QMessageBox.critical(self.main_window, f"文件校验失败 - {APP_NAME}", message)
|
||||
|
||||
self.main_window.setEnabled(True)
|
||||
self.main_window.ui_manager.set_install_button_state("ready")
|
||||
if hasattr(self.main_window, 'window_manager'):
|
||||
self.main_window.window_manager.change_window_state(self.main_window.window_manager.STATE_READY)
|
||||
QTimer.singleShot(100, self.main_window.show_result)
|
||||
|
||||
def on_offline_pre_hash_finished(self, updated_status, game_dirs):
|
||||
@@ -333,7 +334,8 @@ class PatchDetector:
|
||||
"\n未检测到任何需要安装补丁的游戏。\n\n请确保游戏文件夹位于选择的目录中。\n",
|
||||
)
|
||||
|
||||
self.main_window.ui_manager.set_install_button_state("ready")
|
||||
if hasattr(self.main_window, 'window_manager'):
|
||||
self.main_window.window_manager.change_window_state(self.main_window.window_manager.STATE_READY)
|
||||
return
|
||||
|
||||
from PySide6 import QtWidgets
|
||||
@@ -367,7 +369,8 @@ class PatchDetector:
|
||||
|
||||
result = dialog.exec()
|
||||
if result != QtWidgets.QDialog.DialogCode.Accepted or not list_widget.selectedItems():
|
||||
self.main_window.ui_manager.set_install_button_state("ready")
|
||||
if hasattr(self.main_window, 'window_manager'):
|
||||
self.main_window.window_manager.change_window_state(self.main_window.window_manager.STATE_READY)
|
||||
return
|
||||
|
||||
selected_games = [item.text() for item in list_widget.selectedItems()]
|
||||
|
||||
Reference in New Issue
Block a user