From fcfe3406b33e6a8304d91d22fe84ef87883d461f Mon Sep 17 00:00:00 2001 From: SomberNight Date: Tue, 1 May 2018 14:11:34 +0200 Subject: [PATCH] keepkey: fix threading issue during recovery --- plugins/keepkey/qt_generic.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/keepkey/qt_generic.py b/plugins/keepkey/qt_generic.py index 2cdfe3233..9590c216c 100644 --- a/plugins/keepkey/qt_generic.py +++ b/plugins/keepkey/qt_generic.py @@ -132,11 +132,13 @@ class QtHandler(QtHandlerBase): char_signal = pyqtSignal(object) pin_signal = pyqtSignal(object) + close_char_dialog_signal = pyqtSignal() def __init__(self, win, pin_matrix_widget_class, device): super(QtHandler, self).__init__(win, device) self.char_signal.connect(self.update_character_dialog) self.pin_signal.connect(self.pin_dialog) + self.close_char_dialog_signal.connect(self._close_char_dialog) self.pin_matrix_widget_class = pin_matrix_widget_class self.character_dialog = None @@ -146,9 +148,13 @@ class QtHandler(QtHandlerBase): self.done.wait() data = self.character_dialog.data if not data or 'done' in data: + self.close_char_dialog_signal.emit() + return data + + def _close_char_dialog(self): + if self.character_dialog: self.character_dialog.accept() self.character_dialog = None - return data def get_pin(self, msg): self.done.clear()