feat(dconfig-editor): add copy field name in context menu#152
Conversation
1. Added ExecStartPre to disable Transparent Huge Pages before dconfig daemon starts 2. Uses dde-thp-disable script to prevent THP-related memory issues Log: Disable THP before dde-dconfig-daemon startup fix(dde-dconfig-daemon): 服务启动前禁用透明大页 1. 新增 ExecStartPre 在 dconfig daemon 启动前禁用透明大页 2. 通过 dde-thp-disable 脚本避免 THP 导致的内存问题 Log: 在 dde-dconfig-daemon 启动前禁用透明大页 PMS: TASK-390043
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 到剪贴板
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
deepin pr auto review★ 总体评分:95分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 void Content::onCustomContextMenuRequested(QWidget *widget, const QString &appid, const QString &resource, const QString &subpath, const QString &key)
{
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();
// 增加防御性空指针检查,避免在极端图形环境异常情况下引发崩溃
if (!clip) {
qWarning() << "Failed to get system clipboard instance";
return;
}
connect(copyFieldAction, &QAction::triggered, this, [clip, key] {
clip->setText(key);
});
connect(copyValueAction, &QAction::triggered, this, [clip, value] {
clip->setText(value);
});
// ... 其他逻辑 ...
} |
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 clarityTest