Save attachments to user-chosen dir (O) with configurable reveal #11

Closed
clanker wants to merge 0 commits from attachments-save into master
Owner

Batch Save-all for O: picks a destination via getExistingDirectory (defaults to attachment_save_dir=~/Downloads), writes decoded parts directly there with dedup suffix (.1, .2), single status Saved N attachment(s) to DEST, then configurable reveal (attachment_reveal: file_browser runs file_browser_command on dest, none stays silent). Falls back through nautilus/dolphin/thunar/xdg-open.

Split from #10#10 stays compose-model only (see fman fallback 0a3e142 kept on tier3). No temp dir, no thundering Popen.

Batch Save-all for `O`: picks a destination via `getExistingDirectory` (defaults to `attachment_save_dir`=~/Downloads), writes decoded parts directly there with dedup suffix (.1, .2), single status `Saved N attachment(s) to DEST`, then configurable reveal (`attachment_reveal`: `file_browser` runs `file_browser_command` on dest, `none` stays silent). Falls back through nautilus/dolphin/thunar/xdg-open. Split from #10 — #10 stays compose-model only (see fman fallback 0a3e142 kept on tier3). No temp dir, no thundering Popen.
Move account/sig/seed logic into lazarus/compose_model.py (Qt-free
pure functions + ComposeSeed dataclass) so ComposePanel becomes a thin
binding over seeds returned by build_reply/forward/mailto. Panel still
owns _insert_signature (widget cursor + QTextCursor dance) and header
binding; model owns the compositional algebra (sig_block, subject prefix,
quote/forward assembly). Helpers account_for_message / email_for_account
/ gnupg_keyid_for_account / sig_block_text are the new call sites —
exercisable without a display server.
fman was hardcoded in ~/.config but not on PATH, so Popen(shell=True)
failed silently with '/bin/sh: fman: not found'. Now checks shutil.which
on the template's binary and falls back through nautilus/dolphin/thunar/xdg-open,
surfacing the path or an error via status_message. Also fixes the user config
(fman -> nautilus).
O now asks for a destination via getExistingDirectory (defaults to
attachment_save_dir, ~/Downloads), writes decoded parts directly there
with dedup suffix (.1, .2), and post-save either reveals via
file_browser_command (attachment_reveal='file_browser') or just shows a
status message ('none'). No temp-dir + file-manager to /tmp. New settings:

  attachment_save_dir   string  default '~/Downloads'
  attachment_reveal     'file_browser'|'none'  default 'file_browser'

Old file_browser_command retained as the reveal template; empty means skip.
Temp-dir path removed; still falls back through nautilus/dolphin/thunar/xdg-open.
clanker force-pushed attachments-save from 329900ecd9 to 52224bd568 2026-08-08 00:14:06 +00:00 Compare
clanker closed this pull request 2026-08-08 00:17:39 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Home/lazarus!11
No description provided.