feat(core): 增强卸载处理程序的UI反馈和异常日志记录

- 在卸载处理程序中使用UI管理器显示和隐藏加载对话框,提升用户体验。
- 增加异常钩子,确保未捕获的异常能够记录到日志文件中,增强系统的稳定性和可追溯性。
This commit is contained in:
hyb-oyqq
2025-08-11 17:54:14 +08:00
parent 68bbafc564
commit 7d71ffe099
3 changed files with 73 additions and 3 deletions

View File

@@ -75,7 +75,11 @@ class UninstallHandler(QObject):
if debug_mode:
logger.debug(f"DEBUG: 卸载功能 - 用户选择了目录: {selected_folder}")
self.main_window.show_loading_dialog("正在识别游戏目录...")
# 使用UI管理器显示加载对话框
if hasattr(self.main_window, 'ui_manager'):
self.main_window.ui_manager.show_loading_dialog("正在识别游戏目录...")
else:
logger.warning("无法访问UI管理器无法显示加载对话框")
self.uninstall_thread = UninstallThread(self, selected_folder)
self.uninstall_thread.finished.connect(self.on_game_detection_finished)
@@ -83,7 +87,11 @@ class UninstallHandler(QObject):
def on_game_detection_finished(self, game_dirs):
"""游戏识别完成后的回调"""
self.main_window.hide_loading_dialog()
# 使用UI管理器隐藏加载对话框
if hasattr(self.main_window, 'ui_manager'):
self.main_window.ui_manager.hide_loading_dialog()
else:
logger.warning("无法访问UI管理器无法隐藏加载对话框")
if not game_dirs:
QMessageBox.information(