mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-20 03:24:54 +00:00
[GTK3] Disconnect after editing host in connection manager
This commit is contained in:
parent
cd6bad0e35
commit
64710ad226
1 changed files with 8 additions and 9 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue