Feature: Show TLS and MCP state in the server status bar

The main window's status bar now carries two short panes between the host
count and the FRP address. The first reports whether the server identity is
loaded, using the same ServerTlsIdentity::IsReady() check the rest of the UI
uses, so a menu that claims TLS is on cannot leave the bar saying otherwise
when the certificate failed to load. The second reports whether MCP is
enabled and, while it is, which protocol the endpoint speaks: (HTTP) or
(HTTPS) according to McpHttps. Both panes follow the existing 60 second
statistics tick, and toggling either switch in its dialog refreshes them at
once instead of leaving the bar stale until the next tick.

Pane widths are measured from the widest text each pane can show in the
current language instead of hardcoded pixels, and the measurement selects
the status bar's own font: DEFAULT_GUI_FONT is about 8% narrower than the
Segoe UI the bar paints with, which would have clipped "MCP: ... (HTTPS)"
at higher display scaling. Switching HTTP/HTTPS keeps the column width
steady, and turning MCP off lets it shrink again.

The MCP settings dialog was also missing translations for several of its
labels, the file write switch among them, which is why they stayed Chinese
in the English UI. Those keys, together with the status bar ones, are added
to all three language files.

Co-Authored-By: deepseek-flash
This commit is contained in:
yuanyuanxianganddeepseek-flash committed 2026-11-01 10:53:04 +01:00
1 parent e99092ca70
commit 559681ea01
7 files changed
+124 -23

No files matched your search

+2
View File
@@ -444,6 +444,8 @@ public:
ULONGLONG m_ullStartTime = 0; // 程序启动时间 (GetTickCount64)
CString m_strExpireDate; // 到期日期 (YYYYMMDD),空表示无授权
CString m_strFrpAddr; // FRP 地址 (IP:Port),由上级提供
int m_nPaneTlsWidth = 60; // 状态栏 TLS 分区宽度(按当前语言实测文本宽度)
int m_nPaneMcpWidth = 60; // 状态栏 MCP 分区宽度(按当前语言实测文本宽度)
void UpdateStatusBarStats(); // 更新状态栏统计信息
CTrueColorToolBar m_ToolBar;
CGridDialog * m_gridDlg = NULL;