diff --git a/releases/Next-ChangeLog.md b/releases/Next-ChangeLog.md index 31cbff4a..e9fbe60b 100644 --- a/releases/Next-ChangeLog.md +++ b/releases/Next-ChangeLog.md @@ -18,8 +18,7 @@ This lists the new changes that have not yet been published in a normal release. ## 5.4.1 - 2024-??-?? -- tbd - +- Enhancement: Export single sig descriptor with simple QR # Q Specific Changes diff --git a/shared/export.py b/shared/export.py index 5760cc9f..661e8f8b 100644 --- a/shared/export.py +++ b/shared/export.py @@ -133,14 +133,15 @@ be needed for different systems. yield fp.getvalue() del fp -async def write_text_file(fname_pattern, body, title, derive, addr_fmt): +async def write_text_file(fname_pattern, body, title, derive, addr_fmt, + force_prompt=False): # Export data as a text file. from glob import dis, NFC from files import CardSlot, CardMissingError, needs_microsd from ux import import_export_prompt choice = await import_export_prompt("%s file" % title, is_import=False, - no_qr=(not version.has_qwerty)) + force_prompt=force_prompt) # QR offered also on Mk4 if choice == KEY_CANCEL: return elif choice == KEY_QR: @@ -547,7 +548,8 @@ async def make_descriptor_wallet_export(addr_type, account_num=0, mode=None, int ) dis.progress_bar_show(1) - await write_text_file(fname_pattern, body, "Descriptor", derive + "/0/0", addr_type) + await write_text_file(fname_pattern, body, "Descriptor", derive + "/0/0", + addr_type, force_prompt=True) # EOF diff --git a/shared/ux.py b/shared/ux.py index 813fa809..6259e445 100644 --- a/shared/ux.py +++ b/shared/ux.py @@ -456,7 +456,7 @@ def import_export_prompt_decode(ch): async def import_export_prompt(what_it_is, is_import=False, no_qr=False, no_nfc=False, title=None, intro='', footnotes='', - slot_b_only=False): + slot_b_only=False, force_prompt=False): # Show story allowing user to select source for importing/exporting # - return either str(mode) OR dict(file_args) # - KEY_NFC or KEY_QR for those sources @@ -466,7 +466,8 @@ async def import_export_prompt(what_it_is, is_import=False, no_qr=False, if is_import: prompt, escape = _import_prompt_builder(what_it_is, no_qr, no_nfc, slot_b_only) else: - prompt, escape = export_prompt_builder(what_it_is, no_qr, no_nfc) + prompt, escape = export_prompt_builder(what_it_is, no_qr, no_nfc, + force_prompt=force_prompt) # TODO: detect if we're only asking A or B, when just one card is inserted # - assume that's what they want to do diff --git a/testing/test_export.py b/testing/test_export.py index 0ea61eae..8d7a58a3 100644 --- a/testing/test_export.py +++ b/testing/test_export.py @@ -609,8 +609,7 @@ def test_export_xpub(use_nfc, acct_num, dev, cap_menu, pick_menu_item, goto_home def test_generic_descriptor_export(chain, addr_fmt, acct_num, goto_home, settings_set, need_keypress, expect_acctnum_captured, OK, pick_menu_item, way, cap_story, cap_menu, int_ext, settings_get, - virtdisk_path, load_export, press_select, skip_if_useless_way): - skip_if_useless_way(way) + virtdisk_path, load_export, press_select): settings_set('chain', chain) chain_num = 1 if chain in ["XTN", "XRT"] else 0