Feature: Bring feature limits in line with the current menus

The "feature limits" dialog offered by 主控生成 had drifted well behind the
UI: a whole 高级 menu, five toolbar buttons and a couple of dozen context
menu entries could not be restricted at all, and several items were listed
under names that no longer appear anywhere.

The three tabs now follow the real resources. Menu items are listed in the
order of IDR_MENU_MAIN and carry the same text minus accelerators; the
toolbar covers all 19 IDR_TOOLBAR_MAIN buttons; the context menu lists the
nested 实验功能 / 客户管理 / 远程控制 / 机器管理 / 客户代理 / 执行程序 entries
individually and the two runtime-built ones (协议切换, 执行代码) as groups.
That makes 57 / 19 / 46 items, each with its own bit; new bits were added
at the end of each field so the existing positions stay put.

Enforcement was extended to match, and while wiring it up one long-standing
bug surfaced: DeleteMenu(MF_BYCOMMAND) only reaches items of the menu it is
called on, so hiding an entry of a nested popup had always been a no-op.
Nested items are now deleted through their own submenu handle, and a popup
whose items are all hidden is removed together with its parent entry, so
no empty popup is left behind. 协议切换 is inserted relative to where
实验功能 ended up, which keeps it next to it either way; 执行代码 is simply
skipped when restricted.

The missing labels were added to en_US, zh_TW and de_DE.

Co-Authored-By: deepseek-flash
This commit is contained in:
yuanyuanxianganddeepseek-flash committed 2026-11-01 12:48:44 +01:00
1 parent 559681ea01
commit 8807321f1d
7 files changed
+529 -205

No files matched your search

+41 -3
View File
@@ -91,7 +91,21 @@ typedef struct FeatureFlags {
#define MF_MCP_SETTINGS (1ULL << 43) // HIDE_MENU_MCP_SETTINGS
#define MF_TLS_CERTIFICATE (1ULL << 44) // HIDE_MENU_TLS_CERTIFICATE
// [45-63] Reserved
// 后续新增项(按菜单顺序追加以保持既有位不变)
#define MF_TRIGGER_SETTINGS (1ULL << 45) // HIDE_MENU_TRIGGER_SETTINGS (文件)
#define MF_COMPRESS (1ULL << 46) // HIDE_MENU_COMPRESS (文件)
#define MF_UNCOMPRESS (1ULL << 47) // HIDE_MENU_UNCOMPRESS (文件)
#define MF_THUMBNAIL_PREVIEW (1ULL << 48) // HIDE_MENU_THUMBNAIL_PREVIEW (参数)
#define MF_PLUGIN_SETTINGS (1ULL << 49) // HIDE_MENU_PLUGIN_SETTINGS (扩展)
#define MF_WEB_REMOTE_CONTROL (1ULL << 50) // HIDE_MENU_WEB_REMOTE_CONTROL (扩展)
#define MF_DEV_DEBUG (1ULL << 51) // HIDE_MENU_DEV_DEBUG (其他)
#define MF_VIEW_HIDE_LOG (1ULL << 52) // HIDE_MENU_VIEW_HIDE_LOG (其他)
#define MF_UNINSTALL_SOFTWARE (1ULL << 53) // HIDE_MENU_UNINSTALL_SOFTWARE (其他)
#define MF_QUALITY_LEVELS (1ULL << 54) // HIDE_MENU_QUALITY_LEVELS (高级)
#define MF_PREVIEW_LEVELS (1ULL << 55) // HIDE_MENU_PREVIEW_LEVELS (高级)
#define MF_FILE_SPEED (1ULL << 56) // HIDE_MENU_FILE_SPEED (高级)
// [57-63] Reserved
// ============================================================
@@ -112,8 +126,13 @@ typedef struct FeatureFlags {
#define TF_BUILD (1ULL << 11) // HIDE_TOOLBAR_BUILD
#define TF_SEARCH (1ULL << 12) // HIDE_TOOLBAR_SEARCH
#define TF_HELP (1ULL << 13) // HIDE_TOOLBAR_HELP
#define TF_LANGUAGE (1ULL << 14) // HIDE_TOOLBAR_LANGUAGE
#define TF_MCP (1ULL << 15) // HIDE_TOOLBAR_MCP
#define TF_CONNECTIONS (1ULL << 16) // HIDE_TOOLBAR_CONNECTIONS
#define TF_TALK (1ULL << 17) // HIDE_TOOLBAR_TALK
#define TF_MACHINE (1ULL << 18) // HIDE_TOOLBAR_MACHINE
// [14-63] Reserved
// [19-63] Reserved
// ============================================================
@@ -155,7 +174,26 @@ typedef struct FeatureFlags {
#define CF_EXECUTE_TESTRUN (1ULL << 27) // HIDE_CTX_EXECUTE_TESTRUN
#define CF_EXECUTE_GHOST (1ULL << 28) // HIDE_CTX_EXECUTE_GHOST
// [29-63] Reserved
// 后续新增项(按菜单顺序追加以保持既有位不变)
#define CF_COPY_NAME (1ULL << 29) // HIDE_CTX_COPY_NAME
#define CF_CLIENT_LOG (1ULL << 30) // HIDE_CTX_CLIENT_LOG
#define CF_EXPERIMENT_FILEMGR (1ULL << 31) // HIDE_CTX_EXPERIMENT_FILEMGR
#define CF_EXPERIMENT_PRIVATE_SCREEN (1ULL << 32) // HIDE_CTX_EXPERIMENT_PRIVATE_SCREEN
#define CF_EXPERIMENT_DRAWING (1ULL << 33) // HIDE_CTX_EXPERIMENT_DRAWING
#define CF_EXPERIMENT_TLS_ENABLE (1ULL << 34) // HIDE_CTX_EXPERIMENT_TLS_ENABLE
#define CF_EXPERIMENT_TLS_DISABLE (1ULL << 35) // HIDE_CTX_EXPERIMENT_TLS_DISABLE
#define CF_HISTORY_ACTIVITY (1ULL << 36) // HIDE_CTX_HISTORY_ACTIVITY
#define CF_CANCEL_SHARE (1ULL << 37) // HIDE_CTX_CANCEL_SHARE
#define CF_COPY_INFO (1ULL << 38) // HIDE_CTX_COPY_INFO
#define CF_ACTIVE_WND (1ULL << 39) // 活动窗口
#define CF_VIEW_WND (1ULL << 40) // 浏览窗口
#define CF_SCREENPREVIEW_LOOP (1ULL << 41) // 屏幕预览(循环)
#define CF_PROXY_PORT_AUTORUN (1ULL << 42) // 代理端口-自启
#define CF_FORBIDDEN (1ULL << 43) // 封禁使用
#define CF_PROTO_SWITCH (1ULL << 44) // 协议切换
#define CF_EXECUTE_CODE (1ULL << 45) // 执行代码
// [46-63] Reserved
// ============================================================