Skip to content

GUI: 完整筛选 6 维度、简化还原界面、修复加密/压缩自动打包#41

Merged
airprofly merged 23 commits into
mainfrom
feature/AMC513_10-gui-all-filters
Jul 16, 2026
Merged

GUI: 完整筛选 6 维度、简化还原界面、修复加密/压缩自动打包#41
airprofly merged 23 commits into
mainfrom
feature/AMC513_10-gui-all-filters

Conversation

@AMC513

@AMC513 AMC513 commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

改动范围

全部在 src/gui/,未动 CLI/Engine/Filter。

筛选功能

  • 所有 6 个维度全接入 GUI(路径、类型、名称、时间、大小、所有者)
  • 纯路径自动递归展开(core → 包含所有子文件)
  • FilterDialog 与 inline 控件双向同步
  • 类型/名称/路径字段加 tooltip 说明

还原界面

  • 完全自动检测:从文件名后缀识别 加密/压缩/打包方式
  • 移除解密算法选择器(自动尝试 AES→SM4)
  • 移除无效的元数据/特殊文件选项
  • 密码错误直接报错,不走进度条,留在还原页重试

备份界面

  • 压缩/加密勾选瞬间自动打包 Tar,即使之前选了 Zip
  • 阻止无打包启动压缩/加密
  • 加密算法名映射修复(AES-256 → aes256)
  • collectOptions() 补上加密收集

其他

  • 删除设置页(冗余)
  • 目标目录自动建时间戳子目录

airprofly and others added 23 commits July 15, 2026 11:26
GUI filter:
- Add name glob filter (include/exclude) to FilterDialog
- Add all 6 filter dimensions as inline controls in BackupTab:
  path (text), type (text), name (text), time (datetime picker),
  size (spin+unit), owner (text)
- FilterDialog now syncs to/from all inline controls bidirectionally
- collectOptions() forwards all 6 dimensions to BackupOptions

Settings tab removed: settings_tab.cpp/.h deleted, references
removed from main_window, CMakeLists.txt, qrc, and settings icon.
Only backup, restore, and schedule tabs remain.

Co-Authored-By: Claude <noreply@anthropic.com>
Restore tab was missing decryption algorithm selector and
password field. Add enableDecrypt checkbox, decryptAlgo
combobox (AES-256/SM4), and password line edit, matching
the backup tab layout. Forward decrypt options to
RestoreOptions in onStartRestore().

Co-Authored-By: Claude <noreply@anthropic.com>
When user picks a destination dir (e.g. 'data'), the GUI now
automatically creates a timestamped subdirectory inside it:
  data/source_20260715_143000/   (backup)
  data/source_R20260715_143000/  (restore)

This matches the behavior that was removed from CLI by the
revert of #28. GUI-only fix — no CLI changes.

Co-Authored-By: Claude <noreply@anthropic.com>
The engine handles directory creation for both mirror mode
(fs_->mkdir) and archive mode (fs_->write). Pre-creating the
directory in GUI caused an empty directory to remain alongside
the .tar file when pack mode was enabled.

Co-Authored-By: Claude <noreply@anthropic.com>
…collect

Two bugs fixed:
1. collectOptions() was missing the encrypt block entirely —
   opts.encryptAlgo and opts.password were never set.
2. GUI display names 'AES-256' and 'SM4' didn't match
   buildEncryptor expectations ('aes256', 'sm4').
Same fix applied to restore tab's decryptAlgo mapping.

Co-Authored-By: Claude <noreply@anthropic.com>
Mirror the backup tab's encrypt-password validation: require
non-empty password when decrypt is enabled.

Co-Authored-By: Claude <noreply@anthropic.com>
- Remove decrypt algorithm combobox and enableDecrypt checkbox
- Only show password field (always visible)
- Auto-detect encryption from .enc filename suffix
- Encrypted file without password → prompt user
- BackupWorker auto-tries AES-256 first, falls back to SM4
- No need for user to select encryption algorithm manually

Co-Authored-By: Claude <noreply@anthropic.com>
Restore tab now only shows source, destination, and password.
All format/algorithm detection is automatic:

- Parse filename extension chain right-to-left
  .enc → decrypt (auto-try AES→SM4)
  .gz  → decompress gzip
  .zst → decompress zstd
  .xz  → decompress lzma
  .tar → unpack tar
  .zip → unpack zip

Example: docs_20260715.tar.xz.enc → decrypt→lzma→tar
No manual algo selection needed anymore.

Co-Authored-By: Claude <noreply@anthropic.com>
onCancel was connected to finished() but ignored the success
parameter — always showed '还原完成' and emitted success=true.
Renamed to onRestoreFinished(bool success, QString const& msg)
that handles errors correctly: wrong password now shows
'还原失败: ✗ Decryption failed — wrong password or corrupted data'
without progress bar animation.

Co-Authored-By: Claude <noreply@anthropic.com>
Only switch to backup tab on restore success. On failure,
stay on restore tab so user can fix password and retry.

Co-Authored-By: Claude <noreply@anthropic.com>
Encryption operates on a single file, not a directory.
When user enables encryption without pack, auto-enable
Tar packing to produce a valid .tar.enc file.

Co-Authored-By: Claude <noreply@anthropic.com>
RestoreOptions::preserveMetadata and handleSpecial are dead
fields — handleRestore and RestoreEngine never use them.
Removed the misleading checkboxes from restore tab.

Co-Authored-By: Claude <noreply@anthropic.com>
Compression also operates on a single file, not a directory.
Auto-enable Tar packing when user enables compression without
pack, same as encryption.

Co-Authored-By: Claude <noreply@anthropic.com>
Compress/Encrypt auto-enable Tar packing immediately when
the user checks the box, via onCompressToggled/onEncryptToggled
slots, rather than validating at start time.

Co-Authored-By: Claude <noreply@anthropic.com>
…as selected

Compress and encrypt now force the pack format to Tar,
switching away from Zip if previously selected.

Co-Authored-By: Claude <noreply@anthropic.com>
…pack

Guard against edge case where user manually unchecks pack after
auto-toggle. Shows clear error message instead of running a mirror
backup and then failing at compress/encrypt step.

Co-Authored-By: Claude <noreply@anthropic.com>
…trols

Added setters to FilterDialog for types, time, size, and owner.
onEditFilter() pre-fills them before showing dialog, so user's
inline settings are not lost when opening the dialog.

Co-Authored-By: Claude <noreply@anthropic.com>
Path matching uses FNM_PATHNAME where * doesn't match /
Explains common patterns: core, core/*, core/**/*, *.cpp

Co-Authored-By: Claude <noreply@anthropic.com>
When user enters a path without glob chars (e.g. 'core'),
GUI now generates recursive patterns: core, core/*, core/*/*,
... up to 15 levels deep. This matches user expectation that
including a directory includes everything inside it.

Co-Authored-By: Claude <noreply@anthropic.com>
…lter

Type filter is for OS file types (file/dir/symlink), not file
extensions (.txt, .cpp). Updated placeholder and tooltip to
guide users to the name filter for suffix-based filtering.

Co-Authored-By: Claude <noreply@anthropic.com>
@airprofly
airprofly merged commit bc85efd into main Jul 16, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants