Repository navigation
表格识别 - #944
Closed
dengzhongyuan365-dev wants to merge 4 commits into
Closed
表格识别#944dengzhongyuan365-dev wants to merge 4 commits into
dengzhongyuan365-dev wants to merge 4 commits into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: dengzhongyuan365-dev 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 |
Reviewer's GuideThis PR links the DTK table-recognition library and routes screenshot images through a new D-Bus API into the pinned-image window, where users can start recognition from the toolbar or Alt+T, observe themed progress/error states, and copy successful HTML results as Excel-compatible clipboard content. Sequence diagram for table recognition from screenshot to clipboardsequenceDiagram
actor User
participant Recorder as ScreenshotRecorder
participant DBus as PinScreenShotsDBus
participant Pin as PinnedImageWindow
participant Loader as TableRecognizerLoader
participant DTK as DTableRecognizer
participant Clipboard
User->>Recorder: click tableRecogn or press Alt+T
Recorder->>DBus: openImageAndNameForTable(image, imageName, point)
DBus->>Pin: openImageForTable(image, imageName, point)
Pin->>Loader: recognize(image)
Loader->>DTK: recognizeAsync(image, timeout)
DTK-->>Loader: recognitionDone(result)
Loader-->>Pin: recognitionFinished(success, html, error)
alt recognition succeeds
Pin-->>User: show TableResultDialog
User->>Pin: click Copy as Excel format
Pin->>Clipboard: setMimeData(html)
else recognition fails
Pin-->>User: show error toast
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/pin_screenshots/mainwindow.cpp" line_range="214" />
<code_context>
+ if (success) {
+ // 贴图窗口是置顶的无边框窗口,顶层对话框会被遮挡,这里使用窗口内浮层。
+ if (!m_tableResultDialog) {
+ m_tableResultDialog = new TableResultDialog(html, m_image, this);
+ }
+ m_tableResultDialog->setBackdropImage(m_image);
</code_context>
<issue_to_address>
**Clipboard keeps the previous table**
When a later recognition succeeds in the same pin window, `onTableRecognitionFinished` reuses `m_tableResultDialog` without updating its constructor-stored `m_html`, so `copyToClipboard()` copies the previous run’s table instead of the latest result.
Update the dialog’s stored HTML or recreate the dialog for each successful recognition.
Also at `src/pin_screenshots/mainwindow.cpp:213`.
</issue_to_address>
### Comment 2
<location path="src/main_window.cpp" line_range="4028" />
<code_context>
+ m_functionType = status::tablerecogn;
+ m_pinInterface = new PinScreenShotsInterface(
+ "com.deepin.PinScreenShots", "/com/deepin/PinScreenShots", QDBusConnection::sessionBus(), this);
+ saveScreenShot();
+ QImage tableImage = m_resultPixmap.toImage();
+ QDBusPendingCall pendingCall =
</code_context>
<issue_to_address>
**Treeland recognition gets no fresh capture**
When table recognition is launched in a Treeland session, the table branch calls `saveScreenShot()` even in Treeland mode, instead of using the Treeland capture path used by OCR. The image passed to the pin window is consequently not captured through that platform path, and recognition receives an invalid or stale image.
Route Treeland table recognition through the same capture path as OCR before sending the image to the pin window.
</issue_to_address>Add result dialog, progress widget, failure toast and glass panel for table recognition, composed from DTK widgets only. 新增表格识别结果弹窗、识别进度、失败提示与毛玻璃面板,全部由 DTK 控件组合实现;同时补充深色主题取色工具与图标资源。 Log: 新增表格识别 UI 控件 PMS: TASK-393987 Influence: 提供表格识别所需的 UI 组件,尚未接入识别流程。
Link dtk6tablerecognizer and wire the loader into the pin window so an image can be recognized and rendered in the new UI. 链接 dtk6tablerecognizer 并把识别流程接入贴图窗口,对贴图内容执行 表格识别;贴图工具栏新增识别入口,D-Bus 接口开放对应调用。 Log: 接入贴图表格识别流程 PMS: TASK-393987 Influence: 贴图窗口可发起表格识别,依赖 libdtk6tablerecognizer。
Add a table recognition button between OCR and pin in the screenshot toolbar, which opens the pin window and starts recognition. 截图工具栏在文字识别与贴图之间新增表格识别入口,点击后跳转贴图 窗口并发起表格识别;同步补充无障碍名称与图标资源。 Log: 截图工具栏新增表格识别入口 PMS: TASK-393987 Influence: 截图模式下可直接发起表格识别,入口位于 OCR 与贴图之间。
Update zh_CN/zh_HK/zh_TW translations with the new table recognition strings. 更新 zh_CN/zh_HK/zh_TW 翻译,补充表格识别相关文案。 Log: 更新表格识别翻译 PMS: TASK-393987 Influence: 表格识别相关界面文案可正确国际化。
dengzhongyuan365-dev
force-pushed
the
newfeat-10080
branch
from
October 9, 2026 08:07
b247fc8 to
e8514cd
Compare
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.
feat(pin): run table recognition on pin image
Link dtk6tablerecognizer and wire the loader into the pin window so an
image can be recognized and rendered in the new UI.
链接 dtk6tablerecognizer 并把识别流程接入贴图窗口,对贴图内容执行
表格识别;贴图工具栏新增识别入口,D-Bus 接口开放对应调用。
Log: 接入贴图表格识别流程
PMS: TASK-393987
Influence: 贴图窗口可发起表格识别,依赖 libdtk6tablerecognizer。
Summary by Sourcery
Integrate table recognition into screenshot and pin workflows so users can recognize table content and copy the results in Excel-compatible format.
New Features:
Enhancements:
Build:
Chores: