1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-24 07:18:09 +00:00

apps/management/reset_device: improve visuals

This commit is contained in:
Peter Jensen 2018-01-19 14:54:39 +01:00 committed by Jan Pochyla
parent acf9d789c7
commit 5701e57b48

View File

@ -69,17 +69,17 @@ async def layout_reset_device(ctx, msg):
# ask for random number to check correctness
words = list(enumerate(mnemonic.split()))
index = random.uniform(len(words))
word = words[index]
word = words[index][1]
board = MnemonicKeyboard()
board.prompt = ('Type %s. word' % (index + 1))
res = await board
# TBD
if res is not word:
fail_content = Text('Failed!', ui.ICON_NOCOPY, ui.NORMAL,
if res != word:
fail_content = Text('Wrong entry!', ui.ICON_CLEAR, ui.NORMAL,
'You have entered',
'wrong seed word.',
'Please, reconnect',
'device and try again.')
'device and try again.', icon_color=ui.RED)
# todo redesign dialog to single cancel button with text 'Reconnect' or something else (no icon)
await require_confirm(ctx, fail_content, ButtonRequestType.ResetDevice)
if curpin != newpin:
@ -88,6 +88,14 @@ async def layout_reset_device(ctx, msg):
use_passphrase=msg.passphrase_protection)
storage.load_mnemonic(mnemonic)
fail_content = Text('Backup is done!', ui.ICON_CONFIRM, ui.NORMAL,
'Never make a digital',
'copy of your recovery',
'seed and never upload',
'it online!', icon_color=ui.GREEN)
# todo redesign dialog to single cancel button with text 'Finish?' or something else (no icon)
await require_confirm(ctx, fail_content, ButtonRequestType.ResetDevice)
return Success(message='Initialized')
@ -148,5 +156,6 @@ async def show_mnemonic_page(page, page_count, mnemonic):
'Finalize',
normal_style=ui.BTN_CONFIRM,
active_style=ui.BTN_CONFIRM_ACTIVE)
ui.display.clear()
else:
await animate_swipe()