From de84bd6597c391abfbb0c3a1dc38e8804fdec61d Mon Sep 17 00:00:00 2001 From: alfrix Date: Wed, 27 Jul 2022 22:28:35 -0300 Subject: [PATCH] only allow 1 confirm dialog --- screen.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/screen.py b/screen.py index 9d683825..29d314b9 100644 --- a/screen.py +++ b/screen.py @@ -89,6 +89,7 @@ class KlipperScreen(Gtk.Window): self.apiclient = None self.version = version self.dialogs = [] + self.confirm = None configfile = os.path.normpath(os.path.expanduser(args.configfile)) @@ -894,7 +895,10 @@ class KlipperScreen(Gtk.Window): label.set_line_wrap(True) label.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR) - self.gtk.Dialog(self, buttons, label, self._confirm_send_action_response, method, params) + if self.confirm is not None: + self.confirm.destroy() + self.confirm = self.gtk.Dialog(self, buttons, label, self._confirm_send_action_response, method, params) + def _confirm_send_action_response(self, widget, response_id, method, params): if response_id == Gtk.ResponseType.OK: