Skip to content

Commit

Permalink
GUI增加按键映射配置板块;修改相似度配置项为字符串类型
Browse files Browse the repository at this point in the history
  • Loading branch information
Ikaros-521 committed Oct 15, 2023
1 parent 2527e1f commit b2ab119
Show file tree
Hide file tree
Showing 6 changed files with 189 additions and 41 deletions.
55 changes: 43 additions & 12 deletions UI_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
Expand Down
23 changes: 12 additions & 11 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"schedule": true,
"database": true,
"play_audio": true,
"web_captions_printer": true
"web_captions_printer": true,
"key_mapping": true
},
"bilibili": {
"login_type": "手机扫码",
Expand Down Expand Up @@ -533,7 +534,7 @@
"ctrlleft",
"1"
],
"similarity": 1
"similarity": "1"
},
{
"keywords": [
Expand All @@ -542,7 +543,7 @@
"keys": [
"2"
],
"similarity": 1
"similarity": "1"
},
{
"keywords": [
Expand All @@ -551,7 +552,7 @@
"keys": [
"3"
],
"similarity": 1
"similarity": "1"
},
{
"keywords": [
Expand All @@ -560,7 +561,7 @@
"keys": [
"4"
],
"similarity": 1
"similarity": "1"
},
{
"keywords": [
Expand All @@ -569,7 +570,7 @@
"keys": [
"5"
],
"similarity": 1
"similarity": "1"
},
{
"keywords": [
Expand All @@ -578,7 +579,7 @@
"keys": [
"6"
],
"similarity": 1
"similarity": "1"
},
{
"keywords": [
Expand All @@ -587,7 +588,7 @@
"keys": [
"7"
],
"similarity": 1
"similarity": "1"
},
{
"keywords": [
Expand All @@ -596,7 +597,7 @@
"keys": [
"8"
],
"similarity": 1
"similarity": "1"
},
{
"keywords": [
Expand All @@ -605,7 +606,7 @@
"keys": [
"9"
],
"similarity": 1
"similarity": "1"
},
{
"keywords": [
Expand All @@ -614,7 +615,7 @@
"keys": [
"0"
],
"similarity": 1
"similarity": "1"
}
]
}
Expand Down
24 changes: 13 additions & 11 deletions config.json.bak
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"schedule": true,
"database": true,
"play_audio": true,
"web_captions_printer": true
"web_captions_printer": true,
"key_mapping": true
},
"bilibili": {
"login_type": "手机扫码",
Expand Down Expand Up @@ -530,9 +531,10 @@
"动作1"
],
"keys": [
"ctrlleft",
"1"
],
"similarity": 1
"similarity": "1"
},
{
"keywords": [
Expand All @@ -541,7 +543,7 @@
"keys": [
"2"
],
"similarity": 1
"similarity": "1"
},
{
"keywords": [
Expand All @@ -550,7 +552,7 @@
"keys": [
"3"
],
"similarity": 1
"similarity": "1"
},
{
"keywords": [
Expand All @@ -559,7 +561,7 @@
"keys": [
"4"
],
"similarity": 1
"similarity": "1"
},
{
"keywords": [
Expand All @@ -568,7 +570,7 @@
"keys": [
"5"
],
"similarity": 1
"similarity": "1"
},
{
"keywords": [
Expand All @@ -577,7 +579,7 @@
"keys": [
"6"
],
"similarity": 1
"similarity": "1"
},
{
"keywords": [
Expand All @@ -586,7 +588,7 @@
"keys": [
"7"
],
"similarity": 1
"similarity": "1"
},
{
"keywords": [
Expand All @@ -595,7 +597,7 @@
"keys": [
"8"
],
"similarity": 1
"similarity": "1"
},
{
"keywords": [
Expand All @@ -604,7 +606,7 @@
"keys": [
"9"
],
"similarity": 1
"similarity": "1"
},
{
"keywords": [
Expand All @@ -613,7 +615,7 @@
"keys": [
"0"
],
"similarity": 1
"similarity": "1"
}
]
}
Expand Down
Loading

0 comments on commit b2ab119

Please sign in to comment.