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 f7293d6 commit e723ed8
Show file tree
Hide file tree
Showing 8 changed files with 128,777 additions and 128,171 deletions.
2 changes: 2 additions & 0 deletions res/images.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@
<file>icon/svip.png</file>
<file>icon/nv.png</file>
<file>icon/icon_picacg.png</file>
<file>icon/clear_on.png</file>
<file>icon/clear_off.png</file>
</qresource>
<qresource prefix="icon">
<file>theme/dark_pink/disabled/base.svg</file>
Expand Down
8 changes: 5 additions & 3 deletions src/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
Issues2 = "https://hub.ggo.icu/tonquer/picacg-qt/issues"
Issues3 = "https://hub.fastgit.xyz/tonquer/picacg-qt/issues"

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

Waifu2xVersion = "1.1.6"
Expand Down Expand Up @@ -86,6 +86,7 @@
ImageServer2Jump = 'img.picacomic.com' # 分流2 跳转的图片服务器

ImageServer3 = 'storage.diwodiwo.xyz' # 分流3 使用的图片服务器
ImageServer3Jump = 'img.diwodiwo.xyz' # 分流3 使用的图片服务器

ProxyApiDomain = "bika-api.ggo.icu"
ProxyImgDomain = "bika-img.ggo.icu"
Expand All @@ -100,7 +101,8 @@

ImageDomain = [
"s3.picacomic.com",
"storage.diwodiwo.xyz",
# "storage.diwodiwo.xyz",
# "img.diwodiwo.xyz",
"storage1.picacomic.com",
"img.tipatipa.xyz",
"img.picacomic.com",
Expand Down
256,771 changes: 128,635 additions & 128,136 deletions src/images_rc.py

Large diffs are not rendered by default.

34 changes: 26 additions & 8 deletions src/interface/ui_book_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,21 @@
QFrame, QGridLayout, QHBoxLayout, QLabel,
QLayout, QListView, QListWidgetItem, QPlainTextEdit,
QPushButton, QSizePolicy, QSpacerItem, QTabWidget,
QVBoxLayout, QWidget)
QToolButton, QVBoxLayout, QWidget)

from component.button.icon_tool_button import IconToolButton
from component.label.head_label import HeadLabel
from component.list.eps_list_widget import EpsListWidget
from component.list.tag_list_widget import TagListWidget
from component.scroll_area.smooth_scroll_area import SmoothScrollArea
import images_rc
import images_rc

class Ui_BookInfo(object):
def setupUi(self, BookInfo):
if not BookInfo.objectName():
BookInfo.setObjectName(u"BookInfo")
BookInfo.resize(838, 705)
BookInfo.resize(1084, 705)
BookInfo.setStyleSheet(u"QToolButton\n"
"{\n"
"background-color:transparent;\n"
Expand Down Expand Up @@ -69,7 +70,7 @@ def setupUi(self, BookInfo):
self.scrollArea.setWidgetResizable(True)
self.scrollAreaWidgetContents = QWidget()
self.scrollAreaWidgetContents.setObjectName(u"scrollAreaWidgetContents")
self.scrollAreaWidgetContents.setGeometry(QRect(0, 0, 818, 685))
self.scrollAreaWidgetContents.setGeometry(QRect(0, 0, 1064, 685))
self.verticalLayout_3 = QVBoxLayout(self.scrollAreaWidgetContents)
self.verticalLayout_3.setObjectName(u"verticalLayout_3")
self.gridLayout_3 = QGridLayout()
Expand Down Expand Up @@ -314,6 +315,7 @@ def setupUi(self, BookInfo):
self.starButton.setIconSize(QSize(50, 50))
self.starButton.setCheckable(False)
self.starButton.setChecked(False)
self.starButton.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)

self.horizontalLayout_2.addWidget(self.starButton)

Expand All @@ -328,6 +330,7 @@ def setupUi(self, BookInfo):
self.favoriteButton.setIcon(icon1)
self.favoriteButton.setIconSize(QSize(50, 50))
self.favoriteButton.setCheckable(False)
self.favoriteButton.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)

self.horizontalLayout_2.addWidget(self.favoriteButton)

Expand All @@ -340,6 +343,7 @@ def setupUi(self, BookInfo):
icon2.addFile(u":/png/icon/icon_comment.png", QSize(), QIcon.Normal, QIcon.Off)
self.commentButton.setIcon(icon2)
self.commentButton.setIconSize(QSize(50, 50))
self.commentButton.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)

self.horizontalLayout_2.addWidget(self.commentButton)

Expand All @@ -352,9 +356,21 @@ def setupUi(self, BookInfo):
icon3.addFile(u":/png/icon/ic_get_app_black_36dp.png", QSize(), QIcon.Normal, QIcon.Off)
self.downloadButton.setIcon(icon3)
self.downloadButton.setIconSize(QSize(50, 50))
self.downloadButton.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)

self.horizontalLayout_2.addWidget(self.downloadButton)

self.clearButton = QToolButton(self.tab)
self.clearButton.setObjectName(u"clearButton")
self.clearButton.setMinimumSize(QSize(40, 40))
icon4 = QIcon()
icon4.addFile(u":/png/icon/clear_off.png", QSize(), QIcon.Normal, QIcon.Off)
self.clearButton.setIcon(icon4)
self.clearButton.setIconSize(QSize(50, 50))
self.clearButton.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)

self.horizontalLayout_2.addWidget(self.clearButton)

self.startRead = QPushButton(self.tab)
self.startRead.setObjectName(u"startRead")
self.startRead.setMinimumSize(QSize(0, 40))
Expand Down Expand Up @@ -477,8 +493,9 @@ def setupUi(self, BookInfo):
self.starButton.clicked.connect(BookInfo.AddBookLike)
self.favoriteButton.clicked.connect(BookInfo.AddFavorite)
self.downloadButton.clicked.connect(BookInfo.AddDownload)
self.clearButton.clicked.connect(BookInfo.ClearCache)

self.tabWidget.setCurrentIndex(1)
self.tabWidget.setCurrentIndex(0)


QMetaObject.connectSlotsByName(BookInfo)
Expand All @@ -501,10 +518,11 @@ def retranslateUi(self, BookInfo):
self.user_icon.setText(QCoreApplication.translate("BookInfo", u"TextLabel", None))
self.user_name.setText(QCoreApplication.translate("BookInfo", u"TextLabel", None))
self.updateTick.setText(QCoreApplication.translate("BookInfo", u"TextLabel", None))
self.starButton.setText("")
self.favoriteButton.setText("")
self.commentButton.setText("")
self.downloadButton.setText("")
self.starButton.setText(QCoreApplication.translate("BookInfo", u"\u7231\u5fc3", None))
self.favoriteButton.setText(QCoreApplication.translate("BookInfo", u"\u6536\u85cf", None))
self.commentButton.setText(QCoreApplication.translate("BookInfo", u"\u8bc4\u8bba", None))
self.downloadButton.setText(QCoreApplication.translate("BookInfo", u"\u4e0b\u8f7d", None))
self.clearButton.setText(QCoreApplication.translate("BookInfo", u"\u6e05\u7406", None))
self.startRead.setText(QCoreApplication.translate("BookInfo", u"\u5f00\u59cb\u9605\u8bfb", None))
self.pageLabel.setText(QCoreApplication.translate("BookInfo", u"\u5206\u9875\uff1a", None))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), QCoreApplication.translate("BookInfo", u"\u9605\u8bfb", None))
Expand Down
2 changes: 2 additions & 0 deletions src/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ def UpdateDns(self, address, imageAddress):
AllDomain = config.ApiDomain[:]
AllDomain.append(config.ImageServer2)
AllDomain.append(config.ImageServer2Jump)
# AllDomain.append(config.ImageServer3Jump)
for domain in AllDomain:
if is_ipaddress(address):
host_table[domain] = address
Expand All @@ -138,6 +139,7 @@ def UpdateDns(self, address, imageAddress):
host_table[domain] = imageAddress
elif not imageAddress and domain in host_table:
host_table.pop(domain)

# 换一个,清空pool
self.session = requests.session()
return
Expand Down
27 changes: 26 additions & 1 deletion src/view/info/book_info_view.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import json
import os
import shutil

from PySide6 import QtWidgets, QtCore, QtGui
from PySide6.QtCore import Qt, QSize, QEvent, Signal
from PySide6.QtGui import QColor, QFont, QPixmap, QIcon
from PySide6.QtWidgets import QListWidgetItem, QLabel, QApplication, QScroller, QPushButton, QButtonGroup
from PySide6.QtWidgets import QListWidgetItem, QLabel, QApplication, QScroller, QPushButton, QButtonGroup, QMessageBox

from component.layout.flow_layout import FlowLayout
from config.setting import Setting
Expand Down Expand Up @@ -108,6 +110,13 @@ def UpdateFavoriteIcon(self):
else:
self.favoriteButton.setIcon(QIcon(":/png/icon/icon_like_off.png"))

path = os.path.join(os.path.join(Setting.SavePath.value, config.CachePathDir), "book/{}".format(self.bookId))
waifuPath = os.path.join(os.path.join(Setting.SavePath.value, config.CachePathDir), "waifu2x/book/{}".format(self.bookId))
if os.path.isdir(path) or os.path.isdir(waifuPath):
self.clearButton.setIcon(QIcon(":/png/icon/clear_on.png"))
else:
self.clearButton.setIcon(QIcon(":/png/icon/clear_off.png"))

def UpdateLikeIcon(self):
p = QPixmap()
if not self.isLike:
Expand Down Expand Up @@ -450,6 +459,22 @@ def AddFavorite(self):
else:
QtOwner().favoriteView.DelAndFavoritesBack({"st": Status.Ok}, self.bookId)

def ClearCache(self):
isClear = QMessageBox.information(self, '清除缓存', "是否清除本书所有缓存", QtWidgets.QMessageBox.Yes|QtWidgets.QMessageBox.No)
if isClear == QtWidgets.QMessageBox.Yes:
if not Setting.SavePath.value:
return
path = os.path.join(os.path.join(Setting.SavePath.value, config.CachePathDir),
"book/{}".format(self.bookId))
waifuPath = os.path.join(os.path.join(Setting.SavePath.value, config.CachePathDir),
"waifu2x/book/{}".format(self.bookId))
if os.path.isdir(path):
shutil.rmtree(path, True)
if os.path.isdir(waifuPath):
shutil.rmtree(waifuPath, True)
self.UpdateFavoriteIcon()


def OpenReadImg(self, modelIndex):
index = modelIndex.row()
item = self.epsListWidget.item(index)
Expand Down
8 changes: 5 additions & 3 deletions src/view/read/read_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ def _NextPage(self):

if self.curIndex >= self.maxPic - 1:
if self.readImg.isLocal:
QtOwner().ShowMsg(Str.GetStr(Str.AlreadyNextPage))
QtOwner().ShowMsg(Str.GetStr(Str.AutoSkipNext))
self.OpenNextEps()
return
elif self.readImg.isOffline:
if not QtOwner().downloadView.IsDownloadEpsId(self.readImg.bookId, self.readImg.epsId + 1):
Expand Down Expand Up @@ -225,7 +226,8 @@ def _LastPage(self):

if self.curIndex <= 0:
if self.readImg.isLocal:
QtOwner().ShowMsg(Str.GetStr(Str.AlreadyLastPage))
QtOwner().ShowMsg(Str.GetStr(Str.AutoSkipLast))
self.OpenLastEps()
return
elif self.readImg.isOffline:
if not QtOwner().downloadView.IsDownloadEpsId(self.readImg.bookId, self.readImg.epsId - 1):
Expand Down Expand Up @@ -376,7 +378,7 @@ def OpenNextEps(self):
bookInfo = BookMgr().books.get(bookId)
epsId += 1
if self.readImg.isLocal:
if epsId >= len(self.readImg._cacheBook):
if epsId >= len(self.readImg._cacheBook.eps):
QtOwner().ShowMsg(Str.GetStr(Str.AlreadyNextChapter))
return
self.readImg.OpenLocalPage(self.readImg._cacheBook, epsId, 0)
Expand Down
Loading

0 comments on commit e723ed8

Please sign in to comment.