Fix up stopping classic mode

This commit is contained in:
Andrew Resch 2011-06-02 11:55:26 -07:00
commit ac5f9a2828
2 changed files with 15 additions and 8 deletions

View file

@ -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.

View file

@ -835,14 +835,9 @@ class Preferences(component.Component):
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()
dialog = dialogs.YesNoDialog(
_("Attention"),