mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-08 01:18:39 +00:00
catch and exit cleanly on SIGTERM and SIGHUP
This commit is contained in:
parent
e33f9dc844
commit
b8a8beaedc
1 changed files with 6 additions and 5 deletions
|
@ -31,8 +31,8 @@
|
||||||
# this exception statement from your version. If you delete this exception
|
# this exception statement from your version. If you delete this exception
|
||||||
# statement from all source files in the program, then also delete it here.
|
# statement from all source files in the program, then also delete it here.
|
||||||
|
|
||||||
import os.path
|
import os
|
||||||
|
import signal
|
||||||
import gobject
|
import gobject
|
||||||
import pygtk
|
import pygtk
|
||||||
pygtk.require('2.0')
|
pygtk.require('2.0')
|
||||||
|
@ -123,7 +123,9 @@ class DelugeGTK:
|
||||||
if self.config.get("new_releases"):
|
if self.config.get("new_releases"):
|
||||||
new_release_check()
|
new_release_check()
|
||||||
|
|
||||||
|
signal.signal(signal.SIGTERM, self.manager.quit)
|
||||||
|
signal.signal(signal.SIGHUP, self.manager.quit)
|
||||||
|
|
||||||
def connect_signals(self):
|
def connect_signals(self):
|
||||||
self.wtree.signal_autoconnect({
|
self.wtree.signal_autoconnect({
|
||||||
## File Menu
|
## File Menu
|
||||||
|
@ -794,7 +796,6 @@ class DelugeGTK:
|
||||||
# Call update now so everything is up-to-date when the window gains
|
# Call update now so everything is up-to-date when the window gains
|
||||||
# focus on startup
|
# focus on startup
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
gobject.timeout_add(1000, self.update)
|
gobject.timeout_add(1000, self.update)
|
||||||
try:
|
try:
|
||||||
gtk.main()
|
gtk.main()
|
||||||
|
@ -1297,7 +1298,7 @@ class DelugeGTK:
|
||||||
else:
|
else:
|
||||||
self.window.hide()
|
self.window.hide()
|
||||||
self.shutdown()
|
self.shutdown()
|
||||||
|
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
enabled_plugins = ':'.join(self.plugins.get_enabled_plugins())
|
enabled_plugins = ':'.join(self.plugins.get_enabled_plugins())
|
||||||
self.config.set('enabled_plugins', enabled_plugins)
|
self.config.set('enabled_plugins', enabled_plugins)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue