-
Notifications
You must be signed in to change notification settings - Fork 6
/
gui_main.py
344 lines (338 loc) · 20.4 KB
/
gui_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
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'D:\Apps\DEV\PROJECTS\KoHighlights\gui_main.ui',
# licensing of 'D:\Apps\DEV\PROJECTS\KoHighlights\gui_main.ui' applies.
#
# Created: Mon Nov 4 00:35:07 2024
# by: pyside2-uic running on PySide2 5.13.2
#
# WARNING! All changes made in this file will be lost!
from PySide2 import QtCore, QtGui, QtWidgets
class Ui_Base(object):
def setupUi(self, Base):
Base.setObjectName("Base")
Base.resize(640, 512)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(":/stuff/logo64.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
Base.setWindowIcon(icon)
Base.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates))
Base.setToolButtonStyle(QtCore.Qt.ToolButtonIconOnly)
self.centralwidget = QtWidgets.QWidget(Base)
self.centralwidget.setObjectName("centralwidget")
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.centralwidget)
self.verticalLayout_2.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.views = QtWidgets.QStackedWidget(self.centralwidget)
self.views.setObjectName("views")
self.books_pg = QtWidgets.QWidget()
self.books_pg.setObjectName("books_pg")
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.books_pg)
self.verticalLayout_3.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_3.setObjectName("verticalLayout_3")
self.splitter = QtWidgets.QSplitter(self.books_pg)
self.splitter.setOrientation(QtCore.Qt.Horizontal)
self.splitter.setObjectName("splitter")
self.file_table = DropTableWidget(self.splitter)
self.file_table.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
self.file_table.setAcceptDrops(True)
self.file_table.setFrameShape(QtWidgets.QFrame.WinPanel)
self.file_table.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
self.file_table.setDragDropMode(QtWidgets.QAbstractItemView.DropOnly)
self.file_table.setDefaultDropAction(QtCore.Qt.CopyAction)
self.file_table.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
self.file_table.setHorizontalScrollMode(QtWidgets.QAbstractItemView.ScrollPerPixel)
self.file_table.setWordWrap(False)
self.file_table.setCornerButtonEnabled(False)
self.file_table.setColumnCount(8)
self.file_table.setObjectName("file_table")
self.file_table.setColumnCount(8)
self.file_table.setRowCount(0)
item = QtWidgets.QTableWidgetItem()
self.file_table.setHorizontalHeaderItem(0, item)
item = QtWidgets.QTableWidgetItem()
self.file_table.setHorizontalHeaderItem(1, item)
item = QtWidgets.QTableWidgetItem()
self.file_table.setHorizontalHeaderItem(2, item)
item = QtWidgets.QTableWidgetItem()
self.file_table.setHorizontalHeaderItem(3, item)
item = QtWidgets.QTableWidgetItem()
self.file_table.setHorizontalHeaderItem(4, item)
item = QtWidgets.QTableWidgetItem()
self.file_table.setHorizontalHeaderItem(5, item)
item = QtWidgets.QTableWidgetItem()
self.file_table.setHorizontalHeaderItem(6, item)
item = QtWidgets.QTableWidgetItem()
self.file_table.setHorizontalHeaderItem(7, item)
self.file_table.horizontalHeader().setDefaultSectionSize(22)
self.file_table.horizontalHeader().setHighlightSections(False)
self.file_table.horizontalHeader().setMinimumSectionSize(22)
self.file_table.horizontalHeader().setSortIndicatorShown(True)
self.file_table.verticalHeader().setDefaultSectionSize(22)
self.file_table.verticalHeader().setHighlightSections(True)
self.file_table.verticalHeader().setMinimumSectionSize(22)
self.frame = QtWidgets.QFrame(self.splitter)
self.frame.setFrameShape(QtWidgets.QFrame.WinPanel)
self.frame.setFrameShadow(QtWidgets.QFrame.Sunken)
self.frame.setObjectName("frame")
self.verticalLayout = QtWidgets.QVBoxLayout(self.frame)
self.verticalLayout.setSpacing(3)
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
self.verticalLayout.setObjectName("verticalLayout")
self.header = QtWidgets.QWidget(self.frame)
self.header.setObjectName("header")
self.horizontalLayout = QtWidgets.QHBoxLayout(self.header)
self.horizontalLayout.setContentsMargins(0, 0, -1, 0)
self.horizontalLayout.setObjectName("horizontalLayout")
self.fold_btn = QtWidgets.QToolButton(self.header)
self.fold_btn.setStyleSheet("QToolButton{border:none;}")
self.fold_btn.setCheckable(True)
self.fold_btn.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
self.fold_btn.setArrowType(QtCore.Qt.DownArrow)
self.fold_btn.setObjectName("fold_btn")
self.horizontalLayout.addWidget(self.fold_btn)
self.frame_2 = QtWidgets.QFrame(self.header)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.frame_2.sizePolicy().hasHeightForWidth())
self.frame_2.setSizePolicy(sizePolicy)
self.frame_2.setFrameShape(QtWidgets.QFrame.HLine)
self.frame_2.setFrameShadow(QtWidgets.QFrame.Sunken)
self.frame_2.setLineWidth(1)
self.frame_2.setObjectName("frame_2")
self.horizontalLayout.addWidget(self.frame_2)
self.verticalLayout.addWidget(self.header)
self.book_info = QtWidgets.QFrame(self.frame)
self.book_info.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.book_info.setFrameShadow(QtWidgets.QFrame.Raised)
self.book_info.setObjectName("book_info")
self.gridLayout = QtWidgets.QGridLayout(self.book_info)
self.gridLayout.setContentsMargins(6, 0, 6, 0)
self.gridLayout.setObjectName("gridLayout")
self.pages_txt = QtWidgets.QLineEdit(self.book_info)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.pages_txt.sizePolicy().hasHeightForWidth())
self.pages_txt.setSizePolicy(sizePolicy)
self.pages_txt.setMaximumSize(QtCore.QSize(40, 16777215))
self.pages_txt.setReadOnly(True)
self.pages_txt.setObjectName("pages_txt")
self.gridLayout.addWidget(self.pages_txt, 4, 3, 1, 1)
self.lang_lbl = QtWidgets.QLabel(self.book_info)
self.lang_lbl.setObjectName("lang_lbl")
self.gridLayout.addWidget(self.lang_lbl, 4, 0, 1, 1)
self.title_lbl = QtWidgets.QLabel(self.book_info)
self.title_lbl.setObjectName("title_lbl")
self.gridLayout.addWidget(self.title_lbl, 0, 0, 1, 1)
self.series_lbl = QtWidgets.QLabel(self.book_info)
self.series_lbl.setObjectName("series_lbl")
self.gridLayout.addWidget(self.series_lbl, 2, 0, 1, 1)
self.author_txt = QtWidgets.QLineEdit(self.book_info)
self.author_txt.setReadOnly(True)
self.author_txt.setObjectName("author_txt")
self.gridLayout.addWidget(self.author_txt, 1, 1, 1, 6)
self.author_lbl = QtWidgets.QLabel(self.book_info)
self.author_lbl.setObjectName("author_lbl")
self.gridLayout.addWidget(self.author_lbl, 1, 0, 1, 1)
self.description_btn = QtWidgets.QToolButton(self.book_info)
icon1 = QtGui.QIcon()
icon1.addPixmap(QtGui.QPixmap(":/stuff/description.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.description_btn.setIcon(icon1)
self.description_btn.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
self.description_btn.setObjectName("description_btn")
self.gridLayout.addWidget(self.description_btn, 4, 6, 1, 1)
self.pages_lbl = QtWidgets.QLabel(self.book_info)
self.pages_lbl.setObjectName("pages_lbl")
self.gridLayout.addWidget(self.pages_lbl, 4, 2, 1, 1)
self.lang_txt = QtWidgets.QLineEdit(self.book_info)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.lang_txt.sizePolicy().hasHeightForWidth())
self.lang_txt.setSizePolicy(sizePolicy)
self.lang_txt.setMaximumSize(QtCore.QSize(25, 16777215))
self.lang_txt.setReadOnly(True)
self.lang_txt.setObjectName("lang_txt")
self.gridLayout.addWidget(self.lang_txt, 4, 1, 1, 1)
self.tags_lbl = QtWidgets.QLabel(self.book_info)
self.tags_lbl.setObjectName("tags_lbl")
self.gridLayout.addWidget(self.tags_lbl, 3, 0, 1, 1)
self.tags_txt = QtWidgets.QLineEdit(self.book_info)
self.tags_txt.setReadOnly(True)
self.tags_txt.setObjectName("tags_txt")
self.gridLayout.addWidget(self.tags_txt, 3, 1, 1, 6)
self.series_txt = QtWidgets.QLineEdit(self.book_info)
self.series_txt.setReadOnly(True)
self.series_txt.setObjectName("series_txt")
self.gridLayout.addWidget(self.series_txt, 2, 1, 1, 6)
self.review_txt = QtWidgets.QLabel(self.book_info)
self.review_txt.setFrameShape(QtWidgets.QFrame.NoFrame)
self.review_txt.setText("")
self.review_txt.setWordWrap(True)
self.review_txt.setObjectName("review_txt")
self.gridLayout.addWidget(self.review_txt, 5, 1, 1, 6)
self.title_txt = QtWidgets.QLineEdit(self.book_info)
self.title_txt.setReadOnly(True)
self.title_txt.setObjectName("title_txt")
self.gridLayout.addWidget(self.title_txt, 0, 1, 1, 6)
self.review_lbl = QtWidgets.QLabel(self.book_info)
self.review_lbl.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
self.review_lbl.setObjectName("review_lbl")
self.gridLayout.addWidget(self.review_lbl, 5, 0, 1, 1)
self.custom_btn = QtWidgets.QToolButton(self.book_info)
self.custom_btn.setEnabled(False)
self.custom_btn.setText("")
icon2 = QtGui.QIcon()
icon2.addPixmap(QtGui.QPixmap(":/stuff/file_edit.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.custom_btn.setIcon(icon2)
self.custom_btn.setCheckable(True)
self.custom_btn.setObjectName("custom_btn")
self.gridLayout.addWidget(self.custom_btn, 4, 5, 1, 1)
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.gridLayout.addItem(spacerItem, 4, 4, 1, 1)
self.verticalLayout.addWidget(self.book_info)
self.high_list = QtWidgets.QListWidget(self.frame)
self.high_list.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
self.high_list.setFrameShape(QtWidgets.QFrame.WinPanel)
self.high_list.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
self.high_list.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)
self.high_list.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
self.high_list.setVerticalScrollMode(QtWidgets.QAbstractItemView.ScrollPerPixel)
self.high_list.setWordWrap(True)
self.high_list.setObjectName("high_list")
self.verticalLayout.addWidget(self.high_list)
self.verticalLayout_3.addWidget(self.splitter)
self.views.addWidget(self.books_pg)
self.highlights_pg = QtWidgets.QWidget()
self.highlights_pg.setObjectName("highlights_pg")
self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.highlights_pg)
self.verticalLayout_4.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_4.setObjectName("verticalLayout_4")
self.high_table = QtWidgets.QTableWidget(self.highlights_pg)
self.high_table.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
self.high_table.setFrameShape(QtWidgets.QFrame.WinPanel)
self.high_table.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
self.high_table.setDragDropMode(QtWidgets.QAbstractItemView.DropOnly)
self.high_table.setDefaultDropAction(QtCore.Qt.CopyAction)
self.high_table.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
self.high_table.setHorizontalScrollMode(QtWidgets.QAbstractItemView.ScrollPerPixel)
self.high_table.setWordWrap(False)
self.high_table.setCornerButtonEnabled(False)
self.high_table.setColumnCount(8)
self.high_table.setObjectName("high_table")
self.high_table.setColumnCount(8)
self.high_table.setRowCount(0)
item = QtWidgets.QTableWidgetItem()
self.high_table.setHorizontalHeaderItem(0, item)
item = QtWidgets.QTableWidgetItem()
self.high_table.setHorizontalHeaderItem(1, item)
item = QtWidgets.QTableWidgetItem()
self.high_table.setHorizontalHeaderItem(2, item)
item = QtWidgets.QTableWidgetItem()
self.high_table.setHorizontalHeaderItem(3, item)
item = QtWidgets.QTableWidgetItem()
self.high_table.setHorizontalHeaderItem(4, item)
item = QtWidgets.QTableWidgetItem()
self.high_table.setHorizontalHeaderItem(5, item)
item = QtWidgets.QTableWidgetItem()
self.high_table.setHorizontalHeaderItem(6, item)
item = QtWidgets.QTableWidgetItem()
self.high_table.setHorizontalHeaderItem(7, item)
self.high_table.horizontalHeader().setHighlightSections(False)
self.high_table.horizontalHeader().setMinimumSectionSize(22)
self.high_table.horizontalHeader().setSortIndicatorShown(True)
self.high_table.horizontalHeader().setStretchLastSection(True)
self.high_table.verticalHeader().setDefaultSectionSize(22)
self.high_table.verticalHeader().setHighlightSections(True)
self.high_table.verticalHeader().setMinimumSectionSize(22)
self.verticalLayout_4.addWidget(self.high_table)
self.views.addWidget(self.highlights_pg)
self.sync_pg = QtWidgets.QWidget()
self.sync_pg.setObjectName("sync_pg")
self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.sync_pg)
self.verticalLayout_5.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_5.setObjectName("verticalLayout_5")
self.sync_table = XTableWidget(self.sync_pg)
self.sync_table.setAcceptDrops(True)
self.sync_table.setDragEnabled(True)
self.sync_table.setDragDropMode(QtWidgets.QAbstractItemView.InternalMove)
self.sync_table.setDefaultDropAction(QtCore.Qt.MoveAction)
self.sync_table.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
self.sync_table.setObjectName("sync_table")
self.sync_table.setColumnCount(1)
self.sync_table.setRowCount(0)
item = QtWidgets.QTableWidgetItem()
self.sync_table.setHorizontalHeaderItem(0, item)
self.sync_table.horizontalHeader().setVisible(False)
self.sync_table.horizontalHeader().setStretchLastSection(True)
self.sync_table.verticalHeader().setDefaultSectionSize(90)
self.sync_table.verticalHeader().setMinimumSectionSize(90)
self.verticalLayout_5.addWidget(self.sync_table)
self.views.addWidget(self.sync_pg)
self.verticalLayout_2.addWidget(self.views)
Base.setCentralWidget(self.centralwidget)
self.statusbar = QtWidgets.QStatusBar(Base)
self.statusbar.setStyleSheet("QStatusBar{padding-left:8px;font-weight:bold;}")
self.statusbar.setObjectName("statusbar")
Base.setStatusBar(self.statusbar)
self.tool_bar = QtWidgets.QToolBar(Base)
self.tool_bar.setWindowTitle("toolBar")
self.tool_bar.setMovable(True)
self.tool_bar.setAllowedAreas(QtCore.Qt.BottomToolBarArea|QtCore.Qt.TopToolBarArea)
self.tool_bar.setIconSize(QtCore.QSize(32, 32))
self.tool_bar.setToolButtonStyle(QtCore.Qt.ToolButtonTextUnderIcon)
self.tool_bar.setObjectName("tool_bar")
Base.addToolBar(QtCore.Qt.TopToolBarArea, self.tool_bar)
self.act_english = QtWidgets.QAction(Base)
self.act_english.setCheckable(True)
self.act_english.setChecked(False)
self.act_english.setObjectName("act_english")
self.act_greek = QtWidgets.QAction(Base)
self.act_greek.setCheckable(True)
self.act_greek.setChecked(False)
self.act_greek.setObjectName("act_greek")
self.act_view_book = QtWidgets.QAction(Base)
icon3 = QtGui.QIcon()
icon3.addPixmap(QtGui.QPixmap(":/stuff/files_view.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.act_view_book.setIcon(icon3)
self.act_view_book.setObjectName("act_view_book")
self.retranslateUi(Base)
self.views.setCurrentIndex(0)
QtCore.QMetaObject.connectSlotsByName(Base)
def retranslateUi(self, Base):
self.file_table.setSortingEnabled(True)
self.file_table.horizontalHeaderItem(0).setText(QtWidgets.QApplication.translate("Base", "Title", None, -1))
self.file_table.horizontalHeaderItem(1).setText(QtWidgets.QApplication.translate("Base", "Author", None, -1))
self.file_table.horizontalHeaderItem(2).setText(QtWidgets.QApplication.translate("Base", "Type", None, -1))
self.file_table.horizontalHeaderItem(3).setText(QtWidgets.QApplication.translate("Base", "Percent", None, -1))
self.file_table.horizontalHeaderItem(4).setText(QtWidgets.QApplication.translate("Base", "Rating", None, -1))
self.file_table.horizontalHeaderItem(5).setText(QtWidgets.QApplication.translate("Base", "Highlights", None, -1))
self.file_table.horizontalHeaderItem(6).setText(QtWidgets.QApplication.translate("Base", "Modified", None, -1))
self.file_table.horizontalHeaderItem(7).setText(QtWidgets.QApplication.translate("Base", "Path", None, -1))
self.fold_btn.setText(QtWidgets.QApplication.translate("Base", "Hide Book Info", None, -1))
self.lang_lbl.setText(QtWidgets.QApplication.translate("Base", "Language", None, -1))
self.title_lbl.setText(QtWidgets.QApplication.translate("Base", "Title", None, -1))
self.series_lbl.setText(QtWidgets.QApplication.translate("Base", "Series", None, -1))
self.author_lbl.setText(QtWidgets.QApplication.translate("Base", "Author", None, -1))
self.description_btn.setText(QtWidgets.QApplication.translate("Base", "Description", None, -1))
self.pages_lbl.setText(QtWidgets.QApplication.translate("Base", "Pages", None, -1))
self.tags_lbl.setText(QtWidgets.QApplication.translate("Base", "Tags", None, -1))
self.review_lbl.setText(QtWidgets.QApplication.translate("Base", "Review", None, -1))
self.custom_btn.setToolTip(QtWidgets.QApplication.translate("Base", "Show the custom properties of the book", None, -1))
self.custom_btn.setStatusTip(QtWidgets.QApplication.translate("Base", "Show the custom properties of the book", None, -1))
self.high_table.setSortingEnabled(True)
self.high_table.horizontalHeaderItem(0).setText(QtWidgets.QApplication.translate("Base", "Highlight", None, -1))
self.high_table.horizontalHeaderItem(1).setText(QtWidgets.QApplication.translate("Base", "Comment", None, -1))
self.high_table.horizontalHeaderItem(2).setText(QtWidgets.QApplication.translate("Base", "Date", None, -1))
self.high_table.horizontalHeaderItem(3).setText(QtWidgets.QApplication.translate("Base", "Title", None, -1))
self.high_table.horizontalHeaderItem(4).setText(QtWidgets.QApplication.translate("Base", "Author", None, -1))
self.high_table.horizontalHeaderItem(5).setText(QtWidgets.QApplication.translate("Base", "Page", None, -1))
self.high_table.horizontalHeaderItem(6).setText(QtWidgets.QApplication.translate("Base", "Chapter", None, -1))
self.high_table.horizontalHeaderItem(7).setText(QtWidgets.QApplication.translate("Base", "Path", None, -1))
self.sync_table.horizontalHeaderItem(0).setText(QtWidgets.QApplication.translate("Base", "Sync Groups", None, -1))
self.act_english.setText(QtWidgets.QApplication.translate("Base", "English", None, -1))
self.act_greek.setText(QtWidgets.QApplication.translate("Base", "Greek", None, -1))
self.act_view_book.setText(QtWidgets.QApplication.translate("Base", "View Book", None, -1))
self.act_view_book.setShortcut(QtWidgets.QApplication.translate("Base", "Ctrl+B", None, -1))
from secondary import DropTableWidget, XTableWidget
import images_rc