Write the config to disk and reload UI without showing validation dialogs.
(self, show_status: bool = False)
| 511 | self._show_error(f"Failed to save configuration: {e}") |
| 512 | |
| 513 | def _write_and_reload(self, show_status: bool = False): |
| 514 | """Write the config to disk and reload UI without showing validation dialogs.""" |
| 515 | if not self.parser: |
| 516 | return |
| 517 | try: |
| 518 | self.parser.write(backup=True) |
| 519 | self.parser.parse() |
| 520 | self.host_list.load_hosts(self.parser.config.hosts) |
| 521 | self.is_dirty = False |
| 522 | try: |
| 523 | self.host_list.set_undo_enabled(False) |
| 524 | except Exception: |
| 525 | pass |
| 526 | if show_status: |
| 527 | self._update_status(_("Configuration saved")) |
| 528 | except Exception as e: |
| 529 | self._show_error(f"Failed to save configuration: {e}") |
| 530 | |
| 531 | def _on_host_selected(self, host_list, host): |
| 532 | """Handle host selection from the list.""" |
no test coverage detected