提交关于菜单页

This commit is contained in:
halliday2023 2024-02-25 18:08:49 +08:00
parent 8596551899
commit 526f2891be
1 changed files with 18 additions and 9 deletions

View File

@ -9,7 +9,7 @@ from pathlib import Path
from PySide6.QtUiTools import QUiLoader
from PySide6.QtCore import Signal, QThread, QObject, QEventLoop, QTimer
from PySide6.QtWidgets import QApplication,QFileDialog
from PySide6.QtWidgets import QApplication, QFileDialog, QMessageBox
from PySide6.QtGui import QTextCursor
# 声明全局变量
@ -65,6 +65,7 @@ class Window:
self.ui.stopButton.clicked.connect(self.stop)
self.ui.conn_Button.clicked.connect(self.conntest)
self.ui.choosedir_Button.clicked.connect(self.choosedir)
self.ui.actionabout.triggered.connect(self.about)
self.setup_thread()
@ -111,11 +112,10 @@ class Window:
else:
fileDataCreating.new()
self.ui.startButton.setEnabled(True)
self.logger.info("*"*5 + "一次性任务执行完成" + "*"*5 )
self.logger.info("*"*5 + "一次性任务执行完成" + "*"*5)
else:
self.conntest()
self.start_run_db()
self.start_run_db()
def stop(self):
self.logger.info("点击了停止按钮")
@ -136,11 +136,11 @@ class Window:
def choosedir(self):
self.logger.info("点击了选择目录按钮")
dir_path = QFileDialog.getExistingDirectory(self.ui, "选择目录", "", QFileDialog.ShowDirsOnly)
dir_path = QFileDialog.getExistingDirectory(
self.ui, "选择目录", "", QFileDialog.ShowDirsOnly)
self.ui.fileOutputText.setText(dir_path)
self.logger.info("已经选择文件夹:{}".format(dir_path))
def setup_thread(self):
self.thread = FileThread()
global_var.set_value('start_flag', True)
@ -153,7 +153,7 @@ class Window:
self.setup_thread()
self.thread.start()
def check_common(self,elemnet):
def check_common(self, elemnet):
# 为空标红处理
elemnet.setStyleSheet("")
if not elemnet.text():
@ -163,7 +163,6 @@ class Window:
return elemnet.text()
def check_file_input(self):
self.check_flag = True
# 获取界面输入
@ -174,7 +173,8 @@ class Window:
# 是否持续
file_dict['filecreating'] = self.ui.checkBox.isChecked()
if file_dict['filecreating']:
file_dict['fileinsert'] = self.check_common(self.ui.fileInsertRowsText)
file_dict['fileinsert'] = self.check_common(
self.ui.fileInsertRowsText)
file_dict['filedel'] = self.check_common(self.ui.fileDelRowsText)
# 将值放到全局变量中
global_var.set_value('file_args', file_dict)
@ -201,3 +201,12 @@ class Window:
def stop_run_db(self):
pass
def about(self):
msg = "版本: <a>v1.0.0</a><br>\
项目地址: <a href='https://gitea.kiki.kim/ha/dataCreatingGUI'>https://gitea.kiki.kim/ha/dataCreatingGUI</a><br>\
E-mail: <a href='mailto:halliday2023@163.com'>halliday2023@163.com</a>"
QMessageBox.about(
self.ui,
'关于',
msg)