From b2ab119c9ac21c943e019d74b72314a50f9d7649 Mon Sep 17 00:00:00 2001 From: ikaros <327209194@qq.com> Date: Sun, 15 Oct 2023 15:54:31 +0800 Subject: [PATCH] =?UTF-8?q?GUI=E5=A2=9E=E5=8A=A0=E6=8C=89=E9=94=AE?= =?UTF-8?q?=E6=98=A0=E5=B0=84=E9=85=8D=E7=BD=AE=E6=9D=BF=E5=9D=97=EF=BC=9B?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=9B=B8=E4=BC=BC=E5=BA=A6=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E9=A1=B9=E4=B8=BA=E5=AD=97=E7=AC=A6=E4=B8=B2=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- UI_main.py | 55 +++++++++++++++++++++++++++++++--------- config.json | 23 +++++++++-------- config.json.bak | 24 ++++++++++-------- main.py | 63 +++++++++++++++++++++++++++++++++++++++++++++- ui/main.ui | 63 ++++++++++++++++++++++++++++++++++++++++++---- utils/my_handle.py | 2 +- 6 files changed, 189 insertions(+), 41 deletions(-) diff --git a/UI_main.py b/UI_main.py index 11671cb4..90d4938f 100644 --- a/UI_main.py +++ b/UI_main.py @@ -86,7 +86,7 @@ def setupUi(self, MainWindow): self.scrollArea.setWidgetResizable(True) self.scrollArea.setObjectName("scrollArea") self.scrollAreaWidgetContents = QtWidgets.QWidget() - self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 991, 10555)) + self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, -9992, 991, 10717)) self.scrollAreaWidgetContents.setObjectName("scrollAreaWidgetContents") self.verticalLayout = QtWidgets.QVBoxLayout(self.scrollAreaWidgetContents) self.verticalLayout.setContentsMargins(35, 20, 35, 20) @@ -1682,14 +1682,41 @@ def setupUi(self, MainWindow): self.groupBox_database.setObjectName("groupBox_database") self.gridLayout_67 = QtWidgets.QGridLayout(self.groupBox_database) self.gridLayout_67.setObjectName("gridLayout_67") - spacerItem36 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_67.addItem(spacerItem36, 0, 1, 1, 1) self.gridLayout_database = QtWidgets.QGridLayout() self.gridLayout_database.setObjectName("gridLayout_database") self.gridLayout_67.addLayout(self.gridLayout_database, 0, 0, 1, 1) + spacerItem36 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.gridLayout_67.addItem(spacerItem36, 0, 1, 1, 1) self.gridLayout_67.setColumnStretch(0, 9) self.gridLayout_67.setColumnStretch(1, 1) self.verticalLayout.addWidget(self.groupBox_database) + self.groupBox_key_mapping = QtWidgets.QGroupBox(self.scrollAreaWidgetContents) + self.groupBox_key_mapping.setObjectName("groupBox_key_mapping") + self.gridLayout_90 = QtWidgets.QGridLayout(self.groupBox_key_mapping) + self.gridLayout_90.setObjectName("gridLayout_90") + spacerItem37 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.gridLayout_90.addItem(spacerItem37, 0, 1, 1, 1) + self.gridLayout_key_mapping = QtWidgets.QGridLayout() + self.gridLayout_key_mapping.setObjectName("gridLayout_key_mapping") + self.label_key_mapping_enable = QtWidgets.QLabel(self.groupBox_key_mapping) + self.label_key_mapping_enable.setObjectName("label_key_mapping_enable") + self.gridLayout_key_mapping.addWidget(self.label_key_mapping_enable, 0, 0, 1, 1) + self.checkBox_key_mapping_enable = QtWidgets.QCheckBox(self.groupBox_key_mapping) + self.checkBox_key_mapping_enable.setObjectName("checkBox_key_mapping_enable") + self.gridLayout_key_mapping.addWidget(self.checkBox_key_mapping_enable, 0, 1, 1, 1) + self.label_key_mapping_start_cmd = QtWidgets.QLabel(self.groupBox_key_mapping) + self.label_key_mapping_start_cmd.setObjectName("label_key_mapping_start_cmd") + self.gridLayout_key_mapping.addWidget(self.label_key_mapping_start_cmd, 1, 0, 1, 1) + self.lineEdit_key_mapping_start_cmd = QtWidgets.QLineEdit(self.groupBox_key_mapping) + self.lineEdit_key_mapping_start_cmd.setObjectName("lineEdit_key_mapping_start_cmd") + self.gridLayout_key_mapping.addWidget(self.lineEdit_key_mapping_start_cmd, 1, 1, 1, 1) + self.gridLayout_90.addLayout(self.gridLayout_key_mapping, 0, 0, 1, 1) + self.gridLayout_key_mapping_config = QtWidgets.QGridLayout() + self.gridLayout_key_mapping_config.setObjectName("gridLayout_key_mapping_config") + self.gridLayout_90.addLayout(self.gridLayout_key_mapping_config, 1, 0, 1, 1) + self.gridLayout_90.setColumnStretch(0, 9) + self.gridLayout_90.setColumnStretch(1, 1) + self.verticalLayout.addWidget(self.groupBox_key_mapping) self.scrollArea.setWidget(self.scrollAreaWidgetContents) self.gridLayout_21.addWidget(self.scrollArea, 0, 0, 1, 1) self.stackedWidget.addWidget(self.page) @@ -1723,8 +1750,8 @@ def setupUi(self, MainWindow): self.widget.setObjectName("widget") self.gridLayout_37 = QtWidgets.QGridLayout(self.widget) self.gridLayout_37.setObjectName("gridLayout_37") - spacerItem37 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_37.addItem(spacerItem37, 6, 0, 1, 1) + spacerItem38 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.gridLayout_37.addItem(spacerItem38, 6, 0, 1, 1) self.textEdit_copywriting_edit = QtWidgets.QTextEdit(self.widget) self.textEdit_copywriting_edit.setStyleSheet("min-height:300px;") self.textEdit_copywriting_edit.setObjectName("textEdit_copywriting_edit") @@ -1764,8 +1791,8 @@ def setupUi(self, MainWindow): "border-radius: 3px;") self.pushButton_copywriting_pause_play.setObjectName("pushButton_copywriting_pause_play") self.gridLayout_37.addWidget(self.pushButton_copywriting_pause_play, 6, 5, 1, 1) - spacerItem38 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_37.addItem(spacerItem38, 6, 1, 1, 1) + spacerItem39 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.gridLayout_37.addItem(spacerItem39, 6, 1, 1, 1) self.label_copywriting_audio_interval = QtWidgets.QLabel(self.widget) self.label_copywriting_audio_interval.setStyleSheet("") self.label_copywriting_audio_interval.setObjectName("label_copywriting_audio_interval") @@ -1827,7 +1854,7 @@ def setupUi(self, MainWindow): self.scrollArea_copywriting_config.setWidgetResizable(True) self.scrollArea_copywriting_config.setObjectName("scrollArea_copywriting_config") self.scrollAreaWidgetContents_4 = QtWidgets.QWidget() - self.scrollAreaWidgetContents_4.setGeometry(QtCore.QRect(0, 0, 359, 104)) + self.scrollAreaWidgetContents_4.setGeometry(QtCore.QRect(0, 0, 652, 498)) self.scrollAreaWidgetContents_4.setObjectName("scrollAreaWidgetContents_4") self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.scrollAreaWidgetContents_4) self.verticalLayout_4.setObjectName("verticalLayout_4") @@ -2006,8 +2033,8 @@ def setupUi(self, MainWindow): self.lineEdit_talk_baidu_secret_key.setObjectName("lineEdit_talk_baidu_secret_key") self.gridLayout_45.addWidget(self.lineEdit_talk_baidu_secret_key, 2, 1, 1, 1) self.gridLayout_40.addWidget(self.groupBox_talk_baidu, 7, 0, 1, 5) - spacerItem39 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_40.addItem(spacerItem39, 0, 5, 1, 1) + spacerItem40 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.gridLayout_40.addItem(spacerItem40, 0, 5, 1, 1) self.gridLayout_40.setRowMinimumHeight(0, 1) self.gridLayout_40.setRowMinimumHeight(1, 1) self.gridLayout_40.setRowMinimumHeight(2, 1) @@ -2133,8 +2160,8 @@ def setupUi(self, MainWindow): self.gridLayout_integral_common.setColumnStretch(1, 6) self.gridLayout_79.addLayout(self.gridLayout_integral_common, 0, 0, 1, 1) self.gridLayout_78.addWidget(self.groupBox_integral_common, 0, 0, 1, 1) - spacerItem40 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_78.addItem(spacerItem40, 0, 1, 1, 1) + spacerItem41 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.gridLayout_78.addItem(spacerItem41, 0, 1, 1, 1) self.gridLayout_78.setColumnStretch(0, 12) self.gridLayout_78.setColumnStretch(1, 1) self.verticalLayout_6.addWidget(self.widget_3) @@ -2509,6 +2536,10 @@ def retranslateUi(self, MainWindow): self.lineEdit_header_useragent.setText(_translate("MainWindow", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Edg/113.0.1774.42")) self.groupBox_web_captions_printer.setTitle(_translate("MainWindow", "web字幕打印机")) self.groupBox_database.setTitle(_translate("MainWindow", "数据库")) + self.groupBox_key_mapping.setTitle(_translate("MainWindow", "按键映射")) + self.label_key_mapping_enable.setText(_translate("MainWindow", "启用")) + self.checkBox_key_mapping_enable.setText(_translate("MainWindow", "是")) + self.label_key_mapping_start_cmd.setText(_translate("MainWindow", "命令前缀")) self.textBrowser.setHtml(_translate("MainWindow", "\n" "