Skip to content

The only downloader you need. 下载器的集大成者。

- 修改 Linux 版本的图标文件格式和 PySide6 依赖版本 - 移动 Windows 版本判断函数, 防止打不开

XiaoYouChR19642d296a70
diff --git a/app/common/methods.py b/app/common/methods.py
index 31947d2f..794da5e7 100644
--- a/app/common/methods.py
+++ b/app/common/methods.py
@@ -13,7 +13,7 @@ from time import sleep, localtime, time_ns
from urllib.parse import unquote, parse_qs, urlparse
import httpx
-from PySide6.QtCore import QUrl
+from PySide6.QtCore import QUrl, QOperatingSystemVersion
from PySide6.QtGui import QDesktopServices
from PySide6.QtWidgets import QApplication
from loguru import logger
@@ -25,11 +25,22 @@ from app.common.signal_bus import signalBus
plugins = []
+def isGreaterEqualWin10():
+ """ determine if the Windows version ≥ Win10 """
+ cv = QOperatingSystemVersion.current()
+ return sys.platform == "win32" and cv.majorVersion() >= 10
+
+def isLessThanWin10():
+ """ determine if the Windows version < Win10"""
+ cv = QOperatingSystemVersion.current()
+ return sys.platform == "win32" and cv.majorVersion() < 10
+
+def isGreaterEqualWin11():
+ """ determine if the windows version ≥ Win11 """
+ return isGreaterEqualWin10() and sys.getwindowsversion().build >= 22000
def isBorderAccentColorOpen():
""" Check whether the border accent color is open """
- from qframelesswindow.utils.win32_utils import isGreaterEqualWin11
-
if not isGreaterEqualWin11():
return False
diff --git a/app/view/main_window.py b/app/view/main_window.py
index 2858357b..61f45d1b 100644
--- a/app/view/main_window.py
+++ b/app/view/main_window.py
@@ -16,23 +16,13 @@ from .setting_interface import SettingInterface
from .task_interface import TaskInterface
from ..common.config import cfg, Headers, attachmentTypes, FEEDBACK_URL
from ..common.custom_socket import GhostDownloaderSocketServer
-from ..common.methods import getLinkInfo, bringWindowToTop, addDownloadTask, showMessageBox, isBorderAccentColorOpen
+from ..common.methods import getLinkInfo, bringWindowToTop, addDownloadTask, showMessageBox, isBorderAccentColorOpen, \
+ isGreaterEqualWin10, isLessThanWin10
from ..common.signal_bus import signalBus
from ..components.add_task_dialog import AddTaskOptionDialog
from ..components.custom_tray import CustomSystemTrayIcon
from ..components.update_dialog import checkUpdate
-
-def isGreaterEqualWin10():
- """ determine if the Windows version ≥ Win10 """
- cv = QOperatingSystemVersion.current()
- return sys.platform == "win32" and cv.majorVersion() >= 10
-
-def isLessThanWin10():
- """ determine if the Windows version < Win10"""
- cv = QOperatingSystemVersion.current()
- return sys.platform == "win32" and cv.majorVersion() < 10
-
class CustomSplashScreen(SplashScreen):
def finish(self):
diff --git a/app/view/pop_up_window.py b/app/view/pop_up_window.py
index 64f4c611..427d5006 100644
--- a/app/view/pop_up_window.py
+++ b/app/view/pop_up_window.py
@@ -7,7 +7,7 @@ from PySide6.QtWidgets import QWidget, QFileIconProvider, QPushButton, QToolButt
from qfluentwidgets import FluentIcon as FIF
from qfluentwidgets.common.screen import getCurrentScreenGeometry
from qframelesswindow import WindowEffect
-from qframelesswindow.utils.win32_utils import isGreaterEqualWin10
+from app.common.methods import isGreaterEqualWin10
from app.common.methods import openFile, bringWindowToTop, isAbleToShowToast
from app.view.Ui_PopUpWindow import Ui_PopUpWindow
diff --git a/deploy.py b/deploy.py
index 425f199c..938ceb4c 100644
--- a/deploy.py
+++ b/deploy.py
@@ -49,7 +49,7 @@ else:
'--assume-yes-for-downloads',
'--show-memory',
'--show-progress',
- '--linux-icon=resources/logo.ico',
+ '--linux-icon=resources/logo.png',
'--output-dir=dist',
'Ghost-Downloader-3.py',
]
diff --git a/requirements.txt b/requirements.txt
index 9ebd1699..4a948dd2 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,6 @@
PySide6-Fluent-Widgets>=1.7.4
-PySide6==6.7.3
+PySide6==6.9.0; sys_platform!="win32"
+PySide6==6.7.3; sys_platform=="win32"
loguru
httpx[socks]
aiofiles