fix: signal emission

This commit is contained in:
aclist committed 2026-02-07 18:49:06 +09:00
1 parent 045f242e09
commit 6fc348ea34
8 files changed
+89 -56

No files matched your search

+16 -2
View File
@@ -27,10 +27,24 @@ class EarlyAlertDialog(Gtk.MessageDialog):
self.set_default_size(250, 100)
self.connect("response", self._on_response)
abort = self.get_widget_for_response(Gtk.ResponseType.OK)
abort.set_label("Exit")
self.connect("response", self._on_response)
self.run()
self.destroy()
def _on_response(self, dialog: Self, response: Gtk.ResponseType) -> None:
sys.exit(1)
match response:
case Gtk.ResponseType.OK:
sys.exit(1)
case Gtk.ResponseType.CANCEL:
return
class EarlyIgnoreDialog(EarlyAlertDialog):
def __init__(self, string: str) -> None:
super().__init__(string=string)
# TODO: reverse order
self.add_button("Ignore", Gtk.ResponseType.CANCEL)