mirror of
https://github.com/bitcoin-core/gui-qml.git
synced 2026-12-02 08:12:38 +00:00
qml: Back up the wallet the backup dialog was opened for #1009
No reviewers
Labels
No labels
Android
Bug
Build system
Design suggestion
Doc
Needs design review
Needs rebase
Stage
UX
Up for grabs
Upstream
Wallet
duplicate
enhancement
good first issue
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin-core/gui-qml!1009
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/backup-dialog-wallet-target"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #991.
The backup dialog used
selectedWalletwhen accepted, so if another wallet was loaded while the dialog was open, that wallet was backed up instead.The wallet is now pinned when the dialog opens. If it is closed before the dialog is accepted, the backup is refused with an error.
A QML test covers a selection change while the dialog is open.
One UI clarity suggestion for the backup dialog.
After opening the backup dialog for wallet A and loading wallet B, the page behind it shows B while this dialog still targets A. The dialog title is blank, so the editable filename is the only cue that it belongs to A. We should set
title: qsTr("Back up wallet “%1”").arg(root.backupWalletName)here and extend the selection-change test to check that the title still names A after switching to B.Tried a filename-label change locally on
b03cf0554841, macOS 26.6.2 / Qt 6.9. It keeps A visible after loading B and editing the filename. Restoring the backups confirmed they still belonged to A.A 64-character name was readable, but 160 characters stretched the expanded dialog to over three times its normal width. So I’d keep the title change, but wouldn’t use the full wallet name as the filename label as-is. We need a way to show it without letting the dialog grow indefinitely.
Tried a QML confirmation after the native picker locally on
b03cf0554841, macOS / Qt 6.9. Names up to 240 characters wrap without widening it, and a longer nested name scrolls.Switching wallets in either dialog kept the original wallet, confirmed by restoring the backups. Unloading it disabled the backup, including after reloading the same name.
I think this is workable if we’re okay with the extra click. It lets us show the full wallet name and destination before writing, without having to customize the native panel.
240-character name after switching to wallet B:
After unloading the original wallet:
Thanks @johnny9 and @jarolrod. Went with the confirmation step jarolrod prototyped, plus the dialog title.
The save panel is now titled Back up wallet “”. After it is accepted, a QML confirmation shows the pinned wallet and the resolved destination. Both wrap, and the dialog width is fixed, so long names don't widen it. If the pinned wallet is unloaded while the confirmation is open, Back up is disabled and an inline error is shown.
To support this, AlertPopup gained a details slot and AlertAction an enabled property. Both are additive, and existing popups are unchanged.
Tested on Linux (Hyprland, Qt 6.11, GTK native dialog) with a 242-character wallet name:
I have not tested on macOS.
New QML tests cover the selection change, cancel, unloading the pinned wallet, and a long name wrapping without widening the dialog.
One thing to note: when the chosen file already exists, the native panel asks to replace it before our confirmation appears, so that case takes two confirmations. On GTK, that native replace prompt also stretches with a long file name, which we can't control from here.
Hi, I'm working on a PR that fixes a class of related bugs (#992, #999, #1012, #1013, #1026, #1027, #1028, #1030 and #1037 ) where the wallet context changes while a menu or dialog is open.
IMO a safe, shared fix would be to dismiss those menus/dialogs and invalidate their pending actions whenever the wallet context changes. Switching back to the original wallet shouldn’t revive an old action.
What do you think about using that approach here too? We should just dismiss the dialog if the wallet context changes.
https://github.com/bitcoin-core/gui-qml/pull/1046 is a broader fix that fixes #991 as well.
Closing this PR since #1049 already addresses the issue.