mirror of
https://github.com/aclist/dztui.git
synced 2026-11-06 10:00:54 +01:00
fix: signal emission
This commit is contained in:
1 parent
045f242e09
commit
6fc348ea34
8 files changed
+89
-56
No files matched your search
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user