Skip to content

Commit

Permalink
更新
Browse files Browse the repository at this point in the history
  • Loading branch information
tonquer committed May 26, 2024
1 parent 1599c8f commit 3bec230
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 31 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
env:
PACKAGENAME: jmcomic_py37_windows_x64
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python 3.7
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.7
- name: Install dependencies
Expand Down Expand Up @@ -51,9 +51,9 @@ jobs:
env:
PACKAGENAME: jmcomic_py37_windows7_x64
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python 3.7
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.7
- name: Install dependencies
Expand Down Expand Up @@ -85,9 +85,9 @@ jobs:
env:
PACKAGENAME: jmcomic_py37_linux
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python 3.7
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.7
- name: Install dependencies
Expand Down Expand Up @@ -127,9 +127,9 @@ jobs:
env:
PACKAGENAME: jmcomic_py37_macos
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python 3.7
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.7

Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
TAG_NAME: ${{ steps.get-package_prefix.outputs.TAG_NAME }}
HEAD_SHA_SHORT: ${{ steps.get-package_prefix.outputs.HEAD_SHA_SHORT }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: get-package_prefix
Expand Down Expand Up @@ -47,9 +47,9 @@ jobs:
env:
PACKAGENAME: ${{ needs.setup.outputs.PACKAGE_PREFIX }}_macos_x64
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python 3.7
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.7

Expand Down Expand Up @@ -110,9 +110,9 @@ jobs:
env:
PACKAGENAME: ${{ needs.setup.outputs.PACKAGE_PREFIX }}_windows_x64
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python 3.7
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.7

Expand Down Expand Up @@ -150,9 +150,9 @@ jobs:
env:
PACKAGENAME: ${{ needs.setup.outputs.PACKAGE_PREFIX }}_windows7_x64
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python 3.7
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.7

Expand Down Expand Up @@ -189,9 +189,9 @@ jobs:
env:
PACKAGENAME: ${{ needs.setup.outputs.PACKAGE_PREFIX }}_linux_x64
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python 3.7
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.7
- name: Install dependencies
Expand Down
8 changes: 4 additions & 4 deletions src/component/list/comic_list_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ def AddBookByLocal(self, v, category=""):
widget.picNum = v.picCnt
widget.url = v.file
if len(v.eps) > 0:
title += "<font color=#d5577c>{}</font>".format("(" + str(len(v.eps)) + "E)")
fontColor = "<font color=#d5577c>{}</font>".format("(" + str(len(v.eps)) + "E)")
else:
title += "<font color=#d5577c>{}</font>".format("(" + str(v.picCnt) + "P)")
fontColor = "<font color=#d5577c>{}</font>".format("(" + str(v.picCnt) + "P)")
if v.lastReadTime:
categories = "{} {}".format(ToolUtil.GetUpdateStrByTick(v.lastReadTime), Str.GetStr(Str.Looked))

Expand All @@ -133,7 +133,7 @@ def AddBookByLocal(self, v, category=""):
widget.categoryLabel.setText(category)
widget.categoryLabel.setVisible(True)

widget.SetTitle(title)
widget.SetTitle(title, fontColor)
item = QListWidgetItem(self)
item.setFlags(item.flags() & ~Qt.ItemIsSelectable)
item.setSizeHint(widget.sizeHint())
Expand All @@ -160,7 +160,7 @@ def AddBookItem(self, _id, title, categoryStr="", url=""):
widget.url = url
widget.index = index
widget.categoryLabel.setText(categoryStr)
widget.SetTitle(title)
widget.SetTitle(title, "")
widget.path = ToolUtil.GetRealPath(_id, "cover")
widget.starButton.setVisible(False)
widget.timeLabel.setVisible(False)
Expand Down
8 changes: 4 additions & 4 deletions src/component/widget/comic_item_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def __init__(self, isCategory=False):
self.isWaifu2xLoading = False
self.isLoadPicture = False

def SetTitle(self, title):
def SetTitle(self, title, fontColor):
self.title = title
if Setting.NotCategoryShow.value:
self.categoryLabel.setVisible(False)
Expand All @@ -77,11 +77,11 @@ def SetTitle(self, title):
self.nameLable.setVisible(False)
elif Setting.TitleLine.value == 1:
self.nameLable.setWordWrap(False)
self.nameLable.setText(title)
self.nameLable.setText(title + fontColor)
elif Setting.TitleLine.value > 3:
self.nameLable.setText(title)
self.nameLable.setText(title+fontColor)
else:
title2 = self.ElidedLineText()
title2 = self.ElidedLineText(fontColor)
self.nameLable.setText(title2)

def ElidedLineText(self, fontColor):
Expand Down
4 changes: 2 additions & 2 deletions src/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
UpdateUrl2Back = "https://hub.ggo.icu/tonquer/JMComic-qt/"
UpdateUrl3Back = "https://hub.fastgit.xyz/tonquer/JMComic-qt"

UpdateVersion = "v1.2.3"
RealVersion = "v1.2.3"
UpdateVersion = "v1.2.2"
RealVersion = "v1.2.2"
VersionTime = "2024-5-26"

Waifu2xVersion = "1.1.6"
Expand Down
4 changes: 2 additions & 2 deletions src/config/global_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class GlobalConfig:

# Url2 = GlobalItem("https://www.jmapinode.biz")
# PicUrl2 = GlobalItem("https://cdn-msp.jmapinodeudzn.net")
Url2List = GlobalItem(["https://cdn-msp2.jmapinodeudzn.net","https://cn-appdata.jmapiproxy2.cc","https://www.jmapinodeudzn.xyz","https://www.jmapinode.xyz"])
Url2List = GlobalItem(["https://www.cdn-eldenringproxy.xyz","https://cn-appdata.jmapiproxy2.cc","https://www.jmapinodeudzn.xyz","https://www.jmapinode.xyz"])

ProxyApiDomain2 = GlobalItem("jm2-api.ggo.icu")
ProxyImgDomain2 = GlobalItem("jm2-img.ggo.icu")
Expand All @@ -45,7 +45,7 @@ class GlobalConfig:
CdnImgUrl = GlobalItem("https://cdn-msp.jmapiproxy3.cc")
ProxyApiUrl = GlobalItem("https://www.jmapinodeudzn.xyz")
ProxyImgUrl = GlobalItem("https://cdn-msp.jmapiproxy3.cc")
HeaderVer = GlobalItem("1.6.8")
HeaderVer = GlobalItem("1.7.0")

def __init__(self):
pass
Expand Down
1 change: 1 addition & 0 deletions src/config/setting.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ class Setting:
IsOpenDohPicture = SettingValue("ProxySetting", 0, False)
DohAddress = SettingValue("ProxySetting", "https://doh.pub/dns-query", True)
ApiVersion = SettingValue("ProxySetting", 0, False)
LastProxyResult = SettingValue("ProxySetting", {}, False)

ProxyImgSelectIndex = SettingValue("ProxySetting", 1, False)
PreferCDNIPImg = SettingValue("ProxySetting", "104.18.227.172", False)
Expand Down
26 changes: 24 additions & 2 deletions src/view/user/login_proxy_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ def __init__(self):
self.maxNum = 7
self.loginProxy.hide()
self.uaRandom.clicked.connect(self.RandomUa)
self.lastResult = {}
self.LoadHistory()

def Init(self):
self.LoadSetting()
Expand All @@ -67,6 +69,19 @@ def Init(self):
else:
self.checkLabel.setVisible(True)

def LoadHistory(self):
if not Setting.LastProxyResult.value:
return
try:
for k, v in Setting.LastProxyResult.value.items():
if hasattr(self, k):
getattr(self, k).setText(str(v))
except Exception as es:
Log.Error(es)

def SaveHistory(self):
Setting.LastProxyResult.SetValue(dict(self.lastResult))

def ClickButton(self):
self.SaveSetting()

Expand Down Expand Up @@ -246,6 +261,7 @@ def SpeedTestPingBack(self, raw, v):
i, backNum = v
data = raw["data"]
st = raw["st"]
objectName = "label_api_" + str(i)
label = getattr(self, "label_api_" + str(i))
if float(data) > 0.0:
self.pingBackNumDict[i][backNum] = int(float(data))
Expand All @@ -266,18 +282,22 @@ def SpeedTestPingBack(self, raw, v):
else:
sumSt = data
if sumCnt >= 1:
label.setText("<font color=#7fb80e>{}</font>".format(str(int(float(sumData / sumCnt))) + "ms"))
text = "<font color=#7fb80e>{}</font>".format(str(int(float(sumData / sumCnt))) + "ms")
label.setText(text)
else:
label.setText("<font color=#d71345>{}</font>".format(Str.GetStr(int(sumSt))))
text = "<font color=#d71345>{}</font>".format(Str.GetStr(int(sumSt)))
label.setText(text)

self.speedPingNum += 1
self.lastResult[objectName] = text
self.StartSpeedPing()
return

def StartSpeedTest(self):
if len(self.speedTest) <= self.speedIndex:
self.UpdateServer()
self.SetEnabled(True)
self.SaveHistory()
return

address, imgUrl, isHttpProxy, isProxyUrl, dnslist, i = self.speedTest[self.speedIndex]
Expand Down Expand Up @@ -324,9 +344,11 @@ def SpeedTestBack(self, raw, i):
data = "<font color=#d71345>{}</font>".format(Str.GetStr(st))
else:
data = "<font color=#7fb80e>{}</font>".format(data)
objectName = "label_img_" + str(i)
label = getattr(self, "label_img_" + str(i))
label.setText(data)
self.speedIndex += 1
self.lastResult[objectName] = data
self.StartSpeedTest()
return

Expand Down

0 comments on commit 3bec230

Please sign in to comment.