mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-02-08 21:52:42 +00:00
chore(core): drop unused progress impl
This commit is contained in:
parent
9bed793f68
commit
7e2f985037
2
core/src/all_modules.py
generated
2
core/src/all_modules.py
generated
@ -163,8 +163,6 @@ trezor.ui.layouts.mercury.fido
|
||||
import trezor.ui.layouts.mercury.fido
|
||||
trezor.ui.layouts.mercury.homescreen
|
||||
import trezor.ui.layouts.mercury.homescreen
|
||||
trezor.ui.layouts.mercury.progress
|
||||
import trezor.ui.layouts.mercury.progress
|
||||
trezor.ui.layouts.mercury.recovery
|
||||
import trezor.ui.layouts.mercury.recovery
|
||||
trezor.ui.layouts.mercury.reset
|
||||
|
@ -1,72 +0,0 @@
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import trezorui2
|
||||
from trezor import TR, ui, utils
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from typing import Any
|
||||
|
||||
from ..common import ProgressLayout
|
||||
|
||||
|
||||
class RustProgress:
|
||||
def __init__(
|
||||
self,
|
||||
layout: Any,
|
||||
):
|
||||
self.layout = layout
|
||||
ui.backlight_fade(ui.style.get_backlight_dim())
|
||||
self.layout.attach_timer_fn(self.set_timer)
|
||||
self.layout.paint()
|
||||
ui.refresh()
|
||||
ui.backlight_fade(ui.style.get_backlight_normal())
|
||||
|
||||
def set_timer(self, token: int, deadline: int) -> None:
|
||||
raise RuntimeError # progress layouts should not set timers
|
||||
|
||||
def report(self, value: int, description: str | None = None):
|
||||
msg = self.layout.progress_event(value, description or "")
|
||||
assert msg is None
|
||||
self.layout.paint()
|
||||
ui.refresh()
|
||||
|
||||
|
||||
def progress(
|
||||
message: str | None = None,
|
||||
description: str | None = None,
|
||||
indeterminate: bool = False,
|
||||
) -> ProgressLayout:
|
||||
message = message or TR.progress__please_wait # def_arg
|
||||
return RustProgress(
|
||||
layout=trezorui2.show_progress(
|
||||
title=message,
|
||||
indeterminate=indeterminate,
|
||||
description=description or "",
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
def bitcoin_progress(message: str) -> ProgressLayout:
|
||||
return progress(message)
|
||||
|
||||
|
||||
def coinjoin_progress(message: str) -> ProgressLayout:
|
||||
return RustProgress(
|
||||
layout=trezorui2.show_progress_coinjoin(title=message, indeterminate=False)
|
||||
)
|
||||
|
||||
|
||||
def pin_progress(message: str, description: str) -> ProgressLayout:
|
||||
return progress(message, description=description)
|
||||
|
||||
|
||||
if not utils.BITCOIN_ONLY:
|
||||
|
||||
def monero_keyimage_sync_progress() -> ProgressLayout:
|
||||
return progress("", TR.progress__syncing)
|
||||
|
||||
def monero_live_refresh_progress() -> ProgressLayout:
|
||||
return progress("", TR.progress__refreshing, indeterminate=True)
|
||||
|
||||
def monero_transaction_progress_inner() -> ProgressLayout:
|
||||
return progress("", TR.progress__signing_transaction)
|
Loading…
Reference in New Issue
Block a user