美化控制台输出:时间戳、颜色标签、线程安全优化

- PlainTextEdit 替换为 TextEdit 支持 HTML 富文本
- 每条日志添加 [HH:MM:SS] 时间戳
- 根据消息类型自动着色(错误红/成功绿/警告橙/信息蓝)
- 修复字幕检测模型无 ONNX providers 时输出空括号的问题
- HTML 特殊字符转义防止注入
- 清理 gui.py closeEvent 中多余的注释代码

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
flavioy
2026-04-07 23:29:16 +08:00
parent 6c61ddc6b0
commit 1ab2eb96cf
3 changed files with 90 additions and 58 deletions

5
gui.py
View File

@@ -89,11 +89,8 @@ class SubtitleExtractorGUI(FluentWindow):
self.stackWidget.setCurrentIndex(1)
def closeEvent(self, event):
"""程序关闭时保存窗口位置并恢复标准输出和标准错误"""
"""程序关闭时保存窗口位置并清理资源"""
self.save_window_position()
# 断开信号连接
# self.themeListener.terminate()
# self.themeListener.deleteLater()
ProcessManager.instance().terminate_all()
super().closeEvent(event)