Skip to content

Commit

Permalink
更新1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tonquer committed Sep 25, 2022
1 parent dbca6a2 commit 3d7218e
Show file tree
Hide file tree
Showing 42 changed files with 779 additions and 69 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
# tonquer<[email protected]>
# https://github.com/tonquer/picacg-qt
######################################################################################
# Version: v1.4.0
# 2022/9/25
# 1) 新增一个反代分流(其他分流不可用时解锁,防止滥用)
# 2) 设置中新增关闭时可最小化到托盘
# 3) 下载界面,有更新章节时显示NEW
# 4) 收藏界面,有更新章节时显示NEW
# 5) 修复部分漫画无法显示所以章节

# Version: v1.3.9
# 2022/8/14
# 1) 漫画详情新增大家都在看
Expand Down
12 changes: 12 additions & 0 deletions build_mac.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
cd src
pyinstaller --clean --onedir --name PicACG \
--hidden-import waifu2x_vulkan --hidden-import PySide6 --hidden-import requests \
--hidden-import urllib3 --hidden-import websocket-client --hidden-import pillow \
--hidden-import config
--hidden-import component
--hidden-import server
--hidden-import task
--hidden-import tools
--hidden-import view
--strip --windowed -i Icon.icns \
start.py
41 changes: 41 additions & 0 deletions src/component/dialog/show_close_dialog.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
from PySide6.QtWidgets import QApplication

from component.dialog.base_mask_dialog import BaseMaskDialog
from config.setting import Setting
from interface.ui_exit import Ui_Exit
from qt_owner import QtOwner


class ShowCloseDialog(BaseMaskDialog, Ui_Exit):

def __init__(self, parent=None):
BaseMaskDialog.__init__(self, parent)
Ui_Exit.__init__(self)
self.widget.adjustSize()
self.setupUi(self.widget)
self.buttonGroup.setId(self.radioButton1, 0)
self.buttonGroup.setId(self.radioButton2, 1)
self.button.clicked.connect(self.Click)
self.checkBox.clicked.connect(self.SwitchCheckBox)

def SwitchCheckBox(self, check):
Setting.IsNotShowCloseTip.SetValue(int(self.checkBox.isChecked()))

def Click(self):
if self.radioButton1.isChecked():
Setting.ShowCloseType.SetValue(0)
self.close()
QtOwner().closeType = 2
QApplication.quit()
else:
QtOwner().owner.myTrayIcon.show()
Setting.ShowCloseType.SetValue(1)
self.close()
QtOwner().owner.hide()
return

def LoadSetting(self):
self.checkBox.setChecked(bool(Setting.IsNotShowCloseTip.value))
button = getattr(self, "radioButton{}".format(int(Setting.ShowCloseType.value+1)))
button.setChecked(True)
return
4 changes: 2 additions & 2 deletions src/component/label/auto_picture_label.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ def SetGifData(self, data, width, height):
newPic = pic.scaled(width*radio, height*radio, Qt.KeepAspectRatio, Qt.SmoothTransformation)
self.setPixmap(newPic)
self.setScaledContents(True)
widget = data.width() // max(1, data.devicePixelRatioF())
height = data.height()//max(1, data.devicePixelRatioF())
widget = newPic.width() // max(1, newPic.devicePixelRatioF())
height = newPic.height()//max(1, newPic.devicePixelRatioF())
self.setFixedWidth(widget)
self.setFixedHeight(height)

Expand Down
4 changes: 4 additions & 0 deletions src/component/line_edit/search_line_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ def listView(self):
def SetWordData(self, data):
self.words = data

def UpdateTime(self, text):
self.help.updateTime.setText(text)
return

def SetCacheWord(self):
SqlServer().SetCacheWord(self.cacheWords)
self.model.setStringList(self.cacheWords)
Expand Down
11 changes: 8 additions & 3 deletions src/component/list/comic_list_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def AddBookByDict(self, v):
pagesCount = v.get("pagesCount")
self.AddBookItem(_id, title, categoryStr, url, path, likesCount, "", pagesCount, finished)

def AddBookItemByBook(self, v, isShowHistory=False):
def AddBookItemByBook(self, v, isShowHistory=False, isShowToolButton=False):
title = v.title
url = v.fileServer
path = v.path
Expand All @@ -95,8 +95,11 @@ def AddBookItemByBook(self, v, isShowHistory=False):
if isShowHistory:
info = QtOwner().owner.historyView.GetHistory(_id)
if info:
if v.epsCount > info.epsId:
isShowToolButton = True

categories = Str.GetStr(Str.LastLook) + str(info.epsId + 1) + Str.GetStr(Str.Chapter) + "/" + str(v.epsCount) + Str.GetStr(Str.Chapter)
self.AddBookItem(_id, title, categories, url, path, likesCount, updated_at, pagesCount, finished)
self.AddBookItem(_id, title, categories, url, path, likesCount, updated_at, pagesCount, finished, isShowToolButton=isShowToolButton)

def AddBookItemByHistory(self, v):
_id = v.bookId
Expand All @@ -106,7 +109,7 @@ def AddBookItemByHistory(self, v):
categories = "{} {}".format(ToolUtil.GetUpdateStrByTick(v.tick), Str.GetStr(Str.Looked))
self.AddBookItem(_id, title, categories, url, path)

def AddBookItem(self, _id, title, categoryStr="", url="", path="", likesCount="", updated_at="", pagesCount="", finished=""):
def AddBookItem(self, _id, title, categoryStr="", url="", path="", likesCount="", updated_at="", pagesCount="", finished="", isShowToolButton=False):
index = self.count()
widget = ComicItemWidget()
widget.setFocusPolicy(Qt.NoFocus)
Expand All @@ -118,6 +121,8 @@ def AddBookItem(self, _id, title, categoryStr="", url="", path="", likesCount=""
widget.path = ToolUtil.GetRealPath(_id, "cover")

widget.index = index
if not isShowToolButton:
widget.toolButton.hide()
widget.categoryLabel.setText(categoryStr)
if updated_at:
dayStr = ToolUtil.GetUpdateStr(updated_at)
Expand Down
Empty file.
48 changes: 48 additions & 0 deletions src/component/system_tray_icon/my_system_tray_icon.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
from PySide6.QtGui import QIcon, QAction
from PySide6.QtWidgets import QSystemTrayIcon, QMenu, QApplication

from qt_owner import QtOwner
from tools.str import Str


class MySystemTrayIcon(QSystemTrayIcon):
def __init__(self, parent=None):
super().__init__(parent)
self.count = 0
self.setIcon(QIcon(":/png/icon/logo_round.png"))
self.setToolTip("PicACG")
self.menu = QMenu()
mainUi = QAction(Str.GetStr(Str.MainUi), self)
mainUi.triggered.connect(self.ShowMainUi)

showMin = QAction(Str.GetStr(Str.ShowMin), self)
showMin.triggered.connect(self.ShowMin)

quit = QAction(Str.GetStr(Str.Exit), self)
quit.triggered.connect(self.Close)

self.menu.addAction(mainUi)
self.menu.addAction(showMin)
self.menu.addAction(quit)
self.setContextMenu(self.menu)
self.activated.connect(self.OnActive)

def ShowMainUi(self):
QtOwner().owner.show()
pass

def ShowMin(self):
QtOwner().owner.hide()
pass

def Close(self):
QtOwner().closeType = 3
QtOwner().owner.close()

def OnActive(self, reason):
if reason == QSystemTrayIcon.Trigger:
return
elif reason == QSystemTrayIcon.DoubleClick:
self.ShowMainUi()
return
pass
7 changes: 7 additions & 0 deletions src/component/widget/comic_item_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ def __init__(self, isCategory=False):
width = baseW * rate / 100
height = baseH * rate / 100

icon2 = QIcon()
icon2.addFile(u":/png/icon/new.svg", QSize(), QIcon.Normal, QIcon.Off)
self.toolButton.setMinimumSize(QSize(0, 40))
self.toolButton.setFocusPolicy(Qt.NoFocus)
self.toolButton.setIcon(icon2)
self.toolButton.setIconSize(QSize(32, 32))

self.picLabel.setFixedSize(width, height)
# self.picLabel.setMinimumSize(300, 400)
# self.picLabel.setMaximumSize(220, 308)
Expand Down
8 changes: 8 additions & 0 deletions src/component/widget/main_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ def setSubTitle(self, text):
self.widget.subTitle.setText(text)
return

def hide(self):
self.widget.hide()
return super(MainWidget, self).hide()

def show(self):
self.widget.show()
return super(MainWidget, self).show()

Main = MainWidget
MainType = 2
except Exception as es:
Expand Down
2 changes: 2 additions & 0 deletions src/component/widget/navigation_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ def LoginSucBack(self):
def UpdateProxyName(self):
if Setting.ProxySelectIndex.value == 4:
self.proxyName.setText("CDN_{}".format(Setting.PreferCDNIP.value))
elif Setting.ProxySelectIndex.value == 5:
self.proxyName.setText("JP反代分流")
else:
self.proxyName.setText("分流{}".format(str(Setting.ProxySelectIndex.value)))

Expand Down
6 changes: 3 additions & 3 deletions src/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
DatabaseUpdate3 = "https://raw.bika.life/bika-robot/picacg-database/main/version3.txt"
DatabaseDownload3 = "https://raw.bika.life/bika-robot/picacg-database/main/data3/"

UpdateVersion = "v1.3.9"
RealVersion = "v1.3.9.1"
TimeVersion = "2022-8-14"
UpdateVersion = "v1.4.0"
RealVersion = "v1.4.0"
TimeVersion = "2022-9-25"

Waifu2xVersion = "1.1.4"

Expand Down
Loading

0 comments on commit 3d7218e

Please sign in to comment.