Fix: Refresh MCP menu checkmark after settings change

The MCP settings menu item's checkmark was set only once at startup in
CreateSolidMenu, so toggling MCP in the settings dialog left the menu stale
until restart. Update the checkmark in OnMcpSettings after the dialog closes
so it matches [settings] McpEnabled immediately.

Co-Authored-By: deepseek-v4-pro
This commit is contained in:
yuanyuanxianganddeepseek-v4-pro committed 2026-10-15 19:43:58 +02:00
1 parent 7651ee8602
commit 8f02e73b9c
1 file changed
+7
+7
View File
@@ -11585,6 +11585,13 @@ void CMy2015RemoteDlg::OnMcpSettings()
// 保存后重生成 frpc.ini:若已启用 MCP 且绑定 0.0.0.0,则把 MCP 端口纳入 FRP 暴露列表
// (与监听/Web 端口取并集,互不覆盖)。MCP 生效仍需重启,此处仅为下次启动准备配置。
ApplyFrpSettings();
// 菜单在启动时只构建一次(CreateSolidMenu),勾选状态不会自动刷新,
// 这里同步「扩展」菜单上「MCP设置」的勾选,使其与 [settings] McpEnabled 一致。
if (CMenu* pExtMenu = m_MainMenu.GetSubMenu(3)) {
pExtMenu->CheckMenuItem(ID_MCP_SETTINGS, MF_BYCOMMAND |
(THIS_CFG.GetInt("settings", "McpEnabled", 0) ? MF_CHECKED : MF_UNCHECKED));
}
}
void CMy2015RemoteDlg::OnTlsCertificate()