|
|
|
@ -80,8 +80,6 @@ async def apply_settings(ctx: wire.Context, msg: ApplySettings):
|
|
|
|
|
raise wire.ProcessError("Auto-lock delay too long")
|
|
|
|
|
await require_confirm_change_autolock_delay(ctx, msg.auto_lock_delay_ms)
|
|
|
|
|
storage.device.set_autolock_delay_ms(msg.auto_lock_delay_ms)
|
|
|
|
|
# use the value that was stored, not the one that was supplied by the user
|
|
|
|
|
workflow.idle_timer.set(storage.device.get_autolock_delay_ms(), lock_device)
|
|
|
|
|
|
|
|
|
|
if msg.safety_checks is not None:
|
|
|
|
|
await require_confirm_safety_checks(ctx, msg.safety_checks)
|
|
|
|
@ -90,16 +88,22 @@ async def apply_settings(ctx: wire.Context, msg: ApplySettings):
|
|
|
|
|
if msg.display_rotation is not None:
|
|
|
|
|
await require_confirm_change_display_rotation(ctx, msg.display_rotation)
|
|
|
|
|
storage.device.set_rotation(msg.display_rotation)
|
|
|
|
|
ui.display.orientation(storage.device.get_rotation())
|
|
|
|
|
|
|
|
|
|
if msg.experimental_features is not None:
|
|
|
|
|
await require_confirm_experimental_features(ctx, msg.experimental_features)
|
|
|
|
|
storage.device.set_experimental_features(msg.experimental_features)
|
|
|
|
|
wire.experimental_enabled = msg.experimental_features
|
|
|
|
|
|
|
|
|
|
reload_settings_from_storage()
|
|
|
|
|
|
|
|
|
|
return Success(message="Settings applied")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def reload_settings_from_storage() -> None:
|
|
|
|
|
workflow.idle_timer.set(storage.device.get_autolock_delay_ms(), lock_device)
|
|
|
|
|
ui.display.orientation(storage.device.get_rotation())
|
|
|
|
|
wire.experimental_enabled = storage.device.get_experimental_features()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async def require_confirm_change_homescreen(ctx):
|
|
|
|
|
text = Text("Set homescreen", ui.ICON_CONFIG)
|
|
|
|
|
text.normal("Do you really want to", "change the homescreen", "image?")
|
|
|
|
|