feat: PATH 配置文件/预设切换 — 保存、加载、一键应用不同场景的 PATH 配置

- 新增 profiles.rs: list/save/load/delete/rename 五个 Rust 命令
- 配置文件存储在 %APPDATA%/.patheditor/profiles/<name>.json
- ProfileDialog: 保存当前 PATH、加载预览、一键应用到注册表
- 工具栏新增「配置」按钮

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-28 21:02:29 +08:00
parent 7869886670
commit d7d11480b8
9 changed files with 423 additions and 1 deletions
+14
View File
@@ -22,6 +22,7 @@
"cancel": "Cancel",
"help": "Help",
"analyze": "Analyze",
"profiles": "Profiles",
"undo": "Undo",
"redo": "Redo",
"darkMode": "Dark Mode",
@@ -83,6 +84,19 @@
"searchPlaceholder": "Search executable name...",
"conflictCount": "{{count}} file conflict(s) found"
},
"profile": {
"title": "PATH Profiles",
"saveCurrent": "Save Current as Profile",
"namePlaceholder": "Profile name...",
"save": "Save",
"load": "Load",
"apply": "Apply",
"delete": "Delete",
"rename": "Rename",
"noProfiles": "No saved profiles",
"applyConfirm": "This will overwrite current PATH with profile \"{{name}}\" and write to registry. Confirm?",
"deleted": "Profile \"{{name}}\" deleted"
},
"help": {
"content": "PathEditor v4.0 — Windows System Environment Variable (PATH) Editor\n\nFeatures:\n• Create/Edit/Delete path entries\n• Move Up/Down to adjust priority\n• One-click cleanup of invalid & duplicate paths\n• Import/Export JSON, CSV, TXT formats\n• Full Undo/Redo support\n\nShortcuts:\n• Ctrl+N New\n• Ctrl+S Save\n• Ctrl+Z Undo\n• Ctrl+Y Redo\n• Ctrl+F Search\n• Delete Delete selected\n• F1 Help\n\nAuthor: 刘航宇\nGitHub: https://github.com/LHY0125/PathEditor"
}
+14
View File
@@ -22,6 +22,7 @@
"cancel": "取消",
"help": "帮助",
"analyze": "分析",
"profiles": "配置",
"undo": "撤销",
"redo": "重做",
"darkMode": "深色模式",
@@ -83,6 +84,19 @@
"searchPlaceholder": "搜索可执行文件名...",
"conflictCount": "发现 {{count}} 个文件冲突"
},
"profile": {
"title": "PATH 配置文件",
"saveCurrent": "保存当前 PATH 为配置",
"namePlaceholder": "配置名称...",
"save": "保存",
"load": "加载",
"apply": "应用",
"delete": "删除",
"rename": "重命名",
"noProfiles": "暂无配置文件",
"applyConfirm": "将用配置 \"{{name}}\" 覆盖当前 PATH 并写入注册表,确定吗?",
"deleted": "已删除配置 \"{{name}}\""
},
"help": {
"content": "PathEditor v4.0 — Windows 系统环境变量 (PATH) 编辑器\n\n功能:\n• 新建/编辑/删除路径条目\n• 上移/下移调整优先级\n• 一键清理无效和重复路径\n• 导入/导出 JSON、CSV、TXT 格式\n• 完整撤销/重做支持\n\n快捷键:\n• Ctrl+N 新建\n• Ctrl+S 保存\n• Ctrl+Z 撤销\n• Ctrl+Y 重做\n• Ctrl+F 搜索\n• Delete 删除选中\n• F1 帮助\n\n作者: 刘航宇\nGitHub: https://github.com/LHY0125/PathEditor"
}