1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 15:38:11 +00:00

src/apps/homescreen: show warning if PIN is not set

This commit is contained in:
Pavol Rusnak 2018-06-20 17:44:29 +02:00
parent e7b761e66f
commit ab98322d4d
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -1,4 +1,4 @@
from trezor import ui, res
from trezor import ui, res, config
from trezor.ui.swipe import Swipe, degrees
from apps.common import storage
@ -30,6 +30,10 @@ def display_homescreen():
ui.display.bar(0, 0, ui.WIDTH, 30, ui.YELLOW)
ui.display.text_center(ui.WIDTH // 2, 22, 'NEEDS BACKUP!', ui.BOLD, ui.BLACK, ui.YELLOW)
ui.display.bar(0, 30, ui.WIDTH, ui.HEIGHT - 30, ui.BG)
elif not config.has_pin():
ui.display.bar(0, 0, ui.WIDTH, 30, ui.YELLOW)
ui.display.text_center(ui.WIDTH // 2, 22, 'PIN NOT SET!', ui.BOLD, ui.BLACK, ui.YELLOW)
ui.display.bar(0, 30, ui.WIDTH, ui.HEIGHT - 30, ui.BG)
else:
ui.display.bar(0, 0, ui.WIDTH, ui.HEIGHT, ui.BG)
ui.display.avatar(48, 48 - 10, image, ui.WHITE, ui.BLACK)