* Instead of having button enabling and so on logic in both on_hostname_textEdited and on_hosts_itemClicked, just handle the hostname edit as selection or unselecting any matching item, and then process all the logic whenever the selection changes.