Skip to content

Commit

Permalink
fix: bugs and update
Browse files Browse the repository at this point in the history
  • Loading branch information
jianchang512 committed May 4, 2024
1 parent 2971e15 commit 8e423bf
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
4 changes: 2 additions & 2 deletions videotrans/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-

VERSION="v1.67"
VERSION_NUM=11067
VERSION="v1.68"
VERSION_NUM=11068
12 changes: 7 additions & 5 deletions videotrans/mainwin/spwin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion videotrans/translator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# 翻译通道
TRANSNAMES = [
MICROSOFT_NAME,
#FREECHATGPT_NAME,
# FREECHATGPT_NAME,
GOOGLE_NAME,
BAIDU_NAME,
DEEPL_NAME,
Expand Down
9 changes: 4 additions & 5 deletions videotrans/ui/en.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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"))
Expand Down

0 comments on commit 8e423bf

Please sign in to comment.