From c69b1aaa5e255f6c1d09fc0a5f23ca293fd03c9e Mon Sep 17 00:00:00 2001 From: grdddj Date: Thu, 30 Mar 2023 18:40:28 +0200 Subject: [PATCH] rust: delete show_qr --- core/embed/rust/librust_qstr.h | 1 - core/embed/rust/src/ui/model_tt/layout.rs | 33 ----------------------- 2 files changed, 34 deletions(-) diff --git a/core/embed/rust/librust_qstr.h b/core/embed/rust/librust_qstr.h index 9ae6ba337d..7ea4bc36bf 100644 --- a/core/embed/rust/librust_qstr.h +++ b/core/embed/rust/librust_qstr.h @@ -37,7 +37,6 @@ static void _librust_qstrs(void) { MP_QSTR_confirm_recovery; MP_QSTR_show_checklist; MP_QSTR_show_error; - MP_QSTR_show_qr; MP_QSTR_show_success; MP_QSTR_show_warning; MP_QSTR_show_info; diff --git a/core/embed/rust/src/ui/model_tt/layout.rs b/core/embed/rust/src/ui/model_tt/layout.rs index f628f1b004..6186103d85 100644 --- a/core/embed/rust/src/ui/model_tt/layout.rs +++ b/core/embed/rust/src/ui/model_tt/layout.rs @@ -685,29 +685,6 @@ extern "C" fn new_confirm_reset_device(n_args: usize, args: *const Obj, kwargs: unsafe { util::try_with_args_and_kwargs(n_args, args, kwargs, block) } } -extern "C" fn new_show_qr(n_args: usize, args: *const Obj, kwargs: *mut Map) -> Obj { - let block = move |_args: &[Obj], kwargs: &Map| { - let title: StrBuffer = kwargs.get(Qstr::MP_QSTR_title)?.try_into()?; - let address: StrBuffer = kwargs.get(Qstr::MP_QSTR_address)?.try_into()?; - let verb_cancel: StrBuffer = kwargs.get(Qstr::MP_QSTR_verb_cancel)?.try_into()?; - let case_sensitive: bool = kwargs.get(Qstr::MP_QSTR_case_sensitive)?.try_into()?; - - let buttons = Button::cancel_confirm( - Button::with_text(verb_cancel), - Button::with_text("CONFIRM".into()).styled(theme::button_confirm()), - false, - ); - - let obj = LayoutObj::new(Frame::left_aligned( - theme::label_title(), - title, - Dialog::new(Qr::new(address, case_sensitive)?.with_border(4), buttons), - ))?; - Ok(obj.into()) - }; - unsafe { util::try_with_args_and_kwargs(n_args, args, kwargs, block) } -} - extern "C" fn new_show_address_details(n_args: usize, args: *const Obj, kwargs: *mut Map) -> Obj { let block = move |_args: &[Obj], kwargs: &Map| { let address: StrBuffer = kwargs.get(Qstr::MP_QSTR_address)?.try_into()?; @@ -1687,16 +1664,6 @@ pub static mp_module_trezorui2: Module = obj_module! { /// """Confirm TOS before device setup.""" Qstr::MP_QSTR_confirm_reset_device => obj_fn_kw!(0, new_confirm_reset_device).as_obj(), - /// def show_qr( - /// *, - /// title: str, - /// address: str, - /// verb_cancel: str, - /// case_sensitive: bool, - /// ) -> object: - /// """Show QR code.""" - Qstr::MP_QSTR_show_qr => obj_fn_kw!(0, new_show_qr).as_obj(), - /// def show_address_details( /// *, /// address: str,