-
-
Notifications
You must be signed in to change notification settings - Fork 234
/
mwin.py
254 lines (248 loc) · 12.3 KB
/
mwin.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
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'mwin.ui'
#
# Created by: PyQt5 UI code generator 5.10.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MWin(object):
def setupUi(self, MWin):
MWin.setObjectName("MWin")
MWin.resize(620, 450)
MWin.setMinimumSize(QtCore.QSize(16777215, 16777215))
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/images/icon64"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
MWin.setWindowIcon(icon)
self.centralWidget = QtWidgets.QWidget(MWin)
self.centralWidget.setObjectName("centralWidget")
self.horizontalLayout = QtWidgets.QHBoxLayout(self.centralWidget)
self.horizontalLayout.setContentsMargins(11, 11, 11, 11)
self.horizontalLayout.setSpacing(6)
self.horizontalLayout.setObjectName("horizontalLayout")
self.mainLayout = QtWidgets.QGridLayout()
self.mainLayout.setSpacing(6)
self.mainLayout.setObjectName("mainLayout")
self.originLabel = QtWidgets.QLabel(self.centralWidget)
font = QtGui.QFont()
font.setFamily("微软雅黑")
font.setPointSize(12)
self.originLabel.setFont(font)
self.originLabel.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
self.originLabel.setObjectName("originLabel")
self.mainLayout.addWidget(self.originLabel, 0, 0, 1, 1)
self.transText = QtWidgets.QPlainTextEdit(self.centralWidget)
font = QtGui.QFont()
font.setFamily("微软雅黑")
font.setPointSize(10)
self.transText.setFont(font)
self.transText.setObjectName("transText")
self.mainLayout.addWidget(self.transText, 1, 1, 1, 2)
self.transLabel = QtWidgets.QLabel(self.centralWidget)
font = QtGui.QFont()
font.setFamily("微软雅黑")
font.setPointSize(12)
self.transLabel.setFont(font)
self.transLabel.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
self.transLabel.setObjectName("transLabel")
self.mainLayout.addWidget(self.transLabel, 1, 0, 1, 1)
self.originText = QtWidgets.QPlainTextEdit(self.centralWidget)
font = QtGui.QFont()
font.setFamily("微软雅黑")
font.setPointSize(10)
self.originText.setFont(font)
self.originText.setObjectName("originText")
self.mainLayout.addWidget(self.originText, 0, 1, 1, 1)
self.Layout = QtWidgets.QVBoxLayout()
self.Layout.setSpacing(6)
self.Layout.setObjectName("Layout")
self.realTimeTrans = QtWidgets.QCheckBox(self.centralWidget)
font = QtGui.QFont()
font.setFamily("微软雅黑")
font.setPointSize(12)
self.realTimeTrans.setFont(font)
self.realTimeTrans.setObjectName("realTimeTrans")
self.Layout.addWidget(self.realTimeTrans)
self.alwaysFront = QtWidgets.QCheckBox(self.centralWidget)
font = QtGui.QFont()
font.setFamily("微软雅黑")
font.setPointSize(12)
self.alwaysFront.setFont(font)
self.alwaysFront.setObjectName("alwaysFront")
self.Layout.addWidget(self.alwaysFront)
self.paperMode = QtWidgets.QCheckBox(self.centralWidget)
font = QtGui.QFont()
font.setFamily("微软雅黑")
font.setPointSize(12)
self.paperMode.setFont(font)
self.paperMode.setObjectName("paperMode")
self.Layout.addWidget(self.paperMode)
self.Layout_1 = QtWidgets.QHBoxLayout()
self.Layout_1.setSpacing(6)
self.Layout_1.setObjectName("Layout_1")
self.logo = QtWidgets.QLabel(self.centralWidget)
self.logo.setText("")
self.logo.setPixmap(QtGui.QPixmap(":/images/icon64"))
self.logo.setAlignment(QtCore.Qt.AlignCenter)
self.logo.setObjectName("logo")
self.Layout_1.addWidget(self.logo)
self.Layout_2 = QtWidgets.QVBoxLayout()
self.Layout_2.setSpacing(6)
self.Layout_2.setObjectName("Layout_2")
self.go = QtWidgets.QPushButton(self.centralWidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.go.sizePolicy().hasHeightForWidth())
self.go.setSizePolicy(sizePolicy)
self.go.setMinimumSize(QtCore.QSize(100, 30))
font = QtGui.QFont()
font.setFamily("微软雅黑")
font.setPointSize(10)
self.go.setFont(font)
self.go.setObjectName("go")
self.Layout_2.addWidget(self.go)
self.copy = QtWidgets.QPushButton(self.centralWidget)
font = QtGui.QFont()
font.setFamily("Microsoft YaHei")
font.setPointSize(10)
self.copy.setFont(font)
self.copy.setObjectName("copy")
self.Layout_2.addWidget(self.copy)
self.Layout_1.addLayout(self.Layout_2)
self.Layout.addLayout(self.Layout_1)
self.mainLayout.addLayout(self.Layout, 0, 2, 1, 1)
self.horizontalLayout.addLayout(self.mainLayout)
MWin.setCentralWidget(self.centralWidget)
self.menuBar = QtWidgets.QMenuBar(MWin)
self.menuBar.setGeometry(QtCore.QRect(0, 0, 620, 26))
font = QtGui.QFont()
font.setPointSize(9)
self.menuBar.setFont(font)
self.menuBar.setObjectName("menuBar")
self.menuFile = QtWidgets.QMenu(self.menuBar)
self.menuFile.setObjectName("menuFile")
self.menuHelp = QtWidgets.QMenu(self.menuBar)
self.menuHelp.setObjectName("menuHelp")
self.menuSet = QtWidgets.QMenu(self.menuBar)
self.menuSet.setObjectName("menuSet")
self.menuLan = QtWidgets.QMenu(self.menuSet)
icon1 = QtGui.QIcon()
icon1.addPixmap(QtGui.QPixmap(":/images/res/images/chinese.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.menuLan.setIcon(icon1)
self.menuLan.setObjectName("menuLan")
self.menuDestLan = QtWidgets.QMenu(self.menuSet)
icon2 = QtGui.QIcon()
icon2.addPixmap(QtGui.QPixmap(":/images/res/images/english.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.menuDestLan.setIcon(icon2)
self.menuDestLan.setObjectName("menuDestLan")
MWin.setMenuBar(self.menuBar)
self.statusBar = QtWidgets.QStatusBar(MWin)
self.statusBar.setObjectName("statusBar")
MWin.setStatusBar(self.statusBar)
self.openFile = QtWidgets.QAction(MWin)
icon3 = QtGui.QIcon()
icon3.addPixmap(QtGui.QPixmap(":/images/res/images/import.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.openFile.setIcon(icon3)
font = QtGui.QFont()
font.setFamily("微软雅黑")
self.openFile.setFont(font)
self.openFile.setObjectName("openFile")
self.exit = QtWidgets.QAction(MWin)
icon4 = QtGui.QIcon()
icon4.addPixmap(QtGui.QPixmap(":/images/res/images/exit.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.exit.setIcon(icon4)
self.exit.setObjectName("exit")
self.donate = QtWidgets.QAction(MWin)
icon5 = QtGui.QIcon()
icon5.addPixmap(QtGui.QPixmap(":/images/res/images/donate.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.donate.setIcon(icon5)
self.donate.setObjectName("donate")
self.reportBug = QtWidgets.QAction(MWin)
icon6 = QtGui.QIcon()
icon6.addPixmap(QtGui.QPixmap(":/images/res/images/bug.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.reportBug.setIcon(icon6)
self.reportBug.setObjectName("reportBug")
self.exportFile = QtWidgets.QAction(MWin)
icon7 = QtGui.QIcon()
icon7.addPixmap(QtGui.QPixmap(":/images/res/images/export.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.exportFile.setIcon(icon7)
self.exportFile.setObjectName("exportFile")
self.actionChinese = QtWidgets.QAction(MWin)
self.actionChinese.setIcon(icon1)
self.actionChinese.setObjectName("actionChinese")
self.actionEnglish = QtWidgets.QAction(MWin)
self.actionEnglish.setIcon(icon2)
self.actionEnglish.setObjectName("actionEnglish")
self.actionDestChinese = QtWidgets.QAction(MWin)
self.actionDestChinese.setIcon(icon1)
self.actionDestChinese.setObjectName("actionDestChinese")
self.actionDestEnglish = QtWidgets.QAction(MWin)
self.actionDestEnglish.setIcon(icon2)
self.actionDestEnglish.setObjectName("actionDestEnglish")
self.actionDestJapanese = QtWidgets.QAction(MWin)
icon8 = QtGui.QIcon()
icon8.addPixmap(QtGui.QPixmap(":/images/res/images/Japanese.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.actionDestJapanese.setIcon(icon8)
self.actionDestJapanese.setObjectName("actionDestJapanese")
self.actionDestKorean = QtWidgets.QAction(MWin)
icon9 = QtGui.QIcon()
icon9.addPixmap(QtGui.QPixmap(":/images/res/images/Korea.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.actionDestKorean.setIcon(icon9)
self.actionDestKorean.setObjectName("actionDestKorean")
self.about = QtWidgets.QAction(MWin)
icon10 = QtGui.QIcon()
icon10.addPixmap(QtGui.QPixmap(":/images/res/images/about.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.about.setIcon(icon10)
self.about.setObjectName("about")
self.menuFile.addAction(self.openFile)
self.menuFile.addAction(self.exportFile)
self.menuFile.addAction(self.exit)
self.menuHelp.addAction(self.about)
self.menuHelp.addAction(self.donate)
self.menuHelp.addAction(self.reportBug)
self.menuLan.addAction(self.actionChinese)
self.menuLan.addAction(self.actionEnglish)
self.menuDestLan.addAction(self.actionDestChinese)
self.menuDestLan.addAction(self.actionDestEnglish)
self.menuDestLan.addAction(self.actionDestJapanese)
self.menuDestLan.addAction(self.actionDestKorean)
self.menuSet.addAction(self.menuLan.menuAction())
self.menuSet.addAction(self.menuDestLan.menuAction())
self.menuBar.addAction(self.menuFile.menuAction())
self.menuBar.addAction(self.menuSet.menuAction())
self.menuBar.addAction(self.menuHelp.menuAction())
self.retranslateUi(MWin)
QtCore.QMetaObject.connectSlotsByName(MWin)
def retranslateUi(self, MWin):
_translate = QtCore.QCoreApplication.translate
MWin.setWindowTitle(_translate("MWin", "谷歌翻译App v1.2.1"))
self.originLabel.setText(_translate("MWin", "原文:"))
self.transLabel.setText(_translate("MWin", "翻译:"))
self.originText.setPlaceholderText(_translate("MWin", "Ctrl+h获取帮助"))
self.realTimeTrans.setText(_translate("MWin", "实时翻译"))
self.alwaysFront.setText(_translate("MWin", "窗口置顶"))
self.paperMode.setText(_translate("MWin", "论文模式"))
self.go.setText(_translate("MWin", "翻译"))
self.copy.setText(_translate("MWin", "复制"))
self.menuFile.setTitle(_translate("MWin", "文件"))
self.menuHelp.setTitle(_translate("MWin", "帮助"))
self.menuSet.setTitle(_translate("MWin", "设置"))
self.menuLan.setTitle(_translate("MWin", "语言"))
self.menuDestLan.setTitle(_translate("MWin", "目标语言"))
self.openFile.setText(_translate("MWin", "打开"))
self.openFile.setShortcut(_translate("MWin", "Ctrl+O"))
self.exit.setText(_translate("MWin", "退出"))
self.exit.setShortcut(_translate("MWin", "Ctrl+Q"))
self.donate.setText(_translate("MWin", "投喂"))
self.reportBug.setText(_translate("MWin", "报告bug"))
self.exportFile.setText(_translate("MWin", "导出"))
self.exportFile.setIconText(_translate("MWin", "导出"))
self.exportFile.setShortcut(_translate("MWin", "Ctrl+I"))
self.actionChinese.setText(_translate("MWin", "中文"))
self.actionEnglish.setText(_translate("MWin", "英文"))
self.actionDestChinese.setText(_translate("MWin", "中文"))
self.actionDestEnglish.setText(_translate("MWin", "英文"))
self.actionDestJapanese.setText(_translate("MWin", "日文"))
self.actionDestKorean.setText(_translate("MWin", "韩文"))
self.about.setText(_translate("MWin", "关于"))
import res_rc