File tree Expand file tree Collapse file tree 1 file changed +5
-21
lines changed Expand file tree Collapse file tree 1 file changed +5
-21
lines changed Original file line number Diff line number Diff line change 22import getpass
33import os
44import sys
5- import signal
65
76from qfluentwidgets import qconfig
87
2625
2726app = SingletonApplication (sys .argv , "Ghost Downloader" )
2827
29- # 添加信号处理器
30- def signal_handler (signum , frame ):
31- """处理 SIGINT 信号(Ctrl+C)"""
32- print ("\n 接收到退出信号,正在关闭应用..." )
33- app .quit ()
34-
35- signal .signal (signal .SIGINT , signal_handler )
36-
3728# Starting Program
3829import time
3930import warnings
@@ -100,17 +91,10 @@ def signal_handler(signum, frame):
10091speedLimiter .timeout .connect (cfg .resetGlobalSpeed ) # 刷新 globalSpeed为 0
10192speedLimiter .start ()
10293
103- try :
104- w = MainWindow (silence = True if "--silence" in sys .argv else False )
105-
106- # loading plugins
107- pluginsPath = os .path .join (cfg .appPath , "plugins" )
108- loadPlugins (w , pluginsPath )
94+ w = MainWindow (silence = True if "--silence" in sys .argv else False )
10995
110- sys .exit (app .exec ())
96+ # loading plugins
97+ pluginsPath = os .path .join (cfg .appPath , "plugins" )
98+ loadPlugins (w , pluginsPath )
11199
112- except KeyboardInterrupt :
113- print ("\n 用户中断,正在退出..." )
114- speedLimiter .stop ()
115- app .quit ()
116- sys .exit (0 )
100+ sys .exit (app .exec ())
You can’t perform that action at this time.
0 commit comments