Feature: add tooltips to the generate-passcode dialog

Every control the operator can use on the passcode-generation dialog now
explains itself on hover, reusing the MFC built-in tooltip mechanism from
the build-server dialog (EnableToolTips + OnToolHitTest + TTN_NEEDTEXT,
with the max tip width applied when the tip is requested so the explicit
line breaks hold; hidden controls are skipped).

The password, private-key and Generate tips carry the main point: a
passcode is only valid when produced with the right super-admin password
(V1) or a legitimate private key (V2); tampered passwords, forged keys
and hand-assembled values always fail client verification. The
root-credential tip now describes the field as the downward credential
filled in after generating, which is what V2 actually writes there.

All 18 texts are translated in the en_US, de_DE and zh_TW packs.

Co-Authored-By: deepseek-flash
This commit is contained in:
yuanyuanxianganddeepseek-flash committed 2026-12-06 22:22:40 +01:00
1 parent a32219f05c
commit f22bd574ea
5 files changed
+189

No files matched your search

+7
View File
@@ -2,6 +2,7 @@
#include <afx.h>
#include <afxwin.h>
#include <map>
#include <mutex>
#include "Resource.h"
#include "common/commands.h"
@@ -122,6 +123,12 @@ public:
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
// 控件悬浮提示(MFC 内建工具提示):OnToolHitTest 按控件矩形命中,
// TTN_NEEDTEXT 按控件 ID 取多行文本。隐藏控件的提示自动跳过。
virtual INT_PTR OnToolHitTest(CPoint point, TOOLINFO* pTI) const;
BOOL OnToolTipNotify(UINT id, NMHDR* pNMHDR, LRESULT* pResult);
std::map<UINT, CString> m_tips; // 控件 ID -> 提示文本
DECLARE_MESSAGE_MAP()
public:
HICON m_hIcon;