Get the currently selected host.
(self)
| 306 | break |
| 307 | |
| 308 | def get_selected_host(self) -> SSHHost | None: |
| 309 | """Get the currently selected host.""" |
| 310 | if hasattr(self, "tree_view") and self.tree_view is not None: |
| 311 | selection = self.tree_view.get_selection() |
| 312 | model, tree_iter = selection.get_selected() |
| 313 | if tree_iter is not None: |
| 314 | return model[tree_iter][5] |
| 315 | elif hasattr(self, "list_box") and self.list_box is not None: |
| 316 | selected_row = self.list_box.get_selected_row() |
| 317 | if selected_row is not None and hasattr(selected_row, "_host_ref"): |
| 318 | return selected_row._host_ref |
| 319 | return None |
| 320 | |
| 321 | def navigate_with_key(self, keyval, state): |
| 322 | """Handle keyboard navigation in the host list.""" |
no outgoing calls
no test coverage detected