|
|
|
@ -10,18 +10,20 @@ async def layout_apply_settings(ctx, msg):
|
|
|
|
|
from ..common.confirm import require_confirm
|
|
|
|
|
from ..common import storage
|
|
|
|
|
|
|
|
|
|
if msg.homescreen is not None:
|
|
|
|
|
raise wire.FailureError(
|
|
|
|
|
ProcessError, 'ApplySettings.homescreen is not supported')
|
|
|
|
|
|
|
|
|
|
if msg.label is None and msg.language is None and msg.use_passphrase is None:
|
|
|
|
|
if msg.homescreen is None and msg.label is None and msg.language is None and msg.use_passphrase is None:
|
|
|
|
|
raise wire.FailureError(ProcessError, 'No setting provided')
|
|
|
|
|
|
|
|
|
|
if msg.homescreen is not None:
|
|
|
|
|
await require_confirm(ctx, Text(
|
|
|
|
|
'Change homescreen', ui.ICON_RESET,
|
|
|
|
|
'Do you really want to', 'change homescreen?'))
|
|
|
|
|
|
|
|
|
|
if msg.label is not None:
|
|
|
|
|
await require_confirm(ctx, Text(
|
|
|
|
|
'Change label', ui.ICON_RESET,
|
|
|
|
|
'Do you really want to', 'change label to',
|
|
|
|
|
ui.BOLD, '%s' % msg.label))
|
|
|
|
|
ui.BOLD, '%s' % msg.label,
|
|
|
|
|
ui.NORMAL, '?'))
|
|
|
|
|
|
|
|
|
|
if msg.language is not None:
|
|
|
|
|
await require_confirm(ctx, Text(
|
|
|
|
@ -39,6 +41,7 @@ async def layout_apply_settings(ctx, msg):
|
|
|
|
|
'encryption?'))
|
|
|
|
|
|
|
|
|
|
storage.load_settings(label=msg.label,
|
|
|
|
|
use_passphrase=msg.use_passphrase)
|
|
|
|
|
use_passphrase=msg.use_passphrase,
|
|
|
|
|
homescreen=msg.homescreen)
|
|
|
|
|
|
|
|
|
|
return Success(message='Settings applied')
|
|
|
|
|