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

Method _update_button_sensitivity

src/ui/host_editor.py:1678–1697  ·  view source on GitHub ↗

Updates the sensitivity of banner based on global dirty state and validity.

(self)

Source from the content-addressed store, hash-verified

1676 pass
1677
1678 def _update_button_sensitivity(self):
1679 """Updates the sensitivity of banner based on global dirty state and validity."""
1680 is_dirty = False
1681 try:
1682 main = self.app or self.get_root()
1683 parser = getattr(main, "parser", None)
1684 if parser is not None and getattr(parser, "config", None) is not None:
1685 is_dirty = bool(parser.config.is_dirty())
1686 else:
1687 is_dirty = self.is_host_dirty()
1688 except Exception:
1689 is_dirty = self.is_host_dirty()
1690 field_errors = self._collect_field_errors()
1691 is_valid = not bool(field_errors)
1692 try:
1693 if getattr(self, "unsaved_banner", None):
1694 self.unsaved_banner.set_revealed(is_dirty)
1695 self.unsaved_banner.set_sensitive(is_dirty and is_valid)
1696 except Exception:
1697 pass
1698
1699 def _on_test_connection(self, button):
1700 if not self.current_host:

Callers 11

load_hostMethod · 0.95
_on_field_changedMethod · 0.95
_on_raw_text_changedMethod · 0.95
_on_save_clickedMethod · 0.95
_on_host_selectedMethod · 0.80
_on_host_addedMethod · 0.80
_on_host_deletedMethod · 0.80
_on_host_changedMethod · 0.80

Calls 3

is_host_dirtyMethod · 0.95
_collect_field_errorsMethod · 0.95
is_dirtyMethod · 0.80

Tested by

no test coverage detected