From 8e423bf7b89eeed85edd815a83d7da77f7e23696 Mon Sep 17 00:00:00 2001 From: jameson512 <2867557054@qq.com> Date: Sun, 5 May 2024 01:17:54 +0800 Subject: [PATCH] fix: bugs and update --- videotrans/__init__.py | 4 ++-- videotrans/mainwin/spwin.py | 12 +++++++----- videotrans/translator/__init__.py | 2 +- videotrans/ui/en.py | 9 ++++----- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/videotrans/__init__.py b/videotrans/__init__.py index c5550093..28678bc6 100644 --- a/videotrans/__init__.py +++ b/videotrans/__init__.py @@ -1,4 +1,4 @@ # -*- coding: utf-8 -*- -VERSION="v1.67" -VERSION_NUM=11067 \ No newline at end of file +VERSION="v1.68" +VERSION_NUM=11068 \ No newline at end of file diff --git a/videotrans/mainwin/spwin.py b/videotrans/mainwin/spwin.py index da13cfac..841a1c32 100644 --- a/videotrans/mainwin/spwin.py +++ b/videotrans/mainwin/spwin.py @@ -54,6 +54,10 @@ def __init__(self, parent=None,width=1200,height=700): self.setWindowTitle(self.rawtitle) # 检查窗口是否打开 self.initUI() + # 渲染后再执行绑定 + # QTimer.singleShot(200, self.bind_action) + QTimer.singleShot(500, self.start_box) + self.bind_action() def start_box(self): @@ -184,11 +188,6 @@ def initUI(self): self.processlayout = QVBoxLayout(viewport) # 设置布局管理器的对齐方式为顶部对齐 self.processlayout.setAlignment(Qt.AlignTop) - # 渲染后再执行绑定 - QTimer.singleShot(500, self.bind_action) - QTimer.singleShot(500, self.start_box) - - def bind_action(self): # 底部状态栏 self.statusLabel = QPushButton(config.transobj["Open Documents"]) self.statusLabel.setCursor(QtCore.Qt.PointingHandCursor) @@ -201,6 +200,9 @@ def bind_action(self): self.container.addWidget(self.rightbottom) self.statusBar.addPermanentWidget(self.container) + + + def bind_action(self): # 设置角色类型,如果当前是OPENTTS或 coquiTTS则设置,如果是edgeTTS,则为No from videotrans.mainwin.secwin import SecWindow from videotrans.mainwin.subform import Subform diff --git a/videotrans/translator/__init__.py b/videotrans/translator/__init__.py index 5ab4b2e6..9f42182c 100644 --- a/videotrans/translator/__init__.py +++ b/videotrans/translator/__init__.py @@ -19,7 +19,7 @@ # 翻译通道 TRANSNAMES = [ MICROSOFT_NAME, - #FREECHATGPT_NAME, + # FREECHATGPT_NAME, GOOGLE_NAME, BAIDU_NAME, DEEPL_NAME, diff --git a/videotrans/ui/en.py b/videotrans/ui/en.py index b5b4e58d..e5a9c665 100644 --- a/videotrans/ui/en.py +++ b/videotrans/ui/en.py @@ -495,11 +495,7 @@ def setupUi(self, MainWindow): self.subtitle_layout.addLayout(self.layout_sub_bottom) self.horizontalLayout_7.addWidget(self.splitter) MainWindow.setCentralWidget(self.centralwidget) - #200ms后渲染文字 - QTimer.singleShot(200, lambda: self.retranslateUi(MainWindow)) - - def retranslateUi(self, MainWindow): self.statusBar = QtWidgets.QStatusBar(MainWindow) self.statusBar.setObjectName("statusBar") MainWindow.setStatusBar(self.statusBar) @@ -739,9 +735,12 @@ def retranslateUi(self, MainWindow): self.toolBar.addAction(self.action_yingyinhebing) self.toolBar.addAction(self.action_hun) + # self.retranslateUi(MainWindow) + #200ms后渲染文字 + QTimer.singleShot(200, self.retranslateUi) - + def retranslateUi(self): self.btn_get_video.setToolTip(config.uilanglist.get("Multiple MP4 videos can be selected and automatically queued for processing")) self.btn_get_video.setText(config.uilanglist.get("Select video..")) self.btn_save_dir.setToolTip(config.uilanglist.get("Select where to save the processed output resources"))