From 64710ad226cae7a2d6830bcd89fdbb87565f841d Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Thu, 18 Oct 2018 20:43:31 +0100 Subject: [PATCH] [GTK3] Disconnect after editing host in connection manager --- deluge/ui/gtk3/connectionmanager.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/deluge/ui/gtk3/connectionmanager.py b/deluge/ui/gtk3/connectionmanager.py index e8bf7fc73..d5883c4b3 100644 --- a/deluge/ui/gtk3/connectionmanager.py +++ b/deluge/ui/gtk3/connectionmanager.py @@ -448,21 +448,13 @@ class ConnectionManager(component.Component): model, row = self.treeview.get_selection().get_selected() status = model[row][HOSTLIST_COL_STATUS] host_id = model[row][HOSTLIST_COL_ID] - - if status == 'connected': - - def on_disconnect(reason): - self._update_host_status() - - client.disconnect().addCallback(on_disconnect) - return - host_info = [ self.liststore[row][HOSTLIST_COL_HOST], self.liststore[row][HOSTLIST_COL_PORT], self.liststore[row][HOSTLIST_COL_USER], self.liststore[row][HOSTLIST_COL_PASS], ] + new_host_info = self._run_addhost_dialog(edit_host_info=host_info) if new_host_info: hostname, port, username, password = new_host_info @@ -483,6 +475,13 @@ class ConnectionManager(component.Component): ) self._update_host_status() + if status == 'connected': + + def on_disconnect(reason): + self._update_host_status() + + client.disconnect().addCallback(on_disconnect) + def on_button_removehost_clicked(self, widget): log.debug('on_button_removehost_clicked') # Get the selected rows