MCPcopy Create free account
hub / github.com/BuddySirJava/SSH-Studio / _write_and_reload

Method _write_and_reload

src/ui/main_window.py:513–529  ·  view source on GitHub ↗

Write the config to disk and reload UI without showing validation dialogs.

(self, show_status: bool = False)

Source from the content-addressed store, hash-verified

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."""

Callers 3

_on_host_deletedMethod · 0.95
undo_deleteMethod · 0.95
_on_save_clickedMethod · 0.80

Calls 6

_update_statusMethod · 0.95
_show_errorMethod · 0.95
writeMethod · 0.80
parseMethod · 0.80
load_hostsMethod · 0.80
set_undo_enabledMethod · 0.80

Tested by

no test coverage detected