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
This commit is contained in:
1 parent
ee20326bbf
commit
bdf85a82cd
8 files changed
+94
-18
No files matched your search
@@ -82,7 +82,7 @@ public:
|
||||
const std::string& remotePath, const std::string& basename,
|
||||
uint64_t size, uint64_t mtimeMs, const std::string& sha256,
|
||||
HWND notifyHwnd, std::string& outPath, std::string& error,
|
||||
std::string* outSha = nullptr);
|
||||
std::string* outSha = nullptr, bool allowLarge = false);
|
||||
|
||||
// UI 线程:对话框关闭时放弃本窗口的所有预览请求。
|
||||
void CancelForHwnd(HWND hwnd);
|
||||
@@ -131,6 +131,7 @@ private:
|
||||
uint64_t transferID = 0;
|
||||
uint64_t size = 0;
|
||||
uint64_t mtimeMs = 0;
|
||||
bool allowLarge = false; // 显式"打开":放宽大小闸门/总超时,并保护本次缓存不被淘汰
|
||||
std::string clientKey;
|
||||
std::string clientDir;
|
||||
std::string remotePath;
|
||||
@@ -156,6 +157,7 @@ private:
|
||||
std::string recvName;
|
||||
uint64_t size = 0;
|
||||
uint64_t mtimeMs = 0;
|
||||
bool allowLarge = false;
|
||||
std::string requestedSha;
|
||||
std::string packetSha;
|
||||
HWND notifyHwnd = nullptr;
|
||||
@@ -192,7 +194,8 @@ private:
|
||||
const std::vector<Meta>& index,
|
||||
const std::string& remotePath);
|
||||
static bool WriteEmptyFile(const std::string& path);
|
||||
static void EnforceCacheLimits(const std::string& clientDir, std::vector<Meta>& index);
|
||||
static void EnforceCacheLimits(const std::string& clientDir, std::vector<Meta>& index,
|
||||
const std::string& protectName = std::string());
|
||||
static bool MoveOrCopy(const std::string& from, const std::string& to);
|
||||
static void RemoveTempDir(const std::string& tempDir);
|
||||
|
||||
|
||||
Reference in new issue
Block a user