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

Method __init__

src/ui/host_editor.py:75–122  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

73 }
74
75 def __init__(self):
76 super().__init__()
77 self.set_visible(False)
78 self.app = None
79 self.current_host = None
80 self.is_loading = False
81 self._programmatic_raw_update = False
82 self._editor_valid = True
83 self._touched_options: set[str] = set()
84 self._wired_global_buttons = False
85 try:
86 css = Gtk.CssProvider()
87 css.load_from_data(
88 b"""
89 .error-label { color: #e01b24; }
90 .entry-error { border-color: #e01b24; }
91 """
92 )
93 Gtk.StyleContext.add_provider_for_display(
94 Gtk.Display.get_default(), css, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
95 )
96 except Exception:
97 pass
98
99 self.buffer = None
100 self._replace_textview_with_sourceview()
101 self._setup_syntax_highlighting()
102
103 self._connect_signals()
104
105 self._ensure_buffer_initialized()
106 if self.buffer is not None:
107 self._create_diff_tags()
108 self._show_helpful_placeholder()
109
110 try:
111 if getattr(self, "unsaved_banner", None):
112 self.unsaved_banner.set_revealed(False)
113 self.unsaved_banner.set_sensitive(False)
114 except Exception:
115 pass
116
117 try:
118 key_ctrl = Gtk.EventControllerKey.new()
119 key_ctrl.connect("key-pressed", self._on_key_pressed)
120 self.add_controller(key_ctrl)
121 except Exception:
122 pass
123
124 def set_app(self, app):
125 self.app = app

Callers

nothing calls this directly

Tested by

no test coverage detected