Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ Exported Uniform Resource (UR) QR codes, a widely adopted standard for exchangin
- Keypad: Added backtick **`**
- Bugfix: Screensaver not activating in menu pages without statusbar
- Embit: Improved BIP39 mnemonic validation
- Bug Fix: Corrected handling of certain binary-encoded QR codes
- Bugfix: Corrected handling of certain binary-encoded QR codes
- UI: Added contextual information to "Are you sure?" exit prompts
- Fix fingerprint unset warn message for rare case
- Improved QR code decoding performance and added inverted color QR code detection

Expand Down
11 changes: 9 additions & 2 deletions src/krux/pages/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ def __init__(self, ctx: Context, menu=None):
def esc_prompt(self):
"""Prompts user for leaving"""
self.ctx.display.clear()
answer = self.prompt(t("Are you sure?"), self.ctx.display.height() // 2)
answer = self.prompt(
t("Back to Menu") + "\n\n" + t("Are you sure?"),
self.ctx.display.height() >> 1,
)
if kboard.has_touchscreen:
self.ctx.input.touch.clear_regions()
return ESC_KEY if answer else None
Expand Down Expand Up @@ -522,7 +525,11 @@ def has_sd_card(self):

def shutdown(self):
"""Handler for the 'shutdown' menu item"""
if self.prompt(t("Are you sure?"), self.ctx.display.height() // 2):
shtn_reboot_label = t("Shutdown") if kboard.has_battery else t("Reboot")
if self.prompt(
shtn_reboot_label + "\n\n" + t("Are you sure?"),
self.ctx.display.height() >> 1,
):
self.ctx.display.clear()
self.ctx.display.draw_centered_text(t("Shutting down…"))
time.sleep_ms(SHUTDOWN_WAIT_TIME)
Expand Down
5 changes: 4 additions & 1 deletion src/krux/pages/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,10 @@ def _load_key_from_words(self, words, charset=LETTERS, new=False):

index, _ = submenu.run_loop()
if index == submenu.back_index:
if self.prompt(t("Are you sure?"), self.ctx.display.height() // 2):
if self.prompt(
t("Back to Menu") + "\n\n" + t("Are you sure?"),
self.ctx.display.height() >> 1,
):
del key
return MENU_CONTINUE
if index == 0:
Expand Down
5 changes: 4 additions & 1 deletion src/krux/pages/mnemonic_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,10 @@ def edit(self):
if button_index == ESC_INDEX:
# Cancel
self.ctx.display.clear()
if self.prompt(t("Are you sure?"), self.ctx.display.height() // 2):
if self.prompt(
t("Back to Menu") + "\n\n" + t("Are you sure?"),
self.ctx.display.height() >> 1,
):
return None
continue
new_word = self.edit_word(button_index + page * 12)
Expand Down
5 changes: 4 additions & 1 deletion src/krux/pages/stack_1248.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,10 @@ def enter_1248(self):
word_index += 1
elif index >= STACKBIT_ESC_INDEX: # ESC
self.ctx.display.clear()
if self.prompt(t("Are you sure?"), self.ctx.display.height() // 2):
if self.prompt(
t("Back to Menu") + "\n\n" + t("Are you sure?"),
self.ctx.display.height() >> 1,
):
break
# self._map_keys_array()
elif index < 14:
Expand Down
5 changes: 4 additions & 1 deletion src/krux/pages/tiny_seed.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,10 @@ def _editable_bit():
page += 1
elif index >= TS_ESC_START_POSITION: # "Esc"
self.ctx.display.clear()
if self.prompt(t("Are you sure?"), self.ctx.display.height() // 2):
if self.prompt(
t("Back to Menu") + "\n\n" + t("Are you sure?"),
self.ctx.display.height() >> 1,
):
break
self._map_keys_array()
elif _editable_bit():
Expand Down