fix: add .dat file extension automatically when exporting watchonly #957

pull polespinasa wants to merge 2 commits into bitcoin-core:master from polespinasa:2026-08-05-fileextencionwatchonlywallet changing 1 files +6 −2
  1. polespinasa commented at 8:05 AM on August 5, 2026: member

    fixes #956

    Unlike backup wallet, export watch-only wallet was not automatically adding the file extension to the exported file, making restoring difficult if the user doesn't manually add the file extension after exporting.

    Allows also to restore a wallet from a non specified .dat file extension. This is achieved by removing the filter in the select file screen, matching the RPC behavior.

  2. gui: fix add .dat file extension automatically when exporting watchonly 6ed7e05e20
  3. DrahtBot commented at 8:06 AM on August 5, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process.

    Type Reviewers
    ACK hebasto
    Stale ACK achow101

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. hebasto renamed this:
    gui: fix add .dat file extension automatically when exporting watchonly
    fix: add .dat file extension automatically when exporting watchonly
    on Aug 8, 2026
  5. hebasto commented at 1:55 PM on August 8, 2026: member

    Unlike backup wallet, export watch-only wallet was not automatically adding the file extension to the exported file, making restoring difficult if the user doesn't manually add the file extension after exporting.

    As I noted here:

    The GUI behaviour is consistent with the RPC.

    This change does not prevent using exportwatchonlywallet no_dat_extension RPC and subsequently opening the file in the GUI.

  6. polespinasa commented at 9:12 AM on August 11, 2026: member

    This change does not prevent using exportwatchonlywallet no_dat_extension RPC and subsequently opening the file in the GUI.

    Right, probably more correct to say partially-fixes, this PRs tries to mimic what backup wallet does. Which does add the file extension by default when using the gui.

    I think the normal non-technical user (will never use the RPC) workflow is just using the GUI options, and that should not imply adding some unknown data file extensions manually. A user might not know what a .dat is. Adding it by default seems the correct way to me.

  7. polespinasa commented at 10:55 AM on August 11, 2026: member

    This change does not prevent using exportwatchonlywallet no_dat_extension RPC and subsequently opening the file in the GUI.

    Now it does :)

    Second commit allows to load a non .dat file. Force file type filtering might cause the issue reported in #956, thus breaking UX.

    Still I think the first commit is good as adding the file extension is normally good expected behavior and is what the GUI already does with backup wallet.

  8. polespinasa force-pushed on Aug 11, 2026
  9. DrahtBot added the label CI failed on Aug 11, 2026
  10. DrahtBot removed the label CI failed on Aug 11, 2026
  11. achow101 commented at 7:40 PM on August 11, 2026: member

    ACK 10ea03ee5164b584a9155ca260d6ecb85058b6fe

  12. in src/qt/bitcoingui.cpp:559 in 10ea03ee51


    jmechanical13-cloud commented at 9:58 PM on August 11, 2026:

    File=Qmenu

  13. jmechanical13-cloud changes_requested
  14. gui: fix allow restore wallets without .dat file extension 75a4e6c678
  15. in src/qt/bitcoingui.cpp:447 in 10ea03ee51
     443 | @@ -444,7 +444,7 @@ void BitcoinGUI::createActions()
     444 |              //: The title for Restore Wallet File Windows
     445 |              QString title_windows = tr("Load Wallet Backup");
     446 |  
     447 | -            QString backup_file = GUIUtil::getOpenFileName(this, title_windows, QString(), name_data_file + QLatin1String(" (*.dat)"), nullptr);
     448 | +            QString backup_file = GUIUtil::getOpenFileName(this, title_windows, QString(), "Wallet Files (*.dat *.wallet);;All Files (*)", nullptr);
    


    hebasto commented at 11:22 AM on August 13, 2026:

    10ea03ee5164b584a9155ca260d6ecb85058b6fe

    1. The name_data_file local variable seems to be unused now.

    2. The "Wallet Files" and "All Files" substrings are not translated.


    polespinasa commented at 6:43 AM on August 15, 2026:

    Done, thanks :)

  16. polespinasa force-pushed on Aug 15, 2026
  17. in src/qt/bitcoingui.cpp:447 in 75a4e6c678
     443 | @@ -444,7 +444,7 @@ void BitcoinGUI::createActions()
     444 |              //: The title for Restore Wallet File Windows
     445 |              QString title_windows = tr("Load Wallet Backup");
     446 |  
     447 | -            QString backup_file = GUIUtil::getOpenFileName(this, title_windows, QString(), name_data_file + QLatin1String(" (*.dat)"), nullptr);
     448 | +            QString backup_file = GUIUtil::getOpenFileName(this, title_windows, QString(), name_data_file +  QLatin1String(" (*.dat *.wallet);;") + tr("All Files") + QLatin1String(" (*)"), nullptr);
    


    hebasto commented at 10:38 AM on August 15, 2026:

    nit: A stray space?

                QString backup_file = GUIUtil::getOpenFileName(this, title_windows, QString(), name_data_file + QLatin1String(" (*.dat *.wallet);;") + tr("All Files") + QLatin1String(" (*)"), nullptr);
    
  18. hebasto approved
  19. hebasto commented at 10:38 AM on August 15, 2026: member

    ACK 75a4e6c67881a791d6cbc81008c0d70d12c26710.

    A new translatable string "All Files" should be added to the translation source file before the "Translation string freeze" step.

  20. DrahtBot requested review from achow101 on Aug 15, 2026
  21. hebasto merged this on Aug 15, 2026
  22. hebasto closed this on Aug 15, 2026

  23. polespinasa commented at 10:51 AM on August 15, 2026: member

    @hebasto sorry I never did the translation process. I followed the guide and I have a commit for it, should I open a PR for it? Or in the future there will be a PR with more strings to be translated?

  24. hebasto commented at 11:04 AM on August 15, 2026: member

    I followed the guide and I have a commit for it, should I open a PR for it?

    It was simply a note for maintainers (including myself), as the v32.0 release process has already passed the "Soft translation string freeze" step.

    Or in the future there will be a PR with more strings to be translated?

    Yes.

  25. polespinasa commented at 11:07 AM on August 15, 2026: member

    It was simply a note for maintainers (including myself), as the v32.0 release process has already passed the "Soft translation string freeze" step.

    Oh okay, thanks :)

  26. polespinasa deleted the branch on Aug 15, 2026

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/gui. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-08-29 16:20 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me