diff --git a/deluge/ui/client.py b/deluge/ui/client.py index b2de0b138..31fb305a3 100644 --- a/deluge/ui/client.py +++ b/deluge/ui/client.py @@ -613,6 +613,11 @@ class Client(object): """ Disconnects from the daemon. """ + if self.is_classicmode(): + self._daemon_proxy.disconnect() + self.stop_classic_mode() + return + if self._daemon_proxy: return self._daemon_proxy.disconnect() @@ -623,6 +628,13 @@ class Client(object): self._daemon_proxy = DaemonClassicProxy(self.__event_handlers) self.__started_in_classic = True + def stop_classic_mode(self): + """ + Stops the daemon process in the client. + """ + self._daemon_proxy = None + self.__started_in_classic = False + def start_daemon(self, port, config): """ Starts a daemon process. diff --git a/deluge/ui/gtkui/preferences.py b/deluge/ui/gtkui/preferences.py index aeadaf9cc..ee265a068 100644 --- a/deluge/ui/gtkui/preferences.py +++ b/deluge/ui/gtkui/preferences.py @@ -830,26 +830,21 @@ class Preferences(component.Component): # Re-show the dialog to make sure everything has been updated self.show() - if classic_mode_was_set==True and new_gtkui_in_classic_mode==False: + if classic_mode_was_set == True and new_gtkui_in_classic_mode == False: def on_response(response): if response == gtk.RESPONSE_NO: # Set each changed config value in the core self.gtkui_config["classic_mode"] = True - client.core.set_config({"classic_mode": True}) - client.force_call(True) - # Update the configuration - self.core_config.update({"classic_mode": True}) self.glade.get_widget("chk_classic_mode").set_active(True) else: client.disconnect() - if client.is_classicmode(): - component.stop() + component.stop() dialog = dialogs.YesNoDialog( _("Attention"), _("Your current session will be stopped. Continue?") ) dialog.run().addCallback(on_response) - elif classic_mode_was_set==False and new_gtkui_in_classic_mode==True: + elif classic_mode_was_set == False and new_gtkui_in_classic_mode == True: dialog = dialogs.InformationDialog( _("Attention"), _("You must now restart the deluge UI")