批量模式下支持拖文件到窗口上#1104
Open
hjkl950217 wants to merge 4 commits into
Hidden character warning
The head ref may contain hidden characters: "\u529f\u80fd-\u6279\u91cf\u6a21\u5f0f\u4e0b\u652f\u6301\u62d6\u6587\u4ef6\u5230\u7a97\u53e3\u4e0a"
Open
Conversation
- 新增 get_subprocess_kwargs() 统一封装 Windows 静默启动参数(CREATE_NO_WINDOW + SW_HIDE) - 重构 ffmpeg/7z/ASR 等子进程调用,统一使用 get_subprocess_kwargs() - 解决了 GUI 版本执行任务时弹出控制台窗口的问题 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- MainWindow 添加 dragEnterEvent/dropEvent 统一处理拖放 - 移除 BatchProcessInterface 中冗余的拖放方法 - 拖放文件自动添加到批量处理列表 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR primarily aims to restore drag-and-drop file import for the batch-processing UI, which fits into the app’s desktop workflow for submitting media/subtitle jobs. In practice, it also includes a broader Windows UX refactor by centralizing hidden-subprocess startup flags across the media, subtitle-rendering, ASR, and model-download paths.
Changes:
- Added window-level drag/drop handling in the main window and rewired batch file drops to flow through
add_files(...). - Removed batch page-local drop handlers and kept batch file ingestion logic in
BatchProcessInterface. - Replaced ad hoc Windows
creationflagsusage withget_subprocess_kwargs()across FFmpeg, ASR, subtitle rendering, and 7z extraction code paths.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
videocaptioner/ui/view/main_window.py |
Adds global drag/drop entry points and forwards dropped files to the active page. |
videocaptioner/ui/view/batch_process_interface.py |
Removes local drop handlers and relies on shared batch file ingestion. |
videocaptioner/ui/components/FasterWhisperSettingWidget.py |
Switches 7z extraction subprocess startup to shared Windows kwargs helper. |
videocaptioner/core/utils/video_utils.py |
Migrates FFmpeg subprocess calls to shared hidden-window kwargs. |
videocaptioner/core/utils/platform_utils.py |
Expands get_subprocess_kwargs() to return Windows creationflags plus startupinfo. |
videocaptioner/core/subtitle/rounded_renderer.py |
Uses shared subprocess kwargs for FFmpeg metadata/rendering calls. |
videocaptioner/core/subtitle/ass_renderer.py |
Uses shared subprocess kwargs for preview/render FFmpeg calls. |
videocaptioner/core/asr/whisper_cpp.py |
Uses shared subprocess kwargs for whisper-cpp and FFmpeg subprocesses. |
videocaptioner/core/asr/faster_whisper.py |
Uses shared subprocess kwargs for faster-whisper process startup. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- 避免 batch 页面抢占拖放事件\n- 仅在当前页面可处理且启用时接受拖放\n- 过滤非本地 URL 并统一 drop/drag 判定\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
原来的1.3有这个功能,但是不知道为什么pip安装的1.4 gui版本没有这个功能了。让AI跑了下,再检查了2轮后修复了代码,提交了过来