feat(shortcut): add custom shortcut CRUD persistence#95
Closed
yixinshark wants to merge 2 commits into
Closed
Conversation
Expose shortcut category keys as strings, add a ListCategories D-Bus API, and return localized category display names from the shortcut service. Update DConfig shortcut categories and i18n extraction so system, window, workspace, custom, and app-provided categories are translated through the same per-app translation path. 将快捷键分类从数字枚举改为字符串键,新增 ListCategories D-Bus 接口,并由快捷键服务返回本地化后的分类显示名。同步更新 DConfig 快捷键分类和翻译提取逻辑,使系统、窗口、工作区、自定义以及应用提供的分类都走同一套按应用翻译的路径。 Log: add dynamic category metadata Pms: BUG-367657,BUG-365993 Change-Id: I3c0440ff9a91c48b1946b228ac942973ba40c41c
Add runtime custom shortcut CRUD (AddCustomShortcut/ModifyCustomShortcut/DeleteCustomShortcut) to KeybindingManager with input validation, conflict handling and commit-failure rollback. Add GetShortcutCommand so the control center can fetch a custom shortcut command separately. Persist runtime custom shortcuts through user-level DConfig plus a custom shortcut subpath registry. Keep Add on full save/create semantics, use updateCustomShortcut for Modify so existing entries update only changed fields, and roll back persisted state when registration or conflict persistence fails. Introduce display-only shortcut configs so modifiable shortcuts with no hotkey remain visible as "None" after their binding is taken. Keep these entries in the runtime map and expose them through ListAllShortcuts. Remove the unused checkConflictForConfig helper after conflict checks stayed on the actual LookupConflictShortcut/registerShortcut paths. 新增自定义快捷键运行时增删改(AddCustomShortcut/ModifyCustomShortcut/DeleteCustomShortcut),包含输入校验、冲突处理和提交失败回滚;新增 GetShortcutCommand,供控制中心单独获取自定义快捷键命令。 通过用户级 DConfig 和自定义快捷键 subpath 注册表持久化运行时自定义快捷键。Add 继续使用完整创建/保存语义,Modify 改用 updateCustomShortcut,仅更新已有条目的变化字段,并在注册或冲突持久化失败时回滚持久化状态。 引入 display-only 快捷键配置,使可修改但无热键的快捷键在绑定被其他快捷键占用后仍能以“无”显示。此类条目保留在运行时映射中,并通过 ListAllShortcuts 暴露。 删除未使用的 checkConflictForConfig 辅助函数,因为真实冲突检测仍走 LookupConflictShortcut/registerShortcut 路径。 Log: feat(shortcut): add custom shortcut CRUD and display-only support Change-Id: Ie59dd3cb4e2575eea15974b9454eefc0ff484bfa
There was a problem hiding this comment.
Sorry @yixinshark, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: yixinshark The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Contributor
Author
|
Closing because this PR was created against master and included the previous stacked commit. Recreating it against an upstream stacked base branch so it contains only the custom shortcut persistence commit. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan
Dependency
Stacked on #93. This branch is based on yixinshark:fix/shortcut-dynamic-categories, so the PR diff may include #93 until that PR is merged. Please review the top commit: 213e06a feat(shortcut): add custom shortcut CRUD and display-only support.