diff --git a/CHANGELOG.md b/CHANGELOG.md index 387b26141..f700a8b2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/krux/pages/__init__.py b/src/krux/pages/__init__.py index 5e954c093..c140e4be1 100644 --- a/src/krux/pages/__init__.py +++ b/src/krux/pages/__init__.py @@ -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 @@ -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) diff --git a/src/krux/pages/login.py b/src/krux/pages/login.py index 82e32cfca..fe4988232 100644 --- a/src/krux/pages/login.py +++ b/src/krux/pages/login.py @@ -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: diff --git a/src/krux/pages/mnemonic_editor.py b/src/krux/pages/mnemonic_editor.py index e78c2e021..dfccb2107 100644 --- a/src/krux/pages/mnemonic_editor.py +++ b/src/krux/pages/mnemonic_editor.py @@ -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) diff --git a/src/krux/pages/stack_1248.py b/src/krux/pages/stack_1248.py index 0eaa700f2..a2ba2c811 100644 --- a/src/krux/pages/stack_1248.py +++ b/src/krux/pages/stack_1248.py @@ -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: diff --git a/src/krux/pages/tiny_seed.py b/src/krux/pages/tiny_seed.py index 8cbf29ee0..ed028511e 100644 --- a/src/krux/pages/tiny_seed.py +++ b/src/krux/pages/tiny_seed.py @@ -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():