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

+10
View File
@@ -432,6 +432,13 @@ public:
std::string m_selectedGroup;
std::string m_v2KeyPath; // V2 密钥文件路径
void RebuildFilteredIndices(); // 重建过滤索引
// 主机列表的文本筛选(Ctrl+F 搜索栏)。空串表示不筛选;只影响列表显示的行,
// 不改动 m_HostList,也不影响任何按 clientID 解析目标的命令路径。
void SetHostFilter(const CString& text);
CString GetHostFilter() const { return m_strHostFilter; }
CString m_strHostFilter; // 当前筛选文本(只在 UI 线程读写)
// 主机是否命中筛选关键字(key 已转小写)。调用方需持有 m_cs。
bool HostMatchesFilter(context* ctx, const CString& lowerKey);
context* GetContextByListIndex(int iItem); // 根据列表索引获取 context(考虑分组过滤)
// 按 clientID 把选中项恢复到它们当前所在的行号。虚拟列表的选中项是按行号保存的,
// 而 m_HostList 会随主机上下线重排,同一个行号重排后往往指向另一台主机。
@@ -439,6 +446,9 @@ public:
// 本次命令的目标主机:右键菜单派发期间(m_CtxMenuTargets 非空)以 clientID 快照为准,
// 否则取列表当前选中项。调用方需持有 m_cs。
std::vector<context*> ResolveCommandTargets();
// 危险操作确认框里的目标清单:「备注(没有则计算机名)(IP)」,超过 maxShow 台时
// 只列前 maxShow 台、末尾补一行省略号。只读列表数据,调用方需持有 m_cs。
CString DescribeTargetHosts(const std::vector<context*>& targets, int maxShow);
// 右键菜单发起时锁定的目标主机(clientID 快照)。菜单弹出到命令真正执行之间还会插入
// MessageBoxL / DoModal 等模态框,模态循环里 WM_TIMER 照常派发、列表照常重排,命令
// 处理函数若在那之后再按行号读选中项,就会读到另一台主机。只在 UI 线程访问。