mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
Fix properly shutting Deluge down when system shuts down
This commit is contained in:
parent
165b97751d
commit
67b85a9f89
3 changed files with 7 additions and 2 deletions
|
@ -11,6 +11,7 @@ Deluge 0.9.07 - "1.0.0_RC7" (In Development)
|
||||||
|
|
||||||
Windows:
|
Windows:
|
||||||
* Fix Vista slowness issue
|
* Fix Vista slowness issue
|
||||||
|
* Fix properly shutting Deluge down when system shuts down
|
||||||
|
|
||||||
Deluge 0.9.06 - "1.0.0_RC6" (13 August 2008)
|
Deluge 0.9.06 - "1.0.0_RC6" (13 August 2008)
|
||||||
Core:
|
Core:
|
||||||
|
|
|
@ -176,9 +176,11 @@ class Core(
|
||||||
else:
|
else:
|
||||||
from win32api import SetConsoleCtrlHandler
|
from win32api import SetConsoleCtrlHandler
|
||||||
from win32con import CTRL_CLOSE_EVENT
|
from win32con import CTRL_CLOSE_EVENT
|
||||||
|
from win32con import CTRL_SHUTDOWN_EVENT
|
||||||
result = 0
|
result = 0
|
||||||
def win_handler(ctrl_type):
|
def win_handler(ctrl_type):
|
||||||
if ctrl_type == CTRL_CLOSE_EVENT:
|
log.debug("ctrl_type: %s", ctrl_type)
|
||||||
|
if ctrl_type == CTRL_CLOSE_EVENT or ctrl_type == CTRL_SHUTDOWN_EVENT:
|
||||||
self._shutdown()
|
self._shutdown()
|
||||||
result = 1
|
result = 1
|
||||||
return result
|
return result
|
||||||
|
|
|
@ -140,9 +140,11 @@ class GtkUI:
|
||||||
if deluge.common.windows_check():
|
if deluge.common.windows_check():
|
||||||
from win32api import SetConsoleCtrlHandler
|
from win32api import SetConsoleCtrlHandler
|
||||||
from win32con import CTRL_CLOSE_EVENT
|
from win32con import CTRL_CLOSE_EVENT
|
||||||
|
from win32con import CTRL_SHUTDOWN_EVENT
|
||||||
result = 0
|
result = 0
|
||||||
def win_handler(ctrl_type):
|
def win_handler(ctrl_type):
|
||||||
if ctrl_type == CTRL_CLOSE_EVENT:
|
log.debug("ctrl_type: %s", ctrl_type)
|
||||||
|
if ctrl_type == CTRL_CLOSE_EVENT or ctrl_type == CTRL_SHUTDOWN_EVENT:
|
||||||
self.shutdown()
|
self.shutdown()
|
||||||
return 1
|
return 1
|
||||||
SetConsoleCtrlHandler(win_handler)
|
SetConsoleCtrlHandler(win_handler)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue