forked from falseen/shadowsocks-pyqt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Ui_main.py
298 lines (290 loc) · 17.2 KB
/
Ui_main.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
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'E:\github\shadowsocks-pyqt\main.ui'
#
# Created by: PyQt5 UI code generator 5.6
#
# 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.resize(557, 426)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap("res/Shadowsocks_logo.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
MainWindow.setWindowIcon(icon)
self.centralWidget = QtWidgets.QWidget(MainWindow)
self.centralWidget.setObjectName("centralWidget")
self.gridLayoutWidget = QtWidgets.QWidget(self.centralWidget)
self.gridLayoutWidget.setGeometry(QtCore.QRect(250, 10, 291, 328))
self.gridLayoutWidget.setObjectName("gridLayoutWidget")
self.gridLayout = QtWidgets.QGridLayout(self.gridLayoutWidget)
self.gridLayout.setContentsMargins(0, 0, 0, 0)
self.gridLayout.setSpacing(6)
self.gridLayout.setObjectName("gridLayout")
self.editFrame = QtWidgets.QFrame(self.gridLayoutWidget)
self.editFrame.setEnabled(True)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.editFrame.sizePolicy().hasHeightForWidth())
self.editFrame.setSizePolicy(sizePolicy)
self.editFrame.setStyleSheet("font: 9pt \"微软雅黑\";")
self.editFrame.setFrameShape(QtWidgets.QFrame.NoFrame)
self.editFrame.setFrameShadow(QtWidgets.QFrame.Sunken)
self.editFrame.setLineWidth(1)
self.editFrame.setMidLineWidth(0)
self.editFrame.setObjectName("editFrame")
self.formLayout = QtWidgets.QFormLayout(self.editFrame)
self.formLayout.setLabelAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
self.formLayout.setObjectName("formLayout")
self.serverAddrLabel = QtWidgets.QLabel(self.editFrame)
self.serverAddrLabel.setObjectName("serverAddrLabel")
self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.serverAddrLabel)
self.serverAddrEdit = QtWidgets.QLineEdit(self.editFrame)
self.serverAddrEdit.setObjectName("serverAddrEdit")
self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.serverAddrEdit)
self.serverPortLabel = QtWidgets.QLabel(self.editFrame)
self.serverPortLabel.setObjectName("serverPortLabel")
self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.serverPortLabel)
self.serverPortSpinBox = QtWidgets.QSpinBox(self.editFrame)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.serverPortSpinBox.sizePolicy().hasHeightForWidth())
self.serverPortSpinBox.setSizePolicy(sizePolicy)
self.serverPortSpinBox.setMinimum(1)
self.serverPortSpinBox.setMaximum(65535)
self.serverPortSpinBox.setSingleStep(1)
self.serverPortSpinBox.setProperty("value", 8388)
self.serverPortSpinBox.setObjectName("serverPortSpinBox")
self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.serverPortSpinBox)
self.pwdLabel = QtWidgets.QLabel(self.editFrame)
self.pwdLabel.setObjectName("pwdLabel")
self.formLayout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.pwdLabel)
self.pwdEdit = QtWidgets.QLineEdit(self.editFrame)
font = QtGui.QFont()
font.setFamily("微软雅黑")
font.setPointSize(9)
font.setBold(False)
font.setItalic(False)
font.setWeight(50)
self.pwdEdit.setFont(font)
self.pwdEdit.setInputMethodHints(QtCore.Qt.ImhNoAutoUppercase|QtCore.Qt.ImhNoPredictiveText|QtCore.Qt.ImhSensitiveData)
self.pwdEdit.setMaxLength(32767)
self.pwdEdit.setEchoMode(QtWidgets.QLineEdit.PasswordEchoOnEdit)
self.pwdEdit.setObjectName("pwdEdit")
self.formLayout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.pwdEdit)
self.encryptLabel = QtWidgets.QLabel(self.editFrame)
self.encryptLabel.setObjectName("encryptLabel")
self.formLayout.setWidget(3, QtWidgets.QFormLayout.LabelRole, self.encryptLabel)
self.encryptComboBox = QtWidgets.QComboBox(self.editFrame)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.encryptComboBox.sizePolicy().hasHeightForWidth())
self.encryptComboBox.setSizePolicy(sizePolicy)
self.encryptComboBox.setEditable(True)
self.encryptComboBox.setObjectName("encryptComboBox")
self.encryptComboBox.addItem("")
self.encryptComboBox.addItem("")
self.encryptComboBox.addItem("")
self.encryptComboBox.addItem("")
self.encryptComboBox.addItem("")
self.encryptComboBox.addItem("")
self.encryptComboBox.addItem("")
self.encryptComboBox.addItem("")
self.encryptComboBox.addItem("")
self.encryptComboBox.addItem("")
self.encryptComboBox.addItem("")
self.encryptComboBox.addItem("")
self.encryptComboBox.addItem("")
self.encryptComboBox.addItem("")
self.encryptComboBox.addItem("")
self.encryptComboBox.addItem("")
self.encryptComboBox.addItem("")
self.encryptComboBox.addItem("")
self.encryptComboBox.addItem("")
self.encryptComboBox.addItem("")
self.encryptComboBox.addItem("")
self.encryptComboBox.addItem("")
self.encryptComboBox.addItem("")
self.encryptComboBox.addItem("")
self.encryptComboBox.addItem("")
self.encryptComboBox.addItem("")
self.encryptComboBox.addItem("")
self.encryptComboBox.addItem("")
self.encryptComboBox.addItem("")
self.encryptComboBox.addItem("")
self.formLayout.setWidget(3, QtWidgets.QFormLayout.FieldRole, self.encryptComboBox)
self.otaLabel = QtWidgets.QLabel(self.editFrame)
self.otaLabel.setObjectName("otaLabel")
self.formLayout.setWidget(4, QtWidgets.QFormLayout.LabelRole, self.otaLabel)
self.otaCheckBox = QtWidgets.QCheckBox(self.editFrame)
self.otaCheckBox.setToolTip("")
self.otaCheckBox.setObjectName("otaCheckBox")
self.formLayout.setWidget(4, QtWidgets.QFormLayout.FieldRole, self.otaCheckBox)
self.fastopenLabel = QtWidgets.QLabel(self.editFrame)
self.fastopenLabel.setObjectName("fastopenLabel")
self.formLayout.setWidget(5, QtWidgets.QFormLayout.LabelRole, self.fastopenLabel)
self.fastopenCheckBox = QtWidgets.QCheckBox(self.editFrame)
self.fastopenCheckBox.setToolTip("")
self.fastopenCheckBox.setObjectName("fastopenCheckBox")
self.formLayout.setWidget(5, QtWidgets.QFormLayout.FieldRole, self.fastopenCheckBox)
self.timeoutLabel = QtWidgets.QLabel(self.editFrame)
self.timeoutLabel.setObjectName("timeoutLabel")
self.formLayout.setWidget(7, QtWidgets.QFormLayout.LabelRole, self.timeoutLabel)
self.timeoutSpinBox = QtWidgets.QSpinBox(self.editFrame)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.timeoutSpinBox.sizePolicy().hasHeightForWidth())
self.timeoutSpinBox.setSizePolicy(sizePolicy)
self.timeoutSpinBox.setMinimum(10)
self.timeoutSpinBox.setMaximum(3600)
self.timeoutSpinBox.setSingleStep(10)
self.timeoutSpinBox.setProperty("value", 600)
self.timeoutSpinBox.setObjectName("timeoutSpinBox")
self.formLayout.setWidget(7, QtWidgets.QFormLayout.FieldRole, self.timeoutSpinBox)
self.localaddressLabel = QtWidgets.QLabel(self.editFrame)
self.localaddressLabel.setObjectName("localaddressLabel")
self.formLayout.setWidget(8, QtWidgets.QFormLayout.LabelRole, self.localaddressLabel)
self.localaddressEdit = QtWidgets.QLineEdit(self.editFrame)
self.localaddressEdit.setObjectName("localaddressEdit")
self.formLayout.setWidget(8, QtWidgets.QFormLayout.FieldRole, self.localaddressEdit)
self.remarksEdit = QtWidgets.QLineEdit(self.editFrame)
self.remarksEdit.setText("")
self.remarksEdit.setObjectName("remarksEdit")
self.formLayout.setWidget(10, QtWidgets.QFormLayout.FieldRole, self.remarksEdit)
self.remarksLabel = QtWidgets.QLabel(self.editFrame)
self.remarksLabel.setObjectName("remarksLabel")
self.formLayout.setWidget(10, QtWidgets.QFormLayout.LabelRole, self.remarksLabel)
self.localportLabel = QtWidgets.QLabel(self.editFrame)
self.localportLabel.setObjectName("localportLabel")
self.formLayout.setWidget(9, QtWidgets.QFormLayout.LabelRole, self.localportLabel)
self.localportSpinBox = QtWidgets.QSpinBox(self.editFrame)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.localportSpinBox.sizePolicy().hasHeightForWidth())
self.localportSpinBox.setSizePolicy(sizePolicy)
self.localportSpinBox.setMinimum(1)
self.localportSpinBox.setMaximum(65535)
self.localportSpinBox.setSingleStep(1)
self.localportSpinBox.setProperty("value", 1080)
self.localportSpinBox.setObjectName("localportSpinBox")
self.formLayout.setWidget(9, QtWidgets.QFormLayout.FieldRole, self.localportSpinBox)
self.gridLayout.addWidget(self.editFrame, 1, 0, 1, 1)
self.configlist = QtWidgets.QListWidget(self.centralWidget)
self.configlist.setGeometry(QtCore.QRect(10, 10, 221, 311))
self.configlist.setStyleSheet("")
self.configlist.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
self.configlist.setTabKeyNavigation(False)
self.configlist.setSelectionMode(QtWidgets.QAbstractItemView.SingleSelection)
self.configlist.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
self.configlist.setObjectName("configlist")
self.add_config = QtWidgets.QToolButton(self.centralWidget)
self.add_config.setGeometry(QtCore.QRect(10, 330, 101, 41))
self.add_config.setObjectName("add_config")
self.del_config = QtWidgets.QToolButton(self.centralWidget)
self.del_config.setGeometry(QtCore.QRect(120, 330, 111, 41))
self.del_config.setObjectName("del_config")
self.up = QtWidgets.QToolButton(self.centralWidget)
self.up.setGeometry(QtCore.QRect(10, 370, 101, 41))
self.up.setObjectName("up")
self.down = QtWidgets.QToolButton(self.centralWidget)
self.down.setGeometry(QtCore.QRect(120, 370, 111, 41))
self.down.setObjectName("down")
self.b_yes = QtWidgets.QPushButton(self.centralWidget)
self.b_yes.setGeometry(QtCore.QRect(290, 340, 91, 61))
self.b_yes.setObjectName("b_yes")
self.b_exit = QtWidgets.QPushButton(self.centralWidget)
self.b_exit.setGeometry(QtCore.QRect(430, 340, 91, 61))
self.b_exit.setObjectName("b_exit")
self.gridLayoutWidget.raise_()
self.add_config.raise_()
self.del_config.raise_()
self.up.raise_()
self.down.raise_()
self.b_yes.raise_()
self.b_exit.raise_()
self.configlist.raise_()
MainWindow.setCentralWidget(self.centralWidget)
self.retranslateUi(MainWindow)
self.b_exit.clicked.connect(MainWindow.hide)
self.configlist.currentRowChanged['int'].connect(MainWindow.update)
self.add_config.clicked.connect(self.configlist.scrollToBottom)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
MainWindow.setTabOrder(self.serverAddrEdit, self.serverPortSpinBox)
MainWindow.setTabOrder(self.serverPortSpinBox, self.pwdEdit)
MainWindow.setTabOrder(self.pwdEdit, self.encryptComboBox)
MainWindow.setTabOrder(self.encryptComboBox, self.otaCheckBox)
MainWindow.setTabOrder(self.otaCheckBox, self.timeoutSpinBox)
MainWindow.setTabOrder(self.timeoutSpinBox, self.b_yes)
MainWindow.setTabOrder(self.b_yes, self.b_exit)
MainWindow.setTabOrder(self.b_exit, self.configlist)
MainWindow.setTabOrder(self.configlist, self.add_config)
MainWindow.setTabOrder(self.add_config, self.del_config)
MainWindow.setTabOrder(self.del_config, self.up)
MainWindow.setTabOrder(self.up, self.down)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "shadowsocks-pyqt"))
self.serverAddrLabel.setText(_translate("MainWindow", "服务器 IP"))
self.serverAddrEdit.setText(_translate("MainWindow", "127.0.0.1"))
self.serverPortLabel.setText(_translate("MainWindow", "服务器端口"))
self.pwdLabel.setText(_translate("MainWindow", "密码"))
self.pwdEdit.setText(_translate("MainWindow", "password"))
self.encryptLabel.setText(_translate("MainWindow", "加密方式"))
self.encryptComboBox.setItemText(0, _translate("MainWindow", "aes-256-cfb"))
self.encryptComboBox.setItemText(1, _translate("MainWindow", "aes-128-cfb"))
self.encryptComboBox.setItemText(2, _translate("MainWindow", "aes-192-cfb"))
self.encryptComboBox.setItemText(3, _translate("MainWindow", "chacha20"))
self.encryptComboBox.setItemText(4, _translate("MainWindow", "rc4"))
self.encryptComboBox.setItemText(5, _translate("MainWindow", "rc4-md5"))
self.encryptComboBox.setItemText(6, _translate("MainWindow", "table"))
self.encryptComboBox.setItemText(7, _translate("MainWindow", "xchacha20-ietf-poly1305"))
self.encryptComboBox.setItemText(8, _translate("MainWindow", "aes-128-gcm"))
self.encryptComboBox.setItemText(9, _translate("MainWindow", "aes-192-gcm"))
self.encryptComboBox.setItemText(10, _translate("MainWindow", "aes-256-gcm"))
self.encryptComboBox.setItemText(11, _translate("MainWindow", "aes-128-ctr"))
self.encryptComboBox.setItemText(12, _translate("MainWindow", "aes-192-ctr"))
self.encryptComboBox.setItemText(13, _translate("MainWindow", "aes-256-ctr"))
self.encryptComboBox.setItemText(14, _translate("MainWindow", "aes-128-ocb"))
self.encryptComboBox.setItemText(15, _translate("MainWindow", "aes-192-ocb"))
self.encryptComboBox.setItemText(16, _translate("MainWindow", "aes-256-ocb"))
self.encryptComboBox.setItemText(17, _translate("MainWindow", "salsa20"))
self.encryptComboBox.setItemText(18, _translate("MainWindow", "chacha20-ietf-poly1305"))
self.encryptComboBox.setItemText(19, _translate("MainWindow", "chacha20-poly1305"))
self.encryptComboBox.setItemText(20, _translate("MainWindow", "camellia-128-cfb"))
self.encryptComboBox.setItemText(21, _translate("MainWindow", "camellia-192-cfb"))
self.encryptComboBox.setItemText(22, _translate("MainWindow", "camellia-256-cfb"))
self.encryptComboBox.setItemText(23, _translate("MainWindow", "chacha20-ietf"))
self.encryptComboBox.setItemText(24, _translate("MainWindow", "bf-cfb"))
self.encryptComboBox.setItemText(25, _translate("MainWindow", "cast5-cfb"))
self.encryptComboBox.setItemText(26, _translate("MainWindow", "des-cfb"))
self.encryptComboBox.setItemText(27, _translate("MainWindow", "idea-cfb"))
self.encryptComboBox.setItemText(28, _translate("MainWindow", "rc2-cfb"))
self.encryptComboBox.setItemText(29, _translate("MainWindow", "seed-cfb"))
self.otaLabel.setText(_translate("MainWindow", "一次验证"))
self.otaCheckBox.setText(_translate("MainWindow", "(实验功能)"))
self.fastopenLabel.setText(_translate("MainWindow", "快速打开"))
self.fastopenCheckBox.setText(_translate("MainWindow", "(Fast Open 仅支持linux系统)"))
self.timeoutLabel.setText(_translate("MainWindow", "超时时间"))
self.localaddressLabel.setText(_translate("MainWindow", "本地 IP"))
self.localaddressEdit.setText(_translate("MainWindow", "127.0.0.1"))
self.remarksLabel.setText(_translate("MainWindow", "备注"))
self.localportLabel.setText(_translate("MainWindow", "本地端口"))
self.add_config.setText(_translate("MainWindow", "添加"))
self.del_config.setText(_translate("MainWindow", "删除"))
self.up.setText(_translate("MainWindow", "上移"))
self.down.setText(_translate("MainWindow", "下移"))
self.b_yes.setText(_translate("MainWindow", "确定"))
self.b_exit.setText(_translate("MainWindow", "取消"))
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
MainWindow = QtWidgets.QMainWindow()
ui = Ui_MainWindow()
ui.setupUi(MainWindow)
MainWindow.show()
sys.exit(app.exec_())