mirror of
https://github.com/aclist/dztui.git
synced 2026-10-30 22:52:42 +01:00
feat: update dialog on cancel action
This commit is contained in:
1 parent
cf70182733
commit
f2501871ee
1 file changed
+6
-1
@@ -107,7 +107,7 @@ class WaitDialog(GenericDialog):
|
|||||||
self.cur_job = 1
|
self.cur_job = 1
|
||||||
|
|
||||||
self.cancel = Gtk.Button(label="Cancel", halign=Gtk.Align.CENTER)
|
self.cancel = Gtk.Button(label="Cancel", halign=Gtk.Align.CENTER)
|
||||||
self.cancel.connect("clicked", lambda _: self.controller.set_cancel_event())
|
self.cancel.connect("clicked", self._on_cancel_clicked)
|
||||||
|
|
||||||
self.connect("delete-event", lambda widget, event: True)
|
self.connect("delete-event", lambda widget, event: True)
|
||||||
content = self.get_content_area()
|
content = self.get_content_area()
|
||||||
@@ -138,6 +138,11 @@ class WaitDialog(GenericDialog):
|
|||||||
self.prog.set_fraction(fraction)
|
self.prog.set_fraction(fraction)
|
||||||
self.cur_job += 1
|
self.cur_job += 1
|
||||||
|
|
||||||
|
def _on_cancel_clicked(self, button: Gtk.Button) -> None:
|
||||||
|
# TODO: strings
|
||||||
|
GLib.idle_add(self.update_text, "Caught cancel signal, cleaning up")
|
||||||
|
self.controller.set_cancel_event()
|
||||||
|
|
||||||
def show_cancel(self, state: bool) -> None:
|
def show_cancel(self, state: bool) -> None:
|
||||||
self.cancel.set_visible(state)
|
self.cancel.set_visible(state)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user