|
|
|
@ -1011,9 +1011,13 @@ extern "C" fn new_show_homescreen(n_args: usize, args: *const Obj, kwargs: *mut
|
|
|
|
|
kwargs.get(Qstr::MP_QSTR_notification)?.try_into_option()?;
|
|
|
|
|
let notification_level: u32 = kwargs.get_or(Qstr::MP_QSTR_notification_level, 0)?;
|
|
|
|
|
let hold: bool = kwargs.get(Qstr::MP_QSTR_hold)?.try_into()?;
|
|
|
|
|
let skip_first_paint: bool = kwargs.get(Qstr::MP_QSTR_skip_first_paint)?.try_into()?;
|
|
|
|
|
|
|
|
|
|
let notification = notification.map(|w| (w, notification_level));
|
|
|
|
|
let obj = LayoutObj::new(Homescreen::new(label, notification, hold))?;
|
|
|
|
|
if skip_first_paint {
|
|
|
|
|
obj.skip_first_paint();
|
|
|
|
|
}
|
|
|
|
|
Ok(obj.into())
|
|
|
|
|
};
|
|
|
|
|
unsafe { util::try_with_args_and_kwargs(n_args, args, kwargs, block) }
|
|
|
|
@ -1023,8 +1027,12 @@ extern "C" fn new_show_lockscreen(n_args: usize, args: *const Obj, kwargs: *mut
|
|
|
|
|
let block = move |_args: &[Obj], kwargs: &Map| {
|
|
|
|
|
let label: StrBuffer = kwargs.get(Qstr::MP_QSTR_label)?.try_into()?;
|
|
|
|
|
let bootscreen: bool = kwargs.get(Qstr::MP_QSTR_bootscreen)?.try_into()?;
|
|
|
|
|
let skip_first_paint: bool = kwargs.get(Qstr::MP_QSTR_skip_first_paint)?.try_into()?;
|
|
|
|
|
|
|
|
|
|
let obj = LayoutObj::new(Lockscreen::new(label, bootscreen))?;
|
|
|
|
|
if skip_first_paint {
|
|
|
|
|
obj.skip_first_paint();
|
|
|
|
|
}
|
|
|
|
|
Ok(obj.into())
|
|
|
|
|
};
|
|
|
|
|
unsafe { util::try_with_args_and_kwargs(n_args, args, kwargs, block) }
|
|
|
|
@ -1035,6 +1043,7 @@ extern "C" fn new_show_busyscreen(n_args: usize, args: *const Obj, kwargs: *mut
|
|
|
|
|
let title: StrBuffer = kwargs.get(Qstr::MP_QSTR_title)?.try_into()?;
|
|
|
|
|
let description: StrBuffer = kwargs.get(Qstr::MP_QSTR_description)?.try_into()?;
|
|
|
|
|
let time_ms: u32 = kwargs.get(Qstr::MP_QSTR_time_ms)?.try_into()?;
|
|
|
|
|
let skip_first_paint: bool = kwargs.get(Qstr::MP_QSTR_skip_first_paint)?.try_into()?;
|
|
|
|
|
|
|
|
|
|
let obj = LayoutObj::new(Frame::new(
|
|
|
|
|
title,
|
|
|
|
@ -1047,6 +1056,9 @@ extern "C" fn new_show_busyscreen(n_args: usize, args: *const Obj, kwargs: *mut
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
))?;
|
|
|
|
|
if skip_first_paint {
|
|
|
|
|
obj.skip_first_paint();
|
|
|
|
|
}
|
|
|
|
|
Ok(obj.into())
|
|
|
|
|
};
|
|
|
|
|
unsafe { util::try_with_args_and_kwargs(n_args, args, kwargs, block) }
|
|
|
|
@ -1337,6 +1349,7 @@ pub static mp_module_trezorui2: Module = obj_module! {
|
|
|
|
|
/// hold: bool,
|
|
|
|
|
/// notification: str | None,
|
|
|
|
|
/// notification_level: int = 0,
|
|
|
|
|
/// skip_first_paint: bool,
|
|
|
|
|
/// ) -> trezorui2.CANCELLED:
|
|
|
|
|
/// """Idle homescreen."""
|
|
|
|
|
Qstr::MP_QSTR_show_homescreen => obj_fn_kw!(0, new_show_homescreen).as_obj(),
|
|
|
|
@ -1345,6 +1358,7 @@ pub static mp_module_trezorui2: Module = obj_module! {
|
|
|
|
|
/// *,
|
|
|
|
|
/// label: str,
|
|
|
|
|
/// bootscreen: bool,
|
|
|
|
|
/// skip_first_paint: bool,
|
|
|
|
|
/// ) -> trezorui2.CANCELLED:
|
|
|
|
|
/// """Homescreen for locked device."""
|
|
|
|
|
Qstr::MP_QSTR_show_lockscreen => obj_fn_kw!(0, new_show_lockscreen).as_obj(),
|
|
|
|
@ -1354,6 +1368,7 @@ pub static mp_module_trezorui2: Module = obj_module! {
|
|
|
|
|
/// title: str,
|
|
|
|
|
/// description: str,
|
|
|
|
|
/// time_ms: int,
|
|
|
|
|
/// skip_first_paint: bool,
|
|
|
|
|
/// ) -> trezorui2.CANCELLED:
|
|
|
|
|
/// """Homescreen used for indicating coinjoin in progress."""
|
|
|
|
|
Qstr::MP_QSTR_show_busyscreen => obj_fn_kw!(0, new_show_busyscreen).as_obj(),
|
|
|
|
|