only allow 1 confirm dialog

This commit is contained in:
alfrix authored and Alfredo Monclus committed 2022-08-01 12:23:40 -03:00
1 parent d5bc271788
commit de84bd6597
1 file changed
+5 -1
+5 -1
View File
@@ -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: