Feature: show transfer history in the file manager path dropdown

The path combo only listed folders browsed in the current session and
picking an entry did not navigate; transfer history was reachable only
through the history button, which always jumped to the newest entry.

Both path combos now load the [file_history] MRU list (max 10) after
each drive-list reset, with duplicate paths skipped. The current folder
still sits at index 0, and SetCurrentPathInCombo deletes stale copies
before inserting. CBN_SELENDOK navigates as soon as the user picks an
entry; CBN_SELCHANGE was avoided because it fires on every arrow-key
move and would flood the remote side with list requests. With the list
dropped, Enter is left to the combo so keyboard selection works too.

A local entry that no longer exists restores the combo text and shows
the existing "history folder not exist" message. For new clients,
TOKEN_FILE_LIST_ERROR now re-enables and clears the remote pane instead
of leaving it greyed out; a new translated message reports the path.

The dialog resource doubles both dropdown heights (44->88 and 58->116
DLU) so about six rows are visible instead of three.

Builds: Debug x64 server. Not runtime-tested against a live client.

Co-Authored-By: deepseek-flash
This commit is contained in:
yuanyuanxianganddeepseek-flash committed 2026-12-06 21:32:14 +01:00
1 parent 4bc51d2498
commit e265527610
6 files changed
+182 -5

No files matched your search

+14
View File
@@ -283,6 +283,8 @@ protected:
afx_msg void OnRemoteHome();
afx_msg void OnRemoteSearch();
afx_msg void OnRemoteHistory();
afx_msg void OnCbnSelendokLocalPath();
afx_msg void OnCbnSelendokRemotePath();
afx_msg void OnTransferV2ToRemote(); // V2: 本地文件传输到远程
afx_msg void OnTransferV2ToLocal(); // V2: 远程文件传输到本地
//}}AFX_MSG
@@ -324,6 +326,18 @@ private:
static void PushTransferHistory(bool bLocal, uint64_t clientID, const CString& path);
void RecordTransferHistory();
// 历史传输目录同时反映到路径下拉框:打开对话框/回到驱动器列表时追加到列表尾部,
// 用户选中的下拉项直接跳转(CBN_SELENDOK),原有“当前目录在顶部、输入路径回车跳转”不变。
void AppendTransferHistoryToCombo(bool bLocal);
void SetCurrentPathInCombo(bool bLocal, const CString& path);
// 远程列目录失败恢复:新客户端报 TOKEN_FILE_LIST_ERROR 后还会补一个 1 字节的
// 兼容空列表,必须吞掉;失败时回到最近一次成功列出的目录,避免上传/新建落到
// 已失效的路径上。
CString m_LastGoodRemotePath;
bool m_bIgnoreLegacyEmptyList = false;
DWORD m_dwIgnoreLegacyUntil = 0;
// 获取有效的客户端ID(优先用 m_ClientID,否则通过 IP 找主连接)
uint64_t GetClientID() const;
public: