-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.py
55 lines (40 loc) · 1.32 KB
/
functions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import os
import sys
from PyQt5.QtWidgets import *
def MainProcessGuide(path):
if not os.path.exists(path):
RaiseWarning("路径错误")
return
if not GetConfirm("数据无价,请先做好备份工作"):
RaiseMessage("清理已终止")
return
from classes import ProcessModule
MainProcess = ProcessModule(path)
MainProcess.exec_()
def BrowseDialog(PathEdit):
FilePath = QFileDialog.getExistingDirectory()
FilePath = os.path.abspath(FilePath)
PathEdit.setText(FilePath)
def RaiseWarning(info):
MessageBox = QMessageBox()
MessageBox.setIcon(QMessageBox.Warning)
MessageBox.setText(info)
MessageBox.setWindowTitle("Warning")
MessageBox.exec_()
def RaiseMessage(info):
MessageBox = QMessageBox()
MessageBox.setIcon(QMessageBox.Information)
MessageBox.setText(info)
MessageBox.setWindowTitle("Message")
MessageBox.exec_()
def GetConfirm(info):
MessageBox = QMessageBox()
MessageBox.setIcon(QMessageBox.Question)
MessageBox.setText(info)
MessageBox.setStandardButtons(QMessageBox.Ok | QMessageBox.Cancel)
MessageBox.setWindowTitle("Please Confirm")
return MessageBox.exec_() == QMessageBox.Ok
def AboutThisProject():
from classes import AboutPage
AboutPageDialog = AboutPage()
AboutPageDialog.exec_()