forked from caj2pdf/caj2pdf
-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathcaj2pdf_GUI.py
115 lines (107 loc) · 6.65 KB
/
caj2pdf_GUI.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
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'caj2pdf_GUI.ui'
#
# Created by: PyQt5 UI code generator 5.12
#
# 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(369, 525)
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.gridLayout = QtWidgets.QGridLayout(self.centralwidget)
self.gridLayout.setObjectName("gridLayout")
self.label = QtWidgets.QLabel(self.centralwidget)
self.label.setMaximumSize(QtCore.QSize(16777215, 15))
self.label.setObjectName("label")
self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
self.caj_address = QtWidgets.QLineEdit(self.centralwidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(1)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.caj_address.sizePolicy().hasHeightForWidth())
self.caj_address.setSizePolicy(sizePolicy)
self.caj_address.setObjectName("caj_address")
self.gridLayout.addWidget(self.caj_address, 1, 0, 1, 3)
self.caj_file_open_button = QtWidgets.QToolButton(self.centralwidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.caj_file_open_button.sizePolicy().hasHeightForWidth())
self.caj_file_open_button.setSizePolicy(sizePolicy)
self.caj_file_open_button.setObjectName("caj_file_open_button")
self.gridLayout.addWidget(self.caj_file_open_button, 1, 3, 1, 1)
self.label_4 = QtWidgets.QLabel(self.centralwidget)
self.label_4.setMaximumSize(QtCore.QSize(16777215, 15))
self.label_4.setObjectName("label_4")
self.gridLayout.addWidget(self.label_4, 2, 0, 1, 2)
self.pdf_address = QtWidgets.QLineEdit(self.centralwidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(1)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.pdf_address.sizePolicy().hasHeightForWidth())
self.pdf_address.setSizePolicy(sizePolicy)
self.pdf_address.setObjectName("pdf_address")
self.gridLayout.addWidget(self.pdf_address, 3, 0, 1, 3)
self.pdf_file_open_button = QtWidgets.QToolButton(self.centralwidget)
self.pdf_file_open_button.setObjectName("pdf_file_open_button")
self.gridLayout.addWidget(self.pdf_file_open_button, 3, 3, 1, 1)
self.show_button = QtWidgets.QPushButton(self.centralwidget)
self.show_button.setMaximumSize(QtCore.QSize(93, 16777215))
self.show_button.setObjectName("show_button")
self.gridLayout.addWidget(self.show_button, 4, 0, 1, 1)
self.convert = QtWidgets.QPushButton(self.centralwidget)
self.convert.setMaximumSize(QtCore.QSize(93, 16777215))
self.convert.setObjectName("convert")
self.gridLayout.addWidget(self.convert, 4, 1, 1, 1)
self.outlines = QtWidgets.QPushButton(self.centralwidget)
self.outlines.setMaximumSize(QtCore.QSize(93, 16777215))
self.outlines.setObjectName("outlines")
self.gridLayout.addWidget(self.outlines, 4, 2, 1, 1)
self.logger = QtWidgets.QListWidget(self.centralwidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.logger.sizePolicy().hasHeightForWidth())
self.logger.setSizePolicy(sizePolicy)
self.logger.setObjectName("logger")
self.gridLayout.addWidget(self.logger, 5, 0, 1, 4)
self.label_2 = QtWidgets.QLabel(self.centralwidget)
self.label_2.setMaximumSize(QtCore.QSize(16777215, 15))
self.label_2.setObjectName("label_2")
self.gridLayout.addWidget(self.label_2, 6, 0, 1, 3)
self.lineEdit = QtWidgets.QLineEdit(self.centralwidget)
self.lineEdit.setObjectName("lineEdit")
self.gridLayout.addWidget(self.lineEdit, 7, 0, 1, 4)
self.label_3 = QtWidgets.QLabel(self.centralwidget)
self.label_3.setMaximumSize(QtCore.QSize(16777215, 15))
self.label_3.setObjectName("label_3")
self.gridLayout.addWidget(self.label_3, 8, 0, 1, 2)
self.lineEdit_2 = QtWidgets.QLineEdit(self.centralwidget)
self.lineEdit_2.setObjectName("lineEdit_2")
self.gridLayout.addWidget(self.lineEdit_2, 9, 0, 1, 4)
MainWindow.setCentralWidget(self.centralwidget)
self.statusbar = QtWidgets.QStatusBar(MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "caj2pdf"))
self.label.setText(_translate("MainWindow", "caj文件位置:"))
self.caj_file_open_button.setText(_translate("MainWindow", "..."))
self.label_4.setText(_translate("MainWindow", "pdf for outlines:"))
self.pdf_file_open_button.setText(_translate("MainWindow", "..."))
self.show_button.setToolTip(_translate("MainWindow", "打印文件基本信息(文件类型、页面数、大纲项目数)"))
self.show_button.setText(_translate("MainWindow", "show"))
self.convert.setToolTip(_translate("MainWindow", "转换文件"))
self.convert.setText(_translate("MainWindow", "convert"))
self.outlines.setToolTip(_translate("MainWindow", "<html><head/><body><p>从 CAJ 文件中提取大纲信息并添加至转化后的 PDF 文件</p><p>遇到不支持的文件类型或 Bug 时,可用 CAJViewer 打印 PDF 文件,并用这条命令为其添加大纲</p></body></html>"))
self.outlines.setText(_translate("MainWindow", "outlines"))
self.label_2.setText(_translate("MainWindow", "caj2pdf 核心项目源码: (转换不了看这里)"))
self.lineEdit.setText(_translate("MainWindow", "https://github.com/JeziL/caj2pdf"))
self.label_3.setText(_translate("MainWindow", "caj2pdf GUI项目源码:"))
self.lineEdit_2.setText(_translate("MainWindow", "https://github.com/ElonH/caj2pdf_gui"))