Skip to content

Commit

Permalink
本地漫画支持多章节
Browse files Browse the repository at this point in the history
  • Loading branch information
tonquer committed Aug 13, 2023
1 parent 69bd22a commit 97a2e18
Show file tree
Hide file tree
Showing 36 changed files with 10,061 additions and 3,801 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@
# tonquer<[email protected]>
# https://github.com/tonquer/picacg-qt
######################################################################################
# Version: v1.4.6
# 2023/8/13
# 1) 本地漫画支持多章节

# Version: v1.4.5
# 2023/5/7
# 1) 修改上一页和上一章跳到最后 #252
# 2) 自动打卡功能
# 3) 新增新版本聊天室
# 4) 修复上下滚动可能出现回滚 #242
# 5) 收藏新增搜索功能

# Version: v1.4.4
# 2023/3/19
# 1) 优化非滚动模式下,放大后的清晰度问题
Expand Down
Binary file added res/icon/clear_off.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/icon/clear_on.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/tr/tr_en.qm
Binary file not shown.
Binary file modified res/tr/tr_hk.qm
Binary file not shown.
19 changes: 8 additions & 11 deletions script/build_translate.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import os
import sys

from tools.langconv import Converter
cmd = "pyside6-lupdate.exe"
sts = os.system(cmd + " -no-obsolete -source-language zh_CN -target-language zh_HK ../src/tools/str.py -ts ../translate/str_hk.ts")
sts = os.system(cmd + " -no-obsolete -source-language zh_CN -target-language en_US ../src/tools/str.py -ts ../translate/str_en.ts")

sts = os.system(cmd + " -no-obsolete -source-language zh_CN -target-language zh_HK ../ui -ts ../translate/ui_hk.ts")
sts = os.system(cmd + " -no-obsolete -source-language zh_CN -target-language en_US ../ui -ts ../translate/ui_en.ts")
os.system("chcp 65001")
sts = os.system("pyside6-lupdate.exe -no-obsolete -source-language zh_CN -target-language zh_HK ../src/tools/str.py -ts ../translate/str_hk.ts")
sts = os.system("pyside6-lupdate.exe -no-obsolete -source-language zh_CN -target-language en_US ../src/tools/str.py -ts ../translate/str_en.ts")

sts = os.system("pyside6-lupdate.exe -no-obsolete -source-language zh_CN -target-language zh_HK ../ui -ts ../translate/ui_hk.ts")
sts = os.system("pyside6-lupdate.exe -no-obsolete -source-language zh_CN -target-language en_US ../ui -ts ../translate/ui_en.ts")
#
for tsFile in ["../translate/str_hk.ts", "../translate/ui_hk.ts"]:
f = open(tsFile, "r", encoding="utf-8")
data = ""
Expand All @@ -33,6 +31,5 @@
f.write(data)
f.close()

cmd = "pyside6-lrelease.exe"
sts = os.system(cmd + " ../translate/str_en.ts ../translate/ui_en.ts -qm ../res/tr/tr_en.qm")
sts = os.system(cmd + " ../translate/str_hk.ts ../translate/ui_hk.ts -qm ../res/tr/tr_hk.qm")
sts = os.system("pyside6-lrelease.exe ../translate/str_en.ts ../translate/ui_en.ts -qm ../res/tr/tr_en.qm")
sts = os.system("pyside6-lrelease.exe ../translate/str_hk.ts ../translate/ui_hk.ts -qm ../res/tr/tr_hk.qm")
8 changes: 7 additions & 1 deletion src/component/list/comic_list_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def __init__(self, parent):
self.isDelMenu = False
self.isGame = False
self.isLocal = False
self.isLocalEps = False
self.isMoveMenu = False
self.openMenu = False

Expand Down Expand Up @@ -113,7 +114,10 @@ def AddBookByLocal(self, v, category=""):
widget.title = v.title
widget.picNum = v.picCnt
widget.url = v.file
title += "<font color=#d5577c>{}</font>".format("(" + str(v.picCnt) + "P)")
if len(v.eps) > 0:
title += "<font color=#d5577c>{}</font>".format("(" + str(len(v.eps)) + "E)")
else:
title += "<font color=#d5577c>{}</font>".format("(" + str(v.picCnt) + "P)")
if v.lastReadTime:
categories = "{} {}".format(ToolUtil.GetUpdateStrByTick(v.lastReadTime), Str.GetStr(Str.Looked))

Expand Down Expand Up @@ -247,6 +251,8 @@ def SelectItem(self, item):
assert isinstance(widget, ComicItemWidget)
if self.isGame:
QtOwner().OpenGameInfo(widget.id)
elif self.isLocalEps:
QtOwner().OpenLocalEpsBook(widget.id)
elif self.isLocal:
QtOwner().OpenLocalBook(widget.id)
else:
Expand Down
2 changes: 1 addition & 1 deletion src/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

UpdateVersion = "v1.4.5"
RealVersion = "v1.4.5"
TimeVersion = "2023-5-7"
TimeVersion = "2023-8-13"

Waifu2xVersion = "1.1.6"

Expand Down
8,073 changes: 5,989 additions & 2,084 deletions src/images_rc.py

Large diffs are not rendered by default.

123 changes: 69 additions & 54 deletions src/interface/ui_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def setupUi(self, Help):
self.scrollArea.setWidgetResizable(True)
self.scrollAreaWidgetContents = QWidget()
self.scrollAreaWidgetContents.setObjectName(u"scrollAreaWidgetContents")
self.scrollAreaWidgetContents.setGeometry(QRect(0, 0, 753, 718))
self.scrollAreaWidgetContents.setGeometry(QRect(0, 0, 736, 744))
self.verticalLayout_3 = QVBoxLayout(self.scrollAreaWidgetContents)
self.verticalLayout_3.setObjectName(u"verticalLayout_3")
self.horizontalLayout = QHBoxLayout()
Expand Down Expand Up @@ -89,93 +89,106 @@ def setupUi(self, Help):

self.gridLayout.addWidget(self.label_5, 3, 0, 1, 1)

self.verCheck = QPushButton(self.widget_2)
self.verCheck.setObjectName(u"verCheck")

self.gridLayout.addWidget(self.verCheck, 1, 2, 1, 1)

self.logButton = QPushButton(self.widget_2)
self.logButton.setObjectName(u"logButton")
self.dbCheck = QPushButton(self.widget_2)
self.dbCheck.setObjectName(u"dbCheck")

self.gridLayout.addWidget(self.logButton, 5, 2, 1, 1)
self.gridLayout.addWidget(self.dbCheck, 5, 2, 1, 1)

self.label_7 = QLabel(self.widget_2)
self.label_7.setObjectName(u"label_7")
self.label_7.setMinimumSize(QSize(80, 50))
self.label_7.setFont(font)
self.label_4 = QLabel(self.widget_2)
self.label_4.setObjectName(u"label_4")
self.label_4.setMinimumSize(QSize(80, 50))
self.label_4.setFont(font)

self.gridLayout.addWidget(self.label_7, 5, 0, 1, 1)
self.gridLayout.addWidget(self.label_4, 0, 0, 1, 1)

self.localTime = QLabel(self.widget_2)
self.localTime.setObjectName(u"localTime")
self.localTime.setFont(font)

self.gridLayout.addWidget(self.localTime, 4, 1, 1, 1)
self.gridLayout.addWidget(self.localTime, 5, 1, 1, 1)

self.dbCheck = QPushButton(self.widget_2)
self.dbCheck.setObjectName(u"dbCheck")
self.label_6 = QLabel(self.widget_2)
self.label_6.setObjectName(u"label_6")
self.label_6.setMinimumSize(QSize(80, 50))
self.label_6.setFont(font)

self.gridLayout.addWidget(self.dbCheck, 4, 2, 1, 1)
self.gridLayout.addWidget(self.label_6, 2, 0, 1, 1)

self.label_4 = QLabel(self.widget_2)
self.label_4.setObjectName(u"label_4")
self.label_4.setMinimumSize(QSize(80, 50))
self.label_4.setFont(font)
self.upTimeLabel = QLabel(self.widget_2)
self.upTimeLabel.setObjectName(u"upTimeLabel")
self.upTimeLabel.setFont(font)

self.gridLayout.addWidget(self.label_4, 0, 0, 1, 1)
self.gridLayout.addWidget(self.upTimeLabel, 1, 1, 1, 1)

self.verCheck = QPushButton(self.widget_2)
self.verCheck.setObjectName(u"verCheck")

self.gridLayout.addWidget(self.verCheck, 1, 2, 1, 1)

self.localNum = QLabel(self.widget_2)
self.localNum.setObjectName(u"localNum")
self.localNum.setFont(font)

self.gridLayout.addWidget(self.localNum, 3, 1, 1, 1)

self.label_9 = QLabel(self.widget_2)
self.label_9.setObjectName(u"label_9")
self.label_9.setFont(font)
self.openCmd = QPushButton(self.widget_2)
self.openCmd.setObjectName(u"openCmd")

self.gridLayout.addWidget(self.label_9, 1, 0, 1, 1)
self.gridLayout.addWidget(self.openCmd, 6, 1, 1, 1)

self.preCheckBox = QCheckBox(self.widget_2)
self.preCheckBox.setObjectName(u"preCheckBox")

self.gridLayout.addWidget(self.preCheckBox, 0, 2, 1, 1)

self.version = QLabel(self.widget_2)
self.version.setObjectName(u"version")
self.version.setFont(font)

self.gridLayout.addWidget(self.version, 0, 1, 1, 1)

self.label_6 = QLabel(self.widget_2)
self.label_6.setObjectName(u"label_6")
self.label_6.setMinimumSize(QSize(80, 50))
self.label_6.setFont(font)
self.label_9 = QLabel(self.widget_2)
self.label_9.setObjectName(u"label_9")
self.label_9.setFont(font)

self.gridLayout.addWidget(self.label_6, 2, 0, 1, 1)
self.gridLayout.addWidget(self.label_9, 1, 0, 1, 1)

self.logButton = QPushButton(self.widget_2)
self.logButton.setObjectName(u"logButton")

self.gridLayout.addWidget(self.logButton, 6, 2, 1, 1)

self.label_7 = QLabel(self.widget_2)
self.label_7.setObjectName(u"label_7")
self.label_7.setMinimumSize(QSize(80, 50))
self.label_7.setFont(font)

self.gridLayout.addWidget(self.label_7, 6, 0, 1, 1)

self.label_11 = QLabel(self.widget_2)
self.label_11.setObjectName(u"label_11")
self.label_11.setFont(font)

self.gridLayout.addWidget(self.label_11, 4, 0, 1, 1)

self.upTimeLabel = QLabel(self.widget_2)
self.upTimeLabel.setObjectName(u"upTimeLabel")
self.upTimeLabel.setFont(font)

self.gridLayout.addWidget(self.upTimeLabel, 1, 1, 1, 1)
self.gridLayout.addWidget(self.label_11, 5, 0, 1, 1)

self.waifu2x = QLabel(self.widget_2)
self.waifu2x.setObjectName(u"waifu2x")
self.waifu2x.setFont(font)

self.gridLayout.addWidget(self.waifu2x, 2, 1, 1, 1)

self.openCmd = QPushButton(self.widget_2)
self.openCmd.setObjectName(u"openCmd")
self.label_10 = QLabel(self.widget_2)
self.label_10.setObjectName(u"label_10")
self.label_10.setMinimumSize(QSize(80, 50))
self.label_10.setFont(font)

self.gridLayout.addWidget(self.openCmd, 5, 1, 1, 1)
self.gridLayout.addWidget(self.label_10, 4, 0, 1, 1)

self.preCheckBox = QCheckBox(self.widget_2)
self.preCheckBox.setObjectName(u"preCheckBox")
self.localVer = QLabel(self.widget_2)
self.localVer.setObjectName(u"localVer")
self.localVer.setFont(font)

self.gridLayout.addWidget(self.preCheckBox, 0, 2, 1, 1)
self.gridLayout.addWidget(self.localVer, 4, 1, 1, 1)


self.verticalLayout_2.addWidget(self.widget_2)
Expand Down Expand Up @@ -239,21 +252,23 @@ def retranslateUi(self, Help):
self.label_3.setText(QCoreApplication.translate("Help", u"\u60f3\u63d0\u4f9b\u4e00\u4e9b\u5efa\u8bae\uff1f", None))
self.pushButton.setText(QCoreApplication.translate("Help", u"Github Issue", None))
self.label_5.setText(QCoreApplication.translate("Help", u"\u672c\u5730\u5e93\u6570\u91cf:", None))
self.verCheck.setText(QCoreApplication.translate("Help", u"\u68c0\u6d4b\u66f4\u65b0", None))
self.logButton.setText(QCoreApplication.translate("Help", u"\u6253\u5f00\u65e5\u5fd7\u76ee\u5f55", None))
self.label_7.setText(QCoreApplication.translate("Help", u"\u65e5\u5fd7:", None))
self.localTime.setText("")
self.dbCheck.setText(QCoreApplication.translate("Help", u"\u68c0\u6d4b\u66f4\u65b0", None))
self.label_4.setText(QCoreApplication.translate("Help", u"\u7248\u672c\u53f7:", None))
self.localNum.setText("")
self.label_9.setText(QCoreApplication.translate("Help", u"\u4e0a\u6b21\u66f4\u65b0\u65f6\u95f4\uff1a", None))
self.version.setText(QCoreApplication.translate("Help", u"v1.2.8", None))
self.localTime.setText("")
self.label_6.setText(QCoreApplication.translate("Help", u"waifu2x\u7248\u672c:", None))
self.label_11.setText(QCoreApplication.translate("Help", u"\u672c\u5730\u6570\u636e\u4e0a\u6b21\u66f4\u65b0:", None))
self.upTimeLabel.setText(QCoreApplication.translate("Help", u"2021-11-27", None))
self.waifu2x.setText(QCoreApplication.translate("Help", u"v1.0.8", None))
self.verCheck.setText(QCoreApplication.translate("Help", u"\u68c0\u6d4b\u66f4\u65b0", None))
self.localNum.setText("")
self.openCmd.setText(QCoreApplication.translate("Help", u"\u6253\u5f00\u63a7\u5236\u53f0", None))
self.preCheckBox.setText(QCoreApplication.translate("Help", u"\u63a5\u53d7Beta\u7248\u672c\u66f4\u65b0", None))
self.version.setText(QCoreApplication.translate("Help", u"v1.2.8", None))
self.label_9.setText(QCoreApplication.translate("Help", u"\u4e0a\u6b21\u66f4\u65b0\u65f6\u95f4\uff1a", None))
self.logButton.setText(QCoreApplication.translate("Help", u"\u6253\u5f00\u65e5\u5fd7\u76ee\u5f55", None))
self.label_7.setText(QCoreApplication.translate("Help", u"\u65e5\u5fd7:", None))
self.label_11.setText(QCoreApplication.translate("Help", u"\u672c\u5730\u6570\u636e\u4e0a\u6b21\u66f4\u65b0:", None))
self.waifu2x.setText(QCoreApplication.translate("Help", u"v1.0.8", None))
self.label_10.setText(QCoreApplication.translate("Help", u"\u672c\u5730\u5e93\u7248\u672c\uff1a", None))
self.localVer.setText("")
self.label_8.setText(QCoreApplication.translate("Help", u"\u65b0\u7248\u672c\uff1a", None))
self.updateLabel.setText("")
self.updateButton.setText(QCoreApplication.translate("Help", u"\u524d\u5f80\u66f4\u65b0", None))
Expand Down
49 changes: 34 additions & 15 deletions src/interface/ui_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
QImage, QKeySequence, QLinearGradient, QPainter,
QPalette, QPixmap, QRadialGradient, QTransform)
from PySide6.QtWidgets import (QApplication, QComboBox, QFrame, QGridLayout,
QHBoxLayout, QLabel, QListWidgetItem, QPushButton,
QSizePolicy, QSpacerItem, QSpinBox, QWidget)
QHBoxLayout, QLabel, QLineEdit, QListWidgetItem,
QPushButton, QSizePolicy, QSpacerItem, QSpinBox,
QWidget)

from component.list.comic_list_widget import ComicListWidget
from component.list.tag_list_widget import TagListWidget
Expand All @@ -29,6 +30,17 @@ def setupUi(self, Local):
Local.resize(628, 334)
self.gridLayout_2 = QGridLayout(Local)
self.gridLayout_2.setObjectName(u"gridLayout_2")
self.gridLayout_3 = QGridLayout()
self.gridLayout_3.setObjectName(u"gridLayout_3")
self.bookList = ComicListWidget(Local)
self.bookList.setObjectName(u"bookList")
self.bookList.setStyleSheet(u"")

self.gridLayout_3.addWidget(self.bookList, 0, 0, 1, 1)


self.gridLayout_2.addLayout(self.gridLayout_3, 3, 0, 1, 1)

self.horizontalLayout_2 = QHBoxLayout()
self.horizontalLayout_2.setObjectName(u"horizontalLayout_2")
self.tagsList = TagListWidget(Local)
Expand Down Expand Up @@ -67,18 +79,7 @@ def setupUi(self, Local):
self.horizontalLayout_2.addWidget(self.toolButton, 0, Qt.AlignRight)


self.gridLayout_2.addLayout(self.horizontalLayout_2, 0, 0, 1, 1)

self.gridLayout_3 = QGridLayout()
self.gridLayout_3.setObjectName(u"gridLayout_3")
self.bookList = ComicListWidget(Local)
self.bookList.setObjectName(u"bookList")
self.bookList.setStyleSheet(u"")

self.gridLayout_3.addWidget(self.bookList, 0, 0, 1, 1)


self.gridLayout_2.addLayout(self.gridLayout_3, 2, 0, 1, 1)
self.gridLayout_2.addLayout(self.horizontalLayout_2, 1, 0, 1, 1)

self.gridLayout_4 = QGridLayout()
self.gridLayout_4.setObjectName(u"gridLayout_4")
Expand Down Expand Up @@ -168,7 +169,24 @@ def setupUi(self, Local):
self.gridLayout_4.addLayout(self.horizontalLayout, 0, 0, 1, 1)


self.gridLayout_2.addLayout(self.gridLayout_4, 3, 0, 1, 1)
self.gridLayout_2.addLayout(self.gridLayout_4, 4, 0, 1, 1)

self.widget = QWidget(Local)
self.widget.setObjectName(u"widget")
self.horizontalLayout_3 = QHBoxLayout(self.widget)
self.horizontalLayout_3.setObjectName(u"horizontalLayout_3")
self.label = QLabel(self.widget)
self.label.setObjectName(u"label")

self.horizontalLayout_3.addWidget(self.label)

self.lineEdit = QLineEdit(self.widget)
self.lineEdit.setObjectName(u"lineEdit")

self.horizontalLayout_3.addWidget(self.lineEdit)


self.gridLayout_2.addWidget(self.widget, 0, 0, 1, 1)


self.retranslateUi(Local)
Expand All @@ -194,5 +212,6 @@ def retranslateUi(self, Local):
#if QT_CONFIG(shortcut)
self.jumpButton.setShortcut(QCoreApplication.translate("Local", u"Return", None))
#endif // QT_CONFIG(shortcut)
self.label.setText(QCoreApplication.translate("Local", u"\u641c\u7d22\uff1a", None))
# retranslateUi

Loading

0 comments on commit 97a2e18

Please sign in to comment.