Skip to content

批量模式下支持拖文件到窗口上#1104

Open
hjkl950217 wants to merge 4 commits into
WEIFENG2333:masterfrom
hjkl950217:功能-批量模式下支持拖文件到窗口上

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

批量模式下支持拖文件到窗口上#1104
hjkl950217 wants to merge 4 commits into
WEIFENG2333:masterfrom
hjkl950217:功能-批量模式下支持拖文件到窗口上

Conversation

@hjkl950217

Copy link
Copy Markdown

原来的1.3有这个功能,但是不知道为什么pip安装的1.4 gui版本没有这个功能了。让AI跑了下,再检查了2轮后修复了代码,提交了过来

hjkl950217 and others added 3 commits May 5, 2026 13:38
- 新增 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>
Copilot AI review requested due to automatic review settings May 5, 2026 06:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 creationflags usage with get_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.

Comment thread videocaptioner/ui/view/batch_process_interface.py Outdated
Comment thread videocaptioner/ui/view/main_window.py Outdated
Comment thread videocaptioner/core/utils/platform_utils.py
Comment thread videocaptioner/ui/view/main_window.py Outdated
- 避免 batch 页面抢占拖放事件\n- 仅在当前页面可处理且启用时接受拖放\n- 过滤非本地 URL 并统一 drop/drag 判定\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants