Browse Source

fix trezor PIN signal

283
ThomasV 8 years ago
parent
commit
9f7ca3dcb7
  1. 12
      plugins/trezor/qt_generic.py

12
plugins/trezor/qt_generic.py

@ -4,7 +4,6 @@ import threading
from PyQt4.Qt import Qt from PyQt4.Qt import Qt
from PyQt4.Qt import QGridLayout, QInputDialog, QPushButton from PyQt4.Qt import QGridLayout, QInputDialog, QPushButton
from PyQt4.Qt import QVBoxLayout, QLabel, SIGNAL from PyQt4.Qt import QVBoxLayout, QLabel, SIGNAL
from electrum_gui.qt.main_window import StatusBarButton
from electrum_gui.qt.util import * from electrum_gui.qt.util import *
from .plugin import TIM_NEW, TIM_RECOVER, TIM_MNEMONIC from .plugin import TIM_NEW, TIM_RECOVER, TIM_MNEMONIC
from ..hw_wallet.qt import QtHandlerBase, QtPluginBase from ..hw_wallet.qt import QtHandlerBase, QtPluginBase
@ -131,18 +130,19 @@ class CharacterDialog(WindowModalDialog):
class QtHandler(QtHandlerBase): class QtHandler(QtHandlerBase):
charSig = pyqtSignal(object) char_signal = pyqtSignal(object)
pin_signal = pyqtSignal(object)
def __init__(self, win, pin_matrix_widget_class, device): def __init__(self, win, pin_matrix_widget_class, device):
super(QtHandler, self).__init__(win, device) super(QtHandler, self).__init__(win, device)
win.connect(win, SIGNAL('pin_dialog'), self.pin_dialog) self.char_signal.connect(self.update_character_dialog)
self.charSig.connect(self.update_character_dialog) self.pin_signal.connect(self.pin_dialog)
self.pin_matrix_widget_class = pin_matrix_widget_class self.pin_matrix_widget_class = pin_matrix_widget_class
self.character_dialog = None self.character_dialog = None
def get_char(self, msg): def get_char(self, msg):
self.done.clear() self.done.clear()
self.charSig.emit(msg) self.char_signal.emit(msg)
self.done.wait() self.done.wait()
data = self.character_dialog.data data = self.character_dialog.data
if not data or 'done' in data: if not data or 'done' in data:
@ -152,7 +152,7 @@ class QtHandler(QtHandlerBase):
def get_pin(self, msg): def get_pin(self, msg):
self.done.clear() self.done.clear()
self.win.emit(SIGNAL('pin_dialog'), msg) self.pin_signal.emit(msg)
self.done.wait() self.done.wait()
return self.response return self.response

Loading…
Cancel
Save