UI: explain dangerous operations, screen modes and host filtering

Four items from a user-side review of the master. The common thread: the UI
now says what it is about to do instead of leaving the user to guess.

Confirm boxes. Logout, restart, shutdown, delete host and uninstall client
all asked "are you sure" without naming the action or the hosts, so a
multi-selection could not be checked. DescribeTargetHosts() lists
"note (or computer name) (ip)" capped at five lines, and the default button
is No. The preview is dropped before the modal box and targets are
re-resolved after it, since the list can reshuffle in between.

Screen modes. High Speed / Ultra Speed became High Quality (DXGI +
differential: lossless, bandwidth hungry) and Smooth (GDI + H264: lossy,
cheap). TranslateMenu looks menus up by displayed text, so the .rc entries,
the FeatureLimitsDlg item names and the language pack keys changed together.

Host filter. The Ctrl+F bar was find-next; it now filters as you type over
IP, location, note, OS and version, and Esc clears the filter. The status
line reads "filtered: N / M total" while active. Commands still resolve by
clientID and m_FilteredIndices still maps row to m_HostList index, so no
command path changes. SearchBarDlg drops from 446 to 312 lines.

Quality changes. The adaptive level now shows its reason for twenty seconds
("Good (high latency)") instead of silently changing. The full-screen info
bar was a fixed 170px, so that reason was clipped; the width is now measured
from the text with the same font that paints it, 170 becoming the floor and
16px quantisation so changing digits do not jitter the window. Cosmetic
only: no threshold, hysteresis, cooldown or lock-out logic is touched.

Verified: debug server build, 0 errors; new strings present in .res and in
the exe. UI not exercised - the debug master would fight the running release
master for the listening port in Bin/settings.ini.
This commit is contained in:
yuanyuanxiang committed 2026-11-07 15:34:45 +01:00
1 parent a190c21217
commit 6b87a31c6f
12 files changed
+364 -220

No files matched your search

+16
View File
@@ -184,6 +184,13 @@ private:
int m_nOpacityLevel;
bool m_bVisible;
// 宽度按文本自适应。原来写死 170,档位名后面跟出「(链路改善)」这类切档原因时
// 会被截断;170 现在只是下限。
int m_nWidth = 170;
CFont m_infoFont; // 绘制与测量共用,Create 里建一次
int MeasureWidth(); // 当前文本的窗口宽度(不小于下限,按 16px 取整)
void ResizeToFit(); // 宽度有变化时改窗口大小,保持中心不动
// 拖动支持
bool m_bDragging;
CPoint m_ptDragStart;
@@ -410,6 +417,11 @@ public:
ULONGLONG changeWindowStart = 0; // 当前统计窗口起点
int changeCountInWindow = 0; // 窗口内的自适应切换次数
ULONGLONG lockUntil = 0; // 锁档截止时间(0=未锁)
// ===== 档位变化的可见原因(纯界面提示,不参与任何判据)=====
// 记下最近一次自动切档的原因和显示截止时间:标题栏/全屏信息窗在切换后 20 秒内
// 显示「Good (延迟高)」,之后退回纯档位名,避免一直占着标题栏。
CString reason; // 空 = 不显示原因
ULONGLONG reasonUntil = 0;
} m_AdaptiveQuality;
volatile bool m_bResolutionChanging = false; // 分辨率切换中,阻止解码
@@ -485,6 +497,10 @@ public:
void ApplyQualityLevel(int level, bool persist = false); // 应用质量等级
void NoteAdaptiveChange(ULONGLONG now); // 自适应切换频率计数,超限则锁档
const char* GetQualityName(int level); // 获取质量等级名称
// 记下"为什么切档",供标题栏/全屏信息窗显示。key 传中文原文,内部按当前语言查表。
void SetQualityChangeReason(LPCTSTR key);
// 档位名 +(20 秒内有效的切换原因),如 "Good (延迟高)"
CString GetQualityDisplayName();
void UpdateQualityMenuCheck(CMenu* SysMenu = nullptr); // 更新质量菜单勾选状态
void OnTimer(UINT_PTR nIDEvent);