feat: the window and the command line set up, save and show backups; the system's folder dialog

Admin requests set up the backup folder (journaled as the books' own
backup.folder setting, the owner the one who decided) and the passphrase, save
a backup as one file, and say how the backups stand; the Backups window, Save a
backup and Restore (a folder or a file, with the passphrase when it has one) use
them, and the command line has backup-setup, backup-status and backup-save
(the passphrase typed at a terminal, never on the command line).

New dependency: rfd (MIT) in ledger-gui, with pollster, for the system's own
folder and file dialogs (the portal on Linux, native on Windows and macOS). It
adds no other crate to the tree (zbus is already there through the window
toolkit); cargo deny passes and THIRD-PARTY-NOTICES.txt is regenerated.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Fable 5.2 committed 2026-11-21 18:20:59 -07:00
1 parent 0720f3036d
commit 51a7607a82
11 files changed
+1214 -3

No files matched your search

+29
View File
@@ -302,6 +302,35 @@ impl ledger_gui::owner::Owner for ViewerOwner {
ledger_host::commands::back_up_now(&self.common, book, false)
}
fn backup_state(&self, book: &str) -> Result<ledger_gui::owner::BackupState, String> {
let s = ledger_host::commands::backup_standing(&self.common, book)?;
Ok(ledger_gui::owner::BackupState {
lines: ledger_host::commands::backup_words(&s),
folder: s.folder.clone(),
sealed: s.sealed,
})
}
fn set_up_backups(
&self,
book: &str,
folder: Option<String>,
passphrase: Option<ledger_gui::owner::Secret>,
remove_passphrase: bool,
) -> Result<Vec<String>, String> {
ledger_host::commands::backup_setup(
&self.common,
book,
folder,
passphrase.map(|p| p.0.clone()),
remove_passphrase,
)
}
fn save_backup(&self, book: &str, file: &str) -> Result<Vec<String>, String> {
ledger_host::commands::backup_save(&self.common, book, file)
}
fn plan_restore(
&self,
source: &str,