-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUI.py
More file actions
188 lines (181 loc) · 13.5 KB
/
UI.py
File metadata and controls
188 lines (181 loc) · 13.5 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'UI.ui'
#
# Created by: PyQt5 UI code generator 5.13.0
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.setEnabled(True)
MainWindow.resize(600, 500)
MainWindow.setMinimumSize(QtCore.QSize(600, 500))
MainWindow.setMaximumSize(QtCore.QSize(600, 500))
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.centralwidget)
self.verticalLayout_2.setObjectName("verticalLayout_2")
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout_2.addItem(spacerItem)
self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_3.addItem(spacerItem1)
self.filePathEdit = QtWidgets.QLineEdit(self.centralwidget)
self.filePathEdit.setMinimumSize(QtCore.QSize(350, 40))
self.filePathEdit.setMaximumSize(QtCore.QSize(350, 40))
font = QtGui.QFont()
font.setPointSize(12)
self.filePathEdit.setFont(font)
self.filePathEdit.setReadOnly(True)
self.filePathEdit.setObjectName("filePathEdit")
self.horizontalLayout_3.addWidget(self.filePathEdit)
spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_3.addItem(spacerItem2)
self.chooseFileButton = QtWidgets.QToolButton(self.centralwidget)
self.chooseFileButton.setMinimumSize(QtCore.QSize(20, 40))
self.chooseFileButton.setPopupMode(QtWidgets.QToolButton.DelayedPopup)
self.chooseFileButton.setAutoRaise(False)
self.chooseFileButton.setObjectName("chooseFileButton")
self.horizontalLayout_3.addWidget(self.chooseFileButton)
spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_3.addItem(spacerItem3)
self.horizontalLayout_3.setStretch(0, 1)
self.horizontalLayout_3.setStretch(4, 1)
self.verticalLayout_2.addLayout(self.horizontalLayout_3)
spacerItem4 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout_2.addItem(spacerItem4)
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
self.resultText = QtWidgets.QTextBrowser(self.centralwidget)
font = QtGui.QFont()
font.setPointSize(12)
self.resultText.setFont(font)
self.resultText.setObjectName("resultText")
self.horizontalLayout.addWidget(self.resultText)
self.verticalLayout = QtWidgets.QVBoxLayout()
self.verticalLayout.setObjectName("verticalLayout")
self.languageLabel = QtWidgets.QLabel(self.centralwidget)
self.languageLabel.setLayoutDirection(QtCore.Qt.LeftToRight)
self.languageLabel.setAutoFillBackground(False)
self.languageLabel.setTextFormat(QtCore.Qt.AutoText)
self.languageLabel.setAlignment(QtCore.Qt.AlignCenter)
self.languageLabel.setObjectName("languageLabel")
self.verticalLayout.addWidget(self.languageLabel)
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
spacerItem5 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(spacerItem5)
self.languageComboBox = QtWidgets.QComboBox(self.centralwidget)
self.languageComboBox.setMinimumSize(QtCore.QSize(100, 30))
self.languageComboBox.setMaximumSize(QtCore.QSize(100, 30))
font = QtGui.QFont()
font.setPointSize(12)
self.languageComboBox.setFont(font)
self.languageComboBox.setObjectName("languageComboBox")
self.languageComboBox.addItem("")
self.languageComboBox.addItem("")
self.languageComboBox.addItem("")
self.languageComboBox.addItem("")
self.languageComboBox.addItem("")
self.languageComboBox.addItem("")
self.languageComboBox.addItem("")
self.languageComboBox.addItem("")
self.languageComboBox.addItem("")
self.horizontalLayout_2.addWidget(self.languageComboBox)
spacerItem6 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(spacerItem6)
self.verticalLayout.addLayout(self.horizontalLayout_2)
self.limitLabel = QtWidgets.QLabel(self.centralwidget)
self.limitLabel.setAlignment(QtCore.Qt.AlignCenter)
self.limitLabel.setObjectName("limitLabel")
self.verticalLayout.addWidget(self.limitLabel)
self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
spacerItem7 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_4.addItem(spacerItem7)
self.limitSpinBox = QtWidgets.QSpinBox(self.centralwidget)
self.limitSpinBox.setMinimumSize(QtCore.QSize(50, 25))
self.limitSpinBox.setMaximumSize(QtCore.QSize(50, 25))
font = QtGui.QFont()
font.setPointSize(12)
self.limitSpinBox.setFont(font)
self.limitSpinBox.setAlignment(QtCore.Qt.AlignCenter)
self.limitSpinBox.setMinimum(1)
self.limitSpinBox.setProperty("value", 50)
self.limitSpinBox.setObjectName("limitSpinBox")
self.horizontalLayout_4.addWidget(self.limitSpinBox)
spacerItem8 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.horizontalLayout_4.addItem(spacerItem8)
self.verticalLayout.addLayout(self.horizontalLayout_4)
self.changeNameButton = QtWidgets.QPushButton(self.centralwidget)
self.changeNameButton.setEnabled(False)
self.changeNameButton.setMinimumSize(QtCore.QSize(150, 40))
self.changeNameButton.setMaximumSize(QtCore.QSize(150, 40))
self.changeNameButton.setObjectName("changeNameButton")
self.verticalLayout.addWidget(self.changeNameButton)
self.startButton = QtWidgets.QPushButton(self.centralwidget)
self.startButton.setEnabled(False)
self.startButton.setMinimumSize(QtCore.QSize(150, 40))
self.startButton.setMaximumSize(QtCore.QSize(150, 40))
self.startButton.setObjectName("startButton")
self.verticalLayout.addWidget(self.startButton)
spacerItem9 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout.addItem(spacerItem9)
self.horizontalLayout.addLayout(self.verticalLayout)
self.horizontalLayout.setStretch(0, 10)
self.horizontalLayout.setStretch(1, 1)
self.verticalLayout_2.addLayout(self.horizontalLayout)
self.verticalLayout_2.setStretch(0, 1)
self.verticalLayout_2.setStretch(1, 2)
self.verticalLayout_2.setStretch(2, 1)
self.verticalLayout_2.setStretch(3, 20)
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 600, 26))
self.menubar.setObjectName("menubar")
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)
self.retranslateUi(MainWindow)
self.chooseFileButton.clicked.connect(MainWindow.getExistingDirectory)
self.changeNameButton.clicked.connect(MainWindow.changeFilesName)
self.startButton.clicked.connect(MainWindow.startRunSIM)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "代码查重软件"))
self.filePathEdit.setText(_translate("MainWindow", "请选择文件路径"))
self.chooseFileButton.setText(_translate("MainWindow", "打开文件夹"))
self.resultText.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"
"</style></head><body style=\" font-family:\'SimSun\'; font-size:12pt; font-weight:400; font-style:normal;\">\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'-apple-system\'; color:#24292e; background-color:#ffffff;\">本软件为SIM的GUI程序。</span></p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'-apple-system\'; color:#24292e; background-color:#ffffff;\">SIM是Dick Grune开发的一款代码查重软件</span></p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'-apple-system\'; color:#24292e; background-color:#ffffff;\">软件使用说明如下:</span></p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'-apple-system\'; color:#24292e; background-color:#ffffff;\">1.把需要查重的代码放到同一个文件夹目录下。(只包含需要查重的代码文件,文件夹目录不包含中文)</span></p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'-apple-system\'; color:#24292e; background-color:#ffffff;\">注:SIM只支持单语言,单文件查重。</span></p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'-apple-system\'; color:#24292e; background-color:#ffffff;\">2.选择文件夹路径。</span></p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'-apple-system\'; color:#24292e; background-color:#ffffff;\">3.软件不支持中文文件名,点击按钮即可自动把文件名中的中文字符更改成对应拼音(请保证更名之后不会出现同名文件!)。</span></p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'-apple-system\'; color:#24292e; background-color:#ffffff;\">4.选择待查重代码的语言</span></p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'-apple-system\'; color:#24292e; background-color:#ffffff;\">5.点击进行查重</span></p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'-apple-system\'; color:#24292e; background-color:#ffffff;\">6.查重结果以文本文件的形式保存在所选择的目录下。</span></p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'-apple-system\'; color:#24292e; background-color:#ffffff;\">sim_res.txt 保存大致结果,sim_res_all.txt 保存详细结果</span></p>\n"
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:\'-apple-system\'; color:#24292e;\"><br /></p>\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'-apple-system\'; color:#24292e;\">Made by ZXF</span></p></body></html>"))
self.languageLabel.setText(_translate("MainWindow", "选择待查重程序语言"))
self.languageComboBox.setItemText(0, _translate("MainWindow", "C"))
self.languageComboBox.setItemText(1, _translate("MainWindow", "C++"))
self.languageComboBox.setItemText(2, _translate("MainWindow", "Java"))
self.languageComboBox.setItemText(3, _translate("MainWindow", "lisp"))
self.languageComboBox.setItemText(4, _translate("MainWindow", "m2"))
self.languageComboBox.setItemText(5, _translate("MainWindow", "mira"))
self.languageComboBox.setItemText(6, _translate("MainWindow", "pasc"))
self.languageComboBox.setItemText(7, _translate("MainWindow", "8086"))
self.languageComboBox.setItemText(8, _translate("MainWindow", "Text"))
self.limitLabel.setText(_translate("MainWindow", "选择查重阙值"))
self.changeNameButton.setText(_translate("MainWindow", "点击更改文件名"))
self.startButton.setText(_translate("MainWindow", "点击查重"))