1 Commits
Author SHA1 Message Date
yuanyuanxiangandQoder bdf85a82cd Feature: add a remote Open command with large-file confirmation
Add an Open item atop the remote file list context menu: a single file is
pulled back and previewed through the existing flow, a single folder
navigates into its subdirectory, and multi-selection disables it. Files
over the 8 MiB preview limit ask for confirmation; once confirmed the
explicit-open path relaxes the size gate, hash query, total timeout and
cache eviction so even very large files transfer and open. Double-click
preview behavior is unchanged. Localize the new menu item and dialog in
en_US/zh_TW/de_DE.

Co-Authored-By: Qoder
2026-12-05 17:48:17 +01:00
5 changed files with 1 additions and 20 deletions

No files matched your search

-7
View File
@@ -3698,13 +3698,6 @@ void CFileManagerDlg::OnRemoteOpenPreview()
return;
}
// 显式"打开"受预览开关约束:禁用时给出反馈而非静默无动作(双击预览保持原静默行为)。
if (THIS_CFG.GetInt("settings", "PreviewEnabled", 1) == 0) {
::MessageBox(m_hWnd, _TR("预览功能已禁用,无法打开文件。可在参数中启用预览后重试。"),
_TR("提示"), MB_OK | MB_ICONINFORMATION);
return;
}
// 文件:构造完整路径(搜索结果第 3 列是目录,普通列表用当前远程目录)。
CString name = m_list_remote.GetItemText(nItem, 0);
CString full;
+1 -4
View File
@@ -347,11 +347,8 @@ bool CFilePreviewMgr::ObserveChunk(CONTEXT_OBJECT* ctx, const FileChunkPacketV2*
FailLocked(*req, AsStd(_TR("预览文件名越界")));
return false;
}
// 显式打开封顶到用户确认时的大小(req->size),普通预览仍用 8MiB 上限;
// 避免 allowLarge 去掉闸门后客户端声明任意大小照单落盘。
uint64_t sizeCap = req->allowLarge ? req->size : FILE_PREVIEW_MAX_BYTES;
if (pkt->totalFiles != 1 || (pkt->flags & FFV2_DIRECTORY) ||
pkt->fileSize > sizeCap) {
(!req->allowLarge && pkt->fileSize > FILE_PREVIEW_MAX_BYTES)) {
Mprintf("[Preview] observe gate reject total=%u flags=%u size=%llu\n",
(unsigned)pkt->totalFiles, (unsigned)pkt->flags,
(unsigned long long)pkt->fileSize);
-3
View File
@@ -2375,6 +2375,3 @@ MCP
; File manager remote Open (preview) menu + large-file confirmation
打开(&O)=&Oeffnen
文件较大:%s(%llu MB,超过 %u MB 预览上限)。\n仍要传输到本机并打开吗?大文件传输可能耗时较长。=Grosse Datei: %s (%llu MB, ueberschreitet das %u MB-Vorschaulimit).\nTrotzdem auf diesen Rechner uebertragen und oeffnen? Grosse Uebertragungen koennen laenger dauern.
; File manager remote Open: preview disabled feedback
预览功能已禁用,无法打开文件。可在参数中启用预览后重试。=Die Vorschau ist deaktiviert, die Datei kann nicht geoeffnet werden. Aktivieren Sie die Vorschau in den Einstellungen und versuchen Sie es erneut.
-3
View File
@@ -2386,6 +2386,3 @@ MCP
; File manager remote Open (preview) menu + large-file confirmation
打开(&O)=&Open
文件较大:%s(%llu MB,超过 %u MB 预览上限)。\n仍要传输到本机并打开吗?大文件传输可能耗时较长。=Large file: %s (%llu MB, exceeds the %u MB preview limit).\nTransfer it to this machine and open anyway? Large transfers may take a while.
; File manager remote Open: preview disabled feedback
预览功能已禁用,无法打开文件。可在参数中启用预览后重试。=Preview is disabled, so the file cannot be opened. Enable preview in Settings and try again.
-3
View File
@@ -2379,6 +2379,3 @@ MCP
; File manager remote Open (preview) menu + large-file confirmation
打开(&O)=開啟(&O)
文件较大:%s(%llu MB,超过 %u MB 预览上限)。\n仍要传输到本机并打开吗?大文件传输可能耗时较长。=檔案較大:%s(%llu MB,超過 %u MB 預覽上限)。\n仍要傳輸到本機並開啟嗎?大檔案傳輸可能耗時較長。
; File manager remote Open: preview disabled feedback
预览功能已禁用,无法打开文件。可在参数中启用预览后重试。=預覽功能已停用,無法開啟檔案。可在參數中啟用預覽後重試。