feat(dconfig-editor): add copy field name in context menu#153
Merged
Conversation
1. Added "copy field name" action to the right-click context menu on the rightmost list 2. Copies the field key name to clipboard on trigger 3. Renamed `copyAction` to `copyValueAction` for clarity 4. Added Chinese translation for the new menu item Log: Add "copy field name" right-click menu option to copy the field key to clipboard feat(dconfig-editor): 右键菜单新增复制字段名功能 1. 在最右侧列表的右键菜单中新增"复制字段名"选项 2. 点击后将该字段的 key 名称复制到剪贴板 3. 将原有的 `copyAction` 重命名为 `copyValueAction`,避免歧义 4. 添加中文翻译 Log: 在右键菜单中增加复制字段名功能,点击可复制当前字段的 key 到剪贴板
deepin pr auto review★ 总体评分:95分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 void Content::onCustomContextMenuRequested(QWidget *widget, const QString &appid, const QString &resource, const QString &subpath, const QString &key)
{
QString value = "示例值";
QString setCmd = "示例命令";
QMenu *menu = new QMenu(widget);
QAction *exportAction = menu->addAction(tr("export"));
QAction *copyFieldAction = menu->addAction(tr("copy field name"));
QAction *copyValueAction = menu->addAction(tr("copy value"));
QAction *copyCmdAction = menu->addAction(tr("convert to cmd"));
QAction *resetCmdAction = menu->addAction(tr("reset value"));
QClipboard *clip = QApplication::clipboard();
connect(copyFieldAction, &QAction::triggered, this, [clip, key] {
clip->setText(key);
});
connect(copyValueAction, &QAction::triggered, this, [clip, value] {
clip->setText(value);
});
connect(copyCmdAction, &QAction::triggered, this, [clip, setCmd] {
clip->setText(setCmd);
});
menu->exec(QCursor::pos());
delete menu;
} |
18202781743
approved these changes
Jul 9, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, mhduiy 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 |
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
Add "copy field name" right-click menu option to copy the field key to clipboard in dde-dconfig-editor.
Changes
copy field nameaction to the right-click context menu on the rightmost listcopyActiontocopyValueActionfor clarity