mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-06 16:38:43 +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()
|
model, row = self.treeview.get_selection().get_selected()
|
||||||
status = model[row][HOSTLIST_COL_STATUS]
|
status = model[row][HOSTLIST_COL_STATUS]
|
||||||
host_id = model[row][HOSTLIST_COL_ID]
|
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 = [
|
host_info = [
|
||||||
self.liststore[row][HOSTLIST_COL_HOST],
|
self.liststore[row][HOSTLIST_COL_HOST],
|
||||||
self.liststore[row][HOSTLIST_COL_PORT],
|
self.liststore[row][HOSTLIST_COL_PORT],
|
||||||
self.liststore[row][HOSTLIST_COL_USER],
|
self.liststore[row][HOSTLIST_COL_USER],
|
||||||
self.liststore[row][HOSTLIST_COL_PASS],
|
self.liststore[row][HOSTLIST_COL_PASS],
|
||||||
]
|
]
|
||||||
|
|
||||||
new_host_info = self._run_addhost_dialog(edit_host_info=host_info)
|
new_host_info = self._run_addhost_dialog(edit_host_info=host_info)
|
||||||
if new_host_info:
|
if new_host_info:
|
||||||
hostname, port, username, password = new_host_info
|
hostname, port, username, password = new_host_info
|
||||||
|
@ -483,6 +475,13 @@ class ConnectionManager(component.Component):
|
||||||
)
|
)
|
||||||
self._update_host_status()
|
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):
|
def on_button_removehost_clicked(self, widget):
|
||||||
log.debug('on_button_removehost_clicked')
|
log.debug('on_button_removehost_clicked')
|
||||||
# Get the selected rows
|
# Get the selected rows
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue