(self, host: SSHHost)
| 284 | return duplicated_host |
| 285 | |
| 286 | def select_host(self, host: SSHHost): |
| 287 | for index, row in enumerate(self.list_store): |
| 288 | if row[5] == host: |
| 289 | if hasattr(self, "tree_view") and self.tree_view is not None: |
| 290 | tree_iter = self.list_store.iter_nth_child(None, index) |
| 291 | if tree_iter is None: |
| 292 | return |
| 293 | selection = self.tree_view.get_selection() |
| 294 | selection.select_iter(tree_iter) |
| 295 | path = self.list_store.get_path(tree_iter) |
| 296 | if path is not None: |
| 297 | self.tree_view.scroll_to_cell(path, None, False, 0, 0) |
| 298 | elif hasattr(self, "list_box") and self.list_box is not None: |
| 299 | row_widget = self.list_box.get_row_at_index(index) |
| 300 | if row_widget is not None: |
| 301 | self.list_box.select_row(row_widget) |
| 302 | try: |
| 303 | row_widget.grab_focus() |
| 304 | except Exception: |
| 305 | pass |
| 306 | break |
| 307 | |
| 308 | def get_selected_host(self) -> SSHHost | None: |
| 309 | """Get the currently selected host.""" |
no outgoing calls
no test coverage detected