[console] Fix host deletion
The host id didn't receive correctly and the indexing was not being updated correctly. Closes: https://github.com/deluge-torrent/deluge/pull/393
This commit is contained in:
parent
543fce4f29
commit
7336877928
|
@ -197,7 +197,8 @@ class ConnectionManager(BaseMode, PopupsHandler):
|
||||||
if chr(c) == 'q':
|
if chr(c) == 'q':
|
||||||
return
|
return
|
||||||
elif chr(c) == 'D':
|
elif chr(c) == 'D':
|
||||||
host_id = self.popup.current_selection()[1]
|
host_index = self.popup.current_selection()
|
||||||
|
host_id = self.popup.inputs[host_index].name
|
||||||
self.delete_host(host_id)
|
self.delete_host(host_id)
|
||||||
return
|
return
|
||||||
elif chr(c) == 'a':
|
elif chr(c) == 'a':
|
||||||
|
|
|
@ -251,7 +251,7 @@ class SelectablePopup(BaseInputPane, Popup):
|
||||||
|
|
||||||
def set_selection(self, index):
|
def set_selection(self, index):
|
||||||
"""Set a selected index"""
|
"""Set a selected index"""
|
||||||
self.active_input = index
|
self.active_input = min(index, len(self.inputs) - 1)
|
||||||
|
|
||||||
def add_line(
|
def add_line(
|
||||||
self,
|
self,
|
||||||
|
|
Loading…
Reference in New Issue