hw_wallet: show_error can now block optionally. trezor: use prev during recovery.
This commit is contained in:
@@ -32,7 +32,7 @@ class CmdLineHandler:
|
|||||||
def show_message(self, msg, on_cancel=None):
|
def show_message(self, msg, on_cancel=None):
|
||||||
print_msg(msg)
|
print_msg(msg)
|
||||||
|
|
||||||
def show_error(self, msg):
|
def show_error(self, msg, blocking=False):
|
||||||
print_msg(msg)
|
print_msg(msg)
|
||||||
|
|
||||||
def update_status(self, b):
|
def update_status(self, b):
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ class QtHandlerBase(QObject, PrintError):
|
|||||||
|
|
||||||
passphrase_signal = pyqtSignal(object, object)
|
passphrase_signal = pyqtSignal(object, object)
|
||||||
message_signal = pyqtSignal(object, object)
|
message_signal = pyqtSignal(object, object)
|
||||||
error_signal = pyqtSignal(object)
|
error_signal = pyqtSignal(object, object)
|
||||||
word_signal = pyqtSignal(object)
|
word_signal = pyqtSignal(object)
|
||||||
clear_signal = pyqtSignal()
|
clear_signal = pyqtSignal()
|
||||||
query_signal = pyqtSignal(object, object)
|
query_signal = pyqtSignal(object, object)
|
||||||
@@ -90,8 +90,10 @@ class QtHandlerBase(QObject, PrintError):
|
|||||||
def show_message(self, msg, on_cancel=None):
|
def show_message(self, msg, on_cancel=None):
|
||||||
self.message_signal.emit(msg, on_cancel)
|
self.message_signal.emit(msg, on_cancel)
|
||||||
|
|
||||||
def show_error(self, msg):
|
def show_error(self, msg, blocking=False):
|
||||||
self.error_signal.emit(msg)
|
self.done.clear()
|
||||||
|
self.error_signal.emit(msg, blocking)
|
||||||
|
self.done.wait()
|
||||||
|
|
||||||
def finished(self):
|
def finished(self):
|
||||||
self.clear_signal.emit()
|
self.clear_signal.emit()
|
||||||
@@ -154,8 +156,10 @@ class QtHandlerBase(QObject, PrintError):
|
|||||||
vbox.addLayout(Buttons(CancelButton(dialog)))
|
vbox.addLayout(Buttons(CancelButton(dialog)))
|
||||||
dialog.show()
|
dialog.show()
|
||||||
|
|
||||||
def error_dialog(self, msg):
|
def error_dialog(self, msg, blocking):
|
||||||
self.win.show_error(msg, parent=self.top_level_window())
|
self.win.show_error(msg, parent=self.top_level_window())
|
||||||
|
if blocking:
|
||||||
|
self.done.set()
|
||||||
|
|
||||||
def clear_dialog(self):
|
def clear_dialog(self):
|
||||||
if self.dialog:
|
if self.dialog:
|
||||||
|
|||||||
@@ -217,14 +217,13 @@ class TrezorPlugin(HW_PluginBase):
|
|||||||
item, label, pin_protection, passphrase_protection = settings
|
item, label, pin_protection, passphrase_protection = settings
|
||||||
|
|
||||||
if method == TIM_RECOVER:
|
if method == TIM_RECOVER:
|
||||||
# FIXME the PIN prompt will appear over this message
|
|
||||||
# which makes this unreadable
|
|
||||||
handler.show_error(_(
|
handler.show_error(_(
|
||||||
"You will be asked to enter 24 words regardless of your "
|
"You will be asked to enter 24 words regardless of your "
|
||||||
"seed's actual length. If you enter a word incorrectly or "
|
"seed's actual length. If you enter a word incorrectly or "
|
||||||
"misspell it, you cannot change it or go back - you will need "
|
"misspell it, you cannot change it or go back - you will need "
|
||||||
"to start again from the beginning.\n\nSo please enter "
|
"to start again from the beginning.\n\nSo please enter "
|
||||||
"the words carefully!"))
|
"the words carefully!"),
|
||||||
|
blocking=True)
|
||||||
|
|
||||||
language = 'english'
|
language = 'english'
|
||||||
devmgr = self.device_manager()
|
devmgr = self.device_manager()
|
||||||
|
|||||||
Reference in New Issue
Block a user