Skip to content

Commit 7412be9

Browse files
committed
chore(core/eckhart): update apply settings label flow
- change button label and gradient - add success screen after changing device name [no changelog]
1 parent ec8cfd0 commit 7412be9

File tree

12 files changed

+77
-16
lines changed

12 files changed

+77
-16
lines changed

core/embed/rust/librust_qstr.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ static void _librust_qstrs(void) {
268268
MP_QSTR_details_title;
269269
MP_QSTR_device_name;
270270
MP_QSTR_device_name__change_template;
271+
MP_QSTR_device_name__changed;
271272
MP_QSTR_device_name__continue_with_empty_label;
272273
MP_QSTR_device_name__enter;
273274
MP_QSTR_device_name__title;

core/embed/rust/src/translations/generated/translated_string.rs

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/embed/rust/src/ui/layout_eckhart/ui_firmware.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,12 @@ impl FirmwareUI for UIEckhart {
188188
}
189189
}
190190
let text = FormattedText::new(ops);
191-
let action_bar = ActionBar::new_double(
192-
Button::with_icon(theme::ICON_CROSS),
193-
Button::with_text(verb.unwrap_or(TR::buttons__confirm.into())),
194-
);
191+
let right_button = if let Some(verb) = verb {
192+
Button::with_text(verb)
193+
} else {
194+
Button::with_text(TR::buttons__confirm.into()).styled(button_confirm())
195+
};
196+
let action_bar = ActionBar::new_double(Button::with_icon(theme::ICON_CROSS), right_button);
195197
let screen = TextScreen::new(text)
196198
.with_header(Header::new(title))
197199
.with_action_bar(action_bar);

core/mocks/trezortranslate_keys.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ class TR:
250250
debug__loading_seed: str = "Loading seed"
251251
debug__loading_seed_not_recommended: str = "Loading private seed is not recommended."
252252
device_name__change_template: str = "Change device name to {0}?"
253+
device_name__changed: str = "Device name changed."
253254
device_name__continue_with_empty_label: str = "Continue with empty device name?"
254255
device_name__enter: str = "Enter device name"
255256
device_name__title: str = "Device name"

core/src/apps/management/apply_settings.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,10 @@ async def _require_confirm_change_homescreen(homescreen: bytes) -> None:
161161

162162

163163
async def _require_confirm_change_label(label: str) -> None:
164-
from trezor.ui.layouts import confirm_single
164+
from trezor.ui.layouts import confirm_change_label
165165

166-
await confirm_single(
167-
"set_label",
168-
TR.device_name__title,
169-
description=TR.device_name__change_template,
170-
description_param=label,
171-
verb=TR.buttons__change,
166+
await confirm_change_label(
167+
"set_label", TR.device_name__title, TR.device_name__change_template, label
172168
)
173169

174170

core/src/trezor/ui/layouts/bolt/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,19 @@ def confirm_homescreen(image: bytes) -> Awaitable[None]:
213213
)
214214

215215

216+
async def confirm_change_label(
217+
br_name: str, title: str, template: str, param: str
218+
) -> None:
219+
220+
await confirm_single(
221+
br_name=br_name,
222+
title=title,
223+
description=template,
224+
description_param=param,
225+
verb=TR.buttons__change,
226+
)
227+
228+
216229
def confirm_change_passphrase(use: bool) -> Awaitable[None]:
217230
description = TR.passphrase__turn_on if use else TR.passphrase__turn_off
218231
verb = TR.buttons__turn_on if use else TR.buttons__turn_off

core/src/trezor/ui/layouts/caesar/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,19 @@ def confirm_homescreen(image: bytes) -> Awaitable[None]:
231231
)
232232

233233

234+
async def confirm_change_label(
235+
br_name: str, title: str, template: str, param: str
236+
) -> None:
237+
238+
await confirm_single(
239+
br_name=br_name,
240+
title=title,
241+
description=template,
242+
description_param=param,
243+
verb=TR.buttons__change,
244+
)
245+
246+
234247
def confirm_change_passphrase(use: bool) -> Awaitable[None]:
235248
description = TR.passphrase__turn_on if use else TR.passphrase__turn_off
236249
verb = TR.buttons__turn_on if use else TR.buttons__turn_off

core/src/trezor/ui/layouts/delizia/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,19 @@ def confirm_homescreen(
236236
)
237237

238238

239+
async def confirm_change_label(
240+
br_name: str, title: str, template: str, param: str
241+
) -> None:
242+
243+
await confirm_single(
244+
br_name=br_name,
245+
title=title,
246+
description=template,
247+
description_param=param,
248+
verb=TR.buttons__change,
249+
)
250+
251+
239252
def confirm_change_passphrase(use: bool) -> Awaitable[ui.UiResult]:
240253
description = TR.passphrase__turn_on if use else TR.passphrase__turn_off
241254

core/src/trezor/ui/layouts/eckhart/__init__.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,14 @@ def confirm_single(
9393
trezorui_api.confirm_emphasized(
9494
title=title,
9595
items=(begin, (True, description_param), end),
96-
verb=verb,
96+
verb=None,
9797
),
9898
br_name,
9999
ButtonRequestType.ProtectCall,
100100
)
101101

102+
show_continue_in_app(TR.address__confirmed)
103+
102104

103105
def confirm_reset_device(recovery: bool = False) -> Awaitable[None]:
104106
return raise_if_cancelled(
@@ -217,6 +219,21 @@ def confirm_homescreen(
217219
)
218220

219221

222+
async def confirm_change_label(
223+
br_name: str, title: str, template: str, param: str
224+
) -> None:
225+
226+
await confirm_single(
227+
br_name=br_name,
228+
title=title,
229+
description=template,
230+
description_param=param,
231+
verb=None,
232+
)
233+
234+
show_continue_in_app(TR.device_name__changed)
235+
236+
220237
def confirm_change_passphrase(use: bool) -> Awaitable[None]:
221238
description = TR.passphrase__turn_on if use else TR.passphrase__turn_off
222239

core/translations/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@
282282
"debug__loading_seed": "Loading seed",
283283
"debug__loading_seed_not_recommended": "Loading private seed is not recommended.",
284284
"device_name__change_template": "Change device name to {0}?",
285+
"device_name__changed": "Device name changed.",
285286
"device_name__continue_with_empty_label": "Continue with empty device name?",
286287
"device_name__enter": "Enter device name",
287288
"device_name__title": "Device name",

0 commit comments

Comments
 (0)