The only downloader you need. 下载器的集大成者。
TypeScript asyncasynciobittorentbtcross-platformdownload-managerdownloaderfluent-designftphttp3magnetpyqtpyside6pythonqtquicreactsoftwarestreaming
Fix #156
XiaoYouChR6ee842a32a7f
diff --git a/app/common/application.py b/app/common/application.pyindex f910f779..f799e355 100644--- a/app/common/application.py+++ b/app/common/application.py@@ -2,10 +2,11 @@import sysimport traceback-from PySide6.QtCore import QSharedMemory+from PySide6.QtCore import QSharedMemory, Qt, QEventfrom PySide6.QtWidgets import QApplicationfrom loguru import logger+from .methods import bringWindowToTopfrom .signal_bus import signalBus@@ -54,6 +55,9 @@ class SingletonApplication(QApplication):logger.error(f"Failed to recover from shared memory error: {e}")raise RuntimeError(self.memory.errorString())+ self._prev_app_state = Qt.ApplicationState.ApplicationInactive++if "__compiled__" in globals(): # 编译后的错误捕捉sys.excepthook = exception_hook@@ -76,6 +80,13 @@ class SingletonApplication(QApplication):logger.warning(f"Failed to cleanup shared memory on quit: {e}")super().quit()+ def event(self, e: QEvent) -> bool:+ if sys.platform == "darwin":+ if e.type() == QEvent.Type.ApplicationActivate:+ signalBus.showMainWindow.emit()++ return super().event(e)+def exception_hook(exception: BaseException, value, tb):""" exception callback function """message = '\n'.join([''.join(traceback.format_tb(tb)),diff --git a/app/common/signal_bus.py b/app/common/signal_bus.pyindex 4be53130..d201220f 100644--- a/app/common/signal_bus.py+++ b/app/common/signal_bus.py@@ -7,5 +7,6 @@ class SignalBus(QObject):addTaskSignal = Signal(str, str, str, dict, str, int, bool, str) # url, fileName, filePath, headers, status, preBlockNum, notCreateHistoryFile, fileSizeallTaskFinished = Signal()appErrorSig = Signal(str)+ showMainWindow = Signal()signalBus = SignalBus()diff --git a/app/view/main_window.py b/app/view/main_window.pyindex a91ded35..383ccb67 100644--- a/app/view/main_window.py+++ b/app/view/main_window.py@@ -84,6 +84,7 @@ class MainWindow(MSFluentWindow):self.__onCustomThemeModeChanged(cfg.customThemeMode.value)cfg.customThemeMode.valueChanged.connect(self.__onCustomThemeModeChanged)signalBus.appErrorSig.connect(self.onAppError)+ signalBus.showMainWindow.connect(lambda :bringWindowToTop(self))# 设置背景特效self.applyBackgroundEffectByCfg()