mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-12 04:24:27 +00:00
Properly shutdown the daemon if changing from classic to regular
This commit is contained in:
parent
982fd4f292
commit
e905044445
@ -132,6 +132,10 @@ class GtkUI:
|
||||
# Make sure gtkui.conf has at least the defaults set
|
||||
self.config = deluge.configmanager.ConfigManager("gtkui.conf", DEFAULT_PREFS)
|
||||
|
||||
# We need to check on exit if it was started in classic mode to ensure we
|
||||
# shutdown the daemon.
|
||||
self.started_in_classic = self.config["classic_mode"]
|
||||
|
||||
# Start the Dbus Interface before anything else.. Just in case we are
|
||||
# already running.
|
||||
self.queuedtorrents = QueuedTorrents()
|
||||
@ -184,6 +188,8 @@ class GtkUI:
|
||||
|
||||
# Shutdown all components
|
||||
component.shutdown()
|
||||
if self.started_in_classic:
|
||||
client.shutdown()
|
||||
|
||||
def _on_new_core(self, data):
|
||||
component.start()
|
||||
|
@ -36,6 +36,7 @@ pygtk.require('2.0')
|
||||
import gtk, gtk.glade
|
||||
import pkg_resources
|
||||
|
||||
import deluge.error
|
||||
import deluge.component as component
|
||||
from deluge.ui.client import aclient as client
|
||||
import deluge.common as common
|
||||
@ -222,7 +223,10 @@ class MenuBar(component.Component):
|
||||
def on_menuitem_quit_activate(self, data=None):
|
||||
log.debug("on_menuitem_quit_activate")
|
||||
if self.config["classic_mode"]:
|
||||
client.shutdown()
|
||||
try:
|
||||
client.shutdown()
|
||||
except deluge.error.NoCoreError:
|
||||
pass
|
||||
self.window.quit()
|
||||
|
||||
## Edit Menu ##
|
||||
|
Loading…
x
Reference in New Issue
Block a user