Skip to content

Commit

Permalink
update v1.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
tonquer committed Feb 14, 2023
1 parent e1512c0 commit b058ed8
Show file tree
Hide file tree
Showing 37 changed files with 1,929 additions and 367 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ jobs:
pip install urllib3==1.25.11
pip install pillow==8.3.2
pip install Pysocks==1.7.1
pip install natsort==8.2.0
pip install https://github.com/tonquer/waifu2x-vulkan/releases/download/v1.1.5/waifu2x_vulkan-1.1.5-cp37-cp37m-macosx_10_15_x86_64.whl
brew install create-dmg
- name: Build
Expand Down Expand Up @@ -176,6 +177,7 @@ jobs:
pip install pillow==8.3.2
pip install waifu2x-vulkan==1.1.5
pip install Pysocks==1.7.1
pip install natsort==8.2.0
- name: Build
run: |
cd src
Expand Down
58 changes: 50 additions & 8 deletions src/component/list/comic_list_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,19 @@ def __init__(self, parent):
self.itemClicked.connect(self.SelectItem)
self.isDelMenu = False
self.isGame = False
self.isLocal = False

def SelectMenuBook(self, pos):
index = self.indexAt(pos)
widget = self.indexWidget(index)
if index.isValid() and widget:
assert isinstance(widget, ComicItemWidget)
popMenu = QMenu(self)
action = popMenu.addAction(Str.GetStr(Str.Open))
action.triggered.connect(partial(self.OpenBookInfoHandler, index))

if not self.isLocal:
action = popMenu.addAction(Str.GetStr(Str.Open))
action.triggered.connect(partial(self.OpenBookInfoHandler, index))

action = popMenu.addAction(Str.GetStr(Str.LookCover))
action.triggered.connect(partial(self.OpenPicture, index))
action = popMenu.addAction(Str.GetStr(Str.ReDownloadCover))
Expand All @@ -54,12 +58,14 @@ def SelectMenuBook(self, pos):
action.triggered.connect(partial(self.CancleWaifu2xPicture, index))
action = popMenu.addAction(Str.GetStr(Str.CopyTitle))
action.triggered.connect(partial(self.CopyHandler, index))
action = popMenu.addAction(Str.GetStr(Str.Download))
action.triggered.connect(partial(self.DownloadHandler, index))

if not self.isGame:
action = popMenu.addAction(Str.GetStr(Str.DownloadAll))
action.triggered.connect(self.OpenBookDownloadAll)
if not self.isLocal:
action = popMenu.addAction(Str.GetStr(Str.Download))
action.triggered.connect(partial(self.DownloadHandler, index))

if not self.isGame:
action = popMenu.addAction(Str.GetStr(Str.DownloadAll))
action.triggered.connect(self.OpenBookDownloadAll)

if self.isDelMenu:
action = popMenu.addAction(Str.GetStr(Str.Delete))
Expand All @@ -86,6 +92,37 @@ def AddBookByDict(self, v):
pagesCount = v.get("pagesCount")
self.AddBookItem(_id, title, categoryStr, url, path, likesCount, "", pagesCount, finished)

def AddBookByLocal(self, v, isFirstAdd=False):
from task.task_local import LocalData
assert isinstance(v, LocalData)
index = self.count()
widget = ComicItemWidget()
widget.setFocusPolicy(Qt.NoFocus)
widget.id = v.id
title = v.title
widget.index = index
widget.title = v.title
widget.picNum = v.picCnt
widget.url = v.file
title += "<font color=#d5577c>{}</font>".format("(" + str(v.picCnt) + "P)")
if v.lastReadTime:
categories = "{} {}".format(ToolUtil.GetUpdateStrByTick(v.lastReadTime), Str.GetStr(Str.Looked))

widget.timeLabel.setText(categories)
else:
widget.timeLabel.setVisible(False)

widget.toolButton.setVisible(False)
widget.categoryLabel.setVisible(False)
widget.starButton.setVisible(False)
widget.nameLable.setText(title)
item = QListWidgetItem(self)
item.setFlags(item.flags() & ~Qt.ItemIsSelectable)
item.setSizeHint(widget.sizeHint())
self.setItemWidget(item, widget)
widget.picLabel.setText(Str.GetStr(Str.LoadingPicture))
widget.PicLoad.connect(self.LoadingPicture)

def AddBookItemByBook(self, v, isShowHistory=False, isShowToolButton=False):
title = v.title
url = v.fileServer
Expand Down Expand Up @@ -197,6 +234,8 @@ def SelectItem(self, item):
assert isinstance(widget, ComicItemWidget)
if self.isGame:
QtOwner().OpenGameInfo(widget.id)
elif self.isLocal:
QtOwner().OpenLocalBook(widget.id)
else:
QtOwner().OpenBookInfo(widget.id)
return
Expand Down Expand Up @@ -235,7 +274,10 @@ def Waifu2xPicture(self, index, isIfSize=False):
if max(w, h) <= Setting.CoverMaxNum.value or not isIfSize:
model = ToolUtil.GetModelByIndex(Setting.CoverLookNoise.value, Setting.CoverLookScale.value, Setting.CoverLookModel.value, mat)
widget.isWaifu2xLoading = True
self.AddConvertTask(widget.path, widget.picData, model, self.Waifu2xPictureBack, index)
if self.isLocal:
self.AddConvertTask(widget.path, widget.picData, model, self.Waifu2xPictureBack, index, noSaveCache=True)
else:
self.AddConvertTask(widget.path, widget.picData, model, self.Waifu2xPictureBack, index)

def CancleWaifu2xPicture(self, index):
widget = self.indexWidget(index)
Expand Down
15 changes: 14 additions & 1 deletion src/component/widget/navigation_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,22 @@ def UpdateProxyName(self):
self.proxyName.setText("CDN_{}".format(Setting.PreferCDNIP.value))
elif Setting.ProxySelectIndex.value == 5:
self.proxyName.setText("JP反代分流")
elif Setting.ProxySelectIndex.value == 6:
self.proxyName.setText("US反代分流")

else:
self.proxyName.setText("分流{}".format(str(Setting.ProxySelectIndex.value)))

if Setting.ProxyImgSelectIndex.value == 4:
self.proxyImgName.setText("CDN_{}".format(Setting.PreferCDNIPImg.value))
elif Setting.ProxyImgSelectIndex.value == 5:
self.proxyImgName.setText("JP反代分流")
elif Setting.ProxyImgSelectIndex.value == 6:
self.proxyImgName.setText("US反代分流")
else:
self.proxyImgName.setText("分流{}".format(str(Setting.ProxyImgSelectIndex.value)))


def UpdateUserBack(self, raw):
self.levelLabel.setText("LV" + str(User().level))
self.expLabel.setText("Exp: " + str(User().exp))
Expand Down Expand Up @@ -162,7 +175,7 @@ def __hideAniFinishedSlot(self):
def eventFilter(self, obj, event):
if event.type() == QEvent.MouseButtonPress:
if event.button() == Qt.LeftButton:
if self.picData and (obj == self.picLabel):
if (obj == self.picLabel):
QtOwner().OpenWaifu2xTool(self.picData)
return True
return False
Expand Down
48 changes: 29 additions & 19 deletions src/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,35 @@
IsLoadingPicture = True

UpdateUrl = "https://github.com/tonquer/picacg-qt/releases/latest"
UpdateUrlApi = "https://api.github.com/repos/tonquer/picacg-qt/releases"
UpdateUrlBack = "https://github.com/tonquer/picacg-qt"
UpdateUrl2 = "https://hub.fastgit.xyz/tonquer/picacg-qt/releases/latest"
UpdateUrl2Back = "https://hub.fastgit.xyz/tonquer/picacg-qt"

UpdateUrl3 = "https://hub.ggo.icu/tonquer/picacg-qt/releases/latest"
UpdateUrl3Back = "https://hub.ggo.icu/tonquer/picacg-qt"
UpdateUrl2 = "https://hub.ggo.icu/tonquer/picacg-qt/releases/latest"
UpdateUrl2Api = "https://api.ggo.icu/repos/tonquer/picacg-qt/releases"
UpdateUrl2Back = "https://hub.ggo.icu/tonquer/picacg-qt"

DatabaseUpdate = "https://raw.githubusercontent.com/bika-robot/picacg-database/main/version3.txt"
DatabaseDownload = "https://raw.githubusercontent.com/bika-robot/picacg-database/main/data3/"
UpdateUrl3 = "https://hub.fastgit.xyz/tonquer/picacg-qt/releases/latest"
UpdateUrl3Api = "https://api.fastgit.xyz/repos/tonquer/picacg-qt/releases"
UpdateUrl3Back = "https://hub.fastgit.xyz/tonquer/picacg-qt"

DatabaseUpdate2 = "https://raw.fastgit.org/bika-robot/picacg-database/main/version3.txt"
DatabaseDownload2 = "https://raw.fastgit.org/bika-robot/picacg-database/main/data3/"
DatabaseUpdate = "https://raw.ggo.icu/bika-robot/picacg-database/main/version3.txt"
DatabaseDownload = "https://raw.ggo.icu/bika-robot/picacg-database/main/data3/"

DatabaseUpdate3 = "https://raw.ggo.icu/bika-robot/picacg-database/main/version3.txt"
DatabaseDownload3 = "https://raw.ggo.icu/bika-robot/picacg-database/main/data3/"
DatabaseUpdate2 = "https://raw.githubusercontent.com/bika-robot/picacg-database/main/version3.txt"
DatabaseDownload2 = "https://raw.githubusercontent.com/bika-robot/picacg-database/main/data3/"

UpdateVersion = "v1.4.1"
RealVersion = "v1.4.1.1"
TimeVersion = "2023-1-23"
DatabaseUpdate3 = "https://raw.fastgit.org/bika-robot/picacg-database/main/version3.txt"
DatabaseDownload3 = "https://raw.fastgit.org/bika-robot/picacg-database/main/data3/"

Waifu2xVersion = "1.1.4"
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.2"
RealVersion = "v1.4.2"
TimeVersion = "2023-2-5"

Waifu2xVersion = "1.1.5"


# waifu2x
Expand All @@ -63,16 +71,15 @@

IsTips = 1

# ISSUES
Issues = "https://github.com/tonquer/picacg-qt/issues"

# 代理与分流相关
ProxyUrl = "https://github.com/tonquer/picacg-qt/discussions/48"
ProxyUrl1 = "https://github.com/tonquer/picacg-qt/discussions/48"
ProxyUrl2 = "https://hub.ggo.icu/tonquer/picacg-qt/discussions/48"
ProxyUrl3 = "https://hub.fastgit.xyz/tonquer/picacg-qt/discussions/48"

# Waifu2x相关
Waifu2xUrl = "https://github.com/tonquer/picacg-qt/discussions/76"

Address = ["104.22.64.159", "104.21.91.145"] # 分类2,3 Ip列表
Address = ["188.114.98.153", "104.21.91.145"] # 分类2,3 Ip列表

ImageServer2 = 's3.picacomic.com' # 分流2 使用的图片服务器
ImageServer2Jump = 'img.picacomic.com' # 分流2 跳转的图片服务器
Expand All @@ -82,6 +89,9 @@
ProxyApiDomain = "bika-api.ggo.icu"
ProxyImgDomain = "bika-img.ggo.icu"

ProxyApiDomain2 = "bika2-api.ggo.icu"
ProxyImgDomain2 = "bika2-img.ggo.icu"

ApiDomain = [
"picaapi.picacomic.com",
"post-api.wikawika.xyz"
Expand Down
18 changes: 17 additions & 1 deletion src/config/setting.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,12 @@ class Setting:
HttpProxy = SettingValue("ProxySetting", "", False)
Sock5Proxy = SettingValue("ProxySetting", "", False)
ChatProxy = SettingValue("ProxySetting", 0, False)
PreferCDNIP = SettingValue("ProxySetting", "104.16.109.107", False)
PreferCDNIP = SettingValue("ProxySetting", "104.18.227.172", False)
IsUseHttps = SettingValue("ProxySetting", 1, False)

ProxySelectIndex = SettingValue("ProxySetting", 1, False)
ProxyImgSelectIndex = SettingValue("ProxySetting", 1, False)
PreferCDNIPImg = SettingValue("ProxySetting", "104.18.227.172", False)

# 下载与缓存
SavePath = SettingValue("DownloadSetting", "", False)
Expand All @@ -107,6 +110,7 @@ class Setting:
# Waifu2x设置
SelectEncodeGpu = SettingValue("Waifu2xSetting", "", True)
Waifu2xCpuCore = SettingValue("Waifu2xSetting", 0, True)
Waifu2xTileSize = SettingValue("Waifu2xSetting", 0, False, [0, 200, 100, 32])

# 封面 Waifu2x
CoverIsOpenWaifu = SettingValue("Waifu2xSetting", 0, False)
Expand Down Expand Up @@ -143,6 +147,8 @@ class Setting:
IsShowCmd = SettingValue("Other", 0, False)
IsGrabGesture: SettingValue = SettingValue("Other", 0, True)
IsShowProxy5 = SettingValue("Other", 0, False)
IsPreUpdate = SettingValue("Other", 0, False)
SaveCacheAddress = SettingValue("Other", "104.21.91.145", False)

@staticmethod
def InitLoadSetting():
Expand Down Expand Up @@ -182,9 +188,19 @@ def Init():
path = Setting.GetConfigPath()
if not os.path.isdir(path):
os.mkdir(path)
path2 = Setting.GetLocalHomePath()
if not os.path.isdir(path2):
os.mkdir(path2)
Setting.CheckRepair()
return

@staticmethod
def GetLocalHomePath():
from PySide6.QtCore import QDir
homePath = QDir.homePath()
projectName = ".comic-qt"
return os.path.join(homePath, projectName)

@staticmethod
def GetConfigPath():
import sys
Expand Down
Binary file modified src/data/book.db
Binary file not shown.
12 changes: 9 additions & 3 deletions src/interface/ui_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
QFont, QFontDatabase, QGradient, QIcon,
QImage, QKeySequence, QLinearGradient, QPainter,
QPalette, QPixmap, QRadialGradient, QTransform)
from PySide6.QtWidgets import (QApplication, QGridLayout, QHBoxLayout, QLabel,
QPushButton, QSizePolicy, QSpacerItem, QVBoxLayout,
QWidget)
from PySide6.QtWidgets import (QApplication, QCheckBox, QGridLayout, QHBoxLayout,
QLabel, QPushButton, QSizePolicy, QSpacerItem,
QVBoxLayout, QWidget)

from component.scroll_area.smooth_scroll_area import SmoothScrollArea
import images_rc
Expand Down Expand Up @@ -172,6 +172,11 @@ def setupUi(self, Help):

self.gridLayout.addWidget(self.openCmd, 5, 1, 1, 1)

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

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


self.verticalLayout_2.addWidget(self.widget_2)

Expand Down Expand Up @@ -248,6 +253,7 @@ def retranslateUi(self, Help):
self.upTimeLabel.setText(QCoreApplication.translate("Help", u"2021-11-27", None))
self.waifu2x.setText(QCoreApplication.translate("Help", u"v1.0.8", None))
self.openCmd.setText(QCoreApplication.translate("Help", u"\u6253\u5f00\u63a7\u5236\u53f0", None))
self.preCheckBox.setText(QCoreApplication.translate("Help", u"\u63a5\u53d7Beta\u7248\u672c\u66f4\u65b0", None))
self.label_8.setText(QCoreApplication.translate("Help", u"\u65b0\u7248\u672c\uff1a", None))
self.updateLabel.setText("")
self.updateButton.setText(QCoreApplication.translate("Help", u"\u524d\u5f80\u66f4\u65b0", None))
Expand Down
42 changes: 24 additions & 18 deletions src/interface/ui_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
QFont, QFontDatabase, QGradient, QIcon,
QImage, QKeySequence, QLinearGradient, QPainter,
QPalette, QPixmap, QRadialGradient, QTransform)
from PySide6.QtWidgets import (QApplication, QHBoxLayout, QListWidgetItem, QSizePolicy,
QSpacerItem, QTabWidget, QToolButton, QVBoxLayout,
QWidget)
from PySide6.QtWidgets import (QApplication, QHBoxLayout, QListWidgetItem, QPushButton,
QSizePolicy, QSpacerItem, QTabWidget, QToolButton,
QVBoxLayout, QWidget)

from component.list.comic_list_widget import ComicListWidget

Expand All @@ -29,20 +29,6 @@ def setupUi(self, Index):
self.verticalLayout_2 = QVBoxLayout(Index)
self.verticalLayout_2.setSpacing(0)
self.verticalLayout_2.setObjectName(u"verticalLayout_2")
self.horizontalLayout = QHBoxLayout()
self.horizontalLayout.setObjectName(u"horizontalLayout")
self.toolButton = QToolButton(Index)
self.toolButton.setObjectName(u"toolButton")

self.horizontalLayout.addWidget(self.toolButton)

self.horizontalSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)

self.horizontalLayout.addItem(self.horizontalSpacer)


self.verticalLayout_2.addLayout(self.horizontalLayout)

self.tabWidget = QTabWidget(Index)
self.tabWidget.setObjectName(u"tabWidget")
self.tabWidget.setStyleSheet(u"")
Expand All @@ -66,6 +52,25 @@ def setupUi(self, Index):

self.verticalLayout_3.addWidget(self.godList)

self.horizontalLayout = QHBoxLayout()
self.horizontalLayout.setObjectName(u"horizontalLayout")
self.horizontalSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)

self.horizontalLayout.addItem(self.horizontalSpacer)

self.pushButton = QPushButton(self.tab_3)
self.pushButton.setObjectName(u"pushButton")

self.horizontalLayout.addWidget(self.pushButton)

self.toolButton = QToolButton(self.tab_3)
self.toolButton.setObjectName(u"toolButton")

self.horizontalLayout.addWidget(self.toolButton)


self.verticalLayout_3.addLayout(self.horizontalLayout)

self.tabWidget.addTab(self.tab_3, "")
self.tab_2 = QWidget()
self.tab_2.setObjectName(u"tab_2")
Expand All @@ -91,11 +96,12 @@ def setupUi(self, Index):

def retranslateUi(self, Index):
Index.setWindowTitle(QCoreApplication.translate("Index", u"\u9996\u9875", None))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_1), QCoreApplication.translate("Index", u"\u968f\u673a\u63a8\u8350", None))
self.pushButton.setText(QCoreApplication.translate("Index", u"\u6279\u91cf\u4e0b\u8f7d", None))
self.toolButton.setText(QCoreApplication.translate("Index", u"\u5237\u65b0(F5)", None))
#if QT_CONFIG(shortcut)
self.toolButton.setShortcut(QCoreApplication.translate("Index", u"F5", None))
#endif // QT_CONFIG(shortcut)
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_1), QCoreApplication.translate("Index", u"\u968f\u673a\u63a8\u8350", None))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), QCoreApplication.translate("Index", u"\u672c\u5b50\u795e\u63a8\u8350", None))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), QCoreApplication.translate("Index", u"\u672c\u5b50\u9b54\u63a8\u8350", None))
# retranslateUi
Expand Down
Loading

0 comments on commit b058ed8

Please sign in to comment.