(self)
| 224 | self.emit("show-toast", message) |
| 225 | |
| 226 | def _connect_signals(self): |
| 227 | def connect_touch(widget, signal_name: str, option_key: str): |
| 228 | if not widget: |
| 229 | return |
| 230 | |
| 231 | def handler(*args): |
| 232 | if self.is_loading: |
| 233 | return |
| 234 | self._touched_options.add(option_key) |
| 235 | self._on_field_changed(widget) |
| 236 | |
| 237 | widget.connect(signal_name, handler) |
| 238 | |
| 239 | def connect_entry_row_text(widget, option_key: str): |
| 240 | if not widget: |
| 241 | return |
| 242 | |
| 243 | def on_notify_text(*_args): |
| 244 | if self.is_loading: |
| 245 | return |
| 246 | self._touched_options.add(option_key) |
| 247 | self._on_field_changed(widget) |
| 248 | |
| 249 | widget.connect("notify::text", on_notify_text) |
| 250 | |
| 251 | connect_entry_row_text(self.patterns_entry, "__patterns__") |
| 252 | connect_entry_row_text(self.hostname_entry, "HostName") |
| 253 | connect_entry_row_text(self.user_entry, "User") |
| 254 | connect_touch(self.port_entry, "notify::value", "Port") |
| 255 | connect_entry_row_text(self.identity_entry, "IdentityFile") |
| 256 | connect_touch(self.forward_agent_switch, "state-set", "ForwardAgent") |
| 257 | |
| 258 | connect_entry_row_text(self.proxy_jump_entry, "ProxyJump") |
| 259 | connect_entry_row_text(self.proxy_cmd_entry, "ProxyCommand") |
| 260 | connect_entry_row_text(self.local_forward_entry, "LocalForward") |
| 261 | connect_entry_row_text(self.remote_forward_entry, "RemoteForward") |
| 262 | |
| 263 | connect_touch(self.compression_switch, "state-set", "Compression") |
| 264 | connect_touch(self.serveralive_interval_entry, "notify::value", "ServerAliveInterval") |
| 265 | connect_touch(self.serveralive_count_entry, "notify::value", "ServerAliveCountMax") |
| 266 | connect_touch(self.tcp_keepalive_switch, "state-set", "TCPKeepAlive") |
| 267 | if hasattr(self, "strict_host_key_row") and self.strict_host_key_row: |
| 268 | self.strict_host_key_row.connect( |
| 269 | "notify::selected", |
| 270 | lambda *args: ( |
| 271 | None |
| 272 | if self.is_loading |
| 273 | else ( |
| 274 | self._touched_options.add("StrictHostKeyChecking"), |
| 275 | self._on_field_changed(self.strict_host_key_row), |
| 276 | ) |
| 277 | ), |
| 278 | ) |
| 279 | |
| 280 | if hasattr(self, "add_keys_to_agent_row") and self.add_keys_to_agent_row: |
| 281 | self.add_keys_to_agent_row.connect( |
| 282 | "notify::selected", |
| 283 | lambda *args: ( |
no test coverage detected