update v.1.4.5

This commit is contained in:
tonquer 2023-05-07 20:52:18 +08:00
parent 71367ff54b
commit 69bd22ab68
40 changed files with 4613 additions and 354 deletions

BIN
res/icon/nv.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

BIN
res/icon/svip.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
res/icon/vip.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -79,6 +79,10 @@
<file>icon/cat_random.jpg</file>
<file>icon/cat_leaderboard.jpg</file>
<file>icon/new.svg</file>
<file>icon/vip.png</file>
<file>icon/svip.png</file>
<file>icon/nv.png</file>
<file>icon/icon_picacg.png</file>
</qresource>
<qresource prefix="icon">
<file>theme/dark_pink/disabled/base.svg</file>

View File

@ -26,7 +26,7 @@ class BaseListWidget(QListWidget, QtTaskBase):
if Setting.IsGrabGesture.value:
QScroller.grabGesture(self, QScroller.LeftMouseButtonGesture)
propertiesOne = QScroller.scroller(self).scrollerProperties()
print(propertiesOne.scrollMetric(propertiesOne.MousePressEventDelay))
# print(propertiesOne.scrollMetric(propertiesOne.MousePressEventDelay))
propertiesOne.setScrollMetric(QScrollerProperties.MousePressEventDelay, 1)
propertiesOne.setScrollMetric(QScrollerProperties.VerticalOvershootPolicy, QScrollerProperties.OvershootAlwaysOff)
propertiesOne.setScrollMetric(QScrollerProperties.HorizontalOvershootPolicy, QScrollerProperties.OvershootAlwaysOff)
@ -80,8 +80,8 @@ class BaseListWidget(QListWidget, QtTaskBase):
if self.vScrollBar:
self.vScrollBar.ScrollValue(-arg__1.angleDelta().y())
else:
print(self.verticalScrollMode())
print(self.verticalScrollBar().singleStep())
# print(self.verticalScrollMode())
# print(self.verticalScrollBar().singleStep())
return QListWidget.wheelEvent(self, arg__1)
def OnActionTriggered(self):

View File

@ -165,6 +165,7 @@ class UserListWidget(BaseListWidget):
iwidget.starButton.hide()
# iwidget.commentLabel.setTextInteractionFlags(Qt.TextSelectableByKeyboard)
iwidget.commentLabel.setTextInteractionFlags(Qt.NoTextInteraction)
iwidget.setToolTip(slogan)
iwidget.id = id
iwidget.commentLabel.setText(description)

View File

@ -52,7 +52,7 @@ class SmoothScroll:
def __smoothMove(self):
""" 计时器溢出时进行平滑滚动 """
totalDelta = 0
# 计算所有未处理完事件的滚动距离,定时器每溢出一次就将步数-1
# 计算所有未处理完事件的滚动距离,定时器每溢出 一次就将步数-1
for i in self.stepsLeftQueue:
totalDelta += self.__subDelta(i[0], i[1])
i[1] -= 1
@ -72,6 +72,7 @@ class SmoothScroll:
Qt.ScrollBegin,
False
)
# print("old {}".format(self.verticalScrollBar().value()))
QApplication.sendEvent(self.verticalScrollBar(), e)
else:
# 构造滚轮事件

View File

@ -52,9 +52,9 @@ Issues1 = "https://github.com/tonquer/picacg-qt/issues"
Issues2 = "https://hub.ggo.icu/tonquer/picacg-qt/issues"
Issues3 = "https://hub.fastgit.xyz/tonquer/picacg-qt/issues"
UpdateVersion = "v1.4.4"
RealVersion = "v1.4.4"
TimeVersion = "2023-3-19"
UpdateVersion = "v1.4.5"
RealVersion = "v1.4.5"
TimeVersion = "2023-5-7"
Waifu2xVersion = "1.1.6"

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -16,7 +16,8 @@ from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
QImage, QKeySequence, QLinearGradient, QPainter,
QPalette, QPixmap, QRadialGradient, QTransform)
from PySide6.QtWidgets import (QApplication, QGridLayout, QHBoxLayout, QLabel,
QSizePolicy, QSpacerItem, QVBoxLayout, QWidget)
QSizePolicy, QSpacerItem, QToolButton, QVBoxLayout,
QWidget)
from component.label.head_label import HeadLabel
import images_rc
@ -25,7 +26,7 @@ class Ui_ChatNewRoomMsg(object):
def setupUi(self, ChatNewRoomMsg):
if not ChatNewRoomMsg.objectName():
ChatNewRoomMsg.setObjectName(u"ChatNewRoomMsg")
ChatNewRoomMsg.resize(636, 299)
ChatNewRoomMsg.resize(749, 299)
ChatNewRoomMsg.setStyleSheet(u"QWidget#widget{\n"
" border-image:url(:png/icon/skin_aio_friend_bubble_pressed.9.png) 50;\n"
" border-width: 45;\n"
@ -70,16 +71,6 @@ class Ui_ChatNewRoomMsg(object):
self.gridLayout = QGridLayout()
self.gridLayout.setSpacing(1)
self.gridLayout.setObjectName(u"gridLayout")
self.nameLabel = QLabel(ChatNewRoomMsg)
self.nameLabel.setObjectName(u"nameLabel")
self.nameLabel.setMinimumSize(QSize(0, 20))
self.nameLabel.setMaximumSize(QSize(16777215, 30))
font = QFont()
font.setPointSize(12)
self.nameLabel.setFont(font)
self.gridLayout.addWidget(self.nameLabel, 0, 0, 1, 1)
self.horizontalLayout = QHBoxLayout()
self.horizontalLayout.setSpacing(6)
self.horizontalLayout.setObjectName(u"horizontalLayout")
@ -110,7 +101,7 @@ class Ui_ChatNewRoomMsg(object):
self.horizontalLayout.addItem(self.horizontalSpacer_2)
self.gridLayout.addLayout(self.horizontalLayout, 1, 0, 1, 1)
self.gridLayout.addLayout(self.horizontalLayout, 2, 0, 1, 1)
self.widget = QWidget(ChatNewRoomMsg)
self.widget.setObjectName(u"widget")
@ -135,6 +126,8 @@ class Ui_ChatNewRoomMsg(object):
self.replayLabel = QLabel(self.replayWidget)
self.replayLabel.setObjectName(u"replayLabel")
self.replayLabel.setMinimumSize(QSize(40, 50))
font = QFont()
font.setPointSize(12)
self.replayLabel.setFont(font)
self.replayLabel.setStyleSheet(u"padding-left:20px;\n"
"padding-right:10px;")
@ -182,7 +175,60 @@ class Ui_ChatNewRoomMsg(object):
self.verticalLayout_3.addWidget(self.infoLabel)
self.gridLayout.addWidget(self.widget, 4, 0, 1, 1)
self.gridLayout.addWidget(self.widget, 5, 0, 1, 1)
self.horizontalLayout_4 = QHBoxLayout()
self.horizontalLayout_4.setObjectName(u"horizontalLayout_4")
self.nameLabel = QLabel(ChatNewRoomMsg)
self.nameLabel.setObjectName(u"nameLabel")
self.nameLabel.setMinimumSize(QSize(0, 20))
self.nameLabel.setMaximumSize(QSize(16777215, 30))
self.nameLabel.setFont(font)
self.horizontalLayout_4.addWidget(self.nameLabel)
self.vipIcon = QToolButton(ChatNewRoomMsg)
self.vipIcon.setObjectName(u"vipIcon")
icon = QIcon()
icon.addFile(u":/png/icon/vip.png", QSize(), QIcon.Normal, QIcon.Off)
self.vipIcon.setIcon(icon)
self.vipIcon.setIconSize(QSize(32, 32))
self.horizontalLayout_4.addWidget(self.vipIcon)
self.managerIcon = QToolButton(ChatNewRoomMsg)
self.managerIcon.setObjectName(u"managerIcon")
icon1 = QIcon()
icon1.addFile(u":/png/icon/svip.png", QSize(), QIcon.Normal, QIcon.Off)
self.managerIcon.setIcon(icon1)
self.managerIcon.setIconSize(QSize(32, 32))
self.horizontalLayout_4.addWidget(self.managerIcon)
self.nvIcon = QToolButton(ChatNewRoomMsg)
self.nvIcon.setObjectName(u"nvIcon")
icon2 = QIcon()
icon2.addFile(u":/png/icon/nv.png", QSize(), QIcon.Normal, QIcon.Off)
self.nvIcon.setIcon(icon2)
self.nvIcon.setIconSize(QSize(32, 32))
self.horizontalLayout_4.addWidget(self.nvIcon)
self.officialIcon = QToolButton(ChatNewRoomMsg)
self.officialIcon.setObjectName(u"officialIcon")
icon3 = QIcon()
icon3.addFile(u":/png/icon/icon_picacg.png", QSize(), QIcon.Normal, QIcon.Off)
self.officialIcon.setIcon(icon3)
self.officialIcon.setIconSize(QSize(32, 32))
self.horizontalLayout_4.addWidget(self.officialIcon)
self.horizontalSpacer_3 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
self.horizontalLayout_4.addItem(self.horizontalSpacer_3)
self.gridLayout.addLayout(self.horizontalLayout_4, 1, 0, 1, 1)
self.gridLayout_2.addLayout(self.gridLayout, 0, 1, 1, 1)
@ -196,7 +242,6 @@ class Ui_ChatNewRoomMsg(object):
def retranslateUi(self, ChatNewRoomMsg):
ChatNewRoomMsg.setWindowTitle(QCoreApplication.translate("ChatNewRoomMsg", u"Form", None))
self.picLabel.setText("")
self.nameLabel.setText(QCoreApplication.translate("ChatNewRoomMsg", u"TextLabel", None))
self.indexLabel.setText(QCoreApplication.translate("ChatNewRoomMsg", u"X\u697c", None))
self.levelLabel.setText(QCoreApplication.translate("ChatNewRoomMsg", u"LV", None))
self.titleLabel.setText(QCoreApplication.translate("ChatNewRoomMsg", u"TextLabel", None))
@ -205,5 +250,22 @@ class Ui_ChatNewRoomMsg(object):
self.commentLabel.setText(QCoreApplication.translate("ChatNewRoomMsg", u"TextLabel", None))
self.pic2Label.setText("")
self.infoLabel.setText(QCoreApplication.translate("ChatNewRoomMsg", u"TextLabel", None))
self.nameLabel.setText(QCoreApplication.translate("ChatNewRoomMsg", u"TextLabel", None))
#if QT_CONFIG(tooltip)
self.vipIcon.setToolTip(QCoreApplication.translate("ChatNewRoomMsg", u"vip\u7528\u6237", None))
#endif // QT_CONFIG(tooltip)
self.vipIcon.setText(QCoreApplication.translate("ChatNewRoomMsg", u"...", None))
#if QT_CONFIG(tooltip)
self.managerIcon.setToolTip(QCoreApplication.translate("ChatNewRoomMsg", u"\u623f\u7ba1", None))
#endif // QT_CONFIG(tooltip)
self.managerIcon.setText("")
#if QT_CONFIG(tooltip)
self.nvIcon.setToolTip(QCoreApplication.translate("ChatNewRoomMsg", u"\u5973\u83e9\u8428", None))
#endif // QT_CONFIG(tooltip)
self.nvIcon.setText(QCoreApplication.translate("ChatNewRoomMsg", u"...", None))
#if QT_CONFIG(tooltip)
self.officialIcon.setToolTip(QCoreApplication.translate("ChatNewRoomMsg", u"\u54d4\u5494\u5b98\u65b9", None))
#endif // QT_CONFIG(tooltip)
self.officialIcon.setText(QCoreApplication.translate("ChatNewRoomMsg", u"...", None))
# retranslateUi

View File

@ -45,6 +45,16 @@ class Ui_ChatRoom(object):
self.horizontalLayout_3.addItem(self.horizontalSpacer_2)
self.label = QLabel(ChatRoom)
self.label.setObjectName(u"label")
self.horizontalLayout_3.addWidget(self.label)
self.onlineNum = QLabel(ChatRoom)
self.onlineNum.setObjectName(u"onlineNum")
self.horizontalLayout_3.addWidget(self.onlineNum)
self.numLabel = QLabel(ChatRoom)
self.numLabel.setObjectName(u"numLabel")
@ -161,6 +171,8 @@ class Ui_ChatRoom(object):
ChatRoom.setWindowTitle(QCoreApplication.translate("ChatRoom", u"\u804a\u5929\u5ba4", None))
self.atLabel.setText(QCoreApplication.translate("ChatRoom", u"PushButton", None))
self.nameLabel.setText(QCoreApplication.translate("ChatRoom", u"TextLabel", None))
self.label.setText(QCoreApplication.translate("ChatRoom", u"\u5728\u7ebf\u4eba\u6570\uff1a", None))
self.onlineNum.setText(QCoreApplication.translate("ChatRoom", u"0", None))
self.numLabel.setText("")
self.replyLabel.setText(QCoreApplication.translate("ChatRoom", u"PushButton", None))
self.pushButton.setText(QCoreApplication.translate("ChatRoom", u"\u8868\u60c5", None))

View File

@ -70,8 +70,8 @@ class Ui_Download(object):
self.gridLayout.addLayout(self.horizontalLayout, 2, 0, 1, 1)
self.tableWidget = QTableWidget(Download)
if (self.tableWidget.columnCount() < 10):
self.tableWidget.setColumnCount(10)
if (self.tableWidget.columnCount() < 11):
self.tableWidget.setColumnCount(11)
__qtablewidgetitem = QTableWidgetItem()
self.tableWidget.setHorizontalHeaderItem(0, __qtablewidgetitem)
__qtablewidgetitem1 = QTableWidgetItem()
@ -92,6 +92,8 @@ class Ui_Download(object):
self.tableWidget.setHorizontalHeaderItem(8, __qtablewidgetitem8)
__qtablewidgetitem9 = QTableWidgetItem()
self.tableWidget.setHorizontalHeaderItem(9, __qtablewidgetitem9)
__qtablewidgetitem10 = QTableWidgetItem()
self.tableWidget.setHorizontalHeaderItem(10, __qtablewidgetitem10)
self.tableWidget.setObjectName(u"tableWidget")
self.gridLayout.addWidget(self.tableWidget, 5, 0, 1, 1)
@ -121,22 +123,24 @@ class Ui_Download(object):
___qtablewidgetitem = self.tableWidget.horizontalHeaderItem(0)
___qtablewidgetitem.setText(QCoreApplication.translate("Download", u"id", None));
___qtablewidgetitem1 = self.tableWidget.horizontalHeaderItem(1)
___qtablewidgetitem1.setText(QCoreApplication.translate("Download", u"\u6807\u9898", None));
___qtablewidgetitem1.setText(QCoreApplication.translate("Download", u"\u65f6\u95f4", None));
___qtablewidgetitem2 = self.tableWidget.horizontalHeaderItem(2)
___qtablewidgetitem2.setText(QCoreApplication.translate("Download", u"\u4e0b\u8f7d\u8fdb\u5ea6", None));
___qtablewidgetitem2.setText(QCoreApplication.translate("Download", u"\u6807\u9898", None));
___qtablewidgetitem3 = self.tableWidget.horizontalHeaderItem(3)
___qtablewidgetitem3.setText(QCoreApplication.translate("Download", u"\u4e0b\u8f7d\u7ae0\u8282", None));
___qtablewidgetitem3.setText(QCoreApplication.translate("Download", u"\u4e0b\u8f7d\u8fdb\u5ea6", None));
___qtablewidgetitem4 = self.tableWidget.horizontalHeaderItem(4)
___qtablewidgetitem4.setText(QCoreApplication.translate("Download", u"\u4e0b\u8f7d\u901f\u5ea6", None));
___qtablewidgetitem4.setText(QCoreApplication.translate("Download", u"\u4e0b\u8f7d\u7ae0\u8282", None));
___qtablewidgetitem5 = self.tableWidget.horizontalHeaderItem(5)
___qtablewidgetitem5.setText(QCoreApplication.translate("Download", u"\u4e0b\u8f7d\u72b6\u6001", None));
___qtablewidgetitem5.setText(QCoreApplication.translate("Download", u"\u4e0b\u8f7d\u901f\u5ea6", None));
___qtablewidgetitem6 = self.tableWidget.horizontalHeaderItem(6)
___qtablewidgetitem6.setText(QCoreApplication.translate("Download", u"\u8f6c\u6362\u8fdb\u5ea6", None));
___qtablewidgetitem6.setText(QCoreApplication.translate("Download", u"\u4e0b\u8f7d\u72b6\u6001", None));
___qtablewidgetitem7 = self.tableWidget.horizontalHeaderItem(7)
___qtablewidgetitem7.setText(QCoreApplication.translate("Download", u"\u8f6c\u6362\u7ae0\u8282", None));
___qtablewidgetitem7.setText(QCoreApplication.translate("Download", u"\u8f6c\u6362\u8fdb\u5ea6", None));
___qtablewidgetitem8 = self.tableWidget.horizontalHeaderItem(8)
___qtablewidgetitem8.setText(QCoreApplication.translate("Download", u"\u8f6c\u6362\u8017\u65f6", None));
___qtablewidgetitem8.setText(QCoreApplication.translate("Download", u"\u8f6c\u6362\u7ae0\u8282", None));
___qtablewidgetitem9 = self.tableWidget.horizontalHeaderItem(9)
___qtablewidgetitem9.setText(QCoreApplication.translate("Download", u"\u8f6c\u6362\u72b6\u6001", None));
___qtablewidgetitem9.setText(QCoreApplication.translate("Download", u"\u8f6c\u6362\u8017\u65f6", None));
___qtablewidgetitem10 = self.tableWidget.horizontalHeaderItem(10)
___qtablewidgetitem10.setText(QCoreApplication.translate("Download", u"\u8f6c\u6362\u72b6\u6001", None));
# retranslateUi

View File

@ -16,8 +16,9 @@ from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
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
@ -37,7 +38,7 @@ class Ui_Favorite(object):
self.gridLayout_3.addWidget(self.bookList, 0, 0, 1, 1)
self.gridLayout_2.addLayout(self.gridLayout_3, 0, 0, 1, 1)
self.gridLayout_2.addLayout(self.gridLayout_3, 1, 0, 1, 1)
self.gridLayout_4 = QGridLayout()
self.gridLayout_4.setObjectName(u"gridLayout_4")
@ -144,7 +145,24 @@ class Ui_Favorite(object):
self.gridLayout_4.addLayout(self.horizontalLayout, 0, 0, 1, 1)
self.gridLayout_2.addLayout(self.gridLayout_4, 1, 0, 1, 1)
self.gridLayout_2.addLayout(self.gridLayout_4, 2, 0, 1, 1)
self.widget = QWidget(Favorite)
self.widget.setObjectName(u"widget")
self.horizontalLayout_2 = QHBoxLayout(self.widget)
self.horizontalLayout_2.setObjectName(u"horizontalLayout_2")
self.label = QLabel(self.widget)
self.label.setObjectName(u"label")
self.horizontalLayout_2.addWidget(self.label)
self.lineEdit = QLineEdit(self.widget)
self.lineEdit.setObjectName(u"lineEdit")
self.horizontalLayout_2.addWidget(self.lineEdit)
self.gridLayout_2.addWidget(self.widget, 0, 0, 1, 1)
self.retranslateUi(Favorite)
@ -178,5 +196,6 @@ class Ui_Favorite(object):
#if QT_CONFIG(shortcut)
self.jumpButton.setShortcut(QCoreApplication.translate("Favorite", u"Return", None))
#endif // QT_CONFIG(shortcut)
self.label.setText(QCoreApplication.translate("Favorite", u"\u641c\u7d22\uff1a", None))
# retranslateUi

View File

@ -0,0 +1,50 @@
# -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'ui_local_eps.ui'
##
## Created by: Qt User Interface Compiler version 6.2.4
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
QMetaObject, QObject, QPoint, QRect,
QSize, QTime, QUrl, Qt)
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
QFont, QFontDatabase, QGradient, QIcon,
QImage, QKeySequence, QLinearGradient, QPainter,
QPalette, QPixmap, QRadialGradient, QTransform)
from PySide6.QtWidgets import (QApplication, QGridLayout, QListWidgetItem, QSizePolicy,
QWidget)
from component.list.comic_list_widget import ComicListWidget
class Ui_LocalEps(object):
def setupUi(self, LocalEps):
if not LocalEps.objectName():
LocalEps.setObjectName(u"LocalEps")
LocalEps.resize(646, 391)
self.gridLayout_2 = QGridLayout(LocalEps)
self.gridLayout_2.setObjectName(u"gridLayout_2")
self.gridLayout_3 = QGridLayout()
self.gridLayout_3.setObjectName(u"gridLayout_3")
self.bookList = ComicListWidget(LocalEps)
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, 1, 0, 1, 1)
self.retranslateUi(LocalEps)
QMetaObject.connectSlotsByName(LocalEps)
# setupUi
def retranslateUi(self, LocalEps):
LocalEps.setWindowTitle(QCoreApplication.translate("LocalEps", u"\u672c\u5730\u6f2b\u753b\u7ae0\u8282", None))
# retranslateUi

View File

@ -41,6 +41,7 @@ from view.info.game_info_view import GameInfoView
from view.read.read_view import ReadView
from view.search.search_view import SearchView
from view.setting.setting_view import SettingView
from view.tool.local_eps_read_view import LocalEpsReadView
from view.tool.local_read_view import LocalReadView
from view.tool.waifu2x_tool_view import Waifu2xToolView
from view.user.favorite_view import FavoriteView
@ -100,6 +101,9 @@ class Ui_Main(object):
self.indexView = IndexView()
self.indexView.setObjectName(u"indexView")
self.subStackWidget.addWidget(self.indexView)
self.localEpsReadView = LocalEpsReadView()
self.localEpsReadView.setObjectName(u"localEpsReadView")
self.subStackWidget.addWidget(self.localEpsReadView)
self.chatNewView = ChatNewView()
self.chatNewView.setObjectName(u"chatNewView")
self.subStackWidget.addWidget(self.chatNewView)

View File

@ -42,6 +42,7 @@ from view.info.game_info_view import GameInfoView
from view.read.read_view import ReadView
from view.search.search_view import SearchView
from view.setting.setting_view import SettingView
from view.tool.local_eps_read_view import LocalEpsReadView
from view.tool.local_read_view import LocalReadView
from view.tool.waifu2x_tool_view import Waifu2xToolView
from view.user.favorite_view import FavoriteView
@ -170,6 +171,9 @@ class Ui_MainWindows(object):
self.chatNewView = ChatNewView()
self.chatNewView.setObjectName(u"chatNewView")
self.subStackWidget.addWidget(self.chatNewView)
self.localEpsReadView = LocalEpsReadView()
self.localEpsReadView.setObjectName(u"localEpsReadView")
self.subStackWidget.addWidget(self.localEpsReadView)
self.bookEpsView = BookEpsView()
self.bookEpsView.setObjectName(u"bookEpsView")
self.subStackWidget.addWidget(self.bookEpsView)
@ -192,7 +196,7 @@ class Ui_MainWindows(object):
self.retranslateUi(MainWindows)
self.subStackWidget.setCurrentIndex(21)
self.subStackWidget.setCurrentIndex(22)
QMetaObject.connectSlotsByName(MainWindows)

View File

@ -2,6 +2,7 @@ PySide6==6.2.4
websocket-client==0.59.0
requests==2.26.0
urllib3==1.25.11
pillow==8.3.2
waifu2x-vulkan==1.1.6
Pysocks==1.7.1

View File

@ -696,8 +696,8 @@ class GetNewChatProfileReq(ServerReq):
# 发送消息
class SendNewChatMsgReq(ServerReq):
def __init__(self, token, roomId, msg, userMentions, reply):
url = config.NewChatUrl + "room/send-message"
def __init__(self, token, roomId, msg, userMentions, replyId):
url = config.NewChatUrl + "message/send-message"
method = "POST"
header = ToolUtil.GetNewChatHeader()
header["authorization"] = "Bearer " + token,
@ -707,17 +707,17 @@ class SendNewChatMsgReq(ServerReq):
"referenceId": str(uuid.uuid1()),
"userMentions": userMentions,
}
if reply:
data["reply"] = reply
if replyId:
data["replyId"] = replyId
super(self.__class__, self).__init__(url, header,
data, method)
self.token = "Bearer " + token
# 发送消息
# 发送图片
class SendNewChatImgMsgReq(ServerReq):
def __init__(self, token, roomId, msg, filePath):
url = config.NewChatUrl + "room/send-image"
url = config.NewChatUrl + "message/send-image"
method = "POST"
header = ToolUtil.GetNewChatHeader()
header.pop("content-type")
@ -730,6 +730,6 @@ class SendNewChatImgMsgReq(ServerReq):
"roomId": (None, roomId),
"caption": (None, msg),
"referenceId": (None, str(uuid.uuid1())),
"userMentionsJson": (None, "[]"),
"images": (os.path.basename(filePath), open(filePath, 'rb'))
"userMentions": (None, "[]"),
"medias": (os.path.basename(filePath), open(filePath, 'rb'))
}

View File

@ -350,10 +350,23 @@ class SqlServer(Singleton):
cur.execute("COMMIT")
@staticmethod
def SearchFavorite(page, sortKey=0, sortId=0):
def SearchFavorite(page, sortKey=0, sortId=0, searchText=""):
if not searchText:
sql = "select book.id, title, title2, author, chineseTeam, description, epsCount, pages, finished, likesCount, categories, tags," \
"created_at, updated_at, path, fileServer, creator, totalLikes, totalViews from book, favorite where book.id = favorite.id and favorite.user='{}' ".format(
Setting.UserId.value)
else:
sql = "select book.id, title, title2, author, chineseTeam, description, epsCount, pages, finished, likesCount, categories, tags," \
"created_at, updated_at, path, fileServer, creator, totalLikes, totalViews from book, favorite where book.id = favorite.id and favorite.user='{}' ".format(
Setting.UserId.value)
sql += " and (book.title like '%{}%' or ".format(Converter('zh-hans').convert(searchText).replace("'", "''"))
sql += " book.title2 like '%{}%' or ".format(Converter('zh-hans').convert(searchText).replace("'", "''"))
sql += " book.author like '%{}%' or ".format(Converter('zh-hans').convert(searchText).replace("'", "''"))
sql += " book.chineseTeam like '%{}%' or ".format(Converter('zh-hans').convert(searchText).replace("'", "''"))
sql += " book.description like '%{}%' or ".format(Converter('zh-hans').convert(searchText).replace("'", "''"))
sql += " book.tags like '%{}%' or ".format(Converter('zh-hans').convert(searchText).replace("'", "''"))
sql += " book.categories like '%{}%') ".format(Converter('zh-hans').convert(searchText).replace("'", "''"))
if sortKey == 0:
sql += "ORDER BY book.updated_at "

View File

@ -184,17 +184,17 @@ class TaskLocal(TaskBase, QtTaskBase):
return
type = task.type
dir = task.path
if type == 1:
if type == LocalData.Type1:
st, data = self.ParseBookInfoByDir(dir)
datas = [data]
elif type == 2:
elif type == LocalData.Type2:
st, data = self.ParseBookInfoByFile(dir)
datas = [data]
elif type == 3:
elif type == LocalData.Type3:
st, datas = self.ParseBookInfoByFile(dir)
elif type == 4:
elif type == LocalData.Type4:
st, datas = self.ParseBookInfoByFile(dir)
elif type == 5:
elif type == LocalData.Type5:
st, datas = self.ParseBookInfoByFileAll(dir)
self.taskObj.localBack.emit(taskId, st, datas)

View File

@ -84,7 +84,7 @@ class ToolUtil(object):
header = {
"user-agent": "Dart/2.19 (dart:io)",
"accept-encoding":"gzip",
"api-version": "1.0.2",
"api-version": "1.0.3",
"content-type":"application/json; charset=UTF-8",
}
return header

View File

@ -29,6 +29,7 @@ class MsgData:
self.id = ""
self.referenceId = ""
self.type = "TEXT_MESSAGE"
self.createdAt = ""
self.isBlocked = False
self.data = {}
@ -223,6 +224,17 @@ class ChatNewRoomWidget(QWidget, Ui_ChatRoom, QtTaskBase):
self._RecvImageMsg(msg)
elif msg.type == "CONNECTED":
pass
elif msg.type == "INITIAL_MESSAGES":
self._RecvBroadcastInitMsgs(msg)
elif msg.type == "DELETE_MESSAGE_ACTION":
"删除消息"
pass
elif msg.type == "UPDATE_ROOM_ONLINE_USERS_COUNT_ACTION":
onlineCount = msg.data.get("onlineCount", 0)
self.onlineNum.setText(str(onlineCount))
pass
elif msg.type == "PODCAST_IS_LIVE_ACTION":
pass
# if len(data) < 2:
# return
# elif data[0] == "new_connection":
@ -253,21 +265,52 @@ class ChatNewRoomWidget(QWidget, Ui_ChatRoom, QtTaskBase):
self.numLabel.setText(Str.GetStr(Str.OnlineNum) + ": "+str(num))
return
@time_me
def _RecvBroadcastInitMsgs(self, rawMsg):
for v in rawMsg.data.get("messages", []):
msg = MsgData()
msg.ParseData(v)
if msg.type == "TEXT_MESSAGE":
self._RecvBroadcastMsg(msg)
elif msg.type == "IMAGE_MESSAGE":
self._RecvImageMsg(msg)
else:
pass
pass
@time_me
def _RecvBroadcastMsg(self, rawMsg):
data = rawMsg.data
msg = data.get("message", {}).get("message", "")
date = data.get("message", {}).get("date", "")
msg = data.get("message", "")
userMentions = data.get("userMentions", [])
reply = data.get("reply", {})
createdTime = rawMsg.createdAt
timeArray, _ = ToolUtil.GetDateStr(createdTime)
strTime = "{}:{}:{} ".format(timeArray.tm_hour, timeArray.tm_min, timeArray.tm_sec)
name = data.get("profile", {}).get("name", "")
level = data.get("profile", {}).get("level", "")
title = data.get("profile", {}).get("title", "")
characters = data.get("profile", {}).get("characters", [])
info = ChatNewMsgWidget(self)
info.vipIcon.hide()
info.managerIcon.hide()
info.nvIcon.hide()
info.officialIcon.hide()
info.rawMsg = rawMsg
for i in characters:
if i == "vip":
info.vipIcon.setVisible(True)
elif i == "girl":
info.nvIcon.setVisible(True)
elif i == "manager":
info.managerIcon.setVisible(True)
elif i == "official":
info.officialIcon.setVisible(True)
elif i == "anchor":
pass
for at in userMentions:
atName = at.get("name", "")
msg = "<font color=#1661ab>@{}</font>".format(atName) + "\n" + msg
@ -278,17 +321,18 @@ class ChatNewRoomWidget(QWidget, Ui_ChatRoom, QtTaskBase):
info.levelLabel.setText("<font color=#130c0e>{}</font>".format(" LV"+str(level))+" ")
info.titleLabel.setText("<font color=#130c0e>{}</font>".format(" " + title + " "))
# info.indexLabel.setText("{}".format(str(self.indexMsgId + 1))+ Str.GetStr(Str.Floor))
date = time.strftime("%H:%M:%S")
info.indexLabel.setText(date)
# date = time.strftime("%H:%M:%S")
info.indexLabel.setText(strTime)
# info.numLabel.setText("{}楼".format(str(self.indexMsgId+1)))
info.infoLabel.setText(data.get("platform", "")+" ")
if reply:
replayId = reply.get("id")
replyType = reply.get("type", "")
replyMsg = str(reply.get("message", ""))
replyData = reply.get("data", {})
replyMsg = str(replyData.get("message", ""))
if replyMsg == "null" or replyMsg == "None":
replyMsg = ""
replyData = reply.get("data", {})
index = self.msgIdInfo.get(replayId)
oldWiget = self.msgInfo.get(index)
@ -296,7 +340,7 @@ class ChatNewRoomWidget(QWidget, Ui_ChatRoom, QtTaskBase):
assert isinstance(oldWiget, ChatNewMsgWidget)
replyData = oldWiget.rawMsg.data
replyName = replyData.get("profile", {}).get("name", "")
replyName = replyData.get("name", "")
info.replayLabel.setText("<font color=#1661ab>@{}</font>{}".format(replyName, "<br/>" + replyMsg))
info.replayWidget.setVisible(True)
if replyType == "TEXT_MESSAGE":
@ -307,7 +351,9 @@ class ChatNewRoomWidget(QWidget, Ui_ChatRoom, QtTaskBase):
elif replyType == "IMAGE_MESSAGE":
## 回复图片
info.SetReplyPictureDefault()
replayImage = reply.get("image")
replayImage = reply.get("data", {}).get("media")
replyName = reply.get("data", {}).get("name", "")
info.replayLabel.setText("<font color=#1661ab>@{}</font>{}".format(replyName, "<br/>" + replyMsg))
if replayImage:
path = ToolUtil.GetMd5RealPath(replayImage, "chat2/img")
self.AddDownloadTask(replayImage, path, completeCallBack=self.LoadingReplyMsgImgComplete, backParam=self.indexMsgId)
@ -345,12 +391,16 @@ class ChatNewRoomWidget(QWidget, Ui_ChatRoom, QtTaskBase):
@time_me
def _RecvImageMsg(self, rawMsg):
data = rawMsg.data
msg = data.get("message", {}).get("caption", "")
date = data.get("message", {}).get("date", "")
msg = data.get("caption", "")
if msg == "null" or msg == "None" or not msg:
msg = ""
userMentions = data.get("userMentions", [])
reply = data.get("reply", {})
createdTime = rawMsg.createdAt
timeArray, _ = ToolUtil.GetDateStr(createdTime)
strTime = "{}:{}:{} ".format(timeArray.tm_hour, timeArray.tm_min, timeArray.tm_sec)
name = data.get("profile", {}).get("name", "")
level = data.get("profile", {}).get("level", "")
title = data.get("profile", {}).get("title", "")
@ -367,8 +417,7 @@ class ChatNewRoomWidget(QWidget, Ui_ChatRoom, QtTaskBase):
info.levelLabel.setText("<font color=#130c0e>{}</font>".format(" LV"+str(level))+" ")
info.titleLabel.setText("<font color=#130c0e>{}</font>".format(" " + title + " "))
# info.indexLabel.setText("{}".format(str(self.indexMsgId + 1))+ Str.GetStr(Str.Floor))
date = time.strftime("%H:%M:%S")
info.indexLabel.setText(date)
info.indexLabel.setText(strTime)
info.replayWidget.setVisible(False)
# info.numLabel.setText("{}楼".format(str(self.indexMsgId+1)))
info.infoLabel.setText(data.get("platform", "")+" ")
@ -383,7 +432,7 @@ class ChatNewRoomWidget(QWidget, Ui_ChatRoom, QtTaskBase):
path = ToolUtil.GetMd5RealPath(url, "chat2/user")
self.AddDownloadTask(url, path, completeCallBack=self.LoadingPictureComplete, backParam=self.indexMsgId)
medias = data.get("message", {}).get("medias", [])
medias = data.get("medias", [])
if medias and config.IsLoadingPicture:
## 这里目前只有一张
url = medias[0]
@ -494,12 +543,12 @@ class ChatNewRoomWidget(QWidget, Ui_ChatRoom, QtTaskBase):
if not msg and not imageData:
return
userMentions = []
reply = ""
replyId = ""
if self.atLabel.isVisible() and self.atRoleId:
userMentions = [{"id":self.atRoleId, "name": self.atRoleName}]
userMentions = [self.atRoleId]
if self.replyLabel.isVisible() and self.reply:
reply = self.reply
data = req.SendNewChatMsgReq(self.token, self.url, msg, userMentions, reply)
replyId = self.reply.get("id", "")
data = req.SendNewChatMsgReq(self.token, self.url, msg, userMentions, replyId)
self.AddHttpTask(data, callBack=self.SendMsgBack)
self.textEdit.setText("")
self.replyLabel.setVisible(False)
@ -552,7 +601,7 @@ class ChatNewRoomWidget(QWidget, Ui_ChatRoom, QtTaskBase):
assert isinstance(widget, ChatNewMsgWidget)
assert isinstance(widget.rawMsg, MsgData)
name = widget.rawMsg.data.get("profile", {}).get("name", "")
text = widget.rawMsg.data.get("message", {}).get("message", "")
text = widget.rawMsg.data.get("message", "")
self.reply = {
"id": widget.rawMsg.id,
"name": name,

View File

@ -1,5 +1,6 @@
import json
import os.path
import time
from PySide6.QtSql import QSqlDatabase, QSqlQuery
@ -23,6 +24,7 @@ class DownloadDb(object):
downloadEpsIds varchar,\
curDownloadEpsId int,\
curConvertEpsId int,\
tick int,\
title varchar,\
savePath varchar,\
convertPath varchar,\
@ -35,6 +37,13 @@ class DownloadDb(object):
a = query.lastError().text()
Log.Warn(a)
query = QSqlQuery(self.db)
sql = """ALTER TABLE 'download' ADD 'tick' int DEFAULT 1683388800;"""
suc = query.exec_(sql)
if not suc:
a = query.lastError().text()
Log.Warn(a)
query = QSqlQuery(self.db)
sql = """\
create table if not exists download_eps(\
@ -68,15 +77,15 @@ class DownloadDb(object):
def AddDownloadDB(self, task):
assert isinstance(task, DownloadItem)
tick = int(time.time())
query = QSqlQuery(self.db)
sql = "INSERT INTO download(bookId, downloadEpsIds, curDownloadEpsId, curConvertEpsId, title, " \
"savePath, convertPath, status, convertStatus) " \
"VALUES ('{0}', '{1}', {2}, {3}, '{4}', '{5}', '{6}', '{7}', '{8}') " \
"savePath, convertPath, status, convertStatus, tick) " \
"VALUES ('{0}', '{1}', {2}, {3}, '{4}', '{5}', '{6}', '{7}', '{8}', {9}) " \
"ON CONFLICT(bookId) DO UPDATE SET downloadEpsIds='{1}', curDownloadEpsId={2}, curConvertEpsId={3}, " \
"title = '{4}', savePath = '{5}', convertPath= '{6}', status = '{7}', convertStatus = '{8}'".\
format(task.bookId, json.dumps(task.epsIds), task.curDownloadEpsId, task.curConvertEpsId, task.title.replace("'", "''"),
task.savePath.replace("'", "''"), task.convertPath.replace("'", "''"), task.status, task.convertStatus)
task.savePath.replace("'", "''"), task.convertPath.replace("'", "''"), task.status, task.convertStatus, tick)
suc = query.exec_(sql)
if not suc:
@ -102,7 +111,7 @@ class DownloadDb(object):
query = QSqlQuery(self.db)
suc = query.exec_(
"""
select * from download
select bookId,downloadEpsIds,curDownloadEpsId,curConvertEpsId,title,savePath,convertPath,status,convertStatus,tick from download
"""
)
if not suc:
@ -121,6 +130,7 @@ class DownloadDb(object):
info.convertPath = query.value(6)
info.status = query.value(7)
info.convertStatus = query.value(8)
info.tick = query.value(9)
downloads[info.bookId] = info
query = QSqlQuery(self.db)

View File

@ -1,4 +1,5 @@
import os
import time
from config import config
from config.setting import Setting
@ -28,6 +29,7 @@ class DownloadItem(QtTaskBase):
QtTaskBase.__init__(self)
self.bookId = "" # 书籍id
self.title = "" # 标题
self.tick = int(time.time()) #
self.author = "" # 作者名
self.savePath = "" # 保存路径
self.convertPath = "" # Waifu2x路径
@ -47,7 +49,7 @@ class DownloadItem(QtTaskBase):
self.speedDownloadLen = 0
self.downloadReset = 0
self.convertReset = 0
self.tick = 0
self.cvTick = 0
self.dirty = True
@property
@ -82,7 +84,7 @@ class DownloadItem(QtTaskBase):
@property
def convertTick(self):
return str(self.tick) + 's'
return str(self.cvTick) + 's'
@property
def curConvertCnt(self):
@ -245,9 +247,9 @@ class DownloadItem(QtTaskBase):
return self.Converting
def ConvertSucCallBack(self, tick):
def ConvertSucCallBack(self, cvTick):
self.dirty = True
self.tick = tick
self.cvTick = cvTick
self.curConvertEpsInfo.dirty = True
self.curConvertEpsInfo.curPreConvertId += 1
while True:

View File

@ -1,5 +1,6 @@
import os
import shutil
import time
from PySide6 import QtWidgets
from PySide6.QtCore import Qt, QTimer, QUrl, QSize
@ -38,7 +39,7 @@ class DownloadView(QtWidgets.QWidget, Ui_Download, DownloadStatus):
self.tableWidget.setSelectionBehavior(QAbstractItemView.SelectRows)
self.tableWidget.setEditTriggers(QAbstractItemView.NoEditTriggers)
self.tableWidget.setContextMenuPolicy(Qt.CustomContextMenu)
self.tableWidget.setColumnCount(10)
self.tableWidget.setColumnCount(11)
# self.tableWidget.setHorizontalHeaderLabels(HorizontalHeaderLabels)
self.timer = QTimer(self.tableWidget)
self.timer.setInterval(1000)
@ -61,6 +62,7 @@ class DownloadView(QtWidgets.QWidget, Ui_Download, DownloadStatus):
datas = self.db.LoadDownload(self)
self.redownloadRadio.clicked.connect(self.SwitchReDownload)
self.needLoadBookID = []
self.tableWidget.setColumnHidden(0, True)
for task in datas.values():
self.downloadDict[task.bookId] = task
if not task.epsIds:
@ -221,14 +223,19 @@ class DownloadView(QtWidgets.QWidget, Ui_Download, DownloadStatus):
def UpdateTableItem(self, info):
assert isinstance(info, DownloadItem)
localTime = time.localtime(info.tick)
strTime = time.strftime("%Y-%m-%d %H:%M:%S", localTime)
self.tableWidget.setItem(info.tableRow, 0, QTableWidgetItem(info.bookId))
self.tableWidget.setItem(info.tableRow, 1, QTableWidgetItem(strTime))
item = QTableWidgetItem(info.title)
item.setToolTip(info.title)
self.tableWidget.setItem(info.tableRow, 1, item)
self.tableWidget.setItem(info.tableRow, 2, item)
self.tableWidget.setItem(info.tableRow, 5, QTableWidgetItem(info.GetStatusMsg()))
self.tableWidget.setItem(info.tableRow, 6, QTableWidgetItem(info.GetStatusMsg()))
self.tableWidget.setItem(info.tableRow, 2, QTableWidgetItem("{}/{}".format(str(info.curDownloadPic), str(info.maxDownloadPic))))
self.tableWidget.setItem(info.tableRow, 3, QTableWidgetItem("{}/{}".format(str(info.curDownloadPic), str(info.maxDownloadPic))))
bookInfo = BookMgr().GetBook(info.bookId)
item2 = QTableWidgetItem("{}/{}".format(str(info.curDownloadEps), str(info.epsCount)))
@ -237,12 +244,12 @@ class DownloadView(QtWidgets.QWidget, Ui_Download, DownloadStatus):
icon2 = QIcon()
icon2.addFile(u":/png/icon/new.svg", QSize(), QIcon.Normal, QIcon.Off)
item2.setIcon(icon2)
self.tableWidget.setItem(info.tableRow, 3, item2)
self.tableWidget.setItem(info.tableRow, 4, QTableWidgetItem(info.speedStr))
self.tableWidget.setItem(info.tableRow, 6, QTableWidgetItem("{}/{}".format(str(info.curConvertCnt), str(info.convertCnt))))
self.tableWidget.setItem(info.tableRow, 7, QTableWidgetItem("{}/{}".format(str(info.curConvertEps), str(info.convertEpsCnt))))
self.tableWidget.setItem(info.tableRow, 8, QTableWidgetItem("{}".format(str(info.convertTick))))
self.tableWidget.setItem(info.tableRow, 9, QTableWidgetItem(info.GetConvertStatusMsg()))
self.tableWidget.setItem(info.tableRow, 4, item2)
self.tableWidget.setItem(info.tableRow, 5, QTableWidgetItem(info.speedStr))
self.tableWidget.setItem(info.tableRow, 7, QTableWidgetItem("{}/{}".format(str(info.curConvertCnt), str(info.convertCnt))))
self.tableWidget.setItem(info.tableRow, 8, QTableWidgetItem("{}/{}".format(str(info.curConvertEps), str(info.convertEpsCnt))))
self.tableWidget.setItem(info.tableRow, 9, QTableWidgetItem("{}".format(str(info.convertTick))))
self.tableWidget.setItem(info.tableRow, 10, QTableWidgetItem(info.GetConvertStatusMsg()))
return
def RemoveRecord(self, bookId):

View File

@ -103,6 +103,7 @@ class ReadGraphicsView(QGraphicsView, SmoothScroll):
self.labelWaifu2xState = {}
# self.setSceneRect(-self.width()//2, -self.height()//2, self.width(), self.height())
QtOwner().owner.WindowsSizeChange.connect(self.ResetSize)
self.isLastPageMode = False # 是否切换到上一页
@property
def readImg(self):
@ -203,7 +204,7 @@ class ReadGraphicsView(QGraphicsView, SmoothScroll):
elif ReadMode.isScroll(self.qtTool.stripModel):
self.horizontalScrollBar().setValue(self.horizontalScrollBar().value() * ratio)
newV2 = self.verticalScrollBar().value()
print(oldV, newV, newV2)
# print(oldV, newV, newV2)
# if oldScaleCnt != 0:
# for i in range(abs(oldScaleCnt)):
# if oldScaleCnt > 0:
@ -408,7 +409,7 @@ class ReadGraphicsView(QGraphicsView, SmoothScroll):
QtOwner().ShowMsg(Str.GetStr(Str.AlreadyLastPage))
return
self.readImg.curIndex -= 1
print("last page, addv:{}, val:{}, cur:{}, next:{}".format(addValue, value, curPictureSize, nextPictureSize))
# print("last page, addv:{}, val:{}, cur:{}, next:{}".format(addValue, value, curPictureSize, nextPictureSize))
self.changeLastPage.emit(self.readImg.curIndex)
## 切换下一图片
@ -417,7 +418,7 @@ class ReadGraphicsView(QGraphicsView, SmoothScroll):
QtOwner().ShowMsg(Str.GetStr(Str.AlreadyNextPage))
return
self.readImg.curIndex += 1
print("next page, addv:{}, val:{}, cur:{}, next:{}".format(addValue, value, curPictureSize, nextPictureSize))
# print("next page, addv:{}, val:{}, cur:{}, next:{}".format(addValue, value, curPictureSize, nextPictureSize))
self.changeNextPage.emit(self.readImg.curIndex)
else:
break
@ -510,13 +511,17 @@ class ReadGraphicsView(QGraphicsView, SmoothScroll):
elif self.initReadMode in [ReadMode.LeftRightScroll]:
maxSize = max(self.width(), self.labelSize.get(maxNum, 0) - self.width()) + 50
oldV = self.GetScrollBar().value()
self.graphicsScene.setSceneRect(0, 0, maxSize, self.height())
self.GetScrollBar().setMaximum(maxSize)
self.GetScrollBar().setValue(oldV)
self.ScaleResetVer()
elif self.initReadMode in [ReadMode.UpDown]:
maxSize = max(self.height(), self.labelSize.get(maxNum, 0) - self.height()) + 50
oldV = self.GetScrollBar().value()
self.graphicsScene.setSceneRect(0, 0, self.width(), maxSize)
self.GetScrollBar().setMaximum(maxSize)
self.GetScrollBar().setValue(oldV)
self.ScaleResetVer()
else:
self.graphicsScene.setSceneRect(0, 0, self.width(), max(self.height(),
@ -794,6 +799,8 @@ class ReadGraphicsView(QGraphicsView, SmoothScroll):
else:
self.ResetMaxNum()
if self.initReadMode in [ReadMode.Samewight, ReadMode.LeftRight] and self.isLastPageMode:
self.verticalScrollBar().setValue(self.verticalScrollBar().maximum())
return
for lenSize, i in enumerate(indexList):
@ -835,6 +842,7 @@ class ReadGraphicsView(QGraphicsView, SmoothScroll):
self.SetPixIem(index + config.PreLoading, None)
elif ReadMode.isDouble(self.initReadMode):
self.SetPixIem(index - 1, None)
self.isLastPageMode = True
self.ReloadImg()
return
@ -846,6 +854,7 @@ class ReadGraphicsView(QGraphicsView, SmoothScroll):
self.SetPixIem(index - 1, None)
elif ReadMode.isDouble(self.initReadMode):
self.SetPixIem(index + 1, None)
self.isLastPageMode = False
self.ReloadImg()
return
@ -859,7 +868,7 @@ class ReadGraphicsView(QGraphicsView, SmoothScroll):
self.SetPixIem(newIndex, None)
value = self.labelSize.get(index)
self.GetScrollBar().setValue(value)
self.isLastPageMode = False
self.ReloadImg()
return

View File

@ -364,7 +364,7 @@ class ReadTool(QtWidgets.QWidget, Ui_ReadImg):
self.readImg.AddHistory()
QtOwner().bookInfoView.LoadHistory()
self.readImg.OpenPage(bookId, epsId)
self.readImg.OpenPage(bookId, epsId, 9999)
return
def OpenNextEps(self):
@ -512,6 +512,7 @@ class ReadTool(QtWidgets.QWidget, Ui_ReadImg):
self.imgFrame.InitHelp()
def ChangeReadMode2(self, index):
self.imgFrame.isLastPageMode = False
self.stripModel = ReadMode(index)
self.scrollArea.initReadMode = self.stripModel
self.ScalePicture2(100)

View File

@ -387,6 +387,9 @@ class ReadView(QtWidgets.QWidget, QtTaskBase):
if 0 < self.pageIndex < self.maxPic:
self.curIndex = self.pageIndex
QtOwner().ShowMsg(Str.GetStr(Str.ContinueRead) + str(self.pageIndex + 1) + Str.GetStr(Str.Page))
elif self.pageIndex > self.maxPic:
self.curIndex = self.maxPic-1
# QtOwner().ShowMsg(Str.GetStr(Str.ContinueRead) + str(self.maxPic) + Str.GetStr(Str.Page))
self.AddHistory()
self.scrollArea.InitAllQLabel(self.maxPic, self.curIndex)

View File

@ -59,6 +59,7 @@ class SearchView(QWidget, Ui_Search, QtTaskBase):
self.searchLabel.installEventFilter(self)
self.someDownButton.clicked.connect(self.bookList.OpenBookDownloadAll)
def InitCategory(self):
for categorory in CateGoryMgr().allCategorise:
text = Converter('zh-hans').convert(categorory)

View File

@ -0,0 +1,96 @@
import json
import os
from this import d
from PySide6.QtCore import Signal, QUrl
from PySide6.QtGui import QAction, Qt, QDesktopServices
from PySide6.QtWidgets import QWidget, QMenu, QFileDialog
from natsort import natsorted
from interface.ui_index import Ui_Index
from interface.ui_local import Ui_Local
from interface.ui_local_eps import Ui_LocalEps
from qt_owner import QtOwner
from server import req, Log, User, Status
from task.qt_task import QtTaskBase
from task.task_local import LocalData
from tools.str import Str
from view.tool.local_read_db import LocalReadDb
class LocalEpsReadView(QWidget, Ui_LocalEps, QtTaskBase):
ReloadHistory = Signal(int)
def __init__(self, parent=None):
QWidget.__init__(self, parent)
Ui_Index.__init__(self)
QtTaskBase.__init__(self)
self.setupUi(self)
self.isInit = False
# self.tabWidget.setCurrentIndex(0)
# self.toolButton.clicked.connect(self.AddBookByDir)
# self.action3 = QAction(Str.GetStr(Str.ImportSimpleDir), self.toolMenu, triggered=self.CheckAction3)
# self.action4 = QAction(Str.GetStr(Str.ImportChipDir), self.toolMenu, triggered=self.CheckAction4)
self.bookList.isLocal = True
# self.randomList.InitBook()
# self.godList.InitBook()
# self.magicList.InitBook()
self.allBookInfos = {}
self.isInit = False
self.bookList.LoadingPicture = self.LoadingPicture
self.bookList.ReDownloadPicture = self.LoadingPicture
self.lastPath = ""
self.setAcceptDrops(True)
self.curSelectCategory = ""
self.bookList.openMenu = True
self.bookList.OpenDirHandler = self.OpenDirCallBack
self.cacheBook = None
def OpenDirCallBack(self, index):
widget = self.bookList.indexWidget(index)
if widget:
info = self.allBookInfos.get(widget.id)
if not info:
return
assert isinstance(info, LocalData)
if info.isZipFile:
QDesktopServices.openUrl(QUrl.fromLocalFile(os.path.dirname(info.file)))
else:
QDesktopServices.openUrl(QUrl.fromLocalFile(info.file))
def SwitchCurrent(self, **kwargs):
refresh = kwargs.get("refresh")
book = kwargs.get("book")
if book:
self.cacheBook = book
self.InitData()
return
def InitData(self):
assert isinstance(self.cacheBook, LocalData)
self.cacheBook.eps = natsorted(self.cacheBook.eps, key=lambda a: a.title)
return
def LoadingPicture(self, index):
if isinstance(index, int):
item = self.bookList.item(index)
widget = self.bookList.itemWidget(item)
else:
widget = self.bookList.indexWidget(index)
bookId = widget.id
if bookId not in self.allBookInfos:
return
v = self.allBookInfos[bookId]
self.AddLocalTaskLoadPicture(v, -1, index, self.bookList.LoadingPictureComplete)
def OpenLocalBook(self, bookId):
if bookId not in self.allBookInfos:
return
QtOwner().OpenLocalReadView(v)
return

View File

@ -58,6 +58,7 @@ class Waifu2xToolView(QtWidgets.QWidget, Ui_Waifu2xTool, QtTaskBase):
self.graphicsScene = QGraphicsScene(self) # 场景
self.graphicsView.setScene(self.graphicsScene)
self.graphicsView.setDragMode(self.graphicsView.ScrollHandDrag)
self.graphicsItem.setWidget(QLabel())
# self.graphicsItem.setPixmap(QPixmap())
# self.graphicsItem.setTransformationMode(Qt.SmoothTransformation)
@ -423,30 +424,30 @@ class Waifu2xToolView(QtWidgets.QWidget, Ui_Waifu2xTool, QtTaskBase):
QtOwner().ShowMsg(Str.GetStr(Str.HeadUpload))
# QtImgMgr().SetHeadStatus(not self.isHeadUp)
def dragEnterEvent(self, event):
if(event.mimeData().hasUrls()):
event.acceptProposedAction()
else:
event.ignore()
def dragMoveEvent(self, evemt):
return
def dropEvent(self, event):
mimeData = event.mimeData()
if(mimeData.hasUrls()):
urls = mimeData.urls()
QtOwner().ShowLoading()
fileNames = [str(i.toLocalFile()) for i in urls]
if not fileNames:
return
name = fileNames[0]
if os.path.isfile(name):
f = open(name, "rb")
data = f.read()
f.close()
self.data = data
self.waifu2xData = None
self.ClearConvert()
self.backStatus = ""
self.ShowImg(data)
# def dragEnterEvent(self, event):
# if(event.mimeData().hasUrls()):
# event.acceptProposedAction()
# else:
# event.ignore()
#
# def dragMoveEvent(self, evemt):
# return
#
# def dropEvent(self, event):
# mimeData = event.mimeData()
# if(mimeData.hasUrls()):
# urls = mimeData.urls()
# QtOwner().ShowLoading()
# fileNames = [str(i.toLocalFile()) for i in urls]
# if not fileNames:
# return
# name = fileNames[0]
# if os.path.isfile(name):
# f = open(name, "rb")
# data = f.read()
# f.close()
# self.data = data
# self.waifu2xData = None
# self.ClearConvert()
# self.backStatus = ""
# self.ShowImg(data)

View File

@ -44,17 +44,38 @@ class FavoriteView(QtWidgets.QWidget, Ui_Favorite, QtTaskBase):
self.isLocal = False
self.SetLocal(False)
self.someDownButton.clicked.connect(self.bookList.OpenBookDownloadAll)
self.widget.hide()
self.lineEdit.textChanged.connect(self.SearchTextChange)
self.searchText = ""
def SwitchCurrent(self, **kwargs):
refresh = kwargs.get("refresh")
if refresh or self.bookList.count() <= 0:
self.RefreshDataFocus()
def SearchTextChange(self, text):
self.searchText = text
sortId = self.sortIdCombox.currentIndex()
sortKey = self.sortKeyCombox.currentIndex()
sql = SqlServer.SearchFavorite(self.bookList.page, sortKey, sortId, self.searchText)
self.AddSqlTask("book", sql, SqlServer.TaskTypeSelectBook, self.SearchTextChangeBack, self.searchText)
def SearchTextChangeBack(self, bookList, bakKey):
if bakKey == self.searchText:
self.bookList.UpdatePage(1, 1)
self.bookList.UpdateState()
self.bookList.clear()
for info in bookList:
self.bookList.AddBookItemByBook(info, isShowHistory=True)
self.UpdatePageNum()
return
def SetLocal(self, isLocal):
self.isLocal = isLocal
self.sortCombox.setVisible(not isLocal)
self.sortIdCombox.setVisible(isLocal)
self.sortKeyCombox.setVisible(isLocal)
self.widget.setVisible(isLocal)
return
def UpdatePageNum(self):
@ -147,7 +168,7 @@ class FavoriteView(QtWidgets.QWidget, Ui_Favorite, QtTaskBase):
sortId = self.sortIdCombox.currentIndex()
sortKey = self.sortKeyCombox.currentIndex()
if self.isLocal or QtOwner().isOfflineModel:
sql = SqlServer.SearchFavorite(self.bookList.page, sortKey, sortId)
sql = SqlServer.SearchFavorite(self.bookList.page, sortKey, sortId, self.searchText)
self.AddSqlTask("book", sql, SqlServer.TaskTypeSelectBook, self.SearchLocalBack)
else:
sort = self.sortList[self.sortCombox.currentIndex()]

View File

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>636</width>
<width>749</width>
<height>299</height>
</rect>
</property>
@ -86,31 +86,7 @@ background: transparent;
<property name="spacing">
<number>1</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="nameLabel">
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>30</height>
</size>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item row="1" column="0">
<item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>6</number>
@ -187,7 +163,7 @@ background: transparent;
</item>
</layout>
</item>
<item row="4" column="0">
<item row="5" column="0">
<widget class="QWidget" name="widget" native="true">
<property name="minimumSize">
<size>
@ -323,6 +299,127 @@ padding-right:15px;</string>
</layout>
</widget>
</item>
<item row="1" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="nameLabel">
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>30</height>
</size>
</property>
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="vipIcon">
<property name="toolTip">
<string>vip用户</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../res/images.qrc">
<normaloff>:/png/icon/vip.png</normaloff>:/png/icon/vip.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="managerIcon">
<property name="toolTip">
<string>房管</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../res/images.qrc">
<normaloff>:/png/icon/svip.png</normaloff>:/png/icon/svip.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="nvIcon">
<property name="toolTip">
<string>女菩萨</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../res/images.qrc">
<normaloff>:/png/icon/nv.png</normaloff>:/png/icon/nv.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="officialIcon">
<property name="toolTip">
<string>哔咔官方</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../res/images.qrc">
<normaloff>:/png/icon/icon_picacg.png</normaloff>:/png/icon/icon_picacg.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
</layout>

View File

@ -46,6 +46,20 @@
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>在线人数:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="onlineNum">
<property name="text">
<string>0</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="numLabel">
<property name="text">

View File

@ -88,6 +88,11 @@
<string>id</string>
</property>
</column>
<column>
<property name="text">
<string>时间</string>
</property>
</column>
<column>
<property name="text">
<string>标题</string>

View File

@ -14,7 +14,7 @@
<string>收藏</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<item row="1" column="0">
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="ComicListWidget" name="bookList">
@ -25,7 +25,7 @@
</item>
</layout>
</item>
<item row="1" column="0">
<item row="2" column="0">
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
@ -224,6 +224,22 @@
</item>
</layout>
</item>
<item row="0" column="0">
<widget class="QWidget" name="widget" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>搜索:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit"/>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<customwidgets>

43
ui/ui_local_eps.ui Normal file
View File

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>LocalEps</class>
<widget class="QWidget" name="LocalEps">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>646</width>
<height>391</height>
</rect>
</property>
<property name="windowTitle">
<string>本地漫画章节</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="0">
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="ComicListWidget" name="bookList">
<property name="styleSheet">
<string notr="true"/>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>ComicListWidget</class>
<extends>QListWidget</extends>
<header location="global">component.list.comic_list_widget.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
<slots>
<slot>JumpPage()</slot>
<slot>RefreshDataFocus()</slot>
</slots>
</ui>

View File

@ -87,6 +87,7 @@
<item>
<widget class="AnimationStackWidget" name="subStackWidget">
<widget class="IndexView" name="indexView"/>
<widget class="LocalEpsReadView" name="localEpsReadView"/>
<widget class="ChatNewView" name="chatNewView"/>
<widget class="HelpView" name="helpView"/>
<widget class="MyCommentView" name="myCommentView"/>
@ -279,6 +280,12 @@
<header location="global">view.chat_new.chat_new_view.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>LocalEpsReadView</class>
<extends>QWidget</extends>
<header location="global">view.tool.local_eps_read_view.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>

View File

@ -105,7 +105,7 @@
<item>
<widget class="AnimationStackWidget" name="subStackWidget">
<property name="currentIndex">
<number>21</number>
<number>22</number>
</property>
<widget class="IndexView" name="indexView"/>
<widget class="HelpView" name="helpView"/>
@ -129,6 +129,7 @@
<widget class="DownloadAllView" name="downloadAllView"/>
<widget class="LocalReadView" name="localReadView"/>
<widget class="ChatNewView" name="chatNewView"/>
<widget class="LocalEpsReadView" name="localEpsReadView"/>
<widget class="BookEpsView" name="bookEpsView"/>
<widget class="FriedView" name="friedView"/>
</widget>
@ -293,6 +294,12 @@
<header location="global">view.tool.local_read_view.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ChatNewView</class>
<extends>QWidget</extends>
<header location="global">view.chat_new.chat_new_view.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>TitleBarWidget</class>
<extends>QWidget</extends>
@ -300,9 +307,9 @@
<container>1</container>
</customwidget>
<customwidget>
<class>ChatNewView</class>
<class>LocalEpsReadView</class>
<extends>QWidget</extends>
<header location="global">view.chat_new.chat_new_view.h</header>
<header location="global">view.tool.local_eps_read_view.h</header>
<container>1</container>
</customwidget>
</customwidgets>