Commit d949532b authored by xuanweiace's avatar xuanweiace

feat:在【操作表格】中可以获取当前电影时间作为起始时间或者终止时间

fix: 若干bug和体验问题
parent 4cab3e60
...@@ -133,13 +133,14 @@ class MainWindow(QMainWindow, Ui_MainWindow): ...@@ -133,13 +133,14 @@ class MainWindow(QMainWindow, Ui_MainWindow):
self.action_undo.setEnabled(False) self.action_undo.setEnabled(False)
self.action_redo.triggered.connect(self.redo_slot) self.action_redo.triggered.connect(self.redo_slot)
self.action_redo.setEnabled(False) self.action_redo.setEnabled(False)
self.action_view_history.triggered.connect(self.view_history_slot) # 暂时去掉了
# self.action_view_history.triggered.connect(self.view_history_slot)
self.action_operate.triggered.connect(self.operate_slot) self.action_operate.triggered.connect(self.operate_slot)
self.action_operate.setEnabled(False) self.action_operate.setEnabled(False)
self.action_insert_aside_from_now.triggered.connect(self.insert_aside_from_now_slot) self.action_insert_aside_from_now.triggered.connect(self.insert_aside_from_now_slot)
self.action_insert_aside_from_now.setEnabled(False) self.action_insert_aside_from_now.setEnabled(False)
self.insert_aside_from_now_btn.clicked.connect(self.insert_aside_from_now_slot) self.insert_aside_from_now_btn.clicked.connect(self.insert_aside_from_now_slot)
self.insert_aside_from_now_btn.setEnabled(False)
""" """
视频相关信息 视频相关信息
""" """
...@@ -253,10 +254,11 @@ class MainWindow(QMainWindow, Ui_MainWindow): ...@@ -253,10 +254,11 @@ class MainWindow(QMainWindow, Ui_MainWindow):
# 更新工程信息 # 更新工程信息
self.projectContext.Init(project_path) self.projectContext.Init(project_path)
self.update_ui()
# 如果嗅探到旁白检测未完成,则询问是否继续 # 如果嗅探到旁白检测未完成,则询问是否继续
if self.projectContext.detected == True and self.projectContext.nd_process < 1: if self.projectContext.detected == True and self.projectContext.nd_process < 1:
self.continue_detect_prompt_dialog.show_with_msg("您的上次任务未完成,是否继续检测?") self.continue_detect_prompt_dialog.show_with_msg("您的上次任务未完成,是否继续检测?")
self.update_ui()
# 重写关闭Mmainwindow窗口 # 重写关闭Mmainwindow窗口
def closeEvent(self, event): def closeEvent(self, event):
...@@ -341,6 +343,7 @@ class MainWindow(QMainWindow, Ui_MainWindow): ...@@ -341,6 +343,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
self.action_export.setEnabled(True) self.action_export.setEnabled(True)
self.action_operate.setEnabled(True) self.action_operate.setEnabled(True)
self.action_insert_aside_from_now.setEnabled(True) self.action_insert_aside_from_now.setEnabled(True)
self.insert_aside_from_now_btn.setEnabled(True)
# todo: 后续这段代码公共的可以抽出来 # todo: 后续这段代码公共的可以抽出来
...@@ -375,7 +378,8 @@ class MainWindow(QMainWindow, Ui_MainWindow): ...@@ -375,7 +378,8 @@ class MainWindow(QMainWindow, Ui_MainWindow):
self.player.setMedia(QMediaContent(QUrl(video_path))) # 选取视频文件 self.player.setMedia(QMediaContent(QUrl(video_path))) # 选取视频文件
self.playVideo() # 播放视频 self.playVideo() # 播放视频
self.action_insert_aside_from_now.setEnabled(True) self.action_insert_aside_from_now.setEnabled(True)
self.insert_aside_from_now_btn.setEnabled(True)
self.continue_detect_prompt_dialog.setModal(True)
def continue_detect(self): def continue_detect(self):
print(f"继续检测,video_path={self.projectContext.video_path}, book_path={self.projectContext.excel_path}") print(f"继续检测,video_path={self.projectContext.video_path}, book_path={self.projectContext.excel_path}")
self.start_detect(self.projectContext.video_path, self.projectContext.excel_path) self.start_detect(self.projectContext.video_path, self.projectContext.excel_path)
...@@ -712,7 +716,6 @@ class MainWindow(QMainWindow, Ui_MainWindow): ...@@ -712,7 +716,6 @@ class MainWindow(QMainWindow, Ui_MainWindow):
user_operation=True的情况:用户双击操作表格,通过【操作表格】进行增删改,通过【在此处添加旁白】来添加一行 user_operation=True的情况:用户双击操作表格,通过【操作表格】进行增删改,通过【在此处添加旁白】来添加一行
initial_ing为true时,不会生成音频,不会写入历史记录 initial_ing为true时,不会生成音频,不会写入历史记录
""" """
print("set一次")
if not user_operation: if not user_operation:
self.projectContext.initial_ing = True self.projectContext.initial_ing = True
subtitle_list = self.projectContext.subtitle_list subtitle_list = self.projectContext.subtitle_list
...@@ -1076,6 +1079,7 @@ class MainWindow(QMainWindow, Ui_MainWindow): ...@@ -1076,6 +1079,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
self.pb_tableWidget.setItem( self.pb_tableWidget.setItem(
row, constant.Aside.AsideColumnNumber, item) row, constant.Aside.AsideColumnNumber, item)
# debug用的,现在暂时没啥用
def view_history_slot(self): def view_history_slot(self):
print("=="*10) print("=="*10)
print("self.sld_video.maximumSize", self.sld_video.maximumSize(), print("self.sld_video.maximumSize", self.sld_video.maximumSize(),
...@@ -1151,6 +1155,10 @@ class MainWindow(QMainWindow, Ui_MainWindow): ...@@ -1151,6 +1155,10 @@ class MainWindow(QMainWindow, Ui_MainWindow):
self.operation_dialog.show() self.operation_dialog.show()
def insert_aside_from_now_slot(self): def insert_aside_from_now_slot(self):
if self.player.duration() == 0 or self.projectContext.project_base_dir in [None, ""]:
self.prompt_dialog.show_with_msg("插入失败!未检测到视频或工程!")
return
print("self.player.position()", self.player.position())
cur_time = round(self.player.position()/1000, 2) cur_time = round(self.player.position()/1000, 2)
idx = self.calculate_element_row(cur_time) idx = self.calculate_element_row(cur_time)
print("[insert_aside_from_now_slot] idx=", idx) print("[insert_aside_from_now_slot] idx=", idx)
......
...@@ -309,6 +309,9 @@ ...@@ -309,6 +309,9 @@
background: #ffd740; background: #ffd740;
}</string> }</string>
</property> </property>
<property name="value">
<number>99</number>
</property>
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
...@@ -587,11 +590,9 @@ ...@@ -587,11 +590,9 @@
</property> </property>
<addaction name="action_undo"/> <addaction name="action_undo"/>
<addaction name="action_redo"/> <addaction name="action_redo"/>
<addaction name="action_view_history"/>
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="action_insert_aside_from_now"/> <addaction name="action_insert_aside_from_now"/>
<addaction name="action_operate"/> <addaction name="action_operate"/>
<addaction name="action_insert_subtitle_from_now"/>
</widget> </widget>
<widget class="QMenu" name="menu_3"> <widget class="QMenu" name="menu_3">
<property name="title"> <property name="title">
...@@ -652,11 +653,6 @@ ...@@ -652,11 +653,6 @@
<string>旁白音频合成</string> <string>旁白音频合成</string>
</property> </property>
</action> </action>
<action name="action_view_history">
<property name="text">
<string>----</string>
</property>
</action>
<action name="action_refresh_tab"> <action name="action_refresh_tab">
<property name="text"> <property name="text">
<string>刷新且保存表格</string> <string>刷新且保存表格</string>
...@@ -677,11 +673,6 @@ ...@@ -677,11 +673,6 @@
<string>当前位置插入旁白</string> <string>当前位置插入旁白</string>
</property> </property>
</action> </action>
<action name="action_insert_subtitle_from_now">
<property name="text">
<string>当前位置插入字幕</string>
</property>
</action>
<action name="action_create"> <action name="action_create">
<property name="text"> <property name="text">
<string>新建</string> <string>新建</string>
......
...@@ -166,6 +166,7 @@ class Ui_MainWindow(object): ...@@ -166,6 +166,7 @@ class Ui_MainWindow(object):
" QSlider::sub-page {\n" " QSlider::sub-page {\n"
" background: #ffd740;\n" " background: #ffd740;\n"
" }") " }")
self.sld_audio.setProperty("value", 99)
self.sld_audio.setOrientation(QtCore.Qt.Horizontal) self.sld_audio.setOrientation(QtCore.Qt.Horizontal)
self.sld_audio.setObjectName("sld_audio") self.sld_audio.setObjectName("sld_audio")
self.horizontalLayout_5.addWidget(self.sld_audio) self.horizontalLayout_5.addWidget(self.sld_audio)
...@@ -342,8 +343,6 @@ class Ui_MainWindow(object): ...@@ -342,8 +343,6 @@ class Ui_MainWindow(object):
self.action_3.setObjectName("action_3") self.action_3.setObjectName("action_3")
self.action_4 = QtWidgets.QAction(MainWindow) self.action_4 = QtWidgets.QAction(MainWindow)
self.action_4.setObjectName("action_4") self.action_4.setObjectName("action_4")
self.action_view_history = QtWidgets.QAction(MainWindow)
self.action_view_history.setObjectName("action_view_history")
self.action_refresh_tab = QtWidgets.QAction(MainWindow) self.action_refresh_tab = QtWidgets.QAction(MainWindow)
self.action_refresh_tab.setObjectName("action_refresh_tab") self.action_refresh_tab.setObjectName("action_refresh_tab")
self.action_operate = QtWidgets.QAction(MainWindow) self.action_operate = QtWidgets.QAction(MainWindow)
...@@ -352,8 +351,6 @@ class Ui_MainWindow(object): ...@@ -352,8 +351,6 @@ class Ui_MainWindow(object):
self.action_export.setObjectName("action_export") self.action_export.setObjectName("action_export")
self.action_insert_aside_from_now = QtWidgets.QAction(MainWindow) self.action_insert_aside_from_now = QtWidgets.QAction(MainWindow)
self.action_insert_aside_from_now.setObjectName("action_insert_aside_from_now") self.action_insert_aside_from_now.setObjectName("action_insert_aside_from_now")
self.action_insert_subtitle_from_now = QtWidgets.QAction(MainWindow)
self.action_insert_subtitle_from_now.setObjectName("action_insert_subtitle_from_now")
self.action_create = QtWidgets.QAction(MainWindow) self.action_create = QtWidgets.QAction(MainWindow)
self.action_create.setObjectName("action_create") self.action_create.setObjectName("action_create")
self.menu.addAction(self.action_create) self.menu.addAction(self.action_create)
...@@ -366,11 +363,9 @@ class Ui_MainWindow(object): ...@@ -366,11 +363,9 @@ class Ui_MainWindow(object):
self.menu.addAction(self.setting) self.menu.addAction(self.setting)
self.menu_2.addAction(self.action_undo) self.menu_2.addAction(self.action_undo)
self.menu_2.addAction(self.action_redo) self.menu_2.addAction(self.action_redo)
self.menu_2.addAction(self.action_view_history)
self.menu_2.addSeparator() self.menu_2.addSeparator()
self.menu_2.addAction(self.action_insert_aside_from_now) self.menu_2.addAction(self.action_insert_aside_from_now)
self.menu_2.addAction(self.action_operate) self.menu_2.addAction(self.action_operate)
self.menu_2.addAction(self.action_insert_subtitle_from_now)
self.menu_3.addAction(self.action_3) self.menu_3.addAction(self.action_3)
self.menu_3.addAction(self.action_4) self.menu_3.addAction(self.action_4)
self.menu_3.addSeparator() self.menu_3.addSeparator()
...@@ -407,12 +402,10 @@ class Ui_MainWindow(object): ...@@ -407,12 +402,10 @@ class Ui_MainWindow(object):
self.action_redo.setText(_translate("MainWindow", "重做")) self.action_redo.setText(_translate("MainWindow", "重做"))
self.action_3.setText(_translate("MainWindow", "旁白区间检测")) self.action_3.setText(_translate("MainWindow", "旁白区间检测"))
self.action_4.setText(_translate("MainWindow", "旁白音频合成")) self.action_4.setText(_translate("MainWindow", "旁白音频合成"))
self.action_view_history.setText(_translate("MainWindow", "----"))
self.action_refresh_tab.setText(_translate("MainWindow", "刷新且保存表格")) self.action_refresh_tab.setText(_translate("MainWindow", "刷新且保存表格"))
self.action_operate.setText(_translate("MainWindow", "操作表格")) self.action_operate.setText(_translate("MainWindow", "操作表格"))
self.action_export.setText(_translate("MainWindow", "导出")) self.action_export.setText(_translate("MainWindow", "导出"))
self.action_insert_aside_from_now.setText(_translate("MainWindow", "当前位置插入旁白")) self.action_insert_aside_from_now.setText(_translate("MainWindow", "当前位置插入旁白"))
self.action_insert_subtitle_from_now.setText(_translate("MainWindow", "当前位置插入字幕"))
self.action_create.setText(_translate("MainWindow", "新建")) self.action_create.setText(_translate("MainWindow", "新建"))
......
...@@ -6,6 +6,7 @@ from PyQt5.QtWidgets import * ...@@ -6,6 +6,7 @@ from PyQt5.QtWidgets import *
import utils import utils
from operation_dialog_ui import Ui_Dialog from operation_dialog_ui import Ui_Dialog
# from main_window import MainWindow
# todo 注意,删除行,添加行,暂不支持【撤销与重做】功能!!! # todo 注意,删除行,添加行,暂不支持【撤销与重做】功能!!!
...@@ -28,6 +29,11 @@ class Operation_Dialog(QDialog, Ui_Dialog): ...@@ -28,6 +29,11 @@ class Operation_Dialog(QDialog, Ui_Dialog):
# 如果是【修改一行】,选择行的时候要瞬间更新成目前行的内容 # 如果是【修改一行】,选择行的时候要瞬间更新成目前行的内容
self.pushButton_3.clicked.connect(self.fill_row_info_slot) self.pushButton_3.clicked.connect(self.fill_row_info_slot)
self.pickStartPos.clicked.connect(self.pick_start_pos_slot)
self.pickEndPos.clicked.connect(self.pick_end_pos_slot)
self.buttonBox.setEnabled(False) self.buttonBox.setEnabled(False)
self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).clicked.connect( self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).clicked.connect(
self.start_operation_slot) self.start_operation_slot)
...@@ -44,6 +50,14 @@ class Operation_Dialog(QDialog, Ui_Dialog): ...@@ -44,6 +50,14 @@ class Operation_Dialog(QDialog, Ui_Dialog):
self.zmpb_change_slot() self.zmpb_change_slot()
self.adddel_change_slot() self.adddel_change_slot()
def pick_start_pos_slot(self):
time = utils.transfer_second_to_time(str(self.mainWindow.player.position()/1000))
self.lineEdit_2.setText(time)
def pick_end_pos_slot(self):
time = utils.transfer_second_to_time(str(self.mainWindow.player.position()/1000))
self.lineEdit_3.setText(time)
def zmpb_change_slot(self): def zmpb_change_slot(self):
# 如果是删除,则直接return # 如果是删除,则直接return
if self.comboBox_2.currentText() == "删除一行": if self.comboBox_2.currentText() == "删除一行":
......
...@@ -6,38 +6,87 @@ ...@@ -6,38 +6,87 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>574</width> <width>711</width>
<height>384</height> <height>502</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Dialog</string> <string>Dialog</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout" columnstretch="0,1,0,0,0"> <layout class="QGridLayout" name="gridLayout" columnstretch="0,0,0,0,0">
<item row="0" column="1"> <item row="1" column="3" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,1"> <widget class="QPushButton" name="pushButton_3">
<item> <property name="text">
<widget class="QComboBox" name="comboBox"> <string>填充
行信息</string>
</property>
</widget>
</item>
<item row="6" column="4">
<widget class="QComboBox" name="comboBox_3">
<property name="enabled"> <property name="enabled">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="editable"> <property name="editable">
<bool>false</bool> <bool>false</bool>
</property> </property>
<item> </widget>
</item>
<item row="8" column="4">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string/>
</property>
<property name="toolTipDuration">
<number>-1</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Ok</set>
</property>
<property name="centerButtons">
<bool>false</bool>
</property>
</widget>
</item>
<item row="6" column="3">
<widget class="QLabel" name="label_14">
<property name="text"> <property name="text">
<string>字幕</string> <string>语速:</string>
</property> </property>
</widget>
</item> </item>
<item row="8" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="1,1,1">
<property name="topMargin">
<number>0</number>
</property>
<item> <item>
<widget class="QPushButton" name="pushButton_2">
<property name="text"> <property name="text">
<string>旁白</string> <string>修改</string>
</property> </property>
</item>
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="horizontalSpacer_2"> <spacer name="horizontalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
...@@ -49,8 +98,22 @@ ...@@ -49,8 +98,22 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item>
<widget class="QPushButton" name="pushButton">
<property name="text">
<string>检测</string>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
<item row="6" column="2">
<widget class="QLabel" name="label_11">
<property name="text">
<string>*请填文字</string>
</property>
</widget>
</item>
<item row="0" column="2"> <item row="0" column="2">
<widget class="QComboBox" name="comboBox_2"> <widget class="QComboBox" name="comboBox_2">
<item> <item>
...@@ -70,15 +133,19 @@ ...@@ -70,15 +133,19 @@
</item> </item>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="5" column="2">
<widget class="QLabel" name="label"> <widget class="QLabel" name="label_12">
<property name="text"> <property name="text">
<string>我想操作第</string> <string>*请填数字,必须是不超过100的正整数</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="3" column="2">
<widget class="QLineEdit" name="lineEdit"/> <widget class="QLabel" name="label_9">
<property name="text">
<string>*请填数字,最多保留两位小数</string>
</property>
</widget>
</item> </item>
<item row="1" column="2"> <item row="1" column="2">
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
...@@ -103,39 +170,69 @@ ...@@ -103,39 +170,69 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="2" column="0"> <item row="0" column="1">
<widget class="QLabel" name="label_3"> <layout class="QHBoxLayout" name="horizontalLayout" stretch="1,1">
<item>
<widget class="QComboBox" name="comboBox">
<property name="enabled">
<bool>true</bool>
</property>
<property name="editable">
<bool>false</bool>
</property>
<item>
<property name="text"> <property name="text">
<string>起始时间:</string> <string>字幕</string>
</property> </property>
</widget>
</item> </item>
<item row="2" column="1"> <item>
<widget class="QLineEdit" name="lineEdit_2"/>
</item>
<item row="2" column="2">
<widget class="QLabel" name="label_8">
<property name="text"> <property name="text">
<string>*请填数字,最多保留两位小数</string> <string>旁白</string>
</property> </property>
</item>
</widget> </widget>
</item> </item>
<item row="3" column="0"> <item>
<widget class="QLabel" name="label_4"> <spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_6">
<property name="text"> <property name="text">
<string>结束时间</string> <string>推荐字数</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="1"> <item row="6" column="1">
<widget class="QLineEdit" name="lineEdit_3"> <widget class="QLineEdit" name="lineEdit_6">
<property name="enabled"> <property name="enabled">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="2"> <item row="2" column="1">
<widget class="QLabel" name="label_9"> <widget class="QLineEdit" name="lineEdit_2"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>起始时间:</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QLabel" name="label_8">
<property name="text"> <property name="text">
<string>*请填数字,最多保留两位小数</string> <string>*请填数字,最多保留两位小数</string>
</property> </property>
...@@ -148,13 +245,6 @@ ...@@ -148,13 +245,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="1">
<widget class="QLineEdit" name="lineEdit_4">
<property name="enabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="2"> <item row="4" column="2">
<widget class="QLabel" name="label_10"> <widget class="QLabel" name="label_10">
<property name="text"> <property name="text">
...@@ -162,10 +252,10 @@ ...@@ -162,10 +252,10 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="0"> <item row="4" column="1">
<widget class="QLabel" name="label_6"> <widget class="QLineEdit" name="lineEdit_4">
<property name="text"> <property name="enabled">
<string>推荐字数:</string> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
...@@ -176,124 +266,48 @@ ...@@ -176,124 +266,48 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="2"> <item row="1" column="0">
<widget class="QLabel" name="label_12"> <widget class="QLabel" name="label">
<property name="text">
<string>*请填数字,必须是不超过100的正整数</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_7">
<property name="text"> <property name="text">
<string>旁白:</string> <string>我想操作第</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QLineEdit" name="lineEdit_6">
<property name="enabled">
<bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="2"> <item row="1" column="1">
<widget class="QLabel" name="label_11"> <widget class="QLineEdit" name="lineEdit"/>
<property name="text">
<string>*请填文字</string>
</property>
</widget>
</item> </item>
<item row="6" column="3"> <item row="3" column="0">
<widget class="QLabel" name="label_14"> <widget class="QLabel" name="label_4">
<property name="text"> <property name="text">
<string>语速</string> <string>结束时间</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="4"> <item row="3" column="1">
<widget class="QComboBox" name="comboBox_3"> <widget class="QLineEdit" name="lineEdit_3">
<property name="enabled"> <property name="enabled">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="editable">
<bool>false</bool>
</property>
</widget>
</item>
<item row="8" column="4">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string/>
</property>
<property name="toolTipDuration">
<number>-1</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Ok</set>
</property>
<property name="centerButtons">
<bool>false</bool>
</property>
</widget> </widget>
</item> </item>
<item row="8" column="1" colspan="2"> <item row="6" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="1,1,1"> <widget class="QLabel" name="label_7">
<property name="topMargin">
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="pushButton_2">
<property name="text"> <property name="text">
<string>修改</string> <string>旁白:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="2" column="3">
<spacer name="horizontalSpacer"> <widget class="QPushButton" name="pickStartPos">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton">
<property name="text"> <property name="text">
<string>检测</string> <string>取当前位置</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout> <item row="3" column="3">
</item> <widget class="QPushButton" name="pickEndPos">
<item row="1" column="3" colspan="2">
<widget class="QPushButton" name="pushButton_3">
<property name="text"> <property name="text">
<string>填充 <string>取当前位置</string>
行信息</string>
</property> </property>
</widget> </widget>
</item> </item>
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'd:\AddCaption\cur_version\accessibility_movie_2\operation_dialog.ui' # Form implementation generated from reading ui file 'operation_dialog.ui'
# #
# Created by: PyQt5 UI code generator 5.15.4 # Created by: PyQt5 UI code generator 5.12
# #
# WARNING: Any manual changes made to this file will be lost when pyuic5 is # WARNING! All changes made in this file will be lost!
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5 import QtCore, QtGui, QtWidgets
...@@ -14,35 +12,65 @@ from PyQt5 import QtCore, QtGui, QtWidgets ...@@ -14,35 +12,65 @@ from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object): class Ui_Dialog(object):
def setupUi(self, Dialog): def setupUi(self, Dialog):
Dialog.setObjectName("Dialog") Dialog.setObjectName("Dialog")
Dialog.resize(734, 437) Dialog.resize(711, 502)
self.gridLayout = QtWidgets.QGridLayout(Dialog) self.gridLayout = QtWidgets.QGridLayout(Dialog)
self.gridLayout.setObjectName("gridLayout") self.gridLayout.setObjectName("gridLayout")
self.horizontalLayout = QtWidgets.QHBoxLayout() self.pushButton_3 = QtWidgets.QPushButton(Dialog)
self.horizontalLayout.setObjectName("horizontalLayout") self.pushButton_3.setObjectName("pushButton_3")
self.comboBox = QtWidgets.QComboBox(Dialog) self.gridLayout.addWidget(self.pushButton_3, 1, 3, 1, 2)
self.comboBox.setEnabled(True) self.comboBox_3 = QtWidgets.QComboBox(Dialog)
self.comboBox.setEditable(False) self.comboBox_3.setEnabled(True)
self.comboBox.setObjectName("comboBox") self.comboBox_3.setEditable(False)
self.comboBox.addItem("") self.comboBox_3.setObjectName("comboBox_3")
self.comboBox.addItem("") self.gridLayout.addWidget(self.comboBox_3, 6, 4, 1, 1)
self.horizontalLayout.addWidget(self.comboBox) self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
self.buttonBox.setEnabled(False)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.buttonBox.sizePolicy().hasHeightForWidth())
self.buttonBox.setSizePolicy(sizePolicy)
self.buttonBox.setMinimumSize(QtCore.QSize(0, 0))
self.buttonBox.setToolTip("")
self.buttonBox.setToolTipDuration(-1)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Ok)
self.buttonBox.setCenterButtons(False)
self.buttonBox.setObjectName("buttonBox")
self.gridLayout.addWidget(self.buttonBox, 8, 4, 1, 1)
self.label_14 = QtWidgets.QLabel(Dialog)
self.label_14.setObjectName("label_14")
self.gridLayout.addWidget(self.label_14, 6, 3, 1, 1)
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setContentsMargins(-1, 0, -1, -1)
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.pushButton_2 = QtWidgets.QPushButton(Dialog)
self.pushButton_2.setObjectName("pushButton_2")
self.horizontalLayout_2.addWidget(self.pushButton_2)
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem) self.horizontalLayout_2.addItem(spacerItem)
self.horizontalLayout.setStretch(0, 1) self.pushButton = QtWidgets.QPushButton(Dialog)
self.horizontalLayout.setStretch(1, 1) self.pushButton.setObjectName("pushButton")
self.gridLayout.addLayout(self.horizontalLayout, 0, 1, 1, 1) self.horizontalLayout_2.addWidget(self.pushButton)
self.horizontalLayout_2.setStretch(0, 1)
self.horizontalLayout_2.setStretch(1, 1)
self.horizontalLayout_2.setStretch(2, 1)
self.gridLayout.addLayout(self.horizontalLayout_2, 8, 1, 1, 2)
self.label_11 = QtWidgets.QLabel(Dialog)
self.label_11.setObjectName("label_11")
self.gridLayout.addWidget(self.label_11, 6, 2, 1, 1)
self.comboBox_2 = QtWidgets.QComboBox(Dialog) self.comboBox_2 = QtWidgets.QComboBox(Dialog)
self.comboBox_2.setObjectName("comboBox_2") self.comboBox_2.setObjectName("comboBox_2")
self.comboBox_2.addItem("") self.comboBox_2.addItem("")
self.comboBox_2.addItem("") self.comboBox_2.addItem("")
self.comboBox_2.addItem("") self.comboBox_2.addItem("")
self.gridLayout.addWidget(self.comboBox_2, 0, 2, 1, 1) self.gridLayout.addWidget(self.comboBox_2, 0, 2, 1, 1)
self.label = QtWidgets.QLabel(Dialog) self.label_12 = QtWidgets.QLabel(Dialog)
self.label.setObjectName("label") self.label_12.setObjectName("label_12")
self.gridLayout.addWidget(self.label, 1, 0, 1, 1) self.gridLayout.addWidget(self.label_12, 5, 2, 1, 1)
self.lineEdit = QtWidgets.QLineEdit(Dialog) self.label_9 = QtWidgets.QLabel(Dialog)
self.lineEdit.setObjectName("lineEdit") self.label_9.setObjectName("label_9")
self.gridLayout.addWidget(self.lineEdit, 1, 1, 1, 1) self.gridLayout.addWidget(self.label_9, 3, 2, 1, 1)
self.verticalLayout = QtWidgets.QVBoxLayout() self.verticalLayout = QtWidgets.QVBoxLayout()
self.verticalLayout.setObjectName("verticalLayout") self.verticalLayout.setObjectName("verticalLayout")
self.label_2 = QtWidgets.QLabel(Dialog) self.label_2 = QtWidgets.QLabel(Dialog)
...@@ -55,97 +83,72 @@ class Ui_Dialog(object): ...@@ -55,97 +83,72 @@ class Ui_Dialog(object):
self.label_13.setObjectName("label_13") self.label_13.setObjectName("label_13")
self.verticalLayout.addWidget(self.label_13) self.verticalLayout.addWidget(self.label_13)
self.gridLayout.addLayout(self.verticalLayout, 1, 2, 1, 1) self.gridLayout.addLayout(self.verticalLayout, 1, 2, 1, 1)
self.label_3 = QtWidgets.QLabel(Dialog) self.horizontalLayout = QtWidgets.QHBoxLayout()
self.label_3.setObjectName("label_3") self.horizontalLayout.setObjectName("horizontalLayout")
self.gridLayout.addWidget(self.label_3, 2, 0, 1, 1) self.comboBox = QtWidgets.QComboBox(Dialog)
self.comboBox.setEnabled(True)
self.comboBox.setEditable(False)
self.comboBox.setObjectName("comboBox")
self.comboBox.addItem("")
self.comboBox.addItem("")
self.horizontalLayout.addWidget(self.comboBox)
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem1)
self.horizontalLayout.setStretch(0, 1)
self.horizontalLayout.setStretch(1, 1)
self.gridLayout.addLayout(self.horizontalLayout, 0, 1, 1, 1)
self.label_6 = QtWidgets.QLabel(Dialog)
self.label_6.setObjectName("label_6")
self.gridLayout.addWidget(self.label_6, 5, 0, 1, 1)
self.lineEdit_6 = QtWidgets.QLineEdit(Dialog)
self.lineEdit_6.setEnabled(True)
self.lineEdit_6.setObjectName("lineEdit_6")
self.gridLayout.addWidget(self.lineEdit_6, 6, 1, 1, 1)
self.lineEdit_2 = QtWidgets.QLineEdit(Dialog) self.lineEdit_2 = QtWidgets.QLineEdit(Dialog)
self.lineEdit_2.setObjectName("lineEdit_2") self.lineEdit_2.setObjectName("lineEdit_2")
self.gridLayout.addWidget(self.lineEdit_2, 2, 1, 1, 1) self.gridLayout.addWidget(self.lineEdit_2, 2, 1, 1, 1)
self.label_3 = QtWidgets.QLabel(Dialog)
self.label_3.setObjectName("label_3")
self.gridLayout.addWidget(self.label_3, 2, 0, 1, 1)
self.label_8 = QtWidgets.QLabel(Dialog) self.label_8 = QtWidgets.QLabel(Dialog)
self.label_8.setObjectName("label_8") self.label_8.setObjectName("label_8")
self.gridLayout.addWidget(self.label_8, 2, 2, 1, 1) self.gridLayout.addWidget(self.label_8, 2, 2, 1, 1)
self.label_4 = QtWidgets.QLabel(Dialog)
self.label_4.setObjectName("label_4")
self.gridLayout.addWidget(self.label_4, 3, 0, 1, 1)
self.lineEdit_3 = QtWidgets.QLineEdit(Dialog)
self.lineEdit_3.setEnabled(True)
self.lineEdit_3.setObjectName("lineEdit_3")
self.gridLayout.addWidget(self.lineEdit_3, 3, 1, 1, 1)
self.label_9 = QtWidgets.QLabel(Dialog)
self.label_9.setObjectName("label_9")
self.gridLayout.addWidget(self.label_9, 3, 2, 1, 1)
self.label_5 = QtWidgets.QLabel(Dialog) self.label_5 = QtWidgets.QLabel(Dialog)
self.label_5.setObjectName("label_5") self.label_5.setObjectName("label_5")
self.gridLayout.addWidget(self.label_5, 4, 0, 1, 1) self.gridLayout.addWidget(self.label_5, 4, 0, 1, 1)
self.label_10 = QtWidgets.QLabel(Dialog)
self.label_10.setObjectName("label_10")
self.gridLayout.addWidget(self.label_10, 4, 2, 1, 1)
self.lineEdit_4 = QtWidgets.QLineEdit(Dialog) self.lineEdit_4 = QtWidgets.QLineEdit(Dialog)
self.lineEdit_4.setEnabled(True) self.lineEdit_4.setEnabled(True)
self.lineEdit_4.setObjectName("lineEdit_4") self.lineEdit_4.setObjectName("lineEdit_4")
self.gridLayout.addWidget(self.lineEdit_4, 4, 1, 1, 1) self.gridLayout.addWidget(self.lineEdit_4, 4, 1, 1, 1)
self.label_10 = QtWidgets.QLabel(Dialog)
self.label_10.setObjectName("label_10")
self.gridLayout.addWidget(self.label_10, 4, 2, 1, 1)
self.label_6 = QtWidgets.QLabel(Dialog)
self.label_6.setObjectName("label_6")
self.gridLayout.addWidget(self.label_6, 5, 0, 1, 1)
self.lineEdit_5 = QtWidgets.QLineEdit(Dialog) self.lineEdit_5 = QtWidgets.QLineEdit(Dialog)
self.lineEdit_5.setEnabled(True) self.lineEdit_5.setEnabled(True)
self.lineEdit_5.setObjectName("lineEdit_5") self.lineEdit_5.setObjectName("lineEdit_5")
self.gridLayout.addWidget(self.lineEdit_5, 5, 1, 1, 1) self.gridLayout.addWidget(self.lineEdit_5, 5, 1, 1, 1)
self.label_12 = QtWidgets.QLabel(Dialog) self.label = QtWidgets.QLabel(Dialog)
self.label_12.setObjectName("label_12") self.label.setObjectName("label")
self.gridLayout.addWidget(self.label_12, 5, 2, 1, 1) self.gridLayout.addWidget(self.label, 1, 0, 1, 1)
self.lineEdit = QtWidgets.QLineEdit(Dialog)
self.lineEdit.setObjectName("lineEdit")
self.gridLayout.addWidget(self.lineEdit, 1, 1, 1, 1)
self.label_4 = QtWidgets.QLabel(Dialog)
self.label_4.setObjectName("label_4")
self.gridLayout.addWidget(self.label_4, 3, 0, 1, 1)
self.lineEdit_3 = QtWidgets.QLineEdit(Dialog)
self.lineEdit_3.setEnabled(True)
self.lineEdit_3.setObjectName("lineEdit_3")
self.gridLayout.addWidget(self.lineEdit_3, 3, 1, 1, 1)
self.label_7 = QtWidgets.QLabel(Dialog) self.label_7 = QtWidgets.QLabel(Dialog)
self.label_7.setObjectName("label_7") self.label_7.setObjectName("label_7")
self.gridLayout.addWidget(self.label_7, 6, 0, 1, 1) self.gridLayout.addWidget(self.label_7, 6, 0, 1, 1)
self.lineEdit_6 = QtWidgets.QLineEdit(Dialog) self.pickStartPos = QtWidgets.QPushButton(Dialog)
self.lineEdit_6.setEnabled(True) self.pickStartPos.setObjectName("pickStartPos")
self.lineEdit_6.setObjectName("lineEdit_6") self.gridLayout.addWidget(self.pickStartPos, 2, 3, 1, 1)
self.gridLayout.addWidget(self.lineEdit_6, 6, 1, 1, 1) self.pickEndPos = QtWidgets.QPushButton(Dialog)
self.label_11 = QtWidgets.QLabel(Dialog) self.pickEndPos.setObjectName("pickEndPos")
self.label_11.setObjectName("label_11") self.gridLayout.addWidget(self.pickEndPos, 3, 3, 1, 1)
self.gridLayout.addWidget(self.label_11, 6, 2, 1, 1)
self.label_14 = QtWidgets.QLabel(Dialog)
self.label_14.setObjectName("label_14")
self.gridLayout.addWidget(self.label_14, 6, 3, 1, 1)
self.comboBox_3 = QtWidgets.QComboBox(Dialog)
self.comboBox_3.setEnabled(True)
self.comboBox_3.setEditable(False)
self.comboBox_3.setObjectName("comboBox_3")
self.gridLayout.addWidget(self.comboBox_3, 6, 4, 1, 1)
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
self.buttonBox.setEnabled(False)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.buttonBox.sizePolicy().hasHeightForWidth())
self.buttonBox.setSizePolicy(sizePolicy)
self.buttonBox.setMinimumSize(QtCore.QSize(0, 0))
self.buttonBox.setToolTip("")
self.buttonBox.setToolTipDuration(-1)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Ok)
self.buttonBox.setCenterButtons(False)
self.buttonBox.setObjectName("buttonBox")
self.gridLayout.addWidget(self.buttonBox, 8, 4, 1, 1)
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setContentsMargins(-1, 0, -1, -1)
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.pushButton_2 = QtWidgets.QPushButton(Dialog)
self.pushButton_2.setObjectName("pushButton_2")
self.horizontalLayout_2.addWidget(self.pushButton_2)
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(spacerItem1)
self.pushButton = QtWidgets.QPushButton(Dialog)
self.pushButton.setObjectName("pushButton")
self.horizontalLayout_2.addWidget(self.pushButton)
self.horizontalLayout_2.setStretch(0, 1)
self.horizontalLayout_2.setStretch(1, 1)
self.horizontalLayout_2.setStretch(2, 1)
self.gridLayout.addLayout(self.horizontalLayout_2, 8, 1, 1, 2)
self.pushButton_3 = QtWidgets.QPushButton(Dialog)
self.pushButton_3.setObjectName("pushButton_3")
self.gridLayout.addWidget(self.pushButton_3, 1, 3, 1, 2)
self.gridLayout.setColumnStretch(1, 1)
self.retranslateUi(Dialog) self.retranslateUi(Dialog)
QtCore.QMetaObject.connectSlotsByName(Dialog) QtCore.QMetaObject.connectSlotsByName(Dialog)
...@@ -153,25 +156,30 @@ class Ui_Dialog(object): ...@@ -153,25 +156,30 @@ class Ui_Dialog(object):
def retranslateUi(self, Dialog): def retranslateUi(self, Dialog):
_translate = QtCore.QCoreApplication.translate _translate = QtCore.QCoreApplication.translate
Dialog.setWindowTitle(_translate("Dialog", "Dialog")) Dialog.setWindowTitle(_translate("Dialog", "Dialog"))
self.comboBox.setItemText(0, _translate("Dialog", "字幕")) self.pushButton_3.setText(_translate("Dialog", "填充\n"
self.comboBox.setItemText(1, _translate("Dialog", "旁白")) "行信息"))
self.label_14.setText(_translate("Dialog", "语速:"))
self.pushButton_2.setText(_translate("Dialog", "修改"))
self.pushButton.setText(_translate("Dialog", "检测"))
self.label_11.setText(_translate("Dialog", "*请填文字"))
self.comboBox_2.setItemText(0, _translate("Dialog", "增加一行")) self.comboBox_2.setItemText(0, _translate("Dialog", "增加一行"))
self.comboBox_2.setItemText(1, _translate("Dialog", "修改一行")) self.comboBox_2.setItemText(1, _translate("Dialog", "修改一行"))
self.comboBox_2.setItemText(2, _translate("Dialog", "删除一行")) self.comboBox_2.setItemText(2, _translate("Dialog", "删除一行"))
self.label.setText(_translate("Dialog", "我想操作第")) self.label_12.setText(_translate("Dialog", "*请填数字,必须是不超过100的正整数"))
self.label_9.setText(_translate("Dialog", "*请填数字,最多保留两位小数"))
self.label_2.setText(_translate("Dialog", "行(如果操作是增加,则在该行后面增加)")) self.label_2.setText(_translate("Dialog", "行(如果操作是增加,则在该行后面增加)"))
self.label_13.setText(_translate("Dialog", "*需要填在【字幕旁白】页面中的行数")) self.label_13.setText(_translate("Dialog", "*需要填在【字幕旁白】页面中的行数"))
self.comboBox.setItemText(0, _translate("Dialog", "字幕"))
self.comboBox.setItemText(1, _translate("Dialog", "旁白"))
self.label_6.setText(_translate("Dialog", "推荐字数:"))
self.label_3.setText(_translate("Dialog", "起始时间:")) self.label_3.setText(_translate("Dialog", "起始时间:"))
self.label_8.setText(_translate("Dialog", "*请填数字,最多保留两位小数")) self.label_8.setText(_translate("Dialog", "*请填数字,最多保留两位小数"))
self.label_4.setText(_translate("Dialog", "结束时间:"))
self.label_9.setText(_translate("Dialog", "*请填数字,最多保留两位小数"))
self.label_5.setText(_translate("Dialog", "字幕:")) self.label_5.setText(_translate("Dialog", "字幕:"))
self.label_10.setText(_translate("Dialog", "*请填文字")) self.label_10.setText(_translate("Dialog", "*请填文字"))
self.label_6.setText(_translate("Dialog", "推荐字数:")) self.label.setText(_translate("Dialog", "我想操作第"))
self.label_12.setText(_translate("Dialog", "*请填数字")) self.label_4.setText(_translate("Dialog", "结束时间:"))
self.label_7.setText(_translate("Dialog", "旁白:")) self.label_7.setText(_translate("Dialog", "旁白:"))
self.label_11.setText(_translate("Dialog", "*请填文字")) self.pickStartPos.setText(_translate("Dialog", "取当前位置"))
self.label_14.setText(_translate("Dialog", "语速:")) self.pickEndPos.setText(_translate("Dialog", "取当前位置"))
self.pushButton_2.setText(_translate("Dialog", "修改"))
self.pushButton.setText(_translate("Dialog", "检测"))
self.pushButton_3.setText(_translate("Dialog", "填充\n行信息"))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment