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

Method on_response

src/ui/main_window.py:454–471  ·  view source on GitHub ↗
(dialog, response)

Source from the content-addressed store, hash-verified

452 dialog.set_default_response("save")
453
454 def on_response(dialog, response):
455 if response == "save":
456 try:
457 if (
458 hasattr(self.host_editor, "unsaved_banner")
459 and self.host_editor.unsaved_banner
460 ):
461 self.host_editor._on_save_clicked(None)
462 dialog.close()
463 GLib.timeout_add(200, self._delayed_close)
464 except Exception as e:
465 self.show_toast(_(f"Failed to save: {e}"))
466 elif response == "discard":
467 dialog.close()
468 self.destroy()
469 else:
470 dialog.close()
471 return True
472
473 dialog.connect("response", on_response)
474 dialog.present(self)

Callers

nothing calls this directly

Calls 2

show_toastMethod · 0.95
_on_save_clickedMethod · 0.45

Tested by

no test coverage detected