feat(core): 增强工作模式菜单状态同步功能

- 在主窗口和离线模式管理器中添加工作模式菜单状态同步逻辑,确保UI状态与实际工作模式一致。
- 在UI管理器中实现同步方法,提升菜单状态更新的可靠性和兼容性。
- 优化代码结构,确保在菜单创建后立即同步状态,增强用户体验。
This commit is contained in:
hyb-oyqq
2025-08-15 14:06:22 +08:00
parent d7ceb71607
commit adcd6da5b4
3 changed files with 52 additions and 3 deletions

View File

@@ -207,6 +207,10 @@ class MainWindow(QMainWindow):
else:
self.window_manager.change_window_state(self.window_manager.STATE_ERROR)
# 确保工作模式菜单状态与实际状态同步
if hasattr(self, 'ui_manager') and hasattr(self.ui_manager, 'sync_work_mode_menu_state'):
self.ui_manager.sync_work_mode_menu_state()
def set_start_button_enabled(self, enabled, installing=False):
"""[过渡方法] 设置按钮状态将调用委托给WindowManager