mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-06 02:29:55 +00:00
Add the keepkey cancellation feature
to the generic implementation. Not currently used by the trezor libraries.
This commit is contained in:
parent
7b5f3884fa
commit
cb4947d705
2 changed files with 11 additions and 7 deletions
|
@ -268,7 +268,8 @@ class KeepKeyGuiMixin(object):
|
||||||
message = "Confirm address on KeepKey device to continue"
|
message = "Confirm address on KeepKey device to continue"
|
||||||
else:
|
else:
|
||||||
message = "Check KeepKey device to continue"
|
message = "Check KeepKey device to continue"
|
||||||
self.handler.show_message(msg.code, message, self)
|
cancel_callback=self.cancel if msg.code in [3, 8] else None
|
||||||
|
self.handler.show_message(message, cancel_callback)
|
||||||
return proto.ButtonAck()
|
return proto.ButtonAck()
|
||||||
|
|
||||||
def callback_PinMatrixRequest(self, msg):
|
def callback_PinMatrixRequest(self, msg):
|
||||||
|
|
|
@ -31,8 +31,8 @@ class QtHandler:
|
||||||
def stop(self):
|
def stop(self):
|
||||||
self.win.emit(SIGNAL('message_done'))
|
self.win.emit(SIGNAL('message_done'))
|
||||||
|
|
||||||
def show_message(self, msg):
|
def show_message(self, msg, cancel_callback=None):
|
||||||
self.win.emit(SIGNAL('message_dialog'), msg)
|
self.win.emit(SIGNAL('message_dialog'), msg, cancel_callback)
|
||||||
|
|
||||||
def get_pin(self, msg):
|
def get_pin(self, msg):
|
||||||
self.done.clear()
|
self.done.clear()
|
||||||
|
@ -75,15 +75,18 @@ class QtHandler:
|
||||||
self.passphrase = passphrase
|
self.passphrase = passphrase
|
||||||
self.done.set()
|
self.done.set()
|
||||||
|
|
||||||
def message_dialog(self, msg):
|
def message_dialog(self, msg, cancel_callback):
|
||||||
# Called more than once during signing, to confirm output and fee
|
# Called more than once during signing, to confirm output and fee
|
||||||
self.dialog_stop()
|
self.dialog_stop()
|
||||||
msg = _('Please check your %s Device') % self.device
|
msg = _('Please check your %s Device') % self.device
|
||||||
self.dialog = WindowModalDialog(self.win, msg)
|
dialog = self.dialog = WindowModalDialog(self.win, msg)
|
||||||
l = QLabel(msg)
|
l = QLabel(msg)
|
||||||
vbox = QVBoxLayout(self.dialog)
|
vbox = QVBoxLayout(dialog)
|
||||||
|
if cancel_callback:
|
||||||
|
vbox.addLayout(Buttons(CancelButton(dialog)))
|
||||||
|
dialog.connect(dialog, SIGNAL('rejected()'), cancel_callback)
|
||||||
vbox.addWidget(l)
|
vbox.addWidget(l)
|
||||||
self.dialog.show()
|
dialog.show()
|
||||||
|
|
||||||
def dialog_stop(self):
|
def dialog_stop(self):
|
||||||
if self.dialog:
|
if self.dialog:
|
||||||
|
|
Loading…
Add table
Reference in a new issue