|
|
|
@ -29,28 +29,16 @@ def display_homescreen() -> None:
|
|
|
|
|
image = res.load("apps/homescreen/res/bg.toif")
|
|
|
|
|
|
|
|
|
|
if storage.is_initialized() and storage.device.no_backup():
|
|
|
|
|
_err("SEEDLESS")
|
|
|
|
|
ui.header_error("SEEDLESS")
|
|
|
|
|
elif storage.is_initialized() and storage.device.unfinished_backup():
|
|
|
|
|
_err("BACKUP FAILED!")
|
|
|
|
|
ui.header_error("BACKUP FAILED!")
|
|
|
|
|
elif storage.is_initialized() and storage.device.needs_backup():
|
|
|
|
|
_warn("NEEDS BACKUP!")
|
|
|
|
|
ui.header_warning("NEEDS BACKUP!")
|
|
|
|
|
elif storage.is_initialized() and not config.has_pin():
|
|
|
|
|
_warn("PIN NOT SET!")
|
|
|
|
|
ui.header_warning("PIN NOT SET!")
|
|
|
|
|
elif storage.slip39.is_in_progress():
|
|
|
|
|
_warn("SHAMIR IN PROGRESS!")
|
|
|
|
|
ui.header_warning("SHAMIR IN PROGRESS!")
|
|
|
|
|
else:
|
|
|
|
|
ui.display.bar(0, 0, ui.WIDTH, ui.HEIGHT, ui.BG)
|
|
|
|
|
ui.display.avatar(48, 48 - 10, image, ui.WHITE, ui.BLACK)
|
|
|
|
|
ui.display.text_center(ui.WIDTH // 2, 220, label, ui.BOLD, ui.FG, ui.BG)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _warn(message: str) -> None:
|
|
|
|
|
ui.display.bar(0, 0, ui.WIDTH, 30, ui.YELLOW)
|
|
|
|
|
ui.display.text_center(ui.WIDTH // 2, 22, message, ui.BOLD, ui.BLACK, ui.YELLOW)
|
|
|
|
|
ui.display.bar(0, 30, ui.WIDTH, ui.HEIGHT - 30, ui.BG)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _err(message: str) -> None:
|
|
|
|
|
ui.display.bar(0, 0, ui.WIDTH, 30, ui.RED)
|
|
|
|
|
ui.display.text_center(ui.WIDTH // 2, 22, message, ui.BOLD, ui.WHITE, ui.RED)
|
|
|
|
|
ui.display.bar(0, 30, ui.WIDTH, ui.HEIGHT - 30, ui.BG)
|
|
|
|
|