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_random.jpg</file>
<file>icon/cat_leaderboard.jpg</file> <file>icon/cat_leaderboard.jpg</file>
<file>icon/new.svg</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>
<qresource prefix="icon"> <qresource prefix="icon">
<file>theme/dark_pink/disabled/base.svg</file> <file>theme/dark_pink/disabled/base.svg</file>

View File

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

View File

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

View File

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

View File

@ -52,9 +52,9 @@ Issues1 = "https://github.com/tonquer/picacg-qt/issues"
Issues2 = "https://hub.ggo.icu/tonquer/picacg-qt/issues" Issues2 = "https://hub.ggo.icu/tonquer/picacg-qt/issues"
Issues3 = "https://hub.fastgit.xyz/tonquer/picacg-qt/issues" Issues3 = "https://hub.fastgit.xyz/tonquer/picacg-qt/issues"
UpdateVersion = "v1.4.4" UpdateVersion = "v1.4.5"
RealVersion = "v1.4.4" RealVersion = "v1.4.5"
TimeVersion = "2023-3-19" TimeVersion = "2023-5-7"
Waifu2xVersion = "1.1.6" 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, QImage, QKeySequence, QLinearGradient, QPainter,
QPalette, QPixmap, QRadialGradient, QTransform) QPalette, QPixmap, QRadialGradient, QTransform)
from PySide6.QtWidgets import (QApplication, QGridLayout, QHBoxLayout, QLabel, from PySide6.QtWidgets import (QApplication, QGridLayout, QHBoxLayout, QLabel,
QSizePolicy, QSpacerItem, QVBoxLayout, QWidget) QSizePolicy, QSpacerItem, QToolButton, QVBoxLayout,
QWidget)
from component.label.head_label import HeadLabel from component.label.head_label import HeadLabel
import images_rc import images_rc
@ -25,7 +26,7 @@ class Ui_ChatNewRoomMsg(object):
def setupUi(self, ChatNewRoomMsg): def setupUi(self, ChatNewRoomMsg):
if not ChatNewRoomMsg.objectName(): if not ChatNewRoomMsg.objectName():
ChatNewRoomMsg.setObjectName(u"ChatNewRoomMsg") ChatNewRoomMsg.setObjectName(u"ChatNewRoomMsg")
ChatNewRoomMsg.resize(636, 299) ChatNewRoomMsg.resize(749, 299)
ChatNewRoomMsg.setStyleSheet(u"QWidget#widget{\n" ChatNewRoomMsg.setStyleSheet(u"QWidget#widget{\n"
" border-image:url(:png/icon/skin_aio_friend_bubble_pressed.9.png) 50;\n" " border-image:url(:png/icon/skin_aio_friend_bubble_pressed.9.png) 50;\n"
" border-width: 45;\n" " border-width: 45;\n"
@ -70,16 +71,6 @@ class Ui_ChatNewRoomMsg(object):
self.gridLayout = QGridLayout() self.gridLayout = QGridLayout()
self.gridLayout.setSpacing(1) self.gridLayout.setSpacing(1)
self.gridLayout.setObjectName(u"gridLayout") 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 = QHBoxLayout()
self.horizontalLayout.setSpacing(6) self.horizontalLayout.setSpacing(6)
self.horizontalLayout.setObjectName(u"horizontalLayout") self.horizontalLayout.setObjectName(u"horizontalLayout")
@ -110,7 +101,7 @@ class Ui_ChatNewRoomMsg(object):
self.horizontalLayout.addItem(self.horizontalSpacer_2) 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 = QWidget(ChatNewRoomMsg)
self.widget.setObjectName(u"widget") self.widget.setObjectName(u"widget")
@ -135,6 +126,8 @@ class Ui_ChatNewRoomMsg(object):
self.replayLabel = QLabel(self.replayWidget) self.replayLabel = QLabel(self.replayWidget)
self.replayLabel.setObjectName(u"replayLabel") self.replayLabel.setObjectName(u"replayLabel")
self.replayLabel.setMinimumSize(QSize(40, 50)) self.replayLabel.setMinimumSize(QSize(40, 50))
font = QFont()
font.setPointSize(12)
self.replayLabel.setFont(font) self.replayLabel.setFont(font)
self.replayLabel.setStyleSheet(u"padding-left:20px;\n" self.replayLabel.setStyleSheet(u"padding-left:20px;\n"
"padding-right:10px;") "padding-right:10px;")
@ -182,7 +175,60 @@ class Ui_ChatNewRoomMsg(object):
self.verticalLayout_3.addWidget(self.infoLabel) 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) self.gridLayout_2.addLayout(self.gridLayout, 0, 1, 1, 1)
@ -196,7 +242,6 @@ class Ui_ChatNewRoomMsg(object):
def retranslateUi(self, ChatNewRoomMsg): def retranslateUi(self, ChatNewRoomMsg):
ChatNewRoomMsg.setWindowTitle(QCoreApplication.translate("ChatNewRoomMsg", u"Form", None)) ChatNewRoomMsg.setWindowTitle(QCoreApplication.translate("ChatNewRoomMsg", u"Form", None))
self.picLabel.setText("") self.picLabel.setText("")
self.nameLabel.setText(QCoreApplication.translate("ChatNewRoomMsg", u"TextLabel", None))
self.indexLabel.setText(QCoreApplication.translate("ChatNewRoomMsg", u"X\u697c", None)) self.indexLabel.setText(QCoreApplication.translate("ChatNewRoomMsg", u"X\u697c", None))
self.levelLabel.setText(QCoreApplication.translate("ChatNewRoomMsg", u"LV", None)) self.levelLabel.setText(QCoreApplication.translate("ChatNewRoomMsg", u"LV", None))
self.titleLabel.setText(QCoreApplication.translate("ChatNewRoomMsg", u"TextLabel", 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.commentLabel.setText(QCoreApplication.translate("ChatNewRoomMsg", u"TextLabel", None))
self.pic2Label.setText("") self.pic2Label.setText("")
self.infoLabel.setText(QCoreApplication.translate("ChatNewRoomMsg", u"TextLabel", None)) 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 # retranslateUi

View File

@ -45,6 +45,16 @@ class Ui_ChatRoom(object):
self.horizontalLayout_3.addItem(self.horizontalSpacer_2) 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 = QLabel(ChatRoom)
self.numLabel.setObjectName(u"numLabel") self.numLabel.setObjectName(u"numLabel")
@ -161,6 +171,8 @@ class Ui_ChatRoom(object):
ChatRoom.setWindowTitle(QCoreApplication.translate("ChatRoom", u"\u804a\u5929\u5ba4", None)) ChatRoom.setWindowTitle(QCoreApplication.translate("ChatRoom", u"\u804a\u5929\u5ba4", None))
self.atLabel.setText(QCoreApplication.translate("ChatRoom", u"PushButton", None)) self.atLabel.setText(QCoreApplication.translate("ChatRoom", u"PushButton", None))
self.nameLabel.setText(QCoreApplication.translate("ChatRoom", u"TextLabel", 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.numLabel.setText("")
self.replyLabel.setText(QCoreApplication.translate("ChatRoom", u"PushButton", None)) self.replyLabel.setText(QCoreApplication.translate("ChatRoom", u"PushButton", None))
self.pushButton.setText(QCoreApplication.translate("ChatRoom", u"\u8868\u60c5", 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.gridLayout.addLayout(self.horizontalLayout, 2, 0, 1, 1)
self.tableWidget = QTableWidget(Download) self.tableWidget = QTableWidget(Download)
if (self.tableWidget.columnCount() < 10): if (self.tableWidget.columnCount() < 11):
self.tableWidget.setColumnCount(10) self.tableWidget.setColumnCount(11)
__qtablewidgetitem = QTableWidgetItem() __qtablewidgetitem = QTableWidgetItem()
self.tableWidget.setHorizontalHeaderItem(0, __qtablewidgetitem) self.tableWidget.setHorizontalHeaderItem(0, __qtablewidgetitem)
__qtablewidgetitem1 = QTableWidgetItem() __qtablewidgetitem1 = QTableWidgetItem()
@ -92,6 +92,8 @@ class Ui_Download(object):
self.tableWidget.setHorizontalHeaderItem(8, __qtablewidgetitem8) self.tableWidget.setHorizontalHeaderItem(8, __qtablewidgetitem8)
__qtablewidgetitem9 = QTableWidgetItem() __qtablewidgetitem9 = QTableWidgetItem()
self.tableWidget.setHorizontalHeaderItem(9, __qtablewidgetitem9) self.tableWidget.setHorizontalHeaderItem(9, __qtablewidgetitem9)
__qtablewidgetitem10 = QTableWidgetItem()
self.tableWidget.setHorizontalHeaderItem(10, __qtablewidgetitem10)
self.tableWidget.setObjectName(u"tableWidget") self.tableWidget.setObjectName(u"tableWidget")
self.gridLayout.addWidget(self.tableWidget, 5, 0, 1, 1) self.gridLayout.addWidget(self.tableWidget, 5, 0, 1, 1)
@ -121,22 +123,24 @@ class Ui_Download(object):
___qtablewidgetitem = self.tableWidget.horizontalHeaderItem(0) ___qtablewidgetitem = self.tableWidget.horizontalHeaderItem(0)
___qtablewidgetitem.setText(QCoreApplication.translate("Download", u"id", None)); ___qtablewidgetitem.setText(QCoreApplication.translate("Download", u"id", None));
___qtablewidgetitem1 = self.tableWidget.horizontalHeaderItem(1) ___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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 # retranslateUi

View File

@ -16,8 +16,9 @@ from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
QImage, QKeySequence, QLinearGradient, QPainter, QImage, QKeySequence, QLinearGradient, QPainter,
QPalette, QPixmap, QRadialGradient, QTransform) QPalette, QPixmap, QRadialGradient, QTransform)
from PySide6.QtWidgets import (QApplication, QComboBox, QFrame, QGridLayout, from PySide6.QtWidgets import (QApplication, QComboBox, QFrame, QGridLayout,
QHBoxLayout, QLabel, QListWidgetItem, QPushButton, QHBoxLayout, QLabel, QLineEdit, QListWidgetItem,
QSizePolicy, QSpacerItem, QSpinBox, QWidget) QPushButton, QSizePolicy, QSpacerItem, QSpinBox,
QWidget)
from component.list.comic_list_widget import ComicListWidget 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_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 = QGridLayout()
self.gridLayout_4.setObjectName(u"gridLayout_4") 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_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) self.retranslateUi(Favorite)
@ -178,5 +196,6 @@ class Ui_Favorite(object):
#if QT_CONFIG(shortcut) #if QT_CONFIG(shortcut)
self.jumpButton.setShortcut(QCoreApplication.translate("Favorite", u"Return", None)) self.jumpButton.setShortcut(QCoreApplication.translate("Favorite", u"Return", None))
#endif // QT_CONFIG(shortcut) #endif // QT_CONFIG(shortcut)
self.label.setText(QCoreApplication.translate("Favorite", u"\u641c\u7d22\uff1a", None))
# retranslateUi # 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.read.read_view import ReadView
from view.search.search_view import SearchView from view.search.search_view import SearchView
from view.setting.setting_view import SettingView 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.local_read_view import LocalReadView
from view.tool.waifu2x_tool_view import Waifu2xToolView from view.tool.waifu2x_tool_view import Waifu2xToolView
from view.user.favorite_view import FavoriteView from view.user.favorite_view import FavoriteView
@ -100,6 +101,9 @@ class Ui_Main(object):
self.indexView = IndexView() self.indexView = IndexView()
self.indexView.setObjectName(u"indexView") self.indexView.setObjectName(u"indexView")
self.subStackWidget.addWidget(self.indexView) self.subStackWidget.addWidget(self.indexView)
self.localEpsReadView = LocalEpsReadView()
self.localEpsReadView.setObjectName(u"localEpsReadView")
self.subStackWidget.addWidget(self.localEpsReadView)
self.chatNewView = ChatNewView() self.chatNewView = ChatNewView()
self.chatNewView.setObjectName(u"chatNewView") self.chatNewView.setObjectName(u"chatNewView")
self.subStackWidget.addWidget(self.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.read.read_view import ReadView
from view.search.search_view import SearchView from view.search.search_view import SearchView
from view.setting.setting_view import SettingView 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.local_read_view import LocalReadView
from view.tool.waifu2x_tool_view import Waifu2xToolView from view.tool.waifu2x_tool_view import Waifu2xToolView
from view.user.favorite_view import FavoriteView from view.user.favorite_view import FavoriteView
@ -170,6 +171,9 @@ class Ui_MainWindows(object):
self.chatNewView = ChatNewView() self.chatNewView = ChatNewView()
self.chatNewView.setObjectName(u"chatNewView") self.chatNewView.setObjectName(u"chatNewView")
self.subStackWidget.addWidget(self.chatNewView) self.subStackWidget.addWidget(self.chatNewView)
self.localEpsReadView = LocalEpsReadView()
self.localEpsReadView.setObjectName(u"localEpsReadView")
self.subStackWidget.addWidget(self.localEpsReadView)
self.bookEpsView = BookEpsView() self.bookEpsView = BookEpsView()
self.bookEpsView.setObjectName(u"bookEpsView") self.bookEpsView.setObjectName(u"bookEpsView")
self.subStackWidget.addWidget(self.bookEpsView) self.subStackWidget.addWidget(self.bookEpsView)
@ -192,7 +196,7 @@ class Ui_MainWindows(object):
self.retranslateUi(MainWindows) self.retranslateUi(MainWindows)
self.subStackWidget.setCurrentIndex(21) self.subStackWidget.setCurrentIndex(22)
QMetaObject.connectSlotsByName(MainWindows) QMetaObject.connectSlotsByName(MainWindows)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -59,6 +59,7 @@ class SearchView(QWidget, Ui_Search, QtTaskBase):
self.searchLabel.installEventFilter(self) self.searchLabel.installEventFilter(self)
self.someDownButton.clicked.connect(self.bookList.OpenBookDownloadAll) self.someDownButton.clicked.connect(self.bookList.OpenBookDownloadAll)
def InitCategory(self): def InitCategory(self):
for categorory in CateGoryMgr().allCategorise: for categorory in CateGoryMgr().allCategorise:
text = Converter('zh-hans').convert(categorory) 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.graphicsScene = QGraphicsScene(self) # 场景
self.graphicsView.setScene(self.graphicsScene) self.graphicsView.setScene(self.graphicsScene)
self.graphicsView.setDragMode(self.graphicsView.ScrollHandDrag)
self.graphicsItem.setWidget(QLabel()) self.graphicsItem.setWidget(QLabel())
# self.graphicsItem.setPixmap(QPixmap()) # self.graphicsItem.setPixmap(QPixmap())
# self.graphicsItem.setTransformationMode(Qt.SmoothTransformation) # self.graphicsItem.setTransformationMode(Qt.SmoothTransformation)
@ -423,30 +424,30 @@ class Waifu2xToolView(QtWidgets.QWidget, Ui_Waifu2xTool, QtTaskBase):
QtOwner().ShowMsg(Str.GetStr(Str.HeadUpload)) QtOwner().ShowMsg(Str.GetStr(Str.HeadUpload))
# QtImgMgr().SetHeadStatus(not self.isHeadUp) # QtImgMgr().SetHeadStatus(not self.isHeadUp)
def dragEnterEvent(self, event): # def dragEnterEvent(self, event):
if(event.mimeData().hasUrls()): # if(event.mimeData().hasUrls()):
event.acceptProposedAction() # event.acceptProposedAction()
else: # else:
event.ignore() # event.ignore()
#
def dragMoveEvent(self, evemt): # def dragMoveEvent(self, evemt):
return # return
#
def dropEvent(self, event): # def dropEvent(self, event):
mimeData = event.mimeData() # mimeData = event.mimeData()
if(mimeData.hasUrls()): # if(mimeData.hasUrls()):
urls = mimeData.urls() # urls = mimeData.urls()
QtOwner().ShowLoading() # QtOwner().ShowLoading()
fileNames = [str(i.toLocalFile()) for i in urls] # fileNames = [str(i.toLocalFile()) for i in urls]
if not fileNames: # if not fileNames:
return # return
name = fileNames[0] # name = fileNames[0]
if os.path.isfile(name): # if os.path.isfile(name):
f = open(name, "rb") # f = open(name, "rb")
data = f.read() # data = f.read()
f.close() # f.close()
self.data = data # self.data = data
self.waifu2xData = None # self.waifu2xData = None
self.ClearConvert() # self.ClearConvert()
self.backStatus = "" # self.backStatus = ""
self.ShowImg(data) # self.ShowImg(data)

View File

@ -44,17 +44,38 @@ class FavoriteView(QtWidgets.QWidget, Ui_Favorite, QtTaskBase):
self.isLocal = False self.isLocal = False
self.SetLocal(False) self.SetLocal(False)
self.someDownButton.clicked.connect(self.bookList.OpenBookDownloadAll) self.someDownButton.clicked.connect(self.bookList.OpenBookDownloadAll)
self.widget.hide()
self.lineEdit.textChanged.connect(self.SearchTextChange)
self.searchText = ""
def SwitchCurrent(self, **kwargs): def SwitchCurrent(self, **kwargs):
refresh = kwargs.get("refresh") refresh = kwargs.get("refresh")
if refresh or self.bookList.count() <= 0: if refresh or self.bookList.count() <= 0:
self.RefreshDataFocus() 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): def SetLocal(self, isLocal):
self.isLocal = isLocal self.isLocal = isLocal
self.sortCombox.setVisible(not isLocal) self.sortCombox.setVisible(not isLocal)
self.sortIdCombox.setVisible(isLocal) self.sortIdCombox.setVisible(isLocal)
self.sortKeyCombox.setVisible(isLocal) self.sortKeyCombox.setVisible(isLocal)
self.widget.setVisible(isLocal)
return return
def UpdatePageNum(self): def UpdatePageNum(self):
@ -147,7 +168,7 @@ class FavoriteView(QtWidgets.QWidget, Ui_Favorite, QtTaskBase):
sortId = self.sortIdCombox.currentIndex() sortId = self.sortIdCombox.currentIndex()
sortKey = self.sortKeyCombox.currentIndex() sortKey = self.sortKeyCombox.currentIndex()
if self.isLocal or QtOwner().isOfflineModel: 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) self.AddSqlTask("book", sql, SqlServer.TaskTypeSelectBook, self.SearchLocalBack)
else: else:
sort = self.sortList[self.sortCombox.currentIndex()] sort = self.sortList[self.sortCombox.currentIndex()]

View File

@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>636</width> <width>749</width>
<height>299</height> <height>299</height>
</rect> </rect>
</property> </property>
@ -86,31 +86,7 @@ background: transparent;
<property name="spacing"> <property name="spacing">
<number>1</number> <number>1</number>
</property> </property>
<item row="0" column="0"> <item row="2" 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">
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing"> <property name="spacing">
<number>6</number> <number>6</number>
@ -187,7 +163,7 @@ background: transparent;
</item> </item>
</layout> </layout>
</item> </item>
<item row="4" column="0"> <item row="5" column="0">
<widget class="QWidget" name="widget" native="true"> <widget class="QWidget" name="widget" native="true">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
@ -323,6 +299,127 @@ padding-right:15px;</string>
</layout> </layout>
</widget> </widget>
</item> </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> </layout>
</item> </item>
</layout> </layout>

View File

@ -46,6 +46,20 @@
</property> </property>
</spacer> </spacer>
</item> </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> <item>
<widget class="QLabel" name="numLabel"> <widget class="QLabel" name="numLabel">
<property name="text"> <property name="text">

View File

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

View File

@ -14,7 +14,7 @@
<string>收藏</string> <string>收藏</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0"> <item row="1" column="0">
<layout class="QGridLayout" name="gridLayout_3"> <layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0"> <item row="0" column="0">
<widget class="ComicListWidget" name="bookList"> <widget class="ComicListWidget" name="bookList">
@ -25,7 +25,7 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="1" column="0"> <item row="2" column="0">
<layout class="QGridLayout" name="gridLayout_4"> <layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0"> <item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
@ -224,6 +224,22 @@
</item> </item>
</layout> </layout>
</item> </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> </layout>
</widget> </widget>
<customwidgets> <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> <item>
<widget class="AnimationStackWidget" name="subStackWidget"> <widget class="AnimationStackWidget" name="subStackWidget">
<widget class="IndexView" name="indexView"/> <widget class="IndexView" name="indexView"/>
<widget class="LocalEpsReadView" name="localEpsReadView"/>
<widget class="ChatNewView" name="chatNewView"/> <widget class="ChatNewView" name="chatNewView"/>
<widget class="HelpView" name="helpView"/> <widget class="HelpView" name="helpView"/>
<widget class="MyCommentView" name="myCommentView"/> <widget class="MyCommentView" name="myCommentView"/>
@ -279,6 +280,12 @@
<header location="global">view.chat_new.chat_new_view.h</header> <header location="global">view.chat_new.chat_new_view.h</header>
<container>1</container> <container>1</container>
</customwidget> </customwidget>
<customwidget>
<class>LocalEpsReadView</class>
<extends>QWidget</extends>
<header location="global">view.tool.local_eps_read_view.h</header>
<container>1</container>
</customwidget>
</customwidgets> </customwidgets>
<resources/> <resources/>
<connections/> <connections/>

View File

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