feat: CSV 导入导出、导入撤销支持及多项 bug 修复

功能:
- 新增 CSV 格式导入导出支持(含 BOM 处理、引号转义、智能标题行检测)
- 导入操作支持撤销/重做
- 保存时 PATH 长度检查与警告
- 深色模式状态持久化(darkmode.txt)
- 提取 get_current_target/push_record 为共享函数,消除控制器层重复代码
- 新增 string_list_insert_at,修复撤销删除时的索引恢复
- 新增 undo_redo、error_code、import_export 单元测试

Bug 修复:
- 修复备份目录对话框和失败原因的硬编码中文字符串
- 提取 get_exe_dir 到 os_env 消除 i18n.c/ui_utils.c 重复定义
- 修复导入撤销 old_sys/old_user 内存管理(push 后置 NULL 防止重复释放)
- 修复 CSV 导出转义与导入解析不一致(移除反斜杠转义,依赖 CSV 引号机制)
- 修正 PATH 长度 8191 限制描述为 "command line safe limit"
This commit is contained in:
2026-05-03 01:52:06 +08:00
parent 720ebb535d
commit cdcfd8e0a7
27 changed files with 1823 additions and 110 deletions
+8
View File
@@ -3,6 +3,7 @@
#include <iup.h>
#include "core/app_context.h"
#include "core/undo_redo.h"
#include "utils/i18n.h"
// 内部辅助函数声明(供各 callbacks_*.c 文件共享)
@@ -26,4 +27,11 @@ void refresh_undo_redo_buttons(Ihandle *dlg);
// 同步合并预览列表
void sync_merged_list(Ihandle *dlg);
// 获取当前 Tab 对应的 TargetType
TargetType get_current_target(Ihandle *dlg);
// 创建并推送撤销记录
void push_record(Ihandle *dlg, OperationType op_type, int index, int count,
char **old_paths, char **new_paths);
#endif // CALLBACKS_INTERNAL_H