Example #1
0
    async def confirm_layout(self) -> None:
        from trezor.ui.confirm import HoldToConfirmDialog, CONFIRMED

        content = ConfirmContent(self.action, self.app_id)
        dialog = HoldToConfirmDialog(content)

        return await dialog == CONFIRMED
Example #2
0
async def hold_to_confirm(ctx, content, code=None, *args, **kwargs):
    if code is None:
        code = ButtonRequestType.Other
    await ctx.call(ButtonRequest(code=code), wire_types.ButtonAck)

    dialog = HoldToConfirmDialog(content, 'Hold to confirm', *args, **kwargs)

    return await ctx.wait(dialog) == CONFIRMED
Example #3
0
async def hold_to_confirm(ctx, content, code=None, *args, **kwargs):
    if code is None:
        code = ButtonRequestType.Other
    await ctx.call(ButtonRequest(code=code), wire_types.ButtonAck)

    dialog = HoldToConfirmDialog(content, 'Hold to confirm', *args, **kwargs)

    if __debug__:
        waiter = loop.wait(signal, dialog)
    else:
        waiter = dialog
    return await waiter == CONFIRMED
Example #4
0
async def hold_to_confirm(session_id, content, code=None, *args, **kwargs):
    from trezor.ui.confirm import HoldToConfirmDialog, CONFIRMED
    from trezor.messages.ButtonRequest import ButtonRequest
    from trezor.messages.ButtonRequestType import Other
    from trezor.messages.wire_types import ButtonAck

    ui.display.clear()

    dialog = HoldToConfirmDialog(content, 'Hold to confirm', *args, **kwargs)

    if code is None:
        code = Other
    await wire.call(session_id, ButtonRequest(code=code), ButtonAck)
    return await loop.Wait((signal, dialog)) == CONFIRMED
Example #5
0
async def hold_to_confirm(session_id, content=None, code=None, *args, **kwargs):
    from trezor.ui.button import Button, CONFIRM_BUTTON, CONFIRM_BUTTON_ACTIVE
    from trezor.ui.confirm import HoldToConfirmDialog, CONFIRMED
    from trezor.messages.ButtonRequest import ButtonRequest
    from trezor.messages.ButtonRequestType import Other
    from trezor.messages.wire_types import ButtonAck

    ui.display.clear()
    button = Button((0, 240 - 48, 240, 48), 'Hold to confirm',
                    normal_style=CONFIRM_BUTTON,
                    active_style=CONFIRM_BUTTON_ACTIVE)
    dialog = HoldToConfirmDialog(button, content, *args, **kwargs)

    if code is None:
        code = Other
    await wire.call(session_id, ButtonRequest(code=code), ButtonAck)
    return await loop.Wait((signal, dialog)) == CONFIRMED
Example #6
0
async def hold_to_confirm(ctx, content, code=None, *args, **kwargs):
    from trezor.ui.confirm import HoldToConfirmDialog, CONFIRMED
    from trezor.messages.ButtonRequest import ButtonRequest
    from trezor.messages.ButtonRequestType import Other
    from trezor.messages.wire_types import ButtonAck

    ui.display.clear()

    dialog = HoldToConfirmDialog(content, 'Hold to confirm', *args, **kwargs)

    if code is None:
        code = Other
    await ctx.call(ButtonRequest(code=code), ButtonAck)

    if __debug__:
        waiter = loop.wait(signal, dialog)
    else:
        waiter = dialog
    return await waiter == CONFIRMED
Example #7
0
 async def confirm(self) -> None:
     from trezor.ui.confirm import HoldToConfirmDialog
     content = ConfirmContent(self.action, self.app_id)
     dialog = HoldToConfirmDialog(content)
     ui.display.clear()
     self.confirmed = await dialog