From 663441f635ab8d40d84107a8c0c4f826e29131b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 9 Apr 2026 09:22:46 +0200 Subject: [PATCH 001/710] [codex] Fix bitmap.h comments (#372) --- src/bitmap.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bitmap.h b/src/bitmap.h index 9eed653ec..99e8a9e9d 100644 --- a/src/bitmap.h +++ b/src/bitmap.h @@ -45,8 +45,8 @@ class CBitmap // will be compatible with the screen BOOL ReCreateForScreenDC(int width = -1, int height = -1); - // enlarges the bitmap to desired size; if the bitmap is large enough already, it won't - // be shrinked - just returns TRUE + // enlarges the bitmap to the requested size; if the bitmap is already large enough, + // it does not shrink it and only returns TRUE BOOL Enlarge(int width, int height); // returns TRUE, if the bitmap needs to be enlarged BOOL NeedEnlarge(int width, int height); From 1bfac2f0abafae70e8cbbbed71a41b33bcb0e24d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 9 Apr 2026 09:38:55 +0200 Subject: [PATCH 002/710] [translation] Fix bitmap.cpp comments (#373) --- src/bitmap.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bitmap.cpp b/src/bitmap.cpp index 89ae82875..35c15b0d7 100644 --- a/src/bitmap.cpp +++ b/src/bitmap.cpp @@ -219,8 +219,8 @@ BOOL CBitmap::Enlarge(int width, int height) if (Height > height) height = Height; // try to create a larger bitmap - // !CAUTION! Sal 2.5b6 was slow when painting to Viewer (PgDn) compared to 2.0 - // Caused by creating the cache with CreateBitmap() instead of CreateCompatibleBitmap() + // !CAUTION! Sal 2.5b6 was slow when painting in Viewer (PgDn) compared to 2.0 + // This was caused by creating the cache with CreateBitmap() instead of CreateCompatibleBitmap() // According to MSDN, CreateBitmap() should only be used for B&W bitmaps. HBITMAP hTmpBmp; if (HMemDC == NULL || BlackAndWhite) From 3e7e8f166104441171b622555d58bd20f5061c9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 9 Apr 2026 10:03:20 +0200 Subject: [PATCH 003/710] [translation] Fix cache.h comments (#374) --- src/cache.h | 225 ++++++++++++++++++++++++++-------------------------- 1 file changed, 114 insertions(+), 111 deletions(-) diff --git a/src/cache.h b/src/cache.h index 43737b1d2..6c321ba79 100644 --- a/src/cache.h +++ b/src/cache.h @@ -4,7 +4,7 @@ #pragma once -// disck cache initialization, returns success +// initializes the disk cache, returns success BOOL InitializeDiskCache(); // how long time to wait between checking the state of watched objects @@ -52,7 +52,7 @@ class CCacheData // tmp-name, info about file or directory on disk, internal use CQuadWord Size; // tmp-file size (in bytes) int LastAccess; // "time" of last access to the tmp-file (for cache - remove the oldest) BOOL Detached; // TRUE => the tmp-file should not be deleted - BOOL OutOfDate; // TRUE => once possible, we acquire a new copy (as if it's not on disk) + BOOL OutOfDate; // TRUE => obtain a new copy as soon as possible (as if it were not on disk) BOOL OwnDelete; // FALSE = delete the tmp-file using DeleteFile(), TRUE = delete using DeleteManager (the plugin OwnDeletePlugin deletes) CPluginInterfaceAbstract* OwnDeletePlugin; // plugin interface, which should delete the tmp-file (NULL = the plugin is unloaded, the tmp-file should not be deleted) @@ -64,7 +64,7 @@ class CCacheData // tmp-name, info about file or directory on disk, internal use // returns the set size of the tmp-file CQuadWord GetSize() { return Size; } - // returns TRUE if the tmp-file is deleted by the plugin 'ownDeletePlugin' + // returns TRUE if this tmp-file should be deleted by plugin 'ownDeletePlugin' BOOL IsDeletedByPlugin(CPluginInterfaceAbstract* ownDeletePlugin) { return OwnDelete && OwnDeletePlugin == ownDeletePlugin; @@ -73,7 +73,7 @@ class CCacheData // tmp-name, info about file or directory on disk, internal use // returns "time" of last access to the tmp-file int GetLastAccess() { return LastAccess; } - // cancels tmp-file on disk, returns success (Name is not on disk anymore) + // removes the temporary file from disk, returns success (Name is no longer on disk) BOOL CleanFromDisk(); // did the object initialization succeeded? @@ -104,25 +104,25 @@ class CCacheData // tmp-name, info about file or directory on disk, internal use // for description see CDiskCache::NamePrepared() BOOL NamePrepared(const CQuadWord& size); - // for description see CDiskCache::AssignName() + // see CDiskCache::AssignName() for a description // - // handles - object for watching the 'lock' object + // handles - object for tracking 'lock' objects BOOL AssignName(CCacheHandles* handles, HANDLE lock, BOOL lockOwner, CCacheRemoveType remove); - // for description see CDiskCache::ReleaseName() + // see CDiskCache::ReleaseName() for a description // - // lastLock - pointer to BOOL, which is set to TRUE if there are no links to the tmp-file anymore + // lastLock - pointer to a BOOL that is set to TRUE if there are no more links to the tmp-file BOOL ReleaseName(BOOL* lastLock, BOOL storeInCache); // returns the full name of the tmp-file const char* GetTmpName() { return TmpName; } - // detaches the object 'lock' (in "signaled" state) from the tmp-file (detaches the link) + // detaches the 'lock' object (in the "signaled" state) from the tmp-file (detaches the link) // // returns success // - // lock - object, which is in "signaled" state - // lastLock - pointer to BOOL, which is set to TRUE if there are no links to the tmp-file anymore + // lock - object that has entered the "signaled" state + // lastLock - pointer to a BOOL that is set to TRUE if there are no more links to the tmp-file BOOL WaitSatisfied(HANDLE lock, BOOL* lastLock); // if we change our mind about deleting the tmp-file on disk (e.g. it was not possible to pack it, @@ -139,10 +139,10 @@ class CCacheData // tmp-name, info about file or directory on disk, internal use // returns item identification (path to original) const char* GetName() { return Name; } - // performs premature deletion of the tmp-file, which is deleted by the plugin 'ownDeletePlugin'; - // used when unloading the plugin (the tmp-file is marked as deleted - once all links are closed, - // deletion won't occur); if 'onlyDetach' is TRUE, the tmp-file is not deleted, it's only marked - // as deleted (the plugin is detached from the tmp-file) + // performs premature deletion of the tmp-file if it is deleted by the plugin + // 'ownDeletePlugin'; used when unloading the plugin (the tmp-file is marked as deleted, + // so once all references to it are closed, no deletion occurs); if 'onlyDetach' is TRUE, + // the tmp-file is not deleted and is only marked as deleted (the plugin is detached from the tmp-file) void PrematureDeleteByPlugin(CPluginInterfaceAbstract* ownDeletePlugin, BOOL onlyDetach); }; @@ -168,12 +168,12 @@ class CCacheDirData // tmp-directory, contains unique tmp-names, internal use // (finishing of TEMP cleaning - see CDiskCache::RemoveEmptyTmpDirsOnlyFromDisk()) void RemoveEmptyTmpDirsOnlyFromDisk(); - // returns TRUE if the tmp-directory contains 'tmpName' (name of file/directory on disk) + // returns TRUE if the tmp-directory contains 'tmpName' (the name of a file/directory on disk) // rootTmpPath - path where to place the tmp-directory with the tmp-file (must not be NULL) - // rootTmpPathLen - length of the string in rootTmpPath - // canContainThisName - must not be NULL, returns TRUE in it if it's possible to place - // the tmp-file into this tmp-directory (matches tmp-root + there's - // no file with DOS-name equal to 'tmpName') + // rootTmpPathLen - length of the rootTmpPath string + // canContainThisName - must not be NULL; set to TRUE if it is possible to place + // the tmp-file into this tmp-directory (it matches tmp-root and + // contains no file with a DOS name equal to 'tmpName') BOOL ContainTmpName(const char* tmpName, const char* rootTmpPath, int rootTmpPathLen, BOOL* canContainThisName); @@ -199,64 +199,64 @@ class CCacheDirData // tmp-directory, contains unique tmp-names, internal use const char* GetName(const char* name, const char* tmpName, BOOL* exists, BOOL ownDelete, CPluginInterfaceAbstract* ownDeletePlugin, int* errorCode); - // searches for 'name' in the tmp-directory; if it's found, returns TRUE and 'ret' is set to return value - // CDiskCache::NamePrepared(name, size); if it's not found, returns FALSE - // for description see CDiskCache::NamePrepared() + // searches for 'name' in the tmp-directory; if found, returns TRUE and 'ret' is set to the return value of + // CDiskCache::NamePrepared(name, size); if not found, returns FALSE + // see CDiskCache::NamePrepared() for a description BOOL NamePrepared(const char* name, const CQuadWord& size, BOOL* ret); - // searches for 'name' in the tmp-directory; if it's found, returns TRUE and 'ret' is set to return value - // CDiskCache::AssignName(name, lock, lockOwner, remove); if it's not found, returns FALSE - // for description see CDiskCache::AssignName() + // searches for 'name' in the tmp-directory; if found, returns TRUE and 'ret' is set to the return value of + // CDiskCache::AssignName(name, lock, lockOwner, remove); if not found, returns FALSE + // see CDiskCache::AssignName() for a description // - // handles - object for watching the 'lock' object + // handles - object for tracking 'lock' objects BOOL AssignName(CCacheHandles* handles, const char* name, HANDLE lock, BOOL lockOwner, CCacheRemoveType remove, BOOL* ret); - // searches for 'name' in the tmp-directory; if it's found, returns TRUE and 'ret' is set to return value - // CDiskCache::ReleaseName(name); if it's not found, returns FALSE - // for description see CDiskCache::ReleaseName() + // searches for 'name' in the tmp directory; if found, returns TRUE and 'ret' is set to the return value of + // CDiskCache::ReleaseName(name); if not found, returns FALSE + // for a description, see CDiskCache::ReleaseName() // - // lastCached - pointer to BOOL, which is set to TRUE if this is the last link to the cached tmp-file, - // or if it's necessary to decide about its further existence + // lastCached - pointer to BOOL that is set to TRUE if this is the last link to the cached tmp file, + // i.e. if its further existence must be decided BOOL ReleaseName(const char* name, BOOL* ret, BOOL* lastCached, BOOL storeInCache); - // searches for 'data' in the tmp-directory; if it's found, returns TRUE and cancels tmp-file 'data'; - // if it's not found, returns FALSE + // searches for 'data' in the tmp directory; if found, returns TRUE and removes the tmp file 'data'; + // if not found, returns FALSE // - // data - tmp-file + // data - tmp file BOOL Release(CCacheData* data); // sum of sizes of tmp-files in the tmp-directory CQuadWord GetSizeOfFiles(); - // fills the array 'victArr' with cached tmp-files without any link (WARNING: it doesn't sort from the oldest to the newest) + // fills the array 'victArr' with cached orphaned tmp files (WARNING: not sorted from oldest to newest) void AddVictimsToArray(TDirectArray& victArr); // if we change our mind about deleting the tmp-file on disk (e.g. it was not possible to pack it // so we leave it in temp, so that the users don't kill us) BOOL DetachTmpFile(const char* tmpName); - // removes all cached tmp-files beginning with 'name' (e.g. all files from one archive) - // opened files will be marked as out-of-date, so that they will be restored when used again - // (the current copy remains, so that the viewers don't yell at us) + // removes all cached files whose names start with 'name' (e.g. all files from one archive) + // open files are marked as out-of-date so they are refreshed on next use + // (the current copy remains so viewers do not complain) void FlushCache(const char* name); - // removes cached file 'name'; the opened file will be marked as out-of-date, so that it will be - // restored when used again (the current copy remains, so that the viewers don't yell at us); - // returns TRUE if the file was found and removed + // removes cached file 'name'; the open file is marked as out-of-date so it is refreshed on next use + // (the current copy remains so viewers are not disrupted); returns TRUE + // if the file was found and removed BOOL FlushOneFile(const char* name); - // search for the name in the array Names; returns TRUE if 'name' was found (returns also where - 'index'); - // returns FALSE if 'name' is not in Names (returns also where it could be inserted - 'index') + // searches for the name in the Names array; returns TRUE if 'name' is found (and also returns its position in 'index'); + // returns FALSE if 'name' is not in Names (and also returns the insertion position in 'index') BOOL GetNameIndex(const char* name, int& index); // counts how many tmp-files are contained in tmp-directory, which are deleted by the plugin 'ownDeletePlugin' int CountNamesDeletedByPlugin(CPluginInterfaceAbstract* ownDeletePlugin); - // performs premature deletion of all tmp-files, which are deleted by the plugin 'ownDeletePlugin'; - // used when unloading the plugin (the tmp-file is marked as deleted - once all links are closed, - // deletion won't occur); if 'onlyDetach' is TRUE, it is not deleted, it's only marked - // as deleted (the plugin is detached from the tmp-file) + // performs premature deletion of all tmp-files deleted by the plugin + // 'ownDeletePlugin'; used when unloading the plugin (the tmp-files are marked as deleted, + // so once all references to them are closed, no deletion occurs); if 'onlyDetach' is TRUE, + // they are not deleted and are only marked as deleted (the plugin is detached from the tmp-files) void PrematureDeleteByPlugin(CPluginInterfaceAbstract* ownDeletePlugin, BOOL onlyDetach); }; @@ -333,7 +333,7 @@ class CCacheHandles class CDiskCache // assigns names for tmp-files { // object is synchronized - monitor protected: - CRITICAL_SECTION Monitor; // section used for synchronization of this object (behavior - monitor) + CRITICAL_SECTION Monitor; // critical section used to synchronize this object (monitor behavior) CRITICAL_SECTION WaitForIdleCS; // section used for synchronization of calling WaitForIdle() TDirectArray Dirs; // list of tmp-directories, type of item (CCacheDirData *) CCacheHandles Handles; // object, which watches the 'lock' objects @@ -349,81 +349,83 @@ class CDiskCache // assigns names for tmp-files // (e.g. Encrypt plugin has its own) after previous call of PrematureDeleteByPlugin()) void RemoveEmptyTmpDirsOnlyFromDisk(); - // returns success of object initialization + // returns whether object initialization succeeded BOOL IsGood() { return Handles.IsGood() && Dirs.IsGood(); } - // tries to find 'name' in cache; if it's found, waits until the tmp-file is prepared + // tries to find 'name' in the cache; if found, waits until the tmp-file is prepared // (e.g. downloaded from FTP), then returns the tmp-file name and sets 'exists' to TRUE; - // if it's found, but the tmp-file was deleted from disk, returns the tmp-file name and - // 'exists' to FALSE, in this case it's necessary to prepare the tmp-file again and then - // call NamePrepared(); if 'tmpName' is NULL, only find 'name' in cache (don't create new - // tmp-file); if 'onlyAdd' is TRUE, only add to cache (if the tmp-file exists, returns - // error; if the tmp-file was deleted from disk, restoring it is considered as adding, - // so in this case it doesn't return error); if it's not found and 'tmpName' is not NULL, - // creates a new name for the tmp-file, returns it immediately and sets 'exists' to FALSE, - // in this case it's necessary to call NamePrepared() when the tmp-file is prepared (e.g. - // downloaded from FTP) and then the tmp-file will be available to other threads; - // WARNING: it's necessary to call AssignName() or ReleaseName() + // if found but the tmp-file was deleted from disk, returns the tmp-file name and sets + // 'exists' to FALSE; in that case the tmp-file must be prepared again and then + // NamePrepared() must be called; if 'tmpName' is NULL, only look up 'name' in the cache + // (do not create a new tmp-file); if 'onlyAdd' is TRUE, only add to the cache (if the + // tmp-file already exists, the call fails; if someone deleted the tmp-file directly + // from disk, restoring it is treated as adding, so in that case no error is returned); + // if not found and 'tmpName' is not NULL, creates a new name for the tmp-file, + // returns it immediately and sets 'exists' to FALSE; in that case, when the tmp-file is + // prepared (e.g. downloaded from FTP), NamePrepared() must be called so that the file + // becomes available to other threads; + // WARNING: AssignName() or ReleaseName() must be called // - // return value NULL -> "fatal error" ('exists' is TRUE) or in case 'tmpName' is NULL - // "not found" ('exists' is FALSE), and in case 'onlyAdd' is TRUE - // "file already exists" ('exists' is FALSE) + // return value NULL -> "fatal error" ('exists' is TRUE) or, if 'tmpName' is NULL, + // "not found" ('exists' is FALSE), and if 'onlyAdd' is TRUE, + // "file already exists" ('exists' is FALSE) // - // name - unique item identification - // tmpName - required name of the tmp-file or directory, a tmp-directory will be selected + // name - unique item identifier + // tmpName - requested name of the tmp-file or directory; a tmp-directory will be selected // for it - // exists - pointer to BOOL, which is set per the description above - // onlyAdd - if it is TRUE, it is possible to create only a new name (if the name exists, - // returns NULL) or restore a deleted tmp-file (the name exists, but the tmp-file - // is not prepared) - // - // rootTmpPath - if NULL, the tmp-directory with the tmp-file should be placed into TEMP, otherwise - // it's the path where to place the tmp-directory with the tmp-file - // ownDelete - if FALSE, tmp-files should be deleted using DeleteFile(), otherwise using - // DeleteManager (deletion using plugin - see ownDeletePlugin) - // ownDeletePlugin - if ownDelete is TRUE, contains iface of the plugin, which should delete - // the tmp-file - // errorCode - if not NULL and an error occurs, its code is returned in this variable (for codes - // see DCGNE_XXX) + // exists - pointer to a BOOL set as described above + // onlyAdd - if TRUE, only a new name can be created (if the name already exists, + // returns NULL) or a deleted tmp-file can be restored (the name exists, but the + // tmp-file is not prepared) + // rootTmpPath - if NULL, the tmp-directory with the tmp-file should be placed in TEMP; + // otherwise this is the path where the tmp-directory with the tmp-file + // should be placed + // ownDelete - if FALSE, tmp-files should be deleted using DeleteFile(); otherwise they + // should be deleted by DeleteManager (plugin-based deletion - see + // ownDeletePlugin) + // ownDeletePlugin - if ownDelete is TRUE, contains the plugin interface that deletes the + // tmp-file + // errorCode - if not NULL and an error occurs, its code is returned in this variable (for + // codes see DCGNE_XXX) const char* GetName(const char* name, const char* tmpName, BOOL* exists, BOOL onlyAdd, const char* rootTmpPath, BOOL ownDelete, CPluginInterfaceAbstract* ownDeletePlugin, int* errorCode); - // selects tmp-file related to 'name' for a valid one, provides it to other threads, + // marks the tmp-file corresponding to 'name' as valid and makes it available to other threads; // can be called only after GetName() returns 'exists' == FALSE // // returns success // - // name - unique item identification + // name - unique item identifier // size - number of bytes occupied by the tmp-file on disk BOOL NamePrepared(const char* name, const CQuadWord& size); - // assigns system object to the acquired tmp-file, using 'lock' the minimal lifetime - // of the tmp-file is controlled (depends on 'remove') - // can be called only in pair with GetName() + // assigns a system object to the acquired tmp-file; 'lock' controls the minimum + // lifetime of the tmp-file (depends on 'remove') + // can only be called together with GetName() // // returns success // - // name - unique item identification (later for searching) - // lock - when this object is "signaled", it will be possible to "release" the tmp-file + // name - unique item identifier (used later for searching) + // lock - when this object is "signaled", the tmp-file can be "released" // (depends on 'remove') - // lockOwner - should the cache take care of calling CloseHandle(lock) ? + // lockOwner - should the cache take care of calling CloseHandle(lock)? // remove - when to delete the tmp-file BOOL AssignName(const char* name, HANDLE lock, BOOL lockOwner, CCacheRemoveType remove); - // only called when after calling GetName() it is not possible to call NamePrepared() or AssignName() - // it's present for the case of error when acquiring tmp-file or system object 'lock' - // (running application for which the tmp-file was acquired) - // in case that it was necessary to call NamePrepared(), it gives other threads the possibility - // to create tmp-file (which are waiting until the tmp-file is prepared), in case that it was - // necessary to call AssignName(), it cancels the tmp-file "waiting" for the system object 'lock', - // tmp-file cancellation can occur only if 'storeInCache' is TRUE, tmp-file is prepared and - // not locked, the tmp-file is marked as cached (if the maximum capacity of cache allows it, - // it won't be deleted) + // called only when NamePrepared() or AssignName() cannot be called after GetName(); + // used for errors while acquiring the tmp-file or the 'lock' object (the launched + // application for which the tmp-file was being acquired) + // if NamePrepared() would have to be called, gives other threads a chance to create the + // tmp-file (those waiting until the tmp-file is prepared); if AssignName() would have to + // be called, cancels the tmp-file's waiting state for assignment of the 'lock' object, and the + // tmp-file may be deleted; if 'storeInCache' is TRUE and the tmp-file is prepared and not + // locked, it is marked as cached (if the maximum cache capacity allows it, it will not be + // deleted) // // returns success // - // name - unique item identification (later for searching) + // name - item identifier (used later for lookup) BOOL ReleaseName(const char* name, BOOL storeInCache); // waits for the moment when the cache-handles are "free", it's useful when mass @@ -449,10 +451,11 @@ class CDiskCache // assigns names for tmp-files // counts how many tmp-files are contained in disk-cache, which are deleted by the plugin 'ownDeletePlugin' int CountNamesDeletedByPlugin(CPluginInterfaceAbstract* ownDeletePlugin); - // performs premature deletion of all tmp-files, which are deleted by the plugin 'ownDeletePlugin'; - // used when unloading the plugin (the tmp-file is marked as deleted - once all links are closed, - // deletion won't occur); if 'onlyDetach' is TRUE, it is not deleted, it's only marked - // as deleted (the plugin is detached from the tmp-file) + // Performs early deletion of all temporary files deleted by the 'ownDeletePlugin' + // plugin; used when unloading the plugin (the temporary files are marked as + // already deleted, so once all references to them are closed, no further deletion + // occurs); if 'onlyDetach' is TRUE, they are not deleted and are only marked as + // already deleted (the plugin is detached from the temporary files). void PrematureDeleteByPlugin(CPluginInterfaceAbstract* ownDeletePlugin, BOOL onlyDetach); // the TEMP directory clean-up from the rest of previous instances; called only by the first instance @@ -503,18 +506,18 @@ class CDeleteManager // data about the files that are to be deleted (in the main thread by calling the method // CPluginInterfaceForArchiverAbstract::DeleteTmpCopy of the plugin) TIndirectArray Data; - BOOL WaitingForProcessing; // TRUE = message to the main window is on the way or the data - // processing is in progress (the added item will be processed immediately) + BOOL WaitingForProcessing; // TRUE = a message to the main window is pending or data + // processing is already in progress (the added item is processed immediately) BOOL BlockDataProcessing; // TRUE = do not process data (ProcessData() does nothing) public: CDeleteManager(); ~CDeleteManager(); - // adds file for deletion and ensures the closest call of the method - // CPluginInterfaceForArchiverAbstract::DeleteTmpCopy for file deletion; - // in case of error, the file won't be deleted - the plugin should delete its - // directory when loading/unloading (TEMP will be cleaned by Salamander) + // adds a file for deletion and ensures that the plugin method + // CPluginInterfaceForArchiverAbstract::DeleteTmpCopy is called as soon as possible + // to delete the file; if an error occurs, the file is not deleted; the plugin should clean up its + // directory on unload/load (TEMP will be cleaned by Salamander) // can be called from any thread void AddFile(const char* fileName, CPluginInterfaceAbstract* plugin); @@ -522,14 +525,14 @@ class CDeleteManager // processing of new data - deleting files in plugins void ProcessData(); - // unloading of the plugin imminent: let the plugin which is being unloaded delete tmp-copies from disk + // plugin 'plugin' may be unloaded: let it delete temporary copies from disk // (see CPluginInterfaceForArchiverAbstract::PrematureDeleteTmpCopy) void PluginMayBeUnloaded(HWND parent, CPluginData* plugin); - // unload of the plugin finished: detach the plugin from delete-manager and disk-cache; - // 'unloadedPlugin' is already invalid plugin interface (backup before unload) + // plugin 'plugin' has been unloaded: detach it from the delete-manager and disk-cache; + // 'unloadedPlugin' is already an invalid plugin interface saved before unload void PluginWasUnloaded(CPluginData* plugin, CPluginInterfaceAbstract* unloadedPlugin); }; extern CDiskCache DiskCache; // global disk-cache -extern CDeleteManager DeleteManager; // global disk-cache delete-manager (deleting tmp-files in archivers plugins) +extern CDeleteManager DeleteManager; // global disk-cache delete-manager (for deleting tmp-files in archiver plugins) From 4e1c4f282870571094c1f23496cd2cb9814d2ece Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 9 Apr 2026 10:36:45 +0200 Subject: [PATCH 004/710] [tanslation] Fix src/cache.cpp comments (#375) --- src/cache.cpp | 102 +++++++++++++++++++++++++------------------------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/src/cache.cpp b/src/cache.cpp index 6b8e74011..f060e2ca9 100644 --- a/src/cache.cpp +++ b/src/cache.cpp @@ -56,7 +56,7 @@ CCacheData::CCacheData(const char* name, const char* tmpName, BOOL ownDelete, CCacheData::~CCacheData() { - if (TmpName != NULL && LockObject.Count == 0) // tmp-file not needed anymore + if (TmpName != NULL && LockObject.Count == 0) // tmp-file is no longer needed { if (!CleanFromDisk()) { @@ -97,7 +97,7 @@ CCacheData::~CCacheData() BOOL CCacheData::CleanFromDisk() { CALL_STACK_MESSAGE1("CCacheData::CleanFromDisk"); - if (!Detached) // user does not wish to delete tmp-file + if (!Detached) // the user does not want the tmp-file deleted { if (!OwnDelete) { @@ -126,7 +126,7 @@ BOOL CCacheData::CleanFromDisk() } else // deletion should be handled by the plugin { - if (OwnDeletePlugin != NULL) // we can start deleting (plugin can't be unloaded), otherwise the file + if (OwnDeletePlugin != NULL) // we can start deleting (the plugin cannot be unloaded); otherwise the file will not be deleted { // won't be deleted (it's either already deleted or it's just // disconnected - the plugin decides this during its unload DeleteManager.AddFile(TmpName, OwnDeletePlugin); @@ -156,17 +156,17 @@ CCacheData::GetName(CDiskCache* monitor, BOOL* exists, BOOL canBlock, BOOL onlyA else { res = WaitForSingleObject(Preparing, 0); // no waiting - if (res == WAIT_TIMEOUT) // the file is being prepared, we won't wait + if (res == WAIT_TIMEOUT) // the file is being prepared; do not wait { NewCount--; *exists = FALSE; if (errorCode != NULL) *errorCode = onlyAdd ? DCGNE_ALREADYEXISTS : DCGNE_NOTFOUND; - return NULL; // "not found" error, and if 'onlyAdd' is TRUE, then also "file already exists" + return NULL; // "not found" error, and if 'onlyAdd' is TRUE, also "file already exists" } } - if (res == WAIT_OBJECT_0) // tmp-file is ready or we are allowed to prepare it (the one who calls GetName) + if (res == WAIT_OBJECT_0) // tmp-file is ready or we are allowed to prepare it ourselves (the caller of GetName) { if (Prepared) // tmp-file is ready { @@ -195,7 +195,7 @@ CCacheData::GetName(CDiskCache* monitor, BOOL* exists, BOOL canBlock, BOOL onlyA } else { - ReleaseMutex(Preparing); // providing a message about readiness to other threads + ReleaseMutex(Preparing); // signal readiness to the other threads if (onlyAdd) { NewCount--; @@ -217,7 +217,7 @@ CCacheData::GetName(CDiskCache* monitor, BOOL* exists, BOOL canBlock, BOOL onlyA // tmp-file is not ready, the owning thread has been terminated // mutex Preparing is ours (either via WAIT_OBJECT_0 or WAIT_ABANDONED) *exists = FALSE; - if (!CleanFromDisk()) // name change is needed, the original tmp-file probably remained open + if (!CleanFromDisk()) // a name change is needed; the original tmp-file probably remained open { TRACE_E("Unable to delete tmp-file."); } @@ -271,10 +271,10 @@ BOOL CCacheData::ReleaseName(BOOL* lastLock, BOOL storeInCache) if (!Prepared) ReleaseMutex(Preparing); // if we're preparing tmp-file, we give up by this *lastLock = IsLocked(); - if (*lastLock && Prepared && storeInCache && !OutOfDate) // only the prepared file can remaing in cache + if (*lastLock && Prepared && storeInCache && !OutOfDate) // only a prepared file can remain in the cache { Cached = TRUE; // we mark the file as cached, otherwise disk-cache would cancel it immediately - LastAccess = LastAccessCounter++; // the last 'lock', it's in a tight spot (we set the time of the last usage) + LastAccess = LastAccessCounter++; // the last 'lock' is at risk (we update the last-use time) } return TRUE; } @@ -294,7 +294,7 @@ BOOL CCacheData::WaitSatisfied(HANDLE lock, BOOL* lastLock) LockObjOwner.Delete(i); *lastLock = IsLocked(); if (*lastLock) - LastAccess = LastAccessCounter++; // the last 'lock', it's in a tight spot + LastAccess = LastAccessCounter++; // the last 'lock' is gone, so the file is now at risk return TRUE; } } @@ -310,8 +310,8 @@ void CCacheData::PrematureDeleteByPlugin(CPluginInterfaceAbstract* ownDeletePlug CALL_STACK_MESSAGE2("CCacheData::PrematureDeleteByPlugin(, %d)", onlyDetach); if (Detached) onlyDetach = TRUE; - if (OwnDelete && // deleting should be taken care by a plugin - OwnDeletePlugin == ownDeletePlugin) // we're searching for this tmp-file (The plugin 'ownDeletePlugin' deletes it) + if (OwnDelete && // deletion should be handled by the plugin + OwnDeletePlugin == ownDeletePlugin) // searching for this tmp file (the plugin 'ownDeletePlugin' deletes it) { if (!onlyDetach) DeleteManager.AddFile(TmpName, OwnDeletePlugin); @@ -364,7 +364,7 @@ BOOL CCacheDirData::ContainTmpName(const char* tmpName, const char* rootTmpPath, s++; while (*s != 0 && *s != '\\') s++; - if (*s == 0 || *(s + 1) == 0) // // after the root-tmp-path, there's only one subdirectory name (possibly with '\\' at the end) + if (*s == 0 || *(s + 1) == 0) // after the root tmp path, there is only one subdirectory name left (possibly with a trailing '\\') { *canContainThisName = TRUE; // tmp-root matches, tmp-file can be placed here @@ -388,14 +388,14 @@ BOOL CCacheDirData::ContainTmpName(const char* tmpName, const char* rootTmpPath, if (StrICmp(tmpName, data.cFileName) == 0) { TRACE_E("CCacheDirData::ContainTmpName(): unexpected situation: tmp-directory contains unknown file!"); - *canContainThisName = FALSE; // the file can't be placed here, a foreign file would be opened + *canContainThisName = FALSE; // the file cannot be placed here; another file would be opened } else { if (data.cAlternateFileName[0] != 0 && StrICmp(tmpName, data.cAlternateFileName) == 0) { TRACE_I("CCacheDirData::ContainTmpName(): tmp-directory contains file whose dos-name conflicts with new tmp-file - different tmp-directory has to be choosen!"); - *canContainThisName = FALSE; // the file can't be placed here, an existing file with the same dos-name would be opened + *canContainThisName = FALSE; // the file cannot be placed here; an existing file with the same DOS name would be opened } } } @@ -470,7 +470,7 @@ void CCacheDirData::RemoveEmptyTmpDirsOnlyFromDisk() if (PathLength > 0) Path[PathLength - 1] = 0; // backslash trimming SetFileAttributes(Path, FILE_ATTRIBUTE_ARCHIVE); - // the system deletes our tmp-directory only if it's empty (in case of further need for a tmp-directory, we will create it in CCacheDirData::GetName()) + // the system deletes our tmp directory only if it is empty (if a tmp directory is needed again, we create it in CCacheDirData::GetName()) RemoveDirectory(Path); if (PathLength > 0) Path[PathLength - 1] = '\\'; // restoring backslash @@ -486,8 +486,8 @@ BOOL CCacheDirData::GetName(CDiskCache* monitor, const char* name, BOOL* exists, if (GetNameIndex(name, i)) // 'name' found at index 'i' { *tmpPath = Names[i]->GetName(monitor, exists, canBlock, onlyAdd, errorCode); - if (*tmpPath != NULL) // not a fatal error nor an unprepared tmp-file - { // nor a "file already exists" error (only if 'onlyAdd' is TRUE) + if (*tmpPath != NULL) // neither a fatal error nor an unprepared tmp file + { // not a "file already exists" error either (only if 'onlyAdd' is TRUE) CheckAndCreateDirectory(Path, NULL, TRUE); } return TRUE; @@ -520,7 +520,7 @@ CCacheDirData::GetName(const char* name, const char* tmpName, BOOL* exists, BOOL return NULL; } int i; - if (GetNameIndex(name, i)) // error: inserted name is unique - it can't be in the array yet + if (GetNameIndex(name, i)) // error: the inserted name is unique, so it cannot already be in the array { TRACE_E("This should never happen!"); } @@ -582,7 +582,7 @@ BOOL CCacheDirData::ReleaseName(const char* name, BOOL* ret, BOOL* lastCached, B BOOL last; *ret = Names[i]->ReleaseName(&last, storeInCache); *lastCached = FALSE; - if (last) // contemporarily, this was also the last link to this tmp-file + if (last) // this was also the last link to this tmp-file { if (Names[i]->IsCached()) *lastCached = TRUE; @@ -602,7 +602,7 @@ BOOL CCacheDirData::Release(CCacheData* data) CALL_STACK_MESSAGE1("CCacheDirData::Release()"); int i; if (GetNameIndex(data->GetName(), i)) // 'data' found at index 'i' - { // we took advantage of the fact that the name is unique, so that Names[i] == data + { // we rely on the name being unique, so Names[i] must equal data #ifdef _DEBUG if (Names[i] != data) { @@ -652,7 +652,7 @@ BOOL CCacheDirData::DetachTmpFile(const char* tmpName) int i; for (i = 0; i < Names.Count; i++) { - if (StrICmp(Names[i]->GetTmpName() + PathLength, tmpName + PathLength) == 0) // we've got it + if (StrICmp(Names[i]->GetTmpName() + PathLength, tmpName + PathLength) == 0) // found it { Names[i]->DetachTmpFile(); return TRUE; @@ -667,9 +667,9 @@ void CCacheDirData::FlushCache(const char* name) int nameLen = (int)strlen(name); int i; GetNameIndex(name, i); // we'll find the index (match/insertion) from which it makes sense to search for the same prefixes - for (; i < Names.Count; i++) // names are sorted -> elements with the same prefix are continuously next to each other + for (; i < Names.Count; i++) // names are sorted -> elements with the same prefix are contiguous { - if (strncmp(Names[i]->GetName(), name, nameLen) == 0) // mame ho + if (strncmp(Names[i]->GetName(), name, nameLen) == 0) // match found { CCacheData* data = Names[i]; if (data->IsLocked()) @@ -687,7 +687,7 @@ void CCacheDirData::FlushCache(const char* name) } } else - break; // there can't be any other, we are finished + break; // there cannot be any more, stop here } } @@ -736,7 +736,7 @@ unsigned ThreadCacheHandlesBody(void* param) int index; handles->WaitForObjects(&handle, &owner, &index); CALL_STACK_MESSAGE1("ThreadCacheHandlesBody::WaitForObjects_end"); - if (handle == handles->Terminate) // we should end + if (handle == handles->Terminate) // we should terminate { break; } @@ -757,7 +757,7 @@ unsigned ThreadCacheHandlesBody(void* param) if (handle == handles->TestIdle) // WaitForIdle unblocked WaitForObjects (we can ignore it) { } - else // someone from outside changed the state of 'handle' to "signaled" (e.g. the application ended) + else // the state of 'handle' was changed to "signaled" externally (e.g. the application terminated) { if (handle != NULL && owner != NULL) handles->WaitSatisfied(handle, owner, index); @@ -871,7 +871,7 @@ void CCacheHandles::Destroy() SetEvent(Terminate); // "you should end now" if (WaitForSingleObject(Thread, 1000) == WAIT_TIMEOUT) // let's give it 1 second { - TerminateThread(Thread, 666); // it doesn't want to end, we will kill it + TerminateThread(Thread, 666); // if it does not want to terminate, kill it WaitForSingleObject(Thread, INFINITE); // we will wait until the thread really ends, sometimes it takes a while } HANDLES(CloseHandle(Thread)); @@ -930,7 +930,7 @@ void CCacheHandles::WaitForObjects(HANDLE* handle, CCacheData** owner, int* inde while (1) { if (Idle == 1) - Idle = 2; // it is asking, we will find out + Idle = 2; // querying; will determine int offset; for (offset = 0; offset < Handles.Count;) { @@ -948,7 +948,7 @@ void CCacheHandles::WaitForObjects(HANDLE* handle, CCacheData** owner, int* inde GetErrorText(err), offset, count, Handles.Count); #ifndef CALLSTK_DISABLE int i; - for (i = 0; i < count; i++) // this is a little bit dirty ... + for (i = 0; i < count; i++) // somewhat of a hack ... { #if (defined(_DEBUG) || defined(CALLSTK_MEASURETIMES)) && !defined(CALLSTK_DISABLEMEASURETIMES) new CCallStackMessage(TRUE, 0, "handle %d: %p", i, (((HANDLE*)Handles.GetData()) + offset)[i]); @@ -983,7 +983,7 @@ void CCacheHandles::WaitForObjects(HANDLE* handle, CCacheData** owner, int* inde *handle = (HANDLE)Handles[*index]; *owner = Owners[*index]; if (Idle == 2) - Idle = 1; // a formality: answer "no", but it asked, so it will ask again + Idle = 1; // formality: answer "no", but since it asked, it asks again return; } } @@ -1128,8 +1128,8 @@ CDiskCache::GetName(const char* name, const char* tmpName, BOOL* exists, BOOL on const char* tmpPath; if (Dirs[i]->GetName(this, name, exists, &tmpPath, tmpName != NULL && !onlyAdd, onlyAdd, errorCode)) - { // 'name' found; if 'tmpName' is NULL, it can be an unprepared tmp-file (it returns 'not found' error) - // if 'onlyAdd' is TRUE, it can be a "file already exists" error + { // 'name' found; if 'tmpName' is NULL, the name may still refer to an unprepared file (returns a "not found" error) + // if 'onlyAdd' is TRUE, it may instead be a "file already exists" error Leave(); return tmpPath; } @@ -1269,7 +1269,7 @@ BOOL CDiskCache::ReleaseName(const char* name, BOOL storeInCache) BOOL lastCached; if (Dirs[i]->ReleaseName(name, &ret, &lastCached, storeInCache)) // 'name' found { - if (lastCached) // tmp-file is without links and cached, we will see if we need + if (lastCached) // The tmp-file is orphaned and cached; we will see whether it already needs to be released. { // to release it, or if we need to release space on disk CheckCachedFiles(); } @@ -1317,7 +1317,7 @@ void CDiskCache::CheckCachedFiles() int i; for (i = 0; i < Dirs.Count; i++) size += Dirs[i]->GetSizeOfFiles(); - if (size > MAX_CACHE_SIZE) // it is needed to delete some files + if (size > MAX_CACHE_SIZE) // some files need to be deleted { TDirectArray victArr(100, 50); for (i = 0; i < Dirs.Count; i++) @@ -1336,10 +1336,10 @@ void CDiskCache::CheckCachedFiles() { CCacheData* data = victArr[actVict++]; size -= data->GetSize(); // subtract its size from the total size of cache - for (i = 0; i < Dirs.Count; i++) // release it from cache and from disk + for (i = 0; i < Dirs.Count; i++) // release it from the cache and from disk { if (Dirs[i]->Release(data)) - break; // found and cancelled + break; // found and removed } } else @@ -1357,10 +1357,10 @@ void CDiskCache::WaitSatisfied(HANDLE lock, CCacheData* owner) BOOL last; if (owner->WaitSatisfied(lock, &last)) { - if (last) // tmp-file is without links, we can cancel it + if (last) // the tmp-file has no more links; we can cancel it { - if (owner->IsCached()) // we will see if we need to release it, - { // or we will free space on disk + if (owner->IsCached()) // see if we already need to free some space + { // and free up disk space if needed CheckCachedFiles(); } else // we should delete the file directly @@ -1383,7 +1383,7 @@ void CDiskCache::WaitSatisfied(HANDLE lock, CCacheData* owner) return; } Leave(); - return; // an error in owner->WaitSatisfied() + return; // error in owner->WaitSatisfied() } BOOL CDiskCache::DetachTmpFile(const char* tmpName) @@ -1462,7 +1462,7 @@ void CDiskCache::ClearTEMPIfNeeded(HWND parent, HWND hActivePanel) { SalPathAddBackslash(tmpDir, 2 * MAX_PATH); char* tmpDirEnd = tmpDir + strlen(tmpDir); - if (SalPathAppend(tmpDir, "SAL*.tmp", 2 * MAX_PATH)) // we will add a mask (it won't fit = no sense in searching anything) + if (SalPathAppend(tmpDir, "SAL*.tmp", 2 * MAX_PATH)) // append the mask (if it does not fit, there is no point in searching) { TIndirectArray tmpDirs(10, 50); @@ -1478,7 +1478,7 @@ void CDiskCache::ClearTEMPIfNeeded(HWND parent, HWND hActivePanel) while (*s != 0 && *s != '.' && (*s >= '0' && *s <= '9' || *s >= 'a' && *s <= 'f' || *s >= 'A' && *s <= 'F')) s++; - if (StrICmp(s, ".tmp") == 0) // matches "SAL" + hex-number + ".tmp" = it's almost certainly our directory + if (StrICmp(s, ".tmp") == 0) // matches "SAL" + hex number + ".tmp"; it is almost certainly our directory { char* tmp = DupStr(data.cFileName); if (tmp != NULL) @@ -1618,18 +1618,18 @@ void CDeleteManager::ProcessData() HANDLES(EnterCriticalSection(&CS)); if (Data.Count > 0) { - item = Data[0]; // we will select the oldest item (it can't be NULL) + item = Data[0]; // select the oldest item (cannot be NULL) Data.Detach(0); if (!Data.IsGood()) - Data.ResetState(); // the element has been detached, and it doesn't matter if the array is larger + Data.ResetState(); // the element has been detached, and a larger array does not matter } else WaitingForProcessing = FALSE; // we are finishing processing HANDLES(LeaveCriticalSection(&CS)); if (item == NULL) - break; // the end of data processing + break; // end of data processing - // the beginning of the processing of new data + // process new data if (lastFoundPlugin == NULL || lastFoundPlugin != item->Plugin) { plugin = Plugins.GetPluginData(item->Plugin); @@ -1659,7 +1659,7 @@ void CDeleteManager::PluginMayBeUnloaded(HWND parent, CPluginData* plugin) SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_NORMAL); HANDLES(EnterCriticalSection(&CS)); - if (WaitingForProcessing) // message is on its way, we will cancel it, it is unnecessary, at the end of the method data processing will take place + if (WaitingForProcessing) // The message is already pending, so cancel it; it is unnecessary because the data will be processed at the end of the method. { if (MainWindow != NULL && MainWindow->HWindow != NULL) { @@ -1670,10 +1670,10 @@ void CDeleteManager::PluginMayBeUnloaded(HWND parent, CPluginData* plugin) } } else - WaitingForProcessing = TRUE; // we will block sending WM_USER_PROCESSDELETEMAN - undesirable and unnecessary, data processing will take place at the end of the method + WaitingForProcessing = TRUE; // Block sending WM_USER_PROCESSDELETEMAN: it is undesirable and unnecessary; data will be processed at the end of the method HANDLES(LeaveCriticalSection(&CS)); - BlockDataProcessing = TRUE; // // in case we missed a WM_TIMER message posted to the main window (we block it, because it can be delivered by the first displayed messagebox and its message loop) + BlockDataProcessing = TRUE; // in case we missed a WM_TIMER posted to the main window (we block it because it can be delivered by the first displayed message box and its message loop) int copiesCount = DiskCache.CountNamesDeletedByPlugin(plugin->GetPluginInterface()->GetInterface()); if (copiesCount > 0) // plugin still has some tmp-files opened (and it should ensure their deletion) From 3cc7d8886599e7436d08b3008899168186459283 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 9 Apr 2026 10:45:59 +0200 Subject: [PATCH 005/710] [tanslation] Fix src/drivelst.h comments (#376) --- src/drivelst.h | 47 +++++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/src/drivelst.h b/src/drivelst.h index 030f69392..7b0cc4d37 100644 --- a/src/drivelst.h +++ b/src/drivelst.h @@ -49,8 +49,8 @@ int GetOneDriveStorages(); // CDrivesList // -// WARNING: in CDrivesList::BuildData test "DriveType > drvtRAMDisk" is used, so -// it is necessary to bear this in mind when changing the enum !!! +// WARNING: CDrivesList::BuildData uses the test "DriveType > drvtRAMDisk", so +// this must be taken into account when changing the enum. enum CDriveTypeEnum { @@ -106,19 +106,19 @@ class CDrivesList DWORD_PTR* DriveTypeParam; // x64: the referenced value must be able to hold a pointer, so DWORD_PTR int* PostCmd; // post-cmd for context menu of a FS plugin void** PostCmdParam; // post-cmd-parameter for context menu of a FS plugin - BOOL* FromContextMenu; // set to TRUE if the menu was invoked from a context menu + BOOL* FromContextMenu; // set to TRUE if the menu command was triggered by a context menu char CurrentPath[MAX_PATH]; TDirectArray* Drives; CMenuPopup* MenuPopup; int FocusIndex; // what item from the Drives array should be focused - DWORD CachedDrivesMask; // bit array of drives, which we got during the last BuildData() - DWORD CachedCloudStoragesMask; // bit array of cloud storages, which we got during the last BuildData() + DWORD CachedDrivesMask; // bitmask of drives obtained during the last BuildData() + DWORD CachedCloudStoragesMask; // bitmask of cloud storages obtained during the last BuildData() public: // input: - // driveType = dummy - // driveTypeParam = letter of the drive to activate (or 0 (PluginFS) or '\\' (UNC)) + // driveType = dummy + // driveTypeParam = drive letter to activate (or 0 (PluginFS) or '\\' (UNC)) CDrivesList(CFilesWindow* filesWindow, const char* currentPath, CDriveTypeEnum* driveType, DWORD_PTR* driveTypeParam, int* postCmd, void** postCmdParam, BOOL* fromContextMenu); ~CDrivesList() @@ -141,14 +141,17 @@ class CDrivesList // CM_DRIVEBAR_MIN, otherwise from CM_DRIVEBAR2_MIN BOOL FillDriveBar(CDriveBar* driveBar, BOOL bar2); - // here FilesWindows passes information that user right-clicked on item - // 'posByMouse' says whether we should popup the menu at mouse coordinates or under the selected item; - // 'panel' says which panel is active (it can be also inactive panel when there are two DriveBars - from - // Change Drive menu it is always PANEL_SOURCE, from DriveBars it is PANEL_LEFT or PANEL_RIGHT); - // if 'pluginFSDLLName' is not NULL and we are popping up a context menu for a FS item, it returns the - // name of the plugin DLL (or SPL); returns TRUE if we should execute the command on which the context - // menu was popped up (FALSE does nothing); 'itemIndex' says for which item we are popping up the context - // menu, 'posByMouse' must be TRUE; if 'itemIndex' is -1, the item is taken from the menu + // FilesWindow uses this to pass information that the user right-clicked an item. + // 'posByMouse' specifies whether the menu should be opened at the mouse coordinates or + // under the selected item; 'panel' specifies which panel is involved (with two Drive + // bars, this can also be the inactive panel - from the Change Drive menu it is always + // PANEL_SOURCE, from the Drive bars it is PANEL_LEFT or PANEL_RIGHT); if + // 'pluginFSDLLName' is not NULL and a context menu is being opened for an FS item, the + // plugin DLL name (more precisely, the SPL name) is returned through it; returns TRUE + // if the command for which the context menu was opened should be executed (FALSE does + // nothing); 'itemIndex' specifies for which item the context menu should be opened; + // then 'posByMouse' must be TRUE; if 'itemIndex' is -1, the item is obtained from + // the menu BOOL OnContextMenu(BOOL posByMouse, int itemIndex, int panel, const char** pluginFSDLLName); // A new loading of items into the menu is requested here. It is assumed that the menu is displayed @@ -179,14 +182,14 @@ class CDrivesList // 'index' to its index and returns TRUE, otherwise it returns FALSE BOOL FindPanelPathIndex(CFilesWindow* panel, DWORD* index); - // returns bit array of drives, which we got during the last BuildData() - // if BuildDate() has not been called yet, returns 0 - // can be used for quick detection of any change in the drives + // returns the bitmask of drives obtained during the last BuildData() + // if BuildData() has not been called yet, returns 0 + // can be used to quickly detect drive changes DWORD GetCachedDrivesMask(); - // returns bit array of available cloud storages, which we got during the last BuildData() - // if BuildDate() has not been called yet, returns 0 - // can be used for quick detection of any changes in the availability of cloud storages + // returns the bitmask of available cloud storages obtained during the last BuildData() + // if BuildData() has not been called yet, returns 0 + // can be used to quickly detect changes in cloud storage availability DWORD GetCachedCloudStoragesMask(); TDirectArray* GetDrives() { return Drives; } @@ -223,7 +226,7 @@ struct CNBWNetAC3Thread { if (Thread != NULL) { - AddAuxThread(Thread, TRUE); // thread can run only during shutdown, we will kill it by this + AddAuxThread(Thread, TRUE); // the thread may run only during shutdown; this lets it be terminated Thread = NULL; } if (shutdown) From a43aeaf5ca0885a2ba26ead19f976b2e8b8e2bdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 9 Apr 2026 11:10:31 +0200 Subject: [PATCH 006/710] [tanslation] Fix src/drivelst.cpp comments (#377) --- src/drivelst.cpp | 206 +++++++++++++++++++++++------------------------ 1 file changed, 103 insertions(+), 103 deletions(-) diff --git a/src/drivelst.cpp b/src/drivelst.cpp index 34c7824bc..961520deb 100644 --- a/src/drivelst.cpp +++ b/src/drivelst.cpp @@ -92,7 +92,7 @@ BOOL GetUserName(const char* drive, const char* remoteName, char* userName, DWOR HKEY network; LONG res = HANDLES_Q(RegOpenKeyEx(HKEY_CURRENT_USER, "Network", 0, KEY_READ, &network)); if (res != ERROR_SUCCESS) - return FALSE; // well, nothing ... + return FALSE; // nothing to do ... BOOL ret = FALSE; char keyName[MAX_PATH]; @@ -192,21 +192,21 @@ BOOL NonBlockingWNetAddConnection3(DWORD& err, LPNETRESOURCE lpNetResource, // first all we will wait for the previous "calculation" to finish GetAsyncKeyState(VK_ESCAPE); // init GetAsyncKeyState - see help if (NBWNetAC3Thread.ShutdownArrived) - return FALSE; // soft has already ended, no further action + return FALSE; // the application is already shutting down; no further action if (NBWNetAC3Thread.Thread != NULL) { while (1) { DWORD res = WaitForSingleObject(NBWNetAC3Thread.Thread, 200); if (res == WAIT_FAILED) - return FALSE; // invalid thread handle (closed from outside when ending the soft) + return FALSE; // invalid thread handle (closed externally during application shutdown) if (res != WAIT_TIMEOUT) break; if (UserWantsToCancelSafeWaitWindow()) return FALSE; } if (NBWNetAC3Thread.ShutdownArrived) - return FALSE; // soft has already ended, no further action + return FALSE; // the application is already shutting down; no further action NBWNetAC3Thread.Close(); } @@ -248,7 +248,7 @@ BOOL NonBlockingWNetAddConnection3(DWORD& err, LPNETRESOURCE lpNetResource, { memset(NBWNetAC3ThreadFParams.bufPassword, 0, sizeof(NBWNetAC3ThreadFParams.bufPassword)); TRACE_E("Unable to start add-net-connection-3 thread."); - return FALSE; // error (simulation of ESC) + return FALSE; // error (ESC simulation) } // we will wait for the "calculation" to finish so that we can return the result @@ -256,14 +256,14 @@ BOOL NonBlockingWNetAddConnection3(DWORD& err, LPNETRESOURCE lpNetResource, { DWORD res = WaitForSingleObject(NBWNetAC3Thread.Thread, 200); if (res == WAIT_FAILED) - return FALSE; // invalid thread handle (closed from outside when ending the soft) + return FALSE; // invalid thread handle (closed externally during application shutdown) if (res != WAIT_TIMEOUT) break; if (UserWantsToCancelSafeWaitWindow()) return FALSE; } if (NBWNetAC3Thread.ShutdownArrived) - return FALSE; // soft has already ended, no further action + return FALSE; // the application is already shutting down; no further action NBWNetAC3Thread.Close(); if (errProviderCode != NULL) @@ -297,7 +297,7 @@ BOOL IsLogonFailureErr(DWORD err) err == ERROR_BAD_USERNAME || err == ERROR_NO_SUCH_USER || err == ERROR_DOWNGRADE_DETECTED || - err == ERROR_EXTENDED_ERROR; // who knows what extended error this is, but "password expired" belongs here, so that it's a logon failure (at least user says Cancel) + err == ERROR_EXTENDED_ERROR; // This extended error is not specific, but "password expired" can be reported here, so treat it as a logon failure in general (at worst, the user clicks Cancel). } BOOL IsBadUserNameOrPasswdErr(DWORD err) @@ -434,7 +434,7 @@ typedef WINADVAPI DWORD (WINAPI *FT_CredUIParseUserNameA)( */ #define CREDUI_FLAGS_DO_NOT_PERSIST 0x00002 // Do not show "Save" checkbox, and do not persist credentials -#define CREDUI_FLAGS_EXPECT_CONFIRMATION 0x20000 // do not persist unless caller later confirms credential via CredUIConfirmCredential() api +#define CREDUI_FLAGS_EXPECT_CONFIRMATION 0x20000 // Do not persist unless the caller later confirms the credential via CredUIConfirmCredential() API #define CREDUI_FLAGS_GENERIC_CREDENTIALS 0x40000 // Credential is a generic credential BOOL RestoreNetworkConnection(HWND parent, const char* name, const char* remoteName, DWORD* retErr, LPNETRESOURCE lpNetResource) @@ -488,12 +488,12 @@ BOOL RestoreNetworkConnection(HWND parent, const char* name, const char* remoteN if (end != NULL && *(end + 1) != '\\' && *(end + 1) != 0) { const char* last = strchr(end + 2, '\\'); - if (last == NULL || *(last + 1) == 0) // the own dialog under XP+Vista will be only shown for simple UNC paths: "\\server\share" and "\\server\\share\\" + if (last == NULL || *(last + 1) == 0) // show the custom dialog under XP and Vista only for simple UNC paths: "\\server\share" and "\\server\\share\\" lstrcpyn(serverName, remoteName + 2, (int)min(MAX_PATH, (end - (remoteName + 2)) + 1)); } } - if (name != NULL && // mapped paths only (for the drive letter) + if (name != NULL && // mapped paths only (to a drive letter) GetUserName(name, remoteName, userNameBuf, USERNAME_MAXLEN, providerBuf, MAX_PATH)) // unknown user name for the restored connection { if (userNameBuf[0] != 0) @@ -508,8 +508,8 @@ BOOL RestoreNetworkConnection(HWND parent, const char* name, const char* remoteN DWORD err; char* passwd = NULL; - // XP+Vista: we will dynamically extract functions for getting username+password in the standard dialog (including the option to save to Credential Manager - see "Manage your network passwords" in User Accounts in Control Panel) - // Windows 7: there is a new dialog again and I have not yet discovered the interface for it + // XP+Vista: load functions dynamically to obtain the username and password in the standard dialog (including the option to save them to Credential Manager; see "Manage your network passwords" in User Accounts in Control Panel) + // Windows 7: uses a new dialog again, and no interface for it has been found yet HMODULE credUIDLL = !Windows7AndLater ? HANDLES(LoadLibrary("CREDUI.DLL")) : NULL; FT_CredUIPromptForCredentialsA credUIPromptForCredentialsA = NULL; FT_CredUIConfirmCredentialsA credUIConfirmCredentialsA = NULL; @@ -530,7 +530,7 @@ BOOL RestoreNetworkConnection(HWND parent, const char* name, const char* remoteN } BOOL connectInteractive = FALSE; // TRUE: Windows 7 always, XP+Vista only if CREDUI.DLL is not available or it is not a simple UNC path: we will use the CONNECT_INTERACTIVE flag (can do with "network passwords") and therefore the blocking call WNetAddConnection3 (must be in the same thread with the parent) - BOOL confirmCred = FALSE; // TRUE: calling CredUIConfirmCredentialsA is needed + BOOL confirmCred = FALSE; // TRUE: CredUIConfirmCredentialsA must be called // char domain[DOMAIN_MAXLEN]; CREDUI_INFOA uiInfo = {0}; @@ -544,7 +544,7 @@ BOOL RestoreNetworkConnection(HWND parent, const char* name, const char* remoteN if (name == NULL) // mapping UNC paths to "none" { - if (!Windows7AndLater && // there's a new dialog again on Windows 7 and I haven't found the interface for it yet + if (!Windows7AndLater && // Windows 7 uses a new dialog again, and no interface for it has been found yet credUIPromptForCredentialsA != NULL && credUIConfirmCredentialsA != NULL /*&& credUIParseUserNameA != NULL*/ && serverName[0] != 0) // own dialog for entering username+password we will show only for simple UNC paths (\\server\share), we will leave DFS and others to the system { @@ -558,30 +558,30 @@ BOOL RestoreNetworkConnection(HWND parent, const char* name, const char* remoteN else { if (lpNetResource == NULL) - UpdateWindow(MainWindow->HWindow); // doesn't make sense to use from nethood - if (err == NO_ERROR) // user confirmed with OK + UpdateWindow(MainWindow->HWindow); // not useful from Network Neighborhood + if (err == NO_ERROR) // user clicked OK { confirmCred = TRUE; lstrcpyn(userNameBuf, dlg.User, USERNAME_MAXLEN); userName = userNameBuf; passwd = dlg.Passwd; - /* // there was a problem with trimming the domain from the username, they just couldn't log in because we made their domain name local - if (credUIParseUserNameA(dlg.User, userNameBuf, USERNAME_MAXLEN, domain, DOMAIN_MAXLEN) == NO_ERROR) - { - confirmCred = TRUE; - userName = userNameBuf; - passwd = dlg.Passwd; - } - else - { - TRACE_E("RestoreNetworkConnection(): CredUIParseUserNameA failed for: " << dlg.User); - userNameBuf[0] = 0; - userName = NULL; - credUIConfirmCredentialsA(serverName, FALSE); - connectInteractive = TRUE; // another error, let the system variant deal with it - err = ERROR_BAD_USERNAME; - } -*/ + /* // there was a problem with stripping the domain from the username; users could not log in because we converted their domain username into a local one + if (credUIParseUserNameA(dlg.User, userNameBuf, USERNAME_MAXLEN, domain, DOMAIN_MAXLEN) == NO_ERROR) + { + confirmCred = TRUE; + userName = userNameBuf; + passwd = dlg.Passwd; + } + else + { + TRACE_E("RestoreNetworkConnection(): CredUIParseUserNameA failed for: " << dlg.User); + userNameBuf[0] = 0; + userName = NULL; + credUIConfirmCredentialsA(serverName, FALSE); + connectInteractive = TRUE; // another error, let the system implementation handle it + err = ERROR_BAD_USERNAME; + } + */ } else connectInteractive = TRUE; // another error, let the system variant deal with it @@ -715,7 +715,7 @@ BOOL RestoreNetworkConnection(HWND parent, const char* name, const char* remoteN } BOOL newConnectInteractive = FALSE; - if (!Windows7AndLater && // there's a new dialog again on Windows 7 and I haven't found the interface for it yet + if (!Windows7AndLater && // Windows 7 uses a new dialog again, and no interface for it has been found yet credUIPromptForCredentialsA != NULL && credUIConfirmCredentialsA != NULL /*&& credUIParseUserNameA != NULL*/ && serverName[0] != 0) // own dialog for entering username+password we will show only for simple UNC paths (\\server\share), we will leave DFS and others to the system { @@ -731,7 +731,7 @@ BOOL RestoreNetworkConnection(HWND parent, const char* name, const char* remoteN else { if (lpNetResource == NULL) - UpdateWindow(MainWindow->HWindow); // doesn't make sense to use from nethood + UpdateWindow(MainWindow->HWindow); // not meaningful when used from Network Neighborhood if (err == NO_ERROR) // user confirmed with OK { if (name == NULL) @@ -773,7 +773,7 @@ BOOL RestoreNetworkConnection(HWND parent, const char* name, const char* remoteN if (newConnectInteractive) { - if (!connectInteractive) // let's try an interactive mode only if we haven't used it already (a defense against an infinite cycle) + if (!connectInteractive) // try interactive mode only if it has not been used already (to prevent an infinite loop) { connectInteractive = TRUE; continue; @@ -826,7 +826,7 @@ BOOL CheckAndRestoreNetworkConnection(HWND parent, const char drive, BOOL& pathI GetNetworkDrives(netDrives, netRemotePath); - if (netDrives & (1 << (LowerCase[drive] - 'a'))) // disk existed, try to restore + if (netDrives & (1 << (LowerCase[drive] - 'a'))) // the drive existed, try to restore it { char name[4] = " :"; name[0] = drive; @@ -864,7 +864,7 @@ BOOL CheckAndConnectUNCNetworkPath(HWND parent, const char* UNCPath, BOOL& pathI CALL_STACK_MESSAGE3("CheckAndConnectUNCNetworkPath(, %s, , %d)", UNCPath, donotReconnect); pathInvalid = FALSE; if (!IsUNCPath(UNCPath) || UNCPath[2] == '?') - return FALSE; // no basic format UNC path + return FALSE; // not a UNC path in the basic format char root[MAX_PATH + 4]; char* s = root + GetRootPath(root, UNCPath); @@ -876,13 +876,13 @@ BOOL CheckAndConnectUNCNetworkPath(HWND parent, const char* UNCPath, BOOL& pathI { // UNC root path is accessible, we will not do anything HANDLES(FindClose(h)); } - else // UNC root of the path is not listable + else // the UNC root path cannot be listed { *(s - 1) = 0; // we will trim the backslash at the end of the root path DWORD err = GetLastError(); BOOL trySharepoint = err == ERROR_BAD_NET_NAME; // try to call shell when error 67 occurs, so that it can make the path accessible if (!donotReconnect && - (err == ERROR_FILE_NOT_FOUND || err == ERROR_PATH_NOT_FOUND)) // on XP, this error is returned if the user does not have access to the server or the share does not exist on the server, to distinguish these two errors, we call WNetAddConnection3 + (err == ERROR_FILE_NOT_FOUND || err == ERROR_PATH_NOT_FOUND)) // on XP, this error is returned if the user does not have access to the server or if the share does not exist on the server; to distinguish between the two, we call WNetAddConnection3 { NETRESOURCE ns; ns.dwType = RESOURCETYPE_DISK; @@ -893,15 +893,15 @@ BOOL CheckAndConnectUNCNetworkPath(HWND parent, const char* UNCPath, BOOL& pathI err = ERROR_PATH_NOT_FOUND; // ESC } - if (IsLogonFailureErr(err) || // a defense against e.g. "no files found" + if (IsLogonFailureErr(err) || // protection against errors such as "no files found" IsAdminShareExtraLogonFailureErr(err, root)) { if (donotReconnect) pathInvalid = TRUE; // we report the error directly else { - // Petr: I commented out, Explorer or TC do not show any error before displaying the dialog for entering user + password; besides - // we now show a new error after trying to establish a connection (so that the user finds out that he has an expired password, etc.) + // Petr: commented out. Explorer and TC do not show any error before displaying the user name and password dialog; moreover, + // the error is now shown only after an attempt to establish a connection, so the user learns about an expired password, etc. // SalMessageBox(parent, GetErrorText(err), LoadStr(IDS_NETWORKERROR), // MB_OK | MB_ICONEXCLAMATION); @@ -911,7 +911,7 @@ BOOL CheckAndConnectUNCNetworkPath(HWND parent, const char* UNCPath, BOOL& pathI } else { - if (trySharepoint) // we will try to call shell when error 67 occurs, so that it can make the path accessible + if (trySharepoint) // if error 67 occurs, try calling the shell to make the path accessible { SHFILEINFO fi; if (SHGetFileInfoAux(UNCPath, 0, &fi, sizeof(fi), SHGFI_ATTRIBUTES)) @@ -931,7 +931,7 @@ BOOL CheckAndConnectUNCNetworkPath(HWND parent, const char* UNCPath, BOOL& pathI It returns 350 if the drive is a 3.5" floppy drive. It returns 525 if the drive is a 5.25" floppy drive. - It returns 800 if the drive is a 8" floppy drive. + It returns 800 if the drive is an 8" floppy drive. It returns 1 if the drive supports removable media other than 3.5", 5.25", and 8" floppies. It returns 0 on error. @@ -1027,7 +1027,7 @@ void DisplayMenuAux(IContextMenu2* contextMenu, CMINVOKECOMMANDINFO* ici) void DisplayMenuAux2(IContextMenu2* contextMenu, HMENU h) { CALL_STACK_MESSAGE_NONE - // temporary lower the thread priority so that some confused shell extension doesn't eat our CPU + // temporarily lower the thread priority so that some confused shell extension does not eat all the CPU HANDLE hThread = GetCurrentThread(); // pseudo-handle, no need to release int oldThreadPriority = GetThreadPriority(hThread); SetThreadPriority(hThread, THREAD_PRIORITY_NORMAL); @@ -1090,7 +1090,7 @@ CDrivesList::OwnGetDriveType(const char* rootPath) case DRIVE_REMOVABLE: ret = drvtRemovable; break; - case DRIVE_NO_ROOT_DIR: // subst of which the directory was deleted (can also be remote, but we don't care about that) + case DRIVE_NO_ROOT_DIR: // subst drive whose directory was deleted (it can also be remote, but we ignore that) case DRIVE_FIXED: ret = drvtFixed; break; @@ -1148,7 +1148,7 @@ unsigned ReadCDVolNameThreadFBody(void* param) // directory accessibility test DWORD dummy; char fileSystem[11]; if (!GetVolumeInformation(root, buf, MAX_PATH, NULL, &dummy, &dummy, fileSystem, 10)) - buf[0] = 0; // error GetVolumeInformation + buf[0] = 0; // GetVolumeInformation failed if (buf[0] == 0) GetDisplayNameFromSystem(root, buf, MAX_PATH); @@ -1240,7 +1240,7 @@ int GetIndexForDrvText(CPluginFSInterfaceEncapsulation** fsList, int count, { CPluginFSInterfaceEncapsulation* fs = NULL; int z; - for (z = 0; z < count; z++) // found encapsulation FS (if there is a lack of memory, the indexes in fsList and Drives (from the firstFSIndex offset) may not match) + for (z = 0; z < count; z++) // found FS encapsulation (if memory runs low, the indexes in fsList and Drives may not match from firstFSIndex onward) { if (fsList[z]->GetInterface() == fsIface) { @@ -1258,8 +1258,8 @@ int GetIndexForDrvText(CPluginFSInterfaceEncapsulation** fsList, int count, return currentIndex; } -// based on 'hSrcIcon' creates a black and white version of the icon -// WARNING, SLOW, use with caution +// creates a black-and-white version of the icon from 'hSrcIcon' +// WARNING: slow; use with caution HICON ConvertIcon16x16ToGray(HICON hSrcIcon) { CIconList il; @@ -1356,7 +1356,7 @@ void InitDropboxPath() if (hFile != INVALID_HANDLE_VALUE) { LARGE_INTEGER size; - if (GetFileSizeEx(hFile, &size) && size.QuadPart < 100000) // 100KB is enough for a stupid config file + if (GetFileSizeEx(hFile, &size) && size.QuadPart < 100000) // 100 KB is more than enough for a config file { char* buf = (char*)malloc(size.LowPart); DWORD read; @@ -1373,7 +1373,7 @@ void InitDropboxPath() char* secRowEnd = secRow; while (secRowEnd < end && *secRowEnd != '\r' && *secRowEnd != '\n') secRowEnd++; - if (secRow < secRowEnd) // I have a text 2. rows, where the base64 encoded searched path is + if (secRow < secRowEnd) // second line text containing the target path encoded in Base64 { int pathLen; if (base64_decode(secRow, (int)(secRowEnd - secRow), &pathLen, "Dropbox path: ")) @@ -1460,7 +1460,7 @@ BOOL COneDriveBusinessStorages::Find(const char* displayName, const char** userF void InitOneDrivePath() { - OneDrivePath[0] = 0; // we find out the path to OneDrive over and over again, because after the commend "Unlink OneDrive" (from OneDrive) we should stop showing it + OneDrivePath[0] = 0; // The OneDrive path is resolved every time, because after the "Unlink OneDrive" command in OneDrive, it should no longer be shown. BOOL done = FALSE; if (WindowsVistaAndLater) // SHGetKnownFolderPath has existed since Vista @@ -1476,11 +1476,11 @@ void InitOneDrivePath() PWSTR path = NULL; if (DynSHGetKnownFolderPath(my_FOLDERID_SkyDrive, 0, NULL, &path) == S_OK && path != NULL) { - if (path[0] != 0) // FOLDERID_SkyDrive was introduced in Windows 8.1 = we should not need to hunt it in the registry + if (path[0] != 0) // FOLDERID_SkyDrive was introduced in Windows 8.1, so it should not be necessary to look it up in the registry { done = ConvertU2A(path, -1, OneDrivePath, _countof(OneDrivePath)) != 0; if (!done) - OneDrivePath[0] = 0; // just for sync + OneDrivePath[0] = 0; // just to be safe //else TRACE_I("OneDrive path (FOLDERID_SkyDrive): " << OneDrivePath); } CoTaskMemFree(path); @@ -1524,7 +1524,7 @@ void InitOneDrivePath() if (RegEnumKeyEx(hKey, i, keyName, &keyNameLen, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) { // opening the account key HKEY hAccount; - if (StrICmp(keyName, "Personal") != 0 && // we don't want to read personal account here (see OneDrivePath) + if (StrICmp(keyName, "Personal") != 0 && // do not read the personal account here (see OneDrivePath) HANDLES_Q(RegOpenKeyEx(hKey, keyName, 0, KEY_READ, &hAccount)) == ERROR_SUCCESS) { // we read all accounts except Personal (for now only "Business???", where ??? is a number) char disp[ONEDRIVE_MAXBUSINESSDISPLAYNAME]; @@ -1536,7 +1536,7 @@ void InitOneDrivePath() size = sizeof(path); // size in bytes if (SalRegQueryValueEx(hAccount, "UserFolder", 0, &type, (BYTE*)path, &size) == ERROR_SUCCESS && type == REG_SZ && size > 1) - { // we will collect everything that has DisplayName and UserFolder, no matter what it is, we will offer it to the user under "OneDrive" + { // Collect everything that has DisplayName and UserFolder and offer it to the user as "OneDrive" //TRACE_I("OneDrive Business: DisplayName: " << disp << ", UserFolder: " << path); OneDriveBusinessStorages.SortIn(new COneDriveBusinessStorage(DupStr(disp), DupStr(path))); } @@ -1545,7 +1545,7 @@ void InitOneDrivePath() } } else - break; // end of enumeration (can also be a small buffer, but I don't consider it reasonable to handle) + break; // end of enumeration (this can also mean the buffer is too small, but handling that is not considered worthwhile) i++; } HANDLES(RegCloseKey(hKey)); @@ -1561,7 +1561,7 @@ void CDrivesList::AddToDrives(CDriveData& drv, int textResId, char hotkey, CDriv BOOL getGrayIcons, HICON icon, BOOL destroyIcon, const char* itemText) { const char* s = itemText != NULL ? itemText : LoadStr(textResId); - // WARNING: for drvtOneDriveBus, DisplayName is later taken from drv.DriveText, when changing the text format, change it !!! + // WARNING: for drvtOneDriveBus, DisplayName is later taken from drv.DriveText; if the text format changes, update this accordingly char* txt = (char*)malloc(1 + (hotkey == 0 ? 0 : 1) + strlen(s) + 1); strcpy(txt, hotkey == 0 ? "\t" : " \t"); if (hotkey != 0) @@ -1610,11 +1610,11 @@ BOOL CDrivesList::BuildData(BOOL noTimeout, TDirectArray* copyDrives ZeroMemory(&drvSeparator, sizeof(drvSeparator)); drvSeparator.DriveType = drvtSeparator; - if (copyDrives != NULL) // optimization: data is just copied (e.g. it's the second Drives Bar, so we copy the data from the first Drives Bar, for which we got it from the system a few ms ago) + if (copyDrives != NULL) // optimization: the data is simply copied (e.g. this is the second Drives Bar, so we copy it from the first Drives Bar; we retrieved that data from the system a few ms ago) { CachedDrivesMask = copyCachedDrivesMask; - // I will add drives a..z + // Add drives A..Z int lastDiskDrv = -1; int x; for (x = 0; x < copyDrives->Count; x++) @@ -1672,11 +1672,11 @@ BOOL CDrivesList::BuildData(BOOL noTimeout, TDirectArray* copyDrives CQuadWord freeSpace; // how much space we have on the disk - Shares.PrepareSearch(""); // now we will search for drives roots + Shares.PrepareSearch(""); // now we will look for drive roots - BOOL separateNextDrive = FALSE; // before we insert drive, should we insert separator? + BOOL separateNextDrive = FALSE; // before inserting the drive, should we insert a separator? - // I will add drives a..z + // Add drives A..Z while (i != 0) { if (!(noDrivesPolicy & i) && ((mask & i) || (netDrives & i))) // disk is accessible @@ -1853,8 +1853,8 @@ BOOL CDrivesList::BuildData(BOOL noTimeout, TDirectArray* copyDrives // we separate drives that the user wanted to separate if (separateNextDrive && Drives->Count > 0 && !IsLastItemSeparator()) Drives->Add(drvSeparator); - // if there's no drive A or B in the system and the user has set the separator after A or B, we've shown it after C - // that's why we have to drop the flag in any case, not just in the previous condition + // if there is no drive A or B in the system and the user has set the separator after A or B, we displayed it after C + // therefore we have to clear the flag in every case, not just in the previous condition separateNextDrive = FALSE; int index = Drives->Add(drv); @@ -1956,7 +1956,7 @@ BOOL CDrivesList::BuildData(BOOL noTimeout, TDirectArray* copyDrives drv.DLLName = NULL; // just for sure int iconSize = GetIconSizeForSystemDPI(ICONSIZE_16); - // I will add the separator if it is not the first item and if there is no separator yet + // add a separator if this is not the first item and there is not one already if (Drives->Count > 0 && !IsLastItemSeparator()) Drives->Add(drvSeparator); @@ -1967,11 +1967,11 @@ BOOL CDrivesList::BuildData(BOOL noTimeout, TDirectArray* copyDrives SalLoadIcon(ImageResDLL, 112, iconSize)); } - // adding Cloud Storages (Google Drive, etc.), if I find any... + // Add cloud storages (Google Drive, etc.) if any are found CachedCloudStoragesMask = 0; if (Configuration.ChangeDriveCloudStorage) { - CSQLite3DynLoadBase* sqlite3_Dyn_InOut = NULL; // I somewhat expected that sqlite3 will be needed for Dropbox, too, which eventually did not happen (so this is here just in case) + CSQLite3DynLoadBase* sqlite3_Dyn_InOut = NULL; // sqlite3 was expected to be needed for Dropbox too, but that turned out not to be the case, so this is kept here just in case ShellIconOverlays.InitGoogleDrivePath(&sqlite3_Dyn_InOut, TRUE); if (ShellIconOverlays.HasGoogleDrivePath()) { @@ -1999,7 +1999,7 @@ BOOL CDrivesList::BuildData(BOOL noTimeout, TDirectArray* copyDrives char itemText[200 + ONEDRIVE_MAXBUSINESSDISPLAYNAME]; HICON oneDriveIco = c == 0 ? NULL : SalLoadIcon(HInstance, IDI_ONEDRIVE, iconSize); BOOL destroyOneDriveIco = oneDriveIco != NULL; - if (forDriveBar && c > 1) // data for drive-bar && more storages = let the user choose from the menu (drop down) + if (forDriveBar && c > 1) // data for the drive bar when there are multiple storages = let the user choose from the menu (drop-down) { strcpy_s(itemText, LoadStr(IDS_ONEDRIVE)); AddToDrives(drv, 0, 0, drvtOneDriveMenu, getGrayIcons, oneDriveIco, destroyOneDriveIco, itemText); @@ -2016,8 +2016,8 @@ BOOL CDrivesList::BuildData(BOOL noTimeout, TDirectArray* copyDrives AddToDrives(drv, 0, 0, drvtOneDrive, getGrayIcons, oneDriveIco, destroyOneDriveIco, itemText); destroyOneDriveIco = FALSE; } - for (int i = 0; i < OneDriveBusinessStorages.Count; i++) // business - { // WARNING: for drvtOneDriveBus, DisplayName is later taken from drv.DriveText, when changing the text format, change it !!! + for (int i = 0; i < OneDriveBusinessStorages.Count; i++) // business storages + { // WARNING: For drvtOneDriveBus, DisplayName is later taken from drv.DriveText; if the text format changes, update this too. sprintf_s(itemText, "%s - %s", LoadStr(IDS_ONEDRIVE), OneDriveBusinessStorages[i]->DisplayName); AddToDrives(drv, 0, 0, drvtOneDriveBus, getGrayIcons, oneDriveIco, destroyOneDriveIco, itemText); destroyOneDriveIco = FALSE; @@ -2041,7 +2041,7 @@ BOOL CDrivesList::BuildData(BOOL noTimeout, TDirectArray* copyDrives neighborhoodIndex = Drives->Count - 1; } - // adding FS commands from all plug-ins + // adding FS commands from all plugins if (!Plugins.AddItemsToChangeDrvMenu(this, currentFSIndex, FilesWindow->GetPluginFS()->GetPluginInterfaceForFS()->GetInterface(), getGrayIcons)) @@ -2049,7 +2049,7 @@ BOOL CDrivesList::BuildData(BOOL noTimeout, TDirectArray* copyDrives return FALSE; } - // finding the index of the Nethood plug-in and setting it to neighborhoodIndex (we represent the Network item with everything) + // find the index of the Nethood plugin and store it in neighborhoodIndex (we fully represent the Network item) if (existsNethoodPlugin && nethoodPlugin != NULL && neighborhoodIndex == -1) { int i2; @@ -2120,13 +2120,13 @@ BOOL CDrivesList::BuildData(BOOL noTimeout, TDirectArray* copyDrives { BOOL destroyIcon; HICON icon = panel->GetPluginFS()->GetFSIcon(destroyIcon); - if (icon != NULL) // defined by a plugin + if (icon != NULL) // defined by the plugin { drv.HIcon = icon; drv.HGrayIcon = NULL; drv.DestroyIcon = destroyIcon; // we are driven by the plugin } - else // standard + else // default { drv.HIcon = SalLoadIcon(HInstance, IDI_PLUGINFS, iconSize); drv.HGrayIcon = NULL; @@ -2181,7 +2181,7 @@ BOOL CDrivesList::BuildData(BOOL noTimeout, TDirectArray* copyDrives drv.Accessible = TRUE; drv.Shared = FALSE; Drives->Add(drv); - drv.DestroyIcon = FALSE; // I won't clean up other icons anymore + drv.DestroyIcon = FALSE; // Do not clean up the remaining icons } else { @@ -2258,7 +2258,7 @@ BOOL CDrivesList::LoadMenuFromData() mii.HOverlay = HSharedOverlays[ICONSIZE_16]; mii.String = item->DriveText; mii.State = 0; - if (i == FocusIndex) // if FocusIndex==-1, nothing is marked + if (i == FocusIndex) // if FocusIndex == -1, nothing is checked mii.State = MENU_STATE_CHECKED; if (item->DriveType == drvtPluginFSInOtherPanel) mii.State |= MFS_DISABLED | MFS_GRAYED; @@ -2399,14 +2399,14 @@ BOOL CDrivesList::ExecuteItem(int index, HWND hwnd, const RECT* exclude, BOOL* f break; } - case drvtPluginFS: // a plug-in item: opened FS (active/disconnected) + case drvtPluginFS: // plugin item: open FS (active/disconnected) case drvtPluginFSInOtherPanel: // this should never come, we will stop it later (no action) { *DriveTypeParam = (DWORD_PTR)item->PluginFS; break; } - case drvtPluginCmd: // a plug-in item: FS command + case drvtPluginCmd: // a plugin item: FS command { *DriveTypeParam = (DWORD_PTR)item->DLLName; break; @@ -2721,7 +2721,7 @@ BOOL CDrivesList::OnContextMenu(BOOL posByMouse, int itemIndex, int panel, const if (pluginFSDLLName != NULL) *pluginFSDLLName = NULL; - // for the MenuPopup variable, access is only allowed if posByMouse == FALSE + // MenuPopup may only be accessed if posByMouse == FALSE int selectedIndex; if (itemIndex == -1 || !posByMouse) @@ -2781,7 +2781,7 @@ BOOL CDrivesList::OnContextMenu(BOOL posByMouse, int itemIndex, int panel, const } } else - return FALSE; // we can't do the context menu for other types of paths (relative, FS plugin) + return FALSE; // context menus are not supported for other path types (relative paths or plugin FS paths) break; } @@ -2802,7 +2802,7 @@ BOOL CDrivesList::OnContextMenu(BOOL posByMouse, int itemIndex, int panel, const if (dt == drvtPluginFS) { CPluginFSInterfaceAbstract* fs = Drives->At(selectedIndex).PluginFS; - // we need to verify, that 'fs' is still a valid interface + // we must verify that 'fs' is still a valid interface if (FilesWindow->Is(ptPluginFS) && FilesWindow->GetPluginFS()->GetInterface() == fs) { // active FS selection - we will do refresh pluginData = Plugins.GetPluginData(FilesWindow->GetPluginFS()->GetPluginInterfaceForFS()->GetInterface()); @@ -2850,7 +2850,7 @@ BOOL CDrivesList::OnContextMenu(BOOL posByMouse, int itemIndex, int panel, const p.y = selectedIndexRect.bottom; } - char pluginFSNameBuf[MAX_PATH]; // 'pluginFS' may cease to exist, so we put 'fsName' into a local buffer + char pluginFSNameBuf[MAX_PATH]; // 'pluginFS' may cease to exist, so we copy 'fsName' into a local buffer if (pluginFSName != NULL) lstrcpyn(pluginFSNameBuf, pluginFSName, MAX_PATH); if (pluginData->ChangeDriveMenuItemContextMenu(MainWindow->HWindow, panel, p.x, p.y, pluginFS, @@ -2885,7 +2885,7 @@ BOOL CDrivesList::OnContextMenu(BOOL posByMouse, int itemIndex, int panel, const } if (!failed) { - if (postCmd != 0) // closing Change Drive menu + executing postCmd + if (postCmd != 0) // closing the Change Drive menu and executing postCmd { *PostCmd = postCmd; *PostCmdParam = postCmdParam; @@ -2900,7 +2900,7 @@ BOOL CDrivesList::OnContextMenu(BOOL posByMouse, int itemIndex, int panel, const } } } - if (refreshMenu) // plug-in asks for menu refresh + if (refreshMenu) // plugin asks for menu refresh { PostMessage(MainWindow->HWindow, WM_USER_DRIVES_CHANGE, 0, 0); } @@ -2923,7 +2923,7 @@ BOOL CDrivesList::OnContextMenu(BOOL posByMouse, int itemIndex, int panel, const case drvtOneDriveBus: case drvtOneDriveMenu: { - // for Documents, Network, As Other Panel a Cloud Storages we can't do context menu) + // no context menu for Documents, Network, As Other Panel, or Cloud Storages return FALSE; } @@ -2973,9 +2973,9 @@ BOOL CDrivesList::OnContextMenu(BOOL posByMouse, int itemIndex, int panel, const DWORD cmd = contextPopup.Track(MENU_TRACK_RETURNCMD | MENU_TRACK_RIGHTBUTTON, pt.x, pt.y, MainWindow->HWindow, NULL); - // WARNING: during the opened context menu, the object can be refreshed (e.g. user inserts - // a USB stick or disconnects a network drive), we have to count on it when accessing the - // data of this object (e.g. Drives can contain different data) + // WARNING: while the context menu is open, this object may be refreshed (for example, when the user inserts + // a USB stick or disconnects a network drive); this must be taken into account when accessing the + // object's data (for example, Drives may contain different data) if (cmd != 0) { @@ -2987,7 +2987,7 @@ BOOL CDrivesList::OnContextMenu(BOOL posByMouse, int itemIndex, int panel, const { cmdName[0] = 0; } - if (stricmp(cmdName, "properties") != 0 && // not mandatory for properties + if (stricmp(cmdName, "properties") != 0 && // not needed for Properties stricmp(cmdName, "find") != 0 && // not mandatory for find stricmp(cmdName, "open") != 0 && // not mandatory for open stricmp(cmdName, "explore") != 0 && // not mandatory for explore @@ -2998,7 +2998,7 @@ BOOL CDrivesList::OnContextMenu(BOOL posByMouse, int itemIndex, int panel, const for (i = 0; i < 2; i++) { win = i == 0 ? MainWindow->LeftPanel : MainWindow->RightPanel; - if (HasTheSameRootPath(win->GetPath(), path)) // identical disk (both normal and UNC) + if (HasTheSameRootPath(win->GetPath(), path)) // same drive (local and UNC) { if (i == 0) releaseLeft = TRUE; @@ -3031,15 +3031,15 @@ BOOL CDrivesList::OnContextMenu(BOOL posByMouse, int itemIndex, int panel, const ici.ptInvoke.y = pt.y; } - BOOL changeToFixedDrv = cmd == 35; // "format" is not modal, we need to change to fixed drive + BOOL changeToFixedDrv = cmd == 35; // "format" is not modal, so we need to switch to a fixed drive if (releaseLeft) { if (changeToFixedDrv) { MainWindow->LeftPanel->ChangeToFixedDrive(MainWindow->LeftPanel->HWindow); - // WARNING: we have to invalidate the window, so that the cached bitmap of Alt+F1/2 menu is broken - // otherwise, the old part of the panel was displayed in this situation: - // there is disk S: in the left panel; Alt+F1, right click on S, Format + // WARNING: The window must be invalidated to break the cached bitmap of the Alt+F1/2 menu + // otherwise, an old part of the panel was displayed in this situation: + // the left panel shows drive S:; Alt+F1, right-click S, Format InvalidateRect(MainWindow->LeftPanel->HWindow, NULL, TRUE); } else @@ -3058,7 +3058,7 @@ BOOL CDrivesList::OnContextMenu(BOOL posByMouse, int itemIndex, int panel, const DisplayMenuAux(MainWindow->ContextMenuChngDrv, (CMINVOKECOMMANDINFO*)&ici); - // it's possible to change clipboard from context menu, we will check it ... + // the clipboard can be changed from the context menu, so we will check it ... IdleRefreshStates = TRUE; // we will force the check of the state variables at the next Idle IdleCheckClipboard = TRUE; // we will the clipboard to be checked as well @@ -3068,7 +3068,7 @@ BOOL CDrivesList::OnContextMenu(BOOL posByMouse, int itemIndex, int panel, const if (releaseRight && !changeToFixedDrv) MainWindow->RightPanel->HandsOff(FALSE); - if (!selectedIndexAccessible) // unmap the remembered inactive network connection? + if (!selectedIndexAccessible) // unmapping a remembered inactive network connection? PostMessage(MainWindow->HWindow, WM_USER_DRIVES_CHANGE, 0, 0); /* @@ -3106,7 +3106,7 @@ BOOL CDrivesList::RebuildMenu() // remove old data DestroyData(); // get new ones - BuildData(TRUE); // timeout can't be used, reading CD labels takes long time (1,5s) - system notifies the driver earlier than it's loaded + BuildData(TRUE); // A timeout cannot be used; reading the CD label takes a long time (1.5 s), and the system notifies the drive before the label has been read. // remove items from menu MenuPopup->RemoveAllItems(); // get new items @@ -3122,7 +3122,7 @@ BOOL CDrivesList::FindPanelPathIndex(CFilesWindow* panel, DWORD* index) if (panel->Is(ptPluginFS)) { if (!panel->GetPluginFS()->IsServiceSupported(FS_SERVICE_GETCHANGEDRIVEORDISCONNECTITEM)) - { // searching for a plug-in FS without its own item in Change Drive menu (these items are not in Drive bars) + { // searching for a plugin FS without its own item in Change Drive menu (these items are not in Drive bars) int i; for (i = 0; i < Drives->Count; i++) { @@ -3141,7 +3141,7 @@ BOOL CDrivesList::FindPanelPathIndex(CFilesWindow* panel, DWORD* index) if (path[0] == '\\' && path[1] == '\\') { if (path[2] == '.' && path[3] == '\\' && path[4] != 0 && path[5] == ':') - return FALSE; // "\\.\C:\" type path + return FALSE; // path of the "\\.\C:\" type CPluginData* nethoodPlugin = NULL; Plugins.GetFirstNethoodPluginFSName(NULL, &nethoodPlugin); int i; From f14d7cc2a99af91c6f9cc18ad0d671bc6114d44c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 9 Apr 2026 13:03:47 +0200 Subject: [PATCH 007/710] [tanslation] Fix src/fileswn3.cpp comments (#378) --- src/fileswn3.cpp | 190 +++++++++++++++++++++++------------------------ 1 file changed, 95 insertions(+), 95 deletions(-) diff --git a/src/fileswn3.cpp b/src/fileswn3.cpp index 445563ce5..a8cfce4ca 100644 --- a/src/fileswn3.cpp +++ b/src/fileswn3.cpp @@ -131,8 +131,8 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) Files->SetDeleteData(TRUE); Dirs->SetDeleteData(TRUE); - if (WaitForESCReleaseBeforeTestingESC) // waiting for ESC release (so that listing is not interrupted - // immediately - this ESC probably ended modal dialog/messagebox) + if (WaitForESCReleaseBeforeTestingESC) // wait for ESC to be released (so that listing is not interrupted + // immediately; this ESC probably closed a modal dialog/message box) { WaitForESCRelease(); WaitForESCReleaseBeforeTestingESC = FALSE; // another waiting makes no sense @@ -154,7 +154,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) { BOOL isDriveFloppy = FALSE; // floppies have their own configuration beside other removable drives int drv = UpperCase[fileName[0]] - 'A' + 1; - if (drv >= 1 && drv <= 26) // doing "range-check" for sure + if (drv >= 1 && drv <= 26) // perform a range check just to be safe { DWORD medium = GetDriveFormFactor(drv); if (medium == 350 || medium == 525 || medium == 800 || medium == 1) @@ -192,7 +192,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) SetCurrentDirectoryToSystem(); DirectoryLine->SetHidden(HiddenFilesCount, HiddenDirsCount); // TRACE_I("ReadDirectory: end"); - return FALSE; // empty string on input + return FALSE; // empty input string } if (*(st - 1) != '\\') *st++ = '\\'; @@ -202,7 +202,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) if (UseSystemIcons) { IconCacheValid = FALSE; - MSG msg; // we must destroy possible WM_USER_ICONREADING_END which would set IconCacheValid = TRUE + MSG msg; // we must remove any pending WM_USER_ICONREADING_END that would set IconCacheValid = TRUE while (PeekMessage(&msg, HWindow, WM_USER_ICONREADING_END, WM_USER_ICONREADING_END, PM_REMOVE)) ; @@ -218,7 +218,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) if (UseThumbnails) { IconCacheValid = FALSE; - MSG msg; // we must destroy possible WM_USER_ICONREADING_END which would set IconCacheValid = TRUE + MSG msg; // we must remove any pending WM_USER_ICONREADING_END that would set IconCacheValid = TRUE while (PeekMessage(&msg, HWindow, WM_USER_ICONREADING_END, WM_USER_ICONREADING_END, PM_REMOVE)) ; } @@ -228,7 +228,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) BOOL UNCRootUpDir = FALSE; if (GetPath()[0] == '\\' && GetPath()[1] == '\\') { - if (GetPath()[2] == '.' && GetPath()[3] == '\\' && GetPath()[4] != 0 && GetPath()[5] == ':') // "\\.\C:\" type path + if (GetPath()[2] == '.' && GetPath()[3] == '\\' && GetPath()[4] != 0 && GetPath()[5] == ':') // path of the "\\.\C:\" type { upDir = strlen(GetPath()) > 7; } @@ -282,12 +282,12 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) DWORD lastEscCheckTime; //lastEscCheckTime = GetTickCount() - 200; // the first ESC will go immediately - lastEscCheckTime = GetTickCount(); // the first ESC will go after 200 ms -- it's a protection + lastEscCheckTime = GetTickCount(); // the first ESC will only be accepted after 200 ms; this protects // against the cancel prompt for listing after the user - // has closed a dialog (e.g. Files/Security/*) by Esc and - // in the panel there was a network drive (and during the - // opened dialog the user switched to Salamander and back, - // so that there was a refresh of the directory) + // has closed a dialog (e.g. Files/Security/*) with Esc and + // there was a network drive in the panel (and during the + // open dialog the user switched to Salamander and back, + // causing a directory refresh) BOOL isUpDir = FALSE; WIN32_FIND_DATA fileData; @@ -369,7 +369,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) if (isRefresh && (err == ERROR_ACCESS_DENIED || err == ERROR_PATH_NOT_FOUND || err == ERROR_BAD_PATHNAME || err == ERROR_FILE_NOT_FOUND)) - { // when deleting a path shown in the panel, these errors are shown, which we don't want, we just silently shorten the path to the first existing one (unfortunately it's not caught earlier, because the path exists for some time after its deletion, something in Windows just didn't work out again) + { // when a path displayed in the panel is deleted, these errors appear, which we do not want, so just silently shorten the path to the first existing one (unfortunately this is not caught earlier because the path still exists for some time after deletion due to Windows behavior) // TRACE_I("ReadDirectory(): silently ignoring FindFirstFile failure: " << GetErrorText(err)); showErr = FALSE; } @@ -387,7 +387,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) { NumberOfItemsInCurDir++; - // test ESC - doesn't user want to interrupt reading? + // test ESC: does the user want to interrupt reading? if (GetTickCount() - lastEscCheckTime >= 200) // 5 times per second { if (UserWantsToCancelSafeWaitWindow()) @@ -410,13 +410,13 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) if (resBut == IDYES) { testFindNextErr = FALSE; - break; // finish reading + break; // stop loading } else { if (resBut == IDNO) { - if (GetMonitorChanges()) // need to suppress monitoring of changes (autorefresh) + if (GetMonitorChanges()) // suppress change monitoring (auto-refresh) { DetachDirectory((CFilesWindow*)this); SetMonitorChanges(FALSE); // the changes won't be monitored anymore @@ -507,7 +507,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) memmove(file.Name, st, len + 1); // copy of text file.NameLen = len; //--- extension - if (!Configuration.SortDirsByExt && (fileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) // this is ptDisk + if (!Configuration.SortDirsByExt && (fileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) // ptDisk only { file.Ext = file.Name + file.NameLen; // directories have no extension } @@ -530,7 +530,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) file.Hidden = (file.Attr & FILE_ATTRIBUTE_HIDDEN) && !IsFilePlaceholder(&fileData) ? 1 : 0; file.IsOffline = !isUpDir && (file.Attr & FILE_ATTRIBUTE_OFFLINE) ? 1 : 0; - if (testShares && (file.Attr & FILE_ATTRIBUTE_DIRECTORY)) // this is ptDisk + if (testShares && (file.Attr & FILE_ATTRIBUTE_DIRECTORY)) // ptDisk { file.Shared = Shares.Search(file.Name); } @@ -563,12 +563,12 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) } else file.DosName = NULL; - if (file.Attr & FILE_ATTRIBUTE_DIRECTORY) // this is ptDisk + if (file.Attr & FILE_ATTRIBUTE_DIRECTORY) // ptDisk { file.Association = 0; file.Archive = 0; #ifndef _WIN64 - file.IsLink = (isWin64RedirectedDir || (fileData.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) || // CAUTION: pseudo-directory must have IsLink set, otherwise ContainsWin64RedirectedDir must be changed + file.IsLink = (isWin64RedirectedDir || (fileData.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) || // CAUTION: pseudo-directories must have IsLink set; otherwise, ContainsWin64RedirectedDir must be changed isWindows64BitDir && file.NameLen == 8 && StrICmp(file.Name, "system32") == 0) ? 1 : 0; // system32 directory in 32-bit Salamander is link to SysWOW64 + win64 redirected-dir + volume mount point or junction point = show directory with link overlay @@ -635,7 +635,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) : 0; } - if (PackerFormatConfig.PackIsArchive(file.Name, file.NameLen)) // is it an archive which we can process? + if (PackerFormatConfig.PackIsArchive(file.Name, file.NameLen)) // is it an archive that we can process? { file.Association = 1; file.Archive = 1; @@ -645,22 +645,22 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) { file.Association = Associations.IsAssociated(st, addtoIconCache, iconSize); file.Archive = 0; - if (*(DWORD*)st == *(DWORD*)"scr" || // few exceptions + if (*(DWORD*)st == *(DWORD*)"scr" || // a few exceptions *(DWORD*)st == *(DWORD*)"pif") { addtoIconCache = TRUE; } else { - if (*(DWORD*)st == *(DWORD*)"lnk") // icons via link + if (*(DWORD*)st == *(DWORD*)"lnk") // icons via shortcut { strcpy(fileData.cFileName, file.Name); char* ext2 = strrchr(fileData.cFileName, '.'); - if (ext2 != NULL) // ".cvspass" in Windows is an extesion + if (ext2 != NULL) // ".cvspass" is treated as an extension in Windows // if (ext2 != NULL && ext2 != fileData.cFileName) { *ext2 = 0; - if (PackerFormatConfig.PackIsArchive(fileData.cFileName)) // is it a link to archive which we can process? + if (PackerFormatConfig.PackIsArchive(fileData.cFileName)) // is it a link to an archive that we can process? { file.Association = 1; file.Archive = 1; @@ -701,7 +701,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) } // at the file, we will check if it's necessary to load its thumbnail - if (readThumbnails && // thumbnail should be loaded + if (readThumbnails && // thumbnails should be loaded (file.Attr & FILE_ATTRIBUTE_DIRECTORY) == 0 && // (it is ptDisk, so using FILE_ATTRIBUTE_DIRECTORY is o.k.) file.Archive == 0) // archive icon is preferred before thumbnail { @@ -713,30 +713,30 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) if (p->ThumbnailMasks.AgreeMasks(file.Name, file.Ext) && !p->ThumbnailMasksDisabled) // its unload/remove is not in progress { - if (!p->GetLoaded()) // plugin needs to be loaded (possible change of mask for "thumbnail loader") + if (!p->GetLoaded()) // the plugin must be loaded (the "thumbnail loader" mask may change) { // RefreshListBox(0, -1, -1, FALSE, FALSE); // replaced with ListBox->SetItemsCound + WM_USER_UPDATEPANEL, because it was blinking e.g. when adding the first *.doc file to a directory with images (Eroiica is loaded (for thumbnail *.doc)) // displaying "PictureView is not registered" dialog may occur -> in that case it's necessary // to refresh listbox (otherwise we don't do any refresh, so that it doesn't blink with the panel) // we protect listbox against errors caused by request for refresh (data is just being read from disk) - ListBox->SetItemsCount(0, 0, 0, TRUE); // TRUE - we will disable setting scrollbar - // If WM_USER_UPDATEPANEL is delivered, the panel will be redrawn and scrollbar will be set. - // Message loop can deliver it when message box (or dialog) is created. - // Otherwise the panel will behave as unchanged and the message will be removed from queue. + ListBox->SetItemsCount(0, 0, 0, TRUE); // TRUE - disable scrollbar updates + // If WM_USER_UPDATEPANEL is delivered, the panel contents will be redrawn and the scrollbar will be updated. + // The message loop can deliver it when a message box (or dialog) is created. + // Otherwise, the panel will appear unchanged and the message will be removed from the queue. PostMessage(HWindow, WM_USER_UPDATEPANEL, 0, 0); BOOL cont = FALSE; if (p->InitDLL(HWindow, FALSE, TRUE, FALSE) && // plugin loaded successfully p->ThumbnailMasks.GetMasksString()[0] != 0) // plugin is still "thumbnail loader" { - if (!p->ThumbnailMasks.AgreeMasks(file.Name, file.Ext) || // it can't do thumbnail for this file anymore + if (!p->ThumbnailMasks.AgreeMasks(file.Name, file.Ext) || // it can no longer generate thumbnails for this file p->ThumbnailMasksDisabled) // its unload/remove is in progress { cont = TRUE; } } - else // can't load -> we will remove it from the list of probed plugins (prevent from repeating error messages) + else // cannot load -> remove it from the list of tried plugins (to prevent repeated error messages) { TRACE_I("Unable to use plugin " << p->Name << " as thumbnail loader."); thumbLoaderPlugins.Delete(i); @@ -764,7 +764,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) if (foundThumbLoaderPlugins.Count > 0) { int size = len + 4; - size -= (size & 0x3); // size % 4 (alignment per four bytes) + size -= (size & 0x3); // size % 4 (4-byte alignment) int nameSize = size; size += sizeof(CQuadWord) + sizeof(FILETIME); size += (foundThumbLoaderPlugins.Count + 1) * sizeof(void*); // space for pointers to plugin interfaces + NULL at the end @@ -786,7 +786,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) *ifaces = NULL; // the end of list of plugin interfaces iconData.SetFlag(4); // so far no unread thumbnail - // we have to allocate space for thumbnail, because it can't be done in the thread + // we must allocate space for the thumbnail here; it cannot be done in the thread iconData.SetIndex(IconCache->AllocThumbnail()); if (iconData.GetIndex() != -1) @@ -798,7 +798,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) IconCache->ResetState(); } else - addtoIconCache = FALSE; // it's a thumbnail, it can't be an icon at the same time + addtoIconCache = FALSE; // this is a thumbnail, so it cannot be an icon at the same time } else free(iconData.NameAndData); @@ -813,7 +813,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) if (UseSystemIcons && addtoIconCache) { int size = len + 4; - size -= (size & 0x3); // size % 4 (alignment per four bytes) + size -= (size & 0x3); // size % 4 (4-byte alignment) iconData.NameAndData = (char*)malloc(size); if (iconData.NameAndData != NULL) { @@ -841,7 +841,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) #ifndef _WIN64 isWin64RedirectedDir = FALSE; #endif // _WIN64 - break; // the second pass (adding ".." or win64 redirected-dir) + break; // the second pass (adding ".." or the win64 redirected-dir) } } while (FindNextFile(search, &fileData)); DWORD err = GetLastError(); @@ -913,7 +913,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) if (foundWin64RedirectedDirs < 10 && AddWin64RedirectedDir(GetPath(), Dirs, &fileData, &foundWin64RedirectedDirs, &dirWithSameNameExists)) { - foundWin64RedirectedDirs++; // e.g. under system32 there can be 5, I've added some reserve to 10... + foundWin64RedirectedDirs++; // e.g. there can be 5 of them under system32; some reserve was added up to 10... if (Configuration.NotHiddenSystemFiles && (fileData.dwFileAttributes & (FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM))) @@ -998,7 +998,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) { CFileData* f = &ZIPFiles->At(i); if (Configuration.NotHiddenSystemFiles && - (f->Hidden || // both Hidden and Attr are nulled if they are invalid -> tests fail + (f->Hidden || // Hidden and Attr are zeroed when invalid; otherwise tests fail (f->Attr & (FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM)))) { // skip hidden file/directory HiddenFilesCount++; @@ -1025,13 +1025,13 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) } CFileData upDir; static char buffUp[] = ".."; - upDir.Name = buffUp; // free() won't be called, we can afford ".." + upDir.Name = buffUp; // free() will not be called, so ".." can be used directly upDir.Ext = upDir.Name + 2; upDir.Size = CQuadWord(0, 0); upDir.Attr = 0; upDir.LastWrite = GetZIPArchiveDate(); upDir.DosName = NULL; - upDir.PluginData = 0; // 0 just like that, plug-in will overwrite it with its value + upDir.PluginData = 0; // 0 just like that, plugin will overwrite it with its value upDir.NameLen = 2; upDir.Hidden = 0; upDir.IsLink = 0; @@ -1054,7 +1054,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) { CFileData* f = &ZIPDirs->At(i); if (Configuration.NotHiddenSystemFiles && - (f->Hidden || // both Hidden and Attr are nulled if they are invalid -> tests fail + (f->Hidden || // Hidden and Attr are zeroed if they are invalid -> tests fail (f->Attr & (FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM)))) { // skip hidden file/directory HiddenDirsCount++; @@ -1087,7 +1087,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) { DirectoryLine->SetHidden(HiddenFilesCount, HiddenDirsCount); // TRACE_I("ReadDirectory: end"); - return FALSE; // the directory has ceased to exist ... + return FALSE; // the directory no longer exists ... } // sorting of Files and Dirs according to the current sorting method @@ -1098,7 +1098,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) { // preparing for loading of icons IconCacheValid = FALSE; - MSG msg; // need to remove any WM_USER_ICONREADING_END, which would set IconCacheValid = TRUE + MSG msg; // remove any pending WM_USER_ICONREADING_END that would set IconCacheValid = TRUE while (PeekMessage(&msg, HWindow, WM_USER_ICONREADING_END, WM_USER_ICONREADING_END, PM_REMOVE)) ; @@ -1118,7 +1118,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) if (*f->Ext != 0) // an extension exists { /* - if (PackerFormatConfig.PackIsArchive(f->Name)) // is it an archive which we can process? + if (PackerFormatConfig.PackIsArchive(f->Name)) // is it an archive that we can process? { f->Association = TRUE; f->Archive = TRUE; @@ -1151,13 +1151,13 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) iconData.FSFileData = NULL; iconData.SetReadingDone(0); // just for form int size = (int)strlen(iconLocation) + 4; - size -= (size & 0x3); // size % 4 (alignment per four bytes) + size -= (size & 0x3); // size % 4 (4-byte alignment) const char* s = iconLocation + size; // skip alignment from zeros int len = (int)strlen(s); - if (len > 0) // icon-location is not empty + if (len > 0) // icon location is not empty { int nameLen = f->NameLen + 4; - nameLen -= (nameLen & 0x3); // nameLen % 4 (alignment per four bytes) + nameLen -= (nameLen & 0x3); // nameLen % 4 (four-byte alignment) iconData.NameAndData = (char*)malloc(nameLen + len + 1); if (iconData.NameAndData != NULL) { @@ -1199,7 +1199,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) if (*f->Ext != 0) // an extension exists { /* - if (PackerFormatConfig.PackIsArchive(f->Name)) // is it an archive which we can process? + if (PackerFormatConfig.PackIsArchive(f->Name)) // is it an archive that we can process? { f->Association = TRUE; f->Archive = TRUE; @@ -1265,7 +1265,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) CFileData* f = &FSFiles->At(i); if (Configuration.NotHiddenSystemFiles && - (f->Hidden || // both Hidden and Attr are nulled if they are invalid -> tests fail + (f->Hidden || // Hidden and Attr are zeroed when invalid; otherwise the tests fail (f->Attr & (FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM)))) { // skip hidden file/directory HiddenFilesCount++; @@ -1295,7 +1295,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) { CFileData* f = &FSDirs->At(i); if (Configuration.NotHiddenSystemFiles && - (f->Hidden || // both Hidden and Attr are nulled if they are invalid -> tests fail + (f->Hidden || // both Hidden and Attr are zeroed if they are invalid -> tests fail (f->Attr & (FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM)))) { // skip hidden file/directory HiddenDirsCount++; @@ -1359,7 +1359,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) // preparing for loading of icons IconCacheValid = FALSE; - MSG msg; // need to remove any WM_USER_ICONREADING_END, which would set IconCacheValid = TRUE + MSG msg; // need to remove any pending WM_USER_ICONREADING_END message that would set IconCacheValid = TRUE while (PeekMessage(&msg, HWindow, WM_USER_ICONREADING_END, WM_USER_ICONREADING_END, PM_REMOVE)) ; @@ -1379,7 +1379,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) if (*f->Ext != 0) // an extension exists { /* - if (PackerFormatConfig.PackIsArchive(f->Name)) // is it an archive which we can process? + if (PackerFormatConfig.PackIsArchive(f->Name)) // is it an archive that we can process? { f->Association = TRUE; f->Archive = TRUE; @@ -1412,13 +1412,13 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) iconData.FSFileData = NULL; iconData.SetReadingDone(0); // just for form int size = (int)strlen(iconLocation) + 4; - size -= (size & 0x3); // size % 4 (alignment per four bytes) + size -= (size & 0x3); // size % 4 (4-byte alignment) const char* s = iconLocation + size; // skip alignment from zeros int len = (int)strlen(s); - if (len > 0) // icon-location is not empty + if (len > 0) // icon location is not empty { int nameLen = f->NameLen + 4; - nameLen -= (nameLen & 0x3); // nameLen % 4 (alignment per four bytes) + nameLen -= (nameLen & 0x3); // nameLen % 4 (aligned to four bytes) iconData.NameAndData = (char*)malloc(nameLen + len + 1); if (iconData.NameAndData != NULL) { @@ -1459,7 +1459,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) TRACE_E("SimplePluginIcons is not NULL before GetSimplePluginIcons()."); #endif // _DEBUG SimplePluginIcons = PluginData.GetSimplePluginIcons(iconSize); - if (SimplePluginIcons == NULL) // not a success -> degradation to pitSimple + if (SimplePluginIcons == NULL) // failure -> fall back to pitSimple { SetPluginIconsType(pitSimple); } @@ -1477,7 +1477,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) if (*f->Ext != 0) // an extension exists { /* - if (PackerFormatConfig.PackIsArchive(f->Name)) // is it an archive which we can process? + if (PackerFormatConfig.PackIsArchive(f->Name)) // is it an archive that we can process? { f->Association = TRUE; f->Archive = TRUE; @@ -1516,11 +1516,11 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) // preparing for loading of icons IconCacheValid = FALSE; - MSG msg; // need to remove any WM_USER_ICONREADING_END, which would set IconCacheValid = TRUE + MSG msg; // remove any pending WM_USER_ICONREADING_END that would set IconCacheValid = TRUE while (PeekMessage(&msg, HWindow, WM_USER_ICONREADING_END, WM_USER_ICONREADING_END, PM_REMOVE)) ; - // file/directories which don't have a simple icon will be addeed to icon-cache + // add files/directories without a simple icon to the icon cache { CALL_STACK_MESSAGE1("CFilesWindow::ReadDirectory::FS-icons-from-plugin"); @@ -1532,8 +1532,8 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) BOOL isDir = i < FSDirs->Count; CFileData* f = (isDir ? &FSDirs->At(i) : &FSFiles->At(i - FSDirs->Count)); - // need a pointer to CFileData for PluginFSDir, because moving occurs in Files and Dirs - // e.g. when sorting (Files and Dirs are arrays of CFileData, not (CFileData *), that's why these problems exist) + // a pointer to CFileData is needed for PluginFSDir, because items in Files and Dirs can move + // for example when sorting (Files and Dirs are arrays of CFileData, not `CFileData*`, which causes these problems) if (Configuration.NotHiddenSystemFiles && (f->Hidden || //both Hidden a Attr jsou nulovane pokud jsou neplatne -> testy failnou (f->Attr & (FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM)))) @@ -1625,14 +1625,14 @@ void SortFilesAndDirectories(CFilesArray* files, CFilesArray* dirs, CSortType so { CALL_STACK_MESSAGE1("SortDirectoryAux()"); - // CAUTION: must correspond to sort-code in RefreshDirectory, ChangeSortType and CompareDirectories !!! + // CAUTION: must match the sort code in RefreshDirectory, ChangeSortType, and CompareDirectories !! if (dirs->Count > 0) { BOOL hasRoot = (dirs->At(0).NameLen == 2 && dirs->At(0).Name[0] == '.' && dirs->At(0).Name[1] == '.'); // root directory int firstIndex = hasRoot ? 1 : 0; - if (dirs->Count - firstIndex > 1) // if there's one item only, there's nothing to sort + if (dirs->Count - firstIndex > 1) // if there is only one item, there is nothing to sort { switch (sortType) { @@ -1717,7 +1717,7 @@ BOOL IsWin64RedirectedDirAux(const char* subDir, const char* redirectedDir, cons if (h != INVALID_HANDLE_VALUE) { HANDLES(FindClose(h)); - return FALSE; // this is not just a pseudo-directory, there is a directory with the same name, which means that e.g. context menu will work more or less normally + return FALSE; // this is not just a pseudo-directory, there is a directory with the same name, which means that e.g. the context menu will work more or less normally } } @@ -1806,7 +1806,7 @@ BOOL AddWin64RedirectedDirAux(const char* path, const char* subDir, const char* if (StrICmp(dirs->At(i).Name, redirectedDirLastComp) == 0) { if (dirs->At(i).IsLink) - return FALSE; // this redirected-dir is already added + return FALSE; // this redirected-dir has already been added deleteIndex = i; break; } @@ -1942,7 +1942,7 @@ BOOL CFilesWindow::ChangeDir(const char* newDir, int suggestedTopIndex, const ch UpdateWindow(MainWindow->HWindow); if (newDir != NULL) lstrcpyn(path, newDir, 2 * MAX_PATH); - else // focus and top-index setting won't be done for path from dialog + else // do not set focus and top-index for a path from the dialog { suggestedTopIndex = -1; suggestedFocusName = NULL; @@ -1952,7 +1952,7 @@ BOOL CFilesWindow::ChangeDir(const char* newDir, int suggestedTopIndex, const ch char* fsUserPart; if (!sendDirectlyToPluginLocal && IsPluginFSPath(path, fsName, (const char**)&fsUserPart)) { - if (strlen(fsUserPart) >= MAX_PATH) // plugins do not count with longer path + if (strlen(fsUserPart) >= MAX_PATH) // plugins do not support longer paths { sprintf(errBuf, LoadStr(IDS_PATHERRORFORMAT), path, LoadStr(IDS_TOOLONGPATH)); SalMessageBox(HWindow, errBuf, LoadStr(IDS_ERRORCHANGINGDIR), @@ -1963,7 +1963,7 @@ BOOL CFilesWindow::ChangeDir(const char* newDir, int suggestedTopIndex, const ch EndStopRefresh(); // snooper will be started again if (failReason != NULL) *failReason = CHPPFR_INVALIDPATH; - return FALSE; // we're finished, it can't be repeated + return FALSE; // cannot retry, stop here } goto CHANGE_AGAIN; } @@ -2059,7 +2059,7 @@ BOOL CFilesWindow::ChangeDir(const char* newDir, int suggestedTopIndex, const ch EndStopRefresh(); // snooper will be started again if (failReason != NULL) *failReason = CHPPFR_INVALIDPATH; - return FALSE; // finished, cannot be repeated + return FALSE; // Stop here; retry is not possible } goto CHANGE_AGAIN; } @@ -2070,13 +2070,13 @@ BOOL CFilesWindow::ChangeDir(const char* newDir, int suggestedTopIndex, const ch (path[0] != 0 && path[1] == ':' || // X: type paths (path[0] == '/' || path[0] == '\\') && (path[1] == '/' || path[1] == '\\') || // UNC paths Is(ptDisk) || Is(ptZIPArchive))) // disk+archive of the relative path - { // this is a disk path (absolute or relative) - turn all '/' to '\\' + remove duplicated '\\' + { // disk path (absolute or relative): convert all '/' to '\\' and remove duplicate '\\' SlashesToBackslashesAndRemoveDups(path); } int errTextID; const char* text = NULL; // caution: textFailReason must be set - int textFailReason = CHPPFR_INVALIDPATH; // if text != NULL, it contains the code of error which occurred + int textFailReason = CHPPFR_INVALIDPATH; // if text != NULL, textFailReason contains the error code char curPath[2 * MAX_PATH]; curPath[0] = 0; if (sendDirectlyToPluginLocal) @@ -2155,7 +2155,7 @@ BOOL CFilesWindow::ChangeDir(const char* newDir, int suggestedTopIndex, const ch EndStopRefresh(); // snooper will be started again if (failReason != NULL) *failReason = CHPPFR_INVALIDPATH; - return FALSE; // finished, cannot be repeated + return FALSE; // done, cannot retry } goto CHANGE_AGAIN; // show the path in dialog again, so that the user can correct it } @@ -2181,7 +2181,7 @@ BOOL CFilesWindow::ChangeDir(const char* newDir, int suggestedTopIndex, const ch EndStopRefresh(); // snooper will be started again if (failReason != NULL) *failReason = CHPPFR_INVALIDPATH; - return FALSE; // finished, cannot be repeated + return FALSE; // stopping here, cannot retry } goto CHANGE_AGAIN; } @@ -2207,7 +2207,7 @@ BOOL CFilesWindow::ChangeDir(const char* newDir, int suggestedTopIndex, const ch copyLen = (int)strlen(copy); if (copyLen >= MAX_PATH) { - if (*end != 0 && !SalPathAppend(copy, end + 1, 2 * MAX_PATH)) // if the so far processed part of the path is enlengthened and the rest of the path does not fit, we will use the original form of the path + if (*end != 0 && !SalPathAppend(copy, end + 1, 2 * MAX_PATH)) // if extending the part of the path processed so far leaves no room for the rest, use the original form of the path strcpy(copy, path); text = LoadStr(IDS_TOOLONGPATH); textFailReason = CHPPFR_INVALIDPATH; @@ -2235,7 +2235,7 @@ BOOL CFilesWindow::ChangeDir(const char* newDir, int suggestedTopIndex, const ch err = GetLastError(); if (err != ERROR_FILE_NOT_FOUND && err != ERROR_PATH_NOT_FOUND && err != ERROR_BAD_PATHNAME && err != ERROR_INVALID_NAME) - { // if there's chance that the path contains a directory to which we don't have access (we will try if there are other components of the path accessible) + { // if there is a chance that the path contains a directory we cannot access (try whether later path components are accessible) DWORD firstErr = err; char* firstCopyEnd = st + strlen(st); while (*end != 0) @@ -2246,7 +2246,7 @@ BOOL CFilesWindow::ChangeDir(const char* newDir, int suggestedTopIndex, const ch memcpy(st, s, end - s); st[end - s] = 0; s = end; - if ((int)strlen(copy) >= MAX_PATH) // too long path, we're finished... + if ((int)strlen(copy) >= MAX_PATH) // path is too long, stop { h = INVALID_HANDLE_VALUE; break; @@ -2255,14 +2255,14 @@ BOOL CFilesWindow::ChangeDir(const char* newDir, int suggestedTopIndex, const ch { h = HANDLES_Q(FindFirstFile(copy, &find)); if (h != INVALID_HANDLE_VALUE) - break; // we've found an accessible component, continuing... + break; // accessible component found, continue err = GetLastError(); if (err == ERROR_FILE_NOT_FOUND || err == ERROR_PATH_NOT_FOUND || err == ERROR_BAD_PATHNAME || err == ERROR_INVALID_NAME) - break; // an error in the path, we're finished... + break; // error in the path, stopping... } } - if (*end == 0 && h == INVALID_HANDLE_VALUE) // another accessible component not found, we will try if the current path can be listed + if (*end == 0 && h == INVALID_HANDLE_VALUE) // no other accessible component found; try listing the current path { if ((int)strlen(copy) < MAX_PATH && SalPathAppend(copy, "*.*", MAX_PATH + 10)) { @@ -2281,7 +2281,7 @@ BOOL CFilesWindow::ChangeDir(const char* newDir, int suggestedTopIndex, const ch } } } - if (h == INVALID_HANDLE_VALUE) // accessible part of the path not found, we will report the first found error + if (h == INVALID_HANDLE_VALUE) // no accessible part of the path was found; report the first error encountered { err = firstErr; *firstCopyEnd = 0; @@ -2307,7 +2307,7 @@ BOOL CFilesWindow::ChangeDir(const char* newDir, int suggestedTopIndex, const ch { HANDLES(FindClose(h)); int len2 = (int)strlen(find.cFileName); // must fit (only the size of letters is changed - result of FindFirstFile) - if ((int)strlen(st + 1) != len2) // it does e.g. for "aaa " returns "aaa", reproduce: Paste (text without quotes): " " %TEMP%\aaa " " + if ((int)strlen(st + 1) != len2) // for example, for "aaa " it returns "aaa"; reproduce: Paste (text without outer quotes): " " %TEMP%\aaa " " { TRACE_E("CFilesWindow::ChangeDir(): unexpected situation: FindFirstFile returned name with " "different length: \"" @@ -2327,9 +2327,9 @@ BOOL CFilesWindow::ChangeDir(const char* newDir, int suggestedTopIndex, const ch { // file -> is it an archive? if (PackerFormatConfig.PackIsArchive(copy)) { - if ((int)strlen(*end != 0 ? end + 1 : end) >= MAX_PATH) // too long path in archive + if ((int)strlen(*end != 0 ? end + 1 : end) >= MAX_PATH) // path in the archive is too long { - if (!SalPathAppend(copy, end + 1, 2 * MAX_PATH)) // if the archive name is enlengthened and the rest of the path does not fit, we will use the original form of the path + if (!SalPathAppend(copy, end + 1, 2 * MAX_PATH)) // if extending the archive name would leave no room for the path inside the archive, use the original form of the path strcpy(copy, path); text = LoadStr(IDS_TOOLONGPATH); textFailReason = CHPPFR_INVALIDPATH; @@ -2361,7 +2361,7 @@ BOOL CFilesWindow::ChangeDir(const char* newDir, int suggestedTopIndex, const ch char* name; char shortenedPath[MAX_PATH]; strcpy(shortenedPath, copy); - if (*end == 0 && CutDirectory(shortenedPath, &name)) // when the path does not end with '\\' (path to file) + if (*end == 0 && CutDirectory(shortenedPath, &name)) // if the path does not end with '\\' (path to a file) { // change of the path to absolute windows path + focus to the file ChangePathToDisk(HWindow, shortenedPath, -1, name, NULL, TRUE, FALSE, FALSE, failReason); @@ -2369,7 +2369,7 @@ BOOL CFilesWindow::ChangeDir(const char* newDir, int suggestedTopIndex, const ch EndStopRefresh(); // snooper will be started again if (failReason != NULL && *failReason == CHPPFR_SUCCESS) *failReason = CHPPFR_FILENAMEFOCUSED; - return FALSE; // listing another path (file name is cut) + return FALSE; // list a different path (without the file name) } else { @@ -2458,7 +2458,7 @@ BOOL CFilesWindow::ChangeDir(const char* newDir, int suggestedTopIndex, const ch EndStopRefresh(); // snopper will be started again if (failReason != NULL) *failReason = textFailReason; - return FALSE; // finished, cannot be repeated + return FALSE; // stop here, cannot retry } goto CHANGE_AGAIN; } @@ -2633,7 +2633,7 @@ void CFilesWindow::ChangeDrive(char drive) } } - if (ifaceForFS != NULL) // post-cmd from context menu of active/detached FS + if (ifaceForFS != NULL) // post-cmd from the context menu of the active/detached FS { ifaceForFS->ExecuteChangeDrivePostCommand(PANEL_SOURCE, postCmd, postCmdParam); } @@ -2641,19 +2641,19 @@ void CFilesWindow::ChangeDrive(char drive) } case drvtPluginFSInOtherPanel: - return; // illegal action (FS from other panel cannot be given to active panel) + return; // invalid action (an FS from the other panel cannot be assigned to the active panel) case drvtPluginCmd: { const char* dllName = (const char*)driveTypeParam; CPluginData* data = Plugins.GetPluginData(dllName); - if (data != NULL) // plugin exists, we can execute the command + if (data != NULL) // plugin exists, execute the command { - if (!fromContextMenu) // FS item command + if (!fromContextMenu) // command for an FS item { data->ExecuteChangeDriveMenuItem(PANEL_SOURCE); } - else // post-cmd from context menu of FS item + else // post-command from the context menu of an FS item { data->GetPluginInterfaceForFS()->ExecuteChangeDrivePostCommand(PANEL_SOURCE, postCmd, postCmdParam); } @@ -2720,13 +2720,13 @@ void CFilesWindow::UpdateDriveIcon(BOOL check) { BOOL destroyIcon; HICON icon = GetPluginFS()->GetFSIcon(destroyIcon); - if (icon != NULL) // defined by plugin + if (icon != NULL) // defined by the plugin { DirectoryLine->SetDriveIcon(icon); if (destroyIcon) HANDLES(DestroyIcon(icon)); } - else // standard + else // default { icon = SalLoadIcon(HInstance, IDI_PLUGINFS, IconSizes[ICONSIZE_16]); DirectoryLine->SetDriveIcon(icon); From eb22a22d41b9528503a1c793d542b673fe4954af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 9 Apr 2026 13:50:19 +0200 Subject: [PATCH 008/710] [tanslation] Fix src/plugins/ftp/ftp.h comments (#379) --- src/plugins/ftp/ftp.h | 200 +++++++++++++++++++++--------------------- 1 file changed, 100 insertions(+), 100 deletions(-) diff --git a/src/plugins/ftp/ftp.h b/src/plugins/ftp/ftp.h index e38247f89..a18083ed0 100644 --- a/src/plugins/ftp/ftp.h +++ b/src/plugins/ftp/ftp.h @@ -93,10 +93,10 @@ extern HICON FTPOperIcon; // (16x16) icon of the operation dialog extern HICON FTPOperIconBig; // large (32x32) icon of the operation dialog extern HCURSOR DragCursor; // cursor for the drag&drop list box in the Connect dialog extern HFONT FixedFont; // font for the Welcome Message dialog (fixed so text layout works better) -extern HFONT SystemFont; // environment font (dialogs, wait window, etc.) +extern HFONT SystemFont; // system font (dialogs, wait window, etc.) extern HICON WarningIcon; // small (16x16) "warning" icon for the operation dialog -// generic Salamander interface - valid from startup until the plug-in is closed +// generic Salamander interface - valid from startup until the plugin is closed extern CSalamanderGeneralAbstract* SalamanderGeneral; // ZLIB compression/decompression interface; @@ -105,11 +105,11 @@ extern CSalamanderZLIBAbstract* SalZLIB; // interface providing customized Windows controls used in Salamander extern CSalamanderGUIAbstract* SalamanderGUI; -// FS name assigned by Salamander after the plug-in is loaded +// FS name assigned by Salamander after the plugin is loaded extern char AssignedFSName[MAX_PATH]; extern int AssignedFSNameLen; // length of AssignedFSName -// FS name for FTP over SSL (FTPS) assigned by Salamander after the plug-in loads +// FS name for FTP over SSL (FTPS) assigned by Salamander after the plugin loads extern char AssignedFSNameFTPS[MAX_PATH]; extern int AssignedFSNameIndexFTPS; // index of AssignedFSNameFTPS extern int AssignedFSNameLenFTPS; // length of AssignedFSNameFTPS @@ -121,7 +121,7 @@ extern unsigned char* UpperCase; // frequently used error message extern const char* LOW_MEMORY; -extern const char* SAVEBITS_CLASSNAME; // class for CWaitWindow +extern const char* SAVEBITS_CLASSNAME; // window class for CWaitWindow extern int GlobalShowLogUID; // UID of the log that FTPCMD_SHOWLOGS should show (-1 == none) extern int GlobalDisconnectPanel; // panel for which disconnect is called (-1 == active panel - source) @@ -191,7 +191,7 @@ void ConnectFTPServer(HWND parent, int panel); void OrganizeBookmarks(HWND parent); // copies the contents of 'newStr' into 'str', reallocates 'str' if needed; sets 'err' (if not NULL) to TRUE -// on low memory; if 'clearMem' is TRUE, wipes memory that stops being used (due to passwords) +// on out-of-memory; if 'clearMem' is TRUE, clears memory that is no longer used (for passwords) void UpdateStr(char*& str, const char* newStr, BOOL* err = NULL, BOOL clearMem = FALSE); // scrambling and the reverse process used for storing passwords in the registry @@ -221,12 +221,12 @@ void GetMyDocumentsPath(char* initDir); char* GetTypeNameForUser(char* typeName, char* buf, int bufSize); // loads from resources the standard column name identified by 'id' (columns for -// "server type" - solution for translating user-defined parsers); +// "server type" - support for translating user-defined parsers); // returns TRUE if 'id' is known BOOL LoadStdColumnStrName(char* buf, int bufSize, int id); // loads from resources the standard column description identified by 'id' (columns for -// "server type" - solution for translating user-defined parsers) +// "server type" - support for translating user-defined parsers) // returns TRUE if 'id' is known BOOL LoadStdColumnStrDescr(char* buf, int bufSize, int id); @@ -238,7 +238,7 @@ BOOL ConvertStringTxtToReg(char* buf, int bufSize, const char* txtStr); // RegEdit cannot import strings with EOLs from .reg files -> replace EOLs (CRLF with '|', // LF with '!' and CR with '$'); -// converts a registry string to a regular string; returns FALSE if the result +// converts a registry string to a normal string; returns FALSE if the result // did not fit into the buffer BOOL ConvertStringRegToTxt(char* buf, int bufSize, const char* regStr); @@ -274,7 +274,7 @@ enum CSrvTypeColumnTypes stctExt, // 2, extension appended to the name (without stctName it makes no sense) stctSize, // 3, size (UNSIGNED INT64) - default empty value in the column is "0" + directories always have value "0" and the panel shows "DIR" stctDate, // 4, date (NOTE: CFileData stores UTC time - requires a local->UTC conversion) - default empty value in the column is "1.1.1602" (adjusted according to regional settings) - stctTime, // 5, time (NOTE: CFileData stores UTC time - requires a local->UTC conversion) - default empty value in the column is "0:00:00" (adjusted according to regional settings) + stctTime, // 5, time (NOTE: CFileData stores UTC time - conversion from UTC to local time is required) - the default empty value in the column is "0:00:00" (adjusted according to regional settings) stctType, // 6, file type description (works only if 'stctExt' is present) // general columns stored outside CFileData (attached before CFileData::PluginData) // NOTE: numbering must match 'stctFirstGeneral' @@ -354,11 +354,11 @@ struct CSrvTypeColumn void LoadFromObj(CSrvTypeColumn* copyFrom); // loads column data from a string (the structure must be new); - // returns success of the operation + // returns whether the operation succeeded BOOL LoadFromStr(const char* str); - // stores the data to buffer 'buf' of size 'bufSize'; returns FALSE only if the data - // do not fit into the buffer + // stores the data in buffer 'buf' of size 'bufSize'; returns FALSE only if the data + // do not fit in the buffer BOOL SaveToStr(char* buf, int bufSize, BOOL ignoreColWidths = FALSE); // allocates a copy of the structure, returns NULL on error @@ -385,16 +385,16 @@ struct CSrvTypeColumn BOOL LoadStr(const char** str, char** result, int limit); }; -// verifies whether the column list is valid (contains a visible Name column at position one -// + the Ext column is visible and can be only at position two + variable names are -// unique and non-empty + column names and descriptions are non-empty + except for the "general/any" type -// the types in the column list are not repeated + the empty value has a permitted -// format according to the column type); returns TRUE if the list is valid, otherwise returns FALSE and -// in 'errResID' (if not NULL) the ID of the error description in resources +// verifies whether the column list is valid (contains a visible Name column +// in the first position + the Ext column is visible and can only be in the second +// position + variable names are unique and non-empty + column names and descriptions +// are non-empty + except for the "general/any" type, types in the column list are not +// repeated + the empty value has a format permitted by the column type); returns TRUE +// if the list is valid, otherwise returns FALSE and stores the resource ID of the error description in 'errResID' (if not NULL) BOOL ValidateSrvTypeColumns(TIndirectArray* columns, int* errResID); -// returns TRUE if the identifier is OK, otherwise returns FALSE and in 'errResID' (if not NULL) -// returns the ID of the error description in resources +// returns TRUE if the identifier is valid, otherwise returns FALSE and stores the resource ID +// of the error description in 'errResID' (if not NULL) BOOL IsValidIdentifier(const char* s, int* errResID); class CFTPAutodetCondNode; @@ -418,7 +418,7 @@ struct CServerType // !!! NOTE: when adding a new variable it is necessary to update all structure methods !!! // helper variable for listing parser autodetection - no need to initialize/copy, etc. - BOOL ParserAlreadyTested; // TRUE if this server type has already been tried on the listing (unsuccessfully) + BOOL ParserAlreadyTested; // TRUE if this server type has already been tried against the listing (unsuccessfully) CServerType() : Columns(5, 5) { Init(); } ~CServerType() { Release(); } @@ -426,11 +426,11 @@ struct CServerType void Init(); // initializes all object variables void Release(); // releases and initializes all object variables - // sets the structure, returns FALSE on error + // sets the structure, returns FALSE on failure BOOL Set(const char* typeName, const char* autodetectCond, int columnsCount, const char* columnsStr[], const char* rulesForParsing); - // sets the structure (except for 'typeName' it takes everything from 'copyFrom'), returns FALSE on error + // sets the structure (everything except 'typeName' is taken from 'copyFrom'); returns FALSE on failure BOOL Set(const char* typeName, CServerType* copyFrom); // loads the structure, returns TRUE if the item is valid (should be added to the list) @@ -463,8 +463,8 @@ class CServerTypeList : public TIndirectArray // adds a server type to the list BOOL AddServerType(const char* typeName, CServerType* copyFrom); - // adds names to the combo box + returns the index of type 'serverType' in 'index' (if - // not found, returns 'index'==-1); 'serverType' may also be NULL (returns 'index'==-1) + // adds names to the combo box and returns the index of server type 'serverType' in 'index' (if + // not found, 'index' is set to -1); 'serverType' may also be NULL ('index' is set to -1) void AddNamesToCombo(HWND combo, const char* serverType, int& index); // adds names to the list box @@ -480,9 +480,9 @@ class CServerTypeList : public TIndirectArray BOOL CopyItemsFrom(CServerTypeList* list); // returns TRUE if the list already contains the name 'typeName' (regardless of "user defined"); - // if 'exclude' is not NULL, it is an item to exclude from the search (used when renaming so - // the item being renamed is not found); in 'index' (if not NULL) - // returns the index of the found item (-1 if the item is not found) + // if 'exclude' is not NULL, it is the item to exclude from the search (used when renaming so + // the item being renamed is not found); the index of the found item is returned in 'index' + // (if not NULL), or -1 if the item is not found BOOL ContainsTypeName(const char* typeName, CServerType* exclude, int* index = NULL); }; @@ -503,7 +503,7 @@ struct CFTPServer int SavePassword; // TRUE = password should be stored on media (registry/config file) int ProxyServerUID; // proxy server: -2 = default, -1 = not used, otherwise the proxy server UID from Config.FTPProxyServerList char* TargetPanelPath; // if not NULL or "", the target path in the panel should be set (max. MAX_PATH-1 characters) - char* ServerType; // server type (for listing) - NULL == auto-detect, otherwise a textual name (format see CServerType::TypeName; the server list will gradually expand) (max. SERVERTYPE_MAX_SIZE-1 characters) + char* ServerType; // server type (for listing) - NULL == auto-detect, otherwise a textual name (format see CServerType::TypeName; the list of server types will gradually expand) (max. SERVERTYPE_MAX_SIZE-1 characters) char* ListCommand; // command for listing - NULL == LIST_CMD_TEXT, otherwise the command text int TransferMode; // 0 - default, 1 - binary, 2 - ascii, 3 - auto (uses Config.ASCIIFileMasks) int Port; // port of the server we connect to (standard FTP port is IPPORT_FTP) @@ -522,7 +522,7 @@ struct CFTPServer int EncryptDataConnection; // 0 - no, 1 - yes int CompressData; // 0 - no; 1-9 - zlib levels; -1 - default, based on configuration - // !!! NOTE: when adding a new variable it is necessary to update all structure methods !!! + // !!! NOTE: when adding a new variable, all methods of this structure must be updated !! CFTPServer() { Init(); } ~CFTPServer() { Release(); } @@ -532,8 +532,8 @@ struct CFTPServer // releases and zeroes the structure data void Release(); - // allocates a copy of the structure, returns NULL on error - // NOTE: clears user-name, password, and save-passwd when anonymous connection is enabled + // allocates a copy of the structure; returns NULL on failure + // WARNING: clears user-name, password, and save-passwd when anonymous connection is enabled CFTPServer* MakeCopy(); // sets the structure, returns FALSE on error @@ -566,7 +566,7 @@ struct CFTPServer int encryptDataConnection, int compressData); - // sets the structure based on source 'src', returns FALSE on error + // sets the structure based on source 'src', returns FALSE on failure BOOL Set(const CFTPServer& src) { return Set(src.ItemName, @@ -599,14 +599,14 @@ struct CFTPServer src.CompressData); } - // loads the structure, returns TRUE if the item is valid (should be added to the list) + // Loads the structure; returns TRUE if the item is valid (it should be added to the list). BOOL Load(HWND parent, HKEY regKey, CSalamanderRegistryAbstract* registry); // saves the structure void Save(HWND parent, HKEY regKey, CSalamanderRegistryAbstract* registry); - // returns TRUE if the (plain) password can be obtained; - // if a master password is used and not entered, asks the user for it (the window is shown via 'hParent); - // if the user did not enter the correct master password or it could not decrypt the password, returns FALSE + // returns TRUE if the plaintext password can be obtained; + // if a master password is used and has not been entered, asks the user for it (the dialog is shown with hParent as parent); + // if the user did not enter the correct master password or the password could not be decrypted with it, returns FALSE BOOL EnsurePasswordCanBeDecrypted(HWND hParent); }; @@ -617,8 +617,8 @@ class CFTPServerList : public TIndirectArray public: CFTPServerList() : TIndirectArray(10, 10) {} - // copies (allocates) all list items into list 'dstList' (first completely deletes it) - // NOTE: clears user-name, password, and save-passwd when anonymous connection is enabled + // copies (allocates) all list items into 'dstList' (clears it completely first) + // WARNING: clears user name, password, and save-passwd when anonymous connection is enabled BOOL CopyMembersToList(CFTPServerList& dstList); // adds a bookmark to the FTP server list @@ -731,32 +731,32 @@ struct CProxyScriptParams // helper structure for running proxy scripts CProxyScriptParams(); }; -// validates or gradually executes a proxy script; during validation '*execPoint', +// validates or executes a proxy script step by step; during validation, '*execPoint', // 'scriptParams', 'hostBuf', 'port', 'sendCmdBuf', and 'logCmdBuf' are NULL and 'lastCmdReply'==-1; -// the function returns TRUE if the script is OK (FALSE on error, with the error text in 'errDescrBuf'); +// the function returns TRUE if the script is valid (FALSE on error, with the error text in 'errDescrBuf'); // 'script' is the proxy script text; '*execPoint' ('execPoint' must not be NULL) is -// the current execution position (the script is executed step by step); if it is NULL, we start -// validation/execution from the beginning of the script; 'lastCmdReply' is the result of the command from the previous -// line (-1 = previous line was skipped or this is the first line); 'scriptParams' -// contains the input values of individual variables; possible results of the +// the current execution position; if it is NULL, validation/execution starts at the beginning +// of the script; 'lastCmdReply' is the result of the command from the previous +// line (-1 = the previous line was skipped or this is the first line); on input, 'scriptParams' +// contains the values of the individual variables; possible results of the // ProcessProxyScript function: -// - script error: the function returns FALSE + the error position is returned in '*execPoint' + the error +// - script error: the function returns FALSE, the error position is returned in '*execPoint', and the error // description is in 'errDescrBuf' // - missing variable value: the function returns TRUE and scriptParams->NeedUserInput() -// returns TRUE (the value of '*execPoint' does not change) -// - successfully determined host:port to connect to (only at the beginning of the script): returns TRUE -// and returns the connection target in 'hostBuf'+'port'; '*execPoint' points to the start +// returns TRUE ('*execPoint' is unchanged) +// - successfully determined host:port to connect to (only at the beginning of the script): returns TRUE, +// and 'hostBuf' and 'port' receive the destination; '*execPoint' points to the start // of the next script line -// - successfully determined which command to send to the server (not possible at the beginning of the script): returns -// TRUE and 'sendCmdBuf' contains the command (including CRLF at the end), 'logCmdBuf' contains the +// - successfully determined command to send to the server (not possible at the beginning of the script): returns +// TRUE, 'sendCmdBuf' contains the command (including CRLF at the end), and 'logCmdBuf' contains the // log text (the password is replaced with "(hidden)"); '*execPoint' points to the start // of the next script line -// - end of script (not possible at the beginning of the script): returns TRUE and 'sendCmdBuf' is an empty -// string; '*execPoint' points to the end of the script; +// - end of script (not possible at the beginning of the script): returns TRUE, 'sendCmdBuf' is an empty +// string, and '*execPoint' points to the end of the script; // 'hostBuf' (if not NULL) is a buffer of size HOST_MAX_SIZE characters; 'sendCmdBuf' // and 'logCmdBuf' (if not NULL) are buffers of size FTPCOMMAND_MAX_SIZE characters; // 'errDescrBuf' is a buffer of size 300 characters; 'proxyHostNeeded' (if not NULL) -// returns TRUE if ProxyHost must be specified (we connect to it) +// is set to TRUE if ProxyHost must be specified (the connection is made to it) BOOL ProcessProxyScript(const char* script, const char** execPoint, int lastCmdReply, CProxyScriptParams* scriptParams, char* hostBuf, unsigned short* port, char* sendCmdBuf, char* logCmdBuf, char* errDescrBuf, @@ -770,7 +770,7 @@ const char* GetProxyScriptText(CFTPProxyServerType type, BOOL textForDialog); // returns the default port for a proxy server of the given type unsigned short GetProxyDefaultPort(CFTPProxyServerType type); -// returns TRUE if the given proxy server type uses a password for the proxy server +// returns TRUE if the given proxy server type uses a proxy server password BOOL HavePassword(CFTPProxyServerType type); // returns TRUE if the given proxy server type uses the proxy server address and port @@ -819,7 +819,7 @@ struct CFTPProxyServer char* ProxyScript; // only for ProxyType==fpstOwnScript (otherwise NULL): script for connecting to the FTP server - // !!! NOTE: when adding a new variable it is necessary to update all structure methods !!! + // !!! NOTE: when adding a new variable, all methods of this structure must be updated ! CFTPProxyServer(int proxyUID) { Init(proxyUID); } ~CFTPProxyServer() { Release(); } @@ -829,10 +829,10 @@ struct CFTPProxyServer // releases and zeroes the structure data void Release(); - // allocates a copy of the structure, returns NULL on error + // allocates a copy of the structure, returns NULL on failure CFTPProxyServer* MakeCopy(); - // allocates a CFTPProxyForDataCon structure, returns NULL on error + // allocates a CFTPProxyForDataCon structure, returns NULL on failure CFTPProxyForDataCon* AllocProxyForDataCon(DWORD proxyHostIP, const char* host, DWORD hostIP, unsigned short hostPort); @@ -848,7 +848,7 @@ struct CFTPProxyServer // sets ProxyUser BOOL SetProxyUser(const char* proxyUser); - // sets the structure, returns FALSE on error + // sets the structure; returns FALSE on failure BOOL Set(int proxyUID, const char* proxyName, CFTPProxyServerType proxyType, @@ -860,7 +860,7 @@ struct CFTPProxyServer int saveProxyPassword, const char* proxyScript); - // sets the structure based on source 'src', returns FALSE on error + // sets the structure based on source 'src', returns FALSE on failure BOOL Set(const CFTPProxyServer& src) { return Set(src.ProxyUID, @@ -875,7 +875,7 @@ struct CFTPProxyServer src.ProxyScript); } - // loads the structure, returns TRUE if the item is valid (should be added to the list) + // Loads the structure; returns TRUE if the item is valid (it should be added to the list). BOOL Load(HWND parent, HKEY regKey, CSalamanderRegistryAbstract* registry); // saves the structure void Save(HWND parent, HKEY regKey, CSalamanderRegistryAbstract* registry); @@ -901,7 +901,7 @@ class CFTPProxyServerList : protected TIndirectArray // (non-empty and unique among the other proxy servers) BOOL IsProxyNameOK(CFTPProxyServer* proxyServer, const char* proxyName); - // copies (allocates) all elements of the list into the list 'dstList' (first deletes it completely) + // copies (allocates) all elements of the list into 'dstList' (first clears it completely) BOOL CopyMembersToList(CFTPProxyServerList& dstList); // fills the "Proxy Server" combo box; 'combo' is the combo box; 'focusProxyUID' is the UID of the server @@ -976,9 +976,9 @@ class CFTPProxyServerList : protected TIndirectArray // returns TRUE if the server list contains an item whose password is not encrypted with AES (only scrambled) BOOL ContainsUnsecuredPassword(); - // returns TRUE if the (plain) password for the proxy server with UID 'proxyServerUID' can be obtained; - // if a master password is used and not entered, asks the user for it (window is shown via 'hParent) - // if the user did not enter the correct master password or it could not decrypt the password, returns FALSE + // returns TRUE if the plain password for the proxy server with UID 'proxyServerUID' can be obtained; + // if a master password is used and has not been entered, asks the user for it (the window is shown with 'hParent' as the parent); + // if the user does not enter the correct master password or the password cannot be decrypted with it, returns FALSE BOOL EnsurePasswordCanBeDecrypted(HWND hParent, int proxyServerUID); }; @@ -1036,16 +1036,16 @@ class CConfiguration int UseMaxClosedConLogs; // TRUE = use MaxClosedConLogs int MaxClosedConLogs; // maximum number of logs of closed connections (older ones are discarded) int AlwaysShowLogForActPan; // TRUE = activate the log when the FTP connection becomes active in the panel - int DisableLoggingOfWorkers; // TRUE = disable logging of worker communication with the server + int DisableLoggingOfWorkers; // TRUE = disable logging of workers' communication with the server WINDOWPLACEMENT LogsDlgPlacement; // position of the Logs dialog WINDOWPLACEMENT OperDlgPlacement; // position of the Operations dialog (user's last setting) double OperDlgSplitPos; // position of the splitter between list views in the Operations dialog - int CloseOperationDlgIfSuccessfullyFinished; // TRUE = automatically close the operations dialog when an operation finishes without errors/questions in the untouched dialog + int CloseOperationDlgIfSuccessfullyFinished; // TRUE = automatically close the operations dialog when an operation finishes without errors or prompts, if the dialog was left untouched int CloseOperationDlgWhenOperFinishes; // TRUE = close the operations dialog after the operation completes (if no Solve Error dialog is open) int OpenSolveErrIfIdle; // TRUE = automatically open the Solve Error dialog when it is idle - char* CommandHistory[COMMAND_HISTORY_SIZE]; // history of FTP commands (from the "Send FTP Command" command) + char* CommandHistory[COMMAND_HISTORY_SIZE]; // history of FTP commands (from the "Send FTP Command" dialog) int SendSecretCommand; // last state of the "Secret command" checkbox in the "Send FTP Command" dialog char* HostAddressHistory[HOSTADDRESS_HISTORY_SIZE]; // history of server addresses in the Connect to FTP Server dialog @@ -1373,21 +1373,21 @@ class CFTPListingPluginDataInterface : public CPluginDataInterfaceAbstract // prepares data in file.PluginData for further use (deallocates and clears strings) void ClearPluginData(CFileData& file); - // stores the allocated string 'str' into the structure 'file' into column 'column'; + // stores the allocated string 'str' in column 'column' of the 'file' structure; // 'str' is deallocated when ReleasePluginData() is called for 'file'; when - // overwriting a string the overwritten string is deallocated + // overwriting a string, the overwritten string is deallocated void StoreStringToColumn(CFileData& file, int column, char* str); - // stores day 'day' into the structure 'file' into column 'column' into a CFTPDate structure + // stores day 'day' in column 'column' of the 'file' structure in a CFTPDate structure void StoreDayToColumn(CFileData& file, int column, BYTE day); - // stores month 'month' into the structure 'file' into column 'column' into a CFTPDate structure + // stores month 'month' in column 'column' of the 'file' structure in a CFTPDate structure void StoreMonthToColumn(CFileData& file, int column, BYTE month); - // stores year 'year' into the structure 'file' into column 'column' into a CFTPDate structure + // stores year 'year' in column 'column' of the 'file' structure in a CFTPDate structure void StoreYearToColumn(CFileData& file, int column, WORD year); - // stores date 'day'+'month'+'year' into the structure 'file' into column 'column' into a CFTPDate structure + // stores date 'day'+'month'+'year' in column 'column' of the 'file' structure in a CFTPDate structure void StoreDateToColumn(CFileData& file, int column, BYTE day, BYTE month, WORD year); // stores time 'hour'+'minute'+'second'+'millisecond' into the structure 'file' into column 'column' @@ -1395,22 +1395,22 @@ class CFTPListingPluginDataInterface : public CPluginDataInterfaceAbstract void StoreTimeToColumn(CFileData& file, int column, BYTE hour, BYTE minute, BYTE second, WORD millisecond); - // stores number 'number' into the structure 'file' into column 'column' + // stores the number 'number' in column 'column' of the 'file' structure void StoreNumberToColumn(CFileData& file, int column, __int64 number); // returns a string from the structure 'file' from column 'column' char* GetStringFromColumn(const CFileData& file, int column); - // returns (in the relevant part of the structure 'stVal') the date from the structure 'file' from column 'column' + // returns the date from column 'column' of the 'file' structure in the corresponding part of the 'stVal' structure void GetDateFromColumn(const CFileData& file, int column, SYSTEMTIME* stVal); - // returns in 'date' the date from the structure 'file' from column 'column' + // returns the date from column 'column' of the 'file' structure in 'date' void GetDateFromColumn(const CFileData& file, int column, CFTPDate* date); - // returns (in the relevant part of the structure 'stVal') the time from the structure 'file' from column 'column' + // returns the time from column 'column' of the 'file' structure in the corresponding part of the 'stVal' structure void GetTimeFromColumn(const CFileData& file, int column, SYSTEMTIME* stVal); - // returns in 'time' the time from the structure 'file' from column 'column' + // returns the time from column 'column' of the 'file' structure in 'time' void GetTimeFromColumn(const CFileData& file, int column, CFTPTime* time); // returns a number from the structure 'file' from column 'column'; @@ -1420,9 +1420,9 @@ class CFTPListingPluginDataInterface : public CPluginDataInterfaceAbstract // finds the "Rights" column with textual content; if it does not exist, returns -1 int FindRightsColumn(); - // if the size of the file 'file' is known, returns TRUE and the size in 'size' and - // in 'inBytes' returns TRUE/FALSE depending on whether the size is in bytes/blocks; - // if the file size is not known, returns FALSE and does not modify 'size' or 'inBytes' + // if the size of file 'file' is known, returns TRUE, stores the size in 'size', and + // sets 'inBytes' to TRUE/FALSE depending on whether the size is in bytes or blocks; + // if the file size is not known, returns FALSE and leaves 'size' and 'inBytes' unchanged BOOL GetSize(const CFileData& file, CQuadWord& size, BOOL& inBytes); // returns the base name - currently used only when trimming version numbers from @@ -1432,9 +1432,9 @@ class CFTPListingPluginDataInterface : public CPluginDataInterfaceAbstract // an auxiliary buffer (size at least MAX_PATH) into which the adjusted name is stored void GetBasicName(const CFileData& file, char** name, char** ext, char* buffer); - // returns the date and time of the last write to the file; in 'dateAndTimeValid' returns - // FALSE if this date+time is not known; also returns "empty values": - // for the date it sets date->Day == 0, for the time it sets time->Hour == 24 + // returns the date and time of the last write to the file; sets 'dateAndTimeValid' to + // FALSE if this date and time are not known; also returns "empty values": + // for the date, date->Day == 0; for the time, time->Hour == 24 void GetLastWriteDateAndTime(const CFileData& file, BOOL* dateAndTimeValid, CFTPDate* date, CFTPTime* time); @@ -1505,9 +1505,9 @@ class CPluginFSInterface : public CPluginFSInterfaceAbstract CTopIndexMem TopIndexMem; // top-index memory for ExecuteOnFS() CControlConnectionSocket* ControlConnection; // "control connection" socket to the FTP server (NULL == never connected) - char RescuePath[FTP_MAX_PATH]; // rescue path on FTP - try when ChangePath() can no longer shorten the path + char RescuePath[FTP_MAX_PATH]; // fallback path on FTP - try it when ChangePath() can no longer shorten the path char HomeDir[FTP_MAX_PATH]; // default path on FTP - set after logging into the server - BOOL OverwritePathListing; // if TRUE, PathListing should be overwritten with a new listing (once/if we obtain it) - handles the situation when ChangePath is called and ListCurrentPath is no longer invoked because the path did not change + BOOL OverwritePathListing; // if TRUE, PathListing should be overwritten with a new listing if one is obtained - handles the situation when ChangePath is called and ListCurrentPath is no longer invoked because the path did not change char* PathListing; // if not NULL, contains at least part (can also be "") of the listing of the current path int PathListingLen; // length of the string in PathListing CFTPDate PathListingDate; // date when the listing was obtained (needed for "year_or_time") @@ -1530,7 +1530,7 @@ class CPluginFSInterface : public CPluginFSInterfaceAbstract BOOL InformAboutUnknownSrvType; // TRUE until the user is informed that we cannot find a listing parser (unsupported server type) BOOL NextRefreshCanUseOldListing; // TRUE only if only the configuration changed (parsers, columns) and therefore it is not necessary to read the listing from the server again - BOOL NextRefreshWontClearCache; // TRUE only if the refresh happened based on a "change on path" notification and it is therefore not necessary to clear the current path from the cache (done elsewhere) + BOOL NextRefreshWontClearCache; // TRUE only if the refresh was triggered by a "change on path" notification, so the current path does not need to be cleared from the cache (done elsewhere) int TransferMode; // file transfer mode (binary/ascii/auto) (values of type CTransferMode) @@ -1542,10 +1542,10 @@ class CPluginFSInterface : public CPluginFSInterfaceAbstract CPluginFSInterface(); ~CPluginFSInterface(); - // creates the user-part of an FTP path - format "//user@host:port/path"; 'buffer' is - // the buffer for the result with size 'bufferSize' bytes; 'path' is the FTP path, if - // 'path' is NULL the current FTP path is used; if 'ignorePath' is TRUE the user-part - // path is created without the FTP path; returns TRUE if the buffer 'buffer' + // creates the user part of an FTP path in the format "//user@host:port/path"; 'buffer' is + // the output buffer of size 'bufferSize' bytes; 'path' is the FTP path; if + // 'path' is NULL, the current FTP path is used; if 'ignorePath' is TRUE, the user part + // is created without the FTP path; returns TRUE if 'buffer' // is large enough for the result (otherwise the result is truncated and FALSE is returned) BOOL MakeUserPart(char* buffer, int bufferSize, char* path = NULL, BOOL ignorePath = FALSE); @@ -1645,16 +1645,16 @@ class CPluginFSInterface : public CPluginFSInterfaceAbstract // simply calls IsListCommandLIST_a() on the control connection BOOL IsListCommandLIST_a(); - // opens the operation progress window and runs it in the active "control connection" - // (the items are processed in a worker created based on the active control connection - // in the panel (when called, ControlConnection is guaranteed to be not NULL)); - // 'parent' is the "foreground" window of the thread (after pressing ESC it is used to - // determine whether ESC was pressed in this window and not in another application; in the main thread it is + // opens the operation progress window and starts the operation on the active "control connection" + // (the items are processed by a worker created from the active control connection + // in the panel (when called, ControlConnection is guaranteed to be non-NULL)); + // 'parent' is the thread's "foreground" window (after ESC is pressed, it is used to + // determine whether ESC was pressed in this window and not, for example, in another application; in the main thread it is // SalamanderGeneral->GetMsgBoxParent() or a dialog opened by the plugin); returns TRUE - // when the operation starts successfully (otherwise an error occurs and the operation is cancelled) + // if the operation starts successfully (otherwise an error occurs and the operation is canceled) BOOL RunOperation(HWND parent, int operUID, CFTPOperation* oper, HWND dropTargetWnd); - // returns TRUE if the "control connection" has the UID 'controlConUID' + // returns TRUE if there is a "control connection" with UID 'controlConUID' BOOL ContainsConWithUID(int controlConUID); // simply forwards the call to ControlConnection->GetConnectionFromWorker From 91743280ddf5784bd1c04fa1227b5c282df29a17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 9 Apr 2026 14:15:25 +0200 Subject: [PATCH 009/710] [tanslation] Fix src/plugins/ftp/ctrlcon.h comments (#380) --- src/plugins/ftp/ctrlcon.h | 128 +++++++++++++++++++------------------- 1 file changed, 64 insertions(+), 64 deletions(-) diff --git a/src/plugins/ftp/ctrlcon.h b/src/plugins/ftp/ctrlcon.h index 0efd1a333..292132b56 100644 --- a/src/plugins/ftp/ctrlcon.h +++ b/src/plugins/ftp/ctrlcon.h @@ -12,10 +12,10 @@ // returns 'buf' char* CopyStr(char* buf, int bufSize, const char* txt, int size); -// helper function for decomposing a string with initial FTP commands (separated by ';') +// helper function for splitting a string with initial FTP commands (separated by ';') // into individual commands; returns TRUE if another command is available (the // command is returned in 's'); 'next' is an IN/OUT variable, initialize it to -// the start of the string and leave it unchanged between calls to GetToken +// the start of the string and do not modify it between calls to GetToken BOOL GetToken(char** s, char** next); // command codes for PrepareFTPCommand (parameters in [] are passed through the ellipsis) @@ -53,7 +53,7 @@ enum CFtpCmdCode BOOL PrepareFTPCommand(char* buf, int bufSize, char* logBuf, int logBufSize, CFtpCmdCode ftpCmd, int* cmdLen, ...); -// helper function for preparing error texts +// helper function for preparing error messages const char* GetFatalErrorTxt(int fatalErrorTextID, char* errBuf); // helper function for preparing error texts const char* GetOperationFatalErrorTxt(int opFatalError, char* errBuf); @@ -164,13 +164,13 @@ class CLogData unsigned short Port; // port used on the server char* User; // user name - BOOL CtrlConOrWorker; // TRUE/FALSE = logging the "control connection" from the panel / from a worker + BOOL CtrlConOrWorker; // TRUE/FALSE = the "control connection" log is from the panel / from a worker BOOL WorkerIsAlive; // TRUE/FALSE = the worker exists / no longer exists // the "control connection" we are logging (NULL == FS no longer exists); // WARNING: we must not access the "control connection" object - nesting critical sections is forbidden CControlConnectionSocket* CtrlCon; BOOL Connected; // TRUE/FALSE == active/inactive "control connection" (panel and worker) - int DisconnectNum; // if (CtrlCon==NULL && !WorkerIsAlive), holds the number describing how old the dead log is (so that we always delete starting from the longest dead log) + int DisconnectNum; // if (CtrlCon==NULL && !WorkerIsAlive), holds how long the log has been dead (so that we always delete the log that has been dead the longest first) CDynString Text; // the actual log text int SkippedChars; // number of skipped characters since the last output to the edit window in Logs @@ -244,9 +244,9 @@ class CLogs // called after logging parameters change in the configuration void ConfigChanged(); - // adds logs to the combo box; returns the focus in 'focusIndex' (must not be NULL) based on - // 'prevItemUID' (the UID of the item we want to select, it may also be -1); if 'prevItemUID' - // is not found, it returns -1 in 'focusIndex'; in 'empty' (must not be NULL) it returns TRUE if + // adds logs to the combo box; stores the focus index in 'focusIndex' (must not be NULL) based on + // 'prevItemUID' (the UID of the item to select, which may also be -1); if 'prevItemUID' + // is not found, it stores -1 in 'focusIndex'; stores TRUE in 'empty' (must not be NULL) if // no logs exist void AddLogsToCombo(HWND combo, int prevItemUID, int* focusIndex, BOOL* empty); @@ -357,14 +357,14 @@ class CListingCache CListingCache(); ~CListingCache(); - // returns TRUE if a usable listing of the path 'path' (of type 'pathType') is available on the - // server 'host', where user 'user' is connected on port 'port'; the listing is returned in the - // allocated string 'cachedListing' (must not be NULL; returning NULL means an allocation error), - // the string length is returned in 'cachedListingLen' (must not be NULL); the caller is - // responsible for deallocation; the date when the listing was captured is returned in - // 'cachedListingDate' (must not be NULL); 'path' returns the exact text of the cached path (as - // provided by the server when it was inserted into the cache); 'path' is a buffer of size - // 'pathBufSize' bytes + // returns TRUE if a usable listing of path 'path' (of type 'pathType') is available on server + // 'host' for user 'user' connected on port 'port'; the listing is returned in an allocated + // string via 'cachedListing' (the parameter must not be NULL; a NULL returned pointer + // indicates a memory allocation error), its length is returned in 'cachedListingLen' (must not + // be NULL); the caller is responsible for deallocation; the date when the listing was captured + // is returned in 'cachedListingDate' (must not be NULL); 'path' receives the exact text of the + // cached path (as returned by the server when it was inserted into the cache); 'path' is a + // buffer of size 'pathBufSize' bytes // can be called from any thread BOOL GetPathListing(const char* host, unsigned short port, const char* user, CFTPServerPathType pathType, char* path, int pathBufSize, @@ -493,9 +493,9 @@ class CSendCmdUserIfaceAbstract // CanFinishSending() that // returns FALSE virtual void HandleDataConTimeout(DWORD* start) = 0; // called only if - // BeforeWaitingForFinish - // returns TRUE in - // 'useTimeout' + // BeforeWaitingForFinish() + // sets 'useTimeout' to + // TRUE virtual HANDLE GetFinishedEvent() = 0; // once it is signaled, // CanFinishSending() is // tested again @@ -881,21 +881,21 @@ class CControlConnectionSocket : public CSocket // checks whether 'ServerSystem' contains the name 'systemName' BOOL IsServerSystem(const char* systemName); - // if the "control connection" is closed, offers the user to reopen it (WARNING: does not set the - // working directory on the server); returns TRUE when the "control connection" is ready for use, - // and in that case sets SetStartTime() (so further waiting can continue after a possible - // reconnect); 'notInPanel' is TRUE for a detached FS (not in a panel); if 'notInPanel' is FALSE, - // the connection is in a panel - if 'leftPanel' is TRUE it is the left panel, otherwise the right - // panel; 'parent' is the thread's foreground window (after ESC is pressed it is used to detect - // whether ESC was pressed in this window and not, for example, in another application; in the - // main thread this is SalamanderGeneral->GetMsgBoxParent() or a dialog opened by the plugin); - // 'parent' is also the parent of any error message boxes; 'userBuf' + 'userBufSize' is the buffer - // for a new user name on the FTP server (it may change during reconnect); 'reconnected' (if not - // NULL) returns TRUE when the connection was restored (the "control connection" was reopened); if - // 'setStartTimeIfConnected' is FALSE and reconnecting is unnecessary, SetStartTime() is not set; - // 'totalAttemptNum' + 'retryMsg' + 'reconnectErrResID' + 'useFastReconnect' are parameters for - // StartControlConnection(); 'userRejectsReconnect' (if not NULL) returns TRUE if the user refuses - // to perform a reconnect + // if the "control connection" is closed, offers to reopen it (WARNING: does not set the + // working directory on the server); returns TRUE if the "control connection" is ready for use, + // and in that case also sets SetStartTime() (so any further waiting can continue after a possible + // reconnect); 'notInPanel' is TRUE for a detached file system (not in a panel); if 'notInPanel' + // is FALSE, the connection is in a panel - if 'leftPanel' is TRUE, it is the left panel; + // otherwise it is the right panel; 'parent' is the thread's foreground window (after ESC is + // pressed, it is used to detect whether ESC was pressed in this window and not, for example, in + // another application; in the main thread this is SalamanderGeneral->GetMsgBoxParent() or a + // dialog opened by the plugin); 'parent' is also the parent of any error message boxes; + // 'userBuf' + 'userBufSize' is a buffer for the new user name on the FTP server (it may change + // during reconnect); 'reconnected' (if not NULL) returns TRUE if the connection was restored (the + // "control connection" was reopened); if 'setStartTimeIfConnected' is FALSE and reconnecting is + // not needed, SetStartTime() is not set; 'totalAttemptNum' + 'retryMsg' + + // 'reconnectErrResID' + 'useFastReconnect' are parameters for StartControlConnection(); + // 'userRejectsReconnect' (if not NULL) returns TRUE if the user refuses to reconnect // can be called only from the main thread (uses wait windows, etc.) BOOL ReconnectIfNeeded(BOOL notInPanel, BOOL leftPanel, HWND parent, char* userBuf, int userBufSize, BOOL* reconnected, BOOL setStartTimeIfConnected, @@ -903,8 +903,8 @@ class CControlConnectionSocket : public CSocket BOOL* userRejectsReconnect, int reconnectErrResID, BOOL useFastReconnect); - // sends a command to the FTP server and returns the server's reply (WARNING: does not return - // replies of type FTP_D1_MAYBESUCCESS - it automatically waits for the next server reply); + // sends a command to the FTP server and returns the server's reply (WARNING: replies of type + // FTP_D1_MAYBESUCCESS are not returned - it automatically waits for the next server reply); // 'parent' is the thread's foreground window (after ESC is pressed it is used to detect whether // ESC was pressed in this window and not, for example, in another application; in the main thread // this is SalamanderGeneral->GetMsgBoxParent() or a dialog opened by the plugin); 'parent' is also @@ -915,25 +915,25 @@ class CControlConnectionSocket : public CSocket // first ESC sends "ABOR" (probably only makes sense for commands with a data connection) and the // connection is aborted only after the second ESC; if 'allowCmdAbort' is FALSE, the connection is // aborted after the first ESC; if 'resetWorkingPathCache' is TRUE, ResetWorkingPathCache() is - // called after sending the command (used when the command may change the current working - // directory); if 'resetCurrentTransferModeCache' is TRUE, ResetCurrentTransferModeCache() is called - // after sending the command (used when the command may change the current transfer mode); returns - // TRUE if sending the command or aborting it and receiving the reply succeeded; 'cmdAborted' - // (if not NULL) returns TRUE when the command was successfully aborted; the reply code is returned - // in 'ftpReplyCode' (must not be NULL) - it is valid (!=-1) even when 'cmdAborted' == TRUE; the + // called after sending the command (used when the command may change the current working path); + // if 'resetCurrentTransferModeCache' is TRUE, ResetCurrentTransferModeCache() is called after + // sending the command (used when the command may change the current transfer mode); returns TRUE + // if sending the command or aborting it and receiving the reply succeeded; 'cmdAborted' (if not + // NULL) returns TRUE when the command was successfully aborted; the reply code is returned in + // 'ftpReplyCode' (must not be NULL) - it is valid (!=-1) even when 'cmdAborted' == TRUE; the // reply text is stored in the buffer 'ftpReplyBuf' (maximum size 'ftpReplyBufSize'), // null-terminated - if it is longer than the buffer, it is simply truncated; if - // 'specialUserInterface' is NULL, the standard wait window is used for the user interface, - // otherwise the object provided via 'specialUserInterface' should be used (for example when - // listing the current path); - // returns FALSE if the connection was interrupted (on timeout it automatically closes the - // connection hard - sending "QUIT" makes no sense); if 'canRetry' is not NULL, the error text can - // be returned in 'retryMsg' (buffer of size 'retryMsgBufSize') - 'canRetry' returns TRUE; otherwise - // the error is shown in a message box ('canRetry' is either NULL or FALSE is returned there); - // can be called only from the main thread (uses wait windows, etc.) + // 'specialUserInterface' is NULL, the standard wait window is used for the user interface; + // otherwise, the object provided via 'specialUserInterface' is used (for example when listing the + // current path); + // returns FALSE if the connection is interrupted (on timeout it automatically forcibly closes the + // connection - sending "QUIT" makes no sense); if 'canRetry' is not NULL, the error text may be + // returned in 'retryMsg' (a buffer of size 'retryMsgBufSize') and TRUE is returned in 'canRetry'; + // otherwise, the error is shown in a message box ('canRetry' is either NULL or FALSE is returned + // in it); can be called only from the main thread (uses wait windows, etc.) // - // WARNING: when aborting commands ('allowCmdAbort'==TRUE) the system for receiving server replies - // is not fully resolved (servers return either one reply just for ABOR or two replies + // WARNING: when aborting commands ('allowCmdAbort'==TRUE), the handling of server replies is not + // fully resolved (servers return either one reply just for ABOR or two replies // (list + abort); unfortunately both use code 226, so it is impossible to tell which case // occurred) - this is handled by trying to receive everything the server sends in one // packet (it probably sends both replies together); any additional replies are ignored as @@ -1061,20 +1061,20 @@ class CControlConnectionSocket : public CSocket char* userBuf, int userBufSize, BOOL isVMS, BOOL isDir); // sends a request to open a "listen" port (either on the local machine or on the proxy server) for - // the data connection 'dataConnection'; inputs 'listenOnIP' + 'listenOnPort' specify the IP+port - // where the "listen" port should be opened (makes sense only without a proxy server); - // 'parent' is the thread's foreground window (after ESC is pressed it is used to detect whether ESC + // the data connection 'dataConnection'; on input, 'listenOnIP' + 'listenOnPort' specify the IP+port + // where the "listen" port should be opened (relevant only without a proxy server); + // 'parent' is the thread's foreground window (after ESC is pressed, it is used to detect whether ESC // was pressed in this window and not, for example, in another application; in the main thread this // is SalamanderGeneral->GetMsgBoxParent() or a dialog opened by the plugin); 'parent' is also the // parent of any error message boxes; 'waitWndTime' is the delay before displaying the wait window; - // returns TRUE on success - 'listenOnIP' + 'listenOnPort' then contain the IP+port where we wait - // for the FTP server to connect; returns FALSE if an interruption or error occurred; if retrying is - // meaningful, the connection is forcibly closed (we could send "QUIT", but for now we simplify - // our lives) and the error text is returned in 'retryMsg' (buffer of size 'retryMsgBufSize', must - // not be 0) and 'canRetry' (must not be NULL) returns TRUE; if retrying makes no sense, the error - // is shown in a message box and 'canRetry' returns FALSE (the connection is not interrupted); - // 'errBuf' is a helper buffer of size 'errBufSize' (must not be 0) - used for texts displayed in - // message boxes; + // returns TRUE on success - 'listenOnIP' + 'listenOnPort' then contain the IP+port where the + // connection from the FTP server is expected; returns FALSE if an interruption or error occurs; if + // retrying makes sense, the connection is forcibly closed ("QUIT" could be sent instead, but this is + // kept simpler for now), the error text is returned in 'retryMsg' (buffer of size 'retryMsgBufSize', + // must not be 0), and 'canRetry' (must not be NULL) returns TRUE; if retrying does not make sense, + // the error is shown in a message box and 'canRetry' returns FALSE (the connection is not + // interrupted); 'errBuf' is a helper buffer of size 'errBufSize' (must not be 0), used for texts + // displayed in message boxes; // can be called only from the main thread (uses wait windows, etc.) BOOL OpenForListeningAndWaitForRes(HWND parent, CDataConnectionSocket* dataConnection, DWORD* listenOnIP, unsigned short* listenOnPort, @@ -1229,7 +1229,7 @@ class CClosedCtrlConChecker protected: CRITICAL_SECTION DataSect; // critical section for accessing the object's data - // array of closed sockets that we check (whenever FTPCMD_CLOSECONNOTIF is received) + // array of closed sockets to check (whenever FTPCMD_CLOSECONNOTIF is received) TIndirectArray CtrlConSockets; BOOL CmdNotPost; // FALSE if the FTPCMD_CLOSECONNOTIF command has already been posted From 2a34b074b41b701d261a53e9728af47b5fab78cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 9 Apr 2026 15:21:26 +0200 Subject: [PATCH 010/710] [tanslation] Fix src/plugins/ftp/operats.h comments (#381) --- src/plugins/ftp/operats.h | 416 +++++++++++++++++++------------------- 1 file changed, 208 insertions(+), 208 deletions(-) diff --git a/src/plugins/ftp/operats.h b/src/plugins/ftp/operats.h index b25445da8..7ca6a41ae 100644 --- a/src/plugins/ftp/operats.h +++ b/src/plugins/ftp/operats.h @@ -4,12 +4,12 @@ #pragma once -#pragma pack(push, enter_include_operats_h_dt) // so that all structures are as small as possible (speed is not needed, we mainly save space) +#pragma pack(push, enter_include_operats_h_dt) // to keep all structures as small as possible (speed is not important; the main goal is to save space) #pragma pack(1) -// returns a pointer to the textual description of the 'error'; if 'error' is NO_ERROR, returns -// a text like "unknown, maybe insufficient system resources", otherwise returns the standard -// Windows description of the error (it uses the buffer 'errBuf'+'errBufSize' to store it) +// returns a pointer to the text description of 'error'; if 'error' is NO_ERROR, returns +// a string such as "unknown, maybe insufficient system resources"; otherwise returns the standard +// Windows error description (using 'errBuf' and 'errBufSize' to store it) const char* GetWorkerErrorTxt(int error, char* errBuf, int errBufSize); // @@ -22,7 +22,7 @@ enum CFTPQueueItemType { fqitNone, // empty item (must be set to one of the following types) - fqitDeleteExploreDir, // explore directory for delete (note: we delete links to directories as a whole, the goal of the operation is fulfilled and nothing "extra" gets deleted) (object of class CFTPQueueItemDelExplore) + fqitDeleteExploreDir, // directory exploration for a delete operation (note: links to directories are deleted as a whole; the purpose of the operation is fulfilled and nothing "extra" is deleted) (object of class CFTPQueueItemDelExplore) fqitCopyResolveLink, // download: copy: find out whether it is a link to a file or a directory (object of class CFTPQueueItemCopyOrMove) fqitMoveResolveLink, // download: move: find out whether it is a link to a file or a directory (object of class CFTPQueueItemCopyOrMove) fqitCopyExploreDir, // download: explore a directory or a link to a directory for copying (object of class CFTPQueueItemCopyMoveExplore) @@ -36,15 +36,15 @@ enum CFTPQueueItemType fqitLastResolveOrExploreItem, // numeric constant only for distinguishing types (processing priority) of items - fqitDeleteLink, // delete for a link (object of class CFTPQueueItemDel) - fqitDeleteFile, // delete for a file (object of class CFTPQueueItemDel) - fqitDeleteDir, // delete for a directory (object of class CFTPQueueItemDir) + fqitDeleteLink, // delete operation for a link (object of class CFTPQueueItemDel) + fqitDeleteFile, // delete operation for a file (object of class CFTPQueueItemDel) + fqitDeleteDir, // delete operation for a directory (object of class CFTPQueueItemDir) fqitCopyFileOrFileLink, // download: copying a file or a link to a file (object of class CFTPQueueItemCopyOrMove) fqitMoveFileOrFileLink, // download: moving a file or a link to a file (object of class CFTPQueueItemCopyOrMove) fqitMoveDeleteDir, // download: delete a directory after moving its contents (object of class CFTPQueueItemDir) fqitMoveDeleteDirLink, // download: delete a link to a directory after moving its contents (object of class CFTPQueueItemDir) fqitChAttrsFile, // change file attributes (note: attributes cannot be changed on links) (object of class CFTPQueueItemChAttr) - fqitChAttrsDir, // change directory attributes (object of class CFTPQueueItemChAttrDir) + fqitChAttrsDir, // change directory attributes (object of type CFTPQueueItemChAttrDir) fqitUploadCopyFile, // upload: copy a file (object of class CFTPQueueItemCopyOrMoveUpload) fqitUploadMoveFile, // upload: move a file (object of class CFTPQueueItemCopyOrMoveUpload) fqitUploadMoveDeleteDir, // upload: delete a directory after moving its contents (object of class CFTPQueueItemDir) @@ -95,23 +95,23 @@ enum CFTPQueueItemState #define ITEMPR_UNABLETODELETEDIR 23 // issue "unable to delete the directory, server response: %s" (uses ErrAllocDescr to store the server response - it may span multiple lines) #define ITEMPR_UNABLETOCHATTRS 24 // issue "unable to change file/directory attributes, server response: %s" (uses ErrAllocDescr to store the server response - it may span multiple lines) #define ITEMPR_UNABLETORESUME 25 // issue "unable to resume file transfer" -#define ITEMPR_RESUMETESTFAILED 26 // issue "unable to resume file transfer, unexpected tail of file (file has changed)" +#define ITEMPR_RESUMETESTFAILED 26 // problem: "unable to resume file transfer, unexpected tail of file (file has changed)" #define ITEMPR_TGTFILEREADERROR 27 // issue "error reading the target file" (uses WinError) #define ITEMPR_TGTFILEWRITEERROR 28 // issue "error writing the target file" (uses WinError) #define ITEMPR_INCOMPLETEDOWNLOAD 29 // issue "unable to retrieve file from server: %s" (uses WinError and ErrAllocDescr) #define ITEMPR_UNABLETODELSRCFILE 30 // issue "Move: unable to delete the source file, server response: %s" (uses ErrAllocDescr to store the server response - it may span multiple lines) -#define ITEMPR_UPLOADCANNOTCREATETGTDIR 31 // upload: issue "the target directory cannot be created" (if FTPMayBeValidNameComponent() returns FALSE, ErrAllocDescr==NULL and WinError==NO_ERROR; if a file/link is in the way, WinError==ERROR_ALREADY_EXISTS; otherwise it uses ErrAllocDescr to store the server response - it may span multiple lines) +#define ITEMPR_UPLOADCANNOTCREATETGTDIR 31 // upload: issue "the target directory cannot be created" (if FTPMayBeValidNameComponent() returns FALSE, ErrAllocDescr==NULL and WinError==NO_ERROR; if a file/link blocks the path, WinError==ERROR_ALREADY_EXISTS; otherwise it uses ErrAllocDescr to store the server response - it may span multiple lines) #define ITEMPR_UPLOADCANNOTLISTTGTPATH 32 // upload: issue "unable to list the target path" (unable to detect possible name collisions) (uses WinError and ErrAllocDescr) #define ITEMPR_UPLOADTGTDIRALREADYEXISTS 33 // upload: issue "the target directory or a link to the directory already exists" #define ITEMPR_UPLOADCRDIRAUTORENFAILED 34 // upload: issue "unable to create the target directory under any name" (uses ErrAllocDescr to store the server response - it may span multiple lines) #define ITEMPR_UPLOADCANNOTLISTSRCPATH 35 // upload: issue "unable to list the source path" (uses WinError) #define ITEMPR_UNABLETOCWDONLYPATH 36 // issue "error while changing the working directory on the server, server response: %s" - change of the path to Path or TgtPath (uses ErrAllocDescr to store the server response - it may span multiple lines) -#define ITEMPR_UNABLETODELETEDISKDIR 37 // issue "unable to delete directory on disk, error:" (uses WinError) +#define ITEMPR_UNABLETODELETEDISKDIR 37 // error "unable to delete directory on disk, error:" (uses WinError) #define ITEMPR_UPLOADCANNOTCREATETGTFILE 38 // upload: issue "the target file cannot be created or opened" (if FTPMayBeValidNameComponent() returns FALSE, ErrAllocDescr==NULL and WinError==NO_ERROR; if a directory/link is in the way, WinError==ERROR_ALREADY_EXISTS; otherwise it uses ErrAllocDescr to store the server response - it may span multiple lines) #define ITEMPR_UPLOADCANNOTOPENSRCFILE 39 // issue "the source file cannot be opened" (uses WinError) #define ITEMPR_UPLOADTGTFILEALREADYEXISTS 40 // upload: issue "the target file or a link to the file already exists" #define ITEMPR_SRCFILEINUSE 41 // issue "the source file or link is locked by another operation" -#define ITEMPR_TGTFILEINUSE 42 // issue "the target file or link is locked by another operation" +#define ITEMPR_TGTFILEINUSE 42 // problem "the target file or link is locked by another operation" #define ITEMPR_SRCFILEREADERROR 43 // issue "error reading the source file" (uses WinError) #define ITEMPR_INCOMPLETEUPLOAD 44 // issue "unable to store file to server: %s" (uses WinError and ErrAllocDescr) #define ITEMPR_UNABLETODELETEDISKFILE 45 // issue "unable to delete file on disk, error:" (uses WinError) @@ -120,7 +120,7 @@ enum CFTPQueueItemState #define ITEMPR_UPLOADUNABLETORESUMEBIGTGT 48 // issue "unable to resume the file because the target file is larger than the source file" #define ITEMPR_UPLOADFILEAUTORENFAILED 49 // upload: issue "unable to create the target file under any name" (uses ErrAllocDescr to store the server response - it may span multiple lines) #define ITEMPR_SKIPPEDBYUSER 50 // after pressing the Skip button on a waiting item in the operation dialog -#define ITEMPR_UPLOADTESTIFFINISHEDNOTSUP 51 // issue "unable to verify whether the file uploaded successfully" (we sent the entire file + the server "just" did not respond, most likely the file is OK, but we are unable to test it - reasons: ASCII transfer mode or we do not have the size in bytes (neither listing nor the SIZE command)) +#define ITEMPR_UPLOADTESTIFFINISHEDNOTSUP 51 // issue "unable to verify whether the file was uploaded successfully" (the entire file was sent, but the server did not respond; the file is most likely OK, but this cannot be verified - reasons: ASCII transfer mode or the size in bytes is unavailable (neither from a listing nor from the SIZE command)) enum CFTPQueueItemAction { @@ -133,7 +133,7 @@ enum CFTPQueueItemAction fqiaReduceFileSizeAndResume, // the existing file should be truncated and then resumed fqiaUploadForceAutorename, // upload: autorename (use alternate name) should be used no matter what fqiaUploadContinueAutorename, // upload: continuation of autorename (use alternate name) - fqiaUploadTestIfFinished, // upload: we sent the entire file + the server "just" did not respond, most likely the file is OK, we will test it + fqiaUploadTestIfFinished, // upload: the entire file was sent, but the server did not respond; the file is probably OK, so this will be tested }; class CFTPQueueItemAncestor @@ -164,7 +164,7 @@ class CFTPQueueItem : public CFTPQueueItemAncestor // - if it is already in the queue: access only from the queue critical section static CRITICAL_SECTION NextItemUIDCritSect; // critical section for accessing NextItemUID - static int NextItemUID; // global counter for item UIDs (access only inside the NextItemUIDCritSect section!) + static int NextItemUID; // global counter for item UIDs (access only inside the NextItemUIDCritSect critical section!) int UID; // unique item number int ParentUID; // UID of the parent item (-1 = the parent is the operation) @@ -176,7 +176,7 @@ class CFTPQueueItem : public CFTPQueueItemAncestor DWORD ErrorOccurenceTime; // "time" when the error occurred (used to keep the order of error resolution according to their occurrence); -1 = no error occurred - CFTPQueueItemAction ForceAction; // action forced by the user (for example an autorename entered from the Solve Error dialog) + CFTPQueueItemAction ForceAction; // action forced by the user (for example an autorename specified in the Solve Error dialog) char* Path; // path to the processed file/directory (local path on the server or a Windows path) char* Name; // name of the processed file/directory (name without the path) @@ -204,9 +204,9 @@ class CFTPQueueItem : public CFTPQueueItemAncestor void SetItem(int parentUID, CFTPQueueItemType type, CFTPQueueItemState state, DWORD problemID, const char* path, const char* name); - // enabler for buttons in the operation dialog: returns TRUE if the "Solve Error" button makes sense; - // in 'canSkip' (if not NULL) it returns TRUE if the "Skip" button makes sense; - // in 'canRetry' (if not NULL) it returns TRUE if the "Retry" button makes sense + // button enable states in the operation dialog: returns TRUE if the "Solve Error" button should be enabled; + // in 'canSkip' (if not NULL), returns TRUE if the "Skip" button should be enabled; + // in 'canRetry' (if not NULL), returns TRUE if the "Retry" button should be enabled // CAUTION: call only from the queue critical section BOOL HasErrorToSolve(BOOL* canSkip, BOOL* canRetry); @@ -437,7 +437,7 @@ class CFTPQueueItemChAttr : public CFTPQueueItem public: WORD Attr; // requested mode (conversion to a string in octal digits is necessary) BYTE AttrErr; // TRUE = an unknown attribute should be preserved, which we cannot do (FALSE = everything OK) - char* OrigRights; // original file permissions (!=NULL only if they contain unknown permissions + if a permissions column was found at all) + char* OrigRights; // original file permissions (!=NULL only if they contain unknown permissions and a permissions column was found at all) public: CFTPQueueItemChAttr(); @@ -461,7 +461,7 @@ class CFTPQueueItemChAttrDir : public CFTPQueueItemDir public: WORD Attr; // requested mode (conversion to a string in octal digits is necessary) BYTE AttrErr; // TRUE = an unknown attribute should be preserved, which we cannot do (FALSE = everything OK) - char* OrigRights; // original directory permissions (!=NULL only if they contain unknown permissions + if a permissions column was found at all) + char* OrigRights; // original directory permissions (!=NULL only if they contain unknown permissions and a permissions column was found) public: CFTPQueueItemChAttrDir(); @@ -483,7 +483,7 @@ class CFTPQueueItemChAttrDir : public CFTPQueueItemDir class CFTPQueueItemChAttrExplore : public CFTPQueueItem { public: - char* OrigRights; // original directory permissions for computing Attr of the explored directory (!=NULL if a permissions column was found) + char* OrigRights; // original directory permissions for computing Attr of the directory being explored (!=NULL if a permissions column was found) public: CFTPQueueItemChAttrExplore(); @@ -514,7 +514,7 @@ class CFTPQueue int LastFoundUID; // UID of the last found item int LastFoundIndex; // index of the last found item (always a non-negative number, even after initialization) - int FirstWaitingItemIndex; // first item in the queue (array Items) that can (but does not have to) be in state sqisWaiting and if GetOnlyExploreAndResolveItems==TRUE it can also be an "explore" or "resolve" item (there simply are none before this index) + int FirstWaitingItemIndex; // first item in the queue (Items array) that may, but does not have to, be in state sqisWaiting; if GetOnlyExploreAndResolveItems==TRUE, it may also be an "explore" or "resolve" item (there are simply no such items before this index) BOOL GetOnlyExploreAndResolveItems; // TRUE = for now we return only "explore" and "resolve" items from the queue (FALSE only when no such item is in the "waiting" state) (Type < fqitLastResolveOrExploreItem) int ExploreAndResolveItemsCount; // number of queue items of type "explore" and "resolve" (Type < fqitLastResolveOrExploreItem) @@ -574,10 +574,10 @@ class CFTPQueue // returns the number of items in state sqisUserInputNeeded, sqisSkipped, sqisFailed or sqisForcedToFail // in the queue; if 'onlyUINeeded' is TRUE, fills the array 'UINeededArr' with items in state // sqisUserInputNeeded, sqisSkipped, sqisFailed or sqisForcedToFail; if 'focusedItemUID' is not -1, - // it returns in 'indexInAll' the index of the item with UID 'focusedItemUID' in the queue + - // returns in 'indexInUIN' the index of the item with UID 'focusedItemUID' in the array of items in state - // sqisUserInputNeeded, sqisSkipped, sqisFailed or sqisForcedToFail; if it does not find - // the item with UID 'focusedItemUID', it returns both 'indexInAll' and 'indexInUIN' equal to -1 + // returns in 'indexInAll' the index of the item with UID 'focusedItemUID' in the queue and in + // 'indexInUIN' the index of the item with UID 'focusedItemUID' in the array of items in state + // sqisUserInputNeeded, sqisSkipped, sqisFailed or sqisForcedToFail; if the item with UID + // 'focusedItemUID' is not found, sets both 'indexInAll' and 'indexInUIN' to -1 int GetUserInputNeededCount(BOOL onlyUINeeded, TDirectArray* UINeededArr, int focusedItemUID, int* indexInAll, int* indexInUIN); @@ -593,10 +593,10 @@ class CFTPQueue // valid, it does nothing (the list view refresh is already on the way) void GetListViewDataFor(int index, NMLVDISPINFO* lvdi, char* buf, int bufSize); - // button enabler in the operation dialog for the item at index 'index': - // returns TRUE if "Solve Error" makes sense; returns FALSE for an invalid index; - // in 'canSkip' (if not NULL) it returns TRUE if "Skip" makes sense; - // in 'canRetry' (if not NULL) it returns TRUE if "Retry" makes sense + // determines which buttons should be enabled in the operation dialog for the item at index 'index': + // returns TRUE if "Solve Error" should be enabled; returns FALSE for an invalid index; + // in 'canSkip' (if not NULL) returns TRUE if "Skip" should be enabled; + // in 'canRetry' (if not NULL) returns TRUE if "Retry" should be enabled BOOL IsItemWithErrorToSolve(int index, BOOL* canSkip, BOOL* canRetry); // performs Skip on the item with UID 'UID' (change to state "skipped"); returns the index @@ -660,7 +660,7 @@ class CFTPQueue // assigns 'attrErr' to AttrErr of item 'item' void UpdateAttrErr(CFTPQueueItemChAttrDir* item, BYTE attrErr); - // assigns 'attrErr' to AttrErr of item 'item' + // assigns 'attrErr' to the AttrErr member of 'item' void UpdateAttrErr(CFTPQueueItemChAttr* item, BYTE attrErr); // assigns 'isHiddenDir' to IsHiddenDir of item 'item' @@ -669,7 +669,7 @@ class CFTPQueue // assigns 'isHiddenFile' to IsHiddenFile of item 'item' void UpdateIsHiddenFile(CFTPQueueItemDel* item, BOOL isHiddenFile); - // assigns 'size' to Size and 'sizeInBytes' to SizeInBytes of item 'item' + adjusts + // assigns 'size' to Size and 'sizeInBytes' to SizeInBytes of item 'item' and adjusts // TotalSizeInBytes and TotalSizeInBlocks in the operation ('oper') void UpdateFileSize(CFTPQueueItemCopyOrMove* item, CQuadWord const& size, BOOL sizeInBytes, CFTPOperation* oper); @@ -677,23 +677,23 @@ class CFTPQueue // assigns 'asciiTransferMode' to AsciiTransferMode of item 'item' void UpdateAsciiTransferMode(CFTPQueueItemCopyOrMove* item, BOOL asciiTransferMode); - // assigns 'ignoreAsciiTrModeForBinFile' to IgnoreAsciiTrModeForBinFile of item 'item' + // assigns 'ignoreAsciiTrModeForBinFile' to the IgnoreAsciiTrModeForBinFile member of item 'item' void UpdateIgnoreAsciiTrModeForBinFile(CFTPQueueItemCopyOrMove* item, BOOL ignoreAsciiTrModeForBinFile); - // for upload: assigns 'asciiTransferMode' to AsciiTransferMode of item 'item' + // for upload: assigns 'asciiTransferMode' to the AsciiTransferMode member of item 'item' void UpdateAsciiTransferMode(CFTPQueueItemCopyOrMoveUpload* item, BOOL asciiTransferMode); - // for upload: assigns 'ignoreAsciiTrModeForBinFile' to IgnoreAsciiTrModeForBinFile of item 'item' + // for upload: assigns 'ignoreAsciiTrModeForBinFile' to the IgnoreAsciiTrModeForBinFile member of item 'item' void UpdateIgnoreAsciiTrModeForBinFile(CFTPQueueItemCopyOrMoveUpload* item, BOOL ignoreAsciiTrModeForBinFile); - // assigns 'tgtFileState' to TgtFileState of item 'item' + // assigns 'tgtFileState' to the TgtFileState member of 'item' void UpdateTgtFileState(CFTPQueueItemCopyOrMoveUpload* item, unsigned tgtFileState); - // assigns 'size' to Size of item 'item' + adjusts TotalSizeInBytes in the operation ('oper') + // assigns 'size' to the Size member of item 'item' and adjusts TotalSizeInBytes in operation 'oper' void UpdateFileSize(CFTPQueueItemCopyOrMoveUpload* item, CQuadWord const& size, CFTPOperation* oper); - // sets SizeWithCRLF_EOLs and NumberOfEOLs of item 'item' + // sets the SizeWithCRLF_EOLs and NumberOfEOLs members of item 'item' void UpdateTextFileSizes(CFTPQueueItemCopyOrMoveUpload* item, CQuadWord const& sizeWithCRLF_EOLs, CQuadWord const& numberOfEOLs); @@ -702,25 +702,25 @@ class CFTPQueue // on error it throws TRACE_E void DebugCheckCounters(CFTPOperation* oper); - // returns progress based on the ratio between completed ('doneOrSkippedCount') and all - // items ('totalCount'); returns in 'unknownSizeCount' the number of unfinished items - // with unknown size; returns in 'waitingCount' the number of items waiting for + // returns progress based on the ratio between done or skipped items ('doneOrSkippedCount') and all + // items ('totalCount'); stores in 'unknownSizeCount' the number of unfinished items + // with unknown size; stores in 'waitingCount' the number of items waiting for // processing (waiting + delayed + processing) int GetSimpleProgress(int* doneOrSkippedCount, int* totalCount, int* unknownSizeCount, int* waitingCount); - // returns information for download - copy/move progress; returns in 'downloaded' the sum of downloaded - // sizes in bytes; returns in 'unknownSizeCount' the number of unfinished items with - // unknown size; returns in 'totalWithoutErrors' the sum of sizes (in bytes) - // of items that are not in an error state (a prompt to the user is also an error state) + // returns information for download copy/move progress; 'downloaded' receives the total + // number of downloaded bytes; 'unknownSizeCount' receives the number of unfinished items + // with unknown size; 'totalWithoutErrors' receives the total size (in bytes) + // of items that are not in an error state (a prompt to the user is also considered an error state) void GetCopyProgressInfo(CQuadWord* downloaded, int* unknownSizeCount, CQuadWord* totalWithoutErrors, int* errorsCount, int* doneOrSkippedCount, int* totalCount, CFTPOperation* oper); - // returns information for upload - copy/move progress; returns in 'uploaded' the sum of uploaded - // sizes in bytes; returns in 'unknownSizeCount' the number of unfinished items with - // unknown size; returns in 'totalWithoutErrors' the sum of sizes (in bytes) - // of items that are not in an error state (a prompt to the user is also an error state) + // returns information for upload copy/move progress; 'uploaded' receives the total + // number of uploaded bytes; 'unknownSizeCount' receives the number of unfinished items + // with unknown size; 'totalWithoutErrors' receives the total size (in bytes) + // of items that are not in an error state (a prompt to the user is also considered an error state) void GetCopyUploadProgressInfo(CQuadWord* uploaded, int* unknownSizeCount, CQuadWord* totalWithoutErrors, int* errorsCount, int* doneOrSkippedCount, int* totalCount, CFTPOperation* oper); @@ -732,11 +732,11 @@ class CFTPQueue // CAUTION: call only in the QueueCritSect critical section!!! DWORD GiveLastErrorOccurenceTime() { return ++LastErrorOccurenceTime; } - // searches for the UID of the item that needs to open the Solve Error dialog (a - // "new" error appeared in it (the user has not seen it yet)); returns TRUE if such an - // item was found, its UID is returned in 'itemUID' + its index + // searches for the UID of the item for which the Solve Error dialog needs to be opened (a + // "new" error has appeared in it, which the user has not seen yet); returns TRUE if such an + // item was found; its UID is returned in 'itemUID' and its index // in the queue in 'itemIndex' (the index may change immediately, so it should - // be taken only as indicative) + // be treated as indicative only) BOOL SearchItemWithNewError(int* itemUID, int* itemIndex); protected: @@ -761,7 +761,7 @@ enum CFTPDiskWorkType fdwtNone, // initialization value fdwtCreateDir, // creating a directory fdwtCreateFile, // creating/opening a file in a situation where the file state is unknown - fdwtRetryCreatedFile, // creating/opening a file in a situation where the file has already been created/overwritten/resumed_with_overwrite_option + fdwtRetryCreatedFile, // creating/opening a file when the file has already been created/overwritten/resumed with overwrite enabled fdwtRetryResumedFile, // creating/opening a file in a situation where the file has already been resumed fdwtCheckOrWriteFile, // verifying contents or writing to a file (for "resume" it checks the end of the file, writing happens beyond the end of the file) fdwtCreateAndWriteFile, // if the file is not open, it creates it (overwrites an existing file if any) + writes flush data to the file (at the position of the current seek, so normally at the end of the file) @@ -847,7 +847,7 @@ struct CFTPDiskWork struct CFTPFileToClose { char FileName[MAX_PATH]; // file name - HANDLE File; // file handle we should close + HANDLE File; // file handle to close BOOL DeleteIfEmpty; // TRUE = if the file being closed is empty, delete it BOOL SetDateAndTime; // TRUE = set 'Date'+'Time' before closing the file CFTPDate Date; // date to set as the last write time of the file; if Date.Day==0, it is an "empty value" @@ -866,7 +866,7 @@ class CFTPDiskThread : public CThread HANDLE ContEvent; // "signaled" if there is work in the Work array or if the thread should terminate // critical section for accessing the data part of the object - // CAUTION: consult access to critical sections in servers\critsect.txt!!! + // CAUTION: consult servers\critsect.txt before accessing critical sections CRITICAL_SECTION DiskCritSect; TIndirectArray Work; @@ -892,9 +892,9 @@ class CFTPDiskThread : public CThread // or until CancelWork() is called; returns success BOOL AddWork(CFTPDiskWork* work); - // cancels the work 'work' added to the thread; returns TRUE if the work has not started yet - // or if it can still be interrupted (it is in progress and after finishing the opposite - // action will be performed); if the work is in progress, returns TRUE in 'workIsInProgress' (if not NULL); returns + // cancels work 'work' added to the thread; returns TRUE if the work has not started yet + // or if it can still be canceled (it is in progress and, after finishing, the reverse + // action will be performed); if the work is in progress, sets 'workIsInProgress' to TRUE (if not NULL); returns // FALSE if the work has already finished BOOL CancelWork(const CFTPDiskWork* work, BOOL* workIsInProgress); @@ -986,7 +986,7 @@ enum CFTPWorkerSubState // substates for individual states from CFTPWorkerState fwssWorkExplWaitForPWDRes, // explore-dir: waiting for the result of "PWD" (obtaining the working path of the explored directory) fwssWorkExplWaitForPASVRes, // explore-dir: waiting for the result of "PASV" (getting IP+port for the passive data connection) fwssWorkExplOpenActDataCon, // explore-dir: open the active data connection - fwssWorkExplWaitForListen, // explore-dir: waiting for the "listen" port to open (we open an active data connection) - local or on the proxy server + fwssWorkExplWaitForListen, // explore-dir: waiting for the "listen" port to open (opening an active data connection), either locally or on the proxy server fwssWorkExplSetTypeA, // explore-dir: set transfer mode to ASCII fwssWorkExplWaitForPORTRes, // explore-dir: waiting for the result of "PORT" (passing IP+port to the server for the active data connection) fwssWorkExplWaitForTYPERes, // explore-dir: waiting for the result of "TYPE" (switch to ASCII data transfer mode) @@ -1004,13 +1004,13 @@ enum CFTPWorkerSubState // substates for individual states from CFTPWorkerState fwssWorkChAttrWaitForCHMODQuotedRes, // change attributes (name in quotes): waiting for the result of "SITE CHMOD" (change file/directory mode, probably Unix only) fwssWorkCopyWaitForPASVRes, // copy/move file: waiting for the result of "PASV" (getting IP+port for the passive data connection) fwssWorkCopyOpenActDataCon, // copy/move file: open the active data connection - fwssWorkCopyWaitForListen, // copy/move file: waiting for the "listen" port to open (we open an active data connection) - local or on the proxy server + fwssWorkCopyWaitForListen, // copy/move file: waiting for the listening port to open (opening an active data connection), either locally or on the proxy server fwssWorkCopySetType, // copy/move file: set the required transfer mode (ASCII / binary) fwssWorkCopyWaitForPORTRes, // copy/move file: waiting for the result of "PORT" (passing IP+port to the server for the active data connection) fwssWorkCopyWaitForTYPERes, // copy/move file: waiting for the result of "TYPE" (switch to ASCII / binary data transfer mode) fwssWorkCopyResumeFile, // copy/move file: optionally ensure resume (send the REST command) fwssWorkCopyWaitForResumeRes, // copy/move file: waiting for the result of the "REST" command (resume file) - fwssWorkCopyResumeError, // copy/move file: error of the "REST" command (not implemented, etc.) or we already know REST will fail + fwssWorkCopyResumeError, // copy/move file: "REST" command error (not implemented, etc.) or REST is already known to fail fwssWorkCopySendRetrCmd, // copy/move file: send the RETR command (start reading the file, possibly from the offset specified by Resume) fwssWorkCopyActivateDataCon, // copy/move file: activate the data connection (right after sending the RETR command) fwssWorkCopyWaitForRETRRes, // copy/move file: waiting for the result of "RETR" (waiting for the file reading to finish) @@ -1018,7 +1018,7 @@ enum CFTPWorkerSubState // substates for individual states from CFTPWorkerState fwssWorkCopyFinishFlushData, // copy/move file: ensure flushing the data from the data connection is finished (the connection is already closed) fwssWorkCopyFinishFlushDataAfterQuitSent, // copy/move file: after sending "QUIT" wait for the control connection to close + wait for the data flush to disk to finish fwssWorkCopyProcessRETRRes, // copy/move file: process the result of "RETR" (after ending the "data connection", flushing data to disk and receiving the server response to "RETR") - fwssWorkCopyDelayedAutoRetry, // copy/move file: wait WORKER_DELAYEDAUTORETRYTIMEOUT milliseconds for auto-retry (so that all unexpected responses from the server can arrive) + fwssWorkCopyDelayedAutoRetry, // copy/move file: wait WORKER_DELAYEDAUTORETRYTIMEOUT milliseconds before auto-retry (so that all unexpected responses from the server can arrive) fwssWorkCopyTransferFinished, // copy/move file: file transferred, in case of Move delete the source file fwssWorkCopyMoveWaitForDELERes, // copy/move file: waiting for the result of "DELE" (Move: delete the source file/link after finishing the file transfer) fwssWorkCopyDone, // copy/move file: done, close the file and go to the next item @@ -1037,26 +1037,26 @@ enum CFTPWorkerSubState // substates for individual states from CFTPWorkerState fwssWorkUploadAutorenDirSendMKD, // upload copy/move file: autorename - try to generate another new name for the target directory and try to create it fwssWorkUploadAutorenDirWaitForMKDRes, // upload copy/move file: autorename - waiting for the result of "MKD" (creating the target directory under a new name) fwssWorkUploadGetTgtPath, // upload copy/move file: determine the path to the target directory on the server - start by changing to it - fwssWorkUploadGetTgtPathWaitForCWDRes, // upload copy/move file: waiting for the result of "CWD" (setting the path to the target directory) + fwssWorkUploadGetTgtPathWaitForCWDRes, // upload copy/move file: waiting for the result of "CWD" (changing to the target directory) fwssWorkUploadGetTgtPathSendPWD, // upload copy/move file: send "PWD" (getting the path to the target directory) fwssWorkUploadGetTgtPathWaitForPWDRes, // upload copy/move file: waiting for the result of "PWD" (getting the path to the target directory) - fwssWorkUploadListDiskDir, // upload copy/move file: list the directory being uploaded from disk + fwssWorkUploadListDiskDir, // upload copy/move file: list the source directory on disk fwssWorkUploadListDiskWaitForDisk, // upload copy/move file: waiting for the disk operation to finish (listing the directory) fwssWorkUploadListDiskWaitForDiskAftQuit, // upload copy/move file: after sending the "QUIT" command wait for the disk operation to finish (listing the directory) fwssWorkUploadCantCreateFileInvName, // upload copy/move file: handle error "target file cannot be created" (invalid name) fwssWorkUploadCantCreateFileDirEx, // upload copy/move file: handle error "target file cannot be created" (name already used for directory or link to directory) fwssWorkUploadFileExists, // upload copy/move file: handle error "target file already exists" fwssWorkUploadNewFile, // upload copy/move file: the target file does not exist, start uploading it - fwssWorkUploadAutorenameFile, // upload copy/move file: handle the error when creating the target file - autorename + fwssWorkUploadAutorenameFile, // upload copy/move file: handle the error when creating the target file - auto-rename fwssWorkUploadResumeFile, // upload copy/move file: problem "target file exists" - resume fwssWorkUploadTestIfFinished, // upload copy/move file: we sent the entire file + the server "just" did not respond, most likely the file is OK, we will test it - fwssWorkUploadResumeOrOverwriteFile, // upload copy/move file: problem "target file exists" - resume or overwrite + fwssWorkUploadResumeOrOverwriteFile, // upload copy/move file: issue "target file exists" - resume or overwrite fwssWorkUploadOverwriteFile, // upload copy/move file: problem "target file exists" - overwrite fwssWorkUploadFileSetTgtPath, // upload file: set the target path fwssWorkUploadFileSetTgtPathWaitForCWDRes, // upload file: waiting for the result of "CWD" (setting the target path) fwssWorkUploadGenNewName, // upload file: autorename: generate a new name fwssWorkUploadLockFile, // upload file: open the file in FTPOpenedFiles - fwssWorkUploadDelForOverwrite, // upload file: if this is an overwrite and delete should be used first, do it here + fwssWorkUploadDelForOverwrite, // upload file: if this is an overwrite and delete should be used first, perform the delete here fwssWorkUploadDelForOverWaitForDELERes, // upload file: waiting for the DELE result before overwrite fwssWorkUploadFileAllocDataCon, // upload file: allocate the data connection fwssWorkUploadGetFileSize, // upload file: resume: determine the file size (via the SIZE command or from the listing) @@ -1066,7 +1066,7 @@ enum CFTPWorkerSubState // substates for individual states from CFTPWorkerState fwssWorkUploadTestFileSizeFailed, // upload copy/move file: after an upload error the file size test failed fwssWorkUploadWaitForPASVRes, // upload copy/move file: waiting for the result of "PASV" (getting IP+port for the passive data connection) fwssWorkUploadOpenActDataCon, // upload copy/move file: open the active data connection - fwssWorkUploadWaitForListen, // upload copy/move file: waiting for the "listen" port to open (we open an active data connection) - local or on the proxy server + fwssWorkUploadWaitForListen, // upload copy/move file: waiting for the "listen" port to open (opening an active data connection), locally or on the proxy server fwssWorkUploadWaitForPORTRes, // upload copy/move file: waiting for the result of "PORT" (passing IP+port to the server for the active data connection) fwssWorkUploadSetType, // upload copy/move file: set the required transfer mode (ASCII / binary) fwssWorkUploadWaitForTYPERes, // upload copy/move file: waiting for the result of "TYPE" (switch to ASCII / binary data transfer mode) @@ -1082,11 +1082,11 @@ enum CFTPWorkerSubState // substates for individual states from CFTPWorkerState enum CFTPWorkerSocketEvent { - fwseConnect, // [error, 0], connection to the server opened + fwseConnect, // [error, 0], opening a connection to the server fwseClose, // [error, 0], socket was closed - fwseNewBytesRead, // [error, 0], another block of data read into the socket buffer + fwseNewBytesRead, // [error, 0], another block of data was read into the socket buffer fwseWriteDone, // [error, 0], buffer write finished (only if Write returned 'allBytesWritten'==FALSE) - fwseIPReceived, // [IP, error], we received the IP (while resolving the host name) + fwseIPReceived, // [IP, error], IP address received (while resolving the host name) fwseTimeout, // [0, 0], timer delivery reports timeout while sending FTP commands (see WORKER_TIMEOUTTIMERID) fwseWaitForCmdErr, // [0, 0], sending a command to the server failed, waiting whether FD_CLOSE arrives, if not, close the socket "manually" }; @@ -1152,11 +1152,11 @@ enum CFTPWorkerCmdState // the command or connection loss while sending/waiting for the reply or a timeout - connection closed // because we did not receive the server's reply to the FTP command) fwcsWaitForCmdReply, - fwcsWaitForLoginPrompt, // same functionality as fwcsWaitForCmdReply, we distinguish only because of error messages + fwcsWaitForLoginPrompt, // same functionality as fwcsWaitForCmdReply; distinguished only because of error messages - // waiting for the reason of an error that occurred when sending a command (writing to the socket): waiting for fwseClose, - // if it does not arrive we close the socket "manually" (on fwseWaitForCmdErr timeout); at the same time we capture an error - // message from the socket or at least from fwseClose; if we capture nothing, we at least print WaitForCmdErrError + // waiting for the cause of an error that occurred when sending a command (writing to the socket): waiting for fwseClose, + // if it does not arrive, close the socket "manually" (on fwseWaitForCmdErr timeout); at the same time, capture an error + // message from the socket or at least from fwseClose; if nothing is captured, at least print WaitForCmdErrError fwcsWaitForCmdError, }; @@ -1235,7 +1235,7 @@ enum CUploadType #define WORKER_RECONTIMEOUTTIMID 33 // timer ID for waiting for another connect attempt (reconnect) #define WORKER_STATUSUPDATETIMID 34 // timer ID for periodically updating the status #define WORKER_DATACONSTARTTIMID 35 // timer ID for detecting a timeout while waiting for the data connection to open after receiving the server reply to RETR (WarFTPD illogically sends 226 even before our data connection accept) -#define WORKER_DELAYEDAUTORETRYTIMID 36 // timer ID for delaying auto-retry (e.g. Quick&Easy FTPD returns 426 for RETR and immediately 220 - if you retry immediately, responses shift (220 is taken as the response to the next command instead of this command and everything goes wrong)) +#define WORKER_DELAYEDAUTORETRYTIMID 36 // timer ID used to delay auto-retry (e.g. Quick&Easy FTPD returns 426 for RETR and immediately afterwards 220; if retried immediately, the replies become misaligned, so 220 is taken as the response to the next command instead of this one) #define WORKER_LISTENTIMEOUTTIMID 37 // timer ID ensuring timeout detection when opening the "listen" port on the proxy server (when opening an active data connection) #define WORKER_STATUSUPDATETIMEOUT 1000 // time in milliseconds after which the status in the worker (and the worker progress and overall progress in the operation dialog) is updated - NOTE: linked to OPERDLG_STATUSMINIDLETIME @@ -1267,8 +1267,8 @@ class CFTPWorker : public CSocket int ReadBytesOffset; // number of bytes already processed (skipped) in the 'ReadBytes' buffer int ReadBytesAllocatedSize; // allocated size of the 'ReadBytes' buffer - CDataConnectionSocket* WorkerDataCon; // NULL; otherwise, the data connection currently used by this worker (state see WorkerDataConState) - CUploadDataConnectionSocket* WorkerUploadDataCon; // NULL; otherwise, the data connection currently used by this worker for upload (state see WorkerDataConState) + CDataConnectionSocket* WorkerDataCon; // NULL; otherwise, the data connection currently used by this worker (see WorkerDataConState for its state) + CUploadDataConnectionSocket* WorkerUploadDataCon; // NULL; otherwise, the data connection currently used by this worker for upload (state: see WorkerDataConState) // critical section for accessing the data part of the object (data for display in dialogs) // WARNING: consult access to critical sections in the file servers\critsect.txt !!! @@ -1281,7 +1281,7 @@ class CFTPWorker : public CSocket int LogUID; // log UID for this worker (-1 if the log is not created); NOTE: it is in WorkerCritSect and not SocketCritSect !!! CFTPWorkerState State; // worker state, see CFTPWorkerState CFTPWorkerSubState SubState; // state inside the worker state (substate for the processing steps of each State), see CFTPWorkerSubState - CFTPQueueItem* CurItem; // read-only data: processed item (in state sqisProcessing), NULL=worker has no work; write via Queue and CurItem->UID + CFTPQueueItem* CurItem; // read-only data: item being processed (in state sqisProcessing), NULL = worker has no work; write via Queue and CurItem->UID char ErrorDescr[FTPWORKER_ERRDESCR_BUFSIZE]; // textual description of the error, contains no CR or LF and does not end with a period; ensuring these conditions see CorrectErrorDescr(); displayed for fwsWaitingForReconnect and fwsConnectionError, filled on errors see CFTPWorkerEvent int ConnectAttemptNumber; // number of the current attempt to establish the connection; before the very first attempt this is zero (set to one when the connection is established) CCertificate* UnverifiedCertificate; // SSL: if the attempt to connect fails due to an unknown untrusted certificate, the connection is closed and the certificate is stored here (we show it to the user in the Solve Error dialog) @@ -1306,7 +1306,7 @@ class CFTPWorker : public CSocket const char* ProxyScriptExecPoint; // current proxy script command (NULL = first command); WARNING: not intended for reading, only for passing to CFTPOperation::PrepareNextScriptCmd() int ProxyScriptLastCmdReply; // reply to the last command sent from the proxy script (-1 = none) - BOOL DiskWorkIsUsed; // TRUE if DiskWork is inserted in FTPDiskThread + BOOL DiskWorkIsUsed; // TRUE if DiskWork is added to FTPDiskThread HANDLE OpenedFile; // target file for copy/move operations CQuadWord OpenedFileSize; // current size of the 'OpenedFile' @@ -1347,7 +1347,7 @@ class CFTPWorker : public CSocket BOOL UploadDirGetTgtPathListing; // only when processing upload-dir-explore or upload-file items: TRUE = the target path listing should be fetched - int UploadAutorenamePhase; // upload: current phase of generating names for the target directory/file (see FTPGenerateNewName()); 0 = beginning of the autorename process; -1 = it was the last generation phase, we simply cannot generate another name of that type + int UploadAutorenamePhase; // upload: current phase of generating names for the target directory/file (see FTPGenerateNewName()); 0 = beginning of the autorename process; -1 = this was the last generation phase, and another name of that type cannot be generated char UploadAutorenameNewName[MAX_PATH]; // upload: buffer for the last generated name for the target directory/file CUploadType UploadType; // type of upload (according to the state of the target file): new, resume, resume or overwrite, overwrite, autorename @@ -1379,8 +1379,8 @@ class CFTPWorker : public CSocket // returns State (in the WorkerCritSect critical section) CFTPWorkerState GetState(); - // returns ShouldBePaused (in the WorkerCritSect critical section); in 'isWorking' (must not be - // NULL) returns TRUE if the worker is working (not sleeping, not waiting for the user, and not terminated); + // returns ShouldBePaused (in the WorkerCritSect critical section); sets 'isWorking' (must not be + // NULL) to TRUE if the worker is working (not sleeping, not waiting for the user, and not terminated); BOOL IsPaused(BOOL* isWorking); // sets 'CopyOfUID' and 'CopyOfMsg' (in the CSocket::SocketCritSect and @@ -1422,9 +1422,9 @@ class CFTPWorker : public CSocket // if we already attempted deletion via DeleteWorkers); returns TRUE if cancellation is possible BOOL CanDeleteFromRetCons(); - // used to query whether the worker can be cancelled from DeleteWorkers (only if the - // connection from the worker is not being returned to the panel, or if we already attempted deletion - // from the CReturningConnections methods); returns TRUE if cancellation is possible + // used to query whether the worker can be deleted from DeleteWorkers (only if the + // worker's connection is not being returned to the panel, or if we have already attempted deletion + // from the CReturningConnections methods); returns TRUE if deletion is possible BOOL CanDeleteFromDelWorkers(); // informs the worker that it should attempt to stop; returns TRUE if the worker @@ -1440,7 +1440,7 @@ class CFTPWorker : public CSocket // informs the worker that it should attempt to pause/resume; returns TRUE if the worker // wants to post WORKER_SHOULDPAUSE or WORKER_SHOULDRESUME (fweWorkerShouldPause // or fweWorkerShouldResume) by calling PostShouldPauseOrResume() after this - // method; 'pause' is TRUE/FALSE depending on pause/resume + // method finishes; 'pause' is TRUE for pause and FALSE for resume // WARNING: may be called for one worker several times in a row (check whether it has already been called; if so, do nothing and return FALSE)! BOOL InformAboutPause(BOOL pause); @@ -1449,9 +1449,9 @@ class CFTPWorker : public CSocket // critical sections void PostShouldPauseOrResume(); - // determines whether the worker "control connection" socket is closed and the worker - // "data connection" does not exist; returns TRUE if the "control connection" socket is closed - // and the "data connection" does not exist (the worker can be cancelled) + // checks whether the worker's "control connection" socket is closed and the worker + // has no "data connection"; returns TRUE if the "control connection" socket is closed + // and no "data connection" exists (the worker can be deleted) BOOL SocketClosedAndDataConDoesntExist(); // determines whether the worker has work in the disk thread; returns FALSE if it has no work @@ -1478,13 +1478,13 @@ class CFTPWorker : public CSocket // clears the read and write buffers (useful for example before reopening the connection) void ResetBuffersAndEvents(); - // writes to the socket (performs "send") bytes from the 'buffer' of length 'bytesToWrite' + // writes bytes from 'buffer' to the socket (using "send") with length 'bytesToWrite' // (if 'bytesToWrite' is -1, writes strlen(buffer) bytes); on error returns FALSE and, - // if the Windows error code is known, returns it in 'error' (if not NULL); if it returns TRUE, - // at least part of the buffer was successfully written; in 'allBytesWritten' (must not be - // NULL) returns TRUE if the entire buffer was written; if 'allBytesWritten' - // returns FALSE, before the next call to Write you must wait for the fwseWriteDone event - // (once it arrives, the write is complete) + // if the Windows error code is known, stores it in 'error' (if not NULL); if it returns TRUE, + // at least part of the buffer was written successfully; 'allBytesWritten' (must not be + // NULL) is set to TRUE if the entire buffer was written; if 'allBytesWritten' is + // FALSE, you must wait for the fwseWriteDone event before the next call to Write + // (once it occurs, the write is complete) BOOL Write(const char* buffer, int bytesToWrite, DWORD* error, BOOL* allBytesWritten); // helper method to detect whether the entire reply from the FTP server is already in the 'ReadBytes' buffer; @@ -1553,10 +1553,10 @@ class CFTPWorker : public CSocket // a Windows error code (arrived with FD_CLOSE or arose while processing FD_CLOSE) virtual void SocketWasClosed(DWORD error); - // reception of a timer with ID 'id' and parameter 'param' + // receives a timer with ID 'id' and parameter 'param' virtual void ReceiveTimer(DWORD id, void* param); - // reception of a posted message with ID 'id' and parameter 'param' + // receives a posted message with ID 'id' and parameter 'param' virtual void ReceivePostMessage(DWORD id, void* param); protected: @@ -1669,7 +1669,7 @@ class CFTPWorker : public CSocket CQuadWord const* writeOrReadFromOffset, int validBytesInFlushDataBuffer, HANDLE workFile); - // returns the processed 'CurItem' back to the queue (returns it to the "waiting" state so another + // returns the current item being processed, 'CurItem', back to the queue (puts it back into the "waiting" state so another // worker can process it) // WARNING: call only inside the WorkerCritSect critical section !!! void ReturnCurItemToQueue(); @@ -1719,7 +1719,7 @@ class CFTPWorkersList { protected: // critical section for accessing the object's data - // WARNING: consult access to critical sections in the servers\critsect.txt file !!! + // WARNING: consult servers\critsect.txt before accessing critical sections. CRITICAL_SECTION WorkersListCritSect; TIndirectArray Workers; // array of workers @@ -1738,10 +1738,10 @@ class CFTPWorkersList // informs workers that they should attempt to stop; operates on all workers // of the operation (if 'workerInd' is -1) or only on the worker at index 'workerInd'; must - // be called repeatedly until it returns TRUE (processing is batched); 'victims'+'maxVictims' + // be called repeatedly as long as it returns TRUE (processing is batched); 'victims'+'maxVictims' // is an array for workers that need to close the data connection or post WORKER_SHOULDSTOP // (fweWorkerShouldStop) by calling CloseDataConnectionOrPostShouldStop() after this method - // finishes; 'foundVictims' receives the number of filled items in the 'victims' array on input and + // finishes; 'foundVictims' contains the number of filled items in the 'victims' array on input and // returns the updated count of filled items BOOL InformWorkersAboutStop(int workerInd, CFTPWorker** victims, int maxVictims, int* foundVictims); @@ -1842,13 +1842,13 @@ class CFTPWorkersList // WARNING: enters the CSocketsThread::CritSect section !!! void PostLoginChanged(int workerID); - // informs workers in the "sleeping" state about the existence of new work (impulse to search - // for work in the item queue); if 'onlyOneItem' is TRUE, there is just one item - // (informing one worker is enough), otherwise there are more items (inform all - // workers); informing the workers = posting WORKER_WAKEUP; - // WARNING: does not fully lock the WorkersListCritSect, it may not be executed for a worker - // added while the method is running (see AddWorker()) !!! - // WARNING: enters the CSocketsThread::CritSect section !!! + // informs workers in the "sleeping" state that new work is available (a signal to search + // for work in the item queue); if 'onlyOneItem' is TRUE, there is only one item + // (informing one worker is enough), otherwise there are multiple items (inform all + // workers); workers are notified by posting WORKER_WAKEUP; + // WARNING: does not fully use the WorkersListCritSect critical section, so a worker + // added while the method is running may not be informed (see AddWorker()) !!! + // WARNING: enters the CSocketsThread::CritSect critical section !! void PostNewWorkAvailable(BOOL onlyOneItem); // attempts to find a "sleeping" worker with an open connection; on success, @@ -1864,11 +1864,11 @@ class CFTPWorkersList // adds to 'uploaded' the size (in bytes) of the files currently being uploaded by all workers void AddCurrentUploadSize(CQuadWord* uploaded); - // searches for the index of a worker that needs to open the Solve Error dialog (a - // "new" error appeared there (the user has not seen it yet)); 'lastErrorOccurenceTime' is the "time" - // assigned to the last error (used for a quick test whether it even makes sense to look - // for a "new" error); returns TRUE if such a worker was found, - // its index is returned in 'index' + // searches for the index of a worker that needs the Solve Error dialog to be opened (a + // "new" error has appeared for that worker and the user has not seen it yet); 'lastErrorOccurenceTime' is the "time" + // assigned to the last error (used as a quick test of whether it makes sense to search + // for a "new" error at all); returns TRUE if such a worker is found, + // and returns its index in 'index' BOOL SearchWorkerWithNewError(int* index, DWORD lastErrorOccurenceTime); // returns TRUE if the worker list is empty or all workers should stop @@ -1908,8 +1908,8 @@ class CTransferSpeedMeter // can be called from any thread void Clear(); - // returns the connection speed in bytes per second; in 'transferIdleTime' (may be NULL) - // returns the time in seconds since the last data reception + // returns the connection speed in bytes per second; stores in 'transferIdleTime' (may be NULL) + // the time in seconds since the last data was received // can be called from any thread DWORD GetSpeed(DWORD* transferIdleTime); @@ -1999,35 +1999,35 @@ enum CFTPOperationType #define RETRYONRESUMFILE_SKIP 5 // skip (simply do not perform the operation) // WARNING: when adding a value, check the bit range in CFTPOperation !!! -// how to solve the problem "ASCII transfer mode for a binary file" +// how to handle the problem "ASCII transfer mode for a binary file" #define ASCIITRFORBINFILE_USERPROMPT 0 // ask the user #define ASCIITRFORBINFILE_IGNORE 1 // ignore it, the user knows what they are doing #define ASCIITRFORBINFILE_INBINMODE 2 // change the transfer mode to binary and restart the transfer (assuming nothing has been written to the file yet) #define ASCIITRFORBINFILE_SKIP 3 // skip (simply do not perform the operation) // WARNING: when adding a value, check the bit range in CFTPOperation !!! -// how to solve the situation "deleting a non-empty directory" +// how to handle the situation "deleting a non-empty directory" #define NONEMPTYDIRDEL_USERPROMPT 0 // ask the user #define NONEMPTYDIRDEL_DELETEIT 1 // delete it without asking #define NONEMPTYDIRDEL_SKIP 2 // skip (simply do not perform the operation) // WARNING: when adding a value, check the bit range in CFTPOperation !!! -// how to solve the situation "deleting a hidden file" +// how to handle the situation "deleting a hidden file" #define HIDDENFILEDEL_USERPROMPT 0 // ask the user #define HIDDENFILEDEL_DELETEIT 1 // delete it without asking #define HIDDENFILEDEL_SKIP 2 // skip (simply do not perform the operation) // WARNING: when adding a value, check the bit range in CFTPOperation !!! -// how to solve the situation "deleting a hidden directory" +// how to handle the situation "deleting a hidden directory" #define HIDDENDIRDEL_USERPROMPT 0 // ask the user #define HIDDENDIRDEL_DELETEIT 1 // delete it without asking #define HIDDENDIRDEL_SKIP 2 // skip (simply do not perform the operation) // WARNING: when adding a value, check the bit range in CFTPOperation !!! -// how to solve the problem "file/directory has unknown attributes that we cannot preserve (permissions other than 'r'+'w'+'x')" +// how to handle the problem "a file/directory has unknown attributes that we cannot preserve (permissions other than 'r'+'w'+'x')" #define UNKNOWNATTRS_USERPROMPT 0 // ask the user #define UNKNOWNATTRS_IGNORE 1 // ignore it, the user knows what they are doing (set attributes as close to the requested ones as possible) -#define UNKNOWNATTRS_SKIP 2 // we will not change attributes on this file/directory (skip the file/directory) +#define UNKNOWNATTRS_SKIP 2 // do not change attributes on this file/directory (skip the file/directory) // WARNING: when adding a value, check the bit range in CFTPOperation !!! class CExploredPaths @@ -2052,7 +2052,7 @@ class CExploredPaths BOOL AddPath(const char* path); protected: - // returns "found?" and the index of the item or where it should be inserted (sorted array) + // returns "found?" and the item index or the insertion position (sorted array) BOOL GetPathIndex(const char* path, int pathLen, int& index); }; @@ -2065,7 +2065,7 @@ enum COperationState opstFinishedWithErrors // the operation was completed but with errors (items are in the sqisDone, sqisSkipped, sqisFailed or sqisForcedToFail states) }; -#define SMPLCMD_APPROXBYTESIZE 1000 // approximate size of processing a single item in bytes for measuring the speed of Delete and ChangeAttrs operations +#define SMPLCMD_APPROXBYTESIZE 1000 // approximate number of bytes to process one item, for measuring the speed of Delete and ChangeAttrs operations class CFTPOperation { @@ -2075,7 +2075,7 @@ class CFTPOperation protected: // critical section for accessing the object's data - // WARNING: consult access to critical sections in the servers\critsect.txt file !!! + // WARNING: consult servers\critsect.txt before accessing critical sections. CRITICAL_SECTION OperCritSect; int UID; // unique operation number (index in the CFTPOperationsList::Operations array + link for items in the Queue) @@ -2100,16 +2100,16 @@ class CFTPOperation char* User; // user (NULL = unknown) WARNING: anonymous is already part of the string here char* Password; // password (NULL = unknown) WARNING: anonymous password (email) is already part of the string here char* Account; // account info (see FTP command "ACCT") (NULL = unknown) - BOOL RetryLoginWithoutAsking; // TRUE = the worker should try to reconnect even for "error" server replies (code "5xx"); FALSE = reconnect only for "transient-error" replies (code "4xx"); set later by the user when resolving the worker connection problem + BOOL RetryLoginWithoutAsking; // TRUE = the worker should try to reconnect even for "error" server replies (code "5xx"); FALSE = reconnect only for "transient-error" replies (code "4xx"); set later by the user when resolving the worker's connection problem char* InitFTPCommands; // list of FTP commands to send to the server immediately after connecting (NULL = no commands) BOOL UsePassiveMode; // TRUE/FALSE = passive/active data connection mode - BOOL SizeCmdIsSupported; // FALSE = the SIZE command received the server reply "not supported" (no point trying again) + BOOL SizeCmdIsSupported; // FALSE = the server replied "not supported" to the SIZE command (no point trying again) char* ListCommand; // command to obtain a listing of a path on this server (NULL = "LIST") DWORD ServerIP; // IP address of the FTP/Proxy server 'ConnectToHost' (==INADDR_NONE until the IP is known) char* ServerSystem; // server system (reply to the SYST command) - may also be NULL char* ServerFirstReply; // first server reply (often contains the FTP server version) - may also be NULL BOOL UseListingsCache; // TRUE = the user wants to store listings in the cache for this connection - char* ListingServerType; // server type for parsing listings: NULL = autodetect; otherwise the server type name (without the optional leading '*'; if it stops existing, it switches to autodetect) + char* ListingServerType; // server type for parsing listings: NULL = autodetect; otherwise the server type name (without the optional leading '*'; if it no longer exists, it switches to autodetect) BOOL EncryptControlConnection; BOOL EncryptDataConnection; int CompressData; @@ -2134,7 +2134,7 @@ class CFTPOperation int ChildItemsNotDone; // number of unfinished "child" items (except type sqisDone) int ChildItemsSkipped; // number of skipped "child" items (type sqisSkipped) int ChildItemsFailed; // number of failed "child" items (types sqisFailed and sqisForcedToFail) - int ChildItemsUINeeded; // number of user-input-needed "child" items (types sqisFailed and sqisForcedToFail) + int ChildItemsUINeeded; // number of "child" items that require user input (types sqisFailed and sqisForcedToFail) char* SourcePath; // operation source path (full path, possibly including fs-name) char SrcPathSeparator; // most frequently used source path separator ('/', '.', etc.) @@ -2168,8 +2168,8 @@ class CFTPOperation // valid only for download: // data for estimating the block size (for VMS, MVS and other servers that use // blocks - ignored elsewhere) - CQuadWord BlkSizeTotalInBytes; // total size of files obtained so far in bytes (we take only files with a size of at least two blocks) - CQuadWord BlkSizeTotalInBlocks; // total size of files obtained so far in blocks (we take only files with a size of at least two blocks) + CQuadWord BlkSizeTotalInBytes; // total size of files obtained so far in bytes (counting only files at least two blocks in size) + CQuadWord BlkSizeTotalInBlocks; // total size of files obtained so far in blocks (counting only files at least two blocks in size) DWORD BlkSizeActualValue; // current value of the real block size (for progress estimation) (-1 = unknown) BOOL ResumeIsNotSupported; // TRUE = the FTP REST/APPE command returns a permanent error (e.g. "not implemented") @@ -2208,7 +2208,7 @@ class CFTPOperation unsigned ConfirmDelOnHiddenDir : 2; // see constants HIDDENDIRDEL_XXX // **************************************************************************** - // more for Change Attributes: + // additional settings for Change Attributes: // **************************************************************************** unsigned ChAttrOfFiles : 1; // TRUE/FALSE = change/do not change file attributes @@ -2326,9 +2326,9 @@ class CFTPOperation void AddToNotDoneSkippedFailed(int notDone, int skipped, int failed, int uiNeeded, BOOL onlyUINeededOrFailedToSkipped); - // determines whether the name matches the aggregate ASCIIFileMasks mask; 'name'+'ext' are pointers - // to the name and extension (or the end of the name), both placed in a single buffer; returns TRUE if - // the name matches the aggregate mask + // determines whether the name matches the ASCIIFileMasks wildcard mask; 'name' and 'ext' are pointers + // to the name and extension (or the end of the name), both pointing into a single buffer; returns TRUE if + // the name matches the wildcard mask BOOL IsASCIIFile(const char* name, const char* ext); // adds/subtracts 'size' to/from 'TotalSizeInBytes' (if 'sizeInBytes' is TRUE) or to/from 'TotalSizeInBlocks' @@ -2341,7 +2341,7 @@ class CFTPOperation // sets OperationDlg (in the critical section) void SetOperationDlg(COperationDlg* operDlg); - // activates or opens the operation dialog (see OperationDlg); returns success of the operation + // activates or opens the operation dialog (see OperationDlg); returns whether the operation succeeded BOOL ActivateOperationDlg(HWND dropTargetWnd); // closes the operation dialog (if open) and returns the handle of the thread in which the @@ -2449,16 +2449,16 @@ class CFTPOperation void ReportWorkerChange(int workerID, BOOL reportProgressChange); // called by the operation dialog after a change is reported via ReportWorkerChange(); returns the ID of the changed worker - // or -1 if more than one changed; in 'reportProgressChange' (if not NULL) returns TRUE if - // it was a worker change associated with a progress (status) change + // or -1 if more than one worker changed; stores TRUE in 'reportProgressChange' (if not NULL) if + // the worker change was associated with a progress/status change int GetChangedWorker(BOOL* reportProgressChange); // just calls CFTPWorkersList::PostNewWorkAvailable() // WARNING: enters the CSocketsThread::CritSect section !!! void PostNewWorkAvailable(BOOL onlyOneItem); - // just calls CFTPWorkersList::GiveWorkToSleepingConWorker() - // WARNING: enters the CSocketsThread::CritSect section !!! + // only calls CFTPWorkersList::GiveWorkToSleepingConWorker() + // WARNING: enters the CSocketsThread::CritSect critical section !! BOOL GiveWorkToSleepingConWorker(CFTPWorker* sourceWorker); // called to report an item change (only changes that affect the item display in the Operations listview @@ -2528,7 +2528,7 @@ class CFTPOperation BOOL GetEncryptControlConnection() { return EncryptControlConnection; } BOOL GetEncryptDataConnection() { return EncryptDataConnection; } int GetCompressData() { return CompressData; } - CCertificate* GetCertificate(); // WARNING: returns the certificate only after calling its AddRef(), so the caller is responsible for releasing it by calling Release() + CCertificate* GetCertificate(); // WARNING: returns the certificate after calling AddRef() on it, so the caller is responsible for releasing it by calling Release() void SetEncryptDataConnection(BOOL encryptDataConnection) { EncryptDataConnection = encryptDataConnection; } void SetEncryptControlConnection(BOOL encryptControlConnection) { EncryptControlConnection = encryptControlConnection; } @@ -2593,10 +2593,10 @@ class CFTPOperation // determines whether 'ServerSystem' contains the name 'systemName' BOOL IsServerSystem(const char* systemName); - // returns TRUE if the path 'path' is already in the list of explored paths (see 'ExploredPaths'); + // returns TRUE if 'path' is already in the list of explored paths (see 'ExploredPaths'); // WARNING: assumes that 'path' is a path returned by the server, so paths // are compared only as case-sensitive strings (slashes/backslashes/dots, etc., are not trimmed) - // - a cycle may be detected only on its second pass, which is sufficient for our purposes + // - a cycle may be detected only when it is encountered a second time, which is sufficient for our purposes BOOL IsAlreadyExploredPath(const char* path); // stores the path 'path' in the list of explored paths (see 'ExploredPaths'); @@ -2755,9 +2755,9 @@ class CFTPOperation const char* path, CFTPServerPathType pathType, int userLength); - // determines whether among the operations there is an upload to the server 'user'+'host'+'port'; - // 'user' is NULL for anonymous connections; 'userLength' is zero if we do not know how long the username is - // or if it does not contain "forbidden" characters, otherwise it is the expected username length + // determines whether the operations include an upload to the server 'user'+'host'+'port'; + // 'user' is NULL for anonymous connections; 'userLength' is zero if the username length is unknown + // or if the username does not contain "forbidden" characters, otherwise it is the expected username length BOOL IsUploadingToServer(const char* user, const char* host, unsigned short port, int userLength); @@ -2783,7 +2783,7 @@ class CFTPOperationsList { protected: // critical section for accessing the object's data - // WARNING: consult access to critical sections in the servers\critsect.txt file !!! + // WARNING: consult servers\critsect.txt before accessing critical sections. CRITICAL_SECTION OpListCritSect; // list of existing operations; the operation UID is the index into this array, @@ -2800,32 +2800,32 @@ class CFTPOperationsList // returns TRUE if there is no operation in the list BOOL IsEmpty(); - // adds a new operation to the array (works with FirstFreeIndexInOperations); in 'newuid' (if not NULL) + // adds a new operation to the array (uses FirstFreeIndexInOperations); in 'newuid' (if not NULL) // returns the UID of the added operation; returns TRUE on success BOOL AddOperation(CFTPOperation* newOper, int* newuid); // closes all open operation dialogs and waits for all dialog threads to finish void CloseAllOperationDlgs(); - // stops and cancels selected workers of operations; 'parent' is the thread's "foreground" window (after - // pressing ESC it is used to determine whether ESC was pressed in this window and not - // for example in another application; in the main thread it is SalamanderGeneral->GetMsgBoxParent() + // stops and cancels the selected operation workers; 'parent' is the thread's "foreground" window (after + // pressing ESC, it is used to determine whether ESC was pressed in this window and not, + // for example, in another application; in the main thread it is SalamanderGeneral->GetMsgBoxParent() // or a dialog opened by the plugin); if 'operUID' is -1, it works with all workers of all // operations; if 'operUID' is not -1 and 'workerInd' is -1, it works with all workers // of the operation with UID 'operUID'; if neither 'operUID' nor 'workerInd' is -1, it works with the worker // at index 'workerInd' of the operation with UID 'operUID' - // WARNING: enters the CSocketsThread::CritSect and CSocket::SocketCritSect sections !!! + // WARNING: enters the CSocketsThread::CritSect and CSocket::SocketCritSect critical sections !! void StopWorkers(HWND parent, int operUID, int workerInd); - // pauses or resumes selected workers of operations; 'parent' is the thread's "foreground" window (after - // pressing ESC it is used to determine whether ESC was pressed in this window and not - // for example in another application; in the main thread it is SalamanderGeneral->GetMsgBoxParent() + // pauses or resumes the selected operation workers; 'parent' is the thread's "foreground" window (after + // pressing ESC, it is used to determine whether ESC was pressed in this window and not, + // for example, in another application; in the main thread it is SalamanderGeneral->GetMsgBoxParent() // or a dialog opened by the plugin); if 'operUID' is -1, it works with all workers of all // operations; if 'operUID' is not -1 and 'workerInd' is -1, it works with all workers // of the operation with UID 'operUID'; if neither 'operUID' nor 'workerInd' is -1, it works with the worker - // at index 'workerInd' of the operation with UID 'operUID'; if 'pause' is TRUE the selected - // workers should pause, otherwise they should resume - // WARNING: enters the CSocketsThread::CritSect and CSocket::SocketCritSect sections !!! + // at index 'workerInd' of the operation with UID 'operUID'; if 'pause' is TRUE, the selected + // workers are paused, otherwise they are resumed + // WARNING: enters the CSocketsThread::CritSect and CSocket::SocketCritSect critical sections !! void PauseWorkers(HWND parent, int operUID, int workerInd, BOOL pause); // removes the operation with UID 'uid' from the array (updates FirstFreeIndexInOperations); @@ -2905,7 +2905,7 @@ class CUIDArray struct CReturningConnectionData { - int ControlConUID; // to which "control connection" in the panel we return the connection + int ControlConUID; // control connection in the panel to which the connection is returned CFTPWorker* WorkerWithCon; // worker with the returned connection CReturningConnectionData(int controlConUID, CFTPWorker* workerWithCon) @@ -2966,7 +2966,7 @@ struct CUploadListingItem // data of a single file/directory/link in the listing enum CUploadListingChangeType { - ulctDelete, // deleting a name + ulctDelete, // deleting a file name ulctCreateDir, // creating a directory ulctStoreFile, // start uploading a file (may also overwrite a file/link) ulctFileUploaded, // upload finished (may also overwrite a file/link) @@ -3018,7 +3018,7 @@ struct CUploadPathListing // listing for a specific path on the server CUploadListingChange* LastChange; // only in ulsInProgress: last change in the listing (a new change is appended after this one) DWORD LatestChangeTime; // IncListingCounter() from the moment of the last listing change (used to check whether it is possible to update the listing with a new listing - only if LatestChangeTime is less than the start time of downloading the new listing) CUploadWaitingWorker* FirstWaitingWorker; // only in ulsInProgress* states: list of workers waiting for the path listing to finish (or fail) - BOOL FromPanel; // TRUE = listing taken from the panel (may be outdated; if there is doubt about the listing freshness, refresh it) + BOOL FromPanel; // TRUE = listing taken from the panel (may be outdated; if its freshness is in doubt, it is refreshed) TIndirectArray ListingItem; // array of listing items @@ -3040,13 +3040,13 @@ struct CUploadPathListing // listing for a specific path on the server // a possible new item with CUploadListingItem::Name == 'name' should be inserted BOOL FindItem(const char* name, int& index); - // parses the listing 'pathListing'+'pathListingLen'+'pathListingDate'; 'welcomeReply' (must not + // parses the listing from 'pathListing'+'pathListingLen'+'pathListingDate'; 'welcomeReply' (must not // be NULL) is the first server reply (often contains the FTP server version); // 'systReply' (must not be NULL) is the server system (reply to the SYST command); - // 'suggestedListingServerType' is the server type used for parsing the listing: NULL = autodetect, - // otherwise the server type name (without the optional leading '*'; if it stops existing, it switches - // to autodetect); if 'lowMemory' is not NULL, it returns TRUE in it when memory is low; - // returns TRUE if the entire listing was successfully parsed and the object is filled with new items + // 'suggestedListingServerType' is the server type for parsing the listing: NULL = autodetect, + // otherwise the server type name (without the optional leading '*'; if that type no longer exists, + // parsing switches to autodetect); if 'lowMemory' is not NULL, TRUE is returned in it when memory is low; + // returns TRUE if the entire listing was parsed successfully and the object is populated with new items BOOL ParseListing(const char* pathListing, int pathListingLen, const CFTPDate& pathListingDate, CFTPServerPathType pathType, const char* welcomeReply, const char* systReply, const char* suggestedListingServerType, BOOL* lowMemory); @@ -3070,10 +3070,10 @@ struct CUploadPathListing // listing for a specific path on the server // WARNING: do not call directly, called through CUploadListingCache::ReportStoreFile() void ReportStoreFile(const char* name, BOOL* lowMem); - // see CUploadListingCache::ReportFileUploaded(); returns TRUE in 'lowMem' (must not be NULL) - // if there is not enough memory to add the change to the change queue (only in the - // ulsInProgress state) - // WARNING: do not call directly, called through CUploadListingCache::ReportFileUploaded() + // for a description, see CUploadListingCache::ReportFileUploaded(); 'lowMem' (must not be NULL) + // is set to TRUE if there is not enough memory to add the change to the change queue (only in + // the ulsInProgress state) + // WARNING: do not call directly; call through CUploadListingCache::ReportFileUploaded() void ReportFileUploaded(const char* name, const CQuadWord& fileSize, BOOL* lowMem); // applies the change 'change' to the listing; returns success (failure = the entire listing must be invalidated) @@ -3083,10 +3083,10 @@ struct CUploadPathListing // listing for a specific path on the server // to finish (or fail); returns FALSE only when memory is low BOOL AddWaitingWorker(int workerMsg, int workerUID); - // to all workers from the FirstWaitingWorker list: if 'uploadFirstWaitingWorker' is NULL, + // for all workers in the FirstWaitingWorker list: if 'uploadFirstWaitingWorker' is NULL, // WORKER_TGTPATHLISTINGFINISHED messages are sent; otherwise 'uploadFirstWaitingWorker' - // is the list where these workers should be added - // WARNING: if 'uploadFirstWaitingWorker' is NULL, must be called inside CSocketsThread::CritSect! + // is the list to which these workers should be added + // WARNING: if 'uploadFirstWaitingWorker' is NULL, this must be called inside CSocketsThread::CritSect void InformWaitingWorkers(CUploadWaitingWorker** uploadFirstWaitingWorker); private: @@ -3151,10 +3151,10 @@ struct CUploadListingsOnServer // listings of paths on a single server // see CUploadListingCache::IsListingFromPanel BOOL IsListingFromPanel(const char* path, CFTPServerPathType pathType); - // adds an empty listing for path 'path'+'dirName' of type 'pathType' with state 'listingState'; + // adds an empty listing for the path 'path'+'dirName' of type 'pathType' with state 'listingState'; // 'dirName' may also be NULL (a listing for the path 'path' is added); 'doNotCheckIfPathIsKnown' - // is TRUE if we know the path is not in the 'Listing' array; returns a pointer to the new - // listing on success, otherwise returns NULL + // is TRUE if we know the path is not in the 'Listings' array; returns a pointer to the new + // listing on success, otherwise NULL CUploadPathListing* AddEmptyListing(const char* path, const char* dirName, CFTPServerPathType pathType, CUploadListingState listingState, @@ -3195,8 +3195,8 @@ struct CUploadListingsOnServer // listings of paths on a single server // invalidates the listing at index 'index' (e.g. after an "unknown change" in this listing) void InvalidateListing(int index); - // see CUploadListingCache::GetListing() - // WARNING: do not call directly, called through CUploadListingCache::GetListing() + // for a description, see CUploadListingCache::GetListing() + // WARNING: do not call directly; call through CUploadListingCache::GetListing() BOOL GetListing(const char* path, CFTPServerPathType pathType, int workerMsg, int workerUID, BOOL* listingInProgress, BOOL* notAccessible, BOOL* getListing, const char* name, CUploadListingItem** existingItem, @@ -3230,18 +3230,19 @@ class CUploadListingCache ~CUploadListingCache(); // adds or updates a listing from the panel (before starting an upload operation and after a panel refresh - // during the upload operation); 'user'+'host'+'port' describes the server; 'path' is the - // local path on the server of type 'pathType'; 'pathListing'+'pathListingLen' is the listing text; - // 'pathListingDate' is the listing timestamp (needed for "year_or_time"); - // 'listingStartTime' is IncListingCounter() from the moment the LIST command was sent to the server - // (listing started); if 'onlyUpdate' is TRUE, only an update of a listing already in the cache is performed; - // 'welcomeReply' (must not be NULL) is the first server reply (often contains the FTP server version); - // 'systReply' (must not be NULL) is the server system (reply to the SYST command); - // 'suggestedListingServerType' is the server type for parsing the listing: - // NULL = autodetect, otherwise the server type name (without the optional leading '*'; if it stops existing, - // it switches to autodetect); returns FALSE if the listing cannot be parsed or if memory is low or parameters are invalid; - // returns TRUE if the listing was added or updated or was not updated because 'onlyUpdate'==TRUE or because - // an update is not needed (i.e. returns TRUE if the cached path listing can be used) + // during an upload operation); 'user'+'host'+'port' describes the server; 'path' is the + // local path on the server of type 'pathType'; 'pathListing'+'pathListingLen' is the listing + // text; 'pathListingDate' is the date when the listing was obtained (needed for "year_or_time"); + // 'listingStartTime' is IncListingCounter() from the moment the LIST command was sent to the + // server (listing start); if 'onlyUpdate' is TRUE, only a listing already in the cache is + // updated; 'welcomeReply' (must not be NULL) is the first server reply (often containing the + // FTP server version); 'systReply' (must not be NULL) is the server system reply (reply to the + // SYST command); 'suggestedListingServerType' is the server type for parsing the listing: + // NULL = autodetection, otherwise the server type name (without an optional leading '*'; if it + // no longer exists, it switches to autodetection); returns FALSE if the listing cannot be + // parsed, on out-of-memory, or on invalid parameters; returns TRUE if the listing was added or + // updated, or was not updated because 'onlyUpdate'==TRUE or because no update is needed (i.e. + // returns TRUE if the cached path listing can be used) BOOL AddOrUpdateListing(const char* user, const char* host, unsigned short port, const char* path, CFTPServerPathType pathType, const char* pathListing, int pathListingLen, @@ -3313,19 +3314,18 @@ class CUploadListingCache void ReportUnknownChange(const char* user, const char* host, unsigned short port, const char* workPath, CFTPServerPathType pathType); - // obtaining the listing of path 'path' (of type 'pathType') on server 'user'+'host'+'port' - // from the cache - if it is not yet in the cache, it is added; if it is already being fetched, we wait; - // if the path is not in the cache, it is added in the ulsInProgress state, returns TRUE in 'getListing' - // and TRUE in 'listingInProgress'; if the path listing is "unobtainable", returns TRUE - // in 'notAccessible' and FALSE in 'listingInProgress'; if the path is in the cache - // in one of the ulsInProgress* states, returns FALSE in 'getListing', TRUE - // in 'listingInProgress', and after the listing download finishes (or fails) - // posts WORKER_TGTPATHLISTINGFINISHED to worker 'workerMsg'+'workerUID'; - // if the path is in the cache in the ulsReady state, returns FALSE in 'notAccessible', - // FALSE in 'listingInProgress', returns the item named 'name' in the allocated - // structure 'existingItem' (NULL if an item with that name was not found), - // and TRUE/FALSE in 'nameExists' depending on whether an item named 'name' was found; - // returns FALSE only when memory is low + // obtains the listing of path 'path' (of type 'pathType') on server 'user'+'host'+'port' + // from the cache - if it is not yet in the cache, it is added; if it is already being fetched, + // the caller waits; if the path is not in the cache, it is added in the ulsInProgress state, + // returns TRUE in 'getListing' and TRUE in 'listingInProgress'; if the path listing is + // "unobtainable", it returns TRUE in 'notAccessible' and FALSE in 'listingInProgress'; if the + // path is in the cache in one of the ulsInProgress* states, it returns FALSE in 'getListing', + // TRUE in 'listingInProgress', and after the listing download finishes (or on failure) it posts + // WORKER_TGTPATHLISTINGFINISHED to worker 'workerMsg'+'workerUID'; if the path is in the cache + // in the ulsReady state, it returns FALSE in 'notAccessible', FALSE in 'listingInProgress', + // returns the item named 'name' in the allocated structure 'existingItem' (NULL if no item + // with that name was found), and TRUE/FALSE in 'nameExists' depending on whether an item + // named 'name' was found; returns FALSE only on out-of-memory BOOL GetListing(const char* user, const char* host, unsigned short port, const char* path, CFTPServerPathType pathType, int workerMsg, int workerUID, BOOL* listingInProgress, BOOL* notAccessible, @@ -3411,8 +3411,8 @@ class CFTPOpenedFile const char* path, CFTPServerPathType pathType, const char* name, CFTPFileAccessType accessType); - // compares this opened file with the file specified by the method parameters; returns TRUE if - // it is the same file + // compares this open file with the file specified by the method parameters; returns TRUE if + // they are the same file BOOL IsSameFile(const char* user, const char* host, unsigned short port, const char* path, CFTPServerPathType pathType, const char* name); From 8b7cefaaa3856071eec078676f6b41f00bf07b4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 9 Apr 2026 18:09:30 +0200 Subject: [PATCH 011/710] [tanslation] Fix src/plugins/ftp/operats1.cpp comments (#382) --- src/plugins/ftp/operats1.cpp | 62 ++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/src/plugins/ftp/operats1.cpp b/src/plugins/ftp/operats1.cpp index 50e7dc172..ca0b3b4dd 100644 --- a/src/plugins/ftp/operats1.cpp +++ b/src/plugins/ftp/operats1.cpp @@ -139,7 +139,7 @@ void CFTPOperationsList::DeleteOperation(int uid, BOOL doNotPostChangeOnPathNoti if (FirstFreeIndexInOperations >= Operations.Count) FirstFreeIndexInOperations = -1; } - else // deleting inside the array, no array deallocation is possible + else // deletion inside the array; no array deallocation is possible { if (FirstFreeIndexInOperations == -1 || uid < FirstFreeIndexInOperations) FirstFreeIndexInOperations = uid; @@ -150,7 +150,7 @@ void CFTPOperationsList::DeleteOperation(int uid, BOOL doNotPostChangeOnPathNoti HANDLES(LeaveCriticalSection(&OpListCritSect)); // if an upload operation was canceled and no other upload operation is working with - // the server used by the canceled operation, we can release this server from the upload + // the server used by the canceled operation, we can release that server from the upload // listing cache if (uploadOperDeleted && !IsUploadingToServer(uploadUser, uploadHost, uploadPort)) UploadListingCache.RemoveServer(uploadUser, uploadHost, uploadPort); @@ -171,7 +171,7 @@ void CFTPOperationsList::CloseAllOperationDlgs() oper->CloseOperationDlg(&t); if (t != NULL) { - HANDLES(LeaveCriticalSection(&OpListCritSect)); // we must leave the section; the dialog thread calls CFTPOperationsList::SetOperationDlg() + HANDLES(LeaveCriticalSection(&OpListCritSect)); // we must leave the critical section; the dialog thread calls CFTPOperationsList::SetOperationDlg() CALL_STACK_MESSAGE1("AuxThreadQueue.WaitForExit()"); AuxThreadQueue.WaitForExit(t, INFINITE); HANDLES(EnterCriticalSection(&OpListCritSect)); @@ -211,7 +211,7 @@ void CFTPOperationsList::WaitForFinishOrESC(HWND parent, int milliseconds, CWait waitTime = cycleTime; DWORD waitRes = MsgWaitForMultipleObjects(1, &WorkerMayBeClosedEvent, FALSE, waitTime, QS_ALLINPUT); - // check the ESC key first (so we do not ignore it for the user) + // check for ESC first (so we do not ignore the user's key press) if (milliseconds != 0 && // if the timeout is zero we are only pumping messages, do not handle ESC ((GetAsyncKeyState(VK_ESCAPE) & 0x8001) && GetForegroundWindow() == parent || // ESC pressed waitWnd != NULL && waitWnd->GetWindowClosePressed())) // close button in the wait window @@ -222,7 +222,7 @@ void CFTPOperationsList::WaitForFinishOrESC(HWND parent, int milliseconds, CWait reason = wwsrEsc; break; // report ESC } - if (waitRes != WAIT_OBJECT_0) // no additional worker was closed (we ignore this event; it only "wakes" the waiting) + if (waitRes != WAIT_OBJECT_0) // no additional worker was closed (we ignore this event; it only wakes the wait) { if (waitRes == WAIT_OBJECT_0 + 1) // process Windows messages { @@ -247,11 +247,11 @@ void CFTPOperationsList::WaitForFinishOrESC(HWND parent, int milliseconds, CWait restOfWaitTime == waitTime) // this is not just the ESC key test cycle timeout but the global timeout { reason = wwsrTimeout; - break; // report the timeout + break; // indicate a timeout } } } - if (milliseconds != INFINITE) // recalculate the remaining wait time (according to real time) + if (milliseconds != INFINITE) // recalculate the remaining wait time based on actual elapsed time { DWORD t = GetTickCount() - timeStart; // works even when the tick counter overflows if (t < (DWORD)milliseconds) @@ -269,7 +269,7 @@ void CFTPOperationsList::StopWorkers(HWND parent, int operUID, int workerInd) CALL_STACK_MESSAGE3("CFTPOperationsList::StopWorkers(, %d, %d)", operUID, workerInd); parent = FindPopupParent(parent); - // remember the focus from 'parent' (store NULL if the focus is not within 'parent') + // remember the focused window in 'parent' (store NULL if the focus is not within 'parent') HWND focusedWnd = GetFocus(); HWND hwnd = focusedWnd; while (hwnd != NULL && hwnd != parent) @@ -320,7 +320,7 @@ void CFTPOperationsList::StopWorkers(HWND parent, int operUID, int workerInd) for (i = 0; i < count; i++) victims[i]->CloseDataConnectionOrPostShouldStop(); if (done) - break; // all operations reported they do not want another call + break; // all operations reported they do not want any further calls } // ensure that the "elapsed time" stops in the operation dialogs of the halted operations @@ -400,9 +400,9 @@ void CFTPOperationsList::StopWorkers(HWND parent, int operUID, int workerInd) // case wwsrWorkerSocketClosure: break; // only check whether all worker sockets are already closed } - if (terminate) // cancel or timeout, force workers to finish quickly and continue waiting for them to end + if (terminate) // cancel or timeout, force workers to terminate quickly and continue waiting for them to finish { - lastOpIndex = 0; // optimization (index of the last processed operation - start with it in the next round) + lastOpIndex = 0; // optimization (index of the last processed operation - start from it in the next round) while (1) { BOOL done = TRUE; @@ -435,7 +435,7 @@ void CFTPOperationsList::StopWorkers(HWND parent, int operUID, int workerInd) for (i = 0; i < count; i++) victims[i]->ForceClose(); if (done) - break; // all operations reported they do not want another call + break; // all operations reported that they do not want any further calls } } @@ -516,7 +516,7 @@ void CFTPOperationsList::StopWorkers(HWND parent, int operUID, int workerInd) for (i = 0; i < count; i++) DeleteSocket(victims[i]); if (done) - break; // all operations reported they do not want another call + break; // all operations reported that they do not want another call } Logs.RefreshListOfLogsInLogsDlg(); // refresh the Log - workers are closed @@ -1061,10 +1061,10 @@ int CFTPQueue::GetUserInputNeededCount(BOOL onlyUINeeded, TDirectArray* U if (item->UID == focusedItemUID) { *indexInAll = i; - if (item->GetItemState() >= sqisSkipped /* sqisSkipped, sqisFailed, sqisForcedToFail nebo sqisUserInputNeeded */) + if (item->GetItemState() >= sqisSkipped /* sqisSkipped, sqisFailed, sqisForcedToFail, or sqisUserInputNeeded */) *indexInUIN = c; } - if (item->GetItemState() >= sqisSkipped /* sqisSkipped, sqisFailed, sqisForcedToFail nebo sqisUserInputNeeded */) + if (item->GetItemState() >= sqisSkipped /* sqisSkipped, sqisFailed, sqisForcedToFail, or sqisUserInputNeeded */) { if (onlyUINeeded) UINeededArr->Add(i); @@ -1526,7 +1526,7 @@ int CFTPQueue::RetryItem(int UID, CFTPOperation* oper) ret = LastFoundIndex; found->ChangeStateAndCounters(newState, oper, this); if (found->ProblemID == ITEMPR_UNABLETORESUME) - oper->SetResumeIsNotSupported(FALSE); // so Retry makes any sense at all + oper->SetResumeIsNotSupported(FALSE); // so that Retry makes sense at all oper->SetSizeCmdIsSupported(TRUE); // so that the SIZE command is tried again if needed found->ProblemID = ITEMPR_OK; found->WinError = NO_ERROR; @@ -1535,7 +1535,7 @@ int CFTPQueue::RetryItem(int UID, CFTPOperation* oper) SalamanderGeneral->Free(found->ErrAllocDescr); found->ErrAllocDescr = NULL; } - found->ForceAction = fqiaNone; // to ensure Autorename is not performed instead of Retry + found->ForceAction = fqiaNone; // so that, for example, Autorename is not performed instead of Retry } else TRACE_I("CFTPQueue::RetryItem(): cannot retry item because it's not in any of error states!"); @@ -2190,7 +2190,7 @@ int CFTPQueue::SolveErrorOnItem(HWND parent, int UID, CFTPOperation* oper) case 45: // upload: unable to resume (Copy/Move) - server does not support resuming case 46: // upload: unable to resume the file because the target file size is unknown case 47: // upload: unable to resume the file because the target file is larger than the source file - case 51: // issue "unable to verify whether the file was uploaded successfully" (we sent the entire file and the server simply did not respond; the file is most likely OK but we cannot test it - reasons: ASCII transfer mode or we do not have the size in bytes (neither listing nor the SIZE command)) + case 51: // issue "unable to verify whether the file was uploaded successfully" (we sent the entire file and the server simply did not respond; the file is most likely OK, but we cannot verify it - reasons: ASCII transfer mode or we do not have the size in bytes (neither from a listing nor from the SIZE command)) { CSolveServerCmdErr2 dlg(parent, openDlgWithID == 21 || openDlgWithID == 22 || openDlgWithID == 44 || @@ -2266,7 +2266,7 @@ int CFTPQueue::SolveErrorOnItem(HWND parent, int UID, CFTPOperation* oper) } } - if (dlgResult != IDCANCEL) // store the values entered by the user in the item + if (dlgResult != IDCANCEL) // store the user-entered values in the item { HANDLES(EnterCriticalSection(&QueueCritSect)); found = FindItemWithUID(UID); @@ -2348,7 +2348,7 @@ int CFTPQueue::SolveErrorOnItem(HWND parent, int UID, CFTPOperation* oper) } if (openDlgWithID == 12 && (item->Type == fqitUploadCopyExploreDir || item->Type == fqitUploadMoveExploreDir)) - { // invalidate the target path listing (if an outdated listing containing the target directory is used, CWD into this directory reports "path not found" - with an up-to-date listing the directory is created via MKD) + { // invalidate the target path listing (if an outdated listing containing the target directory is used, CWD to this directory returns "path not found"; with an up-to-date listing, the directory is created via MKD) CFTPQueueItemCopyMoveUploadExplore* curItem = (CFTPQueueItemCopyMoveUploadExplore*)item; UpdateUploadTgtDirState(curItem, UPLOADTGTDIRSTATE_UNKNOWN); oper->GetUserHostPort(userBuf, hostBuf, &portBuf); @@ -2356,7 +2356,7 @@ int CFTPQueue::SolveErrorOnItem(HWND parent, int UID, CFTPOperation* oper) UploadListingCache.InvalidatePathListing(userBuf, hostBuf, portBuf, curItem->TgtPath, pathType); } if (found->ProblemID == ITEMPR_UNABLETORESUME) - oper->SetResumeIsNotSupported(FALSE); // so Retry makes any sense at all + oper->SetResumeIsNotSupported(FALSE); // so that Retry makes sense at all item->ProblemID = ITEMPR_OK; item->WinError = NO_ERROR; if (item->ErrAllocDescr != NULL) @@ -2459,7 +2459,7 @@ int CFTPQueue::SolveErrorOnItem(HWND parent, int UID, CFTPOperation* oper) ((CFTPQueueItemChAttrDir*)item)->AttrErr = FALSE; // fqitChAttrsDir } - if (dlgResult == CM_SIEA_SETNEWATTRS) // wants to set a new attribute value + if (dlgResult == CM_SIEA_SETNEWATTRS) // set a new attribute value { if (item->Type == fqitChAttrsFile) { @@ -2501,11 +2501,11 @@ int CFTPQueue::SolveErrorOnItem(HWND parent, int UID, CFTPOperation* oper) break; } - case fqitDeleteExploreDir: // explore a directory for delete (note: directory links are removed as a whole, the operation objective is met and nothing "extra" is deleted) (object of class CFTPQueueItemDelExplore) + case fqitDeleteExploreDir: // explore a directory for a delete operation (note: links to directories are deleted as a whole; the purpose of the operation is achieved and nothing "extra" is deleted) (object of class CFTPQueueItemDelExplore) case fqitDeleteLink: // delete for a link (object of class CFTPQueueItemDel) case fqitDeleteFile: // delete for a file (object of class CFTPQueueItemDel) { - if (openDlgWithID == 9 || // delete directory error: the directory is hidden (more a confirmation than an error) + if (openDlgWithID == 9 || // delete directory error: the directory is hidden (more of a confirmation than an error) openDlgWithID == 10 || // delete file or link error: the file is hidden (more a confirmation than an error) openDlgWithID == 11) // delete directory error: the directory is not empty (more a confirmation than an error) { @@ -2529,7 +2529,7 @@ int CFTPQueue::SolveErrorOnItem(HWND parent, int UID, CFTPOperation* oper) { if (openDlgWithID == 9) // error: hidden directory ((CFTPQueueItemDelExplore*)item)->IsHiddenDir = FALSE; - else // error: directory not empty + else // error: non-empty directory ((CFTPQueueItemDelExplore*)item)->IsTopLevelDir = FALSE; break; } @@ -2544,7 +2544,7 @@ int CFTPQueue::SolveErrorOnItem(HWND parent, int UID, CFTPOperation* oper) item->ChangeStateAndCounters(sqisWaiting, oper, this); item->ProblemID = ITEMPR_OK; item->WinError = NO_ERROR; - if (item->ErrAllocDescr != NULL) // just to be safe (probably not needed) + if (item->ErrAllocDescr != NULL) // as a precaution (probably not needed) { SalamanderGeneral->Free(item->ErrAllocDescr); item->ErrAllocDescr = NULL; @@ -2723,7 +2723,7 @@ int CFTPQueue::SolveErrorOnItem(HWND parent, int UID, CFTPOperation* oper) { case IDOK: item->ForceAction = fqiaNone; - break; // to make sure Retry is performed and not, for example, Autorename + break; // to ensure Retry is used instead of, for example, Autorename case CM_SCRD_USEALTNAME: item->ForceAction = fqiaUseAutorename; break; // force Autorename on the next attempt @@ -2823,7 +2823,7 @@ void CFTPQueue::UpdateItemState(CFTPQueueItem* item, CFTPQueueItemState state, D else { if (errAllocDescr != NULL) - free(errAllocDescr); // there is nowhere to store the value, so at least free it + free(errAllocDescr); // no place to store the value, so at least free it } HANDLES(LeaveCriticalSection(&QueueCritSect)); } @@ -3226,7 +3226,7 @@ BOOL CFTPQueue::SearchItemWithNewError(int* itemUID, int* itemIndex) CALL_STACK_MESSAGE1("CFTPQueue::SearchItemWithNewError()"); HANDLES(EnterCriticalSection(&QueueCritSect)); BOOL res = FALSE; - if (LastFoundErrorOccurenceTime + 1 < LastErrorOccurenceTime + 1) // +1 is here because -1 is used as the initial value + if (LastFoundErrorOccurenceTime + 1 < LastErrorOccurenceTime + 1) // +1 is here because -1 is used as the initial values { // it makes sense to search int foundUID = -1; int foundIndex = -1; @@ -3239,7 +3239,7 @@ BOOL CFTPQueue::SearchItemWithNewError(int* itemUID, int* itemIndex) if (item->IsItemInSimpleErrorState() && item->HasErrorToSolve(NULL, NULL)) itemErrorOccurenceTime = item->ErrorOccurenceTime; if (itemErrorOccurenceTime != -1 && // the item contains an error - itemErrorOccurenceTime >= LastFoundErrorOccurenceTime + 1 && // it is a "new" error + itemErrorOccurenceTime >= LastFoundErrorOccurenceTime + 1 && // this is a "new" error (foundUID == -1 || foundErrorOccurenceTime > itemErrorOccurenceTime)) // so far the first found or the "oldest" (we resolve errors in the order they occurred) { foundErrorOccurenceTime = itemErrorOccurenceTime; @@ -3525,7 +3525,7 @@ void CFTPQueue::ReturnToWaitingItems(CFTPQueueItem* item, CFTPOperation* oper) BOOL exploreOrResolve = item->IsExploreOrResolveItem(); if (exploreOrResolve || !GetOnlyExploreAndResolveItems) { - FirstWaitingItemIndex = 0; // we will not determine the index of the returned item (computationally as difficult as finding the first "waiting" item - which is done only once, unlike calling this function) + FirstWaitingItemIndex = 0; // we will not determine the index of the returned item (that is as computationally expensive as finding the first "waiting" item, which is done only once, unlike calls to this function) if (exploreOrResolve) GetOnlyExploreAndResolveItems = TRUE; } From 8d1259153dfdbd8bb6a650fb640424486947426f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 9 Apr 2026 18:35:06 +0200 Subject: [PATCH 012/710] [tanslation] Fix src/plugins/ftp/operats2.cpp comments (#383) --- src/plugins/ftp/operats2.cpp | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/plugins/ftp/operats2.cpp b/src/plugins/ftp/operats2.cpp index 432c22d22..c37592c2c 100644 --- a/src/plugins/ftp/operats2.cpp +++ b/src/plugins/ftp/operats2.cpp @@ -30,8 +30,8 @@ class COperationDlgThread : public CThread CALL_STACK_MESSAGE1("COperationDlgThread::Body()"); // 'sendWMClose': the dialog sets it to TRUE when WM_CLOSE is received - // when a modal dialog above the operation dialog is open - once that - // modal dialog closes, WM_CLOSE is sent again to the operation dialog + // while a modal dialog is open over the operation dialog - once that + // modal dialog closes, WM_CLOSE is sent to the operation dialog again BOOL sendWMClose = FALSE; OperDlg->SendWMClose = &sendWMClose; if (OperDlg->Create() == NULL || OperDlg->CloseDlg) @@ -44,7 +44,7 @@ class COperationDlgThread : public CThread else { HWND dlg = OperDlg->HWindow; // safely stored window handle (valid even after OperDlg is destroyed) - if (AlwaysOnTop) // handle always-on-top at least "statically" (it's not in the system menu) + if (AlwaysOnTop) // handle always-on-top at least statically (it is not in the system menu) SetWindowPos(dlg, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); SetForegroundWindow(dlg); @@ -91,7 +91,7 @@ BOOL CFTPOperation::SetConnection(CFTPProxyServer* proxyServer, const char* host BOOL err = (host == NULL || *host == 0); Host = SalamanderGeneral->DupStr(host); Port = port; - User = SalamanderGeneral->DupStr((user != NULL && *user == 0) ? NULL : user); // remains NULL if it is NULL + User = SalamanderGeneral->DupStr((user != NULL && *user == 0) ? NULL : user); // remains NULL if user is NULL Password = SalamanderGeneral->DupStr((password != NULL && *password == 0) ? NULL : password); Account = SalamanderGeneral->DupStr((account != NULL && *account == 0) ? NULL : account); InitFTPCommands = SalamanderGeneral->DupStr((initFTPCommands != NULL && *initFTPCommands == 0) ? NULL : initFTPCommands); @@ -119,7 +119,7 @@ BOOL CFTPOperation::SetConnection(CFTPProxyServer* proxyServer, const char* host { ProxyScriptText = GetProxyScriptText(proxyType, FALSE); if (ProxyScriptText[0] == 0) - ProxyScriptText = GetProxyScriptText(fpstNotUsed, FALSE); // undefined script = "not used (direct connection)" script - SOCKS 4/4A/5, HTTP 1.1 + ProxyScriptText = GetProxyScriptText(fpstNotUsed, FALSE); // undefined script means the "not used (direct connection)" script for SOCKS 4/4A/5 and HTTP 1.1 } if (!err) { @@ -131,7 +131,7 @@ BOOL CFTPOperation::SetConnection(CFTPProxyServer* proxyServer, const char* host &proxyScriptParams, connectToHost, &ConnectToPort, NULL, NULL, errBuf, NULL)) { - if (proxyScriptParams.NeedUserInput()) // theoretically should not happen (already verified by running it in the panel) + if (proxyScriptParams.NeedUserInput()) // this should theoretically never happen (already verified by running it in the panel) { err = TRUE; TRACE_E("CFTPOperation::SetConnection(): unexpected situation: proxy script needs user input!"); @@ -153,7 +153,7 @@ void CFTPOperation::SetBasicData(char* operationSubject, const char* listingServ CALL_STACK_MESSAGE1("CFTPOperation::SetBasicData()"); OperationSubject = SalamanderGeneral->DupStr(operationSubject); - ListingServerType = SalamanderGeneral->DupStr(listingServerType); // remains NULL if it is NULL + ListingServerType = SalamanderGeneral->DupStr(listingServerType); // remains NULL if user is NULL } void CFTPOperation::SetOperationDelete(const char* sourcePath, char srcPathSeparator, @@ -426,7 +426,7 @@ void CFTPOperation::AddToNotDoneSkippedFailed(int notDone, int skipped, int fail { BOOL softRefresh = state == opstFinishedWithErrors || // FIXME: once a window with the operation queue exists, we must replace OperationDlg->DlgWillCloseIfOpFinWithSkips with a different detection of whether the worker closes (passing the connection back to the panel) state == opstFinishedWithSkips && (OperationDlg != NULL ? !OperationDlg->DlgWillCloseIfOpFinWithSkips : TRUE); - PostChangeOnPathNotifications(softRefresh); // the line is free now (at least for this operation), so we can afford listing refreshes + PostChangeOnPathNotifications(softRefresh); // the connection is free now (at least for this operation), so we can afford to refresh the listing } HANDLES(LeaveCriticalSection(&OperCritSect)); } @@ -517,7 +517,7 @@ BOOL CFTPOperation::ActivateOperationDlg(HWND dropTargetWnd) else ret = TRUE; // success } - else // low memory, error + else // out of memory, error { delete OperationDlg; OperationDlg = NULL; @@ -528,7 +528,7 @@ BOOL CFTPOperation::ActivateOperationDlg(HWND dropTargetWnd) } } else - TRACE_E(LOW_MEMORY); // low memory, error + TRACE_E(LOW_MEMORY); // out of memory, error } HANDLES(LeaveCriticalSection(&OperCritSect)); return ret; @@ -849,7 +849,7 @@ BOOL CFTPOperation::PrepareNextScriptCmd(char* buf, int bufSize, char* logBuf, i char proxyLogCmdBuf[FTPCOMMAND_MAX_SIZE]; BOOL ret = TRUE; if (*proxyScriptExecPoint == NULL) - *proxyScriptExecPoint = ProxyScriptStartExecPoint; // we should prepare the first script command + *proxyScriptExecPoint = ProxyScriptStartExecPoint; // prepare the first script command if (ProcessProxyScript(ProxyScriptText, proxyScriptExecPoint, proxyScriptLastCmdReply, &proxyScriptParams, NULL, NULL, proxySendCmdBuf, proxyLogCmdBuf, errDescrBuf, NULL)) @@ -860,7 +860,7 @@ BOOL CFTPOperation::PrepareNextScriptCmd(char* buf, int bufSize, char* logBuf, i int resID = 0; if (proxyScriptParams.NeedProxyHost) { - resID = IDS_WORKERUNKNOWNPROXYHOST; // we do say we need it, but the user cannot provide it - if it is ever required (should not happen yet because the login in the panel succeeded even without ProxyHost, so it likely will not be needed here either), add a dialog for entering ProxyHost... + resID = IDS_WORKERUNKNOWNPROXYHOST; // we indicate that it is required, but the user cannot enter it; if that ever becomes necessary (it should not for now, because login in the panel already succeeded without ProxyHost, so it is not expected here either), add a dialog for entering ProxyHost... TRACE_E("CFTPOperation::PrepareNextScriptCmd(): unexpected situation: ProxyHost is empty!"); } if (proxyScriptParams.NeedProxyPassword) @@ -1500,7 +1500,7 @@ void CFTPOperation::SetCertificate(CCertificate* certificate) CALL_STACK_MESSAGE1("CFTPOperation::SetCertificate()"); HANDLES(EnterCriticalSection(&OperCritSect)); - CCertificate* old = pCertificate; // ensures AddRef is called via Release (in case pCertificate == certificate) + CCertificate* old = pCertificate; // ensures AddRef is called before Release (in case pCertificate == certificate) pCertificate = certificate; if (pCertificate) pCertificate->AddRef(); @@ -1684,7 +1684,7 @@ void CFTPOperation::PostNewWorkAvailable(BOOL onlyOneItem) BOOL CFTPOperation::GiveWorkToSleepingConWorker(CFTPWorker* sourceWorker) { CALL_STACK_MESSAGE1("CFTPOperation::GiveWorkToSleepingConWorker()"); - return WorkersList.GiveWorkToSleepingConWorker(sourceWorker); // synchronization is inside WorkersList (the OperCritSect section is not needed here) + return WorkersList.GiveWorkToSleepingConWorker(sourceWorker); // synchronization is handled within WorkersList (the OperCritSect section is not needed here) } CFTPServerPathType @@ -2107,7 +2107,7 @@ void CFTPQueueItem::SetItem(int parentUID, CFTPQueueItemType type, CFTPQueueItem BOOL CFTPQueueItem::HasErrorToSolve(BOOL* canSkip, BOOL* canRetry) { - BOOL solvableErr = ProblemID != ITEMPR_INVALIDPATHTODIR && // not an unsolvable problem (no Retry can help) + BOOL solvableErr = ProblemID != ITEMPR_INVALIDPATHTODIR && // not an unsolvable problem (where Retry cannot help) ProblemID != ITEMPR_DIREXPLENDLESSLOOP && ProblemID != ITEMPR_INVALIDPATHTOLINK; if (canSkip != NULL) @@ -2240,7 +2240,7 @@ void CFTPQueueItem::GetProblemDescr(char* buf, int bufSize) } if (attrs == NULL) attrs = LoadStr(IDS_OPERDOPPR_UNKEXISTATTR); - _snprintf_s(buf, bufSize, _TRUNCATE, LoadStr(IDS_OPERDOPPR_UNKNOWNATTRS), attrs); // attrs might even be NULL (on error); sprintf can cope with that + _snprintf_s(buf, bufSize, _TRUNCATE, LoadStr(IDS_OPERDOPPR_UNKNOWNATTRS), attrs); // attrs might even be NULL (on failure); _snprintf_s can cope with that break; } @@ -2548,7 +2548,7 @@ void CFTPQueueItemAncestor::ChangeStateAndCounters(CFTPQueueItemState state, CFT break; } } - queue->UpdateCounters((CFTPQueueItem*)this, FALSE); // handle the state change by virtually removing the item and adding it back after the state changes + queue->UpdateCounters((CFTPQueueItem*)this, FALSE); // handle the state change by virtually removing the item and adding it back after the state change State = state; queue->UpdateCounters((CFTPQueueItem*)this, TRUE); if (((CFTPQueueItem*)this)->IsItemInSimpleErrorState()) @@ -2591,7 +2591,7 @@ void CFTPQueueItemDir::SetStateAndNotDoneSkippedFailed(int childItemsNotDone, in ChildItemsSkipped = childItemsSkipped; ChildItemsFailed = childItemsFailed; ChildItemsUINeeded = childItemsUINeeded; - if (GetItemState() == sqisWaiting) // if the item is ready to process, check whether + if (GetItemState() == sqisWaiting) // if the item is ready to process, check whether it needs to be delayed or must fail because of child items { // it needs to be delayed or must fail because of child items if (ChildItemsNotDone - ChildItemsSkipped - ChildItemsFailed - ChildItemsUINeeded > 0) SetStateInternal(sqisDelayed); From 90304e0daa41bda57273919c1b2f16979603ac24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 9 Apr 2026 18:47:12 +0200 Subject: [PATCH 013/710] [tanslation] Fix src/plugins/ftp/operats3.cpp comments (#384) --- src/plugins/ftp/operats3.cpp | 116 +++++++++++++++++------------------ 1 file changed, 58 insertions(+), 58 deletions(-) diff --git a/src/plugins/ftp/operats3.cpp b/src/plugins/ftp/operats3.cpp index 0a7f91cd6..c8cd87963 100644 --- a/src/plugins/ftp/operats3.cpp +++ b/src/plugins/ftp/operats3.cpp @@ -124,7 +124,7 @@ CFTPWorker::CFTPWorker(CFTPOperation* oper, CFTPQueue* queue, const char* host, UploadType = utNone; UseDeleteForOverwrite = FALSE; - if (Config.EnableLogging && !Config.DisableLoggingOfWorkers) // without synchronization, not needed + if (Config.EnableLogging && !Config.DisableLoggingOfWorkers) // no synchronization needed { Logs.CreateLog(&LogUID, host, port, user, NULL, FALSE, TRUE); Oper->SendHeaderToLog(LogUID); @@ -788,7 +788,7 @@ BOOL CFTPWorker::InformAboutStop() ret = TRUE; } else - { // if a "data-connection" exists and we are not waiting for the server connection, we need to close the "data-connection" + { // if a "data-connection" exists and we are not waiting for the server connection, we need to close it ret = WorkerDataConState == wdcsOnlyAllocated || WorkerDataConState == wdcsTransferingData || WorkerDataConState == wdcsTransferFinished; } @@ -829,7 +829,7 @@ void CFTPWorker::CloseDataConnectionOrPostShouldStop() if (workerDataCon->IsConnected()) // close the "data connection"; the system will attempt a "graceful" shutdown { workerDataCon->CloseSocketEx(NULL); // shutdown (we do not learn the result) - postShouldStop = TRUE; // we must "get the worker moving" so it terminates (WORKER_DATACON_CLOSED will not arrive) + postShouldStop = TRUE; // we must wake the worker so it terminates (WORKER_DATACON_CLOSED will not arrive) } workerDataCon->FreeFlushData(); DeleteSocket(workerDataCon); @@ -839,7 +839,7 @@ void CFTPWorker::CloseDataConnectionOrPostShouldStop() if (workerUploadDataCon->IsConnected()) // close the "data connection"; the system will attempt a "graceful" shutdown { workerUploadDataCon->CloseSocketEx(NULL); // shutdown (we do not learn the result) - postShouldStop = TRUE; // we must "get the worker moving" so it terminates (WORKER_UPLDATACON_CLOSED will not arrive) + postShouldStop = TRUE; // we must wake the worker so it terminates (WORKER_UPLDATACON_CLOSED will not arrive) } workerUploadDataCon->FreeBufferedData(); DeleteSocket(workerUploadDataCon); @@ -995,7 +995,7 @@ void CFTPWorker::ForceClose() void CFTPWorker::ForceCloseDiskWork() { CALL_STACK_MESSAGE1("CFTPWorker::ForceCloseDiskWork()"); - // WARNING: may be called repeatedly (see calls from CFTPWorkersList::ForceCloseWorkers()) + // WARNING: this may be called repeatedly (see CFTPWorkersList::ForceCloseWorkers()) HANDLES(EnterCriticalSection(&WorkerCritSect)); if (DiskWorkIsUsed) { @@ -1079,7 +1079,7 @@ void CFTPWorker::ReleaseData(CUploadWaitingWorker** uploadFirstWaitingWorker) case fwssWorkDelDirWaitForRMDRes: case fwssWorkCopyMoveWaitForDELERes: { - // if we do not know how deleting the file/link/directory ended, invalidate the listing in the cache + // if we do not know how the file/link/directory deletion ended, invalidate the cached listing Oper->GetUserHostPort(userBuf, hostBuf, &port); UploadListingCache.ReportDelete(userBuf, hostBuf, port, CurItem->Path, Oper->GetFTPServerPathType(CurItem->Path), @@ -1129,7 +1129,7 @@ void CFTPWorker::ReleaseData(CUploadWaitingWorker** uploadFirstWaitingWorker) // except when STOR reports "cannot create target file name" (i.e. STOR reports an error and nothing was uploaded) we consider sending the STOR/APPE command as completion // forced actions: "overwrite", "resume", and "resume or overwrite" - if (CurItem->ForceAction != fqiaNone) // the forced action stops applying + if (CurItem->ForceAction != fqiaNone) // the forced action no longer applies Queue->UpdateForceAction(CurItem, fqiaNone); } break; @@ -1140,7 +1140,7 @@ void CFTPWorker::ReleaseData(CUploadWaitingWorker** uploadFirstWaitingWorker) { if (CurItem->Type == fqitUploadCopyFile || CurItem->Type == fqitUploadMoveFile) // "always true" { - // if we do not know how deleting the file/link/directory ended, invalidate the listing in the cache + // if we do not know how the file/link/directory deletion ended, invalidate the cached listing Oper->GetUserHostPort(userBuf, hostBuf, &port); CFTPQueueItemCopyOrMoveUpload* curItem = (CFTPQueueItemCopyOrMoveUpload*)CurItem; UploadListingCache.ReportDelete(userBuf, hostBuf, port, curItem->TgtPath, @@ -1156,7 +1156,7 @@ void CFTPWorker::ReleaseData(CUploadWaitingWorker** uploadFirstWaitingWorker) ((CFTPQueueItemCopyOrMoveUpload*)CurItem)->RenamedName != NULL) { if (State == fwsWorking && SubState == fwssWorkUploadWaitForSTORRes) - Queue->ChangeTgtNameToRenamedName((CFTPQueueItemCopyOrMoveUpload*)CurItem); // even if STOR has not yet run, it is still more accurate that the file was stored under the new name than under the original one - obvious for overwriting an existing file + Queue->ChangeTgtNameToRenamedName((CFTPQueueItemCopyOrMoveUpload*)CurItem); // even if STOR has not run yet, it is still more accurate that the file is being stored under the new name than under the original one; this is obvious when overwriting an existing file else Queue->UpdateRenamedName((CFTPQueueItemCopyOrMoveUpload*)CurItem, NULL); } @@ -1542,13 +1542,13 @@ BOOL CFTPWorker::Write(const char* buffer, int bytesToWrite, DWORD* error, BOOL* { if (error != NULL) *error = err; - break; // return the error + break; // return an error } } } } - if (ret) // successfully sent; 'len' is the number of sent bytes (the rest will be sent after FD_WRITE) + if (ret) // send succeeded; 'len' is the number of bytes sent (the rest will be sent after FD_WRITE) { if (allBytesWritten != NULL) *allBytesWritten = (len >= bytesToWrite); @@ -1581,7 +1581,7 @@ BOOL CFTPWorker::Write(const char* buffer, int bytesToWrite, DWORD* error, BOOL* } } } - else // not everything was sent yet -> incorrect use of Write + else // not everything has been sent yet -> incorrect use of Write { TRACE_E("Incorrect use of CFTPWorker::Write(): called again before waiting for fwseWriteDone event."); } @@ -1640,7 +1640,7 @@ void CFTPWorker::ReceiveHostByAddress(DWORD ip, int hostUID, int err) void CFTPWorker::ReceiveNetEvent(LPARAM lParam, int index) { CALL_STACK_MESSAGE3("CFTPWorker::ReceiveNetEvent(0x%IX, %d)", lParam, index); - DWORD eventError = WSAGETSELECTERROR(lParam); // extract error code of event + DWORD eventError = WSAGETSELECTERROR(lParam); // extract the event error code switch (WSAGETSELECTEVENT(lParam)) // extract event { case FD_CLOSE: // sometimes arrives before the last FD_READ, so we must first try FD_READ and if it succeeds, post FD_CLOSE again (another FD_READ may succeed before it) @@ -1674,7 +1674,7 @@ void CFTPWorker::ReceiveNetEvent(LPARAM lParam, int index) ReadBytesOffset = 0; } - if (ReadBytesAllocatedSize - ReadBytesCount < FTPWORKER_BYTESTOREADONSOCKET) // still a small 'ReadBytes' buffer + if (ReadBytesAllocatedSize - ReadBytesCount < FTPWORKER_BYTESTOREADONSOCKET) // the 'ReadBytes' buffer is still too small { int newSize = ReadBytesCount + FTPWORKER_BYTESTOREADONSOCKET + FTPWORKER_BYTESTOREADONSOCKETPREALLOC; @@ -1693,8 +1693,8 @@ void CFTPWorker::ReceiveNetEvent(LPARAM lParam, int index) } if (!lowMem) - { // read as many bytes as possible into the buffer; do not read cyclically so the data is processed sequentially - // (smaller buffers are enough); if there is still data to read we receive FD_READ again + { // read as many bytes as possible into the buffer; do not read cyclically, so the data is processed sequentially + // (smaller buffers are sufficient); if there is still data to read, we will receive FD_READ again if (!SSLConn) { int len = recv(Socket, ReadBytes + ReadBytesCount, ReadBytesAllocatedSize - ReadBytesCount, 0); @@ -1743,9 +1743,9 @@ void CFTPWorker::ReceiveNetEvent(LPARAM lParam, int index) } else { - // can happen: the main or operation-dialog thread manages to call CloseSocket() before FD_READ is delivered + // This can happen if the main or operation-dialog thread calls CloseSocket() before FD_READ is delivered // TRACE_E("Unexpected situation in CFTPWorker::ReceiveNetEvent(FD_READ): Socket is not connected."); - // we will not generate an event for this unexpected error (solution: user presses ESC) + // We will not generate an event for this unexpected error (workaround: the user presses ESC) } } else // FD_READ error report (documentation says only WSAENETDOWN) @@ -1766,7 +1766,7 @@ void CFTPWorker::ReceiveNetEvent(LPARAM lParam, int index) // now process FD_CLOSE if (WSAGETSELECTEVENT(lParam) == FD_CLOSE) { - if (sendFDCloseAgain) // FD_CLOSE acted instead of FD_READ => post FD_CLOSE again + if (sendFDCloseAgain) // FD_CLOSE arrived instead of FD_READ => post FD_CLOSE again { PostMessage(SocketsThread->GetHiddenWindow(), WM_APP_SOCKET_MIN + index, (WPARAM)GetSocket(), lParam); @@ -1852,7 +1852,7 @@ void CFTPWorker::ReceiveNetEvent(LPARAM lParam, int index) { BytesToWriteOffset = 0; BytesToWriteCount = 0; - break; // return the error + break; // report the error } } } @@ -1872,7 +1872,7 @@ void CFTPWorker::ReceiveNetEvent(LPARAM lParam, int index) } else { - // can happen: the main or operation-dialog thread manages to call CloseSocket() before FD_WRITE is delivered + // can happen: the main or operation-dialog thread calls CloseSocket() before FD_WRITE is delivered //TRACE_E("Unexpected situation in CFTPWorker::ReceiveNetEvent(FD_WRITE): Socket is not connected."); BytesToWriteCount = 0; // error -> reset the buffer BytesToWriteOffset = 0; @@ -1989,8 +1989,8 @@ void CFTPWorker::ReceiveTimer(DWORD id, void* param) // request another status update cycle clearStatusType = FALSE; - // since we are already in the CSocketsThread::CritSect section, this call - // is possible even from the CSocket::SocketCritSect and CFTPWorker::WorkerCritSect sections (no deadlock risk) + // since we are already in CSocketsThread::CritSect, this call + // is allowed even from CSocket::SocketCritSect and CFTPWorker::WorkerCritSect (no deadlock risk) SocketsThread->AddTimer(Msg, UID, GetTickCount() + WORKER_STATUSUPDATETIMEOUT, WORKER_STATUSUPDATETIMID, NULL); // ignore errors; at worst the status will not update } @@ -2081,8 +2081,8 @@ void CFTPWorker::ReceivePostMessage(DWORD id, void* param) case WORKER_DATACON_CONNECTED: { - // since we are already in the CSocketsThread::CritSect section, this call - // is possible even from the CSocket::SocketCritSect section (no deadlock risk) + // since we are already in CSocketsThread::CritSect, this call + // is allowed even from CSocket::SocketCritSect (no deadlock risk) if (WorkerDataCon != NULL && (int)(INT_PTR)param == WorkerDataCon->GetUID()) // message came from the current data connection (discard others immediately) HandleEvent(fweDataConConnectedToServer, NULL, 0, 0); // else // may arrive after WorkerDataCon is closed (if the LIST reply arrives immediately and the data connection is also immediately closed - short listing) @@ -2092,8 +2092,8 @@ void CFTPWorker::ReceivePostMessage(DWORD id, void* param) case WORKER_DATACON_CLOSED: { - // since we are already in the CSocketsThread::CritSect section, this call - // is possible even from the CSocket::SocketCritSect section (no deadlock risk) + // since we are already in CSocketsThread::CritSect, this call + // is allowed even from CSocket::SocketCritSect (no deadlock risk) if (WorkerDataCon != NULL && (int)(INT_PTR)param == WorkerDataCon->GetUID()) // message came from the current data connection (discard others immediately) HandleEvent(fweDataConConnectionClosed, NULL, 0, 0); // else // may arrive after WorkerDataCon is closed (if the LIST reply arrives immediately and the data connection is also immediately closed - short listing) @@ -2103,8 +2103,8 @@ void CFTPWorker::ReceivePostMessage(DWORD id, void* param) case WORKER_DATACON_FLUSHDATA: { - // since we are already in the CSocketsThread::CritSect section, this call - // is possible even from the CSocket::SocketCritSect section (no deadlock risk) + // since we are already in CSocketsThread::CritSect, this call + // is allowed even from CSocket::SocketCritSect (no deadlock risk) if (WorkerDataCon != NULL && (int)(INT_PTR)param == WorkerDataCon->GetUID()) // message came from the current data connection (discard others immediately) HandleEvent(fweDataConFlushData, NULL, 0, 0); // else // may arrive after WorkerDataCon has been closed @@ -2114,8 +2114,8 @@ void CFTPWorker::ReceivePostMessage(DWORD id, void* param) case WORKER_DATACON_LISTENINGFORCON: { - // since we are already in the CSocketsThread::CritSect section, this call - // is possible even from the CSocket::SocketCritSect section (no deadlock risk) + // since we are already in CSocketsThread::CritSect, this call + // is allowed even from CSocket::SocketCritSect (no deadlock risk) if (WorkerDataCon != NULL && (int)(INT_PTR)param == WorkerDataCon->GetUID()) // message came from the current data connection (discard others immediately) HandleEvent(fweDataConListeningForCon, NULL, 0, 0); else @@ -2125,8 +2125,8 @@ void CFTPWorker::ReceivePostMessage(DWORD id, void* param) case WORKER_UPLDATACON_LISTENINGFORCON: { - // since we are already in the CSocketsThread::CritSect section, this call - // is possible even from the CSocket::SocketCritSect section (no deadlock risk) + // since we are already in CSocketsThread::CritSect, this call + // is allowed even from CSocket::SocketCritSect (no deadlock risk) if (WorkerUploadDataCon != NULL && (int)(INT_PTR)param == WorkerUploadDataCon->GetUID()) // message came from the current data connection (discard others immediately) HandleEvent(fweUplDataConListeningForCon, NULL, 0, 0); else @@ -2136,9 +2136,9 @@ void CFTPWorker::ReceivePostMessage(DWORD id, void* param) case WORKER_UPLDATACON_CONNECTED: { - // since we are already in the CSocketsThread::CritSect section, this call - // is possible even from the CSocket::SocketCritSect section (no deadlock risk) - if (WorkerUploadDataCon != NULL && (int)(INT_PTR)param == WorkerUploadDataCon->GetUID()) // message came from the current upload data connection (discard others immediately) + // since we are already in CSocketsThread::CritSect, this call + // is allowed even from CSocket::SocketCritSect (no deadlock risk) + if (WorkerUploadDataCon != NULL && (int)(INT_PTR)param == WorkerUploadDataCon->GetUID()) // message from the current upload data connection (discard others immediately) HandleEvent(fweUplDataConConnectedToServer, NULL, 0, 0); // else // may arrive after WorkerUploadDataCon has been closed // TRACE_E("CFTPWorker::ReceivePostMessage(): received WORKER_UPLDATACON_CONNECTED for nonexistent data-connection!"); @@ -2147,9 +2147,9 @@ void CFTPWorker::ReceivePostMessage(DWORD id, void* param) case WORKER_UPLDATACON_CLOSED: { - // since we are already in the CSocketsThread::CritSect section, this call - // is possible even from the CSocket::SocketCritSect section (no deadlock risk) - if (WorkerUploadDataCon != NULL && (int)(INT_PTR)param == WorkerUploadDataCon->GetUID()) // message came from the current upload data connection (discard others immediately) + // since we are already in CSocketsThread::CritSect, this call + // is allowed even from CSocket::SocketCritSect (no deadlock risk) + if (WorkerUploadDataCon != NULL && (int)(INT_PTR)param == WorkerUploadDataCon->GetUID()) // message from the current upload data connection (discard others immediately) HandleEvent(fweUplDataConConnectionClosed, NULL, 0, 0); // else // may arrive after WorkerUploadDataCon has been closed // TRACE_E("CFTPWorker::ReceivePostMessage(): received WORKER_UPLDATACON_CLOSED for nonexistent data-connection!"); @@ -2158,9 +2158,9 @@ void CFTPWorker::ReceivePostMessage(DWORD id, void* param) case WORKER_UPLDATACON_PREPAREDATA: { - // since we are already in the CSocketsThread::CritSect section, this call - // is possible even from the CSocket::SocketCritSect section (no deadlock risk) - if (WorkerUploadDataCon != NULL && (int)(INT_PTR)param == WorkerUploadDataCon->GetUID()) // message came from the current upload data connection (discard others immediately) + // since we are already in CSocketsThread::CritSect, this call + // is allowed even from CSocket::SocketCritSect (no deadlock risk) + if (WorkerUploadDataCon != NULL && (int)(INT_PTR)param == WorkerUploadDataCon->GetUID()) // message from the current upload data connection (discard others immediately) HandleEvent(fweUplDataConPrepareData, NULL, 0, 0); // else // may arrive after WorkerUploadDataCon has been closed // TRACE_E("CFTPWorker::ReceivePostMessage(): received WORKER_UPLDATACON_PREPAREDATA for nonexistent data-connection!"); @@ -2192,7 +2192,7 @@ void CFTPWorker::ReadFTPErrorReplies() char* reply; int replySize; int replyCode; - while (ReadFTPReply(&reply, &replySize, &replyCode)) // as long as we have a server reply + while (ReadFTPReply(&reply, &replySize, &replyCode)) // as long as we have any server reply { // log any error messages from the server Logs.LogMessage(LogUID, reply, replySize, TRUE); if (ErrorDescr[0] == 0 && // we do not have an error description yet @@ -2267,7 +2267,7 @@ void CFTPWorker::HandleSocketEvent(CFTPWorkerSocketEvent event, DWORD data1, DWO { switch (event) { - case fwseNewBytesRead: // if it is an error, we want its text + case fwseNewBytesRead: // if it is an error, we want to know its text { ReadFTPErrorReplies(); break; @@ -2280,7 +2280,7 @@ void CFTPWorker::HandleSocketEvent(CFTPWorkerSocketEvent event, DWORD data1, DWO FTPGetErrorTextForLog(data1, errBuf, 300); Logs.LogMessage(LogUID, errBuf, -1, TRUE); } - if (ErrorDescr[0] == 0) // when closing the connection we must fill ErrorDescr (even with "unknown error") + if (ErrorDescr[0] == 0) // on connection close, we must populate ErrorDescr (even with "unknown error") { lstrcpyn(ErrorDescr, GetWorkerErrorTxt(data1, errBuf, 300), FTPWORKER_ERRDESCR_BUFSIZE); CorrectErrorDescr(); @@ -2304,7 +2304,7 @@ void CFTPWorker::HandleSocketEvent(CFTPWorkerSocketEvent event, DWORD data1, DWO int replyCode; BOOL firstRound = TRUE; while (BytesToWriteOffset == BytesToWriteCount && // test "write done" (we wait for the server reply only after the full command is sent) - ReadFTPReply(&reply, &replySize, &replyCode)) // as long as we have some server reply (one read may contain several at once) + ReadFTPReply(&reply, &replySize, &replyCode)) // as long as we have a server reply (one read may contain several at once) { if (!firstRound) HANDLES(EnterCriticalSection(&WorkerCritSect)); @@ -2319,8 +2319,8 @@ void CFTPWorker::HandleSocketEvent(CFTPWorkerSocketEvent event, DWORD data1, DWO HANDLES(LeaveCriticalSection(&WorkerCritSect)); if (FTP_DIGIT_1(replyCode) != FTP_D1_MAYBESUCCESS) // command reply { - // since we are already in the CSocketsThread::CritSect section, this call - // is possible even from the CSocket::SocketCritSect section (no deadlock risk) + // since we are already in CSocketsThread::CritSect, this call + // is allowed even from CSocket::SocketCritSect (no deadlock risk) SocketsThread->DeleteTimer(uid, WORKER_TIMEOUTTIMERID); // HandleEvent() will probably send another command, so delete the timer "in advance" HandleEvent(fweCmdReplyReceived, reply, replySize, replyCode); @@ -2364,13 +2364,13 @@ void CFTPWorker::HandleSocketEvent(CFTPWorkerSocketEvent event, DWORD data1, DWO BOOL trFinished; DWORD start; HANDLES(LeaveCriticalSection(&WorkerCritSect)); - // since we are already in the CSocketsThread::CritSect section, this call - // is possible even from the CSocket::SocketCritSect section (no deadlock risk) + // since we are already in CSocketsThread::CritSect, this call + // is allowed even from CSocket::SocketCritSect (no deadlock risk) BOOL isTransfering = WorkerDataCon != NULL ? WorkerDataCon->IsTransfering(&trFinished) : WorkerUploadDataCon->IsTransfering(&trFinished); if (isTransfering) { // waiting for data, so this is not a timeout - // since we are already in the CSocketsThread::CritSect section, this call - // is possible even from the CSocket::SocketCritSect section (no deadlock risk) + // since we are already in CSocketsThread::CritSect, this call + // is possible even from CSocket::SocketCritSect (no deadlock risk) SocketsThread->AddTimer(Msg, UID, GetTickCount() + serverTimeout, WORKER_TIMEOUTTIMERID, NULL); // ignore the error; at worst the user will press Stop HANDLES(EnterCriticalSection(&WorkerCritSect)); @@ -2380,15 +2380,15 @@ void CFTPWorker::HandleSocketEvent(CFTPWorkerSocketEvent event, DWORD data1, DWO { if (trFinished) { - // the timeout is measured from closing the connection (moment when the server can react - it also learns - // about the connection closing) - // since we are already in the CSocketsThread::CritSect section, this call - // is possible even from the CSocket::SocketCritSect section (no deadlock risk) + // the timeout is measured from the moment the connection is closed (the moment the server can react and also learns + // that the connection was closed) + // since we are already in the CSocketsThread::CritSect critical section, this call + // is possible even from the CSocket::SocketCritSect critical section (no deadlock risk) start = WorkerDataCon != NULL ? WorkerDataCon->GetSocketCloseTime() : WorkerUploadDataCon->GetSocketCloseTime(); if ((GetTickCount() - start) < (DWORD)serverTimeout) // the timeout since closing the connection has not yet expired { - // since we are already in the CSocketsThread::CritSect section, this call - // is possible even from the CSocket::SocketCritSect section (no deadlock risk) + // since we are already in CSocketsThread::CritSect, this call + // is allowed even from CSocket::SocketCritSect (no deadlock risk) SocketsThread->AddTimer(Msg, UID, start + serverTimeout, WORKER_TIMEOUTTIMERID, NULL); // ignore the error; at worst the user will press Stop HANDLES(EnterCriticalSection(&WorkerCritSect)); From 017e7d29d2e9c793048ca474ecdc4b8610c225cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 9 Apr 2026 19:13:39 +0200 Subject: [PATCH 014/710] [tanslation] Fix src/plugins/ftp/operats5.cpp comments (#385) --- src/plugins/ftp/operats5.cpp | 74 ++++++++++++++++++------------------ 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/src/plugins/ftp/operats5.cpp b/src/plugins/ftp/operats5.cpp index a52e4cd44..55a019f0f 100644 --- a/src/plugins/ftp/operats5.cpp +++ b/src/plugins/ftp/operats5.cpp @@ -54,7 +54,7 @@ BOOL CFTPWorkersList::InformWorkersAboutStop(int workerInd, CFTPWorker** victims if (*foundVictims < maxVictims) { CFTPWorker* worker = Workers[workerInd]; - if (worker->InformAboutStop()) // add them among the victims (CloseDataConnectionOrPostShouldStop() will be called on them later) + if (worker->InformAboutStop()) // add it to the victims (CloseDataConnectionOrPostShouldStop() will be called on it later) *(victims + (*foundVictims)++) = worker; } else @@ -67,7 +67,7 @@ BOOL CFTPWorkersList::InformWorkersAboutStop(int workerInd, CFTPWorker** victims while (*foundVictims < maxVictims && i < Workers.Count) { CFTPWorker* worker = Workers[i++]; - if (worker->InformAboutStop()) // add them among the victims (CloseDataConnectionOrPostShouldStop() will be called on them later) + if (worker->InformAboutStop()) // add it to the victims (CloseDataConnectionOrPostShouldStop() will be called on it later) *(victims + (*foundVictims)++) = worker; } ret = i < Workers.Count; @@ -90,7 +90,7 @@ BOOL CFTPWorkersList::InformWorkersAboutPause(int workerInd, CFTPWorker** victim if (*foundVictims < maxVictims) { CFTPWorker* worker = Workers[workerInd]; - if (worker->InformAboutPause(pause)) // add them among the victims (PostShouldPauseOrResume() will be called on them later) + if (worker->InformAboutPause(pause)) // add it to the victims (PostShouldPauseOrResume() will be called on it later) *(victims + (*foundVictims)++) = worker; } else @@ -103,7 +103,7 @@ BOOL CFTPWorkersList::InformWorkersAboutPause(int workerInd, CFTPWorker** victim while (*foundVictims < maxVictims && i < Workers.Count) { CFTPWorker* worker = Workers[i++]; - if (worker->InformAboutPause(pause)) // add them among the victims (PostShouldPauseOrResume() will be called on them later) + if (worker->InformAboutPause(pause)) // add it to the victims (PostShouldPauseOrResume() will be called on it later) *(victims + (*foundVictims)++) = worker; } ret = i < Workers.Count; @@ -161,7 +161,7 @@ BOOL CFTPWorkersList::ForceCloseWorkers(int workerInd, CFTPWorker** victims, worker->ForceCloseDiskWork(); if (*foundVictims < maxVictims) { - if (!worker->SocketClosedAndDataConDoesntExist()) // add them among the victims (ForceClose() will be called on them later) + if (!worker->SocketClosedAndDataConDoesntExist()) // add it to the victims (ForceClose() will be called on it later) *(victims + (*foundVictims)++) = worker; } else @@ -175,7 +175,7 @@ BOOL CFTPWorkersList::ForceCloseWorkers(int workerInd, CFTPWorker** victims, { CFTPWorker* worker = Workers[i++]; worker->ForceCloseDiskWork(); - if (!worker->SocketClosedAndDataConDoesntExist()) // add them among the victims (ForceClose() will be called on them later) + if (!worker->SocketClosedAndDataConDoesntExist()) // add it to the victims (ForceClose() will be called on it later) *(victims + (*foundVictims)++) = worker; } ret = i < Workers.Count; @@ -286,7 +286,7 @@ void CFTPWorkersList::GetListViewDataFor(int index, NMLVDISPINFO* lvdi, char* bu { Workers[index]->GetListViewData(itemData, buf, bufSize); } - else // for an invalid index (listview has not refreshed yet) we must return at least an empty item + else // for an invalid index (the list view has not refreshed yet), we must return at least an empty item { if (itemData->mask & LVIF_IMAGE) itemData->iImage = 0; // we have only one icon so far @@ -469,7 +469,7 @@ BOOL CFTPWorkersList::GiveWorkToSleepingConWorker(CFTPWorker* sourceWorker) { CALL_STACK_MESSAGE1("CFTPWorkersList::GiveWorkToSleepingConWorker()"); - // ATTENTION: we may already be inside CSocketsThread::CritSect (and CSocket::SocketCritSect) !!! + // WARNING: we may already be inside CSocketsThread::CritSect (and CSocket::SocketCritSect)!!! BOOL ret = FALSE; HANDLES(EnterCriticalSection(&WorkersListCritSect)); @@ -536,7 +536,7 @@ BOOL CFTPWorkersList::SearchWorkerWithNewError(int* index, DWORD lastErrorOccure HANDLES(EnterCriticalSection(&WorkersListCritSect)); BOOL res = FALSE; - if (LastFoundErrorOccurenceTime + 1 < lastErrorOccurenceTime + 1) // +1 is here because -1 is used as initialization values + if (LastFoundErrorOccurenceTime + 1 < lastErrorOccurenceTime + 1) // +1 is here because -1 is used as the initial value { // it makes sense to search int foundIndex = -1; DWORD foundErrorOccurenceTime = -1; @@ -545,7 +545,7 @@ BOOL CFTPWorkersList::SearchWorkerWithNewError(int* index, DWORD lastErrorOccure { CFTPWorker* worker = Workers[i]; DWORD workerErrorOccurenceTime = worker->GetErrorOccurenceTime(); - if (workerErrorOccurenceTime != -1 && // the worker contains an error (except for an error forced by the user while resolving login/password during reconnect wait) + if (workerErrorOccurenceTime != -1 && // the worker has an error (except for an error forced by the user while resolving the login/password during reconnect wait) workerErrorOccurenceTime >= LastFoundErrorOccurenceTime + 1 && // it's a "new" error (foundIndex == -1 || foundErrorOccurenceTime > workerErrorOccurenceTime)) // the first one found so far or the "oldest" (we handle errors in the order they occurred) { @@ -570,7 +570,7 @@ void CFTPWorkersList::PostNewWorkAvailable(BOOL onlyOneItem) { CALL_STACK_MESSAGE2("CFTPWorkersList::PostNewWorkAvailable(%d)", onlyOneItem); - // ATTENTION: we may already be inside CSocketsThread::CritSect (and CSocket::SocketCritSect) !!! + // WARNING: we may already be inside CSocketsThread::CritSect (and CSocket::SocketCritSect)!!! if (onlyOneItem) { @@ -610,7 +610,7 @@ void CFTPWorkersList::PostNewWorkAvailable(BOOL onlyOneItem) } HANDLES(LeaveCriticalSection(&WorkersListCritSect)); - if (worker != NULL) // if there is at least one "sleeping" worker, post a "wake-up" to them + if (worker != NULL) // if there is at least one "sleeping" worker, post a "wake-up" to it SocketsThread->PostSocketMessage(msg, uid, WORKER_WAKEUP, NULL); } else @@ -945,7 +945,7 @@ BOOL CFTPDiskThread::CancelWork(const CFTPDiskWork* work, BOOL* workIsInProgress ret = TRUE; if (i == 0) { - Work[0] = NULL; // the first item may currently be processed, cannot remove it from the array (it is rewritten to NULL to detect its cancellation) + Work[0] = NULL; // the first item may still be the one being processed, so it cannot be removed from the array (it is set to NULL to detect its cancellation) if (workIsInProgress != NULL) *workIsInProgress = WorkIsInProgress; } @@ -1118,7 +1118,7 @@ void DoCreateDir(CFTPDiskWork& localWork, char* fullName, BOOL& workDone, BOOL& } } } - else // cannot create dir + else // cannot create directory { switch (localWork.CannotCreateDir) { @@ -1147,7 +1147,7 @@ void DoCreateDir(CFTPDiskWork& localWork, char* fullName, BOOL& workDone, BOOL& } } - if (action == 1) // autorename (for already exists, cannot create, and force action) + if (action == 1) // autorename (already exists, cannot create, and force-action cases) { BOOL ok = FALSE; if (!isValid) @@ -1171,7 +1171,7 @@ void DoCreateDir(CFTPDiskWork& localWork, char* fullName, BOOL& workDone, BOOL& { if (firstRound && !isValid && nameLen < rest) // test the "validated" name memcpy(pathEnd, localWork.Name, nameLen + 1); - else // append numbering to the end of the name (directories have no extension) (e.g. "(2)") + trim if necessary so the name fits into the full path + else // append numbering to the end of the name (directories have no extension), e.g. "(2)", and trim it if necessary so the name fits in the full path { if (firstRound && (tooLongName || !isValid) || winErr == ERROR_FILE_EXISTS || winErr == ERROR_ALREADY_EXISTS) @@ -1211,7 +1211,7 @@ void DoCreateDir(CFTPDiskWork& localWork, char* fullName, BOOL& workDone, BOOL& } } else - break; // another attempt to create the directory makes no sense (it's not a name collision, syntax error, or overly long name), return an error + break; // another attempt to create the directory would be pointless (it is not a name collision, a syntax error, or an overly long name); return an error } // allocate the new name if (localWork.NewTgtName != NULL) @@ -1238,7 +1238,7 @@ void DoCreateDir(CFTPDiskWork& localWork, char* fullName, BOOL& workDone, BOOL& { workDone = TRUE; ok = TRUE; - break; // success, return OK + the new name + break; // success, return OK and the new name } firstRound = FALSE; } @@ -1542,7 +1542,7 @@ void DoCreateFile(CFTPDiskWork& localWork, char* fullName, BOOL& workDone, BOOL& char* s = localWork.Name + strlen(localWork.Name); while (--s >= localWork.Name) { - if (*s == ')') // searching from the end for " (number)" + if (*s == ')') // search from the end for " (number)" { char* end = s + 1; int num = 0; @@ -1595,7 +1595,7 @@ void DoCreateFile(CFTPDiskWork& localWork, char* fullName, BOOL& workDone, BOOL& memcpy(localWork.Name + off, suffix, suffixLen); memcpy(localWork.Name + off + suffixLen, nameBackup + extOffset, nameLen - extOffset + 1); } - else // the entire extension will not fit, shorten the name without respecting the extension + else // the entire extension will not fit, shorten the name without preserving the extension { memcpy(localWork.Name, nameBackup, rest - (suffixLen + 1)); memcpy(localWork.Name + rest - (suffixLen + 1), suffix, suffixLen + 1); @@ -1621,7 +1621,7 @@ void DoCreateFile(CFTPDiskWork& localWork, char* fullName, BOOL& workDone, BOOL& } } else - break; // another attempt to create the file makes no sense (it's not a name collision, syntax error, or overly long name), return an error + break; // another attempt to create the file makes no sense (it is not a name collision, invalid name syntax, or an overly long name), return an error } // allocate the new name if (localWork.NewTgtName != NULL) @@ -1673,7 +1673,7 @@ void DoCreateFile(CFTPDiskWork& localWork, char* fullName, BOOL& workDone, BOOL& break; } - case 2: // resume (for already exists, transfer failed, and force action) + if reduceFileSize==TRUE we also need to shrink the file + case 2: // resume (for the already exists, transfer failed, and force action cases); if reduceFileSize==TRUE, we also need to shrink the file case 3: // resume or overwrite (for already exists, transfer failed, and force action) { file = HANDLES_Q(CreateFile(fullName, @@ -1711,7 +1711,7 @@ void DoCreateFile(CFTPDiskWork& localWork, char* fullName, BOOL& workDone, BOOL& { DWORD resumeOverlap = Config.GetResumeOverlap(); if (resumeOverlap == 0) - resumeOverlap = 1; // at least by one byte (this threatens only if the user just changed it in configuration) + resumeOverlap = 1; // at least one byte (only possible if the user has just changed it in the configuration) if (size < CQuadWord(resumeOverlap, 0)) resumeOverlap = (DWORD)size.Value; size -= CQuadWord(resumeOverlap, 0); @@ -1750,7 +1750,7 @@ void DoCreateFile(CFTPDiskWork& localWork, char* fullName, BOOL& workDone, BOOL& if (ok) { - // workDone = TRUE; // when cancelling the operation we will not delete the file, it's a resume + // workDone = TRUE; // when cancelling the operation we will not delete the file; this is a resume localWork.OpenedFile = file; localWork.FileSize = size; localWork.CanOverwrite = (action == 3 /* resume or overwrite */); // FALSE = the file was resumed @@ -1759,7 +1759,7 @@ void DoCreateFile(CFTPDiskWork& localWork, char* fullName, BOOL& workDone, BOOL& break; // success, we are done } } - else // error when determining the file size, close the file and finish with an error + else // error determining the file size; close the file and fail { HANDLES(CloseHandle(file)); // no need to delete the file because it existed a moment ago (it likely hasn't disappeared => we did not create it) } @@ -1781,7 +1781,7 @@ void DoCreateFile(CFTPDiskWork& localWork, char* fullName, BOOL& workDone, BOOL& // case 3: // resume or overwrite - if resume fails we try overwrite as well case 4: // overwrite (pri already exists, transfer failed i force action) { - if (action == 4) // check whether it happens to be read-only (only via the attribute), but only if we have not done so already + if (action == 4) // check whether it is read-only (via the attribute only), but only if we have not done so already { attr = SalamanderGeneral->SalGetFileAttributes(fullName); if (attr != INVALID_FILE_ATTRIBUTES && (attr & FILE_ATTRIBUTE_READONLY)) @@ -1858,12 +1858,12 @@ void DoCheckOrWriteToFile(CFTPDiskWork& localWork, BOOL& needCopyBack) { writeFile = FALSE; if (localWork.CheckFromOffset >= fileSize) - { // unexpected error: we are supposed to check file contents past the end of the file - the file probably changed recently (should not happen, it is opened "share-read-only") + { // unexpected error: we are supposed to check file contents beyond the end of the file; the file probably changed recently (should not happen, it is opened "share-read-only") localWork.State = sqisFailed; localWork.ProblemID = ITEMPR_RESUMETESTFAILED; needCopyBack = TRUE; } - else // set the seek position in the file + else // set the file pointer { CQuadWord curSeek = localWork.CheckFromOffset; curSeek.LoDWord = SetFilePointer(localWork.WorkFile, curSeek.LoDWord, (LONG*)&curSeek.HiDWord, FILE_BEGIN); @@ -1879,7 +1879,7 @@ void DoCheckOrWriteToFile(CFTPDiskWork& localWork, BOOL& needCopyBack) { char buf[4096]; // buffer for reading from disk int bytesToCheck = (localWork.WriteOrReadFromOffset - localWork.CheckFromOffset).LoDWord; // the size of the verified tail of the file is under 1GB, so this truncation is possible - if (bytesToCheck > localWork.ValidBytesInFlushDataBuffer) // optionally trim by the flush buffer size (we do not need to verify the entire segment at once) + if (bytesToCheck > localWork.ValidBytesInFlushDataBuffer) // optionally trim to the flush buffer size (we do not need to verify the entire segment at once) bytesToCheck = localWork.ValidBytesInFlushDataBuffer; while (bytesToCheck > 0) { @@ -1901,7 +1901,7 @@ void DoCheckOrWriteToFile(CFTPDiskWork& localWork, BOOL& needCopyBack) bytesToCheck -= check; flushBufOffset += check; } - else // the file contains something different than the flush buffer (resume: the file changed since last time) + else // the file contents differ from the flush buffer (resume: the file has changed since last time) { localWork.State = sqisFailed; localWork.ProblemID = ITEMPR_RESUMETESTFAILED; @@ -1924,7 +1924,7 @@ void DoCheckOrWriteToFile(CFTPDiskWork& localWork, BOOL& needCopyBack) localWork.ProblemID = ITEMPR_RESUMETESTFAILED; needCopyBack = TRUE; } - else // set the seek position in the file + else // set the file pointer { if (!skipSetSeekForWrite) { @@ -1957,7 +1957,7 @@ void DoCheckOrWriteToFile(CFTPDiskWork& localWork, BOOL& needCopyBack) { if (localWork.WriteOrReadFromOffset + CQuadWord(writtenBytes, 0) < fileSize) { // if the write finished before the end of the file, call SetEndOfFile (trim unwanted old data that should be overwritten) - SetEndOfFile(localWork.WorkFile); // we do not test success; it does not really matter + SetEndOfFile(localWork.WorkFile); // we do not check for success; it does not really matter } } } @@ -2033,7 +2033,7 @@ void DoListDirectory(CFTPDiskWork& localWork, BOOL& needCopyBack) if (search == INVALID_HANDLE_VALUE) { DWORD err = GetLastError(); - if (err != ERROR_FILE_NOT_FOUND && err != ERROR_NO_MORE_FILES) // this is an error - i.e. it's not just an empty listing + if (err != ERROR_FILE_NOT_FOUND && err != ERROR_NO_MORE_FILES) // this is an error, not just an empty listing { localWork.State = sqisFailed; localWork.ProblemID = ITEMPR_UPLOADCANNOTLISTSRCPATH; @@ -2137,7 +2137,7 @@ void DoDeleteDir(CFTPDiskWork& localWork, BOOL& needCopyBack) } } } - else // the path on disk is too long + else // disk path is too long { localWork.State = sqisFailed; localWork.ProblemID = ITEMPR_INVALIDPATHTODIR; @@ -2583,12 +2583,12 @@ CFTPDiskThread::Body() HANDLES(CloseHandle(localWork.OpenedFile)); localWork.OpenedFile = NULL; } - if (localWork.DiskListing != NULL) // on cancel deallocate the allocated listing + if (localWork.DiskListing != NULL) // on cancel, deallocate the listing { delete localWork.DiskListing; localWork.DiskListing = NULL; } - if (!doCancel) // inform the worker about the work results + if (!doCancel) // inform the worker of the work results { SocketsThread->PostSocketMessage(localWork.SocketMsg, localWork.SocketUID, localWork.MsgID, work); } @@ -2625,7 +2625,7 @@ CFTPDiskThread::Body() if (!DeleteFile(localWork.Name)) // the created file cannot have the read-only attribute TRACE_E("CFTPDiskThread::Body(): cancelling disk operation: unable to remove target file: " << localWork.Name); } - // break; // intentionally no break here! + // break; // no break here intentionally } case fdwtCheckOrWriteFile: { From 46da1662a64f9433ac0db0511691bb662e52427d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 9 Apr 2026 19:55:13 +0200 Subject: [PATCH 015/710] [tanslation] Fix src/plugins/ftp/operats9.cpp comments (#386) --- src/plugins/ftp/operats9.cpp | 54 ++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/plugins/ftp/operats9.cpp b/src/plugins/ftp/operats9.cpp index 9995fa039..6fa50e225 100644 --- a/src/plugins/ftp/operats9.cpp +++ b/src/plugins/ftp/operats9.cpp @@ -403,7 +403,7 @@ BOOL CUploadListingsOnServer::AddOrUpdateListing(const char* path, CFTPServerPat listing->ListingState = ulsInProgressButObsolete; } } - else // error parsing the new listing or memory is low + else // error parsing the new listing, or low memory { if (listing->ListingState == ulsReady) { @@ -415,7 +415,7 @@ BOOL CUploadListingsOnServer::AddOrUpdateListing(const char* path, CFTPServerPat else { listing->ClearListingItems(); // discard the new listing - if (listing->ListingState == ulsInProgressButObsolete) // it is impossible to determine whether the transition to ulsInProgressButObsolete was preceded by an "unknown listing change", so go to the error state of the listing + if (listing->ListingState == ulsInProgressButObsolete) // it is impossible to determine whether the transition to ulsInProgressButObsolete was preceded by an "unknown listing change", so put the listing into an error state listing->ListingState = ulsInProgressButMayBeOutdated; } } @@ -521,7 +521,7 @@ BOOL CUploadListingsOnServer::FindPath(const char* path, CFTPServerPathType path #endif index = -1; int i; - for (i = 0; i < FOUND_PATH_IND_CACHE_SIZE; i++) // first try indexes that succeeded in the past + for (i = 0; i < FOUND_PATH_IND_CACHE_SIZE; i++) // first try indexes that were found in the past { int ind = FoundPathIndexes[i]; if (ind >= 0 && ind < Listing.Count && @@ -659,7 +659,7 @@ void CUploadListingsOnServer::ReportDelete(const char* workPath, CFTPServerPathT lstrcpyn(path, workPath, FTP_MAX_PATH); if (FTPPathAppend(pathType, path, FTP_MAX_PATH, name, TRUE)) { - if (FindPath(path, pathType, index)) // find the path in the cache (if it was a file, the path cannot be found) + if (FindPath(path, pathType, index)) // find the path in the cache (if this was a file, the path cannot be found) InvalidateListing(index); } } @@ -730,7 +730,7 @@ void CUploadListingsOnServer::InvalidateListing(int index) { if (listing->ListingState != ulsNotAccessible) { - if (listing->ListingState == ulsInProgressButObsolete) // discard the newer listing; it will no longer be useful + if (listing->ListingState == ulsInProgressButObsolete) // discard the newer listing; it is no longer useful listing->ClearListingItems(); if (listing->ListingState == ulsInProgress) // discard the accumulated changes; they are no longer useful listing->ClearListingChanges(); @@ -751,7 +751,7 @@ BOOL CUploadListingsOnServer::GetListing(const char* path, CFTPServerPathType pa if (FindPath(path, pathType, index)) { CUploadPathListing* listing = Listing[index]; - if (listing->ListingState == ulsNotAccessible) // the listing is "unobtainable" + if (listing->ListingState == ulsNotAccessible) // the listing is not accessible *notAccessible = TRUE; else { @@ -830,7 +830,7 @@ void CUploadListingsOnServer::ListingFailed(const char* path, CFTPServerPathType listing->ListingState == ulsInProgressButMayBeOutdated) { listing->InformWaitingWorkers(uploadFirstWaitingWorker); - if (listing->ListingState == ulsInProgressButObsolete) // we already have the listing, so we do not mind that the worker reports a listing error + if (listing->ListingState == ulsInProgressButObsolete) // we already have the listing, so a worker-reported listing error does not matter { listing->ListingState = ulsReady; if (listingOKErrorIgnored != NULL) @@ -876,11 +876,11 @@ BOOL CUploadListingsOnServer::ListingFinished(const char* path, CFTPServerPathTy listing->ListingState == ulsInProgressButMayBeOutdated) { listing->InformWaitingWorkers(NULL); - if (listing->ListingState == ulsInProgressButObsolete) // we already have a newer listing than this one, so ignore this listing (stay with the newer one) + if (listing->ListingState == ulsInProgressButObsolete) // we already have a newer listing than this one, so ignore this listing and keep the newer one listing->ListingState = ulsReady; else { - if (listing->ListingState == ulsInProgressButMayBeOutdated) // we know this listing is probably invalid (and we have no other), so remove the path from the cache (the listing will be downloaded again) + if (listing->ListingState == ulsInProgressButMayBeOutdated) // we know this listing is probably invalid (and we have no other), so remove the path from the cache; the listing will then be downloaded again { Listing.Delete(index); if (!Listing.IsGood()) @@ -903,7 +903,7 @@ BOOL CUploadListingsOnServer::ListingFinished(const char* path, CFTPServerPathTy } change = change->NextChange; } - if (change != NULL) // error while applying changes to the new listing - it can only be a lack of memory - temporary error - remove the path from the cache; the listing will be downloaded again later + if (change != NULL) // error while applying changes to the new listing; this can only be caused by low memory, so treat it as a temporary error, remove the path from the cache, and download the listing again later { Listing.Delete(index); if (!Listing.IsGood()) @@ -918,14 +918,14 @@ BOOL CUploadListingsOnServer::ListingFinished(const char* path, CFTPServerPathTy } else { - if (lowMem) // lack of memory = temporary error - remove the path from the cache; the listing will be downloaded again later + if (lowMem) // low memory = temporary error; remove the path from the cache, and the listing will be downloaded again later { Listing.Delete(index); if (!Listing.IsGood()) Listing.ResetState(); // Delete cannot fail; it only reports an error when shrinking the array ret = FALSE; } - else // parsing error of the new listing = permanent error - mark the listing for this path as "unobtainable" + else // parsing the new listing failed = permanent error - mark the listing for this path as "unobtainable" { listing->ListingState = ulsNotAccessible; listing->ClearListingChanges(); @@ -1279,7 +1279,7 @@ BOOL CUploadPathListing::ParseListing(const char* pathListing, int pathListingLe BOOL err = FALSE; CServerType* serverType = NULL; - if (listingServerType[0] != 0) // this is not autodetection; find listingServerType + if (listingServerType[0] != 0) // this is not autodetection; find the matching listingServerType { int i; for (i = 0; i < serverTypeListCount; i++) @@ -1296,11 +1296,11 @@ BOOL CUploadPathListing::ParseListing(const char* pathListing, int pathListingLe needSimpleListing = FALSE; // successfully parsed the listing if (err && lowMemory != NULL) *lowMemory = TRUE; - break; // found the requested server type, done + break; // found the requested server type, stop here } } if (i == serverTypeListCount) - listingServerType[0] = 0; // listingServerType does not exist -> perform autodetection + listingServerType[0] = 0; // listingServerType is missing -> perform autodetection } // autodetection - select the server type whose autodetection condition is satisfied @@ -1318,7 +1318,7 @@ BOOL CUploadPathListing::ParseListing(const char* pathListing, int pathListingLe { serverType->CompiledAutodetCond = CompileAutodetectCond(HandleNULLStr(serverType->AutodetectCond), NULL, NULL, NULL, NULL, 0); - if (serverType->CompiledAutodetCond == NULL) // can only be a memory shortage error + if (serverType->CompiledAutodetCond == NULL) // this can only be a low-memory error { err = TRUE; if (lowMemory != NULL) @@ -1342,7 +1342,7 @@ BOOL CUploadPathListing::ParseListing(const char* pathListing, int pathListingLe s++; lstrcpyn(listingServerType, s, SERVERTYPE_MAX_SIZE); } - needSimpleListing = err; // either successfully parsed the listing or ran into a memory shortage error, finish + needSimpleListing = err; // either the listing was parsed successfully, or an out-of-memory error occurred; stop here break; } } @@ -1356,7 +1356,7 @@ BOOL CUploadPathListing::ParseListing(const char* pathListing, int pathListingLe for (k = 0; k < serverTypeListCount; k++) { serverType = serverTypeList->At(k); - if (!serverType->ParserAlreadyTested) // only if we have not tried it yet + if (!serverType->ParserAlreadyTested) // only if we have not tested it yet { // serverType has been selected; try its parser on the listing // serverType->ParserAlreadyTested = TRUE; // unnecessary, not used later @@ -1371,7 +1371,7 @@ BOOL CUploadPathListing::ParseListing(const char* pathListing, int pathListingLe s++; lstrcpyn(listingServerType, s, SERVERTYPE_MAX_SIZE); } - needSimpleListing = err; // either successfully parsed the listing or ran into a memory shortage error, finish + needSimpleListing = err; // either successfully parsed the listing or encountered an out-of-memory error; stop here break; } } @@ -1438,7 +1438,7 @@ BOOL CUploadPathListing::ParseListingToArray(const char* pathListing, int pathLi const char* listingEnd = pathListing + pathListingLen; BOOL isDir = FALSE; - int rightsCol = dataIface->FindRightsColumn(); // index of the column with rights (used for link detection) + int rightsCol = dataIface->FindRightsColumn(); // index of the permissions column (used to detect links) parser->BeforeParsing(listing, listingEnd, pathListingDate.Year, pathListingDate.Month, pathListingDate.Day, FALSE); // initialize the parser @@ -1507,7 +1507,7 @@ void CUploadPathListing::ReportCreateDir(const char* newDir, BOOL* dirCreated, B case ulsReady: case ulsInProgressButObsolete: { - if (!FindItem(newDir, index)) // the name is free; it is possible to create the directory + if (!FindItem(newDir, index)) // the name is available; the directory can be created { if (InsertNewItem(index, ulitDirectory, newDir, UPLOADSIZE_UNKNOWN)) *dirCreated = TRUE; @@ -1596,7 +1596,7 @@ void CUploadPathListing::ReportStoreFile(const char* name, BOOL* lowMem) case ulsReady: case ulsInProgressButObsolete: { - if (!FindItem(name, index)) // the name is free; create the file + if (!FindItem(name, index)) // the name is available; create the file { if (!InsertNewItem(index, ulitFile, name, UPLOADSIZE_NEEDUPDATE)) *lowMem = TRUE; @@ -1641,7 +1641,7 @@ void CUploadPathListing::ReportFileUploaded(const char* name, const CQuadWord& f case ulsReady: case ulsInProgressButObsolete: { - if (FindItem(name, index)) // if it is a file, set its new size + if (FindItem(name, index)) // if the item exists, update its size if it is a file { CUploadListingItem* item = ListingItem[index]; if (item->ItemType == ulitFile) @@ -1694,7 +1694,7 @@ BOOL CUploadPathListing::CommitChange(CUploadListingChange* change) case ulctCreateDir: { - if (!FindItem(change->Name, index)) // the name is free; it is possible to create the directory + if (!FindItem(change->Name, index)) // the name is available; the directory can be created return InsertNewItem(index, ulitDirectory, change->Name, UPLOADSIZE_UNKNOWN); return TRUE; } @@ -1716,7 +1716,7 @@ BOOL CUploadPathListing::CommitChange(CUploadListingChange* change) case ulctFileUploaded: { - if (FindItem(change->Name, index)) // if it is a file, set its new size + if (FindItem(change->Name, index)) // if found, update its size if it is a file { CUploadListingItem* item = ListingItem[index]; if (item->ItemType == ulitFile) @@ -1760,7 +1760,7 @@ BOOL CUploadPathListing::AddWaitingWorker(int workerMsg, int workerUID) void CUploadPathListing::InformWaitingWorkers(CUploadWaitingWorker** uploadFirstWaitingWorker) { - if (uploadFirstWaitingWorker != NULL) // should add the waiting workers to the list + if (uploadFirstWaitingWorker != NULL) // add the waiting workers to the list { if (FirstWaitingWorker != NULL) { @@ -1779,7 +1779,7 @@ void CUploadPathListing::InformWaitingWorkers(CUploadWaitingWorker** uploadFirst CUploadWaitingWorker* worker = FirstWaitingWorker; while (worker != NULL) { - // because we are already in CSocketsThread::CritSect, this call is possible (no deadlock risk) + // because we are already in CSocketsThread::CritSect, this call is safe (no deadlock risk) SocketsThread->PostSocketMessage(worker->WorkerMsg, worker->WorkerUID, WORKER_TGTPATHLISTINGFINISHED, NULL); CUploadWaitingWorker* del = worker; From e40bc3d8436737705e8903eff7ea7cdb68a71860 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 9 Apr 2026 20:07:11 +0200 Subject: [PATCH 016/710] [tanslation] Fix src/plugins/ftp/operatsa.cpp comments (#387) --- src/plugins/ftp/operatsa.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/plugins/ftp/operatsa.cpp b/src/plugins/ftp/operatsa.cpp index bc34c2681..4d6defe91 100644 --- a/src/plugins/ftp/operatsa.cpp +++ b/src/plugins/ftp/operatsa.cpp @@ -53,7 +53,7 @@ void CFTPWorker::HandleEventInWorkingState4(CFTPWorkerEvent event, BOOL& sendQui } else { - SubState = fwssWorkUploadWaitForListing; // we should wait until another worker finishes the listing + SubState = fwssWorkUploadWaitForListing; // wait until another worker finishes the listing reportWorkerChange = TRUE; // the worker displays the fwssWorkUploadWaitForListing state in the window, so it needs to be redrawn } } @@ -71,7 +71,7 @@ void CFTPWorker::HandleEventInWorkingState4(CFTPWorkerEvent event, BOOL& sendQui if (existingItem == NULL && nameValid) // no collision and the name is valid -> try to create the directory SubState = fwssWorkUploadCreateDir; else - { // if existingItem == NULL then (!nameValid==TRUE), so there is no need to test for existingItem != NULL + { // if existingItem == NULL, then !nameValid is TRUE, so there is no need to test existingItem != NULL if (!nameValid || existingItem->ItemType == ulitFile) // invalid name or a collision with a file -> "dir cannot be created" SubState = !nameValid ? fwssWorkUploadCantCreateDirInvName : fwssWorkUploadCantCreateDirFileEx; else @@ -106,7 +106,7 @@ void CFTPWorker::HandleEventInWorkingState4(CFTPWorkerEvent event, BOOL& sendQui handleShouldStop = TRUE; // check whether the worker should stop else { - if (event == fweTgtPathListingFinished) // the designated worker has finished, try to use the new listing + if (event == fweTgtPathListingFinished) // the designated worker has finished its work; try to use the new listing { SubState = fwssWorkStartWork; reportWorkerChange = TRUE; // the worker displays the fwssWorkUploadWaitForListing state in the window, so it needs to be redrawn @@ -121,7 +121,7 @@ void CFTPWorker::HandleEventInWorkingState4(CFTPWorkerEvent event, BOOL& sendQui lstrcpyn(ftpPath, curItem->TgtPath, FTP_MAX_PATH); CFTPServerPathType type = Oper->GetFTPServerPathType(ftpPath); if (FTPPathAppend(type, ftpPath, FTP_MAX_PATH, curItem->TgtName, TRUE)) - { // we have the path, send CWD to the examined directory on the server + { // we have the path; send CWD to the directory being examined on the server _snprintf_s(errText, 200 + FTP_MAX_PATH, _TRUNCATE, LoadStr(IDS_LOGMSGRESOLVINGLINK), ftpPath); Logs.LogMessage(LogUID, errText, -1, TRUE); @@ -141,7 +141,7 @@ void CFTPWorker::HandleEventInWorkingState4(CFTPWorkerEvent event, BOOL& sendQui break; } - case fwssWorkUploadResLnkWaitForCWDRes: // upload copy/move file: wait for the "CWD" result (changing into the examined link; if it succeeds, the link is a directory) + case fwssWorkUploadResLnkWaitForCWDRes: // upload copy/move file: wait for the "CWD" result (change to the tested link; if it succeeds, the link points to a directory) { switch (event) { @@ -291,7 +291,7 @@ void CFTPWorker::HandleEventInWorkingState4(CFTPWorkerEvent event, BOOL& sendQui case CANNOTCREATENAME_USERPROMPT: { Queue->UpdateItemState(CurItem, sqisUserInputNeeded, ITEMPR_UPLOADCANNOTCREATETGTDIR, NO_ERROR, - SalamanderGeneral->DupStr(errText) /* low memory = the error will be without details */, + SalamanderGeneral->DupStr(errText) /* low memory = the error will have no details */, Oper); lookForNewWork = TRUE; break; @@ -300,7 +300,7 @@ void CFTPWorker::HandleEventInWorkingState4(CFTPWorkerEvent event, BOOL& sendQui case CANNOTCREATENAME_SKIP: { Queue->UpdateItemState(CurItem, sqisSkipped, ITEMPR_UPLOADCANNOTCREATETGTDIR, NO_ERROR, - SalamanderGeneral->DupStr(errText) /* low memory = the error will be without details */, + SalamanderGeneral->DupStr(errText) /* low memory = the error will have no details */, Oper); lookForNewWork = TRUE; break; @@ -514,7 +514,7 @@ void CFTPWorker::HandleEventInWorkingState4(CFTPWorkerEvent event, BOOL& sendQui } else { - SubState = fwssWorkUploadWaitForListing; // we should wait until another worker finishes the listing + SubState = fwssWorkUploadWaitForListing; // wait until another worker finishes the listing reportWorkerChange = TRUE; // the worker displays the fwssWorkUploadWaitForListing state in the window, so it needs to be redrawn } break; @@ -638,7 +638,7 @@ void CFTPWorker::HandleEventInWorkingState4(CFTPWorkerEvent event, BOOL& sendQui lstrcpyn(ftpPath, curItem->TgtPath, FTP_MAX_PATH); CFTPServerPathType type = Oper->GetFTPServerPathType(ftpPath); if (FTPPathAppend(type, ftpPath, FTP_MAX_PATH, curItem->TgtName, TRUE)) - { // we have the path, send CWD to the examined directory on the server + { // we have the path; send CWD to the server for the directory being explored PrepareFTPCommand(buf, 200 + FTP_MAX_PATH, errBuf, 50 + FTP_MAX_PATH, ftpcmdChangeWorkingPath, &cmdLen, ftpPath); // cannot report an error sendCmd = TRUE; @@ -900,7 +900,7 @@ void CFTPWorker::HandleEventInWorkingState4(CFTPWorkerEvent event, BOOL& sendQui int count = ftpQueueItems->Count - (parentItemAdded ? 1 : 0); int childItemsNotDone = count; int i; - for (i = 0; i < count; i++) // set the parent for items created by the explore + for (i = 0; i < count; i++) // set the parent for items created by Explore { CFTPQueueItem* actItem = ftpQueueItems->At(i); actItem->ParentUID = parentUID; @@ -949,7 +949,7 @@ void CFTPWorker::HandleEventInWorkingState4(CFTPWorkerEvent event, BOOL& sendQui // notify all potentially sleeping workers that new work has appeared HANDLES(LeaveCriticalSection(&WorkerCritSect)); // since we are already in CSocketsThread::CritSect, this call is also possible - // from within CSocket::SocketCritSect (no deadlock threat) + // from CSocket::SocketCritSect (no deadlock risk) Oper->PostNewWorkAvailable(FALSE); HANDLES(EnterCriticalSection(&WorkerCritSect)); } From 1ae4ff9ec33f31141b8587a793e45512ba02aeea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 9 Apr 2026 20:16:05 +0200 Subject: [PATCH 017/710] [tanslation] Fix src/plugins/ftp/operats7.cpp comments (#388) --- src/plugins/ftp/operats7.cpp | 172 +++++++++++++++++------------------ 1 file changed, 86 insertions(+), 86 deletions(-) diff --git a/src/plugins/ftp/operats7.cpp b/src/plugins/ftp/operats7.cpp index 9fec2ffbf..817d18320 100644 --- a/src/plugins/ftp/operats7.cpp +++ b/src/plugins/ftp/operats7.cpp @@ -18,8 +18,8 @@ void CFTPWorker::OpenActDataCon(CFTPWorkerSubState waitForListen, char* errBuf, HANDLES(LeaveCriticalSection(&WorkerCritSect)); - // Since we are already inside the CSocketsThread::CritSect section, these calls - // are possible even from the CSocket::SocketCritSect section (no risk of deadlock). + // Since we are already in CSocketsThread::CritSect, these calls + // are allowed even from CSocket::SocketCritSect (there is no risk of deadlock). GetLocalIP(&localIP, NULL); // it should hardly be able to return an error BOOL retOpenForListening = FALSE; BOOL listenError = TRUE; @@ -41,12 +41,12 @@ void CFTPWorker::OpenActDataCon(CFTPWorkerSubState waitForListen, char* errBuf, int serverTimeout = Config.GetServerRepliesTimeout() * 1000; if (serverTimeout < 1000) serverTimeout = 1000; // at least one second - // Since we are already inside the CSocketsThread::CritSect section, this call - // is possible even from the CSocket::SocketCritSect and CFTPWorker::WorkerCritSect sections (no risk of deadlock). + // Since we are already in CSocketsThread::CritSect, this call + // is possible even from CSocket::SocketCritSect and CFTPWorker::WorkerCritSect (there is no risk of deadlock). SocketsThread->AddTimer(Msg, UID, GetTickCount() + serverTimeout, WORKER_LISTENTIMEOUTTIMID, NULL); // ignore error; at worst the user presses Stop } - else // failed to open a "listen" socket for receiving the data connection from + else // failed to open a "listen" socket for receiving the data connection from the server { // the server (a local operation that should almost never happen) or cannot open a connection to the proxy server if (WorkerDataCon != NULL) { @@ -112,7 +112,7 @@ void CFTPWorker::WaitForListen(CFTPWorkerEvent event, BOOL& handleShouldStop, ch HANDLES(LeaveCriticalSection(&WorkerCritSect)); // Since we are already inside the CSocketsThread::CritSect section, this call // It can also be called from the CSocket::SocketCritSect section (no risk of deadlock). - if (WorkerDataCon->IsConnected()) // close the "data connection", the system will attempt a "graceful" + if (WorkerDataCon->IsConnected()) // close the "data connection"; the system will attempt a graceful shutdown WorkerDataCon->CloseSocketEx(NULL); // shutdown (we will not learn about the result) WorkerDataCon->FreeFlushData(); DeleteSocket(WorkerDataCon); @@ -155,7 +155,7 @@ void CFTPWorker::WaitForListen(CFTPWorkerEvent event, BOOL& handleShouldStop, ch sendCmd = TRUE; SubState = waitForPORTRes; } - else // error while opening the "listen" port on the proxy server - perform a retry... + else // error while opening the "listen" port on the proxy server - retry... { // Close the data connection. if (WorkerDataCon != NULL) @@ -163,7 +163,7 @@ void CFTPWorker::WaitForListen(CFTPWorkerEvent event, BOOL& handleShouldStop, ch HANDLES(LeaveCriticalSection(&WorkerCritSect)); // Since we are already inside the CSocketsThread::CritSect section, this call // It can also be called from the CSocket::SocketCritSect section (no risk of deadlock). - if (WorkerDataCon->IsConnected()) // close the "data connection", the system will attempt a "graceful" + if (WorkerDataCon->IsConnected()) // close the "data connection"; the system will attempt a "graceful" shutdown WorkerDataCon->CloseSocketEx(NULL); // shutdown (we will not learn about the result) WorkerDataCon->FreeFlushData(); DeleteSocket(WorkerDataCon); @@ -196,7 +196,7 @@ void CFTPWorker::WaitForListen(CFTPWorkerEvent event, BOOL& handleShouldStop, ch errBuf[0] = 0; // Since we are already inside the CSocketsThread::CritSect section, this call // It can also be called from the CSocket::SocketCritSect section (no risk of deadlock). - if (WorkerDataCon->IsConnected()) // close the "data connection", the system will attempt a "graceful" + if (WorkerDataCon->IsConnected()) // close the "data connection"; the system will attempt a graceful shutdown WorkerDataCon->CloseSocketEx(NULL); // shutdown (we will not learn about the result) WorkerDataCon->FreeFlushData(); DeleteSocket(WorkerDataCon); @@ -267,8 +267,8 @@ void CFTPWorker::WaitForPASVRes(CFTPWorkerEvent event, char* reply, int replySiz int logUID = LogUID; HANDLES(LeaveCriticalSection(&WorkerCritSect)); - // Since we are already inside the CSocketsThread::CritSect section, these calls - // They can also be called from the CSocket::SocketCritSect section (no risk of deadlock). + // Since we are already in CSocketsThread::CritSect, these calls + // can also be made from CSocket::SocketCritSect (no deadlock risk). if (WorkerDataCon != NULL) { WorkerDataCon->SetPassive(ip, port, logUID); @@ -311,13 +311,13 @@ void CFTPWorker::WaitForPASVRes(CFTPWorkerEvent event, char* reply, int replySiz break; } - case fweCmdConClosed: // connection closed/timed out (description see ErrorDescr) -> try to restore it + case fweCmdConClosed: // connection closed/timed out (see ErrorDescr) -> try to restore it { if (WorkerDataCon != NULL) { HANDLES(LeaveCriticalSection(&WorkerCritSect)); - // Since we are already inside the CSocketsThread::CritSect section, this call - // It can also be called from the CSocket::SocketCritSect section (no risk of deadlock). + // Since we are already in CSocketsThread::CritSect, this call + // can also be made from CSocket::SocketCritSect (no deadlock risk). DeleteSocket(WorkerDataCon); // no connection has been established yet; it will only be deallocated WorkerDataCon = NULL; HANDLES(EnterCriticalSection(&WorkerCritSect)); @@ -343,14 +343,14 @@ void CFTPWorker::WaitForPORTRes(CFTPWorkerEvent event, BOOL& nextLoop, BOOL& con break; } - case fweCmdConClosed: // connection closed/timed out (description see ErrorDescr) -> try to restore it + case fweCmdConClosed: // connection closed/timed out (see ErrorDescr for details) -> try to reestablish it { if (WorkerDataCon != NULL) { HANDLES(LeaveCriticalSection(&WorkerCritSect)); // Since we are already inside the CSocketsThread::CritSect section, this call // It can also be called from the CSocket::SocketCritSect section (no risk of deadlock). - if (WorkerDataCon->IsConnected()) // close the "data connection", the system will attempt a "graceful" + if (WorkerDataCon->IsConnected()) // close the "data connection"; the system will attempt a graceful shutdown WorkerDataCon->CloseSocketEx(NULL); // shutdown (we will not learn about the result) WorkerDataCon->FreeFlushData(); DeleteSocket(WorkerDataCon); @@ -377,7 +377,7 @@ void CFTPWorker::SetTypeA(BOOL& handleShouldStop, char* errBuf, char* buf, int& HANDLES(LeaveCriticalSection(&WorkerCritSect)); // Since we are already inside the CSocketsThread::CritSect section, this call // It can also be called from the CSocket::SocketCritSect section (no risk of deadlock). - if (WorkerDataCon->IsConnected()) // close the "data connection", the system will attempt a "graceful" + if (WorkerDataCon->IsConnected()) // close the "data connection"; the system will attempt a "graceful" shutdown WorkerDataCon->CloseSocketEx(NULL); // shutdown (we will not learn about the result) WorkerDataCon->FreeFlushData(); DeleteSocket(WorkerDataCon); @@ -413,7 +413,7 @@ void CFTPWorker::WaitForTYPERes(CFTPWorkerEvent event, int replyCode, BOOL& next // case fweCmdInfoReceived: // ignore "1xx" replies (they are only written to the log) case fweCmdReplyReceived: { - if (FTP_DIGIT_1(replyCode) == FTP_D1_SUCCESS) // success is returned (should be 200) + if (FTP_DIGIT_1(replyCode) == FTP_D1_SUCCESS) // a success reply was received (it should be 200) CurrentTransferMode = trMode; // the transfer mode was changed else CurrentTransferMode = ctrmUnknown; // unknown error; it may not matter at all, but we will not cache the data transfer mode @@ -430,7 +430,7 @@ void CFTPWorker::WaitForTYPERes(CFTPWorkerEvent event, int replyCode, BOOL& next HANDLES(LeaveCriticalSection(&WorkerCritSect)); // Since we are already inside the CSocketsThread::CritSect section, this call // It can also be called from the CSocket::SocketCritSect section (no risk of deadlock). - if (WorkerDataCon->IsConnected()) // close the "data connection", the system will attempt a "graceful" + if (WorkerDataCon->IsConnected()) // close the "data connection"; the system will attempt a graceful shutdown WorkerDataCon->CloseSocketEx(NULL); // shutdown (we will not learn about the result) WorkerDataCon->FreeFlushData(); DeleteSocket(WorkerDataCon); @@ -452,7 +452,7 @@ void CFTPWorker::HandleEventInWorkingState2(CFTPWorkerEvent event, BOOL& sendQui BOOL& conClosedRetryItem, BOOL& lookForNewWork, BOOL& handleShouldStop, BOOL* listingNotAccessible) { - // NOTE: this method is also used for listing the target path during upload (UploadDirGetTgtPathListing==TRUE)!!! + // NOTE: this method is also used to list the target path during upload (UploadDirGetTgtPathListing==TRUE). if (listingNotAccessible != NULL) *listingNotAccessible = FALSE; char* tgtPath = NULL; @@ -492,7 +492,7 @@ void CFTPWorker::HandleEventInWorkingState2(CFTPWorkerEvent event, BOOL& sendQui lstrcpyn(ftpPath, CurItem->Path, FTP_MAX_PATH); CFTPServerPathType type = Oper->GetFTPServerPathType(ftpPath); if (UploadDirGetTgtPathListing || FTPPathAppend(type, ftpPath, FTP_MAX_PATH, CurItem->Name, TRUE)) - { // we have the path; send CWD to the server to enter the inspected directory + { // we have the path; send CWD to the server for the directory being explored _snprintf_s(errText, 200 + FTP_MAX_PATH, _TRUNCATE, LoadStr(IDS_LOGMSGLISTINGPATH), ftpPath); Logs.LogMessage(LogUID, errText, -1, TRUE); @@ -579,7 +579,7 @@ void CFTPWorker::HandleEventInWorkingState2(CFTPWorkerEvent event, BOOL& sendQui else { if (UploadDirGetTgtPathListing || FTPGetDirectoryFromReply(reply, replySize, ftpPath, FTP_MAX_PATH)) - { // we have the working path; check whether a cycle (endless loop) is occurring + { // We have the working path; check whether a cycle (infinite loop) is occurring BOOL cycle = FALSE; if (!UploadDirGetTgtPathListing) { @@ -597,7 +597,7 @@ void CFTPWorker::HandleEventInWorkingState2(CFTPWorkerEvent event, BOOL& sendQui cycle = TRUE; } } - // Check whether we have already visited this path, which would mean entering an endless loop. + // Check whether we have already visited this path, which would mean that we have entered an infinite loop. if (!cycle && Oper->IsAlreadyExploredPath(WorkingPath)) cycle = TRUE; } @@ -608,7 +608,7 @@ void CFTPWorker::HandleEventInWorkingState2(CFTPWorkerEvent event, BOOL& sendQui Queue->UpdateItemState(CurItem, sqisFailed, ITEMPR_DIREXPLENDLESSLOOP, NO_ERROR, NULL, Oper); lookForNewWork = TRUE; } - else // everything is OK; allocate the data connection + else // everything is OK; allocate the data connection socket { if (WorkerDataCon != NULL) TRACE_E("Unexpected situation in CFTPWorker::HandleEventInWorkingState2(): WorkerDataCon is not NULL before starting data-connection!"); @@ -628,8 +628,8 @@ void CFTPWorker::HandleEventInWorkingState2(CFTPWorkerEvent event, BOOL& sendQui if (WorkerDataCon != NULL) { HANDLES(LeaveCriticalSection(&WorkerCritSect)); - // Since we are already inside the CSocketsThread::CritSect section, this call - // It can also be called from the CSocket::SocketCritSect section (no risk of deadlock). + // Since we are already in CSocketsThread::CritSect, this call + // is allowed even from CSocket::SocketCritSect (no deadlock risk) DeleteSocket(WorkerDataCon); // it will only be deallocated WorkerDataCon = NULL; HANDLES(EnterCriticalSection(&WorkerCritSect)); @@ -651,15 +651,15 @@ void CFTPWorker::HandleEventInWorkingState2(CFTPWorkerEvent event, BOOL& sendQui WorkerDataConState = wdcsOnlyAllocated; HANDLES(LeaveCriticalSection(&WorkerCritSect)); - // Since we are already inside the CSocketsThread::CritSect section, this call - // It can also be called from the CSocket::SocketCritSect section (no risk of deadlock). + // Since we are already in CSocketsThread::CritSect, this call + // is allowed even from CSocket::SocketCritSect (no deadlock risk) WorkerDataCon->SetPostMessagesToWorker(TRUE, Msg, UID, WORKER_DATACON_CONNECTED, WORKER_DATACON_CLOSED, -1 /* not needed for listings */, WORKER_DATACON_LISTENINGFORCON); WorkerDataCon->SetGlobalLastActivityTime(Oper->GetGlobalLastActivityTime()); // exploring directories for delete/change-attr and upload listing are not measured (the meter is used - // otherwise see SMPLCMD_APPROXBYTESIZE + upload: the meter is for upload, but this is download) + // differently, see SMPLCMD_APPROXBYTESIZE + upload: the meter is for upload, but this is download) if (CurItem->Type != fqitDeleteExploreDir && CurItem->Type != fqitChAttrsExploreDir && CurItem->Type != fqitChAttrsExploreDirLink && @@ -756,9 +756,9 @@ void CFTPWorker::HandleEventInWorkingState2(CFTPWorkerEvent event, BOOL& sendQui if (WorkerDataCon != NULL) { HANDLES(LeaveCriticalSection(&WorkerCritSect)); - // Since we are already inside the CSocketsThread::CritSect section, this call - // It can also be called from the CSocket::SocketCritSect section (no risk of deadlock). - if (WorkerDataCon->IsConnected()) // close the "data connection", the system will attempt a "graceful" + // Since we are already in CSocketsThread::CritSect, this call + // is allowed even from CSocket::SocketCritSect (no deadlock risk) + if (WorkerDataCon->IsConnected()) // close the "data connection"; the system will attempt a "graceful" shutdown WorkerDataCon->CloseSocketEx(NULL); // shutdown (we will not learn about the result) DeleteSocket(WorkerDataCon); WorkerDataCon = NULL; @@ -791,8 +791,8 @@ void CFTPWorker::HandleEventInWorkingState2(CFTPWorkerEvent event, BOOL& sendQui if (WorkerDataCon != NULL) { HANDLES(LeaveCriticalSection(&WorkerCritSect)); - // Since we are already inside the CSocketsThread::CritSect section, this call - // It can also be called from the CSocket::SocketCritSect section (no risk of deadlock). + // Since we are already in CSocketsThread::CritSect, this call + // is allowed even from CSocket::SocketCritSect (no deadlock risk) WorkerDataCon->ActivateConnection(); HANDLES(EnterCriticalSection(&WorkerCritSect)); } @@ -835,9 +835,9 @@ void CFTPWorker::HandleEventInWorkingState2(CFTPWorkerEvent event, BOOL& sendQui HANDLES(LeaveCriticalSection(&WorkerCritSect)); if (FTP_DIGIT_1(replyCode) != FTP_D1_SUCCESS || !WorkerDataCon->IsTransfering(&trFinished) && !trFinished) - { // the server returns a listing error or the connection was not established - // Since we are already inside the CSocketsThread::CritSect section, this call - // It can also be called from the CSocket::SocketCritSect section (no risk of deadlock). + { // the server returned a listing error or the connection was not established +// Since we are already in CSocketsThread::CritSect, this call +// is allowed even from CSocket::SocketCritSect (no deadlock risk) if (WorkerDataCon->IsConnected()) { // close the "data connection", the system will attempt a "graceful" WorkerDataCon->CloseSocketEx(NULL); // shutdown (we will not learn about the result) @@ -867,15 +867,15 @@ void CFTPWorker::HandleEventInWorkingState2(CFTPWorkerEvent event, BOOL& sendQui if (WorkerDataCon != NULL) { HANDLES(LeaveCriticalSection(&WorkerCritSect)); - // Since we are already inside the CSocketsThread::CritSect section, this call - // It can also be called from the CSocket::SocketCritSect section (no risk of deadlock). - if (WorkerDataCon->IsConnected()) // close the "data connection", the system will attempt a "graceful" + // Since we are already in CSocketsThread::CritSect, this call + // is allowed even from CSocket::SocketCritSect (no deadlock risk) + if (WorkerDataCon->IsConnected()) // close the "data connection"; the system will attempt a "graceful" shutdown WorkerDataCon->CloseSocketEx(NULL); // shutdown (we will not learn about the result) HANDLES(EnterCriticalSection(&WorkerCritSect)); } } - // If we do not have to wait for the "data connection" to finish, proceed to processing the LIST command replyCode. + // If we do not have to wait for the data connection to finish, proceed to processing the LIST command reply code. SubState = waitForDataConFinish ? fwssWorkExplWaitForDataConFinish : fwssWorkExplProcessLISTRes; if (!waitForDataConFinish) nextLoop = TRUE; @@ -887,9 +887,9 @@ void CFTPWorker::HandleEventInWorkingState2(CFTPWorkerEvent event, BOOL& sendQui if (WorkerDataCon != NULL) { HANDLES(LeaveCriticalSection(&WorkerCritSect)); - // Since we are already inside the CSocketsThread::CritSect section, this call - // It can also be called from the CSocket::SocketCritSect section (no risk of deadlock). - if (WorkerDataCon->IsConnected()) // close the "data connection", the system will attempt a "graceful" + // Since we are already in CSocketsThread::CritSect, this call + // is allowed even from CSocket::SocketCritSect (no deadlock risk) + if (WorkerDataCon->IsConnected()) // close the "data connection"; the system will attempt a "graceful" shutdown WorkerDataCon->CloseSocketEx(NULL); // shutdown (we will not learn about the result) DeleteSocket(WorkerDataCon); WorkerDataCon = NULL; @@ -910,8 +910,8 @@ void CFTPWorker::HandleEventInWorkingState2(CFTPWorkerEvent event, BOOL& sendQui if (WorkerDataCon != NULL) { HANDLES(LeaveCriticalSection(&WorkerCritSect)); - // Since we are already inside the CSocketsThread::CritSect section, this call - // It can also be called from the CSocket::SocketCritSect section (no risk of deadlock). + // Since we are already in CSocketsThread::CritSect, this call + // is allowed even from CSocket::SocketCritSect (no deadlock risk) con = WorkerDataCon->IsConnected(); HANDLES(EnterCriticalSection(&WorkerCritSect)); } @@ -935,9 +935,9 @@ void CFTPWorker::HandleEventInWorkingState2(CFTPWorkerEvent event, BOOL& sendQui if (WorkerDataCon != NULL) { HANDLES(LeaveCriticalSection(&WorkerCritSect)); - // Since we are already inside the CSocketsThread::CritSect section, this call - // It can also be called from the CSocket::SocketCritSect section (no risk of deadlock). - if (WorkerDataCon->IsConnected()) // close the "data connection", the system will attempt a "graceful" + // Since we are already in CSocketsThread::CritSect, this call + // is allowed even from CSocket::SocketCritSect (no deadlock risk) + if (WorkerDataCon->IsConnected()) // close the "data connection"; the system will attempt a "graceful" shutdown WorkerDataCon->CloseSocketEx(NULL); // shutdown (we will not learn about the result) DeleteSocket(WorkerDataCon); WorkerDataCon = NULL; @@ -958,9 +958,9 @@ void CFTPWorker::HandleEventInWorkingState2(CFTPWorkerEvent event, BOOL& sendQui BOOL lowMem, noDataTransTimeout; int sslErrorOccured; HANDLES(LeaveCriticalSection(&WorkerCritSect)); - // Since we are already inside the CSocketsThread::CritSect section, this call - // It can also be called from the CSocket::SocketCritSect section (no risk of deadlock). - if (WorkerDataCon->IsConnected()) // close the "data connection", the system will attempt a "graceful" + // Since we are already in CSocketsThread::CritSect, this call + // is allowed even from CSocket::SocketCritSect (no deadlock risk) + if (WorkerDataCon->IsConnected()) // close the "data connection"; the system will attempt a "graceful" shutdown { WorkerDataCon->CloseSocketEx(NULL); // shutdown (we will not learn about the result) TRACE_E("Unexpected situation in CFTPWorker::HandleEventInWorkingState2(): data connection has left opened!"); @@ -970,8 +970,8 @@ void CFTPWorker::HandleEventInWorkingState2(CFTPWorkerEvent event, BOOL& sendQui errBuf[0] = 0; if (lowMem) // the "data connection" reports out-of-memory ("always false") { - // Since we are already inside the CSocketsThread::CritSect section, this call - // It can also be called from the CSocket::SocketCritSect section (no risk of deadlock). + // Since we are already inside CSocketsThread::CritSect, this call + // can also be made from CSocket::SocketCritSect (no deadlock risk). DeleteSocket(WorkerDataCon); WorkerDataCon = NULL; HANDLES(EnterCriticalSection(&WorkerCritSect)); @@ -984,11 +984,11 @@ void CFTPWorker::HandleEventInWorkingState2(CFTPWorkerEvent event, BOOL& sendQui else { if (err != NO_ERROR && !IsConnected()) - { // the LIST reply did arrive, but while waiting for the transfer to finish through the data connection - // the connection was interrupted (both data connection and control connection) -> RETRY + { // the LIST reply arrived, but while waiting for the transfer to finish over the data connection +// both connections were interrupted (data connection and control connection) -> RETRY - // Since we are already inside the CSocketsThread::CritSect section, this call - // It can also be called from the CSocket::SocketCritSect section (no risk of deadlock). + // Since we are already in CSocketsThread::CritSect, this call + // is allowed even from CSocket::SocketCritSect (no deadlock risk) DeleteSocket(WorkerDataCon); WorkerDataCon = NULL; HANDLES(EnterCriticalSection(&WorkerCritSect)); @@ -1010,7 +1010,7 @@ void CFTPWorker::HandleEventInWorkingState2(CFTPWorkerEvent event, BOOL& sendQui { // obtain the data from the "data connection" allocatedListing = WorkerDataCon->GiveData(&allocatedListingLen, &decomprErr); - if (decomprErr) // on decompression error discard the result and display the error + if (decomprErr) // on decompression error, discard the result and report the error { listingIsNotOK = TRUE; allocatedListingLen = 0; @@ -1018,8 +1018,8 @@ void CFTPWorker::HandleEventInWorkingState2(CFTPWorkerEvent event, BOOL& sendQui allocatedListing = NULL; } } - // Since we are already inside the CSocketsThread::CritSect section, this call - // It can also be called from the CSocket::SocketCritSect section (no risk of deadlock). + // Since we are already in CSocketsThread::CritSect, this call + // is allowed even from CSocket::SocketCritSect (no deadlock risk) DeleteSocket(WorkerDataCon); WorkerDataCon = NULL; HANDLES(EnterCriticalSection(&WorkerCritSect)); @@ -1032,10 +1032,10 @@ void CFTPWorker::HandleEventInWorkingState2(CFTPWorkerEvent event, BOOL& sendQui FTP_DIGIT_1(listCmdReplyCode) == FTP_D1_ERROR)) { HANDLES(LeaveCriticalSection(&WorkerCritSect)); - if (IsConnected()) // "Manually" close the control connection. + if (IsConnected()) // close the control connection manually { - // Since we are already inside the CSocketsThread::CritSect section, this call - // It can also be called from the CSocket::SocketCritSect section (no risk of deadlock). + // Since we are already in CSocketsThread::CritSect, this call + // is allowed even from CSocket::SocketCritSect (no deadlock risk) ForceClose(); // Sending QUIT would be cleaner, but a certificate change is very unlikely, so it is not worth bothering with that ;-) } HANDLES(EnterCriticalSection(&WorkerCritSect)); @@ -1066,11 +1066,11 @@ void CFTPWorker::HandleEventInWorkingState2(CFTPWorkerEvent event, BOOL& sendQui (FTP_DIGIT_2(listCmdReplyCode) == FTP_D2_CONNECTION || FTP_DIGIT_2(listCmdReplyCode) != FTP_D2_CONNECTION && !isVMSFileNotFound) && ListCmdReplyText != NULL) - { // if we do not have a network error description from the server, use the system description + { // if we do not have an error description from the server, use the system description lstrcpyn(errText, ListCmdReplyText, 200 + FTP_MAX_PATH); } - if (errText[0] == 0 && errBuf[0] != 0) // try to take the error text from the proxy server + if (errText[0] == 0 && errBuf[0] != 0) // try to get the error text from the proxy server lstrcpyn(errText, errBuf, 200 + FTP_MAX_PATH); if (errText[0] == 0 && decomprErr) @@ -1133,14 +1133,14 @@ void CFTPWorker::HandleEventInWorkingState2(CFTPWorkerEvent event, BOOL& sendQui Oper->GetListingServerType(listingServerType); BOOL err2 = allocatedListing == NULL; - if (UploadDirGetTgtPathListing) // upload listing: store the listing in the cache + if (UploadDirGetTgtPathListing) // upload listing: store the listing in cache { err2 |= welcomeReply == NULL || systReply == NULL; if (!err2) { unsigned short port; Oper->GetUserHostPort(userTmp, host, &port); - // The call UploadListingCache.ListingFinished() is possible only because we are in the CSocketsThread::CritSect section. + // UploadListingCache.ListingFinished() can be called only because we are in CSocketsThread::CritSect err2 = !UploadListingCache.ListingFinished(userTmp, host, port, tgtPath, pathType, allocatedListing, allocatedListingLen, listingDate, welcomeReply, systReply, @@ -1148,7 +1148,7 @@ void CFTPWorker::HandleEventInWorkingState2(CFTPWorkerEvent event, BOOL& sendQui uploadFinished = !err2; } } - else // download + delete + change-attrs: parse the listing and add new items to the queue + else // download + delete + change attributes: parse the listing and add new items to the queue { BOOL isVMS = pathType == ftpsptOpenVMS; BOOL isAS400 = pathType == ftpsptAS400; @@ -1179,7 +1179,7 @@ void CFTPWorker::HandleEventInWorkingState2(CFTPWorkerEvent event, BOOL& sendQui err2 |= ftpQueueItems == NULL || !HaveWorkingPath; if (!err2) { - if (listingServerType[0] != 0) // this is not autodetection; find listingServerType + if (listingServerType[0] != 0) // this is not autodetection; find the matching listingServerType { int i; for (i = 0; i < serverTypeListCount; i++) @@ -1201,7 +1201,7 @@ void CFTPWorker::HandleEventInWorkingState2(CFTPWorkerEvent event, BOOL& sendQui { needSimpleListing = FALSE; // we parsed the listing successfully } - break; // we found the required server type; finish + break; // we found the required server type; stop } } if (i == serverTypeListCount) @@ -1308,7 +1308,7 @@ void CFTPWorker::HandleEventInWorkingState2(CFTPWorkerEvent event, BOOL& sendQui Queue->UpdateItemState(CurItem, sqisFailed, ITEMPR_UNABLETOPARSELISTING, NO_ERROR, NULL, Oper); lookForNewWork = TRUE; } - else // log which parser handled it + else // log which parser parsed it { if (listingServerType[0] != 0) // "always true" { @@ -1373,7 +1373,7 @@ void CFTPWorker::HandleEventInWorkingState2(CFTPWorkerEvent event, BOOL& sendQui case fqitChAttrsExploreDir: // explore directories for attribute changes (also adds an item for changing directory attributes) (object of class CFTPQueueItemChAttrExplore) { - if (selDirs) // relevant only when attributes should be set on the inspected directory + if (selDirs) // relevant only when attributes are to be set on the inspected directory { skip = FALSE; type = fqitChAttrsDir; @@ -1386,7 +1386,7 @@ void CFTPWorker::HandleEventInWorkingState2(CFTPWorkerEvent event, BOOL& sendQui if (rights != NULL && GetAttrsFromUNIXRights(&actAttr, &attrDiff, rights)) { DWORD changeMask = (~attrAndMask | attrOrMask) & 0777; - if ((attrDiff & changeMask) == 0 && // we do not change any unknown attribute + if ((attrDiff & changeMask) == 0 && // we do not change any unknown attributes (actAttr & changeMask) == (((actAttr & attrAndMask) | attrOrMask) & changeMask)) // we do not change any known attribute { // nothing to do (no attribute change) skip = TRUE; @@ -1395,7 +1395,7 @@ void CFTPWorker::HandleEventInWorkingState2(CFTPWorkerEvent event, BOOL& sendQui { if (((attrDiff & attrAndMask) & attrOrMask) != (attrDiff & attrAndMask)) { // problem: an unknown attribute needs to be preserved, which we cannot do - actAttr |= attrDiff; // put at least 'x' there when we do not know 's' or 't' or whatever is there now (see UNIX permissions) + actAttr |= attrDiff; // put at least 'x' there, since we cannot preserve the current 's' or 't' value or whatever is there now (see UNIX permissions) attrErr = TRUE; } actAttr = (actAttr & attrAndMask) | attrOrMask; @@ -1405,7 +1405,7 @@ void CFTPWorker::HandleEventInWorkingState2(CFTPWorkerEvent event, BOOL& sendQui { actAttr = attrOrMask; // assume no permissions (actAttr==0) if (((~attrAndMask | attrOrMask) & 0777) != 0777) - { // problem: permissions are unknown and some attribute must be preserved (we do not know its value -> we cannot keep it) + { // problem: permissions are unknown and some attribute should be preserved (we do not know its value, so we cannot preserve it) attrErr = TRUE; } } @@ -1456,7 +1456,7 @@ void CFTPWorker::HandleEventInWorkingState2(CFTPWorkerEvent event, BOOL& sendQui // case fqitChAttrsExploreDirLink: // explore a directory link for attribute changes (object of class CFTPQueueItem) } - BOOL parentItemAdded = FALSE; // TRUE = there is a "parent" item at the end of ftpQueueItems (for example deleting a directory (Delete and Move), changing directory attributes (Change Attrs)) + BOOL parentItemAdded = FALSE; // TRUE = ftpQueueItems ends with a "parent" item (for example when deleting a directory (Delete and Move) or changing directory attributes (Change Attrs)) int parentUID = CurItem->ParentUID; // parent UID for items created by expanding the directory if (item != NULL) { @@ -1484,7 +1484,7 @@ void CFTPWorker::HandleEventInWorkingState2(CFTPWorkerEvent event, BOOL& sendQui } else { - if (!skip) // only if it is not skipping the item but a low-memory error + if (!skip) // only if this is not skipping the item but a low-memory error { TRACE_E(LOW_MEMORY); err2 = TRUE; @@ -1494,7 +1494,7 @@ void CFTPWorker::HandleEventInWorkingState2(CFTPWorkerEvent event, BOOL& sendQui if (!err2) { // For items created by exploring the directory (does not apply to a possible "parent" item at the end of the array): - // set the parents and count items in the states "Skipped", "Failed", and those other than Done + // set the parents and count items in the "Skipped" and "Failed" states, and those not in "Done" int count = ftpQueueItems->Count - (parentItemAdded ? 1 : 0); int childItemsNotDone = 0; int childItemsSkipped = 0; @@ -1598,14 +1598,14 @@ void CFTPWorker::HandleEventInWorkingState2(CFTPWorkerEvent event, BOOL& sendQui // Inform all potentially sleeping workers that new work has appeared. HANDLES(LeaveCriticalSection(&WorkerCritSect)); - // Since we are already inside the CSocketsThread::CritSect section, this call - // It can also be called from the CSocket::SocketCritSect section (no risk of deadlock). + // Since we are already in CSocketsThread::CritSect, this call + // is allowed even from CSocket::SocketCritSect (no deadlock risk) Oper->PostNewWorkAvailable(FALSE); HANDLES(EnterCriticalSection(&WorkerCritSect)); } else { - err2 = TRUE; // out of memory -> write the error into the item + err2 = TRUE; // out of memory -> record the error in the item Queue->UnlockForMoreOperations(); } } @@ -1645,8 +1645,8 @@ void CFTPWorker::HandleEventInWorkingState2(CFTPWorkerEvent event, BOOL& sendQui // If we are exploring directories for delete/change-attr or doing an upload listing, we must // reset the speed meter (explore speed and upload listing are not measured; this - // that moment can therefore be the start of measuring speed for delete/change-attr/upload operations), - // so that the time-left is shown correctly in the operation dialog. + // moment can therefore be the start of speed measurement for delete/change-attr/upload operations), + // so that the time left is shown correctly in the operation dialog if (delOrChangeAttrExpl || UploadDirGetTgtPathListing) { Oper->GetGlobalTransferSpeedMeter()->Clear(); @@ -1660,8 +1660,8 @@ void CFTPWorker::HandleEventInWorkingState2(CFTPWorkerEvent event, BOOL& sendQui postActivate = TRUE; // trigger to continue working reportWorkerChange = TRUE; // we need to hide any progress while fetching the listing - // Since we are already inside the CSocketsThread::CritSect section, this call - // It can also be called from the CSocket::SocketCritSect and CFTPWorker::WorkerCritSect sections (no risk of deadlock). + // Since we are already in CSocketsThread::CritSect, this call + // is allowed even from CSocket::SocketCritSect and CFTPWorker::WorkerCritSect (no deadlock risk). SocketsThread->DeleteTimer(UID, WORKER_STATUSUPDATETIMID); // cancel any timer from the previous work } break; From 82c3a148482d29210cc807798764cd01d12ab6e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 9 Apr 2026 20:20:45 +0200 Subject: [PATCH 018/710] [tanslation] Fix src/plugins/ftp/operats4.cpp comments (#389) --- src/plugins/ftp/operats4.cpp | 88 ++++++++++++++++++------------------ 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/src/plugins/ftp/operats4.cpp b/src/plugins/ftp/operats4.cpp index d8fbe5f38..b2df2f6a3 100644 --- a/src/plugins/ftp/operats4.cpp +++ b/src/plugins/ftp/operats4.cpp @@ -69,7 +69,7 @@ void CFTPWorker::HandleEventInWorkingState(CFTPWorkerEvent event, BOOL& sendQuit HANDLES(LeaveCriticalSection(&WorkerCritSect)); // since we are already inside CSocketsThread::CritSect, this call // is also possible from CSocket::SocketCritSect (no risk of deadlock) - if (WorkerDataCon->IsConnected()) // close the data connection; the system will try a "graceful" + if (WorkerDataCon->IsConnected()) // close the "data connection"; the system will attempt a "graceful" shutdown WorkerDataCon->CloseSocketEx(NULL); // shutdown (we will not learn the result) WorkerDataCon->FreeFlushData(); DeleteSocket(WorkerDataCon); @@ -135,7 +135,7 @@ void CFTPWorker::HandleEventInWorkingState(CFTPWorkerEvent event, BOOL& sendQuit WorkerDataConState = wdcsTransferFinished; else { - if (WorkerDataConState != wdcsWaitingForConnection) // this also arrives when the data-connection connect fails + if (WorkerDataConState != wdcsWaitingForConnection) // also occurs when the data connection connect attempt fails TRACE_E("CFTPWorker::HandleEventInWorkingState(): fweDataConConnectionClosed: WorkerDataConState is not wdcsTransferingData!"); } } @@ -147,7 +147,7 @@ void CFTPWorker::HandleEventInWorkingState(CFTPWorkerEvent event, BOOL& sendQuit { if (event == fweUplDataConConnectedToServer) { - if (ResumingFileOnServer) // APPE caused the data connection to open -> APPE is probably functional (implemented) + if (ResumingFileOnServer) // APPE opened the data connection -> APPE is probably supported (implemented) Oper->SetDataConWasOpenedForAppendCmd(TRUE); if (ShouldStop) { @@ -156,7 +156,7 @@ void CFTPWorker::HandleEventInWorkingState(CFTPWorkerEvent event, BOOL& sendQuit HANDLES(LeaveCriticalSection(&WorkerCritSect)); // since we are already inside CSocketsThread::CritSect, this call // is also possible from CSocket::SocketCritSect (no risk of deadlock) - if (WorkerUploadDataCon->IsConnected()) // close the data connection; the system will try a "graceful" + if (WorkerUploadDataCon->IsConnected()) // close the "data connection"; the system will attempt a "graceful" shutdown WorkerUploadDataCon->CloseSocketEx(NULL); // shutdown (we will not learn the result) WorkerUploadDataCon->FreeBufferedData(); DeleteSocket(WorkerUploadDataCon); @@ -208,7 +208,7 @@ void CFTPWorker::HandleEventInWorkingState(CFTPWorkerEvent event, BOOL& sendQuit WorkerDataConState = wdcsTransferFinished; else { - if (WorkerDataConState != wdcsWaitingForConnection) // also arrives when the data connection connect fails + if (WorkerDataConState != wdcsWaitingForConnection) // also occurs when the data connection fails to connect TRACE_E("CFTPWorker::HandleEventInWorkingState(): fweUplDataConConnectionClosed: WorkerDataConState is not wdcsTransferingData!"); } } @@ -247,7 +247,7 @@ void CFTPWorker::HandleEventInWorkingState(CFTPWorkerEvent event, BOOL& sendQuit case fqitUploadCopyExploreDir: // upload: explore a directory for copying (CFTPQueueItemCopyMoveUploadExplore object) case fqitUploadMoveExploreDir: // upload: explore a directory for move (deletes the directory after completion) (CFTPQueueItemCopyMoveUploadExplore object) { - if (UploadDirGetTgtPathListing) // list the target path into the upload listing cache + if (UploadDirGetTgtPathListing) // cache the target path listing for upload { BOOL listingNotAccessible; HandleEventInWorkingState2(event, sendQuitCmd, postActivate, reportWorkerChange, buf, errBuf, host, @@ -263,7 +263,7 @@ void CFTPWorker::HandleEventInWorkingState(CFTPWorkerEvent event, BOOL& sendQuit UploadListingCache.ListingFailed(userBuf, hostBuf, port, ((CFTPQueueItemCopyMoveUploadExplore*)CurItem)->TgtPath, pathType, listingNotAccessible, NULL, &listingOKErrorIgnored); - if (listingOKErrorIgnored && lookForNewWork) // a listing error is reported on the item; cancel this error + if (listingOKErrorIgnored && lookForNewWork) // a listing error is reported for the item; clear this error { lookForNewWork = FALSE; Queue->UpdateItemState(CurItem, sqisProcessing, ITEMPR_OK, NO_ERROR, NULL, Oper); @@ -294,7 +294,7 @@ void CFTPWorker::HandleEventInWorkingState(CFTPWorkerEvent event, BOOL& sendQuit { switch (SubState) { - case fwssWorkStartWork: // determine which path we should switch to on the server and send CWD + case fwssWorkStartWork: // determine which path to switch to on the server and send CWD { // before resolving the link for change-attr we must reset the speed meter (the resolve speed // is not measured) - this results in "(unknown)" time-left being shown in the operation dialog @@ -307,7 +307,7 @@ void CFTPWorker::HandleEventInWorkingState(CFTPWorkerEvent event, BOOL& sendQuit lstrcpyn(ftpPath, CurItem->Path, FTP_MAX_PATH); CFTPServerPathType type = Oper->GetFTPServerPathType(ftpPath); if (FTPPathAppend(type, ftpPath, FTP_MAX_PATH, CurItem->Name, TRUE)) - { // we have the path, send CWD to the examined directory on the server + { // we have the path; send CWD to the target directory on the server _snprintf_s(errText, _TRUNCATE, LoadStr(IDS_LOGMSGRESOLVINGLINK), ftpPath); Logs.LogMessage(LogUID, errText, -1, TRUE); @@ -327,7 +327,7 @@ void CFTPWorker::HandleEventInWorkingState(CFTPWorkerEvent event, BOOL& sendQuit break; } - case fwssWorkResLnkWaitForCWDRes: // resolve-link: waiting for the "CWD" result (changing to the examined link - if it succeeds, it is a directory link) + case fwssWorkResLnkWaitForCWDRes: // resolve-link: waiting for the "CWD" result (changing to the link being examined; if it succeeds, it is a link to a directory) { switch (event) { @@ -363,7 +363,7 @@ void CFTPWorker::HandleEventInWorkingState(CFTPWorkerEvent event, BOOL& sendQuit break; } - case fqitChAttrsResolveLink: // change attributes: detect whether this is a link to a directory (CFTPQueueItem object) + case fqitChAttrsResolveLink: // change attributes: determine whether this is a link to a directory (CFTPQueueItem object) { item = new CFTPQueueItem; if (item != NULL) @@ -488,9 +488,9 @@ void CFTPWorker::HandleEventInWorkingState(CFTPWorkerEvent event, BOOL& sendQuit break; } - case fqitDeleteLink: // delete for a link (CFTPQueueItemDel object) - case fqitDeleteFile: // delete for a file (CFTPQueueItemDel object) - case fqitDeleteDir: // delete for a directory (CFTPQueueItemDir object) + case fqitDeleteLink: // delete a link (CFTPQueueItemDel object) + case fqitDeleteFile: // delete a file (CFTPQueueItemDel object) + case fqitDeleteDir: // delete a directory (CFTPQueueItemDir object) case fqitCopyFileOrFileLink: // copy a file or a link to a file (CFTPQueueItemCopyOrMove object) case fqitMoveFileOrFileLink: // move a file or a link to a file (CFTPQueueItemCopyOrMove object) case fqitMoveDeleteDir: // delete a directory after moving its contents (CFTPQueueItemDir object) @@ -604,9 +604,9 @@ void CFTPWorker::HandleEventInWorkingState(CFTPWorkerEvent event, BOOL& sendQuit case fweCmdReplyReceived: { if (FTP_DIGIT_1(replyCode) == FTP_D1_SUCCESS) - { // we successfully changed the working path; because this path was "once" returned - // from the server in response to PWD, we assume that PWD would now return this path again - // and therefore we will not send it (optimization with hopefully low risk) + { // we successfully changed the working path; because this path was previously returned + // by the server in response to PWD, we assume that PWD would return it again now, + // so we will not send it (an optimization with hopefully low risk) HaveWorkingPath = TRUE; lstrcpyn(WorkingPath, CurItem->Path, FTP_MAX_PATH); SubState = fwssWorkSimpleCmdStartWork; @@ -640,8 +640,8 @@ void CFTPWorker::HandleEventInWorkingState(CFTPWorkerEvent event, BOOL& sendQuit { switch (CurItem->Type) { - case fqitDeleteFile: // delete for a file (CFTPQueueItemDel object) - case fqitDeleteLink: // delete for a link (CFTPQueueItemDel object) + case fqitDeleteFile: // delete a file (CFTPQueueItemDel object) + case fqitDeleteLink: // delete a link (CFTPQueueItemDel object) case fqitMoveDeleteDirLink: // delete a link to a directory after moving its contents (CFTPQueueItemDir object) { PrepareFTPCommand(buf, 200 + FTP_MAX_PATH, errBuf, 50 + FTP_MAX_PATH, @@ -651,7 +651,7 @@ void CFTPWorker::HandleEventInWorkingState(CFTPWorkerEvent event, BOOL& sendQuit break; } - case fqitDeleteDir: // delete for a directory (CFTPQueueItemDir object) + case fqitDeleteDir: // delete a directory (CFTPQueueItemDir object) case fqitMoveDeleteDir: // delete a directory after moving its contents (CFTPQueueItemDir object) { char vmsDirName[MAX_PATH + 10]; @@ -684,7 +684,7 @@ void CFTPWorker::HandleEventInWorkingState(CFTPWorkerEvent event, BOOL& sendQuit break; } - case fwssWorkDelFileWaitForDELERes: // deleting a file/link: waiting for the "DELE" result (file/link deletion) + case fwssWorkDelFileWaitForDELERes: // deleting a file/link: waiting for the "DELE" result { switch (event) { @@ -735,7 +735,7 @@ void CFTPWorker::HandleEventInWorkingState(CFTPWorkerEvent event, BOOL& sendQuit } } } - if (finished) // use only the final command in the operation for speed measurement (RMD may follow DELE; eliminate that here) + if (finished) // use only the last command in the operation for speed measurement (RMD may follow DELE; that is eliminated here) { // the server replied -> add theoretical bytes to the speed meter Oper->GetGlobalTransferSpeedMeter()->BytesReceived(SMPLCMD_APPROXBYTESIZE, GetTickCount()); @@ -743,7 +743,7 @@ void CFTPWorker::HandleEventInWorkingState(CFTPWorkerEvent event, BOOL& sendQuit break; } - case fweCmdConClosed: // the connection closed/timed out (see ErrorDescr for details) -> try to restore it + case fweCmdConClosed: // the connection closed/timed out (see ErrorDescr for details) -> try to reestablish it { // if we do not know how the file/link deletion ended, invalidate the listing cache Oper->GetUserHostPort(userBuf, hostBuf, &port); @@ -808,7 +808,7 @@ void CFTPWorker::HandleEventInWorkingState(CFTPWorkerEvent event, BOOL& sendQuit } case fwssWorkChAttrWaitForCHMODRes: // change attributes: waiting for the "SITE CHMOD" result (changing file/directory mode, likely Unix only) - case fwssWorkChAttrWaitForCHMODQuotedRes: // change attributes (name in quotes): waiting for the "SITE CHMOD" result (changing file/directory mode, likely Unix only) + case fwssWorkChAttrWaitForCHMODQuotedRes: // changing attributes (name in quotes): waiting for the "SITE CHMOD" result (changing the file/directory mode, probably Unix only) { switch (event) { @@ -826,7 +826,7 @@ void CFTPWorker::HandleEventInWorkingState(CFTPWorkerEvent event, BOOL& sendQuit char* s = CurItem->Name; while (*s != 0 && *s > ' ') s++; - if (*s != 0 && SubState == fwssWorkChAttrWaitForCHMODRes) // the file/directory name contains white-spaces; try placing the name in quotes (only if we have not tried this yet) + if (*s != 0 && SubState == fwssWorkChAttrWaitForCHMODRes) // the file/directory name contains whitespace; try putting the name in quotes (only if we have not tried this yet) { if (ShouldStop) handleShouldStop = TRUE; // check whether the worker should stop @@ -860,7 +860,7 @@ void CFTPWorker::HandleEventInWorkingState(CFTPWorkerEvent event, BOOL& sendQuit lookForNewWork = TRUE; } } - if (finished) // use only the final command in the operation for speed measurement (RMD may follow DELE; eliminate that here) + if (finished) // use only the final command in the operation for speed measurement (RMD may follow DELE; that is ignored here) { // the server replied -> add theoretical bytes to the speed meter Oper->GetGlobalTransferSpeedMeter()->BytesReceived(SMPLCMD_APPROXBYTESIZE, GetTickCount()); @@ -887,7 +887,7 @@ void CFTPWorker::HandleEventInWorkingState(CFTPWorkerEvent event, BOOL& sendQuit case fqitUploadCopyFile: // upload: copy a file (CFTPQueueItemCopyOrMoveUpload object) case fqitUploadMoveFile: // upload: move a file (CFTPQueueItemCopyOrMoveUpload object) { - if (UploadDirGetTgtPathListing) // list the target path into the upload listing cache + if (UploadDirGetTgtPathListing) // cache the target path listing for upload { BOOL listingNotAccessible; HandleEventInWorkingState2(event, sendQuitCmd, postActivate, reportWorkerChange, buf, errBuf, host, @@ -903,7 +903,7 @@ void CFTPWorker::HandleEventInWorkingState(CFTPWorkerEvent event, BOOL& sendQuit UploadListingCache.ListingFailed(userBuf, hostBuf, port, ((CFTPQueueItemCopyOrMoveUpload*)CurItem)->TgtPath, pathType, listingNotAccessible, NULL, &listingOKErrorIgnored); - if (listingOKErrorIgnored && lookForNewWork) // a listing error is reported on the item; cancel this error + if (listingOKErrorIgnored && lookForNewWork) // a listing error is reported on the item; clear this error { lookForNewWork = FALSE; Queue->UpdateItemState(CurItem, sqisProcessing, ITEMPR_OK, NO_ERROR, NULL, Oper); @@ -955,7 +955,7 @@ void CFTPWorker::HandleEventInWorkingState(CFTPWorkerEvent event, BOOL& sendQuit } else { - if (conClosedRetryItem) // the connection broke; end the operation on the item and try to perform the item again + if (conClosedRetryItem) // the connection broke; end the operation on this item and retry the item { CloseOpenedFile(TRUE, FALSE, NULL, NULL, FALSE, NULL); // this transfer failed; close the target file (if we are using one at all) CloseOpenedInFile(); // this transfer failed; close the source file (if we are using one at all) @@ -1051,7 +1051,7 @@ void CFTPWorker::HandleEvent(CFTPWorkerEvent event, char* reply, int replySize, { case fwsLookingForWork: { - if (ShouldStop) // we should stop the worker + if (ShouldStop) // stop the worker { if (SubState != fwssLookFWQuitSent && !SocketClosed) { @@ -1089,12 +1089,12 @@ void CFTPWorker::HandleEvent(CFTPWorkerEvent event, char* reply, int replySize, case fwsSleeping: { - if (ShouldStop) // we should stop the worker + if (ShouldStop) // stop the worker { if (SubState != fwssSleepingQuitSent && !SocketClosed) { SubState = fwssSleepingQuitSent; // prevent sending "QUIT" multiple times - sendQuitCmd = TRUE; // we must finish and have an open connection -> send the server the "QUIT" command (ignore the reply; it should lead to closing the connection and that is all we need now) + sendQuitCmd = TRUE; // we are shutting down and still have an open connection -> send the server the "QUIT" command (ignore the reply; it should close the connection, and that is all we need now) } } else @@ -1109,7 +1109,7 @@ void CFTPWorker::HandleEvent(CFTPWorkerEvent event, char* reply, int replySize, reportWorkerChange = TRUE; if (SocketClosed) - ConnectAttemptNumber = 0; // give the awakened worker without a connection a chance for a new connect + ConnectAttemptNumber = 0; // give the awakened worker without a connection a chance to make a new connection } } break; @@ -1139,7 +1139,7 @@ void CFTPWorker::HandleEvent(CFTPWorkerEvent event, char* reply, int replySize, } else // normal activity { - if (event == fweReconTimeout || event == fweWorkerShouldResume) // proceed to another connection attempt + if (event == fweReconTimeout || event == fweWorkerShouldResume) // proceed to the next connection attempt { State = fwsConnecting; // no need to call Oper->OperationStatusMaybeChanged(); it does not change the operation state (it is not paused and will not be after this change) SubState = fwssNone; @@ -1158,8 +1158,8 @@ void CFTPWorker::HandleEvent(CFTPWorkerEvent event, char* reply, int replySize, { ReturnCurItemToQueue(); // return the item to the queue HANDLES(LeaveCriticalSection(&WorkerCritSect)); - // since we are already inside CSocketsThread::CritSect, this call - // is also possible from CSocket::SocketCritSect (no risk of deadlock) + // since we are already in CSocketsThread::CritSect, this call + // is also allowed from CSocket::SocketCritSect (no deadlock risk) Oper->PostNewWorkAvailable(TRUE); // inform any first sleeping worker that new work is available HANDLES(EnterCriticalSection(&WorkerCritSect)); } @@ -1216,7 +1216,7 @@ void CFTPWorker::HandleEvent(CFTPWorkerEvent event, char* reply, int replySize, { DWORD lastIdle, lastIdle2; BOOL isNotBusy = SalamanderGeneral->SalamanderIsNotBusy(&lastIdle); - if (isNotBusy || GetTickCount() - lastIdle < 2000) // high chance that Salamander reaches the "idle" state (the connection can be returned to the panel) + if (isNotBusy || GetTickCount() - lastIdle < 2000) // there is a high chance that Salamander will reach the "idle" state (the connection can then be returned to the panel) { HANDLES(LeaveCriticalSection(&WorkerCritSect)); @@ -1230,7 +1230,7 @@ void CFTPWorker::HandleEvent(CFTPWorkerEvent event, char* reply, int replySize, DWORD startTime = GetTickCount(); while (1) { - if (isNotBusy || startTime - lastIdle < 500 || // already idle or was idle half a second ago (it is very unlikely that e.g. a dialog is open -> the idle state should return soon) + if (isNotBusy || startTime - lastIdle < 500 || // already idle or was idle less than half a second ago (so it is very unlikely that, for example, a dialog is open, and the idle state should return soon) SalamanderGeneral->SalamanderIsNotBusy(&lastIdle2) || lastIdle2 != lastIdle) // strong chance the connection handover happens immediately (otherwise we prefer to close it via "QUIT") { if (ReturningConnections.Add(ctrlUID, this)) @@ -1268,7 +1268,7 @@ void CFTPWorker::HandleEvent(CFTPWorkerEvent event, char* reply, int replySize, PrepareFTPCommand(buf, 200 + FTP_MAX_PATH, errBuf, 50 + FTP_MAX_PATH, ftpcmdQuit, &cmdLen); // cannot report an error sendCmd = TRUE; } - else // the connection will be handed over; simulate closing the worker's socket (to end waiting for socket closure when stopping the worker) + else // the connection will be handed over; simulate closing the worker's socket (to stop waiting for socket closure when stopping the worker) { SocketClosed = TRUE; ErrorDescr[0] = 0; // this is not an error (and it should no longer be displayed anywhere) @@ -1305,9 +1305,9 @@ void CFTPWorker::HandleEvent(CFTPWorkerEvent event, char* reply, int replySize, } else { - // the socket most likely closed (FD_CLOSE will arrive eventually); if another error occurred, - // close the socket hard via CloseSocket() after 100 ms - wait to see which of the two - // variants happens (while trying to capture an error message and log it) + // the socket was most likely closed (FD_CLOSE will arrive eventually); if another error occurred, + // the socket will be forcibly closed via CloseSocket() after 100 ms - wait to see which of these two + // cases applies (while also trying to capture an error message and write it to the log) HANDLES(EnterCriticalSection(&WorkerCritSect)); CommandState = fwcsWaitForCmdError; CommandTransfersData = FALSE; @@ -1315,8 +1315,8 @@ void CFTPWorker::HandleEvent(CFTPWorkerEvent event, char* reply, int replySize, // ReadFTPErrorReplies(); // cannot be used (calls SkipFTPReply, which skips the reply processed in this method and causes an error after returning); if the socket has long been closed, read its errors right now (no socket events will occur; nothing would be read) HANDLES(LeaveCriticalSection(&WorkerCritSect)); - // since we are already inside CSocketsThread::CritSect, this call - // is also possible from CSocket::SocketCritSect (no risk of deadlock) + // since we are already in CSocketsThread::CritSect, this call + // is also allowed from CSocket::SocketCritSect (no deadlock risk) SocketsThread->AddTimer(Msg, UID, GetTickCount() + 100, // give 0.1 seconds to possibly receive bytes from the socket (it may re-post FD_CLOSE, etc.) WORKER_CMDERRORTIMERID, NULL); // ignore errors; at worst the user will press Stop } From 64642e6affaf43de531e22caea6284a05fe55dcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 9 Apr 2026 20:22:49 +0200 Subject: [PATCH 019/710] [tanslation] Fix src/plugins/ftp/operats6.cpp comments (#390) --- src/plugins/ftp/operats6.cpp | 100 +++++++++++++++++------------------ 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/src/plugins/ftp/operats6.cpp b/src/plugins/ftp/operats6.cpp index 7bab4447e..2ecab0980 100644 --- a/src/plugins/ftp/operats6.cpp +++ b/src/plugins/ftp/operats6.cpp @@ -17,7 +17,7 @@ void CFTPWorker::HandleEventInPreparingState(CFTPWorkerEvent event, BOOL& sendQu if (SubState != fwssPrepQuitSent && SubState != fwssPrepWaitForDiskAfterQuitSent && !SocketClosed) { SubState = (SubState == fwssPrepWaitForDisk ? fwssPrepWaitForDiskAfterQuitSent : fwssPrepQuitSent); // so that we do not send "QUIT" more than once - sendQuitCmd = TRUE; // we are supposed to finish and the connection is open -> send the server the "QUIT" command (we ignore the reply, it should lead to closing the connection and nothing else matters now) + sendQuitCmd = TRUE; // we should terminate and the connection is open -> send the server the "QUIT" command (ignore the reply; it should close the connection, and nothing else matters now) } } else // normal activity @@ -32,7 +32,7 @@ void CFTPWorker::HandleEventInPreparingState(CFTPWorkerEvent event, BOOL& sendQu { case fqitCopyResolveLink: // copy: detect whether it is a link to a file or directory (object of class CFTPQueueItemCopyOrMove) case fqitMoveResolveLink: // move: detect whether it is a link to a file or directory (object of class CFTPQueueItemCopyOrMove) - break; // nothing to check + break; // nothing to verify case fqitCopyExploreDir: // explore a directory or a link to a directory for copying (object of class CFTPQueueItemCopyMoveExplore) case fqitMoveExploreDir: // explore a directory for moving (deletes the directory after completion) (object of class CFTPQueueItemCopyMoveExplore) @@ -51,7 +51,7 @@ void CFTPWorker::HandleEventInPreparingState(CFTPWorkerEvent event, BOOL& sendQu ((CFTPQueueItemCopyMoveExplore*)CurItem)->TgtPath, ((CFTPQueueItemCopyMoveExplore*)CurItem)->TgtName, CurItem->ForceAction, FALSE, NULL, NULL, NULL, 0, NULL); - if (CurItem->ForceAction != fqiaNone) // the forced action stops being valid here + if (CurItem->ForceAction != fqiaNone) // the forced action no longer applies here Queue->UpdateForceAction(CurItem, fqiaNone); if (FTPDiskThread->AddWork(&DiskWork)) { @@ -121,7 +121,7 @@ void CFTPWorker::HandleEventInPreparingState(CFTPWorkerEvent event, BOOL& sendQu switch (Oper->GetUploadCannotCreateDir()) { case CANNOTCREATENAME_AUTORENAME: - break; // autorename (when it happens) must deal even with a bad name + break; // autorename must also handle an invalid name when it gets to it case CANNOTCREATENAME_SKIP: { @@ -145,10 +145,10 @@ void CFTPWorker::HandleEventInPreparingState(CFTPWorkerEvent event, BOOL& sendQu } case fqitDeleteExploreDir: // explore directories for delete (note: links to directories are deleted as a whole, the operation's purpose is fulfilled and nothing "extra" is removed) (object of class CFTPQueueItemDelExplore) - case fqitDeleteLink: // delete for a link (object of class CFTPQueueItemDel) - case fqitDeleteFile: // delete for a file (object of class CFTPQueueItemDel) + case fqitDeleteLink: // delete a link (object of class CFTPQueueItemDel) + case fqitDeleteFile: // delete a file (object of class CFTPQueueItemDel) { - if (CurItem->Type == fqitDeleteExploreDir && ((CFTPQueueItemDelExplore*)CurItem)->IsHiddenDir || // if the directory/file/link is hidden, check what the user wants to do with it + if (CurItem->Type == fqitDeleteExploreDir && ((CFTPQueueItemDelExplore*)CurItem)->IsHiddenDir || // if the directory, file, or link is hidden, check what the user wants to do with it (CurItem->Type == fqitDeleteLink || CurItem->Type == fqitDeleteFile) && ((CFTPQueueItemDel*)CurItem)->IsHiddenFile) { @@ -208,7 +208,7 @@ void CFTPWorker::HandleEventInPreparingState(CFTPWorkerEvent event, BOOL& sendQu } } - case fqitDeleteDir: // delete for a directory (object of class CFTPQueueItemDir) + case fqitDeleteDir: // delete a directory (object of class CFTPQueueItemDir) case fqitChAttrsExploreDir: // explore directories for attribute changes (also adds an item for changing the directory attributes) (object of class CFTPQueueItemChAttrExplore) case fqitChAttrsResolveLink: // attribute change: determine whether it is a link to a directory (object of class CFTPQueueItem) case fqitChAttrsExploreDirLink: // explore a link to a directory for attribute changes (object of class CFTPQueueItem) @@ -242,7 +242,7 @@ void CFTPWorker::HandleEventInPreparingState(CFTPWorkerEvent event, BOOL& sendQu CurItem->ForceAction, strcmp(CurItem->Name, ((CFTPQueueItemCopyOrMove*)CurItem)->TgtName) != 0, NULL, NULL, NULL, 0, NULL); - if (CurItem->ForceAction != fqiaNone) // the forced action stops being valid here + if (CurItem->ForceAction != fqiaNone) // the forced action no longer applies here Queue->UpdateForceAction(CurItem, fqiaNone); if (FTPDiskThread->AddWork(&DiskWork)) { @@ -328,7 +328,7 @@ void CFTPWorker::HandleEventInPreparingState(CFTPWorkerEvent event, BOOL& sendQu switch (Oper->GetUploadCannotCreateFile()) { case CANNOTCREATENAME_AUTORENAME: - break; // autorename (when it happens) must deal even with a bad name + break; // autorename must handle even an invalid name case CANNOTCREATENAME_SKIP: { @@ -484,7 +484,7 @@ void CFTPWorker::HandleEventInPreparingState(CFTPWorkerEvent event, BOOL& sendQu case fqitChAttrsFile: // change file attributes (note: attributes cannot be changed on links) (object of class CFTPQueueItemChAttr) case fqitChAttrsDir: // change directory attributes (object of class CFTPQueueItemChAttrDir) { - if (CurItem->Type == fqitChAttrsFile && ((CFTPQueueItemChAttr*)CurItem)->AttrErr || // respond to the error "an unknown attribute should be preserved, which we cannot do" + if (CurItem->Type == fqitChAttrsFile && ((CFTPQueueItemChAttr*)CurItem)->AttrErr || // handle the error "an unknown attribute should be preserved, which we cannot do" CurItem->Type == fqitChAttrsDir && ((CFTPQueueItemChAttrDir*)CurItem)->AttrErr) { switch (Oper->GetUnknownAttrs()) @@ -533,7 +533,7 @@ void CFTPWorker::HandleEventInPreparingState(CFTPWorkerEvent event, BOOL& sendQu if (!wait) { - if (fail) // the item cannot be performed, it already has an error set, go find another item + if (fail) // the item cannot be processed; an error is already set, so find another item { CurItem = NULL; State = fwsLookingForWork; // no need to call Oper->OperationStatusMaybeChanged(), the operation state does not change (it is not paused and will not be after this change) @@ -577,7 +577,7 @@ void CFTPWorker::HandleEventInConnectingState(CFTPWorkerEvent event, BOOL& sendQ { run = FALSE; // when changed to TRUE, the loop runs again immediately BOOL closeSocket = FALSE; // TRUE = the worker's socket should be closed - if (ShouldStop) // we should terminate the worker (everything inside the loop due to 'closeSocket') + if (ShouldStop) // terminate the worker (everything is inside the loop because of 'closeSocket') { switch (SubState) { @@ -599,8 +599,8 @@ void CFTPWorker::HandleEventInConnectingState(CFTPWorkerEvent event, BOOL& sendQ case fwssConWaitForConRes: // close the connection and delete the WORKER_CONTIMEOUTTIMID timer { - // because we are already inside CSocketsThread::CritSect, this call is also possible - // from within CSocket::SocketCritSect and CFTPWorker::WorkerCritSect (no risk of dead-lock) + // since we are already in CSocketsThread::CritSect, this call is also possible + // from CSocket::SocketCritSect and CFTPWorker::WorkerCritSect (no deadlock risk) SocketsThread->DeleteTimer(UID, WORKER_CONTIMEOUTTIMID); closeSocket = TRUE; break; @@ -611,21 +611,21 @@ void CFTPWorker::HandleEventInConnectingState(CFTPWorkerEvent event, BOOL& sendQ case fwssConWaitForInitCmdRes: // close the connection and delete the WORKER_TIMEOUTTIMERID timer (it might no longer exist, but that does not matter) case fwssConWaitForSystRes: // close the connection and delete the WORKER_TIMEOUTTIMERID timer (it might no longer exist, but that does not matter) { - // because we are already inside CSocketsThread::CritSect, this call is also possible - // from within CSocket::SocketCritSect and CFTPWorker::WorkerCritSect (no risk of dead-lock) + // since we are already in CSocketsThread::CritSect, this call + // is allowed even from CSocket::SocketCritSect and CFTPWorker::WorkerCritSect (no deadlock risk) SocketsThread->DeleteTimer(UID, WORKER_TIMEOUTTIMERID); closeSocket = TRUE; break; } } } - else // normal activity + else // normal operation { switch (SubState) { case fwssNone: // determine whether we need to obtain the IP address { - if (ConnectAttemptNumber == 0) // for this worker it is the first attempt to establish a connection + if (ConnectAttemptNumber == 0) // this is the first connection attempt for this worker { ConnectAttemptNumber = 1; } @@ -643,7 +643,7 @@ void CFTPWorker::HandleEventInConnectingState(CFTPWorkerEvent event, BOOL& sendQ SubState = fwssNone; postActivate = TRUE; // post an activation for the next worker state reportWorkerChange = TRUE; - break; // end of executing the fwsConnecting state + break; // end of the fwsConnecting state } else ConnectAttemptNumber++; @@ -662,8 +662,8 @@ void CFTPWorker::HandleEventInConnectingState(CFTPWorkerEvent event, BOOL& sendQ } else // we only have a host name { - // because we are already inside CSocketsThread::CritSect, this call is also possible - // from within CSocket::SocketCritSect and CFTPWorker::WorkerCritSect (no risk of dead-lock) + // since we are already in CSocketsThread::CritSect, this call + // is allowed even from CSocket::SocketCritSect and CFTPWorker::WorkerCritSect (no deadlock risk) BOOL getHostByAddressRes = GetHostByAddress(host, ++IPRequestUID); RefreshCopiesOfUIDAndMsg(); // refresh the UID+Msg copies (they changed) if (!getHostByAddressRes) @@ -759,8 +759,8 @@ void CFTPWorker::HandleEventInConnectingState(CFTPWorkerEvent event, BOOL& sendQ ResetBuffersAndEvents(); // clear the buffers (discard old data) and initialize variables related to the connection DWORD error; - // because we are already inside CSocketsThread::CritSect, this call is also possible - // from within CSocket::SocketCritSect and CFTPWorker::WorkerCritSect (no risk of dead-lock) + // since we are already in CSocketsThread::CritSect, this call + // is allowed even from CSocket::SocketCritSect and CFTPWorker::WorkerCritSect (no deadlock risk) BOOL conRes = ConnectWithProxy(serverIP, port, proxyType, &error, host, hostPort, proxyUser, proxyPassword, hostIP); RefreshCopiesOfUIDAndMsg(); // refresh the UID+Msg copies (they changed) @@ -803,8 +803,8 @@ void CFTPWorker::HandleEventInConnectingState(CFTPWorkerEvent event, BOOL& sendQ // from within CSocket::SocketCritSect and CFTPWorker::WorkerCritSect (no risk of dead-lock) SocketsThread->DeleteTimer(UID, WORKER_CONTIMEOUTTIMID); - // set the worker state so it starts waiting for a command reply (even if we did not - // send any command, we wait for the server response) - set the timeout for receiving a command reply + // set the worker state to wait for a command reply (even though we did not + // send any command, we are waiting for the server response) and set the timeout for receiving it CommandState = fwcsWaitForLoginPrompt; int serverTimeout = Config.GetServerRepliesTimeout() * 1000; if (serverTimeout < 1000) @@ -815,7 +815,7 @@ void CFTPWorker::HandleEventInConnectingState(CFTPWorkerEvent event, BOOL& sendQ WORKER_TIMEOUTTIMERID, NULL); // ignore the error, at worst the user hits Stop SubState = fwssConWaitForPrompt; - // run = TRUE; // pointless (no event has occurred yet) + // run = TRUE; // no point yet (no event has occurred yet) break; } @@ -832,8 +832,8 @@ void CFTPWorker::HandleEventInConnectingState(CFTPWorkerEvent event, BOOL& sendQ case fweConTimeout: { - // because we are already inside CSocket::SocketCritSect, this call is also possible - // from within CFTPWorker::WorkerCritSect (no risk of dead-lock) + // because we are already in CSocket::SocketCritSect, this call is also allowed + // from CFTPWorker::WorkerCritSect (no deadlock risk) if (!GetProxyTimeoutDescr(ErrorDescr, FTPWORKER_ERRDESCR_BUFSIZE)) lstrcpyn(ErrorDescr, LoadStr(IDS_OPENCONTIMEOUT), FTPWORKER_ERRDESCR_BUFSIZE); CorrectErrorDescr(); @@ -878,13 +878,13 @@ void CFTPWorker::HandleEventInConnectingState(CFTPWorkerEvent event, BOOL& sendQ SubState = fwssConReconnect; run = TRUE; } - else // unexpected response, ignore it + else // unexpected reply, ignore it { TRACE_E("Unexpected reply: " << CopyStr(errBuf, 50 + FTP_MAX_PATH, reply, replySize)); } } } - else // not an FTP server + else // not an FTP server error { _snprintf_s(ErrorDescr, _TRUNCATE, LoadStr(IDS_NOTFTPSERVERERROR), CopyStr(errBuf, 50 + FTP_MAX_PATH, reply, replySize)); @@ -922,7 +922,7 @@ void CFTPWorker::HandleEventInConnectingState(CFTPWorkerEvent event, BOOL& sendQ SubState = fwssConWaitForAUTHCmdRes; break; - case fwssConSendPBSZ: // After AUTH TLS, but only if encrypting also data + case fwssConSendPBSZ: // After AUTH TLS, but only if data is also encrypted strcpy(buf, "PBSZ 0\r\n"); cmdLen = (int)strlen(buf); strcpy(errBuf, buf); // For logging purposes @@ -958,7 +958,7 @@ void CFTPWorker::HandleEventInConnectingState(CFTPWorkerEvent event, BOOL& sendQ { if (buf[0] == 0) // end of the script { - if (ProxyScriptLastCmdReply == -1) // the script does not contain any command that would be sent to the server - e.g. commands were skipped because they contain optional variables + if (ProxyScriptLastCmdReply == -1) // the script does not contain any command to send to the server, e.g. because commands were skipped due to optional variables { lstrcpyn(ErrorDescr, LoadStr(IDS_INCOMPLETEPRXSCR2), FTPWORKER_ERRDESCR_BUFSIZE); CorrectErrorDescr(); @@ -970,7 +970,7 @@ void CFTPWorker::HandleEventInConnectingState(CFTPWorkerEvent event, BOOL& sendQ { Logs.LogMessage(LogUID, LoadStr(IDS_LOGMSGLOGINSUCCESS), -1, TRUE); NextInitCmd = 0; // send the first init-ftp command - SubState = Oper->GetCompressData() ? fwssConSendMODEZ : fwssConSendInitCmds; // we are logged in, now send the init-ftp commands + SubState = Oper->GetCompressData() ? fwssConSendMODEZ : fwssConSendInitCmds; // we are logged in, now send the initial FTP commands run = TRUE; } else // FTP_DIGIT_1(ProxyScriptLastCmdReply) == FTP_D1_PARTIALSUCCESS // e.g. 331 User name okay, need password @@ -982,7 +982,7 @@ void CFTPWorker::HandleEventInConnectingState(CFTPWorkerEvent event, BOOL& sendQ } } } - else // there is another command to send + else // another command remains to be sent { sendCmd = TRUE; SubState = fwssConWaitForScriptCmdRes; @@ -1040,7 +1040,7 @@ void CFTPWorker::HandleEventInConnectingState(CFTPWorkerEvent event, BOOL& sendQ HANDLES(EnterCriticalSection(&WorkerCritSect)); if (ret) { - if (unverifiedCert != NULL) // close the connection and retry only after the user learns about the untrusted certificate and accepts it or ensures it becomes trusted (in the Solve Error dialog) + if (unverifiedCert != NULL) // close the connection and retry only after the user is informed about the untrusted certificate and either accepts it or makes it trusted (in the Solve Error dialog) { if (UnverifiedCertificate != NULL) UnverifiedCertificate->Release(); @@ -1095,7 +1095,7 @@ void CFTPWorker::HandleEventInConnectingState(CFTPWorkerEvent event, BOOL& sendQ closeSocket = TRUE; // close the connection (no point in continuing) - if (retryLoginWithoutAsking) // try again + if (retryLoginWithoutAsking) // retry { SubState = fwssConReconnect; run = TRUE; @@ -1177,8 +1177,8 @@ void CFTPWorker::HandleEventInConnectingState(CFTPWorkerEvent event, BOOL& sendQ { BOOL retryLoginWithoutAsking; if (FTP_DIGIT_1(replyCode) == FTP_D1_TRANSIENTERROR) - { // convenient handling of the "too many users" error - no questions, immediately retry - // this may be a problem: this code is accompanied by a message that requires changing the user/password + { // convenient handling of the "too many users" error - retry immediately without prompting +// possible issue: this code may be followed by a message that requires changing the user/password retryLoginWithoutAsking = TRUE; } else @@ -1189,7 +1189,7 @@ void CFTPWorker::HandleEventInConnectingState(CFTPWorkerEvent event, BOOL& sendQ CorrectErrorDescr(); closeSocket = TRUE; // close the connection (no point in continuing) - if (retryLoginWithoutAsking) // try again + if (retryLoginWithoutAsking) // retry { SubState = fwssConReconnect; run = TRUE; @@ -1266,7 +1266,7 @@ void CFTPWorker::HandleEventInConnectingState(CFTPWorkerEvent event, BOOL& sendQ if (sendCmd) // sending another init-ftp command { SubState = fwssConWaitForInitCmdRes; - // run = TRUE; // pointless (no event has occurred yet) + // run = TRUE; // no point yet (no event has occurred yet) } else // all init-ftp commands have been sent (or none exist) { @@ -1303,7 +1303,7 @@ void CFTPWorker::HandleEventInConnectingState(CFTPWorkerEvent event, BOOL& sendQ PrepareFTPCommand(buf, 200 + FTP_MAX_PATH, errBuf, 50 + FTP_MAX_PATH, ftpcmdSystem, &cmdLen); // cannot report an error sendCmd = TRUE; SubState = fwssConWaitForSystRes; - // run = TRUE; // pointless (no event has occurred yet) + // run = TRUE; // no point yet (no event has occurred yet) break; } @@ -1362,20 +1362,20 @@ void CFTPWorker::HandleEventInConnectingState(CFTPWorkerEvent event, BOOL& sendQ // wait for a reconnect ConnectAttemptNumber++; - // because we are already inside CSocketsThread::CritSect, this call is also possible - // from within CSocket::SocketCritSect and CFTPWorker::WorkerCritSect (no risk of dead-lock) + // since we are already in CSocketsThread::CritSect, this call + // is allowed even from CSocket::SocketCritSect and CFTPWorker::WorkerCritSect (no deadlock risk) SocketsThread->DeleteTimer(UID, WORKER_RECONTIMEOUTTIMID); // start a timer for the next connect attempt int delayBetweenConRetries = Config.GetDelayBetweenConRetries() * 1000; - // because we are already inside CSocketsThread::CritSect, this call is also possible - // from within CSocket::SocketCritSect and CFTPWorker::WorkerCritSect (no risk of dead-lock) + // since we are already in CSocketsThread::CritSect, this call + // is allowed even from CSocket::SocketCritSect and CFTPWorker::WorkerCritSect (no deadlock risk) SocketsThread->AddTimer(Msg, UID, GetTickCount() + delayBetweenConRetries, WORKER_RECONTIMEOUTTIMID, NULL); // ignore the error, at worst the user hits Stop State = fwsWaitingForReconnect; // NOTE: assumes ErrorDescr is set; no need to call Oper->OperationStatusMaybeChanged(), the operation state does not change (it is not paused and will not be after this change) SubState = fwssNone; - // postActivate = TRUE; // no reason, waiting for the timeout + // postActivate = TRUE; // no reason to do this, waiting for the timeout reportWorkerChange = TRUE; } } @@ -1387,8 +1387,8 @@ void CFTPWorker::HandleEventInConnectingState(CFTPWorkerEvent event, BOOL& sendQ { HANDLES(LeaveCriticalSection(&WorkerCritSect)); - // because we are already inside CSocketsThread::CritSect, this call is also possible - // from within CSocket::SocketCritSect (no risk of dead-lock) + // because we are already in CSocketsThread::CritSect, this call is also allowed + // from CSocket::SocketCritSect (no deadlock risk) ForceClose(); HANDLES(EnterCriticalSection(&WorkerCritSect)); @@ -1472,7 +1472,7 @@ BOOL CFTPWorker::ParseListingToFTPQueue(TIndirectArray* ftpQueueI { CFTPQueueItemCopyMoveExplore* cmItem = (CFTPQueueItemCopyMoveExplore*)CurItem; lstrcpyn(targetPath, cmItem->TgtPath, MAX_PATH); - SalamanderGeneral->SalPathAppend(targetPath, cmItem->TgtName, MAX_PATH); // must succeed, the directory already exists on disk and its full name is at most PATH_MAX_PATH-1 characters + SalamanderGeneral->SalPathAppend(targetPath, cmItem->TgtName, MAX_PATH); // must succeed; the directory already exists on disk and its full name is at most MAX_PATH-1 characters } else targetPath[0] = 0; From 5cf3529d1dfabe55df046dd605831bd75f803b73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 9 Apr 2026 20:28:21 +0200 Subject: [PATCH 020/710] [tanslation] Fix src/plugins/ftp/operatsb.cpp comments (#391) --- src/plugins/ftp/operatsb.cpp | 156 +++++++++++++++++------------------ 1 file changed, 78 insertions(+), 78 deletions(-) diff --git a/src/plugins/ftp/operatsb.cpp b/src/plugins/ftp/operatsb.cpp index 062ad6527..a7e61b91f 100644 --- a/src/plugins/ftp/operatsb.cpp +++ b/src/plugins/ftp/operatsb.cpp @@ -82,12 +82,12 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui { HANDLES(LeaveCriticalSection(&WorkerCritSect)); char* flushBuffer; - // because we are already inside CSocketsThread::CritSect, this call is also possible - // from inside CSocket::SocketCritSect (no deadlock risk) + // since we are already in CSocketsThread::CritSect, this call + // is also possible from CSocket::SocketCritSect (no deadlock risk) BOOL haveBufferForData = WorkerUploadDataCon->GiveBufferForData(&flushBuffer); HANDLES(EnterCriticalSection(&WorkerCritSect)); - if (haveBufferForData) // we have 'flushBuffer'; it must be handed over to the disk thread, where it will be filled with file data (if there is an error we release it) + if (haveBufferForData) // we have 'flushBuffer'; it must be passed to the disk thread, where it will be filled with file data (if an error occurs, we release it) { if (DiskWorkIsUsed) TRACE_E("Unexpected situation in CFTPWorker::HandleEventInWorkingState5(): DiskWorkIsUsed may not be TRUE here!"); @@ -108,7 +108,7 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui HANDLES(LeaveCriticalSection(&WorkerCritSect)); // because we are already inside CSocketsThread::CritSect, this call is also possible // from inside CSocket::SocketCritSect (no deadlock risk) - if (WorkerUploadDataCon->IsConnected()) // close the data connection; the system will attempt a "graceful" + if (WorkerUploadDataCon->IsConnected()) // close the "data connection"; the system will attempt a "graceful" shutdown WorkerUploadDataCon->CloseSocketEx(NULL); // shutdown (we do not learn the result) WorkerUploadDataCon->FreeBufferedData(); DeleteSocket(WorkerUploadDataCon); @@ -140,8 +140,8 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui HANDLES(LeaveCriticalSection(&WorkerCritSect)); // because we are already inside CSocketsThread::CritSect, this call is also possible // from inside CSocket::SocketCritSect (no deadlock risk) - if (WorkerUploadDataCon->IsConnected()) // close the data connection; the system will attempt a "graceful" - WorkerUploadDataCon->CloseSocketEx(NULL); // shutdown (we do not learn the result) + if (WorkerUploadDataCon->IsConnected()) // close the data connection; the system will attempt a "graceful" shutdown + WorkerUploadDataCon->CloseSocketEx(NULL); // shutdown (result unavailable) WorkerUploadDataCon->FreeBufferedData(); DeleteSocket(WorkerUploadDataCon); WorkerUploadDataCon = NULL; @@ -152,7 +152,7 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui } else { - if (WorkerUploadDataCon != NULL) // if the data connection exists, pass the buffer into it for writing into the data connection + if (WorkerUploadDataCon != NULL) // if the data connection exists, pass it the buffer for writing { HANDLES(LeaveCriticalSection(&WorkerCritSect)); // because we are already inside CSocketsThread::CritSect, this call is also possible @@ -167,7 +167,7 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui } DiskWork.FlushDataBuffer = NULL; - // take over the new offset in the file (we cannot simply add it because text files convert all LF to CRLF) + // use the new file offset (we cannot just add it because text files convert all LF to CRLF) OpenedInFileCurOffset = DiskWork.WriteOrReadFromOffset; if (OpenedInFileCurOffset > OpenedInFileSize) OpenedInFileSize = OpenedInFileCurOffset; @@ -188,7 +188,7 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui HANDLES(LeaveCriticalSection(&WorkerCritSect)); // because we are already inside CSocketsThread::CritSect, this call is also possible // from inside CSocket::SocketCritSect (no deadlock risk) - if (WorkerUploadDataCon->IsConnected()) // close the data connection; the system will attempt a "graceful" + if (WorkerUploadDataCon->IsConnected()) // close the "data connection"; the system will attempt a "graceful" shutdown WorkerUploadDataCon->CloseSocketEx(NULL); // shutdown (we do not learn the result) WorkerUploadDataCon->FreeBufferedData(); DeleteSocket(WorkerUploadDataCon); @@ -229,7 +229,7 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui ¬Accessible, &getListing, curItem->TgtName, &existingItem, NULL)) { - if (listingInProgress) // listing is currently taking place or is about to happen + if (listingInProgress) // the listing is currently in progress or is about to start { if (getListing) // we are to obtain the listing and then notify any other waiting workers { @@ -238,7 +238,7 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui } else { - SubState = fwssWorkUploadWaitForListing; // we should wait until another worker finishes listing + SubState = fwssWorkUploadWaitForListing; // wait until another worker finishes the listing reportWorkerChange = TRUE; // the worker prints the fwssWorkUploadWaitForListing state to the window, so a redraw is needed } } @@ -252,7 +252,7 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui else // the listing is available; check for a possible file name collision { nextLoop = TRUE; - if (CurItem->ForceAction == fqiaUploadContinueAutorename) // continuing auto-rename (try another name + another STOR) + if (CurItem->ForceAction == fqiaUploadContinueAutorename) // continue auto-rename (try another name + another STOR) { UploadType = utAutorename; if (curItem->RenamedName != NULL) @@ -267,17 +267,17 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui else { BOOL nameValid = FTPMayBeValidNameComponent(curItem->TgtName, curItem->TgtPath, FALSE, pathType); - if (existingItem == NULL && nameValid) // no collision and a valid name -> attempt to create the directory + if (existingItem == NULL && nameValid) // no collision and a valid name -> attempt to create the file SubState = fwssWorkUploadNewFile; else - { // if existingItem == NULL, then (!nameValid==TRUE), so tests for existingItem != NULL are unnecessary + { // if existingItem == NULL, then !nameValid is TRUE, so checks for existingItem != NULL are unnecessary if (!nameValid || existingItem->ItemType == ulitDirectory) // invalid name or collision with a directory -> "file cannot be created" SubState = !nameValid ? fwssWorkUploadCantCreateFileInvName : fwssWorkUploadCantCreateFileDirEx; else { if (existingItem->ItemType == ulitFile) // collision with a file -> "file already exists" SubState = fwssWorkUploadFileExists; - else // (existingItem->ItemType == ulitLink): collision with a link -> determine what the link is (file/directory) + else // (existingItem->ItemType == ulitLink): collision with a link -> determine whether the link is a file or directory SubState = fwssWorkUploadResolveLink; } } @@ -307,7 +307,7 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui handleShouldStop = TRUE; // check whether the worker should stop else { - if (event == fweTgtPathListingFinished) // the designated worker has already finished, so try to use the new listing + if (event == fweTgtPathListingFinished) // the designated worker has finished its work, so try to use the new listing { SubState = fwssWorkStartWork; reportWorkerChange = TRUE; // the worker prints the fwssWorkUploadWaitForListing state to the window, so a redraw is needed @@ -333,7 +333,7 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui HaveWorkingPath = FALSE; // changing the current working path on the server } - else // path syntax error or the path would become too long + else // path syntax error or the resulting path would be too long { // error on the item; record this state into it Queue->UpdateItemState(CurItem, sqisFailed, ITEMPR_INVALIDPATHTOLINK, NO_ERROR, NULL, Oper); @@ -342,7 +342,7 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui break; } - case fwssWorkUploadResLnkWaitForCWDRes: // upload copy/move file: waiting for the result of "CWD" (changing into the examined link - if it succeeds, the link points to a directory) + case fwssWorkUploadResLnkWaitForCWDRes: // upload copy/move file: waiting for the result of "CWD" (changing to the link being examined - if it succeeds, the link points to a directory) { switch (event) { @@ -386,7 +386,7 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui case fwssWorkUploadCantCreateFileInvName: // upload copy/move file: handling the "target file cannot be created" error (invalid name) case fwssWorkUploadCantCreateFileDirEx: // upload copy/move file: handling the "target file cannot be created" error (name already used for a directory or a link to a directory) { - if (CurItem->ForceAction == fqiaUseAutorename) // forced auto-rename + if (CurItem->ForceAction == fqiaUseAutorename) // forced autorename { SubState = fwssWorkUploadAutorenameFile; nextLoop = TRUE; @@ -693,8 +693,8 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui { if (FTP_DIGIT_1(replyCode) == FTP_D1_SUCCESS) // the target path is set; start generating target directory names { // we have successfully changed the working path; since this path was once returned - // by the server in response to PWD, we assume PWD would return it again now, and therefore - // we will not send it (an optimization hopefully with very low risk) + // returned by the server in response to PWD; we assume PWD would return this path again now, and therefore + // we will not send it (an optimization with hopefully very low risk) HaveWorkingPath = TRUE; lstrcpyn(WorkingPath, curItem->TgtPath, FTP_MAX_PATH); @@ -774,10 +774,10 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui handleShouldStop = TRUE; // check whether the worker should stop else { - if (FTP_DIGIT_1(replyCode) == FTP_D1_SUCCESS) // success is returned (should be 200) + if (FTP_DIGIT_1(replyCode) == FTP_D1_SUCCESS) // a success reply was received (should be 200) CurrentTransferMode = (curItem->AsciiTransferMode ? ctrmASCII : ctrmBinary); // the transfer mode was changed else - CurrentTransferMode = ctrmUnknown; // unknown error; it may not matter, but we will not cache the transfer mode + CurrentTransferMode = ctrmUnknown; // unknown error; it may not matter, but we will not cache the data transfer mode nextLoop = TRUE; switch (UploadType) @@ -833,7 +833,7 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui // case fweCmdInfoReceived: // "1xx" replies are ignored (they are only written into the log) case fweCmdReplyReceived: { - if (FTP_DIGIT_1(replyCode) == FTP_D1_SUCCESS) // success is returned (should be 213) + if (FTP_DIGIT_1(replyCode) == FTP_D1_SUCCESS) // success response returned (should be 213) { if (ShouldStop) handleShouldStop = TRUE; // check whether the worker should stop @@ -901,7 +901,7 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui else { int resumeMinFileSize = Config.GetResumeMinFileSize(); - if ((unsigned __int64)resumeMinFileSize <= size) // resume makes sense (the portion of the file is larger than the minimum for resume) + if ((unsigned __int64)resumeMinFileSize <= size) // resume makes sense (the partial file is larger than the minimum size for resume) { ResumingFileOnServer = TRUE; OpenedInFileCurOffset.SetUI64(size); @@ -953,7 +953,7 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui case fwssWorkUploadGetFileSizeFromListing: // file upload: resume - the SIZE command failed (or is not implemented), determine the file size from the listing { - if (existingItem == NULL) // if it did not arrive here directly, retrieve target file information from the listing again + if (existingItem == NULL) // if it was not obtained directly, retrieve the target file information from the listing again { Oper->GetUserHostPort(userBuf, hostBuf, &portBuf); CFTPServerPathType pathType = Oper->GetFTPServerPathType(curItem->TgtPath); @@ -963,7 +963,7 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui ¬Accessible, &getListing, curItem->TgtName, &existingItem, NULL)) { - if (listingInProgress) // listing is currently taking place or is about to happen + if (listingInProgress) // the listing is currently in progress or is about to start { if (getListing) // we are to obtain the listing and then notify any other waiting workers { @@ -973,7 +973,7 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui } else { - SubState = fwssWorkUploadWaitForListing; // we should wait until another worker finishes listing + SubState = fwssWorkUploadWaitForListing; // wait until another worker finishes the listing reportWorkerChange = TRUE; // the worker prints the fwssWorkUploadWaitForListing state to the window, so a redraw is needed } break; @@ -1157,7 +1157,7 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui } else { - Queue->UpdateItemState(CurItem, sqisWaiting, ITEMPR_OK, NO_ERROR, NULL, Oper); // at least this worker will go look for new work, so some worker will surely handle this item (no need to post "new work available") + Queue->UpdateItemState(CurItem, sqisWaiting, ITEMPR_OK, NO_ERROR, NULL, Oper); // at least this worker will look for new work, so some worker will handle this item (no need to post "new work available") lookForNewWork = TRUE; } break; @@ -1170,18 +1170,18 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui BOOL notAccessible, getListing, listingInProgress, nameExists; int index = 0; UploadAutorenamePhase = curItem->AutorenamePhase; - int usedUploadAutorenamePhase = UploadAutorenamePhase; // in case of a name collision - the phase in which we should try to generate another name + int usedUploadAutorenamePhase = UploadAutorenamePhase; // in case of a name collision - the phase in which we should try generating another name while (1) { FTPGenerateNewName(&UploadAutorenamePhase, UploadAutorenameNewName, &index, curItem->TgtName, pathType, FALSE, strcmp(curItem->TgtName, curItem->Name) != 0); - // we have a new name; verify whether it collides with a name from the target path listing + // we have a new name; verify that it does not collide with any name in the target path listing if (UploadListingCache.GetListing(userBuf, hostBuf, portBuf, curItem->TgtPath, pathType, Msg, UID, &listingInProgress, ¬Accessible, &getListing, UploadAutorenameNewName, NULL, &nameExists)) { - if (listingInProgress) // listing is currently taking place or is about to happen + if (listingInProgress) // the listing is currently in progress or is about to start { if (getListing) // we are to obtain the listing and then notify any other waiting workers { @@ -1191,20 +1191,20 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui } else { - SubState = fwssWorkUploadWaitForListing; // we should wait until another worker finishes listing + SubState = fwssWorkUploadWaitForListing; // wait until another worker finishes the listing reportWorkerChange = TRUE; // the worker prints the fwssWorkUploadWaitForListing state to the window, so a redraw is needed } break; } else // the listing is already cached or marked as "unobtainable" { - if (notAccessible) // the listing is cached, but only as "unobtainable" (very unlikely; the listing was "ready" a moment ago) + if (notAccessible) // the listing is cached, but only as "unobtainable" (very unlikely; it was "ready" a moment ago) { Queue->UpdateItemState(CurItem, sqisFailed, ITEMPR_UPLOADCANNOTLISTTGTPATH, 0, NULL, Oper); lookForNewWork = TRUE; break; } - else // the listing is available; check for a potential file name collision + else // the listing is available; check for a possible file name collision { if (LockedFileUID != 0) TRACE_E("Unexpected situation in CFTPWorker::HandleEventInWorkingState5(): LockedFileUID != 0!"); @@ -1251,11 +1251,11 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui if (FTPOpenedFiles.OpenFile(userBuf, hostBuf, portBuf, curItem->TgtPath, Oper->GetFTPServerPathType(curItem->TgtPath), curItem->TgtName, &LockedFileUID, ffatWrite)) - { // the file on the server is not open yet; we can work with it + { // the file on the server is not open yet; we can still work with it SubState = fwssWorkUploadDelForOverwrite; nextLoop = TRUE; } - else // another operation is already in progress on this file; let the user try again later + else // another operation is already in progress on this file; the user should try again later { // error on the item; record this state into it Queue->UpdateItemState(CurItem, sqisFailed, ITEMPR_TGTFILEINUSE, NO_ERROR, NULL, Oper); @@ -1264,7 +1264,7 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui break; } - case fwssWorkUploadDelForOverwrite: // file upload: if overwrite should delete first, perform it here + case fwssWorkUploadDelForOverwrite: // file upload: if this is an overwrite and delete should be done first, perform the delete here { if (UseDeleteForOverwrite && UploadType == utOverwriteFile) { // the file is already locked for writing; deletion is just an intermediate step, no need to call FTPOpenedFiles.OpenFile() @@ -1424,8 +1424,8 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui int logUID = LogUID; HANDLES(LeaveCriticalSection(&WorkerCritSect)); - // because we are already inside CSocketsThread::CritSect, these calls are also possible - // from inside CSocket::SocketCritSect (no deadlock risk) + // since we are already in CSocketsThread::CritSect, these calls + // are also possible from CSocket::SocketCritSect (no deadlock risk) if (WorkerUploadDataCon != NULL) { WorkerUploadDataCon->SetPassive(ip, port, logUID); @@ -1497,8 +1497,8 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui HANDLES(LeaveCriticalSection(&WorkerCritSect)); - // because we are already inside CSocketsThread::CritSect, these calls are also possible - // from inside CSocket::SocketCritSect (no deadlock risk) + // since we are already in CSocketsThread::CritSect, these calls + // are also possible from CSocket::SocketCritSect (no deadlock risk) GetLocalIP(&localIP, NULL); // should not even be able to return an error BOOL retOpenForListening = FALSE; BOOL listenError = TRUE; @@ -1526,12 +1526,12 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui int serverTimeout = Config.GetServerRepliesTimeout() * 1000; if (serverTimeout < 1000) serverTimeout = 1000; // at least one second - // because we are already in CSocketsThread::CritSect, this call is also - // possible from CSocket::SocketCritSect and CFTPWorker::WorkerCritSect (no deadlock risk) + // because we are already in CSocketsThread::CritSect, this call can also be made + // from CSocket::SocketCritSect and CFTPWorker::WorkerCritSect (no deadlock risk) SocketsThread->AddTimer(Msg, UID, GetTickCount() + serverTimeout, WORKER_LISTENTIMEOUTTIMID, NULL); // ignore the error; at worst the user will press Stop } - else // failed to open the "listen" socket to accept the data connection from + else // failed to open the "listen" socket to accept the data connection from the server { // the server (local operation, most likely never happens) or cannot open the connection to the proxy server if (WorkerUploadDataCon != NULL) { @@ -1550,7 +1550,7 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui Queue->UpdateItemState(CurItem, sqisFailed, ITEMPR_LISTENFAILURE, error, NULL, Oper); lookForNewWork = TRUE; } - else // unable to open the connection to the proxy server, perform a retry... + else // unable to open the connection to the proxy server, retry... { if (error != NO_ERROR) { @@ -1583,7 +1583,7 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui break; } - case fwssWorkUploadWaitForListen: // upload copy/move file: waiting for the "listen" port to open (opening the active data connection) - local or on the proxy server + case fwssWorkUploadWaitForListen: // upload file copy/move: waiting for the "listen" port to open (opening the active data connection), locally or on the proxy server { if (ShouldStop) { @@ -1596,7 +1596,7 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui HANDLES(LeaveCriticalSection(&WorkerCritSect)); // because we are already in CSocketsThread::CritSect, this call is also // possible from CSocket::SocketCritSect (no deadlock risk) - if (WorkerUploadDataCon->IsConnected()) // close the "data connection", the system will attempt a "graceful" + if (WorkerUploadDataCon->IsConnected()) // close the "data connection"; the system will attempt a graceful shutdown WorkerUploadDataCon->CloseSocketEx(NULL); // shutdown (we will not learn the result) DeleteSocket(WorkerUploadDataCon); WorkerUploadDataCon = NULL; @@ -1638,7 +1638,7 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui sendCmd = TRUE; SubState = fwssWorkUploadWaitForPORTRes; } - else // error when opening the "listen" port on the proxy server - perform a retry... + else // error opening the "listen" port on the proxy server - retry... { // close the data connection if (WorkerUploadDataCon != NULL) @@ -1646,7 +1646,7 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui HANDLES(LeaveCriticalSection(&WorkerCritSect)); // because we are already in CSocketsThread::CritSect, this call is also // possible from CSocket::SocketCritSect (no deadlock risk) - if (WorkerUploadDataCon->IsConnected()) // close the "data connection", the system will attempt a "graceful" + if (WorkerUploadDataCon->IsConnected()) // close the "data connection"; the system will attempt a graceful shutdown WorkerUploadDataCon->CloseSocketEx(NULL); // shutdown (we will not learn the result) DeleteSocket(WorkerUploadDataCon); WorkerUploadDataCon = NULL; @@ -1678,7 +1678,7 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui errBuf[0] = 0; // because we are already in CSocketsThread::CritSect, this call is also // possible from CSocket::SocketCritSect (no deadlock risk) - if (WorkerUploadDataCon->IsConnected()) // close the "data connection", the system will attempt a "graceful" + if (WorkerUploadDataCon->IsConnected()) // close the "data connection"; the system will attempt a graceful shutdown WorkerUploadDataCon->CloseSocketEx(NULL); // shutdown (we will not learn the result) DeleteSocket(WorkerUploadDataCon); WorkerUploadDataCon = NULL; @@ -1734,7 +1734,7 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui HANDLES(LeaveCriticalSection(&WorkerCritSect)); // because we are already in CSocketsThread::CritSect, this call is also // possible from CSocket::SocketCritSect (no deadlock risk) - if (WorkerUploadDataCon->IsConnected()) // close the "data connection", the system will attempt a "graceful" + if (WorkerUploadDataCon->IsConnected()) // close the "data connection"; the system will attempt a graceful shutdown WorkerUploadDataCon->CloseSocketEx(NULL); // shutdown (we will not learn the result) DeleteSocket(WorkerUploadDataCon); WorkerUploadDataCon = NULL; @@ -1760,7 +1760,7 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui HANDLES(LeaveCriticalSection(&WorkerCritSect)); // because we are already in CSocketsThread::CritSect, this call is also // possible from CSocket::SocketCritSect (no deadlock risk) - if (WorkerUploadDataCon->IsConnected()) // close the "data connection", the system will attempt a "graceful" + if (WorkerUploadDataCon->IsConnected()) // close the "data connection"; the system will attempt a "graceful" shutdown WorkerUploadDataCon->CloseSocketEx(NULL); // shutdown (we will not learn the result) DeleteSocket(WorkerUploadDataCon); WorkerUploadDataCon = NULL; @@ -1810,7 +1810,7 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui break; } - case fwssWorkUploadActivateDataCon: // upload copy/move file: activate the data connection (right after sending the STOR command) + case fwssWorkUploadActivateDataCon: // file upload during copy/move: activate the data connection (right after sending the STOR command) { if (!Oper->GetEncryptDataConnection() && (WorkerUploadDataCon != NULL)) { // FIXME: 2009.01.29: I believe ActivateConnection can be called later @@ -1827,7 +1827,7 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui break; } - case fwssWorkUploadWaitForSTORRes: // upload copy/move file: waiting for the "STOR/APPE" result (waiting for the upload to finish) + case fwssWorkUploadWaitForSTORRes: // upload copy/move of a file: waiting for the "STOR/APPE" result (waiting for the file upload to finish) { switch (event) { @@ -1885,7 +1885,7 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui errBuf[0] = 0; // because we are already in CSocketsThread::CritSect, this call is also // possible from CSocket::SocketCritSect (no deadlock risk) - if (WorkerUploadDataCon->IsConnected()) // close the "data connection", the system will attempt a "graceful" + if (WorkerUploadDataCon->IsConnected()) // close the "data connection"; the system will attempt a graceful shutdown WorkerUploadDataCon->CloseSocketEx(NULL); // shutdown (we will not learn the result) WorkerUploadDataCon->FreeBufferedData(); DeleteSocket(WorkerUploadDataCon); @@ -1898,8 +1898,8 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui BOOL canUseRenamedName = TRUE; BOOL canClearForceAction = TRUE; if (!ShouldStop && PrepareDataError == pderASCIIForBinaryFile) - { // when a binary file is detected in ASCII mode, ensure the target file is deleted - // the file is already locked for writing, deletion is only an intermediate step, no need to call FTPOpenedFiles.OpenFile() + { // when a binary file is detected in ASCII mode, delete the target file + // the file is already locked for writing; deletion is only an intermediate step, so FTPOpenedFiles.OpenFile() need not be called PrepareFTPCommand(buf, 200 + FTP_MAX_PATH, errBuf, 50 + FTP_MAX_PATH, ftpcmdDeleteFile, &cmdLen, UploadType == utAutorename ? curItem->RenamedName : curItem->TgtName); // cannot report an error @@ -1923,7 +1923,7 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui // close the source file on disk CloseOpenedInFile(); - // mark the file as already transferred (in case deleting the source file fails during Move we need to distinguish this situation) + // mark the file as already transferred (for a Move, we must distinguish this case if deleting the source file fails) Queue->UpdateTgtFileState(curItem, UPLOADTGTFILESTATE_TRANSFERRED); if (uploadRealSize != UPLOADSIZE_UNKNOWN && curItem->Size != uploadRealSize) @@ -1942,7 +1942,7 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui FTP_DIGIT_1(replyCode) == FTP_D1_ERROR)) { HANDLES(LeaveCriticalSection(&WorkerCritSect)); - if (IsConnected()) // "manually" close the control connection + if (IsConnected()) // close the control connection manually { // because we are already in CSocketsThread::CritSect, this call is also // possible from CSocket::SocketCritSect (no deadlock risk) @@ -1955,10 +1955,10 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui { if ((!ResumingFileOnServer || Oper->GetDataConWasOpenedForAppendCmd()) && // proftpd (Linux) repeatedly returns 45x (append disabled, enabled somewhere in the config), warftpd repeatedly returns 42x (some write error) -- in any case we cannot keep trying APPE endlessly (however if APPE opened the data connection, perform auto-retry because APPE works 99.9% of the time) FTP_DIGIT_1(replyCode) == FTP_D1_TRANSIENTERROR && - (FTP_DIGIT_2(replyCode) == FTP_D2_CONNECTION || // mainly "426 data connection closed, transfer aborted" (I cannot tell whether it was caused by the server admin or a connection failure, so priority goes to assuming a connection issue -> retry the upload) + (FTP_DIGIT_2(replyCode) == FTP_D2_CONNECTION || // mainly "426 data connection closed, transfer aborted" (it is not possible to tell whether this was caused by the server admin or by a connection failure, so it is treated as a connection problem first -> retry the upload) FTP_DIGIT_2(replyCode) == FTP_D2_FILESYSTEM) && // "450 Transfer aborted. Link to file server lost." dataSSLErrorOccured != SSLCONERR_DONOTRETRY || // take 426 and 450 only if they were not caused by: failed to encrypt the connection, which is a permanent problem - dataConNoDataTransTimeout || // connection interrupted by us due to the no-data-transfer timeout (happens during "50%" network outages, the data connection stays up but data transfer stalls, can remain open for 14000 seconds, this should address it) -> retry the upload attempt + dataConNoDataTransTimeout || // connection interrupted by us due to the no-data-transfer timeout (this happens during "50%" network outages: the data connection stays up, but data transfer stalls and can remain open for 14000 seconds; this should handle that) -> retry the upload attempt dataSSLErrorOccured == SSLCONERR_CANRETRY) // failed to encrypt the connection, but it is not a permanent problem { SubState = fwssWorkCopyDelayedAutoRetry; // use delayed auto-retry so all unexpected replies from the server can arrive @@ -1993,7 +1993,7 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui canUseRenamedName = FALSE; // keep TgtName as the original (forget RenamedName; another name will be generated by the next FTPGenerateNewName phase) Queue->UpdateItemState(CurItem, sqisWaiting, ITEMPR_OK, NO_ERROR, NULL, Oper); // at least this worker will look for new work, so some worker will take care of this item (no need to post "new work available") } - else // we no longer know what other name could be created, so report an error + else // we no longer know what other name can be generated, so report an error { CopyStr(errText, 200 + FTP_MAX_PATH, reply, replySize); Queue->UpdateItemState(CurItem, sqisFailed, ITEMPR_UPLOADFILEAUTORENFAILED, NO_ERROR, @@ -2063,7 +2063,7 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui } else { - if (ResumingFileOnServer && UploadType == utResumeOrOverwriteFile && // resume failed, try overwrite instead + if (ResumingFileOnServer && UploadType == utResumeOrOverwriteFile && // resume failed, try overwriting instead dataSSLErrorOccured == SSLCONERR_NOERROR) { Logs.LogMessage(LogUID, LoadStr(IDS_LOGMSGUPLRESUMEERR), -1, TRUE); @@ -2080,11 +2080,11 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui { errText[0] = 0; if (FTP_DIGIT_1(replyCode) != FTP_D1_SUCCESS) - { // if we have no description of the network error from the server, fall back to the system description + { // if we do not have a network error description from the server, use the system description CopyStr(errText, 200 + FTP_MAX_PATH, reply, replySize); } - if (errText[0] == 0 && errBuf[0] != 0) // try to use the error text from the proxy server + if (errText[0] == 0 && errBuf[0] != 0) // try to get the error text from the proxy server lstrcpyn(errText, errBuf, 200 + FTP_MAX_PATH); } @@ -2108,9 +2108,9 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui if (CurItem->ForceAction != fqiaNone && canClearForceAction) // the forced action no longer applies Queue->UpdateForceAction(CurItem, fqiaNone); - // autorename: record the new name in the item - even if STOR failed, it is still more accurate that the file - // was stored under the new name than under the original one - for example when overwriting an existing file this is obvious - // NOTE: no need to call Oper->ReportItemChange(CurItem->UID), because RenamedName is used + // autorename: record the new name in the item - even if STOR returns an error, it is still more accurate that the file + // was stored under the new name than under the original one - for example, when overwriting an existing file + // NOTE: there is no need to call Oper->ReportItemChange(CurItem->UID), because RenamedName is used // before TgtName (so the new name has already been displayed) if (uploadTypeIsAutorename && canUseRenamedName) Queue->ChangeTgtNameToRenamedName(curItem); @@ -2120,15 +2120,15 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui case fweCmdConClosed: // the connection closed/timed out (see ErrorDescr for details) -> try to restore it { if (UploadType == utAutorename) - Queue->ChangeTgtNameToRenamedName(curItem); // even if STOR failed, it is still more accurate that the file was stored under the new name than the original one - for example when overwriting an existing file this is obvious + Queue->ChangeTgtNameToRenamedName(curItem); // even if STOR failed, it is still more accurate to say that the file was stored under the new name than under the original name; for example, when overwriting an existing file, this is obvious // the result of the STOR command is unknown, invalidate the listing Oper->GetUserHostPort(userBuf, hostBuf, &portBuf); UploadListingCache.ReportFileUploaded(userBuf, hostBuf, portBuf, curItem->TgtPath, Oper->GetFTPServerPathType(curItem->TgtPath), curItem->TgtName, UPLOADSIZE_UNKNOWN, TRUE); - // except for the case when STOR reports the "cannot create target file name" error (which is when STOR reports - // some error + nothing was uploaded) we consider sending the STOR/APPE command to complete + // except when STOR reports the "cannot create target file name" error (that is, when STOR reports + // an error and nothing was uploaded), we consider sending the STOR/APPE command to complete // the forced actions: "overwrite", "resume", and "resume or overwrite" if (CurItem->ForceAction != fqiaNone) // the forced action no longer applies Queue->UpdateForceAction(CurItem, fqiaNone); @@ -2138,7 +2138,7 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui HANDLES(LeaveCriticalSection(&WorkerCritSect)); // because we are already in CSocketsThread::CritSect, this call is also // possible from CSocket::SocketCritSect (no deadlock risk) - if (WorkerUploadDataCon->IsConnected()) // close the "data connection", the system will attempt a "graceful" + if (WorkerUploadDataCon->IsConnected()) // close the "data connection"; the system will attempt a graceful shutdown WorkerUploadDataCon->CloseSocketEx(NULL); // shutdown (we will not learn the result) WorkerUploadDataCon->FreeBufferedData(); DeleteSocket(WorkerUploadDataCon); @@ -2227,7 +2227,7 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui lookForNewWork = TRUE; } } - else // Copy - nothing more to handle, done + else // Copy - nothing else to do, done { SubState = fwssWorkUploadCopyDone; nextLoop = TRUE; @@ -2271,7 +2271,7 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui break; } - case fwssWorkUploadCopyDone: // upload copy/move file: finished, move on to the next item + case fwssWorkUploadCopyDone: // upload copy/move: finished, move on to the next item { // the item was completed successfully, store this state in it Queue->UpdateItemState(CurItem, sqisDone, ITEMPR_OK, NO_ERROR, NULL, Oper); @@ -2297,11 +2297,11 @@ void CFTPWorker::HandleEventInWorkingState5(CFTPWorkerEvent event, BOOL& sendQui if (FTPDiskThread->CancelWork(&DiskWork, &workIsInProgress)) { if (workIsInProgress) - DiskWork.FlushDataBuffer = NULL; // work is in progress; we cannot free the buffer with read data, leave it to the disk-work thread (see the cancellation section) - we can write to DiskWork because after Cancel the disk thread must no longer access it (it might not even exist) + DiskWork.FlushDataBuffer = NULL; // work is in progress; we cannot free the buffer containing the read data, so leave it to the disk-work thread (see the cancellation section) - we can write to DiskWork because after Cancel the disk thread must no longer access it (it might not even exist) } // if we cancelled the work before it started, we must release the flush buffer, and - // if the work has already finished, release the flush buffer here because fweDiskWorkReadFinished - // it will be delivered elsewhere (where it will be ignored) + // if the work has already finished, release the flush buffer here because fweDiskWorkReadFinished + // will arrive elsewhere (where it will be ignored) if (DiskWork.FlushDataBuffer != NULL) { free(DiskWork.FlushDataBuffer); From 71e5ea6b5a31df28c219281fb6f07b51c325d5f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 9 Apr 2026 20:50:21 +0200 Subject: [PATCH 021/710] [tanslation] Fix src/plugins/ftp/ctrlcon1.cpp comments (#392) --- src/plugins/ftp/ctrlcon1.cpp | 128 +++++++++++++++++------------------ 1 file changed, 64 insertions(+), 64 deletions(-) diff --git a/src/plugins/ftp/ctrlcon1.cpp b/src/plugins/ftp/ctrlcon1.cpp index b215277b9..9c99b2205 100644 --- a/src/plugins/ftp/ctrlcon1.cpp +++ b/src/plugins/ftp/ctrlcon1.cpp @@ -118,9 +118,9 @@ CControlConnectionSocket::~CControlConnectionSocket() HANDLES(CloseHandle(NewEvent)); HANDLES(DeleteCriticalSection(&EventCritSect)); - // Logs cannot touch the "control connection" (nested critical sections are forbidden), - // this call synchronizes only the validity of the pointer to the "control connection" (not the object contents, - // therefore it can be at the very end of the destructor) + // Logs cannot access the "control connection" (nested critical sections are forbidden), + // this call synchronizes only the validity of the pointer to the "control connection" (not the object contents, + // so it can be at the very end of the destructor) if (LogUID != -1) Logs.ClosingConnection(LogUID); } @@ -227,7 +227,7 @@ void CControlConnectionSocket::WaitForEventOrESC(HWND parent, CControlConnection CALL_STACK_MESSAGE3("CControlConnectionSocket::WaitForEventOrESC(, , , , %d, , , %d)", milliseconds, waitForUserIfaceFinish); - const DWORD cycleTime = 200; // period of testing the ESC key press in ms (200 = 5 times per second) + const DWORD cycleTime = 200; // ESC key polling interval in ms (200 = 5 times per second) DWORD timeStart = GetTickCount(); DWORD restOfWaitTime = milliseconds; // remaining waiting time @@ -263,7 +263,7 @@ void CControlConnectionSocket::WaitForEventOrESC(HWND parent, CControlConnection DWORD waitRes = MsgWaitForMultipleObjects(1, &watchedEvent, FALSE, waitTime, QS_ALLINPUT); // first check for ESC press (so we do not ignore it for the user) - if (milliseconds != 0 && // if the timeout is zero, we are only pumping messages, ignore ESC + if (milliseconds != 0 && // if the timeout is zero, we are only pumping messages; do not handle ESC ((GetAsyncKeyState(VK_ESCAPE) & 0x8001) && GetForegroundWindow() == parent || // ESC key pressed waitWnd != NULL && waitWnd->GetWindowClosePressed() || // close button in the wait window userIface != NULL && userIface->GetWindowClosePressed())) // close button in the user interface @@ -314,7 +314,7 @@ void CControlConnectionSocket::WaitForEventOrESC(HWND parent, CControlConnection *event = ccsevTimeout; // no time remains *data1 = 0; *data2 = 0; - break; // report timeout + break; // report a timeout } } } @@ -351,7 +351,7 @@ void CControlConnectionSocket::SetConnectionParameters(const char* host, unsigne ProxyServer = NULL; else { - ProxyServer = Config.FTPProxyServerList.MakeCopyOfProxyServer(proxyServerUID, NULL); // ignore lack of memory (automatically "not used (direct connection)") + ProxyServer = Config.FTPProxyServerList.MakeCopyOfProxyServer(proxyServerUID, NULL); // ignore out-of-memory; it will automatically be "not used (direct connection)" if (ProxyServer != NULL) { if (ProxyServer->ProxyEncryptedPassword != NULL) @@ -415,8 +415,8 @@ enum CStartCtrlConStates // states of the automaton for CControlConnectionSocket // connect to the FTP server (retrieved IP is in 'auxServerIP') sccsConnect, - // retry the connection (based on Config.DelayBetweenConRetries + Config.ConnectRetries), - // if it should not retry anymore, it transitions to the state from 'noRetryState' + if 'fastRetry' is TRUE, it must not + // retry the connection (according to Config.DelayBetweenConRetries and Config.ConnectRetries), + // if it should no longer retry, it transitions to the state from 'noRetryState' + if 'fastRetry' is TRUE, it must not // wait before the next attempt sccsRetry, @@ -432,7 +432,7 @@ enum CStartCtrlConStates // states of the automaton for CControlConnectionSocket // retry the login (without waiting and losing the connection) - only transitions to sccsStartLoginScript - cannot be used with a proxy server!!! sccsRetryLogin, - // end of the method (successful or unsuccessful - according to 'ret' TRUE/FALSE) + // end of the method (successful or unsuccessful, depending on whether 'ret' is TRUE or FALSE) sccsDone }; @@ -562,7 +562,7 @@ BOOL CControlConnectionSocket::StartControlConnection(HWND parent, char* user, i if (serverTimeout < 1000) serverTimeout = 1000; // at least one second - // store the focus from 'parent' (if the focus is not from 'parent', store NULL) + // remember the focused window in 'parent' (store NULL if the focus is not within 'parent') HWND focusedWnd = GetFocus(); HWND hwnd = focusedWnd; while (hwnd != NULL && hwnd != parent) @@ -594,13 +594,13 @@ BOOL CControlConnectionSocket::StartControlConnection(HWND parent, char* user, i { const char* txt = GetProxyScriptText(proxyType, FALSE); if (txt[0] == 0) - txt = GetProxyScriptText(fpstNotUsed, FALSE); // undefined script = "not used (direct connection)" script - SOCKS 4/4A/5, HTTP 1.1 + txt = GetProxyScriptText(fpstNotUsed, FALSE); // no script defined = the "not used (direct connection)" script - SOCKS 4/4A/5, HTTP 1.1 lstrcpyn(proxyScriptText, txt, PROXYSCRIPT_MAX_SIZE); } DWORD auxServerIP = ServerIP; srvAddr.s_addr = auxServerIP; - ResetWorkingPathCache(); // after connecting to the server it is necessary to determine the working dir - ResetCurrentTransferModeCache(); // after connecting to the server it is necessary to set the transfer mode (it should be ASCII, but we do not trust it) + ResetWorkingPathCache(); // after connecting to the server, the working directory must be determined + ResetCurrentTransferModeCache(); // after connecting to the server, the transfer mode must be set (it should be ASCII, but that is not trusted) HANDLES(LeaveCriticalSection(&SocketCritSect)); const char* proxyScriptExecPoint = NULL; @@ -630,7 +630,7 @@ BOOL CControlConnectionSocket::StartControlConnection(HWND parent, char* user, i CStartCtrlConStates state = (auxServerIP == INADDR_NONE ? sccsGetIP : sccsConnect); - if (retryMsg != NULL) // simulate the state when the connection was interrupted directly in this method - "retry" connection + if (retryMsg != NULL) // simulate the state as if the connection had been interrupted directly in this method - retry the connection { lstrcpyn(errBuf, retryMsg, 300); // store the retry message in errBuf (for sccsOperationFatalError) opFatalErrorTextID = reconnectErrResID != -1 ? reconnectErrResID : IDS_SENDCOMMANDERROR; @@ -645,7 +645,7 @@ BOOL CControlConnectionSocket::StartControlConnection(HWND parent, char* user, i if (ProcessProxyScript(proxyScriptText, &proxyScriptExecPoint, proxyLastCmdReply, &proxyScriptParams, host, &port, NULL, NULL, errBuf2, NULL)) { - if (proxyScriptParams.NeedUserInput()) // theoretically should not happen + if (proxyScriptParams.NeedUserInput()) // should theoretically not happen { // only proxyScriptParams->NeedProxyHost can be TRUE (otherwise ProcessProxyScript would return an error) strcpy(errBuf, LoadStr(IDS_PROXYSRVADREMPTY)); lstrcpyn(errBuf, errBuf2, 300); @@ -656,7 +656,7 @@ BOOL CControlConnectionSocket::StartControlConnection(HWND parent, char* user, i else proxyScriptStartExecPoint = proxyScriptExecPoint; } - else // theoretically should never happen (saved scripts are validated) + else // this should theoretically never happen (saved scripts are validated) { lstrcpyn(errBuf, errBuf2, 300); opFatalError = -1; // error is directly in errBuf @@ -673,7 +673,7 @@ BOOL CControlConnectionSocket::StartControlConnection(HWND parent, char* user, i { case sccsGetIP: // obtain an IP address from the textual address of the FTP server { - if (!GetHostByAddress(host, 0)) // must be outside the SocketCritSect section + if (!GetHostByAddress(host, 0)) // must be outside the SocketCritSect critical section { // no chance of success -> report an error sprintf(formatBuf, LoadStr(IDS_GETIPERROR), host); opFatalErrorTextID = -1; // the text is in 'formatBuf' @@ -727,7 +727,7 @@ BOOL CControlConnectionSocket::StartControlConnection(HWND parent, char* user, i case ccsevIPReceived: // data1 == IP, data2 == error { - if (data1 != INADDR_NONE) // we have an IP + if (data1 != INADDR_NONE) // we have the IP address { HANDLES(EnterCriticalSection(&SocketCritSect)); auxServerIP = ServerIP = data1; @@ -814,7 +814,7 @@ BOOL CControlConnectionSocket::StartControlConnection(HWND parent, char* user, i ResetBuffersAndEvents(); // empty the buffers (discard old data) and discard old events if (useWelcomeMessage) - welcomeMessage.Clear(); // clear the previous attempt (only makes sense after a "retry") + welcomeMessage.Clear(); // clear the welcome message from the previous attempt (only makes sense after a "retry") if ((proxyType == fpstSocks5 || proxyType == fpstHTTP1_1) && proxyScriptParams.ProxyUser[0] != 0 && proxyScriptParams.ProxyPassword[0] == 0) @@ -825,7 +825,7 @@ BOOL CControlConnectionSocket::StartControlConnection(HWND parent, char* user, i proxyScriptParams.ProxyPassword, PASSWORD_MAX_SIZE, TRUE, connectingToAs, FALSE) .Execute() != IDCANCEL) - { // value change -> we must update the originals as well + { // value changed -> we must update the originals as well HANDLES(EnterCriticalSection(&SocketCritSect)); if (ProxyServer != NULL) ProxyServer->SetProxyPassword(proxyScriptParams.ProxyPassword); @@ -887,7 +887,7 @@ BOOL CControlConnectionSocket::StartControlConnection(HWND parent, char* user, i fatalErrorTextID = -1; // the description is directly in 'errBuf' else fatalErrorTextID = IDS_OPENCONTIMEOUT; - noRetryState = sccsFatalError; // if retry is not performed, execute sccsFatalError + noRetryState = sccsFatalError; // if retry is not performed, transition to sccsFatalError state = sccsRetry; break; } @@ -906,12 +906,12 @@ BOOL CControlConnectionSocket::StartControlConnection(HWND parent, char* user, i sprintf(formatBuf, LoadStr(IDS_OPENCONERROR), host, inet_ntoa(srvAddr), port); } opFatalErrorTextID = -1; // the text is in 'formatBuf' - noRetryState = sccsOperationFatalError; // if retry is not performed, execute sccsOperationFatalError + noRetryState = sccsOperationFatalError; // if retry is not performed, transition to sccsOperationFatalError if (opFatalError == -1 && errBuf[0] == 0) // simple error -> convert it to sccsFatalError { fatalErrorTextID = -1; lstrcpyn(errBuf, formatBuf, 300); - noRetryState = sccsFatalError; // if retry is not performed, execute sccsFatalError + noRetryState = sccsFatalError; // if retry is not performed, transition to sccsFatalError } state = sccsRetry; } @@ -931,14 +931,14 @@ BOOL CControlConnectionSocket::StartControlConnection(HWND parent, char* user, i opFatalError = error; sprintf(formatBuf, LoadStr(IDS_OPENCONERROR), host, inet_ntoa(srvAddr), port); opFatalErrorTextID = -1; // the text is in 'formatBuf' - noRetryState = sccsOperationFatalError; // if retry is not performed, execute sccsOperationFatalError + noRetryState = sccsOperationFatalError; // if retry is not performed, transition to sccsOperationFatalError state = sccsRetry; } break; } case sccsRetry: // try connecting again (based on Config.DelayBetweenConRetries + Config.ConnectRetries), - { // if it should no longer try, transition to the state from 'noRetryState' + if 'fastRetry' is TRUE, + { // if no more retries should be attempted, transition to the state in 'noRetryState'; if 'fastRetry' is TRUE, // do not wait before the next attempt // Resend AUTH TLS if needed if (EncryptControlConnection) @@ -984,7 +984,7 @@ BOOL CControlConnectionSocket::StartControlConnection(HWND parent, char* user, i *s1 = 0; // trim end-of-line characters from the last error text // when the server closes the control connection, keep-alive changes to 'kamNone', therefore: - // prepare keep-alive for further use + set keep-alive to 'kamForbidden' (a normal command is in progress) + // prepare keep-alive for further use and set it to 'kamForbidden' (a normal command is in progress) ReleaseKeepAlive(); WaitForEndOfKeepAlive(parent, 0); // cannot open the wait window (it is in the 'kamNone' state) @@ -995,7 +995,7 @@ BOOL CControlConnectionSocket::StartControlConnection(HWND parent, char* user, i // if necessary, close the socket; the system will attempt a graceful shutdown (we will not learn the result) CloseSocket(NULL); Logs.SetIsConnected(logUID, IsConnected()); - Logs.RefreshListOfLogsInLogsDlg(); // display "connection inactive" + Logs.RefreshListOfLogsInLogsDlg(); // "connection inactive" in the log state = sccsConnect; // try to connect again (the IP is already known) } @@ -1044,7 +1044,7 @@ BOOL CControlConnectionSocket::StartControlConnection(HWND parent, char* user, i s++; if (*s == '\n') { - if (*(s + 1) == '\n') // remove an empty line in the text + if (*(s + 1) == '\n') // remove the empty line in the text memmove(s, s + 1, strlen(s + 1) + 1); s++; } @@ -1075,7 +1075,7 @@ BOOL CControlConnectionSocket::StartControlConnection(HWND parent, char* user, i if (now - start < (DWORD)delayBetweenConRetries * 1000) { // rebuild the text for the retry wait window (contains the countdown) DWORD wait = delayBetweenConRetries * 1000 - (now - start); - if (now != start) // it makes no sense the first time + if (now != start) // no point on the first pass { _snprintf_s(retryBuf, _TRUNCATE, LoadStr(IDS_WAITINGTORETRYSUF), buf, (1 + (wait - 1) / 1000), attemptNum, Config.GetConnectRetries() + 1); @@ -1122,7 +1122,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = { // gives up further login attempts state = sccsDone; run = FALSE; - // actionCanceled = TRUE; // do not log cancel in "retry" + // actionCanceled = TRUE; // do not log cancellation during "retry" } else { @@ -1134,7 +1134,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = else { SalamanderGeneral->WaitForESCRelease(); // measure to prevent interrupting the next action after every ESC in the previous message box - waitWnd.Show(TRUE); // wants to continue waiting + waitWnd.Show(TRUE); // continue waiting } } break; @@ -1208,7 +1208,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = case ccsevTimeout: { fatalErrorTextID = IDS_WAITFORLOGTIMEOUT; - noRetryState = sccsFatalError; // if retry is not performed, execute sccsFatalError + noRetryState = sccsFatalError; // if retry is not performed, transition to sccsFatalError state = sccsRetry; break; } @@ -1221,7 +1221,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = int replyCode; HANDLES(EnterCriticalSection(&SocketCritSect)); - while (ReadFTPReply(&reply, &replySize, &replyCode)) // while we have some server response + while (ReadFTPReply(&reply, &replySize, &replyCode)) // while we have a server reply { if (useWelcomeMessage) welcomeMessage.Append(reply, replySize); @@ -1256,11 +1256,11 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = if (FTP_DIGIT_1(replyCode) == FTP_D1_TRANSIENTERROR || FTP_DIGIT_1(replyCode) == FTP_D1_ERROR) // e.g. 421 Service not available, closing control connection { - if (state == sccsServerReady) // if we are not reporting another error yet + if (state == sccsServerReady) // if we are not already reporting another error { CopyStr(errBuf, 300, reply, replySize); fatalErrorTextID = -1; // the error text is in 'errBuf' - noRetryState = sccsFatalError; // if retry is not performed, execute sccsFatalError + noRetryState = sccsFatalError; // if retry is not performed, transition to sccsFatalError retryLogError = FALSE; // the error is already in the log, do not add it again state = sccsRetry; } @@ -1274,7 +1274,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = } else // not an FTP server { - if (state == sccsServerReady) // if we are not reporting another error yet + if (state == sccsServerReady) // if we are not already reporting another error { opFatalErrorTextID = IDS_NOTFTPSERVERERROR; CopyStr(errBuf, 300, reply, replySize); @@ -1292,7 +1292,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = if (state == sccsServerReady) // close without a reason { fatalErrorTextID = IDS_CONNECTIONLOSTERROR; - noRetryState = sccsFatalError; // if retry is not performed, execute sccsFatalError + noRetryState = sccsFatalError; // if retry is not performed, transition to sccsFatalError state = sccsRetry; } if (data1 != NO_ERROR) @@ -1344,7 +1344,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = &proxyScriptParams, NULL, NULL, proxySendCmdBuf, proxyLogCmdBuf, errBuf, NULL)) { - if (sslisNone == SSLInitSequence && proxyScriptParams.NeedUserInput()) // it is necessary to enter some data (user, password, etc.) + if (sslisNone == SSLInitSequence && proxyScriptParams.NeedUserInput()) // some data needs to be entered (user, password, etc.) { if (proxyScriptParams.NeedProxyHost) { @@ -1485,7 +1485,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = } if (proxySendCmdBuf[0] == 0) // end of the login script { - if (proxyLastCmdReply == -1) // the script contains no command sent to the server - e.g. commands skipped because they contain optional variables + if (proxyLastCmdReply == -1) // the script contains no command to send to the server - e.g. commands skipped because they contain optional variables { fatalErrorTextID = IDS_INCOMPLETEPRXSCR2; state = sccsFatalError; @@ -1495,7 +1495,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = if (FTP_DIGIT_1(proxyLastCmdReply) == FTP_D1_SUCCESS) // e.g. 230 User logged in, proceed { state = sccsDone; - ret = TRUE; // SUCCESS, we are logged in! + ret = TRUE; // success, logged in } else // FTP_DIGIT_1(proxyLastCmdReply) == FTP_D1_PARTIALSUCCESS // e.g. 331 User name okay, need password { @@ -1561,7 +1561,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = case ccsevTimeout: { fatalErrorTextID = IDS_SNDORABORCMDTIMEOUT; - noRetryState = sccsFatalError; // if retry is not performed, execute sccsFatalError + noRetryState = sccsFatalError; // if retry is not performed, transition to sccsFatalError state = sccsRetry; allBytesWritten = TRUE; // no longer important, the socket will be closed break; @@ -1578,7 +1578,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = HANDLES(EnterCriticalSection(&SocketCritSect)); BOOL sectLeaved = FALSE; - while (ReadFTPReply(&reply, &replySize, &replyCode)) // while we have some server response + while (ReadFTPReply(&reply, &replySize, &replyCode)) // while we have a server reply { if (useWelcomeMessage) welcomeMessage.Append(reply, replySize); @@ -1588,7 +1588,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = { if ((FTP_DIGIT_1(replyCode) == FTP_D1_ERROR) && CompressData && !_strnicmp(proxySendCmdBuf, "MODE Z", sizeof("MODE Z") - 1)) { - // Server does not support compression -> swallow the error, disable compression and go on + // Server does not support compression -> ignore the error, disable compression, and continue replyCode = 200; // Emulate Full success CompressData = FALSE; Logs.LogMessage(logUID, LoadStr(IDS_MODEZ_LOG_UNSUPBYSERVER), -1); @@ -1614,8 +1614,8 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = FTP_DIGIT_1(replyCode) == FTP_D1_ERROR) // e.g. 530 Not logged in (invalid password) { if (FTP_DIGIT_1(replyCode) == FTP_D1_TRANSIENTERROR) - { // convenient handling of the "too many users" error - no questions, immediately "retry" - // drawback: with this code comes a message that may require changing user/password + { // convenient handling of the "too many users" error - retry immediately without prompting +// possible issue: this code may be followed by a message that requires changing the user/password retryLoginWithoutAsking = TRUE; } @@ -1668,7 +1668,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = if (dlg.LoginChanged && event != ccsevClosed && !proxyUsed) { // retry login (without waiting and closing the connection) - handles responses such as "invalid user/password" state = sccsRetryLogin; - // allBytesWritten = TRUE; // the connection will not be closed, we must wait (besides, once a reply arrived, it is likely the whole command was sent) + // allBytesWritten = TRUE; // the connection will not be closed, so we must wait (once a reply has arrived, the whole command was presumably sent) } } else // cancel @@ -1687,7 +1687,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = opFatalErrorTextID = IDS_LOGINERROR; // CopyStr(errBuf, 300, reply, replySize); // done earlier - before leaving the critical section opFatalError = -1; // the error text is in 'errBuf' - noRetryState = sccsOperationFatalError; // if retry is not performed, execute sccsOperationFatalError + noRetryState = sccsOperationFatalError; // if retry is not performed, transition to sccsOperationFatalError retryLogError = FALSE; // the error is already in the log, do not add it again state = sccsRetry; allBytesWritten = TRUE; // no longer important, the socket will be closed @@ -1701,11 +1701,11 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = } else // not an FTP server { - if (state == sccsProcessLoginScript) // if we are not reporting another error yet + if (state == sccsProcessLoginScript) // if we are not already reporting another error { opFatalErrorTextID = IDS_NOTFTPSERVERERROR; CopyStr(errBuf, 300, reply, replySize); - opFatalError = -1; // the "error" (reply) is directly in errBuf + opFatalError = -1; // the "error" reply is already in errBuf state = sccsOperationFatalError; fatalErrLogMsg = FALSE; // already in the log, no point adding it again allBytesWritten = TRUE; // no longer important, the socket will be closed @@ -1722,7 +1722,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = if (state == sccsProcessLoginScript) // close without a reason { fatalErrorTextID = IDS_CONNECTIONLOSTERROR; - noRetryState = sccsFatalError; // if retry is not performed, execute sccsFatalError + noRetryState = sccsFatalError; // if retry is not performed, transition to sccsFatalError state = sccsRetry; } if (data1 != NO_ERROR) @@ -1747,7 +1747,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = int err; CCertificate* unverifiedCert; if (!EncryptSocket(logUID, &err, &unverifiedCert, &errID, errBuf, 300, - NULL /* it's always NULL for the control connection */)) + NULL /* for the control connection this is always NULL */)) { allBytesWritten = TRUE; // no longer important, the socket will be closed if (errBuf[0] == 0) @@ -1816,7 +1816,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = } } } - else // Error! OpenSSL libs not found? Or not W2K+? + else // Error: OpenSSL libraries not found, or the system is not W2K+ { allBytesWritten = TRUE; // no longer important, the socket will be closed state = sccsFatalError; @@ -1864,7 +1864,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = { while (state == sccsProcessLoginScript) { - // pick an event on the socket + // select an event on the socket CControlConnectionSocketEvent event; DWORD data1, data2; WaitForEventOrESC(parent, &event, &data1, &data2, 0, NULL, NULL, FALSE); // do not wait, just receive events @@ -1875,7 +1875,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = { opFatalErrorTextID = IDS_SENDCOMMANDERROR; opFatalError = error; - noRetryState = sccsOperationFatalError; // if retry is not performed, execute sccsOperationFatalError + noRetryState = sccsOperationFatalError; // if retry is not performed, transition to sccsOperationFatalError state = sccsRetry; break; } @@ -1888,11 +1888,11 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = int replyCode; HANDLES(EnterCriticalSection(&SocketCritSect)); - while (ReadFTPReply(&reply, &replySize, &replyCode)) // while we have some server response + while (ReadFTPReply(&reply, &replySize, &replyCode)) // while we have any server reply { Logs.LogMessage(logUID, reply, replySize); - if (replyCode == -1 || // not an FTP reply + if (replyCode == -1 || // not an FTP response FTP_DIGIT_1(replyCode) == FTP_D1_TRANSIENTERROR || // description of a temporary error FTP_DIGIT_1(replyCode) == FTP_D1_ERROR) // description of an error { @@ -1900,10 +1900,10 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = CopyStr(errBuf, 300, reply, replySize); SkipFTPReply(replySize); opFatalError = -1; // the "error" (reply) is directly in errBuf - noRetryState = sccsOperationFatalError; // if retry is not performed, execute sccsOperationFatalError + noRetryState = sccsOperationFatalError; // if retry is not performed, transition to sccsOperationFatalError retryLogError = FALSE; // the error is already in the log, do not add it again state = sccsRetry; - break; // no need to read another message + break; // no need to read another reply } SkipFTPReply(replySize); } @@ -1914,7 +1914,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = if (state == sccsProcessLoginScript) // close without a reason { fatalErrorTextID = IDS_CONNECTIONLOSTERROR; - noRetryState = sccsFatalError; // if retry is not performed, execute sccsFatalError + noRetryState = sccsFatalError; // if retry is not performed, transition to sccsFatalError state = sccsRetry; } if (data1 != NO_ERROR) @@ -2080,7 +2080,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = errBuf, 300, NULL)) { ret = FALSE; // we are no longer connected - break; // go perform the "retry" + break; // perform the "retry" } } } @@ -2101,13 +2101,13 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = HANDLES(LeaveCriticalSection(&SocketCritSect)); } else - ret = FALSE; // error -> connection closed - go perform the "retry" + ret = FALSE; // error -> connection closed - proceed with the "retry" } if (ret && workDir != NULL && !GetCurrentWorkingPath(parent, workDir, workDirBufSize, FALSE, &canRetry, errBuf, 300)) { - ret = FALSE; // error -> connection closed - go perform the "retry" + ret = FALSE; // error -> connection closed - proceed with the "retry" } if (canRetry && !ret) // assumes 'errBuf' has been set @@ -2166,7 +2166,7 @@ BOOL CControlConnectionSocket::ReconnectIfNeeded(BOOL notInPanel, BOOL leftPanel { if (retryMsg == NULL) // connection interrupted for an unknown reason - display it and ask about reconnecting { - // if we have not yet displayed what led to the connection closing, do it now + // if we have not yet reported what led to the connection closing, do it now CheckCtrlConClose(notInPanel, leftPanel, parent, FALSE); BOOL reconnectToSrv = FALSE; From 5be286d9db0e69da5332cd93711526d3572a0b1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 9 Apr 2026 21:05:59 +0200 Subject: [PATCH 022/710] [tanslation] Fix src/plugins/ftp/ctrlcon2.cpp comments (#393) --- src/plugins/ftp/ctrlcon2.cpp | 120 +++++++++++++++++------------------ 1 file changed, 60 insertions(+), 60 deletions(-) diff --git a/src/plugins/ftp/ctrlcon2.cpp b/src/plugins/ftp/ctrlcon2.cpp index 66aedbffc..6c76d3bc2 100644 --- a/src/plugins/ftp/ctrlcon2.cpp +++ b/src/plugins/ftp/ctrlcon2.cpp @@ -191,7 +191,7 @@ BOOL CDynString::Append(const char* str, int len) Buffer = newBuf; Allocated = size; } - else // insufficient memory, tough luck... + else // insufficient memory { TRACE_E(LOW_MEMORY); return FALSE; @@ -258,7 +258,7 @@ void CControlConnectionSocket::CloseControlConnection(HWND parent) serverTimeout = 1000; // at least a second SetStartTime(); - // Remember the focus from 'parent' (if the focus is not from 'parent', store NULL) + // Remember the focused window in 'parent' (store NULL if the focus is not within 'parent') HWND focusedWnd = GetFocus(); HWND hwnd = focusedWnd; while (hwnd != NULL && hwnd != parent) @@ -362,7 +362,7 @@ void CControlConnectionSocket::CloseControlConnection(HWND parent) int replySize; HANDLES(EnterCriticalSection(&SocketCritSect)); - while (ReadFTPReply(&reply, &replySize)) // process responses from the server as long as we have any + while (ReadFTPReply(&reply, &replySize)) // while we have any server replies { Logs.LogMessage(logUID, reply, replySize); @@ -411,7 +411,7 @@ void CControlConnectionSocket::CloseControlConnection(HWND parent) if (!socketClosed) { - CloseSocket(NULL); // close the socket (if it is open); the system will attempt a "graceful" shutdown (we won't learn the result) + CloseSocket(NULL); // close the socket (if it is open); the system will attempt a "graceful" shutdown (the result is unknown) Logs.SetIsConnected(logUID, IsConnected()); Logs.RefreshListOfLogsInLogsDlg(); // show the "connection inactive" notification } @@ -444,7 +444,7 @@ void CControlConnectionSocket::CheckCtrlConClose(BOOL notInPanel, BOOL leftPanel char* auxConnectionLostMsg = ConnectionLostMsg; HANDLES(LeaveCriticalSection(&EventCritSect)); - if (found || // the ccsevClosed event is waiting for us—the user still does not know that the connection is closed + if (found || // the ccsevClosed event is still pending; the user still does not know that the connection is closed auxConnectionLostMsg != NULL) // we cached the message captured when the connection closed (at that moment it only went into the log) { char errBuf[300]; @@ -459,7 +459,7 @@ void CControlConnectionSocket::CheckCtrlConClose(BOOL notInPanel, BOOL leftPanel BOOL haveErr = FALSE; HANDLES(EnterCriticalSection(&SocketCritSect)); - while (ReadFTPReply(&reply, &replySize, &replyCode)) // process responses from the server as long as we have any + while (ReadFTPReply(&reply, &replySize, &replyCode)) // while we have a server response { Logs.LogMessage(logUID, reply, replySize, TRUE); @@ -485,7 +485,7 @@ void CControlConnectionSocket::CheckCtrlConClose(BOOL notInPanel, BOOL leftPanel lstrcpyn(errBuf, ConnectionLostMsg, 300); else errBuf[0] = 0; - SalamanderGeneral->Free(ConnectionLostMsg); // it is no longer needed + SalamanderGeneral->Free(ConnectionLostMsg); // no longer needed ConnectionLostMsg = NULL; HANDLES(LeaveCriticalSection(&SocketCritSect)); } @@ -510,7 +510,7 @@ void CControlConnectionSocket::CheckCtrlConClose(BOOL notInPanel, BOOL leftPanel lstrcpyn(errBuf, ConnectionLostMsg, 300); else errBuf[0] = 0; - SalamanderGeneral->Free(ConnectionLostMsg); // it is no longer needed + SalamanderGeneral->Free(ConnectionLostMsg); // no longer needed ConnectionLostMsg = NULL; HANDLES(LeaveCriticalSection(&SocketCritSect)); } @@ -572,8 +572,8 @@ BOOL CControlConnectionSocket::ReadFTPReply(char** reply, int* replySize, int* r CALL_STACK_MESSAGE1("CControlConnectionSocket::ReadFTPReply(, ,)"); #ifdef _DEBUG - if (SocketCritSect.RecursionCount == 0 /* does not catch the situation when - the section is used by another thread */ + if (SocketCritSect.RecursionCount == 0 /* does not catch the situation where + another thread uses the section */ ) TRACE_E("Incorrect call to CControlConnectionSocket::ReadFTPReply: not from section SocketCritSect!"); #endif @@ -586,8 +586,8 @@ void CControlConnectionSocket::SkipFTPReply(int replySize) CALL_STACK_MESSAGE2("CControlConnectionSocket::SkipFTPReply(%d)", replySize); #ifdef _DEBUG - if (SocketCritSect.RecursionCount == 0 /* does not catch the situation when - the section is used by another thread */ + if (SocketCritSect.RecursionCount == 0 /* does not catch the situation where + another thread uses the section */ ) TRACE_E("Incorrect call to CControlConnectionSocket::SkipFTPReply: not from section SocketCritSect!"); #endif @@ -622,9 +622,9 @@ BOOL CControlConnectionSocket::Write(const char* buffer, int bytesToWrite, DWORD HANDLES(EnterCriticalSection(&SocketCritSect)); BOOL ret = FALSE; - if (Socket != INVALID_SOCKET) // the socket is connected + if (Socket != INVALID_SOCKET) // socket is connected { - if (BytesToWriteCount == BytesToWriteOffset) // nothing is waiting to be sent, we can transmit + if (BytesToWriteCount == BytesToWriteOffset) // nothing is waiting to be sent; we can send { if (BytesToWriteCount != 0) TRACE_E("Unexpected value of BytesToWriteCount."); @@ -637,7 +637,7 @@ BOOL CControlConnectionSocket::Write(const char* buffer, int bytesToWrite, DWORD // a command in the SendFTPCommand() method must be adjusted int sentLen = send(Socket, buffer + len, bytesToWrite - len, 0); - if (sentLen != SOCKET_ERROR) // at least something was sent successfully (or rather taken over by Windows; delivery is uncertain) + if (sentLen != SOCKET_ERROR) // at least some data was sent successfully (or rather accepted by Windows; delivery is uncertain) { len += sentLen; if (len >= bytesToWrite) // has everything been sent? @@ -649,16 +649,16 @@ BOOL CControlConnectionSocket::Write(const char* buffer, int bytesToWrite, DWORD else { DWORD err = WSAGetLastError(); - if (err == WSAEWOULDBLOCK) // nothing else can be sent (Windows no longer have buffer space) + if (err == WSAEWOULDBLOCK) // nothing else can be sent (Windows no longer has buffer space available) { ret = TRUE; break; // stop sending (the rest will be done after FD_WRITE) } - else // send error + else // sending error { if (error != NULL) *error = err; - break; // return the error + break; // return an error } } } @@ -669,24 +669,24 @@ BOOL CControlConnectionSocket::Write(const char* buffer, int bytesToWrite, DWORD // a command in the SendFTPCommand() method must be adjusted int sentLen = SSLLib.SSL_write(SSLConn, buffer + len, bytesToWrite - len); - if (sentLen >= 0) // at least something was sent successfully (or rather taken over by Windows; delivery is uncertain) + if (sentLen >= 0) // at least some data was sent successfully (or rather accepted by Windows; delivery is uncertain) { len += sentLen; if (len >= bytesToWrite) // has everything been sent? { ret = TRUE; - break; // stop sending (there is nothing left) + break; // stop sending (nothing is left) } } else { DWORD err = SSLtoWS2Error(SSLLib.SSL_get_error(SSLConn, sentLen)); - if (err == WSAEWOULDBLOCK) // nothing else can be sent (Windows no longer have buffer space) + if (err == WSAEWOULDBLOCK) // nothing else can be sent (Windows no longer has buffer space) { ret = TRUE; break; // stop sending (the rest will be done after FD_WRITE) } - else // send error + else // sending error { if (error != NULL) *error = err; @@ -695,7 +695,7 @@ BOOL CControlConnectionSocket::Write(const char* buffer, int bytesToWrite, DWORD } } - if (ret) // successful send, 'len' holds the number of bytes sent (the rest is sent after FD_WRITE is received) + if (ret) // send succeeded; 'len' holds the number of bytes sent (the rest will be sent after FD_WRITE) { if (allBytesWritten != NULL) *allBytesWritten = (len >= bytesToWrite); @@ -713,7 +713,7 @@ BOOL CControlConnectionSocket::Write(const char* buffer, int bytesToWrite, DWORD BytesToWrite = newBuf; BytesToWriteAllocatedSize = newSize; } - else // not enough memory to store data in our buffer (only TRACE reports the error) + else // insufficient memory to store the data in our buffer (only TRACE reports the error) { TRACE_E(LOW_MEMORY); ret = FALSE; @@ -805,7 +805,7 @@ BOOL CControlConnectionSocket::SendKeepAliveCmd(int logUID, const char* ftpCmd) void CControlConnectionSocket::ReceiveNetEvent(LPARAM lParam, int index) { CALL_STACK_MESSAGE3("CControlConnectionSocket::ReceiveNetEvent(0x%IX, %d)", lParam, index); - DWORD eventError = WSAGETSELECTERROR(lParam); // extract error code of event + DWORD eventError = WSAGETSELECTERROR(lParam); // extract the event error code switch (WSAGETSELECTEVENT(lParam)) // extract event { case FD_CLOSE: // sometimes arrives before the final FD_READ; we must first try FD_READ and, if it succeeds, post FD_CLOSE again (another FD_READ may succeed before it) @@ -825,19 +825,19 @@ void CControlConnectionSocket::ReceiveNetEvent(LPARAM lParam, int index) BOOL genEvent = FALSE; if (eventError == NO_ERROR) { - if (Socket != INVALID_SOCKET) // the socket is connected + if (Socket != INVALID_SOCKET) // socket is connected { BOOL lowMem = FALSE; if (ReadBytesAllocatedSize - ReadBytesCount < CRTLCON_BYTESTOREADONSOCKET) // the 'ReadBytes' buffer is small { - if (ReadBytesOffset > 0) // is it possible to move data within the buffer? + if (ReadBytesOffset > 0) // can data be shifted within the buffer? { memmove(ReadBytes, ReadBytes + ReadBytesOffset, ReadBytesCount - ReadBytesOffset); ReadBytesCount -= ReadBytesOffset; ReadBytesOffset = 0; } - if (ReadBytesAllocatedSize - ReadBytesCount < CRTLCON_BYTESTOREADONSOCKET) // the 'ReadBytes' buffer is still small + if (ReadBytesAllocatedSize - ReadBytesCount < CRTLCON_BYTESTOREADONSOCKET) // the 'ReadBytes' buffer is still too small { int newSize = ReadBytesCount + CRTLCON_BYTESTOREADONSOCKET + CRTLCON_BYTESTOREADONSOCKETPREALLOC; @@ -847,7 +847,7 @@ void CControlConnectionSocket::ReceiveNetEvent(LPARAM lParam, int index) ReadBytes = newBuf; ReadBytesAllocatedSize = newSize; } - else // not enough memory to store data in our buffer (only TRACE reports the error) + else // insufficient memory to store the data in our buffer (only TRACE reports the error) { TRACE_E(LOW_MEMORY); lowMem = TRUE; @@ -865,7 +865,7 @@ void CControlConnectionSocket::ReceiveNetEvent(LPARAM lParam, int index) { if (len > 0) { - ReadBytesCount += len; // adjust the number of bytes read by the newly received ones + ReadBytesCount += len; // adjust the number of bytes read by the newly read bytes ret = TRUE; genEvent = TRUE; if (WSAGETSELECTEVENT(lParam) == FD_CLOSE) @@ -888,7 +888,7 @@ void CControlConnectionSocket::ReceiveNetEvent(LPARAM lParam, int index) { if (len > 0) { - ReadBytesCount += len; // adjust the number of bytes read by the newly received ones + ReadBytesCount += len; // increment the number of bytes read by the newly read bytes ret = TRUE; genEvent = TRUE; if (WSAGETSELECTEVENT(lParam) == FD_CLOSE) @@ -912,7 +912,7 @@ void CControlConnectionSocket::ReceiveNetEvent(LPARAM lParam, int index) // do not generate an event for this unexpected error (solution: the user presses ESC) } } - else // reporting an error in FD_READ (according to the help only WSAENETDOWN) + else // FD_READ error report (according to the documentation, only WSAENETDOWN) { if (WSAGETSELECTEVENT(lParam) != FD_CLOSE) // let FD_CLOSE handle the error itself { @@ -925,7 +925,7 @@ void CControlConnectionSocket::ReceiveNetEvent(LPARAM lParam, int index) char* reply; int replySize; int replyCode; - while (ReadFTPReply(&reply, &replySize, &replyCode)) // process responses from the server as long as we have any + while (ReadFTPReply(&reply, &replySize, &replyCode)) // while we have a server response { Logs.LogMessage(LogUID, reply, replySize); BOOL run = TRUE; @@ -988,7 +988,7 @@ void CControlConnectionSocket::ReceiveNetEvent(LPARAM lParam, int index) if (kaDataConnection->FinishDataTransfer(replyCode)) { // release the data connection via the SocketsThread method call HANDLES(EnterCriticalSection(&SocketCritSect)); - kaDataConnection = KeepAliveDataCon; // prevent double destruction (if the main thread waits for destruction, it is already NULL) + kaDataConnection = KeepAliveDataCon; // prevent double destruction (if the main thread is waiting for destruction, KeepAliveDataCon is already NULL here) KeepAliveDataCon = NULL; KeepAliveDataConState = kadcsNone; HANDLES(LeaveCriticalSection(&SocketCritSect)); @@ -1038,12 +1038,12 @@ void CControlConnectionSocket::ReceiveNetEvent(LPARAM lParam, int index) // consume extra messages from the server (e.g. WarFTPD generates them when LISTing an inaccessible directory) HANDLES(EnterCriticalSection(&SocketCritSect)); - while (ReadFTPReply(&reply, &replySize, &replyCode)) // process responses from the server as long as we have any + while (ReadFTPReply(&reply, &replySize, &replyCode)) // while we have a server response { Logs.LogMessage(LogUID, reply, replySize); SkipFTPReply(replySize); } - break; // abort... + break; // stop... } HANDLES(EnterCriticalSection(&SocketCritSect)); if (!run) @@ -1087,7 +1087,7 @@ void CControlConnectionSocket::ReceiveNetEvent(LPARAM lParam, int index) { if (BytesToWriteCount > BytesToWriteOffset) // we have remaining data, send the rest from the 'BytesToWrite' buffer { - if (Socket != INVALID_SOCKET) // the socket is connected + if (Socket != INVALID_SOCKET) // socket is connected { int len = 0; if (!SSLConn) @@ -1096,24 +1096,24 @@ void CControlConnectionSocket::ReceiveNetEvent(LPARAM lParam, int index) { int sentLen = send(Socket, BytesToWrite + BytesToWriteOffset + len, BytesToWriteCount - BytesToWriteOffset - len, 0); - if (sentLen != SOCKET_ERROR) // at least something was sent successfully (or rather taken over by Windows; delivery is uncertain) + if (sentLen != SOCKET_ERROR) // at least some data was sent successfully (or rather accepted by Windows; delivery is uncertain) { len += sentLen; if (len >= BytesToWriteCount - BytesToWriteOffset) // has everything been sent? { ret = TRUE; - break; // stop sending (there is nothing left) + break; // stop sending (nothing left) } } else { err = WSAGetLastError(); - if (err == WSAEWOULDBLOCK) // nothing else can be sent (Windows no longer have buffer space) + if (err == WSAEWOULDBLOCK) // nothing else can be sent (Windows no longer has buffer space) { ret = TRUE; break; // stop sending (the rest will be done after FD_WRITE) } - else // different error - reset the buffer + else // another error - reset the buffer { BytesToWriteOffset = 0; BytesToWriteCount = 0; @@ -1128,7 +1128,7 @@ void CControlConnectionSocket::ReceiveNetEvent(LPARAM lParam, int index) { int sentLen = SSLLib.SSL_write(SSLConn, BytesToWrite + BytesToWriteOffset + len, BytesToWriteCount - BytesToWriteOffset - len); - if (sentLen >= 0) // at least something was sent successfully (or rather taken over by Windows; delivery is uncertain) + if (sentLen >= 0) // at least some data was sent successfully (or rather accepted by Windows; delivery is uncertain) { len += sentLen; if (len >= BytesToWriteCount - BytesToWriteOffset) // has everything been sent? @@ -1140,12 +1140,12 @@ void CControlConnectionSocket::ReceiveNetEvent(LPARAM lParam, int index) else { err = SSLtoWS2Error(SSLLib.SSL_get_error(SSLConn, sentLen)); - if (err == WSAEWOULDBLOCK) // nothing else can be sent (Windows no longer have buffer space) + if (err == WSAEWOULDBLOCK) // nothing else can be sent (Windows no longer has buffer space) { ret = TRUE; break; // stop sending (the rest will be done after FD_WRITE) } - else // different error - reset the buffer + else // another error - reset the buffer { BytesToWriteOffset = 0; BytesToWriteCount = 0; @@ -1171,13 +1171,13 @@ void CControlConnectionSocket::ReceiveNetEvent(LPARAM lParam, int index) { // May occur: the main thread manages to call CloseSocket() before FD_WRITE is delivered //TRACE_E("Unexpected situation in CControlConnectionSocket::ReceiveNetEvent(FD_WRITE): Socket is not connected."); - BytesToWriteCount = 0; // error — reset the buffer + BytesToWriteCount = 0; // error: reset the buffer BytesToWriteOffset = 0; // do not generate an event for this unexpected error (solution: the user presses ESC) } } } - else // reporting an error in FD_WRITE (according to the help only WSAENETDOWN) + else // FD_WRITE error report (according to the documentation, only WSAENETDOWN) { genEvent = TRUE; err = eventError; @@ -1219,8 +1219,8 @@ void CControlConnectionSocket::SocketWasClosed(DWORD error) AddEvent(ccsevClosed, error, 0); // Inform the user about the control connection closing if it does not happen - // during a socket operation (when the user would be told about a timeout or a "kick" - // leading to disconnection from the FTP server) + // during a socket operation (which would report a timeout or a "kick" + // leading to disconnection from the FTP server) ClosedCtrlConChecker.Add(this); HANDLES(EnterCriticalSection(&SocketCritSect)); @@ -1280,14 +1280,14 @@ void CClosedCtrlConChecker::Check(HWND parent) CmdNotPost = TRUE; int k; - for (k = 0; k < CtrlConSockets.Count; k++) // for all stored closed control connections (may already be deallocated) + for (k = 0; k < CtrlConSockets.Count; k++) // for all stored closed control connections (they may already be deallocated) { CControlConnectionSocket* ctrlCon = CtrlConSockets[k]; int i; - for (i = 0; i < FTPConnections.Count; i++) // try to find a FS using 'ctrlCon' (the FS may already be closed) + for (i = 0; i < FTPConnections.Count; i++) // try to find an FS using 'ctrlCon' ('FS' may already be closed) { CPluginFSInterface* fs = FTPConnections[i]; - if (fs->Contains(ctrlCon)) // found a FS with a closed control connection + if (fs->Contains(ctrlCon)) // found an FS with a closed control connection { fs->CheckCtrlConClose(parent); // if the user has not been informed yet, notify them now break; @@ -1371,8 +1371,8 @@ class CLogsDlgThread : public CThread CALL_STACK_MESSAGE1("CLogsDlgThread::Body()"); // 'sendWMClose': the dialog sets this to TRUE when WM_CLOSE is received - // while a modal dialog is open above the logs dialog; once that - // modal dialog finishes, WM_CLOSE is sent to the logs dialog again + // while a modal dialog is open over the log dialog; once that + // modal dialog closes, WM_CLOSE is sent to the log dialog again BOOL sendWMClose = FALSE; LogsDlg->SendWMClose = &sendWMClose; @@ -1386,7 +1386,7 @@ class CLogsDlgThread : public CThread else { HWND dlg = LogsDlg->HWindow; - if (AlwaysOnTop) // handle always-on-top at least "statically" (not in the system menu) + if (AlwaysOnTop) // handle always-on-top at least statically (it is not in the system menu) SetWindowPos(dlg, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); SetForegroundWindow(dlg); @@ -1578,7 +1578,7 @@ void CLogs::SetLogToEdit(HWND edit, int logUID, BOOL update) void CLogs::ConfigChanged() { HANDLES(EnterCriticalSection(&LogCritSect)); - if (!Config.EnableLogging) // tear down the data + if (!Config.EnableLogging) // clear the data { Data.DestroyMembers(); if (!Data.IsGood()) @@ -1685,8 +1685,8 @@ void CLogs::LimitClosedConLogs() for (i = Data.Count - 1; i >= 0; i--) { CLogData* d = Data[i]; - if (d->CtrlCon == NULL && !d->WorkerIsAlive && // log of a closed connection (dead log) - d->DisconnectNum < firstSurvival) // it is an overly old log + if (d->CtrlCon == NULL && !d->WorkerIsAlive && // log for a closed connection (dead log) + d->DisconnectNum < firstSurvival) // this log is too old { Data.Delete(i); if (!Data.IsGood()) @@ -1849,7 +1849,7 @@ BOOL CLogs::ActivateLogsDlg(int showLogUID) if (t != NULL) { if ((LogsThread = t->Create(AuxThreadQueue)) == NULL) - { // the thread did not start, error + { // thread did not start, error delete t; delete LogsDlg; LogsDlg = NULL; @@ -1983,7 +1983,7 @@ void CLogs::SaveLog(HWND parent, const char* itemName, int uid) } if (uid != -1) - break; // writing only one log, stop here + break; // writing only one log, stop if (i + 1 < Data.Count) // write a separator { @@ -2003,7 +2003,7 @@ void CLogs::SaveLog(HWND parent, const char* itemName, int uid) HANDLES(CloseHandle(file)); SetCursor(oldCur); - if (err != NO_ERROR) // report the error + if (err != NO_ERROR) // display the error { sprintf(buf, LoadStr(IDS_SAVELOGERROR), SalamanderGeneral->GetErrorText(err)); SalamanderGeneral->SalMessageBox(parent, buf, LoadStr(IDS_FTPERRORTITLE), From 12e6ffd61ed39e4dcd080182036a9f65978cf2c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 9 Apr 2026 21:41:36 +0200 Subject: [PATCH 023/710] [tanslation] Fix src/plugins/ftp/ctrlcon4.cpp comments (#394) --- src/plugins/ftp/ctrlcon4.cpp | 60 ++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/src/plugins/ftp/ctrlcon4.cpp b/src/plugins/ftp/ctrlcon4.cpp index 4e121e148..f3bf582bb 100644 --- a/src/plugins/ftp/ctrlcon4.cpp +++ b/src/plugins/ftp/ctrlcon4.cpp @@ -47,7 +47,7 @@ BOOL CControlConnectionSocket::SetCurrentTransferMode(HWND parent, BOOL asciiMod &ftpReplyCode, ftpReplyBuf, ftpReplyBufSize, FALSE, FALSE, TRUE, canRetry, retryMsg, retryMsgBufSize, NULL)) { - if (FTP_DIGIT_1(ftpReplyCode) == FTP_D1_SUCCESS) // success is returned (should be 200) + if (FTP_DIGIT_1(ftpReplyCode) == FTP_D1_SUCCESS) // a success reply was received (it should be 200) { HANDLES(EnterCriticalSection(&SocketCritSect)); leaveSect = TRUE; @@ -60,7 +60,7 @@ BOOL CControlConnectionSocket::SetCurrentTransferMode(HWND parent, BOOL asciiMod ret = FALSE; // error -> connection closed } - if (leaveSect) // the requested transfer mode is already set successfully + if (leaveSect) // the requested transfer mode has already been set successfully { if (success != NULL) *success = TRUE; @@ -234,7 +234,7 @@ BOOL CSendCmdUserIfaceForListAndDownload::CanFinishSending(int replyCode, BOOL* void CSendCmdUserIfaceForListAndDownload::BeforeWaitingForFinish(int replyCode, BOOL* useTimeout) { - if (FTP_DIGIT_1(replyCode) != FTP_D1_SUCCESS) // LIST does not return success - it may not close + if (FTP_DIGIT_1(replyCode) != FTP_D1_SUCCESS) // LIST did not return success, so the data connection may not close at all { // the data connection (e.g., WarFTPD) - wait for the remaining data, but preferably with a timeout *useTimeout = TRUE; // DataConnection->CloseSocketEx(NULL); // to have something to show in the Show Raw Listing panel we must fetch the remaining data @@ -269,8 +269,8 @@ void CSendCmdUserIfaceForListAndDownload::HandleESCWhenWaitingForFinish(HWND par if (esc) { // WaitWnd.SetText(LoadStr(IDS_LISTWNDABORTINGCOMMAND)); // unnecessary, the window will not be shown again - // while the user decides how to respond to the abort, the data connection may finish (that is why - // the dialog says "listing may be incomplete") - then it makes sense to ignore the abort + // while the user decides whether to abort, the data connection may finish (hence the + // "listing may be incomplete" message); then it makes sense to ignore the abort if (DataConnection->IsTransfering(NULL) || DataConnection->IsFlushingDataToDisk()) { DataConnection->CancelConnectionAndFlushing(); // close the "data connection"; the system attempts a "graceful" shutdown (we will not learn the result) @@ -392,7 +392,7 @@ BOOL CControlConnectionSocket::ListWorkingPath(HWND parent, const char* path, ch DWORD ip; unsigned short port; if (FTP_DIGIT_1(ftpReplyCode) == FTP_D1_SUCCESS && // success (should be 227) - FTPGetIPAndPortFromReply(replyBuf, -1, &ip, &port)) // managed to obtain IP and port + FTPGetIPAndPortFromReply(replyBuf, -1, &ip, &port)) // successfully obtained the IP address and port { dataConnection->SetPassive(ip, port, logUID); dataConnection->PassiveConnect(NULL); // the first attempt; the result does not matter (it is checked later) @@ -410,7 +410,7 @@ BOOL CControlConnectionSocket::ListWorkingPath(HWND parent, const char* path, ch { ok = FALSE; if (canRetry) - retryMsgAux = retryMsgBuf; // "retry" is allowed; go to the next reconnect + retryMsgAux = retryMsgBuf; // "retry" is allowed; move on to the next reconnect attempt else { *fatalError = TRUE; // fatal error @@ -438,7 +438,7 @@ BOOL CControlConnectionSocket::ListWorkingPath(HWND parent, const char* path, ch { // error -> connection closed ok = FALSE; if (canRetry) - retryMsgAux = retryMsgBuf; // "retry" is allowed; go to the next reconnect + retryMsgAux = retryMsgBuf; // "retry" is allowed; proceed to the next reconnect attempt else { *fatalError = TRUE; // fatal error @@ -446,11 +446,11 @@ BOOL CControlConnectionSocket::ListWorkingPath(HWND parent, const char* path, ch } } } - else // failed to open the "listen" socket for receiving the data connection from the server -> + else // failed to open the "listen" socket for receiving the data connection from the server, so treat it as a closed connection { // connection closed (so that the standard Retry can be used) ok = FALSE; if (canRetry) - retryMsgAux = retryMsgBuf; // "retry" is allowed; go to the next reconnect + retryMsgAux = retryMsgBuf; // "retry" is allowed; move on to the next reconnect attempt else { *fatalError = TRUE; // fatal error @@ -459,14 +459,14 @@ BOOL CControlConnectionSocket::ListWorkingPath(HWND parent, const char* path, ch } } - if (ok) // if we are still connected, switch the transfer mode to ASCII (ignore success) + if (ok) // if we are still connected, switch the transfer mode to ASCII (ignore the result) { ok = SetCurrentTransferMode(parent, TRUE, NULL, NULL, 0, forceRefresh, &canRetry, retryMsgBuf, 300); if (!ok) // error -> connection closed { if (canRetry) - retryMsgAux = retryMsgBuf; // "retry" is allowed; go to the next reconnect + retryMsgAux = retryMsgBuf; // "retry" is allowed; proceed to the next reconnect attempt else { *fatalError = TRUE; // fatal error @@ -513,8 +513,8 @@ BOOL CControlConnectionSocket::ListWorkingPath(HWND parent, const char* path, ch *pathListingIsBroken = TRUE; // to make it clear that the returned listing is not OK (VxWorks: while listing it can report "error reading entry: 16" and return "550 no files found or ...") } - // VMS returns 550 for an empty directory: we cannot leave the path and the listing can easily - // be considered OK (it can even be cached - it was not interrupted and the server + // VMS returns 550 for an empty directory: we cannot leave this path, and the listing can safely + // be treated as OK (it can even be cached - it was not interrupted, and the server // will most likely not return a different listing) // ret = FALSE; // stop - the path cannot be listed -> a path change is required @@ -562,7 +562,7 @@ BOOL CControlConnectionSocket::ListWorkingPath(HWND parent, const char* path, ch if (FTP_DIGIT_1(ftpReplyCode) == FTP_D1_SUCCESS || FTP_DIGIT_2(ftpReplyCode) != FTP_D2_CONNECTION || noDataTrTimeout || sslErrorOccured != SSLCONERR_NOERROR) - { // if we do not have a description of the network error from the server, we settle for the system description + { // if we do not have a network error description from the server, use the system description systErr = TRUE; if (!trModeHint) trModeHint = err == WSAETIMEDOUT || sslErrorOccured != SSLCONERR_NOERROR; @@ -610,7 +610,7 @@ BOOL CControlConnectionSocket::ListWorkingPath(HWND parent, const char* path, ch if (userIface.WasAborted()) // the user aborted the listing, which terminated the connection (for example on sunsolve.sun.com (Sun Unix) or ftp.chg.ru) - finish with an error (an incomplete listing) { ok = FALSE; // do not display the "list can be incomplete" message; the user was warned during abort - if (canRetry) // take over the message for the message box that announces the connection interruption + if (canRetry) // take over the message for the message box that reports the connection interruption { HANDLES(EnterCriticalSection(&SocketCritSect)); if (ConnectionLostMsg != NULL) @@ -665,7 +665,7 @@ BOOL CControlConnectionSocket::ListWorkingPath(HWND parent, const char* path, ch retryMsgBuf, 300)) { if (strcmp(cmdBuf, path) == 0) // we have the desired working directory on the server - // (assumption: the server returns the same working-path string) +// (assumption: the server always returns the same working-directory string) { pathError = FALSE; ok = TRUE; // successful reconnect; list again @@ -709,7 +709,7 @@ BOOL CControlConnectionSocket::ListWorkingPath(HWND parent, const char* path, ch } } } - else // reconnect failed - finish with an error (an incomplete listing) + else // reconnect failed; end with an error (incomplete listing) { SalamanderGeneral->SalMessageBox(parent, LoadStr(IDS_UNABLETOREADLIST), LoadStr(IDS_FTPERRORTITLE), @@ -745,7 +745,7 @@ BOOL CControlConnectionSocket::ListWorkingPath(HWND parent, const char* path, ch MB_OK | MB_ICONEXCLAMATION); } - *pathListingIsIncomplete = !ok; // TRUE in case of a failure/interruption/connection error + *pathListingIsIncomplete = !ok; // TRUE on connection failure, interruption, or error *pathListingMayBeOutdated = FALSE; // store the date when the listing was created @@ -787,7 +787,7 @@ BOOL CControlConnectionSocket::ListWorkingPath(HWND parent, const char* path, ch *pathListingStartTime); } } - else // failure/interruption/connection error = return at least what we have (the user already knows that "list can be incomplete") + else // on failure, interruption, or a connection error, return at least what we have (the user already knows that "list can be incomplete") { if (*allocatedListing != NULL) { // the buffer does not contain a complete listing -> trim it at the last line ending (CRLF or LF) to make it easier to work with @@ -795,7 +795,7 @@ BOOL CControlConnectionSocket::ListWorkingPath(HWND parent, const char* path, ch char* s = start + *allocatedListingLen; while (s > start && *(s - 1) != '\n') s--; - if (s < start + *allocatedListingLen) // there is a place to write the null terminator (just for easier debugging) + if (s < start + *allocatedListingLen) // there is room to write the null terminator (just for easier debugging) *s = 0; // either at the start of the buffer or after the last LF *allocatedListingLen = (int)(s - start); } @@ -803,7 +803,7 @@ BOOL CControlConnectionSocket::ListWorkingPath(HWND parent, const char* path, ch } if (dataConnection != NULL) // release and possibly close the "data connection" { - if (dataConnection->IsConnected()) // close the "data connection"; the system attempts a "graceful" + if (dataConnection->IsConnected()) // close the "data connection"; the system will attempt a graceful shutdown dataConnection->CloseSocketEx(NULL); // shutdown (we will not learn the result) DeleteSocket(dataConnection); } @@ -1056,8 +1056,8 @@ void CControlConnectionSocket::SetupNextKeepAliveTimer() #endif if (!KeepAliveCmdAllBytesWritten) - { // this should never happen because the server's reply arrives only after the complete command is written - // of the command (the command is always written at once; it is just a few bytes) + { // this should never happen because the server's reply arrives only after the complete + // command has been written (the command is always written at once; it is only a few bytes) TRACE_E("Unexpected situation in CControlConnectionSocket::SetupNextKeepAliveTimer(): KeepAliveCmdAllBytesWritten==FALSE!"); KeepAliveCmdAllBytesWritten = TRUE; } @@ -1081,7 +1081,7 @@ void CControlConnectionSocket::SetupNextKeepAliveTimer() } else { - KeepAliveMode = kamNone; // we should no longer perform keep-alive (there is no point in protecting the connection anymore) + KeepAliveMode = kamNone; // do not perform keep-alive anymore (protecting the connection is no longer useful) Logs.LogMessage(LogUID, LoadStr(IDS_LOGMSGKASTOPPED), -1, TRUE); // notify the user that the keep-alive mode has stopped } } @@ -1133,7 +1133,7 @@ void CControlConnectionSocket::ReleaseKeepAlive() // if the "data connection" is open, close it; it certainly will not be needed now if (closeDataCon != NULL) { - if (closeDataCon->IsConnected()) // close the "data connection"; the system attempts a "graceful" + if (closeDataCon->IsConnected()) // close the "data connection"; the system will attempt a graceful shutdown closeDataCon->CloseSocketEx(NULL); // shutdown (we will not learn the result) DeleteSocket(closeDataCon); // release the "data connection" through a SocketsThread method call } @@ -1236,7 +1236,7 @@ void CControlConnectionSocket::ReceiveTimer(DWORD id, void* param) BOOL listenError; if (!keepAliveDataConAux->OpenForListeningWithProxy(localIP, localPort, &listenError, &error)) { // failed to open the "listen" socket for receiving the data connection from - // the server (a local operation, this should almost never happen) and it can also be + // the server (a local operation, so this should almost never happen); it can also be // an error when connecting to the proxy server Logs.LogMessage(logUID, LoadStr(listenError ? IDS_LOGMSGOPENACTDATACONERROR : IDS_LOGMSGOPENACTDATACONERROR2), -1, TRUE); } @@ -1380,7 +1380,7 @@ CListingCacheItem::CListingCacheItem(const char* host, unsigned short port, cons if (CachedListing != NULL && cachedListing != NULL) { memcpy(CachedListing, cachedListing, cachedListingLen); - CachedListing[cachedListingLen] = 0; // once it is allocated there, make it null-terminated for debugging purposes + CachedListing[cachedListingLen] = 0; // If it is already allocated, make it null-terminated for debugging purposes } else err = TRUE; @@ -1496,7 +1496,7 @@ BOOL CListingCache::GetPathListing(const char* host, unsigned short port, const if (*cachedListing != NULL) { memcpy(*cachedListing, item->CachedListing, item->CachedListingLen); - (*cachedListing)[item->CachedListingLen] = 0; // once it is allocated there, make it null-terminated for debugging purposes + (*cachedListing)[item->CachedListingLen] = 0; // since it is already allocated, make it null-terminated for debugging purposes *cachedListingLen = item->CachedListingLen; } else @@ -1620,7 +1620,7 @@ void CListingCache::AcceptChangeOnPathNotification(const char* userPart, BOOL in HANDLES(EnterCriticalSection(&CacheCritSect)); - int delIndex = 0; // variables for deleting in blocks (shifting the array is O(N*N), so we optimize) + int delIndex = 0; // variables for block deletion (shifting the array is O(N*N), so we optimize) int delCount = 0; int i; for (i = 0; i < Cache.Count; i++) From 83234a9b25c6151019cae256e76d6e708dc54276 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 9 Apr 2026 21:54:50 +0200 Subject: [PATCH 024/710] [tanslation] Fix src/plugins/ftp/ctrlcon5.cpp comments (#395) --- src/plugins/ftp/ctrlcon5.cpp | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/plugins/ftp/ctrlcon5.cpp b/src/plugins/ftp/ctrlcon5.cpp index d1524a60a..0423fae18 100644 --- a/src/plugins/ftp/ctrlcon5.cpp +++ b/src/plugins/ftp/ctrlcon5.cpp @@ -70,7 +70,7 @@ void CControlConnectionSocket::DownloadOneFile(HWND parent, const char* fileName char replyBuf[700]; BOOL setStartTimeIfConnected = TRUE; BOOL sslErrReconnect = FALSE; // TRUE = reconnect because of SSL errors - BOOL fastSSLErrReconnect = FALSE; // TRUE = server certificate changed, an immediate reconnect is desirable (without 20 seconds of waiting) + BOOL fastSSLErrReconnect = FALSE; // TRUE = the server certificate changed; an immediate reconnect is desirable (without waiting 20 seconds) while (ReconnectIfNeeded(notInPanel, panel == PANEL_LEFT, parent, userBuf, userBufSize, &reconnected, setStartTimeIfConnected, totalAttemptNum, @@ -109,7 +109,7 @@ void CControlConnectionSocket::DownloadOneFile(HWND parent, const char* fileName userBuf, userBufSize, &success, replyBuf, 700, NULL, totalAttemptNum, NULL, TRUE, NULL); - if (ok && !success && workPath[0] != 0) // send succeeded but the server reports an error (+ignore errors with an empty path) -> file cannot be + if (ok && !success && workPath[0] != 0) // send succeeded but the server reports an error (+ignore errors with an empty path) -> file cannot be downloaded { // downloaded (it is on the current path in the panel) _snprintf_s(errBuf, _TRUNCATE, LoadStr(IDS_CHANGEWORKPATHERROR), workPath, replyBuf); SalamanderGeneral->SalMessageBox(parent, errBuf, LoadStr(IDS_FTPERRORTITLE), @@ -184,7 +184,7 @@ void CControlConnectionSocket::DownloadOneFile(HWND parent, const char* fileName else // failed to open the "listen" socket for accepting the data connection from the server -> { // connection closed (so the standard Retry can be used) ok = FALSE; - if (canRetry) // "retry" is allowed, proceed to the next reconnect + if (canRetry) // "retry" is allowed, proceed to the next reconnect attempt { run = TRUE; retryMsgAux = retryMsgBuf; @@ -192,7 +192,7 @@ void CControlConnectionSocket::DownloadOneFile(HWND parent, const char* fileName } } - if (ok) // if we are still connected, change the transfer mode according to 'asciiMode' (ignore success) + if (ok) // if we are still connected, change the transfer mode according to 'asciiMode' (ignore the result) { if (!SetCurrentTransferMode(parent, asciiMode, NULL, NULL, 0, FALSE, &canRetry, retryMsgBuf, 300)) @@ -234,7 +234,7 @@ void CControlConnectionSocket::DownloadOneFile(HWND parent, const char* fileName int asciiTrForBinFileHowToSolve = 0; if (dataConnection->IsAsciiTrForBinFileProblem(&asciiTrForBinFileHowToSolve)) { // the "ascii transfer mode for binary file" problem was detected - if (asciiTrForBinFileHowToSolve == 0) // we should ask the user + if (asciiTrForBinFileHowToSolve == 0) // ask the user { INT_PTR res = CViewErrAsciiTrForBinFileDlg(parent).Execute(); if (res == IDOK) @@ -405,7 +405,7 @@ void CControlConnectionSocket::DownloadOneFile(HWND parent, const char* fileName dataConnection->WaitForFileClose(5000); // max. 5 seconds if (run) // go for another attempt; clean the target file just in case (it may have been created before the error/interruption) - { // we are not in any critical section, so even if the disk operation stalls for a while, nothing happens + { // we are not in any critical section, so it does not matter if the disk operation stalls for a while SetFileAttributes(tgtFileName, FILE_ATTRIBUTE_NORMAL); DeleteFile(tgtFileName); } @@ -420,7 +420,7 @@ void CControlConnectionSocket::DownloadOneFile(HWND parent, const char* fileName if (*newFileSize != CQuadWord(0, 0)) TRACE_E("CControlConnectionSocket::DownloadOneFile(): unexpected situation: file was not created, but its size is not null!"); - // we are not in any critical section, so even if the disk operation stalls for a while, nothing happens + // we are not in any critical section, so it does not matter if the disk operation stalls for a while SetFileAttributes(tgtFileName, FILE_ATTRIBUTE_NORMAL); // so a read-only file can be overwritten HANDLE file = HANDLES_Q(CreateFile(tgtFileName, GENERIC_WRITE, FILE_SHARE_READ, NULL, @@ -453,8 +453,8 @@ void CControlConnectionSocket::DownloadOneFile(HWND parent, const char* fileName } } - if (dataConnection->IsConnected()) // close the "data connection" if needed; the system attempts a "graceful" - dataConnection->CloseSocketEx(NULL); // shutdown (we do not learn the result) + if (dataConnection->IsConnected()) // close the "data connection" if needed; the system attempts a "graceful" shutdown + dataConnection->CloseSocketEx(NULL); // shutdown (the result is not available) if (!run) break; @@ -530,7 +530,7 @@ BOOL CControlConnectionSocket::CreateDir(char* changedPath, HWND parent, char* n userBuf, userBufSize, &success, replyBuf, 700, NULL, totalAttemptNum, NULL, TRUE, NULL); - if (ok && !success && workPath[0] != 0) // send succeeded but the server reports an error (+ignore errors with an empty path) -> file cannot be + if (ok && !success && workPath[0] != 0) // send succeeded, but the server reports an error (+ignore errors with an empty path) -> file cannot be downloaded { // downloaded (it is on the current path in the panel) _snprintf_s(errBuf, _TRUNCATE, LoadStr(IDS_CHANGEWORKPATHERROR), workPath, replyBuf); SalamanderGeneral->SalMessageBox(parent, errBuf, LoadStr(IDS_FTPERRORTITLE), @@ -561,7 +561,7 @@ BOOL CControlConnectionSocket::CreateDir(char* changedPath, HWND parent, char* n UploadListingCache.ReportCreateDirs(hostBuf, userBuffer, portBuf, workPath, GetFTPServerPathType(workPath), newName, FALSE); } - if (FTP_DIGIT_1(ftpReplyCode) == FTP_D1_SUCCESS && // success is returned (should be 257) + if (FTP_DIGIT_1(ftpReplyCode) == FTP_D1_SUCCESS && // a success reply is returned (should be 257) FTPGetDirectoryFromReply(replyBuf, (int)strlen(replyBuf), newPath, FTP_MAX_PATH)) { // directory 'newPath' has just been created newName[0] = 0; // no focus after refresh yet @@ -578,12 +578,12 @@ BOOL CControlConnectionSocket::CreateDir(char* changedPath, HWND parent, char* n if (FTPIsTheSameServerPath(pathType, newPath, workPath)) lstrcpyn(newName, cutDir, 2 * MAX_PATH); // directory name for focus after the refresh } - else // probably the server returns a relative directory name in reply "257" (e.g. warftpd) + else // the server probably returns a relative directory name in reply "257" (e.g. warftpd) { lstrcpyn(newName, newPath, 2 * MAX_PATH); // directory name for focus after the refresh } } - else // error (including unexpected format of reply "257") + else // error (including an unexpected format of reply "257") { if (!retSuccess) // do not display an error message for a successful reply { @@ -706,7 +706,7 @@ BOOL CControlConnectionSocket::QuickRename(char* changedPath, HWND parent, const userBuf, userBufSize, &success, replyBuf, 700, NULL, totalAttemptNum, NULL, TRUE, NULL); - if (ok && !success && workPath[0] != 0) // send succeeded but the server reports an error (+ignore errors with an empty path) -> file cannot be + if (ok && !success && workPath[0] != 0) // send succeeded, but the server reports an error (+ignore errors for an empty path) -> file cannot be downloaded { // downloaded (it is on the current path in the panel) _snprintf_s(errBuf, _TRUNCATE, LoadStr(IDS_CHANGEWORKPATHERROR), workPath, replyBuf); SalamanderGeneral->SalMessageBox(parent, errBuf, LoadStr(IDS_FTPERRORTITLE), @@ -733,7 +733,7 @@ BOOL CControlConnectionSocket::QuickRename(char* changedPath, HWND parent, const &ftpReplyCode, replyBuf, 700, FALSE, FALSE, FALSE, &canRetry, retryMsgBuf, 300, NULL)) { - if (FTP_DIGIT_1(ftpReplyCode) == FTP_D1_SUCCESS) // success is returned (should be 250) + if (FTP_DIGIT_1(ftpReplyCode) == FTP_D1_SUCCESS) // success returned (should be 250) { // quick rename completed successfully - leave the new name in 'newName' so it can be focused after the refresh retSuccess = TRUE; if (workPath[0] != 0) @@ -840,7 +840,7 @@ BOOL CControlConnectionSocket::OpenForListeningAndWaitForRes(HWND parent, CDataC CSetWaitCursorWindow* winParent = NULL; if (parentIsEnabled) // we cannot leave the parent enabled (the wait window is not modal) { - // store the focus from 'parent' (if the focus is not from 'parent', save NULL) + // save the focused window from 'parent' (if the focus is not in 'parent', save NULL) focusedWnd = GetFocus(); HWND hwnd = focusedWnd; while (hwnd != NULL && hwnd != parent) @@ -864,7 +864,7 @@ BOOL CControlConnectionSocket::OpenForListeningAndWaitForRes(HWND parent, CDataC HANDLES(EnterCriticalSection(&SocketCritSect)); int logUID = LogUID; // log UID of this connection - BOOL handleKeepAlive = KeepAliveMode != kamForbidden; // TRUE if keep-alive is not handled one level above (it must be handled here) + BOOL handleKeepAlive = KeepAliveMode != kamForbidden; // TRUE if keep-alive is not handled at a higher level (it must be handled here) DWORD auxServerIP = ServerIP; int proxyPort = ProxyServer != NULL ? ProxyServer->ProxyPort : 0; HANDLES(LeaveCriticalSection(&SocketCritSect)); @@ -999,7 +999,7 @@ BOOL CControlConnectionSocket::OpenForListeningAndWaitForRes(HWND parent, CDataC } doNotCloseCon = TRUE; } - else // connection error on the proxy server; log the error, close the control connection, and perform "retry" + else // connection error when connecting to the proxy server; log the error, close the control connection, and retry { in_addr srvAddr; srvAddr.s_addr = auxServerIP; From a648fdf840e92eb70c629727f177fc87035394d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 9 Apr 2026 22:11:06 +0200 Subject: [PATCH 025/710] [tanslation] Fix src/plugins/ftp/datacon.h comments (#396) --- src/plugins/ftp/datacon.h | 58 +++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/src/plugins/ftp/datacon.h b/src/plugins/ftp/datacon.h index 583dc6605..98c3201aa 100644 --- a/src/plugins/ftp/datacon.h +++ b/src/plugins/ftp/datacon.h @@ -188,7 +188,7 @@ class CDataConnectionSocket : public CDataConnectionBaseSocket // shared among all threads - set to "signaled" after the "data connection" closes (after receiving all bytes) and also after the flush to disk is completed (see TgtDiskFileName) HANDLE TransferFinished; - HWND WindowWithStatus; // handle of the window that should receive notifications about changes in the "data connection" state (NULL = do not send anything) + HWND WindowWithStatus; // handle of the window that should receive messages about changes in the "data connection" state (NULL = do not send anything) UINT StatusMessage; // message sent when the "data connection" state changes BOOL StatusMessageSent; // TRUE = the previous message has not been delivered yet, so there is no point sending another one @@ -245,7 +245,7 @@ class CDataConnectionSocket : public CDataConnectionBaseSocket // returns NetEventLastError, ReadBytesLowMemory, TgtFileLastError, NoDataTransTimeout, // SSLErrorOccured, DecomprErrorOccured - // (these use a critical section) + // (protected by a critical section) void GetError(DWORD* netErr, BOOL* lowMem, DWORD* tgtFileErr, BOOL* noDataTransTimeout, int* sslErrorOccured, BOOL* decomprErrorOccured); @@ -287,8 +287,8 @@ class CDataConnectionSocket : public CDataConnectionBaseSocket void SetDirectFlushParams(const char* tgtFileName, CCurrentTransferMode currentTransferMode); // returns the state of the target file when flushing data directly to the TgtDiskFileName file; - // in 'fileCreated' it returns TRUE if the file was created; in 'fileSize' it returns the size - // of the file + // returns TRUE in 'fileCreated' if the file was created; returns the size + // of the file in 'fileSize' void GetTgtFileState(BOOL* fileCreated, CQuadWord* fileSize); // called after the data transfer finishes (successful or not); meaningful only when flushing @@ -296,14 +296,14 @@ class CDataConnectionSocket : public CDataConnectionBaseSocket void CloseTgtFile(); // called by the worker after data flushing finishes; 'flushBuffer' is the buffer that was just flushed - // (it is therefore returned to this object - retrieve it via GiveFlushData(); - // WARNING: it can also be a buffer from 'DecomprDataBuffer'); if there is more data to flush, - // the buffers are swapped and WorkerMsgFlushData is posted to the worker; if necessary it will also post - // FD_READ or FD_CLOSE to this socket (see NeedFlushReadBuf); + // (it is thus returned to this object - see GiveFlushData() to retrieve it; + // WARNING: it can also be a buffer from 'DecomprDataBuffer'); if more data need to be flushed, + // the buffers are swapped and WorkerMsgFlushData is posted to the worker; if needed, + // FD_READ or FD_CLOSE is also posted to this socket (see NeedFlushReadBuf); // 'enterSocketCritSect' is TRUE except for the exception described below // WARNING: this method must not be called from the SocketCritSect critical section (the method uses - // SocketsThread), exception: if we are in CSocketsThread::CritSect and - // SocketCritSect, the call is possible if we set 'enterSocketCritSect' to FALSE + // SocketsThread); exception: if the caller is in both CSocketsThread::CritSect and + // SocketCritSect, the call is allowed if 'enterSocketCritSect' is set to FALSE void FlushDataFinished(char* flushBuffer, BOOL enterSocketCritSect); // if new data are present in FlushBuffer it returns TRUE and the data in 'flushBuffer' @@ -320,10 +320,10 @@ class CDataConnectionSocket : public CDataConnectionBaseSocket // were flushed) void FreeFlushData(); - // called after this data connection closes; returns TRUE if all data are - // flushed (meaning the data connection no longer contains any data); if 'onlyTest' + // called after this data connection is closed; returns TRUE if all data are + // flushed (that is, the data connection no longer contains any data); if 'onlyTest' // is FALSE and necessary, it swaps buffers and posts WorkerMsgFlushData - // to the worker (flush the data); it returns TRUE only after FlushDataFinished is called for + // to the worker to flush the data; returns TRUE only after FlushDataFinished is called for // the last flushed data // WARNING: this method must not be called from the SocketCritSect critical section (the method uses // SocketsThread) @@ -338,10 +338,10 @@ class CDataConnectionSocket : public CDataConnectionBaseSocket // if data are being flushed; otherwise returns FALSE BOOL IsFlushingDataToDisk(); - // returns TRUE if the "ASCII transfer mode for binary file" problem needs to be handled, then - // in 'howToSolve' it returns how to handle the problem: 0 = ask the user, 1 = download - // again in binary mode, 2 = interrupt the file download (cancel); returns FALSE if - // the problem did not occur or the user chose: ignore (finish the download in ASCII + // returns TRUE if the "ASCII transfer mode for binary file" problem needs to be handled; in + // 'howToSolve' it stores how to handle it: 0 = ask the user, 1 = download + // again in binary mode, 2 = cancel the file download; returns FALSE if + // the problem did not occur or the user chose to ignore it (finish the download in ASCII // mode) BOOL IsAsciiTrForBinFileProblem(int* howToSolve); @@ -400,7 +400,7 @@ class CDataConnectionSocket : public CDataConnectionBaseSocket // a Windows error code (came with FD_CLOSE or occurred while handling FD_CLOSE) virtual void SocketWasClosed(DWORD error); - // receiving a timer with ID 'id' and parameter 'param' + // receives a timer with ID 'id' and parameter 'param' virtual void ReceiveTimer(DWORD id, void* param); // receiving a posted message with ID 'id' and parameter 'param' @@ -473,7 +473,7 @@ class CUploadDataConnectionSocket : public CDataConnectionBaseSocket BOOL IsGood() { return BytesToWrite != NULL && FlushBuffer != NULL; } - // returns NetEventLastError, NoDataTransTimeout, and SSLErrorOccured (use a critical section) + // returns NetEventLastError, NoDataTransTimeout, and SSLErrorOccured (protected by a critical section) void GetError(DWORD* netErr, BOOL* noDataTransTimeout, int* sslErrorOccured); // just calls CloseSocket() + sets SocketCloseTime @@ -515,10 +515,10 @@ class CUploadDataConnectionSocket : public CDataConnectionBaseSocket // called by the worker after finishing reading data from disk; 'flushBuffer' is the buffer that was just filled; // if the second data buffer is free and we have not reached the end of the file yet, - // the buffers are swapped and WorkerMsgPrepareData is posted to the worker; if necessary it will also post - // FD_WRITE to this socket (see WaitingForWriteEvent); with compression it ensures - // gradually fills the FlushBuffer with compressed data (until it is full and we are not - // at the end of the file, posts WorkerMsgPrepareData to the worker) + // the buffers are swapped and WorkerMsgPrepareData is posted to the worker; if needed, it also posts + // FD_WRITE to this socket (see WaitingForWriteEvent); with compression, it ensures that + // FlushBuffer is gradually filled with compressed data (while it is not full and we are not yet at + // the end of the file, it posts WorkerMsgPrepareData to the worker) void DataBufferPrepared(char* flushBuffer, int validBytesInFlushBuffer, BOOL enterCS); // called by the worker after receiving the response to the STOR/APPE command from the server (upload is finished on the server side) @@ -567,7 +567,7 @@ class CUploadDataConnectionSocket : public CDataConnectionBaseSocket // a Windows error code (came with FD_CLOSE or occurred while handling FD_CLOSE) virtual void SocketWasClosed(DWORD error); - // receiving a timer with ID 'id' and parameter 'param' + // receives a timer with ID 'id' and parameter 'param' virtual void ReceiveTimer(DWORD id, void* param); // called after FD_ACCEPT is received and processed (assuming CSocket::ReceiveNetEvent is used for FD_ACCEPT) @@ -603,7 +603,7 @@ class CKeepAliveDataConSocket : public CSocket DWORD NetEventLastError; // code of the last error reported to ReceiveNetEvent() or that occurred in PassiveConnect() int SSLErrorOccured; // see constants SSLCONERR_XXX BOOL ReceivedConnected; // TRUE = the "data connection" opened (connect or accept); does not describe the current state - DWORD LastActivityTime; // GetTickCount() from when we last worked with the "data connection" (tracks initialization (SetPassive() and SetActive()), successful connect, and read) + DWORD LastActivityTime; // GetTickCount() value from the last activity on the "data connection" (tracks initialization (SetPassive() and SetActive()), a successful connect, and a read) DWORD SocketCloseTime; // GetTickCount() from the moment the "data connection" socket closed // used when closing the "data connection" (evaluates whether the keep-alive command has finished) @@ -621,11 +621,11 @@ class CKeepAliveDataConSocket : public CSocket CKeepAliveDataConSocket(CControlConnectionSocket* parentControlSocket, CFTPProxyForDataCon* proxyServer, int encryptConnection, CCertificate* certificate); virtual ~CKeepAliveDataConSocket(); - // called when the "control connection" receives the server's response ('replyCode') - // announcing the end of the data transfer; returns TRUE if the transfer really finished (the + // called when the "control connection" receives the server response ('replyCode') + // indicating the end of the data transfer; returns TRUE if the transfer has actually finished (the // "data connection" can be released); returns FALSE if the transfer has not finished yet (the "data connection" // cannot be released); once the transfer actually ends, it indirectly calls SetupNextKeepAliveTimer() - // of the ParentControlSocket object + // on the ParentControlSocket object BOOL FinishDataTransfer(int replyCode); // returns TRUE if the "data connection" is open for data transfer (the connection to the server has already been established) @@ -708,7 +708,7 @@ class CKeepAliveDataConSocket : public CSocket // a Windows error code (came with FD_CLOSE or occurred while handling FD_CLOSE) virtual void SocketWasClosed(DWORD error); - // timer reception with ID 'id' and parameter 'param' + // receives a timer with ID 'id' and parameter 'param' virtual void ReceiveTimer(DWORD id, void* param); // called after FD_ACCEPT is received and processed (assuming CSocket::ReceiveNetEvent is used for FD_ACCEPT) From f324d817e89489c3a9b94053a68643f92fd95d2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 9 Apr 2026 22:25:13 +0200 Subject: [PATCH 026/710] [tanslation] Fix src/plugins/ftp/datacon1.cpp comments (#397) --- src/plugins/ftp/datacon1.cpp | 54 ++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/plugins/ftp/datacon1.cpp b/src/plugins/ftp/datacon1.cpp index ecdb3d359..d7850b8a7 100644 --- a/src/plugins/ftp/datacon1.cpp +++ b/src/plugins/ftp/datacon1.cpp @@ -131,7 +131,7 @@ BOOL CDataConnectionBaseSocket::PassiveConnect(DWORD* error) conRes = Connect(auxServerIP, auxServerPort, &err); } BOOL ret = TRUE; - if (!conRes) // there is no hope for success + if (!conRes) // no chance of success { HANDLES(EnterCriticalSection(&SocketCritSect)); NetEventLastError = err; // record the error (except fatal errors such as insufficient memory, etc.) @@ -824,7 +824,7 @@ void CDataConnectionSocket::ReceivePostMessage(DWORD id, void* param) } TgtFileLastError = DiskWork.WinError; // store the error when creating/writing to the target file - CloseSocketEx(NULL); // shut down (we will not learn about the result) + CloseSocketEx(NULL); // shutdown (we will not learn the result) FreeFlushData(); // since we are already in the CSocketsThread::CritSect section, this call // can also be made from the CSocket::SocketCritSect section (no deadlock risk) @@ -844,8 +844,8 @@ void CDataConnectionSocket::JustConnected() { ReceivedConnected = TRUE; // if FD_READ arrives before FD_CONNECT (either way it must be connected) TransferSpeedMeter.JustConnected(); - // since we are already in the CSocketsThread::CritSect section, this call - // can also be made from the CSocket::SocketCritSect section (no deadlock risk) + // Since we are already in CSocketsThread::CritSect, this call + // is allowed even from CSocket::SocketCritSect (no deadlock risk) DoPostMessageToWorker(WorkerMsgConnectedToServer); // since we are already in the CSocketsThread::CritSect section, this call // can also be made from the CSocket::SocketCritSect section (no deadlock risk) @@ -907,21 +907,21 @@ void CDataConnectionSocket::MoveReadBytesToFlushBuffer() void CDataConnectionSocket::ReceiveNetEvent(LPARAM lParam, int index) { SLOW_CALL_STACK_MESSAGE3("CDataConnectionSocket::ReceiveNetEvent(0x%IX, %d)", lParam, index); - DWORD eventError = WSAGETSELECTERROR(lParam); // extract error code of event + DWORD eventError = WSAGETSELECTERROR(lParam); // extract the event error code BOOL logLastErr = FALSE; switch (WSAGETSELECTEVENT(lParam)) // extract event { case FD_CLOSE: // sometimes arrives before the last FD_READ, so we first try FD_READ and if it succeeds, post FD_CLOSE again (FD_READ may succeed again before it) case FD_READ: { - BOOL sendFDCloseAgain = FALSE; // TRUE = FD_CLOSE arrived and there was data to read (handled as FD_READ) => post FD_CLOSE again (the current FD_CLOSE was a false alarm) + BOOL sendFDCloseAgain = FALSE; // TRUE = FD_CLOSE arrived and there was data to read (handled as FD_READ), so post FD_CLOSE again (the current FD_CLOSE was spurious) BOOL skipSendingOfFDClose = FALSE; // TRUE = FD_CLOSE arrived and we are waiting for the data flush, so delay it (do not process it now) HANDLES(EnterCriticalSection(&SocketCritSect)); if (ReceivedConnected || UsePassiveMode) // ignore closing of the "listen" socket { if (eventError == NO_ERROR) // only if no error occurred (according to the help only WSAENETDOWN can happen) { - if (UsePassiveMode) // for an active connection we have to wait for FD_ACCEPT (this socket is the "listen" one, and only then comes the "data connection") + if (UsePassiveMode) // for a passive connection we have to wait for FD_ACCEPT (this socket is the "listen" socket, and only then comes the "data connection") { if (!ReceivedConnected) JustConnected(); @@ -1044,12 +1044,12 @@ void CDataConnectionSocket::ReceiveNetEvent(LPARAM lParam, int index) sendFDCloseAgain = TRUE; // if no timer for flushing data with the DATACON_FLUSHTIMEOUT timeout has been created yet, - // and at the same time the need to flush the buffer is not recorded (NeedFlushReadBuf == 0), - // then create a timer for flushing the data + // and the need to flush the buffer has not yet been recorded (NeedFlushReadBuf == 0), + // create a timer for flushing the data if (!FlushTimerAdded && NeedFlushReadBuf == 0) { - // since we are already in the CSocketsThread::CritSect section, this call - // can also be made from the CSocket::SocketCritSect section (no deadlock risk) + // since we are already in CSocketsThread::CritSect, this call + // can also be made from CSocket::SocketCritSect (no deadlock risk) FlushTimerAdded = SocketsThread->AddTimer(Msg, UID, GetTickCount() + DATACON_FLUSHTIMEOUT, DATACON_FLUSHTIMERID, NULL); } @@ -1142,12 +1142,12 @@ void CDataConnectionSocket::ReceiveNetEvent(LPARAM lParam, int index) len = SSLLib.SSL_read(SSLConn, ReadBytes + ValidBytesInReadBytesBuf, ReadBytesAllocatedSize - ValidBytesInReadBytesBuf); } - if (len >= 0) // we may have read something (0 = the connection is already closed) + if (len >= 0) // data may have been read (0 = the connection is already closed) { if (len > 0) { - ValidBytesInReadBytesBuf += len; // adjust the number of bytes already read by the newly read ones - TotalReadBytesCount += CQuadWord(len, 0); // adjust the total number of bytes already read by the newly read ones + ValidBytesInReadBytesBuf += len; // adjust the number of bytes already read by the newly read bytes + TotalReadBytesCount += CQuadWord(len, 0); // add the newly read bytes to the total number of bytes already read LastActivityTime = GetTickCount(); // successfully read bytes from the socket if (GlobalLastActivityTime != NULL) GlobalLastActivityTime->Set(LastActivityTime); @@ -1223,7 +1223,7 @@ void CDataConnectionSocket::ReceiveNetEvent(LPARAM lParam, int index) // now process FD_CLOSE if (WSAGETSELECTEVENT(lParam) == FD_CLOSE && !skipSendingOfFDClose) { - if (sendFDCloseAgain) // FD_CLOSE came instead of FD_READ => post FD_CLOSE again + if (sendFDCloseAgain) // FD_CLOSE arrived instead of FD_READ => post FD_CLOSE again { PostMessage(SocketsThread->GetHiddenWindow(), WM_APP_SOCKET_MIN + index, (WPARAM)GetSocket(), lParam); @@ -1286,12 +1286,12 @@ void CDataConnectionSocket::SocketWasClosed(DWORD error) if (error != NO_ERROR) NetEventLastError = error; - // since we are already in the CSocketsThread::CritSect section, this call - // can also be made from the CSocket::SocketCritSect section (no deadlock risk) + // Since we are already in CSocketsThread::CritSect, this call + // is allowed even from CSocket::SocketCritSect (no deadlock risk) DoPostMessageToWorker(WorkerMsgConnectionClosed); - // since we are already in the CSocketsThread::CritSect section, this call - // can also be made from the CSocket::SocketCritSect section (no deadlock risk) + // Since we are already in CSocketsThread::CritSect, this call + // is allowed even from CSocket::SocketCritSect (no deadlock risk) SocketsThread->DeleteTimer(UID, DATACON_TESTNODATATRTIMERID); HANDLES(LeaveCriticalSection(&SocketCritSect)); @@ -1376,13 +1376,13 @@ void CDataConnectionSocket::CloseTgtFile() HANDLES(EnterCriticalSection(&SocketCritSect)); if (TgtDiskFileName[0] != 0) { - if (DiskWorkIsUsed) // if some disk flush is in progress, cancel it + if (DiskWorkIsUsed) // if any disk flush is in progress, cancel it { BOOL workIsInProgress; if (FTPDiskThread->CancelWork(&DiskWork, &workIsInProgress)) { if (workIsInProgress) - DiskWork.FlushDataBuffer = NULL; // the work is in progress; we cannot free the buffer with the data being written/tested, leave it to the disk-work thread (see the cancellation part) - we can write to DiskWork because after Cancel the disk thread must no longer access it (it may no longer exist) + DiskWork.FlushDataBuffer = NULL; // the work is in progress; we cannot free the buffer with the data being written/tested, leave it to the disk-work thread (see the cancellation part) - DiskWork can be written because after Cancel the disk thread must no longer access it (it may no longer exist) else { // the work was cancelled before the disk thread started processing it - deallocate the flush buffer if (DiskWork.FlushDataBuffer != NULL) @@ -1392,7 +1392,7 @@ void CDataConnectionSocket::CloseTgtFile() } } } - else // the work is already finished, DATACON_DISKWORKWRITEFINISHED is supposedly on its way (has not arrived yet) + else // the work is already finished, DATACON_DISKWORKWRITEFINISHED should already be on its way (has not arrived yet) { if (DiskWork.FlushDataBuffer != NULL) // the flush buffer is now useless { @@ -1443,7 +1443,7 @@ BOOL CDataConnectionSocket::WaitForFileClose(DWORD timeout) if (tgtDiskFileCloseIndex != -1) return FTPDiskThread->WaitForFileClose(tgtDiskFileCloseIndex, timeout); - return FALSE; // the file probably was not opened at all (or the closing+delete is handled on the disk-work thread - cancellation during the first create+flush disk job) + return FALSE; // the file was probably never opened at all (or the close+delete operation is handled on the disk worker thread - cancellation during the first create+flush disk task) } void CDataConnectionSocket::SetDataTotalSize(CQuadWord const& size) @@ -1551,7 +1551,7 @@ BOOL CDataConnectionSocket::GiveFlushData(char** flushBuffer, int* validBytesInF { int newBytes = (DecomprDataAllocatedSize - DecomprDataDelayedBytes - ZLIBInfo.avail_out) - (ValidBytesInFlushBuffer - AlreadyDecomprPartOfFlushBuffer - ZLIBInfo.avail_in); - if (newBytes != 0) // balance the difference caused by decompression (WARNING: it can also be negative) + if (newBytes != 0) // adjust for the difference caused by decompression (WARNING: it can also be negative) { if (newBytes > 0) { @@ -1580,7 +1580,7 @@ BOOL CDataConnectionSocket::GiveFlushData(char** flushBuffer, int* validBytesInF { *flushBuffer = DecomprDataBuffer; if (err != SAL_Z_STREAM_END && !isFirstDecompFromFlushBuffer && *validBytesInFlushBuffer < DecomprDataAllocatedSize) - { // when continuing to decompress data from FlushBuffer, if it is not the end of the file and the DecomprDataBuffer was not filled (fill level depends on compression ratio, in extreme cases it may be just a single byte), wait with writing to the file until the next cycle (to avoid unnecessary fragmentation) + { // when continuing to decompress data from FlushBuffer, if this is not the end of the file and DecomprDataBuffer is not full (the fill level depends on the compression ratio and in extreme cases may be just one byte), postpone writing to the file until the next cycle (to avoid unnecessary fragmentation) // TRACE_I("flushing: buffer is not full (only " << *validBytesInFlushBuffer << " bytes), waiting..."); DecomprDataDelayedBytes = *validBytesInFlushBuffer; *validBytesInFlushBuffer = 0; // do not write an empty buffer @@ -1658,8 +1658,8 @@ void CDataConnectionSocket::FlushDataFinished(char* flushBuffer, BOOL enterSocke if (CompressData && AlreadyDecomprPartOfFlushBuffer < ValidBytesInFlushBuffer) { // if it is necessary to continue decompressing data from 'FlushBuffer' - // since we are already in the CSocketsThread::CritSect section, this call - // can also be made from the CSocket::SocketCritSect section (no deadlock risk) + // Since we are already in CSocketsThread::CritSect, this call + // is allowed even from CSocket::SocketCritSect (no deadlock risk) DoPostMessageToWorker(WorkerMsgFlushData); // if this is direct flushing of data to a file from the data connection, perform it here From 9f08ae60021caea002f1a48a534c4480f1ade971 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 9 Apr 2026 22:36:33 +0200 Subject: [PATCH 027/710] [tanslation] Fix src/plugins/ftp/datacon2.cpp comments (#398) --- src/plugins/ftp/datacon2.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/plugins/ftp/datacon2.cpp b/src/plugins/ftp/datacon2.cpp index 52b136eec..e89e02a9b 100644 --- a/src/plugins/ftp/datacon2.cpp +++ b/src/plugins/ftp/datacon2.cpp @@ -456,7 +456,7 @@ void CKeepAliveDataConSocket::ConnectionAccepted(BOOL success, DWORD winError, B JustConnected(); LastActivityTime = GetTickCount(); // a successful accept occurred } - else // an error occurred - log it at least + else // error: log it at least { NetEventLastError = winError; if (proxyError && NetEventLastError == NO_ERROR) @@ -468,20 +468,20 @@ void CKeepAliveDataConSocket::ConnectionAccepted(BOOL success, DWORD winError, B void CKeepAliveDataConSocket::ReceiveNetEvent(LPARAM lParam, int index) { CALL_STACK_MESSAGE3("CKeepAliveDataConSocket::ReceiveNetEvent(0x%IX, %d)", lParam, index); - DWORD eventError = WSAGETSELECTERROR(lParam); // extract error code of event + DWORD eventError = WSAGETSELECTERROR(lParam); // extract the event error code BOOL logLastErr = FALSE; switch (WSAGETSELECTEVENT(lParam)) // extract event { case FD_CLOSE: // sometimes arrives before the final FD_READ, so try FD_READ first and if it succeeds post FD_CLOSE again (another FD_READ may still succeed before it) case FD_READ: { - BOOL sendFDCloseAgain = FALSE; // TRUE = FD_CLOSE arrived and there was data to read (handled as FD_READ) => post FD_CLOSE again (the current FD_CLOSE was a false alarm) + BOOL sendFDCloseAgain = FALSE; // TRUE = FD_CLOSE arrived and there was data to read (handled as FD_READ) => post FD_CLOSE again (the current FD_CLOSE was premature) HANDLES(EnterCriticalSection(&SocketCritSect)); if (ReceivedConnected || UsePassiveMode) // ignore closing of the listen socket { if (eventError == NO_ERROR) // only if no error occurred (documentation says only WSAENETDOWN can happen) { - if (UsePassiveMode) // for an active connection we must wait for FD_ACCEPT (this socket is the listener, then the data connection) + if (UsePassiveMode) // for a passive connection we must wait for FD_ACCEPT (this socket is the listener, then the data connection) { if (!ReceivedConnected) JustConnected(); @@ -928,7 +928,7 @@ void CUploadDataConnectionSocket::UploadFinished() HANDLES(EnterCriticalSection(&SocketCritSect)); if (ConnectionClosedOnEOF && SkippedWriteAfterConnect > 0) - { // account bytes from local buffers in the upload speed (we are not sure the local buffers will be sent, but without them the speed on small files that fit almost entirely into local buffers would be completely wrong—absurdly low) + { // include bytes from local buffers in the upload speed (we are not sure the local buffers will be sent, but without them the speed for small files that fit almost entirely into local buffers would be completely wrong: absurdly low) DWORD ti = GetTickCount(); TransferSpeedMeter.BytesReceived(SkippedWriteAfterConnect, ti); if (GlobalTransferSpeedMeter != NULL) @@ -1017,7 +1017,7 @@ void CUploadDataConnectionSocket::ConnectionAccepted(BOOL success, DWORD winErro SSLErrorOccured = SSLCONERR_NOERROR; JustConnected(); } - else // an error occurred - log it at least + else // error: log it at least { NetEventLastError = winError; if (proxyError && NetEventLastError == NO_ERROR) @@ -1031,7 +1031,7 @@ DWORD GetPacketSizeEstimation(DWORD speed, DWORD tooBigPacketSize) if (tooBigPacketSize == -1) tooBigPacketSize = 1000000; // disable tooBigPacketSize if (speed < 4096 || tooBigPacketSize <= 1024) - return 512; // select this even if tooBigPacketSize forbids it (something must be chosen) + return 512; // choose this even if tooBigPacketSize forbids it (something must be chosen) else { if (speed < 8192 || tooBigPacketSize <= 4096) @@ -1108,7 +1108,7 @@ void CUploadDataConnectionSocket::MoveFlushBufferToBytesToWrite() void CUploadDataConnectionSocket::ReceiveNetEvent(LPARAM lParam, int index) { CALL_STACK_MESSAGE3("CUploadDataConnectionSocket::ReceiveNetEvent(0x%IX, %d)", lParam, index); - DWORD eventError = WSAGETSELECTERROR(lParam); // extract error code of event + DWORD eventError = WSAGETSELECTERROR(lParam); // extract the event error code BOOL logLastErr = FALSE; switch (WSAGETSELECTEVENT(lParam)) // extract event { @@ -1121,7 +1121,7 @@ void CUploadDataConnectionSocket::ReceiveNetEvent(LPARAM lParam, int index) WaitingForWriteEvent = FALSE; // assumption: starting the write will require posting FD_WRITE (if send returns a "would-block" error we switch the value to TRUE) if (eventError == NO_ERROR) { - if (UsePassiveMode) // for an active connection we must wait for FD_ACCEPT (this socket is the listener, then the data connection) + if (UsePassiveMode) // for a passive connection we must wait for FD_ACCEPT (this socket is the listener, then the data connection) { if (!ReceivedConnected) JustConnected(); // if FD_WRITE arrives before FD_CONNECT (it still must be connected) @@ -1206,7 +1206,7 @@ void CUploadDataConnectionSocket::ReceiveNetEvent(LPARAM lParam, int index) if (GlobalLastActivityTime != NULL) GlobalLastActivityTime->Set(LastActivityTime); if (LastActivityTime - FirstWriteAfterConnectTime > 100) - { // during upload the local buffer fills first (e.g. 8KB in 1ms or 45KB in 8ms when connected to localhost, apparently both send and receive buffers fill up), we do not measure the rate of this filling because it would artificially and unfairly boost the upload speed + { // during upload, the local buffer fills first (e.g. 8KB in 1ms or 45KB in 8ms when connected to localhost, apparently both send and receive buffers fill up); we do not measure this fill rate because it would artificially and meaninglessly increase the upload speed TransferSpeedMeter.BytesReceived(decomprSentLen, LastActivityTime); if (CompressData) ComprTransferSpeedMeter.BytesReceived(sentLen, LastActivityTime); @@ -1533,7 +1533,7 @@ void CUploadDataConnectionSocket::DataBufferPrepared(char* flushBuffer, int vali AlreadyComprPartOfFlushBuffer = (int)(ZLIBInfo.next_out - (BYTE*)FlushBuffer); DecomprBytesInFlushBuffer += validBytesInFlushBuffer - ZLIBInfo.avail_in; if (err == SAL_Z_STREAM_END) - EndOfFileReached = TRUE; // managed to compress all data and finish the stream == we are at the end of the file + EndOfFileReached = TRUE; // all data was compressed and the stream was finished == we are at the end of the file if (err < 0) TRACE_E("SalZLIB->Deflate returns unexpected error: " << err); else // successful compression From 84d8db9e3eee737df895178372e1ae39f51fb1c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 9 Apr 2026 23:07:36 +0200 Subject: [PATCH 028/710] [tanslation] Fix src/plugins/ftp/dialogs1.cpp comments (#399) --- src/plugins/ftp/dialogs1.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/plugins/ftp/dialogs1.cpp b/src/plugins/ftp/dialogs1.cpp index 2a7d1774e..dd7625792 100644 --- a/src/plugins/ftp/dialogs1.cpp +++ b/src/plugins/ftp/dialogs1.cpp @@ -27,7 +27,7 @@ CCenteredDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) // horizontal and vertical centering of the dialog relative to the parent if (Parent != NULL) SalamanderGeneral->MultiMonCenterWindow(HWindow, Parent, TRUE); - break; // I want the focus from DefDlgProc + break; // Let DefDlgProc set the focus } } return CDialog::DialogProc(uMsg, wParam, lParam); @@ -538,7 +538,7 @@ CConfigPageDefaults::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) HWND combo = GetDlgItem(HWindow, IDC_PROXYSERVER); int sel = (int)SendMessage(combo, CB_GETCURSEL, 0, 0); int count = (int)SendMessage(combo, CB_GETCOUNT, 0, 0); - int fixedItems = 1; // this will be 2 for "not used" + "default" + int fixedItems = 1; // this will be 2 for "not used" and "default" EnableMenuItem(subMenu, CM_EDITPROXYSRV, MF_BYCOMMAND | ((sel != CB_ERR && count != CB_ERR ? sel >= fixedItems : FALSE) ? MF_ENABLED : MF_DISABLED | MF_GRAYED)); EnableMenuItem(subMenu, CM_DELETEPROXYSRV, MF_BYCOMMAND | ((sel != CB_ERR && count != CB_ERR ? sel >= fixedItems : FALSE) ? MF_ENABLED : MF_DISABLED | MF_GRAYED)); EnableMenuItem(subMenu, CM_MOVEUPPROXYSRV, MF_BYCOMMAND | ((sel != CB_ERR && count != CB_ERR ? sel > fixedItems : FALSE) ? MF_ENABLED : MF_DISABLED | MF_GRAYED)); @@ -647,7 +647,7 @@ class CCenteredPropertyWindow : public CWindow case WM_APP + 1000: // we should detach from the dialog (already centered) { DetachWindow(); - delete this; // a bit hacky, but nothing touches 'this' anymore, so it's fine + delete this; // a bit of a hack, but 'this' will no longer be accessed afterward return 0; } } @@ -821,7 +821,7 @@ CBookmarksListbox::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) break; } } - break; // let the keys propagate, the listbox should not handle them, no problem + break; // pass the keys on; the listbox should not process them } case WM_LBUTTONDBLCLK: @@ -1210,7 +1210,7 @@ void CConnectDlg::RefreshList(BOOL focusLast) void CConnectDlg::MoveItem(HWND list, int fromIndex, int toIndex, int topIndex) { - if (fromIndex > 0 && toIndex > 0 && fromIndex != toIndex && // nobody is allowed to move the quick-connect entry + if (fromIndex > 0 && toIndex > 0 && fromIndex != toIndex && // the quick-connect entry must not be moved fromIndex <= TmpFTPServerList.Count && toIndex <= TmpFTPServerList.Count) // movement stays within the array { fromIndex--; @@ -1411,7 +1411,7 @@ CConnectDlg::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) SendMessage(HWindow, WM_NEXTDLGCTL, (WPARAM)button, TRUE); PostMessage(HWindow, uMsg, wParam, lParam); // postpone this command CanChangeFocus = FALSE; // prevents an infinite loop - return TRUE; // do nothing; wait for the kill focus in the edit boxes + return TRUE; // do nothing; wait for the edit boxes to lose focus } CanChangeFocus = TRUE; @@ -1442,7 +1442,7 @@ CConnectDlg::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) HWND wnd = GetFocus(); while (wnd != NULL && wnd != ctrl) wnd = GetParent(wnd); - if (wnd == NULL) // set focus only if the control is not an ancestor of GetFocus + if (wnd == NULL) // set focus only if the control is not an ancestor of the window returned by GetFocus { // for example, the edit line in the combo box SendMessage(HWindow, WM_NEXTDLGCTL, (WPARAM)ctrl, TRUE); } @@ -1466,7 +1466,7 @@ CConnectDlg::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) // if the connection needs passwords, we must be able to decrypt them // test the bookmark if (!s->EnsurePasswordCanBeDecrypted(HWindow)) - return TRUE; // failed to enter the master password or it probably failed to decrypt the password + return TRUE; // the master password was not entered, or the password probably could not be decrypted with it // WARNING: s->EnsurePasswordCanBeDecrypted() might have cleared the password in 's' and its stored copy, which means // returning to the dialog (return TRUE) requires performing a "refresh" @@ -1481,7 +1481,7 @@ CConnectDlg::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) SelChanged(); EnableControls(); - return TRUE; // failed to enter the master password or they could not decrypt the password + return TRUE; // master password entry failed or the password could not be decrypted } } break; From bc9f893075beb4e915a2a79cd7d935721145f2d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 9 Apr 2026 23:21:14 +0200 Subject: [PATCH 029/710] [tanslation] Fix src/plugins/ftp/dialogs2.cpp comments (#400) --- src/plugins/ftp/dialogs2.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/plugins/ftp/dialogs2.cpp b/src/plugins/ftp/dialogs2.cpp index d0d42e052..c7cebeb66 100644 --- a/src/plugins/ftp/dialogs2.cpp +++ b/src/plugins/ftp/dialogs2.cpp @@ -411,7 +411,7 @@ void CLogsDlg::LoadLog(int updateUID) if (updateUID != -1) // the log with UID 'updateUID' should be updated { - BOOL found = (actLogUID == updateUID); // TRUE = the combo has the updated log with UID 'actLogUID' selected + BOOL found = (actLogUID == updateUID); // TRUE = the combo has the log with UID 'actLogUID' selected for update MSG msg; // remove other messages requesting a log update (update the current log) while (PeekMessage(&msg, NULL, WM_APP_UPDATELOG, WM_APP_UPDATELOG, PM_REMOVE)) { @@ -582,7 +582,7 @@ CLogsDlg::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) for (i = 0; i < count; i++) { if (SendMessage(combo, CB_GETITEMDATA, i, 0) == (int)wParam) // find the UID // FIXME_X64 suspicious cast - { // (unfortunately we cannot search directly in Logs - a changed log count would misalign the index) + { // (unfortunately we cannot search directly in Logs - if the number of logs changes, the index would no longer match) if (SendMessage(combo, CB_GETCURSEL, 0, 0) != i) { SendMessage(combo, CB_SETCURSEL, i, 0); @@ -1111,8 +1111,8 @@ CWaitWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) // the application was deactivated and the wait window should be shown (no longer hidden because of a dialog) if (!Visible && wParam == FALSE && HasTimer) Show(TRUE); // the window must be shown so Salamander can be reached via Alt+Tab - break; // WM_ACTIVATEAPP arrives even when neither the wait window nor its parent is active (any - } // modeless dialog without a parent - previously the Logs dialog) - the wait window cannot be activated + break; // WM_ACTIVATEAPP arrives even when neither the wait window nor its parent is active + } // for example, for a modeless dialog without a parent; the wait window cannot be activated case WM_ACTIVATE: { @@ -1161,8 +1161,8 @@ CWaitWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_NCHITTEST: { - // prevent moving the window by dragging its title bar - // also block the tooltip above the Close button + // prevent moving the window by dragging the title bar + // also block the tooltip over the Close button return HTCLIENT; } @@ -1448,7 +1448,7 @@ void CListWaitWindow::RefreshTimeAndStatusAndProgress(BOOL fromTimer) int asciiTrForBinFileHowToSolve = 0; if (Visible && DataConnection->IsAsciiTrForBinFileProblem(&asciiTrForBinFileHowToSolve)) { // detected the "ascii transfer mode for binary file" problem, ask how to solve it - if (asciiTrForBinFileHowToSolve == 0) // we should ask the user + if (asciiTrForBinFileHowToSolve == 0) // ask the user { Show(FALSE); INT_PTR res = CViewErrAsciiTrForBinFileDlg(HParent).Execute(); From 4895409d6cf603f787f54a59ae97c2227b61b07c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 9 Apr 2026 23:32:43 +0200 Subject: [PATCH 030/710] [tanslation] Fix src/plugins/ftp/dialogs3.cpp comments (#401) --- src/plugins/ftp/dialogs3.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/ftp/dialogs3.cpp b/src/plugins/ftp/dialogs3.cpp index 21cd64327..309db12a2 100644 --- a/src/plugins/ftp/dialogs3.cpp +++ b/src/plugins/ftp/dialogs3.cpp @@ -599,7 +599,7 @@ CEditServerTypeDlg::CEditServerTypeDlg(HWND parent, CServerType* serverType) } } if (!ok) - ColumnsData.DestroyMembers(); // safeguard against a potential overlooked error + ColumnsData.DestroyMembers(); // safeguard in case an error was overlooked RawListing = NULL; RawListIncomplete = FALSE; @@ -663,7 +663,7 @@ void CEditServerTypeDlg::Validate(CTransferInfo& ti) delete parser; // the parser is OK, delete it again else // display the error and mark the error in the "rules for parsing" edit box { - if (errorResID != -1) // some "reasonable" error was found, comment on it + if (errorResID != -1) // some "reasonable" error was found, report it { char buf[300]; sprintf(buf, LoadStr(IDS_STPAR_UNABLECOMPPARSER), LoadStr(errorResID)); @@ -767,7 +767,7 @@ void CEditServerTypeDlg::Transfer(CTransferInfo& ti) } } if (!ok) - ServerType->Columns.DestroyMembers(); // safeguard against a potential overlooked error + ServerType->Columns.DestroyMembers(); // safeguard against a possible missed error } // if the data changed, we must change the server type to "user defined" @@ -829,7 +829,7 @@ void CEditServerTypeDlg::RefreshListView(BOOL onlySet, int selIndex) CanReadListViewChanges = FALSE; // LockWindowUpdate(HListView); // do not use - it makes the entire Windows flicker SendMessage(HListView, WM_SETREDRAW, FALSE, 0); - // I see no reason to dim the window here; there are few columns and calling SetColumnWidths() + // I see no reason to hide the window here; there are few columns and calling SetColumnWidths() // does not cause the list view to flicker // SetWindowPos(HListView, NULL, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_HIDEWINDOW | SWP_NOREDRAW | SWP_NOSENDCHANGING | SWP_NOZORDER); @@ -920,7 +920,7 @@ void CEditServerTypeDlg::RefreshListView(BOOL onlySet, int selIndex) ListView_SetItemState(HListView, selIndex, state, state); ListView_EnsureVisible(HListView, selIndex, FALSE); } - // LockWindowUpdate(NULL); // do not use - it makes the entire Windows flicker + // LockWindowUpdate(NULL); // do not use - the entire Windows UI flickers // SetWindowPos(HListView, NULL, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_SHOWWINDOW | SWP_NOREDRAW | SWP_NOSENDCHANGING | SWP_NOZORDER); SendMessage(HListView, WM_SETREDRAW, TRUE, 0); @@ -1589,7 +1589,7 @@ MENU_TEMPLATE_ITEM EditServerTypeADCondMenu[] = } else // display the error and mark the error in the "rules for parsing" edit box { - if (errorResID != -1) // some "reasonable" error was found, comment on it + if (errorResID != -1) // a "reasonable" error was found; report it { char buf[300]; sprintf(buf, LoadStr(IDS_STPAR_UNABLECOMPPARSER), LoadStr(errorResID)); From cf11bfae48fa0ed96ef0c333cc6294b185d3c0bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 9 Apr 2026 23:43:48 +0200 Subject: [PATCH 031/710] [tanslation] Fix src/plugins/ftp/dialogs4.cpp comments (#402) --- src/plugins/ftp/dialogs4.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/ftp/dialogs4.cpp b/src/plugins/ftp/dialogs4.cpp index 470f4d8cf..1c0753516 100644 --- a/src/plugins/ftp/dialogs4.cpp +++ b/src/plugins/ftp/dialogs4.cpp @@ -179,8 +179,8 @@ void CEditSrvTypeColumnDlg::Transfer(CTransferInfo& ti) } else { - // if the user has custom text, pull it out, otherwise use indexes from the last selection - // in the combo (finding the index by looking up the string in the list is impossible, duplicate strings may occur) + // if the user has custom text, retrieve it; otherwise use the indexes from the last selection + // in the combo box (finding the index by looking up the string in the list is impossible because duplicate strings may occur) if (LastUsedIndexForName == -1) GetWindowText(comboName, bufName, STC_NAME_MAX_SIZE); if (LastUsedIndexForDescr == -1) @@ -957,7 +957,7 @@ void CSrvTypeTestParserDlg::LoadTextFromFile() HANDLES(CloseHandle(file)); SetCursor(oldCur); - if (err != NO_ERROR) // print the error + if (err != NO_ERROR) // display the error { sprintf(buf, LoadStr(IDS_SRVTYPE_READRAWLISTERR), SalamanderGeneral->GetErrorText(err)); SalamanderGeneral->SalMessageBox(HWindow, buf, LoadStr(IDS_FTPERRORTITLE), From 863e1d637c4e043e4657c97e914c7520b818a6c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 9 Apr 2026 23:55:52 +0200 Subject: [PATCH 032/710] [tanslation] Fix src/plugins/ftp/dialogs5.cpp comments (#403) --- src/plugins/ftp/dialogs5.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/ftp/dialogs5.cpp b/src/plugins/ftp/dialogs5.cpp index 453af42d9..2f8724e61 100644 --- a/src/plugins/ftp/dialogs5.cpp +++ b/src/plugins/ftp/dialogs5.cpp @@ -452,7 +452,7 @@ BOOL COperationDlg::UpdateDataInDialog() if (totalCount > 0 && transferIdleTime <= 30) { DWORD secs = (SMPLCMD_APPROXBYTESIZE * waitingCount) / speed; // estimate remaining seconds - secs++; // add one second so we end with "time left: 1 sec" instead of 0 sec + secs++; // add one more second so we finish the operation with "time left: 1 sec" (instead of 0 sec) if (LastTimeEstimation != -1) secs = (2 * secs + LastTimeEstimation) / 3; // rounding calculation (roughly 10% error + round to nice numbers 1,2,5,10,20,40) @@ -720,7 +720,7 @@ BOOL COperationDlg::UpdateDataInDialog() // determine what actually changed int itemUID1, itemUID2; Oper->GetChangedItems(&itemUID1, &itemUID2); - if (!ShowOnlyErrors && itemUID1 != -1) // change of a single item (ShowOnlyErrors disallows this; must refresh all items because the item may hide/show) + if (!ShowOnlyErrors && itemUID1 != -1) // change of a single item (not allowed with ShowOnlyErrors; all items must be refreshed because the item may be hidden or shown) { // redraw the changed item int index1 = Queue->GetItemIndex(itemUID1); @@ -831,7 +831,7 @@ void COperationDlg::RefreshConnections(BOOL init, int newFocusIndex, int refresh if (!ConsListViewObj.Scrolling) ListView_EnsureVisible(ConsListView, 0, FALSE); } - else // refresh the list view as gently as possible (preserves top index and focus by UID or the last focus) + else // refresh the list view with minimal disruption (preserves the top index and restores focus by UID or the last focused item) { if (newFocusIndex != -1) lastFocus = newFocusIndex; @@ -931,7 +931,7 @@ void COperationDlg::RefreshItems(BOOL init, int refreshOnlyIndex1, int refreshOn focusIndex = ErrorsIndexes[0]; FocusedItemUID = Queue->GetItemUID(focusIndex); } - else // refresh the list view as gently as possible (preserves top index and focus by UID or the last focus) + else // refresh the list view with minimal disruption (preserves the top index and restores focus by UID or the last focused item) { int index = lastFocus >= 0 ? lastFocus : 0; if (ShowOnlyErrors) From 241c45e1d7760f69a8c3a3b5d232a5e432ba0436 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 00:08:19 +0200 Subject: [PATCH 033/710] [tanslation] Fix src/plugins/ftp/dialogs6.cpp comments (#404) --- src/plugins/ftp/dialogs6.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/ftp/dialogs6.cpp b/src/plugins/ftp/dialogs6.cpp index e33648c34..dd84cf6a2 100644 --- a/src/plugins/ftp/dialogs6.cpp +++ b/src/plugins/ftp/dialogs6.cpp @@ -481,7 +481,7 @@ COperationDlg::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) LastActivityTime = GetTickCount(); Config.OperDlgPlacement.length = sizeof(WINDOWPLACEMENT); // store the window position GetWindowPlacement(HWindow, &Config.OperDlgPlacement); - if (SimpleLook) // simple-look is unsuitable; store the size of the opened dialog + if (SimpleLook) // simple-look is not suitable; store the open dialog size Config.OperDlgPlacement.rcNormalPosition.bottom = Config.OperDlgPlacement.rcNormalPosition.top + LastDlgHeight1; else { @@ -579,7 +579,7 @@ COperationDlg::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) DlgWillCloseIfOpFinWithSkips = (IsDlgButtonChecked(HWindow, IDC_OPCLOSEWINWHENDONE) == BST_CHECKED); CorrectLookOfPrevFocusedDisabledButton(focus); if (res != IDYES) - return TRUE; // no Cancel/Close will happen + return TRUE; // no Cancel/Close will occur break; } @@ -983,7 +983,7 @@ COperationDlg::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) ToggleSimpleLook(); // the dialog must be shown in the detailed form if (workerIndex != -1) { - // focus the worker whose error we are going to solve + // focus the worker whose error we are going to handle BOOL oldEnableChangeFocusedCon = EnableChangeFocusedCon; EnableChangeFocusedCon = FALSE; ListView_SetItemState(ConsListView, workerIndex, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED); @@ -1029,7 +1029,7 @@ COperationDlg::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) else TRACE_E("Unexpected situation in COperationDlg::DialogProc::OPERDLG_AUTOSHOWERRTIMER!"); } - SetTimer(HWindow, OPERDLG_AUTOSHOWERRTIMER2, 100, 0); // to have an "immediate" reaction to the next error (PostMessage cannot be used here because another window beeps for some reason; I did not investigate why, WorkersList->PostNewWorkAvailable causes it) + SetTimer(HWindow, OPERDLG_AUTOSHOWERRTIMER2, 100, 0); // for an "immediate" response to the next error (PostMessage cannot be used here because another window beeps for some reason; the cause was not investigated, but WorkersList->PostNewWorkAvailable triggers it) SetTimer(HWindow, OPERDLG_AUTOSHOWERRTIMER, OPERDLG_AUTOSHOWERRPERIOD, NULL); // resume regular error checks } } @@ -1224,7 +1224,7 @@ COperationDlg::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) // from the message loop of that modal dialog) SalamanderGeneral->CloseAllOwnedEnabledDialogs(HWindow); *SendWMClose = TRUE; // request WM_CLOSE again - return TRUE; // do not process further (closing was denied) + return TRUE; // do not process further (close was blocked) } DestroyWindow(HWindow); // destroy the window (the standard variant tries IDCANCEL, which we do not want) return TRUE; // do not process further From 14ad5b0e0e205b59c48d06573c247455b1c27fa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 00:18:57 +0200 Subject: [PATCH 034/710] [tanslation] Fix src/plugins/ftp/dialogs7.cpp comments (#405) --- src/plugins/ftp/dialogs7.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/plugins/ftp/dialogs7.cpp b/src/plugins/ftp/dialogs7.cpp index 9a72e33c3..c7d8bb6f5 100644 --- a/src/plugins/ftp/dialogs7.cpp +++ b/src/plugins/ftp/dialogs7.cpp @@ -134,10 +134,10 @@ void CSolveItemErrorDlg::Validate(CTransferInfo& ti) } } -// meaning of the button in connection with "do the same action for all operations with the same error": +// button meaning in connection with "do the same action for all operations with the same error": // buttons (order of values in one row of the array): // use-alternate-name, resume, resume or overwrite, overwrite, skip, use-existing-dir, ignore, in-binary-mode -// special value: -1 = does not make sense +// special value: -1 = not applicable int ButtonActionsTbl[][8] = { // row 0 = file exists: download+upload {FILEALREADYEXISTS_AUTORENAME, FILEALREADYEXISTS_RESUME, FILEALREADYEXISTS_RES_OVRWR, FILEALREADYEXISTS_OVERWRITE, FILEALREADYEXISTS_SKIP, -1, -1, -1}, @@ -316,7 +316,7 @@ void CSolveItemErrorDlg::Transfer(CTransferInfo& ti) case CM_SIED_OVERWRITE: value = ButtonActionsTbl[typeIndex][3]; break; - // case CM_SIED_OVERWRITEALL: // is changed to CM_SIED_OVERWRITE + *ApplyToAll==TRUE + // case CM_SIED_OVERWRITEALL: // changes to CM_SIED_OVERWRITE + *ApplyToAll==TRUE case IDB_SCRD_SKIP: value = ButtonActionsTbl[typeIndex][4]; break; @@ -1047,7 +1047,7 @@ COperDlgListView::~COperDlgListView() DestroyWindow(HToolTip); } -#define TTS_NOANIMATE 0x10 // it is not in the headers, so I define the constant here +#define TTS_NOANIMATE 0x10 // not in the headers, so define the constant here void COperDlgListView::Attach(HWND hListView, COperationDlg* operDlg, BOOL consOrItems) { @@ -1063,9 +1063,9 @@ void COperDlgListView::Attach(HWND hListView, COperationDlg* operDlg, BOOL consO if (dlgFont != NULL || SystemFont != NULL) SendMessage(HToolTip, WM_SETFONT, (WPARAM)(dlgFont != NULL ? dlgFont : SystemFont), TRUE); - // I commented out SetWindowPos(HWND_TOPMOST) because otherwise message boxes above the operation dialog do not work - // completely correctly - when Alt+TAB to the message box it does not activate automatically (it is not brought to the front) - // operation dialog + // SetWindowPos(HWND_TOPMOST) is commented out because otherwise message boxes above the operation dialog do not work + // completely correctly: when Alt+TAB switches to a message box, the operation dialog is not activated automatically + // (not brought to the front). // SetWindowPos(HToolTip, HWND_TOPMOST, 0, 0, 0, 0, // SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOREDRAW | SWP_NOSIZE); @@ -1235,9 +1235,9 @@ COperDlgListView::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (pt.x + width > monRect.right) pt.x = monRect.right - width; - // I commented out SetWindowPos(HWND_TOPMOST) because otherwise message boxes above the operation dialog do not work - // completely correctly - when Alt+TAB to the message box it does not activate automatically (it is not brought to the front) - // operation dialog + // SetWindowPos(HWND_TOPMOST) is commented out because otherwise message boxes above the operation dialog do not work + // completely correctly: when Alt+TAB switches to a message box, the operation dialog is not activated automatically + // (not brought to the front). /* SetWindowPos(HToolTip, HWND_TOPMOST, pt.x, @@ -1409,7 +1409,7 @@ void CSolveItemErrorSimpleDlg::Transfer(CTransferInfo& ti) int value = -1; switch (UsedButtonID) { - // case CM_SISE_RETRY: // it makes no sense for Retry + // case CM_SISE_RETRY: // does not make sense for Retry case IDOK: { From cb930b38e00bc6285c46c4f8ec677ff7fcea6194 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 00:30:13 +0200 Subject: [PATCH 035/710] [tanslation] Fix src/plugins/ftp/dialogs8.cpp comments (#406) --- src/plugins/ftp/dialogs8.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/ftp/dialogs8.cpp b/src/plugins/ftp/dialogs8.cpp index e07fe3ecd..8348fadcc 100644 --- a/src/plugins/ftp/dialogs8.cpp +++ b/src/plugins/ftp/dialogs8.cpp @@ -297,7 +297,7 @@ CServersListbox::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) break; } } - break; // let the keys pass through, the listbox should not handle them, no problem + break; // let the keys pass through; the listbox should not handle them } case WM_LBUTTONDBLCLK: @@ -977,7 +977,7 @@ CRenameDlg::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) checkboxName[0] != 0 ? checkboxName : LoadStr(IDS_QUICKCONNECT)); SetDlgItemText(HWindow, IDC_COPYFOCUSEDSRV, buf); } - else // new server type + empty list = necessary to hide/disable the "copy from" checkbox + else // new server type + empty list = need to hide/disable the "copy from" checkbox { ShowWindow(GetDlgItem(HWindow, IDC_COPYFOCUSEDSRV), SW_HIDE); } @@ -1193,7 +1193,7 @@ void CConfigPageAdvanced::Validate(CTransferInfo& ti) int num; int arr[] = {IDE_SRVREPLIESTIMEOUT, IDE_DELAYBETWCONRETR, IDE_CONNECTRETRIES, IDE_NODATATRTIMEOUT, IDE_RESUMEMINFILESIZE, IDE_RESUMEOVERLAP, -1}; - BOOL gzthzero[] = {TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, -1}; // testing > 0 (TRUE) or >= 0 (FALSE) + BOOL gzthzero[] = {TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, -1}; // test > 0 (TRUE) or >= 0 (FALSE) int i; for (i = 0; arr[i] != -1; i++) { From 0c7e4ed2ade2daba287a9c021ac573fa77e45459 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 00:42:22 +0200 Subject: [PATCH 036/710] [tanslation] Fix src/plugins/ftp/fs1.cpp comments (#407) --- src/plugins/ftp/fs1.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/ftp/fs1.cpp b/src/plugins/ftp/fs1.cpp index d2dd78969..72eb1e49e 100644 --- a/src/plugins/ftp/fs1.cpp +++ b/src/plugins/ftp/fs1.cpp @@ -4,7 +4,7 @@ #include "precomp.h" -// FS-name assigned by Salamander after loading the plug-in +// FS-name assigned by Salamander after loading the plugin char AssignedFSName[MAX_PATH] = ""; int AssignedFSNameLen = 0; @@ -305,7 +305,7 @@ void CPluginInterfaceForFS::CloseFS(CPluginFSInterfaceAbstract* fs) break; } } - if (!found) // "i == FTPConnections.Count" is not enough (there is Delete(i)) + if (!found) // "i == FTPConnections.Count" is not enough because Delete(i) is called TRACE_E("Unexpected situation in CPluginInterfaceForFS::CloseFS(): FS not found in FTPConnections."); delete ((CPluginFSInterface*)fs); // to call the correct destructor @@ -691,7 +691,7 @@ void CPluginInterfaceForFS::ExecuteOnFS(int panel, CPluginFSInterfaceAbstract* p fs->MakeUserPart(newUserPart, FTP_USERPART_SIZE, newPath); if (SalamanderGeneral->ChangePanelPathToPluginFS(panel, pluginFSName, newUserPart)) { - fs->TopIndexMem.Push(type, backupPath, topIndex); // remember the top-index for the return + fs->TopIndexMem.Push(type, backupPath, topIndex); // remember the top index for returning } } } @@ -756,7 +756,7 @@ void CTopIndexMem::Push(CFTPServerPathType type, const char* path, int topIndex) ok = FTPIsTheSameServerPath(type, testPath, Path); } - if (ok) // it follows -> remember the next top-index + if (ok) // continues from the current path -> remember the next top-index { if (TopIndexesCount == TOP_INDEX_MEM_SIZE) // we need to discard the first top-index from memory { @@ -788,13 +788,13 @@ BOOL CTopIndexMem::FindAndPop(CFTPServerPathType type, const char* path, int& to topIndex = TopIndexes[--TopIndexesCount]; return TRUE; } - else // we no longer have this value (it was not stored or low memory removed it) + else // we no longer have this value (it was not stored, or it was discarded due to low memory) { Clear(); return FALSE; } } - else // query for another path -> clear the memory, a long jump occurred + else // query for a different path -> clear memory, a long jump occurred { Clear(); return FALSE; From 803cfc16ec370304df7c09b1790353d4a4207fba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 00:59:19 +0200 Subject: [PATCH 037/710] [tanslation] Fix src/plugins/ftp/fs2.cpp comments (#408) --- src/plugins/ftp/fs2.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/plugins/ftp/fs2.cpp b/src/plugins/ftp/fs2.cpp index 0a95bd6a5..d5f93b707 100644 --- a/src/plugins/ftp/fs2.cpp +++ b/src/plugins/ftp/fs2.cpp @@ -7,7 +7,7 @@ int CSimpleListPluginDataInterface::ListingColumnWidth = 0; // LO/HI-WORD: left/right panel: width of the Raw Listing column int CSimpleListPluginDataInterface::ListingColumnFixedWidth = 0; // LO/HI-WORD: left/right panel: does the Raw Listing column have a fixed width? -// Global variables where I store pointers to Salamander's global variables +// Global variables that store pointers to Salamander's global variables const CFileData** TransferFileData = NULL; int* TransferIsDir = NULL; char* TransferBuffer = NULL; @@ -385,7 +385,7 @@ BOOL CPluginFSInterface::ChangePath(int currentFSNameIndex, char* fsName, int fs if (lastErrorState == fesFatal) { TargetPanelPath[0] = 0; // the connection failed, no path change in the target panel - return FALSE; // fatal error, stop + return FALSE; // fatal error, abort } // Treat a hard refresh as distrust of the path; drop from the disk cache all files @@ -411,7 +411,7 @@ BOOL CPluginFSInterface::ChangePath(int currentFSNameIndex, char* fsName, int fs TotalConnectAttemptNum = 1; // opening the connection = first attempt to open it InformAboutUnknownSrvType = TRUE; - BOOL parsedPath = TRUE; // TRUE = path obtained from the user part; need to decide whether to trim '/' or '\\' at the start + BOOL parsedPath = TRUE; // TRUE = path obtained from the user-part; need to determine whether to trim a leading '/' or '\\' ControlConnection = new CControlConnectionSocket; if (ControlConnection == NULL || !ControlConnection->IsGood()) { @@ -1168,7 +1168,7 @@ BOOL CPluginFSInterface::ListCurrentPath(CSalamanderDirectoryAbstract* dir, { serverType->CompiledAutodetCond = CompileAutodetectCond(HandleNULLStr(serverType->AutodetectCond), NULL, NULL, NULL, NULL, 0); - if (serverType->CompiledAutodetCond == NULL) // can only fail due to lack of memory + if (serverType->CompiledAutodetCond == NULL) // this can only be a low-memory error { err = TRUE; break; @@ -1205,8 +1205,8 @@ BOOL CPluginFSInterface::ListCurrentPath(CSalamanderDirectoryAbstract* dir, serverType = serverTypeList->At(i); if (!serverType->ParserAlreadyTested) // only if we have not tried it yet { - // serverType is selected, try its parser on the listing - // serverType->ParserAlreadyTested = TRUE; // unnecessary, not used afterwards + // serverType has been selected; try its parser on the listing + // serverType->ParserAlreadyTested = TRUE; // unnecessary, not used later if (ParseListing(dir, &pluginData, serverType, &err, isVMS, NULL, FALSE, NULL, NULL) || err) { if (!err) @@ -1260,7 +1260,7 @@ BOOL CPluginFSInterface::ListCurrentPath(CSalamanderDirectoryAbstract* dir, pluginData = &SimpleListPluginDataInterface; // ATTENTION: the change may also affect obtaining the data interface in CPluginFSInterface::ChangeAttributes! dir->SetValidData(VALID_DATA_NONE); dir->SetFlags(SALDIRFLAG_CASESENSITIVE | SALDIRFLAG_IGNOREDUPDIRS); // probably unnecessary, but everything is treated as case-sensitive so this should be safe - if (!PathListingIsBroken && // if the listing is not OK, rather use an empty listing + if (!PathListingIsBroken && // if the listing is not OK, use an empty listing instead PathListingLen > 0) { char* beg = PathListing; From e8401f6d03154c3c77d008416624dc8a38472b5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 01:20:38 +0200 Subject: [PATCH 038/710] [tanslation] Fix src/plugins/ftp/fs3.cpp comments (#409) --- src/plugins/ftp/fs3.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/plugins/ftp/fs3.cpp b/src/plugins/ftp/fs3.cpp index b3c58b596..2b7fa14b0 100644 --- a/src/plugins/ftp/fs3.cpp +++ b/src/plugins/ftp/fs3.cpp @@ -23,7 +23,7 @@ BOOL CPluginFSInterface::TryCloseOrDetach(BOOL forceClose, BOOL canDetach, BOOL& { if (reason == FSTRYCLOSE_CHANGEPATH) { - if (canDetach && !Config.DisconnectCommandUsed) // "close or detach" and it is not the "Disconnect" command + if (canDetach && !Config.DisconnectCommandUsed) // "close or detach", not the "Disconnect" command { int res; if (!Config.AlwaysNotCloseCon) @@ -88,7 +88,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = { close = ret = TRUE; // this prompt proved to be very confusing and incomprehensible, so we simply prefer Disconnect /* - // "no path on the FTP is accessible, disconnect?" + // "no path on the FTP server is accessible, disconnect?" close = ret = (SalamanderGeneral->SalMessageBox(SalamanderGeneral->GetMsgBoxParent(), LoadStr(IDS_NOPATHACCESSINPANEL), LoadStr(IDS_FTPPLUGINTITLE), @@ -168,12 +168,12 @@ void CPluginFSInterface::Event(int event, DWORD param) case FSE_TIMER: // delayed panel refresh (to give the connection time to return from the operation dialog to the panel) { - DWORD paramLimit = 4; // maximum one second waiting for the connection (we wait to see whether the worker will try to hand over the connection) + DWORD paramLimit = 4; // wait up to one second for the connection (we wait to see whether the worker will try to hand over the connection) DWORD ti; if (ControlConnection != NULL && ControlConnection->GetIsSocketConnectedLastCallTime(&ti) && GetTickCount() - ti < 5000) { - paramLimit = 24; // maximum five seconds waiting for the connection (we know the worker is trying to hand it over) + paramLimit = 24; // wait up to five seconds for the connection (we know the worker is trying to hand it over) } if (param >= paramLimit || // param < paramLimit: start the refresh only if we have the connection, param >= paramLimit always allows the refresh ControlConnection != NULL && ControlConnection->IsConnected()) @@ -222,8 +222,8 @@ void CPluginFSInterface::ReleaseObject(HWND parent) } else { - // if we have not yet written what led to closing the connection, do it now - // at least into the log (there is no point in showing a window, the user is probably no longer interested) + // if we have not yet logged what caused the connection to close, do it now + // at least to the log (there is no point in showing a window; the user is probably no longer interested) ControlConnection->CheckCtrlConClose(TRUE, FALSE, parent, TRUE); } @@ -319,7 +319,7 @@ BOOL CPluginFSInterface::GetNextDirectoryLineHotPath(const char* text, int pathL if (*root == '/' || *root == '\\') root++; // skip '/' or '\\' from the disk root path } - if (DirLineHotPathType == ftpsptTandem) // for Tandem paths skip the "system" ("\\SYSTEM"), a shorter path makes no sense + if (DirLineHotPathType == ftpsptTandem) // for Tandem paths, skip "system" ("\\SYSTEM"); a shorter path makes no sense while (root < end && *root != '.') root++; } @@ -777,7 +777,7 @@ void CPluginFSInterface::SendUserFTPCommand(HWND parent) BOOL ok = TRUE; char newPath[FTP_MAX_PATH]; BOOL needChangeDir = reconnected; // after reconnect try to set the working directory again - if (!reconnected) // already connected for a longer time, verify that the working directory matches 'Path' + if (!reconnected) // already connected for some time, verify that the working directory matches 'Path' { // use the cache, under normal circumstances the path should be there ok = ControlConnection->GetCurrentWorkingPath(parent, newPath, FTP_MAX_PATH, FALSE, @@ -787,7 +787,7 @@ void CPluginFSInterface::SendUserFTPCommand(HWND parent) run = TRUE; retryMsgAux = retryMsgBuf; } - if (ok && strcmp(newPath, Path) != 0) // working directory on the server differs - change required + if (ok && strcmp(newPath, Path) != 0) // the working directory on the server differs - change required needChangeDir = TRUE; // (assumption: the server returns the same working path string) } if (ok && needChangeDir) // working directory needs to be changed @@ -795,14 +795,14 @@ void CPluginFSInterface::SendUserFTPCommand(HWND parent) int panel; BOOL notInPanel = !SalamanderGeneral->GetPanelWithPluginFS(this, panel); BOOL success; - // SendChangeWorkingPath() calls ReconnectIfNeeded() on connection failure, luckily that + // SendChangeWorkingPath() calls ReconnectIfNeeded() on connection failure; this // does not matter because the code preceding this call runs only when reconnect did not // occur - "if (!reconnected)" - if reconnect happens, both code paths are the same ok = ControlConnection->SendChangeWorkingPath(notInPanel, panel == PANEL_LEFT, parent, Path, User, USER_MAX_SIZE, &success, ftpReplyBuf, 700, NULL, &TotalConnectAttemptNum, NULL, TRUE, NULL); - if (ok && !success && Path[0] != 0) // send succeeded, but the server reports an error (+ignore the error for an empty path) -> user command cannot + if (ok && !success && Path[0] != 0) // send succeeded, but the server reports an error (+ignore the error for an empty path) -> the user command cannot be sent { // be sent (it may be tied to the current path in the panel) char errBuf[900 + FTP_MAX_PATH]; _snprintf_s(errBuf, _TRUNCATE, LoadStr(IDS_CHANGEWORKPATHERROR), Path, ftpReplyBuf); @@ -844,7 +844,7 @@ void CPluginFSInterface::SendUserFTPCommand(HWND parent) } } - if (ok) // everything went well, report the command result to the user + if (ok) // command succeeded, report the command result to the user { char* s = logBuf + strlen(logBuf); while (s > logBuf && (*(s - 1) == '\n' || *(s - 1) == '\r')) @@ -856,7 +856,7 @@ void CPluginFSInterface::SendUserFTPCommand(HWND parent) } else { - if (dlg.RefreshWorkingPath) // the Path may have changed, invalidate the Path listing cache + if (dlg.RefreshWorkingPath) // Path may have changed, invalidate the listing for Path in the cache UploadListingCache.ReportUnknownChange(User, Host, Port, Path, GetFTPServerPathType(Path)); if (canRetry) // "retry" is allowed @@ -927,7 +927,7 @@ void CPluginFSInterface::ContextMenu(const char* fsName, HWND parent, int menuX, int type2, lastType = sctyUnknown; while (SalamanderGeneral->EnumSalamanderCommands(&index, &salCmd, nameBuf, 200, &enabled, &type2)) { - if (!enabled || salCmd == SALCMD_OPEN || // we cannot "open" files yet, so do not add it (we can do it only for directories and there it is uninteresting) + if (!enabled || salCmd == SALCMD_OPEN || // we cannot "open" files yet, so do not add it (we only support it for directories, where it is not useful) type2 == sctyForFocusedFile && isfocusedDir || (type2 != sctyForFocusedFile && type2 != sctyForFocusedFileOrDirectory && type2 != sctyForSelectedFilesAndDirectories)) @@ -1344,7 +1344,7 @@ CFTPListingPluginDataInterface::CFTPListingPluginDataInterface(TIndirectArray Date: Fri, 10 Apr 2026 01:34:42 +0200 Subject: [PATCH 039/710] [tanslation] Fix src/plugins/ftp/fs4.cpp comments (#410) --- src/plugins/ftp/fs4.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/plugins/ftp/fs4.cpp b/src/plugins/ftp/fs4.cpp index ddfdec72b..09de19478 100644 --- a/src/plugins/ftp/fs4.cpp +++ b/src/plugins/ftp/fs4.cpp @@ -300,7 +300,7 @@ BOOL CFTPListingPluginDataInterface::GetInfoLineContent(int panel, const CFileDa { if (selectedFiles == 0 && selectedDirs == 0) // Information Line for an empty panel return FALSE; // let Salamander print the text - if (BytesColumnOffset == -1 && BlocksColumnOffset == -1 || selectedDirs != 0) // no size in bytes nor blocks or directories are selected too + if (BytesColumnOffset == -1 && BlocksColumnOffset == -1 || selectedDirs != 0) // no size in bytes or blocks, or directories are selected too return FALSE; // let Salamander print the counts of selected files and folders // when only files are selected (block size is unknown for directories) // sum up the number of blocks @@ -649,7 +649,7 @@ BOOL CPluginFSInterface::Delete(const char* fsName, int mode, HWND parent, int p char subject[MAX_PATH + 200]; sprintf(subject, LoadStr(IDS_DELETEFROMFTP), subjectSrc); - // open a message box asking about the delete + // open a message box asking for delete confirmation const char* Shell32DLLName = "shell32.dll"; HINSTANCE Shell32DLL; Shell32DLL = HANDLES(LoadLibraryEx(Shell32DLLName, NULL, LOAD_LIBRARY_AS_DATAFILE)); @@ -691,7 +691,7 @@ BOOL CPluginFSInterface::Delete(const char* fsName, int mode, HWND parent, int p if (cert) cert->Release(); oper->SetCompressData(ControlConnection->GetCompressData()); - if (ControlConnection->InitOperation(oper)) // initialize the server connection according to the "control connection" + if (ControlConnection->InitOperation(oper)) // initialize the server connection using the "control connection" { oper->SetBasicData(dlgSubjectSrc, (AutodetectSrvType ? NULL : LastServerType)); char path[2 * MAX_PATH]; @@ -713,7 +713,7 @@ BOOL CPluginFSInterface::Delete(const char* fsName, int mode, HWND parent, int p { if (dataIface != NULL && (void*)dataIface == (void*)&SimpleListPluginDataInterface) dataIface = NULL; // we care only about a data interface of type CFTPListingPluginDataInterface - int rightsCol = -1; // column index with permissions (used to detect links) + int rightsCol = -1; // permissions column index (used to detect links) if (dataIface != NULL) rightsCol = dataIface->FindRightsColumn(); const CFileData* f = NULL; // pointer to the file/directory/link in the panel to process @@ -791,7 +791,7 @@ BOOL CPluginFSInterface::Delete(const char* fsName, int mode, HWND parent, int p } if (!ok) FTPOperationsList.DeleteOperation(operUID, TRUE); - oper = NULL; // the operation is already added to the array, do not release it via 'delete' (see below) + oper = NULL; // the operation has already been added to the array, so do not release it via 'delete' (see below) } } if (oper != NULL) @@ -928,7 +928,7 @@ BOOL CPluginFSInterface::CopyOrMoveFromFS(BOOL copy, int mode, const char* fsNam char subject[MAX_PATH + 200]; sprintf(subject, LoadStr(copy ? IDS_COPYFROMFTP : IDS_MOVEFROMFTP), subjectSrc); - if (mode == 1 && targetPath[0] != 0) // only when opening the dialog for the first time and the target path is selected + if (mode == 1 && targetPath[0] != 0) // only when opening the dialog for the first time and a target path is selected { SalamanderGeneral->SalPathAppend(targetPath, "*.*", 2 * MAX_PATH); SalamanderGeneral->SetUserWorkedOnPanelPath(PANEL_TARGET); // default action = work with the path in the target panel @@ -1035,7 +1035,7 @@ BOOL CPluginFSInterface::CopyOrMoveFromFS(BOOL copy, int mode, const char* fsNam if (cert) cert->Release(); oper->SetCompressData(ControlConnection->GetCompressData()); - if (ControlConnection->InitOperation(oper)) // initialize the server connection according to the "control connection" + if (ControlConnection->InitOperation(oper)) // initialize the connection to the server based on the "control connection" { oper->SetBasicData(dlgSubjectSrc, (AutodetectSrvType ? NULL : LastServerType)); char path[2 * MAX_PATH]; @@ -1069,8 +1069,8 @@ BOOL CPluginFSInterface::CopyOrMoveFromFS(BOOL copy, int mode, const char* fsNam if (queue != NULL) { if (dataIface != NULL && (void*)dataIface == (void*)&SimpleListPluginDataInterface) - dataIface = NULL; // we care only about a data interface of type CFTPListingPluginDataInterface - int rightsCol = -1; // column index with permissions (used to detect links) + dataIface = NULL; // we are only interested in a data interface of type CFTPListingPluginDataInterface + int rightsCol = -1; // index of the permissions column (used to detect links) if (dataIface != NULL) rightsCol = dataIface->FindRightsColumn(); CQuadWord totalSize(0, 0); // total size (in bytes or blocks) @@ -1097,7 +1097,7 @@ BOOL CPluginFSInterface::CopyOrMoveFromFS(BOOL copy, int mode, const char* fsNam if (!is_AS_400_QSYS_LIB_Path) { if (donotUseOpMask) - lstrcpyn(targetName, f->Name, 2 * MAX_PATH); // masks trim '.' from name ends, which is not always OK (e.g. directories "a.b" and "a.b." would merge) - probably rare, so for now we solve it only provisionally like this + lstrcpyn(targetName, f->Name, 2 * MAX_PATH); // masks trim trailing '.' characters from names, which is not always OK (e.g. directories "a.b" and "a.b." would merge) - this is probably rare, so for now we handle it only provisionally like this else SalamanderGeneral->MaskName(targetName, 2 * MAX_PATH, f->Name, opMask); } @@ -1106,7 +1106,7 @@ BOOL CPluginFSInterface::CopyOrMoveFromFS(BOOL copy, int mode, const char* fsNam char mbrName[MAX_PATH]; FTPAS400CutFileNamePart(mbrName, f->Name); if (donotUseOpMask) - lstrcpyn(targetName, mbrName, 2 * MAX_PATH); // masks trim '.' from name ends, which is not always OK (e.g. directories "a.b" and "a.b." would merge) - probably rare, so for now we solve it only provisionally like this + lstrcpyn(targetName, mbrName, 2 * MAX_PATH); // masks trim '.' from the ends of names, which is not always OK (e.g. directories "a.b" and "a.b." would merge) - this is probably rare, so for now we handle it provisionally like this else SalamanderGeneral->MaskName(targetName, 2 * MAX_PATH, mbrName, opMask); } @@ -1211,7 +1211,7 @@ CFTPQueueItem* CreateItemForChangeAttrsOperation(const CFileData* f, BOOL isDir, char* rights = NULL; if (rightsCol != -1 && IsUNIXLink((rights = dataIface->GetStringFromColumn(*f, rightsCol)))) { // link - if (includeSubdirs) // try whether it is a link to a directory (otherwise there is nothing to do) + if (includeSubdirs) // try to determine whether this is a link to a directory (otherwise there is nothing to do) { *type = fqitChAttrsResolveLink; item = new CFTPQueueItem; From 223d7d2878343dd9c3b687b6a2e28dd1d222c701 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 01:51:36 +0200 Subject: [PATCH 040/710] [tanslation] Fix src/plugins/ftp/fs5.cpp comments (#411) --- src/plugins/ftp/fs5.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/plugins/ftp/fs5.cpp b/src/plugins/ftp/fs5.cpp index 064cbd35c..b469f253f 100644 --- a/src/plugins/ftp/fs5.cpp +++ b/src/plugins/ftp/fs5.cpp @@ -47,7 +47,7 @@ BOOL CPluginFSInterface::ChangeAttributes(const char* fsName, HWND parent, int p { // we only care about data iface objects of type CFTPListingPluginDataInterface CFTPListingPluginDataInterface* dataIface = (CFTPListingPluginDataInterface*)pluginDataIface; int rightsCol = dataIface->FindRightsColumn(); - if (rightsCol != -1) // if the Rights column exists (it does not have to be Unix, that is handled later) + if (rightsCol != -1) // if the Rights column exists (it does not have to be a Unix column; that is handled later) { displayWarning = FALSE; const CFileData* f = NULL; // pointer to the file/directory in the panel that should be processed @@ -93,7 +93,7 @@ BOOL CPluginFSInterface::ChangeAttributes(const char* fsName, HWND parent, int p } } - if (!displayWarning || // optionally display a warning that this is not a UNIX server with the traditional rights model (e.g. we do not support ACL) + if (!displayWarning || // optionally display a warning that this is not a UNIX server with the traditional permissions model (e.g. ACLs are not supported) SalamanderGeneral->SalMessageBox(parent, LoadStr(IDS_CHATTRNOTUNIXSRV), LoadStr(IDS_FTPPLUGINTITLE), MB_YESNO | MSGBOXEX_ESCAPEENABLED | @@ -105,7 +105,7 @@ BOOL CPluginFSInterface::ChangeAttributes(const char* fsName, HWND parent, int p CChangeAttrsDlg dlg(parent, subject, attr, attrDiff, selDirs); if (dlg.Execute() == IDOK) { - BOOL failed = TRUE; // pre-initialize the operation error + BOOL failed = TRUE; // initialize the operation as failed // create the operation object CFTPOperation* oper = new CFTPOperation; if (oper != NULL) @@ -141,7 +141,7 @@ BOOL CPluginFSInterface::ChangeAttributes(const char* fsName, HWND parent, int p CFTPListingPluginDataInterface* dataIface = (CFTPListingPluginDataInterface*)pluginDataIface; if (dataIface != NULL && (void*)dataIface == (void*)&SimpleListPluginDataInterface) dataIface = NULL; // we only care about data iface objects of type CFTPListingPluginDataInterface - int rightsCol = -1; // index of the column with rights (used to detect links) + int rightsCol = -1; // index of the permissions column (used to detect links) if (dataIface != NULL) rightsCol = dataIface->FindRightsColumn(); const CFileData* f = NULL; // pointer to the file/directory/link in the panel that should be processed @@ -238,7 +238,7 @@ BOOL CPluginFSInterface::ChangeAttributes(const char* fsName, HWND parent, int p } if (!ok) FTPOperationsList.DeleteOperation(operUID, TRUE); - oper = NULL; // the operation is already added in the array, do not free it with 'delete' (see below) + oper = NULL; // the operation is already added to the array, do not free it with 'delete' (see below) } } if (oper != NULL) @@ -246,7 +246,7 @@ BOOL CPluginFSInterface::ChangeAttributes(const char* fsName, HWND parent, int p } else TRACE_E(LOW_MEMORY); - return !failed; // return the operation success (TRUE = clear the selection in the panel) + return !failed; // return whether the operation succeeded (TRUE = clear the selection in the panel) } } return FALSE; // cancellation @@ -258,7 +258,7 @@ BOOL CPluginFSInterface::RunOperation(HWND parent, int operUID, CFTPOperation* o BOOL ok = TRUE; - CFTPWorker* workerWithCon = NULL; // if we passed the connection, this points to who received it + CFTPWorker* workerWithCon = NULL; // if we passed the connection, this points to the recipient int i; for (i = 0; i < 1; i++) // FIXME: eventually we may place the initial number of operation workers into the configuration: just replace "1" with the appropriate count... { @@ -456,14 +456,14 @@ void CPluginFSInterface::ViewFile(const char* fsName, HWND parent, // open the viewer HANDLE fileLock; BOOL fileLockOwner; - if (!fileExists && !newFileCreated || // open the viewer only if the copy of the file is fine + if (!fileExists && !newFileCreated || // open the viewer only if the file copy is valid !salamander->OpenViewer(parent, tmpFileName, &fileLock, &fileLockOwner)) { // on error reset the "lock" fileLock = NULL; fileLockOwner = FALSE; } - // we still have to call FreeFileNameInCache as a pair to AllocFileNameInCache (link + // we still have to call FreeFileNameInCache to match AllocFileNameInCache (link // the viewer and the disk cache) salamander->FreeFileNameInCache(uniqueFileName, fileExists, newFileCreated, newFileSize, fileLock, fileLockOwner, @@ -714,7 +714,7 @@ BOOL CPluginFSInterface::CopyOrMoveFromDiskToFS(BOOL copy, int mode, const char* if (mode == 2 || mode == 3) { // 'targetPath' contains the raw path entered by the user (the only thing we know about it - // is that it points to the FTP, otherwise Salamander would not call this method) + // is that it is on FTP, otherwise Salamander would not call this method) int isFTPS = SalamanderGeneral->StrNICmp(targetPath, AssignedFSNameFTPS, AssignedFSNameLenFTPS) == 0 && targetPath[AssignedFSNameLenFTPS] == ':'; @@ -744,7 +744,7 @@ BOOL CPluginFSInterface::CopyOrMoveFromDiskToFS(BOOL copy, int mode, const char* if (p != NULL && *p != 0) port = atoi(p); - if (ControlConnection == NULL) // open the connection (open the path on the FTP server) + if (ControlConnection == NULL) // opening the connection (opening the path on the FTP server) { TotalConnectAttemptNum = 1; // opening the connection = first attempt to open the connection @@ -886,7 +886,7 @@ BOOL CPluginFSInterface::CopyOrMoveFromDiskToFS(BOOL copy, int mode, const char* } // if this is a root (only specific cases, other types of root paths continue further), no more adjustments - // nor path analysis make sense - use the path as is plus the "*" mask + // or path analysis makes sense - use the path as is plus the "*" mask if (!isSpecRootPath) { // if the path ends with a separator, treat it as a path without a mask (e.g. "/pub/dir/" or @@ -1034,7 +1034,7 @@ BOOL CPluginFSInterface::CopyOrMoveFromDiskToFS(BOOL copy, int mode, const char* // the path is analyzed, start the operation: // 'tgtPath' is the target path, 'mask' is the operation mask - BOOL success = FALSE; // pre-initialize cancel/error state of the operation + BOOL success = FALSE; // preset the cancel/error state of the operation char dlgSubjectSrc[MAX_PATH + 100]; if (sourceFiles + sourceDirs <= 1) // one selected item @@ -1070,7 +1070,7 @@ BOOL CPluginFSInterface::CopyOrMoveFromDiskToFS(BOOL copy, int mode, const char* if (cert) cert->Release(); oper->SetCompressData(ControlConnection->GetCompressData()); - if (ControlConnection->InitOperation(oper)) // initialize the connection to the server according to the "control connection" + if (ControlConnection->InitOperation(oper)) // initialize the connection to the server based on the "control connection" { oper->SetBasicData(dlgSubjectSrc, (AutodetectSrvType ? NULL : LastServerType)); char targetPath2[2 * MAX_PATH]; @@ -1207,7 +1207,7 @@ BOOL CPluginFSInterface::CopyOrMoveFromDiskToFS(BOOL copy, int mode, const char* oper->SetQueue(queue); // set the queue of its items for the operation queue = NULL; - // FIXME: there is probably no place for an "only add to queue" checkbox: if (Config.UploadAddToQueue) success = TRUE; // perform the operation later -> for now the operation is successful + // FIXME: there is probably nowhere to put an "only add to queue" checkbox: if (Config.UploadAddToQueue) success = TRUE; // perform the operation later -> for now, this counts as a successful operation // else // perform the operation in the active "control connection" // { // open the operation progress window and start the operation @@ -1219,7 +1219,7 @@ BOOL CPluginFSInterface::CopyOrMoveFromDiskToFS(BOOL copy, int mode, const char* } if (!ok) FTPOperationsList.DeleteOperation(operUID, TRUE); - oper = NULL; // the operation is already added in the array, do not free it with 'delete' (see below) + oper = NULL; // the operation is already added to the array, do not free it with 'delete' (see below) } } } @@ -1248,7 +1248,7 @@ void CPluginFSInterface::ShowSecurityInfo(HWND hParent) char errBuf[300]; int panel; if (SalamanderGeneral->GetPanelWithPluginFS(this, panel)) - { // the user might have imported the certificate or deleted it from the MS store, verify the state and show it in the panel + { // the user might have imported the certificate or deleted it from the MS store; recheck its status and show it in the panel bool verified = cert->CheckCertificate(errBuf, 300); cert->SetVerified(verified); SalamanderGeneral->ShowSecurityIcon(panel, TRUE, verified, From 3f616456a4dcd1795ffa566e883e8307dd0d3fb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 02:05:34 +0200 Subject: [PATCH 041/710] [tanslation] Fix src/plugins/ftp/ftp.cpp comments (#412) --- src/plugins/ftp/ftp.cpp | 100 ++++++++++++++++++++-------------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/src/plugins/ftp/ftp.cpp b/src/plugins/ftp/ftp.cpp index dee08be27..02ab50456 100644 --- a/src/plugins/ftp/ftp.cpp +++ b/src/plugins/ftp/ftp.cpp @@ -10,45 +10,45 @@ CPluginInterface PluginInterface; CPluginInterfaceForFS InterfaceForFS; CPluginInterfaceForMenuExt InterfaceForMenuExt; -// ConfigVersion: 0 - default (without load), -// 1 - work version before listing parsing support (from this version on there are sensible lists of server-types and ftp-servers) -// 2 - work version before the first MVS adjustments according to tester Michael Knigge (server-type list adjustment) -// 3 - work version before the second MVS adjustments according to tester Michael Knigge (server-type list adjustment) -// 4 - work version before the third MVS adjustments according to tester Michael Knigge (server-type list adjustment) -// 5 - work version before the first VMS adjustments (server-type list adjustment) -// 6 - work version before the fourth MVS adjustments according to tester Michael Knigge (server-type list adjustment) -// 7 - work version before modifying values in the configuration on the Operations page -// 8 - work version before Servant Salamander 2.1 beta 1 -// 9 - Servant Salamander 2.5 beta 6 (+adjustments to server-type autodetect conditions) -// 10 - added parser for Unix systems with two spaces before the file/directory name in the listing (Filezilla + AIX) -// 11 - fixed parser for Unix systems with two spaces before the file/directory name in the listing (Filezilla + AIX) -// 12 - priority change: the parser for Unix systems with two spaces after the year before names comes before the parser with one space after the year before names (the variant without spaces at the beginning of names is more likely) + enriched MVS1 and MVS2 parsers -// 13 - fixed column descriptions in the MVS PO parser (all four): used "Number of Records" instead of "Size" -// 14 - fixed the MVS PO 4 parser: the value can be missing both in column "AC" and in column "Alias" - now reading them directly by offsets + trimming trailing spaces, there is no other way + fixed the MVS1 and MVS2 parsers (volume OK + followed by "Error determining attributes") -// + fixed the column names in the MVS PO parser (all four): used "Records" instead of "Size" - the size is not in bytes, nonsensical progress was shown during download -// 15 - added parser for OS/2 FTP server -// 16 - added parser for VxWorks FTP server +// ConfigVersion: 0 - default (not loaded), +// 1 - working version before listing parsing support (from this version on, sensible server-type and ftp-server lists already exist) +// 2 - working version before the first MVS changes based on tester Michael Knigge's feedback (server-type list update) +// 3 - working version before the second MVS changes based on tester Michael Knigge's feedback (server-type list update) +// 4 - working version before the third MVS changes based on tester Michael Knigge's feedback (server-type list update) +// 5 - working version before the first VMS changes (server-type list update) +// 6 - working version before the fourth MVS changes based on tester Michael Knigge's feedback (server-type list update) +// 7 - working version before changing values in the configuration on the Operations page +// 8 - working version before Servant Salamander 2.1 beta 1 +// 9 - Servant Salamander 2.5 beta 6 (+ changes to server-type autodetection conditions) +// 10 - added a parser for Unix systems with two spaces before the file/directory name in the listing (FileZilla + AIX) +// 11 - fixed the parser for Unix systems with two spaces before the file/directory name in the listing (FileZilla + AIX) +// 12 - priority change: the parser for Unix systems with two spaces after the year before names now takes precedence over the parser with one space after the year before names (the variant without leading spaces in names is more likely) + enhanced MVS1 and MVS2 parsers +// 13 - fixed column descriptions in the MVS PO parser (all four): "Number of Records" is now used instead of "Size" +// 14 - fixed the MVS PO 4 parser: a value may be missing in both the "AC" and "Alias" columns - they are now read strictly by offsets + trailing spaces are trimmed, otherwise it simply does not work + fixed the MVS1 and MVS2 parsers (volume OK + followed by "Error determining attributes") +// + fixed column names in the MVS PO parser (all four): "Records" is now used instead of "Size" - the size is not in bytes, so download progress was nonsensical +// 15 - added a parser for the OS/2 FTP server +// 16 - added a parser for the VxWorks FTP server // 17 - fixed the MVS parser (another type of error message in the listing + another combination of skipped data in the listing) + fixed the VxWorks parser -// 18 - added alignment to parser columns - we usually align dates+times+numbers to the right +// 18 - added alignment to parser columns - dates, times, and numbers are usually right-aligned // 19 - adjusted the z/VM parser: Date is of type GeneralDate so that item ".." shows an empty string instead of "1.1.1602" // 20 - added the "is_link" identifier (TRUE = the panel icon has a link overlay) -// 21 - added the UNIX4 parser (German dates - months longer than 3 letters), added functions "month_txt" -// 22 - modified values in the configuration on the Operations 2 (Upload) page -// 23 - adjusted parser autodetection conditions that skip the first or last rows of the listing (if Microsoft IIS or Netprezenz returned a listing with one or two rows, the VMS parser simply ignored it and an empty listing was used) -// 24 - adjusted skipping listing headers in parsers, now an invalid row is not skipped when a header is missing -// 25 - adjusted the Microsoft IIS parser: directories containing spaces instead of names are ignored (I do not understand why they are even shown when they have no name, but they are) -// 26 - added UNIX5 (IBM AIX - German version) parser (the month and day columns are swapped) -// 27 - adjusted the VMS1-4 parsers, novelty on cs.felk.cvut.cz: an empty directory returns a listing containing "Total of 0 files, 0/0 blocks" (the listing previously returned the error "no files found") -// 28 - added parser for Tandem -// 29 - default change: "Resume or Overwrite" instead of "Overwrite" for Config.UploadRetryOnCreatedFile; Config.DisableLoggingOfWorkers changed to FALSE (I am tired of writing to everyone to enable logging, the logging overhead is minimal) -// 30 - added parser for IBM AS/400 -// 31 - adjusted parser for IBM AS/400 -// 32 - renamed parser for IBM AS/400 to "IBM iSeries/i5, AS/400" -// 33 - adjusted parser for IBM AS/400: names must not contain spaces (otherwise it nonsensically parses, for example, unparsable Unix listings) -// 34 - adjusted all five UNIX parsers: user+group can contain more spaces (in that case they are ignored because we do not know how to separate user from group) -// 35 - added UNIX parser for MOXA FTP server (missing times + dates); change in all UNIX parsers: reading the column is no longer done by fixed 10 characters but by a word (reason: ACL on Unix introduced '+' after those ten characters, e.g. "drwxrwxr-x+") +// 21 - added the UNIX4 parser (German dates - month names longer than 3 letters), added the "month_txt" functions +// 22 - changed values in the configuration on the Operations 2 (Upload) page +// 23 - adjusted parser autodetection conditions that skip the first or last rows of the listing (if Microsoft IIS or NetPresenz returned a listing with one or two rows, the VMS parser simply ignored it and an empty listing was used) +// 24 - adjusted skipping of listing headers in parsers; an invalid row is no longer skipped when a header is missing +// 25 - adjusted the Microsoft IIS parser: directories with spaces instead of names are ignored +// 26 - added the UNIX5 (IBM AIX - German version) parser (the month and day columns are swapped) +// 27 - adjusted the VMS1-4 parsers; new behavior on cs.felk.cvut.cz: an empty directory returns a listing containing "Total of 0 files, 0/0 blocks" (previously the listing returned the error "no files found") +// 28 - added a parser for Tandem +// 29 - default change: "Resume or Overwrite" instead of "Overwrite" for Config.UploadRetryOnCreatedFile; Config.DisableLoggingOfWorkers changed to FALSE (logging overhead is minimal) +// 30 - added a parser for IBM AS/400 +// 31 - adjusted the parser for IBM AS/400 +// 32 - renamed the parser for IBM AS/400 to "IBM iSeries/i5, AS/400" +// 33 - adjusted the parser for IBM AS/400: names must not contain spaces (otherwise it produces nonsensical parsing, for example for Unix listings that cannot be parsed) +// 34 - adjusted all five UNIX parsers: user+group may contain multiple spaces (in that case they are ignored because user and group cannot be separated) +// 35 - added a UNIX parser for the MOXA FTP server (missing times + dates); change in all UNIX parsers: the column is no longer read as a fixed 10 characters, but as a word (reason: ACLs on Unix introduced '+' after those ten characters, e.g. "drwxrwxr-x+") // 36 - change in the CZ+EN parser for IBM AS/400: ignore the first row with an empty file name -// 37 - added parser for Xbox 360 +// 37 - added a parser for Xbox 360 int ConfigVersion = 0; #define CURRENT_CONFIG_VERSION 37 @@ -200,7 +200,7 @@ int InactiveBeepWhenDone = TRUE; // current value of the Salamander configurati HINSTANCE DLLInstance = NULL; // handle to SPL - language-independent resources HINSTANCE HLanguage = NULL; // handle to SLG - language-dependent resources -// general interface of Salamander - valid from startup until the plug-in is closed +// general interface of Salamander - valid from startup until the plugin is closed CSalamanderGeneralAbstract* SalamanderGeneral = NULL; // ZLIB compression/decompression interface; @@ -244,7 +244,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) if (!InitCommonControlsEx(&initCtrls)) { MessageBox(NULL, "InitCommonControlsEx failed!", "Error", MB_OK | MB_ICONERROR); - return FALSE; // DLL won't start + return FALSE; // DLL cannot be loaded } WindowsVistaAndLater = SalIsWindowsVersionOrGreater(6, 0, 0); @@ -287,16 +287,16 @@ CPluginInterfaceAbstract* WINAPI SalamanderPluginEntry(CSalamanderPluginEntryAbs HANDLES_CAN_USE_TRACE(); CALL_STACK_MESSAGE1("SalamanderPluginEntry()"); - // this plug-in is made for the current version of Salamander and higher - perform a check + // this plugin is made for the current version of Salamander and higher - perform a check if (SalamanderVersion < LAST_VERSION_OF_SALAMANDER) { // reject older versions MessageBox(salamander->GetParentWindow(), REQUIRE_LAST_VERSION_OF_SALAMANDER, - "FTP Client" /* neprekladat! */, MB_OK | MB_ICONERROR); + "FTP Client" /* do not translate */, MB_OK | MB_ICONERROR); return NULL; } // let the language module (.slg) load - HLanguage = salamander->LoadLanguageModule(salamander->GetParentWindow(), "FTP Client" /* neprekladat! */); + HLanguage = salamander->LoadLanguageModule(salamander->GetParentWindow(), "FTP Client" /* do not translate */); if (HLanguage == NULL) return NULL; @@ -332,7 +332,7 @@ CPluginInterfaceAbstract* WINAPI SalamanderPluginEntry(CSalamanderPluginEntryAbs return NULL; // error } - // set the basic information about the plug-in + // set the basic information about the plugin salamander->SetBasicPluginData(LoadStr(IDS_PLUGINNAME), FUNCTION_CONFIGURATION | FUNCTION_LOADSAVECONFIGURATION | FUNCTION_FILESYSTEM, @@ -585,9 +585,9 @@ void CPluginInterface::LoadConfiguration(HWND parent, HKEY regKey, CSalamanderRe registry->GetValue(regKey, CONFIG_UPLOADDIRALREADYEXISTS, REG_DWORD, &Config.UploadDirAlreadyExists, sizeof(DWORD)); registry->GetValue(regKey, CONFIG_UPLOADRETRYONCREATFILE, REG_DWORD, &Config.UploadRetryOnCreatedFile, sizeof(DWORD)); - // adjustment of a poorly chosen default - based on user feedback I changed "Overwrite" to "Resume or Overwrite" - // (they were annoyed that after an hour of upload and a broken connection the file was overwritten instead of resumed, the risk of - // Resume is hopefully small enough, so I changed it to "Resume or Overwrite") + // adjustment of a poorly chosen default - based on user feedback, "Overwrite" was changed to "Resume or Overwrite" + // (users were annoyed that after an hour of uploading and a broken connection, the file was overwritten instead of resumed; the risk of + // Resume errors is hopefully small enough, so it was changed to "Resume or Overwrite") if (ConfigVersion < 29 && Config.UploadRetryOnCreatedFile == RETRYONCREATFILE_OVERWRITE) Config.UploadRetryOnCreatedFile = RETRYONCREATFILE_RES_OVRWR; @@ -642,7 +642,7 @@ void CPluginInterface::LoadConfiguration(HWND parent, HKEY regKey, CSalamanderRe registry->GetValue(regKey, CONFIG_ALWAYSSHOWLOGFORACTPAN, REG_DWORD, &Config.AlwaysShowLogForActPan, sizeof(DWORD)); registry->GetValue(regKey, CONFIG_DISABLELOGWORKERS, REG_DWORD, &Config.DisableLoggingOfWorkers, sizeof(DWORD)); - // adjustment of a poorly chosen default - logging will be enabled in workers by default (I am tired of constantly pointing people to how to enable logging + the logging overhead is minimal) + // adjust a poorly chosen default - logging will now be enabled in workers by default (the logging overhead is minimal) if (ConfigVersion < 29 && Config.DisableLoggingOfWorkers) Config.DisableLoggingOfWorkers = FALSE; @@ -698,8 +698,8 @@ void CPluginInterface::LoadConfiguration(HWND parent, HKEY regKey, CSalamanderRe registry->GetValue(regKey, CONFIG_OPERDLGCLOSEIFSUCCESS, REG_DWORD, &Config.CloseOperationDlgIfSuccessfullyFinished, sizeof(DWORD)); - // commented out because remembering this checkbox feels odd to me - I now see the meaning of the checkbox - // in having the option to let the dialog close after the operation completes (which does not depend on the previous operation) + // commented out because remembering this checkbox seems odd - the checkbox now appears to mean + // having the option to close the dialog after the operation completes (which does not depend on the previous operation) // registry->GetValue(regKey, CONFIG_OPERDLGCLOSEWHENFINISHES, REG_DWORD, // &Config.CloseOperationDlgWhenOperFinishes, sizeof(DWORD)); @@ -874,8 +874,8 @@ void CPluginInterface::SaveConfiguration(HWND parent, HKEY regKey, CSalamanderRe registry->SetValue(regKey, CONFIG_OPERDLGCLOSEIFSUCCESS, REG_DWORD, &Config.CloseOperationDlgIfSuccessfullyFinished, sizeof(DWORD)); - // commented out because remembering this checkbox feels odd to me - I now see the meaning of the checkbox - // in having the option to let the dialog close after the operation completes (which does not depend on the previous operation) + // commented out because remembering this checkbox seems odd - the checkbox now appears to mean + // having the option to close the dialog after the operation completes (which does not depend on the previous operation) // registry->SetValue(regKey, CONFIG_OPERDLGCLOSEWHENFINISHES, REG_DWORD, // &Config.CloseOperationDlgWhenOperFinishes, sizeof(DWORD)); @@ -1068,7 +1068,7 @@ void CPluginInterface::AcceptChangeOnPathNotification(const char* path, BOOL inc void CPluginInterface::ReleasePluginDataInterface(CPluginDataInterfaceAbstract* pluginData) { - if (pluginData != &SimpleListPluginDataInterface) // it is global, no need to release it + if (pluginData != &SimpleListPluginDataInterface) // the global one does not need to be released { delete ((CFTPListingPluginDataInterface*)pluginData); } From 6993b067263c6802273a5c53317a5261fab4840b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 02:25:29 +0200 Subject: [PATCH 042/710] [tanslation] Fix src/plugins/ftp/ftp2.cpp comments (#413) --- src/plugins/ftp/ftp2.cpp | 67 ++++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/src/plugins/ftp/ftp2.cpp b/src/plugins/ftp/ftp2.cpp index c1b104da3..93be7912e 100644 --- a/src/plugins/ftp/ftp2.cpp +++ b/src/plugins/ftp/ftp2.cpp @@ -804,16 +804,16 @@ char* GetTypeNameForUser(char* typeName, char* buf, int bufSize) #define WSTF_MAX_LINE_LEN 80 // used when writing and reading a string to a file -// writes string 'str' to file 'file', returns any error in 'err' (must not be NULL); -// format (apart from "// " at the beginning of the line exactly as it will be in the file - '"', '\', etc. have no C++ meaning): -// "first line starts with double quotes -// long lines has backslash after each part of line: -// line-part1\ -// line-part2\ +// writes string 'str' to file 'file'; returns any error in 'err' ('err' must not be NULL); +// format (except for the "// " at the beginning of the line, exactly as it will be in the file - '"', '\\', etc. do not have C++ meaning): +// "first line starts with a double quote +// long lines have a backslash after each line part: +// line-part1\\ +// line-part2\\ // line-part3 -// next-line with escape sequence \" for double quotes and \\ for backslash -// NULL string is written only as \0 escape sequence -// lastline ends with double quotes" +// next-line with escape sequence \\\" for double quotes and \\\\ for backslash +// NULL string is written only as the \\0 escape sequence +// last line ends with a double quote" void WriteStrToFile(HANDLE file, const char* str, DWORD* err) { char line[WSTF_MAX_LINE_LEN + 3]; // 3 characters are overhead for easy writing @@ -821,7 +821,7 @@ void WriteStrToFile(HANDLE file, const char* str, DWORD* err) BOOL success; if (str == NULL) { - strcpy(line, "\"\\0\"\r\n"); // string for a NULL value + strcpy(line, "\"\\0\"\r\n"); // representation of a NULL string int len = (int)strlen(line); if ((success = WriteFile(file, line, len, &written, NULL)) == 0 || written != (DWORD)len) @@ -962,7 +962,7 @@ CServerType::ExportToFile(HANDLE file) ULONG written; BOOL success; int len = (int)strlen(line); - if (len > 0 && // there is something to write + if (len > 0 && // something to write ((success = WriteFile(file, line, len, &written, NULL)) == 0 || written != (DWORD)len)) { @@ -991,7 +991,7 @@ BOOL MatchString(char* beg, char* end, const char* str, char** afterStr) return FALSE; } -// returns a null-terminated allocated string from 'beg' to 'end'; on low memory +// returns a newly allocated null-terminated string from 'beg' to 'end'; if memory allocation fails // returns NULL and stores FALSE in 'ret' char* AllocString(char* beg, char* end, BOOL* ret) { @@ -1009,13 +1009,13 @@ char* AllocString(char* beg, char* end, BOOL* ret) return s; } -// gradually reads a string from the file lines; the currently processed line is 'line' to 'lineEnd' +// reads a string incrementally from the file lines; the currently processed line is 'line' to 'lineEnd' // (not null-terminated); 'firstLine' is an IN/OUT variable initialized to -// TRUE, the ReadStrFromLines function changes it to FALSE as soon as it finds the beginning of the string; +// TRUE; ReadStrFromLines changes it to FALSE as soon as it finds the beginning of the string; // 'dynStr' receives the part of the string read from the currently processed line; the pointers -// 'firstLine' and 'dynStr' do not change during the loading of one string (they act as global -// data); in 'success' (must not be NULL) FALSE is returned on a syntax error or a -// 'dynStr' allocation error; returns TRUE if the entire string has already been read and in 'isNULLStr' returns +// 'firstLine' and 'dynStr' do not change while reading one string (they serve as global +// data); 'success' (must not be NULL) is set to FALSE on a syntax error or a +// 'dynStr' allocation error; returns TRUE if the entire string has already been read, and 'isNULLStr' returns // TRUE if it is NULL (otherwise the string is stored in 'dynStr') BOOL ReadStrFromLines(const char* line, const char* lineEnd, BOOL* firstLine, CDynString* dynStr, BOOL* success, BOOL* isNULLStr) @@ -1065,7 +1065,7 @@ BOOL ReadStrFromLines(const char* line, const char* lineEnd, BOOL* firstLine, { foundEnd = TRUE; eol = FALSE; - break; // end of the string found (+ no more EOL) + break; // end of the string found (+ no following EOL) } } if (d + 2 >= end) // need to "flush" the local buffer to 'dynStr' (no space left for a character + EOL) @@ -1086,9 +1086,9 @@ BOOL ReadStrFromLines(const char* line, const char* lineEnd, BOOL* firstLine, return foundEnd; } -// helper function: if 'isNULLStr' is TRUE, it returns NULL in 'str'; otherwise, if 'success' -// is TRUE, it tries to duplicate the 'dynStr' string into 'str', and on low memory returns -// 'success' as FALSE +// helper function: if 'isNULLStr' is TRUE, it stores NULL in 'str'; otherwise, if 'success' +// is TRUE, it tries to duplicate the 'dynStr' string into 'str' and sets +// 'success' to FALSE on out-of-memory void GetStrResult(char** str, BOOL* success, CDynString* dynStr, BOOL isNULLStr) { if (isNULLStr) @@ -1278,7 +1278,7 @@ BOOL CServerType::ImportFromFile(HANDLE file, DWORD* err, int* errResID) case 5: // load columns { BOOL read2 = TRUE; - if (strFirstLine) // the string has not started yet, check whether there is still a column on the line or whether they have ended + if (strFirstLine) // the string has not started yet, check whether there is still a column on the line or whether the columns have ended { char* s2 = lineBeg; while (s2 < lineEnd && *s2 <= ' ') @@ -1497,16 +1497,17 @@ CProxyScriptParams::CProxyScriptParams() } // 'buf' with size 'bufSize' is the buffer for the resulting text (host or command); -// 'logBuf' with size 'logBufSize' is the buffer for the resulting text that can be published in the log +// 'logBuf' with size 'logBufSize' is the buffer for the resulting text suitable for publishing in the log // (commands only - passwords are not published, they are replaced with the word "hidden"); 'strBeg' to 'strEnd' -// is the script text to be expanded; 'hostVarsOnly' is TRUE when expanding -// the host (only the Host and ProxyHost variables are allowed, and CRLF is not appended at the end as it is for commands); -// 'proxyHostNeeded' (if not NULL) returns TRUE when the $(ProxyHost) variable is used during the expansion +// is the script text to expand; 'hostVarsOnly' is TRUE when expanding +// the host (only the Host and ProxyHost variables are allowed, and CRLF is not appended at the end as it is +// for commands); 'proxyHostNeeded' (if not NULL) receives TRUE if the $(ProxyHost) variable is used during +// string expansion // return values: -// - error: returns FALSE, the error code is returned in 'errCode' and '*errorPos' gives the error position -// - the line should be skipped: returns TRUE with 'skipThisLine'==TRUE -// - missing variable values: returns FALSE, but 'errCode' is 0 -// - everything OK: returns TRUE with text in 'buf' +// - error: returns FALSE, the error code is returned in 'errCode' and the error position is returned in '*errorPos' +// - the line should be skipped: returns TRUE and 'skipThisLine'==TRUE +// - variable values are missing: returns FALSE, but 'errCode' is 0 +// - everything OK: returns TRUE and the text is in 'buf' BOOL ExpandText(char* buf, int bufSize, char* logBuf, int logBufSize, const char* strBeg, const char* strEnd, CProxyScriptParams* scriptParams, const char** errorPos, int* errCode, BOOL hostVarsOnly, BOOL* skipThisLine, BOOL* proxyHostNeeded) @@ -1743,7 +1744,7 @@ BOOL ExpandText(char* buf, int bufSize, char* logBuf, int logBufSize, const char int i; for (i = 0; i < 9; i++) { - if (needUserInput & (1 << i)) // necessarily means that 'scriptParams' is not NULL + if (needUserInput & (1 << i)) // implies that 'scriptParams' is not NULL { switch (i) { @@ -1830,7 +1831,7 @@ BOOL ProcessProxyScript(const char* script, const char** execPoint, int lastCmdR int errCode = 0; const char* s = *execPoint == NULL ? script : *execPoint; BOOL validateScript = scriptParams == NULL; - BOOL processNextLine = s > script; // TRUE = we should process the next line with a command in the script + BOOL processNextLine = s > script; // TRUE = process the next command line in the script if (s == script) // we are at the beginning of the script { while (*s != 0 && *s <= ' ') @@ -2427,7 +2428,7 @@ BOOL CFTPProxyServer::Load(HWND parent, HKEY regKey, CSalamanderRegistryAbstract { saveProxyPassword = TRUE; - // detect and, if needed, clear the "unnecessary" (due to storing "save password" TRUE) empty scrambled password + // detect and, if needed, clear the empty scrambled password stored only to keep "save password" TRUE CSalamanderPasswordManagerAbstract* passwordManager = SalamanderGeneral->GetSalamanderPasswordManager(); if (!passwordManager->IsPasswordEncrypted(proxyEncryptedPassword, proxyEncryptedPasswordSize)) { From ad01bfff91f5adf7a49b6da5fdc0ae265b78106f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 02:39:22 +0200 Subject: [PATCH 043/710] [tanslation] Fix src/plugins/ftp/ftp3.cpp comments (#414) --- src/plugins/ftp/ftp3.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/ftp/ftp3.cpp b/src/plugins/ftp/ftp3.cpp index be4703b9c..5000628e0 100644 --- a/src/plugins/ftp/ftp3.cpp +++ b/src/plugins/ftp/ftp3.cpp @@ -95,7 +95,7 @@ void CServerTypeList::Load(HWND parent, HKEY regKey, CSalamanderRegistryAbstract TRACE_E(LOW_MEMORY); break; } - if (!item->Load(parent, subKey, registry)) // loading failed, we ignore this item + if (!item->Load(parent, subKey, registry)) // loading failed, ignore this item { delete item; } @@ -318,7 +318,7 @@ void CFTPServerList::CheckProxyServersUID(CFTPProxyServerList& ftpProxyServerLis if (s->ProxyServerUID != -1 && s->ProxyServerUID != -2 && !ftpProxyServerList.IsValidUID(s->ProxyServerUID)) { - s->ProxyServerUID = -2; // validate the UID by switching to "default" + s->ProxyServerUID = -2; // make the UID valid by switching to "default" } } } From 6e86f81f17219c9a63d743299385ec70fb6b9bf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 03:05:04 +0200 Subject: [PATCH 044/710] [tanslation] Fix src/plugins/ftp/ftputils.cpp comments (#415) --- src/plugins/ftp/ftputils.cpp | 62 ++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/src/plugins/ftp/ftputils.cpp b/src/plugins/ftp/ftputils.cpp index e43d71cc2..517d15108 100644 --- a/src/plugins/ftp/ftputils.cpp +++ b/src/plugins/ftp/ftputils.cpp @@ -25,7 +25,7 @@ BOOL FTPCutDirectory(CFTPServerPathType type, char* path, int pathBufSize, switch (type) { case ftpsptUnix: - case ftpsptAS400: // although it is not perfect, I think it will be enough (improvement: if it is a /qsys.lib path and the name ends with .mbr, cut two components and return them as the file name: "/QSYS.LIB/GARY.LIB/UCLSRC.FILE/BKPLIB2.MBR" -> "/QSYS.LIB/GARY.LIB" + "UCLSRC.FILE/BKPLIB2.MBR") + case ftpsptAS400: // not perfect, but sufficient for now (improvement: for a /qsys.lib path with a name ending in .mbr, cut two components and return them as the file name: "/QSYS.LIB/GARY.LIB/UCLSRC.FILE/BKPLIB2.MBR" -> "/QSYS.LIB/GARY.LIB" + "UCLSRC.FILE/BKPLIB2.MBR") { char* lastSlash = path + l - 1; while (--lastSlash >= path && *lastSlash != '/') @@ -351,7 +351,7 @@ BOOL FTPPathAppend(CFTPServerPathType type, char* path, int pathSize, const char default: { char slash = '/'; - if (type == ftpsptNetware || type == ftpsptWindows || type == ftpsptOS2) // novell + windows + OS/2 + if (type == ftpsptNetware || type == ftpsptWindows || type == ftpsptOS2) // NetWare + Windows + OS/2 { if (l > 0 && (path[l - 1] == '/' || path[l - 1] == '\\')) { @@ -367,7 +367,7 @@ BOOL FTPPathAppend(CFTPServerPathType type, char* path, int pathSize, const char if (*name != 0) { int n = (int)strlen(name); - if (l + 1 + n < pathSize) // do we fit even with the terminating zero? + if (l + 1 + n < pathSize) // do we fit even with the terminating null character? { if (!empty) path[l] = slash; @@ -429,7 +429,7 @@ BOOL FTPIsValidAndNotRootPath(CFTPServerPathType type, const char* path) if (l > 0) // valid path = non-empty { const char* s = strchr(path, '.'); - return s == NULL || s != path + l - 1; // root ends with '.' and contains only one period + return s == NULL || s != path + l - 1; // root must not end with '.' as its only period } return FALSE; } @@ -484,7 +484,7 @@ const char* FTPFindEndOfUserNameOrHostInURL(const char* url) while (--p >= url && *p != '@' && *p != ':' && *p != '\\') ; if (p < url) - return hostEnd; // it is only the server address and port + return hostEnd; // only the server address and port if (*p == '\\' || *p == ':') skip = TRUE; // neither '\\' nor ':' belongs here, stop parsing from the right } @@ -573,12 +573,12 @@ void FTPSplitPath(char* p, char** user, char** password, char** host, char** por *e-- = 0; // clip spaces at end } *p++ = 0; - if (passwd) // next is password + if (passwd) // password follows { beg = p; p = passEnd; if (password != NULL) - *password = beg; // let password as is (do not skip spaces) + *password = beg; // leave the password as is (do not skip spaces) *p++ = 0; } // next is host @@ -630,7 +630,7 @@ int FTPGetUserLength(const char* user) while (*s != 0 && *s != '/' && *s != '\\' && *s != ':' && *s != '@') s++; if (*s == 0) - return 0; // problem-free name (including anonymous user) + return 0; // valid name (including anonymous user) while (*s != 0) s++; return (int)(s - user); @@ -981,7 +981,7 @@ BOOL HaveSubstring(const char* text, const char* sub) } t++; } - return *sub == 0; // not found (exception: empty text and empty substring) + return *sub == 0; // not found (except when both text and substring are empty) } const char* KnownOSNames[] = {"UNIX", "Windows", "NETWARE", "TANDEM", "OS/2", "VMS", "MVS", "VM", "OS/400", NULL}; @@ -1005,7 +1005,7 @@ void FTPGetServerSystem(const char* serverSystem, char* sysName) if (serverSystem != NULL) { int replyLen = (int)strlen(serverSystem); - if (*serverSystem == '2' && replyLen > 4) // FTP_D1_SUCCESS + there is a chance of the system name string + if (*serverSystem == '2' && replyLen > 4) // FTP_D1_SUCCESS + the system name string may be present { const char* sys; if (serverSystem[3] == ' ') @@ -1245,7 +1245,7 @@ CFTPServerPathType GetFTPServerPathType(const char* serverFirstReply, const char return ftpsptTandem; } else - return ftpsptWindows; // Windows are more likely than NetWare + return ftpsptWindows; // Windows is more likely than NetWare } } if (charOnFirstPos && colonOnSecondPos && colon == 1 && // paths of the form "C:" @@ -1280,7 +1280,7 @@ CFTPServerPathType GetFTPServerPathType(const char* serverFirstReply, const char return ftpsptWindows; if (HaveSubstring(sysName, "NETWARE") || serverFirstReply != NULL && HaveSubstring(serverFirstReply, " NW 3") && - HaveSubstring(serverFirstReply, " HellSoft")) // known first server response and it is a Hellsoft server on NetWare + HaveSubstring(serverFirstReply, " HellSoft")) // the server's first response is known and it is a HellSoft server on NetWare { return ftpsptNetware; } @@ -1382,7 +1382,7 @@ BOOL FTPAddHexEscapeSequences(char* txt, int txtSize) s += 3; } else - return FALSE; // maly buffer + return FALSE; // small buffer } else s++; @@ -1436,7 +1436,7 @@ BOOL GetAttrsFromUNIXRights(DWORD* actAttr, DWORD* attrDiff, const char* rights) // CAUTION: if the format of UNIX permissions changes, IsUNIXLink() must be updated as well - if (rights != NULL && strlen(rights) == 10) // must be ten characters, otherwise it cannot be UNIX permissions (permissions with ACL have eleven characters, e.g. "drwxrwxr-x+", and we cannot modify them, so we pretend we do not know them) + if (rights != NULL && strlen(rights) == 10) // it must be ten characters, otherwise it cannot be UNIX permissions (permissions with ACL have eleven characters, e.g. "drwxrwxr-x+", but we cannot modify them, so we pretend they are unknown) { BOOL ok = TRUE; *actAttr = 0; @@ -1494,7 +1494,7 @@ BOOL IsUNIXLink(const char* rights) // CAUTION: if the format of UNIX permissions changes, GetAttrsFromUNIXRights() must be updated as well int len = (rights != NULL ? (int)strlen(rights) : 0); - return ((len == 10 || len == 11 && rights[10] == '+') && // must be ten characters, otherwise it cannot be UNIX permissions; exception: with ACL it is eleven characters, e.g. "drwxrwxr-x+" + return ((len == 10 || len == 11 && rights[10] == '+') && // it must be ten characters, otherwise it cannot be UNIX permissions; exception: with ACL it has eleven characters, e.g. "drwxrwxr-x+" rights[0] == 'l' && (rights[1] == 'r' || rights[1] == '-') && (rights[2] == 'w' || rights[2] == '-') && @@ -1544,7 +1544,7 @@ BOOL FTPReadFTPReply(char* readBytes, int readBytesCount, int readBytesOffset, char** reply, int* replySize, int* replyCode) { BOOL ret = FALSE; - if (readBytesOffset < readBytesCount) // if anything is loaded at all + if (readBytesOffset < readBytesCount) // if anything has been read at all { char* s = readBytes + readBytesOffset; char* end = readBytes + readBytesCount; @@ -1752,7 +1752,7 @@ BOOL FTPGetIPAndPortFromReply(const char* reply, int replySize, DWORD* ip, unsig int p1, p2; while (s < end) // looking for a sequence of six numbers separated by ',' and whitespace { - if (*s >= '0' && *s <= '9') // hope for the start of the sequence + if (*s >= '0' && *s <= '9') // possible start of the sequence { int i; for (i = 0; i < 6; i++) @@ -1790,7 +1790,7 @@ BOOL FTPGetIPAndPortFromReply(const char* reply, int replySize, DWORD* ip, unsig } } else - break; // number too large, cannot be the requested sextet + break; // number too large, cannot be the searched-for sextet if (i == 5) // end of search, success { @@ -2204,7 +2204,7 @@ BOOL FTPRemovePointsFromPath(char* path, CFTPServerPathType pathType) case ftpsptWindows: case ftpsptOS2: { - char backslashSep = backslash ? '\\' : '/'; // backslash==FALSE -> every check will test '/' twice (instead of both slash and backslash) + char backslashSep = backslash ? '\\' : '/'; // backslash==FALSE -> every check will test '/' twice (instead of testing both '/' and '\\') char* afterRoot = path + (*path == '/' || *path == backslashSep ? 1 : 0); if (pathType == ftpsptOS2 && afterRoot == path && *path != 0 && *(path + 1) == ':') afterRoot = path + 2 + (*(path + 2) == '/' || *(path + 2) == backslashSep ? 1 : 0); @@ -2420,7 +2420,7 @@ BOOL FTPMayBeValidNameComponent(const char* name, const char* path, BOOL isDir, default: { TRACE_E("FTPIsValidName(): unexpected path type!"); - return TRUE; // we do not know what path that is, so assume OK (if it is not, the server will report it later; at worst it creates more subdirectories, tough luck) + return TRUE; // we do not know what type of path this is, so assume OK (if it is not OK, the server will report it later; at worst it creates more subdirectories, etc.) } } } @@ -2557,10 +2557,10 @@ void FTPGenerateNewName(int* phase, char* newName, int* index, const char* origi case ftpsptWindows: case ftpsptOS2: *phase = 1; - // the break is not missing here! + // the break is intentionally omitted here case ftpsptUnix: { - if (*phase == 0) // at this stage we assume a classic UNIX (names max 255 characters, do not contain '/' or '\0') + if (*phase == 0) // at this stage we assume classic UNIX (names max 255 characters, do not contain '/' or '\0') { const char* s = originalName; char* n = newName; @@ -2620,7 +2620,7 @@ void FTPGenerateNewName(int* phase, char* newName, int* index, const char* origi if (255 - (n - newName) < suffixLen) { int cut = (int)(suffixLen - (255 - (n - newName))); - if (dot != NULL && dot - newName > cut) // shortening in the name + if (dot != NULL && dot - newName > cut) // shorten the name { memmove(dot - cut, dot, (n - dot) + 1); dot -= cut; @@ -2659,7 +2659,7 @@ void FTPGenerateNewName(int* phase, char* newName, int* index, const char* origi if (*index != 0) // append " (number)" after the name { char* n = newName + strlen(newName); - char* dot = isDir ? NULL : strrchr(newName + 1, '.'); // files only: the first period from the right that is not at the beginning of the name; NOTE: exception, because phase==0 means that we are not dealing with Windows: ".cvspass" on UNIX is not an extension + char* dot = isDir ? NULL : strrchr(newName + 1, '.'); // files only: the first period from the right that is not at the beginning of the name; NOTE: exception, because phase==0 means this is not Windows: ".cvspass" on UNIX is not an extension if (alreadyRenamedFile) // ensure "name (2)"->"name (3)" instead of ->"name (2) (2)" { char* s = dot == NULL ? n : dot; @@ -2693,7 +2693,7 @@ void FTPGenerateNewName(int* phase, char* newName, int* index, const char* origi if (MAX_PATH - 4 - (n - newName) < suffixLen) { int cut = (int)(suffixLen - (MAX_PATH - 4 - (n - newName))); - if (dot != NULL && dot - newName > cut) // shortening in the name + if (dot != NULL && dot - newName > cut) // shorten the name { memmove(dot - cut, dot, (n - dot) + 1); dot -= cut; @@ -2821,7 +2821,7 @@ void FTPGenerateNewName(int* phase, char* newName, int* index, const char* origi if (MAX_PATH - 4 - (n - newName) < suffixLen) { int cut = (int)(suffixLen - (MAX_PATH - 4 - (n - newName))); - if (dot != NULL && dot - newName > cut) // shortening in the name + if (dot != NULL && dot - newName > cut) // shorten the name { memmove(dot - cut, dot, (n - dot) + 1); dot -= cut; @@ -2985,8 +2985,8 @@ void FTPGenerateNewName(int* phase, char* newName, int* index, const char* origi } } } - if (*index == 0 && *s == 0 && !changed) // newName is identical to originalName, we must adjust newName - *index = 1; // also handles the reserved name "." (by the way: ".." -> "__" or "_.") + if (*index == 0 && *s == 0 && !changed) // newName is identical to originalName, so newName must be adjusted + *index = 1; // also handles the reserved name "." (note: ".." -> "__" or "_.") if (*index != 0) // append "_number" after the name { if (alreadyRenamedFile) // ensure "name_2"->"name_3" instead of ->"name_2_2" @@ -3053,7 +3053,7 @@ void FTPGenerateNewName(int* phase, char* newName, int* index, const char* origi break; } - case ftpsptAS400: // AS/400: we do not know anything about the naming format on AS/400 yet; for now we reuse the following Tandem code, it seems restrictive enough that AS/400 should be satisfied with it as well + case ftpsptAS400: // AS/400: we do not know anything about the AS/400 name format yet; for now we reuse the following Tandem code, which seems restrictive enough for AS/400 as well case ftpsptTandem: { // full path to a file: \\SYSTEM.$VVVVV.SUBVOLUM.FILENAME @@ -3094,7 +3094,7 @@ void FTPGenerateNewName(int* phase, char* newName, int* index, const char* origi } } *n = 0; - if (*index == 0 && *s == 0 && !change) // newName is identical to originalName, we must adjust newName + if (*index == 0 && *s == 0 && !change) // newName is identical to originalName, so newName must be adjusted *index = 1; if (*index != 0) // append "number" after the name { @@ -3230,7 +3230,7 @@ void FTPGenerateNewName(int* phase, char* newName, int* index, const char* origi if (MAX_PATH - 4 - (n - newName) < suffixLen) { int cut = (int)(suffixLen - (MAX_PATH - 4 - (n - newName))); - if (dot != NULL && dot - newName > cut) // shortening in the name + if (dot != NULL && dot - newName > cut) // shortening the name { memmove(dot - cut, dot, (n - dot) + 1); dot -= cut; From b8aa2df13c8b344a89936106b75e732975275064 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 03:18:54 +0200 Subject: [PATCH 045/710] [tanslation] Fix src/plugins/ftp/ftputils.h comments (#416) --- src/plugins/ftp/ftputils.h | 97 ++++++++++++++++++++------------------ 1 file changed, 50 insertions(+), 47 deletions(-) diff --git a/src/plugins/ftp/ftputils.h b/src/plugins/ftp/ftputils.h index 95f680bc9..6480d8735 100644 --- a/src/plugins/ftp/ftputils.h +++ b/src/plugins/ftp/ftputils.h @@ -25,13 +25,13 @@ enum CFTPServerPathType // determines the path type on an FTP server; if 'serverFirstReply' is not NULL, it is the first // reply from the server (often containing the server version); if 'serverSystem' is not NULL, it -// is the FTP server response to the SYST command (our ftpcmdSystem); 'path' is the path on the FTP +// is the FTP server response to the SYST command (our ftpcmdSystem); 'path' is the path on the FTP server; returns the path type CFTPServerPathType GetFTPServerPathType(const char* serverFirstReply, const char* serverSystem, const char* path); // parses the system name from the server response to the SYST command stored in 'serverSystem' -// and stores it into 'sysName' (a buffer of at least 201 characters); if it is not possible to -// obtain the system name from this response, returns an empty string +// and stores it into 'sysName' (a buffer of at least 201 characters); if the system name cannot be +// obtained from this response, stores an empty string void FTPGetServerSystem(const char* serverSystem, char* sysName); // shortens the FTP server path by the last directory/file (directory separators depend on the @@ -45,11 +45,11 @@ void FTPGetServerSystem(const char* serverSystem, char* sysName); BOOL FTPCutDirectory(CFTPServerPathType type, char* path, int pathBufSize, char* cutDir, int cutDirBufSize, BOOL* fileNameCouldBeCut); -// concatenates the path 'path' and 'name' (file/directory name - 'isDir' is FALSE/TRUE) into -// 'path', performing the concatenation according to the path type - 'type'; 'path' is a buffer of -// at least 'pathSize' characters; returns TRUE if 'name' fits into 'path'; if 'path' or 'name' is -// empty, no concatenation occurs (the 'path' path may be adjusted - truncated to the minimal length - e.g. -// "/pub/" + "" = "/pub") +// concatenates 'path' and 'name' (file/directory name - 'isDir' is FALSE/TRUE) into 'path', +// performing the concatenation according to the path type - 'type'; 'path' is a buffer of at +// least 'pathSize' characters; returns TRUE if 'name' fits into 'path'; if 'path' or 'name' is +// empty, no concatenation is performed (the path in 'path' may still be adjusted - truncated to +// the minimal length - e.g. "/pub/" + "" = "/pub") BOOL FTPPathAppend(CFTPServerPathType type, char* path, int pathSize, const char* name, BOOL isDir); // determines whether the FTP server path (not a user-part path) 'path' is valid and whether it is @@ -57,7 +57,7 @@ BOOL FTPPathAppend(CFTPServerPathType type, char* path, int pathSize, const char // and is not a root path BOOL FTPIsValidAndNotRootPath(CFTPServerPathType type, const char* path); -// converts escape sequences (e.g. "%20" = " ") in the string 'txt' to ASCII characters +// converts hex escape sequences (e.g. "%20" = " ") in the string 'txt' to ASCII characters void FTPConvertHexEscapeSequences(char* txt); // prepares the text 'txt' so that it survives the subsequent conversion of escape sequences to // ASCII characters (e.g. "%20" = "%2520"); 'txtSize' is the size of the 'txt' buffer; returns @@ -65,11 +65,11 @@ void FTPConvertHexEscapeSequences(char* txt); BOOL FTPAddHexEscapeSequences(char* txt, int txtSize); // splits the user-part path into individual components (user name, host, port, and path (without -// '/' or '\\' at the beginning)); inserts zero terminators into the path string 'p' so each +// '/' or '\\' at the beginning)); inserts null terminators into the path string 'p' so each // component becomes a null-terminated string; if 'firstCharOfPath' is not NULL and the FTP path -// contains a path within the server ('path' string), 'firstCharOfPath' receives the separator of this -// path ('/' or '\\'); it does not need to return all components ('user', 'host', 'port', and 'path' -// can be NULL); if a particular component cannot be obtained (the path might not contain it), the +// contains a server path ('path' string), 'firstCharOfPath' receives the separator of that path +// ('/' or '\\'); it does not need to return all components ('user', 'host', 'port', and 'path' can +// be NULL); if a particular component cannot be obtained (the path might not contain it), the // corresponding variable receives NULL; 'user', 'host', and 'port' are returned trimmed of // whitespace on both sides; 'userLength' is zero if we do not know how long the user name is or if it // does not contain "forbidden" characters, otherwise it is the expected length of the user name; @@ -80,7 +80,7 @@ void FTPSplitPath(char* p, char** user, char** password, char** host, char** por // returns the length of the username for use in the "userLength" parameters (FTPSplitPath, // FTPFindPath, etc.); for an anonymous user and other usernames without special characters -// ('@', '/', '\', ':') returns zero; 'user' can also be NULL +// ('@', '/', '\\', ':') returns zero; 'user' can also be NULL int FTPGetUserLength(const char* user); // returns a pointer to the remote path in an FTP path (a pointer into the 'path' buffer); 'path' @@ -103,7 +103,8 @@ BOOL FTPIsTheSameServerPath(CFTPServerPathType type, const char* p1, const char* // determines whether 'prefix' is a prefix of 'path' - both paths are on the FTP server (not // user-part paths), returns TRUE if it is a prefix; 'type' is the type of at least one of the -// paths; if 'mustBeSame' is TRUE, 'prefix' and 'path' must match (same function as +// paths; if 'mustBeSame' is TRUE, 'prefix' and 'path' must match, which is equivalent to +// FTPIsTheSameServerPath() BOOL FTPIsPrefixOfServerPath(CFTPServerPathType type, const char* prefix, const char* path, BOOL mustBeSame = FALSE); @@ -126,18 +127,18 @@ char* FTPGetErrorText(int err, char* buf, int bufSize); // returns, based on the path type, the character used to separate path components (subdirectories) char FTPGetPathDelimiter(CFTPServerPathType pathType); -// only for the ftpsptIBMz_VM path type: obtains the root path from the path 'path'; -// 'root'+'rootSize' is the buffer for the result; returns success +// only for the ftpsptIBMz_VM path type: obtains the root path from 'path'; +// 'root'+'rootSize' is the output buffer; returns success BOOL FTPGetIBMz_VMRootPath(char* root, int rootSize, const char* path); -// only for the ftpsptOS2 path type: obtains the root path from the path 'path'; -// 'root'+'rootSize' is the buffer for the result; returns success +// only for the ftpsptOS2 path type: obtains the root path from 'path'; +// 'root'+'rootSize' is the output buffer; returns success BOOL FTPGetOS2RootPath(char* root, int rootSize, const char* path); -// obtains the numeric value from the UNIX rights string 'rights'; returns the value in actAttr -// (must not be NULL); if it finds permissions that cannot be set via "site chmod" ('s', 't', etc.), -// it ORs the respective bits into 'attrDiff' (must not be NULL); if the rights are UNIX rights, it -// returns TRUE, otherwise it returns FALSE (unknown rights string or e.g. ACL rights on UNIX (such +// obtains the numeric value from the UNIX rights string 'rights'; returns the value in 'actAttr' +// (must not be NULL); if it finds rights that cannot be set using "site chmod" ('s', 't', etc.), +// it ORs the corresponding bits into 'attrDiff' (must not be NULL); returns TRUE for UNIX rights +// and FALSE otherwise (unknown rights string or e.g. UNIX ACL rights, such as "drwxrwxr-x+") BOOL GetAttrsFromUNIXRights(DWORD* actAttr, DWORD* attrDiff, const char* rights); // converts 'attrs' (numeric rights on UNIX) to a UNIX rights string (without the first letter) @@ -153,30 +154,30 @@ BOOL IsUNIXLink(const char* rights); // NOTE: 'bufSize' must be greater than 2 void FTPGetErrorTextForLog(DWORD err, char* errBuf, int bufSize); -// method for detecting whether the buffer 'readBytes' (with 'readBytesCount' valid bytes, reading -// from position 'readBytesOffset') already contains the entire response from the FTP server; -// returns TRUE on success - 'reply' (must not be NULL) receives a pointer to the beginning of the -// response, 'replySize' (must not be NULL) receives the length of the response, 'replyCode' -// (if not NULL) receives the FTP response code or -1 if the response has no code (does not start +// detects whether the buffer 'readBytes' (with 'readBytesCount' valid bytes, starting at +// position 'readBytesOffset') already contains the complete response from the FTP server; +// returns TRUE on success: 'reply' (must not be NULL) receives a pointer to the start of the +// response, 'replySize' (must not be NULL) receives the response length, and 'replyCode' +// (if not NULL) receives the FTP reply code or -1 if the response has no code (does not start // with a three-digit number); if the response is not complete yet, returns FALSE BOOL FTPReadFTPReply(char* readBytes, int readBytesCount, int readBytesOffset, char** reply, int* replySize, int* replyCode); -// parses the directory from the string 'reply' (rules see RFC 959 - FTP response number "257"); -// does not strictly require "257" at the beginning of the string (handle if necessary before -// calling); returns TRUE if the directory was obtained successfully +// parses the directory from the string 'reply' (for the rules, see RFC 959, FTP reply code "257"); +// does not strictly require "257" at the beginning of the string (if necessary, handle this before calling); +// returns TRUE if the directory was parsed successfully // can be called from any thread BOOL FTPGetDirectoryFromReply(const char* reply, int replySize, char* dirBuf, int dirBufSize); -// parses IP+port from the string 'reply' of length 'replySize' (-1 == use 'strlen(reply)') (returns -// it in 'ip'+'port' (must not be NULL); rules see RFC 959 - FTP response number 227); -// does not strictly require "227" at the beginning of the string (handle if necessary before -// calling); returns TRUE if obtaining IP+port succeeded +// parses the IP address and port from the string 'reply' of length 'replySize' (-1 == use 'strlen(reply)') +// (returns them in 'ip' and 'port' (must not be NULL); for the rules, see RFC 959, FTP reply code 227); +// does not strictly require "227" at the beginning of the string (if necessary, handle this before calling); +// returns TRUE if the IP address and port were parsed successfully // can be called from any thread BOOL FTPGetIPAndPortFromReply(const char* reply, int replySize, DWORD* ip, unsigned short* port); -// parses the data size from the string 'reply' of length 'replySize' and returns it in 'size'; -// on success returns TRUE, otherwise FALSE and 'size' is set arbitrarily +// parses the data size from the string 'reply' of length 'replySize' and stores it in 'size'; +// returns TRUE on success; otherwise returns FALSE and 'size' is set to an arbitrary value BOOL FTPGetDataSizeInfoFromSrvReply(CQuadWord& size, const char* reply, int replySize); // creates a VMS directory name (adds ".DIR;1") @@ -184,7 +185,8 @@ void FTPMakeVMSDirName(char* vmsDirNameBuf, int vmsDirNameBufSize, const char* d // checks whether there is an escape sequence before the character 'checkedChar' in the path // 'pathBeginning' (e.g. "^." is '.', which VMS does not consider a path or extension separator, -// etc.); returns TRUE if there is an escape sequence before the character (meaning the character +// etc.); returns TRUE if there is an escape sequence before the character (i.e. the character has +// no special meaning) BOOL FTPIsVMSEscapeSequence(const char* pathBeginning, const char* checkedChar); // returns TRUE if the path 'path' of type 'type' ends with a path component delimiter @@ -192,9 +194,9 @@ BOOL FTPIsVMSEscapeSequence(const char* pathBeginning, const char* checkedChar); BOOL FTPPathEndsWithDelimiter(CFTPServerPathType type, const char* path); // shortens an IBM z/VM path on the FTP server by the last two components; 'path' is an in/out -// buffer (min. size 'pathBufSize' bytes), 'cutDir' (a buffer of at least -// 'cutDirBufSize') returns the last two components (the removed part; if the string -// does not fit into the buffer, it is truncated); returns TRUE if shortening occurred +// buffer (minimum size 'pathBufSize' bytes), and 'cutDir' (a buffer of at least +// 'cutDirBufSize' bytes) receives the last two components (the removed part; if the string +// does not fit into the buffer, it is truncated); returns TRUE if the path was shortened BOOL FTPIBMz_VmCutTwoDirectories(char* path, int pathBufSize, char* cutDir, int cutDirBufSize); // trims the file version number from an OpenVMS file name (e.g. "a.txt;1" -> "a.txt"); @@ -219,7 +221,7 @@ BOOL FTPCutFirstDirFromRelativePath(CFTPServerPathType pathType, char* path, // completes an absolute path to a full absolute path (for VMS the volume is added - e.g. // "PUB$DEVICE:", for OS/2 the drive - e.g. "C:"); 'pathType' is the path type; 'path' is an -// absolute path; 'path' (a buffer of at least 'pathBufSize' characters) returns the full +// absolute path; 'path' (a buffer of at least 'pathBufSize' characters) receives the full // absolute path (lack of space = truncated result); 'workPath' is the working // full absolute path (from which the volume/drive is taken); returns success (even if // 'path' is already a full absolute path on input - meaning there is nothing to do) @@ -235,21 +237,22 @@ BOOL FTPRemovePointsFromPath(char* path, CFTPServerPathType pathType); // otherwise it is case-insensitive (windows) BOOL FTPIsCaseSensitive(CFTPServerPathType pathType); -// returns TRUE if this is an error response to the LIST command that only says the directory is -// empty (so it is not actually an error - unfortunately VMS and Z/VM still report such errors) +// returns TRUE if this is an error response to the LIST command that only indicates the directory +// is empty (that is, it is not actually an error; unfortunately VMS and Z/VM report such +// non-errors this way) BOOL FTPIsEmptyDirListErrReply(const char* listErrReply); // returns TRUE if the name 'name' can be the name of a single file/directory ('isDir' is // FALSE/TRUE) on the path 'path' of type 'pathType'; used only to prevent creating multiple -// subdirectories instead of just one (e.g. "a.b.c" on VMS creates three subdirectories) -// the server reports the syntax error in the name +// subdirectories instead of just one (e.g. "a.b.c" on VMS creates three subdirectories); +// any syntax error in the name is reported only by the server BOOL FTPMayBeValidNameComponent(const char* name, const char* path, BOOL isDir, CFTPServerPathType pathType); // for uploading to the server: adds the *.* or * mask to the target path (for later processing of // the operation mask); 'pathType' is the path type; 'targetPath' is a buffer (of size // 'targetPathBufSize') containing the target path on input (full, including fs-name) -// and on output enriched with the mask; 'noFilesSelected' is TRUE if no files should be uploaded +// and the same path with the mask appended on output; 'noFilesSelected' is TRUE if no files should be uploaded // (only directories are selected in the panel) void FTPAddOperationMask(CFTPServerPathType pathType, char* targetPath, int targetPathBufSize, BOOL noFilesSelected); From 23558878196c3f745a11b6a930c3ec9bdc8e2e70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 03:27:05 +0200 Subject: [PATCH 046/710] [tanslation] Fix src/plugins/ftp/menu.cpp comments (#417) --- src/plugins/ftp/menu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/ftp/menu.cpp b/src/plugins/ftp/menu.cpp index 48ec82f5c..cfdd77f64 100644 --- a/src/plugins/ftp/menu.cpp +++ b/src/plugins/ftp/menu.cpp @@ -22,7 +22,7 @@ CPluginInterfaceForMenuExt::GetMenuItemState(int id, DWORD eventMask) case FTPCMD_TRMODEBINARY: { CPluginFSInterfaceAbstract* fs = SalamanderGeneral->GetPanelPluginFS(PANEL_SOURCE); - if (fs != NULL) // it is our FS; otherwise it would be NULL + if (fs != NULL) // our FS; otherwise it would be NULL { return ((CPluginFSInterface*)fs)->GetTransferModeCmdState(id); } From 11e7744cd8040b915c6a03fc9bb300e3251f1822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 03:36:19 +0200 Subject: [PATCH 047/710] [tanslation] Fix src/plugins/ftp/parser.h comments (#418) --- src/plugins/ftp/parser.h | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/plugins/ftp/parser.h b/src/plugins/ftp/parser.h index 020e99a87..9cd2747b4 100644 --- a/src/plugins/ftp/parser.h +++ b/src/plugins/ftp/parser.h @@ -4,9 +4,9 @@ #pragma once -// skips the identifier name (function, state variable, or column name), +// skips an identifier (function, state variable, or column name), // returns TRUE if at least one character was skipped (the identifier has at least one -// character); otherwise returns the 'emptyErrID' error in 'errorResID' +// character); otherwise stores the 'emptyErrID' error in 'errorResID' BOOL SkipIdentifier(const char*& s, const char* end, int* errorResID, int emptyErrID); // @@ -43,7 +43,7 @@ enum CFTPParserBinaryOperators enum CFTPParserParameterType { pptNone, // uninitialized - pptColumnID, // column identifier (-3==is_link, -2==is_hidden, -1==is_dir, from 0 it is an index in the 'columns' array) + pptColumnID, // column identifier (-3==is_link, -2==is_hidden, -1==is_dir, from 0 onward it is an index in the 'columns' array) pptBoolean, // boolean (true==1, false==0) pptString, // string pptNumber, // signed int64 (unsigned int64 is unnecessary) @@ -242,7 +242,7 @@ class CFTPParserFunction protected: CFTPParserFunctionCode Function; - TIndirectArray Parameters; // list of all rule functions + TIndirectArray Parameters; // list of all function parameters public: CFTPParserFunction(CFTPParserFunctionCode func) : Parameters(1, 1) { Function = func; } @@ -323,8 +323,8 @@ class CFTPParserRule BOOL IsGood() { return Functions.IsGood(); } // returns TRUE if the function in the rule was compiled successfully (up to the ')' symbol); - // on error returns FALSE and sets 'errorResID' (number of the string describing - // the error - stored in resources) or 'lowMem' (TRUE = low memory) + // on failure returns FALSE and sets 'errorResID' (resource ID of the string describing + // the error) or 'lowMem' (TRUE = low memory) BOOL CompileNewFunction(CFTPParserFunctionCode func, const char*& rules, const char* rulesEnd, TIndirectArray* columns, int* errorResID, BOOL* lowMem, BOOL* colAssigned); @@ -352,12 +352,12 @@ class CFTPParserRule // // bits for the date column index in 'emptyCol' (see CFTPParser::GetNextItemFromListing) -#define DATE_MASK_DAY 0x02 // the date has the day set (starting at 0x02 because TRUE = 0x01) +#define DATE_MASK_DAY 0x02 // day is set in the date (starting at 0x02 because TRUE = 0x01) #define DATE_MASK_MONTH 0x04 // the date has the month set #define DATE_MASK_YEAR 0x08 // the date has the year set #define DATE_MASK_DATE 0x0E // the date is set completely #define DATE_MASK_YEARCORRECTIONNEEDED 0x10 // the year in the date still needs to be corrected (used with "year_or_time") -#define DATE_MASK_TIME 0x100 // the time is set completely (it is a different column, it could be 0x02, but we use 0x10 for easier error detection) +#define DATE_MASK_TIME 0x100 // the time is fully set (it is a different column, 0x02 could be used, but 0x10 is used for easier error detection) // constants for CFTPParser::AllowedLanguagesMask #define PARSER_LANG_ALL 0xFFFF @@ -381,7 +381,7 @@ class CFTPParser const char* LastNonEmptyEnd; // end of the last non-empty line const char* ListingBeg; // beginning of the listing BOOL ListingIncomplete; // TRUE if the listing is incomplete - BOOL SkipThisLineItIsIncomlete; // TRUE only if the rule processing detected that the listing is incomplete - skip the trailing part of the listing processed by this rule + BOOL SkipThisLineItIsIncomlete; // TRUE only if rule processing detected that the listing is incomplete - the trailing part of the listing processed by this rule is skipped DWORD AllowedLanguagesMask; // allowed languages for functions month_3 and month_txt (bit combination of PARSER_LANG_XXX constants) - purpose: to avoid mixing languages when detecting months public: @@ -492,20 +492,20 @@ class CFTPAutodetCondNode }; // allocates the parser and creates its structure according to the 'rules' string (parsing rules); -// 'columns' are defined columns; on error returns NULL; returns TRUE in 'lowMem' (if not NULL) -// if the error was caused by lack of memory; returns the offset of a syntactic or semantic error -// inside 'rules' in 'errorPos' (if not NULL) (-1=unknown error position), and at the same time -// returns the number of the string describing the error in 'errorResID' (if not NULL) +// 'columns' are the defined columns; on error returns NULL; returns TRUE in 'lowMem' (if not NULL) +// if the error was caused by lack of memory; returns the offset of a syntax or semantic error +// in 'rules' in 'errorPos' (if not NULL) (-1=unknown error position), and also returns +// the ID of the string describing the error in 'errorResID' (if not NULL) // (stored in resources; -1=no error description) CFTPParser* CompileParsingRules(const char* rules, TIndirectArray* columns, int* errorPos, int* errorResID, BOOL* lowMem); // loads the autodetection condition from the 'cond' string and stores it in an allocated tree, // whose root it returns; on error returns NULL; returns TRUE in 'lowMem' (if not NULL) if the error -// was caused by lack of memory; returns the offset of a syntactic error inside 'cond' (-1=unknown error position) -// in 'errorPos' (if not NULL); simultaneously returns the number of the string describing the error in 'errorResID' -// (if not NULL) (stored in resources; -1=no error description) and returns a textual error description in the -// 'errBuf'+'errBufSize' buffer (has higher priority than 'errorResID') +// was caused by lack of memory; returns the offset of a syntax error inside 'cond' (-1=unknown error position) +// in 'errorPos' (if not NULL); also returns the ID of the string describing the error in 'errorResID' +// (if not NULL) (stored in resources; -1=no error description) and returns a textual error description in +// the buffer specified by 'errBuf' and 'errBufSize' (has higher priority than 'errorResID') CFTPAutodetCondNode* CompileAutodetectCond(const char* cond, int* errorPos, int* errorResID, BOOL* lowMem, char* errBuf, int errBufSize); From c0652759cacc125004bdd67f85b71c15d3872e84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 03:48:25 +0200 Subject: [PATCH 048/710] [tanslation] Fix src/plugins/ftp/parser1.cpp comments (#419) --- src/plugins/ftp/parser1.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/plugins/ftp/parser1.cpp b/src/plugins/ftp/parser1.cpp index de72d63d6..ee199f0d0 100644 --- a/src/plugins/ftp/parser1.cpp +++ b/src/plugins/ftp/parser1.cpp @@ -205,7 +205,7 @@ BOOL CFTPParser::CompileNewRule(const char*& rules, const char* rulesEnd, int* errorResID, BOOL* lowMem, BOOL* colAssigned) { CALL_STACK_MESSAGE1("CFTPParser::CompileNewRule()"); - rules++; // we know '*' arrived, skip it + rules++; // we know there is a '*', skip it CFTPParserRule* ruleObj = new CFTPParserRule; if (ruleObj == NULL) { @@ -242,7 +242,7 @@ BOOL CFTPParser::CompileNewRule(const char*& rules, const char* rulesEnd, return FALSE; } rules++; - return TRUE; // with this, the rule is compiled + return TRUE; // the rule is compiled at this point } else // a function has to start here { @@ -409,7 +409,7 @@ BOOL CFTPParserRule::CompileNewFunction(CFTPParserFunctionCode func, const char* int* errorResID, BOOL* lowMem, BOOL* colAssigned) { DEBUG_SLOW_CALL_STACK_MESSAGE2("CFTPParserRule::CompileNewFunction(%d)", (int)func); - rules++; // we know '(' arrived, skip it + rules++; // we know there is a '(', skip it CFTPParserFunction* funcObj = new CFTPParserFunction(func); if (funcObj == NULL) { @@ -457,7 +457,7 @@ BOOL CFTPParserRule::CompileNewFunction(CFTPParserFunctionCode func, const char* // also check the types and counts of parameters used by the compiled function if (!funcObj->CheckParameters(columns, errorResID, colAssigned)) return FALSE; - return TRUE; // with this, the function is compiled + return TRUE; // the function is compiled at this point } else // a parameter has to start here { @@ -1500,7 +1500,7 @@ CFTPParserParameter::GetFuncParType(TIndirectArray* columns) } else { - if (Type == pptColumnID) // for a column, determine the type according to the column's value type + if (Type == pptColumnID) // for a column, determine the type according to the type of values in the column { if (ColumnIndex >= 0 && ColumnIndex < columns->Count) { @@ -1754,12 +1754,12 @@ BOOL CFTPParserParameter::GetBoolean(CFileData* file, BOOL* isDir, case pboSubStrIsNotInString: { BOOL found = FALSE; - if (lBeg < lEnd) // non-empty sample to search for + if (lBeg < lEnd) // non-empty pattern to search for { const char* s = rBeg; while (s < rEnd) { - if (LowerCase[*lBeg] == LowerCase[*s]) // does the first letter of the pattern match + if (LowerCase[*lBeg] == LowerCase[*s]) // the first letter of the pattern matches { // searching for 'lBeg' in 's' (using the simplest algorithm - O(m*n), but almost O(1) in real cases) const char* m = lBeg + 1; const char* t = s + 1; From 3f83af68993295e859810b2ae2807f3ceec116ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 04:02:25 +0200 Subject: [PATCH 049/710] [tanslation] Fix src/plugins/ftp/parser2.cpp comments (#420) --- src/plugins/ftp/parser2.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/plugins/ftp/parser2.cpp b/src/plugins/ftp/parser2.cpp index 82d6560be..ab26da31a 100644 --- a/src/plugins/ftp/parser2.cpp +++ b/src/plugins/ftp/parser2.cpp @@ -190,7 +190,7 @@ void FillEmptyValues(BOOL& err, CFileData* file, BOOL isDir, } } } - else // the date is incomplete -> take the empty value + else // the date is incomplete -> use an empty value { lastWriteDate.wYear = stVal.wYear; lastWriteDate.wMonth = stVal.wMonth; @@ -300,7 +300,7 @@ BOOL CFTPParser::GetNextItemFromListing(CFileData* file, BOOL* isDir, if (!err) { - // for each column the 'emptyCol' array contains TRUE until some value is assigned + // for each column, the 'emptyCol' array contains TRUE until a value is assigned to that column int i; for (i = 0; i < columns->Count; i++) emptyCol[i] = TRUE; @@ -318,7 +318,7 @@ BOOL CFTPParser::GetNextItemFromListing(CFileData* file, BOOL* isDir, BOOL brk = FALSE; if (Rules[j]->UseRule(file, isDir, dataIface, columns, &s, listingEnd, this, &err, emptyCol)) { - if (SkipThisLineItIsIncomlete || // an incomplete listing was detected - skip the processed trailing part of the listing + if (SkipThisLineItIsIncomlete || // an incomplete listing was detected - skip the trailing part of the listing being processed !emptyCol[0]) break; // the rule succeeded - a file or directory was read - proceed to process the data brk = TRUE; // the rule succeeded - skip the line - continue parsing the next line @@ -682,7 +682,7 @@ BOOL AssignStringToColumn(int col, TIndirectArray* columns, cons } } -// returns the number of the month whose name is encoded by three letters; if it is an unknown +// returns the number of the month whose name is encoded as three letters; if it is an unknown // month code, returns -1 int GetMonthFromThreeLetters(const char* month, const char* monthStr) { @@ -769,8 +769,8 @@ int GetMonthFromThreeLettersAllLangs(const char* month, DWORD* allowedLanguagesM } } -// returns the number of the month whose name is encoded by text; if it is an unknown -// month code, returns -1 +// returns the number of the month whose name is encoded in the text; if the +// month code is unknown, returns -1 int GetMonthFromText(const char** month, const char* monthEnd, const char* monthStr) { const char* s = *month; @@ -1327,7 +1327,7 @@ BOOL CFTPParserFunction::UseFunction(CFileData* file, BOOL* isDir, { while (s < listingEnd && *s != '\r' && *s != '\n') { - if (LowerCase[*str] == LowerCase[*s]) // the first letter of the searched pattern matches + if (LowerCase[*str] == LowerCase[*s]) // the first letter of the pattern matches { // search for 'str' in 's' (using the simplest algorithm - O(m*n), but almost O(1) in real cases) const char* m = str + 1; const char* t = s + 1; @@ -1363,7 +1363,7 @@ BOOL CFTPParserFunction::UseFunction(CFileData* file, BOOL* isDir, } } else - ret = FALSE; // should never happen (NULL only on low-memory, which does not reach here) + ret = FALSE; // should never happen (NULL only under low-memory conditions, and that cannot happen here) if (needDealloc && str != NULL) free((void*)str); } From 354fe6773ff0fab5ffe668451352353ebb1958f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 04:13:05 +0200 Subject: [PATCH 050/710] [tanslation] Fix src/plugins/ftp/parser3.cpp comments (#421) --- src/plugins/ftp/parser3.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/plugins/ftp/parser3.cpp b/src/plugins/ftp/parser3.cpp index 96ddf7aba..371eca620 100644 --- a/src/plugins/ftp/parser3.cpp +++ b/src/plugins/ftp/parser3.cpp @@ -33,8 +33,8 @@ class CFTPAutodetCondLexAn CFTPAutodetCondLexElement ActElem; // current symbol (lexNone = it is still necessary to find the symbol) - int* ErrorResID; // if not NULL, stores the id of the string in resources that describes the error - BOOL* LowMem; // if not NULL, stores TRUE for an error caused by lack of memory + int* ErrorResID; // if not NULL, stores the ID of the string resource that describes the error + BOOL* LowMem; // if not NULL, stores TRUE if the error was caused by lack of memory char* ErrBuf; // buffer of size ErrBufSize for the textual description of the error (higher priority than ErrorResID) int ErrBufSize; // size of the ErrBuf buffer (0 = NULL buffer) @@ -221,7 +221,7 @@ CFTPAutodetCondLexAn::GetActualElement() break; } if (*s == '\r' || *s == '\n') - break; // the string cannot contain EOL directly (use escape sequences '\r' and '\n') + break; // the string cannot contain a literal EOL (use escape sequences '\r' and '\n') if (*s == '\\' && s + 1 < end) // escape sequence { s++; @@ -236,7 +236,7 @@ CFTPAutodetCondLexAn::GetActualElement() } s++; } - if (strEndFound) // string is OK + if (strEndFound) // string is valid { const char* orgStrBeg = strBeg; char* str = (char*)malloc((s - strBeg) - esc + 1); @@ -461,7 +461,7 @@ CFTPAutodetCondNode* CompileAutodetectCond(const char* cond, int* errorPos, int* if (lexAn.GetActualElement() != lexEOS) // non-empty condition -> start parsing { CFTPAutodetCondNode* node = FTP_AC_ExpOr(lexAn); - if (node != NULL && lexAn.GetActualElement() != lexEOS) // if the entire string is not parsed, it is an error (the "empty" rule from the grammar is "unpacked" here) + if (node != NULL && lexAn.GetActualElement() != lexEOS) // if the entire string is not parsed, it is an error (the "empty" grammar rule is expanded here) { lexAn.SetErrorResID(IDS_STPAR_ERR_UNEXPSYM); delete node; @@ -495,7 +495,7 @@ CFTPAutodetCondNode* CompileAutodetectCond(const char* cond, int* errorPos, int* // // allocates a new node for an operator; 'type' can only be 'acntOr' or 'acntAnd'; -// 'left'+'right' are operands; returns the allocated node; on lack of memory +// 'left'+'right' are operands; returns the allocated node; if memory is insufficient, // deallocates 'left' and 'right' and returns NULL CFTPAutodetCondNode* CreateNewACOperNode(CFTPAutodetCondLexAn& lexAn, CFTPAutodetCondNodeType type, CFTPAutodetCondNode* left, CFTPAutodetCondNode* right) @@ -517,8 +517,8 @@ CFTPAutodetCondNode* CreateNewACOperNode(CFTPAutodetCondLexAn& lexAn, CFTPAutode return node; } -// allocates a new node for negation; 'operand' is the operand of negation; returns the allocated -// node; on lack of memory deallocates 'operand' and returns NULL +// allocates a new node for negation; 'operand' is the negation operand; returns the allocated +// node; if memory is insufficient, deallocates 'operand' and returns NULL CFTPAutodetCondNode* CreateNewACNotNode(CFTPAutodetCondLexAn& lexAn, CFTPAutodetCondNode* operand) { CFTPAutodetCondNode* node = new CFTPAutodetCondNode; @@ -535,8 +535,8 @@ CFTPAutodetCondNode* CreateNewACNotNode(CFTPAutodetCondLexAn& lexAn, CFTPAutodet return node; } -// allocates a new node for a function loaded from 'lexAn'; returns the allocated node or -// NULL when memory is insufficient +// allocates a new node for a function read from 'lexAn'; returns the allocated node or +// NULL if memory is insufficient CFTPAutodetCondNode* CreateNewACFuncNode(CFTPAutodetCondLexAn& lexAn) { CFTPAutodetCondNode* node = new CFTPAutodetCondNode; From e914790cf90b4a2de4dee27a0bea22af2b41bfe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 04:47:55 +0200 Subject: [PATCH 051/710] [tanslation] Fix src/plugins/ftp/sockets.cpp comments Refines translated comments in src/plugins/ftp/sockets.cpp. Model: OpenAI GPT-5.4. Verification: OSTranslation sequential review with full prompt logging, Copilot event logging, clang AST grounding, guard 0 violations, and git diff check passed. Telemetry: 62 provider calls, 570250 estimated tokens, 7 Copilot SDK calls, 14 Copilot request units. --- src/plugins/ftp/sockets.cpp | 76 ++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/src/plugins/ftp/sockets.cpp b/src/plugins/ftp/sockets.cpp index 59f2d2c50..3bab7b7a4 100644 --- a/src/plugins/ftp/sockets.cpp +++ b/src/plugins/ftp/sockets.cpp @@ -407,7 +407,7 @@ BOOL CSocket::Connect(DWORD ip, unsigned short port, DWORD* error, BOOL calledFr ShouldPostFD_WRITE = FALSE; BOOL addCalled = FALSE; - if (Msg == -1) // the socket is not in SocketsThread, add it + if (Msg == -1) // the socket is not in SocketsThread; add it { if (!SocketsThread->AddSocket(this)) // we are inside CSocketsThread::CritSect, so this call is possible even from CSocket::SocketCritSect { @@ -426,10 +426,10 @@ BOOL CSocket::Connect(DWORD ip, unsigned short port, DWORD* error, BOOL calledFr Socket = socket(AF_INET, SOCK_STREAM, 0); if (Socket != INVALID_SOCKET) { - // disable the Nagle algorithm, we do not want any unnecessary waiting - // WARNING: when downloading on a local network there were frequent dropouts, the transfer often - // restarted, and I did not notice any speedup, so I decided - // to give this up (this was still at accept()) + // disable the Nagle algorithm to avoid unnecessary waiting + // WARNING: when downloading on a local network, frequent dropouts occurred, the transfer often + // restarted, and no speedup was observed, so this was abandoned + // (this was still in accept()) // BOOL noDelayOn = TRUE; // setsockopt(Socket, IPPROTO_TCP, TCP_NODELAY, (char *)&noDelayOn, sizeof(noDelayOn)); @@ -446,7 +446,7 @@ BOOL CSocket::Connect(DWORD ip, unsigned short port, DWORD* error, BOOL calledFr if (connect(Socket, (SOCKADDR*)&addr, sizeof(addr)) == SOCKET_ERROR) { DWORD err = WSAGetLastError(); - if (err == WSAEWOULDBLOCK) // normal reaction to connecting a non-blocking socket + if (err == WSAEWOULDBLOCK) // normal response when connecting a non-blocking socket { ret = TRUE; } @@ -456,7 +456,7 @@ BOOL CSocket::Connect(DWORD ip, unsigned short port, DWORD* error, BOOL calledFr *error = WSAGetLastError(); } } - else // returned NO_ERROR, behaves like the blocking variant of "connect", should never happen + else // connect returned NO_ERROR, behaves like the blocking variant of "connect", should never happen { TRACE_E("CSocket::Connect(): connect has returned unexpected value!"); } @@ -797,7 +797,7 @@ BOOL CSocket::GetHostByAddress(const char* address, int hostUID) if (t != NULL) { if (t->Create(SocketsThreadQueue) == NULL) - delete t; // the thread did not start, error + delete t; // thread failed to start, error else maybeOK = TRUE; // the thread is running, the address lookup may succeed } @@ -885,7 +885,7 @@ BOOL CSocket::GetProxyError(char* errBuf, int errBufSize, char* formatBuf, int f CALL_STACK_MESSAGE1("CSocket::GetProxyError(, , ,)"); HANDLES(EnterCriticalSection(&SocketCritSect)); - BOOL ret = FALSE; // FALSE = it is not an error reported by the proxy server (but for example an error connecting to the proxy server) + BOOL ret = FALSE; // FALSE = not an error reported by the proxy server (for example, an error connecting to the proxy server) if (ProxyErrorCode != pecNoError) { ret = TRUE; @@ -1201,7 +1201,7 @@ void CSocket::Socks5SendRequest(int request, int index, BOOL* csLeft, BOOL isCon len = 255; // longer named addresses simply cannot be entered in a SOCKS 5 request buf[4] = (unsigned char)len; memcpy(buf + 5, HostAddress, len); - len++; // for the byte with the address length + len++; // for the address-length byte } else { @@ -1579,7 +1579,7 @@ void CSocket::ReceiveNetEventInt(LPARAM lParam, int index) { // process the first response from the SOCKS5 proxy server if (read == 2) // the response should have 2 bytes (the first byte is the version, but they do not say what it should be set to, so we ignore it) { - if (buf[1] == 0 /* anonymous */) + if (buf[1] == 0 /* no authentication */) { SocketState = ssSocks5_WaitForCon; BOOL csLeft; @@ -1635,7 +1635,7 @@ void CSocket::ReceiveNetEventInt(LPARAM lParam, int index) if (!csLeft) HANDLES(LeaveCriticalSection(&SocketCritSect)); } - else // the server rejected us, we are done + else // the server rejected us, aborting { ProxyErrorCode = pecUserPassAuthFail; SocketState = ssConnectFailed; @@ -1754,7 +1754,7 @@ void CSocket::ReceiveNetEventInt(LPARAM lParam, int index) int read = 2; if (ProxyReceiveBytes(lParam, buf, &read, index, FALSE, TRUE /* listen */, FALSE)) { // process the first response from the SOCKS5 proxy server - if (read == 2) // the response should have 2 bytes (the first byte is the version, but they do not say what it should be set to, so we ignore it) + if (read == 2) // the response should have 2 bytes (the first byte is the version, but its expected value is not specified, so we ignore it) { if (buf[1] == 0 /* anonymous */) { @@ -1813,7 +1813,7 @@ void CSocket::ReceiveNetEventInt(LPARAM lParam, int index) if (!csLeft) HANDLES(LeaveCriticalSection(&SocketCritSect)); } - else // the server rejected us, we are done + else // the server rejected us, terminate { ProxyErrorCode = pecUserPassAuthFail; SocketState = ssListenFailed; @@ -1833,13 +1833,13 @@ void CSocket::ReceiveNetEventInt(LPARAM lParam, int index) break; } - case ssSocks4_WaitForListenRes: // waiting for the proxy to open a port for "listen" and return the IP+port where it listens or an error (timeout should be handled outside - timeout for calling ListeningForConnection()) + case ssSocks4_WaitForListenRes: // waiting for the proxy to open a port for "listen" and return the IP+port where it is listening or an error (timeout should be handled outside - timeout for calling ListeningForConnection()) case ssSocks4A_WaitForListenRes: // waiting for the proxy to open a port for "listen" and return the IP+port where it listens or an error (timeout should be handled outside - timeout for calling ListeningForConnection()) { int read = 8; if (ProxyReceiveBytes(lParam, buf, &read, index, FALSE, TRUE /* listen */, FALSE)) { // process the SOCKS4 proxy server response - if (read == 8 && buf[0] == 0) // the response should have 8 bytes + "version" should be 0 + if (read == 8 && buf[0] == 0) // the response should have 8 bytes and the "version" should be 0 { if (buf[1] == 90) // reply code == success { @@ -1875,12 +1875,12 @@ void CSocket::ReceiveNetEventInt(LPARAM lParam, int index) break; } - case ssSocks5_WaitForListenRes: // waiting for the proxy to open a port for "listen" and return the IP+port where it listens or an error (timeout should be handled outside - timeout for calling ListeningForConnection()) + case ssSocks5_WaitForListenRes: // waiting for the proxy to open a port for "listen" and return the IP+port where it is listening, or return an error (timeout should be handled outside - timeout for calling ListeningForConnection()) { int read = 10; if (ProxyReceiveBytes(lParam, buf, &read, index, FALSE, TRUE /* listen */, FALSE)) { // process the SOCKS5 proxy server response - if (read == 10 && buf[0] == 5 && buf[3] == 1) // the response should have 10 bytes + "version" should be 5 + address type should be 1 (IPv4) + if (read == 10 && buf[0] == 5 && buf[3] == 1) // the response should have 10 bytes, the "version" should be 5, and the address type should be 1 (IPv4) { if (buf[1] == 0) // reply code == success { @@ -1973,12 +1973,12 @@ void CSocket::ReceiveNetEventInt(LPARAM lParam, int index) PostMessage(SocketsThread->GetHiddenWindow(), WM_APP_SOCKET_MIN + index, (WPARAM)Socket, MAKELPARAM(FD_WRITE, NO_ERROR)); } - if (event == FD_CLOSE) // this close occurred after a successful connection from the FTP server, it will be processed later... + if (event == FD_CLOSE) // this close occurred after successfully connecting to the FTP server, it will be processed later... { PostMessage(SocketsThread->GetHiddenWindow(), WM_APP_SOCKET_MIN + index, (WPARAM)Socket, lParam); } - ConnectionAccepted(TRUE, NO_ERROR, FALSE); // announce a successful connection establishment + ConnectionAccepted(TRUE, NO_ERROR, FALSE); // report successful connection establishment HANDLES(LeaveCriticalSection(&SocketCritSect)); } else // error @@ -2152,7 +2152,7 @@ void CSocket::ReceiveNetEventInt(LPARAM lParam, int index) if (!csLeft) HANDLES(LeaveCriticalSection(&SocketCritSect)); } - // else HANDLES(LeaveCriticalSection(&SocketCritSect)); // ProxyReceiveBytes() returns FALSE = the SocketCritSect section has already been left + // else HANDLES(LeaveCriticalSection(&SocketCritSect)); // ProxyReceiveBytes() returns FALSE, so SocketCritSect has already been left break; } @@ -2190,7 +2190,7 @@ void CSocket::ReceiveNetEventInt(LPARAM lParam, int index) void CSocket::ReceiveNetEvent(LPARAM lParam, int index) { CALL_STACK_MESSAGE3("CSocket::ReceiveNetEvent(0x%IX, %d)", lParam, index); - DWORD eventError = WSAGETSELECTERROR(lParam); // extract error code of event + DWORD eventError = WSAGETSELECTERROR(lParam); // extract the event error code switch (WSAGETSELECTEVENT(lParam)) { case FD_CLOSE: @@ -2230,7 +2230,7 @@ void CSocket::ReceiveNetEvent(LPARAM lParam, int index) { int r = SSLLib.SSL_read(SSLConn, buf, 500); if (r <= 0) - break; // loop until an error or zero (0 = gracefully closed) + break; // loop until an error or zero (0 = graceful close) else { if (OurShutdown) // shutdown was initiated by the client @@ -2268,18 +2268,18 @@ void CSocket::ReceiveNetEvent(LPARAM lParam, int index) TRACE_E("Incorrect call to CSocket::ReceiveNetEvent(FD_ACCEPT): from section SocketCritSect!"); #endif - if (eventError == NO_ERROR) // only accept without error, ignore the rest (the connection is retried until timeout) + if (eventError == NO_ERROR) // accept only error-free events, ignore the rest (the connection is retried until timeout) { - if (Socket != INVALID_SOCKET) // the socket is connected (otherwise ignore it - the user probably aborted) + if (Socket != INVALID_SOCKET) // the socket is still valid (otherwise ignore it - the user probably aborted) { SOCKADDR_IN addr; memset(&addr, 0, sizeof(addr)); int len = sizeof(addr); SOCKET sock = accept(Socket, (SOCKADDR*)&addr, &len); if (sock != INVALID_SOCKET && - // according to the help calling WSAAsyncSelect is not necessary, but supposedly some versions of Windows Sockets - // do not do it automatically, so it must be done - an anomaly occurred: when stepping through sending - // the LIST command it generates FD_XXX twice (the second set arrives after the first FD_CLOSE -> it is undeliverable) + // according to the help, calling WSAAsyncSelect is not necessary, but supposedly some versions of Windows Sockets + // do not do it automatically, so it is necessary - an anomaly occurred: when stepping through sending + // the LIST command, it generates FD_XXX twice (the second set arrives after the first FD_CLOSE -> it cannot be delivered) WSAAsyncSelect(sock, socketsWindow, Msg, FD_READ | FD_WRITE | FD_CLOSE) != SOCKET_ERROR) { closesocket(Socket); // close the "listen" socket, it will no longer be needed - calling CloseSocketEx is undesirable @@ -2356,7 +2356,7 @@ CSocket::GetSocket() void CSocket::SetCertificate(CCertificate* certificate) { HANDLES(EnterCriticalSection(&SocketCritSect)); - CCertificate* old = pCertificate; // ensures AddRef is called via Release (in case pCertificate == certificate) + CCertificate* old = pCertificate; // ensures AddRef is called before Release (in case pCertificate == certificate) pCertificate = certificate; if (pCertificate) pCertificate->AddRef(); @@ -2658,7 +2658,7 @@ void CSocketsThread::ReceiveMsgData() CSocket* s = Sockets[index]; if (s != NULL && s->GetUID() == data->SocketUID) // it is the recipient of the message (it was waiting) s->ReceiveHostByAddressInt(data->IP, data->HostUID, data->Err, index); - else // IP that did not arrive because the socket was cancelled or swapped, + else // This is an IP that did not arrive because the socket was canceled or swapped. { // when sockets are swapped, find the target socket sequentially and deliver the IP int i; for (i = 0; i < Sockets.Count; i++) @@ -2763,7 +2763,7 @@ void CSocketsThread::ReceivePostMessage() CSocket* s = Sockets[index]; if (s != NULL && s->GetUID() == data->SocketUID) // it is the recipient of the message (it was waiting) s->ReceivePostMessage(data->ID, data->Param); - else // a message that did not arrive because the socket was cancelled or swapped, + else // this is a message that did not arrive because the socket was cancelled or swapped { // when sockets are swapped, find the target socket sequentially and deliver the message int i; for (i = 0; i < Sockets.Count; i++) @@ -2814,7 +2814,7 @@ int CSocketsThread::FindIndexForNewTimer(DWORD timeoutAbs, int leftIndex) if (actTimeoutAbs == timeoutAbs) { while (++m < Timers.Count && Timers[m]->TimeoutAbs - timeoutAbsBase == timeoutAbs) - ; // return the index after the last identical timer + ; // return the index after the last timer with the same timeout return m; // found } else if (actTimeoutAbs > timeoutAbs) @@ -2845,7 +2845,7 @@ BOOL CSocketsThread::AddTimer(int socketMsg, int socketUID, DWORD timeoutAbs, DW Timers.Insert(i, data); if (Timers.IsGood()) { - if (i == 0 && !Terminating) // inserting the timer with the shortest time into the timeout + if (i == 0 && !Terminating) // inserting the timer with the shortest time to timeout { DWORD ti = timeoutAbs - GetTickCount(); if ((int)ti > 0) // if the new timer has not yet expired (the time difference can also be negative), adjust or start the Windows timer @@ -2930,12 +2930,12 @@ void CSocketsThread::ReceiveTimer() HANDLES(EnterCriticalSection(&CritSect)); // guard against recursive calls to ReceiveTimer() - there is no point posting WM_TIMER until the first run completes - // processing the first call to ReceiveTimer(), a new timer will be started or WM_TIMER posted + // after processing the first call to ReceiveTimer(), a new timer will be started or WM_TIMER posted if (LockedTimers == -1) { DWORD ti = GetTickCount(); int last = FindIndexForNewTimer(ti, 0); - if (last > 0) // if any timer timeout occurred + if (last > 0) // if any timer has timed out { LockedTimers = last; // protect the timers being processed from deletion and array shifting int i; @@ -2948,7 +2948,7 @@ void CSocketsThread::ReceiveTimer() CSocket* s = Sockets[index]; if (s != NULL && s->GetUID() == timer->SocketUID) // it is the recipient of the message (it was waiting) s->ReceiveTimer(timer->ID, timer->Param); - else // a timer that did not arrive because the socket was cancelled or swapped, + else // This is a timer that did not arrive because the socket was canceled or swapped. { // when sockets are swapped, find the target socket sequentially and deliver the timer int j; for (j = 0; j < Sockets.Count; j++) @@ -3042,8 +3042,8 @@ CSocketsThread::WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) // SLOW_CALL_STACK_MESSAGE5("CSocketsThread::WindowProc(0x%X, 0x%X, 0x%X, 0x%X)", hwnd, uMsg, wParam, lParam); if (GetTickCount() - LastWM_TIMER_Processing >= 500 && uMsg != WM_TIMER) - { // if 1000 ms passed since the last WM_TIMER, insert it for processing manually, because most likely - // the thread simply is not "idle", and therefore the system does not send WM_TIMER (it is unfortunately a low-priority message) + { // if 1000 ms has passed since the last WM_TIMER, insert one for processing manually, because most likely + // the thread simply is not "idle", so the system does not send WM_TIMER (unfortunately, it is a low-priority message) LastWM_TIMER_Processing = GetTickCount(); // store when WM_TIMER was last processed if (SocketsThread != NULL) SocketsThread->ReceiveTimer(); From fc7dcf7019b7637a6d143953f19de5e8278fbe0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 05:06:39 +0200 Subject: [PATCH 052/710] [tanslation] Fix src/plugins/ftp/sockets.h comments Refines translated comments in src/plugins/ftp/sockets.h. Model: OpenAI GPT-5.4. Verification: OSTranslation sequential review with full prompt logging, Copilot event logging, clang AST grounding, guard 0 violations, and git diff check passed. Telemetry: 16 provider calls, 343538 estimated tokens, 7 Copilot SDK calls, 14 Copilot request units. --- src/plugins/ftp/sockets.h | 198 +++++++++++++++++++------------------- 1 file changed, 101 insertions(+), 97 deletions(-) diff --git a/src/plugins/ftp/sockets.h b/src/plugins/ftp/sockets.h index 243338799..4abef896f 100644 --- a/src/plugins/ftp/sockets.h +++ b/src/plugins/ftp/sockets.h @@ -33,8 +33,8 @@ extern WSADATA WinSocketsData; // info about the implementation of Windows Socke // GLOBAL FUNCTIONS // **************************************************************************** -// initialization of the sockets module; 'parent' is the parent of the message box, -// returns TRUE if initialization is successful +// initializes the sockets module; 'parent' is the parent window for message boxes, +// returns TRUE if initialization succeeds BOOL InitSockets(HWND parent); // release the sockets module void ReleaseSockets(); @@ -44,7 +44,7 @@ void ReleaseSockets(); void DeleteSocket(class CSocket* socket); #ifdef _DEBUG -extern BOOL InDeleteSocket; // TRUE if we are inside ::DeleteSocket (to test direct calls of "delete socket") +extern BOOL InDeleteSocket; // TRUE if we are inside ::DeleteSocket (to detect direct calls to "delete socket") #endif // @@ -132,15 +132,15 @@ class CSocket SOCKET Socket; // encapsulated Windows Sockets socket; if INVALID_SOCKET, the socket is not open SSL* SSLConn; // SSL connection, use instead of Socket if non-NULL int ReuseSSLSession; // reuse the SSL session of this control connection for all its data connections: 0 = try, 1 = yes, 2 = no - BOOL ReuseSSLSessionFailed; // TRUE = reusing the SSL session for the last data connection opened failed: if we cannot do without it, we have to reconnect this control connection + BOOL ReuseSSLSessionFailed; // TRUE = reusing the SSL session for the most recently opened data connection failed: if SSL session reuse is required, this control connection must be reconnected CCertificate* pCertificate; // non-NULL on FTPS connections BOOL OurShutdown; // TRUE if this side (the FTP client) initiated the shutdown - BOOL IsDataConnection; // TRUE = socket for data transfer, set larger buffers (speed up listing, downloads and uploads) + BOOL IsDataConnection; // TRUE = data transfer socket; larger buffers are used (to speed up listing, downloads, and uploads) CSocketState SocketState; // socket state // data for connecting through proxy servers (firewalls) - char* HostAddress; // name address of the target machine we want to connect to + char* HostAddress; // host name of the target machine we want to connect to DWORD HostIP; // IP address of 'HostAddress' (==INADDR_NONE until the IP is known) unsigned short HostPort; // port of the target machine we want to connect to char* ProxyUser; // username for the proxy server @@ -201,8 +201,8 @@ class CSocket // callable from any thread void SwapSockets(CSocket* sock); - // returns TRUE if CSocketsThread::IsSocketConnected() has been called for this socket - - // returns the call time in 'lastCallTime'; returns FALSE if CSocketsThread::IsSocketConnected() + // returns TRUE if CSocketsThread::IsSocketConnected() has been called for this socket; + // the call time is returned in 'lastCallTime'; returns FALSE if CSocketsThread::IsSocketConnected() // has not been called yet BOOL GetIsSocketConnectedLastCallTime(DWORD* lastCallTime); @@ -214,27 +214,27 @@ class CSocket // receives the results in the "sockets" thread - the "receive" methods of this object are called there) // ****************************************************************************************** - // obtains an IP address from a host name (or even the textual IP address itself); 'hostUID' is used + // obtains an IP address from a host name (or even directly from a textual IP address); 'hostUID' is used // to identify the result when this method is called multiple times; the result (including 'hostUID') - // will be in the parameters of the ReceiveHostByAddress method called in the "sockets" thread; + // will be passed in the parameters of a call to the ReceiveHostByAddress method in the "sockets" thread; // returns TRUE if there is a chance of success (if the thread retrieving the IP address can be started), - // returns FALSE on failure; if it returns TRUE and this object was not connected to - // SocketsThread, it connects it (see the AddSocket method) + // returns FALSE on failure; if it returns TRUE and this object has not been attached to + // SocketsThread, it attaches it (see the AddSocket method) // WARNING: this method cannot be called from the SocketCritSect critical section (the method uses - // SocketsThread); the exception is when we are already inside the CSocketsThread::CritSect critical section + // SocketsThread); the exception is when already inside the CSocketsThread::CritSect critical section // callable from any thread BOOL GetHostByAddress(const char* address, int hostUID = 0); - // connects to a SOCKS 4/4A/5 or HTTP 1.1 (the proxy type is in 'proxyType') proxy server - // 'serverIP' on port 'serverPort' + if it is not one of these proxy servers, it works the same as - // the Connect method; creates a Windows socket and sets it as non-blocking - it sends messages + // connects to the proxy server at 'serverIP':'serverPort' using SOCKS 4/4A/5 or HTTP 1.1 + // (the proxy type is in 'proxyType'); for other proxy server types, it behaves like the + // Connect method; creates a Windows socket and sets it to non-blocking mode - it sends messages // to the SocketsThread object, which, according to the proxy server protocol, performs - // the connection to address 'host' port 'port' with proxy-user-name 'proxyUser' and proxy-password - // 'proxyPassword' (only SOCKS 5 and HTTP 1.1); 'hostIP' (only SOCKS 4) is the IP address of 'host' + // the connection to address 'host' on port 'port' using proxy user name 'proxyUser' and proxy password + // 'proxyPassword' (SOCKS 5 and HTTP 1.1 only); 'hostIP' (SOCKS 4 only) is the IP address of 'host' // (if unknown, use INADDR_NONE); returns TRUE if there is a chance of success (the result of // connecting to 'host' is received by the ReceiveNetEvent method - FD_CONNECT), returns FALSE on failure - // and if the Windows error code is known, returns it in 'error' (if not NULL); if it returns TRUE - // and this object was not connected to SocketsThread, it connects it (see the AddSocket method) + // and, if the Windows error code is known, returns it in 'err' (if not NULL); if it returns TRUE + // and this object has not been attached to SocketsThread, it attaches it (see the AddSocket method) // WARNING: this method cannot be called from the SocketCritSect critical section (the method uses // SocketsThread) // callable from any thread @@ -242,12 +242,12 @@ class CSocket DWORD* err, const char* host, unsigned short port, const char* proxyUser, const char* proxyPassword, DWORD hostIP); - // connects to IP address 'ip' on port 'port'; creates a Windows socket and sets it as non-blocking - - // it sends messages to the SocketsThread object, which based on these messages calls the - // ReceiveNetEvent method of this object; returns TRUE if there is a chance of success - // (the result is received by the ReceiveNetEvent method - FD_CONNECT), returns FALSE on failure - // and if the Windows error code is known, returns it in 'error' (if not NULL); if it returns - // TRUE and this object was not connected to SocketsThread, it connects it (see the AddSocket method); + // connects to IP address 'ip' on port 'port'; creates a Windows socket and sets it to + // non-blocking mode - it sends messages to the SocketsThread object, which invokes this + // object's ReceiveNetEvent method based on those messages; returns TRUE if there is a chance + // of success (the result is received by the ReceiveNetEvent method - FD_CONNECT), returns FALSE + // on failure and, if the Windows error code is known, returns it in 'error' (if not NULL); if it returns + // TRUE and this object has not been attached to SocketsThread, it attaches it (see the AddSocket method); // 'calledFromConnect' is TRUE only when called from one of the ConnectUsingXXX methods; // WARNING: this method cannot be called from the SocketCritSect critical section (the method uses // SocketsThread) @@ -268,16 +268,16 @@ class CSocket // with a length of at least 'bufSize' characters BOOL GetProxyTimeoutDescr(char* buf, int bufSize); - // returns TRUE if the socket is not closed (INVALID_SOCKET) + // returns TRUE if the socket is not closed (i.e. is not INVALID_SOCKET) BOOL IsConnected(); - // initiates a socket shutdown - after successfully sending + confirming the unsent data, - // FD_CLOSE arrives and closes the socket (releases Windows socket resources); after starting - // the shutdown, no data can be written to the socket anymore (if Write does not write the whole buffer - // at once, you must wait for the write to finish - event ccsevWriteDone); - // returns TRUE on success, FALSE on error - if the Windows error code is known, returns it - // in 'error' (if not NULL) - // NOTE: after receiving FD_CLOSE, the SocketWasClosed method is called (information about the socket closure) + // initiates socket shutdown - after all unsent data has been sent and acknowledged, + // FD_CLOSE is received and closes the socket (releasing Windows socket resources); once + // shutdown has started, no more data can be written to the socket (if Write does not write the entire buffer + // at once, it is necessary to wait for the write to complete - ccsevWriteDone event); + // returns TRUE on success, FALSE on error - if the Windows error code is known, returns + // it in 'error' (if not NULL) + // NOTE: after FD_CLOSE is received, the SocketWasClosed method is called (information about socket closure) BOOL Shutdown(DWORD* error); // hard socket closure (only when Shutdown timed out) - calls closesocket (deallocation of @@ -285,45 +285,47 @@ class CSocket // code is known, returns it in 'error' (if not NULL) BOOL CloseSocket(DWORD* error); - // encrypts the socket, returns TRUE on success; if the server certificate cannot be + // encrypts the socket and returns TRUE on success; if the server certificate cannot be // verified and the user has not previously accepted it as trusted: if 'unverifiedCert' - // is NULL, it returns failure and SSLCONERR_UNVERIFIEDCERT in 'sslErrorOccured'; if - // 'unverifiedCert' is not NULL, it returns success and the server certificate in 'unverifiedCert', - // the caller is responsible for releasing it by calling unverifiedCert->Release() and - // returns the reason why the certificate cannot be verified in 'errorBuf' (of size 'errorBufLen', - // if it is 0, 'errorBuf' can be NULL); in 'errorID' (if not NULL) it returns the resource-id - // of the error text or -1 if no error should be displayed; for other errors - // (except an untrusted certificate): it returns NULL in 'unverifiedCert', returns supplementary - // text for the error in 'errorBuf' (of size 'errorBufLen', if it is 0, 'errorBuf' can be NULL) (it is inserted - // into 'errorID' at position %s via sprintf); in 'sslErrorOccured' (if not NULL) it returns the error code (one of SSLCONERR_XXX); - // 'logUID' is the log UID; 'conForReuse' (if not NULL) is the socket whose SSL session should be reused (called - // "SSL session reuse", see for example http://vincent.bernat.im/en/blog/2011-ssl-session-reuse-rfc5077.html - // and it is used from the control connection for all its data connections) + // is NULL, returns failure and SSLCONERR_UNVERIFIEDCERT in 'sslErrorOccured'; if + // 'unverifiedCert' is not NULL, returns success and the server certificate in 'unverifiedCert'; + // the caller is responsible for releasing it by calling unverifiedCert->Release(), and + // the reason why the certificate cannot be verified is returned in 'errorBuf' (of size 'errorBufLen'; + // if it is 0, 'errorBuf' may be NULL); in 'errorID' (if not NULL), returns the resource ID + // of the error text, or -1 if no error should be displayed; for other errors + // (except an untrusted certificate): returns NULL in 'unverifiedCert', and returns additional + // error text in 'errorBuf' (of size 'errorBufLen'; if it is 0, 'errorBuf' may be NULL) + // (inserted into the text identified by 'errorID' at the %s position via sprintf); in 'sslErrorOccured' + // (if not NULL), returns the error code (one of SSLCONERR_XXX); 'logUID' is the log UID; + // 'conForReuse' (if not NULL) is the socket whose SSL session should be reused (this is called + // "SSL session reuse", see e.g. http://vincent.bernat.im/en/blog/2011-ssl-session-reuse-rfc5077.html + // and it is used to reuse the control connection's SSL session for all its data connections) BOOL EncryptSocket(int logUID, int* sslErrorOccured, CCertificate** unverifiedCert, int* errorID, char* errorBuf, int errorBufLen, CSocket* conForReuse); - // connects to a SOCKS 4/4A/5 or HTTP 1.1 (the proxy type is in 'proxyType') proxy server - // 'proxyIP' on port 'proxyPort' and opens a port for "listen" on it; the IP+port where it - // listens is received by the socket in the ListeningForConnection() method; if it is not one of these - // proxy servers, it works like OpenForListening(), except that it also passes the result + // connects to a SOCKS 4/4A/5 or HTTP 1.1 proxy server (the proxy type is in 'proxyType') + // at 'proxyIP':'proxyPort' and opens a "listen" port on it; the socket receives the listening + // IP+port in ListeningForConnection(); if it is not one of these proxy + // servers, it works like OpenForListening(), except that it also passes the result // through ListeningForConnection() - it is called directly from the OpenForListeningWithProxy() method; - // 'listenOnIP'+'listenOnPort' is used only when it is not a connection through these proxy - // servers - 'listenOnIP' is the IP of this machine (when binding the socket on multi-home machines - // the IP may not be detectable, for FTP we take the IP from the "control connection"), 'listenOnPort' is - // the port on which to listen; if it does not matter, value 0 is used; - // it creates a Windows socket and sets it as non-blocking - it sends messages to the - // SocketsThread object, which according to the proxy server protocol requests the opening of a "listen" port - // for connections from address 'host' (IP 'hostIP') port 'hostPort' with proxy-user-name - // 'proxyUser' and proxy-password 'proxyPassword' (only SOCKS 5 and HTTP 1.1); 'hostIP' + // 'listenOnIP'+'listenOnPort' are used only if the connection is not through one of these proxy + // servers - 'listenOnIP' is the IP of this machine (when binding the socket on multihomed machines, + // the IP may not be determinable; for FTP, the IP is taken from the "control connection"), 'listenOnPort' is + // the port on which to listen; if it does not matter, 0 is used; + // creates a Windows socket and sets it to non-blocking mode - sends messages to the + // SocketsThread object, which, according to the proxy server protocol, requests opening a "listen" port + // for a connection from address 'host' (IP 'hostIP') port 'hostPort' with proxy user name + // 'proxyUser' and proxy password 'proxyPassword' (only SOCKS 5 and HTTP 1.1); 'hostIP' // (used only for SOCKS 4, otherwise INADDR_NONE) is the IP address of 'host' (the IP must be - // known - a connection to 'hostIP' must be open, otherwise it is impossible to request this opening of a - // "listen" port); returns TRUE if there is a chance of success (the "listen" IP+port is received by the - // ListeningForConnection() method, and then the result of the connection from 'host' is received by the - // ConnectionAccepted() method - provided that the CSocket::ReceiveNetEvent method is called for FD_ACCEPT); - // returns FALSE on failure and if the Windows error code is known, returns it in 'err' (if not NULL), and - // if 'listenError' is not NULL, returns TRUE/FALSE in it depending on whether it is a LISTEN error (listen error without a proxy server) - // or CONNECT error (error connecting to the proxy server); if it returns TRUE and this object was not connected - // to SocketsThread, it connects it (see the AddSocket method) + // known - a connection to 'hostIP' must already be open, otherwise this opening of a + // "listen" port cannot be requested); returns TRUE if the operation can proceed + // (ListeningForConnection() receives the "listen" IP+port, and then the result of the connection from 'host' + // is received by ConnectionAccepted() - provided that CSocket::ReceiveNetEvent + // is called for FD_ACCEPT); returns FALSE on failure and, if the Windows error code is known, + // returns it in 'err' (if not NULL); if 'listenError' is not NULL, returns TRUE/FALSE in it + // depending on whether it is a LISTEN error (listen error without a proxy server) or a CONNECT error + // (error connecting to the proxy server); if it returns TRUE and this object is not connected + // to SocketsThread, it connects it (see AddSocket) // WARNING: this method cannot be called from the SocketCritSect critical section (the method uses // SocketsThread) // callable from any thread @@ -333,18 +335,20 @@ class CSocket unsigned short proxyPort, const char* proxyUser, const char* proxyPassword, BOOL* listenError, DWORD* err); - // opens a socket and waits for a connection on it (listens); 'listenOnIP' (must not be NULL) is on - // input the IP of this machine (when binding the socket on multi-home machines the IP may not be detectable, - // for FTP we take the IP from the "control connection"), on output it is the IP where the connection is awaited; - // 'listenOnPort' (must not be NULL) is on input the port on which to wait for a connection, - // if it does not matter, value 0 is used; on output it is the port where the connection is awaited; - // it creates a Windows socket and sets it as non-blocking - it sends messages to the - // SocketsThread object, which based on these messages calls the ReceiveNetEvent method of this object - // (the incoming connection is announced by calling the ConnectionAccepted() method - provided that the - // CSocket::ReceiveNetEvent method is called for FD_ACCEPT); returns TRUE when the socket is opened successfully, - // returns FALSE on failure and if the Windows error code is known, returns it in 'error' (if not NULL); - // if it returns TRUE and this object was not connected to SocketsThread, it connects it (see the AddSocket method) - // WARNING: this method cannot be called from the SocketCritSect critical section (the method uses + // opens a socket and listens for connections; 'listenOnIP' (must not be NULL) specifies + // on input the IP address of this machine (when binding the socket on multihomed machines, + // the IP address may not be detectable; for FTP, the IP is taken from the "control connection"), + // and on output receives the IP address on which the socket listens; + // 'listenOnPort' (must not be NULL) specifies on input the port on which to listen for a connection; + // if it does not matter, use value 0; on output it receives the port on which the socket listens; + // creates a Windows socket and sets it to nonblocking mode; messages are sent to the + // SocketsThread object, which invokes this object's ReceiveNetEvent method based on them + // (an incoming connection is reported by calling ConnectionAccepted(), provided that + // CSocket::ReceiveNetEvent is called for FD_ACCEPT); returns TRUE if the socket is opened + // successfully; on failure returns FALSE and, if the Windows error code is known, stores it + // in 'error' (if not NULL); if the method returns TRUE and this object is not connected to + // SocketsThread, it connects it (see the AddSocket method) + // WARNING: this method cannot be called from the SocketCritSect critical section (it uses // SocketsThread) // callable from any thread BOOL OpenForListening(DWORD* listenOnIP, unsigned short* listenOnPort, DWORD* error); @@ -376,7 +380,7 @@ class CSocket // the Windows error code (arrived with FD_CLOSE or occurred during FD_CLOSE processing) virtual void SocketWasClosed(DWORD error) {} - // receives a timer with ID 'id' and parameter 'param' + // receives a timer event with ID 'id' and parameter 'param' virtual void ReceiveTimer(DWORD id, void* param) {} // receives a posted message with ID 'id' and parameter 'param' @@ -420,10 +424,10 @@ class CSocket // WARNING: call only with a single nesting level in the SocketCritSect section void ProxySendBytes(const char* buf, int bufLen, int index, BOOL* csLeft, BOOL isConnect); - // helper methods: 'index' is the socket index in the SocketsThread->Sockets array (used - // when calling ReceiveNetEvent()); inside the method the SocketCritSect critical section may be left, + // helper methods: 'index' is the index of the socket in the SocketsThread->Sockets array (used + // when calling ReceiveNetEvent()); the method may leave the SocketCritSect critical section, // in which case it returns TRUE in 'csLeft' - // WARNING: call only with a single nesting level in the SocketCritSect section + // WARNING: call only with exactly one nesting level in the SocketCritSect critical section // // sends request 'request' (1=CONNECT, 2=LISTEN) to the SOCKS4 proxy server; 'isConnect' is // TRUE/FALSE for CONNECT/LISTEN; 'isSocks4A' is TRUE/FALSE for SOCKS 4A/4 @@ -440,17 +444,17 @@ class CSocket void HTTP11SendRequest(int index, BOOL* csLeft); // helper method: receives a reply from the proxy server; returns TRUE if any data appears on - // the socket (if FD_CLOSE arrived, it returns the data + further FD_CLOSE processing is up to the caller); - // WARNING: if it returns FALSE, it has left the SocketCritSect section; 'buf' - // is the buffer for this response ('read' is on input the size of the 'buf' buffer, on - // output it is the number of bytes read); 'index' is the socket index in the + // the socket (if FD_CLOSE was received, it returns the data, and further FD_CLOSE processing + // is up to the caller); WARNING: if it returns FALSE, it has left the SocketCritSect critical + // section; 'buf' is the buffer for this reply ('read' is the size of 'buf' on input and the + // number of bytes read on output); 'index' is the socket index in the // SocketsThread->Sockets array (used when calling ReceiveNetEvent()); 'isConnect' is - // TRUE/FALSE for CONNECT/LISTEN_or_ACCEPT; 'isListen' only makes sense when - // 'isConnect'==FALSE and is TRUE/FALSE for LISTEN/ACCEPT; if 'readOnlyToEOL' is TRUE, - // the socket is read byte by byte only until the first LF occurs (reads at most + // TRUE for CONNECT and FALSE for LISTEN or ACCEPT; 'isListen' only makes sense when + // 'isConnect'==FALSE and is TRUE for LISTEN and FALSE for ACCEPT; if 'readOnlyToEOL' is TRUE, + // the socket is read one byte at a time only until the first LF is encountered (reads at most // one line including the trailing LF) - // WARNING: call only with a single nesting in the SocketCritSect section and at least one - // nesting in the CSocketsThread::CritSect section + // WARNING: call only with one level of nesting in the SocketCritSect critical section and at + // least one level of nesting in the CSocketsThread::CritSect critical section BOOL ProxyReceiveBytes(LPARAM lParam, char* buf, int* read, int index, BOOL isConnect, BOOL isListen, BOOL readOnlyToEOL); @@ -488,7 +492,7 @@ struct CMsgData // data for WM_APP_SOCKET_ADDR struct CTimerData // data for WM_TIMER (see CSocketsThread::AddTimer()) { - int SocketMsg; // message number used to receive events for the informed socket; if (WM_APP_SOCKET_MIN-1), it is a deleted timer in the locked section of the Timers array + int SocketMsg; // message number used to receive events for the notified socket; if (WM_APP_SOCKET_MIN-1), this is a deleted timer in the locked section of the Timers array int SocketUID; // UID of the informed socket DWORD TimeoutAbs; // absolute time in milliseconds; the timer fires only when GetTickCount() returns at least this value DWORD ID; // timer id @@ -507,7 +511,7 @@ struct CTimerData // data for WM_TIMER (see CSocketsThread::AddTimer()) struct CPostMsgData // data for WM_APP_SOCKET_POSTMSG { int SocketMsg; // message number used to receive events for the informed socket - int SocketUID; // UID of the informed socket + int SocketUID; // UID of the notified socket DWORD ID; // event id void* Param; // event parameter @@ -570,7 +574,7 @@ class CSocketsThread : public CThread // the socket that should be notified of the added timer timeout (see the CSocket::ReceiveTimer() method); // 'id' is the timer ID; 'param' is an optional timer parameter, if it contains any allocated // value, the CSocket object must take care of deallocation when receiving the timer, when adding the timer fails, - // or when unloading the plugin; returns TRUE when the timer is added successfully, otherwise returns FALSE + // or when unloading the plugin; returns TRUE when the timer is added successfully, returns FALSE on failure // (the only error is lack of memory) // callable from any thread BOOL AddTimer(int socketMsg, int socketUID, DWORD timeoutAbs, DWORD id, void* param); @@ -604,8 +608,8 @@ class CSocketsThread : public CThread BOOL AddSocket(CSocket* sock); // deallocates/detaches ('onlyDetach' is FALSE/TRUE) the socket object 'sock' from the array of handled - // objects (writes NULL to the position and sets FirstFreeIndexInSockets); if the object is not in the array - // and 'onlyDetach' is TRUE, it is deallocated + // objects (writes NULL to its slot and sets FirstFreeIndexInSockets); if the object is not in the array + // and 'onlyDetach' is FALSE, it is deallocated // callable from any thread void DeleteSocket(CSocket* sock, BOOL onlyDetach = FALSE) { From f569c16c4b7bec8d361ef0aa5a4a10b6d557234f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 05:20:46 +0200 Subject: [PATCH 053/710] [tanslation] Fix src/plugins/ftp/ssl.cpp comments Refines translated comments in src/plugins/ftp/ssl.cpp. Model: OpenAI GPT-5.4. Verification: OSTranslation sequential review with full prompt logging, Copilot event logging, clang AST grounding, guard 0 violations, and git diff check passed. Telemetry: 12 provider calls, 161094 estimated tokens, 3 Copilot SDK calls, 6 Copilot request units. --- src/plugins/ftp/ssl.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/plugins/ftp/ssl.cpp b/src/plugins/ftp/ssl.cpp index f2ea1fe60..35ff88a43 100644 --- a/src/plugins/ftp/ssl.cpp +++ b/src/plugins/ftp/ssl.cpp @@ -430,7 +430,7 @@ void WriteSSLErrorStackToLog(int logUID, const char* errSrc) { // log OpenSSL error stack int err2; - char buffer[256]; // they say: at least 120 bytes + char buffer[256]; // documentation says: at least 120 bytes while ((err2 = SSLLib.ERR_get_error()) != 0) { SSLLib.ERR_error_string(err2, buffer); @@ -471,10 +471,10 @@ BOOL CSocket::EncryptSocket(int logUID, int* sslErrorOccured, CCertificate** unv WSAAsyncSelect(Socket, hWnd, 0, 0); err = ioctlsocket(Socket, FIONBIO, &argp); - // On x64, SOCKET is a 64-bit value, but the OpenSSL folks assume it never exceeds 2^32 + // On x64, SOCKET is a 64-bit value, but the OpenSSL developers assume it never exceeds 2^32 // see http://comments.gmane.org/gmane.comp.encryption.openssl.devel/13621 // http://msdn.microsoft.com/en-us/library/ms724485%28VS.85%29.aspx - // if that happens and this condition starts failing, maybe an x64 version of SSL will already exist + // if that happens and this condition starts failing, perhaps an x64 version of SSL will already exist if (Socket > 0x00000000ffffffff) { DWORD* crash = NULL; @@ -606,7 +606,7 @@ BOOL CSocket::EncryptSocket(int logUID, int* sslErrorOccured, CCertificate** unv Logs.LogMessage(logUID, LoadStr(pCertificate->IsVerified() ? IDS_SSL_LOG_CERTVERIFIED : IDS_SSL_LOG_CERTACCEPTED), -1, TRUE); certAcceptedOrVerified = TRUE; } - else // Huh! The certificate has changed????? + else // The certificate has changed. { Logs.LogMessage(logUID, LoadStr(IDS_SSL_LOG_CERTCHANGED), -1, TRUE); pCertificate->Release(); @@ -626,8 +626,8 @@ BOOL CSocket::EncryptSocket(int logUID, int* sslErrorOccured, CCertificate** unv } if (!certAcceptedOrVerified) { - // The certificate was not verified nor previously accepted by user, so user should accept - // it before further using of this socket. + // The certificate was not verified and had not previously been accepted by the user, so the user should accept + // it before any further use of this socket. if (unverifiedCert != NULL) *unverifiedCert = new CCertificate(DERCert, DERCertLen, PKCS7Cert, PKCS7CertLen, false, HostAddress); else @@ -638,7 +638,7 @@ BOOL CSocket::EncryptSocket(int logUID, int* sslErrorOccured, CCertificate** unv free(PKCS7Cert); free(DERCert); if (sslErrorOccured != NULL) - *sslErrorOccured = SSLCONERR_UNVERIFIEDCERT; // The certificate was not verified nor previously accepted by user. + *sslErrorOccured = SSLCONERR_UNVERIFIEDCERT; // The certificate was not verified and was not previously accepted by the user. return FALSE; } } @@ -648,7 +648,7 @@ BOOL CSocket::EncryptSocket(int logUID, int* sslErrorOccured, CCertificate** unv WSAAsyncSelect(Socket, hWnd, Msg, FD_READ | FD_CLOSE | FD_WRITE); SSLConn = Conn; if (sslErrorOccured != NULL) - *sslErrorOccured = SSLCONERR_NOERROR; // But the certificate must not be verified nor previously accepted by user. + *sslErrorOccured = SSLCONERR_NOERROR; // But the certificate must not have been verified or previously accepted by the user. return TRUE; } else @@ -821,11 +821,11 @@ bool InitSSL(int logUID, int* errorID) { SSLLib.CRYPTO_set_locking_callback(/*(void (*)(int,int,const char *,int))*/ LockingCallback); - // NOTE: the pointer returned SSLv23_client_method is not to be freed + // NOTE: do not free the pointer returned by SSLv23_client_method() // - // SSLv23_client_method() is default method used in OpenSLL.exe and CURL. - // Unsafe SSL2 protocol is disabled using OPENSSL_NO_SSL2 define. - // SSLv3_client_method() didn't work with wedos server: https://forum.altap.cz/viewtopic.php?f=2&t=6667 + // SSLv23_client_method() is the default method used in OpenSSL.exe and CURL. + // The unsafe SSL2 protocol is disabled by the OPENSSL_NO_SSL2 define. + // SSLv3_client_method() did not work with the wedos server: https://forum.altap.cz/viewtopic.php?f=2&t=6667 // SSLLib.Meth = SSLLib.SSLv3_client_method(); SSLLib.Meth = SSLLib.SSLv23_client_method(); if (SSLLib.Meth) @@ -833,15 +833,15 @@ bool InitSSL(int logUID, int* errorID) SSLLib.Ctx = SSLLib.SSL_CTX_new(SSLLib.Meth); if (SSLLib.Ctx) { - /* also switch on all the interoperability and bug - * workarounds so that we will communicate with people - * that cannot read poorly written specs :-) - */ + /* also enable all the interoperability and bug + * workarounds so that we can communicate with implementations + * that cannot read poorly written specs + */ SSLLib.SSL_CTX_ctrl(SSLLib.Ctx, SSL_CTRL_OPTIONS, SSL_OP_ALL, NULL); bSSLInited = true; return true; } - } // if Meth <> NULL then + } // if Meth != NULL } } FreeSSL(loadStatus); From 5ab3dccb611f9929b546e1823936823679d4e593 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 05:27:06 +0200 Subject: [PATCH 054/710] [tanslation] Fix src/plugins/ftp/ssl.h comments Refines translated comments in src/plugins/ftp/ssl.h. Model: OpenAI GPT-5.4. Verification: OSTranslation sequential review with full prompt logging, Copilot event logging, clang AST grounding, guard 0 violations, and git diff check passed. Telemetry: 3 provider calls, 33401 estimated tokens, 1 Copilot SDK call, 2 Copilot request units. --- src/plugins/ftp/ssl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/ftp/ssl.h b/src/plugins/ftp/ssl.h index 0799074dd..407997973 100644 --- a/src/plugins/ftp/ssl.h +++ b/src/plugins/ftp/ssl.h @@ -96,7 +96,7 @@ typedef const char* (*TX509_verify_cert_error_string)(long n); typedef X509* (*TSSL_get_peer_certificate)(const SSL* SSL); typedef STACK_OF(X509) * (*TSSL_get_peer_cert_chain)(const SSL* s); typedef STACK_OF(SSL_COMP) * (*TSSL_COMP_get_compression_methods)(void); -typedef SSL_SESSION* (*TSSL_get1_session)(SSL* ssl); /* obtain a reference count */ +typedef SSL_SESSION* (*TSSL_get1_session)(SSL* ssl); /* obtain a session and increment its reference count */ typedef void (*TSSL_SESSION_free)(SSL_SESSION* ses); typedef long (*TSSL_ctrl)(SSL* ssl, int cmd, long larg, void* parg); typedef int (*TSSL_set_session)(SSL* to, SSL_SESSION* session); From 3f31e07dff6deb22e8f61edeaaf53ad127629519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 05:56:17 +0200 Subject: [PATCH 055/710] [tanslation] Fix src/plugins/ftp/ctrlcon3.cpp comments Refines translated comments in src/plugins/ftp/ctrlcon3.cpp. Model: OpenAI GPT-5.4 Verification: full OSTranslation sequential review with prompt-log-mode full, copilot-event-log full, clang AST grounding, review-provider auto, Copilot SDK gpt-5.4 reasoning high; 301 comment units, 301 review results, 301 resolved results, 301 apply results; branch-target guard passed strict and ignore-whitespace with 0 violations and 0 preprocessing failures; git diff --check passed. Telemetry: 40 provider calls and 524717 estimated tokens total. Codex-family: 33 calls and 287191 estimated tokens. Copilot SDK: 7 calls, 237526 estimated tokens, 127968 input tokens, 23670 output tokens, 14 Copilot request units. Copilot billing in this workflow is request-unit based, not token-priced. --- src/plugins/ftp/ctrlcon3.cpp | 68 ++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/src/plugins/ftp/ctrlcon3.cpp b/src/plugins/ftp/ctrlcon3.cpp index 1efa3ce3d..5a462f832 100644 --- a/src/plugins/ftp/ctrlcon3.cpp +++ b/src/plugins/ftp/ctrlcon3.cpp @@ -64,7 +64,7 @@ void CSendCmdUserIfaceWaitWnd::Init(HWND parent, const char* logCmd, const char* { char buf[500]; char errBuf[300]; - if (waitWndText == NULL) // standard text of the wait window + if (waitWndText == NULL) // use the standard wait window text { lstrcpyn(errBuf, logCmd, 300); // trim the CRLF from the command char* s = errBuf + strlen(errBuf); @@ -153,7 +153,7 @@ BOOL CControlConnectionSocket::SendFTPCommand(HWND parent, const char* ftpCmd, c CSetWaitCursorWindow* winParent = NULL; if (parentIsEnabled) // we cannot leave the parent enabled (the wait window is not modal) { - // store the focus from 'parent' (if the focus is not from 'parent', store NULL) + // save the current focus in 'parent' (if focus is not in 'parent', store NULL) focusedWnd = GetFocus(); HWND hwnd = focusedWnd; while (hwnd != NULL && hwnd != parent) @@ -229,7 +229,7 @@ BOOL CControlConnectionSocket::SendFTPCommand(HWND parent, const char* ftpCmd, c if (aborting && auxCanSendOOBData) { - // notify the server about the abort (see RFC 959 - sending the ABOR command) + // notify the server of the abort (see RFC 959: sending the ABOR command) HANDLES(EnterCriticalSection(&SocketCritSect)); if (Socket != INVALID_SOCKET && BytesToWriteCount == 0) // "always true" (all data should have been sent) @@ -319,11 +319,11 @@ BOOL CControlConnectionSocket::SendFTPCommand(HWND parent, const char* ftpCmd, c { if (userIface->HandleESC(parent, state == sfcsSendCommand, allowCmdAbort)) { // cancel - if (allowCmdAbort && state == sfcsSendCommand) // cancel for the command -> start aborting the command + if (allowCmdAbort && state == sfcsSendCommand) // command cancel -> start aborting the command { state = sfcsAbortCommand; - // allBytesWritten = TRUE; // we must wait until the command is sent before starting to send the abort - // we will not display the wait window again; in theory sending should never stall -> ignore it (the user will wait without the wait window) + // allBytesWritten = TRUE; // we must wait until the command is sent before starting the abort + // we will not show the wait dialog again; in theory, sending should never stall, so we do not handle it (the user will wait without the dialog) } else // cannot use abort (we must close the connection) or cancel while aborting the command { @@ -380,14 +380,14 @@ BOOL CControlConnectionSocket::SendFTPCommand(HWND parent, const char* ftpCmd, c { // replies of type FTP_D1_MAYBESUCCESS are logged only (we are waiting for the server's "last word") if (event != ccsevClosed) { - if (!aborting) // send command - { // state can also be sfcsAbortCommand; then we must abort the command even if it succeeded just now (the user ordered an abort) + if (!aborting) // send the command unless it is being aborted + { // state can also be sfcsAbortCommand; then we must abort the command even if it has just succeeded (the user requested an abort) if (state != sfcsAbortCommand) { state = sfcsDone; *ftpReplyCode = replyCode; CopyStr(ftpReplyBuf, ftpReplyBufSize, reply, replySize); - ret = TRUE; // SUCCESS, we have the server's reply! (for sending we only care about a single server reply) + ret = TRUE; // SUCCESS, we have the server reply! (when sending, only one server reply matters) } // else; // continue waiting for the abort command (we have not sent ABOR yet) SkipFTPReply(replySize); @@ -408,8 +408,8 @@ BOOL CControlConnectionSocket::SendFTPCommand(HWND parent, const char* ftpCmd, c { // this is the reply for the sent or aborted command; we will still try to read // additional server replies (some servers send one more for ABOR) - if (!cmdReplyReceived) // return the first reply (it should belong to the command but it may be - { // for ABOR as well) - ignore any possible second reply (to ABOR) + if (!cmdReplyReceived) // return the first reply (it should belong to the command, but it may also be for ABOR) + { // ignore any possible second reply (to ABOR) state = sfcsDone; *ftpReplyCode = replyCode; CopyStr(ftpReplyBuf, ftpReplyBufSize, reply, replySize); @@ -493,7 +493,7 @@ BOOL CControlConnectionSocket::SendFTPCommand(HWND parent, const char* ftpCmd, c switch (event) { case ccsevUserIfaceFinished: - break; // CanFinishSending() will hopefully return TRUE now + break; // CanFinishSending() should return TRUE now case ccsevTimeout: { @@ -563,7 +563,7 @@ BOOL CControlConnectionSocket::SendFTPCommand(HWND parent, const char* ftpCmd, c switch (event) { // case ccsevESC: // (the user cannot press ESC during a 0 ms timeout) - case ccsevTimeout: // no message is waiting -> display the error from Write directly + case ccsevTimeout: // no message is pending -> display the error from Write directly { opFatalErrorTextID = !aborting ? IDS_SENDCOMMANDERROR : IDS_ABORTCOMMANDERROR; opFatalError = error; @@ -622,7 +622,7 @@ BOOL CControlConnectionSocket::SendFTPCommand(HWND parent, const char* ftpCmd, c if (event == ccsevClosed) { - if (state == sendState) // close without a cause + if (state == sendState) // unexpected close { fatalErrorTextID = IDS_CONNECTIONLOSTERROR; state = sfcsFatalError; @@ -653,7 +653,7 @@ BOOL CControlConnectionSocket::SendFTPCommand(HWND parent, const char* ftpCmd, c Logs.LogMessage(logUID, buf, -1, TRUE); // add the last error text to the log } fatalErrLogMsg = TRUE; - if (canRetry == NULL || donotRetry) // "retry" is not possible or does not make sense + if (canRetry == NULL || donotRetry) // "retry" is not possible or useful { *s = 0; SalamanderGeneral->SalMessageBox(parent, buf, LoadStr(IDS_FTPERRORTITLE), @@ -707,7 +707,7 @@ BOOL CControlConnectionSocket::SendFTPCommand(HWND parent, const char* ftpCmd, c } } - if (parentIsEnabled) // if we disabled the parent, enable it again + if (parentIsEnabled) // if the parent was disabled, enable it again { // remove the wait cursor over the parent if (winParent != NULL) @@ -744,7 +744,7 @@ BOOL CControlConnectionSocket::SendFTPCommand(HWND parent, const char* ftpCmd, c SetupKeepAliveTimer(); } } - else // connection interrupted or timeout (the socket cannot be used anymore) + else // connection interrupted or timed out (the socket is no longer usable) { CloseSocket(NULL); // close the socket (if it is open); the system will attempt a "graceful" shutdown (we will not learn the result) Logs.SetIsConnected(logUID, IsConnected()); @@ -795,7 +795,7 @@ BOOL CControlConnectionSocket::GetCurrentWorkingPath(HWND parent, char* path, in HANDLES(EnterCriticalSection(&SocketCritSect)); if (FTP_DIGIT_1(ftpReplyCode) == FTP_D1_SUCCESS && // success is returned (should be 257) FTPGetDirectoryFromReply(replyBuf, (int)strlen(replyBuf), WorkingPath, FTP_MAX_PATH) || - FTP_DIGIT_1(ftpReplyCode) != FTP_D1_SUCCESS) // failure returned (e.g. "not defined; use CWD to set the working directory") -> temporarily use an empty path + FTP_DIGIT_1(ftpReplyCode) != FTP_D1_SUCCESS) // failed (e.g. "not defined; use CWD to set the working directory") -> temporarily use an empty path { if (FTP_DIGIT_1(ftpReplyCode) != FTP_D1_SUCCESS) WorkingPath[0] = 0; // temporarily use an empty path @@ -896,8 +896,8 @@ BOOL CControlConnectionSocket::SendChangeWorkingPath(BOOL notInPanel, BOOL leftP const char* p; BOOL needChangeDir = i == 0 && reconnected && startPath != NULL; // after reconnect try to set 'startPath' again - if (i == 0 && !reconnected && startPath != NULL) // we have been connected for a while, check - { // whether the working directory matches 'startPath' + if (i == 0 && !reconnected && startPath != NULL) // we have been connected for a while; check whether the working directory matches 'startPath' + { // use the cache; under normal circumstances the path should be there if (GetCurrentWorkingPath(parent, newPath, FTP_MAX_PATH, FALSE, &canRetry, retryMsgBuf, 300)) { @@ -1041,8 +1041,8 @@ BOOL CControlConnectionSocket::ChangeWorkingPath(BOOL notInPanel, BOOL leftPanel if (path[0] == 0) // only right after connecting - otherwise the path change (Shift+F7) to { // a relative path (e.g. "ftp://localhost") is ignored // + when optimizing ChangePath() called right after obtaining the working directory - // forceRefresh should be only FALSE + it is always preceded by a GetCurrentWorkingPath() call -> it should always - // take the path from the cache (does not touch the connection) + // forceRefresh should only be FALSE, and this is always preceded by a GetCurrentWorkingPath() call, so it should always + // use the cached path (without touching the connection) ret = GetCurrentWorkingPath(parent, path, pathBufSize, forceRefresh, NULL, NULL, 0); if (ret) { @@ -1052,7 +1052,7 @@ BOOL CControlConnectionSocket::ChangeWorkingPath(BOOL notInPanel, BOOL leftPanel } else { - if (parsedPath && // except for connecting from the "Connect to FTP Server" dialog it is always TRUE + if (parsedPath && // parsedPath is always TRUE except when connecting from the "Connect to FTP Server" dialog (*path == '/' || *path == '\\')) // 'path' always starts with '/' or '\\' ("always true") { pathType = GetFTPServerPathType(path + 1); @@ -1060,7 +1060,7 @@ BOOL CControlConnectionSocket::ChangeWorkingPath(BOOL notInPanel, BOOL leftPanel pathType == ftpsptOS2 && GetFTPServerPathType("") == ftpsptOS2) // OS/2 paths get confused with the Unix path "/C:/path", so distinguish OS/2 paths even just by the SYST reply { // VMS + MVS + IBM_z/VM + OS/2 do not have '/' or '\\' at the start of the path memmove(path, path + 1, strlen(path) + 1); // remove the '/' or '\\' character from the start of the path - if (path[0] == 0) // generic root -> supplement it according to the system type + if (path[0] == 0) // generic root -> fill it in according to the system type { if (pathType == ftpsptOpenVMS) lstrcpyn(path, "[000000]", pathBufSize); @@ -1074,7 +1074,7 @@ BOOL CControlConnectionSocket::ChangeWorkingPath(BOOL notInPanel, BOOL leftPanel { if (rescuePath[0] == 0 || !FTPGetIBMz_VMRootPath(path, pathBufSize, rescuePath)) { - lstrcpyn(path, "/", pathBufSize); // the tested server supported the Unix root "/"; maybe someone will report it, then we will handle it further... + lstrcpyn(path, "/", pathBufSize); // the tested server supported the Unix root "/"; maybe someone will report this, then we will handle it further... } } else @@ -1083,7 +1083,7 @@ BOOL CControlConnectionSocket::ChangeWorkingPath(BOOL notInPanel, BOOL leftPanel { if (rescuePath[0] == 0 || !FTPGetOS2RootPath(path, pathBufSize, rescuePath)) { - lstrcpyn(path, "/", pathBufSize); // try at least the Unix root "/", we know nothing else; maybe someone will report it, then we will handle it further... + lstrcpyn(path, "/", pathBufSize); // try at least the Unix root "/"; we do not know anything else; maybe someone will report this, then we will handle it further... } } } @@ -1141,8 +1141,8 @@ BOOL CControlConnectionSocket::ChangeWorkingPath(BOOL notInPanel, BOOL leftPanel pathType = GetFTPServerPathType(path); rescuePath[0] = 0; // do not try it next time (avoid loops) } - else // no need to report any error (listing already reported an error); we quietly tried - { // to find an accessible path (which did not work) + else // no need to report any error (listing already reported an error); we tried silently + { // to find an accessible path, but it did not work ret = FALSE; } } @@ -1168,7 +1168,7 @@ BOOL CControlConnectionSocket::ChangeWorkingPath(BOOL notInPanel, BOOL leftPanel strcat(listCmd, "\r\n"); BOOL isFTPS = EncryptControlConnection == 1; int useListingsCacheAux = UseListingsCache; - BOOL resuscitateKeepAlive = (IsConnected() && KeepAliveEnabled && KeepAliveMode == kamNone); // if keep-alive has already turned off (revival time expired), we must restart it + BOOL resuscitateKeepAlive = (IsConnected() && KeepAliveEnabled && KeepAliveMode == kamNone); // if keep-alive has already turned off (the resuscitation interval expired), we must restart it KeepAliveStart = GetTickCount(); // beware, it is not enough to do it simply; 'resuscitateKeepAlive' must be used HANDLES(LeaveCriticalSection(&SocketCritSect)); @@ -1259,7 +1259,7 @@ BOOL CControlConnectionSocket::ChangeWorkingPath(BOOL notInPanel, BOOL leftPanel errBuf[0] = 0; // any possible message is unnecessary; the printed error would only be confusing } } - break; // fatal error or success (path changed) + possibly: the path is cached, take the listing from the cache + break; // fatal error or success (path changed); possibly: the path is cached and the listing is taken from the cache } } else @@ -1293,7 +1293,7 @@ BOOL CControlConnectionSocket::ChangeWorkingPath(BOOL notInPanel, BOOL leftPanel lstrcpyn(path, rescuePath, pathBufSize); fileNameAlreadyCut = TRUE; pathType = GetFTPServerPathType(path); - rescuePath[0] = 0; // do not try it next time (avoid loops) + rescuePath[0] = 0; // do not try it again next time (avoid loops) } else { @@ -1307,7 +1307,7 @@ BOOL CControlConnectionSocket::ChangeWorkingPath(BOOL notInPanel, BOOL leftPanel *pathWasCut = TRUE; // we are on a path other than the requested one if (pathBufSize > 0) path[0] = 0; // there is no current path on the server - break; // go try listing... + break; // try listing now... } } else @@ -1406,7 +1406,7 @@ void CControlConnectionSocket::GiveConnectionToWorker(CFTPWorker* newWorker, HWN if (IsConnected()) // only if the connection is open { // first stop keep-alive: - // store the focus from 'parent' (if the focus is not from 'parent', store NULL) + // save the focus from 'parent' (if the focus is not in 'parent', store NULL) HWND focusedWnd = GetFocus(); HWND hwnd = focusedWnd; while (hwnd != NULL && hwnd != parent) @@ -1588,7 +1588,7 @@ void CControlConnectionSocket::GetConnectionFromWorker(CFTPWorker* workerWithCon // restart keep-alive ReleaseKeepAlive(); WaitForEndOfKeepAlive(SalamanderGeneral->GetMsgBoxParent(), 0); // cannot open the wait window (it is in state 'kamNone') - SetupKeepAliveTimer(TRUE); // set up the keep-alive timer; trigger the keep-alive command right away (we do not know how long the connection was inactive, so let us avoid losing it) + SetupKeepAliveTimer(TRUE); // set up the keep-alive timer; run the keep-alive command immediately (the connection may have been inactive for an unknown length of time, so avoid losing it unnecessarily) } } } From 6bd8b9e22eca9a3ed89ba41b27377ac03a69bc42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 06:03:23 +0200 Subject: [PATCH 056/710] [tanslation] Fix src/plugins/ftp/dialogs.h comments Refines translated comments in src/plugins/ftp/dialogs.h. Model: OpenAI GPT-5.4 Verification: full OSTranslation sequential review with prompt-log-mode full, copilot-event-log full, clang AST grounding, review-provider auto, Copilot SDK gpt-5.4 reasoning high; 326 comment units, 326 review results, 326 resolved results, 326 apply results; branch-target guard passed strict and ignore-whitespace with 0 violations and 0 preprocessing failures; git diff --check passed. Telemetry: 2 provider calls and 19863 estimated tokens total. Codex-family: 1 codex-resolve call and 646 estimated tokens. Copilot SDK: 1 call, 19217 estimated tokens, 12359 input tokens, 586 output tokens, 2 Copilot request units. Copilot billing in this workflow is request-unit based, not token-priced. --- src/plugins/ftp/dialogs.h | 66 +++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/src/plugins/ftp/dialogs.h b/src/plugins/ftp/dialogs.h index f8dcc9119..f58b10a09 100644 --- a/src/plugins/ftp/dialogs.h +++ b/src/plugins/ftp/dialogs.h @@ -40,27 +40,27 @@ void HandleOperationsCombo(int* value, CTransferInfo& ti, int resID, int arrValu void ProxyComboBox(HWND hWindow, CTransferInfo& ti, int ctrlID, int& proxyUID, BOOL addDefault, CFTPProxyServerList* proxyServerList); -// 'lastCheck' (in/out) stores the last state of the checkbox, 'lastCheck' initializes to -1; -// 'valueBuf' is a buffer for the value in the "checked" state with size of at least 31 characters, -// 'valueBuf' initializes to an empty string; +// 'lastCheck' (in/out) stores the last checkbox state; 'lastCheck' is initialized to -1; +// 'valueBuf' is a buffer for the value in the "checked" state, at least 31 characters long; +// 'valueBuf' is initialized to an empty string; // 'checkedVal' is the initial value in the "checked" state; -// 'globValUsed'+'globVal' - value for the third state of the checkbox (is it used? + value) +// 'globValUsed'+'globVal' specify the third checkbox state (whether it is used and its value) void CheckboxEditLineInteger(HWND dlg, int checkboxID, int editID, int* lastCheck, char* valueBuf, int checkedVal, BOOL globValUsed, int globVal); -// 'lastCheck' (in/out) stores the last state of the checkbox, 'lastCheck' initializes to -1; -// 'valueBuf' is a buffer for the value in the "checked" state with size of at least 31 characters, -// 'valueBuf' initializes to an empty string; +// 'lastCheck' (in/out) stores the last checkbox state value; initialize 'lastCheck' to -1. +// 'valueBuf' is a buffer for the value in the "checked" state, with a size of at least 31 characters; +// initialize 'valueBuf' to an empty string. // 'checkedVal' is the initial value in the "checked" state; -// 'globValUsed'+'globVal' - value for the third state of the checkbox (is it used? + value) +// 'globValUsed'+'globVal' - value for the third state of the checkbox (used? + value) void CheckboxEditLineDouble(HWND dlg, int checkboxID, int editID, int* lastCheck, char* valueBuf, double checkedVal, BOOL globValUsed, double globVal); -// 'lastCheck' (in/out) stores the last state of the checkbox, 'lastCheck' initializes to -1; -// 'valueBuf' is a buffer for the value in the "checked" state (index in the combo box), -// 'valueBuf' initializes to -1; -// 'checkedVal' is the initial value in the "checked" state (index in the combo box); -// 'globValUsed'+'globVal' - value for the third state of the checkbox (is it used? + value) +// 'lastCheck' (in/out) stores the last checkbox state; 'lastCheck' is initialized to -1; +// 'valueBuf' stores the value in the "checked" state (combo box index); +// 'valueBuf' is initialized to -1; +// 'checkedVal' is the initial value in the "checked" state (combo box index); +// 'globValUsed'+'globVal' specify the third checkbox state (whether it is used and its value) void CheckboxCombo(HWND dlg, int checkboxID, int comboID, int* lastCheck, int* valueBuf, int checkedVal, BOOL globValUsed, int globVal); @@ -193,7 +193,7 @@ class CConfigPageLogs : public CCommonPropSheetPage { protected: int LastLogMaxSize; // last value of the "log max size" checkbox - char LogMaxSizeBuf[31]; // buffer to keep the contents of the "log max size" line + char LogMaxSizeBuf[31]; // buffer holding the contents of the "log max size" field int LastMaxClosedConLogs; // last value of the "max disconnected connection logs" checkbox char MaxClosedConLogsBuf[31]; // buffer to keep the contents of the "max disconnected connection logs" line @@ -416,8 +416,8 @@ class CRenameDlg : public CCenteredDialog protected: char* Name; // listbox item name (for edit line + checkbox) - BOOL NewServer; // TRUE/FALSE: dialog New/Rename - BOOL AddBookmark; // TRUE/FALSE: Connect:Add Bookmark dialog / applies to NewServer + BOOL NewServer; // TRUE/FALSE: New/Rename dialog + BOOL AddBookmark; // TRUE/FALSE: Connect:Add Bookmark dialog / only when NewServer is TRUE BOOL ServerTypes; // FALSE/TRUE: Connect/Configuration:Servers dialog char* CopyFromName; // only if ServerTypes==TRUE: name for the checkbox (differs from the name for the edit line) @@ -478,8 +478,8 @@ class CWaitWindow : public CWindow CWaitWindow(HWND hParent, BOOL showCloseButton); ~CWaitWindow(); - // returns TRUE if the user clicked the wait-window close button with the mouse; it returns TRUE - // only once and the next TRUE comes only after another click of the close button + // returns TRUE if the user clicked the wait-window close button with the mouse; + // it returns TRUE only once per click of the close button BOOL GetWindowClosePressed() { BOOL ret = WindowClosePressed; @@ -785,7 +785,7 @@ class CEditServerTypeDlg : public CCenteredDialog { protected: HWND HListView; // listview with columns - BOOL CanReadListViewChanges; // TRUE = record checkbox changes in the list-view, FALSE = undesirable while filling the list-view + BOOL CanReadListViewChanges; // TRUE = record checkbox changes in the list-view; FALSE = do not record them while filling the list-view CServerType* ServerType; // edited server type (changes may occur only after pressing the OK button) TIndirectArray ColumnsData; // columns shown in the dialog (data for the listview with columns) @@ -821,10 +821,10 @@ class CEditSrvTypeColumnDlg : public CCenteredDialog BOOL Edit; // TRUE = editing, FALSE = adding a new column int* EditedColumn; // IN: index (in 'ColumnsData') of the edited column, OUT: focus index - int LastUsedIndexForName; // -1==invalid, otherwise index in the combo of the last Name selection - int LastUsedIndexForDescr; // -1==invalid, otherwise index in the combo of the last Description selection + int LastUsedIndexForName; // -1==invalid, otherwise the index of the last Name selection in the combo box + int LastUsedIndexForDescr; // -1==invalid, otherwise the index of the last Description selection in the combo box - BOOL FirstSelNotifyAfterTransfer; // TRUE = data were just set into the dialog, the posted CBN_SELCHANGE for combo Type must not change Alignment + BOOL FirstSelNotifyAfterTransfer; // TRUE = data were just set into the dialog; the posted CBN_SELCHANGE for combo Type must not change the Alignment value public: CEditSrvTypeColumnDlg(HWND parent, TIndirectArray* columnsData, @@ -990,7 +990,7 @@ class CChangeAttrsDlg : public CCenteredDialog #define OPERDLG_STATUSMINIDLETIME 950 // minimum time gap for the next update (periodic or from a worker) after the last worker update - WARNING: tied to WORKER_STATUSUPDATETIMEOUT #define OPERDLG_GETDISKSPACEPERIOD 3000 // time after which free space on the target disk is fetched again #define OPERDLG_SHOWERRMINIDLETIME 10000 // minimum idle time in the dialog before an error is shown automatically (see Config.OpenSolveErrIfIdle) -#define OPERDLG_AUTOSHOWERRTIMER 4 // timer ID for a periodic test whether a Show Error dialog should appear +#define OPERDLG_AUTOSHOWERRTIMER 4 // timer ID for periodically checking whether a Show Error dialog should be displayed #define OPERDLG_AUTOSHOWERRPERIOD 1000 // timer period for testing whether a Show Error dialog should appear #define OPERDLG_AUTOSHOWERRTIMER2 5 // helper timer: ensures "immediate" delivery of OPERDLG_AUTOSHOWERRTIMER #define OPERDLG_CORRECTBTNSTIMER 6 // timer ID for checking button states shortly after the dialog is activated (focus is unfortunately unknown at activation) @@ -998,7 +998,7 @@ class CChangeAttrsDlg : public CCenteredDialog #define WM_APP_DISABLEDETAILED WM_APP + 1 // [0, 0] - disable the Detailed button after maximizing #define WM_APP_ACTIVATEWORKERS WM_APP + 2 // [0, 0] - activate workers after opening the dialog #define WM_APP_WORKERCHANGEREP WM_APP + 3 // [0, 0] - a worker change was reported, we must read from the operation where the change happened (see CFTPOperation::GetChangedWorker()) -#define WM_APP_ITEMCHANGEREP WM_APP + 4 // [0, 0] - an item change was reported, we must read from the operation where the changes happened (see CFTPOperation::GetChangedItems()) +#define WM_APP_ITEMCHANGEREP WM_APP + 4 // [0, 0] - an item change was reported; query the operation for where the changes happened (see CFTPOperation::GetChangedItems()) #define WM_APP_OPERSTATECHANGE WM_APP + 5 // [0, 0] - the operation state changed (done/in progress/completed with errors), we must read the state from the operation (see CFTPOperation::GetOperationState()) #define WM_APP_HAVEDISKFREESPACE WM_APP + 6 // [0, 0] - the thread checking disk free space reports that it has a result #define WM_APP_CLOSEDLG WM_APP + 7 // [0, 0] - the progress dialog should close (uses auto-close) @@ -1048,7 +1048,7 @@ class COperDlgListView : public CWindow public: HWND HToolTip; COperationDlg* OperDlg; // dialog in which the listview exists - BOOL ConsOrItems; // TRUE/FALSE = take data from the Connections/Operations listview + BOOL ConsOrItems; // TRUE/FALSE = take data from the Connections/Operations listview, respectively int LastItem; int LastSubItem; @@ -1102,12 +1102,12 @@ class COperationDlg : public CDialog char ItemsTextBuf[3][OPERDLG_ITEMSTEXTBUFSIZE]; // buffers for LVN_GETDISPINFO text in the Operations listview int ItemsActTextBuf; // which of the three buffers is currently free for LVN_GETDISPINFO in the Operations listview - BOOL SimpleLook; // TRUE/FALSE = simple (after the split bar) / detailed (complete) dialog look + BOOL SimpleLook; // TRUE/FALSE = simple / detailed (complete) dialog appearance char* TitleText; // text for the dialog title (without the initial "(XX%) ") BOOL IsDirtyStatus; // TRUE = status/progress of the operation needs update (the dialog must redraw status/progress) - BOOL IsDirtyProgress; // TRUE = a worker changed; maybe (if the worker changed due to progress) status/progress needs update (the dialog must redraw status/progress) + BOOL IsDirtyProgress; // TRUE = a worker changed; status/progress of the operation may need an update (the dialog must redraw status/progress if the worker changed due to progress) DWORD LastUpdateOfProgressByWorker; // GetTickCount at the last update of progress triggered by a worker (used to skip unnecessarily frequent updates with multiple workers + skip periodic updates) BOOL IsDirtyConsListView; // TRUE = the Connections listview content changed (needs repaint in the dialog) BOOL IsDirtyItemsListView; // TRUE = the Operations listview content changed (needs repaint in the dialog) @@ -1124,8 +1124,8 @@ class COperationDlg : public CDialog BOOL EnableChangeFocusedItemUID; // TRUE = change FocusedItemUID when focus changes (FALSE is used during listview refresh to prevent unwanted changes to FocusedItemUID) BOOL UserWasActive; // TRUE = prevent the window from closing automatically after the operation finishes successfully (the user was doing something and the dialog would vanish) - BOOL DelayAfterCancel; // TRUE = do not open another Solve Error dialog immediately after Cancel in the previous Solve Error dialog - BOOL CloseDlgWhenOperFin; // FALSE = do not close the window after operation completion = the window may close only if Config.CloseOperationDlgIfSuccessfullyFinished==TRUE + BOOL DelayAfterCancel; // TRUE = do not open another Solve Error dialog immediately after pressing Cancel in the previous Solve Error dialog + BOOL CloseDlgWhenOperFin; // FALSE = do not close the window after the operation finishes = the window may close if Config.CloseOperationDlgIfSuccessfullyFinished==TRUE DWORD ClearChkboxTime; HWND LastFocusedControl; // last focused control in the dialog DWORD LastActivityTime; // GetTickCount() from the time of the user's last activity @@ -1198,7 +1198,7 @@ class COperationDlg : public CDialog int ConnectionsActHeight; // current height of the Connections listview int ConsAddActYOffset; // current y-offset of the Add button below the Connections listview int ConnectionsActHeightLimit; // current height limit for the Connections listview - BOOL InListViewSplit; // TRUE = the mouse is in the area where dragging changes the Connections listview height against the Operations listview + BOOL InListViewSplit; // TRUE = the mouse is in the area where dragging changes the Connections listview height relative to the Operations listview height BOOL Captured; // TRUE = the mouse is captured by us int DragOriginY; // Y coordinate of the left-button press (start of the drag) double ListviewSplitRatio; // ratio between the Connections listview height and the total height for the listviews @@ -1251,9 +1251,9 @@ class COperationDlg : public CDialog // updates is OPERDLG_UPDATEPERIOD milliseconds void ScheduleDelayedUpdate(); - // draws (shows) new values of all changed data displayed in the dialog + // updates displayed values of all changed data in the dialog // (used for delayed data refresh); returns TRUE if - // something needed updating + // anything needed updating BOOL UpdateDataInDialog(); // ensures setting the close button (Close/Cancel); 'flashTitle' is TRUE @@ -1529,7 +1529,7 @@ class CViewErrAsciiTrForBinFileDlg : public CCenteredDialog // // helper object for the Script edit control (custom context menu + does not -// select-all when the control gets focus) +// select all when the control gets focus) class CProxyScriptControlWindow : public CWindow { public: From 14db829e2b81e93fcec0113258fe637653351517 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 06:25:04 +0200 Subject: [PATCH 057/710] [tanslation] Fix src/plugins/ftp/operats8.cpp comments Translate and tighten comments in src/plugins/ftp/operats8.cpp without changing executable code. The update clarifies FTP worker flush handling, data-connection shutdown behavior, retry timing, resume-size handling, delayed auto-retry setup, and disk-work cancellation notes. Model: OpenAI GPT-5.4. Verification: sequential scan, ground, review, resolve, apply, and guard completed for 213 comment units; git diff --check passed; comment guard passed with 0 violations. Telemetry: 32 total requests, 291,369 estimated tokens, 3 Copilot SDK requests, 6 Copilot request units. Copilot billing is request-unit based, not direct token-priced billing. --- src/plugins/ftp/operats8.cpp | 96 ++++++++++++++++++------------------ 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/src/plugins/ftp/operats8.cpp b/src/plugins/ftp/operats8.cpp index e284321b0..6b6d582e1 100644 --- a/src/plugins/ftp/operats8.cpp +++ b/src/plugins/ftp/operats8.cpp @@ -91,7 +91,7 @@ void CFTPWorker::HandleEventInWorkingState3(CFTPWorkerEvent event, BOOL& sendQui char userBuf[USER_MAX_SIZE]; unsigned short portBuf; - // ensure flushing the data from the data connection to the disk thread and once the flush is complete + // ensure the data is flushed from the data connection to the disk thread, and once the flush is complete // return the buffer to the data connection (if it is already closed, just deallocate the buffer) if (!ShouldStop && WorkerDataCon != NULL && event == fweDataConFlushData || event == fweDiskWorkWriteFinished) @@ -102,8 +102,8 @@ void CFTPWorker::HandleEventInWorkingState3(CFTPWorkerEvent event, BOOL& sendQui char* flushBuffer; int validBytesInFlushBuffer; BOOL deleteTgtFile; - // since we are already in the CSocketsThread::CritSect section, this call - // is also possible from the CSocket::SocketCritSect section (no dead-lock risk) + // since we are already in CSocketsThread::CritSect, this call + // is also possible from CSocket::SocketCritSect (no deadlock risk) BOOL haveFlushData = WorkerDataCon->GiveFlushData(&flushBuffer, &validBytesInFlushBuffer, &deleteTgtFile); HANDLES(EnterCriticalSection(&WorkerCritSect)); @@ -139,7 +139,7 @@ void CFTPWorker::HandleEventInWorkingState3(CFTPWorkerEvent event, BOOL& sendQui HANDLES(LeaveCriticalSection(&WorkerCritSect)); // since we are already in the CSocketsThread::CritSect section, this call // is also possible from the CSocket::SocketCritSect section (no dead-lock risk) - if (WorkerDataCon->IsConnected()) // close the "data connection", the system tries to do a "graceful" + if (WorkerDataCon->IsConnected()) // close the "data connection"; the system tries to perform a "graceful" shutdown WorkerDataCon->CloseSocketEx(NULL); // shutdown (we will not learn about the result) WorkerDataCon->FreeFlushData(); DeleteSocket(WorkerDataCon); @@ -180,7 +180,7 @@ void CFTPWorker::HandleEventInWorkingState3(CFTPWorkerEvent event, BOOL& sendQui HANDLES(LeaveCriticalSection(&WorkerCritSect)); // since we are already in the CSocketsThread::CritSect section, this call // is also possible from the CSocket::SocketCritSect section (no dead-lock risk) - if (WorkerDataCon->IsConnected()) // close the "data connection", the system tries to do a "graceful" + if (WorkerDataCon->IsConnected()) // close the "data connection"; the system will attempt a "graceful" shutdown WorkerDataCon->CloseSocketEx(NULL); // shutdown (we will not learn about the result) WorkerDataCon->FreeFlushData(); DeleteSocket(WorkerDataCon); @@ -219,8 +219,8 @@ void CFTPWorker::HandleEventInWorkingState3(CFTPWorkerEvent event, BOOL& sendQui if (WorkerDataCon != NULL) // if the data connection exists, return the buffer for reuse { HANDLES(LeaveCriticalSection(&WorkerCritSect)); - // since we are already in the CSocketsThread::CritSect section, this call - // is also possible from the CSocket::SocketCritSect section (no dead-lock risk) + // since we are already in CSocketsThread::CritSect, this call + // can also be made from CSocket::SocketCritSect (no deadlock risk) WorkerDataCon->FlushDataFinished(DiskWork.FlushDataBuffer, TRUE); if (!WorkerDataCon->IsConnected()) { @@ -267,7 +267,7 @@ void CFTPWorker::HandleEventInWorkingState3(CFTPWorkerEvent event, BOOL& sendQui HANDLES(LeaveCriticalSection(&WorkerCritSect)); // since we are already in the CSocketsThread::CritSect section, this call // is also possible from the CSocket::SocketCritSect section (no dead-lock risk) - if (WorkerDataCon->IsConnected()) // close the "data connection", the system tries to do a "graceful" + if (WorkerDataCon->IsConnected()) // close the "data connection"; the system will attempt a graceful shutdown WorkerDataCon->CloseSocketEx(NULL); // shutdown (we will not learn about the result) WorkerDataCon->FreeFlushData(); DeleteSocket(WorkerDataCon); @@ -353,8 +353,8 @@ void CFTPWorker::HandleEventInWorkingState3(CFTPWorkerEvent event, BOOL& sendQui WorkerDataConState = wdcsOnlyAllocated; HANDLES(LeaveCriticalSection(&WorkerCritSect)); - // since we are already in the CSocketsThread::CritSect section, this call - // is also possible from the CSocket::SocketCritSect section (no dead-lock risk) + // since we are already in CSocketsThread::CritSect, this call + // is also possible from CSocket::SocketCritSect (no deadlock risk) WorkerDataCon->SetPostMessagesToWorker(TRUE, Msg, UID, WORKER_DATACON_CONNECTED, WORKER_DATACON_CLOSED, @@ -439,7 +439,7 @@ void CFTPWorker::HandleEventInWorkingState3(CFTPWorkerEvent event, BOOL& sendQui HANDLES(LeaveCriticalSection(&WorkerCritSect)); // since we are already in the CSocketsThread::CritSect section, this call // is also possible from the CSocket::SocketCritSect section (no dead-lock risk) - if (WorkerDataCon->IsConnected()) // close the "data connection", the system tries to do a "graceful" + if (WorkerDataCon->IsConnected()) // close the "data connection"; the system tries to perform a "graceful" shutdown WorkerDataCon->CloseSocketEx(NULL); // shutdown (we will not learn about the result) WorkerDataCon->FreeFlushData(); DeleteSocket(WorkerDataCon); @@ -530,7 +530,7 @@ void CFTPWorker::HandleEventInWorkingState3(CFTPWorkerEvent event, BOOL& sendQui HANDLES(LeaveCriticalSection(&WorkerCritSect)); // since we are already in the CSocketsThread::CritSect section, this call // is also possible from the CSocket::SocketCritSect section (no dead-lock risk) - if (WorkerDataCon->IsConnected()) // close the "data connection", the system tries to do a "graceful" + if (WorkerDataCon->IsConnected()) // close the "data connection"; the system will try a "graceful" shutdown WorkerDataCon->CloseSocketEx(NULL); // shutdown (we will not learn about the result) WorkerDataCon->FreeFlushData(); DeleteSocket(WorkerDataCon); @@ -555,7 +555,7 @@ void CFTPWorker::HandleEventInWorkingState3(CFTPWorkerEvent event, BOOL& sendQui HANDLES(LeaveCriticalSection(&WorkerCritSect)); // since we are already in the CSocketsThread::CritSect section, this call // is also possible from the CSocket::SocketCritSect section (no dead-lock risk) - if (WorkerDataCon->IsConnected()) // close the "data connection", the system tries to do a "graceful" + if (WorkerDataCon->IsConnected()) // close the "data connection"; the system attempts a graceful shutdown WorkerDataCon->CloseSocketEx(NULL); // shutdown (we will not learn about the result) WorkerDataCon->FreeFlushData(); DeleteSocket(WorkerDataCon); @@ -589,7 +589,7 @@ void CFTPWorker::HandleEventInWorkingState3(CFTPWorkerEvent event, BOOL& sendQui HANDLES(LeaveCriticalSection(&WorkerCritSect)); // since we are already in the CSocketsThread::CritSect section, this call // is also possible from the CSocket::SocketCritSect section (no dead-lock risk) - if (WorkerDataCon->IsConnected()) // close the "data connection", the system tries to do a "graceful" + if (WorkerDataCon->IsConnected()) // close the "data connection"; the system attempts a graceful shutdown WorkerDataCon->CloseSocketEx(NULL); // shutdown (we will not learn about the result) WorkerDataCon->FreeFlushData(); DeleteSocket(WorkerDataCon); @@ -661,7 +661,7 @@ void CFTPWorker::HandleEventInWorkingState3(CFTPWorkerEvent event, BOOL& sendQui if (!ResumingOpenedFile && // during resume some servers return the file size and others the remaining size to download (there is no way to tell which one it is, so they cannot be used) FTPGetDataSizeInfoFromSrvReply(size, reply, replySize)) { - // if (ResumingOpenedFile && ) // WARNING, NOT ALWAYS TRUE: during resume we do not receive the total file size, only the resumed part -> must add it to 'size' + // if (ResumingOpenedFile && ) // WARNING, NOT ALWAYS TRUE: when resuming, we do not receive the total file size, only the size of the resumed part -> must add the resumed offset to 'size' // size += OpenedFileResumedAtOffset; if (!curItem->SizeInBytes || curItem->Size != size) { // write the newly determined file size into the item (for overall progress + conversion of block/record/etc. sizes to bytes) @@ -696,9 +696,9 @@ void CFTPWorker::HandleEventInWorkingState3(CFTPWorkerEvent event, BOOL& sendQui HANDLES(LeaveCriticalSection(&WorkerCritSect)); if (FTP_DIGIT_1(replyCode) != FTP_D1_SUCCESS) { // the server reports an error retrieving the file - // since we are already in the CSocketsThread::CritSect section, this call - // is also possible from the CSocket::SocketCritSect section (no dead-lock risk) - if (WorkerDataCon->IsConnected()) // close the "data connection", the system tries to do a "graceful" + // since we are already in CSocketsThread::CritSect, this call + // is also possible from CSocket::SocketCritSect (no deadlock risk) + if (WorkerDataCon->IsConnected()) // close the "data connection"; the system attempts a graceful shutdown WorkerDataCon->CloseSocketEx(NULL); // shutdown (we will not learn about the result) } else @@ -708,11 +708,11 @@ void CFTPWorker::HandleEventInWorkingState3(CFTPWorkerEvent event, BOOL& sendQui waitForDataConFinish = TRUE; if (!WorkerDataCon->IsTransfering(&trFinished) && !trFinished) { // connection has not been established - wait 5 seconds, then possibly report an error (if the connection still has not been established and ListCmdReplyCode is success) - // since we are already in the CSocketsThread::CritSect section, this call - // is also possible from the CSocket::SocketCritSect and CFTPWorker::WorkerCritSect sections (no dead-lock risk) + // since we are already in CSocketsThread::CritSect, this call + // can also be made from CSocket::SocketCritSect and CFTPWorker::WorkerCritSect (no deadlock risk) SocketsThread->DeleteTimer(UID, WORKER_DATACONSTARTTIMID); - // since we are already in the CSocketsThread::CritSect section, this call - // is also possible from the CSocket::SocketCritSect and CFTPWorker::WorkerCritSect sections (no dead-lock risk) + // since we are already in CSocketsThread::CritSect, this call + // is also possible from CSocket::SocketCritSect and CFTPWorker::WorkerCritSect (no deadlock risk) SocketsThread->AddTimer(Msg, UID, GetTickCount() + 20000, WORKER_DATACONSTARTTIMID, NULL); // ignore the error; at worst the user presses Stop } @@ -727,7 +727,7 @@ void CFTPWorker::HandleEventInWorkingState3(CFTPWorkerEvent event, BOOL& sendQui HANDLES(LeaveCriticalSection(&WorkerCritSect)); // since we are already in the CSocketsThread::CritSect section, this call // is also possible from the CSocket::SocketCritSect section (no dead-lock risk) - if (WorkerDataCon->IsConnected()) // close the "data connection", the system tries to do a "graceful" + if (WorkerDataCon->IsConnected()) // close the "data connection"; the system tries to perform a graceful shutdown WorkerDataCon->CloseSocketEx(NULL); // shutdown (we will not learn about the result) HANDLES(EnterCriticalSection(&WorkerCritSect)); } @@ -747,7 +747,7 @@ void CFTPWorker::HandleEventInWorkingState3(CFTPWorkerEvent event, BOOL& sendQui HANDLES(LeaveCriticalSection(&WorkerCritSect)); // since we are already in the CSocketsThread::CritSect section, this call // is also possible from the CSocket::SocketCritSect section (no dead-lock risk) - if (WorkerDataCon->IsConnected()) // close the "data connection", the system tries to do a "graceful" + if (WorkerDataCon->IsConnected()) // close the "data connection"; the system will try a graceful shutdown WorkerDataCon->CloseSocketEx(NULL); // shutdown (we will not learn about the result) WorkerDataCon->FreeFlushData(); DeleteSocket(WorkerDataCon); @@ -781,8 +781,8 @@ void CFTPWorker::HandleEventInWorkingState3(CFTPWorkerEvent event, BOOL& sendQui { int retrReply = ListCmdReplyCode; HANDLES(LeaveCriticalSection(&WorkerCritSect)); - if (event == fweDataConStartTimeout) // if the connection still has not been established, there is no point in waiting longer + - { // if ListCmdReplyCode is success, retry the operation + if (event == fweDataConStartTimeout) // if the connection still has not been established, there is no point in waiting any longer + { // if ListCmdReplyCode indicates success, retry the operation BOOL trFinished; if (WorkerDataCon->IsConnected() && !WorkerDataCon->IsTransfering(&trFinished) && !trFinished) @@ -790,8 +790,8 @@ void CFTPWorker::HandleEventInWorkingState3(CFTPWorkerEvent event, BOOL& sendQui WorkerDataCon->CloseSocketEx(NULL); // shutdown (we will not learn about the result) if (FTP_DIGIT_1(retrReply) == FTP_D1_SUCCESS) // retry the operation (the server returned success, but the data connection did not even open, so something is wrong) { - // since we are already in the CSocketsThread::CritSect section, this call - // is also possible from the CSocket::SocketCritSect section (no dead-lock risk) + // since we are already in CSocketsThread::CritSect, this call + // can also be made from CSocket::SocketCritSect (no deadlock risk) WorkerDataCon->FreeFlushData(); DeleteSocket(WorkerDataCon); WorkerDataCon = NULL; @@ -814,21 +814,21 @@ void CFTPWorker::HandleEventInWorkingState3(CFTPWorkerEvent event, BOOL& sendQui { nextLoopCopy = TRUE; SubState = fwssWorkCopyFinishFlushData; - // since we are already in the CSocketsThread::CritSect section, this call - // is also possible from the CSocket::SocketCritSect and CFTPWorker::WorkerCritSect sections (no dead-lock risk) + // since we are already in CSocketsThread::CritSect, this call + // is also possible from CSocket::SocketCritSect and CFTPWorker::WorkerCritSect (no deadlock risk) SocketsThread->DeleteTimer(UID, WORKER_DATACONSTARTTIMID); } break; } - case fwssWorkCopyFinishFlushData: // copy/move of a file: ensure the data flush from the data connection finishes (it is already closed) + case fwssWorkCopyFinishFlushData: // copy/move of a file: ensure data flushing from the data connection completes (it is already closed) { BOOL done = !DiskWorkIsUsed; // TRUE only if a data flush is not in progress if (done && WorkerDataCon != NULL) { HANDLES(LeaveCriticalSection(&WorkerCritSect)); - // since we are already in the CSocketsThread::CritSect section, this call - // is also possible from the CSocket::SocketCritSect section (no dead-lock risk) + // since we are already in CSocketsThread::CritSect, this call + // can also be made from CSocket::SocketCritSect (no deadlock risk) done = WorkerDataCon->AreAllDataFlushed(FALSE); HANDLES(EnterCriticalSection(&WorkerCritSect)); } @@ -849,7 +849,7 @@ void CFTPWorker::HandleEventInWorkingState3(CFTPWorkerEvent event, BOOL& sendQui } case fwssWorkCopyFinishFlushDataAfterQuitSent: - break; // copy/move of a file: after sending "QUIT" wait for the control connection to close and for the data flush to finish on disk + break; // copy/move of a file: after sending "QUIT", wait for the control connection to close and for the data flush to disk to finish case fwssWorkCopyProcessRETRRes: // copy/move of a file: process the result of "RETR" (after the "data connection" closed, data were flushed to disk, and the server response to "RETR" was received) { @@ -876,10 +876,10 @@ void CFTPWorker::HandleEventInWorkingState3(CFTPWorkerEvent event, BOOL& sendQui //dataConDecomprMissingStreamEnd = WorkerDataCon->GetDecomprMissingStreamEnd(); if (!WorkerDataCon->GetProxyError(errBuf, 50 + FTP_MAX_PATH, NULL, 0, TRUE)) errBuf[0] = 0; - // since we are already in the CSocketsThread::CritSect section, this call - // is also possible from the CSocket::SocketCritSect section (no dead-lock risk) - // the data connection should be closed already, so closing it is probably redundant, but we play it safe... - if (WorkerDataCon->IsConnected()) // close the "data connection", the system tries to do a "graceful" + // since we are already in CSocketsThread::CritSect, this call + // is also possible from CSocket::SocketCritSect (no deadlock risk) + // the data connection should already be closed, so closing it is probably redundant, but keep the defensive close... + if (WorkerDataCon->IsConnected()) // close the "data connection"; the system attempts a graceful shutdown { WorkerDataCon->CloseSocketEx(NULL); // shutdown (we will not learn about the result) TRACE_E("Unexpected situation in CFTPWorker::HandleEventInWorkingState3(): data connection has left opened!"); @@ -905,8 +905,8 @@ void CFTPWorker::HandleEventInWorkingState3(CFTPWorkerEvent event, BOOL& sendQui else { if (dataConError != NO_ERROR && !IsConnected()) - { // the response to RETR arrived, but while waiting for the data connection to finish - // the connection was interrupted (both the data and control connections) -> RETRY + { // the response to RETR arrived, but while waiting for the transfer over the data connection to finish + // both the data and control connections were interrupted -> RETRY conClosedRetryItem = TRUE; } else @@ -922,8 +922,8 @@ void CFTPWorker::HandleEventInWorkingState3(CFTPWorkerEvent event, BOOL& sendQui HANDLES(LeaveCriticalSection(&WorkerCritSect)); if (IsConnected()) // "manually" close the control connection { - // since we are already in the CSocketsThread::CritSect section, this call - // is also possible from the CSocket::SocketCritSect section (no dead-lock risk) + // since we are already in CSocketsThread::CritSect, this call + // is also possible from CSocket::SocketCritSect (no deadlock risk) ForceClose(); // it would be cleaner to send QUIT, but a certificate change is very unlikely, so it is not worth the hassle :-) } HANDLES(EnterCriticalSection(&WorkerCritSect)); @@ -936,12 +936,12 @@ void CFTPWorker::HandleEventInWorkingState3(CFTPWorkerEvent event, BOOL& sendQui (FTP_DIGIT_2(ListCmdReplyCode) == FTP_D2_CONNECTION || // mainly "426 data connection closed, transfer aborted" (whether it was the server admin or a connection issue is impossible to tell, so we prioritize a connection issue -> retry the download) FTP_DIGIT_2(ListCmdReplyCode) == FTP_D2_FILESYSTEM) && // "450 Transfer aborted. Link to file server lost." dataSSLErrorOccured != SSLCONERR_DONOTRETRY || // accept 426 and 450 only if they were not caused by an error: encryption failed, which is a permanent problem - dataConNoDataTransTimeout || // connection interrupted by us due to a no-data-transfer timeout (happens with "50%" network dropouts; the data connection stays open but the data transfer blocks, it can stay open for 14000 seconds, this should solve it) -> retry the download + dataConNoDataTransTimeout || // connection interrupted by us due to a no-data-transfer timeout (happens with "50%" network dropouts; the data connection stays open but the data transfer gets stuck, and it can stay open for 14000 seconds; this should handle it) -> retry the download dataSSLErrorOccured == SSLCONERR_CANRETRY)) // encryption failed, but it is not a permanent problem { SubState = fwssWorkCopyDelayedAutoRetry; // use a delayed auto-retry so that all unexpected server responses have time to arrive - // since we are already in the CSocketsThread::CritSect section, this call - // is also possible from the CSocket::SocketCritSect and CFTPWorker::WorkerCritSect sections (no dead-lock risk) + // since we are already in CSocketsThread::CritSect, this call + // can also be made from CSocket::SocketCritSect and CFTPWorker::WorkerCritSect (no deadlock risk) SocketsThread->AddTimer(Msg, UID, GetTickCount() + WORKER_DELAYEDAUTORETRYTIMEOUT, WORKER_DELAYEDAUTORETRYTIMID, NULL); // ignore the error; at worst the user presses Stop } @@ -960,11 +960,11 @@ void CFTPWorker::HandleEventInWorkingState3(CFTPWorkerEvent event, BOOL& sendQui { errText[0] = 0; if (FTP_DIGIT_1(ListCmdReplyCode) != FTP_D1_SUCCESS && ListCmdReplyText != NULL) - { // if we do not have a network error description from the server, settle for the system description + { // if we do not have a network error description from the server, use the system description lstrcpyn(errText, ListCmdReplyText, 200 + FTP_MAX_PATH); } - if (errText[0] == 0 && errBuf[0] != 0) // try to take the error text from the proxy server + if (errText[0] == 0 && errBuf[0] != 0) // try to get the error text from the proxy server lstrcpyn(errText, errBuf, 200 + FTP_MAX_PATH); // if (errText[0] == 0 && dataConDecomprMissingStreamEnd) @@ -1146,7 +1146,7 @@ void CFTPWorker::HandleEventInWorkingState3(CFTPWorkerEvent event, BOOL& sendQui if (FTPDiskThread->CancelWork(&DiskWork, &workIsInProgress)) { if (workIsInProgress) - DiskWork.FlushDataBuffer = NULL; // the work is in progress; we cannot free the buffer with the data being written/tested and leave it to the disk-work thread (see the cancellation part) - we can write to DiskWork because after Cancel the disk thread must not access it anymore (for example it might no longer exist) + DiskWork.FlushDataBuffer = NULL; // the work is in progress; we cannot free the buffer with the data being written/tested, so we leave it to the disk-work thread (see the cancellation part) - we can write to DiskWork because after Cancel the disk thread must not access it anymore (for example, it might no longer exist) } // if we cancelled the work before it started, we must free the flush buffer, and // if the work is already finished, free the flush buffer here, because fweDiskWorkWriteFinished From fdbcefc844b8ca2bd9770dee4380a9e5daea2946 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 06:44:19 +0200 Subject: [PATCH 058/710] [tanslation] Fix src/plugins/automation/abortmodal.cpp comments Tighten one translated comment in src/plugins/automation/abortmodal.cpp without changing executable code. The update clarifies WM_QUIT pump behavior and the loss of messages queued before WM_QUIT. Model: OpenAI GPT-5.4. Verification: sequential scan, ground, review, resolve, apply, and guard completed for 4 comment units; git diff --check passed; comment guard passed with 0 violations. Telemetry: 2 total requests, 23,871 estimated tokens, 1 Copilot SDK request, 2 Copilot request units. Copilot billing is request-unit based, not direct token-priced billing. --- src/plugins/automation/abortmodal.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/automation/abortmodal.cpp b/src/plugins/automation/abortmodal.cpp index 4ef0a0a9d..f982f5f84 100644 --- a/src/plugins/automation/abortmodal.cpp +++ b/src/plugins/automation/abortmodal.cpp @@ -128,7 +128,7 @@ HRESULT AbortableModalDialogWrapper( { hr = SALAUT_E_ABORT; - // Pump out the WM_QUIT we generated. The eventual messages + // Pump out the WM_QUIT we generated. Any messages // before WM_QUIT are lost. MSG msg; while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) From fdf9a1a90f41f6a3f73a68812910459cd7e5b6ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 06:51:50 +0200 Subject: [PATCH 059/710] [tanslation] Fix src/plugins/automation/abortmodal.h comments Tighten the Doxygen comment for AbortableModalDialogWrapper in src/plugins/automation/abortmodal.h without changing executable code. The update clarifies the wrapper description, parameter text, and success return wording. Model: OpenAI GPT-5.4. Verification: sequential scan, ground, review, resolve, apply, and guard completed for 3 comment units; git diff --check passed; comment guard passed with 0 violations. Telemetry: 1 Copilot SDK request, 24,703 estimated tokens, 2 Copilot request units. Copilot billing is request-unit based, not direct token-priced billing. --- src/plugins/automation/abortmodal.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/automation/abortmodal.h b/src/plugins/automation/abortmodal.h index 48dda8c99..d27caa392 100644 --- a/src/plugins/automation/abortmodal.h +++ b/src/plugins/automation/abortmodal.h @@ -15,10 +15,10 @@ #define WM_SAL_ABORTMODAL (WM_APP + 0) -/// Wraps a modal dialog into the dialog that can be forcibly aborted by the user. -/// \param pfnDialogFn Function to display the modal dialog. -/// \param pContext User defined value to be passed to the dialog function. -/// \return If the modal dialog was successfully executed, the return value is S_OK. +/// Wraps a modal dialog in a dialog that the user can forcibly abort. +/// \param pfnDialogFn Function that displays the modal dialog. +/// \param pContext User-defined value passed to the dialog function. +/// \return If the modal dialog was executed successfully, the return value is S_OK. /// If the modal dialog was aborted, the return value is SALAUT_E_ABORT. HRESULT AbortableModalDialogWrapper( __in class CScriptInfo* pScript, From ed3f45552ebce966aa106ecfb2476be81cef6f37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 06:59:16 +0200 Subject: [PATCH 060/710] [tanslation] Fix src/plugins/automation/abortpalette.cpp comments Tighten one translated system menu comment in src/plugins/automation/abortpalette.cpp without changing executable code. The update clarifies that SC_CLOSE is referenced by command rather than position. Model: OpenAI GPT-5.4. Verification: sequential scan, ground, review, resolve, apply, and guard completed for 15 comment units; git diff --check passed; comment guard passed with 0 violations. Telemetry: 2 total requests, 30,157 estimated tokens, 1 Copilot SDK request, 2 Copilot request units. Copilot billing is request-unit based, not direct token-priced billing. --- src/plugins/automation/abortpalette.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/automation/abortpalette.cpp b/src/plugins/automation/abortpalette.cpp index b79955587..ab718cfab 100644 --- a/src/plugins/automation/abortpalette.cpp +++ b/src/plugins/automation/abortpalette.cpp @@ -293,8 +293,8 @@ unsigned CScriptAbortPaletteThread::Body() // We cannot delete the SC_CLOSE menu item, // since that would not disable the close button // on the title bar on Vista+ with Aero. - // Moreover the item cannot be referenced by - // position but by command only. + // Moreover, the item cannot be referenced + // by position, only by command. EnableMenuItem(hSysMenu, SC_CLOSE, MF_BYCOMMAND | MF_GRAYED); } else if (uId != SC_MOVE) From ee79b6617a33ed2025c2fd6f19fb9e6e14f8916a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 07:07:56 +0200 Subject: [PATCH 061/710] [tanslation] Fix src/plugins/automation/automationplug.cpp comments Tighten translated menu-related comments in src/plugins/automation/automationplug.cpp without changing executable code. The update clarifies callGetState mask handling, forced plugin load before the first menu popup, item refresh behavior, and icon-list copying. Model: OpenAI GPT-5.4. Verification: sequential scan, ground, review, resolve, apply, and guard completed for 37 comment units; git diff --check passed; comment guard passed with 0 violations. Telemetry: 3 total requests, 55,594 estimated tokens, 2 Copilot SDK requests, 4 Copilot request units. Copilot billing is request-unit based, not direct token-priced billing. --- src/plugins/automation/automationplug.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/plugins/automation/automationplug.cpp b/src/plugins/automation/automationplug.cpp index cdc4740e4..b975acebf 100644 --- a/src/plugins/automation/automationplug.cpp +++ b/src/plugins/automation/automationplug.cpp @@ -281,8 +281,8 @@ MENU_TEMPLATE_ITEM PluginMenu[] = 0, CAutomationMenuExtInterface::CmdRunFocusedScript, TRUE, // callGetState - 0, // or-mask (ignored id callGetState == TRUE) - 0, // and-mask (ignored id callGetState == TRUE) + 0, // or-mask (ignored if callGetState == TRUE) + 0, // and-mask (ignored if callGetState == TRUE) MENU_SKILLLEVEL_ALL); // open script menu @@ -296,10 +296,10 @@ MENU_TEMPLATE_ITEM PluginMenu[] = 0, MENU_SKILLLEVEL_ALL); - // for our menu items we set callGetState to TRUE, so the - // GetMenuItemState will be always called for the items which - // forces our plugin to be loaded before first menu popup - // and the items get refreshed + // for our menu items we set callGetState to TRUE, so + // GetMenuItemState is always called for those items, + // which forces our plugin to load before the first menu popup + // and refreshes the items if (g_oScriptLookup.GetCount() > 0) { @@ -319,8 +319,8 @@ MENU_TEMPLATE_ITEM PluginMenu[] = AddScriptContainerToMenu(pRootContainer, salamander, 0); } - // Salamander manages the icon list itself, so we must everytime - // create a copy of that list that we pass to menu builder. + // Salamander manages the icon list itself, so we must always + // create a copy of the list that we pass to the menu builder. CGUIIconListAbstract* pListCopy = SalamanderGUI->CreateIconList(); if (pListCopy) { From 69249b374e024299b2a5ec00f2f9783ed4ddb95d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 07:16:42 +0200 Subject: [PATCH 062/710] [tanslation] Fix src/plugins/automation/aututils.cpp comments Tighten translated utility comments in src/plugins/automation/aututils.cpp without changing executable code. The update clarifies one-based source-position normalization and the OLE Automation fallback from 64-bit integers to double. Model: OpenAI GPT-5.4. Verification: sequential scan, ground, review, resolve, apply, and guard completed for 11 comment units; git diff --check passed; comment guard passed with 0 violations. Telemetry: 3 total requests, 67,965 estimated tokens, 1 Copilot SDK request, 2 Copilot request units. Copilot billing is request-unit based, not direct token-priced billing. --- src/plugins/automation/aututils.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/automation/aututils.cpp b/src/plugins/automation/aututils.cpp index 241c76e85..90ef29105 100644 --- a/src/plugins/automation/aututils.cpp +++ b/src/plugins/automation/aututils.cpp @@ -128,9 +128,9 @@ static int DisplayError( static void AdjustSourcePosition(ULONG& line, LONG& col, CScriptEngineShim* pShim) { - // Some engines return zero-based line number, others one-based - // try to normalize to one-base line numbers since it is more - // natural for humans and editors start counting from one too. + // Some engines return zero-based line numbers, others one-based. + // Try to normalize to one-based line numbers since that is more + // natural for humans, and editors start counting from one too. if (pShim != NULL) { @@ -293,7 +293,7 @@ void QuadWordToVariant(const CQuadWord& q, __out VARIANT* var) } else { - // 64b integer is not OLE Automation type, coerce to double + // 64-bit integer is not an OLE Automation type; coerce to double V_VT(var) = VT_R8; V_R8(var) = (double)q.Value; } @@ -310,7 +310,7 @@ void QuadWordToVariant(LARGE_INTEGER q, __out VARIANT* var) } else { - // 64b integer is not OLE Automation type, coerce to double + // 64-bit integer is not an OLE Automation type; coerce to double V_VT(var) = VT_R8; V_R8(var) = (double)q.QuadPart; } From 12ce473dc782ebc84278adfc12004ae2caf899ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 07:26:36 +0200 Subject: [PATCH 063/710] [tanslation] Fix src/plugins/automation/aututils.h comments Tighten translated utility API comments in src/plugins/automation/aututils.h without changing executable code. The update clarifies error text formatting, IDispatch property retrieval, result output semantics, and abort exception reporting. Model: OpenAI GPT-5.4. Verification: sequential scan, ground, review, resolve, apply, and guard completed for 15 comment units; escaped Doxygen parameter tags were manually corrected; git diff --check passed; comment guard passed with 0 violations. Telemetry: 3 total requests, 57,709 estimated tokens, 1 Copilot SDK request, 2 Copilot request units. Copilot billing is request-unit based, not direct token-priced billing. --- src/plugins/automation/aututils.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/automation/aututils.h b/src/plugins/automation/aututils.h index 3acab07d1..d26b9a6ce 100644 --- a/src/plugins/automation/aututils.h +++ b/src/plugins/automation/aututils.h @@ -52,7 +52,7 @@ void DisplayException(EXCEPINFO& ei, bool bFree = true); /// Releases resources associated with the EXCEPINFO structure. void FreeException(EXCEPINFO& ei); -/// Formats textual description of the system error code. +/// Formats a textual description of the system error code. void FormatErrorText( HRESULT hrCode, TCHAR* pszBuffer, @@ -67,10 +67,10 @@ UINT HashString(__in_z PCTSTR s); void QuadWordToVariant(LARGE_INTEGER q, __out VARIANT* var); void QuadWordToVariant(const CQuadWord& q, __out VARIANT* var); -/// Retrieved property value from the IDispatch interface. +/// Retrieves a property value from the IDispatch interface. /// \param pdisp Pointer to the IDispatch interface. /// \param name Name of the property to retrieve. -/// \param result Property value. +/// \param result Receives the property value. HRESULT DispPropGet(IDispatch* pdisp, PCWSTR name, VARIANT* result); HRESULT DispPropGet(IUnknown* punk, PCWSTR name, VARIANT* result); @@ -84,6 +84,6 @@ int ButtonToFriendlyNumber(int button); /// See CScriptInfo::ExecuteWorker for detailed explanation. void ResetKeyboardState(); -/// Checks if the script execution was aborted and if so, fills appropriately -/// the exception information. +/// Checks whether script execution was aborted and, if so, fills the +/// exception information accordingly. HRESULT CheckAbort(__in class CScriptInfo* pScriptInfo, __out EXCEPINFO* pExcepInfo); From 587e6507624d7838c05cfc527b2508c14c7a455f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 07:35:11 +0200 Subject: [PATCH 064/710] [tanslation] Fix src/plugins/automation/cfgdlg.cpp comments Tighten translated dialog configuration comments in src/plugins/automation/cfgdlg.cpp without changing executable code. The update clarifies list-view command forwarding, autocomplete setup before subclassing, and deferred column-width recalculation. Model: OpenAI GPT-5.4. Verification: sequential scan, ground, review, resolve, apply, and guard completed for 19 comment units; git diff --check passed; comment guard passed with 0 violations. Telemetry: 3 total requests, 69,431 estimated tokens, 1 Copilot SDK request, 2 Copilot request units. Copilot billing is request-unit based, not direct token-priced billing. --- src/plugins/automation/cfgdlg.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/plugins/automation/cfgdlg.cpp b/src/plugins/automation/cfgdlg.cpp index d712a4d59..7fdd2a392 100644 --- a/src/plugins/automation/cfgdlg.cpp +++ b/src/plugins/automation/cfgdlg.cpp @@ -61,9 +61,9 @@ INT_PTR CAutomationConfigDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lPa HWND hwndList = GetDlgItem(HWindow, IDC_DIRLIST); if (hwndFrom == hwndList || GetParent(hwndFrom) == hwndList) { - // command forwarded from the list view, - // do not pass it to the CDialog::DialogProc - // since if it is IDOK the dialog will close + // command forwarded from the list view; + // do not pass it to CDialog::DialogProc, + // because IDOK would close the dialog return FALSE; } @@ -330,8 +330,8 @@ BOOL CAutomationConfigDialog::OnDirListBeginLabelEdit(NMLVDISPINFO* nmlv) _ASSERTE(IsWindow(hwndEdit)); // autocomplete must be attached before we subclass - // the edit control to not mess the subclass chain - // while unsubclassing + // the edit control so as not to disrupt the subclass chain + // during unsubclassing SHAutoComplete(hwndEdit, SHACF_FILESYS_DIRS); SubclassLabelEdit(hwndEdit); @@ -383,9 +383,9 @@ BOOL CAutomationConfigDialog::OnDirListEndLabelEdit(NMLVDISPINFO* nmlv) // accept the edited text SetWindowLongPtr(HWindow, DWLP_MSGRESULT, TRUE); - // the width of the column might be changed, - // defer recalcing the width once the new text will - // be set after we return from this notification handler + // the column width might change; + // defer recalculating it until the new text is set + // after we return from this notification handler PostMessage(HWindow, WM_USER_RECALCWIDTH, 0, 0); DirSelChanged(); From ddf7f7de0522917149b43445eee7f895757846ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 07:47:42 +0200 Subject: [PATCH 065/710] [tanslation] Fix src/plugins/automation/dispimpl.h comments Updated two reviewed comments in src/plugins/automation/dispimpl.h after comparing the current English translation against the original Czech baseline from OpenSalamander/salamander commit a28afcb958578dd219311a7b500320b162de812b. The IDispatchEx implementation note was rewritten to remove colloquial and emotional wording, fix missing articles, and make the VBScript behavior description precise without changing the technical meaning. The DispInvoke return-value comment was tightened by spelling out standard DispInvoke and adding the missing articles around the return-value pointer description. No executable code, declarations, control flow, preprocessor directives, or resource data were changed. The update is limited to comment text in the reviewed header. Model: OpenAI GPT-5.4 Verification: - Sequential review processed 52 comment units, with 52 review results, 52 resolved results, and 52 apply results. - Apply classified 2 units as applied, 9 as kept_target, and 41 as noop. - git diff --check for src/plugins/automation/dispimpl.h passed. - Comment guard was re-run against the materialized delivery checkout and passed with 0 violations. - Final git diff was manually reviewed for comment-only changes. Telemetry: - Total provider calls: 1. - Total tokens recorded: 18,915. - Total billing units recorded: 0. - Provider/model: codex gpt-5.4, 1 call. - Copilot billing note: Copilot is billed by request units, not by token-priced usage in this workflow. --- src/plugins/automation/dispimpl.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/plugins/automation/dispimpl.h b/src/plugins/automation/dispimpl.h index 2e09c7a1e..0bc2216ef 100644 --- a/src/plugins/automation/dispimpl.h +++ b/src/plugins/automation/dispimpl.h @@ -24,11 +24,11 @@ } /* - We must implement IDispatchEx for the very stupid VBScript engine. - We used to use simple StdDispatch implementation, but VB insists - on IDispatchEx and if it doesn't get it it simply !!!CASTS!!! - the interface pointer to the IDispatch which is not very good - with the aggregated StdDispatch interface and it caused strange + We must implement IDispatchEx for the VBScript engine. + We used to use a simple StdDispatch implementation, but VB requires + IDispatchEx and if it does not get it, it simply casts + the interface pointer to IDispatch, which does not work well + with the aggregated StdDispatch interface and caused strange crashes. */ @@ -210,8 +210,8 @@ class CDispatchImpl : public Interface, if (SUCCEEDED(hr) && pVarResult != NULL && V_VT(pVarResult) == VT_DISPATCH) { - // it seems that std DispInvoke is not able - // to coerce return value to proper pointer to + // it seems that standard DispInvoke is not able + // to coerce the return value to a proper pointer to // IDispatch in case of dual interface objects IDispatch* pdisp; From ab7498e5d5d938cb84b37d3004ee2ff07ea9bfa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 07:54:50 +0200 Subject: [PATCH 066/710] [tanslation] Fix src/plugins/automation/engassoc.cpp comments Updated one reviewed comment block in src/plugins/automation/engassoc.cpp after comparing the current English translation against the original Czech baseline from OpenSalamander/salamander commit a28afcb958578dd219311a7b500320b162de812b. The hardcoded JScript engine association fallback comment was rewritten to fix awkward grammar. The new wording keeps the same technical meaning: Windows makes using the JScript engine difficult, so the code falls back to a hardcoded association for .js files when other lookup mechanisms fail. No executable code, declarations, control flow, preprocessor directives, or resource data were changed. The update is limited to comment text in the reviewed source file. Model: OpenAI GPT-5.4 Verification: - Sequential review processed 4 comment units, with 4 review results, 4 resolved results, and 4 apply results. - Apply classified 1 unit as applied and 3 as kept_target. - git diff --check for src/plugins/automation/engassoc.cpp passed. - Comment guard was re-run against the materialized delivery checkout and passed with 0 violations. - Final git diff was manually reviewed for comment-only changes. Telemetry: - Total provider calls: 2. - Total tokens recorded: 53,134. - Total billing units recorded: 2 copilot_request_units. - Provider/model: copilot-sdk gpt-5.4, 1 call, 2 request units. - Provider/model: codex-resolve gpt-5.4, 1 call. - Copilot billing note: Copilot is billed by request units, not by token-priced usage in this workflow. --- src/plugins/automation/engassoc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/automation/engassoc.cpp b/src/plugins/automation/engassoc.cpp index 8fc8f00e5..bb5835278 100644 --- a/src/plugins/automation/engassoc.cpp +++ b/src/plugins/automation/engassoc.cpp @@ -122,8 +122,8 @@ HRESULT CScriptEngineAssociations::QueryHardcodedScriptEngineAssociation( PCTSTR pszExt, __out CLSID* clsidEngine) { - // Windows really makes hard time for us to use the JScript engine. - // Use hardcoded association for .js files if everything else fails. + // Windows really makes it hard for us to use the JScript engine. + // Use a hardcoded association for .js files if everything else fails. if (_tcsicmp(pszExt, _T(".js")) == 0) { From 283030f76461587fff44c532ea06fc7359ebbbe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 08:02:10 +0200 Subject: [PATCH 067/710] [tanslation] Fix src/plugins/automation/entry.cpp comments Updated two reviewed Doxygen comment blocks in src/plugins/automation/entry.cpp after comparing the current English translation against the original Czech baseline from OpenSalamander/salamander commit a28afcb958578dd219311a7b500320b162de812b. The plugin object return comment now says that the return value is a pointer to the plugin object, fixing the missing article without changing the documented success and failure semantics. The required Open Salamander version comment now includes the missing articles and punctuation around the spl_vers.h reference, making the documentation idiomatic while preserving its meaning. No executable code, declarations, control flow, preprocessor directives, or resource data were changed. The update is limited to comment text in the reviewed source file. Model: OpenAI GPT-5.4 Verification: - Sequential review processed 20 comment units, with 20 review results, 20 resolved results, and 20 apply results. - Apply classified 2 units as applied, 17 as kept_target, and 1 as noop. - git diff --check for src/plugins/automation/entry.cpp passed. - Comment guard was re-run against the materialized delivery checkout and passed with 0 violations. - Final git diff was manually reviewed for comment-only changes. Telemetry: - Total provider calls: 2. - Total tokens recorded: 32,164. - Total billing units recorded: 2 copilot_request_units. - Provider/model: codex gpt-5.4, 1 call. - Provider/model: copilot-sdk gpt-5.4, 1 call, 2 request units. - Copilot billing note: Copilot is billed by request units, not by token-priced usage in this workflow. --- src/plugins/automation/entry.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/automation/entry.cpp b/src/plugins/automation/entry.cpp index f844b512b..90f397e16 100644 --- a/src/plugins/automation/entry.cpp +++ b/src/plugins/automation/entry.cpp @@ -69,7 +69,7 @@ static void WINAPI HTMLHelpCallback(HWND hWindow, UINT helpID) /// Returns the object representing the plugin. /// \param salamander Pointer to the CSalamanderPluginEntryAbstract interface. -/// \return If the function succeeds, the return value is pointer to the +/// \return If the function succeeds, the return value is a pointer to the /// plugin object. If the function fails, the return value is NULL. CPluginInterfaceAbstract* WINAPI @@ -131,9 +131,9 @@ CPluginInterfaceAbstract* return &g_oAutomationPlugin; } -/// Returns version of Open Salamander required to run this plugin. -/// \return The return value is required version of Open Salamander. -/// For list of version values see \e spl_vers.h. +/// Returns the version of Open Salamander required to run this plugin. +/// \return The return value is the required version of Open Salamander. +/// For a list of version values, see \e spl_vers.h. int WINAPI SalamanderPluginGetReqVer() { return LAST_VERSION_OF_SALAMANDER; From a0e7c32098e034d48da2b47fcc687af7d05bf562 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 08:16:07 +0200 Subject: [PATCH 068/710] [tanslation] Fix src/plugins/automation/guicomponent.h comments Updated one reviewed comment in src/plugins/automation/guicomponent.h after comparing the current English translation against the original Czech baseline from OpenSalamander/salamander commit a28afcb958578dd219311a7b500320b162de812b. The component base class comment was rewritten to preserve the original prohibition against using the class directly while replacing non-native phrasing with idiomatic object-oriented terminology. The new comment tells callers not to use the class directly and to create a derived class instead. No executable code, declarations, control flow, preprocessor directives, or resource data were changed. The update is limited to comment text in the reviewed header. Model: OpenAI GPT-5.4 Verification: - Sequential review processed 32 comment units, with 32 review results, 32 resolved results, and 32 apply results. - Apply classified 1 unit as applied, 19 as kept_target, and 12 as noop. - git diff --check for src/plugins/automation/guicomponent.h passed. - Comment guard was re-run against the materialized delivery checkout and passed with 0 violations. - Final git diff was manually reviewed for comment-only changes. Telemetry: - Total provider calls: 3. - Total tokens recorded: 40,385. - Total billing units recorded: 2 copilot_request_units. - Provider/model: codex gpt-5.4, 1 call. - Provider/model: copilot-sdk gpt-5.4, 1 call, 2 request units. - Provider/model: codex-resolve gpt-5.4, 1 call. - Copilot billing note: Copilot is billed by request units, not by token-priced usage in this workflow. --- src/plugins/automation/guicomponent.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/automation/guicomponent.h b/src/plugins/automation/guicomponent.h index 32fc05429..742622192 100644 --- a/src/plugins/automation/guicomponent.h +++ b/src/plugins/automation/guicomponent.h @@ -17,7 +17,7 @@ #include "guidefs.h" /// Component base class. -/// You never use this class directly, you must create inherited class. +/// Never use this class directly; create a derived class instead. class CSalamanderGuiComponentBase : public ISalamanderGuiComponentInternal { private: From 4e47079ec26af71704abe105813fa6429b62b383 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 08:22:33 +0200 Subject: [PATCH 069/710] [tanslation] Fix src/plugins/automation/guicontainer.cpp comments Updated two reviewed implementation comments in src/plugins/automation/guicontainer.cpp after comparing the current English translation against the original Czech baseline from OpenSalamander/salamander commit a28afcb958578dd219311a7b500320b162de812b. The NULL assignment no-op comment now uses the missing articles around the non-existent member and no-op phrasing. The component type failure comment was shortened to a concise state label that matches the surrounding implementation-comment style while preserving the same meaning. No executable code, declarations, control flow, preprocessor directives, or resource data were changed. The update is limited to comment text in the reviewed source file. Model: OpenAI GPT-5.4 Verification: - Sequential review processed 15 comment units, with 15 review results, 15 resolved results, and 15 apply results. - Apply classified 2 units as applied and 13 as kept_target. - git diff --check for src/plugins/automation/guicontainer.cpp passed. - Comment guard was re-run against the materialized delivery checkout and passed with 0 violations. - Final git diff was manually reviewed for comment-only changes. Telemetry: - Total provider calls: 2. - Total tokens recorded: 32,901. - Total billing units recorded: 2 copilot_request_units. - Provider/model: codex gpt-5.4, 1 call. - Provider/model: copilot-sdk gpt-5.4, 1 call, 2 request units. - Copilot billing note: Copilot is billed by request units, not by token-priced usage in this workflow. --- src/plugins/automation/guicontainer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/automation/guicontainer.cpp b/src/plugins/automation/guicontainer.cpp index b4e85cbbb..5bf56d52d 100644 --- a/src/plugins/automation/guicontainer.cpp +++ b/src/plugins/automation/guicontainer.cpp @@ -248,7 +248,7 @@ HRESULT CSalamanderGuiContainerBase::ContainerPutMember( } else { - // Setting non-existent member to NULL is no-op. + // Setting a non-existent member to NULL is a no-op. _ASSERT(pComponent == NULL); } @@ -281,7 +281,7 @@ HRESULT CSalamanderGuiContainerBase::ContainerPutMember( if (FAILED(hr)) { - // It's not a component. + // Not a component. if (pComponent) { From 8781f963d2021532eb6f4f27667ecd4cba0560cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 08:31:54 +0200 Subject: [PATCH 070/710] [tanslation] Fix src/plugins/automation/guiform.cpp comments Updated six reviewed implementation comments in src/plugins/automation/guiform.cpp after comparing the current English translation against the original Czech baseline from OpenSalamander/salamander commit a28afcb958578dd219311a7b500320b162de812b. The changes fix awkward or non-native English in comments describing Cancel button behavior, system menu separator cleanup, resized component bounds, standard button alignment metadata, close-button Cancel return behavior, and button centering math. The rewritten comments keep the same technical meaning while improving grammar, articles, punctuation, and terminology such as system menu, dimensions, unused element, and x-shift offset. No executable code, declarations, control flow, preprocessor directives, or resource data were changed. The update is limited to comment text in the reviewed source file. Model: OpenAI GPT-5.4 Verification: - Sequential review processed 49 comment units, with 49 review results, 49 resolved results, and 49 apply results. - Apply classified 6 units as applied, 32 as kept_target, and 11 as noop. - git diff --check for src/plugins/automation/guiform.cpp passed. - Comment guard was re-run against the materialized delivery checkout and passed with 0 violations. - Final git diff was manually reviewed for comment-only changes. Telemetry: - Total provider calls: 4. - Total tokens recorded: 68,183. - Total billing units recorded: 4 copilot_request_units. - Provider/model: codex gpt-5.4, 2 calls. - Provider/model: copilot-sdk gpt-5.4, 2 calls, 4 request units. - Copilot billing note: Copilot is billed by request units, not by token-priced usage in this workflow. --- src/plugins/automation/guiform.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/plugins/automation/guiform.cpp b/src/plugins/automation/guiform.cpp index b3c0b1838..11a8d70f9 100644 --- a/src/plugins/automation/guiform.cpp +++ b/src/plugins/automation/guiform.cpp @@ -109,7 +109,7 @@ CSalamanderGuiForm::~CSalamanderGuiForm() HMENU hSysMenu = GetSystemMenu(m_hWnd, FALSE); - // If the form does not have the Cancel button, disable also the + // If the form does not have a Cancel button, also disable the // close button in the title bar. if (m_nCloseCode == -1) { @@ -138,8 +138,8 @@ CSalamanderGuiForm::~CSalamanderGuiForm() DeleteMenu(hSysMenu, SC_SIZE, MF_BYCOMMAND); } - // Remove separator between "Move" and "Close" if they - // remained the only items in the sys menu. + // Remove the separator between "Move" and "Close" if they + // are the only items left in the system menu. int iMove = -1; int iClose = -1; @@ -558,8 +558,8 @@ void CSalamanderGuiForm::InternalAddComponent( } // If some attributes of the previous component (most notably - // the Text property) were changed, its dimension might - // change as well. Expand bounds of the form to hold resized + // the Text property) were changed, its dimensions might + // change as well. Expand bounds of the form to hold the resized // component. UnionBounds(prevBounds); } @@ -669,10 +669,10 @@ void CSalamanderGuiForm::UnionBounds(const SALGUI_BOUNDS& bounds) void CSalamanderGuiForm::AlignButtons() { - // Contains pointers to standard buttons (have the DialogResult - // property set) added on the form. The array is indexed by - // the exit codes (IDOK, IDCANCEL...). Element zero is spare. - // Elements 16, 17 and 18 are specific buttons, see + // Contains pointers to standard buttons (with the DialogResult + // property set) added to the form. The array is indexed by + // exit codes (IDOK, IDCANCEL...). Element zero is unused. + // Elements 16, 17, and 18 are specific buttons; see the // ButtonToFriendlyNumber function. ISalamanderGuiComponentInternal* apButtons[MAX_EXIT_BUTTONS] = { 0, @@ -777,7 +777,7 @@ void CSalamanderGuiForm::AlignButtons() else if (apButtons[IDCANCEL]) { // If there is a Cancel button on the form, make the close - // button return the Cancel as well. + // button return the Cancel code as well. m_nCloseCode = IDCANCEL; } else @@ -833,8 +833,8 @@ void CSalamanderGuiForm::AlignButtonLine( int xshift; int cxClient, cxButtons; - // Center the buttons bounding rect in the form client rect, - // calculate x-shift offset and the shift all the buttons by + // Center the buttons' bounding rect in the form client rect, + // calculate the x-shift offset, and then shift all the buttons by // that offset. GetClientRect(m_hWnd, &rcClient); cxClient = rcClient.right; From 1e0880b6b2a2e44d7a926814d7797a1d9553eb04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 09:04:18 +0200 Subject: [PATCH 071/710] [tanslation] Fix src/plugins/automation/processlist.h comments Updated one reviewed API comment in src/plugins/automation/processlist.h after comparing the current English translation against the original Czech baseline from OpenSalamander/salamander commit a28afcb958578dd219311a7b500320b162de812b. The WindowBelongsToProcessID comment was rewritten to be grammatically complete and idiomatic. The new wording preserves the same behavior: the function returns TRUE when the window belongs to the requested process ID and walks through parent processes while checking ownership. No executable code, declarations, control flow, preprocessor directives, or resource data were changed. The update is limited to comment text in the reviewed header. Model: OpenAI GPT-5.4 Verification: - Sequential review processed 3 comment units, with 3 review results, 3 resolved results, and 3 apply results. - Apply classified 1 unit as applied and 2 as kept_target. - git diff --check for src/plugins/automation/processlist.h passed. - Comment guard was re-run against the materialized delivery checkout and passed with 0 violations. - Final git diff was manually reviewed for comment-only changes. Telemetry: - Total provider calls: 1. - Total tokens recorded: 23,183. - Total billing units recorded: 2 copilot_request_units. - Provider/model: copilot-sdk gpt-5.4, 1 call, 2 request units. - Copilot billing note: Copilot is billed by request units, not by token-priced usage in this workflow. --- src/plugins/automation/processlist.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/automation/processlist.h b/src/plugins/automation/processlist.h index 2e093b990..16af30cd8 100644 --- a/src/plugins/automation/processlist.h +++ b/src/plugins/automation/processlist.h @@ -13,6 +13,6 @@ #pragma once -// returns TRUE when window 'hWnd' belongs to process with 'dwProcessId' -// function walks through parent processes +// Returns TRUE when window 'hWnd' belongs to the process with 'dwProcessId'. +// The function walks through parent processes. BOOL WindowBelongsToProcessID(HWND hWnd, DWORD dwProcessId); From 7501e81ad877e26ab8d2d6d14d0e935a5423058c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 09:15:51 +0200 Subject: [PATCH 072/710] [tanslation] Fix src/plugins/automation/raiserr.h comments Correct a reviewed Doxygen parameter comment in src/plugins/automation/raiserr.h by fixing the typo Idenfier to Identifier while preserving the existing Doxygen param directive and line wrapping. This is a comment-only change. It does not alter declarations, API behavior, resources, control flow, or generated binaries. Model: OpenAI GPT-5.4 through GitHub Copilot. Copilot telemetry is reported in request units rather than token-priced USD cost. The run used 1 provider call, 20,529 total tokens, 12,998 input tokens, 747 output tokens, and 2 copilot_request_units. Verification: ran the sequential review pipeline with full prompt and Copilot event logging; inspected apply results and final diff; corrected the generated Doxygen escape issue during final review; ran git diff --check for the touched file; reran comment guard against the materialized checkout; guard passed with zero violations. --- src/plugins/automation/raiserr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/automation/raiserr.h b/src/plugins/automation/raiserr.h index 11322efe7..9441efa01 100644 --- a/src/plugins/automation/raiserr.h +++ b/src/plugins/automation/raiserr.h @@ -15,7 +15,7 @@ void RaiseError(LPCOLESTR pszDescription, REFIID riid, LPCOLESTR pszProgId); -/// \param nIdDescription Idenfier of the string in the language +/// \param nIdDescription Identifier of the string in the language /// module that describes the error. void RaiseError(int nIdDescription, REFIID riid, LPCOLESTR pszProgId); From 84077ab6cea6c5df02b6f19a68b681ad7caf4c1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 09:23:00 +0200 Subject: [PATCH 073/710] [tanslation] Fix src/plugins/automation/salamanderaut.cpp comments Improve two reviewed comments in src/plugins/automation/salamanderaut.cpp. The SalMessageBoxEx failure comment now uses clearer English, and the panel-object TODO now expands the abbreviation st. to e.g. This is a comment-only change. It preserves all declarations, control flow, return values, resources, and runtime behavior. Model: OpenAI GPT-5.4 through Codex and GitHub Copilot. Copilot telemetry is reported in request units rather than token-priced USD cost. The run used 3 provider calls, 32,267 total tokens, 14,932 input tokens, 1,975 output tokens, and 2 copilot_request_units. Verification: ran the sequential review pipeline with full prompt and Copilot event logging; inspected apply results, generated draft, and final diff; ran git diff --check for the touched file; reran comment guard against the materialized checkout; guard passed with zero violations. --- src/plugins/automation/salamanderaut.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/automation/salamanderaut.cpp b/src/plugins/automation/salamanderaut.cpp index b3452420c..37e8dc886 100644 --- a/src/plugins/automation/salamanderaut.cpp +++ b/src/plugins/automation/salamanderaut.cpp @@ -119,7 +119,7 @@ static void WINAPI ShowMsgBoxProc(void* pContext) if (msgbox.nDlgResult == 0) { - // the most probable reason of failure is invalid arguments + // the most likely reason for the failure is invalid arguments // to SalMessageBoxEx return E_INVALIDARG; } @@ -891,7 +891,7 @@ static void CALLBACK ShowQuestionDialogProc(void* pContext) if (FAILED(hr)) { - // TODO: report better error, st. like "panel object expected" + // TODO: report a better error, e.g. "panel object expected" return hr; } } From 4125bda65c742c98ac4dd99f7d963ec8fca97aeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 09:35:56 +0200 Subject: [PATCH 074/710] [tanslation] Fix src/plugins/automation/scriptlist.cpp comments Improve reviewed comments in src/plugins/automation/scriptlist.cpp. The update fixes spelling, grammar, and clarity in parsing-error, SendKeys, script-state, debugger, abort-event, main-window-locking, directory-filtering, registry-hash, uniquifier, and refresh-throttling comments. This is a comment-only change. It does not alter executable statements, declarations, registry logic, script execution flow, debugger behavior, abort handling, resources, or runtime behavior. Model: OpenAI GPT-5.4 through Codex and GitHub Copilot. Copilot telemetry is reported in request units rather than token-priced USD cost. The run used 5 provider calls, 125,450 total tokens, 53,805 input tokens, 11,058 output tokens, and 6 copilot_request_units. Verification: ran the sequential review pipeline with full prompt and Copilot event logging; inspected apply results, generated draft, and final diff; ran git diff --check for the touched file; reran comment guard against the materialized checkout; guard passed with zero violations. --- src/plugins/automation/scriptlist.cpp | 77 ++++++++++++++------------- 1 file changed, 40 insertions(+), 37 deletions(-) diff --git a/src/plugins/automation/scriptlist.cpp b/src/plugins/automation/scriptlist.cpp index b2f7a3054..2bc91855d 100644 --- a/src/plugins/automation/scriptlist.cpp +++ b/src/plugins/automation/scriptlist.cpp @@ -348,9 +348,9 @@ bool CScriptInfo::ExecuteWorker(EXECUTION_INFO* info) m_bSiteErrorDisplayed = false; if (!CreateEngine(info)) { - // If the error occured during parsing and was already displayed - // through the site's OnScriptError event, don't display it here. - // Otherwise display generic error message here. + // If the error occurred during parsing and was already displayed + // through the site's OnScriptError event, do not display it here. + // Otherwise, display a generic error message here. if (!m_bSiteErrorDisplayed) { SalamanderGeneral->SalMessageBox( @@ -363,42 +363,44 @@ bool CScriptInfo::ExecuteWorker(EXECUTION_INFO* info) return false; } - // workaround for WshShell.SendKeys to work properly (by john): - // Salamander is not responding properly on SendKeys (http://msdn.microsoft.com/en-us/library/8c6yea83%28VS.85%29.aspx) - // when Ctrl/Shift/Alt is still pressed (for example when script was started using Ctrl+Shift+Z hot key). - // Miranda global hot key (Ctrl+Shift+A) is triggered on (salamander ->) Ctrl+Shift+Z -> (script started ->) SendKeys("a"). - // Attempt to release pressed Ctrl/Shift/Alt using SetKeyboardState() doesn't work. - // Note: it seems that SendKeys is using API ::SendInput() beacause it doesn't work too (Miranda is activated). - // Fortunately, following hack works pretty well. + // Workaround to make WshShell.SendKeys work correctly (by john): + // Salamander does not handle SendKeys correctly while Ctrl/Shift/Alt are still pressed + // (for example, when the script was started with the Ctrl+Shift+Z hotkey): + // http://msdn.microsoft.com/en-us/library/8c6yea83%28VS.85%29.aspx + // Miranda's global hotkey (Ctrl+Shift+A) is triggered by the sequence + // Ctrl+Shift+Z in Salamander -> script start -> SendKeys("a"). + // An attempt to release pressed Ctrl/Shift/Alt with SetKeyboardState() does not work. + // SendKeys appears to use the ::SendInput() API, because that does not work either + // (Miranda is activated). Fortunately, the following workaround works well. ResetKeyboardState(); m_pShim->BeginExecution(); // Run the script. // We used to have only SetScriptState(SCRIPTSTATE_CONNECTED) here, but tracing - // the cscript.exe revealed, that it calls SCRIPTSTATE_INITIALIZED immediately - // followed by SCRIPTSTATE_STARTED. We changed the logic here to match the one - // of cscript.exe more closely. This was done primarily because of RScript22 - // won't execute a script without SCRIPTSTATE_STARTED. Hopefully, this won't - // break other engines (JScript and VBScript seems fine). + // cscript.exe revealed that it calls SCRIPTSTATE_INITIALIZED immediately, + // followed by SCRIPTSTATE_STARTED. We changed the logic here to match + // cscript.exe more closely. This was done primarily because RScript22 + // will not execute a script without SCRIPTSTATE_STARTED. Hopefully, this will not + // break other engines (JScript and VBScript seem fine). hr = m_pScript->SetScriptState(SCRIPTSTATE_INITIALIZED); if (SUCCEEDED(hr)) { hr = m_pScript->SetScriptState(SCRIPTSTATE_STARTED); } - // ActivePython returns SCRIPT_E_REPORTED if there was parse error. - // If debugging is enabled, the SCRIPT_E_PROPAGATE may be returned - // if debugger is detached while an exception is being debugged. + // ActivePython returns SCRIPT_E_REPORTED if there was a parse error. + // If debugging is enabled, SCRIPT_E_PROPAGATE may be returned + // if the debugger is detached while an exception is being debugged. _ASSERTE(SUCCEEDED(hr) || hr == SCRIPT_E_REPORTED || hr == SCRIPT_E_PROPAGATE || m_pHardError); m_pSite->SetExecutionInfo(NULL); UninitializeDebugger(&info->dbgInfo); m_pShim->EndExecution(); - // cscript.exe doesn't call SetScriptState at all at the end of the execution. But it can - // afford not calling it because the process ends afterwards. We must deal with buggy - // engines and do need to uninitialize it. + // cscript.exe does not call SetScriptState at the end of execution. + // It can afford not to, because the process exits afterwards. We must handle + // buggy engines and explicitly uninitialize them. hr = m_pScript->SetScriptState(SCRIPTSTATE_INITIALIZED); _ASSERTE(SUCCEEDED(hr)); @@ -546,7 +548,7 @@ HRESULT CScriptInfo::AbortScript() // message boxes, exit GUI loops, cancel sleeps, break // enumerators etc.). - // Set the abort event, so the kernel waits can exit (e.g. + // Set the abort event so kernel wait operations can exit (e.g. // Salamander.Sleep()). _ASSERTE(m_hAbortEvent != NULL); SetEvent(m_hAbortEvent); @@ -574,13 +576,14 @@ void CScriptInfo::ScriptEnter() hwndPalette = m_pExecInfo->pAbortPalette->GetHwnd(); _ASSERTE(IsWindow(hwndPalette)); - // Make the main window inaccessible, since the script may display - // modeless window and the user can unload the whole plugin from - // the main window in the mean time. - // NOTE: 'hwndPalette' mechanism is not used because WS_EX_TOPMOST with process tree - // checking using WindowBelongsToProcessID() look like better solution for now. - // For example unpack script is starting several command prompt windows - // so WS_EX_TOPMOST toolbar is better accessible. + // Make the main window inaccessible because the script may display a + // modeless window, and the user could unload the entire plugin from + // the main window in the meantime. + // NOTE: The 'hwndPalette' mechanism is not used because WS_EX_TOPMOST with + // process-tree checking via WindowBelongsToProcessID() looks like a better + // solution for now. + // For example, the unpack script starts several command prompt windows, + // so a WS_EX_TOPMOST toolbar is more accessible. SalamanderGeneral->LockMainWindow(TRUE, NULL, SalamanderGeneral->LoadStr(g_hLangInst, IDS_MAINWINDOWLOCKED)); } } @@ -874,7 +877,7 @@ int CScriptLookup::FillContainer( if (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - if (fd.cFileName[0] != _T('.')) // exclude . and .. as well as unix style hidden dirs + if (fd.cFileName[0] != _T('.')) // exclude . and .. as well as Unix-style hidden directories { int cSubScripts = 0; CScriptContainer* pSubContainer; @@ -1135,8 +1138,8 @@ int CScriptLookup::GetUniquier( StringCchPrintf(szName, _countof(szName), "%06X", HashFromId(nHash)); if (!registry->OpenKey(hKey, szName, hkSub)) { - // the hash key does not even exist in the registry, - // return 1st available uniquier + // the hash key does not exist in the registry, + // return the first available uniquier m_bModified = true; return 0; } @@ -1173,7 +1176,7 @@ int CScriptLookup::GetUniquier( registry->CloseKey(hkSub); // the script path was not found in the registry, - // look if we can allocate a new uniquier for this path + // check whether we can allocate a new uniquifier for this path m_bModified = true; return bitmap.Alloc(); } @@ -1208,7 +1211,7 @@ int CScriptLookup::GetUniquier( return bitmap.Alloc(); } - // no uniquier for this hash yet, start counting at zero + // no uniquifier for this hash yet; start counting from zero return 0; } @@ -1257,9 +1260,9 @@ bool CScriptLookup::Refresh(bool bForce) if (GetTickCount() - m_dwLastRefreshTime < 5000 && !bForce) { - // ignore refresh request if it comes too early - // since the last one (this prevents excessive - // disk activity when user repeatedly runs a script) + // ignore the refresh request if it comes too soon + // after the last one (this prevents excessive + // disk activity when the user repeatedly runs a script) return true; } From f09abc62529dee5e2185bc6ca5177ae9bba72f2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 09:40:31 +0200 Subject: [PATCH 075/710] [tanslation] Fix src/plugins/automation/scriptlist.h comments Clarify the inline member comment for m_hAbortEvent in src/plugins/automation/scriptlist.h. The new wording identifies it as a manual-reset event and states that it is signaled when the user requests abort. This is a comment-only change. It does not alter class layout, member declarations, event handling, abort behavior, script execution, resources, or executable code. Model: OpenAI GPT-5.4 through Codex and GitHub Copilot. Copilot telemetry is reported in request units rather than token-priced USD cost. The run used 2 provider calls, 38,970 total tokens, 11,923 input tokens, 424 output tokens, and 2 copilot_request_units. Verification: ran the sequential review pipeline with full prompt and Copilot event logging; inspected apply results, generated draft, and final diff; ran git diff --check for the touched file; reran comment guard against the materialized checkout; guard passed with zero violations. --- src/plugins/automation/scriptlist.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/automation/scriptlist.h b/src/plugins/automation/scriptlist.h index 08b9bfe6a..da2f2b34b 100644 --- a/src/plugins/automation/scriptlist.h +++ b/src/plugins/automation/scriptlist.h @@ -70,7 +70,7 @@ class CScriptInfo IActiveScriptError* m_pHardError; bool m_bSiteErrorDisplayed; ///< Message box shown in site's OnScriptError. class CScriptEngineShim* m_pShim; - HANDLE m_hAbortEvent; ///< Manually reset event signaled when the user requested abort. + HANDLE m_hAbortEvent; ///< Manual-reset event signaled when the user requests abort. HWND m_hwndAbortTarget; // statistics stuff From d177a2675542d19f300f431919fe6735d9363576 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 09:47:24 +0200 Subject: [PATCH 076/710] [tanslation] Fix src/plugins/automation/scriptsite.cpp comments Improve reviewed script error handling comments in src/plugins/automation/scriptsite.cpp. The patch clarifies parsing-phase error wording, abort-palette deletion wording, and the S_OK return requirement for repeated JScript error callbacks. This is a comment-only change. It does not alter COM interfaces, exception handling, abort-palette deletion behavior, debugger callbacks, return values, resources, or executable code. Model: OpenAI GPT-5.4 through Codex and GitHub Copilot. Copilot telemetry is reported in request units rather than token-priced USD cost. The run used 2 provider calls, 37,034 total tokens, 16,331 input tokens, 2,730 output tokens, and 2 copilot_request_units. Verification: ran the sequential review pipeline with full prompt and Copilot event logging; inspected apply results, generated draft, and final diff; corrected an over-indented continuation comment during final review; ran git diff --check for the touched file; reran comment guard against the materialized checkout; guard passed with zero violations. --- src/plugins/automation/scriptsite.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/plugins/automation/scriptsite.cpp b/src/plugins/automation/scriptsite.cpp index 138652f72..1eb7f6b33 100644 --- a/src/plugins/automation/scriptsite.cpp +++ b/src/plugins/automation/scriptsite.cpp @@ -195,10 +195,10 @@ HRESULT CScriptSite::OnStateChange( HRESULT CScriptSite::OnScriptError( /* [in] */ __RPC__in_opt IActiveScriptError* pScriptError) { - // May be NULL if the error raises during the parsing phase. + // May be NULL if the error occurs during the parsing phase. if (m_pExecInfo != NULL) { - // The abort palette is no longer needed, hide it now. + // The abort palette is no longer needed; delete it now. delete m_pExecInfo->pAbortPalette; m_pExecInfo->pAbortPalette = NULL; } @@ -220,10 +220,10 @@ HRESULT CScriptSite::OnScriptError( FreeException(ei); - // Never ever try to return anything else than S_OK here. + // Never return anything other than S_OK here. // If JScript.dll returns CTL_E_OUTOFMEMORY because of infinite - // recursion (see Redmine #782 bug) it keeps calling OnScriptError - // again and again if we return anything else than S_OK. + // recursion (see Redmine #782), it keeps calling OnScriptError + // repeatedly unless we return S_OK. return S_OK; } @@ -382,10 +382,10 @@ HRESULT STDMETHODCALLTYPE CScriptSite::OnScriptErrorDebug( /* [out] */ BOOL* pfEnterDebugger, /* [out] */ BOOL* pfCallOnScriptErrorWhenContinuing) { - // May be NULL if the error raises during the parsing phase. + // May be NULL if the error occurs during the parsing phase. if (m_pExecInfo != NULL) { - // The abort palette is no longer needed, hide it now. + // The abort palette is no longer needed; delete it now. delete m_pExecInfo->pAbortPalette; m_pExecInfo->pAbortPalette = NULL; } From a93234daf362e751c6a44a14113d9aa8682df2b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 09:54:28 +0200 Subject: [PATCH 077/710] [tanslation] Fix src/plugins/automation/shim.cpp comments Improve reviewed comments in src/plugins/automation/shim.cpp. The patch clarifies source-position adjustment, abort reporting through COM exceptions, PHP engine workarounds, and Ruby interruption behavior while preserving Redmine #817 context. This is a comment-only change. It does not alter source-position adjustment, abort detection, PHP engine cleanup, Ruby interruption behavior, COM calls, return values, resources, or executable code. Model: OpenAI GPT-5.4 through Codex and GitHub Copilot. Copilot telemetry is reported in request units rather than token-priced USD cost. The run used 3 provider calls, 68,710 total tokens, 17,237 input tokens, 2,880 output tokens, and 2 copilot_request_units. Verification: ran the sequential review pipeline with full prompt and Copilot event logging; inspected apply results, generated draft, and final diff; ran git diff --check for the touched file; reran comment guard against the materialized checkout; guard passed with zero violations. --- src/plugins/automation/shim.cpp | 43 ++++++++++++++++----------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/src/plugins/automation/shim.cpp b/src/plugins/automation/shim.cpp index 2f3af3a00..1a54e2380 100644 --- a/src/plugins/automation/shim.cpp +++ b/src/plugins/automation/shim.cpp @@ -61,7 +61,7 @@ CScriptEngineShim* CScriptEngineShim::Create(CScriptInfo* pScript) void CScriptEngineShim::AdjustSourcePosition(LONG& linePos, LONG& columnPos) { // JScript and VBScript are zero-based, - // so threat this as default behavior + // so treat this as the default behavior. linePos += 1; columnPos += 1; } @@ -159,10 +159,10 @@ bool CScriptEngineShim::DisplayErrorHook(__in EXCEPINFO* ei, __in_opt BSTR src, UNREFERENCED_PARAMETER(src); UNREFERENCED_PARAMETER(bDebug); - // Some engines (Python, Ruby) does not report abortion thru our special - // SALAUT_E_ABORT we pass into the engine, instead they raise COM - // exception. Since this shim is general and should not influence - // anything, I decided to put it here in the base shim. + // Some engines (Python, Ruby) do not report aborts through the special + // SALAUT_E_ABORT we pass to the engine; instead, they raise a COM + // exception. Because this shim is general and should not affect + // anything else, handle it here in the base shim. if (ei && ei->scode == DISP_E_EXCEPTION && m_pScript->IsAbortPending()) { return false; @@ -193,8 +193,8 @@ CScriptEngineShim* CPhpScriptEngineShim::Create(CScriptInfo* pScript) void CPhpScriptEngineShim::AdjustSourcePosition(LONG& linePos, LONG& columnPos) { - // PHP starts counting lines from one and char position - // always sets to zero. + // PHP starts line numbering at one, and the char position + // is always zero. columnPos = -1; } @@ -206,14 +206,14 @@ HRESULT CPhpScriptEngineShim::ReleaseEngine(IActiveScript* pScript) // This is needed for the buggy PHP script engine to revoke // instance from the global interface table. hr = pScript->SetScriptSite(NULL); - // Behaved engines return E_POINTER, unlike PHP, which returns S_OK + // Well-behaved engines return E_POINTER, unlike PHP, which returns S_OK, // and ActivePython, which returns E_FAIL. _ASSERTE(SUCCEEDED(hr)); hr = ReleaseEngineCore(pScript, cRef); - // Workaround for the buggy PHP script engine - // to kill the script thread and delete the engine object + // Workaround for a PHP script engine bug: + // kill the script thread and delete the engine object if (cRef == 1) { cRef = pScript->Release(); @@ -275,9 +275,9 @@ CScriptEngineShim* CGlobalRubyScriptEngineShim::Create(CScriptInfo* pScript) void CGlobalRubyScriptEngineShim::AdjustSourcePosition(LONG& linePos, LONG& columnPos) { - // Ruby seems not using position information at all, - // both the line and column is always set to zero, - // the line number is mentioned in the description + // Ruby does not seem to use position information at all: + // both the line and column are always set to zero, + // and the line number is mentioned in the description // and is one-based. linePos = columnPos = -1; } @@ -303,18 +303,17 @@ void CGlobalRubyScriptEngineShim::Site_OnLeaveScript() HRESULT CGlobalRubyScriptEngineShim::InterruptScript(IActiveScript* pScript) { // Redmine #817: - // Calling InterruptScriptThread on Ruby engine is a suicidal mission. - // What is going on? + // Calling InterruptScriptThread on the Ruby engine is unsafe. + // Behavior observed: // 1. Ruby suspends the thread executing the script (i.e. Salamander's // main thread). // 2. It sets the thread context, forcing the instruction pointer to - // be address of the internal rb_raise function. + // the address of the internal rb_raise function. // 3. The engine resumes the thread. - // 4. The thread's context is completely messed up, executing the - // rb_raise function (which does longjmp according to search results - // on Google) without correctly unwinding the stack. - // I still cannot believe this. To make the long story short, we just - // prevent calling InterruptScriptThread when running Ruby script and - // we are leaving the script to be interrupted cooperatively. + // 4. The thread's context is corrupted, executing the rb_raise function + // (which reportedly calls longjmp) without correctly unwinding the + // stack. + // In short, prevent InterruptScriptThread from being called when running + // a Ruby script and let the script be interrupted cooperatively. return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED); } From cdfc404e521db03c423c3309a16890015ddb26a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 11:13:49 +0200 Subject: [PATCH 078/710] [tanslation] Fix src/plugins/dbviewer/csvlib/csvlib.cpp comments Update two comments in the DB Viewer CSV parser source. The FALSE description for the IsAlphaNumeric table now says that FALSE means the character is not a letter or digit. This keeps the original Czech meaning while using more natural English wording for the boolean lookup table. The UTF8 detection comment now uses the standard UTF-8 spelling. This is a comment-only terminology cleanup and does not alter the encoding detection logic, parser behavior, buffer handling, or any compiled code path. The change was produced by the comments translation review workflow with OpenAI GPT-5.4 through Codex and GitHub Copilot. Copilot usage was tracked as request units; this run consumed 2 Copilot request units. Provider telemetry for the run recorded 6 total calls and 137,133 total tokens. Verification completed with the sequential review pipeline using full prompt and Copilot event logging, manual inspection of the final git diff, git diff --check for the touched source file, and the comment guard rerun against the delivery checkout. The guard passed for src/plugins/dbviewer/csvlib/csvlib.cpp with no reported violations. --- src/plugins/dbviewer/csvlib/csvlib.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/dbviewer/csvlib/csvlib.cpp b/src/plugins/dbviewer/csvlib/csvlib.cpp index 5566aa52a..00e79ac86 100644 --- a/src/plugins/dbviewer/csvlib/csvlib.cpp +++ b/src/plugins/dbviewer/csvlib/csvlib.cpp @@ -21,7 +21,7 @@ #include "csvlib.h" // only an optimization detail -extern BOOL IsAlphaNumeric[256]; // TRUE/FALSE array for characters (FALSE = not a letter nor a digit) +extern BOOL IsAlphaNumeric[256]; // TRUE/FALSE array for characters (FALSE = not a letter or digit) extern BOOL IsAlpha[256]; #define SizeOf(x) (sizeof(x) / sizeof(x[0])) @@ -194,7 +194,7 @@ CCSVParser::CCSVParser(const char* filename, bIsBigEndian = BOM == 0xFFFE; } else - { // Detect UTF8 + { // Detect UTF-8 BYTE b[3]; fread(b, 1, 3, File); if (!memcmp(b, "\xEF\xBB\xBF", 3)) From 0ac2ce181b244467afc75f92bed9d513745dca99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 11:22:06 +0200 Subject: [PATCH 079/710] [tanslation] Fix src/plugins/dbviewer/csvlib/csvlib.h comments Update comments in the DB Viewer CSV parser header. The Name field comment now states that the pointer contains an allocated column name, or NULL when the column has no name. This removes the ambiguous pronoun from the previous wording while preserving the original Czech meaning. The SetLongerColumn comment block now describes the two behaviors more directly: it adds a column when the requested index does not exist yet, and it updates MaxLength only when the new length is greater than the current value. The return-value comments were kept aligned with that add/update behavior. This is a comment-only cleanup. It does not change the CCSVColumn layout, parser API, SetLongerColumn signature, column allocation behavior, length comparison behavior, or any compiled code path. The change was produced by the comments translation review workflow with OpenAI GPT-5.4 through Codex and GitHub Copilot. Copilot usage was tracked as request units; this run consumed 2 Copilot request units. Provider telemetry for the run recorded 2 total calls and 46,383 total tokens. Verification completed with the sequential review pipeline using full prompt and Copilot event logging, manual inspection of the final git diff, git diff --check for the touched source file, materializing the approved draft into the delivery checkout, and rerunning comment guard against that checkout. The guard passed for src/plugins/dbviewer/csvlib/csvlib.h with no reported violations. --- src/plugins/dbviewer/csvlib/csvlib.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/dbviewer/csvlib/csvlib.h b/src/plugins/dbviewer/csvlib/csvlib.h index 228ff0ae1..e3bfc692f 100644 --- a/src/plugins/dbviewer/csvlib/csvlib.h +++ b/src/plugins/dbviewer/csvlib/csvlib.h @@ -25,7 +25,7 @@ enum CCSVParserTextQualifier struct CCSVColumn { DWORD MaxLength; // maximum number of characters in the column - char* Name; // allocated column name or NULL if it does not exist + char* Name; // allocated column name, or NULL if the column has no name // temporary variables filled during FetchRecord DWORD First; DWORD Length; @@ -75,11 +75,11 @@ class CCSVParserCore : public CCSVParserBase virtual CCSVParserStatus FetchRecord(DWORD index) = 0; protected: - // if the column does not exist at columnIndex, add a new one with MaxLength = columnLen + // if the column at columnIndex does not exist yet, add a new one with MaxLength = columnLen // returns FALSE if the column could not be added to the array - // if the column already exists, extend columnLen only when it is larger than - // the current MaxLength value in that column - // returns TRUE if the addition/update of the column succeeded + // if the column already exists, set its MaxLength to columnLen only if it is greater than the + // current MaxLength value in that column + // returns TRUE if adding/updating the column succeeded BOOL SetLongerColumn(int columnIndex, DWORD columnLen); struct CLineRating From e12eac90f696894366497e4b1b324f6bfe665bf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 11:29:57 +0200 Subject: [PATCH 080/710] [tanslation] Fix src/plugins/dbviewer/data.h comments Update one DB Viewer data header comment. The IsOpened comment now states the behavior that the inline function actually implements: it returns TRUE when the database is open. The previous English text claimed that all variables were initialized, but the implementation only checks whether Parser is non-NULL. This is a comment-only cleanup. It does not change the IsOpened inline function, parser ownership, database open/close state management, object layout, or any compiled code path. The change was produced by the comments translation review workflow with OpenAI GPT-5.4 through Codex and GitHub Copilot. Copilot usage was tracked as request units; this run consumed 2 Copilot request units. Provider telemetry for the run recorded 3 total calls and 49,271 total tokens. Verification completed with the sequential review pipeline using full prompt and Copilot event logging, manual inspection of the final git diff, git diff --check for the touched source file, materializing the approved draft into the delivery checkout, and rerunning comment guard against that checkout. The guard passed for src/plugins/dbviewer/data.h with no reported violations. --- src/plugins/dbviewer/data.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/dbviewer/data.h b/src/plugins/dbviewer/data.h index b1fe5779e..fdf886fb1 100644 --- a/src/plugins/dbviewer/data.h +++ b/src/plugins/dbviewer/data.h @@ -65,7 +65,7 @@ class CDatabase BOOL Open(const char* fileName); void Close(); - // return TRUE if the database is open and all variables are initialized + // returns TRUE if the database is open BOOL IsOpened() { return Parser != NULL; } // "", "dbf", "csv" From fc5c40d5510d6df969cb4d23a3e4c5dd1181b23b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 11:40:20 +0200 Subject: [PATCH 081/710] [tanslation] Fix src/plugins/dbviewer/dbflib/dbflib.cpp comments Update comments in the DB Viewer DBF library implementation. The change cleans up five comments in dbflib.cpp. It clarifies the untested dBASE 5 version note, fixes the FoxPro character-field length explanation, makes the memo block-size offset note more explicit, repairs the malformed dBASE 3 memo-size comment, and rewrites the fake bufSize note in clearer English. The approved draft was manually touched only to fix indentation inside two multi-line block comments before the final guard run. No wording was changed outside the reviewed comment updates, and the alignment cleanup keeps the block comments readable without altering code. This is a comment-only cleanup. It does not change DBF version detection, FoxPro field length handling, memo block-size probing, memo item reading, buffer-size query behavior, file I/O, or any compiled code path. The change was produced by the comments translation review workflow with OpenAI GPT-5.4 through Codex and GitHub Copilot. Copilot usage was tracked as request units; this run consumed 10 Copilot request units. Provider telemetry for the run recorded 10 total calls and 216,165 total tokens. Verification completed with the sequential review pipeline using full prompt and Copilot event logging, manual inspection of the final git diff, git diff --check for the touched source file, materializing the approved draft into the delivery checkout, manual indentation cleanup for block comments, and rerunning comment guard against that checkout. The guard passed for src/plugins/dbviewer/dbflib/dbflib.cpp with no reported violations. --- src/plugins/dbviewer/dbflib/dbflib.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/plugins/dbviewer/dbflib/dbflib.cpp b/src/plugins/dbviewer/dbflib/dbflib.cpp index 5ec99ccf7..4686099b0 100644 --- a/src/plugins/dbviewer/dbflib/dbflib.cpp +++ b/src/plugins/dbviewer/dbflib/dbflib.cpp @@ -82,7 +82,7 @@ cDBF::cDBF(const char* filename, BOOL readOnly) : fields(NULL), status(DBFE_OK), break; /* Visual dBase Version 7 */ case 0x05: hdr.version = DBF_DBASE5; - break; /* Not tested. Does it exist? */ + break; /* Not tested; existence unconfirmed. */ case 0x83: hdr.version = DBF_DBASE3; break; /* III+ w/ memo */ @@ -226,8 +226,8 @@ cDBF::cDBF(const char* filename, BOOL readOnly) : fields(NULL), status(DBFE_OK), { hdr.memoFieldsCnt++; } - /* FoxPro files can contain character fields having upto 32KB - Then the high byte is stored where count of decimals is usually stored */ + /* FoxPro files can contain character fields up to 32 KB. + In that case, the high byte is stored where the decimal count is usually stored. */ if ((fld.type == DBF_FTYPE_CHAR) && (hdr.version == DBF_FOXPRO)) { fields[i].len += (U32)fld.decimal << 8; @@ -374,7 +374,7 @@ cDBF::cDBF(const char* filename, BOOL readOnly) : fields(NULL), status(DBFE_OK), { if (!tmp || (tmp == 0xE5 /*???dBase IV sample from Delphi???*/)) { /* dBase IV or V */ - /* On offset 20 there seems to be a block length; similar info might be on ofs 4 */ + /* At offset 20, there seems to be a block length; similar information might be at offset 4. */ fseek(fmemo, 20, SEEK_SET); if ((1 != fread(&memoBlockSize, 4, 1, fmemo)) || (memoBlockSize > 32768)) { @@ -571,15 +571,15 @@ eDBFStatus cDBF::GetMemoField(U32 pos, char* buffer, U32 bufSize, U32* dataSize) break; case DBF_DBASE3: - /* This weird old format never stores the actual size of memo items/ - We must read entire block and calculate the size. - The end of data is denoted b 1A 1A sequence */ + /* This old format never stores the actual size of memo items. + We must read the entire block and calculate the size. + The end of data is denoted by a 1A 1A sequence. */ { BOOL lookFor1a = FALSE; /* 1A 1A may be split into two blocks */ if (!buffer) { - /* Faking bufSize when enquiring needed buf size makes things simpler */ + /* Using a fake bufSize when querying the required buffer size simplifies things */ bufSize = 0x7FFFFFFF; } while (bufSize > 0) From b18044de9e25e0bee5d4688dfb1dca73d4f4b392 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 11:49:14 +0200 Subject: [PATCH 082/710] [tanslation] Fix src/plugins/dbviewer/dbflib/dbflib.h comments Update two DBF header structure comments. The DBF_HEADER recordSize comment now says that the field stores the total record size as in the master DBF file. This preserves the original meaning while using clearer English wording. The DBF_FIELD len comment now says total field length in bytes instead of the abbreviated total len wording. This makes the structure field description clearer without changing the field meaning. This is a comment-only cleanup. It does not change DBF_HEADER or DBF_FIELD layout, record-size interpretation, field-length interpretation, parser behavior, or any compiled code path. The change was produced by the comments translation review workflow with OpenAI GPT-5.4 through Codex and GitHub Copilot. Copilot usage was tracked as request units; this run consumed 8 Copilot request units. Provider telemetry for the run recorded 9 total calls and 205,632 total tokens. Verification completed with the sequential review pipeline using full prompt and Copilot event logging, manual inspection of the final git diff, git diff --check for the touched source file, materializing the approved draft into the delivery checkout, and rerunning comment guard against that checkout. The guard passed for src/plugins/dbviewer/dbflib/dbflib.h with no reported violations. --- src/plugins/dbviewer/dbflib/dbflib.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/dbviewer/dbflib/dbflib.h b/src/plugins/dbviewer/dbflib/dbflib.h index 473bfeb42..e510b6608 100644 --- a/src/plugins/dbviewer/dbflib/dbflib.h +++ b/src/plugins/dbviewer/dbflib/dbflib.h @@ -153,14 +153,14 @@ typedef struct _dbf_header U32 recordsCnt; /* total number of records in file */ U32 fieldsCnt; /* number of fields per record, including memo fields */ U32 memoFieldsCnt; /* number of memo fields per record */ - U32 recordSize; /* total size of record as in master DBF file */ + U32 recordSize; /* total record size as in the master DBF file */ U32 headerSize; /* total size of file header */ U32 codePage; /* codepage of DBF_FLDTYPE_CHAR fields */ } DBF_HEADER, *DBF_HEADER_PTR; typedef struct _dbf_field { - U32 len; /* total len of field in bytes */ + U32 len; /* total field length in bytes */ U32 decimals; /* count of decimal digits */ U32 posInRecord; /* position of field in record */ U8 type; /* see DBF_FTYPE_XXX */ From c727322693e4d7931c1c58863332475f930cfb38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 11:58:58 +0200 Subject: [PATCH 083/710] [tanslation] Fix src/plugins/dbviewer/dbviewer.cpp comments Update comments in the DB Viewer plugin implementation. The change cleans up five comments in dbviewer.cpp. It clarifies the unfinished enablers TODO, fixes zero-based index wording, preserves and standardizes the LR_SHARED icon lifetime warning, rewrites the rebar redraw workaround explanation, and simplifies the short new-name comment. One reviewed rewrite was manually adjusted before the final guard run to keep the explicit LR_SHARED technical detail. The adjustment is still comment-only and keeps the intended warning precise. This is a comment-only cleanup. It does not change plugin naming, menu or toolbar data, icon loading, viewer thread behavior, window resizing, file-name update logic, or any compiled code path. The change was produced by the comments translation review workflow with OpenAI GPT-5.4 through Codex and GitHub Copilot. Copilot usage was tracked as request units; this run consumed 4 Copilot request units. Provider telemetry for the run recorded 8 total calls and 116,433 total tokens. Verification completed with the sequential review pipeline using full prompt and Copilot event logging, manual inspection of the final git diff, git diff --check for the touched source file, materializing the approved draft into the delivery checkout, manual preservation of the LR_SHARED detail, and rerunning comment guard against that checkout. The guard passed for src/plugins/dbviewer/dbviewer.cpp with no reported violations. --- src/plugins/dbviewer/dbviewer.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/plugins/dbviewer/dbviewer.cpp b/src/plugins/dbviewer/dbviewer.cpp index f8f667469..a4408c824 100644 --- a/src/plugins/dbviewer/dbviewer.cpp +++ b/src/plugins/dbviewer/dbviewer.cpp @@ -16,7 +16,7 @@ const char* READABLE_EN_PLUGIN_NAME = "Database Viewer"; /* -TODO: enabler sketch; Salamander needs to implement the offset method (enablersOffset) +TODO: unfinished enablers; Salamander needs to implement the offset method (enablersOffset) also add a comment for this variable in SPL_GUI.H introduce it in DBVIEWER.CPP and DEMOPLUG.CPP, where enablers are global for windows from multiple threads -> conflict */ @@ -197,7 +197,7 @@ MENU_TEMPLATE_ITEM PopupMenuTemplate[] = struct CButtonData { - int ImageIndex; // zero base index + int ImageIndex; // zero-based index WORD ToolTipResID; // resource ID with the tooltip string WORD ID; // universal command CViewerWindowEnablerEnum Enabler; // control variable used to enable the button @@ -657,7 +657,7 @@ unsigned WINAPI ViewerThreadBody(void* param) window) != NULL) { CALL_STACK_MESSAGE1("ViewerThreadBody::ShowWindow"); - // NOTE! icons obtained without the LR_SHARED flag must be destroyed in WM_DESTROY + // NOTE: icons obtained without LR_SHARED must be destroyed in WM_DESTROY. SendMessage(window->HWindow, WM_SETICON, ICON_BIG, (LPARAM)LoadIcon(DLLInstance, MAKEINTRESOURCE(IDI_MAIN))); SendMessage(window->HWindow, WM_SETICON, ICON_SMALL, @@ -1220,9 +1220,9 @@ CViewerWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) HDWP hdwp = BeginDeferWindowPos(2); if (hdwp != NULL) { - // +4: when increasing the window width the last 4 pixels of the rebar were not redrawn - // in the rebar; even after hours I could not find the reason; it works in Salamander; - // for now this workaround will do; maybe I'll remember the problem later + // +4: when increasing the window width, the last 4 pixels of the rebar were not redrawn + // in the rebar; even after several hours I did not find the cause; it works in Salamander; + // using this workaround for now; the cause may become clear later hdwp = DeferWindowPos(hdwp, HRebar, NULL, 0, 0, r.right + 4, rebarHeight, SWP_NOACTIVATE | SWP_NOZORDER); @@ -1505,7 +1505,7 @@ CViewerWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) } if (ok) - { // we've got a new name + { // new name received if (!openedFileName || !*openedFileName || _stricmp(fileName, openedFileName)) { From d97a56cf5e2eae0f5404e22504b208f2d799d110 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 12:47:56 +0200 Subject: [PATCH 084/710] [tanslation] Fix dbviewer.h comments (#455) --- src/plugins/dbviewer/dbviewer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/dbviewer/dbviewer.h b/src/plugins/dbviewer/dbviewer.h index 25216e6db..f451c7fbe 100644 --- a/src/plugins/dbviewer/dbviewer.h +++ b/src/plugins/dbviewer/dbviewer.h @@ -109,7 +109,7 @@ enum CViewerWindowEnablerEnum class CViewerWindow : public CWindow { public: - HANDLE Lock; // 'lock' object or NULL (goes to the signaled state once the file is closed) + HANDLE Lock; // 'lock' object or NULL (becomes signaled only after the file is closed) CRendererWindow Renderer; int ConversionsCount; // number of conversions retrieved including "Don't convert"; without separators CCSVConfig CfgCSV; @@ -124,7 +124,7 @@ class CViewerWindow : public CWindow HIMAGELIST HHotToolBarImageList; // toolbar and menu in a colored variant DWORD Enablers[vweCount]; - BOOL IsSrcFileSelected; // valid only if Enablers[vweSelSrcFile]==TRUE: TRUE/FALSE source file is selected/unselected + BOOL IsSrcFileSelected; // valid only if Enablers[vweSelSrcFile]==TRUE: TRUE/FALSE means the source file is selected/unselected public: CViewerWindow(int enumFilesSourceUID, int enumFilesCurrentIndex); From 8781af9ba22e193be0c8e064cc915dfc869a6910 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 12:58:47 +0200 Subject: [PATCH 085/710] [tanslation] Fix parser.h comment (#456) --- src/plugins/dbviewer/parser.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/dbviewer/parser.h b/src/plugins/dbviewer/parser.h index 03cc9afb6..2c21674fb 100644 --- a/src/plugins/dbviewer/parser.h +++ b/src/plugins/dbviewer/parser.h @@ -26,7 +26,7 @@ bool IsUTF8Encoded(const char* s, int cnt); struct CFieldInfo { - char* Name; // if NULL, the required length is stored into NameMax + char* Name; // if Name is NULL, the required length is stored in NameMax int NameMax; // if Name != NULL, specifies the buffer size (NameMax equals the number of characters plus the terminator) BOOL LeftAlign; // where the text should be aligned when displayed int TextMax; // maximum number of characters shown in this column; -1 if unknown to the parser From cd9bf5674ec3e2fae15a0edbfaf7ad5b714b5318 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 13:00:25 +0200 Subject: [PATCH 086/710] [tanslation] Fix dialogs comments (#457) --- src/plugins/dbviewer/dialogs.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/dbviewer/dialogs.cpp b/src/plugins/dbviewer/dialogs.cpp index 0274951c6..4eb1832fc 100644 --- a/src/plugins/dbviewer/dialogs.cpp +++ b/src/plugins/dbviewer/dialogs.cpp @@ -815,9 +815,9 @@ void CFindDialog::Transfer(CTransferInfo& ti) FIND_HISTORY_SIZE, FindHistory); /* if (ti.Type == ttDataToWindow) - { // initialize the searched text according to the selection in the viewer (parent of this dialog) + { // initialize the search text from the selection in the viewer (the parent of this dialog) CWindowsObject *win = WindowsManager.GetWindowPtr(Parent); - if (win != NULL && win->Is(otViewerWindow)) // double-check that this is a viewer window + if (win != NULL && win->Is(otViewerWindow)) // make sure this is a viewer window { CViewerWindow *view = (CViewerWindow *)win; char buf[FIND_TEXT_LEN]; From 6312bec420c447fe6ef322669499b04dd7bb026d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 13:02:48 +0200 Subject: [PATCH 087/710] [tanslation] Fix parser comments (#458) --- src/plugins/dbviewer/parser.cpp | 40 ++++++++++++++++----------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/plugins/dbviewer/parser.cpp b/src/plugins/dbviewer/parser.cpp index a9433fa5e..5072968b7 100644 --- a/src/plugins/dbviewer/parser.cpp +++ b/src/plugins/dbviewer/parser.cpp @@ -86,7 +86,7 @@ bool IsUTF8Encoded(const char* s, int cnt) } if (nUTF8 > 0) - { // At least one 2-or-more-bytes UTF8 sequence found and no invalid sequences found + { // At least one UTF-8 sequence of 2 or more bytes found and no invalid sequences found return true; } return false; @@ -95,10 +95,10 @@ bool IsUTF8Encoded(const char* s, int cnt) void CParserInterfaceAbstract::ShowParserError(HWND hParent, CParserStatusEnum status) { if (this != NULL) - { // this is NULL when called from CDatabase::Open when opening the file failed + { // this is NULL when called from CDatabase::Open if opening the file failed if (bShowingError) { - // Avoid recursive error showing on WM_PAINT + // Avoid recursive error display on WM_PAINT return; } bShowingError = true; @@ -496,7 +496,7 @@ char* Int64ToCurrency(char* buffer, __int64 number) else { DecimalSeparatorLen--; - DecimalSeparator[DecimalSeparatorLen] = 0; // ensure a zero terminator at the end + DecimalSeparator[DecimalSeparatorLen] = 0; // ensure a null terminator at the end } */ // other DBF values use '.' as the decimal separator, so we do not use the system one @@ -528,12 +528,12 @@ void TimeStampToDate(int jdays, int* pDay, int* pMon, int* pYear, BOOL bJulianDa } else { - // old code assuming it was number of Julian days (since 1.1.4713 BC) - // 1.1.1993 is claimed to be Julian Day 2448989 - // get the number of days since 1.1.1600 (jday == 1 means 1.1.1600) + // Old code assumed this was the number of Julian days (since 1.1.4713 BC). + // 1.1.1993 is claimed to be Julian Day 2448989. + // Get the number of days since 1.1.1600 (jday == 1 means 1.1.1600). if (jdays < 2448989 - 93 * 365 - 23 - 3 * 100 * 365 - 2 * 24 - 25) { - // Before 1.1. 1600. We do no support Julian calendar introduced AFAIR around 1584 + // Before 1.1.1600. The Julian calendar, introduced around 1584, is not supported. return; } // get the number of days since 1.1.1600 (jday == 1 means 1.1.1600 @@ -617,8 +617,8 @@ CParserInterfaceDBF::GetCellText(DWORD index, size_t* textLen) case DBF_FTYPE_INT: { - // Patera 2003.06.05: Why was there short int? - // FoxPro is supposed to use this type as 32bit int! + // Patera 2003.06.05: Why was this a short int? + // FoxPro is supposed to use this type as a 32-bit int sprintf(Buffer, "%d", *((int*)text)); *textLen = strlen(Buffer); return Buffer; @@ -627,9 +627,9 @@ CParserInterfaceDBF::GetCellText(DWORD index, size_t* textLen) case DBF_FTYPE_AUTOINC: case DBF_FTYPE_INT_V7: { // Used by Visual dBase 7: - // The DOC: left-most bit used for sign, 0 means negative - // Observation: Seems to be big-endian. - // Wow! Got it! Its for faster string-based comparison (for indexing)! + // The documentation says the leftmost bit is used for the sign; 0 means negative. + // Observation: seems to be big-endian. + // This is probably for faster string-based comparison (for indexing). UINT32 val = LongSwap(*(int*)text); sprintf(Buffer, "%u", val ? (val ^ 0x80000000) : 0); @@ -671,9 +671,9 @@ CParserInterfaceDBF::GetCellText(DWORD index, size_t* textLen) } case DBF_FTYPE_DTIME: - { // Visual FoxPro DateTime field: 8BYTE type: - // Lower 4 bytes: Julian day (since 1/1/4713 BC) - // Higher 4 bytes: time in miliseconds + { // Visual FoxPro DateTime field: 8-byte value: + // Lower 4 bytes: Julian day (since 1/1/4713 BC) + // Upper 4 bytes: time in milliseconds int day, mon, year, jd; int hour, min, sec; __int64 tmp64; @@ -702,7 +702,7 @@ CParserInterfaceDBF::GetCellText(DWORD index, size_t* textLen) case DBF_FTYPE_CHAR: { const void* zero = memchr(text, 0, field->len); - // ignore terminating binary zeros + // ignore trailing zero bytes *textLen = zero ? ((char*)zero - text) : field->len; return text; } @@ -713,8 +713,8 @@ CParserInterfaceDBF::GetCellText(DWORD index, size_t* textLen) __int64 tmp64; UINT32 tmp[2]; - // according to dBase doc, this type consists of two 32bits, number of days since 1/1/4713BC and miliseconds - // VCL takes it as double whose integer part is number of miliseconds since 1/1/1 + // According to the dBase documentation, this type consists of two 32-bit values: the number of days since 1/1/4713 BC and milliseconds. + // VCL treats it as a double whose integer part is the number of milliseconds since 1/1/1. // convert from big-endian to little-endian and again, as for long & autoinc, flip the sign tmp[1] = LongSwap(*(UINT32*)text); @@ -877,7 +877,7 @@ CParserInterfaceCSV::OpenFile(const char* fileName) { WORD w; fread(&w, 1, 2, f); - IsUnicode = (w == 0xFEFF) || (w == 0xFFFE); // UTFE16 LE & BE BOM's + IsUnicode = (w == 0xFEFF) || (w == 0xFFFE); // UTF-16 LE and BE BOMs // CP_UTF8 if (w == 0xBBEF) { From 471119462159eaaaaa5f9a851552c583b43d3b87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 13:04:02 +0200 Subject: [PATCH 088/710] [tanslation] Fix renderer comments (#459) --- src/plugins/dbviewer/renderer.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/plugins/dbviewer/renderer.h b/src/plugins/dbviewer/renderer.h index 591199c97..8e8463a10 100644 --- a/src/plugins/dbviewer/renderer.h +++ b/src/plugins/dbviewer/renderer.h @@ -96,7 +96,7 @@ class CSelection return FocusX == AnchorX && FocusY == AnchorY; } - // return TRUE if cell [x,y] had a different state in oldSelection + // return TRUE if cell [x,y] had a different state in the old selection BOOL Changed(const CSelection* old, int x, int y) { // if the selection state changed @@ -233,7 +233,7 @@ class CRendererWindow : public CWindow char DefaultCoding[210]; BOOL UseCodeTable; // should the CodeTable be used for recoding? // CodeTable matters only when UseCodeTable is TRUE - char CodeTable[256]; // translation table + char CodeTable[256]; // encoding table protected: int EnumFilesSourceUID; // source UID for enumerating viewer files @@ -301,17 +301,17 @@ class CRendererWindow : public CWindow BOOL HitTest(int x, int y, int* column, int* row, BOOL getNearest); BOOL HitTestRow(int y, int* row, BOOL getNearest); BOOL HitTestColumn(int x, int* column, BOOL getNearest); - // return TRUE if x is approximately above a divider between columns - // column and offset can be NULL + // returns TRUE if x is approximately over a column divider + // column and offset may be NULL BOOL HitTestColumnSplit(int x, int* column, int* offset); // start editing the cell under the focus // void OnEditCell(); - // find the column with the visibleIndex; if found, - // set index according to its position in Database.Column and xPos to - // its X coordinate and return TRUE; - // otherwise return FALSE + // finds the column with index visibleIndex and, if found, + // sets index to its position in Database.Column and xPos to + // its X coordinate, then returns TRUE + // otherwise returns FALSE BOOL GetColumnInfo(int visibleIndex, int* index, int* xPos); // enable/disable the timer and state variables during block dragging @@ -330,7 +330,7 @@ class CRendererWindow : public CWindow // prepare the buffer and let Salamander detect the code page void RecognizeCodePage(); - // convert characters in the text buffer + // converts characters in the text buffer void CodeCharacters(char* text, size_t textLen); void SetViewerTitle(); From cd328aa05ff51f8cd8b4f7358fdac79fefc5fb86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 13:05:08 +0200 Subject: [PATCH 089/710] [tanslation] Fix renmain comments (#460) --- src/plugins/dbviewer/renmain.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/dbviewer/renmain.cpp b/src/plugins/dbviewer/renmain.cpp index 3cb8bf30b..66e838ee0 100644 --- a/src/plugins/dbviewer/renmain.cpp +++ b/src/plugins/dbviewer/renmain.cpp @@ -16,7 +16,7 @@ #define TIMER_SCROLL_ID 1 -BOOL IsAlphaNumeric[256]; // TRUE/FALSE table for characters (FALSE = neither a letter nor a digit) +BOOL IsAlphaNumeric[256]; // TRUE/FALSE array for characters (FALSE = not a letter or digit) BOOL IsAlpha[256]; //**************************************************************************** @@ -514,7 +514,7 @@ void CRendererWindow::Find(BOOL forward, BOOL wholeWords, { const CDatabaseColumn* column = Database.GetVisibleColumn(col); - // too narrow columns are not searched in non-regexp mode + // columns that are too narrow are not searched in non-regexp mode // other possible optimizations: do not search DBF_FTYPE_INT_V7, // DBF_FTYPE_TSTAMP, DBF_FTYPE_AUTOINC & DBF_FTYPE_DOUBLE columns if // the search pattern contains non-numeric characters @@ -541,7 +541,7 @@ void CRendererWindow::Find(BOOL forward, BOOL wholeWords, LPCWSTR textW = Database.GetCellTextW(column, &textLen); textLen = WideCharToMultiByte(CP_ACP, WC_COMPOSITECHECK, textW, (int)textLen, buf, bufSize, NULL, NULL); if (textLen < 0) - textLen = 0; // Error - swallow it ;-) + textLen = 0; // ignore the error text = buf; } do @@ -580,7 +580,7 @@ void CRendererWindow::Find(BOOL forward, BOOL wholeWords, } return; } - } // of if (!bmSearchData || (column->Length >= patLen)) + } // end of if (!bmSearchData || (column->Length >= patLen)) } if (forward) @@ -949,7 +949,7 @@ BOOL CRendererWindow::HitTestColumnSplit(int x, int* column, int* offset) { if (i > 0 && x >= colX - 3 && x <= colX) { - // if this is not the left edge of the first column and the point overlaps a divider, we found it + // if this is not the left edge of the first column and the point is within a divider range, we found it if (column != NULL) *column = i - 1; if (offset != NULL) @@ -1495,7 +1495,7 @@ CRendererWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) return 0; } - if (uMsg == WM_MOUSEHWHEEL) // horizontall scroll, supported from Windows Vista + if (uMsg == WM_MOUSEHWHEEL) // horizontal scroll, supported from Windows Vista { short zDelta = (short)HIWORD(wParam); if ((zDelta < 0 && MouseHWheelAccumulator > 0) || (zDelta > 0 && MouseHWheelAccumulator < 0)) From 0bf200c72930666860d076401222188037194f45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 13:37:04 +0200 Subject: [PATCH 090/710] [tanslation] Fix src/plugins/7zip/7zclient.cpp comments (#461) --- src/plugins/7zip/7zclient.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/plugins/7zip/7zclient.cpp b/src/plugins/7zip/7zclient.cpp index 0bdc4209f..c98af3dd3 100644 --- a/src/plugins/7zip/7zclient.cpp +++ b/src/plugins/7zip/7zclient.cpp @@ -191,7 +191,7 @@ BOOL C7zClient::FillItemData(IInArchive* archive, UINT32 index, C7zClient::CItem else itemData->SetMethod(GetAnsiString(propVariant.bstrVal)); - /* // 06F10701 is the id for 7zAES -> so it's the password :) + /* // 06F10701 is the ID for 7zAES, i.e. encryption // if (strstr(itemData->Method, "06F10701") != NULL) if (strstr(itemData->Method, "7zAES") != NULL) itemData->Encrypted = TRUE; @@ -271,7 +271,7 @@ BOOL C7zClient::AddFileDir(IInArchive* archive, UINT32 idx, } fd.PluginData = (DWORD_PTR)itemData; - // Creation Time + // Modification Time archive->GetProperty(idx, kpidMTime, &propVariant); fd.LastWrite = propVariant.filetime; @@ -333,7 +333,7 @@ BOOL C7zClient::AddFileDir(IInArchive* archive, UINT32 idx, // file length archive->GetProperty(idx, kpidSize, &propVariant); ::ConvertPropVariantToUInt64(propVariant, fd.Size.Value); - // What is better? Check on *.lnk/pif/url extensions or Unix flags or both? We do both. + // Which is better? Checking *.lnk/pif/url extensions, Unix flags, or both? We do both. fd.IsLink |= SalamanderGeneral->IsFileLink(fd.Ext); // file @@ -535,7 +535,7 @@ int C7zClient::GetArchiveItemList(IInArchive* archive, TIndirectArrayGetProperty(i, kpidMTime, &propVariant); FILETIME lastWrite = propVariant.filetime; @@ -706,7 +706,7 @@ int C7zClient::Delete(CSalamanderForOperationsAbstract* salamander, const char* updateCallbackSpec->Password = password; updateCallbackSpec->AskPassword = passwordIsDefined; - // TODO: what about delete? is it possible to load compression parameters? and do they even need to be set? + // TODO: what about delete? Can the compression parameters be loaded, and do they need to be set at all? // SetCompressionParams(outArchive, compr); // start update in a thread @@ -1079,7 +1079,7 @@ int C7zClient::Update(CSalamanderForOperationsAbstract* salamander, const char* CCompressParams* compressParams, bool passwordIsDefined, UString password) { char tmpName[MAX_PATH]; - // trim the filename from archiveName, leaving the target path where we will extract + // strip the filename from archiveName, leaving the target path where we will extract lstrcpy(tmpName, archiveName); SalamanderGeneral->CutDirectory(tmpName, NULL); DWORD err; @@ -1226,9 +1226,9 @@ int C7zClient::Update(CSalamanderForOperationsAbstract* salamander, const char* // else { if (FAILED(result) && ((FACILITY_WIN32 << 16) == (result & 0x7FFF0000))) { - // LastError error encoded into HRESULT - // There is something strange: E_OUTOFMEMORY as 0x8007000EL prints as "Not enough storage is available to complete this operation" - // even when not truncated to 16 bits while 0x80000002L prints as "Ran out of memory" + // LastError encoded as HRESULT + // Oddly, E_OUTOFMEMORY as 0x8007000EL prints as "Not enough storage is available to complete this operation" + // even without truncating to 16 bits, while 0x80000002L prints as "Ran out of memory" SysError(IDS_7Z_FATAL_ERROR, (result == E_OUTOFMEMORY) ? 0x80000002L : (result & 0xFFFF), FALSE); } else From 65558285f895bda367f8925689cc0944c933b605 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 13:41:57 +0200 Subject: [PATCH 091/710] [tanslation] Fix src/plugins/7zip/7zclient.h comments (#462) --- src/plugins/7zip/7zclient.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/7zip/7zclient.h b/src/plugins/7zip/7zclient.h index d6bacc18b..573b45ef6 100644 --- a/src/plugins/7zip/7zclient.h +++ b/src/plugins/7zip/7zclient.h @@ -33,10 +33,10 @@ #define S_ISLNK(m) (((m) & 0170000) == 0120000) /* symbolic link */ #endif -// three states for errors. -// there are situations where TRUE/FALSE is not enough. we have an activity that can run into an error. sometimes we can -// and want to continue the activity, other times we cannot. if we can continue we return OPER_CONTINUE, -// if it cannot go on (out of memory, etc.) -> OPER_CANCEL. if everything is fine -> OPER_OK +// three error states. +// there are situations where TRUE/FALSE is not enough. we have an operation that can encounter an error. sometimes we can +// and want to continue the operation, other times we cannot. if we can continue, we return OPER_CONTINUE, +// if continuing is not possible (out of memory, etc.) -> OPER_CANCEL. if everything is OK -> OPER_OK #define OPER_OK 0 #define OPER_CONTINUE 1 #define OPER_CANCEL 2 From 181d25f8d97a5625e8f7ec9b5f094645db21f755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 13:51:29 +0200 Subject: [PATCH 092/710] [tanslation] Fix src/plugins/7zip/7zip.cpp comments (#463) --- src/plugins/7zip/7zip.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/plugins/7zip/7zip.cpp b/src/plugins/7zip/7zip.cpp index d00ff7a2e..a8897b8a1 100644 --- a/src/plugins/7zip/7zip.cpp +++ b/src/plugins/7zip/7zip.cpp @@ -54,7 +54,7 @@ int ConfigVersion = 0; // 2: ? // 3: Igor changed the default values for LZMA compression (dictionary size, etc.). There are more changes, // so Honza Patera and I agreed that when importing old configurations we will -// ignore compression settings and use the new defaults instead. +// ignore the compression settings and use these new defaults. #define CURRENT_CONFIG_VERSION 3 const char* CONFIG_VERSION = "Version"; @@ -139,12 +139,12 @@ CPluginInterfaceAbstract* WINAPI SalamanderPluginEntry(CSalamanderPluginEntryAbs { // reject older versions MessageBox(salamander->GetParentWindow(), REQUIRE_LAST_VERSION_OF_SALAMANDER, - "7-Zip" /* neprekladat! */, MB_OK | MB_ICONERROR); + "7-Zip" /* do not translate */, MB_OK | MB_ICONERROR); return NULL; } // load the language module (.slg) - HLanguage = salamander->LoadLanguageModule(salamander->GetParentWindow(), "7-Zip" /* neprekladat! */); + HLanguage = salamander->LoadLanguageModule(salamander->GetParentWindow(), "7-Zip" /* do not translate */); if (HLanguage == NULL) return NULL; @@ -444,7 +444,7 @@ void CPluginInterface::LoadConfiguration(HWND parent, HKEY regKey, CSalamanderRe { CALL_STACK_MESSAGE1("CPluginInterface::LoadConfiguration(, ,)"); - if (regKey != NULL) // load from registry + if (regKey != NULL) // load from the registry { if (!registry->GetValue(regKey, CONFIG_VERSION, REG_DWORD, &ConfigVersion, sizeof(DWORD))) ConfigVersion = 0; // default configuration @@ -457,7 +457,7 @@ void CPluginInterface::LoadConfiguration(HWND parent, HKEY regKey, CSalamanderRe // set config defaults SetDefaultConfiguration(); - if (regKey != NULL) // load from registry + if (regKey != NULL) // load from the registry { registry->GetValue(regKey, CONFIG_SHOW_EXTENDED_OPTIONS, REG_DWORD, &Config.ShowExtendedOptions, sizeof(DWORD)); registry->GetValue(regKey, CONFIG_EXTENDED_LIST_INFO, REG_DWORD, &Config.ExtendedListInfo, sizeof(DWORD)); @@ -471,7 +471,7 @@ void CPluginInterface::LoadConfiguration(HWND parent, HKEY regKey, CSalamanderRe if (ConfigVersion >= 1) { - // compress params + // compression params registry->GetValue(regKey, CONFIG_SOLID_ARCHIVE, REG_DWORD, &Config.CompressParams.SolidArchive, sizeof(DWORD)); if (registry->GetValue(regKey, CONFIG_COMPRESS_METHOD, REG_DWORD, &Config.CompressParams.Method, sizeof(DWORD)) && (Config.CompressParams.Method != CCompressParams::LZMA || ConfigVersion >= 3)) // for configuration version 3 we reset the defaults for LZMA because they differ @@ -502,7 +502,7 @@ void CPluginInterface::SaveConfiguration(HWND parent, HKEY regKey, CSalamanderRe registry->SetValue(regKey, CONFIG_COL_METHOD_WIDTH, REG_DWORD, &Config.ColumnMethodWidth, sizeof(DWORD)); // config version == 2 - // compress params + // compression params registry->SetValue(regKey, CONFIG_COMPRESS_LEVEL, REG_DWORD, &Config.CompressParams.CompressLevel, sizeof(DWORD)); registry->SetValue(regKey, CONFIG_COMPRESS_METHOD, REG_DWORD, &Config.CompressParams.Method, sizeof(DWORD)); registry->SetValue(regKey, CONFIG_DICT_SIZE, REG_DWORD, &Config.CompressParams.DictSize, sizeof(DWORD)); @@ -532,8 +532,8 @@ void CPluginInterface::Connect(HWND parent, CSalamanderConnectAbstract* salamand // when adding more extensions we must raise CURRENT_CONFIG_VERSION // BASIC SECTION - // AddViewer and AddPanelArchiver will fall under the UPGRADE SECTION - // salamander->AddViewer("*.7z", FALSE); // default (plugin install), otherwise Salamander ignores it + // AddViewer and AddPanelArchiver are handled by the UPGRADE SECTION + // salamander->AddViewer("*.7z", FALSE); // default (plugin installation), otherwise Salamander ignores it salamander->AddPanelArchiver("7z", TRUE, FALSE); @@ -969,7 +969,7 @@ BOOL CPluginInterfaceForArchiver::PackToArchive(CSalamanderForOperationsAbstract CALL_STACK_MESSAGE5("CPluginInterfaceForArchiver::PackToArchive(, %s, %s, %d, %s, ,)", fileName, archiveRoot, move, sourcePath); - // test whether the archive exists (we need to distinguish between update and create new archive) + // test whether the archive exists (we need to distinguish between updating and creating a new archive) BOOL isNewArchive = FALSE; HANDLE hArchive = ::CreateFile(fileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (hArchive == INVALID_HANDLE_VALUE) @@ -1059,7 +1059,7 @@ BOOL CPluginInterfaceForArchiver::PackToArchive(CSalamanderForOperationsAbstract // count how many items we will compress // (we could use a growing array right away, but with a large number it would fragment memory, and iterating the list twice - // will not kill us) + // is acceptable) int itemCount = 0; while ((name = next(SalamanderGeneral->GetMsgBoxParent(), 3, &dosName, &isDir, &size, &attr, &lastWrite, nextParam, &errorOccured)) != NULL) @@ -1111,7 +1111,7 @@ BOOL CPluginInterfaceForArchiver::PackToArchive(CSalamanderForOperationsAbstract { // first lock the archive file so we cannot delete it ourselves (bug: https://forum.altap.cz/viewtopic.php?f=3&t=3859) while (1) { - hArchive = ::CreateFile(fileName, GENERIC_READ /* I tried 0, but the system then allowed deleting the file */, + hArchive = ::CreateFile(fileName, GENERIC_READ /* Using 0 was tested, but then the system allowed the file to be deleted */, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); @@ -1180,7 +1180,7 @@ BOOL CPluginInterfaceForArchiver::PackToArchive(CSalamanderForOperationsAbstract } int endSourceSize = MAX_PATH - (int)(endSource - sourceName); // maximum number of characters for a name from the 'next' enumeration - // delete directories; if something remains inside they will not be removed and that's fine :) + // delete directories; if something remains inside, they will not be removed, which is correct // because we iterate from leaves to the root, we can delete them this way next(NULL, -1, NULL, NULL, NULL, NULL, NULL, nextParam, NULL); while ((name = next(NULL /* we do not log errors the second time */, 3, &dosName, &isDir, &size, @@ -1287,7 +1287,7 @@ CPluginInterfaceForViewer::ViewFile(const char *name, int left, int top, int wid "0x%X, %d, %d, , , , %d, %d)", name, left, top, width, height, showCmd, alwaysOnTop, returnLock, enumFilesSourceUID, enumFilesCurrentIndex); - // we do not set 'lock' or 'lockOwner'; we only need the lifetime of the file 'name' + // we do not set 'lock' or 'lockOwner'; we only need the file 'name' to remain valid // within this method HCURSOR hOldCur = SetCursor(LoadCursor(NULL, IDC_WAIT)); @@ -1313,7 +1313,7 @@ CPluginInterfaceForViewer::ViewFile(const char *name, int left, int top, int wid int err; CSalamanderPluginInternalViewerData viewerData; - // create a temporary file and pour the module dump into it + // create a temporary file and write the module dump to it FILE *outStream = fopen(tempFileName, "w"); if (!image->DumpInfo(outStream)) { @@ -1322,7 +1322,7 @@ CPluginInterfaceForViewer::ViewFile(const char *name, int left, int top, int wid fclose(outStream); delete image; - // hand the file over to Salamander - it moves it to cache and deletes it when it is done + // hand the file over to Salamander - it moves it to the cache and deletes it when it no longer uses it viewerData.Size = sizeof(viewerData); viewerData.FileName = tempFileName; viewerData.Mode = 0; // text mode From 6c2fdfd8e0ce659d231b5698a7b6ff11728095dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 13:56:36 +0200 Subject: [PATCH 093/710] [tanslation] Fix src/plugins/7zip/7zthreads.cpp comments (#464) --- src/plugins/7zip/7zthreads.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/7zip/7zthreads.cpp b/src/plugins/7zip/7zthreads.cpp index 44f043e12..30258e85c 100644 --- a/src/plugins/7zip/7zthreads.cpp +++ b/src/plugins/7zip/7zthreads.cpp @@ -126,7 +126,7 @@ HRESULT LaunchAndDo7ZipTask(LPTHREAD_START_ROUTINE threadProc, LPVOID args) GetExitCodeThread(hThread, &exitCode); CloseHandle(hThread); - return exitCode; // Our thread body func returns HRESULT + return exitCode; // Our thread body function returns HRESULT } MSG msg; @@ -155,9 +155,9 @@ HRESULT DoDecompress(CSalamanderForOperationsAbstract* salamander, CDecompressPa if (FAILED(result) && ((FACILITY_WIN32 << 16) == (result & 0x7FFF0000))) { - // LastError error encoded into HRESULT - // There is something strange: E_OUTOFMEMORY as 0x8007000EL prints as "Not enough storage is available to complete this operation" - // even when not truncated to 16 bits while 0x80000002L prints as "Ran out of memory" + // LastError encoded as HRESULT + // Oddly, E_OUTOFMEMORY as 0x8007000EL prints as "Not enough storage is available to complete this operation" + // even without truncating to 16 bits, while 0x80000002L prints as "Ran out of memory" SysError(label, (result == E_OUTOFMEMORY) ? 0x80000002L : (result & 0xFFFF), FALSE); } else From b94d8d1b198e762a3764d5e47a87b1cb7e503d6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 14:04:36 +0200 Subject: [PATCH 094/710] [tanslation] Fix src/plugins/7zip/dialogs.cpp comments (#465) --- src/plugins/7zip/dialogs.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/7zip/dialogs.cpp b/src/plugins/7zip/dialogs.cpp index 9ae3c26cd..a67307b8d 100644 --- a/src/plugins/7zip/dialogs.cpp +++ b/src/plugins/7zip/dialogs.cpp @@ -389,7 +389,7 @@ CCompressParamsDlg::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) SetComboCurSelData(GetDlgItem(HWindow, IDCfgDictSize), CompressParams->DictSize); SetComboCurSelData(GetDlgItem(HWindow, IDCfgWordSize), CompressParams->WordSize); - break; // request focus from DefDlgProc + break; // let DefDlgProc handle focus } case WM_COMMAND: @@ -434,7 +434,7 @@ CCommonDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) // horizontally and vertically center the dialog relative to the parent if (Parent != NULL) SalamanderGeneral->MultiMonCenterWindow(HWindow, Parent, TRUE); - break; // request focus from DefDlgProc + break; // let DefDlgProc handle focus case WM_COMMAND: break; @@ -483,7 +483,7 @@ CConfigurationDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) EnableWindow(GetDlgItem(HWindow, IDC_CFG_LISTINFOMETHOD), Cfg.ExtendedListInfo); CompressParamsDlg.HWindow = HWindow; - break; // request focus from DefDlgProc + break; // let DefDlgProc handle focus } case WM_COMMAND: @@ -580,7 +580,7 @@ CExtOptionsDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) CompressParamsDlg.HWindow = HWindow; - break; // request focus from DefDlgProc + break; // let DefDlgProc handle focus } case WM_COMMAND: @@ -666,7 +666,7 @@ CEnterPasswordDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_COMMAND: { /* - // preparation for skip and skip_all + // support for skip and skip_all switch (LOWORD(wParam)) { case IDC_SKIP: return EndDialog(HWindow, DIALOG_SKIP); From 381f88e79f4c72d0fd29903f07bb692550fa4563 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 14:15:07 +0200 Subject: [PATCH 095/710] [tanslation] Fix src/plugins/7zip/extract.cpp comments (#466) --- src/plugins/7zip/extract.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/plugins/7zip/extract.cpp b/src/plugins/7zip/extract.cpp index 0a10c7ac9..ea896fd2c 100644 --- a/src/plugins/7zip/extract.cpp +++ b/src/plugins/7zip/extract.cpp @@ -39,8 +39,8 @@ CExtractCallbackImp::~CExtractCallbackImp() DeleteCriticalSection(&CSExtract); } -// silent - if TRUE and a DataError occurs during extraction (usually an incorrect password), the file is deleted -// automatically and the user is not asked anything (used when extracting a single file for preview - F3) +// silent - if TRUE and a DataError occurs during extraction (usually because of an incorrect password), the file is deleted +// automatically and the user is not prompted (used when extracting a single file for viewing - F3) BOOL CExtractCallbackImp::Init(IInArchive* archive, const char* outDir, const FILETIME& utcLastWriteTimeDefault, DWORD attributesDefault, BOOL silentDelete /* = FALSE*/) { @@ -158,20 +158,20 @@ STDMETHODIMP CExtractCallbackImp::GetStream(UINT32 index, ISequentialOutStream** const CArchiveItemInfo* aii = ItemsToExtract[index]; if (!aii) { - // Already extracted??? Not to be extracted? + // Already extracted? Not selected for extraction? throw S_OK; } ItemsToExtract.erase(index); const CFileData* fd = aii->FileData; // fd is certainly not NULL - // because we handed over a list of CArchiveItem with all information we need, we can extract directly. - // however, we need reverse mapping (a hash function) that tells us the index of the item to use - // because this function receives the index in the archive + // Because we passed a list of CArchiveItem objects with all the information we need, we can extract directly. + // However, we need reverse mapping (a hash function) to tell us which item index to use, + // because this function receives the index within the archive. // - // we could save memory and retrieve the properties we need via ArchiveHandler->GetProperty, - // but the problem is with names: GetProperty returns path+filename relative to the archive root and if we extract - // from a different root, we would have to strip the path + // We could save memory and retrieve the properties we need via ArchiveHandler->GetProperty, + // but names are a problem: GetProperty returns path+filename relative to the archive root, and if we extract + // from a different root, we would have to strip the path. ProcessedFileInfo.Attributes = fd->Attr; ProcessedFileInfo.AttributesAreDefined = true; @@ -364,7 +364,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = } } - // release the OutStream so it can be deleted if needed + // release OutStream so the file can be deleted if needed if (OutFileStream != NULL) OutFileStreamSpec->SetMTime(&ProcessedFileInfo.LastWrite); OutFileStream.Release(); @@ -480,7 +480,7 @@ STDMETHODIMP CExtractCallbackImp::SetOperationResult(INT32 resultEOperationResul if (TargetDir && !ItemsToExtract.size()) { // NULL TargetDir means testing the archive - // Doing partial extract & everything has been extracted. Looks like a solid archive + // A partial extraction was requested, and everything has been extracted. The archive appears to be solid. return E_STOPEXTRACTION; } From d55340d5ed83c33ed6157a01f1806974c10cb74d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 14:18:21 +0200 Subject: [PATCH 096/710] [tanslation] Fix src/plugins/7zip/extract.h comments (#467) --- src/plugins/7zip/extract.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/7zip/extract.h b/src/plugins/7zip/extract.h index 66415e00f..6e48142dd 100644 --- a/src/plugins/7zip/extract.h +++ b/src/plugins/7zip/extract.h @@ -99,7 +99,7 @@ class CExtractCallbackImp : public IArchiveExtractCallback, Cancel }; // behavior of the callback when a data error occurs - BOOL DataErrorSilent; // whether to ask about Keep or Delete + BOOL DataErrorSilent; // whether to prompt for Keep or Delete EOperationMode DataErrorMode; BOOL DataErrorDeleteSilent; // report an error when deleting BOOL SilentDelete; From d3685081ad6b0640bffb6bfaeae6c4fad295e769 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 14:35:15 +0200 Subject: [PATCH 097/710] [tanslation] Fix src/plugins/7zip/7za/c/7z.h comments (#468) --- src/plugins/7zip/7za/c/7z.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/7zip/7za/c/7z.h b/src/plugins/7zip/7za/c/7z.h index 476815194..b7ae11cc5 100644 --- a/src/plugins/7zip/7za/c/7z.h +++ b/src/plugins/7zip/7za/c/7z.h @@ -173,11 +173,11 @@ UInt16 *SzArEx_GetFullNameUtf16_Back(const CSzArEx *p, size_t fileIndex, UInt16 SRes SzArEx_Extract( const CSzArEx *db, ILookInStream *inStream, - UInt32 fileIndex, /* index of file */ - UInt32 *blockIndex, /* index of solid block */ + UInt32 fileIndex, /* file index */ + UInt32 *blockIndex, /* solid block index */ Byte **outBuffer, /* pointer to pointer to output buffer (allocated with allocMain) */ - size_t *outBufferSize, /* buffer size for output buffer */ - size_t *offset, /* offset of stream for required file in *outBuffer */ + size_t *outBufferSize, /* size of the output buffer */ + size_t *offset, /* offset of the required file stream in *outBuffer */ size_t *outSizeProcessed, /* size of file in *outBuffer */ ISzAlloc *allocMain, ISzAlloc *allocTemp); From e4c35ed9b042dc5a87d0978f0d4a4ff0dabf3713 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 14:52:28 +0200 Subject: [PATCH 098/710] [tanslation] Fix src/plugins/7zip/7za/c/7zDec.c comments (#469) Co-authored-by: OpenAI Codex --- src/plugins/7zip/7za/c/7zDec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/7zip/7za/c/7zDec.c b/src/plugins/7zip/7za/c/7zDec.c index c45d6bf8d..0ac6f823f 100644 --- a/src/plugins/7zip/7za/c/7zDec.c +++ b/src/plugins/7zip/7za/c/7zDec.c @@ -412,7 +412,7 @@ static SRes SzFolder_Decode2(const CSzFolder *folder, } else if (ci == 2) { - if (unpackSize > outSize) /* check it */ + if (unpackSize > outSize) /* check size */ return SZ_ERROR_PARAM; tempBuf3 = outBufCur = outBuffer + (outSize - (size_t)unpackSize); tempSize3 = outSizeCur = (SizeT)unpackSize; From cf8e4bf3d174df0ff434afd337a248793a6e3a2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 15:52:33 +0200 Subject: [PATCH 099/710] [tanslation] Fix src/plugins/demoplug/archiver.cpp comments (#470) Co-authored-by: OpenAI Codex --- src/plugins/demoplug/archiver.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/plugins/demoplug/archiver.cpp b/src/plugins/demoplug/archiver.cpp index 0ca72ef9f..58af6c59c 100644 --- a/src/plugins/demoplug/archiver.cpp +++ b/src/plugins/demoplug/archiver.cpp @@ -456,7 +456,7 @@ CPluginInterfaceForArchiver::PackToArchive(CSalamanderForOperationsAbstract* sal while ((name = next(SalamanderGeneral->GetMsgBoxParent(), 3, &dosName, &isDir, &size, &attr, &lastWrite, nextParam, &errorOccured)) != NULL) { - if (errorOccured == SALENUM_ERROR) // SALENUM_CANCEL cannot appear here + if (errorOccured == SALENUM_ERROR) // SALENUM_CANCEL cannot occur here TRACE_I("Not all files and directories from disk will be packed."); totalSize += size; @@ -623,7 +623,7 @@ CPluginInterfaceForArchiver::UnpackWholeArchive(CSalamanderForOperationsAbstract BOOL ret = FALSE; if (delArchiveWhenDone) - archiveVolumes->Add(fileName, -2); // FIXME: once the plugin learns multi-volume archives we must add all archive volumes here (to delete the entire archive) + archiveVolumes->Add(fileName, -2); // FIXME: once the plugin supports multi-volume archives, we must add all archive volumes here (to delete the entire archive) salamander->OpenProgressDialog("Unpacking DemoPlug Archive", FALSE, NULL, FALSE); salamander->ProgressSetTotalSize(CQuadWord(100, 0), CQuadWord(-1, -1)); @@ -797,9 +797,9 @@ CPluginInterfaceForArchiver::DeleteTmpCopy(const char* fileName, BOOL firstFile) CALL_STACK_MESSAGE3("CPluginInterfaceForArchiver::DeleteTmpCopy(%s, %d)", fileName, firstFile); /* - // message box test (message boxes should be used only in an extreme situation) - it makes a mess + // message box test (use message boxes only in extreme situations) - it causes problems // if another plugin has its own modal dialog open (cosmetic issue: the message box for this dialog is not modal - // and after closing it activates the dialog's parent) + // and activates the dialog's parent after it is closed) char buf[500]; sprintf(buf, "File \"%s\" will be deleted.", fileName); SalamanderGeneral->SalMessageBox(SalamanderGeneral->GetMsgBoxParent(), @@ -807,8 +807,8 @@ CPluginInterfaceForArchiver::DeleteTmpCopy(const char* fileName, BOOL firstFile) MB_OK | MB_ICONINFORMATION); */ - // if this is a critical shutdown it is not a good time for slow file deletion (our process will be killed soon), - // at the first subsequent plugin start in the first Salamander instance this will be deleted "calmly", + // if this is a critical shutdown, it is not a good time for slow file deletion (our process will be killed soon), + // at the first subsequent plugin start in the first Salamander instance, this will be deleted normally, // we probably cannot come up with anything better if (SalamanderGeneral->IsCriticalShutdown()) return; @@ -849,8 +849,8 @@ CPluginInterfaceForArchiver::PrematureDeleteTmpCopy(HWND parent, int copiesCount { CALL_STACK_MESSAGE2("CPluginInterfaceForArchiver::PrematureDeleteTmpCopy(, %d)", copiesCount); - // if this is a critical shutdown it is not a good time for slow file deletion (our process will be killed soon), - // at the first subsequent plugin start in the first Salamander instance this will be deleted "calmly", + // if this is a critical shutdown, it is not a good time for slow file deletion (our process will be killed soon), + // at the first subsequent plugin start in the first Salamander instance, this will be deleted normally, // we probably cannot come up with anything better if (SalamanderGeneral->IsCriticalShutdown()) return FALSE; // during a critical shutdown we do not ask any questions From c46345e979de678c9f171578fa0b676dbbbcaa5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 16:07:09 +0200 Subject: [PATCH 100/710] [tanslation] Fix src/plugins/demoplug/demoplug.cpp comments (#471) Co-authored-by: OpenAI Codex --- src/plugins/demoplug/demoplug.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/demoplug/demoplug.cpp b/src/plugins/demoplug/demoplug.cpp index ade705a40..5dfb55f96 100644 --- a/src/plugins/demoplug/demoplug.cpp +++ b/src/plugins/demoplug/demoplug.cpp @@ -153,7 +153,7 @@ void InitIconOverlays() // in reality large icons have been supported for a long time and can be enabled via // Desktop/Properties/???/Large Icons; note that there will be no system image list // for 32x32 icons in that case, and we should fetch the actual icon sizes from the system - // for now we ignore it and enable 48x48 only from XP where they are normally available + // for now we ignore this and enable 48x48 only from XP, where they are normally available int iconSizes[3] = {16, 32, 48}; if (!SalIsWindowsVersionOrGreater(5, 1, 0)) // not WindowsXPAndLater: not XP or later iconSizes[2] = 32; From 0db5a363211b027c58e585bfe5d61d767b7a4cd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 16:22:01 +0200 Subject: [PATCH 101/710] [tanslation] Fix src/plugins/demoplug/demoplug.h comments (#472) --- src/plugins/demoplug/demoplug.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/demoplug/demoplug.h b/src/plugins/demoplug/demoplug.h index b7e229e66..cacd939cd 100644 --- a/src/plugins/demoplug/demoplug.h +++ b/src/plugins/demoplug/demoplug.h @@ -330,7 +330,7 @@ class CViewerWindow : public CWindow DWORD Enablers[vweCount]; - HWND HRebar; // holds the menu bar and toolbar + HWND HRebar; // holds MenuBar and ToolBar CGUIMenuPopupAbstract* MainMenu; CGUIMenuBarAbstract* MenuBar; CGUIToolBarAbstract* ToolBar; @@ -420,7 +420,7 @@ class CDeleteProgressDlg : public CCommonDialog void Set(const char* fileName, DWORD progress, BOOL dalayedPaint); - // empties the message queue (call often enough) and allows repainting, handling Cancel, ... + // empties the message queue (call often enough), allows repainting, and handles Cancel presses // returns TRUE if the user wants to interrupt the operation BOOL GetWantCancel(); From 3a4d028ba6e3b17dc34f1e1031a42135a103b116 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 16:30:57 +0200 Subject: [PATCH 102/710] [tanslation] Fix src/plugins/demoplug/dialogs.cpp comments (#473) --- src/plugins/demoplug/dialogs.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/demoplug/dialogs.cpp b/src/plugins/demoplug/dialogs.cpp index 07ad76429..b241aeb04 100644 --- a/src/plugins/demoplug/dialogs.cpp +++ b/src/plugins/demoplug/dialogs.cpp @@ -39,7 +39,7 @@ CCommonDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) // horizontally and vertically center the dialog relative to the parent if (Parent != NULL) SalamanderGeneral->MultiMonCenterWindow(HWindow, Parent, TRUE); - break; // ask DefDlgProc to handle focus + break; // let DefDlgProc handle focus } } return CDialog::DialogProc(uMsg, wParam, lParam); @@ -264,7 +264,7 @@ CPathDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) CDialog::DialogProc(uMsg, wParam, lParam); return FALSE; */ - break; // ask DefDlgProc to handle focus + break; // let DefDlgProc handle focus } } return CCommonDialog::DialogProc(uMsg, wParam, lParam); @@ -382,7 +382,7 @@ BOOL CCtrlExampleDialog::CreateChilds() CGUIHyperLinkAbstract* hl; - // A hyperlink can be reached in the dialog via the keyboard if the .RC assigns it the WS_TABSTOP style. + // A HyperLink can be reached in the dialog via the keyboard if the .RC assigns it the WS_TABSTOP style. hl = SalamanderGUI->AttachHyperLink(HWindow, IDC_CE_HLOPEN, STF_UNDERLINE | STF_HYPERLINK_COLOR); if (hl == NULL) return FALSE; From 67be5db6b9fd803baed7eef4ed77f554619f1392 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 16:47:33 +0200 Subject: [PATCH 103/710] [tanslation] Fix src/plugins/demoplug/fs1.cpp comments (#474) --- src/plugins/demoplug/fs1.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/demoplug/fs1.cpp b/src/plugins/demoplug/fs1.cpp index 5698e1e31..67d8c1f35 100644 --- a/src/plugins/demoplug/fs1.cpp +++ b/src/plugins/demoplug/fs1.cpp @@ -471,9 +471,9 @@ void CTopIndexMem::Push(const char* path, int topIndex) ok = s - path == l && SalamanderGeneral->StrNICmp(path, Path, l) == 0; } - if (ok) // it follows -> remember the next top index + if (ok) // path follows -> remember the next top index { - if (TopIndexesCount == TOP_INDEX_MEM_SIZE) // need to remove the first top index from memory + if (TopIndexesCount == TOP_INDEX_MEM_SIZE) // discard the first stored top index { int i; for (i = 0; i < TOP_INDEX_MEM_SIZE - 1; i++) @@ -515,13 +515,13 @@ BOOL CTopIndexMem::FindAndPop(const char* path, int& topIndex) topIndex = TopIndexes[--TopIndexesCount]; return TRUE; } - else // we no longer have this value (it was not stored or low memory discarded it) + else // we no longer have this value (it was not stored or was discarded due to low memory) { Clear(); return FALSE; } } - else // request for another path -> clear the memory, a long jump occurred + else // request for a different path -> clear memory; a long jump occurred { Clear(); return FALSE; From c78961fac91696f9b7826be580cf5e00ca322da0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 17:24:10 +0200 Subject: [PATCH 104/710] [tanslation] Fix src/plugins/demoplug/fs2.cpp comments (#475) --- src/plugins/demoplug/fs2.cpp | 46 ++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/plugins/demoplug/fs2.cpp b/src/plugins/demoplug/fs2.cpp index 7bd06efb5..e9cc165b9 100644 --- a/src/plugins/demoplug/fs2.cpp +++ b/src/plugins/demoplug/fs2.cpp @@ -71,7 +71,7 @@ void CDeleteProgressDlg::EnableCancel(BOOL enable) BOOL CDeleteProgressDlg::GetWantCancel() { MSG msg; - while (PeekMessage(&msg, NULL, 0, 0, TRUE)) // give the user a brief timeslice ... + while (PeekMessage(&msg, NULL, 0, 0, TRUE)) // give the user a brief moment ... { if (!IsWindow(HWindow) || !IsDialogMessage(HWindow, &msg)) { @@ -291,7 +291,7 @@ CPluginFSInterface::ChangePath(int currentFSNameIndex, char* fsName, int fsNameI if (FatalError) { FatalError = FALSE; - return FALSE; // ListCurrentPath failed because of low memory, fatal error + return FALSE; // ListCurrentPath failed due to low memory; fatal error } char errBuf[MAX_PATH]; @@ -315,7 +315,7 @@ CPluginFSInterface::ChangePath(int currentFSNameIndex, char* fsName, int fsNameI { // try to shorten the path PathError = FALSE; if (!SalamanderGeneral->CutDirectory(path, NULL)) - return FALSE; // nothing left to shorten, fatal error + return FALSE; // the path cannot be shortened further; fatal error fileNameAlreadyCut = TRUE; if (pathWasCut != NULL) *pathWasCut = TRUE; @@ -332,7 +332,7 @@ CPluginFSInterface::ChangePath(int currentFSNameIndex, char* fsName, int fsNameI } #endif // DEMOPLUG_QUIET - if (attr != 0xFFFFFFFF && (attr & FILE_ATTRIBUTE_DIRECTORY) != 0) // success, pick the path as current + if (attr != 0xFFFFFFFF && (attr & FILE_ATTRIBUTE_DIRECTORY) != 0) // success, use the path as current { if (errBuf[0] != 0) // if we have a message from shortening, display it now { @@ -341,7 +341,7 @@ CPluginFSInterface::ChangePath(int currentFSNameIndex, char* fsName, int fsNameI } strcpy(Path, path); - // timer test only (useful for keep-connection-alive for example) + // timer test only (useful, for example, for keeping the connection alive) // SalamanderGeneral->KillPluginFSTimer(this, TRUE, 0); // clear existing timers for this FS first // SalamanderGeneral->AddPluginFSTimer(2000, this, 1234); @@ -502,7 +502,7 @@ CPluginFSInterface::ListCurrentPath(CSalamanderDirectoryAbstract* dir, file.LastWrite = data.ftLastWriteTime; file.Hidden = file.Attr & FILE_ATTRIBUTE_HIDDEN ? 1 : 0; // always set IconOverlayIndex; Salamander will ignore it if it doesn't apply - // read-only = slow file overlay, system = shared overlay + // read-only = slow file icon overlay, system = shared icon overlay file.IconOverlayIndex = file.Attr & FILE_ATTRIBUTE_READONLY ? 1 : file.Attr & FILE_ATTRIBUTE_SYSTEM ? 0 : ICONOVERLAYINDEX_NOTUSED; @@ -1026,7 +1026,7 @@ CPluginFSInterface::CreateDir(const char* fsName, int mode, HWND parent, char* n { cancel = FALSE; if (mode == 1) - return FALSE; // request for the standard dialog + return FALSE; // request the standard dialog #ifndef DEMOPLUG_QUIET char bufText[2 * MAX_PATH + 100]; @@ -1566,14 +1566,14 @@ BOOL DFS_IsValidPath(const char* path, CDFSPathError* err) *err = dfspeShareNameMissing; } else - return TRUE; // cesta OK + return TRUE; // path OK } } else // path specified via a drive (c:\...) { if (LowerCase[*s] >= 'a' && LowerCase[*s] <= 'z' && *(s + 1) == ':' && *(s + 2) == '\\') // "c:\..." { - return TRUE; // cesta OK + return TRUE; // path OK } else { @@ -1653,13 +1653,13 @@ CPluginFSInterface::CopyOrMoveFromFS(BOOL copy, int mode, const char* fsName, HW SalamanderGeneral->SetUserWorkedOnPanelPath(PANEL_TARGET); // default action = work with the target panel path } - return FALSE; // request for the standard dialog + return FALSE; // request the standard dialog } if (mode == 4) // error in the standard Salamander processing of the destination path { // 'targetPath' contains an invalid path; the user was notified, just let them edit it - return FALSE; // request for the standard dialog + return FALSE; // request the standard dialog } const char* title = copy ? "DFS Copy" : "DFS Move"; @@ -1688,7 +1688,7 @@ CPluginFSInterface::CopyOrMoveFromFS(BOOL copy, int mode, const char* fsName, HW if (mode == 2) // the user entered a path in the standard dialog { // resolve relative paths ourselves (Salamander cannot do that) - if ((targetPath[0] != '\\' || targetPath[1] != '\\') && // not an UNC path + if ((targetPath[0] != '\\' || targetPath[1] != '\\') && // not a UNC path (targetPath[0] == 0 || targetPath[1] != ':')) // not a standard drive path { // so it is neither Windows nor archive syntax userPart = strchr(targetPath, ':'); @@ -1720,7 +1720,7 @@ CPluginFSInterface::CopyOrMoveFromFS(BOOL copy, int mode, const char* fsName, HW userPart = s; BOOL tooLong = FALSE; int rootLen = SalamanderGeneral->GetRootPath(s, Path); - if (targetPath[0] == '\\') // "\\path" -> build root + newName + if (targetPath[0] == '\\') // "\\path" -> concatenate root + newName { s += rootLen; int len = (int)strlen(targetPath + 1); // skip the leading '\\' @@ -1732,7 +1732,7 @@ CPluginFSInterface::CopyOrMoveFromFS(BOOL copy, int mode, const char* fsName, HW *(s + len) = 0; } } - else // "path" -> combine Path + newName + else // "path" -> concatenate Path + newName { int pathLen = (int)strlen(Path); if (pathLen < rootLen) @@ -1834,7 +1834,7 @@ CPluginFSInterface::CopyOrMoveFromFS(BOOL copy, int mode, const char* fsName, HW { char* end2 = end; BOOL cut = FALSE; - while (*--end2 != '\\') // at least one backslash must follow after the root + while (*--end2 != '\\') // at least one backslash is guaranteed after the root { if (*end2 == '*' || *end2 == '?') cut = TRUE; @@ -1847,7 +1847,7 @@ CPluginFSInterface::CopyOrMoveFromFS(BOOL copy, int mode, const char* fsName, HW } } - while (end > afterRoot) // there is still more than the root + while (end > afterRoot) // there is more than the root { DWORD attrs = SalamanderGeneral->SalGetFileAttributes(userPart); if (attrs != 0xFFFFFFFF) // this part of the path exists @@ -1982,7 +1982,7 @@ CPluginFSInterface::CopyOrMoveFromFS(BOOL copy, int mode, const char* fsName, HW if (pathError) { // return 'targetPath' after adjustment (expansion of the path and possible tweaks to ".." and ".") - return FALSE; // error -> re-open the standard dialog + return FALSE; // error -> show the standard dialog again } } } @@ -2094,13 +2094,13 @@ CPluginFSInterface::CopyOrMoveFromFS(BOOL copy, int mode, const char* fsName, HW opMask++; } - /* // description of the operation destination gathered in the previous code: + /* // description of the operation target obtained by the preceding code: if (diskPath) // 'targetPath' is a Windows path, 'opMask' is the operation mask { } - else // 'targetPath' is a path on this FS ('userPart' points to the FS user-part path), 'opMask' is the operation mask + else // 'targetPath' is a path on this FS ('userPart' points to the user part of the FS path), 'opMask' is the operation mask { - // if 'rename' is TRUE we are renaming/copying a directory into itself + // if 'rename' is TRUE, this is renaming/copying a directory into itself } */ @@ -2204,7 +2204,7 @@ CPluginFSInterface::CopyOrMoveFromFS(BOOL copy, int mode, const char* fsName, HW if (!fileFromCache) // the file is not in the disk cache { // copy the file directly from DFS - // the demo plug-in does not handle overwriting files; real code should confirm overwrites here + // the demo plugin does not handle overwriting files; real code should confirm overwrites here // (the ConfirmOnFileOverwrite and ConfirmOnSystemHiddenFileOverwrite flags apply) while (1) { @@ -2475,7 +2475,7 @@ CPluginFSInterface::CopyOrMoveFromDiskToFS(BOOL copy, int mode, const char* fsNa { // 'targetPath' contains the raw path entered by the user (all we know is that it // belongs to this FS, otherwise Salamander would not call this method) - char* userPart = strchr(targetPath, ':') + 1; // v 'targetPath' musi byt fs-name + ':' + char* userPart = strchr(targetPath, ':') + 1; // 'targetPath' must contain fs-name + ':' CDFSPathError err; BOOL invPath = !DFS_IsValidPath(userPart, &err); @@ -2795,7 +2795,7 @@ CPluginFSInterface::CopyOrMoveFromDiskToFS(BOOL copy, int mode, const char* fsNa break; } - if (success && !copy && !skip) // we are doing a move and the file was not skipped -> delete the source file + if (success && !copy && !skip) // this is a move and the file was not skipped -> delete the source file { // remove the file from disk while (1) From f39142da9aed601a4556b5f70ac1fdeae5e25876 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 17:45:13 +0200 Subject: [PATCH 105/710] [tanslation] Fix src/plugins/demoplug/menu.cpp comments (#476) --- src/plugins/demoplug/menu.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/demoplug/menu.cpp b/src/plugins/demoplug/menu.cpp index 1491f6634..b32947985 100644 --- a/src/plugins/demoplug/menu.cpp +++ b/src/plugins/demoplug/menu.cpp @@ -111,7 +111,7 @@ void WINAPI DEMOPLUGOperationFromDisk(const char* sourcePath, SalEnumSelection2 while ((name = next(data->Parent, 3, &dosName, &isDir, &size, &attr, &lastWrite, nextParam, &errorOccured)) != NULL) { - if (errorOccured == SALENUM_ERROR) // SALENUM_CANCEL cannot arrive here + if (errorOccured == SALENUM_ERROR) // SALENUM_CANCEL cannot occur here data->Success = FALSE; if (!isDir) totalSize += size; @@ -493,7 +493,7 @@ CPluginInterfaceForMenuExt::ExecuteMenuItem(CSalamanderForOperationsAbstract* sa { break; } - else UpdateWindow(waitWndParent); // avoid staring at leftover message box contents + else UpdateWindow(waitWndParent); // redraw the parent window to remove message box remnants SalamanderGeneral->ShowSafeWaitWindow(TRUE); } } @@ -501,7 +501,7 @@ CPluginInterfaceForMenuExt::ExecuteMenuItem(CSalamanderForOperationsAbstract* sa */ /* - // password mananger + // password manager CSalamanderPasswordManagerAbstract *passwordManager = NULL; passwordManager = SalamanderGeneral->GetSalamanderPasswordManager(); if (passwordManager != NULL) @@ -530,11 +530,11 @@ CPluginInterfaceForMenuExt::ExecuteMenuItem(CSalamanderForOperationsAbstract* sa if (passwordManager->DecryptPassword(encryptedPassword, encryptedPasswordSize, &decryptedPassword)) { TRACE_I("Decrypted password: " << decryptedPassword); - memset(decryptedPassword, 0, lstrlen(decryptedPassword)); // clear memory with plain password + memset(decryptedPassword, 0, lstrlen(decryptedPassword)); // clear the memory containing the plain text password SalamanderGeneral->Free(decryptedPassword); } - if (!encrypt) memset(encryptedPassword, 0, encryptedPasswordSize); // clear memory with scrambled password + if (!encrypt) memset(encryptedPassword, 0, encryptedPasswordSize); // clear the memory containing the scrambled password SalamanderGeneral->Free(encryptedPassword); } } @@ -759,7 +759,7 @@ CPluginInterfaceForMenuExt::ExecuteMenuItem(CSalamanderForOperationsAbstract* sa { if (!filePath) { - // error - expected a file path, not a directory + // error - expected a directory path, but found a file SalamanderGeneral->SalMessageBox(parent, "Unable to create the path specified, name has already been used for a file.", "Path Error", MB_OK | MB_ICONEXCLAMATION); continue; // ask again From 166c916adbd1b22949ae0837921d4976a8f24777 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 17:59:12 +0200 Subject: [PATCH 106/710] [tanslation] Fix src/plugins/demoplug/thumbldr.cpp comments (#477) --- src/plugins/demoplug/thumbldr.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/plugins/demoplug/thumbldr.cpp b/src/plugins/demoplug/thumbldr.cpp index 8b777dffe..eb03d7c94 100644 --- a/src/plugins/demoplug/thumbldr.cpp +++ b/src/plugins/demoplug/thumbldr.cpp @@ -16,11 +16,11 @@ // **************************************************************************** // opens the specified file and converts it into a sequence of DWORDs -// that means 24 bits for color (R, G, B) and 8 bits of padding +// i.e. 24 bits for color (R, G, B) and 8 unused bits // the size of a single row in bytes is: image_width * sizeof(DWORD) /* -// simple variant built on LoadImage, which blocks the rest of the OS -// and the loading process cannot be interrupted +// simple variant based on LoadImage, which blocks the rest of the system +// and does not allow the loading process to be interrupted CPluginInterfaceForThumbLoader::LoadThumbnail(const char *filename, int thumbWidth, int thumbHeight, CSalamanderThumbnailMakerAbstract *thumbMaker, BOOL fastThumbnail) @@ -29,18 +29,18 @@ CPluginInterfaceForThumbLoader::LoadThumbnail(const char *filename, int thumbWid IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE)); if (hSrcBitmap != NULL) { - // get the width and height of the image + // get the image width and height BITMAP srcBitmap; if (GetObject(hSrcBitmap, sizeof(BITMAP), &srcBitmap) != 0) { - // create a copy in which every pixel is represented as COLORREF + // create a copy in which each pixel is represented as COLORREF BITMAPINFO tmpBI; memset(&tmpBI, NULL, sizeof(BITMAPINFO)); tmpBI.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); tmpBI.bmiHeader.biWidth = srcBitmap.bmWidth; tmpBI.bmiHeader.biHeight = -srcBitmap.bmHeight; // send a top-down bitmap to Salamander tmpBI.bmiHeader.biPlanes = 1; - tmpBI.bmiHeader.biBitCount = 32; // R, G, B, one byte of padding + tmpBI.bmiHeader.biBitCount = 32; // R, G, B, one unused byte void* ptr; HBITMAP hTmpBitmap = HANDLES(CreateDIBSection(NULL, &tmpBI, DIB_RGB_COLORS, &ptr, NULL, NULL)); @@ -48,7 +48,7 @@ CPluginInterfaceForThumbLoader::LoadThumbnail(const char *filename, int thumbWid if (hTmpBitmap != NULL && tmpBitmapBits != NULL) { - // if the bitmap was allocated, convert it into our format + // if the bitmap was allocated successfully, convert it to the required format HDC hDC = HANDLES(GetDC(NULL)); HDC hSrcDC = HANDLES(CreateCompatibleDC(hDC)); @@ -64,9 +64,9 @@ CPluginInterfaceForThumbLoader::LoadThumbnail(const char *filename, int thumbWid HANDLES(DeleteDC(hTmpDC)); HANDLES(ReleaseDC(NULL, hDC)); - GdiFlush(); // we are going to work with raw data, ensure GDI operations are flushed + GdiFlush(); // flush pending GDI operations before working with raw data - // hand the image to Salamander for downscaling + // pass the image to Salamander for downscaling thumbMaker->SetParameters(srcBitmap.bmWidth, srcBitmap.bmHeight, 0); // int i = 0; // while (i < srcBitmap.bmHeight) @@ -82,7 +82,7 @@ CPluginInterfaceForThumbLoader::LoadThumbnail(const char *filename, int thumbWid thumbMaker->SetError(); // probably not enough memory; the file gets a simple icon } else - thumbMaker->SetError(); // it's a bitmap, but probably corrupted; the file gets a simple icon + thumbMaker->SetError(); // it is a bitmap, but it is probably corrupted; the file gets a simple icon HANDLES(DeleteObject(hSrcBitmap)); } @@ -106,7 +106,7 @@ DWORD GetClrUsed(const BITMAPINFOHEADER* bih, BOOL max) case 8: return 256; default: - return 0; // A 24 or 32 bitcount DIB has no color table + return 0; // A 24- or 32-bit DIB has no color table } } @@ -271,7 +271,7 @@ CPluginInterfaceForThumbLoader::LoadThumbnail(const char* filename, processTopDown = TRUE; height *= -1; } - // pass picture format to Open Salamander + // pass image parameters to Open Salamander if (thumbMaker->SetParameters(width, height, processTopDown ? 0 : SSTHUMB_MIRROR_VERT)) { LOGPALETTE* palette = NULL; From dd223431bcb93cc9186560be679053ee846e1a37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 18:11:49 +0200 Subject: [PATCH 107/710] [tanslation] Fix src/plugins/demoplug/viewer.cpp comments (#478) --- src/plugins/demoplug/viewer.cpp | 34 ++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/plugins/demoplug/viewer.cpp b/src/plugins/demoplug/viewer.cpp index 5dabcc051..6f42c5ffa 100644 --- a/src/plugins/demoplug/viewer.cpp +++ b/src/plugins/demoplug/viewer.cpp @@ -72,7 +72,7 @@ MENU_TEMPLATE_ITEM PopupMenuTemplate[] = struct CButtonData { - int ImageIndex; // zero base index + int ImageIndex; // zero-based index WORD ToolTipResID; // resource ID containing the tooltip string WORD ID; // generic command ID CViewerWindowEnablerEnum Enabler; // control variable that enables the button @@ -116,7 +116,7 @@ void ReleaseViewer() ViewerAccels = NULL; } -/* // viewer thread start variant without using the CThread object +/* // variant of starting the viewer thread without using the CThread object struct CTVData { BOOL AlwaysOnTop; @@ -136,7 +136,7 @@ unsigned WINAPI ViewerThreadBody(void *param) SetThreadNameInVCAndTrace("DOP Viewer"); TRACE_I("Begin"); - // sample application crash + // application crash example // int *p = 0; // *p = 0; // ACCESS VIOLATION ! @@ -156,8 +156,8 @@ unsigned WINAPI ViewerThreadBody(void *param) if (CfgSavePosition && CfgWindowPlacement.length != 0) { WINDOWPLACEMENT place = CfgWindowPlacement; - // GetWindowPlacement respects the taskbar so if it sits at the top or left, - // the coordinates are offset by its size; correct them. + // GetWindowPlacement takes the taskbar into account, so if the taskbar is at the top or left, + // the coordinates are offset by its size. Correct them. RECT monitorRect; RECT workRect; SalamanderGeneral->MultiMonGetClipRectByRect(&place.rcNormalPosition, &workRect, &monitorRect); @@ -171,7 +171,7 @@ unsigned WINAPI ViewerThreadBody(void *param) data->ShowCmd = place.showCmd; } - // NOTE: on an existing window/dialog the top-most state is easy to apply: + // NOTE: on an existing window/dialog, making it topmost is easy: // SetWindowPos(HWindow, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); if (window->CreateEx(data->AlwaysOnTop ? WS_EX_TOPMOST : 0, @@ -204,7 +204,7 @@ unsigned WINAPI ViewerThreadBody(void *param) char name[MAX_PATH]; strcpy(name, data->Name); BOOL openFile = data->Success; - SetEvent(data->Continue); // wake the main thread; the data are no longer valid past this point (=NULL) + SetEvent(data->Continue); // let the main thread continue; past this point the data are no longer valid (=NULL) data = NULL; // if everything went well, open the requested file in the window @@ -239,8 +239,8 @@ CPluginInterfaceForViewer::ViewFile(const char *name, int left, int top, int wid BOOL *lockOwner, CSalamanderPluginViewerData *viewerData, int enumFilesSourceUID, int enumFilesCurrentIndex) { - // DemoPlug does not use 'viewerData'; otherwise we would pass the values (not references) - // via CTVData to the viewer thread... + // DemoPlug does not use 'viewerData'; otherwise the values would have to be passed + // via CTVData to the viewer thread, not by reference... CTVData data; data.AlwaysOnTop = alwaysOnTop; @@ -263,7 +263,7 @@ CPluginInterfaceForViewer::ViewFile(const char *name, int left, int top, int wid if (ThreadQueue.StartThread(ViewerThreadBody, &data)) { - // wait until the thread processes the supplied data and returns results + // wait until the thread processes the supplied data and returns the results WaitForSingleObject(data.Continue, INFINITE); } else data.Success = FALSE; @@ -287,7 +287,7 @@ class CViewerThread : public CThread BOOL* Success; int EnumFilesSourceUID; // UID of the source used to enumerate files in the viewer - int EnumFilesCurrentIndex; // index of the first viewer file in the source + int EnumFilesCurrentIndex; // index of the first file in the viewer within the source public: CViewerThread(const char* name, int left, int top, int width, int height, @@ -607,7 +607,7 @@ BOOL CViewerWindow::InitializeGraphics() BOOL ok = SalamanderGUI->CreateGrayscaleAndMaskBitmaps(hTmpColorBitmap, RGB(255, 0, 255), hTmpGrayBitmap, hTmpMaskBitmap); - if (ok) // put the obtained bitmap handles into HANDLES (manual insertion example; easier + if (ok) // put the obtained bitmap handles into HANDLES (manual insertion example) { // in this scenario DeleteObject follows immediately, so use the NOHANDLES macro with DeleteObject) HANDLES_ADD(__htBitmap, __hoCreateDIBitmap, hTmpGrayBitmap); HANDLES_ADD(__htBitmap, __hoCreateDIBitmap, hTmpMaskBitmap); @@ -746,7 +746,7 @@ CViewerWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_CREATE: { InitializeGraphics(); - DragAcceptFiles(HWindow, TRUE); // drag&drop open file + DragAcceptFiles(HWindow, TRUE); // enable drag-and-drop file opening MainMenu = SalamanderGUI->CreateMenuPopup(); if (MainMenu == NULL) return -1; @@ -801,7 +801,7 @@ CViewerWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_DESTROY: { - DragAcceptFiles(HWindow, FALSE); // drag&drop open file + DragAcceptFiles(HWindow, FALSE); // disable drag-and-drop file opening if (CfgSavePosition) { CfgWindowPlacement.length = sizeof(WINDOWPLACEMENT); @@ -878,9 +878,9 @@ CViewerWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) HDWP hdwp = HANDLES(BeginDeferWindowPos(2)); if (hdwp != NULL) { - // +4: when widening the window the last four pixels refused to repaint - // in the rebar; even after hours I could not find the cause; Salamander handles it fine; - // this workaround suffices for now; maybe I will remember the cause later + // +4: when increasing the window width, the last four pixels did not repaint + // in the rebar; the cause was not found after several hours; it works in Salamander; + // keep this workaround for now; maybe the cause will become clear later hdwp = HANDLES(DeferWindowPos(hdwp, HRebar, NULL, 0, 0, r.right + 4, rebarHeight, SWP_NOACTIVATE | SWP_NOZORDER)); From 42887f05698553a1f9585c74f4f56f4610137ea9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 19:52:33 +0200 Subject: [PATCH 108/710] [tanslation] Fix src/plugins/demoview/demoview.h comments (#479) --- src/plugins/demoview/demoview.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/demoview/demoview.h b/src/plugins/demoview/demoview.h index 8010dc2ce..20c38f300 100644 --- a/src/plugins/demoview/demoview.h +++ b/src/plugins/demoview/demoview.h @@ -140,7 +140,7 @@ class CRendererWindow : public CWindow class CViewerWindow : public CWindow { public: - HANDLE Lock; // 'lock' object or NULL (set to the signaled state once we close the file) + HANDLE Lock; // 'lock' object or NULL (set to the signaled state after the file is closed) char Name[MAX_PATH]; // file name or "" CRendererWindow Renderer; // viewer inner window HIMAGELIST HGrayToolBarImageList; // toolbar and menu in the gray variant (computed from the colored one) @@ -154,7 +154,7 @@ class CViewerWindow : public CWindow CGUIToolBarAbstract* ToolBar; int EnumFilesSourceUID; // source UID for enumerating files in the viewer - int EnumFilesCurrentIndex; // index of the current viewer file within the source + int EnumFilesCurrentIndex; // index of the current file in the viewer within the source public: CViewerWindow(int enumFilesSourceUID, int enumFilesCurrentIndex); From 44eff860c6091b873721a57073fa42dc8bf0374b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 20:00:27 +0200 Subject: [PATCH 109/710] [tanslation] Fix src/plugins/demoview/dialogs.cpp comments (#480) --- src/plugins/demoview/dialogs.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/demoview/dialogs.cpp b/src/plugins/demoview/dialogs.cpp index 2eb951eb6..7f58ec2bb 100644 --- a/src/plugins/demoview/dialogs.cpp +++ b/src/plugins/demoview/dialogs.cpp @@ -36,7 +36,7 @@ CCommonDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) // horizontally and vertically center the dialog relative to the parent if (Parent != NULL) SalamanderGeneral->MultiMonCenterWindow(HWindow, Parent, TRUE); - break; // want focus from DefDlgProc + break; // let DefDlgProc handle focus } } return CDialog::DialogProc(uMsg, wParam, lParam); @@ -98,7 +98,7 @@ class CCenteredPropertyWindow : public CWindow break; } - case WM_APP + 1000: // we should detach from the dialog (already centered) + case WM_APP + 1000: // detach from the dialog (it is already centered) { DetachWindow(); delete this; // a bit of a hack, but nobody will touch 'this' anymore, so it's fine From edf10ef6e6dc2f51d28220aeb5e95db44051a456 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 20:15:09 +0200 Subject: [PATCH 110/710] [tanslation] Fix src/plugins/demoview/thumbldr.cpp comments (#481) --- src/plugins/demoview/thumbldr.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/demoview/thumbldr.cpp b/src/plugins/demoview/thumbldr.cpp index 88816776e..9d58e51f1 100644 --- a/src/plugins/demoview/thumbldr.cpp +++ b/src/plugins/demoview/thumbldr.cpp @@ -12,7 +12,7 @@ #include "precomp.h" // opens the specified file and converts it into a sequence of DWORDs -// that is, 24 bits for color (R, G, B) and 8 bits of padding +// i.e. 24 bits for color (R, G, B) and 8 unused bits // the size of a single row in bytes is: image_width * sizeof(DWORD) DWORD GetClrUsed(const BITMAPINFOHEADER* bih, BOOL max) @@ -29,7 +29,7 @@ DWORD GetClrUsed(const BITMAPINFOHEADER* bih, BOOL max) case 8: return 256; default: - return 0; // A 24 or 32 bitcount DIB has no color table + return 0; // A 24-bit or 32-bit DIB has no color table } } @@ -147,7 +147,7 @@ CPluginInterfaceForThumbLoader::LoadThumbnail(const char* filename, BOOL fastThumbnail) { BOOL stopFurtherLoaders = TRUE; // don't try next parsers - // we must call thumbMaker->SetError() when error occures and stopFurtherLoaders is TRUE + // we must call thumbMaker->SetError() when an error occurs and stopFurtherLoaders is TRUE // open the file HANDLE hFile = HANDLES_Q(CreateFile(filename, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, @@ -194,7 +194,7 @@ CPluginInterfaceForThumbLoader::LoadThumbnail(const char* filename, processTopDown = TRUE; height *= -1; } - // pass picture format to Open Salamander + // pass image parameters to Open Salamander if (thumbMaker->SetParameters(width, height, processTopDown ? 0 : SSTHUMB_MIRROR_VERT)) { LOGPALETTE* palette = NULL; From fec49a52232bd3ef4bce13c58ef9917711db110f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 20:31:04 +0200 Subject: [PATCH 111/710] src/plugins/demoview/viewer.cpp review Review the English comment translations in src/plugins/demoview/viewer.cpp against the original Czech comments from OpenSalamander/salamander at a28afcb958578dd219311a7b500320b162de812b. Changed several comments where the existing English was awkward, misleading, or less precise than the Czech source. Standardized the toolbar image index as a zero-based index, clarified that EnumFilesCurrentIndex stores the first viewer file source index, and rewrote the temporary bitmap handle note so the HANDLES and NOHANDLES relationship is grammatical without changing code behavior. Corrected the WM_DESTROY DragAcceptFiles comment to match the FALSE argument: the call disables drag-and-drop file opening rather than allowing it. Tightened the rebar +4 repaint workaround note into neutral English while preserving the original debugging context and workaround intent. Cleaned up the obsolete hotkey note and the paste enabler comment without changing any executable code. Verification: ran the branch-target review pipeline for this file, inspected the resolved results and draft diff, manually materialized only the approved comment edits into the delivery checkout, reran the Windows comment guard with clang against the same artifact directory, verified seven inline PR review comments in Files changed, and waited for all GitHub checks to pass before merging. --- src/plugins/demoview/viewer.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/plugins/demoview/viewer.cpp b/src/plugins/demoview/viewer.cpp index f7518f20f..9fb315ad7 100644 --- a/src/plugins/demoview/viewer.cpp +++ b/src/plugins/demoview/viewer.cpp @@ -68,7 +68,7 @@ MENU_TEMPLATE_ITEM PopupMenuTemplate[] = struct CButtonData { - int ImageIndex; // zero base index + int ImageIndex; // zero-based index WORD ToolTipResID; // resource ID with the tooltip string WORD ID; // universal command CViewerWindowEnablerEnum Enabler; // control variable for enabling the button @@ -127,7 +127,7 @@ class CViewerThread : public CThread BOOL* Success; int EnumFilesSourceUID; // source UID for enumerating files in the viewer - int EnumFilesCurrentIndex; // index of the first viewer file within the source + int EnumFilesCurrentIndex; // index of the first file in the viewer within the source public: CViewerThread(const char* name, int left, int top, int width, int height, @@ -389,8 +389,8 @@ BOOL CViewerWindow::InitializeGraphics() hTmpColorBitmap = HANDLES(LoadBitmap(DLLInstance, MAKEINTRESOURCE(SalamanderGeneral->CanUse256ColorsBitmap() ? IDB_TOOLBAR256 : IDB_TOOLBAR16))); BOOL ok = SalamanderGUI->CreateGrayscaleAndMaskBitmaps(hTmpColorBitmap, RGB(255, 0, 255), hTmpGrayBitmap, hTmpMaskBitmap); - if (ok) // insert the acquired bitmap handles into HANDLES (example of manual insertion; simpler - { // in this situation (DeleteObject immediately follows) to use the NOHANDLES macro for DeleteObject) + if (ok) // insert the acquired bitmap handles into HANDLES (manual insertion example) + { // here DeleteObject follows immediately, so NOHANDLES with DeleteObject would be simpler HANDLES_ADD(__htBitmap, __hoCreateDIBitmap, hTmpGrayBitmap); HANDLES_ADD(__htBitmap, __hoCreateDIBitmap, hTmpMaskBitmap); } @@ -583,7 +583,7 @@ CViewerWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_DESTROY: { - DragAcceptFiles(HWindow, FALSE); // allow opening files via drag and drop + DragAcceptFiles(HWindow, FALSE); // disable drag-and-drop file opening if (CfgSavePosition) { CfgWindowPlacement.length = sizeof(WINDOWPLACEMENT); @@ -661,8 +661,8 @@ CViewerWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (hdwp != NULL) { // +4: without this offset the last four pixels of the rebar failed to repaint while resizing the window. - // I could not track down the cause even after spending several hours on it (Salamander itself works fine). - // Leave the workaround in place for now and revisit once we rediscover the root cause. + // the cause was not found after several hours; Salamander itself works fine. + // keep this workaround for now and revisit it if the root cause becomes clear. hdwp = HANDLES(DeferWindowPos(hdwp, HRebar, NULL, 0, 0, r.right + 4, rebarHeight, SWP_NOACTIVATE | SWP_NOZORDER)); @@ -729,7 +729,7 @@ CViewerWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) BOOL noMoreFiles = FALSE; char fileName[MAX_PATH]; fileName[0] = 0; - if (shiftPressed) // legacy hot-key: use Backspace (keys + commands in the menu see PictView, menu File/Other Files) + if (shiftPressed) // legacy hotkey: use Backspace instead (see PictView, File/Other Files for keys and menu commands) { ok = SalamanderGeneral->GetPreviousFileNameForViewer(EnumFilesSourceUID, &EnumFilesCurrentIndex, @@ -901,7 +901,7 @@ CViewerWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case CM_VIEWER_PASTE: { SalamanderGeneral->SalMessageBox(HWindow, "TODO: Paste", LoadStr(IDS_PLUGINNAME), MB_ICONINFORMATION | MB_OK); - Enablers[vwePaste] = FALSE; // it's OK only if it was Cut (Copy should not change it) + Enablers[vwePaste] = FALSE; // OK only if it was Cut (Copy should not change it) UpdateEnablers(); break; } From 64906978bc827227d447f222208435b2ce59d413 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 20:50:29 +0200 Subject: [PATCH 112/710] src/plugins/diskmap/DiskMap/GUI.DirectoryLine.h review Review the English comment translations in src/plugins/diskmap/DiskMap/GUI.DirectoryLine.h against the original Czech comments from OpenSalamander/salamander at a28afcb958578dd219311a7b500320b162de812b. Changed the comment on the dx[strlen] assignment from stopper to sentinel. The value is written just past the measured character widths and is then used to terminate the following scan, so sentinel is the idiomatic technical term for this pattern. No executable code changed. The update only tightens one inline comment so it describes the existing loop mechanics more precisely. Verification: ran the branch-target review pipeline for this file, inspected the single draft change and its Czech source, manually materialized only that approved comment edit into the delivery checkout, reran the Windows comment guard with clang against the same artifact directory, verified the inline PR review comment in Files changed, and waited for all GitHub checks to pass before merging. --- src/plugins/diskmap/DiskMap/GUI.DirectoryLine.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/diskmap/DiskMap/GUI.DirectoryLine.h b/src/plugins/diskmap/DiskMap/GUI.DirectoryLine.h index f56a26d06..dfa764e23 100644 --- a/src/plugins/diskmap/DiskMap/GUI.DirectoryLine.h +++ b/src/plugins/diskmap/DiskMap/GUI.DirectoryLine.h @@ -278,7 +278,7 @@ class CDirectoryLine : public CChildWindow int rp = p; int miswidth = pathwidth - width + this->_dotsWidth + dx[p - 1]; - dx[strlen] = miswidth; //stopper + dx[strlen] = miswidth; //sentinel while (miswidth > dx[rp]) rp++; From b1a950c07ba509f77f940b11401a8938f423c2dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 20:57:16 +0200 Subject: [PATCH 113/710] src/plugins/diskmap/DiskMap/GUI.DiskMapView.h review Review the English comment translations in src/plugins/diskmap/DiskMap/GUI.DiskMapView.h against the baseline comments from OpenSalamander/salamander at a28afcb958578dd219311a7b500320b162de812b. Changed one TODO comment from an excited placeholder style to a neutral technical TODO. The updated comment keeps the intended placeholder meaning while using the repository normal comment spacing and a clearer description of the missing drawing path. No executable code changed. The update only tightens one inline comment in the fallback paint branch. Verification: ran the branch-target review pipeline for this file, inspected the single draft change and its original source comment, manually materialized only that approved comment edit into the delivery checkout, reran the Windows comment guard with clang against the same artifact directory, verified the inline PR review comment in Files changed, and waited for all GitHub checks to pass before merging. --- src/plugins/diskmap/DiskMap/GUI.DiskMapView.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/diskmap/DiskMap/GUI.DiskMapView.h b/src/plugins/diskmap/DiskMap/GUI.DiskMapView.h index e2257571f..c63fbac8b 100644 --- a/src/plugins/diskmap/DiskMap/GUI.DiskMapView.h +++ b/src/plugins/diskmap/DiskMap/GUI.DiskMapView.h @@ -80,7 +80,7 @@ class CDiskMapView : public CChildWindow } else { - //TODO: Display something! + // TODO: Display content BitBlt(hdc, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, NULL, 0, 0, BLACKNESS); //HACK: this was put together quickly to have something for version 1.0; fortunately it should not happen too often From 2ccd0a29e5f640cf29a4c1ee6de25575856a4aed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 21:03:54 +0200 Subject: [PATCH 114/710] src/plugins/diskmap/DiskMap/GUI.LoadAnimation.h review Review the English comment translations in src/plugins/diskmap/DiskMap/GUI.LoadAnimation.h against the baseline comments from OpenSalamander/salamander at a28afcb958578dd219311a7b500320b162de812b. Changed one TODO comment from colloquial wording to a neutral technical TODO. The new wording keeps the note that the current line-height handling should be improved, while using consistent TODO punctuation and spacing. No executable code changed. The update only tightens one inline comment next to the _lineHeight assignment. Verification: ran the branch-target review pipeline for this file, inspected the single draft change and its original source comment, manually materialized only the approved comment edit into the delivery checkout, reran the Windows comment guard with clang against the same artifact directory, verified the inline PR review comment in Files changed, and waited for all GitHub checks to pass before merging. --- src/plugins/diskmap/DiskMap/GUI.LoadAnimation.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/diskmap/DiskMap/GUI.LoadAnimation.h b/src/plugins/diskmap/DiskMap/GUI.LoadAnimation.h index c49b01258..e8f04acc8 100644 --- a/src/plugins/diskmap/DiskMap/GUI.LoadAnimation.h +++ b/src/plugins/diskmap/DiskMap/GUI.LoadAnimation.h @@ -93,7 +93,7 @@ class CLoadAnimation : public CAnimation } GetTextExtentPoint32(hdc, this->_escinfo->GetString(), (int)this->_escinfo->GetLength(), &sz); this->_escinfoWidth = sz.cx; - this->_lineHeight = sz.cy; //TODO nicer! + this->_lineHeight = sz.cy; // TODO: Improve this. SelectObject(hdc, fo); this->_headersWidth = width; //return TRUE; From a0eace9dcb5882babf2f32d83e8f05b0286065ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 21:14:48 +0200 Subject: [PATCH 115/710] src/plugins/diskmap/DiskMap/GUI.ToolTip.h review Review the English comment translations in src/plugins/diskmap/DiskMap/GUI.ToolTip.h against the baseline comments from OpenSalamander/salamander at a28afcb958578dd219311a7b500320b162de812b. Changed one tooltip sizing comment so it explains that the header space is reserved even when the type string is empty. The original wording was understandable but informal and less precise about reserving layout space rather than adding a text space. No executable code changed. The update only tightens one inline comment next to the _headerheight adjustment. Verification: ran the branch-target review pipeline for this file, inspected the single draft change and its original source comment, manually materialized a more precise approved comment edit into the delivery checkout, reran the Windows comment guard with clang against the same artifact directory, verified the inline PR review comment in Files changed, and waited for all GitHub checks to pass before merging. --- src/plugins/diskmap/DiskMap/GUI.ToolTip.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/diskmap/DiskMap/GUI.ToolTip.h b/src/plugins/diskmap/DiskMap/GUI.ToolTip.h index d527bfb4f..811fbd048 100644 --- a/src/plugins/diskmap/DiskMap/GUI.ToolTip.h +++ b/src/plugins/diskmap/DiskMap/GUI.ToolTip.h @@ -426,7 +426,7 @@ class CFileInfoTooltip : public CFrameWindow //Check normal font height GetTextExtentPoint32(hdc, TEXT("W"), 1, &sz); - this->_headerheight += sz.cy; //even when type string is empty add the space so the tooltip doesn't change its size unexpectedly + this->_headerheight += sz.cy; // reserve the space even when the type string is empty so the tooltip size does not change unexpectedly int dataheight = 0; for (int i = 0; i < TT_LINECOUNT; i++) From 1cf74bcbcb945d84f6295cbee72c4bce1ff3682e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 21:23:34 +0200 Subject: [PATCH 116/710] src/plugins/diskmap/DiskMap/System.Lock.h review Review the English comment translations in src/plugins/diskmap/DiskMap/System.Lock.h against the baseline comments from OpenSalamander/salamander at a28afcb958578dd219311a7b500320b162de812b. Changed the TryEnter inline comment so it describes the InterlockedExchange result in natural English. The old text was understandable but awkward around the write operation and lock acquisition semantics; the new text keeps the same meaning while making the successful acquisition case explicit. No executable code changed. The update only tightens one inline comment next to the InterlockedExchange call. Verification: ran the branch-target review pipeline for this file, inspected the single draft change and its original source comment, manually materialized only the approved comment edit into the delivery checkout, reran the Windows comment guard with clang against the same artifact directory, verified the inline PR review comment in Files changed, and waited for all GitHub checks to pass before merging. --- src/plugins/diskmap/DiskMap/System.Lock.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/diskmap/DiskMap/System.Lock.h b/src/plugins/diskmap/DiskMap/System.Lock.h index e2209c5cc..693b87e3a 100644 --- a/src/plugins/diskmap/DiskMap/System.Lock.h +++ b/src/plugins/diskmap/DiskMap/System.Lock.h @@ -15,7 +15,7 @@ class CLock } BOOL TryEnter() { - return InterlockedExchange(&this->_lock, 1) == 0; // before writing, 0 means acquire the lock; otherwise it was already locked (1) + return InterlockedExchange(&this->_lock, 1) == 0; // before the write, 0 means the lock was acquired; otherwise it was already locked (1) } void Enter() { From 52409dc7cad1cc2d53130dfbc43caaadb9955e93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 21:40:21 +0200 Subject: [PATCH 117/710] [translation] Fix src/plugins/diskmap/DiskMap/System.WorkerThread.h comments Refines translated comments in src/plugins/diskmap/DiskMap/System.WorkerThread.h. Model: OpenAI GPT-5.4 Verification: full OSTranslation sequential review with prompt-log-mode full, copilot-event-log full, clang AST grounding, review-provider auto, Copilot SDK gpt-5.4 reasoning high; 36 comment units, 36 review results, 36 resolved results, 36 apply results; branch-target guard passed strict and ignore-whitespace with 0 violations and 0 preprocessing failures; git diff --check passed. Telemetry: 9 provider calls and 131298 estimated tokens total. Codex-family: 8 calls and 98893 estimated tokens. Copilot SDK: 1 call, 32405 estimated tokens, 17225 input tokens, 2764 output tokens, 2 Copilot request units. Copilot billing in this workflow is request-unit based, not token-priced. --- .../diskmap/DiskMap/System.WorkerThread.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/plugins/diskmap/DiskMap/System.WorkerThread.h b/src/plugins/diskmap/DiskMap/System.WorkerThread.h index d02d3cf40..0dd5c03b9 100644 --- a/src/plugins/diskmap/DiskMap/System.WorkerThread.h +++ b/src/plugins/diskmap/DiskMap/System.WorkerThread.h @@ -18,7 +18,7 @@ class CMyThreadQueue : public CThreadQueue public: CMyThreadQueue(const char* queueName /* e.g., "DemoPlug Viewers" */) : CThreadQueue(queueName) {} - void Add(HANDLE hThread, DWORD tid) // adds an item to the queue, returns success + void Add(HANDLE hThread, DWORD tid) // adds an item to the queue { CS.Enter(); CThreadQueue::Add(new CThreadQueueItem(hThread, tid)); // cannot fail @@ -108,22 +108,22 @@ class CWorkerThread this->_lock = new CLock(); this->_rwlock = new CRWLock(); - this->_doDelete = FALSE; // the thread may finish before CreateThread() returns, so postpone deletion + this->_doDelete = FALSE; // the thread may finish before CreateThread() returns, so postpone deleting the object this->_hThread = CreateThread( NULL, // default security attributes 0, // use default stack size CWorkerThread::s_ThreadProc, // thread function this, // argument to thread function - (suspended) ? CREATE_SUSPENDED : 0, // use default creation flags - &this->_threadId); // returns the thread identifier + (suspended) ? CREATE_SUSPENDED : 0, // creation flags + &this->_threadId); // receives the thread identifier if (this->_hThread != NULL) ThreadQueue.Add(this->_hThread, this->_threadId); else this->_finished = TRUE; // the thread failed to start = act as if it has already finished if (selfDelete) - this->SetSelfDelete(selfDelete); // deletion of the object is now possible + this->SetSelfDelete(selfDelete); // the object can now be deleted } ~CWorkerThread() { @@ -144,7 +144,7 @@ class CWorkerThread CLock* GetLock() { return this->_lock; } CRWLock* GetRWLock() { return this->_rwlock; } - void SetSelfDelete(BOOL selfDelete) //after calling with TRUE, references to the object are unsafe and it may be destroyed at any time + void SetSelfDelete(BOOL selfDelete) // after calling with TRUE, the object may be destroyed at any time, so references to it are unsafe { this->_innerlock->Enter(); if (this->_doDelete != selfDelete) @@ -155,11 +155,11 @@ class CWorkerThread } else //if the thread has already finished { - if (selfDelete) //wants to delete me, so delete... + if (selfDelete) // wants to delete this object, so delete it... { this->_innerlock->Leave(); //first release the lock delete this; //destroy ourselves - return; //and exit quickly + return; // return immediately } } } From 73beb586b881294cefb1f2e9f8495862ffcea39f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 21:51:28 +0200 Subject: [PATCH 118/710] [translation] Fix src/plugins/diskmap/DiskMap/TreeMap.CDiskMap.h comments Refines translated comments in src/plugins/diskmap/DiskMap/TreeMap.CDiskMap.h. Model: OpenAI GPT-5.4 Verification: full OSTranslation sequential review with prompt-log-mode full, copilot-event-log full, clang AST grounding, review-provider auto, Copilot SDK gpt-5.4 reasoning high; 49 comment units, 49 review results, 49 resolved results, 49 apply results; branch-target guard passed strict and ignore-whitespace with 0 violations and 0 preprocessing failures; git diff --check passed. Telemetry: 3 provider calls and 73308 estimated tokens total. Codex-family: 1 call and 21146 estimated tokens. Copilot SDK: 2 calls, 52162 estimated tokens, 30903 input tokens, 2315 output tokens, 4 Copilot request units. Copilot billing in this workflow is request-unit based, not token-priced. --- src/plugins/diskmap/DiskMap/TreeMap.CDiskMap.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/diskmap/DiskMap/TreeMap.CDiskMap.h b/src/plugins/diskmap/DiskMap/TreeMap.CDiskMap.h index 4d2ad3eaf..1acc13a19 100644 --- a/src/plugins/diskmap/DiskMap/TreeMap.CDiskMap.h +++ b/src/plugins/diskmap/DiskMap/TreeMap.CDiskMap.h @@ -551,7 +551,7 @@ class CDiskMap BOOL ZoomOut() { if (this->_viewdir == NULL) - return FALSE; //if it is not null, the root should not be null either + return FALSE; //if _viewdir is not NULL, _rootdir should not be NULL either if (this->_viewdir != this->_rootdir) { this->_viewdir = this->_viewdir->GetParent(); @@ -585,7 +585,7 @@ class CDiskMap this->_rootdir = NULL; this->_populateworker = NULL; wrk->SetSelfDelete(TRUE); - wrk->Abort(TRUE); //TODO: do I really want to wait? + wrk->Abort(TRUE); //TODO: should this really wait? return TRUE; } From 058f09a1aaa3ad978df14b53a4070e9e67e8e65b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 22:09:04 +0200 Subject: [PATCH 119/710] [translation] Fix src/plugins/diskmap/DiskMap/TreeMap.DiskMap.CDirectoryOverlay.h comments Refines translated comments in src/plugins/diskmap/DiskMap/TreeMap.DiskMap.CDirectoryOverlay.h. Model: OpenAI GPT-5.4 Verification: full OSTranslation sequential review with prompt-log-mode full, copilot-event-log full, clang AST grounding, review-provider auto, Copilot SDK gpt-5.4 reasoning high; 61 comment units, 61 review results, 61 resolved results, 61 apply results; branch-target guard passed strict and ignore-whitespace with 0 violations and 0 preprocessing failures; git diff --check passed. Telemetry: 3 provider calls and 74418 estimated tokens total. Codex-family: 1 call and 19636 estimated tokens. Copilot SDK: 2 calls, 54782 estimated tokens, 31454 input tokens, 1824 output tokens, 4 Copilot request units. Copilot billing in this workflow is request-unit based, not token-priced. --- .../diskmap/DiskMap/TreeMap.DiskMap.CDirectoryOverlay.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/diskmap/DiskMap/TreeMap.DiskMap.CDirectoryOverlay.h b/src/plugins/diskmap/DiskMap/TreeMap.DiskMap.CDirectoryOverlay.h index 996eb0c5b..84d26c544 100644 --- a/src/plugins/diskmap/DiskMap/TreeMap.DiskMap.CDirectoryOverlay.h +++ b/src/plugins/diskmap/DiskMap/TreeMap.DiskMap.CDirectoryOverlay.h @@ -420,7 +420,7 @@ class CDirectoryOverlay : public CDiskMapOverlay else //text pixel { if (tx > titlewidth) - titlewidth = tx; //extend the maximum text length + titlewidth = tx; //extend the maximum text width txt_data[cxp] = 0xff; //text pixel will be white @@ -429,7 +429,7 @@ class CDirectoryOverlay : public CDiskMapOverlay for (int px = 0; px < 4; px++) { if ((px == 0) && (py == 0)) - continue; //no need for the center + continue; //center pixel not needed int txa = CDirectoryOverlay_shadowdata[py * 4 + px]; if (tx - px > 0) From 359d7c88d64824fb632135ca53590d7c78a62093 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 22:16:21 +0200 Subject: [PATCH 120/710] [translation] Fix src/plugins/diskmap/DiskMap/TreeMap.DiskMap.CDiskMapOverlay.h comments Refines translated comments in src/plugins/diskmap/DiskMap/TreeMap.DiskMap.CDiskMapOverlay.h. Model: OpenAI GPT-5.4 Verification: full OSTranslation sequential review with prompt-log-mode full, copilot-event-log full, clang AST grounding, review-provider auto, Copilot SDK gpt-5.4 reasoning high; 3 comment units, 3 review results, 3 resolved results, 3 apply results; branch-target guard passed strict and ignore-whitespace with 0 violations and 0 preprocessing failures; git diff --check passed. Telemetry: 1 provider call and 19843 estimated tokens total. Copilot SDK: 1 call, 19843 estimated tokens, 12576 input tokens, 739 output tokens, 2 Copilot request units. Copilot billing in this workflow is request-unit based, not token-priced. --- src/plugins/diskmap/DiskMap/TreeMap.DiskMap.CDiskMapOverlay.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/diskmap/DiskMap/TreeMap.DiskMap.CDiskMapOverlay.h b/src/plugins/diskmap/DiskMap/TreeMap.DiskMap.CDiskMapOverlay.h index 8a6633440..69b6d5bff 100644 --- a/src/plugins/diskmap/DiskMap/TreeMap.DiskMap.CDiskMapOverlay.h +++ b/src/plugins/diskmap/DiskMap/TreeMap.DiskMap.CDiskMapOverlay.h @@ -40,7 +40,7 @@ class CSelectedCushionOverlay : public CDiskMapOverlay BOOL Paint(CZBitmap* pix, HDC refDC) { if (this->_selected == FALSE) - return TRUE; //ok, but nothing to draw + return TRUE; //nothing is drawn int width = pix->GetWidth(); int height = pix->GetHeight(); From f3bb6deaae1a99ab9c1b51ffc63aa8bccb273189 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 22:26:53 +0200 Subject: [PATCH 121/710] [translation] Fix src/plugins/diskmap/DiskMap/TreeMap.FileData.CZDirectory.cpp comments Refines the English translations of Czech comments in src/plugins/diskmap/DiskMap/TreeMap.FileData.CZDirectory.cpp while preserving the surrounding directory enumeration and aggregation logic unchanged. The updated comments tighten two implementation notes that were still awkward in English. One now states that the empty directory branch represents a no-error case, and the other clarifies the periodic progress-report condition after a quarter-second interval. No executable statements, declarations, control flow, literals, or formatting outside comments were intentionally changed. Verified with the OSTranslation sequential review pipeline using prompt-log-mode full, copilot-event-log full, AST grounding through clang, review-provider auto, model gpt-5.4, and Copilot reasoning high. The run produced 29 comment units, 29 review results, 29 resolved results, and 29 apply results. Branch-target comment guard passed for src/plugins/diskmap/DiskMap/TreeMap.FileData.CZDirectory.cpp in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. git diff --check -- src/plugins/diskmap/DiskMap/TreeMap.FileData.CZDirectory.cpp completed without diff integrity failures. Telemetry: 4 provider calls and 98802 estimated tokens total. Codex-family calls: 1 call and 23219 estimated tokens. Copilot SDK calls: 3 calls, 75583 estimated tokens, 45239 input tokens, 3720 output tokens, and 6 Copilot request units. Copilot billing in this workflow is request-unit based, not token-priced. --- src/plugins/diskmap/DiskMap/TreeMap.FileData.CZDirectory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/diskmap/DiskMap/TreeMap.FileData.CZDirectory.cpp b/src/plugins/diskmap/DiskMap/TreeMap.FileData.CZDirectory.cpp index 8e24b651a..5e25e621a 100644 --- a/src/plugins/diskmap/DiskMap/TreeMap.FileData.CZDirectory.cpp +++ b/src/plugins/diskmap/DiskMap/TreeMap.FileData.CZDirectory.cpp @@ -204,7 +204,7 @@ INT64 CZDirectory::PopulateDir(CWorkerThread* mythread, TCHAR* path, int pos, si realsize = 0; disksize = 0; } - else if (datasize == 0) //everything ok, but empty + else if (datasize == 0) //no error, but empty { this->_dircount++; dircount++; @@ -294,7 +294,7 @@ INT64 CZDirectory::PopulateDir(CWorkerThread* mythread, TCHAR* path, int pos, si this->_files->At(fre) = f; } //if (((filecount + dircount) > MAXREPORTEDFILES) || (GetTickCount() - lastTime > 500)) //either many files or 0.5 sec elapsed - if ((GetTickCount() - lastTime > 250) && (filecount + dircount) > 0) //if 0.25 sec elapsed and at least something new was found + if ((GetTickCount() - lastTime > 250) && (filecount + dircount) > 0) //if 0.25 sec have elapsed and at least something new was found { this->_root->IncStats(filecount, dircount, tsize); lastTime = GetTickCount(); From 1b0b76cb6df033a0b6572c41cef07e2a3889ccd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 22:45:08 +0200 Subject: [PATCH 122/710] [translation] Fix src/plugins/diskmap/DiskMap/TreeMap.FileData.CZFile.cpp comments Refines the English translations of Czech comments in src/plugins/diskmap/DiskMap/TreeMap.FileData.CZFile.cpp while preserving the surrounding path-building logic unchanged. The updated comment now names both occurrences of the terminator explicitly, so the length-check explanation matches the expression it describes. No executable statements, declarations, control flow, literals, or formatting outside comments were intentionally changed. Verified with the OSTranslation sequential review pipeline using prompt-log-mode full, copilot-event-log full, AST grounding through clang, review-provider auto, model gpt-5.4, and Copilot reasoning high. The run produced 2 comment units, 2 review results, 2 resolved results, and 2 apply results. Branch-target comment guard passed for src/plugins/diskmap/DiskMap/TreeMap.FileData.CZFile.cpp in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. git diff --check -- src/plugins/diskmap/DiskMap/TreeMap.FileData.CZFile.cpp completed without diff integrity failures. Telemetry: 1 provider call and 28145 estimated tokens total. Copilot SDK calls: 1 call, 28145 estimated tokens, 14990 input tokens, 2147 output tokens, and 2 Copilot request units. Copilot billing in this workflow is request-unit based, not token-priced. --- src/plugins/diskmap/DiskMap/TreeMap.FileData.CZFile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/diskmap/DiskMap/TreeMap.FileData.CZFile.cpp b/src/plugins/diskmap/DiskMap/TreeMap.FileData.CZFile.cpp index ece9a762a..11910503c 100644 --- a/src/plugins/diskmap/DiskMap/TreeMap.FileData.CZFile.cpp +++ b/src/plugins/diskmap/DiskMap/TreeMap.FileData.CZFile.cpp @@ -10,7 +10,7 @@ size_t CZFile::GetFullName(TCHAR* buff, size_t size) size_t pos = 0; if (this->_parent) pos = this->_parent->GetFullName(buff, size); - if ((pos + this->_namelen + 1) < size) //pos = path + null terminator; total = path + ( '\\' + name length ) + null < size + if ((pos + this->_namelen + 1) < size) //pos = path + null terminator; total = path + ( '\\' + name length ) + null terminator < size { if (pos && buff[pos - 1] != TEXT('\\')) { From 57485ccd816e8c41c7e61c687998e80b7f355e8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 23:00:52 +0200 Subject: [PATCH 123/710] [translation] Fix src/plugins/diskmap/DiskMap/TreeMap.Graphics.CCushionGraphics.h comments Refines the English translations of Czech comments in src/plugins/diskmap/DiskMap/TreeMap.Graphics.CCushionGraphics.h while preserving the surrounding cushion-graphics parsing and validation logic unchanged. The updated comments improve six technical notes: the debug runtime-check explanation, the byte-count description of the file header, the chunk-loop position note, the EF zero-size requirement, and the fixed-border height and width validation messages. The rewrites tighten grammar, article usage, hyphenation, and technical wording without changing the underlying behavior being documented. No executable statements, declarations, control flow, literals, or formatting outside comments were intentionally changed. Verified with the OSTranslation sequential review pipeline using prompt-log-mode full, copilot-event-log full, AST grounding through clang, review-provider auto, model gpt-5.4, and Copilot reasoning high. The run produced 65 comment units, 65 review results, 65 resolved results, and 65 apply results. Branch-target comment guard passed for src/plugins/diskmap/DiskMap/TreeMap.Graphics.CCushionGraphics.h in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. git diff --check -- src/plugins/diskmap/DiskMap/TreeMap.Graphics.CCushionGraphics.h completed without diff integrity failures. Telemetry: 5 provider calls and 128150 estimated tokens total. Codex-family calls: 2 calls and 44637 estimated tokens. Copilot SDK calls: 3 calls, 83513 estimated tokens, 49059 input tokens, 4374 output tokens, and 6 Copilot request units. Copilot billing in this workflow is request-unit based, not token-priced. --- .../DiskMap/TreeMap.Graphics.CCushionGraphics.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/plugins/diskmap/DiskMap/TreeMap.Graphics.CCushionGraphics.h b/src/plugins/diskmap/DiskMap/TreeMap.Graphics.CCushionGraphics.h index 635d9b39f..ca4407bdf 100644 --- a/src/plugins/diskmap/DiskMap/TreeMap.Graphics.CCushionGraphics.h +++ b/src/plugins/diskmap/DiskMap/TreeMap.Graphics.CCushionGraphics.h @@ -5,8 +5,8 @@ #include -// precaution against runtime check failure in the debug version: the original macro casted RGB to WORD, -// so it reported data loss (RED component) +// precaution against a runtime check failure in the debug version: the original macro casts RGB to WORD, +// so it reports data loss (RED component) #undef GetGValue #define GetGValue(rgb) ((BYTE)(((rgb) >> 8) & 0xFF)) @@ -126,7 +126,7 @@ class CCushionGraphics BOOL Load(BYTE* dta, int size) { - if (size < 10) //10-byte header... 8 header + 2 version bytes + if (size < 10) //10-byte header... 8 header bytes + 2 version bytes { //_tcscpy(errbuff, TEXT("Internal error: Wrong data size")); //errlen = _tcslen(errbuff); @@ -212,7 +212,7 @@ class CCushionGraphics BYTE* aby = NULL; BOOL isAlpha = FALSE; - while (tbs + 4 <= end) // position + 4bytes chunk info + while (tbs + 4 <= end) // current position + 4-byte chunk info { mxc = *(unsigned short*)tbs; tbs += 2; //Chunk ID @@ -242,7 +242,7 @@ class CCushionGraphics break; case 0x4645: //EF (end of file) if (mxs != 0) - return FALSE; //EF always empty! + return FALSE; //EF must always be empty EFfound = TRUE; break; case 0x4642: //BF (fixed border info) @@ -257,9 +257,9 @@ class CCushionGraphics fil = *(unsigned short*)tbs; tbs += 2; if (fit + fib > h) - return FALSE; //fixed height is bigger then image height + return FALSE; //fixed height exceeds image height if (fir + fil > w) - return FALSE; //fixed width is bigger then image width + return FALSE; //fixed width exceeds image width break; case 0x4144: //DA (Alpha channel) tbd = aby; From 431f8e6f65aee71cc69a05a76d09cbff18896a56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 23:38:19 +0200 Subject: [PATCH 124/710] [translation] Fix src/plugins/diskmap/DiskMap/TreeMap.TreeData.h comments Refines the English translations of Czech comments in src/plugins/diskmap/DiskMap/TreeMap.TreeData.h while preserving the surrounding tree-layout logic unchanged. The only updated comment is the fallback TODO note on the null direction return path. The rewrite normalizes the exclamation-based phrasing into a more idiomatic defect label while keeping the original intent that the branch indicates an unexpected bug condition. No executable statements, declarations, control flow, literals, or formatting outside comments were intentionally changed. Verified with the OSTranslation sequential review pipeline using prompt-log-mode full, copilot-event-log full, AST grounding through clang, review-provider auto, model gpt-5.4, and Copilot reasoning high. The run produced 5 comment units, 5 review results, 5 resolved results, and 5 apply results. Branch-target comment guard passed for src/plugins/diskmap/DiskMap/TreeMap.TreeData.h in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. git diff --check -- src/plugins/diskmap/DiskMap/TreeMap.TreeData.h completed without diff integrity failures. Telemetry: 1 provider call and 24769 estimated tokens total. Copilot SDK calls: 1 call, 24769 estimated tokens, 14194 input tokens, 1359 output tokens, and 2 Copilot request units. Copilot billing in this workflow is request-unit based, not token-priced. --- src/plugins/diskmap/DiskMap/TreeMap.TreeData.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/diskmap/DiskMap/TreeMap.TreeData.h b/src/plugins/diskmap/DiskMap/TreeMap.TreeData.h index ba20227ff..6c5036ca4 100644 --- a/src/plugins/diskmap/DiskMap/TreeMap.TreeData.h +++ b/src/plugins/diskmap/DiskMap/TreeMap.TreeData.h @@ -157,7 +157,7 @@ class CTreeMapRendererBase return dirHorizontal; break; } - return dirNULL; //TODO: error! + return dirNULL; //TODO: bug } //virtual ERenderDecision Decide(CCushionRow *csr, double width, double length, int level, EDirection lastdir, INT64 datasize, INT64 remainingdata, int i, int remainingfiles) virtual ERenderDecision Decide(CCushionRow* csr, double width, double length, INT64 datasize, INT64 remainingdata) = 0; From 1d7cd1a8d6150af07ef8170bfabe29a90ab81bab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 23:45:58 +0200 Subject: [PATCH 125/710] [translation] Fix src/plugins/diskmap/DiskMap/Utils.Array.h comments Refines the English translations of Czech comments in src/plugins/diskmap/DiskMap/Utils.Array.h while preserving the surrounding dynamic-array logic unchanged. The updated comments remove one awkward first-person phrasing and one non-idiomatic indexing description. The new wording describes the empty-state cleanup branch and the indexing operator in clearer technical English without changing the underlying behavior being documented. No executable statements, declarations, control flow, literals, or formatting outside comments were intentionally changed. Verified with the OSTranslation sequential review pipeline using prompt-log-mode full, copilot-event-log full, AST grounding through clang, review-provider auto, model gpt-5.4, and Copilot reasoning high. The run produced 18 comment units, 18 review results, 18 resolved results, and 18 apply results. Branch-target comment guard passed for src/plugins/diskmap/DiskMap/Utils.Array.h in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. git diff --check -- src/plugins/diskmap/DiskMap/Utils.Array.h completed without diff integrity failures. Telemetry: 1 provider call and 20870 estimated tokens total. Codex-family calls: 1 call and 20870 estimated tokens. Copilot SDK calls: 0 calls and 0 Copilot request units for this run. --- src/plugins/diskmap/DiskMap/Utils.Array.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/diskmap/DiskMap/Utils.Array.h b/src/plugins/diskmap/DiskMap/Utils.Array.h index dd141cdd8..b5ff20a0c 100644 --- a/src/plugins/diskmap/DiskMap/Utils.Array.h +++ b/src/plugins/diskmap/DiskMap/Utils.Array.h @@ -92,7 +92,7 @@ class TAutoDirectArray { free(Blocks[_count / BlockSize]); } - if (!_count) //used them all + if (!_count) // all elements used up { free(Blocks); Blocks = NULL; @@ -104,7 +104,7 @@ class TAutoDirectArray CDynamicArray * const &operator[](float index); // function is never called, but if it is missing // MSVC does terrible things */ - DATA_TYPE& operator[](int index) //returns the element at the position + DATA_TYPE& operator[](int index) // returns the element at the given position { return Blocks[index / BlockSize][index % BlockSize]; } From 662936d140fcacfbdee05434e4a24c83edcb6bcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 10 Apr 2026 23:53:41 +0200 Subject: [PATCH 126/710] [translation] Fix src/plugins/diskmap/DiskMap/Utils.CStringFormatter.h comments (#497) Co-authored-by: OpenAI Codex --- src/plugins/diskmap/DiskMap/Utils.CStringFormatter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/diskmap/DiskMap/Utils.CStringFormatter.h b/src/plugins/diskmap/DiskMap/Utils.CStringFormatter.h index 254401be3..88e80f9ea 100644 --- a/src/plugins/diskmap/DiskMap/Utils.CStringFormatter.h +++ b/src/plugins/diskmap/DiskMap/Utils.CStringFormatter.h @@ -271,7 +271,7 @@ class CStringFormatter static const int maxexp = sizeof expch / sizeof TCHAR - 2; size_t len = 0; int exp = 0; - //C4244 ok: we only need the first few digits because we compute the short form "1.45TB" + //C4244 is OK: we only need the first few digits because we compute the short form "1,45TB" double rs = (double)(__int64)size; while (rs >= 1024 && exp < maxexp) { From 4c8e89b21af6b487c04001694a0162862ea39dcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sat, 11 Apr 2026 00:09:31 +0200 Subject: [PATCH 127/710] [translation] Fix src/plugins/diskmap/DiskMapPlugin/DiskMapPlugin.h comments (#498) Co-authored-by: OpenAI Codex --- src/plugins/diskmap/DiskMapPlugin/DiskMapPlugin.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/diskmap/DiskMapPlugin/DiskMapPlugin.h b/src/plugins/diskmap/DiskMapPlugin/DiskMapPlugin.h index ba27b7ca4..b95bf651c 100644 --- a/src/plugins/diskmap/DiskMapPlugin/DiskMapPlugin.h +++ b/src/plugins/diskmap/DiskMapPlugin/DiskMapPlugin.h @@ -1,10 +1,10 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later -// The following ifdef block is the standard way of creating macros which make exporting +// The following ifdef block is the standard way of creating macros that make exporting // from a DLL simpler. All files within this DLL are compiled with the ZAREVAKDISKMAPPLUGIN_EXPORTS -// symbol defined on the command line. this symbol should not be defined on any project -// that uses this DLL. This way any other project whose source files include this file see +// symbol defined on the command line. This symbol should not be defined in any project +// that uses this DLL. This way, any other project whose source files include this file sees // ZAREVAKDISKMAPPLUGIN_API functions as being imported from a DLL, whereas this DLL sees symbols // defined with this macro as being exported. From bb00bdb0207c764673769c0e0e39ff674454fbfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sat, 11 Apr 2026 00:13:20 +0200 Subject: [PATCH 128/710] [translation] Fix src/plugins/diskmap/DiskMapPlugin/DiskMapPlugin.cpp comments (#499) Co-authored-by: OpenAI Codex --- src/plugins/diskmap/DiskMapPlugin/DiskMapPlugin.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/diskmap/DiskMapPlugin/DiskMapPlugin.cpp b/src/plugins/diskmap/DiskMapPlugin/DiskMapPlugin.cpp index 74f1dc9b9..050d56acf 100644 --- a/src/plugins/diskmap/DiskMapPlugin/DiskMapPlugin.cpp +++ b/src/plugins/diskmap/DiskMapPlugin/DiskMapPlugin.cpp @@ -87,7 +87,7 @@ class CSalamanderCallback : public CSalamanderCallbackAbstract char focusPath[MAX_PATH]; lstrcpyn(focusPath, FocusPathBuf, MAX_PATH); FocusPathBuf[0] = 0; - if (focusPath[0] != 0) // only if we were not unlucky (we did not hit the beginning of Salamander's BUSY mode) + if (focusPath[0] != 0) // only if we were not unlucky (that is, we did not hit the start of Salamander's BUSY mode) { LPTSTR name; if (SalamanderGeneral->CutDirectory(focusPath, &name)) @@ -104,7 +104,7 @@ class CSalamanderCallback : public CSalamanderCallbackAbstract char focusPath[MAX_PATH]; lstrcpyn(focusPath, FocusPathBuf, MAX_PATH); FocusPathBuf[0] = 0; - if (focusPath[0] != 0) // only if we were not unlucky (we did not hit the beginning of Salamander's BUSY mode) + if (focusPath[0] != 0) // only if we did not enter at the start of Salamander's BUSY mode { SalamanderGeneral->SkipOneActivateRefresh(); // the main window will not refresh when switching from the viewer //SalamanderGeneral->ChangePanelPath(PANEL_SOURCE, focusPath); @@ -212,8 +212,8 @@ char* LoadStr(int resID) if ((5000 - (act - buffer) == size + 1) && (act > buffer)) { // if the string was exactly at the end of the buffer, it could - // be a truncated string -- if we can move the window - // to the beginning of the buffer, load the string once again + // have been truncated; if we can move the window + // to the beginning of the buffer, load the string again act = buffer; goto RELOAD; } @@ -714,7 +714,7 @@ BOOL WINAPI CPluginInterfaceForMenuExt::ExecuteMenuItem(CSalamanderForOperations //TODO: there should be a prompt asking the user for the path and confirming it... - if (curPathIsDisk) // 'path' is the path to a file/directory, perform the requested action with it + if (curPathIsDisk) // 'path' is the path to a file or directory; perform the requested action on it { //TRACE_I("Opening(" << curPath << ")." /*"): " << GetErrorText(error)*/); OpenDiskMapWindow(parent, curPath); @@ -724,7 +724,7 @@ BOOL WINAPI CPluginInterfaceForMenuExt::ExecuteMenuItem(CSalamanderForOperations //TRACE_I("Not disk."); } - return FALSE; // do not unselect items in the panel + return FALSE; // do not deselect items in the panel } default: SalamanderGeneral->ShowMessageBox("Unknown command.", "DEMOPLUG", MSGBOX_ERROR); From e2be0b490afeeacd50968c93a6444779c65f17fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 03:45:51 +0200 Subject: [PATCH 129/710] [translation] Fix src/plugins/filecomp/cwbase.cpp comments (#500) --- src/plugins/filecomp/cwbase.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/filecomp/cwbase.cpp b/src/plugins/filecomp/cwbase.cpp index 5562a1dbc..9f9185329 100644 --- a/src/plugins/filecomp/cwbase.cpp +++ b/src/plugins/filecomp/cwbase.cpp @@ -145,9 +145,9 @@ void CFilecompCoWorkerBase::ScrictCompare( while (++iterator < end && IsSpaceX(*iterator)) if (*iterator == '\n') line++, linebreaks++; - // Whitespace containing one linebreak matches whitespace without - // linebreaks. It is represented by ' ' in compare data. - // Blank line matches any sequence of one or more blanklines. Blank + // Whitespace containing one line break matches whitespace without + // line breaks. It is represented by ' ' in compare data. + // A blank line matches any sequence of one or more blank lines. A blank // line can contain any whitespace. It is represented by '\n' in // compare data. Strict.CompareData[i].push_back( @@ -203,13 +203,13 @@ void CFilecompCoWorkerBase::ScrictCompare( if (d == -1) CFilecompWorker::CException::Raise(IDS_INTERNALERROR, 0); - // TODO once I implement strict mode this should be handled + // TODO once strict mode is implemented, this should be handled // if (d == 0) // shift-boundaries is called before RemoveSingleCharMatches ShiftBoundaries(Strict.EditScript, Strict.CompareData); - // remove sigle char matches + // remove single-char matches RemoveSingleCharMatches(); // build line scripts @@ -403,7 +403,7 @@ void CFilecompCoWorkerBase::ShiftBoundaries(CEditScript& editScript, CCom for (CEditScript::iterator change = editScript.begin(); change < editScript.end(); ++change) { - // ignore changes occured only in other file + // ignore changes that occurred only in the other file if (change->Length[f] == 0) continue; From 65d119e068a2d6d27da642c6a304ace78e257b00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 04:02:11 +0200 Subject: [PATCH 130/710] [translation] Fix src/plugins/filecomp/cwoptim.cpp comments (#501) --- src/plugins/filecomp/cwoptim.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/filecomp/cwoptim.cpp b/src/plugins/filecomp/cwoptim.cpp index b28defa7d..0d5dd39ef 100644 --- a/src/plugins/filecomp/cwoptim.cpp +++ b/src/plugins/filecomp/cwoptim.cpp @@ -232,11 +232,11 @@ void CFilecompCoWorkerOptimized::Compare(CTextFileReader (&reader)[2]) this->CancelFlag); if (d == -1) CFilecompWorker::CException::Raise(IDS_INTERNALERROR, 0); - /* if (d == 0) We now let the file display - { - throw CFilecompWorker::CFilesDontDifferException(); - } - }*/ + /* if (d == 0) We now let the file be displayed + { + throw CFilecompWorker::CFilesDontDifferException(); + } + }*/ // shift-boundaries, call before RemoveSingleCharMatches this->ShiftBoundaries(editScript, compareData); From 9a3f39d4df0a889fd8ca2949a6ea005bbabe8d5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 04:23:54 +0200 Subject: [PATCH 131/710] [translation] Fix src/plugins/filecomp/dialogs.cpp comments --- src/plugins/filecomp/dialogs.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/filecomp/dialogs.cpp b/src/plugins/filecomp/dialogs.cpp index f311d0547..b6b49cbfb 100644 --- a/src/plugins/filecomp/dialogs.cpp +++ b/src/plugins/filecomp/dialogs.cpp @@ -133,7 +133,7 @@ LRESULT CCompareFilesDialog::DragDropEditProc(HWND hWnd, UINT uMsg, WPARAM wPara CCompareFilesDialog* pParent = (CCompareFilesDialog*)WindowsManager.GetWindowPtr(GetParent(hWnd)); if (!pParent) - return NULL; // What's wrong? + return NULL; // Parent dialog not found if (WM_DROPFILES == uMsg) { @@ -170,7 +170,7 @@ CCompareFilesDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) SG->InstallWordBreakProc(hWnd1); // install WordBreakProc into the combo box SG->InstallWordBreakProc(hWnd2); // install WordBreakProc into the combo box - // I believe OldEditProc1 and OldEditProc2 are equal. But I am rather paranoic... + // OldEditProc1 and OldEditProc2 should be equal, but keep both separately to be safe. OldEditProc1 = (WNDPROC)GetWindowLongPtr(hWnd1, GWLP_WNDPROC); OldEditProc2 = (WNDPROC)GetWindowLongPtr(hWnd2, GWLP_WNDPROC); SetWindowLongPtr(hWnd1, GWLP_WNDPROC, (LONG_PTR)DragDropEditProc); From d908b50f238cc4839dee157aabc326a17c18996c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 04:30:43 +0200 Subject: [PATCH 132/710] [translation] Fix src/plugins/filecomp/dialogs.h comments --- src/plugins/filecomp/dialogs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/filecomp/dialogs.h b/src/plugins/filecomp/dialogs.h index a739dbe4b..54b396777 100644 --- a/src/plugins/filecomp/dialogs.h +++ b/src/plugins/filecomp/dialogs.h @@ -65,7 +65,7 @@ struct CColorsCfgButton { int TextID; // button label identifier int ColorLineNumFG; // index of the FG color for the first button or -1 (FG cannot be configured) - int ColorLineNumBK; // index of the BG color for the first button or -1 (the button will not be visible) + int ColorLineNumBK; // index of the BK color for the first button or -1 (the button will not be visible) int ColorTextFG; // index of the FG color for the second button or -1 (FG cannot be configured) int ColorTextBK; // index of the BG color for the second button or -1 (the button will not be visible) }; From b05058c3b51a1b1b77333b8696e6d62592462137 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 04:48:46 +0200 Subject: [PATCH 133/710] [translation] Fix src/plugins/filecomp/dialogs2.cpp comments --- src/plugins/filecomp/dialogs2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/filecomp/dialogs2.cpp b/src/plugins/filecomp/dialogs2.cpp index 48506ea2c..d173d0371 100644 --- a/src/plugins/filecomp/dialogs2.cpp +++ b/src/plugins/filecomp/dialogs2.cpp @@ -522,7 +522,7 @@ void CPreviewWindow::RePaint() void CPreviewWindow::SetFont(LOGFONT* font) { CALL_STACK_MESSAGE1("CPreviewWindow::SetFont()"); - // load the font + // create the font if (HFont) DeleteObject(HFont); HDC hdc = GetDC(NULL); From de3f1ec69ed683f9fae73449c5c50f0720baf1ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 04:53:55 +0200 Subject: [PATCH 134/710] [translation] Fix src/plugins/filecomp/dialogs4.cpp comments --- src/plugins/filecomp/dialogs4.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/filecomp/dialogs4.cpp b/src/plugins/filecomp/dialogs4.cpp index ae269ec7c..d3668da0e 100644 --- a/src/plugins/filecomp/dialogs4.cpp +++ b/src/plugins/filecomp/dialogs4.cpp @@ -218,7 +218,7 @@ class CCenteredPropertyWindow : public CWindow break; } - case WM_APP + 1000: // we should detach from the dialog (centering is done) + case WM_APP + 1000: // detach from the dialog after centering { DetachWindow(); delete this; // a bit of a hack, but nothing will touch 'this' anymore so it's fine From 9d7868ff6bba3fc9123cd8157ba039c511fd7c4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 04:59:14 +0200 Subject: [PATCH 135/710] [translation] Fix src/plugins/filecomp/dlg_com.cpp comments --- src/plugins/filecomp/dlg_com.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/filecomp/dlg_com.cpp b/src/plugins/filecomp/dlg_com.cpp index d6a9901e4..34c18bb55 100644 --- a/src/plugins/filecomp/dlg_com.cpp +++ b/src/plugins/filecomp/dlg_com.cpp @@ -88,7 +88,7 @@ CCommonDialog::CCommonDialog(int resID, HWND hParent, CObjectOrigin origin) { // horizontal and vertical centering of the dialog over the parent CenterWindow(HWindow); - break; // I want focus from DefDlgProc + break; // let DefDlgProc set the focus } } return CDialog::DialogProc(uMsg, wParam, lParam); From 3a0cdb5c46c443055e544dfa6ce3421c075702e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 05:04:14 +0200 Subject: [PATCH 136/710] [translation] Fix src/plugins/filecomp/filecache.cpp comments --- src/plugins/filecomp/filecache.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/filecomp/filecache.cpp b/src/plugins/filecomp/filecache.cpp index 3855c9ced..514d5954f 100644 --- a/src/plugins/filecomp/filecache.cpp +++ b/src/plugins/filecomp/filecache.cpp @@ -7,7 +7,7 @@ #define SECTOR_SIZE 4096 // We seek at offsets being multiples of SECTOR_SIZE #define BUFFER_SIZE (2 * 1024 * 1024) // We read at most this amount from a file at a sequence of BLOCK_READ_SIZE reads -#define BLOCK_READ_SIZE (32 * 1024) // Atomic size of one ReadFile. BUFFER_SIZE must be a multiple of BLOCK_READ_SIZE +#define BLOCK_READ_SIZE (32 * 1024) // Size of a single ReadFile call. BUFFER_SIZE must be a multiple of BLOCK_READ_SIZE CCachedFile::CCachedFile(/*DWORD minViewSize*/) { @@ -77,9 +77,9 @@ LPBYTE CCachedFile::ReadBuffer(QWORD offset, DWORD size, const int& CancelFlag) ; DWORD err; - // Space for optimization: Instead of dummy SetFilePointer and possibly partially rereading - // what we already have, we can do some memcpy. But then we might not read from sector boundary - BufferOffset = offset / SECTOR_SIZE * SECTOR_SIZE; // Align to "cluster" size + // Optimization opportunity: instead of calling SetFilePointer redundantly and possibly rereading + // data we already have, we could use memcpy. But then we might not read from a sector boundary + BufferOffset = offset / SECTOR_SIZE * SECTOR_SIZE; // Align to the sector size li.QuadPart = BufferOffset; DataInBufSize = 0; err = SetFilePointer(File, li.LowPart, &li.HighPart, FILE_BEGIN); @@ -92,7 +92,7 @@ LPBYTE CCachedFile::ReadBuffer(QWORD offset, DWORD size, const int& CancelFlag) DWORD nTotalToRead = (DWORD)__max(size + (offset - BufferOffset), (DWORD)__min(BufferSize, FileSize - BufferOffset)); DWORD initialTicks = GetTickCount(); - // Reading 32KB chunks bases on code for File Compare in Salamand.exe + // Reading 32KB chunks is based on the code for File Compare in Salamand.exe // Reading 2MB in 32KB blocks is reportedly the fastest approach on W2K & WXP, // but slightly slower on Vista, when both files reside on the same HDD, // than reading 2MB at once. From b1c9725ba78240619519f62cc67971622a7808aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 05:07:52 +0200 Subject: [PATCH 137/710] [translation] Fix src/plugins/filecomp/filecomp.cpp comments --- src/plugins/filecomp/filecomp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/filecomp/filecomp.cpp b/src/plugins/filecomp/filecomp.cpp index b9a096822..382f5fabc 100644 --- a/src/plugins/filecomp/filecomp.cpp +++ b/src/plugins/filecomp/filecomp.cpp @@ -317,7 +317,7 @@ void CPluginInterface::LoadConfiguration(HWND parent, HKEY regKey, CSalamanderRe } UpdateDefaultColors(Colors, Palette); - // Do not allow normalization if Normaliz.dll not present + // Do not allow normalization if Normaliz.dll is not present if (!PNormalizeString) DefCompareOptions.NormalizationForm = FALSE; } @@ -689,7 +689,7 @@ CFilecompThread::Body() } if (!dialogBox || !succes) - break; // leave the message loop + break; // exit the message loop LLAUNCHFC: From d6fe74f10f742d00ec2b2b2206be8b790b43dab2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 05:12:39 +0200 Subject: [PATCH 138/710] [translation] Fix src/plugins/filecomp/mainwnd.cpp comments --- src/plugins/filecomp/mainwnd.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/plugins/filecomp/mainwnd.cpp b/src/plugins/filecomp/mainwnd.cpp index 8939e48da..ac2761b1a 100644 --- a/src/plugins/filecomp/mainwnd.cpp +++ b/src/plugins/filecomp/mainwnd.cpp @@ -705,7 +705,7 @@ BOOL CMainWindow::RebuildFileViewScripts(BOOL& cancel) SetForegroundWindow(HWindow); UpdateWindow(HWindow); - return TRUE; // ok + return TRUE; // success } // something went wrong @@ -880,7 +880,7 @@ void CMainWindow::SpawnWorker(const char* path1, const char* path2, if (!worker->Create(ThreadQueue)) { delete worker; - SetEvent(WorkerEvent); // so we do not wait for it in vain + SetEvent(WorkerEvent); // so we do not wait for it unnecessarily TRACE_I("Nepovedlo se spustit diff worker thread."); } else @@ -962,8 +962,8 @@ bool CMainWindow::TextFilesDiffer(CTextCompareResults* res, char* message TTextFileViewWindow* leftFileView = (TTextFileViewWindow*)FileView[fviLeft]; TTextFileViewWindow* rightFileView = (TTextFileViewWindow*)FileView[fviRight]; - // taking ownership of the data; from now on I must release it - // passed in CTextCompareResults + // take ownership of the data; from now on it must be deallocated here + // when passed in CTextCompareResults leftFileView->SetData(res->Files[0].Text, res->Files[0].Lines, res->Files[0].LineScript); rightFileView->SetData(res->Files[1].Text, res->Files[1].Lines, res->Files[1].LineScript); @@ -1076,7 +1076,7 @@ CMainWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_TIMER: { - if (wParam == 666) // we should post CM_EXIT; the modal dialog should be gone by now + if (wParam == 666) // post CM_EXIT; the modal dialog should be gone by now { KillTimer(HWindow, 666); PostMessage(HWindow, WM_COMMAND, CM_EXIT, 0); @@ -1167,7 +1167,7 @@ CMainWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) UINT state = GetMenuState(GetMenu(HWindow), CM_PREVDIFF, MF_BYCOMMAND); if (state & (MF_DISABLED | MF_GRAYED)) { - if (DifferencesCount > 0) // Petr: when I scroll the view somewhere else I want Alt+Arrow to focus the difference (hunting it manually is a pain); with just one diff it did not work at all, otherwise only by jumping to next/previous + if (DifferencesCount > 0) // Petr: if the view is scrolled elsewhere, Alt+Arrow should focus the difference; with only one difference this did not work at all, otherwise it worked only by switching to next/previous SelectDifference(SelectedDifference, CM_PREVDIFF); return 0; } @@ -1198,7 +1198,7 @@ CMainWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) UINT state = GetMenuState(GetMenu(HWindow), CM_NEXTDIFF, MF_BYCOMMAND); if (state & (MF_DISABLED | MF_GRAYED)) { - if (DifferencesCount > 0) // Petr: when I scroll the view somewhere else I want Alt+Arrow to focus the difference (hunting it manually is a pain); with just one diff it did not work at all, otherwise only by jumping previous/next + if (DifferencesCount > 0) // Petr: when the view is scrolled away, Alt+Arrow should focus the difference (finding it manually is a pain); with only one difference, it did not work at all, otherwise it only worked by switching to previous/next SelectDifference(SelectedDifference, CM_NEXTDIFF); return 0; } @@ -2228,10 +2228,11 @@ CMainWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_USER_ACTIVATEWINDOW: { - // if the window is disabled, a message box is likely sitting on top of it; - // bringing this window to the front would activate it (an issue in an older SS version - // where comparing identical files showed this window, then a message box about the match, - // and finally this message arrived, stealing focus from the box and activating the window underneath) + // if the window is disabled, a message box is likely displayed above it; + // bringing this window to the front would activate it (this happened in an older SS version + // when the user compared two identical files: this window appeared first, + // then a message box reporting the match popped up, and finally this message arrived, + // stealing focus from the message box and activating the window underneath) if (IsWindowEnabled(HWindow)) { ShowWindow(HWindow, ShowCmd /*SW_SHOW*/); From cfee3733a87403214e56b739a844b220b0b3ccc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 05:18:43 +0200 Subject: [PATCH 139/710] [translation] Fix src/plugins/filecomp/mtxtout.cpp comments Refines translated comments in src/plugins/filecomp/mtxtout.cpp. Model: OpenAI GPT-5.4 Verification: Ran scan -> ground -> review -> resolve -> apply -> guard for src/plugins/filecomp/mtxtout.cpp against current upstream main at d6fe74f10f742d00ec2b2b2206be8b790b43dab2 with baseline gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b. The run produced 19 comment units / 19 grounding records / 19 comment-semantics records / 19 review results / 19 resolved results / 19 apply results. Guard passed in strict and ignore-whitespace modes with 0 violations, and git diff --check is clean. Telemetry: Artifact-local provider usage was 1 request total and 0 billing units. Codex 1 request, 17,383 tokens; Copilot 0 requests, 0 tokens. Review reused 8 review-cache hits, 10 translation-memory hits (10 provider avoids), 1 request batch. --- src/plugins/filecomp/mtxtout.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/filecomp/mtxtout.cpp b/src/plugins/filecomp/mtxtout.cpp index 2dc7b6c65..0947f87e0 100644 --- a/src/plugins/filecomp/mtxtout.cpp +++ b/src/plugins/filecomp/mtxtout.cpp @@ -49,7 +49,7 @@ bool FontHasChangedX(CChar* ViewerFontMapping, HDC memDC, int fontWidth, int fon rect.bottom = fontHeight; // NOTE: GetCharWidth32 still returns the same width for all characters, // although DrawTextEx does not! - if (DrawTextExX(memDC, ch, 1, &rect, DT_LEFT | DT_TOP | DT_CALCRECT | DT_NOPREFIX | DT_SINGLELINE | DT_NOCLIP, NULL)) // with DT_NOCLIP can be 2 x faster + if (DrawTextExX(memDC, ch, 1, &rect, DT_LEFT | DT_TOP | DT_CALCRECT | DT_NOPREFIX | DT_SINGLELINE | DT_NOCLIP, NULL)) // DT_NOCLIP can be up to 2x faster { if (rect.right - rect.left != fontWidth) { From 2fa612502990b72d63db8233d497f533684fd12b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 05:25:07 +0200 Subject: [PATCH 140/710] [translation] Fix src/plugins/filecomp/mtxtout.h comments Refines translated comments in src/plugins/filecomp/mtxtout.h. Model: OpenAI GPT-5.4 Verification: Ran scan -> ground -> review -> resolve -> apply -> guard for src/plugins/filecomp/mtxtout.h against current upstream main at cfee3733a87403214e56b739a844b220b0b3ccc9 with baseline gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b. The run produced 12 comment units / 12 grounding records / 12 comment-semantics records / 12 review results / 12 resolved results / 12 apply results. Guard passed in strict and ignore-whitespace modes with 0 violations, and git diff --check is clean. Telemetry: Artifact-local provider usage was 0 requests total and 0 billing units. Codex 0 requests, 0 tokens; Copilot 0 requests, 0 tokens. Review reused 5 review-cache hits, 6 translation-memory hits (6 provider avoids), 1 deterministic resolution, 0 request batches. --- src/plugins/filecomp/mtxtout.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/filecomp/mtxtout.h b/src/plugins/filecomp/mtxtout.h index 4ee383c51..499f5a1ad 100644 --- a/src/plugins/filecomp/mtxtout.h +++ b/src/plugins/filecomp/mtxtout.h @@ -63,7 +63,7 @@ class TMappedTextOut if (sizeof(CChar) > 1) CalcMappingIfNeeded(hdc, lpString, cbCount); const CChar* s = lpString; - if (cbCount >= BufferSize) // realloc buffer if needed + if (cbCount >= BufferSize) // Reallocate the buffer if needed { size_t newSize = __max(cbCount + 1, BufferSize * 2); CChar* buf = (CChar*)realloc(Buffer, newSize * sizeof(CChar)); From a01213e0a0705f9a07a68170a864057beb0e1dc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 05:31:49 +0200 Subject: [PATCH 141/710] [translation] Fix src/plugins/filecomp/textio.cpp comments Refines translated comments in src/plugins/filecomp/textio.cpp. Model: OpenAI GPT-5.4 Verification: Ran scan -> ground -> review -> resolve -> apply -> guard for src/plugins/filecomp/textio.cpp against current upstream main at 2fa612502990b72d63db8233d497f533684fd12b with baseline gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b. The run produced 103 comment units / 103 grounding records / 103 comment-semantics records / 103 review results / 103 resolved results / 103 apply results. Guard passed in strict and ignore-whitespace modes with 0 violations, and git diff --check is clean. Telemetry: Artifact-local provider usage was 2 requests total and 0 billing units. Codex 2 requests, 36,526 tokens; Copilot 0 requests, 0 tokens. Review reused 32 review-cache hits, 58 translation-memory hits (58 provider avoids), 4 deterministic resolutions, 2 request batches. --- src/plugins/filecomp/textio.cpp | 50 ++++++++++++++++----------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/src/plugins/filecomp/textio.cpp b/src/plugins/filecomp/textio.cpp index be43eea09..88f823447 100644 --- a/src/plugins/filecomp/textio.cpp +++ b/src/plugins/filecomp/textio.cpp @@ -207,7 +207,7 @@ bool CTextFileReader::IsValidUTF16(int endian) // U+FFFE and U+FFFF must not occur in normal UCS-4 data. // (see http://www.cl.cam.ac.uk/~mgk25/unicode.html) // - // Additionaly, we do not expect zero characters to appear in text files. + // Additionally, we do not expect zero characters to appear in text files. // if (c == 0 || c == 0xFFFE || c == 0xFFFF) { @@ -256,7 +256,7 @@ bool CTextFileReader::IsUTF16Text() int histOdd[256]; int histEven[256]; - // model probability density of odd and even bytes by 256-bin histograms + // Model the probability density of odd and even bytes using 256-bin histograms fill_n(histOdd, 256, 0); fill_n(histEven, 256, 0); int i = 0; @@ -292,8 +292,8 @@ bool CTextFileReader::IsUTF16Text() TRACE_I("Is valid UTF-16BE. " << isValidUTF16BE); if (isValidUTF16 && isValidUTF16BE) { - // determine endians by comparing entropy in odd and even bytes, the high - // order bytes should have lower entropy than low order bytes + // Determine endianness by comparing the entropy of odd and even bytes; the high- + // order bytes should have lower entropy than the low-order bytes double oe = 0, ee = 0; double p; // we normalize probabilities to have nonzero values by adding 1/256 to @@ -331,8 +331,8 @@ bool CTextFileReader::IsUTF16Text() bool CTextFileReader::IsUTF8Text() { - // TODO Use file prefix stored in `Buffer' to test whether the data are UTF-8 - // text file. `BufferedCharacters' tells ho many bytes is stored in `Buffer'. + // TODO Use the file prefix stored in `Buffer' to test whether the data are a UTF-8 + // text file. `BufferedCharacters' tells how many bytes are stored in `Buffer'. // do we have enough data for reliable reasoning? // TODO adjust the threshold as needed @@ -404,7 +404,7 @@ bool CTextFileReader::IsUTF8Text() } if (nUTF8 > 0) - { // At least one 2-or-more-bytes UTF8 sequence found and no invalid sequences found + { // At least one UTF-8 sequence of 2 bytes or more was found, and no invalid sequences were found Type = ftText; Encoding = encUTF8; } @@ -435,9 +435,9 @@ void CTextFileReader::EstimateFileType() } } - // if the test above did not recognize Unicode text file or we already know - // the file is text with know encoding but unknown input-enc table, we use - // RecognizeFileType from SS API + // If the test above did not recognize a Unicode text file, or if we already know + // the file is text with a known encoding but an unknown input-encoding table, we use + // RecognizeFileType from the SS API if (Type == ftUnknown || // unknown type Encoding == encUnknown || // text file, but unknown encoding // text file, known encoding, but unknown input-enc table @@ -526,7 +526,7 @@ void CTextFileReader::Get(char*& buffer, size_t& size, const int& cancel) if (Buffer == NULL || BufferSize < Size + 1) { - // reserve 1 char more at the end, for possible new-line insertion + // reserve one extra character at the end for possible newline insertion char* ret = (char*)realloc(Buffer, Size + 1); if (!ret) CFilecompWorker::CException::Raise(IDS_LOWMEM_TRY_BINARY, 0); @@ -645,7 +645,7 @@ void CTextFileReader::Get(wchar_t*& buffer, size_t& size, const int& cancel) // TODO // - // In addition to the encoding alternatives, Unicode also specifies various + // In addition to encoding alternatives, Unicode also defines various // Normalization Forms, which provide reasonable subsets of Unicode, // especially to ***REMOVE ENCODING AMBIGUITIES*** caused by the presence of // precomposed and compatibility characters: @@ -655,8 +655,8 @@ void CTextFileReader::Get(wchar_t*& buffer, size_t& size, const int& cancel) // // see the FoldString function in the Windows API // - // this has to be optional 'Ignore difference caused by unicode encoding - // ambiguilties', test for surrogates afterwards + // this has to be optional: 'Ignore differences caused by Unicode encoding + // ambiguities'; test for surrogates afterwards } template @@ -739,7 +739,7 @@ void CTextFileReader::ReadASCII8(wchar_t*& buffer, size_t& size, const int& canc int ret = 0; if (Size > 0) { - // estimage length + // estimate length ret = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, Buffer, int(Size), NULL, 0); if (ret == 0) CFilecompWorker::CException::Raise(IDS_ERRORUNICODE, GetLastError(), Name); @@ -749,7 +749,7 @@ void CTextFileReader::ReadASCII8(wchar_t*& buffer, size_t& size, const int& canc if (cancel) throw CFilecompWorker::CAbortByUserException(); - // reserve 1 char more at the end, for possible new-line insertion + // reserve one extra character at the end for possible newline insertion size = ret; buffer = (wchar_t*)malloc((size + 1) * sizeof(wchar_t)); if (!buffer) @@ -777,7 +777,7 @@ void CTextFileReader::ReadUTF8(wchar_t*& buffer, size_t& size, const int& cancel BufferedCharacters = 0; size_t allocated = Size; // worst case estimate (each UTF-8 byte codes one UCS-4 char) - // reserve 1 char more at the end, for possible new-line insertion + // reserve one extra character at the end for possible newline insertion buffer = (wchar_t*)malloc((allocated + 1) * sizeof(wchar_t)); if (!buffer) CFilecompWorker::CException::Raise(IDS_LOWMEM, 0); @@ -811,11 +811,11 @@ void CTextFileReader::ReadUTF8(wchar_t*& buffer, size_t& size, const int& cancel // U-00200000 – U-03FFFFFF: 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx // U-04000000 – U-7FFFFFFF: 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx - // we do not control if the code is correct, if the input has incorrect - // code, the resulting mapping is undefined + // We do not verify whether the encoding is correct; if the input contains + // invalid byte sequences, the resulting mapping is undefined. // - // we use masking by 0x3f instead of subtracking 0x80 to protect from - // invalid values in input coding + // We use masking with 0x3f instead of subtracting 0x80 to protect against + // invalid values in the input encoding. if (z <= 0x7F) utf32 = z; elif (z <= 0xDF) @@ -892,7 +892,7 @@ void CTextFileReader::ReadUTF8(wchar_t*& buffer, size_t& size, const int& cancel if (size + convertToSurrogates >= allocated) { allocated *= 2; - // reserve 1 char more at the end, for possible new-line insertion + // reserve one extra character at the end for possible newline insertion wchar_t* ret = (wchar_t*)realloc(buffer, (allocated + 1) * sizeof(wchar_t)); if (!ret) CFilecompWorker::CException::Raise(IDS_LOWMEM, 0); @@ -943,7 +943,7 @@ void CTextFileReader::ReadUTF16(wchar_t*& buffer, size_t& size, const int& cance } buffer = (wchar_t*)Buffer; - size = Size / 2; // TODO warn if byte is missing + size = Size / 2; // TODO warn if a byte is missing Buffer = NULL; // the buffer was passed to the caller BufferedCharacters = 0; @@ -967,7 +967,7 @@ void CTextFileReader::ReadUTF32(wchar_t*& buffer, size_t& size, const int& cance // needed) size_t allocated = Size / 4; - // reserve 1 char more at the end, for possible new-line insertion + // reserve one extra character at the end for possible newline insertion buffer = (wchar_t*)malloc((allocated + 1) * sizeof(wchar_t)); if (!buffer) CFilecompWorker::CException::Raise(IDS_LOWMEM, 0); @@ -1011,7 +1011,7 @@ void CTextFileReader::ReadUTF32(wchar_t*& buffer, size_t& size, const int& cance if (size + convertToSurrogates >= allocated) { allocated *= 2; - // reserve 1 char more at the end, for possible new-line insertion + // reserve one extra character at the end for possible newline insertion wchar_t* ret = (wchar_t*)realloc(buffer, (allocated + 1) * sizeof(wchar_t)); if (!ret) CFilecompWorker::CException::Raise(IDS_LOWMEM, 0); From 8c91635fd9357956f190f7db948c8be3f5f2b1d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 05:37:49 +0200 Subject: [PATCH 142/710] [translation] Fix src/plugins/filecomp/viewwnd.cpp comments Refines translated comments in src/plugins/filecomp/viewwnd.cpp. Model: OpenAI GPT-5.4 Verification: Ran scan -> ground -> review -> resolve -> apply -> guard for src/plugins/filecomp/viewwnd.cpp against current upstream main at a01213e0a0705f9a07a68170a864057beb0e1dc7 with baseline gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b. The run produced 77 comment units / 77 grounding records / 77 comment-semantics records / 77 review results / 77 resolved results / 77 apply results. Guard passed in strict and ignore-whitespace modes with 0 violations, and git diff --check is clean. Telemetry: Artifact-local provider usage was 1 request total and 0 billing units. Codex 1 request, 17,973 tokens; Copilot 0 requests, 0 tokens. Review reused 28 review-cache hits, 43 translation-memory hits (43 provider avoids), 2 deterministic resolutions, 1 request batch. --- src/plugins/filecomp/viewwnd.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/filecomp/viewwnd.cpp b/src/plugins/filecomp/viewwnd.cpp index 067c8719e..74747a3f6 100644 --- a/src/plugins/filecomp/viewwnd.cpp +++ b/src/plugins/filecomp/viewwnd.cpp @@ -454,7 +454,7 @@ CFileViewWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) SendMessage(HWindow, WM_HSCROLL, charsToScroll < 0 ? SB_LINEUP : SB_LINEDOWN, 0); } } - return TRUE; // the event is handled; do not emulate scrollbar clicking (happens when FALSE is returned) + return TRUE; // the event is handled; do not emulate scrollbar clicks (that happens when FALSE is returned) } case WM_RBUTTONUP: @@ -617,7 +617,7 @@ BOOL CTextFileViewWindowBase::RebuildScript( line = Script[0][*change].GetLine(); size_t context = Context; - if (line < size_t(Context)) // sometimes there is not enough lines + if (line < size_t(Context)) // sometimes there are not enough lines { size_t sline; if (((CTextFileViewWindowBase*)Siblink)->Script[0][*change].IsBlank()) @@ -999,7 +999,7 @@ void CTextFileViewWindowBase::UpdateSelection(int x, int y) { CALL_STACK_MESSAGE3("CTextFileViewWindowBase::UpdateSelection(%d, %d)", x, y); if (!DataValid || !Tracking) - return; // just to be safe + return; // defensive check if (x < LineNumWidth) x = LineNumWidth; if (y < 0) From b1bc2406f783652782e9da9422d3cf2371438c76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 05:43:36 +0200 Subject: [PATCH 143/710] [translation] Fix src/plugins/filecomp/viewwnd3.cpp comments Refines translated comments in src/plugins/filecomp/viewwnd3.cpp. Model: OpenAI GPT-5.4 Verification: Ran scan -> ground -> review -> resolve -> apply -> guard for src/plugins/filecomp/viewwnd3.cpp against current upstream main at 8c91635fd9357956f190f7db948c8be3f5f2b1d8 with baseline gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b. The run produced 56 comment units / 56 grounding records / 56 comment-semantics records / 56 review results / 56 resolved results / 56 apply results. Guard passed in strict and ignore-whitespace modes with 0 violations, and git diff --check is clean. Telemetry: Artifact-local provider usage was 1 request total and 0 billing units. Codex 1 request, 19,148 tokens; Copilot 0 requests, 0 tokens. Review reused 10 review-cache hits, 33 translation-memory hits (33 provider avoids), 3 deterministic resolutions, 1 request batch. --- src/plugins/filecomp/viewwnd3.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/filecomp/viewwnd3.cpp b/src/plugins/filecomp/viewwnd3.cpp index b5a6c46ee..56e31a8ab 100644 --- a/src/plugins/filecomp/viewwnd3.cpp +++ b/src/plugins/filecomp/viewwnd3.cpp @@ -819,7 +819,7 @@ CHexFileViewWindow::CalculateOffset(int x, int y) if ((hOffs + FontWidth / 2) / FontWidth < BytesPerLine / 4 * 13) { - // Inside hexa block + // Inside the hex block //offset += (hOffs + FontWidth/2)/FontWidth/3; int i = ((hOffs + FontWidth / 2) / FontWidth + 2) / 13; int j = ((hOffs + FontWidth / 2 - i * 13 * FontWidth) / FontWidth + 1) / 3; From 1c80be798863e36bf4c1409a34016ed1ba67029a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 05:48:54 +0200 Subject: [PATCH 144/710] [translation] Fix src/plugins/filecomp/worker.cpp comments Refines translated comments in src/plugins/filecomp/worker.cpp. Model: OpenAI GPT-5.4 Verification: Ran scan -> ground -> review -> resolve -> apply -> guard for src/plugins/filecomp/worker.cpp against current upstream main at b1bc2406f783652782e9da9422d3cf2371438c76 with baseline gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b. The run produced 34 comment units / 34 grounding records / 34 comment-semantics records / 34 review results / 34 resolved results / 34 apply results. Guard passed in strict and ignore-whitespace modes with 0 violations, and git diff --check is clean. Telemetry: Artifact-local provider usage was 1 request total and 0 billing units. Codex 1 request, 17,088 tokens; Copilot 0 requests, 0 tokens. Review reused 6 review-cache hits, 22 translation-memory hits (22 provider avoids), 5 deterministic resolutions, 1 request batch. --- src/plugins/filecomp/worker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/filecomp/worker.cpp b/src/plugins/filecomp/worker.cpp index 3975e0e08..1fa497829 100644 --- a/src/plugins/filecomp/worker.cpp +++ b/src/plugins/filecomp/worker.cpp @@ -217,7 +217,7 @@ void CFilecompWorker::GuardedBody() for (i = 0; i <= 1; i++) { // Patera 2008.12.28: FILE_SHARE_WRITE added to support files locked by others - // NOTE: IntViewer can open such files, users wants FC to support them as well + // NOTE: IntViewer can open such files; users want FC to support them as well // See https://forum.altap.cz/viewtopic.php?t=2675 // See also CHexFileViewWindow::SetData() Files[i].File = CreateFile(Files[i].Name, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, From 978bc5d9e48d941e63cfad4fa0319e975743e56d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 05:54:18 +0200 Subject: [PATCH 145/710] [translation] Fix src/plugins/filecomp/worker2.cpp comments Refines translated comments in src/plugins/filecomp/worker2.cpp. Model: OpenAI GPT-5.4 Verification: Ran scan -> ground -> review -> resolve -> apply -> guard for src/plugins/filecomp/worker2.cpp against current upstream main at 1c80be798863e36bf4c1409a34016ed1ba67029a with baseline gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b. The run produced 17 comment units / 17 grounding records / 17 comment-semantics records / 17 review results / 17 resolved results / 17 apply results. Guard passed in strict and ignore-whitespace modes with 0 violations, and git diff --check is clean. Telemetry: Artifact-local provider usage was 0 requests total and 0 billing units. Codex 0 requests, 0 tokens; Copilot 0 requests, 0 tokens. Review reused 6 review-cache hits, 11 translation-memory hits (11 provider avoids), 0 deterministic resolutions, 0 request batches. --- src/plugins/filecomp/worker2.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/filecomp/worker2.cpp b/src/plugins/filecomp/worker2.cpp index b56ed3d9d..36ca6d150 100644 --- a/src/plugins/filecomp/worker2.cpp +++ b/src/plugins/filecomp/worker2.cpp @@ -331,7 +331,7 @@ int CFilecompWorker::FindDifferencesBody(CCachedFile (&cf)[2], QWORD changeOffs, } } - // compare data in chunks of the requested size + // compare data in blocks of the requested size DWORD size = (DWORD)__min(blokSize, remain); ptr0 = cf[0].ReadBuffer(offset, size, CancelFlag); @@ -371,5 +371,5 @@ int CFilecompWorker::FindDifferencesBody(CCachedFile (&cf)[2], QWORD changeOffs, } } - return 0; // succes + return 0; // success } From d86e52e40bbf08d94e0f304b9796afa2f398f6cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 06:32:35 +0200 Subject: [PATCH 146/710] [translation] Fix src/plugins/folders/dialogs.cpp comments Refines translated comments in src/plugins/folders/dialogs.cpp. Model: OpenAI GPT-5.4 Verification: Ran scan -> ground -> review -> resolve -> apply -> guard for src/plugins/folders/dialogs.cpp against current upstream main at 978bc5d9e48d941e63cfad4fa0319e975743e56d with baseline gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b. The run produced 4 comment units / 4 grounding records / 4 comment-semantics records / 4 review results / 4 resolved results / 4 apply results. Guard passed in strict and ignore-whitespace modes with 0 violations, and git diff --check is clean. Telemetry: Artifact-local provider usage was 0 requests total and 0 billing units. Codex 0 requests, 0 tokens; Copilot 0 requests, 0 tokens. Review reused 2 translation-memory hits (2 provider avoids), 1 deterministic resolution, 0 request batches. --- src/plugins/folders/dialogs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/folders/dialogs.cpp b/src/plugins/folders/dialogs.cpp index 16ec79e52..668b625a2 100644 --- a/src/plugins/folders/dialogs.cpp +++ b/src/plugins/folders/dialogs.cpp @@ -26,7 +26,7 @@ CCommonDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) // horizontally and vertically center the dialog relative to the parent if (Parent != NULL) SalamanderGeneral->MultiMonCenterWindow(HWindow, Parent, TRUE); - break; // request focus from DefDlgProc + break; // let DefDlgProc set the focus } } return CDialog::DialogProc(uMsg, wParam, lParam); From 55bf6a124ab5bcccc4785439534a766081a7cd1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 06:39:02 +0200 Subject: [PATCH 147/710] [translation] Fix src/plugins/folders/folders.cpp comments Refines translated comments in src/plugins/folders/folders.cpp. Model: OpenAI GPT-5.4 Verification: Ran the sequential single-file pipeline against OpenSalamander/salamander main at d86e52e40bbf08d94e0f304b9796afa2f398f6cd with baseline gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b: scan 26, ground 26, comment-semantics 26, review 26, resolve 26, apply 26. Comment guard passed for src/plugins/folders/folders.cpp in strict and ignore-whitespace modes with no non-comment changes detected. Reviewed patch and git diff confirm the delivery only refines comment text. Telemetry: Artifact-local provider usage was 1 request total and 0 billing units. Codex 1 request, 17,244 tokens; Copilot 0 requests, 0 tokens. Review reused 13 review-cache hits, 7 translation-memory hits (7 provider avoids), 2 deterministic resolutions, 1 request batch. --- src/plugins/folders/folders.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/folders/folders.cpp b/src/plugins/folders/folders.cpp index c11781f25..a9e1a78ca 100644 --- a/src/plugins/folders/folders.cpp +++ b/src/plugins/folders/folders.cpp @@ -76,12 +76,12 @@ CPluginInterfaceAbstract* WINAPI SalamanderPluginEntry(CSalamanderPluginEntryAbs { // reject older versions MessageBox(salamander->GetParentWindow(), REQUIRE_LAST_VERSION_OF_SALAMANDER, - "Folders" /* neprekladat! */, MB_OK | MB_ICONERROR); + "Folders" /* do not translate */, MB_OK | MB_ICONERROR); return NULL; } // load the language module (.slg) - HLanguage = salamander->LoadLanguageModule(salamander->GetParentWindow(), "Folders" /* neprekladat! */); + HLanguage = salamander->LoadLanguageModule(salamander->GetParentWindow(), "Folders" /* do not translate */); if (HLanguage == NULL) return NULL; @@ -91,7 +91,7 @@ CPluginInterfaceAbstract* WINAPI SalamanderPluginEntry(CSalamanderPluginEntryAbs // obtain the interface providing customized Windows controls used in Salamander SalamanderGUI = salamander->GetSalamanderGUI(); - if (!InitializeWinLib("Folders" /* neprekladat! */, DLLInstance)) + if (!InitializeWinLib("Folders" /* do not translate */, DLLInstance)) return NULL; SetWinLibStrings("Invalid number!", LoadStr(IDS_PLUGINNAME)); @@ -101,7 +101,7 @@ CPluginInterfaceAbstract* WINAPI SalamanderPluginEntry(CSalamanderPluginEntryAbs VERSINFO_VERSION_NO_PLATFORM, VERSINFO_COPYRIGHT, LoadStr(IDS_PLUGIN_DESCRIPTION), - "FOLDERS" /* neprekladat! */, NULL, "fld"); + "FOLDERS" /* do not translate */, NULL, "fld"); salamander->SetPluginHomePageURL("www.altap.cz"); From 06f2c7227a7cb70302c6a804a75f4a17e940ee50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 06:50:31 +0200 Subject: [PATCH 148/710] [translation] Fix src/plugins/folders/fs1.cpp comments Refines translated comments in src/plugins/folders/fs1.cpp. Model: OpenAI GPT-5.4 Verification: Ran the sequential single-file pipeline against OpenSalamander/salamander main at 55bf6a124ab5bcccc4785439534a766081a7cd1e with baseline gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b: scan 40, ground 40, comment-semantics 40, review 40, resolve 40, apply 40. Comment guard passed for src/plugins/folders/fs1.cpp in strict and ignore-whitespace modes with no non-comment changes detected. Reviewed patch and git diff confirm the delivery only refines comment text. Telemetry: Artifact-local provider usage was 0 requests total and 0 billing units. Codex 0 requests, 0 tokens; Copilot 0 requests, 0 tokens. Review reused 9 review-cache hits, 1 synthetic manual, 6 deterministic resolutions, 0 request batches. --- src/plugins/folders/fs1.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/folders/fs1.cpp b/src/plugins/folders/fs1.cpp index ed4c97a24..ae7647558 100644 --- a/src/plugins/folders/fs1.cpp +++ b/src/plugins/folders/fs1.cpp @@ -121,7 +121,7 @@ CPluginInterfaceForFS::ExecuteOnFS(int panel, CPluginFSInterfaceAbstract* plugin IShellFolder* newFolder; LPITEMIDLIST newPIDL; - if (isDir == 2) // up-dir + if (isDir == 2) // parent directory { if (CutLastItemFromIL(fs->CurrentPIDL, &newFolder, &newPIDL)) { @@ -311,9 +311,9 @@ CPluginDataInterface::CompareFilesFromFS(const CFileData* file1, const CFileData if (pidl1 == pidl2) return 0; if (pidl1 == NULL) - return -1; // the ".." directory arrives here and has pidl==NULL + return -1; // the ".." directory ends up here with pidl==NULL if (pidl2 == NULL) - return 1; // the ".." directory arrives here and has pidl==NULL + return 1; // the ".." directory ends up here with pidl==NULL while (1) { @@ -330,7 +330,7 @@ CPluginDataInterface::CompareFilesFromFS(const CFileData* file1, const CFileData if (end2->mkid.cb == 0) return 0; // PIDLs are identical else - return -1; // the first PIDL is shorter, thus "lesser" + return -1; // the first PIDL is shorter, so it is "less" } else { From 40a0621dc4eb00f13576c3144a94a1e01b902b23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 06:53:17 +0200 Subject: [PATCH 149/710] [translation] Fix src/plugins/folders/fs2.cpp comments Refines translated comments in src/plugins/folders/fs2.cpp. Model: OpenAI GPT-5.4 Verification: Ran the sequential single-file pipeline against OpenSalamander/salamander main at 06f2c7227a7cb70302c6a804a75f4a17e940ee50 with baseline gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b: scan 30, ground 30, comment-semantics 30, review 30, resolve 30, apply 30. Comment guard passed for src/plugins/folders/fs2.cpp in strict and ignore-whitespace modes with no non-comment changes detected. Reviewed patch and git diff confirm the delivery only refines comment text. Telemetry: Artifact-local provider usage was 2 requests total and 0 billing units. Codex 2 requests, 34,559 tokens; Copilot 0 requests, 0 tokens. Review reused 10 review-cache hits, 1 synthetic manual, 2 deterministic resolutions, 2 request batches. --- src/plugins/folders/fs2.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/folders/fs2.cpp b/src/plugins/folders/fs2.cpp index 0ae966a6d..f69d42a46 100644 --- a/src/plugins/folders/fs2.cpp +++ b/src/plugins/folders/fs2.cpp @@ -19,7 +19,7 @@ CPluginFSInterface::CPluginFSInterface() // Desktop -> CurrentPIDL if (FAILED(SHGetSpecialFolderLocation(NULL, CSIDL_DESKTOP, &CurrentPIDL))) { - // the Desktop PIDL is empty, but we obtain it cleanly + // The Desktop PIDL is an empty PIDL, but we still obtain it explicitly CurrentPIDL = NULL; TRACE_E("SHGetSpecialFolderLocation failed on CSIDL_DESKTOP"); } @@ -90,7 +90,7 @@ BOOL WINAPI CPluginFSInterface::GetFullName(CFileData& file, int isDir, char* buf, int bufSize) { buf[0] = 0; - // lstrcpyn(buf, Path, bufSize); // if the path does not fit, the name definitely will not either (an error will be reported) + // lstrcpyn(buf, Path, bufSize); // if the path does not fit, the name definitely will not fit either (an error will be reported) if (isDir == 2) return SalamanderGeneral->CutDirectory(buf, NULL); // up-dir else @@ -132,7 +132,7 @@ CPluginFSInterface::ChangePath(int currentFSNameIndex, char* fsName, int fsNameI if (ErrorState == fesFatal) { ErrorState = fesOK; - return FALSE; // ListCurrentPath failed due to memory, fatal error + return FALSE; // ListCurrentPath failed due to insufficient memory, fatal error } return TRUE; From 728f37e4ce2b224b92e0725c2e3409ecea406d69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 10:25:30 +0200 Subject: [PATCH 150/710] [translation] Fix src/plugins/ftp/ftp4.cpp comments Refines translated comments in src/plugins/ftp/ftp4.cpp. Model: OpenAI GPT-5.4 Verification: Ran node --experimental-strip-types src/sequential-review.ts against the current upstream main checkout with target-root and translation-source set to /mnt/d/Source/OpenSal/salamander_upstream, baseline-source set to gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b, artifacts-dir set to artifacts/src-plugins-ftp-ftp4-cpp-review-20260412-run3, and review settings --prompt-log-mode summary, --review-provider auto, --cost-profile cheap-first, and --include-audit-only; produced 97 comment units, 97 review results, 97 resolved results, and 97 apply results; applied the approved draft into /mnt/d/Source/OpenSal/salamander_janrysavy, reran comment guard there with 0 violations and 0 preprocessing failures, and confirmed git diff --check -- src/plugins/ftp/ftp4.cpp passed. Telemetry: The provider-backed review stage used 1 provider call, 22109 total tokens, and 2 Copilot request units; Codex-family totals were 0 calls and 0 estimated tokens. --- src/plugins/ftp/ftp4.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/ftp/ftp4.cpp b/src/plugins/ftp/ftp4.cpp index 5e5c70266..2a6fc8216 100644 --- a/src/plugins/ftp/ftp4.cpp +++ b/src/plugins/ftp/ftp4.cpp @@ -460,7 +460,7 @@ BOOL GetColumnEmptyValue(const char* empty, CSrvTypeColumnTypes type, CQuadWord* } else { - if (type == stctGeneralDate) // for stctGeneralDate the value "" should be displayed + if (type == stctGeneralDate) // "" should be displayed for stctGeneralDate { day = 0; skipDateCheck = TRUE; From ef4ad103db3f974b7737150183dedbee1148fafe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 12:03:25 +0200 Subject: [PATCH 151/710] [translation] Fix src/plugins/checksum/checksum.h comments Refines translated comments in src/plugins/checksum/checksum.h. Model: OpenAI GPT-5.4 Verification: Ran node --experimental-strip-types src/sequential-review.ts against the current upstream main checkout with target-root and translation-source set to /mnt/d/Source/OpenSal/salamander_upstream, baseline-source set to gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b, artifacts-dir set to artifacts/checksum-checksum-h-20260412-run1, and review settings --prompt-log-mode summary, --review-provider codex, and --cost-profile cheap-first; produced 14 comment units, 14 review results, 14 resolved results, and 14 apply results; applied the approved draft into /mnt/d/Source/OpenSal/salamander_janrysavy, reran comment guard there with 0 violations and 0 preprocessing failures, and confirmed git diff --check -- src/plugins/checksum/checksum.h passed. Telemetry: The provider-backed review stage used 1 provider call, 21669 total tokens, and 2 Copilot request units; Codex-family totals were 0 calls and 0 estimated tokens. --- src/plugins/checksum/checksum.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/checksum/checksum.h b/src/plugins/checksum/checksum.h index d2fde76ca..ccb58c3ef 100644 --- a/src/plugins/checksum/checksum.h +++ b/src/plugins/checksum/checksum.h @@ -14,7 +14,7 @@ typedef enum eHASH_TYPE HT_SHA1, HT_SHA256, HT_SHA512, - HT_COUNT // Not a hash type but # of known hash types + HT_COUNT // Not a hash type, but the count of known hash types } eHASH_TYPE; typedef struct SHashInfo From a0d161731676ae12c07cd8f0293292a3fa86432a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 12:20:54 +0200 Subject: [PATCH 152/710] [translation] Fix src/plugins/checksum/dialogs.cpp comments Refines translated comments in src/plugins/checksum/dialogs.cpp. Model: OpenAI GPT-5.4 Verification: Ran node --experimental-strip-types src/sequential-review.ts against the current upstream main checkout with target-root and translation-source set to /mnt/d/Source/OpenSal/salamander_upstream, baseline-source set to gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b, artifacts-dir set to artifacts/checksum-dialogs-cpp-20260412-run1, and review settings --prompt-log-mode summary, --review-provider codex, and --cost-profile cheap-first; produced 166 comment units, 166 review results, 166 resolved results, and 166 apply results; applied the approved draft into /mnt/d/Source/OpenSal/salamander_janrysavy, reran comment guard there with 0 violations and 0 preprocessing failures, and confirmed git diff --check -- src/plugins/checksum/dialogs.cpp passed. Telemetry: The provider-backed stages used 5 provider calls, 122672 total tokens, and 2 Copilot request units; Codex-family totals were 4 calls and 86978 estimated tokens. --- src/plugins/checksum/dialogs.cpp | 37 ++++++++++++++++---------------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/src/plugins/checksum/dialogs.cpp b/src/plugins/checksum/dialogs.cpp index 4e359eac5..6921a2846 100644 --- a/src/plugins/checksum/dialogs.cpp +++ b/src/plugins/checksum/dialogs.cpp @@ -179,7 +179,7 @@ void CSFVMD5Dialog::OnThreadEnd() ShowWindow(GetDlgItem(HWindow, IDC_LABEL), SW_HIDE); ShowWindow(GetDlgItem(HWindow, IDC_PROGRESS), SW_HIDE); bThreadRunning = FALSE; - if (ScrollIndex < FileList.Count) // the worker already stopped counting (it may still be running), no sync needed + if (ScrollIndex < FileList.Count) // the worker thread is no longer calculating (it may still be running), so no synchronization is needed { // update the last "calculated" item so it does not remain calculating / verifying ... SetRowsDirty(ScrollIndex, ScrollIndex); } @@ -330,11 +330,12 @@ INT_PTR CSFVMD5Dialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) int i = -1; // -1 = do not call ensure visible if (ScheduledScrollIndex != ScrollIndex) { - // at this moment items up to ScrollIndex are acknowledged as computed, - // ScrollIndex itself is calculating / verifying and the items after it remain unprocessed - // (even if they are already computed, they will surface in the next cycle) - // show the newly acknowledged computed data + the new ScrollIndex must be repainted - // (to print calculating / verifying) + // at this moment, computed data up to ScrollIndex becomes visible; + // ScrollIndex itself is calculating / verifying, and the items after it remain uncomputed + // (even if they have already been computed, they are not shown + // until the next cycle) + // repaint the newly visible computed data + the new ScrollIndex + // (display calculating / verifying) SetRowsDirty(ScrollIndex, ScheduledScrollIndex); ScrollIndex = ScheduledScrollIndex; if (bScrollToItem) @@ -413,7 +414,7 @@ INT_PTR CSFVMD5Dialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (!IsWindowEnabled(HWindow)) { // close all dialogs stacked above this one (send them WM_CLOSE and then send it here again) SalamanderGeneral->CloseAllOwnedEnabledDialogs(HWindow); - if (iThreadID != 0) // if a thread is running, close its windows too and let it finish + if (iThreadID != 0) // if a thread is running, close its windows too and let it terminate { // to avoid immediately opening another window with a new error bTerminateThread = TRUE; SalamanderGeneral->CloseAllOwnedEnabledDialogs(HWindow, iThreadID); @@ -428,7 +429,7 @@ INT_PTR CSFVMD5Dialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_DESTROY: { - if (hThread != NULL) // if we started the thread, close it and wait for it + if (hThread != NULL) // if we started the thread, request its termination and wait for it { bTerminateThread = TRUE; ThreadQueue.WaitForExit(hThread, INFINITE); @@ -461,7 +462,7 @@ CCalculateDialog::CCalculateDialog(HWND parent, BOOL alwaysOnTop, TSeedFileList* void CCalculateDialog::RefreshUI() { MSG msg; - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) // we want responsive GUI + while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) // Keep the GUI responsive { if (!IsWindow(HWindow) || !IsDialogMessage(HWindow, &msg)) { @@ -1278,7 +1279,7 @@ INT_PTR CCalculateDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) NMLVDISPINFO* plvdi = (NMLVDISPINFO*)nmh; int index = plvdi->item.iItem; if (index < 0 || index >= FileList.Count) // while the worker thread runs, the array is not modified - break; // array size does not change = no synchronization + break; // the array size does not change, so no synchronization is needed if (plvdi->item.mask & LVIF_IMAGE) { // ScrollIndex nor the icons before it are modified by the thread, no synchronization needed @@ -1299,7 +1300,7 @@ INT_PTR CCalculateDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) } case 1: - { // Size: once added to the array it never changes = access is not synchronized + { // Size: once added to the array, it never changes, so access is not synchronized SalamanderGeneral->NumberToStr(plvdi->item.pszText, FileList[index]->Size); break; } @@ -1497,8 +1498,8 @@ BOOL CVerifyDialog::AnalyzeSourceFile() isSFV = FALSE; // not an SFV } - // WARNING: the following code must match CGenericHashAlgo::ParseDigest() !!! - // checksum at the beginning (before ' ') or checksum at the end (after ' ' or '=') and at the same time + // WARNING: the following code must remain consistent with CGenericHashAlgo::ParseDigest() !!! + // checksum at the beginning (before ' ') or at the end (after ' ' or '=') and also // the hash name at the beginning (before '(' or ' ') int posFirst, lenFirst; @@ -1810,7 +1811,7 @@ void CVerifyDialog::OnThreadEnd() { if (!nMissing && !nSkipped && !nCorrupt) { - if (fileList.Count) // while the worker thread runs, the array is not modified + if (fileList.Count) // while the worker thread is running, the number of items in the array does not change strcpy(text, LoadStr(IDS_ALLOK)); // number of items does not change = no synchronization needed else strcpy(text, LoadStr(IDS_NOFILES)); @@ -1905,7 +1906,7 @@ INT_PTR CVerifyDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) lstrcpyn(Focus_Path, fileList[i]->fileName, MAX_PATH); SalamanderGeneral->PostMenuExtCommand(CMD_FOCUSFILE, TRUE); Sleep(500); // switching to another window happens, so this Sleep should not hurt anything - Focus_Path[0] = 0; // after 0.5 seconds we no longer want the focus (handles hitting the start of Salamander's BUSY mode) + Focus_Path[0] = 0; // after 0.5 seconds we no longer need the focus (handles the case where we hit the start of Salamander's BUSY mode) } else SalamanderGeneral->SalMessageBox(HWindow, LoadStr(IDS_BUSY), LoadStr(IDS_VERIFYTITLE), MB_ICONINFORMATION); @@ -1950,7 +1951,7 @@ INT_PTR CVerifyDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) break; } - case 1: // FileExist+Size: once added to the array it never changes = no synchronization needed + case 1: // FileExist+Size: once added to the array, they do not change, so access is not synchronized { if (FileList[index]->FileExist) SalamanderGeneral->NumberToStr(plvdi->item.pszText, FileList[index]->Size); @@ -2086,7 +2087,7 @@ BOOL OpenCalculateDialog(HWND parent) int nFiles, nDirs; char sourcePath[MAX_PATH]; - // Check if nothing is selected and no focus is set + // Check whether nothing is selected and no item is focused if (SalamanderGeneral->GetPanelSelection(PANEL_SOURCE, &nFiles, &nDirs)) { int index = 0; @@ -2238,7 +2239,7 @@ CCommonDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) // Center horizontally & vertically to parent if (Parent != NULL) SalamanderGeneral->MultiMonCenterWindow(HWindow, Parent, TRUE); - break; // Need focus from DefDlgProc + break; // Need DefDlgProc to set focus } } // switch return CDialog::DialogProc(uMsg, wParam, lParam); From f7b327317b5804da105d863f1011b952b36139fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 12:34:05 +0200 Subject: [PATCH 153/710] [translation] Fix src/plugins/checksum/wrappers.cpp comments Refines translated comments in src/plugins/checksum/wrappers.cpp. Model: OpenAI GPT-5.4 Verification: Ran the single-file pipeline for src/plugins/checksum/wrappers.cpp into artifacts/checksum-wrappers-cpp-20260412-run1 with 42 comment units, 42 review results, 42 resolved results, and 42 apply results. Apply materialized one patched file in the janrysavy checkout, comment guard passed in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures, and git diff --check confirmed a clean comment-only diff for src/plugins/checksum/wrappers.cpp. Telemetry: Review used the Codex GPT-5.4 path with summary prompt logging and incurred 2 provider requests / 4 Copilot request units, 53,298 total tokens, 29,556 input tokens, 2,750 output tokens, and 20,992 cache-read input tokens. The cumulative estimates were 120 translation prompt tokens and 1,519 verification prompt tokens. --- src/plugins/checksum/wrappers.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/plugins/checksum/wrappers.cpp b/src/plugins/checksum/wrappers.cpp index 246efef5f..c1187331a 100644 --- a/src/plugins/checksum/wrappers.cpp +++ b/src/plugins/checksum/wrappers.cpp @@ -17,7 +17,7 @@ class CCRCAlgo : public CHashAlgo virtual bool Init(); // Init for a new file. true on success virtual bool Update(const char* buf, DWORD size); virtual bool Finalize(); - virtual int GetDigest(char* buf, DWORD bufsize); // Returns # of copied binary bytes + virtual int GetDigest(char* buf, DWORD bufsize); // Returns the number of copied binary bytes. virtual bool ParseDigest(char* buf, char* fileName, int fileNameLen, char* digest); private: @@ -45,12 +45,12 @@ class CMD5Algo : public CGenericHashAlgo virtual bool Init(); // Init for a new file. true on success virtual bool Update(const char* buf, DWORD size); virtual bool Finalize(); - virtual int GetDigest(char* buf, DWORD bufsize); // Returns # of copied binary bytes + virtual int GetDigest(char* buf, DWORD bufsize); // Returns the number of copied digest bytes. protected: virtual const char* GetID() { return "MD5"; }; virtual int GetIDLen() { return 3; }; // strlen(GetID()) - virtual int GetDigestLen() { return 16; }; // ensure DIGEST_MAX_SIZE remains large enough! + virtual int GetDigestLen() { return 16; }; // ensure DIGEST_MAX_SIZE is large enough private: CSalamanderMD5* md5; @@ -66,12 +66,12 @@ class CSHA1Algo : public CGenericHashAlgo virtual bool Init(); // Init for a new file. true on success virtual bool Update(const char* buf, DWORD size); virtual bool Finalize(); - virtual int GetDigest(char* buf, DWORD bufsize); // Returns # of copied binary bytes + virtual int GetDigest(char* buf, DWORD bufsize); // Returns the number of copied digest bytes. protected: virtual const char* GetID() { return "SHA1"; }; virtual int GetIDLen() { return 4; }; - virtual int GetDigestLen() { return 20; }; // ensure DIGEST_MAX_SIZE remains large enough! + virtual int GetDigestLen() { return 20; }; // ensure DIGEST_MAX_SIZE does not need to be increased private: CSalSHA1 sha1; @@ -87,12 +87,12 @@ class CSHA256Algo : public CGenericHashAlgo virtual bool Init(); // Init for a new file. true on success virtual bool Update(const char* buf, DWORD size); virtual bool Finalize(); - virtual int GetDigest(char* buf, DWORD bufsize); // Returns # of copied binary bytes + virtual int GetDigest(char* buf, DWORD bufsize); // Returns the number of copied digest bytes. protected: virtual const char* GetID() { return "SHA256"; }; virtual int GetIDLen() { return 6; }; - virtual int GetDigestLen() { return 32; }; // ensure DIGEST_MAX_SIZE remains large enough! + virtual int GetDigestLen() { return 32; }; // ensure DIGEST_MAX_SIZE does not need to be increased private: hash_state sha256; @@ -108,12 +108,12 @@ class CSHA512Algo : public CGenericHashAlgo virtual bool Init(); // Init for a new file. true on success virtual bool Update(const char* buf, DWORD size); virtual bool Finalize(); - virtual int GetDigest(char* buf, DWORD bufsize); // Returns # of copied binary bytes + virtual int GetDigest(char* buf, DWORD bufsize); // Returns the number of copied digest bytes. protected: virtual const char* GetID() { return "SHA512"; }; virtual int GetIDLen() { return 6; }; - virtual int GetDigestLen() { return 64; }; // ensure DIGEST_MAX_SIZE remains large enough! + virtual int GetDigestLen() { return 64; }; // ensure DIGEST_MAX_SIZE does not need to be increased private: hash_state sha512; @@ -248,7 +248,7 @@ bool CCRCAlgo::ParseDigest(char* buf, char* fileName, int fileNameLen, char* dig pos--; buf[pos] = 0; if ((int)strlen(buf) >= fileNameLen) - return false; // too long name + return false; // file name too long strcpy_s(fileName, fileNameLen, buf); return true; } @@ -260,7 +260,7 @@ bool CGenericHashAlgo::ParseDigest(char* buf, char* fileName, int fileNameLen, c int pos, len; // WARNING: the following code must match CVerifyDialog::AnalyzeSourceFile() !!! - // checksum at the beginning (before ' ') or checksum at the end (after ' ' or '=') and at the same time + // checksum at the beginning (before ' ') or at the end (after ' ' or '=') and // the hash name at the beginning (before '(' or ' ') GetFirstWord(buf, pos, len, '('); @@ -285,7 +285,7 @@ bool CGenericHashAlgo::ParseDigest(char* buf, char* fileName, int fileNameLen, c if (buf[pos] == '(') { pos++; - // What if filename contains ')'??? + // File names may contain ')'. // "openssl md5 file().txt" produces: "MD5(file().txt)= 636e5618c32f05ac9f2623169527cd3c" len = (int)strlen(buf); if (len > 0 && buf[len - 1] == ')') @@ -306,7 +306,7 @@ bool CGenericHashAlgo::ParseDigest(char* buf, char* fileName, int fileNameLen, c pos++; // skip the asterisk indicating a binary file } if ((int)strlen(buf + pos) >= fileNameLen) - return false; // too long name + return false; // file name too long strcpy_s(fileName, fileNameLen, buf + pos); return true; } From 060d75b5de67f86de40d7798f18f2d635568870d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 12:37:55 +0200 Subject: [PATCH 154/710] [translation] Fix src/plugins/checksum/wrappers.h comments Refines translated comments in src/plugins/checksum/wrappers.h. Model: OpenAI GPT-5.4 Verification: Ran the single-file pipeline for src/plugins/checksum/wrappers.h into artifacts/checksum-wrappers-h-20260412-run1 with 4 comment units, 4 review results, 4 resolved results, and 4 apply results. Apply materialized one patched file in the janrysavy checkout, comment guard passed in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures, and git diff --check confirmed a clean comment-only diff for src/plugins/checksum/wrappers.h. Telemetry: Review and resolve used the Codex GPT-5.4 path with summary prompt logging and incurred 3 provider requests, 51,360 total tokens, 168 estimated translation prompt tokens, 726 estimated verification prompt tokens, and 692 estimated metadata prompt tokens. --- src/plugins/checksum/wrappers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/checksum/wrappers.h b/src/plugins/checksum/wrappers.h index 5aaab1408..244a41d7e 100644 --- a/src/plugins/checksum/wrappers.h +++ b/src/plugins/checksum/wrappers.h @@ -13,7 +13,7 @@ class CHashAlgo virtual bool Init() = 0; // Init for a new file. true on success virtual bool Update(const char* buf, DWORD size) = 0; virtual bool Finalize() = 0; - virtual int GetDigest(char* buf, DWORD bufsize) = 0; // Returns # of copied binary bytes + virtual int GetDigest(char* buf, DWORD bufsize) = 0; // Returns the number of copied binary bytes. virtual bool ParseDigest(char* buf, char* fileName, int fileNameLen, char* digest) = 0; }; From 42a6a3d711c0fbdb27ec5555115dac196fdb9aed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 12:58:38 +0200 Subject: [PATCH 155/710] [translation] Fix src/plugins/checkver/checkver.cpp comments Refines translated comments in src/plugins/checkver/checkver.cpp. Model: OpenAI GPT-5.4 Verification: Ran the single-file pipeline for src/plugins/checkver/checkver.cpp into artifacts/checkver-checkver-cpp-20260412-run1 with 64 comment units, 64 review results, 64 resolved results, and 64 apply results. Review completed with 50 cache hits, 2 run-local memo hits, 8 deterministic outcomes, and 1 synthetic manual, then apply materialized one patched file in the janrysavy checkout. Comment guard passed in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures, and git diff --check confirmed a clean comment-only diff for src/plugins/checkver/checkver.cpp. Telemetry: The run completed without live provider calls because all model-backed decisions were satisfied from cache or deterministic paths, so provider requests, request units, and provider tokens were all 0 for this single-file artifact. --- src/plugins/checkver/checkver.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/checkver/checkver.cpp b/src/plugins/checkver/checkver.cpp index 390b66584..2f6ab0425 100644 --- a/src/plugins/checkver/checkver.cpp +++ b/src/plugins/checkver/checkver.cpp @@ -72,9 +72,9 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) } if (fdwReason == DLL_PROCESS_DETACH) { - // if Altap Salamander is blocked from accessing the internet by the firewall and Salamander is closed while checkver is running, - // TRACE is destroyed before this function is called, which leads to a crash in TRACE_I, - // therefore TRACE must not be called here + // if Altap Salamander is blocked from accessing the internet by a firewall and Salamander is closed while checkver is running, + // TRACE is destroyed before this function is called, causing a crash in TRACE_I, + // so TRACE must not be called here //TRACE_I("CheckVer DLL_PROCESS_DETACH"); DeleteCriticalSection(&MainDialogIDSection); if (HModulesEnumDone != NULL) @@ -151,8 +151,8 @@ CPluginInterfaceAbstract* WINAPI SalamanderPluginEntry(CSalamanderPluginEntryAbs DWORD loadInfo = salamander->GetLoadInformation(); - // immediately after Salamander is installed, perform the version check with an open window so that - // it is visible what is happening and the user understands why internet access must be allowed + // immediately after Salamander is installed, perform the version check with the window open so that + // the user can see what is happening and understand why Internet access must be allowed // in the personal firewall if (loadInfo & LOADINFO_NEWSALAMANDERVER) LoadedOnSalInstall = TRUE; @@ -369,7 +369,7 @@ unsigned WINAPI ThreadMessageLoopBody(void* param) } data->Success = HMainDialog != NULL; - SetEvent(data->Continue); // let the main thread continue; from this point on the data are invalid (=NULL) + SetEvent(data->Continue); // let the main thread continue; from this point on, the data are no longer valid (=NULL) data = NULL; MSG msg; From e30b53c5572bbcf89bd56a25c3a4400aef3e4fa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 13:01:01 +0200 Subject: [PATCH 156/710] [translation] Fix src/plugins/checkver/checkver.h comments Refines translated comments in src/plugins/checkver/checkver.h. Model: OpenAI GPT-5.4 Verification: Ran the single-file pipeline for src/plugins/checkver/checkver.h into artifacts/checkver-checkver-h-20260412-run1 with 40 comment units, 40 review results, 40 resolved results, and 40 apply results. Review completed with 27 cache hits, 3 run-local memo hits, 8 deterministic outcomes, 1 synthetic manual, and 1 provider-backed lite review decision, then apply materialized one patched file in the janrysavy checkout. Comment guard passed in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures, and git diff --check confirmed a clean comment-only diff for src/plugins/checkver/checkver.h. Telemetry: The run used 1 Codex GPT-5.4 review request and recorded 16,977 total tokens, with 25 estimated translation prompt tokens and 114 estimated verification prompt tokens. --- src/plugins/checkver/checkver.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/checkver/checkver.h b/src/plugins/checkver/checkver.h index 25bb036bf..f3d3d2a45 100644 --- a/src/plugins/checkver/checkver.h +++ b/src/plugins/checkver/checkver.h @@ -11,7 +11,7 @@ #define WM_USER_KEYDOWN WM_APP + 667 // configuration data -enum CAutoCheckModeEnum // how often the plugin window is activated +enum CAutoCheckModeEnum // how often the plugin window is shown { achmNever, achmDay, From 62952c1f6418fbd60bfc18baf8495f299648569d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 13:06:55 +0200 Subject: [PATCH 157/710] [translation] Fix src/plugins/checkver/data.cpp comments Refines translated comments in src/plugins/checkver/data.cpp. Model: OpenAI GPT-5.4 Verification: Ran the single-file pipeline for src/plugins/checkver/data.cpp into artifacts/checkver-data-cpp-20260412-run1 with 100 comment units, 100 review results, 100 resolved results, and 100 apply results. Review completed with 80 cache hits, 2 run-local memo hits, 10 deterministic outcomes, 1 synthetic manual, and 3 provider-backed review decisions. After apply, one rejected commented-out TRACE_I literal change was reverted during final manual review, the resulting comment-only diff was rechecked, and comment guard passed in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. git diff --check confirmed a clean final diff for src/plugins/checkver/data.cpp. Telemetry: The run used 2 Codex GPT-5.4 review requests and recorded 35,611 total tokens, with 488 estimated translation prompt tokens and 584 estimated verification prompt tokens. --- src/plugins/checkver/data.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/plugins/checkver/data.cpp b/src/plugins/checkver/data.cpp index b088315da..155af628d 100644 --- a/src/plugins/checkver/data.cpp +++ b/src/plugins/checkver/data.cpp @@ -157,9 +157,9 @@ const char* CONFIG_NEXTOPEN = "NextOpen"; const char* CONFIG_NUMOFERRORS = "NumOfErrors"; // ConfigVersion: 0 - no configuration was loaded from the Registry (plugin installation), -// 1 - configuration before the 'Version' value was added to the registry +// 1 - configuration from before the 'Version' value was added to the registry // 2 - Salamander 2.52: enforce new default values (set inetLAN defaults for everyone) -// 3 - Salamander 3.0: enforce new default values (show all new versions, add the "ignore this version" link, hopefully CheckVer will no longer be disabled manually) +// 3 - Salamander 3.0: enforce new default values (show all new versions, add the "ignore this version" link, hopefully CheckVer will no longer be disabled outright) // 4 - Salamander 4.0: enforce new default values int ConfigVersion = 0; // version of the configuration loaded from the registry (see above for description) @@ -357,7 +357,7 @@ void LoadConfig(HKEY regKey, CSalamanderRegistryAbstract* registry) if (regKey != NULL && !registry->GetValue(regKey, CONFIG_VERSION, REG_DWORD, &ConfigVersion, sizeof(DWORD))) ConfigVersion = 1; // configuration before the 'Version' value was added to the registry BOOL curVerIsPB = IsPBVersion(SalamanderTextVersion); - if (curVerIsPB) // the PB build tests PB versions by default + if (curVerIsPB) // in the PB build, PB versions are checked by default { int i; for (i = 0; i < inetCount; i++) @@ -606,9 +606,9 @@ BOOL CSalModuleInfo::SetVersion(const char* version) sprintf(partR + len - 1, ".%d", ch - 'a' + 1); } } - // compose the version - // bug still present in AS2.51: without adding 0.5 the values were "random", because - // when WinSCP is loaded into the process it changes CPU rounding (applies per thread) + // build the version + // bug still present in AS2.51: without adding 0.5, the values came out "random" because + // WinSCP changes the CPU rounding mode when loaded into the process (per-thread) ResolvedVersion = ((WORD)(atof(partL) * 1000 + 0.5)) << 16; if (partR[0] != 0) ResolvedVersion |= ((WORD)(atof(partR) * 100 + 0.5)); @@ -938,10 +938,10 @@ BOOL CModules::BuildDataFromScript() *(line + lineLen) = 0; if (lstrcmp(line, SCRIPT_SIGNATURE_EOF) == 0) - break; // everything loaded... + break; // all data loaded... if (count >= LoadedScriptSize - 2) - break; // time to bail out + break; // time to exit if (*lineEnd == '\r' && *(lineEnd + 1) == '\r' && *(lineEnd + 2) == '\n') { // '\r\r\n' - '\r\n' converted via FTP lineEnd += 3; @@ -1119,7 +1119,7 @@ void CModules::CompareWithInstalledModulesAndLogIt(BOOL rereadModules) { // reset the event ResetEvent(HModulesEnumDone); - // post a command so the main Salamander thread reaches us, + // post a command so that Salamander's main thread reaches us, // from which we can perform the enumeration SalGeneral->PostMenuExtCommand(CM_ENUMMODULES, FALSE); // wait until the enumeration is finished @@ -1172,9 +1172,9 @@ void CModules::CompareWithInstalledModulesAndLogIt(BOOL rereadModules) BOOL newModule = FALSE; if (installed && salMdl->GetResBeta() == mdl->GetResBeta()) { - // if the module is installed and it matches the beta/non-beta state of the scripted module, - // compare their versions (when versions match, decide by checking whether it is an IB/DB/PB/CB, - // a special build always takes precedence over a non-special build and among special builds + // if the module is installed and its beta/non-beta state matches the module from the script, + // compare their versions (if the versions match, whether it is an IB/DB/PB/CB can still decide, + // a special build always takes precedence over a non-special build, and among special builds // the build number decides) if (salMdl->GetResVer() < mdl->GetResVer() || salMdl->GetResVer() == mdl->GetResVer() && salMdl->GetSpecBld() > 0 && mdl->GetSpecBld() == 0 || // same version + installed module is a special build and the scripted module is not From 454222a458238b7ad68c6d7e4e9dde2c5d924225 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 13:10:28 +0200 Subject: [PATCH 158/710] [translation] Fix src/plugins/checkver/dialogs.cpp comments Refines translated comments in src/plugins/checkver/dialogs.cpp. Model: OpenAI GPT-5.4 Verification: Ran the single-file pipeline for src/plugins/checkver/dialogs.cpp into artifacts/checkver-dialogs-cpp-20260412-run1 with 76 comment units, 76 review results, 76 resolved results, and 76 apply results. Review completed with 55 cache hits, 10 run-local memo hits, 4 deterministic outcomes, 1 synthetic manual, 3 provider-backed review decisions, and 3 audit cache hits. Apply materialized one patched file in the janrysavy checkout, comment guard passed in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures, and git diff --check confirmed a clean comment-only diff for src/plugins/checkver/dialogs.cpp. Telemetry: The run used 2 Codex GPT-5.4 review requests and recorded 35,232 total tokens, with 160 estimated translation prompt tokens and 767 estimated verification prompt tokens. --- src/plugins/checkver/dialogs.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/plugins/checkver/dialogs.cpp b/src/plugins/checkver/dialogs.cpp index dc6c58fcb..57e3a4eb0 100644 --- a/src/plugins/checkver/dialogs.cpp +++ b/src/plugins/checkver/dialogs.cpp @@ -56,7 +56,7 @@ INT_PTR CALLBACK InternetProc(HWND hWindow, UINT uMsg, WPARAM wParam, LPARAM lPa { if ((GetKeyState(VK_CONTROL) & 0x8000) == 0 && (GetKeyState(VK_SHIFT) & 0x8000) == 0) SalGeneral->OpenHtmlHelp(hWindow, HHCDisplayContext, IDD_INTERNET, FALSE); - return TRUE; // never let F1 reach the parent + return TRUE; // never let F1 propagate to the parent } case WM_APP + 55: @@ -285,7 +285,7 @@ INT_PTR CALLBACK CfgDlgProc(HWND hWindow, UINT uMsg, WPARAM wParam, LPARAM lPara { if ((GetKeyState(VK_CONTROL) & 0x8000) == 0 && (GetKeyState(VK_SHIFT) & 0x8000) == 0) SalGeneral->OpenHtmlHelp(hWindow, HHCDisplayContext, IDD_CONFIGURATION, FALSE); - return TRUE; // never let F1 reach the parent + return TRUE; // never let F1 propagate to the parent } case WM_COMMAND: @@ -376,7 +376,7 @@ INT_PTR CALLBACK CfgDlgProc(HWND hWindow, UINT uMsg, WPARAM wParam, LPARAM lPara } } BOOL autoConnect = IsDlgButtonChecked(hWindow, IDC_CFG_AUTOCONNECT) == BST_CHECKED; - if (Data.AutoConnect != autoConnect) // meaning of NextOpenOrCheckTime changed: just open the dialog / open it with an automatic version check + if (Data.AutoConnect != autoConnect) // NextOpenOrCheckTime now means: open the dialog only / open it with an automatic version check { Data.AutoConnect = autoConnect; updateNextOpenOrCheckTime = TRUE; @@ -385,7 +385,7 @@ INT_PTR CALLBACK CfgDlgProc(HWND hWindow, UINT uMsg, WPARAM wParam, LPARAM lPara } if (updateNextOpenOrCheckTime) { - if (!autoConnect || LastCheckTime.wYear == 0) // no automatic check or we have not performed one yet + if (!autoConnect || LastCheckTime.wYear == 0) // this is not an automatic check, or we have not performed one yet ZeroMemory(&NextOpenOrCheckTime, sizeof(NextOpenOrCheckTime)); // opening the window and optionally performing a check on the first load-on-start (ASAP) else GetFutureTime(&NextOpenOrCheckTime, &LastCheckTime, GetWaitDays()); // base the next check on the date of the last check @@ -554,9 +554,9 @@ MENU_TEMPLATE_ITEM AppendToSystemMenu[] = { if (tvData->FirstLoadAfterInstall) { - // on the first load after installation (without loading a configuration, i.e. installation on a machine without Salamander) the window - // is shown after two seconds so that the user, if using a personal firewall, sees why - // Salamander is accessing the internet (without a firewall, checkver should finish faster and the user + // on the first load after installation (without loading a configuration, i.e. installation on a machine without Salamander), the window + // is shown after two seconds so that a user with a personal firewall can see why + // Salamander is trying to access the internet (without a firewall, checkver should finish faster, so the user // would not see the CheckVer window at all) if (!SetTimer(hWindow, 665, 2000, NULL)) ShowMinNA_IfNotShownYet(hWindow, TRUE, TRUE); // if the timer cannot be created, show the window immediately @@ -599,7 +599,7 @@ MENU_TEMPLATE_ITEM AppendToSystemMenu[] = { if ((GetKeyState(VK_CONTROL) & 0x8000) == 0 && (GetKeyState(VK_SHIFT) & 0x8000) == 0) SalGeneral->OpenHtmlHelp(hWindow, HHCDisplayContext, IDD_MAIN, FALSE); - return TRUE; // never let F1 reach the parent + return TRUE; // never let F1 propagate to the parent } case WM_SIZE: @@ -769,7 +769,7 @@ MENU_TEMPLATE_ITEM AppendToSystemMenu[] = if (MainDlgAutoOpen2 && IsTimeExpired(&NextOpenOrCheckTime) && Data.AutoCheckMode != achmNever) { - GetFutureTime(&NextOpenOrCheckTime, 1); // if opening the dialog and the check did not finish successfully (and therefore did not set NextOpenOrCheckTime), schedule another attempt for tomorrow + GetFutureTime(&NextOpenOrCheckTime, 1); // if opening the dialog and any subsequent check did not complete successfully (and therefore did not set NextOpenOrCheckTime), schedule the next attempt for tomorrow // TRACE_I("New on Close: NextOpenOrCheckTime: " << NextOpenOrCheckTime.wDay << "." << NextOpenOrCheckTime.wMonth << "." << NextOpenOrCheckTime.wYear); } @@ -803,7 +803,7 @@ MENU_TEMPLATE_ITEM AppendToSystemMenu[] = } else { - if (autoClose && ++ErrorsSinceLastCheck >= 4) // report only the fourth error (ignore the first three to bother the user as little as possible) + if (autoClose && ++ErrorsSinceLastCheck >= 4) // report only the fourth error (ignore the first three to minimize user disruption) { autoClose = FALSE; ErrorsSinceLastCheck = 0; From e9f8addd2de73f66f53dab95950b4760b2d86947 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 13:13:49 +0200 Subject: [PATCH 159/710] [translation] Fix src/plugins/checkver/internet.cpp comments Refines translated comments in src/plugins/checkver/internet.cpp. Model: OpenAI GPT-5.4 Verification: Ran the single-file pipeline for src/plugins/checkver/internet.cpp into artifacts/checkver-internet-cpp-20260412-run1 with 18 comment units, 18 review results, 18 resolved results, and 18 apply results. Review completed with 13 cache hits, 1 synthetic manual, and 1 provider-backed deep review decision, then apply materialized one patched file in the janrysavy checkout. Comment guard passed in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures, and git diff --check confirmed a clean comment-only diff for src/plugins/checkver/internet.cpp. Telemetry: The run used 1 Codex GPT-5.4 review request and recorded 17,291 total tokens, with 23 estimated translation prompt tokens and 249 estimated verification prompt tokens. --- src/plugins/checkver/internet.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/checkver/internet.cpp b/src/plugins/checkver/internet.cpp index 4baff3a2c..2e5b0b876 100644 --- a/src/plugins/checkver/internet.cpp +++ b/src/plugins/checkver/internet.cpp @@ -124,7 +124,7 @@ DWORD WINAPI ThreadDownload(void* param) CTDData* data = (CTDData*)param; DWORD dialogID = data->MainDialogID; BOOL firstLoadAfterInstall = data->FirstLoadAfterInstall; - SetEvent(data->Continue); // let the main thread continue; from this point on the data are invalid (=NULL) + SetEvent(data->Continue); // let the main thread continue; from this point on, the data are no longer valid (=NULL) data = NULL; // lock the DLL to prevent it from being unloaded while this function runs @@ -204,8 +204,8 @@ DWORD WINAPI ThreadDownload(void* param) default: { - // p.s. adjusted to allow version checking behind a firewall (tested at SPS) - // HTTP (experimentally much faster than FTP-passive at SPS, probably due to HTTP caching, + // adjusted to allow version checking behind a firewall (tested at SPS) + // HTTP (experimentally much faster than FTP passive at SPS, probably due to HTTP caching; // usually passes through firewalls) char scriptURL[200]; _snprintf_s(scriptURL, _TRUNCATE, "%s?version=%s&lang=%s", @@ -270,7 +270,7 @@ DWORD WINAPI ThreadDownload(void* param) PostMessage(HMainDialog, WM_USER_DOWNLOADTHREAD_EXIT, !exit, 0); // thread ends; data are loaded FreeLibrary(hLock); // release the lock LeaveCriticalSection(&MainDialogIDSection); - return 0; // let the thread die naturally + return 0; // let the thread exit normally } else { @@ -301,7 +301,7 @@ StartDownloadThread(BOOL firstLoadAfterInstall) HANDLE hThread = CreateThread(NULL, 0, ThreadDownload, &data, 0, &threadID); if (hThread == NULL) TRACE_E("Unable to create Check Version Download thread."); - else // wait until the thread takes the data + else // wait until the thread picks up the data WaitForSingleObject(data.Continue, INFINITE); CloseHandle(data.Continue); From efcc85c121c9962af7960a457c750a4e0cc4811e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 16:46:17 +0200 Subject: [PATCH 160/710] [translation] Fix src/plugins/ieviewer/ieviewer.cpp comments Refines translated comments in src/plugins/ieviewer/ieviewer.cpp. Model: OpenAI GPT-5.4 Verification: Ran `node --experimental-strip-types /mnt/d/source/ostranslation/src/sequential-review.ts --target-root /mnt/d/Source/OpenSal/salamander_upstream --translation-source /mnt/d/Source/OpenSal/salamander_upstream --baseline-source gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b --artifacts-dir /mnt/d/source/ostranslation/artifacts/ieviewer-ieviewer-cpp-20260412-run1 --file src/plugins/ieviewer/ieviewer.cpp --cost-profile cheap-first`, which produced 163 comment units, 163 review results, 163 resolved results, and 163 apply results; reapplied the approved artifact into `/mnt/d/Source/OpenSal/salamander_janrysavy` with `node --experimental-strip-types /mnt/d/source/ostranslation/src/cli.ts apply --mode apply ...`; reran `node --experimental-strip-types /mnt/d/source/ostranslation/src/cli.ts guard ...` on the branch target, which passed for `src/plugins/ieviewer/ieviewer.cpp` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures; and completed `git diff --check -- src/plugins/ieviewer/ieviewer.cpp` without diff integrity failures. Telemetry: Provider-backed review used 1 Codex request totaling 17283 estimated tokens, including 12 estimated translation prompt tokens and 273 estimated verification prompt tokens; Copilot request units were 0. --- src/plugins/ieviewer/ieviewer.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/plugins/ieviewer/ieviewer.cpp b/src/plugins/ieviewer/ieviewer.cpp index d49a8b5bb..40a6a1269 100644 --- a/src/plugins/ieviewer/ieviewer.cpp +++ b/src/plugins/ieviewer/ieviewer.cpp @@ -103,7 +103,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { if (fdwReason == DLL_PROCESS_ATTACH) DLLInstance = hinstDLL; - return TRUE; // DLL can be loaded + return TRUE; // Allow the DLL to load } // @@ -157,7 +157,7 @@ void UpdateInternetFeatureControl() // MSDN mentions that FEATURE_96DPI_PIXEL is deprecated and replaced by DOCHOSTUIFLAG_DPI_AWARE // https://msdn.microsoft.com/en-us/library/aa753277%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396 - // but it still works under W10/IE11, so I am ignoring it + // but it still works under W10/IE11, so it is left as is char exePath[MAX_PATH]; if (!GetModuleFileName(NULL, exePath, MAX_PATH)) @@ -197,12 +197,12 @@ CPluginInterfaceAbstract* WINAPI SalamanderPluginEntry(CSalamanderPluginEntryAbs { // reject older versions MessageBox(salamander->GetParentWindow(), REQUIRE_LAST_VERSION_OF_SALAMANDER, - "Internet Explorer Viewer" /* neprekladat! */, MB_OK | MB_ICONERROR); + "Internet Explorer Viewer" /* do not translate */, MB_OK | MB_ICONERROR); return NULL; } // let it load the language module (.slg) - HLanguage = salamander->LoadLanguageModule(salamander->GetParentWindow(), "Internet Explorer Viewer" /* neprekladat! */); + HLanguage = salamander->LoadLanguageModule(salamander->GetParentWindow(), "Internet Explorer Viewer" /* do not translate */); if (HLanguage == NULL) return NULL; @@ -394,7 +394,7 @@ unsigned WINAPI ThreadIEMessageLoop(void* param) lstrcpyn(name, data->Name, MAX_PATH); IStream* contentStream = data->ContentStream; BOOL openFile = data->Success; - SetEvent(data->Continue); // let the main thread continue; data are invalid from this point (=NULL) + SetEvent(data->Continue); // allow the main thread to continue; the data are invalid from this point on (=NULL) data = NULL; // if everything succeeded, open the requested file in the window @@ -421,10 +421,10 @@ unsigned WINAPI ThreadIEMessageLoop(void* param) } } - // probably a common bug in IE - the object was originally destroyed in response to WM_DESTROY - // but a message arrived before the message pump finished and hit the destroyed + // probably a common IE bug: the object was originally destroyed in response to WM_DESTROY + // but another message arrived before the message pump finished and accessed the destroyed // object - // therefore I moved the window destruction here - similar to ooStatic from WinLib + // therefore the window destruction was moved here, similar to ooStatic in WinLib CALL_STACK_MESSAGE1("ThreadIEMessageLoop::message_loop done"); delete window; @@ -1386,7 +1386,7 @@ CSite::CSite() //Object interfaces m_pIUnknown = NULL; m_pIWebBrowser = NULL; - m_pIWebBrowser2 = NULL; // !!! warning - for IE3.02 it can be NULL + m_pIWebBrowser2 = NULL; // Warning: may be NULL in IE 3.02 m_pIOleObject = NULL; m_pIOleInPlaceObject = NULL; m_pIOleInPlaceActiveObject = NULL; @@ -1533,7 +1533,7 @@ BOOL CSite::Create(HWND hParentWnd) CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER, IID_IUnknown, (void**)&m_pIUnknown); - if (hr == REGDB_E_CLASSNOTREG) // correct variant + if (hr == REGDB_E_CLASSNOTREG) // correct case { TRACE_E("A InternetExplorer class is not registered in the registration database"); return FALSE; From 0c7f4e265099114233c6c68d4ba3a218be14d7ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 16:49:55 +0200 Subject: [PATCH 161/710] [translation] Fix src/plugins/ieviewer/ieviewer.h comments Refines translated comments in src/plugins/ieviewer/ieviewer.h. Model: OpenAI GPT-5.4 Verification: Ran `node --experimental-strip-types /mnt/d/source/ostranslation/src/sequential-review.ts --target-root /mnt/d/Source/OpenSal/salamander_upstream --translation-source /mnt/d/Source/OpenSal/salamander_upstream --baseline-source gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b --artifacts-dir /mnt/d/source/ostranslation/artifacts/ieviewer-ieviewer-h-20260412-run1 --file src/plugins/ieviewer/ieviewer.h --cost-profile cheap-first`, which produced 51 comment units, 51 review results, 51 resolved results, and 51 apply results; reapplied the approved artifact into `/mnt/d/Source/OpenSal/salamander_janrysavy` with `node --experimental-strip-types /mnt/d/source/ostranslation/src/cli.ts apply --mode apply ...`; reran `node --experimental-strip-types /mnt/d/source/ostranslation/src/cli.ts guard ...` on the branch target, which passed for `src/plugins/ieviewer/ieviewer.h` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures; and completed `git diff --check -- src/plugins/ieviewer/ieviewer.h` without diff integrity failures. Telemetry: Provider-backed review used 0 Codex requests totaling 0 estimated tokens; Copilot request units were 0. --- src/plugins/ieviewer/ieviewer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/ieviewer/ieviewer.h b/src/plugins/ieviewer/ieviewer.h index 9c9903fbc..1b38fea1a 100644 --- a/src/plugins/ieviewer/ieviewer.h +++ b/src/plugins/ieviewer/ieviewer.h @@ -453,7 +453,7 @@ class CIEMainWindow { public: HWND HWindow; // viewer window handle - HANDLE Lock; // 'lock' object or NULL (becomes signaled after we close the file) + HANDLE Lock; // 'lock' object or NULL (becomes signaled only after the file is closed) static CIEMainWindowQueue ViewerWindowQueue; // list of all viewer windows static CThreadQueue ThreadQueue; // list of all window threads From daa24570469937473a033bdedceae59a41fd8ae0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 17:10:27 +0200 Subject: [PATCH 162/710] [translation] Fix src/plugins/mmviewer/buffer.h comments Refines translated comments in src/plugins/mmviewer/buffer.h. Model: OpenAI GPT-5.4 Verification: Ran `node --experimental-strip-types /mnt/d/source/ostranslation/src/sequential-review.ts --target-root /mnt/d/Source/OpenSal/salamander_upstream --translation-source /mnt/d/Source/OpenSal/salamander_upstream --baseline-source gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b --artifacts-dir /mnt/d/source/ostranslation/artifacts/mmviewer-src-plugins-mmviewer-buffer-h-20260412-run1 --file src/plugins/mmviewer/buffer.h --cost-profile cheap-first`, which produced 2 comment units, 2 review results, 2 resolved results, and 2 apply results; reapplied the approved artifact into `/mnt/d/Source/OpenSal/salamander_janrysavy` with `node --experimental-strip-types /mnt/d/source/ostranslation/src/cli.ts apply --mode apply ...`; reran `node --experimental-strip-types /mnt/d/source/ostranslation/src/cli.ts guard ...` on the branch target, which passed for `src/plugins/mmviewer/buffer.h` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures; and completed `git diff --check -- src/plugins/mmviewer/buffer.h` without diff integrity failures. Telemetry: Provider-backed review used 0 Codex requests totaling 0 estimated tokens; Copilot request units were 0. --- src/plugins/mmviewer/buffer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/mmviewer/buffer.h b/src/plugins/mmviewer/buffer.h index 2eb2d2a02..542bdfb4c 100644 --- a/src/plugins/mmviewer/buffer.h +++ b/src/plugins/mmviewer/buffer.h @@ -3,7 +3,7 @@ #pragma once -//Persistent not supported!!! +//Persistence not supported. class CBuffer { From cd8e6eb26ffcabb0ca28c41d2f5c0820f9f9b288 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 17:13:22 +0200 Subject: [PATCH 163/710] [translation] Fix src/plugins/mmviewer/dialogs.cpp comments Refines translated comments in src/plugins/mmviewer/dialogs.cpp. Model: OpenAI GPT-5.4 Verification: Ran `node --experimental-strip-types /mnt/d/source/ostranslation/src/sequential-review.ts --target-root /mnt/d/Source/OpenSal/salamander_upstream --translation-source /mnt/d/Source/OpenSal/salamander_upstream --baseline-source gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b --artifacts-dir /mnt/d/source/ostranslation/artifacts/mmviewer-dialogs-cpp-20260412-run1 --file src/plugins/mmviewer/dialogs.cpp --cost-profile cheap-first`, which produced 7 comment units, 7 review results, 7 resolved results, and 7 apply results; reapplied the approved artifact into `/mnt/d/Source/OpenSal/salamander_janrysavy` with `node --experimental-strip-types /mnt/d/source/ostranslation/src/cli.ts apply --mode apply ...`; reran `node --experimental-strip-types /mnt/d/source/ostranslation/src/cli.ts guard ...` on the branch target, which passed for `src/plugins/mmviewer/dialogs.cpp` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures; and completed `git diff --check -- src/plugins/mmviewer/dialogs.cpp` without diff integrity failures. Telemetry: Provider-backed review used 0 Codex requests totaling 0 estimated tokens; Copilot request units were 0. --- src/plugins/mmviewer/dialogs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/mmviewer/dialogs.cpp b/src/plugins/mmviewer/dialogs.cpp index 13a2827cb..6b5c320fd 100644 --- a/src/plugins/mmviewer/dialogs.cpp +++ b/src/plugins/mmviewer/dialogs.cpp @@ -32,7 +32,7 @@ CCommonDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) // horizontal and vertical centering of the dialog to the parent if (Parent != NULL) SalGeneral->MultiMonCenterWindow(HWindow, Parent, TRUE); - break; // want focus from DefDlgProc + break; // let DefDlgProc set the focus } } return CDialog::DialogProc(uMsg, wParam, lParam); From b19498c03f600f6140613cfe8f49da8ec0d7675b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 17:22:40 +0200 Subject: [PATCH 164/710] [translation] Fix src/plugins/mmviewer/mmviewer.cpp comments Refines translated comments in src/plugins/mmviewer/mmviewer.cpp. Model: OpenAI GPT-5.4 Verification: Ran `node --experimental-strip-types /mnt/d/source/ostranslation/src/sequential-review.ts --target-root /mnt/d/Source/OpenSal/salamander_upstream --translation-source /mnt/d/Source/OpenSal/salamander_upstream --baseline-source gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b --artifacts-dir /mnt/d/source/ostranslation/artifacts/mmviewer-src-plugins-mmviewer-mmviewer-cpp-20260412-run1 --file src/plugins/mmviewer/mmviewer.cpp --cost-profile cheap-first`, which produced 104 comment units, 104 review results, 104 resolved results, and 104 apply results; reapplied the approved artifact into `/mnt/d/Source/OpenSal/salamander_janrysavy` with `node --experimental-strip-types /mnt/d/source/ostranslation/src/cli.ts apply --mode apply ...`; reran `node --experimental-strip-types /mnt/d/source/ostranslation/src/cli.ts guard ...` on the branch target, which passed for `src/plugins/mmviewer/mmviewer.cpp` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures; and completed `git diff --check -- src/plugins/mmviewer/mmviewer.cpp` without diff integrity failures. Telemetry: Provider-backed review used 12 Codex-family requests totaling 223252 estimated tokens, including 3329 estimated translation prompt tokens and 20301 estimated verification prompt tokens; Copilot request units were 0. --- src/plugins/mmviewer/mmviewer.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/plugins/mmviewer/mmviewer.cpp b/src/plugins/mmviewer/mmviewer.cpp index 2a2cbd3fc..62b27c1e4 100644 --- a/src/plugins/mmviewer/mmviewer.cpp +++ b/src/plugins/mmviewer/mmviewer.cpp @@ -132,7 +132,7 @@ MENU_TEMPLATE_ITEM PopupMenuTemplate[] = struct CButtonData { - int ImageIndex; // zero base index + int ImageIndex; // zero-based index WORD ToolTipResID; // resource ID with the tooltip string WORD ID; // universal command CViewerWindowEnablerEnum Enabler; // control variable for enabling the button @@ -171,7 +171,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) } } - return TRUE; // DLL can be loaded + return TRUE; // Allow the DLL to load } // @@ -567,7 +567,7 @@ struct CTVData BOOL Success; HANDLE Continue; int EnumFilesSourceUID; // source UID for enumerating files in the viewer - int EnumFilesCurrentIndex; // index of the first file in the viewer within the source + int EnumFilesCurrentIndex; // index of the first file in the viewer in the source }; unsigned WINAPI ViewerThreadBody(void* param) @@ -644,7 +644,7 @@ unsigned WINAPI ViewerThreadBody(void* param) char name[MAX_PATH]; strcpy(name, data->Name); BOOL openFile = data->Success; - SetEvent(data->Continue); // let the main thread continue, data are invalid from this point (=NULL) + SetEvent(data->Continue); // allow the main thread to continue; the data are invalid from this point on (=NULL) data = NULL; // if everything went smoothly, open the requested file in the window @@ -957,9 +957,9 @@ CViewerWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) HDWP hdwp = BeginDeferWindowPos(2); if (hdwp != NULL) { - // + 4: when increasing the window width the last 4 points of the rebar were not redrawn - // in the rebar; even after several hours I did not find the cause; it works in Salamander; - // for now I'm handling it like this; maybe I'll remember later where the problem is + // + 4: when increasing the window width, the last 4 pixels of the rebar were not redrawn + // in the rebar; even after several hours, the cause was not found; it works in Salamander; + // for now, this is handled this way; the root cause can be investigated later hdwp = DeferWindowPos(hdwp, HRebar, NULL, 0, 0, r.right + 4, rebarHeight, SWP_NOACTIVATE | SWP_NOZORDER); @@ -1136,7 +1136,7 @@ void WINAPI MMVOperationFromDisk(const char* sourcePath, SalEnumSelection2 next, while ((name = next(data->Parent, 1, &dosName, &isDir, &size, &attr, &lastWrite, nextParam, &errorOccured)) != NULL) { - //if (errorOccured == SALENUM_ERROR); // SALENUM_CANCEL cannot arrive here + //if (errorOccured == SALENUM_ERROR); // SALENUM_CANCEL cannot occur here // data->Success = FALSE; // Petr: I think skipped files do not block further processing (the user knows about them) if (!isDir) @@ -1163,7 +1163,7 @@ void WINAPI MMVOperationFromDisk(const char* sourcePath, SalEnumSelection2 next, } } - if (errorOccured == SALENUM_CANCEL || // Petr: I think skipped files do not block further processing (the user knows about them), but if the user pressed Cancel we abort the operation + if (errorOccured == SALENUM_CANCEL || // Petr: Skipped files should not prevent further processing (the user is aware of them), but if the user pressed Cancel, abort the operation data->ProcessedFiles == 0) { data->Success = FALSE; From 5d9a7500c9af9bb72851bc43d623dc58c91ed83c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 17:39:01 +0200 Subject: [PATCH 165/710] [translation] Fix src/plugins/mmviewer/mmviewer.h comments Refines translated comments in src/plugins/mmviewer/mmviewer.h. Model: OpenAI GPT-5.4 Verification: Ran `node --experimental-strip-types /mnt/d/source/ostranslation/src/sequential-review.ts --target-root /mnt/d/Source/OpenSal/salamander_upstream --translation-source /mnt/d/Source/OpenSal/salamander_upstream --baseline-source gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b --artifacts-dir /mnt/d/source/ostranslation/artifacts/mmviewer-src-plugins-mmviewer-mmviewer-h-20260412-run1 --file src/plugins/mmviewer/mmviewer.h --cost-profile cheap-first`, which produced 19 comment units, 19 review results, 19 resolved results, and 19 apply results; reapplied the approved artifact into `/mnt/d/Source/OpenSal/salamander_janrysavy` with `node --experimental-strip-types /mnt/d/source/ostranslation/src/cli.ts apply --mode apply ...`; reran `node --experimental-strip-types /mnt/d/source/ostranslation/src/cli.ts guard ...` on the branch target, which passed for `src/plugins/mmviewer/mmviewer.h` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures; and completed `git diff --check -- src/plugins/mmviewer/mmviewer.h` without diff integrity failures. Telemetry: Provider-backed review used 2 Codex-family requests totaling 36232 estimated tokens; Copilot request units were 0. --- src/plugins/mmviewer/mmviewer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/mmviewer/mmviewer.h b/src/plugins/mmviewer/mmviewer.h index 9dd9382dc..a942e2618 100644 --- a/src/plugins/mmviewer/mmviewer.h +++ b/src/plugins/mmviewer/mmviewer.h @@ -142,7 +142,7 @@ enum CViewerWindowEnablerEnum class CViewerWindow : public CWindow { public: - HANDLE Lock; // 'lock' object or NULL (signaled only after we close the file) + HANDLE Lock; // 'lock' object or NULL (becomes signaled only after the file is closed) CRendererWindow Renderer; HWND HRebar; // holds the MenuBar and ToolBar From f1879457b685c6e87febc4cfb1a541e1b021f2cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 17:42:45 +0200 Subject: [PATCH 166/710] [translation] Fix src/plugins/mmviewer/mod/modparser.cpp comments Refines translated comments in src/plugins/mmviewer/mod/modparser.cpp. Model: OpenAI GPT-5.4 Verification: Ran `node --experimental-strip-types /mnt/d/source/ostranslation/src/sequential-review.ts --target-root /mnt/d/Source/OpenSal/salamander_upstream --translation-source /mnt/d/Source/OpenSal/salamander_upstream --baseline-source gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b --artifacts-dir /mnt/d/source/ostranslation/artifacts/mmviewer-mod-modparser-cpp-20260412-run2 --file src/plugins/mmviewer/mod/modparser.cpp --cost-profile cheap-first`, which produced 7 comment units, 7 review results, 7 resolved results, and 7 apply results; reapplied the approved artifact into `/mnt/d/Source/OpenSal/salamander_janrysavy` with `node --experimental-strip-types /mnt/d/source/ostranslation/src/cli.ts apply --mode apply ...`; reran `node --experimental-strip-types /mnt/d/source/ostranslation/src/cli.ts guard ...` on the branch target, which passed for `src/plugins/mmviewer/mod/modparser.cpp` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures; and completed `git diff --check -- src/plugins/mmviewer/mod/modparser.cpp` without diff integrity failures. Telemetry: Provider-backed review used 0 Codex requests totaling 0 estimated tokens; Copilot request units were 0. --- src/plugins/mmviewer/mod/modparser.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/mmviewer/mod/modparser.cpp b/src/plugins/mmviewer/mod/modparser.cpp index c7d20501c..b02ce8cf8 100644 --- a/src/plugins/mmviewer/mod/modparser.cpp +++ b/src/plugins/mmviewer/mod/modparser.cpp @@ -62,7 +62,7 @@ BOOL CParserMOD::ReadScreamTrackerModule() if (fread(&type, 1, 1, f) != 1) return FALSE; - if (type == 16) // this indicates an S3M module + if (type == 16) // S3M module { if (fseek(f, 0x2C, SEEK_SET) != 0) return FALSE; @@ -217,10 +217,10 @@ BOOL CParserMOD::ReadMultiTrackerModule() BOOL CParserMOD::ReadProTrackerModule() { - // with this stupid format it is hard to tell whether it really - // is a MOD file, so I'll try to catch at least the null terminator - // after the song name. If it is there, I assume it is a MOD. - // I also check that those 19 characters are normal characters + // With this format, it is difficult to determine reliably whether this is really + // a MOD file, so at least check for the null terminator after the song name. + // If it is present, treat it as a MOD. + // Also check that those 19 characters are normal characters. memset(modulename, '\0', sizeof(modulename)); From 69fbf0f62eb6bc191dc1ca29a15d5723ed9abfdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 17:48:06 +0200 Subject: [PATCH 167/710] [translation] Fix src/plugins/mmviewer/mp3/id3tagv1.cpp comments Refines translated comments in src/plugins/mmviewer/mp3/id3tagv1.cpp. Model: OpenAI GPT-5.4 Verification: Ran `node --experimental-strip-types /mnt/d/source/ostranslation/src/sequential-review.ts --target-root /mnt/d/Source/OpenSal/salamander_upstream --translation-source /mnt/d/Source/OpenSal/salamander_upstream --baseline-source gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b --artifacts-dir /mnt/d/source/ostranslation/artifacts/mmviewer-src-plugins-mmviewer-mp3-id3tagv1-cpp-20260412-run2 --file src/plugins/mmviewer/mp3/id3tagv1.cpp --cost-profile cheap-first`, which produced 7 comment units, 7 review results, 7 resolved results, and 7 apply results; reapplied the approved artifact into `/mnt/d/Source/OpenSal/salamander_janrysavy` with `node --experimental-strip-types /mnt/d/source/ostranslation/src/cli.ts apply --mode apply ...`; reran `node --experimental-strip-types /mnt/d/source/ostranslation/src/cli.ts guard ...` on the branch target, which passed for `src/plugins/mmviewer/mp3/id3tagv1.cpp` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures; and completed `git diff --check -- src/plugins/mmviewer/mp3/id3tagv1.cpp` without diff integrity failures. Telemetry: Provider-backed review used 0 Codex requests totaling 0 estimated tokens; Copilot request units were 0. --- src/plugins/mmviewer/mp3/id3tagv1.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/mmviewer/mp3/id3tagv1.cpp b/src/plugins/mmviewer/mp3/id3tagv1.cpp index dd881ec55..e3f95f6d4 100644 --- a/src/plugins/mmviewer/mp3/id3tagv1.cpp +++ b/src/plugins/mmviewer/mp3/id3tagv1.cpp @@ -9,7 +9,7 @@ void chkstrcpy(char* out, const char* in, size_t maxoutsize); -//max ID3TAGV1::genre size allowed +// Maximum allowed size for ID3TAGV1::genre const char* ID3TAGV1_GetGenreStr(BYTE genre) { switch (genre) From 3c73e868b0b25ea7b7ca379f51f81c75253bd8dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 17:54:07 +0200 Subject: [PATCH 168/710] [translation] Fix src/plugins/mmviewer/mp3/id3tagv2.cpp comments Refines translated comments in src/plugins/mmviewer/mp3/id3tagv2.cpp. Model: OpenAI GPT-5.4 Verification: Ran `node --experimental-strip-types /mnt/d/source/ostranslation/src/sequential-review.ts --target-root /mnt/d/Source/OpenSal/salamander_upstream --translation-source /mnt/d/Source/OpenSal/salamander_upstream --baseline-source gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b --artifacts-dir /mnt/d/source/ostranslation/artifacts/mmviewer-scan-src-plugins-mmviewer-mp3-id3tagv2-cpp-20260412-run1 --file src/plugins/mmviewer/mp3/id3tagv2.cpp --cost-profile cheap-first`, which produced 75 comment units, 75 review results, 75 resolved results, and 1 patched file in apply; reapplied the approved artifact into `/mnt/d/Source/OpenSal/salamander_janrysavy` with `node --experimental-strip-types /mnt/d/source/ostranslation/src/cli.ts apply --mode apply ...`; reran `node --experimental-strip-types /mnt/d/source/ostranslation/src/cli.ts guard ...` on the branch target, which passed for `src/plugins/mmviewer/mp3/id3tagv2.cpp` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures; and completed `git diff --check -- src/plugins/mmviewer/mp3/id3tagv2.cpp` without diff integrity failures. Telemetry: Provider-backed review used 1 Codex request totaling 16615 estimated tokens during resolve post-check patch handling; Copilot request units were 0. --- src/plugins/mmviewer/mp3/id3tagv2.cpp | 38 +++++++++++++-------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/plugins/mmviewer/mp3/id3tagv2.cpp b/src/plugins/mmviewer/mp3/id3tagv2.cpp index c164d129c..59d99159c 100644 --- a/src/plugins/mmviewer/mp3/id3tagv2.cpp +++ b/src/plugins/mmviewer/mp3/id3tagv2.cpp @@ -280,14 +280,14 @@ BOOL SwitchUnicodeString(LPWSTR wstr, int len) return TRUE; } -// reads a string and always creates NULL/NULLNULL +// reads a string and always adds a NULL/NULLNULL terminator BOOL ReadStr(FILE* f, char** out_str, long& size, int encoding = 0) { if (*out_str) free(*out_str); if (size == 0) - return TRUE; // the string has been cleaned and that's it + return TRUE; // string cleaned int nullterm = (encoding == 0) ? 1 : 2; @@ -305,7 +305,7 @@ BOOL ReadStr(FILE* f, char** out_str, long& size, int encoding = 0) // appended the string's NULL terminator (even for Unicode) (*out_str)[size] = 0; - if (encoding == 1) // and another one for Unicode + if (encoding == 1) // another one for Unicode (*out_str)[size + 1] = 0; size += nullterm; @@ -319,12 +319,12 @@ BOOL ConvertStr(char** out_str, long& size, int encoding = 0) { assert(size > 0); /*encoding: - 0 - ISO-8859-1 ..... NULL terminator at the end - 1 - 16bit Unicode .. Unicode BOM at the beginning ($FF FE or $FE FF) - defines byte order - Unicode NULL at the end ($FF FE 00 00 or $FE FF 00 00). - 2 - UTF16 BE with BOM - 3 - UTF8 without BOM - */ + 0 - ISO-8859-1 ..... NULL terminator at the end + 1 - 16-bit Unicode .. Unicode BOM at the beginning ($FF FE or $FE FF) - defines byte order + Unicode NULL at the end ($FF FE 00 00 or $FE FF 00 00). + 2 - UTF16 BE with BOM + 3 - UTF8 without BOM + */ if (*out_str) { @@ -336,12 +336,12 @@ BOOL ConvertStr(char** out_str, long& size, int encoding = 0) if (size < 4) return FALSE; - if (((*out_str)[0] == 0xFE) && ((*out_str)[1] == 0xFF)) // reversed BOM, swap it + if (((*out_str)[0] == 0xFE) && ((*out_str)[1] == 0xFF)) // Reversed BOM, swap bytes SwitchUnicodeString(((WCHAR*)(*out_str)) + 1, size - 2); assert((size % 2) == 0); - if ((size % 2) != 0) // that's some glitch, try it like this + if ((size % 2) != 0) // odd size, try handling it like this size++; // and now we have the ANSI size @@ -364,7 +364,7 @@ BOOL ConvertStr(char** out_str, long& size, int encoding = 0) //free(*out_str); *out_str = new_out_str; } - else if (encoding == 3 /*UTF8 w/o BOM*/) + else if (encoding == 3 /*UTF8 without BOM*/) { } else @@ -380,7 +380,7 @@ BOOL ConvertStr(char** out_str, long& size, int encoding = 0) return FALSE; } -// splits the string into two at the point where the NULL terminator is +// splits the string into two at the NULL terminator BOOL BreakStr(char** out_str, int size, int encoding, char** pp1, int& sizep1, char** pp2, int& sizep2, BOOL second_is_ansi = FALSE) { char* part1; @@ -478,7 +478,7 @@ BOOL ReadTextInfoFrm(FILE* f, const ID3TagV2FrameHeaderAbstract* pfh, char** out { if ((*out_str) && pfh->CompareID(id3v2_frames[26])) { - // special filtering of GENRE (parentheses with a number as an index in the tag1 genre list...) + // Special filtering of GENRE (parentheses with a number used as an index into the tag1 genre list...) char* tmp; char* string = *out_str; char* new_out_str = NULL; @@ -526,7 +526,7 @@ void ReadBreakStr(FILE* f, char** out_str, long size, int encoding) int p1size; int p2size; - // a comment consists of two parts. Between them is a NULL terminator. Split them + // The comment consists of two parts. There is a NULL terminator between them. Split them. if (BreakStr(out_str, size, encoding, &p1, p1size, &p2, p2size)) { char separator[] = " - "; @@ -548,10 +548,10 @@ void ReadBreakStr(FILE* f, char** out_str, long size, int encoding) if (p2) free(p2); - if (*out_str && (p1 != *out_str /*sometimes!*/)) + if (*out_str && (p1 != *out_str /* p1 sometimes aliases *out_str */)) free(*out_str); - *out_str = new_out_str; // returns null if allocation fails + *out_str = new_out_str; // set to NULL if allocation fails } } } @@ -644,7 +644,7 @@ BOOL ID3TAGV2_Read(FILE* f, const ID3TAGV2_HEADER* pmh, ID3TAGV2_DECODED* phd) if (f && pmh && phd) { if (pmh->ver > 4) - return FALSE; // currently do not support versions > id3v2.4 + return FALSE; // versions later than ID3v2.4 are not supported yet memset(phd, 0, sizeof(ID3TAGV2_DECODED)); @@ -764,7 +764,7 @@ BOOL ID3TAGV2_ReadMainHead(FILE* f, ID3TAGV2_HEADER* pmh) switch (pmh->ver) { case 2: // v2.2 - return FALSE; // in this version the 6th bit means compressed. We don't take compressed ones. Extended is not here + return FALSE; // In this version, bit 6 means compressed. Compressed frames are not supported. There is no extended header here. case 3: // v2.3 case 4: // v2.4 From 97ffb5b54b7f38f6c4049a8011c265223b55bb6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 17:59:54 +0200 Subject: [PATCH 169/710] [translation] Fix src/plugins/mmviewer/mp4/mp4head.cpp comments Refines translated comments in src/plugins/mmviewer/mp4/mp4head.cpp. Model: OpenAI GPT-5.4 Verification: Ran `node --experimental-strip-types /mnt/d/source/ostranslation/src/sequential-review.ts --target-root /mnt/d/Source/OpenSal/salamander_upstream --translation-source /mnt/d/Source/OpenSal/salamander_upstream --baseline-source gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b --artifacts-dir /mnt/d/source/ostranslation/artifacts/mmviewer-scan-src-plugins-mmviewer-mp4-mp4head-cpp-20260412-run2 --file src/plugins/mmviewer/mp4/mp4head.cpp --cost-profile cheap-first`, which produced 25 comment units, 25 review results, 25 resolved results, and 1 patched file in apply; reapplied the approved artifact into `/mnt/d/Source/OpenSal/salamander_janrysavy` with `node --experimental-strip-types /mnt/d/source/ostranslation/src/cli.ts apply --mode apply ...`; reran `node --experimental-strip-types /mnt/d/source/ostranslation/src/cli.ts guard ...` on the branch target, which passed for `src/plugins/mmviewer/mp4/mp4head.cpp` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures; and completed `git diff --check -- src/plugins/mmviewer/mp4/mp4head.cpp` without diff integrity failures. Telemetry: Provider-backed review used 3 Codex requests totaling 59440 estimated tokens; Copilot request units were 0. --- src/plugins/mmviewer/mp4/mp4head.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/mmviewer/mp4/mp4head.cpp b/src/plugins/mmviewer/mp4/mp4head.cpp index 74a53e46f..de4053513 100644 --- a/src/plugins/mmviewer/mp4/mp4head.cpp +++ b/src/plugins/mmviewer/mp4/mp4head.cpp @@ -91,14 +91,14 @@ static int ReadADTSHeader(FILE* file, AACHEAD_DECODED* info) break; } - /* check syncword */ + /* Check the syncword. */ if (!((buffer[0] == 0xFF) && ((buffer[1] & 0xF6) == 0xF0))) break; if (!frames) { - /* fixed ADTS header is the same for every frame, so we read it only once */ - /* Syncword found, proceed to read in the fixed ADTS header */ + /* The fixed ADTS header is the same for every frame, so we read it only once. */ + /* Syncword found; proceed to read the fixed ADTS header. */ ID = buffer[1] & 0x08; info->object_type = (buffer[2] & 0xC0) >> 6; sr_idx = (buffer[2] & 0x3C) >> 2; @@ -178,7 +178,7 @@ bool DecodeAACHeader(FILE* file, AACHEAD_DECODED* info) adxx_id[5 - 1] = 0; info->length = 0; - /* Determine the header type of the file, check the first two bytes */ + /* Determine the file header type by checking the first two bytes. */ if (StringComp((const char*)adxx_id, "AD", 2) == 0) { /* We think its an ADIF header, but check the rest just to make sure */ From 2f7b8ff1ba6bce2116fc8f16a17a382bf132fc3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 18:03:28 +0200 Subject: [PATCH 170/710] [translation] Fix src/plugins/mmviewer/ogg/ogg.h comments Refines translated comments in src/plugins/mmviewer/ogg/ogg.h. Model: OpenAI GPT-5.4 Verification: Ran `node --experimental-strip-types /mnt/d/source/ostranslation/src/sequential-review.ts --target-root /mnt/d/Source/OpenSal/salamander_upstream --translation-source /mnt/d/Source/OpenSal/salamander_upstream --baseline-source gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b --artifacts-dir /mnt/d/source/ostranslation/artifacts/mmviewer-scan-src-plugins-mmviewer-ogg-ogg-h-20260412-run3 --file src/plugins/mmviewer/ogg/ogg.h --cost-profile cheap-first`, which produced 20 comment units, 20 review results, 20 resolved results, and 1 patched file in apply; reapplied the approved artifact into `/mnt/d/Source/OpenSal/salamander_janrysavy` with `node --experimental-strip-types /mnt/d/source/ostranslation/src/cli.ts apply --mode apply ...`; reran `node --experimental-strip-types /mnt/d/source/ostranslation/src/cli.ts guard ...` on the branch target, which passed for `src/plugins/mmviewer/ogg/ogg.h` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures; and completed `git diff --check -- src/plugins/mmviewer/ogg/ogg.h` without diff integrity failures. Telemetry: Provider-backed review used 2 Codex requests totaling 36332 estimated tokens; Copilot request units were 0. --- src/plugins/mmviewer/ogg/ogg.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/plugins/mmviewer/ogg/ogg.h b/src/plugins/mmviewer/ogg/ogg.h index 45ef98d4f..e44288e46 100644 --- a/src/plugins/mmviewer/ogg/ogg.h +++ b/src/plugins/mmviewer/ogg/ogg.h @@ -68,10 +68,8 @@ extern "C" unsigned char header[282]; /* working space for header encode */ int header_fill; - int e_o_s; /* set when we have buffered the last packet in the - logical bitstream */ - int b_o_s; /* set after we've written the initial page - of a logical bitstream */ + int e_o_s; /* set when the last packet in the logical bitstream has been buffered */ + int b_o_s; /* set after the initial page of a logical bitstream has been written */ long serialno; long pageno; ogg_int64_t packetno; /* sequence number for decode; the framing From c9ca6d0bba88b13953ce56d9ae685ab3f55cf770 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 18:06:47 +0200 Subject: [PATCH 171/710] [translation] Fix src/plugins/mmviewer/ogg/oggparser.cpp comments Refines translated comments in src/plugins/mmviewer/ogg/oggparser.cpp. Model: OpenAI GPT-5.4 Verification: Ran `node --experimental-strip-types /mnt/d/source/ostranslation/src/sequential-review.ts --target-root /mnt/d/Source/OpenSal/salamander_upstream --translation-source /mnt/d/Source/OpenSal/salamander_upstream --baseline-source gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b --artifacts-dir /mnt/d/source/ostranslation/artifacts/mmviewer-scan-src-plugins-mmviewer-ogg-oggparser-cpp-20260412-run4 --file src/plugins/mmviewer/ogg/oggparser.cpp --cost-profile cheap-first`, which produced 24 comment units, 24 review results, 24 resolved results, and 1 patched file in apply; reapplied the approved artifact into `/mnt/d/Source/OpenSal/salamander_janrysavy` with `node --experimental-strip-types /mnt/d/source/ostranslation/src/cli.ts apply --mode apply ...`; reran `node --experimental-strip-types /mnt/d/source/ostranslation/src/cli.ts guard ...` on the branch target, which passed for `src/plugins/mmviewer/ogg/oggparser.cpp` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures; and completed `git diff --check -- src/plugins/mmviewer/ogg/oggparser.cpp` without diff integrity failures. Telemetry: Provider-backed review used 2 Codex requests totaling 43015 estimated tokens; Copilot request units were 0. --- src/plugins/mmviewer/ogg/oggparser.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/mmviewer/ogg/oggparser.cpp b/src/plugins/mmviewer/ogg/oggparser.cpp index 7ff8fbd41..879af2600 100644 --- a/src/plugins/mmviewer/ogg/oggparser.cpp +++ b/src/plugins/mmviewer/ogg/oggparser.cpp @@ -106,7 +106,7 @@ CParserOGG::GetFileInfo(COutputInterface* output) {"GENRE", IDS_OGG_GENRE, NULL}, //A short text indication of music genre {"PERFORMER", IDS_OGG_PERFORMER, NULL}, - //The artist(s) who performed the work. In classical music this would be the conductor, orchestra, soloists. In an audio book it would be the actor who did the reading. In popular music this is typically the same as the ARTIST and is ommitted. + // The artist(s) who performed the work. In classical music this would be the conductor, orchestra, or soloists. In an audio book it would be the actor who did the reading. In popular music this is typically the same as the ARTIST and is omitted. {"ORGANIZATION", IDS_OGG_ORGANIZATION, NULL}, //Name of the organization producing the track (i.e. the 'record label') {"DESCRIPTION", IDS_OGG_DESCRIPTION, NULL}, @@ -120,7 +120,7 @@ CParserOGG::GetFileInfo(COutputInterface* output) {"ISRC", IDS_OGG_ISRC, NULL}, //ISRC number for the track; see the ISRC intro page for more information on ISRC numbers. {"DISCID", IDS_OGG_DISCID, NULL}, - //Table of contents hash from an associated disc, generally used to index the track in published music databases. See http://freedb.org/ for and example of such a hash. + // Table-of-contents hash from an associated disc, generally used to index the track in published music databases. See http://freedb.org/ for an example of such a hash. {"VERSION", IDS_OGG_VERSIONS, NULL}, //The version field may be used to differentiate multiple versions of the same track title in a single collection. (e.g. remix info) {"COMMENT", IDS_OGG_COMMENTS, NULL}, @@ -153,7 +153,7 @@ CParserOGG::GetFileInfo(COutputInterface* output) { char* tmp = SalGeneral->DupStr(*ptr); _strupr(tmp); - // UTF8 is preserved on NT-class OS's + // UTF-8 is preserved on NT-class OSes if (((f = FindComment(tmp, offset, comments)) != -1) && (f < countTags)) comments[f].str = SalGeneral->DupStr(*ptr + offset); else From 1725b6825e382389935f211c3b774159ab8fef6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 18:10:38 +0200 Subject: [PATCH 172/710] [translation] Fix src/plugins/mmviewer/parser.h comments Refines translated comments in src/plugins/mmviewer/parser.h. Model: OpenAI GPT-5.4 Verification: Ran `node --experimental-strip-types /mnt/d/source/ostranslation/src/sequential-review.ts --target-root /mnt/d/Source/OpenSal/salamander_upstream --translation-source /mnt/d/Source/OpenSal/salamander_upstream --baseline-source gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b --artifacts-dir /mnt/d/source/ostranslation/artifacts/mmviewer-scan-src-plugins-mmviewer-parser-h-20260412-run5 --file src/plugins/mmviewer/parser.h --cost-profile cheap-first`, which produced 15 comment units, 15 review results, 15 resolved results, and 1 patched file in apply; reapplied the approved artifact into `/mnt/d/Source/OpenSal/salamander_janrysavy` with `node --experimental-strip-types /mnt/d/source/ostranslation/src/cli.ts apply --mode apply ...`; reran `node --experimental-strip-types /mnt/d/source/ostranslation/src/cli.ts guard ...` on the branch target, which passed for `src/plugins/mmviewer/parser.h` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures; and completed `git diff --check -- src/plugins/mmviewer/parser.h` without diff integrity failures. Telemetry: Provider-backed review used 2 Codex requests totaling 34019 estimated tokens; Copilot request units were 0. --- src/plugins/mmviewer/parser.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/mmviewer/parser.h b/src/plugins/mmviewer/parser.h index d55f9c127..ca9bb33df 100644 --- a/src/plugins/mmviewer/parser.h +++ b/src/plugins/mmviewer/parser.h @@ -11,7 +11,7 @@ enum CParserResultEnum preOpenError, // error while opening the file preReadError, // error while reading from the file preWriteError, // error while writing to the file - preSeekError, // error while setting the position in the file + preSeekError, // error while seeking in the file preCorruptedFile, // corruped file preExtensionError, // unable to initialize Windows extensions e.g. WMA preCount // another error From b574865ebe957d2cd5540e954a9a637acaeabb70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 18:15:15 +0200 Subject: [PATCH 173/710] [translation] Fix src/plugins/mmviewer/renmain.cpp comments Refines translated comments in src/plugins/mmviewer/renmain.cpp. Model: OpenAI GPT-5.4 Verification: Ran `node --experimental-strip-types /mnt/d/source/ostranslation/src/sequential-review.ts --target-root /mnt/d/Source/OpenSal/salamander_upstream --translation-source /mnt/d/Source/OpenSal/salamander_upstream --baseline-source gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b --artifacts-dir /mnt/d/source/ostranslation/artifacts/mmviewer-scan-src-plugins-mmviewer-renmain-cpp-20260412-run6 --file src/plugins/mmviewer/renmain.cpp --cost-profile cheap-first`, which produced 26 comment units, 26 review results, 26 resolved results, and 1 patched file in apply; reapplied the approved artifact into `/mnt/d/Source/OpenSal/salamander_janrysavy` with `node --experimental-strip-types /mnt/d/source/ostranslation/src/cli.ts apply --mode apply ...`; reran `node --experimental-strip-types /mnt/d/source/ostranslation/src/cli.ts guard ...` on the branch target, which passed for `src/plugins/mmviewer/renmain.cpp` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures; and completed `git diff --check -- src/plugins/mmviewer/renmain.cpp` without diff integrity failures. Telemetry: Provider-backed review used 4 Codex requests totaling 76878 estimated tokens; Copilot request units were 0. --- src/plugins/mmviewer/renmain.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/mmviewer/renmain.cpp b/src/plugins/mmviewer/renmain.cpp index cf9abb78d..85cb8b902 100644 --- a/src/plugins/mmviewer/renmain.cpp +++ b/src/plugins/mmviewer/renmain.cpp @@ -265,7 +265,7 @@ LRESULT CRendererWindow::OnCommand(WPARAM wParam, LPARAM lParam) FileName[0] = 0; } - // set the index even if it fails so the user can move to the next/previous image + // Set the index even if opening fails so the user can move to the next/previous image EnumFilesCurrentIndex = enumFilesCurrentIndex; } } @@ -482,7 +482,7 @@ CRendererWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) { if (Output.GetCount()) return 1; - // Let Windows erase the bground for us if we have nothing to show... + // Let Windows erase the background for us if we have nothing to show... break; } From fe26c3a4d30e80fc4777ff816063e5bf3f000723 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 18:18:10 +0200 Subject: [PATCH 174/710] [translation] Fix src/plugins/mmviewer/renpaint.cpp comments Refines translated comments in src/plugins/mmviewer/renpaint.cpp. Model: OpenAI GPT-5.4 Verification: Ran `node --experimental-strip-types /mnt/d/source/ostranslation/src/sequential-review.ts --target-root /mnt/d/Source/OpenSal/salamander_upstream --translation-source /mnt/d/Source/OpenSal/salamander_upstream --baseline-source gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b --artifacts-dir /mnt/d/source/ostranslation/artifacts/mmviewer-scan-src-plugins-mmviewer-renpaint-cpp-20260412-run7 --file src/plugins/mmviewer/renpaint.cpp --cost-profile cheap-first`, which produced 15 comment units, 15 review results, 15 resolved results, and 1 patched file in apply; reapplied the approved artifact into `/mnt/d/Source/OpenSal/salamander_janrysavy` with `node --experimental-strip-types /mnt/d/source/ostranslation/src/cli.ts apply --mode apply ...`; reran `node --experimental-strip-types /mnt/d/source/ostranslation/src/cli.ts guard ...` on the branch target, which passed for `src/plugins/mmviewer/renpaint.cpp` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures; and completed `git diff --check -- src/plugins/mmviewer/renpaint.cpp` without diff integrity failures. Telemetry: Provider-backed review used 3 Codex requests totaling 55997 estimated tokens; Copilot request units were 0. --- src/plugins/mmviewer/renpaint.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/mmviewer/renpaint.cpp b/src/plugins/mmviewer/renpaint.cpp index bbefac16a..cc433b0cf 100644 --- a/src/plugins/mmviewer/renpaint.cpp +++ b/src/plugins/mmviewer/renpaint.cpp @@ -117,7 +117,7 @@ void CRendererWindow::Paint(HDC hDC, BOOL moveEditBoxes, DWORD deferFlg) SCROLLINFO si; si.cbSize = sizeof(si); si.fMask = SIF_POS; - if (!GetScrollInfo(HWindow, SB_VERT, &si)) //0 = no scrollbar + if (!GetScrollInfo(HWindow, SB_VERT, &si)) // 0 = no scroll position si.nPos = 0; int yPos = si.nPos; @@ -158,7 +158,7 @@ void CRendererWindow::Paint(HDC hDC, BOOL moveEditBoxes, DWORD deferFlg) { LRESULT lines = SendMessage(item->hwnd, (UINT)EM_GETLINECOUNT, 0, 0); - if (lines > 1) // add a tiny scrollbar ;-) + if (lines > 1) // add a vertical scrollbar { LONG style = GetWindowLong(item->hwnd, GWL_STYLE); SetWindowLong(item->hwnd, GWL_STYLE, style | WS_VSCROLL); From c5da73dc5fc6828a818719a6c0d431b9e998e354 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 18:20:55 +0200 Subject: [PATCH 175/710] [translation] Fix src/plugins/mmviewer/vqf/vqfparser.cpp comments Refines translated comments in src/plugins/mmviewer/vqf/vqfparser.cpp. Model: OpenAI GPT-5.4 Verification: Ran `node --experimental-strip-types /mnt/d/source/ostranslation/src/sequential-review.ts --target-root /mnt/d/Source/OpenSal/salamander_upstream --translation-source /mnt/d/Source/OpenSal/salamander_upstream --baseline-source gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b --artifacts-dir /mnt/d/source/ostranslation/artifacts/mmviewer-scan-src-plugins-mmviewer-vqf-vqfparser-cpp-20260412-run8 --file src/plugins/mmviewer/vqf/vqfparser.cpp --cost-profile cheap-first`, which produced 7 comment units, 7 review results, 7 resolved results, and 1 patched file in apply; reapplied the approved artifact into `/mnt/d/Source/OpenSal/salamander_janrysavy` with `node --experimental-strip-types /mnt/d/source/ostranslation/src/cli.ts apply --mode apply ...`; reran `node --experimental-strip-types /mnt/d/source/ostranslation/src/cli.ts guard ...` on the branch target, which passed for `src/plugins/mmviewer/vqf/vqfparser.cpp` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures; and completed `git diff --check -- src/plugins/mmviewer/vqf/vqfparser.cpp` without diff integrity failures. Telemetry: Provider-backed review used 2 Codex requests totaling 36630 estimated tokens; Copilot request units were 0. --- src/plugins/mmviewer/vqf/vqfparser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/mmviewer/vqf/vqfparser.cpp b/src/plugins/mmviewer/vqf/vqfparser.cpp index 8b0e6a765..ebb2a4fac 100644 --- a/src/plugins/mmviewer/vqf/vqfparser.cpp +++ b/src/plugins/mmviewer/vqf/vqfparser.cpp @@ -84,7 +84,7 @@ CParserVQF::GetFileInfo(COutputInterface* output) {'(', 'c', ')', ' ', IDS_VQF_COPYRIGHT, NULL}, {'F', 'I', 'L', 'E', IDS_VQF_ORIGFILENAME, NULL}, - //TODO I do not know exactly what these tags mean, you will have to find out + // TODO: The exact meaning of these tags is unknown and must be determined. {'L', 'Y', 'R', 'C', IDS_VQF_LYRC, NULL}, {'W', 'O', 'R', 'D', IDS_VQF_WORD, NULL}, {'M', 'U', 'S', 'C', IDS_VQF_MUSC, NULL}, From 9f4d83121dbc8d8703c35cb7e65ae7caecbc6abd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 12 Apr 2026 18:25:10 +0200 Subject: [PATCH 176/710] [translation] Fix src/plugins/mmviewer/wav/wavparser.cpp comments Refines translated comments in src/plugins/mmviewer/wav/wavparser.cpp. Model: OpenAI GPT-5.4 Verification: Ran `node --experimental-strip-types /mnt/d/source/ostranslation/src/sequential-review.ts --target-root /mnt/d/Source/OpenSal/salamander_upstream --translation-source /mnt/d/Source/OpenSal/salamander_upstream --baseline-source gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b --artifacts-dir /mnt/d/source/ostranslation/artifacts/mmviewer-scan-src-plugins-mmviewer-wav-wavparser-cpp-20260412-run9 --file src/plugins/mmviewer/wav/wavparser.cpp --cost-profile cheap-first`, which produced 18 comment units, 18 review results, 18 resolved results, and 1 patched file in apply; reapplied the approved artifact into `/mnt/d/Source/OpenSal/salamander_janrysavy` with `node --experimental-strip-types /mnt/d/source/ostranslation/src/cli.ts apply --mode apply ...`; reran `node --experimental-strip-types /mnt/d/source/ostranslation/src/cli.ts guard ...` on the branch target, which passed for `src/plugins/mmviewer/wav/wavparser.cpp` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures; and completed `git diff --check -- src/plugins/mmviewer/wav/wavparser.cpp` without diff integrity failures. Telemetry: Provider-backed review used 6 Codex-family requests totaling 112490 estimated tokens; Copilot request units were 0. --- src/plugins/mmviewer/wav/wavparser.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/mmviewer/wav/wavparser.cpp b/src/plugins/mmviewer/wav/wavparser.cpp index f5b83e2c4..8db5d8984 100644 --- a/src/plugins/mmviewer/wav/wavparser.cpp +++ b/src/plugins/mmviewer/wav/wavparser.cpp @@ -152,8 +152,8 @@ HRESULT CMMIO::ReadMMIO() sizeof(pcmWaveFormat)) != sizeof(pcmWaveFormat)) return E_FAIL; - // Allocate the waveformatex, but if its not pcm format, read the next - // word, and thats how many extra bytes to allocate. + // Allocate the WAVEFORMATEX structure. If the format is not PCM, read the next + // word to determine how many extra bytes to allocate. if (pcmWaveFormat.wf.wFormatTag == WAVE_FORMAT_PCM) { m_pwfx = (WAVEFORMATEX*)malloc(sizeof(WAVEFORMATEX)); @@ -166,7 +166,7 @@ HRESULT CMMIO::ReadMMIO() } else { - // Read in length of extra bytes. + // Read the length of the extra bytes. WORD cbExtraBytes = 0L; if (mmioRead(m_hmmio, (CHAR*)&cbExtraBytes, sizeof(WORD)) != sizeof(WORD)) return E_FAIL; From a9ae2ace50612c3298b184841fdfe43e61743d11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 09:04:45 +0200 Subject: [PATCH 177/710] Delete src/plugins/zip/appnote.pk (#571) --- src/plugins/zip/appnote.pk | 3498 ------------------------------------ 1 file changed, 3498 deletions(-) delete mode 100644 src/plugins/zip/appnote.pk diff --git a/src/plugins/zip/appnote.pk b/src/plugins/zip/appnote.pk deleted file mode 100644 index 8cf4bb73a..000000000 --- a/src/plugins/zip/appnote.pk +++ /dev/null @@ -1,3498 +0,0 @@ -File: APPNOTE.TXT - .ZIP File Format Specification -Version: 6.3.4 -Status: Final - replaces version 6.3.3 -Revised: October 1, 2014 -Copyright (c) 1989 - 2014 PKWARE Inc., All Rights Reserved. - -1.0 Introduction ---------------- - -1.1 Purpose ------------ - - 1.1.1 This specification is intended to define a cross-platform, - interoperable file storage and transfer format. Since its - first publication in 1989, PKWARE, Inc. ("PKWARE") has remained - committed to ensuring the interoperability of the .ZIP file - format through periodic publication and maintenance of this - specification. We trust that all .ZIP compatible vendors and - application developers that use and benefit from this format - will share and support this commitment to interoperability. - -1.2 Scope ---------- - - 1.2.1 ZIP is one of the most widely used compressed file formats. It is - universally used to aggregate, compress, and encrypt files into a single - interoperable container. No specific use or application need is - defined by this format and no specific implementation guidance is - provided. This document provides details on the storage format for - creating ZIP files. Information is provided on the records and - fields that describe what a ZIP file is. - -1.3 Trademarks --------------- - - 1.3.1 PKWARE, PKZIP, SecureZIP, and PKSFX are registered trademarks of - PKWARE, Inc. in the United States and elsewhere. PKPatchMaker, - Deflate64, and ZIP64 are trademarks of PKWARE, Inc. Other marks - referenced within this document appear for identification - purposes only and are the property of their respective owners. - - -1.4 Permitted Use ------------------ - - 1.4.1 This document, "APPNOTE.TXT - .ZIP File Format Specification" is the - exclusive property of PKWARE. Use of the information contained in this - document is permitted solely for the purpose of creating products, - programs and processes that read and write files in the ZIP format - subject to the terms and conditions herein. - - 1.4.2 Use of the content of this document within other publications is - permitted only through reference to this document. Any reproduction - or distribution of this document in whole or in part without prior - written permission from PKWARE is strictly prohibited. - - 1.4.3 Certain technological components provided in this document are the - patented proprietary technology of PKWARE and as such require a - separate, executed license agreement from PKWARE. Applicable - components are marked with the following, or similar, statement: - 'Refer to the section in this document entitled "Incorporating - PKWARE Proprietary Technology into Your Product" for more information'. - -1.5 Contacting PKWARE ---------------------- - - 1.5.1 If you have questions on this format, its use, or licensing, or if you - wish to report defects, request changes or additions, please contact: - - PKWARE, Inc. - 201 E. Pittsburgh Avenue, Suite 400 - Milwaukee, WI 53204 - +1-414-289-9788 - +1-414-289-9789 FAX - zipformat@pkware.com - - 1.5.2 Information about this format and copies of this document are publicly - available at: - - http://www.pkware.com/appnote - -1.6 Disclaimer --------------- - - 1.6.1 Although PKWARE will attempt to supply current and accurate - information relating to its file formats, algorithms, and the - subject programs, the possibility of error or omission cannot - be eliminated. PKWARE therefore expressly disclaims any warranty - that the information contained in the associated materials relating - to the subject programs and/or the format of the files created or - accessed by the subject programs and/or the algorithms used by - the subject programs, or any other matter, is current, correct or - accurate as delivered. Any risk of damage due to any possible - inaccurate information is assumed by the user of the information. - Furthermore, the information relating to the subject programs - and/or the file formats created or accessed by the subject - programs and/or the algorithms used by the subject programs is - subject to change without notice. - -2.0 Revisions --------------- - -2.1 Document Status --------------------- - - 2.1.1 If the STATUS of this file is marked as DRAFT, the content - defines proposed revisions to this specification which may consist - of changes to the ZIP format itself, or that may consist of other - content changes to this document. Versions of this document and - the format in DRAFT form may be subject to modification prior to - publication STATUS of FINAL. DRAFT versions are published periodically - to provide notification to the ZIP community of pending changes and to - provide opportunity for review and comment. - - 2.1.2 Versions of this document having a STATUS of FINAL are - considered to be in the final form for that version of the document - and are not subject to further change until a new, higher version - numbered document is published. Newer versions of this format - specification are intended to remain interoperable with with all prior - versions whenever technically possible. - -2.2 Change Log --------------- - - Version Change Description Date - ------- ------------------ ---------- - 5.2 -Single Password Symmetric Encryption 07/16/2003 - storage - - 6.1.0 -Smartcard compatibility 01/20/2004 - -Documentation on certificate storage - - 6.2.0 -Introduction of Central Directory 04/26/2004 - Encryption for encrypting metadata - -Added OS X to Version Made By values - - 6.2.1 -Added Extra Field placeholder for 04/01/2005 - POSZIP using ID 0x4690 - - -Clarified size field on - "zip64 end of central directory record" - - 6.2.2 -Documented Final Feature Specification 01/06/2006 - for Strong Encryption - - -Clarifications and typographical - corrections - - 6.3.0 -Added tape positioning storage 09/29/2006 - parameters - - -Expanded list of supported hash algorithms - - -Expanded list of supported compression - algorithms - - -Expanded list of supported encryption - algorithms - - -Added option for Unicode filename - storage - - -Clarifications for consistent use - of Data Descriptor records - - -Added additional "Extra Field" - definitions - - 6.3.1 -Corrected standard hash values for 04/11/2007 - SHA-256/384/512 - - 6.3.2 -Added compression method 97 09/28/2007 - - -Documented InfoZIP "Extra Field" - values for UTF-8 file name and - file comment storage - - 6.3.3 -Formatting changes to support 09/01/2012 - easier referencing of this APPNOTE - from other documents and standards - - 6.3.4 -Address change 10/01/2014 - - -3.0 Notations -------------- - - 3.1 Use of the term MUST or SHALL indicates a required element. - - 3.2 MAY NOT or SHALL NOT indicates an element is prohibited from use. - - 3.3 SHOULD indicates a RECOMMENDED element. - - 3.4 SHOULD NOT indicates an element NOT RECOMMENDED for use. - - 3.5 MAY indicates an OPTIONAL element. - - -4.0 ZIP Files -------------- - -4.1 What is a ZIP file ----------------------- - - 4.1.1 ZIP files MAY be identified by the standard .ZIP file extension - although use of a file extension is not required. Use of the - extension .ZIPX is also recognized and MAY be used for ZIP files. - Other common file extensions using the ZIP format include .JAR, .WAR, - .DOCX, .XLXS, .PPTX, .ODT, .ODS, .ODP and others. Programs reading or - writing ZIP files SHOULD rely on internal record signatures described - in this document to identify files in this format. - - 4.1.2 ZIP files SHOULD contain at least one file and MAY contain - multiple files. - - 4.1.3 Data compression MAY be used to reduce the size of files - placed into a ZIP file, but is not required. This format supports the - use of multiple data compression algorithms. When compression is used, - one of the documented compression algorithms MUST be used. Implementors - are advised to experiment with their data to determine which of the - available algorithms provides the best compression for their needs. - Compression method 8 (Deflate) is the method used by default by most - ZIP compatible application programs. - - - 4.1.4 Data encryption MAY be used to protect files within a ZIP file. - Keying methods supported for encryption within this format include - passwords and public/private keys. Either MAY be used individually - or in combination. Encryption MAY be applied to individual files. - Additional security MAY be used through the encryption of ZIP file - metadata stored within the Central Directory. See the section on the - Strong Encryption Specification for information. Refer to the section - in this document entitled "Incorporating PKWARE Proprietary Technology - into Your Product" for more information. - - 4.1.5 Data integrity MUST be provided for each file using CRC32. - - 4.1.6 Additional data integrity MAY be included through the use of - digital signatures. Individual files MAY be signed with one or more - digital signatures. The Central Directory, if signed, MUST use a - single signature. - - 4.1.7 Files MAY be placed within a ZIP file uncompressed or stored. - The term "stored" as used in the context of this document means the file - is copied into the ZIP file uncompressed. - - 4.1.8 Each data file placed into a ZIP file MAY be compressed, stored, - encrypted or digitally signed independent of how other data files in the - same ZIP file are archived. - - 4.1.9 ZIP files MAY be streamed, split into segments (on fixed or on - removable media) or "self-extracting". Self-extracting ZIP - files MUST include extraction code for a target platform within - the ZIP file. - - 4.1.10 Extensibility is provided for platform or application specific - needs through extra data fields that MAY be defined for custom - purposes. Extra data definitions MUST NOT conflict with existing - documented record definitions. - - 4.1.11 Common uses for ZIP MAY also include the use of manifest files. - Manifest files store application specific information within a file stored - within the ZIP file. This manifest file SHOULD be the first file in the - ZIP file. This specification does not provide any information or guidance on - the use of manifest files within ZIP files. Refer to the application developer - for information on using manifest files and for any additional profile - information on using ZIP within an application. - - 4.1.12 ZIP files MAY be placed within other ZIP files. - -4.2 ZIP Metadata ----------------- - - 4.2.1 ZIP files are identified by metadata consisting of defined record types - containing the storage information necessary for maintaining the files - placed into a ZIP file. Each record type MUST be identified using a header - signature that identifies the record type. Signature values begin with the - two byte constant marker of 0x4b50, representing the characters "PK". - - -4.3 General Format of a .ZIP file ---------------------------------- - - 4.3.1 A ZIP file MUST contain an "end of central directory record". A ZIP - file containing only an "end of central directory record" is considered an - empty ZIP file. Files may be added or replaced within a ZIP file, or deleted. - A ZIP file MUST have only one "end of central directory record". Other - records defined in this specification MAY be used as needed to support - storage requirements for individual ZIP files. - - 4.3.2 Each file placed into a ZIP file MUST be preceeded by a "local - file header" record for that file. Each "local file header" MUST be - accompanied by a corresponding "central directory header" record within - the central directory section of the ZIP file. - - 4.3.3 Files MAY be stored in arbitrary order within a ZIP file. A ZIP - file MAY span multiple volumes or it MAY be split into user-defined - segment sizes. All values MUST be stored in little-endian byte order unless - otherwise specified in this document for a specific data element. - - 4.3.4 Compression MUST NOT be applied to a "local file header", an "encryption - header", or an "end of central directory record". Individual "central - directory records" must not be compressed, but the aggregate of all central - directory records MAY be compressed. - - 4.3.5 File data MAY be followed by a "data descriptor" for the file. Data - descriptors are used to facilitate ZIP file streaming. - - - 4.3.6 Overall .ZIP file format: - - [local file header 1] - [encryption header 1] - [file data 1] - [data descriptor 1] - . - . - . - [local file header n] - [encryption header n] - [file data n] - [data descriptor n] - [archive decryption header] - [archive extra data record] - [central directory header 1] - . - . - . - [central directory header n] - [zip64 end of central directory record] - [zip64 end of central directory locator] - [end of central directory record] - - - 4.3.7 Local file header: - - local file header signature 4 bytes (0x04034b50) - version needed to extract 2 bytes - general purpose bit flag 2 bytes - compression method 2 bytes - last mod file time 2 bytes - last mod file date 2 bytes - crc-32 4 bytes - compressed size 4 bytes - uncompressed size 4 bytes - file name length 2 bytes - extra field length 2 bytes - - file name (variable size) - extra field (variable size) - - 4.3.8 File data - - Immediately following the local header for a file - SHOULD be placed the compressed or stored data for the file. - If the file is encrypted, the encryption header for the file - SHOULD be placed after the local header and before the file - data. The series of [local file header][encryption header] - [file data][data descriptor] repeats for each file in the - .ZIP archive. - - Zero-byte files, directories, and other file types that - contain no content MUST not include file data. - - 4.3.9 Data descriptor: - - crc-32 4 bytes - compressed size 4 bytes - uncompressed size 4 bytes - - 4.3.9.1 This descriptor MUST exist if bit 3 of the general - purpose bit flag is set (see below). It is byte aligned - and immediately follows the last byte of compressed data. - This descriptor SHOULD be used only when it was not possible to - seek in the output .ZIP file, e.g., when the output .ZIP file - was standard output or a non-seekable device. For ZIP64(tm) format - archives, the compressed and uncompressed sizes are 8 bytes each. - - 4.3.9.2 When compressing files, compressed and uncompressed sizes - should be stored in ZIP64 format (as 8 byte values) when a - file's size exceeds 0xFFFFFFFF. However ZIP64 format may be - used regardless of the size of a file. When extracting, if - the zip64 extended information extra field is present for - the file the compressed and uncompressed sizes will be 8 - byte values. - - 4.3.9.3 Although not originally assigned a signature, the value - 0x08074b50 has commonly been adopted as a signature value - for the data descriptor record. Implementers should be - aware that ZIP files may be encountered with or without this - signature marking data descriptors and SHOULD account for - either case when reading ZIP files to ensure compatibility. - - 4.3.9.4 When writing ZIP files, implementors SHOULD include the - signature value marking the data descriptor record. When - the signature is used, the fields currently defined for - the data descriptor record will immediately follow the - signature. - - 4.3.9.5 An extensible data descriptor will be released in a - future version of this APPNOTE. This new record is intended to - resolve conflicts with the use of this record going forward, - and to provide better support for streamed file processing. - - 4.3.9.6 When the Central Directory Encryption method is used, - the data descriptor record is not required, but MAY be used. - If present, and bit 3 of the general purpose bit field is set to - indicate its presence, the values in fields of the data descriptor - record MUST be set to binary zeros. See the section on the Strong - Encryption Specification for information. Refer to the section in - this document entitled "Incorporating PKWARE Proprietary Technology - into Your Product" for more information. - - - 4.3.10 Archive decryption header: - - 4.3.10.1 The Archive Decryption Header is introduced in version 6.2 - of the ZIP format specification. This record exists in support - of the Central Directory Encryption Feature implemented as part of - the Strong Encryption Specification as described in this document. - When the Central Directory Structure is encrypted, this decryption - header MUST precede the encrypted data segment. - - 4.3.10.2 The encrypted data segment SHALL consist of the Archive - extra data record (if present) and the encrypted Central Directory - Structure data. The format of this data record is identical to the - Decryption header record preceding compressed file data. If the - central directory structure is encrypted, the location of the start of - this data record is determined using the Start of Central Directory - field in the Zip64 End of Central Directory record. See the - section on the Strong Encryption Specification for information - on the fields used in the Archive Decryption Header record. - Refer to the section in this document entitled "Incorporating - PKWARE Proprietary Technology into Your Product" for more information. - - - 4.3.11 Archive extra data record: - - archive extra data signature 4 bytes (0x08064b50) - extra field length 4 bytes - extra field data (variable size) - - 4.3.11.1 The Archive Extra Data Record is introduced in version 6.2 - of the ZIP format specification. This record MAY be used in support - of the Central Directory Encryption Feature implemented as part of - the Strong Encryption Specification as described in this document. - When present, this record MUST immediately precede the central - directory data structure. - - 4.3.11.2 The size of this data record SHALL be included in the - Size of the Central Directory field in the End of Central - Directory record. If the central directory structure is compressed, - but not encrypted, the location of the start of this data record is - determined using the Start of Central Directory field in the Zip64 - End of Central Directory record. Refer to the section in this document - entitled "Incorporating PKWARE Proprietary Technology into Your - Product" for more information. - - 4.3.12 Central directory structure: - - [central directory header 1] - . - . - . - [central directory header n] - [digital signature] - - File header: - - central file header signature 4 bytes (0x02014b50) - version made by 2 bytes - version needed to extract 2 bytes - general purpose bit flag 2 bytes - compression method 2 bytes - last mod file time 2 bytes - last mod file date 2 bytes - crc-32 4 bytes - compressed size 4 bytes - uncompressed size 4 bytes - file name length 2 bytes - extra field length 2 bytes - file comment length 2 bytes - disk number start 2 bytes - internal file attributes 2 bytes - external file attributes 4 bytes - relative offset of local header 4 bytes - - file name (variable size) - extra field (variable size) - file comment (variable size) - - 4.3.13 Digital signature: - - header signature 4 bytes (0x05054b50) - size of data 2 bytes - signature data (variable size) - - With the introduction of the Central Directory Encryption - feature in version 6.2 of this specification, the Central - Directory Structure MAY be stored both compressed and encrypted. - Although not required, it is assumed when encrypting the - Central Directory Structure, that it will be compressed - for greater storage efficiency. Information on the - Central Directory Encryption feature can be found in the section - describing the Strong Encryption Specification. The Digital - Signature record will be neither compressed nor encrypted. - - 4.3.14 Zip64 end of central directory record - - zip64 end of central dir - signature 4 bytes (0x06064b50) - size of zip64 end of central - directory record 8 bytes - version made by 2 bytes - version needed to extract 2 bytes - number of this disk 4 bytes - number of the disk with the - start of the central directory 4 bytes - total number of entries in the - central directory on this disk 8 bytes - total number of entries in the - central directory 8 bytes - size of the central directory 8 bytes - offset of start of central - directory with respect to - the starting disk number 8 bytes - zip64 extensible data sector (variable size) - - 4.3.14.1 The value stored into the "size of zip64 end of central - directory record" should be the size of the remaining - record and should not include the leading 12 bytes. - - Size = SizeOfFixedFields + SizeOfVariableData - 12. - - 4.3.14.2 The above record structure defines Version 1 of the - zip64 end of central directory record. Version 1 was - implemented in versions of this specification preceding - 6.2 in support of the ZIP64 large file feature. The - introduction of the Central Directory Encryption feature - implemented in version 6.2 as part of the Strong Encryption - Specification defines Version 2 of this record structure. - Refer to the section describing the Strong Encryption - Specification for details on the version 2 format for - this record. Refer to the section in this document entitled - "Incorporating PKWARE Proprietary Technology into Your Product" - for more information applicable to use of Version 2 of this - record. - - 4.3.14.3 Special purpose data MAY reside in the zip64 extensible - data sector field following either a V1 or V2 version of this - record. To ensure identification of this special purpose data - it must include an identifying header block consisting of the - following: - - Header ID - 2 bytes - Data Size - 4 bytes - - The Header ID field indicates the type of data that is in the - data block that follows. - - Data Size identifies the number of bytes that follow for this - data block type. - - 4.3.14.4 Multiple special purpose data blocks MAY be present. - Each MUST be preceded by a Header ID and Data Size field. Current - mappings of Header ID values supported in this field are as - defined in APPENDIX C. - - 4.3.15 Zip64 end of central directory locator - - zip64 end of central dir locator - signature 4 bytes (0x07064b50) - number of the disk with the - start of the zip64 end of - central directory 4 bytes - relative offset of the zip64 - end of central directory record 8 bytes - total number of disks 4 bytes - - 4.3.16 End of central directory record: - - end of central dir signature 4 bytes (0x06054b50) - number of this disk 2 bytes - number of the disk with the - start of the central directory 2 bytes - total number of entries in the - central directory on this disk 2 bytes - total number of entries in - the central directory 2 bytes - size of the central directory 4 bytes - offset of start of central - directory with respect to - the starting disk number 4 bytes - .ZIP file comment length 2 bytes - .ZIP file comment (variable size) - -4.4 Explanation of fields --------------------------- - - 4.4.1 General notes on fields - - 4.4.1.1 All fields unless otherwise noted are unsigned and stored - in Intel low-byte:high-byte, low-word:high-word order. - - 4.4.1.2 String fields are not null terminated, since the length - is given explicitly. - - 4.4.1.3 The entries in the central directory may not necessarily - be in the same order that files appear in the .ZIP file. - - 4.4.1.4 If one of the fields in the end of central directory - record is too small to hold required data, the field should be - set to -1 (0xFFFF or 0xFFFFFFFF) and the ZIP64 format record - should be created. - - 4.4.1.5 The end of central directory record and the Zip64 end - of central directory locator record MUST reside on the same - disk when splitting or spanning an archive. - - 4.4.2 version made by (2 bytes) - - 4.4.2.1 The upper byte indicates the compatibility of the file - attribute information. If the external file attributes - are compatible with MS-DOS and can be read by PKZIP for - DOS version 2.04g then this value will be zero. If these - attributes are not compatible, then this value will - identify the host system on which the attributes are - compatible. Software can use this information to determine - the line record format for text files etc. - - 4.4.2.2 The current mappings are: - - 0 - MS-DOS and OS/2 (FAT / VFAT / FAT32 file systems) - 1 - Amiga 2 - OpenVMS - 3 - UNIX 4 - VM/CMS - 5 - Atari ST 6 - OS/2 H.P.F.S. - 7 - Macintosh 8 - Z-System - 9 - CP/M 10 - Windows NTFS - 11 - MVS (OS/390 - Z/OS) 12 - VSE - 13 - Acorn Risc 14 - VFAT - 15 - alternate MVS 16 - BeOS - 17 - Tandem 18 - OS/400 - 19 - OS X (Darwin) 20 thru 255 - unused - - 4.4.2.3 The lower byte indicates the ZIP specification version - (the version of this document) supported by the software - used to encode the file. The value/10 indicates the major - version number, and the value mod 10 is the minor version - number. - - 4.4.3 version needed to extract (2 bytes) - - 4.4.3.1 The minimum supported ZIP specification version needed - to extract the file, mapped as above. This value is based on - the specific format features a ZIP program MUST support to - be able to extract the file. If multiple features are - applied to a file, the minimum version MUST be set to the - feature having the highest value. New features or feature - changes affecting the published format specification will be - implemented using higher version numbers than the last - published value to avoid conflict. - - 4.4.3.2 Current minimum feature versions are as defined below: - - 1.0 - Default value - 1.1 - File is a volume label - 2.0 - File is a folder (directory) - 2.0 - File is compressed using Deflate compression - 2.0 - File is encrypted using traditional PKWARE encryption - 2.1 - File is compressed using Deflate64(tm) - 2.5 - File is compressed using PKWARE DCL Implode - 2.7 - File is a patch data set - 4.5 - File uses ZIP64 format extensions - 4.6 - File is compressed using BZIP2 compression* - 5.0 - File is encrypted using DES - 5.0 - File is encrypted using 3DES - 5.0 - File is encrypted using original RC2 encryption - 5.0 - File is encrypted using RC4 encryption - 5.1 - File is encrypted using AES encryption - 5.1 - File is encrypted using corrected RC2 encryption** - 5.2 - File is encrypted using corrected RC2-64 encryption** - 6.1 - File is encrypted using non-OAEP key wrapping*** - 6.2 - Central directory encryption - 6.3 - File is compressed using LZMA - 6.3 - File is compressed using PPMd+ - 6.3 - File is encrypted using Blowfish - 6.3 - File is encrypted using Twofish - - 4.4.3.3 Notes on version needed to extract - - * Early 7.x (pre-7.2) versions of PKZIP incorrectly set the - version needed to extract for BZIP2 compression to be 50 - when it should have been 46. - - ** Refer to the section on Strong Encryption Specification - for additional information regarding RC2 corrections. - - *** Certificate encryption using non-OAEP key wrapping is the - intended mode of operation for all versions beginning with 6.1. - Support for OAEP key wrapping MUST only be used for - backward compatibility when sending ZIP files to be opened by - versions of PKZIP older than 6.1 (5.0 or 6.0). - - + Files compressed using PPMd MUST set the version - needed to extract field to 6.3, however, not all ZIP - programs enforce this and may be unable to decompress - data files compressed using PPMd if this value is set. - - When using ZIP64 extensions, the corresponding value in the - zip64 end of central directory record MUST also be set. - This field should be set appropriately to indicate whether - Version 1 or Version 2 format is in use. - - - 4.4.4 general purpose bit flag: (2 bytes) - - Bit 0: If set, indicates that the file is encrypted. - - (For Method 6 - Imploding) - Bit 1: If the compression method used was type 6, - Imploding, then this bit, if set, indicates - an 8K sliding dictionary was used. If clear, - then a 4K sliding dictionary was used. - - Bit 2: If the compression method used was type 6, - Imploding, then this bit, if set, indicates - 3 Shannon-Fano trees were used to encode the - sliding dictionary output. If clear, then 2 - Shannon-Fano trees were used. - - (For Methods 8 and 9 - Deflating) - Bit 2 Bit 1 - 0 0 Normal (-en) compression option was used. - 0 1 Maximum (-exx/-ex) compression option was used. - 1 0 Fast (-ef) compression option was used. - 1 1 Super Fast (-es) compression option was used. - - (For Method 14 - LZMA) - Bit 1: If the compression method used was type 14, - LZMA, then this bit, if set, indicates - an end-of-stream (EOS) marker is used to - mark the end of the compressed data stream. - If clear, then an EOS marker is not present - and the compressed data size must be known - to extract. - - Note: Bits 1 and 2 are undefined if the compression - method is any other. - - Bit 3: If this bit is set, the fields crc-32, compressed - size and uncompressed size are set to zero in the - local header. The correct values are put in the - data descriptor immediately following the compressed - data. (Note: PKZIP version 2.04g for DOS only - recognizes this bit for method 8 compression, newer - versions of PKZIP recognize this bit for any - compression method.) - - Bit 4: Reserved for use with method 8, for enhanced - deflating. - - Bit 5: If this bit is set, this indicates that the file is - compressed patched data. (Note: Requires PKZIP - version 2.70 or greater) - - Bit 6: Strong encryption. If this bit is set, you MUST - set the version needed to extract value to at least - 50 and you MUST also set bit 0. If AES encryption - is used, the version needed to extract value MUST - be at least 51. See the section describing the Strong - Encryption Specification for details. Refer to the - section in this document entitled "Incorporating PKWARE - Proprietary Technology into Your Product" for more - information. - - Bit 7: Currently unused. - - Bit 8: Currently unused. - - Bit 9: Currently unused. - - Bit 10: Currently unused. - - Bit 11: Language encoding flag (EFS). If this bit is set, - the filename and comment fields for this file - MUST be encoded using UTF-8. (see APPENDIX D) - - Bit 12: Reserved by PKWARE for enhanced compression. - - Bit 13: Set when encrypting the Central Directory to indicate - selected data values in the Local Header are masked to - hide their actual values. See the section describing - the Strong Encryption Specification for details. Refer - to the section in this document entitled "Incorporating - PKWARE Proprietary Technology into Your Product" for - more information. - - Bit 14: Reserved by PKWARE. - - Bit 15: Reserved by PKWARE. - - 4.4.5 compression method: (2 bytes) - - 0 - The file is stored (no compression) - 1 - The file is Shrunk - 2 - The file is Reduced with compression factor 1 - 3 - The file is Reduced with compression factor 2 - 4 - The file is Reduced with compression factor 3 - 5 - The file is Reduced with compression factor 4 - 6 - The file is Imploded - 7 - Reserved for Tokenizing compression algorithm - 8 - The file is Deflated - 9 - Enhanced Deflating using Deflate64(tm) - 10 - PKWARE Data Compression Library Imploding (old IBM TERSE) - 11 - Reserved by PKWARE - 12 - File is compressed using BZIP2 algorithm - 13 - Reserved by PKWARE - 14 - LZMA (EFS) - 15 - Reserved by PKWARE - 16 - Reserved by PKWARE - 17 - Reserved by PKWARE - 18 - File is compressed using IBM TERSE (new) - 19 - IBM LZ77 z Architecture (PFS) - 97 - WavPack compressed data - 98 - PPMd version I, Rev 1 - - - 4.4.6 date and time fields: (2 bytes each) - - The date and time are encoded in standard MS-DOS format. - If input came from standard input, the date and time are - those at which compression was started for this data. - If encrypting the central directory and general purpose bit - flag 13 is set indicating masking, the value stored in the - Local Header will be zero. - - 4.4.7 CRC-32: (4 bytes) - - The CRC-32 algorithm was generously contributed by - David Schwaderer and can be found in his excellent - book "C Programmers Guide to NetBIOS" published by - Howard W. Sams & Co. Inc. The 'magic number' for - the CRC is 0xdebb20e3. The proper CRC pre and post - conditioning is used, meaning that the CRC register - is pre-conditioned with all ones (a starting value - of 0xffffffff) and the value is post-conditioned by - taking the one's complement of the CRC residual. - If bit 3 of the general purpose flag is set, this - field is set to zero in the local header and the correct - value is put in the data descriptor and in the central - directory. When encrypting the central directory, if the - local header is not in ZIP64 format and general purpose - bit flag 13 is set indicating masking, the value stored - in the Local Header will be zero. - - 4.4.8 compressed size: (4 bytes) - 4.4.9 uncompressed size: (4 bytes) - - The size of the file compressed (4.4.8) and uncompressed, - (4.4.9) respectively. When a decryption header is present it - will be placed in front of the file data and the value of the - compressed file size will include the bytes of the decryption - header. If bit 3 of the general purpose bit flag is set, - these fields are set to zero in the local header and the - correct values are put in the data descriptor and - in the central directory. If an archive is in ZIP64 format - and the value in this field is 0xFFFFFFFF, the size will be - in the corresponding 8 byte ZIP64 extended information - extra field. When encrypting the central directory, if the - local header is not in ZIP64 format and general purpose bit - flag 13 is set indicating masking, the value stored for the - uncompressed size in the Local Header will be zero. - - 4.4.10 file name length: (2 bytes) - 4.4.11 extra field length: (2 bytes) - 4.4.12 file comment length: (2 bytes) - - The length of the file name, extra field, and comment - fields respectively. The combined length of any - directory record and these three fields should not - generally exceed 65,535 bytes. If input came from standard - input, the file name length is set to zero. - - - 4.4.13 disk number start: (2 bytes) - - The number of the disk on which this file begins. If an - archive is in ZIP64 format and the value in this field is - 0xFFFF, the size will be in the corresponding 4 byte zip64 - extended information extra field. - - 4.4.14 internal file attributes: (2 bytes) - - Bits 1 and 2 are reserved for use by PKWARE. - - 4.4.14.1 The lowest bit of this field indicates, if set, - that the file is apparently an ASCII or text file. If not - set, that the file apparently contains binary data. - The remaining bits are unused in version 1.0. - - 4.4.14.2 The 0x0002 bit of this field indicates, if set, that - a 4 byte variable record length control field precedes each - logical record indicating the length of the record. The - record length control field is stored in little-endian byte - order. This flag is independent of text control characters, - and if used in conjunction with text data, includes any - control characters in the total length of the record. This - value is provided for mainframe data transfer support. - - 4.4.15 external file attributes: (4 bytes) - - The mapping of the external attributes is - host-system dependent (see 'version made by'). For - MS-DOS, the low order byte is the MS-DOS directory - attribute byte. If input came from standard input, this - field is set to zero. - - 4.4.16 relative offset of local header: (4 bytes) - - This is the offset from the start of the first disk on - which this file appears, to where the local header should - be found. If an archive is in ZIP64 format and the value - in this field is 0xFFFFFFFF, the size will be in the - corresponding 8 byte zip64 extended information extra field. - - 4.4.17 file name: (Variable) - - 4.4.17.1 The name of the file, with optional relative path. - The path stored MUST not contain a drive or - device letter, or a leading slash. All slashes - MUST be forward slashes '/' as opposed to - backwards slashes '\' for compatibility with Amiga - and UNIX file systems etc. If input came from standard - input, there is no file name field. - - 4.4.17.2 If using the Central Directory Encryption Feature and - general purpose bit flag 13 is set indicating masking, the file - name stored in the Local Header will not be the actual file name. - A masking value consisting of a unique hexadecimal value will - be stored. This value will be sequentially incremented for each - file in the archive. See the section on the Strong Encryption - Specification for details on retrieving the encrypted file name. - Refer to the section in this document entitled "Incorporating PKWARE - Proprietary Technology into Your Product" for more information. - - - 4.4.18 file comment: (Variable) - - The comment for this file. - - 4.4.19 number of this disk: (2 bytes) - - The number of this disk, which contains central - directory end record. If an archive is in ZIP64 format - and the value in this field is 0xFFFF, the size will - be in the corresponding 4 byte zip64 end of central - directory field. - - - 4.4.20 number of the disk with the start of the central - directory: (2 bytes) - - The number of the disk on which the central - directory starts. If an archive is in ZIP64 format - and the value in this field is 0xFFFF, the size will - be in the corresponding 4 byte zip64 end of central - directory field. - - 4.4.21 total number of entries in the central dir on - this disk: (2 bytes) - - The number of central directory entries on this disk. - If an archive is in ZIP64 format and the value in - this field is 0xFFFF, the size will be in the - corresponding 8 byte zip64 end of central - directory field. - - 4.4.22 total number of entries in the central dir: (2 bytes) - - The total number of files in the .ZIP file. If an - archive is in ZIP64 format and the value in this field - is 0xFFFF, the size will be in the corresponding 8 byte - zip64 end of central directory field. - - 4.4.23 size of the central directory: (4 bytes) - - The size (in bytes) of the entire central directory. - If an archive is in ZIP64 format and the value in - this field is 0xFFFFFFFF, the size will be in the - corresponding 8 byte zip64 end of central - directory field. - - 4.4.24 offset of start of central directory with respect to - the starting disk number: (4 bytes) - - Offset of the start of the central directory on the - disk on which the central directory starts. If an - archive is in ZIP64 format and the value in this - field is 0xFFFFFFFF, the size will be in the - corresponding 8 byte zip64 end of central - directory field. - - 4.4.25 .ZIP file comment length: (2 bytes) - - The length of the comment for this .ZIP file. - - 4.4.26 .ZIP file comment: (Variable) - - The comment for this .ZIP file. ZIP file comment data - is stored unsecured. No encryption or data authentication - is applied to this area at this time. Confidential information - should not be stored in this section. - - 4.4.27 zip64 extensible data sector (variable size) - - (currently reserved for use by PKWARE) - - - 4.4.28 extra field: (Variable) - - This SHOULD be used for storage expansion. If additional - information needs to be stored within a ZIP file for special - application or platform needs, it SHOULD be stored here. - Programs supporting earlier versions of this specification can - then safely skip the file, and find the next file or header. - This field will be 0 length in version 1.0. - - Existing extra fields are defined in the section - Extensible data fields that follows. - -4.5 Extensible data fields --------------------------- - - 4.5.1 In order to allow different programs and different types - of information to be stored in the 'extra' field in .ZIP - files, the following structure MUST be used for all - programs storing data in this field: - - header1+data1 + header2+data2 . . . - - Each header should consist of: - - Header ID - 2 bytes - Data Size - 2 bytes - - Note: all fields stored in Intel low-byte/high-byte order. - - The Header ID field indicates the type of data that is in - the following data block. - - Header IDs of 0 thru 31 are reserved for use by PKWARE. - The remaining IDs can be used by third party vendors for - proprietary usage. - - 4.5.2 The current Header ID mappings defined by PKWARE are: - - 0x0001 Zip64 extended information extra field - 0x0007 AV Info - 0x0008 Reserved for extended language encoding data (PFS) - (see APPENDIX D) - 0x0009 OS/2 - 0x000a NTFS - 0x000c OpenVMS - 0x000d UNIX - 0x000e Reserved for file stream and fork descriptors - 0x000f Patch Descriptor - 0x0014 PKCS#7 Store for X.509 Certificates - 0x0015 X.509 Certificate ID and Signature for - individual file - 0x0016 X.509 Certificate ID for Central Directory - 0x0017 Strong Encryption Header - 0x0018 Record Management Controls - 0x0019 PKCS#7 Encryption Recipient Certificate List - 0x0065 IBM S/390 (Z390), AS/400 (I400) attributes - - uncompressed - 0x0066 Reserved for IBM S/390 (Z390), AS/400 (I400) - attributes - compressed - 0x4690 POSZIP 4690 (reserved) - - - 4.5.3 -Zip64 Extended Information Extra Field (0x0001): - - The following is the layout of the zip64 extended - information "extra" block. If one of the size or - offset fields in the Local or Central directory - record is too small to hold the required data, - a Zip64 extended information record is created. - The order of the fields in the zip64 extended - information record is fixed, but the fields MUST - only appear if the corresponding Local or Central - directory record field is set to 0xFFFF or 0xFFFFFFFF. - - Note: all fields stored in Intel low-byte/high-byte order. - - Value Size Description - ----- ---- ----------- -(ZIP64) 0x0001 2 bytes Tag for this "extra" block type - Size 2 bytes Size of this "extra" block - Original - Size 8 bytes Original uncompressed file size - Compressed - Size 8 bytes Size of compressed data - Relative Header - Offset 8 bytes Offset of local header record - Disk Start - Number 4 bytes Number of the disk on which - this file starts - - This entry in the Local header MUST include BOTH original - and compressed file size fields. If encrypting the - central directory and bit 13 of the general purpose bit - flag is set indicating masking, the value stored in the - Local Header for the original file size will be zero. - - - 4.5.4 -OS/2 Extra Field (0x0009): - - The following is the layout of the OS/2 attributes "extra" - block. (Last Revision 09/05/95) - - Note: all fields stored in Intel low-byte/high-byte order. - - Value Size Description - ----- ---- ----------- -(OS/2) 0x0009 2 bytes Tag for this "extra" block type - TSize 2 bytes Size for the following data block - BSize 4 bytes Uncompressed Block Size - CType 2 bytes Compression type - EACRC 4 bytes CRC value for uncompress block - (var) variable Compressed block - - The OS/2 extended attribute structure (FEA2LIST) is - compressed and then stored in its entirety within this - structure. There will only ever be one "block" of data in - VarFields[]. - - 4.5.5 -NTFS Extra Field (0x000a): - - The following is the layout of the NTFS attributes - "extra" block. (Note: At this time the Mtime, Atime - and Ctime values MAY be used on any WIN32 system.) - - Note: all fields stored in Intel low-byte/high-byte order. - - Value Size Description - ----- ---- ----------- -(NTFS) 0x000a 2 bytes Tag for this "extra" block type - TSize 2 bytes Size of the total "extra" block - Reserved 4 bytes Reserved for future use - Tag1 2 bytes NTFS attribute tag value #1 - Size1 2 bytes Size of attribute #1, in bytes - (var) Size1 Attribute #1 data - . - . - . - TagN 2 bytes NTFS attribute tag value #N - SizeN 2 bytes Size of attribute #N, in bytes - (var) SizeN Attribute #N data - - For NTFS, values for Tag1 through TagN are as follows: - (currently only one set of attributes is defined for NTFS) - - Tag Size Description - ----- ---- ----------- - 0x0001 2 bytes Tag for attribute #1 - Size1 2 bytes Size of attribute #1, in bytes - Mtime 8 bytes File last modification time - Atime 8 bytes File last access time - Ctime 8 bytes File creation time - - 4.5.6 -OpenVMS Extra Field (0x000c): - - The following is the layout of the OpenVMS attributes - "extra" block. - - Note: all fields stored in Intel low-byte/high-byte order. - - Value Size Description - ----- ---- ----------- - (VMS) 0x000c 2 bytes Tag for this "extra" block type - TSize 2 bytes Size of the total "extra" block - CRC 4 bytes 32-bit CRC for remainder of the block - Tag1 2 bytes OpenVMS attribute tag value #1 - Size1 2 bytes Size of attribute #1, in bytes - (var) Size1 Attribute #1 data - . - . - . - TagN 2 bytes OpenVMS attribute tag value #N - SizeN 2 bytes Size of attribute #N, in bytes - (var) SizeN Attribute #N data - - OpenVMS Extra Field Rules: - - 4.5.6.1. There will be one or more attributes present, which - will each be preceded by the above TagX & SizeX values. - These values are identical to the ATR$C_XXXX and ATR$S_XXXX - constants which are defined in ATR.H under OpenVMS C. Neither - of these values will ever be zero. - - 4.5.6.2. No word alignment or padding is performed. - - 4.5.6.3. A well-behaved PKZIP/OpenVMS program should never produce - more than one sub-block with the same TagX value. Also, there will - never be more than one "extra" block of type 0x000c in a particular - directory record. - - 4.5.7 -UNIX Extra Field (0x000d): - - The following is the layout of the UNIX "extra" block. - Note: all fields are stored in Intel low-byte/high-byte - order. - - Value Size Description - ----- ---- ----------- -(UNIX) 0x000d 2 bytes Tag for this "extra" block type - TSize 2 bytes Size for the following data block - Atime 4 bytes File last access time - Mtime 4 bytes File last modification time - Uid 2 bytes File user ID - Gid 2 bytes File group ID - (var) variable Variable length data field - - The variable length data field will contain file type - specific data. Currently the only values allowed are - the original "linked to" file names for hard or symbolic - links, and the major and minor device node numbers for - character and block device nodes. Since device nodes - cannot be either symbolic or hard links, only one set of - variable length data is stored. Link files will have the - name of the original file stored. This name is NOT NULL - terminated. Its size can be determined by checking TSize - - 12. Device entries will have eight bytes stored as two 4 - byte entries (in little endian format). The first entry - will be the major device number, and the second the minor - device number. - - 4.5.8 -PATCH Descriptor Extra Field (0x000f): - - 4.5.8.1 The following is the layout of the Patch Descriptor - "extra" block. - - Note: all fields stored in Intel low-byte/high-byte order. - - Value Size Description - ----- ---- ----------- -(Patch) 0x000f 2 bytes Tag for this "extra" block type - TSize 2 bytes Size of the total "extra" block - Version 2 bytes Version of the descriptor - Flags 4 bytes Actions and reactions (see below) - OldSize 4 bytes Size of the file about to be patched - OldCRC 4 bytes 32-bit CRC of the file to be patched - NewSize 4 bytes Size of the resulting file - NewCRC 4 bytes 32-bit CRC of the resulting file - - 4.5.8.2 Actions and reactions - - Bits Description - ---- ---------------- - 0 Use for auto detection - 1 Treat as a self-patch - 2-3 RESERVED - 4-5 Action (see below) - 6-7 RESERVED - 8-9 Reaction (see below) to absent file - 10-11 Reaction (see below) to newer file - 12-13 Reaction (see below) to unknown file - 14-15 RESERVED - 16-31 RESERVED - - 4.5.8.2.1 Actions - - Action Value - ------ ----- - none 0 - add 1 - delete 2 - patch 3 - - 4.5.8.2.2 Reactions - - Reaction Value - -------- ----- - ask 0 - skip 1 - ignore 2 - fail 3 - - 4.5.8.3 Patch support is provided by PKPatchMaker(tm) technology - and is covered under U.S. Patents and Patents Pending. The use or - implementation in a product of certain technological aspects set - forth in the current APPNOTE, including those with regard to - strong encryption or patching requires a license from PKWARE. - Refer to the section in this document entitled "Incorporating - PKWARE Proprietary Technology into Your Product" for more - information. - - 4.5.9 -PKCS#7 Store for X.509 Certificates (0x0014): - - This field MUST contain information about each of the certificates - files may be signed with. When the Central Directory Encryption - feature is enabled for a ZIP file, this record will appear in - the Archive Extra Data Record, otherwise it will appear in the - first central directory record and will be ignored in any - other record. - - - Note: all fields stored in Intel low-byte/high-byte order. - - Value Size Description - ----- ---- ----------- -(Store) 0x0014 2 bytes Tag for this "extra" block type - TSize 2 bytes Size of the store data - TData TSize Data about the store - - - 4.5.10 -X.509 Certificate ID and Signature for individual file (0x0015): - - This field contains the information about which certificate in - the PKCS#7 store was used to sign a particular file. It also - contains the signature data. This field can appear multiple - times, but can only appear once per certificate. - - Note: all fields stored in Intel low-byte/high-byte order. - - Value Size Description - ----- ---- ----------- -(CID) 0x0015 2 bytes Tag for this "extra" block type - TSize 2 bytes Size of data that follows - TData TSize Signature Data - - 4.5.11 -X.509 Certificate ID and Signature for central directory (0x0016): - - This field contains the information about which certificate in - the PKCS#7 store was used to sign the central directory structure. - When the Central Directory Encryption feature is enabled for a - ZIP file, this record will appear in the Archive Extra Data Record, - otherwise it will appear in the first central directory record. - - Note: all fields stored in Intel low-byte/high-byte order. - - Value Size Description - ----- ---- ----------- -(CDID) 0x0016 2 bytes Tag for this "extra" block type - TSize 2 bytes Size of data that follows - TData TSize Data - - 4.5.12 -Strong Encryption Header (0x0017): - - Value Size Description - ----- ---- ----------- - 0x0017 2 bytes Tag for this "extra" block type - TSize 2 bytes Size of data that follows - Format 2 bytes Format definition for this record - AlgID 2 bytes Encryption algorithm identifier - Bitlen 2 bytes Bit length of encryption key - Flags 2 bytes Processing flags - CertData TSize-8 Certificate decryption extra field data - (refer to the explanation for CertData - in the section describing the - Certificate Processing Method under - the Strong Encryption Specification) - - See the section describing the Strong Encryption Specification - for details. Refer to the section in this document entitled - "Incorporating PKWARE Proprietary Technology into Your Product" - for more information. - - 4.5.13 -Record Management Controls (0x0018): - - Value Size Description - ----- ---- ----------- -(Rec-CTL) 0x0018 2 bytes Tag for this "extra" block type - CSize 2 bytes Size of total extra block data - Tag1 2 bytes Record control attribute 1 - Size1 2 bytes Size of attribute 1, in bytes - Data1 Size1 Attribute 1 data - . - . - . - TagN 2 bytes Record control attribute N - SizeN 2 bytes Size of attribute N, in bytes - DataN SizeN Attribute N data - - - 4.5.14 -PKCS#7 Encryption Recipient Certificate List (0x0019): - - This field MAY contain information about each of the certificates - used in encryption processing and it can be used to identify who is - allowed to decrypt encrypted files. This field should only appear - in the archive extra data record. This field is not required and - serves only to aid archive modifications by preserving public - encryption key data. Individual security requirements may dictate - that this data be omitted to deter information exposure. - - Note: all fields stored in Intel low-byte/high-byte order. - - Value Size Description - ----- ---- ----------- -(CStore) 0x0019 2 bytes Tag for this "extra" block type - TSize 2 bytes Size of the store data - TData TSize Data about the store - - TData: - - Value Size Description - ----- ---- ----------- - Version 2 bytes Format version number - must 0x0001 at this time - CStore (var) PKCS#7 data blob - - See the section describing the Strong Encryption Specification - for details. Refer to the section in this document entitled - "Incorporating PKWARE Proprietary Technology into Your Product" - for more information. - - 4.5.15 -MVS Extra Field (0x0065): - - The following is the layout of the MVS "extra" block. - Note: Some fields are stored in Big Endian format. - All text is in EBCDIC format unless otherwise specified. - - Value Size Description - ----- ---- ----------- -(MVS) 0x0065 2 bytes Tag for this "extra" block type - TSize 2 bytes Size for the following data block - ID 4 bytes EBCDIC "Z390" 0xE9F3F9F0 or - "T4MV" for TargetFour - (var) TSize-4 Attribute data (see APPENDIX B) - - - 4.5.16 -OS/400 Extra Field (0x0065): - - The following is the layout of the OS/400 "extra" block. - Note: Some fields are stored in Big Endian format. - All text is in EBCDIC format unless otherwise specified. - - Value Size Description - ----- ---- ----------- -(OS400) 0x0065 2 bytes Tag for this "extra" block type - TSize 2 bytes Size for the following data block - ID 4 bytes EBCDIC "I400" 0xC9F4F0F0 or - "T4MV" for TargetFour - (var) TSize-4 Attribute data (see APPENDIX A) - -4.6 Third Party Mappings ------------------------- - - 4.6.1 Third party mappings commonly used are: - - 0x07c8 Macintosh - 0x2605 ZipIt Macintosh - 0x2705 ZipIt Macintosh 1.3.5+ - 0x2805 ZipIt Macintosh 1.3.5+ - 0x334d Info-ZIP Macintosh - 0x4341 Acorn/SparkFS - 0x4453 Windows NT security descriptor (binary ACL) - 0x4704 VM/CMS - 0x470f MVS - 0x4b46 FWKCS MD5 (see below) - 0x4c41 OS/2 access control list (text ACL) - 0x4d49 Info-ZIP OpenVMS - 0x4f4c Xceed original location extra field - 0x5356 AOS/VS (ACL) - 0x5455 extended timestamp - 0x554e Xceed unicode extra field - 0x5855 Info-ZIP UNIX (original, also OS/2, NT, etc) - 0x6375 Info-ZIP Unicode Comment Extra Field - 0x6542 BeOS/BeBox - 0x7075 Info-ZIP Unicode Path Extra Field - 0x756e ASi UNIX - 0x7855 Info-ZIP UNIX (new) - 0xa220 Microsoft Open Packaging Growth Hint - 0xfd4a SMS/QDOS - - Detailed descriptions of Extra Fields defined by third - party mappings will be documented as information on - these data structures is made available to PKWARE. - PKWARE does not guarantee the accuracy of any published - third party data. - - 4.6.2 Third-party Extra Fields must include a Header ID using - the format defined in the section of this document - titled Extensible Data Fields (section 4.5). - - The Data Size field indicates the size of the following - data block. Programs can use this value to skip to the - next header block, passing over any data blocks that are - not of interest. - - Note: As stated above, the size of the entire .ZIP file - header, including the file name, comment, and extra - field should not exceed 64K in size. - - 4.6.3 In case two different programs should appropriate the same - Header ID value, it is strongly recommended that each - program SHOULD place a unique signature of at least two bytes in - size (and preferably 4 bytes or bigger) at the start of - each data area. Every program SHOULD verify that its - unique signature is present, in addition to the Header ID - value being correct, before assuming that it is a block of - known type. - - Third-party Mappings: - - 4.6.4 -ZipIt Macintosh Extra Field (long) (0x2605): - - The following is the layout of the ZipIt extra block - for Macintosh. The local-header and central-header versions - are identical. This block must be present if the file is - stored MacBinary-encoded and it should not be used if the file - is not stored MacBinary-encoded. - - Value Size Description - ----- ---- ----------- - (Mac2) 0x2605 Short tag for this extra block type - TSize Short total data size for this block - "ZPIT" beLong extra-field signature - FnLen Byte length of FileName - FileName variable full Macintosh filename - FileType Byte[4] four-byte Mac file type string - Creator Byte[4] four-byte Mac creator string - - - 4.6.5 -ZipIt Macintosh Extra Field (short, for files) (0x2705): - - The following is the layout of a shortened variant of the - ZipIt extra block for Macintosh (without "full name" entry). - This variant is used by ZipIt 1.3.5 and newer for entries of - files (not directories) that do not have a MacBinary encoded - file. The local-header and central-header versions are identical. - - Value Size Description - ----- ---- ----------- - (Mac2b) 0x2705 Short tag for this extra block type - TSize Short total data size for this block (12) - "ZPIT" beLong extra-field signature - FileType Byte[4] four-byte Mac file type string - Creator Byte[4] four-byte Mac creator string - fdFlags beShort attributes from FInfo.frFlags, - may be omitted - 0x0000 beShort reserved, may be omitted - - - 4.6.6 -ZipIt Macintosh Extra Field (short, for directories) (0x2805): - - The following is the layout of a shortened variant of the - ZipIt extra block for Macintosh used only for directory - entries. This variant is used by ZipIt 1.3.5 and newer to - save some optional Mac-specific information about directories. - The local-header and central-header versions are identical. - - Value Size Description - ----- ---- ----------- - (Mac2c) 0x2805 Short tag for this extra block type - TSize Short total data size for this block (12) - "ZPIT" beLong extra-field signature - frFlags beShort attributes from DInfo.frFlags, may - be omitted - View beShort ZipIt view flag, may be omitted - - - The View field specifies ZipIt-internal settings as follows: - - Bits of the Flags: - bit 0 if set, the folder is shown expanded (open) - when the archive contents are viewed in ZipIt. - bits 1-15 reserved, zero; - - - 4.6.7 -FWKCS MD5 Extra Field (0x4b46): - - The FWKCS Contents_Signature System, used in - automatically identifying files independent of file name, - optionally adds and uses an extra field to support the - rapid creation of an enhanced contents_signature: - - Header ID = 0x4b46 - Data Size = 0x0013 - Preface = 'M','D','5' - followed by 16 bytes containing the uncompressed file's - 128_bit MD5 hash(1), low byte first. - - When FWKCS revises a .ZIP file central directory to add - this extra field for a file, it also replaces the - central directory entry for that file's uncompressed - file length with a measured value. - - FWKCS provides an option to strip this extra field, if - present, from a .ZIP file central directory. In adding - this extra field, FWKCS preserves .ZIP file Authenticity - Verification; if stripping this extra field, FWKCS - preserves all versions of AV through PKZIP version 2.04g. - - FWKCS, and FWKCS Contents_Signature System, are - trademarks of Frederick W. Kantor. - - (1) R. Rivest, RFC1321.TXT, MIT Laboratory for Computer - Science and RSA Data Security, Inc., April 1992. - ll.76-77: "The MD5 algorithm is being placed in the - public domain for review and possible adoption as a - standard." - - - 4.6.8 -Info-ZIP Unicode Comment Extra Field (0x6375): - - Stores the UTF-8 version of the file comment as stored in the - central directory header. (Last Revision 20070912) - - Value Size Description - ----- ---- ----------- - (UCom) 0x6375 Short tag for this extra block type ("uc") - TSize Short total data size for this block - Version 1 byte version of this extra field, currently 1 - ComCRC32 4 bytes Comment Field CRC32 Checksum - UnicodeCom Variable UTF-8 version of the entry comment - - Currently Version is set to the number 1. If there is a need - to change this field, the version will be incremented. Changes - may not be backward compatible so this extra field should not be - used if the version is not recognized. - - The ComCRC32 is the standard zip CRC32 checksum of the File Comment - field in the central directory header. This is used to verify that - the comment field has not changed since the Unicode Comment extra field - was created. This can happen if a utility changes the File Comment - field but does not update the UTF-8 Comment extra field. If the CRC - check fails, this Unicode Comment extra field should be ignored and - the File Comment field in the header should be used instead. - - The UnicodeCom field is the UTF-8 version of the File Comment field - in the header. As UnicodeCom is defined to be UTF-8, no UTF-8 byte - order mark (BOM) is used. The length of this field is determined by - subtracting the size of the previous fields from TSize. If both the - File Name and Comment fields are UTF-8, the new General Purpose Bit - Flag, bit 11 (Language encoding flag (EFS)), can be used to indicate - both the header File Name and Comment fields are UTF-8 and, in this - case, the Unicode Path and Unicode Comment extra fields are not - needed and should not be created. Note that, for backward - compatibility, bit 11 should only be used if the native character set - of the paths and comments being zipped up are already in UTF-8. It is - expected that the same file comment storage method, either general - purpose bit 11 or extra fields, be used in both the Local and Central - Directory Header for a file. - - - 4.6.9 -Info-ZIP Unicode Path Extra Field (0x7075): - - Stores the UTF-8 version of the file name field as stored in the - local header and central directory header. (Last Revision 20070912) - - Value Size Description - ----- ---- ----------- - (UPath) 0x7075 Short tag for this extra block type ("up") - TSize Short total data size for this block - Version 1 byte version of this extra field, currently 1 - NameCRC32 4 bytes File Name Field CRC32 Checksum - UnicodeName Variable UTF-8 version of the entry File Name - - Currently Version is set to the number 1. If there is a need - to change this field, the version will be incremented. Changes - may not be backward compatible so this extra field should not be - used if the version is not recognized. - - The NameCRC32 is the standard zip CRC32 checksum of the File Name - field in the header. This is used to verify that the header - File Name field has not changed since the Unicode Path extra field - was created. This can happen if a utility renames the File Name but - does not update the UTF-8 path extra field. If the CRC check fails, - this UTF-8 Path Extra Field should be ignored and the File Name field - in the header should be used instead. - - The UnicodeName is the UTF-8 version of the contents of the File Name - field in the header. As UnicodeName is defined to be UTF-8, no UTF-8 - byte order mark (BOM) is used. The length of this field is determined - by subtracting the size of the previous fields from TSize. If both - the File Name and Comment fields are UTF-8, the new General Purpose - Bit Flag, bit 11 (Language encoding flag (EFS)), can be used to - indicate that both the header File Name and Comment fields are UTF-8 - and, in this case, the Unicode Path and Unicode Comment extra fields - are not needed and should not be created. Note that, for backward - compatibility, bit 11 should only be used if the native character set - of the paths and comments being zipped up are already in UTF-8. It is - expected that the same file name storage method, either general - purpose bit 11 or extra fields, be used in both the Local and Central - Directory Header for a file. - - - 4.6.10 -Microsoft Open Packaging Growth Hint (0xa220): - - Value Size Description - ----- ---- ----------- - 0xa220 Short tag for this extra block type - TSize Short size of Sig + PadVal + Padding - Sig Short verification signature (A028) - PadVal Short Initial padding value - Padding variable filled with NULL characters - -4.7 Manifest Files ------------------- - - 4.7.1 Applications using ZIP files may have a need for additional - information that must be included with the files placed into - a ZIP file. Application specific information that cannot be - stored using the defined ZIP storage records SHOULD be stored - using the extensible Extra Field convention defined in this - document. However, some applications may use a manifest - file as a means for storing additional information. One - example is the META-INF/MANIFEST.MF file used in ZIP formatted - files having the .JAR extension (JAR files). - - 4.7.2 A manifest file is a file created for the application process - that requires this information. A manifest file MAY be of any - file type required by the defining application process. It is - placed within the same ZIP file as files to which this information - applies. By convention, this file is typically the first file placed - into the ZIP file and it may include a defined directory path. - - 4.7.3 Manifest files may be compressed or encrypted as needed for - application processing of the files inside the ZIP files. - - Manifest files are outside of the scope of this specification. - - -5.0 Explanation of compression methods --------------------------------------- - - -5.1 UnShrinking - Method 1 --------------------------- - - 5.1.1 Shrinking is a Dynamic Ziv-Lempel-Welch compression algorithm - with partial clearing. The initial code size is 9 bits, and the - maximum code size is 13 bits. Shrinking differs from conventional - Dynamic Ziv-Lempel-Welch implementations in several respects: - - 5.1.2 The code size is controlled by the compressor, and is - not automatically increased when codes larger than the current - code size are created (but not necessarily used). When - the decompressor encounters the code sequence 256 - (decimal) followed by 1, it should increase the code size - read from the input stream to the next bit size. No - blocking of the codes is performed, so the next code at - the increased size should be read from the input stream - immediately after where the previous code at the smaller - bit size was read. Again, the decompressor should not - increase the code size used until the sequence 256,1 is - encountered. - - 5.1.3 When the table becomes full, total clearing is not - performed. Rather, when the compressor emits the code - sequence 256,2 (decimal), the decompressor should clear - all leaf nodes from the Ziv-Lempel tree, and continue to - use the current code size. The nodes that are cleared - from the Ziv-Lempel tree are then re-used, with the lowest - code value re-used first, and the highest code value - re-used last. The compressor can emit the sequence 256,2 - at any time. - -5.2 Expanding - Methods 2-5 ---------------------------- - - 5.2.1 The Reducing algorithm is actually a combination of two - distinct algorithms. The first algorithm compresses repeated - byte sequences, and the second algorithm takes the compressed - stream from the first algorithm and applies a probabilistic - compression method. - - 5.2.2 The probabilistic compression stores an array of 'follower - sets' S(j), for j=0 to 255, corresponding to each possible - ASCII character. Each set contains between 0 and 32 - characters, to be denoted as S(j)[0],...,S(j)[m], where m<32. - The sets are stored at the beginning of the data area for a - Reduced file, in reverse order, with S(255) first, and S(0) - last. - - 5.2.3 The sets are encoded as { N(j), S(j)[0],...,S(j)[N(j)-1] }, - where N(j) is the size of set S(j). N(j) can be 0, in which - case the follower set for S(j) is empty. Each N(j) value is - encoded in 6 bits, followed by N(j) eight bit character values - corresponding to S(j)[0] to S(j)[N(j)-1] respectively. If - N(j) is 0, then no values for S(j) are stored, and the value - for N(j-1) immediately follows. - - 5.2.4 Immediately after the follower sets, is the compressed data - stream. The compressed data stream can be interpreted for the - probabilistic decompression as follows: - - let Last-Character <- 0. - loop until done - if the follower set S(Last-Character) is empty then - read 8 bits from the input stream, and copy this - value to the output stream. - otherwise if the follower set S(Last-Character) is non-empty then - read 1 bit from the input stream. - if this bit is not zero then - read 8 bits from the input stream, and copy this - value to the output stream. - otherwise if this bit is zero then - read B(N(Last-Character)) bits from the input - stream, and assign this value to I. - Copy the value of S(Last-Character)[I] to the - output stream. - - assign the last value placed on the output stream to - Last-Character. - end loop - - B(N(j)) is defined as the minimal number of bits required to - encode the value N(j)-1. - - 5.2.5 The decompressed stream from above can then be expanded to - re-create the original file as follows: - - let State <- 0. - - loop until done - read 8 bits from the input stream into C. - case State of - 0: if C is not equal to DLE (144 decimal) then - copy C to the output stream. - otherwise if C is equal to DLE then - let State <- 1. - - 1: if C is non-zero then - let V <- C. - let Len <- L(V) - let State <- F(Len). - otherwise if C is zero then - copy the value 144 (decimal) to the output stream. - let State <- 0 - - 2: let Len <- Len + C - let State <- 3. - - 3: move backwards D(V,C) bytes in the output stream - (if this position is before the start of the output - stream, then assume that all the data before the - start of the output stream is filled with zeros). - copy Len+3 bytes from this position to the output stream. - let State <- 0. - end case - end loop - - The functions F,L, and D are dependent on the 'compression - factor', 1 through 4, and are defined as follows: - - For compression factor 1: - L(X) equals the lower 7 bits of X. - F(X) equals 2 if X equals 127 otherwise F(X) equals 3. - D(X,Y) equals the (upper 1 bit of X) * 256 + Y + 1. - For compression factor 2: - L(X) equals the lower 6 bits of X. - F(X) equals 2 if X equals 63 otherwise F(X) equals 3. - D(X,Y) equals the (upper 2 bits of X) * 256 + Y + 1. - For compression factor 3: - L(X) equals the lower 5 bits of X. - F(X) equals 2 if X equals 31 otherwise F(X) equals 3. - D(X,Y) equals the (upper 3 bits of X) * 256 + Y + 1. - For compression factor 4: - L(X) equals the lower 4 bits of X. - F(X) equals 2 if X equals 15 otherwise F(X) equals 3. - D(X,Y) equals the (upper 4 bits of X) * 256 + Y + 1. - -5.3 Imploding - Method 6 ------------------------- - - 5.3.1 The Imploding algorithm is actually a combination of two - distinct algorithms. The first algorithm compresses repeated byte - sequences using a sliding dictionary. The second algorithm is - used to compress the encoding of the sliding dictionary output, - using multiple Shannon-Fano trees. - - 5.3.2 The Imploding algorithm can use a 4K or 8K sliding dictionary - size. The dictionary size used can be determined by bit 1 in the - general purpose flag word; a 0 bit indicates a 4K dictionary - while a 1 bit indicates an 8K dictionary. - - 5.3.3 The Shannon-Fano trees are stored at the start of the - compressed file. The number of trees stored is defined by bit 2 in - the general purpose flag word; a 0 bit indicates two trees stored, - a 1 bit indicates three trees are stored. If 3 trees are stored, - the first Shannon-Fano tree represents the encoding of the - Literal characters, the second tree represents the encoding of - the Length information, the third represents the encoding of the - Distance information. When 2 Shannon-Fano trees are stored, the - Length tree is stored first, followed by the Distance tree. - - 5.3.4 The Literal Shannon-Fano tree, if present is used to represent - the entire ASCII character set, and contains 256 values. This - tree is used to compress any data not compressed by the sliding - dictionary algorithm. When this tree is present, the Minimum - Match Length for the sliding dictionary is 3. If this tree is - not present, the Minimum Match Length is 2. - - 5.3.5 The Length Shannon-Fano tree is used to compress the Length - part of the (length,distance) pairs from the sliding dictionary - output. The Length tree contains 64 values, ranging from the - Minimum Match Length, to 63 plus the Minimum Match Length. - - 5.3.6 The Distance Shannon-Fano tree is used to compress the Distance - part of the (length,distance) pairs from the sliding dictionary - output. The Distance tree contains 64 values, ranging from 0 to - 63, representing the upper 6 bits of the distance value. The - distance values themselves will be between 0 and the sliding - dictionary size, either 4K or 8K. - - 5.3.7 The Shannon-Fano trees themselves are stored in a compressed - format. The first byte of the tree data represents the number of - bytes of data representing the (compressed) Shannon-Fano tree - minus 1. The remaining bytes represent the Shannon-Fano tree - data encoded as: - - High 4 bits: Number of values at this bit length + 1. (1 - 16) - Low 4 bits: Bit Length needed to represent value + 1. (1 - 16) - - 5.3.8 The Shannon-Fano codes can be constructed from the bit lengths - using the following algorithm: - - 1) Sort the Bit Lengths in ascending order, while retaining the - order of the original lengths stored in the file. - - 2) Generate the Shannon-Fano trees: - - Code <- 0 - CodeIncrement <- 0 - LastBitLength <- 0 - i <- number of Shannon-Fano codes - 1 (either 255 or 63) - - loop while i >= 0 - Code = Code + CodeIncrement - if BitLength(i) <> LastBitLength then - LastBitLength=BitLength(i) - CodeIncrement = 1 shifted left (16 - LastBitLength) - ShannonCode(i) = Code - i <- i - 1 - end loop - - 3) Reverse the order of all the bits in the above ShannonCode() - vector, so that the most significant bit becomes the least - significant bit. For example, the value 0x1234 (hex) would - become 0x2C48 (hex). - - 4) Restore the order of Shannon-Fano codes as originally stored - within the file. - - Example: - - This example will show the encoding of a Shannon-Fano tree - of size 8. Notice that the actual Shannon-Fano trees used - for Imploding are either 64 or 256 entries in size. - - Example: 0x02, 0x42, 0x01, 0x13 - - The first byte indicates 3 values in this table. Decoding the - bytes: - 0x42 = 5 codes of 3 bits long - 0x01 = 1 code of 2 bits long - 0x13 = 2 codes of 4 bits long - - This would generate the original bit length array of: - (3, 3, 3, 3, 3, 2, 4, 4) - - There are 8 codes in this table for the values 0 thru 7. Using - the algorithm to obtain the Shannon-Fano codes produces: - - Reversed Order Original - Val Sorted Constructed Code Value Restored Length - --- ------ ----------------- -------- -------- ------ - 0: 2 1100000000000000 11 101 3 - 1: 3 1010000000000000 101 001 3 - 2: 3 1000000000000000 001 110 3 - 3: 3 0110000000000000 110 010 3 - 4: 3 0100000000000000 010 100 3 - 5: 3 0010000000000000 100 11 2 - 6: 4 0001000000000000 1000 1000 4 - 7: 4 0000000000000000 0000 0000 4 - - The values in the Val, Order Restored and Original Length columns - now represent the Shannon-Fano encoding tree that can be used for - decoding the Shannon-Fano encoded data. How to parse the - variable length Shannon-Fano values from the data stream is beyond - the scope of this document. (See the references listed at the end of - this document for more information.) However, traditional decoding - schemes used for Huffman variable length decoding, such as the - Greenlaw algorithm, can be successfully applied. - - 5.3.9 The compressed data stream begins immediately after the - compressed Shannon-Fano data. The compressed data stream can be - interpreted as follows: - - loop until done - read 1 bit from input stream. - - if this bit is non-zero then (encoded data is literal data) - if Literal Shannon-Fano tree is present - read and decode character using Literal Shannon-Fano tree. - otherwise - read 8 bits from input stream. - copy character to the output stream. - otherwise (encoded data is sliding dictionary match) - if 8K dictionary size - read 7 bits for offset Distance (lower 7 bits of offset). - otherwise - read 6 bits for offset Distance (lower 6 bits of offset). - - using the Distance Shannon-Fano tree, read and decode the - upper 6 bits of the Distance value. - - using the Length Shannon-Fano tree, read and decode - the Length value. - - Length <- Length + Minimum Match Length - - if Length = 63 + Minimum Match Length - read 8 bits from the input stream, - add this value to Length. - - move backwards Distance+1 bytes in the output stream, and - copy Length characters from this position to the output - stream. (if this position is before the start of the output - stream, then assume that all the data before the start of - the output stream is filled with zeros). - end loop - -5.4 Tokenizing - Method 7 -------------------------- - - 5.4.1 This method is not used by PKZIP. - -5.5 Deflating - Method 8 ------------------------- - - 5.5.1 The Deflate algorithm is similar to the Implode algorithm using - a sliding dictionary of up to 32K with secondary compression - from Huffman/Shannon-Fano codes. - - 5.5.2 The compressed data is stored in blocks with a header describing - the block and the Huffman codes used in the data block. The header - format is as follows: - - Bit 0: Last Block bit This bit is set to 1 if this is the last - compressed block in the data. - Bits 1-2: Block type - 00 (0) - Block is stored - All stored data is byte aligned. - Skip bits until next byte, then next word = block - length, followed by the ones compliment of the block - length word. Remaining data in block is the stored - data. - - 01 (1) - Use fixed Huffman codes for literal and distance codes. - Lit Code Bits Dist Code Bits - --------- ---- --------- ---- - 0 - 143 8 0 - 31 5 - 144 - 255 9 - 256 - 279 7 - 280 - 287 8 - - Literal codes 286-287 and distance codes 30-31 are - never used but participate in the huffman construction. - - 10 (2) - Dynamic Huffman codes. (See expanding Huffman codes) - - 11 (3) - Reserved - Flag a "Error in compressed data" if seen. - - 5.5.3 Expanding Huffman Codes - - If the data block is stored with dynamic Huffman codes, the Huffman - codes are sent in the following compressed format: - - 5 Bits: # of Literal codes sent - 256 (256 - 286) - All other codes are never sent. - 5 Bits: # of Dist codes - 1 (1 - 32) - 4 Bits: # of Bit Length codes - 3 (3 - 19) - - The Huffman codes are sent as bit lengths and the codes are built as - described in the implode algorithm. The bit lengths themselves are - compressed with Huffman codes. There are 19 bit length codes: - - 0 - 15: Represent bit lengths of 0 - 15 - 16: Copy the previous bit length 3 - 6 times. - The next 2 bits indicate repeat length (0 = 3, ... ,3 = 6) - Example: Codes 8, 16 (+2 bits 11), 16 (+2 bits 10) will - expand to 12 bit lengths of 8 (1 + 6 + 5) - 17: Repeat a bit length of 0 for 3 - 10 times. (3 bits of length) - 18: Repeat a bit length of 0 for 11 - 138 times (7 bits of length) - - The lengths of the bit length codes are sent packed 3 bits per value - (0 - 7) in the following order: - - 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 - - The Huffman codes should be built as described in the Implode algorithm - except codes are assigned starting at the shortest bit length, i.e. the - shortest code should be all 0's rather than all 1's. Also, codes with - a bit length of zero do not participate in the tree construction. The - codes are then used to decode the bit lengths for the literal and - distance tables. - - The bit lengths for the literal tables are sent first with the number - of entries sent described by the 5 bits sent earlier. There are up - to 286 literal characters; the first 256 represent the respective 8 - bit character, code 256 represents the End-Of-Block code, the remaining - 29 codes represent copy lengths of 3 thru 258. There are up to 30 - distance codes representing distances from 1 thru 32k as described - below. - - Length Codes - ------------ - Extra Extra Extra Extra - Code Bits Length Code Bits Lengths Code Bits Lengths Code Bits Length(s) - ---- ---- ------ ---- ---- ------- ---- ---- ------- ---- ---- --------- - 257 0 3 265 1 11,12 273 3 35-42 281 5 131-162 - 258 0 4 266 1 13,14 274 3 43-50 282 5 163-194 - 259 0 5 267 1 15,16 275 3 51-58 283 5 195-226 - 260 0 6 268 1 17,18 276 3 59-66 284 5 227-257 - 261 0 7 269 2 19-22 277 4 67-82 285 0 258 - 262 0 8 270 2 23-26 278 4 83-98 - 263 0 9 271 2 27-30 279 4 99-114 - 264 0 10 272 2 31-34 280 4 115-130 - - Distance Codes - -------------- - Extra Extra Extra Extra - Code Bits Dist Code Bits Dist Code Bits Distance Code Bits Distance - ---- ---- ---- ---- ---- ------ ---- ---- -------- ---- ---- -------- - 0 0 1 8 3 17-24 16 7 257-384 24 11 4097-6144 - 1 0 2 9 3 25-32 17 7 385-512 25 11 6145-8192 - 2 0 3 10 4 33-48 18 8 513-768 26 12 8193-12288 - 3 0 4 11 4 49-64 19 8 769-1024 27 12 12289-16384 - 4 1 5,6 12 5 65-96 20 9 1025-1536 28 13 16385-24576 - 5 1 7,8 13 5 97-128 21 9 1537-2048 29 13 24577-32768 - 6 2 9-12 14 6 129-192 22 10 2049-3072 - 7 2 13-16 15 6 193-256 23 10 3073-4096 - - 5.5.4 The compressed data stream begins immediately after the - compressed header data. The compressed data stream can be - interpreted as follows: - - do - read header from input stream. - - if stored block - skip bits until byte aligned - read count and 1's compliment of count - copy count bytes data block - otherwise - loop until end of block code sent - decode literal character from input stream - if literal < 256 - copy character to the output stream - otherwise - if literal = end of block - break from loop - otherwise - decode distance from input stream - - move backwards distance bytes in the output stream, and - copy length characters from this position to the output - stream. - end loop - while not last block - - if data descriptor exists - skip bits until byte aligned - read crc and sizes - endif - -5.6 Enhanced Deflating - Method 9 ---------------------------------- - - 5.6.1 The Enhanced Deflating algorithm is similar to Deflate but uses - a sliding dictionary of up to 64K. Deflate64(tm) is supported - by the Deflate extractor. - -5.7 BZIP2 - Method 12 ---------------------- - - 5.7.1 BZIP2 is an open-source data compression algorithm developed by - Julian Seward. Information and source code for this algorithm - can be found on the internet. - -5.8 LZMA - Method 14 ---------------------- - - 5.8.1 LZMA is a block-oriented, general purpose data compression - algorithm developed and maintained by Igor Pavlov. It is a derivative - of LZ77 that utilizes Markov chains and a range coder. Information and - source code for this algorithm can be found on the internet. Consult - with the author of this algorithm for information on terms or - restrictions on use. - - Support for LZMA within the ZIP format is defined as follows: - - 5.8.2 The Compression method field within the ZIP Local and Central - Header records will be set to the value 14 to indicate data was - compressed using LZMA. - - 5.8.3 The Version needed to extract field within the ZIP Local and - Central Header records will be set to 6.3 to indicate the minimum - ZIP format version supporting this feature. - - 5.8.4 File data compressed using the LZMA algorithm must be placed - immediately following the Local Header for the file. If a standard - ZIP encryption header is required, it will follow the Local Header - and will precede the LZMA compressed file data segment. The location - of LZMA compressed data segment within the ZIP format will be as shown: - - [local header file 1] - [encryption header file 1] - [LZMA compressed data segment for file 1] - [data descriptor 1] - [local header file 2] - - 5.8.5 The encryption header and data descriptor records may - be conditionally present. The LZMA Compressed Data Segment - will consist of an LZMA Properties Header followed by the - LZMA Compressed Data as shown: - - [LZMA properties header for file 1] - [LZMA compressed data for file 1] - - 5.8.6 The LZMA Compressed Data will be stored as provided by the - LZMA compression library. Compressed size, uncompressed size and - other file characteristics about the file being compressed must be - stored in standard ZIP storage format. - - 5.8.7 The LZMA Properties Header will store specific data required - to decompress the LZMA compressed Data. This data is set by the - LZMA compression engine using the function WriteCoderProperties() - as documented within the LZMA SDK. - - 5.8.8 Storage fields for the property information within the LZMA - Properties Header are as follows: - - LZMA Version Information 2 bytes - LZMA Properties Size 2 bytes - LZMA Properties Data variable, defined by "LZMA Properties Size" - - 5.8.8.1 LZMA Version Information - this field identifies which version - of the LZMA SDK was used to compress a file. The first byte will - store the major version number of the LZMA SDK and the second - byte will store the minor number. - - 5.8.8.2 LZMA Properties Size - this field defines the size of the - remaining property data. Typically this size should be determined by - the version of the SDK. This size field is included as a convenience - and to help avoid any ambiguity should it arise in the future due - to changes in this compression algorithm. - - 5.8.8.3 LZMA Property Data - this variable sized field records the - required values for the decompressor as defined by the LZMA SDK. - The data stored in this field should be obtained using the - WriteCoderProperties() in the version of the SDK defined by - the "LZMA Version Information" field. - - 5.8.8.4 The layout of the "LZMA Properties Data" field is a function of - the LZMA compression algorithm. It is possible that this layout may be - changed by the author over time. The data layout in version 4.3 of the - LZMA SDK defines a 5 byte array that uses 4 bytes to store the dictionary - size in little-endian order. This is preceded by a single packed byte as - the first element of the array that contains the following fields: - - PosStateBits - LiteralPosStateBits - LiteralContextBits - - Refer to the LZMA documentation for a more detailed explanation of - these fields. - - 5.8.9 Data compressed with method 14, LZMA, may include an end-of-stream - (EOS) marker ending the compressed data stream. This marker is not - required, but its use is highly recommended to facilitate processing - and implementers should include the EOS marker whenever possible. - When the EOS marker is used, general purpose bit 1 must be set. If - general purpose bit 1 is not set, the EOS marker is not present. - -5.9 WavPack - Method 97 ------------------------ - - 5.9.1 Information describing the use of compression method 97 is - provided by WinZIP International, LLC. This method relies on the - open source WavPack audio compression utility developed by David Bryant. - Information on WavPack is available at www.wavpack.com. Please consult - with the author of this algorithm for information on terms and - restrictions on use. - - 5.9.2 WavPack data for a file begins immediately after the end of the - local header data. This data is the output from WavPack compression - routines. Within the ZIP file, the use of WavPack compression is - indicated by setting the compression method field to a value of 97 - in both the local header and the central directory header. The Version - needed to extract and version made by fields use the same values as are - used for data compressed using the Deflate algorithm. - - 5.9.3 An implementation note for storing digital sample data when using - WavPack compression within ZIP files is that all of the bytes of - the sample data should be compressed. This includes any unused - bits up to the byte boundary. An example is a 2 byte sample that - uses only 12 bits for the sample data with 4 unused bits. If only - 12 bits are passed as the sample size to the WavPack routines, the 4 - unused bits will be set to 0 on extraction regardless of their original - state. To avoid this, the full 16 bits of the sample data size - should be provided. - -5.10 PPMd - Method 98 ---------------------- - - 5.10.1 PPMd is a data compression algorithm developed by Dmitry Shkarin - which includes a carryless rangecoder developed by Dmitry Subbotin. - This algorithm is based on predictive phrase matching on multiple - order contexts. Information and source code for this algorithm - can be found on the internet. Consult with the author of this - algorithm for information on terms or restrictions on use. - - 5.10.2 Support for PPMd within the ZIP format currently is provided only - for version I, revision 1 of the algorithm. Storage requirements - for using this algorithm are as follows: - - 5.10.3 Parameters needed to control the algorithm are stored in the two - bytes immediately preceding the compressed data. These bytes are - used to store the following fields: - - Model order - sets the maximum model order, default is 8, possible - values are from 2 to 16 inclusive - - Sub-allocator size - sets the size of sub-allocator in MB, default is 50, - possible values are from 1MB to 256MB inclusive - - Model restoration method - sets the method used to restart context - model at memory insufficiency, values are: - - 0 - restarts model from scratch - default - 1 - cut off model - decreases performance by as much as 2x - 2 - freeze context tree - not recommended - - 5.10.4 An example for packing these fields into the 2 byte storage field is - illustrated below. These values are stored in Intel low-byte/high-byte - order. - - wPPMd = (Model order - 1) + - ((Sub-allocator size - 1) << 4) + - (Model restoration method << 12) - - -6.0 Traditional PKWARE Encryption ----------------------------------- - - 6.0.1 The following information discusses the decryption steps - required to support traditional PKWARE encryption. This - form of encryption is considered weak by today's standards - and its use is recommended only for situations with - low security needs or for compatibility with older .ZIP - applications. - -6.1 Traditional PKWARE Decryption ---------------------------------- - - 6.1.1 PKWARE is grateful to Mr. Roger Schlafly for his expert - contribution towards the development of PKWARE's traditional - encryption. - - 6.1.2 PKZIP encrypts the compressed data stream. Encrypted files - must be decrypted before they can be extracted to their original - form. - - 6.1.3 Each encrypted file has an extra 12 bytes stored at the start - of the data area defining the encryption header for that file. The - encryption header is originally set to random values, and then - itself encrypted, using three, 32-bit keys. The key values are - initialized using the supplied encryption password. After each byte - is encrypted, the keys are then updated using pseudo-random number - generation techniques in combination with the same CRC-32 algorithm - used in PKZIP and described elsewhere in this document. - - 6.1.4 The following are the basic steps required to decrypt a file: - - 1) Initialize the three 32-bit keys with the password. - 2) Read and decrypt the 12-byte encryption header, further - initializing the encryption keys. - 3) Read and decrypt the compressed data stream using the - encryption keys. - - 6.1.5 Initializing the encryption keys - - Key(0) <- 305419896 - Key(1) <- 591751049 - Key(2) <- 878082192 - - loop for i <- 0 to length(password)-1 - update_keys(password(i)) - end loop - - Where update_keys() is defined as: - - update_keys(char): - Key(0) <- crc32(key(0),char) - Key(1) <- Key(1) + (Key(0) & 000000ffH) - Key(1) <- Key(1) * 134775813 + 1 - Key(2) <- crc32(key(2),key(1) >> 24) - end update_keys - - Where crc32(old_crc,char) is a routine that given a CRC value and a - character, returns an updated CRC value after applying the CRC-32 - algorithm described elsewhere in this document. - - 6.1.6 Decrypting the encryption header - - The purpose of this step is to further initialize the encryption - keys, based on random data, to render a plaintext attack on the - data ineffective. - - Read the 12-byte encryption header into Buffer, in locations - Buffer(0) thru Buffer(11). - - loop for i <- 0 to 11 - C <- buffer(i) ^ decrypt_byte() - update_keys(C) - buffer(i) <- C - end loop - - Where decrypt_byte() is defined as: - - unsigned char decrypt_byte() - local unsigned short temp - temp <- Key(2) | 2 - decrypt_byte <- (temp * (temp ^ 1)) >> 8 - end decrypt_byte - - After the header is decrypted, the last 1 or 2 bytes in Buffer - should be the high-order word/byte of the CRC for the file being - decrypted, stored in Intel low-byte/high-byte order. Versions of - PKZIP prior to 2.0 used a 2 byte CRC check; a 1 byte CRC check is - used on versions after 2.0. This can be used to test if the password - supplied is correct or not. - - 6.1.7 Decrypting the compressed data stream - - The compressed data stream can be decrypted as follows: - - loop until done - read a character into C - Temp <- C ^ decrypt_byte() - update_keys(temp) - output Temp - end loop - - -7.0 Strong Encryption Specification ------------------------------------ - - 7.0.1 Portions of the Strong Encryption technology defined in this - specification are covered under patents and pending patent applications. - Refer to the section in this document entitled "Incorporating - PKWARE Proprietary Technology into Your Product" for more information. - -7.1 Strong Encryption Overview ------------------------------- - - 7.1.1 Version 5.x of this specification introduced support for strong - encryption algorithms. These algorithms can be used with either - a password or an X.509v3 digital certificate to encrypt each file. - This format specification supports either password or certificate - based encryption to meet the security needs of today, to enable - interoperability between users within both PKI and non-PKI - environments, and to ensure interoperability between different - computing platforms that are running a ZIP program. - - 7.1.2 Password based encryption is the most common form of encryption - people are familiar with. However, inherent weaknesses with - passwords (e.g. susceptibility to dictionary/brute force attack) - as well as password management and support issues make certificate - based encryption a more secure and scalable option. Industry - efforts and support are defining and moving towards more advanced - security solutions built around X.509v3 digital certificates and - Public Key Infrastructures(PKI) because of the greater scalability, - administrative options, and more robust security over traditional - password based encryption. - - 7.1.3 Most standard encryption algorithms are supported with this - specification. Reference implementations for many of these - algorithms are available from either commercial or open source - distributors. Readily available cryptographic toolkits make - implementation of the encryption features straight-forward. - This document is not intended to provide a treatise on data - encryption principles or theory. Its purpose is to document the - data structures required for implementing interoperable data - encryption within the .ZIP format. It is strongly recommended that - you have a good understanding of data encryption before reading - further. - - 7.1.4 The algorithms introduced in Version 5.0 of this specification - include: - - RC2 40 bit, 64 bit, and 128 bit - RC4 40 bit, 64 bit, and 128 bit - DES - 3DES 112 bit and 168 bit - - Version 5.1 adds support for the following: - - AES 128 bit, 192 bit, and 256 bit - - - 7.1.5 Version 6.1 introduces encryption data changes to support - interoperability with Smartcard and USB Token certificate storage - methods which do not support the OAEP strengthening standard. - - 7.1.6 Version 6.2 introduces support for encrypting metadata by compressing - and encrypting the central directory data structure to reduce information - leakage. Information leakage can occur in legacy ZIP applications - through exposure of information about a file even though that file is - stored encrypted. The information exposed consists of file - characteristics stored within the records and fields defined by this - specification. This includes data such as a file's name, its original - size, timestamp and CRC32 value. - - 7.1.7 Version 6.3 introduces support for encrypting data using the Blowfish - and Twofish algorithms. These are symmetric block ciphers developed - by Bruce Schneier. Blowfish supports using a variable length key from - 32 to 448 bits. Block size is 64 bits. Implementations should use 16 - rounds and the only mode supported within ZIP files is CBC. Twofish - supports key sizes 128, 192 and 256 bits. Block size is 128 bits. - Implementations should use 16 rounds and the only mode supported within - ZIP files is CBC. Information and source code for both Blowfish and - Twofish algorithms can be found on the internet. Consult with the author - of these algorithms for information on terms or restrictions on use. - - 7.1.8 Central Directory Encryption provides greater protection against - information leakage by encrypting the Central Directory structure and - by masking key values that are replicated in the unencrypted Local - Header. ZIP compatible programs that cannot interpret an encrypted - Central Directory structure cannot rely on the data in the corresponding - Local Header for decompression information. - - 7.1.9 Extra Field records that may contain information about a file that should - not be exposed should not be stored in the Local Header and should only - be written to the Central Directory where they can be encrypted. This - design currently does not support streaming. Information in the End of - Central Directory record, the Zip64 End of Central Directory Locator, - and the Zip64 End of Central Directory records are not encrypted. Access - to view data on files within a ZIP file with an encrypted Central Directory - requires the appropriate password or private key for decryption prior to - viewing any files, or any information about the files, in the archive. - - 7.1.10 Older ZIP compatible programs not familiar with the Central Directory - Encryption feature will no longer be able to recognize the Central - Directory and may assume the ZIP file is corrupt. Programs that - attempt streaming access using Local Headers will see invalid - information for each file. Central Directory Encryption need not be - used for every ZIP file. Its use is recommended for greater security. - ZIP files not using Central Directory Encryption should operate as - in the past. - - 7.1.11 This strong encryption feature specification is intended to provide for - scalable, cross-platform encryption needs ranging from simple password - encryption to authenticated public/private key encryption. - - 7.1.12 Encryption provides data confidentiality and privacy. It is - recommended that you combine X.509 digital signing with encryption - to add authentication and non-repudiation. - - -7.2 Single Password Symmetric Encryption Method ------------------------------------------------ - - 7.2.1 The Single Password Symmetric Encryption Method using strong - encryption algorithms operates similarly to the traditional - PKWARE encryption defined in this format. Additional data - structures are added to support the processing needs of the - strong algorithms. - - The Strong Encryption data structures are: - - 7.2.2 General Purpose Bits - Bits 0 and 6 of the General Purpose bit - flag in both local and central header records. Both bits set - indicates strong encryption. Bit 13, when set indicates the Central - Directory is encrypted and that selected fields in the Local Header - are masked to hide their actual value. - - - 7.2.3 Extra Field 0x0017 in central header only. - - Fields to consider in this record are: - - 7.2.3.1 Format - the data format identifier for this record. The only - value allowed at this time is the integer value 2. - - 7.2.3.2 AlgId - integer identifier of the encryption algorithm from the - following range - - 0x6601 - DES - 0x6602 - RC2 (version needed to extract < 5.2) - 0x6603 - 3DES 168 - 0x6609 - 3DES 112 - 0x660E - AES 128 - 0x660F - AES 192 - 0x6610 - AES 256 - 0x6702 - RC2 (version needed to extract >= 5.2) - 0x6720 - Blowfish - 0x6721 - Twofish - 0x6801 - RC4 - 0xFFFF - Unknown algorithm - - 7.2.3.3 Bitlen - Explicit bit length of key - - 32 - 448 bits - - 7.2.3.4 Flags - Processing flags needed for decryption - - 0x0001 - Password is required to decrypt - 0x0002 - Certificates only - 0x0003 - Password or certificate required to decrypt - - Values > 0x0003 reserved for certificate processing - - - 7.2.4 Decryption header record preceding compressed file data. - - -Decryption Header: - - Value Size Description - ----- ---- ----------- - IVSize 2 bytes Size of initialization vector (IV) - IVData IVSize Initialization vector for this file - Size 4 bytes Size of remaining decryption header data - Format 2 bytes Format definition for this record - AlgID 2 bytes Encryption algorithm identifier - Bitlen 2 bytes Bit length of encryption key - Flags 2 bytes Processing flags - ErdSize 2 bytes Size of Encrypted Random Data - ErdData ErdSize Encrypted Random Data - Reserved1 4 bytes Reserved certificate processing data - Reserved2 (var) Reserved for certificate processing data - VSize 2 bytes Size of password validation data - VData VSize-4 Password validation data - VCRC32 4 bytes Standard ZIP CRC32 of password validation data - - 7.2.4.1 IVData - The size of the IV should match the algorithm block size. - The IVData can be completely random data. If the size of - the randomly generated data does not match the block size - it should be complemented with zero's or truncated as - necessary. If IVSize is 0,then IV = CRC32 + Uncompressed - File Size (as a 64 bit little-endian, unsigned integer value). - - 7.2.4.2 Format - the data format identifier for this record. The only - value allowed at this time is the integer value 3. - - 7.2.4.3 AlgId - integer identifier of the encryption algorithm from the - following range - - 0x6601 - DES - 0x6602 - RC2 (version needed to extract < 5.2) - 0x6603 - 3DES 168 - 0x6609 - 3DES 112 - 0x660E - AES 128 - 0x660F - AES 192 - 0x6610 - AES 256 - 0x6702 - RC2 (version needed to extract >= 5.2) - 0x6720 - Blowfish - 0x6721 - Twofish - 0x6801 - RC4 - 0xFFFF - Unknown algorithm - - 7.2.4.4 Bitlen - Explicit bit length of key - - 32 - 448 bits - - 7.2.4.5 Flags - Processing flags needed for decryption - - 0x0001 - Password is required to decrypt - 0x0002 - Certificates only - 0x0003 - Password or certificate required to decrypt - - Values > 0x0003 reserved for certificate processing - - 7.2.4.6 ErdData - Encrypted random data is used to store random data that - is used to generate a file session key for encrypting - each file. SHA1 is used to calculate hash data used to - derive keys. File session keys are derived from a master - session key generated from the user-supplied password. - If the Flags field in the decryption header contains - the value 0x4000, then the ErdData field must be - decrypted using 3DES. If the value 0x4000 is not set, - then the ErdData field must be decrypted using AlgId. - - - 7.2.4.7 Reserved1 - Reserved for certificate processing, if value is - zero, then Reserved2 data is absent. See the explanation - under the Certificate Processing Method for details on - this data structure. - - 7.2.4.8 Reserved2 - If present, the size of the Reserved2 data structure - is located by skipping the first 4 bytes of this field - and using the next 2 bytes as the remaining size. See - the explanation under the Certificate Processing Method - for details on this data structure. - - 7.2.4.9 VSize - This size value will always include the 4 bytes of the - VCRC32 data and will be greater than 4 bytes. - - 7.2.4.10 VData - Random data for password validation. This data is VSize - in length and VSize must be a multiple of the encryption - block size. VCRC32 is a checksum value of VData. - VData and VCRC32 are stored encrypted and start the - stream of encrypted data for a file. - - - 7.2.5 Useful Tips - - 7.2.5.1 Strong Encryption is always applied to a file after compression. The - block oriented algorithms all operate in Cypher Block Chaining (CBC) - mode. The block size used for AES encryption is 16. All other block - algorithms use a block size of 8. Two IDs are defined for RC2 to - account for a discrepancy found in the implementation of the RC2 - algorithm in the cryptographic library on Windows XP SP1 and all - earlier versions of Windows. It is recommended that zero length files - not be encrypted, however programs should be prepared to extract them - if they are found within a ZIP file. - - 7.2.5.2 A pseudo-code representation of the encryption process is as follows: - - Password = GetUserPassword() - MasterSessionKey = DeriveKey(SHA1(Password)) - RD = CryptographicStrengthRandomData() - For Each File - IV = CryptographicStrengthRandomData() - VData = CryptographicStrengthRandomData() - VCRC32 = CRC32(VData) - FileSessionKey = DeriveKey(SHA1(IV + RD) - ErdData = Encrypt(RD,MasterSessionKey,IV) - Encrypt(VData + VCRC32 + FileData, FileSessionKey,IV) - Done - - 7.2.5.3 The function names and parameter requirements will depend on - the choice of the cryptographic toolkit selected. Almost any - toolkit supporting the reference implementations for each - algorithm can be used. The RSA BSAFE(r), OpenSSL, and Microsoft - CryptoAPI libraries are all known to work well. - - - 7.3 Single Password - Central Directory Encryption - -------------------------------------------------- - - 7.3.1 Central Directory Encryption is achieved within the .ZIP format by - encrypting the Central Directory structure. This encapsulates the metadata - most often used for processing .ZIP files. Additional metadata is stored for - redundancy in the Local Header for each file. The process of concealing - metadata by encrypting the Central Directory does not protect the data within - the Local Header. To avoid information leakage from the exposed metadata - in the Local Header, the fields containing information about a file are masked. - - 7.3.2 Local Header - - Masking replaces the true content of the fields for a file in the Local - Header with false information. When masked, the Local Header is not - suitable for streaming access and the options for data recovery of damaged - archives is reduced. Extra Data fields that may contain confidential - data should not be stored within the Local Header. The value set into - the Version needed to extract field should be the correct value needed to - extract the file without regard to Central Directory Encryption. The fields - within the Local Header targeted for masking when the Central Directory is - encrypted are: - - Field Name Mask Value - ------------------ --------------------------- - compression method 0 - last mod file time 0 - last mod file date 0 - crc-32 0 - compressed size 0 - uncompressed size 0 - file name (variable size) Base 16 value from the - range 1 - 0xFFFFFFFFFFFFFFFF - represented as a string whose - size will be set into the - file name length field - - The Base 16 value assigned as a masked file name is simply a sequentially - incremented value for each file starting with 1 for the first file. - Modifications to a ZIP file may cause different values to be stored for - each file. For compatibility, the file name field in the Local Header - should never be left blank. As of Version 6.2 of this specification, - the Compression Method and Compressed Size fields are not yet masked. - Fields having a value of 0xFFFF or 0xFFFFFFFF for the ZIP64 format - should not be masked. - - 7.3.3 Encrypting the Central Directory - - Encryption of the Central Directory does not include encryption of the - Central Directory Signature data, the Zip64 End of Central Directory - record, the Zip64 End of Central Directory Locator, or the End - of Central Directory record. The ZIP file comment data is never - encrypted. - - Before encrypting the Central Directory, it may optionally be compressed. - Compression is not required, but for storage efficiency it is assumed - this structure will be compressed before encrypting. Similarly, this - specification supports compressing the Central Directory without - requiring that it also be encrypted. Early implementations of this - feature will assume the encryption method applied to files matches the - encryption applied to the Central Directory. - - Encryption of the Central Directory is done in a manner similar to - that of file encryption. The encrypted data is preceded by a - decryption header. The decryption header is known as the Archive - Decryption Header. The fields of this record are identical to - the decryption header preceding each encrypted file. The location - of the Archive Decryption Header is determined by the value in the - Start of the Central Directory field in the Zip64 End of Central - Directory record. When the Central Directory is encrypted, the - Zip64 End of Central Directory record will always be present. - - The layout of the Zip64 End of Central Directory record for all - versions starting with 6.2 of this specification will follow the - Version 2 format. The Version 2 format is as follows: - - The leading fixed size fields within the Version 1 format for this - record remain unchanged. The record signature for both Version 1 - and Version 2 will be 0x06064b50. Immediately following the last - byte of the field known as the Offset of Start of Central - Directory With Respect to the Starting Disk Number will begin the - new fields defining Version 2 of this record. - - 7.3.4 New fields for Version 2 - - Note: all fields stored in Intel low-byte/high-byte order. - - Value Size Description - ----- ---- ----------- - Compression Method 2 bytes Method used to compress the - Central Directory - Compressed Size 8 bytes Size of the compressed data - Original Size 8 bytes Original uncompressed size - AlgId 2 bytes Encryption algorithm ID - BitLen 2 bytes Encryption key length - Flags 2 bytes Encryption flags - HashID 2 bytes Hash algorithm identifier - Hash Length 2 bytes Length of hash data - Hash Data (variable) Hash data - - The Compression Method accepts the same range of values as the - corresponding field in the Central Header. - - The Compressed Size and Original Size values will not include the - data of the Central Directory Signature which is compressed or - encrypted. - - The AlgId, BitLen, and Flags fields accept the same range of values - the corresponding fields within the 0x0017 record. - - Hash ID identifies the algorithm used to hash the Central Directory - data. This data does not have to be hashed, in which case the - values for both the HashID and Hash Length will be 0. Possible - values for HashID are: - - Value Algorithm - ------ --------- - 0x0000 none - 0x0001 CRC32 - 0x8003 MD5 - 0x8004 SHA1 - 0x8007 RIPEMD160 - 0x800C SHA256 - 0x800D SHA384 - 0x800E SHA512 - - 7.3.5 When the Central Directory data is signed, the same hash algorithm - used to hash the Central Directory for signing should be used. - This is recommended for processing efficiency, however, it is - permissible for any of the above algorithms to be used independent - of the signing process. - - The Hash Data will contain the hash data for the Central Directory. - The length of this data will vary depending on the algorithm used. - - The Version Needed to Extract should be set to 62. - - The value for the Total Number of Entries on the Current Disk will - be 0. These records will no longer support random access when - encrypting the Central Directory. - - 7.3.6 When the Central Directory is compressed and/or encrypted, the - End of Central Directory record will store the value 0xFFFFFFFF - as the value for the Total Number of Entries in the Central - Directory. The value stored in the Total Number of Entries in - the Central Directory on this Disk field will be 0. The actual - values will be stored in the equivalent fields of the Zip64 - End of Central Directory record. - - 7.3.7 Decrypting and decompressing the Central Directory is accomplished - in the same manner as decrypting and decompressing a file. - - 7.4 Certificate Processing Method - --------------------------------- - - The Certificate Processing Method for ZIP file encryption - defines the following additional data fields: - - 7.4.1 Certificate Flag Values - - Additional processing flags that can be present in the Flags field of both - the 0x0017 field of the central directory Extra Field and the Decryption - header record preceding compressed file data are: - - 0x0007 - reserved for future use - 0x000F - reserved for future use - 0x0100 - Indicates non-OAEP key wrapping was used. If this - this field is set, the version needed to extract must - be at least 61. This means OAEP key wrapping is not - used when generating a Master Session Key using - ErdData. - 0x4000 - ErdData must be decrypted using 3DES-168, otherwise use the - same algorithm used for encrypting the file contents. - 0x8000 - reserved for future use - - - 7.4.2 CertData - Extra Field 0x0017 record certificate data structure - - The data structure used to store certificate data within the section - of the Extra Field defined by the CertData field of the 0x0017 - record are as shown: - - Value Size Description - ----- ---- ----------- - RCount 4 bytes Number of recipients. - HashAlg 2 bytes Hash algorithm identifier - HSize 2 bytes Hash size - SRList (var) Simple list of recipients hashed public keys - - - RCount This defines the number intended recipients whose - public keys were used for encryption. This identifies - the number of elements in the SRList. - - HashAlg This defines the hash algorithm used to calculate - the public key hash of each public key used - for encryption. This field currently supports - only the following value for SHA-1 - - 0x8004 - SHA1 - - HSize This defines the size of a hashed public key. - - SRList This is a variable length list of the hashed - public keys for each intended recipient. Each - element in this list is HSize. The total size of - SRList is determined using RCount * HSize. - - - 7.4.3 Reserved1 - Certificate Decryption Header Reserved1 Data - - Value Size Description - ----- ---- ----------- - RCount 4 bytes Number of recipients. - - RCount This defines the number intended recipients whose - public keys were used for encryption. This defines - the number of elements in the REList field defined below. - - - 7.4.4 Reserved2 - Certificate Decryption Header Reserved2 Data Structures - - - Value Size Description - ----- ---- ----------- - HashAlg 2 bytes Hash algorithm identifier - HSize 2 bytes Hash size - REList (var) List of recipient data elements - - - HashAlg This defines the hash algorithm used to calculate - the public key hash of each public key used - for encryption. This field currently supports - only the following value for SHA-1 - - 0x8004 - SHA1 - - HSize This defines the size of a hashed public key - defined in REHData. - - REList This is a variable length of list of recipient data. - Each element in this list consists of a Recipient - Element data structure as follows: - - - Recipient Element (REList) Data Structure: - - Value Size Description - ----- ---- ----------- - RESize 2 bytes Size of REHData + REKData - REHData HSize Hash of recipients public key - REKData (var) Simple key blob - - - RESize This defines the size of an individual REList - element. This value is the combined size of the - REHData field + REKData field. REHData is defined by - HSize. REKData is variable and can be calculated - for each REList element using RESize and HSize. - - REHData Hashed public key for this recipient. - - REKData Simple Key Blob. The format of this data structure - is identical to that defined in the Microsoft - CryptoAPI and generated using the CryptExportKey() - function. The version of the Simple Key Blob - supported at this time is 0x02 as defined by - Microsoft. - -7.5 Certificate Processing - Central Directory Encryption ---------------------------------------------------------- - - 7.5.1 Central Directory Encryption using Digital Certificates will - operate in a manner similar to that of Single Password Central - Directory Encryption. This record will only be present when there - is data to place into it. Currently, data is placed into this - record when digital certificates are used for either encrypting - or signing the files within a ZIP file. When only password - encryption is used with no certificate encryption or digital - signing, this record is not currently needed. When present, this - record will appear before the start of the actual Central Directory - data structure and will be located immediately after the Archive - Decryption Header if the Central Directory is encrypted. - - 7.5.2 The Archive Extra Data record will be used to store the following - information. Additional data may be added in future versions. - - Extra Data Fields: - - 0x0014 - PKCS#7 Store for X.509 Certificates - 0x0016 - X.509 Certificate ID and Signature for central directory - 0x0019 - PKCS#7 Encryption Recipient Certificate List - - The 0x0014 and 0x0016 Extra Data records that otherwise would be - located in the first record of the Central Directory for digital - certificate processing. When encrypting or compressing the Central - Directory, the 0x0014 and 0x0016 records must be located in the - Archive Extra Data record and they should not remain in the first - Central Directory record. The Archive Extra Data record will also - be used to store the 0x0019 data. - - 7.5.3 When present, the size of the Archive Extra Data record will be - included in the size of the Central Directory. The data of the - Archive Extra Data record will also be compressed and encrypted - along with the Central Directory data structure. - -7.6 Certificate Processing Differences --------------------------------------- - - 7.6.1 The Certificate Processing Method of encryption differs from the - Single Password Symmetric Encryption Method as follows. Instead - of using a user-defined password to generate a master session key, - cryptographically random data is used. The key material is then - wrapped using standard key-wrapping techniques. This key material - is wrapped using the public key of each recipient that will need - to decrypt the file using their corresponding private key. - - 7.6.2 This specification currently assumes digital certificates will follow - the X.509 V3 format for 1024 bit and higher RSA format digital - certificates. Implementation of this Certificate Processing Method - requires supporting logic for key access and management. This logic - is outside the scope of this specification. - -7.7 OAEP Processing with Certificate-based Encryption ------------------------------------------------------ - - 7.7.1 OAEP stands for Optimal Asymmetric Encryption Padding. It is a - strengthening technique used for small encoded items such as decryption - keys. This is commonly applied in cryptographic key-wrapping techniques - and is supported by PKCS #1. Versions 5.0 and 6.0 of this specification - were designed to support OAEP key-wrapping for certificate-based - decryption keys for additional security. - - 7.7.2 Support for private keys stored on Smartcards or Tokens introduced - a conflict with this OAEP logic. Most card and token products do - not support the additional strengthening applied to OAEP key-wrapped - data. In order to resolve this conflict, versions 6.1 and above of this - specification will no longer support OAEP when encrypting using - digital certificates. - - 7.7.3 Versions of PKZIP available during initial development of the - certificate processing method set a value of 61 into the - version needed to extract field for a file. This indicates that - non-OAEP key wrapping is used. This affects certificate encryption - only, and password encryption functions should not be affected by - this value. This means values of 61 may be found on files encrypted - with certificates only, or on files encrypted with both password - encryption and certificate encryption. Files encrypted with both - methods can safely be decrypted using the password methods documented. - -8.0 Splitting and Spanning ZIP files -------------------------------------- - - 8.1 Spanned ZIP files - - 8.1.1 Spanning is the process of segmenting a ZIP file across - multiple removable media. This support has typically only - been provided for DOS formatted floppy diskettes. - - 8.2 Split ZIP files - - 8.2.1 File splitting is a newer derivation of spanning. - Splitting follows the same segmentation process as - spanning, however, it does not require writing each - segment to a unique removable medium and instead supports - placing all pieces onto local or non-removable locations - such as file systems, local drives, folders, etc. - - 8.3 File Naming Differences - - 8.3.1 A key difference between spanned and split ZIP files is - that all pieces of a spanned ZIP file have the same name. - Since each piece is written to a separate volume, no name - collisions occur and each segment can reuse the original - .ZIP file name given to the archive. - - 8.3.2 Sequence ordering for DOS spanned archives uses the DOS - volume label to determine segment numbers. Volume labels - for each segment are written using the form PKBACK#xxx, - where xxx is the segment number written as a decimal - value from 001 - nnn. - - 8.3.3 Split ZIP files are typically written to the same location - and are subject to name collisions if the spanned name - format is used since each segment will reside on the same - drive. To avoid name collisions, split archives are named - as follows. - - Segment 1 = filename.z01 - Segment n-1 = filename.z(n-1) - Segment n = filename.zip - - 8.3.4 The .ZIP extension is used on the last segment to support - quickly reading the central directory. The segment number - n should be a decimal value. - - 8.4 Spanned Self-extracting ZIP Files - - 8.4.1 Spanned ZIP files may be PKSFX Self-extracting ZIP files. - PKSFX files may also be split, however, in this case - the first segment must be named filename.exe. The first - segment of a split PKSFX archive must be large enough to - include the entire executable program. - - 8.5 Capacities and Markers - - 8.5.1 Capacities for split archives are as follows: - - Maximum number of segments = 4,294,967,295 - 1 - Maximum .ZIP segment size = 4,294,967,295 bytes - Minimum segment size = 64K - Maximum PKSFX segment size = 2,147,483,647 bytes - - 8.5.2 Segment sizes may be different however by convention, all - segment sizes should be the same with the exception of the - last, which may be smaller. Local and central directory - header records must never be split across a segment boundary. - When writing a header record, if the number of bytes remaining - within a segment is less than the size of the header record, - end the current segment and write the header at the start - of the next segment. The central directory may span segment - boundaries, but no single record in the central directory - should be split across segments. - - 8.5.3 Spanned/Split archives created using PKZIP for Windows - (V2.50 or greater), PKZIP Command Line (V2.50 or greater), - or PKZIP Explorer will include a special spanning - signature as the first 4 bytes of the first segment of - the archive. This signature (0x08074b50) will be - followed immediately by the local header signature for - the first file in the archive. - - 8.5.4 A special spanning marker may also appear in spanned/split - archives if the spanning or splitting process starts but - only requires one segment. In this case the 0x08074b50 - signature will be replaced with the temporary spanning - marker signature of 0x30304b50. Split archives can - only be uncompressed by other versions of PKZIP that - know how to create a split archive. - - 8.5.5 The signature value 0x08074b50 is also used by some - ZIP implementations as a marker for the Data Descriptor - record. Conflict in this alternate assignment can be - avoided by ensuring the position of the signature - within the ZIP file to determine the use for which it - is intended. - -9.0 Change Process ------------------- - - 9.1 In order for the .ZIP file format to remain a viable technology, this - specification should be considered as open for periodic review and - revision. Although this format was originally designed with a - certain level of extensibility, not all changes in technology - (present or future) were or will be necessarily considered in its - design. - - 9.2 If your application requires new definitions to the - extensible sections in this format, or if you would like to - submit new data structures or new capabilities, please forward - your request to zipformat@pkware.com. All submissions will be - reviewed by the ZIP File Specification Committee for possible - inclusion into future versions of this specification. - - 9.3 Periodic revisions to this specification will be published as - DRAFT or as FINAL status to ensure interoperability. We encourage - comments and feedback that may help improve clarity or content. - - -10.0 Incorporating PKWARE Proprietary Technology into Your Product ------------------------------------------------------------------- - - 10.1 The Use or Implementation in a product of APPNOTE technological - components pertaining to either strong encryption or patching requires - a separate, executed license agreement from PKWARE. Please contact - PKWARE at zipformat@pkware.com or +1-414-289-9788 with regard to - acquiring such a license. - - 10.2 Additional information regarding PKWARE proprietray technology is - available at http://www.pkware.com/appnote. - -11.0 Acknowledgements ---------------------- - - In addition to the above mentioned contributors to PKZIP and PKUNZIP, - PKWARE would like to extend special thanks to Robert Mahoney for - suggesting the extension .ZIP for this software. - -12.0 References ---------------- - - Fiala, Edward R., and Greene, Daniel H., "Data compression with - finite windows", Communications of the ACM, Volume 32, Number 4, - April 1989, pages 490-505. - - Held, Gilbert, "Data Compression, Techniques and Applications, - Hardware and Software Considerations", John Wiley & Sons, 1987. - - Huffman, D.A., "A method for the construction of minimum-redundancy - codes", Proceedings of the IRE, Volume 40, Number 9, September 1952, - pages 1098-1101. - - Nelson, Mark, "LZW Data Compression", Dr. Dobbs Journal, Volume 14, - Number 10, October 1989, pages 29-37. - - Nelson, Mark, "The Data Compression Book", M&T Books, 1991. - - Storer, James A., "Data Compression, Methods and Theory", - Computer Science Press, 1988 - - Welch, Terry, "A Technique for High-Performance Data Compression", - IEEE Computer, Volume 17, Number 6, June 1984, pages 8-19. - - Ziv, J. and Lempel, A., "A universal algorithm for sequential data - compression", Communications of the ACM, Volume 30, Number 6, - June 1987, pages 520-540. - - Ziv, J. and Lempel, A., "Compression of individual sequences via - variable-rate coding", IEEE Transactions on Information Theory, - Volume 24, Number 5, September 1978, pages 530-536. - - -APPENDIX A - AS/400 Extra Field (0x0065) Attribute Definitions --------------------------------------------------------------- - -A.1 Field Definition Structure: - - a. field length including length 2 bytes - b. field code 2 bytes - c. data x bytes - -A.2 Field Code Description - - 4001 Source type i.e. CLP etc - 4002 The text description of the library - 4003 The text description of the file - 4004 The text description of the member - 4005 x'F0' or 0 is PF-DTA, x'F1' or 1 is PF_SRC - 4007 Database Type Code 1 byte - 4008 Database file and fields definition - 4009 GZIP file type 2 bytes - 400B IFS code page 2 bytes - 400C IFS Creation Time 4 bytes - 400D IFS Access Time 4 bytes - 400E IFS Modification time 4 bytes - 005C Length of the records in the file 2 bytes - 0068 GZIP two words 8 bytes - -APPENDIX B - z/OS Extra Field (0x0065) Attribute Definitions ------------------------------------------------------------- - -B.1 Field Definition Structure: - - a. field length including length 2 bytes - b. field code 2 bytes - c. data x bytes - -B.2 Field Code Description - - 0001 File Type 2 bytes - 0002 NonVSAM Record Format 1 byte - 0003 Reserved - 0004 NonVSAM Block Size 2 bytes Big Endian - 0005 Primary Space Allocation 3 bytes Big Endian - 0006 Secondary Space Allocation 3 bytes Big Endian - 0007 Space Allocation Type1 byte flag - 0008 Modification Date Retired with PKZIP 5.0 + - 0009 Expiration Date Retired with PKZIP 5.0 + - 000A PDS Directory Block Allocation 3 bytes Big Endian binary value - 000B NonVSAM Volume List variable - 000C UNIT Reference Retired with PKZIP 5.0 + - 000D DF/SMS Management Class 8 bytes EBCDIC Text Value - 000E DF/SMS Storage Class 8 bytes EBCDIC Text Value - 000F DF/SMS Data Class 8 bytes EBCDIC Text Value - 0010 PDS/PDSE Member Info. 30 bytes - 0011 VSAM sub-filetype 2 bytes - 0012 VSAM LRECL 13 bytes EBCDIC "(num_avg num_max)" - 0013 VSAM Cluster Name Retired with PKZIP 5.0 + - 0014 VSAM KSDS Key Information 13 bytes EBCDIC "(num_length num_position)" - 0015 VSAM Average LRECL 5 bytes EBCDIC num_value padded with blanks - 0016 VSAM Maximum LRECL 5 bytes EBCDIC num_value padded with blanks - 0017 VSAM KSDS Key Length 5 bytes EBCDIC num_value padded with blanks - 0018 VSAM KSDS Key Position 5 bytes EBCDIC num_value padded with blanks - 0019 VSAM Data Name 1-44 bytes EBCDIC text string - 001A VSAM KSDS Index Name 1-44 bytes EBCDIC text string - 001B VSAM Catalog Name 1-44 bytes EBCDIC text string - 001C VSAM Data Space Type 9 bytes EBCDIC text string - 001D VSAM Data Space Primary 9 bytes EBCDIC num_value left-justified - 001E VSAM Data Space Secondary 9 bytes EBCDIC num_value left-justified - 001F VSAM Data Volume List variable EBCDIC text list of 6-character Volume IDs - 0020 VSAM Data Buffer Space 8 bytes EBCDIC num_value left-justified - 0021 VSAM Data CISIZE 5 bytes EBCDIC num_value left-justified - 0022 VSAM Erase Flag 1 byte flag - 0023 VSAM Free CI % 3 bytes EBCDIC num_value left-justified - 0024 VSAM Free CA % 3 bytes EBCDIC num_value left-justified - 0025 VSAM Index Volume List variable EBCDIC text list of 6-character Volume IDs - 0026 VSAM Ordered Flag 1 byte flag - 0027 VSAM REUSE Flag 1 byte flag - 0028 VSAM SPANNED Flag 1 byte flag - 0029 VSAM Recovery Flag 1 byte flag - 002A VSAM WRITECHK Flag 1 byte flag - 002B VSAM Cluster/Data SHROPTS 3 bytes EBCDIC "n,y" - 002C VSAM Index SHROPTS 3 bytes EBCDIC "n,y" - 002D VSAM Index Space Type 9 bytes EBCDIC text string - 002E VSAM Index Space Primary 9 bytes EBCDIC num_value left-justified - 002F VSAM Index Space Secondary 9 bytes EBCDIC num_value left-justified - 0030 VSAM Index CISIZE 5 bytes EBCDIC num_value left-justified - 0031 VSAM Index IMBED 1 byte flag - 0032 VSAM Index Ordered Flag 1 byte flag - 0033 VSAM REPLICATE Flag 1 byte flag - 0034 VSAM Index REUSE Flag 1 byte flag - 0035 VSAM Index WRITECHK Flag 1 byte flag Retired with PKZIP 5.0 + - 0036 VSAM Owner 8 bytes EBCDIC text string - 0037 VSAM Index Owner 8 bytes EBCDIC text string - 0038 Reserved - 0039 Reserved - 003A Reserved - 003B Reserved - 003C Reserved - 003D Reserved - 003E Reserved - 003F Reserved - 0040 Reserved - 0041 Reserved - 0042 Reserved - 0043 Reserved - 0044 Reserved - 0045 Reserved - 0046 Reserved - 0047 Reserved - 0048 Reserved - 0049 Reserved - 004A Reserved - 004B Reserved - 004C Reserved - 004D Reserved - 004E Reserved - 004F Reserved - 0050 Reserved - 0051 Reserved - 0052 Reserved - 0053 Reserved - 0054 Reserved - 0055 Reserved - 0056 Reserved - 0057 Reserved - 0058 PDS/PDSE Member TTR Info. 6 bytes Big Endian - 0059 PDS 1st LMOD Text TTR 3 bytes Big Endian - 005A PDS LMOD EP Rec # 4 bytes Big Endian - 005B Reserved - 005C Max Length of records 2 bytes Big Endian - 005D PDSE Flag 1 byte flag - 005E Reserved - 005F Reserved - 0060 Reserved - 0061 Reserved - 0062 Reserved - 0063 Reserved - 0064 Reserved - 0065 Last Date Referenced 4 bytes Packed Hex "yyyymmdd" - 0066 Date Created 4 bytes Packed Hex "yyyymmdd" - 0068 GZIP two words 8 bytes - 0071 Extended NOTE Location 12 bytes Big Endian - 0072 Archive device UNIT 6 bytes EBCDIC - 0073 Archive 1st Volume 6 bytes EBCDIC - 0074 Archive 1st VOL File Seq# 2 bytes Binary - -APPENDIX C - Zip64 Extensible Data Sector Mappings ---------------------------------------------------- - - -Z390 Extra Field: - - The following is the general layout of the attributes for the - ZIP 64 "extra" block for extended tape operations. - - Note: some fields stored in Big Endian format. All text is - in EBCDIC format unless otherwise specified. - - Value Size Description - ----- ---- ----------- - (Z390) 0x0065 2 bytes Tag for this "extra" block type - Size 4 bytes Size for the following data block - Tag 4 bytes EBCDIC "Z390" - Length71 2 bytes Big Endian - Subcode71 2 bytes Enote type code - FMEPos 1 byte - Length72 2 bytes Big Endian - Subcode72 2 bytes Unit type code - Unit 1 byte Unit - Length73 2 bytes Big Endian - Subcode73 2 bytes Volume1 type code - FirstVol 1 byte Volume - Length74 2 bytes Big Endian - Subcode74 2 bytes FirstVol file sequence - FileSeq 2 bytes Sequence - -APPENDIX D - Language Encoding (EFS) ------------------------------------- - -D.1 The ZIP format has historically supported only the original IBM PC character -encoding set, commonly referred to as IBM Code Page 437. This limits storing -file name characters to only those within the original MS-DOS range of values -and does not properly support file names in other character encodings, or -languages. To address this limitation, this specification will support the -following change. - -D.2 If general purpose bit 11 is unset, the file name and comment should conform -to the original ZIP character encoding. If general purpose bit 11 is set, the -filename and comment must support The Unicode Standard, Version 4.1.0 or -greater using the character encoding form defined by the UTF-8 storage -specification. The Unicode Standard is published by the The Unicode -Consortium (www.unicode.org). UTF-8 encoded data stored within ZIP files -is expected to not include a byte order mark (BOM). - -D.3 Applications may choose to supplement this file name storage through the use -of the 0x0008 Extra Field. Storage for this optional field is currently -undefined, however it will be used to allow storing extended information -on source or target encoding that may further assist applications with file -name, or file content encoding tasks. Please contact PKWARE with any -requirements on how this field should be used. - -D.4 The 0x0008 Extra Field storage may be used with either setting for general -purpose bit 11. Examples of the intended usage for this field is to store -whether "modified-UTF-8" (JAVA) is used, or UTF-8-MAC. Similarly, other -commonly used character encoding (code page) designations can be indicated -through this field. Formalized values for use of the 0x0008 record remain -undefined at this time. The definition for the layout of the 0x0008 field -will be published when available. Use of the 0x0008 Extra Field provides -for storing data within a ZIP file in an encoding other than IBM Code -Page 437 or UTF-8. - -D.5 General purpose bit 11 will not imply any encoding of file content or -password. Values defining character encoding for file content or -password must be stored within the 0x0008 Extended Language Encoding -Extra Field. - -D.6 Ed Gordon of the Info-ZIP group has defined a pair of "extra field" records -that can be used to store UTF-8 file name and file comment fields. These -records can be used for cases when the general purpose bit 11 method -for storing UTF-8 data in the standard file name and comment fields is -not desirable. A common case for this alternate method is if backward -compatibility with older programs is required. - -D.7 Definitions for the record structure of these fields are included above -in the section on 3rd party mappings for "extra field" records. These -records are identified by Header ID's 0x6375 (Info-ZIP Unicode Comment -Extra Field) and 0x7075 (Info-ZIP Unicode Path Extra Field). - -D.8 The choice of which storage method to use when writing a ZIP file is left -to the implementation. Developers should expect that a ZIP file may -contain either method and should provide support for reading data in -either format. Use of general purpose bit 11 reduces storage requirements -for file name data by not requiring additional "extra field" data for -each file, but can result in older ZIP programs not being able to extract -files. Use of the 0x6375 and 0x7075 records will result in a ZIP file -that should always be readable by older ZIP programs, but requires more -storage per file to write file name and/or file comment fields. - From 36f8c7f42afa800fdc46308d7fb829dcb8e83f8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:20:48 +0200 Subject: [PATCH 178/710] [translation] Fix src/plugins/shared/versinfo.rc2 comments (#549) --- src/plugins/shared/versinfo.rc2 | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/plugins/shared/versinfo.rc2 b/src/plugins/shared/versinfo.rc2 index 00b9bbffc..01921fe42 100644 --- a/src/plugins/shared/versinfo.rc2 +++ b/src/plugins/shared/versinfo.rc2 @@ -14,19 +14,17 @@ #error this file is not editable by Microsoft Visual C++ #endif //APSTUDIO_INVOKED +// VERSIONINFO template for plugins and their LANG files +// Each module/plugin defines the VERSINFO_xxx variables in its own versinfo.rh // -// sablona VERSIONINFO pro pluginy a jejich LANG soubory -// kazdy modul/plugin definuje promenne VERSINFO_xxx zve svem versinfo.rh -// -// tento resource vkladame pomoci include jak do SALAMAND.EXE, LANG.SPL, -// do vsech pluginu (SPL) a do jejich SLG -// pri prekladu SLG je v projektu definovana konstanta _LANG -// -// VarFileInfo\[Translation, Author, Email, Web, Comment, HelpDir] umi nastavovat -// Translator; originalni SLG je anglicke -// VarFileInfo\Translation je zobrazovano ve vlastnostech souboru -// na strance Version jako "Language" +// This resource is included in SALAMAND.EXE, LANG.SPL, +// in all plugins (SPL) and in their SLG files +// When building SLG, the _LANG constant is defined in the project // +// Translator can set VarFileInfo\[Translation, Author, Email, Web, Comment, HelpDir]; +// the original SLG is in English +// VarFileInfo\Translation is shown in the file properties +// on the Version tab as "Language" VS_VERSION_INFO VERSIONINFO FILEVERSION VERSINFO_MAJOR,VERSINFO_MINORA,VERSINFO_MINORB,VERSINFO_BUILDNUMBER From 936741ecf4521addfa7a897230f6ed0089a39398 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:21:37 +0200 Subject: [PATCH 179/710] [translation] Fix src/plugins/shared/statics.rh2 comments (#550) --- src/plugins/shared/statics.rh2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/shared/statics.rh2 b/src/plugins/shared/statics.rh2 index 8303e203f..d43752653 100644 --- a/src/plugins/shared/statics.rh2 +++ b/src/plugins/shared/statics.rh2 @@ -14,7 +14,7 @@ #error this file is not editable by Microsoft Visual C++ #endif //defined(APSTUDIO_INVOKED) && !defined(APSTUDIO_READONLY_SYMBOLS) -// modul, ktery includi statics.rh2 musi definovat IDC_STATIC_1 a rezervovat prostor pro 40 hodnot +// Any module that includes statics.rh2 must define IDC_STATIC_1 and reserve space for 40 values //#define IDC_STATIC_1 (IDC_STATIC_1+0) // definovano v nadrazenem headru #define IDC_STATIC_2 (IDC_STATIC_1+1) From 6b951aeaf7af7624d34c13d36607e1add9c4ae66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:21:43 +0200 Subject: [PATCH 180/710] [translation] Fix src/plugins/shared/spl_view.h comments (#551) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/plugins/shared/spl_view.h | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/plugins/shared/spl_view.h b/src/plugins/shared/spl_view.h index e6c6eb161..de9486737 100644 --- a/src/plugins/shared/spl_view.h +++ b/src/plugins/shared/spl_view.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED //**************************************************************************** // @@ -12,7 +13,7 @@ #pragma once #ifdef _MSC_VER -#pragma pack(push, enter_include_spl_view) // aby byly struktury nezavisle na nastavenem zarovnavani +#pragma pack(push, enter_include_spl_view) // to make the structures independent of the current packing alignment #pragma pack(4) #endif // _MSC_VER #ifdef __BORLANDC__ @@ -29,37 +30,37 @@ struct CSalamanderPluginViewerData; class CPluginInterfaceForViewerAbstract { #ifdef INSIDE_SALAMANDER -private: // ochrana proti nespravnemu primemu volani metod (viz CPluginInterfaceForViewerEncapsulation) +private: // guard against incorrect direct method calls (see CPluginInterfaceForViewerEncapsulation) friend class CPluginInterfaceForViewerEncapsulation; #else // INSIDE_SALAMANDER public: #endif // INSIDE_SALAMANDER - // funkce pro "file viewer", vola se pri pozadavku na otevreni viewru a nacteni souboru - // 'name', 'left'+'right'+'width'+'height'+'showCmd'+'alwaysOnTop' je doporucene umisteni + // Called when the viewer is requested to open and load file + // 'name'; 'left'+'top'+'width'+'height'+'showCmd'+'alwaysOnTop' is the recommended window placement; // okna, je-li 'returnLock' FALSE nemaji 'lock'+'lockOwner' zadny vyznam, je-li 'returnLock' // TRUE, mel by viewer vratit system-event 'lock' v nonsignaled stavu, do signaled stavu 'lock' - // prejde v okamziku ukonceni prohlizeni souboru 'name' (soubor je v tomto okamziku odstranen + // becomes signaled when viewing file 'name' ends (the file is removed from the temporary // z docasneho adresare), dale by mel vratit v 'lockOwner' TRUE pokud ma byt objekt 'lock' uzavren // volajicim (FALSE znamena, ze si viewer 'lock' rusi sam - v tomto pripade viewer musi pro // prechod 'lock' do signaled stavu pouzit metodu CSalamanderGeneralAbstract::UnlockFileInCache); // pokud viewer nenastavi 'lock' (zustava NULL) je soubor 'name' platny jen do ukonceni volani teto // metody ViewFile; neni-li 'viewerData' NULL, jde o predani rozsirenych parametru viewru (viz // CSalamanderGeneralAbstract::ViewFileInPluginViewer); 'enumFilesSourceUID' je UID zdroje (panelu - // nebo Find okna), ze ktereho je viewer otviran, je-li -1, je zdroj neznamy (archivy a + // or Find window) from which the viewer is opened; if it is -1, the source is unknown (archives // file_systemy nebo Alt+F11, atd.) - viz napr. CSalamanderGeneralAbstract::GetNextFileNameForViewer; - // 'enumFilesCurrentIndex' je index oteviraneho souboru ve zdroji (panelu nebo Find okne), je-li -1, + // 'enumFilesCurrentIndex' is the index of the opened file in the source (panel or Find window); if it is -1, // neni zdroj nebo index znamy; vraci TRUE pri uspechu (FALSE znamena neuspech, 'lock' a - // 'lockOwner' v tomto pripade nemaji zadny vyznam) + // 'lockOwner' have no meaning in that case) virtual BOOL WINAPI ViewFile(const char* name, int left, int top, int width, int height, UINT showCmd, BOOL alwaysOnTop, BOOL returnLock, HANDLE* lock, BOOL* lockOwner, CSalamanderPluginViewerData* viewerData, int enumFilesSourceUID, int enumFilesCurrentIndex) = 0; - // funkce pro "file viewer", vola se pri pozadavku na otevreni viewru a nacteni souboru - // 'name'; tato fuknce by nemela zobrazovat zadna okna typu "invalid file format", tato - // okna se zobrazi az pri volani metody ViewFile tohoto rozhrani; zjisti jestli je - // soubor 'name' zobrazitelny (napr. soubor ma odpovidajici signaturu) ve vieweru + // Called when the viewer is requested to open and load file + // 'name'; this method should not display any "invalid file format" dialogs; those + // dialogs are displayed only when the ViewFile method of this interface is called; checks whether + // file 'name' can be displayed in the viewer (e.g. the file has a matching signature) // a pokud je, vraci TRUE; pokud vrati FALSE, zkusi Salamander pro 'name' najit jiny // viewer (v prioritnim seznamu vieweru, viz konfiguracni stranka Viewers) virtual BOOL WINAPI CanViewFile(const char* name) = 0; From eab77031da057d4c13a55bc57d630fbbfcc15395 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:21:50 +0200 Subject: [PATCH 181/710] [translation] Fix src/plugins/shared/spl_vers.h comments (#552) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/plugins/shared/spl_vers.h | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/src/plugins/shared/spl_vers.h b/src/plugins/shared/spl_vers.h index 79bc6460d..b3c6a7713 100644 --- a/src/plugins/shared/spl_vers.h +++ b/src/plugins/shared/spl_vers.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED //**************************************************************************** // @@ -25,7 +26,7 @@ #define VERSINFO_SALAMANDER_MINORA 0 #define VERSINFO_SALAMANDER_MINORB 0 -#if (VERSINFO_SALAMANDER_MINORB == 0) // nulu na setinach nepiseme 2.50 -> 2.5 +#if (VERSINFO_SALAMANDER_MINORB == 0) // omit the trailing zero in the hundredths place: 2.50 -> 2.5 #define VERSINFO_SALAMANDER_VERSION VERSINFO_xstr(VERSINFO_SALAMANDER_MAJOR) "." VERSINFO_xstr(VERSINFO_SALAMANDER_MINORA) VERSINFO_BETAVERSION_TXT #define VERSINFO_SAL_SHORT_VERSION VERSINFO_xstr(VERSINFO_SALAMANDER_MAJOR) VERSINFO_xstr(VERSINFO_SALAMANDER_MINORA) VERSINFO_BETAVERSIONSHORT_TXT #else @@ -34,7 +35,7 @@ #endif #ifdef VERSINFO_MAJOR // je definovane jen pokud se pouziva z pluginu -#if (VERSINFO_MINORB == 0) // nulu na setinach nepiseme 2.50 -> 2.5 +#if (VERSINFO_MINORB == 0) // omit the trailing zero in the hundredths place: 2.50 -> 2.5 #define VERSINFO_VERSION VERSINFO_xstr(VERSINFO_MAJOR) "." VERSINFO_xstr(VERSINFO_MINORA) VERSINFO_BETAVERSION_TXT #define VERSINFO_VERSION_NO_PLATFORM VERSINFO_xstr(VERSINFO_MAJOR) "." VERSINFO_xstr(VERSINFO_MINORA) VERSINFO_BETAVERSION_TXT_NO_PLATFORM #else @@ -51,14 +52,9 @@ // VERSINFO_BUILDNUMBER: // -// Slouzi ke snadnemu odliseni verzi vsech modulu mezi jednotlivymi verzemi -// Salamandera (jde o posledni komponentu cisla verze vsech pluginu a -// Salamandera). Zvysovat s kazdou verzi (IB, DB, PB, beta, release nebo i -// jen testovaci verze poslana jednomu uzivateli). Prehled ruznych typu verzi -// je v souboru doc\versions.txt. Vzdy zavest komentar s popisem, ke ktere -// verzi Salamandera patri nove pouzite cislo buildu. +// Used to easily distinguish all module versions across Salamander releases (it is the last component of the version number of all plugins and Salamander). Increment it for every version (IB, DB, PB, beta, release, or even a test build sent to a single user). An overview of the different version types is in doc\versions.txt. Always add a comment describing which Salamander version a newly used build number belongs to. // -// Prehled pouzitych hodnot VERSINFO_BUILDNUMBER: +// Overview of used VERSINFO_BUILDNUMBER values: // 9 - 2.5 beta 9 // 10 - 2.5 beta 10 // 11 - 2.5 beta 11 @@ -103,19 +99,19 @@ // VERSINFO_BETAVERSION_TXT: // -// Meni se s kazdym buildem, v pripade release verze bude VERSINFO_BETAVERSION_TXT="". -// Pokud vydavame specialni opravne beta verze typu 2.5 beta 9a, zvysime -// VERSINFO_BUILDNUMBER o jedna a dame VERSINFO_BETAVERSION_TXT==" beta 9a". +// Changes with every build; for a release version, VERSINFO_BETAVERSION_TXT will be "". +// If we release a special beta fix build such as 2.5 beta 9a, increment +// VERSINFO_BUILDNUMBER by one and set VERSINFO_BETAVERSION_TXT==" beta 9a". // -// VERSINFO_BETAVERSIONSHORT_TXT slouzi pro pojmenovani bug reportu, jde o co nejkratsi zapis +// VERSINFO_BETAVERSIONSHORT_TXT is used for bug report names; it should be as short as possible -// priklady ("x86" je pro 32-bit verzi, "x64" pro 64-bit verzi, v nasledujicich prikladech jsou -// x86/x64 zamenne): " (x86)" (pro release verze), " beta 2 (x64)", " beta 2 (SDK x86)", +// examples ("x86" is for the 32-bit version, "x64" for the 64-bit version; in the following examples, +// x86/x64 are interchangeable): " (x86)" (for release versions), " beta 2 (x64)", " beta 2 (SDK x86)", // " RC1 (x64)", " beta 2 (IB21 x86)", " beta 2 (DB21 x64)", " beta 2 (PB21 x86)" #define VERSINFO_BETAVERSION_TXT " (" SAL_VER_PLATFORM ")" -#define VERSINFO_BETAVERSION_TXT_NO_PLATFORM "" // kopie radku vyse + smazat SAL_VER_PLATFORM + je-li zavorka prazdna, smazat ji + smazat nadbytecne mezery +#define VERSINFO_BETAVERSION_TXT_NO_PLATFORM "" // copy the line above + remove SAL_VER_PLATFORM + if the parentheses are empty, remove them + remove extra spaces -// priklady (x86/x64 viz predchozi odstavec): "x86" (pro release verze), "B2x64", "B2SDKx86", +// examples (see the previous paragraph for x86/x64): "x86" (for release versions), "B2x64", "B2SDKx86", // "RC1x64", "B2IB21x86", "B2DB21x64", "B2PB21x86" #define VERSINFO_BETAVERSIONSHORT_TXT SAL_VER_PLATFORM From 6f06b27743892a7d137f6cc092ad8878f318bf2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:21:56 +0200 Subject: [PATCH 182/710] [translation] Fix src/plugins/shared/arraylt.h comments (#553) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/plugins/shared/arraylt.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/shared/arraylt.h b/src/plugins/shared/arraylt.h index 5f872e871..fa8144f41 100644 --- a/src/plugins/shared/arraylt.h +++ b/src/plugins/shared/arraylt.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED //**************************************************************************** // @@ -16,8 +17,7 @@ // Use the _DEBUG or __ARRAY_DEBUG defines to enable various error state checking. Errors // are displayed using TRACE_E and TRACE_C macros. -// We need to make this module independent on TRACE macros, so if they are not defined, -// we define their fakes. Certainly error reporting will not work in such situation. +// We need to make this module independent of the TRACE macros, so if they are not defined, we provide dummy definitions. Error reporting will of course not work in that case. #if !defined(TRACE_I) && !defined(TRACE_E) && !defined(TRACE_C) inline void __TraceEmptyFunction() {} #define TRACE_I(str) __TraceEmptyFunction() @@ -97,7 +97,7 @@ class TDirectArray TRACE_C("Index is out of range (index = " << index << ", Count = " << Count << ")."); Error(etUnknownIndex); - return Data[0]; // because of compiler we must return (invalid) item + return Data[0]; // the compiler requires us to return an (invalid) item } #endif } @@ -114,7 +114,7 @@ class TDirectArray TRACE_C("Index is out of range (index = " << index << ", Count = " << Count << ")."); Error(etUnknownIndex); - return Data[0]; // because of compiler we must return (invalid) item + return Data[0]; // the compiler requires us to return an (invalid) item } #endif } @@ -183,7 +183,7 @@ class TDirectArray virtual void CallDestructor(DATA_TYPE& member) { member.~DATA_TYPE(); } -private: // following methods will not be called (prevention) +private: // prevents use of the following methods TDirectArray() {} TDirectArray(const TDirectArray&) {} TDirectArray& operator=(TDirectArray&) { return *this; } From d5a5ccffe816d12257c1158302443317e425d463 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:22:03 +0200 Subject: [PATCH 183/710] [translation] Fix src/plugins/shared/auxtools.cpp comments (#554) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/plugins/shared/auxtools.cpp | 79 +++++++++++++++++---------------- 1 file changed, 40 insertions(+), 39 deletions(-) diff --git a/src/plugins/shared/auxtools.cpp b/src/plugins/shared/auxtools.cpp index 3b69e499d..6f2e95f4e 100644 --- a/src/plugins/shared/auxtools.cpp +++ b/src/plugins/shared/auxtools.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED //**************************************************************************** // @@ -42,11 +43,11 @@ CThreadQueue::CThreadQueue(const char* queueName) CThreadQueue::~CThreadQueue() { - ClearFinishedThreads(); // neni treba sekce, uz by mel pouzivat jen jeden thread + ClearFinishedThreads(); // no critical section needed; only one thread should be using this now if (Continue != NULL) CloseHandle(Continue); if (Head != NULL) - TRACE_E("Some thread is still in " << QueueName << " queue!"); // po terminovani threadu, ktery ceka na (nebo zrovna terminuje) jiny thread z fronty, jinak by nemelo nastat... + TRACE_E("Some thread is still in " << QueueName << " queue!"); // after terminating a thread that is waiting for, or is just terminating, another thread from the queue; otherwise this should not happen... } void CThreadQueue::ClearFinishedThreads() @@ -57,7 +58,7 @@ void CThreadQueue::ClearFinishedThreads() { DWORD ec; if (act->Locks == 0 && (!GetExitCodeThread(act->Thread, &ec) || ec != STILL_ACTIVE)) - { // tento thread neni zamceny + uz skoncil, vyhodime ho ze seznamu + { // this thread is not locked and has already finished; remove it from the list if (last != NULL) last->Next = act->Next; else @@ -76,10 +77,10 @@ void CThreadQueue::ClearFinishedThreads() BOOL CThreadQueue::Add(CThreadQueueItem* item) { - // nejprve vyhodime thready, ktere se jiz ukoncily + // first remove threads that have already finished ClearFinishedThreads(); - // pridame novy thread + // add the new thread if (item != NULL) { item->Next = Head; @@ -93,7 +94,7 @@ BOOL CThreadQueue::FindAndLockItem(HANDLE thread) { CS.Enter(); - CThreadQueueItem* act = Head; // zkusime najit otevreny handle threadu + CThreadQueueItem* act = Head; // try to find an open thread handle while (act != NULL) { if (act->Thread == thread) @@ -106,7 +107,7 @@ BOOL CThreadQueue::FindAndLockItem(HANDLE thread) CS.Leave(); - return act != NULL; // NULL = nenalezeno + return act != NULL; // NULL = not found } void CThreadQueue::UnlockItem(HANDLE thread, BOOL deleteIfUnlocked) @@ -114,7 +115,7 @@ void CThreadQueue::UnlockItem(HANDLE thread, BOOL deleteIfUnlocked) CS.Enter(); CThreadQueueItem* last = NULL; - CThreadQueueItem* act = Head; // zkusime najit otevreny handle threadu + CThreadQueueItem* act = Head; // try to find an open thread handle while (act != NULL) { if (act->Thread == thread) @@ -122,13 +123,13 @@ void CThreadQueue::UnlockItem(HANDLE thread, BOOL deleteIfUnlocked) last = act; act = act->Next; } - if (act != NULL) // always true (bylo zamknute, neslo smazat) + if (act != NULL) // always true (it was locked, so it could not be deleted) { if (act->Locks <= 0) TRACE_E("CThreadQueue::UnlockItem(): thread has not locks!"); else { - if (--(act->Locks) == 0 && deleteIfUnlocked) // thread uz neni zamceny a mame ho smazat + if (--(act->Locks) == 0 && deleteIfUnlocked) // thread is no longer locked and should be deleted { if (last != NULL) last->Next = act->Next; @@ -140,7 +141,7 @@ void CThreadQueue::UnlockItem(HANDLE thread, BOOL deleteIfUnlocked) } } else - TRACE_E("CThreadQueue::UnlockItem(): unable to find thread!"); // to nebyl zamknuty, ze je smazany? + TRACE_E("CThreadQueue::UnlockItem(): unable to find thread!"); // wasn't it already unlocked and therefore deleted? CS.Leave(); } @@ -151,7 +152,7 @@ BOOL CThreadQueue::WaitForExit(HANDLE thread, int milliseconds) BOOL ret = TRUE; if (thread != NULL) { - if (FindAndLockItem(thread)) // handle threadu nalezen a uzamcen - muzeme na nej cekat, pak ho zrusime + if (FindAndLockItem(thread)) // thread handle found and locked; we can wait for it, then remove it { ret = WaitForSingleObject(thread, milliseconds) != WAIT_TIMEOUT; @@ -168,10 +169,10 @@ void CThreadQueue::KillThread(HANDLE thread, DWORD exitCode) CALL_STACK_MESSAGE2("CThreadQueue::KillThread(, %d)", exitCode); if (thread != NULL) { - if (FindAndLockItem(thread)) // handle threadu nalezen a uzamcen - muzeme ho terminovat, pak ho zrusime + if (FindAndLockItem(thread)) // thread handle found and locked; we can terminate it, then remove it { TerminateThread(thread, exitCode); - WaitForSingleObject(thread, INFINITE); // pockame az thread skutecne skonci, nekdy mu to dost trva + WaitForSingleObject(thread, INFINITE); // wait until the thread actually exits; sometimes this takes quite a while UnlockItem(thread, TRUE); } @@ -188,7 +189,7 @@ BOOL CThreadQueue::KillAll(BOOL force, int waitTime, int forceWaitTime, DWORD ex CS.Enter(); - // vykillujeme vsechny thready, ktere nehodlaji koncit sami + // terminate all threads that will not exit on their own CThreadQueueItem* prevItem = NULL; CThreadQueueItem* item = Head; while (item != NULL) @@ -196,11 +197,11 @@ BOOL CThreadQueue::KillAll(BOOL force, int waitTime, int forceWaitTime, DWORD ex BOOL leaveCS = FALSE; DWORD ec; if (GetExitCodeThread(item->Thread, &ec) && ec == STILL_ACTIVE) - { // thread jeste nejspis bezi + { // thread is probably still running DWORD t = GetTickCount() - ti; - if (w == INFINITE || t < w) // mame jeste cekat + if (w == INFINITE || t < w) // still need to wait { - // uvolnime frontu pro dalsi thready (aby se napr. dockaly ukonceni threadu z fronty a pak se sami ukoncily) + // release the queue for other threads (for example so they can wait for a queued thread to finish and then exit themselves) CS.Leave(); if (w == INFINITE || 50 < w - t) @@ -208,34 +209,34 @@ BOOL CThreadQueue::KillAll(BOOL force, int waitTime, int forceWaitTime, DWORD ex else { Sleep(w - t); - ti -= w; // pro priste vyradime test na cekani + ti -= w; // skip the wait test next time } CS.Enter(); item = Head; prevItem = NULL; - continue; // zacneme pekne od zacatku (podminka cyklu se otestuje) + continue; // start over from the beginning (the loop condition will be rechecked) } - if (force) // zabijeme ho + if (force) // terminate it { TRACE_E("Thread has not ended itself, we must terminate it (" << QueueName << " queue)."); TerminateThread(item->Thread, exitCode); - WaitForSingleObject(item->Thread, INFINITE); // pockame az thread skutecne skonci, nekdy mu to dost trva + WaitForSingleObject(item->Thread, INFINITE); // wait until the thread actually exits; sometimes this takes quite a while // pokud nejaky thread ceka na ukonceni prave zabiteho threadu, pustime pro nej na chvilku // frontu, jinak zustane zasekly v UnlockItem() leaveCS = item->Locks > 0; } - else // bez 'force' jen ohlasime, ze jeste neco bezi + else // without force, just report that something is still running { TRACE_I("KillAll(): At least one thread is still running in " << QueueName << " queue."); - ClearFinishedThreads(); // jen tak pro prehlednost pri debugovani + ClearFinishedThreads(); // just for clarity while debugging CS.Leave(); return FALSE; } } CThreadQueueItem* delItem = item; item = item->Next; - if (delItem->Locks == 0) // handle je mozne zavrit, polozku smazat + if (delItem->Locks == 0) // the handle can be closed; delete the item { if (Head == delItem) Head = item; @@ -245,19 +246,19 @@ BOOL CThreadQueue::KillAll(BOOL force, int waitTime, int forceWaitTime, DWORD ex delete delItem; } else - prevItem = delItem; // handle musime nechat byt, takze i polozku + prevItem = delItem; // we have to leave the handle alone, so the item has to stay too if (leaveCS) { - // uvolnime frontu pro dalsi thready (aby se napr. dockaly ukonceni threadu z fronty a pak se sami ukoncily) + // release the queue for other threads (for example so they can wait for a queued thread to finish and then exit themselves) CS.Leave(); - Sleep(50); // chvilka na prevzeti fronty a prip. dobeh threadu (nez ho pujdeme zabit jako vsechny ostatni) + Sleep(50); // give it a moment to take over the queue and possibly finish before we kill it like the others CS.Enter(); item = Head; prevItem = NULL; - continue; // zacneme pekne od zacatku (podminka cyklu se otestuje) + continue; // start over from the beginning (the loop condition will be rechecked) } } @@ -277,14 +278,14 @@ CThreadQueue::ThreadBase(void* param) { CThreadBaseData* d = (CThreadBaseData*)param; - // zaloha dat na stack ('d' prestane byt platne po 'Continue') + // copy the data to the stack ('d' becomes invalid after 'Continue') unsigned(WINAPI * threadBody)(void*) = d->Body; void* threadParam = d->Param; - SetEvent(d->Continue); // pustime dal hl. thread + SetEvent(d->Continue); // let the main thread continue d = NULL; - // spustime nas thread + // run the thread body return SalamanderDebug->CallWithCallStack(threadBody, threadParam); } @@ -328,12 +329,12 @@ CThreadQueue::StartThread(unsigned(WINAPI* body)(void*), void* param, unsigned s } else { - // pridame thread do fronty threadu tohoto pluginu + // add the thread to this plugin's thread queue if (!Add(new CThreadQueueItem(thread, tid))) { TRACE_E("Unable to add thread to the queue."); - TerminateThread(thread, 666); // je suspended, takze nebude v zadne kriticke sekci, atd. - WaitForSingleObject(thread, INFINITE); // pockame az thread skutecne skonci, nekdy mu to dost trva + TerminateThread(thread, 666); // it is suspended, so it cannot be in any critical section, etc. + WaitForSingleObject(thread, INFINITE); // wait until the thread actually exits; sometimes this takes quite a while CloseHandle(thread); CS.Leave(); @@ -341,7 +342,7 @@ CThreadQueue::StartThread(unsigned(WINAPI* body)(void*), void* param, unsigned s return NULL; } - // zapis dokud thread nebezi (zarucuje, ze uz nedobehl a jeho objekt neni dealokovany) + // store the handle before the thread starts running (guarantees it has not finished and its object has not been deallocated) if (threadHandle != NULL) *threadHandle = thread; if (threadID != NULL) @@ -350,7 +351,7 @@ CThreadQueue::StartThread(unsigned(WINAPI* body)(void*), void* param, unsigned s SalamanderDebug->TraceAttachThread(thread, tid); ResumeThread(thread); - WaitForSingleObject(Continue, INFINITE); // pockame na predani dat do CThreadQueue::ThreadBase + WaitForSingleObject(Continue, INFINITE); // wait until the data has been handed off to CThreadQueue::ThreadBase CS.Leave(); @@ -379,9 +380,9 @@ CThread::UniversalBody(void* param) CALL_STACK_MESSAGE2("CThread::UniversalBody(thread name = \"%s\")", thread->Name); SalamanderDebug->SetThreadNameInVCAndTrace(thread->Name); - unsigned ret = thread->Body(); // spusteni tela threadu + unsigned ret = thread->Body(); // run the thread body - delete thread; // likvidace objektu threadu + delete thread; // destroy the thread object return ret; } From cf9124713bde7777265e80b4a241f1847b53ba11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:22:09 +0200 Subject: [PATCH 184/710] [translation] Fix src/plugins/shared/auxtools.h comments (#555) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/plugins/shared/auxtools.h | 81 ++++++++++++++++++----------------- 1 file changed, 41 insertions(+), 40 deletions(-) diff --git a/src/plugins/shared/auxtools.h b/src/plugins/shared/auxtools.h index 2efd3b05f..3d59a2c49 100644 --- a/src/plugins/shared/auxtools.h +++ b/src/plugins/shared/auxtools.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED //**************************************************************************** // @@ -19,7 +20,7 @@ struct CThreadQueueItem { HANDLE Thread; - DWORD ThreadID; // jen pro ladici ucely (nalezeni threadu v seznamu threadu v debuggeru) + DWORD ThreadID; // debugging only (to find the thread in the debugger thread list) int Locks; // pocet zamku, je-li > 0 nesmime zavrit 'Thread' CThreadQueueItem* Next; @@ -35,11 +36,11 @@ struct CThreadQueueItem class CThreadQueue { protected: - const char* QueueName; // jmeno fronty (jen pro debugovaci ucely) + const char* QueueName; // queue name (debugging only) CThreadQueueItem* Head; - HANDLE Continue; // musime pockat na predani dat do startovaneho threadu + HANDLE Continue; // must wait until the data is handed off to the started thread - struct CCS // pristup z vice threadu -> nutna synchronizace + struct CCS // access from multiple threads -> synchronization required { CRITICAL_SECTION cs; @@ -51,23 +52,23 @@ class CThreadQueue } CS; public: - CThreadQueue(const char* queueName /* napr. "DemoPlug Viewers" */); + CThreadQueue(const char* queueName /* e.g. "DemoPlug Viewers" */); ~CThreadQueue(); - // spusti funkci 'body' s parametrem 'param' v nove vytvorenem threadu se zasobnikem + // starts function 'body' with parameter 'param' in a newly created thread with a stack // o velikosti 'stack_size' (0 = default); vraci handle threadu nebo NULL pri chybe, - // zaroven vysledek zapise pred spustenim threadu (resume) i do 'threadHandle' - // (neni-li NULL), vraceny handle threadu pouzivat jen na testy na NULL a pro volani - // metod CThreadQueue: WaitForExit() a KillThread(); zavreni handlu threadu zajistuje - // tento objekt fronty + // also writes the result to 'threadHandle' before the thread is resumed + // (if not NULL); use the returned thread handle only for NULL checks and for calling + // CThreadQueue methods WaitForExit() and KillThread(); the thread handle is closed by + // this queue object // POZOR: -thread se muze spustit se zpozdenim az po navratu ze StartThread() - // (je-li 'param' ukazatel na strukturu ulozenou na zasobniku, je nutne - // synchronizovat predani dat z 'param' - hl. thread musi pockat - // na prevzeti dat novym threadem) - // -vraceny handle threadu jiz muze byt zavreny pokud thread dobehne pred - // navratem ze StartThread() a z jineho threadu se vola StartThread() nebo + // (if 'param' points to a structure stored on the stack, it is necessary to + // synchronize the handoff of data from 'param' - the main thread must wait + // until the new thread takes ownership of the data) + // -the returned thread handle may already be closed if the thread finishes before + // StartThread() returns and another thread calls StartThread() or // KillAll() - // mozne volat z libovolneho threadu + // can be called from any thread HANDLE StartThread(unsigned(WINAPI* body)(void*), void* param, unsigned stack_size = 0, HANDLE* threadHandle = NULL, DWORD* threadID = NULL); @@ -83,21 +84,21 @@ class CThreadQueue void KillThread(HANDLE thread, DWORD exitCode = 666); // overi, ze vsechny thready skoncily; je-li 'force' TRUE a nejaky thread jeste bezi, - // ceka 'forceWaitTime' (v ms) na ukonceni vsech threadu, pak bezici thready zabije - // (jejich objekty se nedealokuji, protoze jejich stav je neznamy, mozna nekonzistentni); + // waits 'forceWaitTime' (ms) for all threads to finish, then kills any threads still running + // (their objects are not deallocated because their state is unknown and may be inconsistent); // vraci TRUE, jsou-li vsechny thready ukoncene, pri 'force' TRUE vzdy vraci TRUE; - // je-li 'force' FALSE a nejaky thread jeste bezi, ceka 'waitTime' (v ms) na ukonceni + // if 'force' is FALSE and some thread is still running, waits 'waitTime' (ms) for all // vsech threadu, pokud pak jeste stale neco bezi, vraci FALSE; cas INFINITE = neomezene - // dlouhe cekani - // mozne volat z libovolneho threadu + // waiting + // can be called from any thread BOOL KillAll(BOOL force, int waitTime = 1000, int forceWaitTime = 200, DWORD exitCode = 666); -protected: // vnitrni nesynchronizovane metody - BOOL Add(CThreadQueueItem* item); // prida polozku do fronty, vraci uspech - BOOL FindAndLockItem(HANDLE thread); // najde polozku pro 'thread' ve fronte a zamkne ji - void UnlockItem(HANDLE thread, BOOL deleteIfUnlocked); // odemkne polozku pro 'thread' ve fronte, pripadne ji smaze - void ClearFinishedThreads(); // vyradi z fronty thready, ktere jiz dobehly - static DWORD WINAPI ThreadBase(void* param); // univerzalni body threadu +protected: // internal unsynchronized methods + BOOL Add(CThreadQueueItem* item); // adds an item to the queue; returns success + BOOL FindAndLockItem(HANDLE thread); // finds the queue item for 'thread' and locks it + void UnlockItem(HANDLE thread, BOOL deleteIfUnlocked); // unlocks the queue item for 'thread', or deletes it + void ClearFinishedThreads(); // removes threads that have already finished from the queue + static DWORD WINAPI ThreadBase(void* param); // universal thread body }; // @@ -115,34 +116,34 @@ class CThread HANDLE Thread; protected: - char Name[101]; // buffer pro jmeno threadu (pouziva se v TRACE a CALL-STACK pro identifikaci threadu) + char Name[101]; // buffer for the thread name (used in TRACE and CALL-STACK to identify the thread) // POZOR: pokud budou data threadu obsahovat odkazy na stack nebo jine docasne objekty, // je potreba zajistit, aby se s temito odkazy pracovalo jen po dobu jejich platnosti public: CThread(const char* name = NULL); - virtual ~CThread() {} // aby se spravne volaly destruktory potomku + virtual ~CThread() {} // so destructors of derived classes are called correctly - // vytvoreni (start) threadu ve fronte threadu 'queue'; 'stack_size' je velikost zasobniku + // creates (starts) a thread in thread queue 'queue'; 'stack_size' is the stack size of the // noveho threadu v bytech (0 = default); vraci handle noveho threadu nebo NULL pri chybe; - // zavreni handlu zajistuje objekt 'queue'; pokud se podari vytvorit thread, je tento objekt - // dealokovan pri ukonceni threadu, pri chybe spousteni je dealokace objektu na volajicim + // the 'queue' object closes the handle; if the thread is created successfully, this object is + // deallocated when the thread exits; if thread startup fails, the caller deallocates the object // POZOR: bez pridani synchronizace muze thread dobehnout jeste pred navratem z Create() -> - // ukazatel "this" je proto po uspesnem volani Create() nutne povazovat za neplatny, - // to same plati pro vraceny handle threadu (pouzivat jen na testy na NULL a pro volani - // metod CThreadQueue: WaitForExit() a KillThread()) - // mozne volat z libovolneho threadu + // therefore, after a successful call to Create(), the "this" pointer must be considered invalid, + // the same applies to the returned thread handle (use it only for NULL checks and for calling + // CThreadQueue methods WaitForExit() and KillThread()) + // can be called from any thread HANDLE Create(CThreadQueue& queue, unsigned stack_size = 0, DWORD* threadID = NULL); - // vraci 'Thread' viz vyse + // returns 'Thread'; see above HANDLE GetHandle() { return Thread; } - // vraci jmeno threadu + // returns the thread name const char* GetName() { return Name; } - // tato metoda obsahuje telo threadu + // this method implements the thread body virtual unsigned Body() = 0; protected: - static unsigned WINAPI UniversalBody(void* param); // pomocna metoda pro spousteni threadu + static unsigned WINAPI UniversalBody(void* param); // helper method for starting threads }; From 7f5d2fa8320a479e7265fc74d03cad9767391a21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:22:16 +0200 Subject: [PATCH 185/710] [translation] Fix src/plugins/shared/dbg.cpp comments (#556) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/plugins/shared/dbg.cpp | 45 +++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/src/plugins/shared/dbg.cpp b/src/plugins/shared/dbg.cpp index 3ab6ad79f..315a9d674 100644 --- a/src/plugins/shared/dbg.cpp +++ b/src/plugins/shared/dbg.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED //**************************************************************************** // @@ -16,8 +17,8 @@ #include #endif // _MSC_VER -// potlaceni warningu C4996: This function or variable may be unsafe. Consider using strcat_s instead. -// duvod: lstrcat a dalsi Windows rutiny prost nejsou safe, takze to nema smysl resit tady +// suppress warning C4996: This function or variable may be unsafe. Consider using strcat_s instead. +// reason: lstrcat and other Windows routines are not safe anyway, so addressing it here is pointless #pragma warning(push) #pragma warning(disable : 4996) @@ -209,8 +210,8 @@ C__Trace::SetInfoW(const WCHAR* file, int line) struct C__TraceMsgBoxThreadData { - char* Msg; // alokovany text hlasky - const char* File; // jen odkaz na staticky string + char* Msg; // allocated message text + const char* File; // only a pointer to a static string int Line; }; @@ -239,8 +240,8 @@ DWORD WINAPI __TraceMsgBoxThread(void* param) struct C__TraceMsgBoxThreadDataW { - WCHAR* Msg; // alokovany text hlasky - const WCHAR* File; // jen odkaz na staticky string + WCHAR* Msg; // allocated message text + const WCHAR* File; // only a pointer to a static string int Line; }; @@ -265,7 +266,7 @@ DWORD WINAPI __TraceMsgBoxThreadW(void* param) void C__Trace::SendMessageToServer(BOOL information, BOOL unicode, BOOL crash) { - // flushnuti do bufferu + // flush to the buffer if (unicode) TraceStrStreamW.flush(); else @@ -307,7 +308,7 @@ void C__Trace::SendMessageToServer(BOOL information, BOOL unicode, BOOL crash) memset(&threadDataW, 0, sizeof(threadDataW)); else memset(&threadData, 0, sizeof(threadData)); - if (crash) // break/padacka po vypisu TRACE error hlasky (TRACE_C a TRACE_MC) + if (crash) // break/crash after displaying the TRACE error message (TRACE_C and TRACE_MC) { if (!msgBoxOpened) { @@ -343,32 +344,32 @@ void C__Trace::SendMessageToServer(BOOL information, BOOL unicode, BOOL crash) } } if (unicode) - TraceStringBufW.erase(); // priprava pro dalsi trace + TraceStringBufW.erase(); // prepare for the next TRACE else TraceStringBuf.erase(); LeaveCriticalSection(&CriticalSection); if (crash) { - if (unicode && threadDataW.Msg != NULL || // break/padacka po vypisu TRACE error hlasky (TRACE_C a TRACE_MC) + if (unicode && threadDataW.Msg != NULL || // break/crash after displaying the TRACE error message (TRACE_C and TRACE_MC) !unicode && threadData.Msg != NULL) { - // vypiseme hlasku v jinem threadu, aby nepumpovala zpravy aktualniho threadu + // display the message in another thread so it does not pump the current thread's messages DWORD id; HANDLE msgBoxThread = CreateThread(NULL, 0, unicode ? __TraceMsgBoxThreadW : __TraceMsgBoxThread, unicode ? (void*)&threadDataW : (void*)&threadData, 0, &id); if (msgBoxThread != NULL) { - WaitForSingleObject(msgBoxThread, INFINITE); // pokud se da TRACE_C do DllMain do DLL_THREAD_ATTACH, dojde k deadlocku - silne nepravdepodobne, neresime + WaitForSingleObject(msgBoxThread, INFINITE); // Using TRACE_C in DllMain for DLL_THREAD_ATTACH deadlocks; this is very unlikely, so we do not handle it CloseHandle(msgBoxThread); } msgBoxOpened = FALSE; GlobalFree(unicode ? (HGLOBAL)threadDataW.Msg : (HGLOBAL)threadData.Msg); - // pad softu vyvolame primo v kodu, kde je umisteny TRACE_C/TRACE_MC, aby - // bylo v bug reportu videt presne kde makra lezi; padacka tedy nasleduje - // po dokonceni teto metody + // trigger the crash directly in the code that contains TRACE_C/TRACE_MC so + // the bug report shows exactly where the macros are; the crash therefore follows + // after this method completes } - else // ostatni thready s TRACE_C zablokujeme, az se zavre msgbox otevreny pro - { // prvni TRACE_C, tak to tam i spadne, at v tom neni bordel + else // block other TRACE_C threads until the message box opened for the + { // first TRACE_C closes; they crash there too to keep things consistent if (msgBoxOpened) { while (1) @@ -394,11 +395,11 @@ void* _sal_safe_memcpy(void* dest, const void* src, size_t count) #endif // defined(TRACE_ENABLE) && !defined(INSIDE_SALAMANDER) -// pasticka na vlastni definici techto "zakazanych" operatoru (aby fungovala kontrola -// zakazanych kombinaci stringu WCHAR / char v TRACE makrech, nesmi byt nasledujici -// operatory definovany v jinych modulech - jinak by linker neohlasil chybu - idea: -// v DEBUG verzi chytame chyby linkeru, v RELEASE verzi chytame chyby vlastni definice -// operatoru) +// trap for custom definitions of these "forbidden" operators (for the check for +// forbidden WCHAR/char string combinations in TRACE macros to work, the following +// operators must not be defined in other modules; otherwise the linker would not report an error. Idea: +// in DEBUG builds we catch linker errors, in RELEASE builds we catch accidental custom +// operator definitions) #if !defined(_DEBUG) && !defined(INSIDE_SALAMANDER) && !defined(__BORLANDC__) #include From 140ee0ce3a174bcb32ded7d0688ad7a1c04ef194 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:22:23 +0200 Subject: [PATCH 186/710] [translation] Fix src/plugins/shared/dbg.h comments (#557) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/plugins/shared/dbg.h | 91 ++++++++++++++++++++-------------------- 1 file changed, 46 insertions(+), 45 deletions(-) diff --git a/src/plugins/shared/dbg.h b/src/plugins/shared/dbg.h index 4b765c595..4bea8e81e 100644 --- a/src/plugins/shared/dbg.h +++ b/src/plugins/shared/dbg.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED //**************************************************************************** // @@ -11,13 +12,13 @@ #pragma once -// definice maker TRACE_I, TRACE_IW, TRACE_E, TRACE_EW, TRACE_C, TRACE_CW a CALL_STACK_MESSAGEXXX pro pluginy, -// v pluginu je treba definovat promennou SalamanderDebug (typ viz nize) a -// v SalamanderPluginEntry tuto promennou inicializovat: +// definitions of the TRACE_I, TRACE_IW, TRACE_E, TRACE_EW, TRACE_C, TRACE_CW, and CALL_STACK_MESSAGEXXX macros for plugins, +// in a plugin you must define the SalamanderDebug variable (type shown below) and +// initialize it in SalamanderPluginEntry: // SalamanderDebug = salamander->GetSalamanderDebug(); // -// TRACE se zapina definici makra TRACE_ENABLE -// CALL-STACK se vypina definici makra CALLSTK_DISABLE +// TRACE is enabled by defining TRACE_ENABLE +// CALL-STACK is disabled by defining CALLSTK_DISABLE // POZOR: TRACE_C se nesmi pouzivat v DllMain knihoven, ani v zadnem kodu, ktery // se z DllMainu vola, jinak dojde k deadlocku, vice viz implementace @@ -28,19 +29,19 @@ // POZOR: nutne zapnout tez pro kazdy plugin zvlast // makro CALLSTK_DISABLEMEASURETIMES - potlaci mereni casu straveneho pri priprave call-stack hlaseni v DEBUG verzi -// prehled typu maker: (vsechna jsou neprazdna jen pokud neni definovano CALLSTK_DISABLE) -// CALL_STACK_MESSAGE - bezne call-stack makro -// SLOW_CALL_STACK_MESSAGE - call-stack makro, u ktereho se ignoruje libovolne zpomaleni kodu (pouziti -// na mistech, kde vime, ze vyrazne zpomaluje kod, ale presto ho na tomto -// miste potrebujeme) -// DEBUG_SLOW_CALL_STACK_MESSAGE - call-stack makro, ktere je v release verzi prazdne, v DEBUG verzi -// se chova jako SLOW_CALL_STACK_MESSAGE (pouziti na mistech, kde jsme -// ochotni ignorovat zpomaleni jen v debug verzi, release verze je rychla) +// overview of macro types: (all are non-empty only if CALLSTK_DISABLE is not defined) +// CALL_STACK_MESSAGE - regular call-stack macro +// SLOW_CALL_STACK_MESSAGE - call-stack macro for places where we ignore any slowdown of the code (use +// at places where we know it slows the code down significantly but still +// need it there) +// DEBUG_SLOW_CALL_STACK_MESSAGE - call-stack macro that is empty in release builds and behaves like +// SLOW_CALL_STACK_MESSAGE in DEBUG builds (use at places where we are +// willing to ignore the slowdown only in debug builds; the release build stays fast) -// globalni promenna s interfacem CSalamanderDebugAbstract +// global variable holding the CSalamanderDebugAbstract interface extern CSalamanderDebugAbstract* SalamanderDebug; -// kopie z spl_com.h: globalni promenna s verzi Salamandera, ve kterem je tento plugin nacteny +// copy from spl_com.h: global variable holding the Salamander version in which this plugin is loaded extern int SalamanderVersion; #ifndef __WFILE__ @@ -146,7 +147,7 @@ class C__StringStreamBuf : public std::streambuf // update pointers setp(ptr, ptr + newsize); - pbump((int)oldsize); // FIXME_X64 - je pretypovani na (int) OK? + pbump((int)oldsize); // FIXME_X64 - is the cast to (int) OK? } // store the character @@ -374,12 +375,12 @@ class CWStr #ifndef TRACE_ENABLE -// aby nedochazelo k problemum se stredniky v nize nadefinovanych makrech +// to avoid problems with semicolons in the macros defined below // Bypasses a clang-format bug in version 19.1.5 (part of Visual Studio 2022 17.14). // clang-format off inline void __TraceEmptyFunction() {} -// clang-format on +// to avoid problems with semicolons in the macros defined below #define TRACE_MI(file, line, str) __TraceEmptyFunction() #define TRACE_MIW(file, line, str) __TraceEmptyFunction() @@ -391,18 +392,18 @@ inline void __TraceEmptyFunction() {} #define TRACE_MEW(file, line, str) __TraceEmptyFunction() #define TRACE_E(str) __TraceEmptyFunction() #define TRACE_EW(str) __TraceEmptyFunction() -// pri crashi softu pres DebugBreak() nejde vystopovat, kde lezi volani -// TRACE_C/TRACE_MC, protoze adresa exceptiony je kdesi v ntdll.dll -// a sekce Stack Back Trace bug reportu muze obsahovat nesmysly, pokud -// funkce volajici TRACE_C/TRACE_MC nepouziva stary jednoduchy model -// ukladani a prace s EBP/ESP, ovsem i v tom pripade je zde jen adresa -// odkud byla tato funkce volana (ne primo adresa TRACE_C/TRACE_MC), -// proto aspon prozatim pouzivame stary primitivni zpusob crashe -// zapisem na NULL -//#define TRACE_MC(file, line, str) DebugBreak() -//#define TRACE_MCW(file, line, str) DebugBreak() -//#define TRACE_C(str) DebugBreak() -//#define TRACE_CW(str) DebugBreak() +// when the application crashes via DebugBreak(), it is impossible to trace where +// TRACE_C/TRACE_MC was called, because the exception address ends up somewhere in ntdll.dll +// and the Stack Back Trace section of the bug report can contain garbage if +// the function calling TRACE_C/TRACE_MC does not use the old simple model +// of storing and working with EBP/ESP; even then only the address +// from which that function was called is available (not the address of TRACE_C/TRACE_MC itself), +// so at least for now we use the old primitive way of crashing +// by writing to NULL +// #define TRACE_MC(file, line, str) DebugBreak() +// #define TRACE_MCW(file, line, str) DebugBreak() +// #define TRACE_C(str) DebugBreak() +// #define TRACE_CW(str) DebugBreak() #define TRACE_MC(file, line, str) (*((int*)NULL) = 0x666) #define TRACE_MCW(file, line, str) (*((int*)NULL) = 0x666) #define TRACE_C(str) (*((int*)NULL) = 0x666) @@ -413,7 +414,7 @@ inline void __TraceEmptyFunction() {} #else // TRACE_ENABLE -// info-trace, manualne zadana pozice v souboru +// info-trace, manually specified file position #define TRACE_MI(file, line, str) \ (::EnterCriticalSection(&__Trace.CriticalSection), __Trace.OStream() << str, \ __Trace) \ @@ -434,7 +435,7 @@ inline void __TraceEmptyFunction() {} #define TRACE_W(str) TRACE_I(str) #define TRACE_WW(str) TRACE_IW(str) -// error-trace, manualne zadana pozice v souboru +// error-trace, manually specified file position #define TRACE_ME(file, line, str) \ (::EnterCriticalSection(&__Trace.CriticalSection), __Trace.OStream() << str, \ __Trace) \ @@ -451,15 +452,15 @@ inline void __TraceEmptyFunction() {} #define TRACE_E(str) TRACE_ME(__FILE__, __LINE__, str) #define TRACE_EW(str) TRACE_MEW(__WFILE__, __LINE__, str) -// fatal-error-trace (CRASHING TRACE), manualne zadana pozice v souboru; -// zastavime soft v debuggeru, pro snadne odladeni problemu, ktery prave vznikl, -// release verze spadne a problem snad bude jasny z call-stacku v bug-reportu; -// nepouzivame DebugBreak(), protoze pri crashi softu nejde vystopovat, kde -// lezi volani DebugBreak(), protoze adresa exceptiony je kdesi v ntdll.dll -// a sekce Stack Back Trace bug reportu muze obsahovat nesmysly, pokud -// funkce, ze ktere volame TRACE_C/MC, nepouziva stary jednoduchy model ukladani -// a prace s EBP/ESP (to zalezi na kompileru a zaplych optimalizacich), proto -// aspon prozatim pouzivame stary primitivni zpusob crashe zapisem na NULL +// fatal-error-trace (CRASHING TRACE), manually specified file position; +// stop the application in the debugger to make the problem that just occurred easy to debug, +// the release build crashes and the problem will hopefully be clear from the call stack in the bug report; +// we do not use DebugBreak(), because when the application crashes it is impossible to trace where +// DebugBreak() was called, because the exception address ends up somewhere in ntdll.dll +// and the Stack Back Trace section of the bug report can contain garbage if +// the function from which we call TRACE_C/MC does not use the old simple model of storing and working with EBP/ESP +// (that depends on the compiler and enabled optimizations), so +// at least for now we use the old primitive way of crashing by writing to NULL #define TRACE_MC(file, line, str) \ ((::EnterCriticalSection(&__Trace.CriticalSection), __Trace.OStream() << str, \ __Trace) \ @@ -489,9 +490,9 @@ class C__Trace CRITICAL_SECTION CriticalSection; protected: - const char* File; // pomocne promenne pro predani jmena souboru (ANSI) - const WCHAR* FileW; // pomocne promenne pro predani jmena souboru (unicode) - int Line; // a cisla radku, odkud se vola TRACE_X() + const char* File; // helper variable for passing the file name (ANSI) + const WCHAR* FileW; // helper variable for passing the file name (Unicode) + int Line; // and the line number from which TRACE_X() is called C__StringStreamBuf TraceStringBuf; // string buffer drzici data trace streamu (ANSI) C__StringStreamBufW TraceStringBufW; // string buffer drzici data trace streamu (unicode) C__TraceStream TraceStrStream; // vlastni trace stream (ANSI) @@ -812,7 +813,7 @@ extern BOOL __CallStk_T; // always TRUE - just to check format string and type o #endif // _DEBUG -// prazdne makro: oznamuje CheckStk, ze u teto funkce si call-stack message neprejeme +// empty macro: tells CheckStk that we do not want a call-stack message for this function #define CALL_STACK_MESSAGE_NONE // From 08570b72e6569d4c515fdfa015e0ad4649099e59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:22:29 +0200 Subject: [PATCH 187/710] [translation] Fix src/plugins/shared/mhandles.cpp comments (#558) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/plugins/shared/mhandles.cpp | 79 ++++++++++++++++++--------------- 1 file changed, 43 insertions(+), 36 deletions(-) diff --git a/src/plugins/shared/mhandles.cpp b/src/plugins/shared/mhandles.cpp index c085db37b..637c5ae70 100644 --- a/src/plugins/shared/mhandles.cpp +++ b/src/plugins/shared/mhandles.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED //**************************************************************************** // @@ -51,15 +52,15 @@ char __ErrorBuffer[__ERROR_BUFFER_SIZE] = ""; const char* __MessagesTitle = "Message"; HWND __MessagesParent = NULL; -// zajisti aktualnimu threadu pristup k funkcim a datum modulu +// Ensures the current thread has access to the module's functions and data. void EnterMessagesModul(); -// volat az aktualni thread nebude potrebovat pristup k funkcim a datum modulu +// Call when the current thread no longer needs access to the module's functions and data. void LeaveMessagesModul(); -/// vraci ukazatel na globalni buffer, ktery naplni retezcem z sprintf +// Returns a pointer to a global buffer containing the sprintf result. const char* spf(const char* formatString, ...); -/// vraci ukazatel na globalni buffer, ktery naplni popisem chyby +// Returns a pointer to a global buffer containing the error description. const char* err(DWORD error); #define MESSAGE(parent, str, buttons) \ @@ -75,22 +76,28 @@ const char* err(DWORD error); .MessageBoxT(__MessagesStringBuf.c_str(), \ __MessagesTitle, (buttons)) -/** zobrazi messagebox se zadanym textem a ikonou chyby, neni v novem - threadu, distribuje message volajiciho threadu */ +/* + * shows a message box with the specified text and error icon, not in a new + * thread, dispatches the calling thread's messages + */ #define MESSAGE_E(parent, str, buttons) \ MESSAGE(parent, str, MB_ICONEXCLAMATION | (buttons)) -/** zobrazi messagebox se zadanym textem a ikonou informaci, v novem threadu, - nerozdistribuje message volajiciho threadu */ +/* + * shows a message box with the specified text and information icon, in a new thread, + * does not dispatch the calling thread's messages + */ #define MESSAGE_TI(str, buttons) \ MESSAGE_T(str, MB_ICONINFORMATION | (buttons)) -/** zobrazi messagebox se zadanym textem a ikonou chyby, v novem threadu, - nerozdistribuje message volajiciho threadu */ +/* + * shows a message box with the specified text and error icon, in a new thread, + * does not dispatch the calling thread's messages + */ #define MESSAGE_TE(str, buttons) \ MESSAGE_T(str, MB_ICONEXCLAMATION | (buttons)) -// kriticka sekce pro cely modul - monitor +// module-wide critical section - used as a monitor CRITICAL_SECTION __MessagesCriticalSection; const char* __MessagesLowMemory = "Insufficient memory."; @@ -131,15 +138,15 @@ struct C__MessageBoxData }; int CALLBACK __MessagesMessageBoxThreadF(C__MessageBoxData* data) -{ // nesmi cekat na odezvu volajiciho threadu, protoze ten nebude reagovat - // proto je parent==NULL -> zadne disablovani oken atd. +{ // must not wait for the calling thread's response, because it will not respond + // therefore parent==NULL -> no window disabling, etc. data->Return = MessageBox(NULL, data->Text, data->Caption, data->Type | MB_SETFOREGROUND); return 0; } int C__Messages::MessageBoxT(LPCTSTR lpText, LPCTSTR lpCaption, UINT uType) { - __Handles.__MessagesStrStream.flush(); // flushnuti do bufferu (v lpText) + __Handles.__MessagesStrStream.flush(); // flush into the buffer (lpText) C__MessageBoxData data; data.Caption = lpCaption; @@ -147,7 +154,7 @@ int C__Messages::MessageBoxT(LPCTSTR lpText, LPCTSTR lpCaption, UINT uType) data.Return = 0; int len = (int)strlen(lpText) + 1; - char* message = (char*)malloc(len); // zaloha textu + char* message = (char*)malloc(len); // backup copy of the text if (message != NULL) { memcpy(message, lpText, len); @@ -155,14 +162,14 @@ int C__Messages::MessageBoxT(LPCTSTR lpText, LPCTSTR lpCaption, UINT uType) } else data.Text = __MessagesLowMemory; - LeaveMessagesModul(); // ted uz muzou zacit blbnout ostatni thready + message loopy + LeaveMessagesModul(); // other threads and message loops can start interfering now - // MessageBox nahodime v novem threadu, aby nerozeslal message tohoto threadu + // Run MessageBox in a new thread so it does not dispatch this thread's messages DWORD threadID; HANDLE thread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)__MessagesMessageBoxThreadF, &data, 0, &threadID); if (thread != NULL) { - WaitForSingleObject(thread, INFINITE); // pockame az ho user odmackne + WaitForSingleObject(thread, INFINITE); // wait until the user dismisses it CloseHandle(thread); } // else TRACE_E("Unable to show MessageBox: " << data.Caption << ": " << data.Text); @@ -170,23 +177,23 @@ int C__Messages::MessageBoxT(LPCTSTR lpText, LPCTSTR lpCaption, UINT uType) if (message != NULL) free(message); - __MessagesStringBuf.erase(); // priprava pro dalsi message + __MessagesStringBuf.erase(); // prepare for the next message return data.Return; } int C__Messages::MessageBox(HWND hWnd, LPCTSTR lpText, LPCTSTR lpCaption, UINT uType) { - __Handles.__MessagesStrStream.flush(); // flushnuti do bufferu (v lpText) + __Handles.__MessagesStrStream.flush(); // flush into the buffer (lpText) int len = (int)strlen(lpText) + 1; - char* message = (char*)malloc(len); // zaloha textu + char* message = (char*)malloc(len); // backup copy of the text char* txt = message; if (txt != NULL) memcpy(txt, lpText, len); else txt = (char*)__MessagesLowMemory; - LeaveMessagesModul(); // ted uz muzou zacit blbnout ostatni thready + message loopy + LeaveMessagesModul(); // other threads and message loops can start interfering now if (!IsWindow(hWnd)) hWnd = NULL; @@ -195,7 +202,7 @@ int C__Messages::MessageBox(HWND hWnd, LPCTSTR lpText, LPCTSTR lpCaption, UINT u if (message != NULL) free(message); - __MessagesStringBuf.erase(); // priprava pro dalsi message + __MessagesStringBuf.erase(); // prepare for the next message return ret; } @@ -678,7 +685,7 @@ C__Handles::C__Handles() : __MessagesStrStream(&__MessagesStringBuf), __Messages C__Handles::~C__Handles() { - // vyrazeni handlu, ktere se uvolnuji automaticky + // remove handles that are released automatically for (int i = Handles.Count - 1; i >= 0; i--) { if (Handles[i].Handle.Origin == __hoLoadAccelerators) @@ -688,7 +695,7 @@ C__Handles::~C__Handles() else if (Handles[i].Handle.Origin == __hoGetStockObject) Handles.Delete(i); } - // kontrola + vypis zbylych + // check and list remaining handles if (Handles.Count != 0) { if (MESSAGE_E(NULL, "Some monitored handles remained opened.\n" @@ -735,7 +742,7 @@ C__Handles::SetInfo(const char* file, int line, C__HandlesOutputType outputType) ::EnterCriticalSection(&CriticalSection); if (CriticalSection.RecursionCount > 1) { - DebugBreak(); // rekurzivni volani handles !!! zase nejaka maskovana message-loopa - viz call-stack + DebugBreak(); // Recursive HANDLES call - another hidden message loop, see call stack } OutputType = outputType; TemporaryHandle.File = file; @@ -838,7 +845,7 @@ BOOL C__Handles::DeleteHandle(C__HandlesType& type, HANDLE handle, { C__HandlesOrigin org = Handles[i].Handle.Origin; if (org != __hoLoadAccelerators && org != __hoLoadIcon && - org != __hoGetStockObject) // nejde o handle, ktery nemusi byt uvolneny (prioritne uvolnujeme handly, ktere se musi uvolnit) + org != __hoGetStockObject) // not a handle exempt from release (we prioritize handles that must be released) { if (origin != NULL) *origin = org; @@ -853,7 +860,7 @@ BOOL C__Handles::DeleteHandle(C__HandlesType& type, HANDLE handle, } } } - if (foundTypeOK != -1) // nalezen jen handle, ktery nemusi byt uvolneny + if (foundTypeOK != -1) // found only a handle exempt from release { type = Handles[foundTypeOK].Handle.Type; if (origin != NULL) @@ -861,7 +868,7 @@ BOOL C__Handles::DeleteHandle(C__HandlesType& type, HANDLE handle, Handles.Delete(foundTypeOK); return TRUE; } - if (found != -1) // nalezen jen handle se shodnym cislem + if (found != -1) // found only a handle with the same numeric value { #if defined(_DEBUG) || defined(__HANDLES_DEBUG) if (CanUseTrace) @@ -1009,7 +1016,7 @@ C__Handles::CreateFile(LPCTSTR lpFileName, DWORD dwDesiredAccess, dwFlagsAndAttributes, hTemplateFile); char paramsBuf[MAX_PATH + 200]; const char* params = NULL; - if (ret == INVALID_HANDLE_VALUE) // parameters to buffer only when error occurs (can be displayed) + if (ret == INVALID_HANDLE_VALUE) // format parameters into the buffer only on error (for display) { #ifdef __BORLANDC__ _snprintf(paramsBuf, MAX_PATH + 200, @@ -1101,7 +1108,7 @@ HDC C__Handles::BeginPaint(HWND hwnd, LPPAINTSTRUCT lpPaint) C__HandlesData tmpTemporaryHandle = TemporaryHandle; ::LeaveCriticalSection(&CriticalSection); - HDC ret = ::BeginPaint(hwnd, lpPaint); // obsahuje message-loopu + HDC ret = ::BeginPaint(hwnd, lpPaint); // contains a message loop ::EnterCriticalSection(&CriticalSection); OutputType = tmpOutputType; @@ -2135,7 +2142,7 @@ BOOL C__Handles::FreeLibrary(HMODULE hLibModule) C__HandlesData tmpTemporaryHandle = TemporaryHandle; ::LeaveCriticalSection(&CriticalSection); - BOOL ret = ::FreeLibrary(hLibModule); // obsahuje volani destruktoru globalek DLLka, muze obsahovat message-loopu + BOOL ret = ::FreeLibrary(hLibModule); // calls DLL global destructors, may contain a message loop ::EnterCriticalSection(&CriticalSection); OutputType = tmpOutputType; @@ -2151,7 +2158,7 @@ VOID C__Handles::FreeLibraryAndExitThread(HMODULE hLibModule, DWORD dwExitCode) C__HandlesData tmpTemporaryHandle = TemporaryHandle; ::LeaveCriticalSection(&CriticalSection); - ::FreeLibraryAndExitThread(hLibModule, dwExitCode); // obsahuje volani destruktoru globalek DLLka, muze obsahovat message-loopu + ::FreeLibraryAndExitThread(hLibModule, dwExitCode); // calls DLL global destructors, may contain a message loop ::EnterCriticalSection(&CriticalSection); OutputType = tmpOutputType; @@ -2231,7 +2238,7 @@ BOOL C__Handles::FindCloseChangeNotification(HANDLE hChangeHandle) C__HandlesData tmpTemporaryHandle = TemporaryHandle; ::LeaveCriticalSection(&CriticalSection); - BOOL ret = ::FindCloseChangeNotification(hChangeHandle); // muze se kousnout i na dost dlouho + BOOL ret = ::FindCloseChangeNotification(hChangeHandle); // can hang for quite a long time ::EnterCriticalSection(&CriticalSection); OutputType = tmpOutputType; @@ -2386,7 +2393,7 @@ HDWP C__Handles::DeferWindowPos(HDWP hWinPosInfo, HWND hWnd, HWND hWndInsertAfte { HDWP ret = ::DeferWindowPos(hWinPosInfo, hWnd, hWndInsertAfter, x, y, cx, cy, uFlags); - if (ret != hWinPosInfo) // doslo k realokaci struktury - musime zmenit hodnotu hlidaneho handlu + if (ret != hWinPosInfo) // the structure was reallocated - we must update the monitored handle value { CheckClose(TRUE, (HANDLE)hWinPosInfo, __htDeferWindowPos, __GetHandlesOrigin(__hoDeferWindowPos), ERROR_SUCCESS, FALSE); CheckCreate(ret != NULL, __htDeferWindowPos, __hoDeferWindowPos, (HANDLE)ret, GetLastError()); @@ -2404,7 +2411,7 @@ BOOL C__Handles::EndDeferWindowPos(HDWP hWinPosInfo) C__HandlesData tmpTemporaryHandle = TemporaryHandle; ::LeaveCriticalSection(&CriticalSection); - BOOL ret = ::EndDeferWindowPos(hWinPosInfo); // obsahuje message-loopu + BOOL ret = ::EndDeferWindowPos(hWinPosInfo); // contains a message loop ::EnterCriticalSection(&CriticalSection); OutputType = tmpOutputType; From 0f905b88da1cfe776c72c97edd4d6d54f45b9fa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:22:36 +0200 Subject: [PATCH 188/710] [translation] Fix src/plugins/shared/mhandles.h comments (#559) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/plugins/shared/mhandles.h | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/plugins/shared/mhandles.h b/src/plugins/shared/mhandles.h index 6da0b68f0..380192c4e 100644 --- a/src/plugins/shared/mhandles.h +++ b/src/plugins/shared/mhandles.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED //**************************************************************************** // @@ -11,19 +12,19 @@ #pragma once -// makro MHANDLES_ENABLE - zapina monitorovani handlu +// MHANDLES_ENABLE macro - enables handle monitoring // POZOR: volat HANDLES_CAN_USE_TRACE() tesne po inicializaci "dbg.h" modulu -// (po inicializaci SalamanderDebug a SalamanderVersion) -// POZOR: MHANDLES se inicializuji/rusi na urovni "lib", pokud tedy plugin -// uroven "lib" (nebo "compiler") pouziva, musi si sam zajistit, ze na -// techto urovnich nebude pouzivat MHANDLES (viz #pragma init_seg (lib)) +// (after SalamanderDebug and SalamanderVersion are initialized) +// WARNING: MHANDLES are initialized/destroyed at the "lib" level; if a plugin +// uses the "lib" (or "compiler") level, it must ensure that it does not +// use MHANDLES at those levels (see #pragma init_seg (lib)) // POZNAMKA: pro snazsi rozmisteni maker HANDLES() a HANDLES_Q() pouzijte program CheckHnd.exe #define NOHANDLES(function) function #ifndef MHANDLES_ENABLE -// aby nedochazelo k problemum se stredniky v nize nadefinovanych makrech +// to avoid semicolon problems in the macros defined below inline void __HandlesEmptyFunction() {} #define HANDLES_CAN_USE_TRACE() __HandlesEmptyFunction() @@ -54,8 +55,8 @@ enum C__HandlesOutputType enum C__HandlesType { - __htHandle_comp_with_CloseHandle, // handle kompatibilni s CloseHandle() a DuplicateHandle() - __htHandle_comp_with_DeleteObject, // handle kompatibilni s DeleteObject() a GetStockObject() + __htHandle_comp_with_CloseHandle, // handle compatible with CloseHandle() and DuplicateHandle() + __htHandle_comp_with_DeleteObject, // handle compatible with DeleteObject() and GetStockObject() __htKey, __htIcon, __htGlobal, @@ -220,7 +221,7 @@ struct C__HandlesHandle { C__HandlesType Type; C__HandlesOrigin Origin; - HANDLE Handle; // univerzalni, pro vsechny druhy handlu + HANDLE Handle; // generic, for all handle types C__HandlesHandle() {} @@ -284,16 +285,16 @@ typedef unsigned int uintptr_t; class C__Handles { public: - // objekty pro praci s messageboxy, zde je jen pro zaruceni poradi konstrukce/destrukce + // message box helper objects; this one is here only to guarantee construction/destruction order std::ostream __MessagesStrStream; C__Messages __Messages; protected: - C_HandlesDataArray Handles; // vsechny kontrolovane handly - C__HandlesData TemporaryHandle; // pri vkladani nastaven z SetInfo() - C__HandlesOutputType OutputType; // typ vystupu hlasek - CRITICAL_SECTION CriticalSection; // pro synchronizaci multi-threadu - BOOL CanUseTrace; // TRUE az po inicializaci "dbg.h" modulu, az bude mozne pouzivat TRACE_ makra + C_HandlesDataArray Handles; // all monitored handles + C__HandlesData TemporaryHandle; // used during insertion, set by SetInfo() + C__HandlesOutputType OutputType; // message output type + CRITICAL_SECTION CriticalSection; // for multi-thread synchronization + BOOL CanUseTrace; // TRUE only after the "dbg.h" module is initialized and TRACE_ macros can be used public: C__Handles(); @@ -677,9 +678,9 @@ class C__Handles BOOL OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle); protected: - void AddHandle(C__HandlesHandle handle); // prida TemporaryHandle + void AddHandle(C__HandlesHandle handle); // adds TemporaryHandle - // vyjme handle, pri uspechu vraci TRUE + // removes the handle, returns TRUE on success BOOL DeleteHandle(C__HandlesType& type, HANDLE handle, C__HandlesOrigin* origin, C__HandlesType expType); From 4aa939abbd291699bb9b4532812256d9ddfaa790 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:22:43 +0200 Subject: [PATCH 189/710] [translation] Fix src/plugins/shared/spl_arc.h comments (#560) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/plugins/shared/spl_arc.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/shared/spl_arc.h b/src/plugins/shared/spl_arc.h index ba32af36f..84aa568fd 100644 --- a/src/plugins/shared/spl_arc.h +++ b/src/plugins/shared/spl_arc.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED //**************************************************************************** // @@ -12,7 +13,7 @@ #pragma once #ifdef _MSC_VER -#pragma pack(push, enter_include_spl_arc) // aby byly struktury nezavisle na nastavenem zarovnavani +#pragma pack(push, enter_include_spl_arc) // to make the structures independent of the current alignment setting #pragma pack(4) #endif // _MSC_VER #ifdef __BORLANDC__ @@ -31,7 +32,7 @@ class CPluginDataInterfaceAbstract; class CPluginInterfaceForArchiverAbstract { #ifdef INSIDE_SALAMANDER -private: // ochrana proti nespravnemu primemu volani metod (viz CPluginInterfaceForArchiverEncapsulation) +private: // guards against incorrect direct method calls (see CPluginInterfaceForArchiverEncapsulation) friend class CPluginInterfaceForArchiverEncapsulation; #else // INSIDE_SALAMANDER public: From ce9bc7cc7b1be0d235c09a305356f90aea7a93cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:22:50 +0200 Subject: [PATCH 190/710] [translation] Fix src/plugins/shared/spl_base.h comments (#561) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/plugins/shared/spl_base.h | 489 +++++++++++++++++----------------- 1 file changed, 245 insertions(+), 244 deletions(-) diff --git a/src/plugins/shared/spl_base.h b/src/plugins/shared/spl_base.h index 62c945808..8dcf95c0d 100644 --- a/src/plugins/shared/spl_base.h +++ b/src/plugins/shared/spl_base.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED //**************************************************************************** // @@ -12,7 +13,7 @@ #pragma once #ifdef _MSC_VER -#pragma pack(push, enter_include_spl_base) // aby byly struktury nezavisle na nastavenem zarovnavani +#pragma pack(push, enter_include_spl_base) // so that structures are independent of the current alignment setting #pragma pack(4) #pragma warning(3 : 4706) // warning C4706: assignment within conditional expression #endif // _MSC_VER @@ -20,7 +21,7 @@ #pragma option -a4 #endif // __BORLANDC__ -// v debug verzi budeme testovat, jestli se neprekryvaji zdrojova a cilova pamet (pro memcpy se nesmi prekryvat) +// in the debug build we test whether the source and destination memory overlap (they must not overlap for memcpy) #if defined(_DEBUG) && defined(TRACE_ENABLE) #define memcpy _sal_safe_memcpy #ifdef __cplusplus @@ -33,11 +34,11 @@ extern "C" #endif #endif // defined(_DEBUG) && defined(TRACE_ENABLE) -// nasledujici funkce nepadaji pri praci s neplatnou pameti (ani pri praci s NULL): -// lstrcpy, lstrcpyn, lstrlen a lstrcat (ty jsou definovane s priponou A nebo W, proto -// je primo neredefinujeme), v zajmu snazsiho odladeni chyb potrebujeme, aby padaly, -// protoze jinak se na chybu prijde pozdeji v miste, kde uz nemusi byt jasne, co ji -// zpusobilo +// The following functions do not crash when working with invalid memory (or even with NULL): +// lstrcpy, lstrcpyn, lstrlen, and lstrcat (they are defined with the A or W suffix, so +// we do not redefine them directly). For easier debugging we need them to crash, +// because otherwise the error is discovered later, at a place where it may no longer be clear what +// caused it #define lstrcpyA _sal_lstrcpyA #define lstrcpyW _sal_lstrcpyW #define lstrcpynA _sal_lstrcpynA @@ -62,7 +63,7 @@ extern "C" } #endif -// puvodni SDK, ktere bylo soucasti VC6 melo hodnotu definovanou jako 0x00000040 (rok 1998, kdy se atribut jeste nepouzival, nastoupil az s W2K) +// the original SDK that shipped with VC6 had this value defined as 0x00000040 (year 1998, when the attribute was not yet used; it only arrived with W2K) #if (FILE_ATTRIBUTE_ENCRYPTED != 0x00004000) #pragma message(__FILE__ " ERROR: FILE_ATTRIBUTE_ENCRYPTED != 0x00004000. You have to install latest version of Microsoft SDK. This value has changed!") #endif @@ -92,11 +93,11 @@ class CGUIIconListAbstract; #if (defined(_DEBUG) || defined(CALLSTK_MEASURETIMES)) && !defined(CALLSTK_DISABLEMEASURETIMES) struct CCallStackMsgContext { - DWORD PushesCounterStart; // start-stav pocitadla Pushu volanych v tomto threadu - LARGE_INTEGER PushPerfTimeCounterStart; // start-stav pocitadla casu straveneho v metodach Push volanych v tomto threadu - LARGE_INTEGER IgnoredPushPerfTimeCounterStart; // start-stav pocitadla casu straveneho v nemerenych (ignorovanych) metodach Push volanych v tomto threadu - LARGE_INTEGER StartTime; // "cas" Pushe tohoto call-stack makra - DWORD_PTR PushCallerAddress; // adresa makra CALL_STACK_MESSAGE (adresa Pushnuti) + DWORD PushesCounterStart; // initial state of the Push counter for calls made in this thread + LARGE_INTEGER PushPerfTimeCounterStart; // initial state of the time counter for time spent in Push methods called in this thread + LARGE_INTEGER IgnoredPushPerfTimeCounterStart; // initial state of the time counter for time spent in unmeasured (ignored) Push methods called in this thread + LARGE_INTEGER StartTime; // the "time" of the Push in this call-stack macro + DWORD_PTR PushCallerAddress; // address of the CALL_STACK_MESSAGE macro (address of the Push) }; #else // (defined(_DEBUG) || defined(CALLSTK_MEASURETIMES)) && !defined(CALLSTK_DISABLEMEASURETIMES) struct CCallStackMsgContext; @@ -105,16 +106,16 @@ struct CCallStackMsgContext; class CSalamanderDebugAbstract { public: - // vypise 'file'+'line'+'str' TRACE_I na TRACE SERVER - pouze pri DEBUG/SDK/PB verzi Salamandera + // writes 'file'+'line'+'str' as TRACE_I to the TRACE SERVER - only in the DEBUG/SDK/PB build of Salamander virtual void WINAPI TraceI(const char* file, int line, const char* str) = 0; virtual void WINAPI TraceIW(const WCHAR* file, int line, const WCHAR* str) = 0; - // vypise 'file'+'line'+'str' TRACE_E na TRACE SERVER - pouze pri DEBUG/SDK/PB verzi Salamandera + // writes 'file'+'line'+'str' as TRACE_E to the TRACE SERVER - only in the DEBUG/SDK/PB build of Salamander virtual void WINAPI TraceE(const char* file, int line, const char* str) = 0; virtual void WINAPI TraceEW(const WCHAR* file, int line, const WCHAR* str) = 0; - // zaregistruje novy thread u TRACE (prideli Unique ID), 'thread'+'tid' vraci - // _beginthreadex i CreateThread, nepovine (UID je pak -1) + // registers a new thread with TRACE (assigns a Unique ID); 'thread'+'tid' are returned by + // _beginthreadex and CreateThread; optional (UID is then -1) virtual void WINAPI TraceAttachThread(HANDLE thread, unsigned tid) = 0; // nastavi jmeno aktivniho threadu pro TRACE, nepovine (thread je oznacen jako "unknown") @@ -122,10 +123,10 @@ class CSalamanderDebugAbstract virtual void WINAPI TraceSetThreadName(const char* name) = 0; virtual void WINAPI TraceSetThreadNameW(const WCHAR* name) = 0; - // zavede do threadu veci potrebne pro CALL-STACK metody (viz Push a Pop nize), - // ve vsech volanych metodach pluginu je mozne CALL_STACK metody pouzit primo, - // tato metoda se pouziva pouze pro nove thready pluginu, - // spousti funkci 'threadBody' s parametrem 'param', vraci vysledek funkce 'threadBody' + // initializes the thread with the things needed for CALL-STACK methods (see Push and Pop below); + // in all called plugin methods, CALL_STACK methods can then be used directly; + // this method is used only for new plugin threads; + // it runs 'threadBody' with the 'param' parameter and returns the result of 'threadBody' virtual unsigned WINAPI CallWithCallStack(unsigned(WINAPI* threadBody)(void*), void* param) = 0; // uklada na CALL-STACK zpravu ('format'+'args' viz vsprintf), pri padu aplikace je @@ -136,23 +137,23 @@ class CSalamanderDebugAbstract // odstranuje z CALL-STACKU posledni zpravu, volani musi parovat s Push virtual void WINAPI Pop(CCallStackMsgContext* callStackMsgContext) = 0; - // nastavi jmeno aktivniho threadu pro VC debugger + // sets the active thread name for the VC debugger virtual void WINAPI SetThreadNameInVC(const char* name) = 0; - // vola TraceSetThreadName a SetThreadNameInVC pro 'name' (popis viz tyto dve metody) + // calls TraceSetThreadName and SetThreadNameInVC for 'name' (see those two methods for details) virtual void WINAPI SetThreadNameInVCAndTrace(const char* name) = 0; - // Pokud jiz nejsme pripojeni na Trace Server, zkusi navazat spojeni (server - // musi bezet). Jen SDK verze Salamandera (i Preview Buildy): pokud je povoleny - // autostart serveru a server nebezi (napr. ho uzivatel ukoncil), zkusi ho pred - // pripojenim nastartovat. + // If we are not already connected to the Trace Server, it tries to connect (the server + // must be running). In the SDK version of Salamander only (including Preview Builds): if server + // autostart is enabled and the server is not running (e.g. the user has already terminated it), it tries to start it before + // connecting. virtual void WINAPI TraceConnectToServer() = 0; - // vola se pro moduly, ve kterych se muzou hlasit memory leaky, pokud se detekuji memory leaky, - // dojde k loadu "as image" (bez initu modulu) vsech takto registrovanych modulu (pri kontrole - // memory leaku uz jsou tyto moduly unloadle), a pak teprve k vypisu memory leaku = jsou videt - // jmena .cpp modulu misto "#File Error#" - // mozne volat z libovolneho threadu + // used for modules that may report memory leaks; if memory leaks are detected, + // all modules registered this way are loaded "as image" (without module initialization) during the leak check + // (by then these modules are already unloaded), and only then are the memory leaks reported, so the + // .cpp module names are visible instead of "#File Error#" + // may be called from any thread virtual void WINAPI AddModuleWithPossibleMemoryLeaks(const char* fileName) = 0; }; @@ -167,35 +168,35 @@ class CSalamanderDebugAbstract class CSalamanderRegistryAbstract { public: - // vycisti klic 'key' od vsech podklicu a hodnot, vraci uspech + // clears all subkeys and values from the 'key' key; returns success virtual BOOL WINAPI ClearKey(HKEY key) = 0; - // vytvori nebo otevre existujici podklic 'name' klice 'key', vraci 'createdKey' a uspech; - // ziskany klic ('createdKey') je nutne zavrit volanim CloseKey + // creates or opens the existing subkey 'name' of the 'key' key, returns 'createdKey' and success; + // the obtained key ('createdKey') must be closed by calling CloseKey virtual BOOL WINAPI CreateKey(HKEY key, const char* name, HKEY& createdKey) = 0; - // otevre existujici podklic 'name' klice 'key', vraci 'openedKey' a uspech - // ziskany klic ('openedKey') je nutne zavrit volanim CloseKey + // opens the existing subkey 'name' of the 'key' key, returns 'openedKey' and success + // the obtained key ('openedKey') must be closed by calling CloseKey virtual BOOL WINAPI OpenKey(HKEY key, const char* name, HKEY& openedKey) = 0; - // zavre klic otevreny pres OpenKey nebo CreateKey + // closes the key opened via OpenKey or CreateKey virtual void WINAPI CloseKey(HKEY key) = 0; - // smaze podklic 'name' klice 'key', vraci uspech + // deletes the 'name' subkey of the 'key' key; returns success virtual BOOL WINAPI DeleteKey(HKEY key, const char* name) = 0; - // nacte hodnotu 'name'+'type'+'buffer'+'bufferSize' z klice 'key', vraci uspech + // reads the 'name'+'type'+'buffer'+'bufferSize' value from the 'key' key; returns success virtual BOOL WINAPI GetValue(HKEY key, const char* name, DWORD type, void* buffer, DWORD bufferSize) = 0; - // ulozi hodnotu 'name'+'type'+'data'+'dataSize' do klice 'key', pro retezce je mozne - // zadat 'dataSize' == -1 -> vypocet delky retezce pomoci funkce strlen, - // vraci uspech + // stores the 'name'+'type'+'data'+'dataSize' value in the 'key' key; for strings you can + // specify 'dataSize' == -1 to calculate the string length with strlen; + // returns success virtual BOOL WINAPI SetValue(HKEY key, const char* name, DWORD type, const void* data, DWORD dataSize) = 0; - // smaze hodnotu 'name' klice 'key', vraci uspech + // deletes the 'name' value from the 'key' key; returns success virtual BOOL WINAPI DeleteValue(HKEY key, const char* name) = 0; - // vytahne do 'bufferSize' potrebnou velikost pro hodnotu 'name'+'type' z klice 'key', vraci uspech + // retrieves into 'bufferSize' the size required for the 'name'+'type' value from the 'key' key; returns success virtual BOOL WINAPI GetSize(HKEY key, const char* name, DWORD type, DWORD& bufferSize) = 0; }; @@ -206,35 +207,35 @@ class CSalamanderRegistryAbstract // sada metod Salamandera pro navazani pluginu do Salamandera // (custom pack/unpack + panel archiver view/edit + file viewer + menu-items) -// konstanty pro CSalamanderConnectAbstract::AddMenuItem -#define MENU_EVENT_TRUE 0x0001 // nastane vzdy -#define MENU_EVENT_DISK 0x0002 // zdroj je windows adresar ("c:\path" nebo UNC) -#define MENU_EVENT_THIS_PLUGIN_ARCH 0x0004 // zdroj je archiv tohoto pluginu -#define MENU_EVENT_THIS_PLUGIN_FS 0x0008 // zdroj je file-system tohoto pluginu -#define MENU_EVENT_FILE_FOCUSED 0x0010 // focus je na souboru -#define MENU_EVENT_DIR_FOCUSED 0x0020 // focus je na adresari -#define MENU_EVENT_UPDIR_FOCUSED 0x0040 // focus je na ".." -#define MENU_EVENT_FILES_SELECTED 0x0080 // jsou oznaceny soubory -#define MENU_EVENT_DIRS_SELECTED 0x0100 // jsou oznaceny adresare -#define MENU_EVENT_TARGET_DISK 0x0200 // cil je windows adresar ("c:\path" nebo UNC) -#define MENU_EVENT_TARGET_THIS_PLUGIN_ARCH 0x0400 // cil je archiv tohoto pluginu -#define MENU_EVENT_TARGET_THIS_PLUGIN_FS 0x0800 // cil je file-system tohoto pluginu -#define MENU_EVENT_SUBDIR 0x1000 // adresar neni root (obsahuje "..") -// fokus je na souboru, pro ktery tento plugin zajistuje "panel archiver view" nebo "panel archiver edit" +// constants for CSalamanderConnectAbstract::AddMenuItem +#define MENU_EVENT_TRUE 0x0001 // always occurs +#define MENU_EVENT_DISK 0x0002 // source is a Windows directory ("c:\path" or UNC) +#define MENU_EVENT_THIS_PLUGIN_ARCH 0x0004 // source is this plugin's archive +#define MENU_EVENT_THIS_PLUGIN_FS 0x0008 // source is this plugin's file system +#define MENU_EVENT_FILE_FOCUSED 0x0010 // focus is on a file +#define MENU_EVENT_DIR_FOCUSED 0x0020 // focus is on a directory +#define MENU_EVENT_UPDIR_FOCUSED 0x0040 // focus is on ".." +#define MENU_EVENT_FILES_SELECTED 0x0080 // files are selected +#define MENU_EVENT_DIRS_SELECTED 0x0100 // directories are selected +#define MENU_EVENT_TARGET_DISK 0x0200 // target is a Windows directory ("c:\path" or UNC) +#define MENU_EVENT_TARGET_THIS_PLUGIN_ARCH 0x0400 // target is this plugin's archive +#define MENU_EVENT_TARGET_THIS_PLUGIN_FS 0x0800 // target is this plugin's file system +#define MENU_EVENT_SUBDIR 0x1000 // the directory is not the root (contains "..") +// focus is on a file for which this plugin provides "panel archiver view" or "panel archiver edit" #define MENU_EVENT_ARCHIVE_FOCUSED 0x2000 -// uz je k dispozici jen 0x4000 (masky se skladaji obe do DWORDu a predtim se maskuji 0x7FFF) +// only 0x4000 is still available (both masks are stored in a DWORD and masked with 0x7FFF beforehand) -// urcuje pro ktereho uzivatele je polozka urcena -#define MENU_SKILLLEVEL_BEGINNER 0x0001 // urceno pro nejdulezitejsi polozky menu, urcene pro zacatecniky -#define MENU_SKILLLEVEL_INTERMEDIATE 0x0002 // nastavovat i mene frekventovanym prikazum; pro pokrocilejsi uzivatele -#define MENU_SKILLLEVEL_ADVANCED 0x0004 // nastavovat vsem prikazum (profici by meli mit v menu vse) -#define MENU_SKILLLEVEL_ALL 0x0007 // pomocna konstanta slucujici vsechny predesle +// specifies which type of user the item is intended for +#define MENU_SKILLLEVEL_BEGINNER 0x0001 // intended for the most important menu items, for beginners +#define MENU_SKILLLEVEL_INTERMEDIATE 0x0002 // assign also to less frequently used commands; for intermediate users +#define MENU_SKILLLEVEL_ADVANCED 0x0004 // assign to all commands (power users should have everything in the menu) +#define MENU_SKILLLEVEL_ALL 0x0007 // helper constant combining all previous ones -// makro pro pripravu 'HotKey' pro AddMenuItem() -// LOWORD - hot key (virtual key + modifikatory) (LOBYTE - virtual key, HIBYTE - modifikatory) -// mods: kombinace HOTKEYF_CONTROL, HOTKEYF_SHIFT, HOTKEYF_ALT +// macro for preparing 'HotKey' for AddMenuItem() +// LOWORD - hot key (virtual key + modifiers) (LOBYTE - virtual key, HIBYTE - modifiers) +// mods: combination of HOTKEYF_CONTROL, HOTKEYF_SHIFT, HOTKEYF_ALT // examples: SALHOTKEY('A', HOTKEYF_CONTROL | HOTKEYF_SHIFT), SALHOTKEY(VK_F1, HOTKEYF_CONTROL | HOTKEYF_ALT | HOTKEYF_EXT) -//#define SALHOTKEY(vk,mods,cst) ((DWORD)(((BYTE)(vk)|((WORD)((BYTE)(mods))<<8))|(((DWORD)(BYTE)(cst))<<16))) +// #define SALHOTKEY(vk,mods,cst) ((DWORD)(((BYTE)(vk)|((WORD)((BYTE)(mods))<<8))|(((DWORD)(BYTE)(cst))<<16))) #define SALHOTKEY(vk, mods) ((DWORD)(((BYTE)(vk) | ((WORD)((BYTE)(mods)) << 8)))) // makro pro pripravu 'hotKey' pro AddMenuItem() @@ -247,89 +248,89 @@ class CSalamanderRegistryAbstract class CSalamanderConnectAbstract { public: - // pridani pluginu do seznamu pro "custom archiver pack", - // 'title' je nazev custom packeru pro uzivatele, 'defaultExtension' je standardni pripona - // pro nove archivy, pokud nejde o upgrade "custom pack" (nebo pridani celeho pluginu) a + // adds the plugin to the list for "custom archiver pack", + // 'title' is the user-visible name of the custom packer, 'defaultExtension' is the default extension + // for new archives; if this is not an upgrade of "custom pack" (or the addition of the whole plugin) and // 'update' je FALSE, je volani ignorovano; je-li 'update' TRUE, prepise se nastaveni na // nove hodnoty 'title' a 'defaultExtension' - nutna prevence proti opakovanemu 'update'==TRUE - // (neustalemu prepisovani nastaveni) + // (to avoid continually overwriting the settings) virtual void WINAPI AddCustomPacker(const char* title, const char* defaultExtension, BOOL update) = 0; - // pridani pluginu do seznamu pro "custom archiver unpack", - // 'title' je nazev custom unpackeru pro uzivatele, 'masks' jsou masky souboru archivu (hleda - // se podle nich cim rozpakovavat dany archiv, oddelovac je ';' (escape sekvence pro ';' je - // ";;") a pouzivaji se klasicky wildcards '*' a '?' plus '#' pro '0'..'9'), pokud nejde o upgrade + // adds the plugin to the list for "custom archiver unpack", + // 'title' is the user-visible name of the custom unpacker, 'masks' are archive-file masks (used to determine + // which unpacker should unpack a given archive; the separator is ';' (the escape sequence for ';' is + // ";;") and the usual '*' and '?' wildcards are used, plus '#' for '0'..'9'); if this is not an upgrade // "custom unpack" (nebo pridani celeho pluginu) a 'update' je FALSE je volani ignorovano; - // je-li 'update' TRUE, prepise se nastaveni na nove hodnoty 'title' a 'masks' - nutna prevence + // if 'update' is TRUE, the settings are overwritten with the new 'title' and 'masks' values - repeated // proti opakovanemu 'update'==TRUE (neustalemu prepisovani nastaveni) virtual void WINAPI AddCustomUnpacker(const char* title, const char* masks, BOOL update) = 0; - // pridani pluginu do seznamu pro "panel archiver view/edit", - // 'extensions' jsou pripony archivu, ktere se timto pluginem maji zpracovavat - // (oddelovac je ';' (zde nema ';' zadnou escape sekvenci) a pouziva se wildcard '#' pro + // adds the plugin to the list for "panel archiver view/edit", + // 'extensions' are the archive extensions handled by this plugin + // (the separator is ';' (';' has no escape sequence here) and the wildcard '#' is used for // '0'..'9'), pokud je 'edit' TRUE, resi tento plugin "panel archiver view/edit", jinak jen - // "panel archiver view", pokud nejde o upgrade "panel archiver view/edit" (nebo pridani + // "panel archiver view"; if this is not an upgrade of "panel archiver view/edit" (or the addition // celeho pluginu) a 'updateExts' je FALSE je volani ignorovano; je-li 'updateExts' TRUE, - // jde o pridani novych pripon archivu (zajisteni pritomnosti vsech pripon z 'extensions') - nutna + // new archive extensions are added (ensuring that all extensions from 'extensions' are present) - repeated // prevence proti opakovanemu 'updateExts'==TRUE (neustalemu ozivovani pripon z 'extensions') virtual void WINAPI AddPanelArchiver(const char* extensions, BOOL edit, BOOL updateExts) = 0; - // vyhozeni pripony ze seznamu pro "panel archiver view/edit" (jen z polozek tykajicich se - // tohoto pluginu), 'extension' je pripona archivu (jedina; pouziva se wildcard '#' pro '0'..'9'), - // nutna prevence proti opakovanemu volani (neustalemu mazani 'extension') + // removes an extension from the list for "panel archiver view/edit" (only from items belonging to + // this plugin); 'extension' is a single archive extension (the '#' wildcard is used for '0'..'9'); + // repeated calls must be prevented (to avoid continually deleting 'extension') virtual void WINAPI ForceRemovePanelArchiver(const char* extension) = 0; - // pridani pluginu do seznamu pro "file viewer", - // 'masks' jsou pripony vieweru, ktere se timto pluginem maji zpracovavat - // (oddelovac je ';' (escape sekvence pro ';' je ";;") a pouzivaji se wildcardy '*' a '?', - // pokud mozno nepouzivat mezery + znak '|' je zakazany (inverzni masky nejsou povolene)), - // pokud nejde o upgrade "file viewer" (nebo pridani celeho pluginu) a 'force' je FALSE, + // adds the plugin to the list for "file viewer", + // 'masks' are the viewer masks handled by this plugin + // (the separator is ';' (the escape sequence for ';' is ";;") and the '*' and '?' wildcards are used; + // if possible, avoid spaces, and the '|' character is forbidden (inverse masks are not allowed)), + // if this is not an upgrade of "file viewer" (or the addition of the whole plugin) and 'force' is FALSE, // je volani ignorovano; je-li 'force' TRUE, prida 'masks' vzdy (pokud jiz nejsou na // seznamu) - nutna prevence proti opakovanemu 'force'==TRUE (neustalemu pridavani 'masks') virtual void WINAPI AddViewer(const char* masks, BOOL force) = 0; - // vyhozeni masky ze seznamu pro "file viewer" (jen z polozek tykajicich se tohoto pluginu), - // 'mask' je pripona viewru (jedina; pouzivaji se wildcardy '*' a '?'), nutna prevence - // proti opakovanemu volani (neustalemu mazani 'mask') + // removes a mask from the list for "file viewer" (only from items belonging to this plugin); + // 'mask' is a single viewer mask (the '*' and '?' wildcards are used); repeated calls must be prevented + // (to avoid continually deleting 'mask') virtual void WINAPI ForceRemoveViewer(const char* mask) = 0; - // pridava polozky do menu Plugins/"jmeno pluginu" v Salamanderu, 'iconIndex' je index - // ikony polozky (-1=zadna ikona; zadani bitmapy s ikonami viz + // adds items to the Plugins/"plugin name" menu in Salamander, 'iconIndex' is the + // item icon index (-1=no icon; for assigning a bitmap with icons see // CSalamanderConnectAbstract::SetBitmapWithIcons; u separatoru se ignoruje), 'name' je // jmeno polozky (max. MAX_PATH - 1 znaku) nebo NULL jde-li o separator (parametry - // 'state_or'+'state_and' v tomto pripade nemaji vyznam); 'hotKey' je horka klavesa - // polozky ziskana pomoci makra SALHOTKEY; 'name' muze obsahovat hint pro horkou klavesu, - // oddeleny znakem '\t', v promenne 'hotKey' musi byt v tomto pripade prirazena konstanta + // 'state_or'+'state_and' parameters have no meaning in that case); 'hotKey' is the hot key + // for the item, obtained with the SALHOTKEY macro; 'name' may contain a hot-key hint, + // separated by '\t'; in that case the 'hotKey' variable must be assigned the // SALHOTKEY_HINT, vice viz komentar k SALHOTKEY_HINT; 'id' je unikatni identifikacni // cislo polozky v ramci pluginu (u separatoru ma vyznam jen je-li 'callGetState' TRUE), // pokud je 'callGetState' TRUE, vola se pro zjisteni stavu polozky metoda // CPluginInterfaceForMenuExtAbstract::GetMenuItemState (u separatoru ma vyznam jen stav // MENU_ITEM_STATE_HIDDEN, ostatni se ignoruji), jinak se k vypoctu stavu polozky (enabled/disabled) - // pouziji 'state_or'+'state_and' - pri vypoctu stavu polozky se nejprve sestavi maska - // ('eventMask') tak, ze se logicky sectou vsechny udalosti, ktere nastaly (udalosti viz + // is computed from 'state_or'+'state_and' - the item state is calculated by first building the mask + // ('eventMask') as the logical OR of all events that occurred (see // MENU_EVENT_XXX), polozka bude "enable" pokud bude nasl. vyraz TRUE: // ('eventMask' & 'state_or') != 0 && ('eventMask' & 'state_and') == 'state_and', - // parametr 'skillLevel' urcuje kterym urovnim uzivatele bude polozka (nebo separator) - // zobrazena; hodnota obsahuje jednu nebo vice (ORovane) konstant MENU_SKILLLEVEL_XXX; - // polozky v menu se updatuji pri kazdem loadu pluginu (mozna zmena polozek dle konfigurace) + // the 'skillLevel' parameter specifies for which user levels the item (or separator) + // is displayed; the value contains one or more MENU_SKILLLEVEL_XXX constants ORed together; + // menu items are updated on every plugin load (the items may change with configuration) // POZOR: pro "dynamic menu extension" se pouziva CSalamanderBuildMenuAbstract::AddMenuItem virtual void WINAPI AddMenuItem(int iconIndex, const char* name, DWORD hotKey, int id, BOOL callGetState, DWORD state_or, DWORD state_and, DWORD skillLevel) = 0; - // prida submenu do menu Plugins/"jmeno pluginu" v Salamanderu, 'iconIndex' - // je index ikony submenu (-1=zadna ikona; zadani bitmapy s ikonami + // adds a submenu to the Plugins/"plugin name" menu in Salamander, 'iconIndex' + // is the submenu icon index (-1=no icon; for assigning a bitmap with icons // viz CSalamanderConnectAbstract::SetBitmapWithIcons), 'name' je jmeno - // submenu (max. MAX_PATH - 1 znaku), 'id' je unikatni identifikacni cislo polozky + // name (max. MAX_PATH - 1 characters), 'id' is the unique menu-item identifier // menu v ramci pluginu (u submenu ma vyznam jen je-li 'callGetState' TRUE), // pokud je 'callGetState' TRUE, vola se pro zjisteni stavu submenu metoda // CPluginInterfaceForMenuExtAbstract::GetMenuItemState (vyznam maji jen stavy - // MENU_ITEM_STATE_ENABLED a MENU_ITEM_STATE_HIDDEN, ostatni se ignoruji), jinak se - // k vypoctu stavu polozky (enabled/disabled) pouziji 'state_or'+'state_and' - vypocet + // MENU_ITEM_STATE_ENABLED and MENU_ITEM_STATE_HIDDEN states matter; the others are ignored), otherwise + // the item state (enabled/disabled) is computed from 'state_or'+'state_and' - for the state calculation // stavu polozky viz CSalamanderConnectAbstract::AddMenuItem(), parametr 'skillLevel' - // urcuje kterym urovnim uzivatele bude submenu zobrazeno, hodnota obsahuje jednu nebo - // vice (ORovanych) konstant MENU_SKILLLEVEL_XXX, submenu se ukoncuje volanim + // specifies for which user levels the submenu is displayed; the value contains one or more + // MENU_SKILLLEVEL_XXX constants ORed together; the submenu is closed by calling // CSalamanderConnectAbstract::AddSubmenuEnd(); - // polozky v menu se updatuji pri kazdem loadu pluginu (mozna zmena polozek dle konfigurace) + // menu items are updated on every plugin load (the items may change with configuration) // POZOR: pro "dynamic menu extension" se pouziva CSalamanderBuildMenuAbstract::AddSubmenuStart virtual void WINAPI AddSubmenuStart(int iconIndex, const char* name, int id, BOOL callGetState, DWORD state_or, DWORD state_and, DWORD skillLevel) = 0; @@ -348,9 +349,9 @@ class CSalamanderConnectAbstract // CSalamanderGeneralAbstract::SetChangeDriveMenuItemVisibility virtual void WINAPI SetChangeDriveMenuItem(const char* title, int iconIndex) = 0; - // informuje Salamandera, ze plugin umi nacitat thumbnaily ze souboru odpovidajicich - // skupinove masce 'masks' (oddelovac je ';' (escape sekvence pro ';' je ";;") a pouzivaji - // se wildcardy '*' a '?'); pro nacteni thumbnailu se vola + // informs Salamander that the plugin can load thumbnails from files matching the group mask + // 'masks' (the separator is ';' (the escape sequence for ';' is ";;") and the '*' and '?' wildcards are used); + // to load a thumbnail, Salamander calls // CPluginInterfaceForThumbLoaderAbstract::LoadThumbnail virtual void WINAPI SetThumbnailLoader(const char* masks) = 0; @@ -365,31 +366,31 @@ class CSalamanderConnectAbstract // SetIconListForGUI() virtual void WINAPI SetBitmapWithIcons(HBITMAP bitmap) = 0; - // nastavi index ikony pluginu, ktera se pro plugin pouziva v okne Plugins/Plugins Manager, - // v menu Help/About Plugin a pripadne i pro submenu pluginu v menu Plugins (detaily + // sets the plugin icon index used for the plugin in the Plugins/Plugins Manager window, + // in the Help/About Plugin menu, and optionally also for the plugin submenu in the Plugins menu (for details // viz CSalamanderConnectAbstract::SetPluginMenuAndToolbarIcon()); pokud plugin tuto - // metodu nezavola, pouzije se standardni Salamanderovska ikona pro plugin; 'iconIndex' - // je nastavovany index ikony (zadani bitmapy s ikonami viz + // method, the standard Salamander plugin icon is used; 'iconIndex' + // is the icon index to set (for assigning a bitmap with icons see // CSalamanderConnectAbstract::SetBitmapWithIcons) virtual void WINAPI SetPluginIcon(int iconIndex) = 0; - // nastavi index ikony pro submenu pluginu, ktera se pouziva pro submenu pluginu - // v menu Plugins a pripadne i v horni toolbare pro drop-down button slouzici - // k zobrazeni submenu pluginu; pokud plugin tuto metodu nezavola, pouzije se - // pro submenu pluginu v menu Plugins ikona pluginu (nastaveni viz - // CSalamanderConnectAbstract::SetPluginIcon) a v horni toolbare se neobjevi - // button pro plugin; 'iconIndex' je nastavovany index ikony (-1=ma se pouzit ikona + // sets the icon index for the plugin submenu, used for the plugin submenu + // in the Plugins menu and optionally also in the top toolbar for the drop-down button used + // to display the plugin submenu; if the plugin does not call this method, the + // plugin icon is used for the plugin submenu in the Plugins menu (configured by + // CSalamanderConnectAbstract::SetPluginIcon) and no toolbar button is shown + // for the plugin; 'iconIndex' is the icon index to set (-1=use the plugin icon // pluginu, viz CSalamanderConnectAbstract::SetPluginIcon(); zadani bitmapy // s ikonami viz CSalamanderConnectAbstract::SetBitmapWithIcons); virtual void WINAPI SetPluginMenuAndToolbarIcon(int iconIndex) = 0; - // nastavi bitmapu s ikonami pluginu; bitmapu je treba alokovat pomoci volani - // CSalamanderGUIAbstract::CreateIconList() a nasledne vytvorit a naplnit pomoci - // metod CGUIIconListAbstract interfacu; rozmery ikonek musi byt 16x16 bodu; - // Salamander si objekt bitmapy prebira do sve spravy, plugin ji po zavolani - // teto funkce nesmi destruovat; bitmapa se uklada do konfigurace Salamandera, - // aby se ikony pri dalsim spusteni daly pouzivat bez loadu pluginu, proto do - // ni vkladejte pouze potrebne ikony + // sets the icon list with plugin icons; the icon list must be allocated by calling + // CSalamanderGUIAbstract::CreateIconList() and then created and filled using + // methods of the CGUIIconListAbstract interface; icon size must be 16x16 pixels; + // Salamander takes ownership of the icon-list object; the plugin must not destroy it after calling + // this function; the icon list is stored in Salamander's configuration + // so that the icons can be used on the next start without loading the plugin, so + // put only the necessary icons into it virtual void WINAPI SetIconListForGUI(CGUIIconListAbstract* iconList) = 0; }; @@ -402,9 +403,9 @@ class CSalamanderConnectAbstract class CDynamicString { public: - // vraci TRUE pokud se retezec 'str' o delce 'len' podarilo pridat; je-li 'len' -1, - // urci se 'len' jako "strlen(str)" (pridani bez koncove nuly); je-li 'len' -2, - // urci se 'len' jako "strlen(str)+1" (pridani vcetne koncove nuly) + // returns TRUE if the string 'str' of length 'len' was added successfully; if 'len' is -1, + // 'len' is taken as "strlen(str)" (add without the terminating null); if 'len' is -2, + // 'len' is taken as "strlen(str)+1" (add including the terminating null) virtual BOOL WINAPI Add(const char* str, int len = -1) = 0; }; @@ -422,71 +423,71 @@ class CDynamicString // nacitace thumbnailu - viz CPluginInterfaceForThumbLoaderAbstract. // Casti jsou pripojeny k CPluginInterfaceAbstract pres CPluginInterfaceAbstract::GetInterfaceForXXX -// flagy oznacujici, ktere funkce plugin poskytuje (jake metody potomka -// CPluginInterfaceAbstract jsou v pluginu skutecne implementovane): -#define FUNCTION_PANELARCHIVERVIEW 0x0001 // metody pro "panel archiver view" -#define FUNCTION_PANELARCHIVEREDIT 0x0002 // metody pro "panel archiver edit" -#define FUNCTION_CUSTOMARCHIVERPACK 0x0004 // metody pro "custom archiver pack" -#define FUNCTION_CUSTOMARCHIVERUNPACK 0x0008 // metody pro "custom archiver unpack" -#define FUNCTION_CONFIGURATION 0x0010 // metoda Configuration -#define FUNCTION_LOADSAVECONFIGURATION 0x0020 // metody pro "load/save configuration" -#define FUNCTION_VIEWER 0x0040 // metody pro "file viewer" -#define FUNCTION_FILESYSTEM 0x0080 // metody pro "file system" -#define FUNCTION_DYNAMICMENUEXT 0x0100 // metody pro "dynamic menu extension" - -// kody ruznych udalosti (a vyznam parametru 'param'), prijima metoda CPluginInterfaceAbstract::Event(): -// doslo ke zmene barev (diky zmene systemovych barev / WM_SYSCOLORCHANGE nebo diky zmene v konfiguraci); plugin si -// muze vytahnout nove verze salamanderovskych barev pres CSalamanderGeneralAbstract::GetCurrentColor; -// pokud ma plugin file-system s ikonami typu pitFromPlugin, mel by prebarvit pozadi image-listu -// s jednoduchymi ikonami na barvu SALCOL_ITEM_BK_NORMAL; 'param' se zde ignoruje +// flags indicating which functions the plugin provides (which methods of the +// CPluginInterfaceAbstract descendant are actually implemented in the plugin): +#define FUNCTION_PANELARCHIVERVIEW 0x0001 // methods for "panel archiver view" +#define FUNCTION_PANELARCHIVEREDIT 0x0002 // methods for "panel archiver edit" +#define FUNCTION_CUSTOMARCHIVERPACK 0x0004 // methods for "custom archiver pack" +#define FUNCTION_CUSTOMARCHIVERUNPACK 0x0008 // methods for "custom archiver unpack" +#define FUNCTION_CONFIGURATION 0x0010 // Configuration() method +#define FUNCTION_LOADSAVECONFIGURATION 0x0020 // methods for "load/save configuration" +#define FUNCTION_VIEWER 0x0040 // methods for "file viewer" +#define FUNCTION_FILESYSTEM 0x0080 // methods for "file system" +#define FUNCTION_DYNAMICMENUEXT 0x0100 // methods for "dynamic menu extension" + +// codes of various events (and the meaning of the 'param' parameter), received by CPluginInterfaceAbstract::Event(): +// the colors have changed (because of a system color change / WM_SYSCOLORCHANGE or because of a configuration change); the plugin can +// fetch updated Salamander colors via CSalamanderGeneralAbstract::GetCurrentColor; +// if the plugin has a file system with pitFromPlugin icons, it should repaint the image-list background +// for simple icons to SALCOL_ITEM_BK_NORMAL; 'param' is ignored here #define PLUGINEVENT_COLORSCHANGED 0 -// doslo ke zmene konfigurace Salamandera; plugin si muze vytahnout nove verze salamanderovskych -// konfiguracnich parametru pres CSalamanderGeneralAbstract::GetConfigParameter; -// 'param' se zde ignoruje +// Salamander's configuration has changed; the plugin can fetch updated versions of Salamander +// configuration parameters via CSalamanderGeneralAbstract::GetConfigParameter; +// 'param' is ignored here #define PLUGINEVENT_CONFIGURATIONCHANGED 1 -// doslo k prohozeni leveho a praveho panelu (Swap Panels - Ctrl+U) -// 'param' se zde ignoruje +// the left and right panels were swapped (Swap Panels - Ctrl+U) +// 'param' is ignored here #define PLUGINEVENT_PANELSSWAPPED 2 -// doslo ke zmene aktivniho panelu (prepnuti mezi panely) -// 'param' je PANEL_LEFT nebo PANEL_RIGHT - oznacuje aktivovany panel +// the active panel has changed (switch between panels) +// 'param' is PANEL_LEFT or PANEL_RIGHT - it identifies the activated panel #define PLUGINEVENT_PANELACTIVATED 3 -// Salamander obdrzel WM_SETTINGCHANGE a na jeho zaklade pregeneroval fonty pro toolbars. -// Potom rozesila tento event vsem pluginu, aby mely moznost zavolat svym nastrojovym listam -// metodu SetFont(); -// 'param' se zde ignoruje +// Salamander received WM_SETTINGCHANGE and regenerated the fonts for toolbars on that basis. +// It then sends this event to all plugins so they can call +// SetFont() on their toolbars; +// 'param' is ignored here #define PLUGINEVENT_SETTINGCHANGE 4 -// kody udalosti v Password Manageru, prijima metoda CPluginInterfaceAbstract::PasswordManagerEvent(): -#define PME_MASTERPASSWORDCREATED 1 // uzivatel vytvoril master password (je potreba zasifrovat hesla) -#define PME_MASTERPASSWORDCHANGED 2 // uzivatel zmenil master password (je potreba desifrovat a nasledne znovu zasifrovat hesla) -#define PME_MASTERPASSWORDREMOVED 3 // uzivatel zrusil master password (je potreba desifrovat hesla) +// Password Manager event codes, received by CPluginInterfaceAbstract::PasswordManagerEvent(): +#define PME_MASTERPASSWORDCREATED 1 // user created a master password (passwords need to be encrypted) +#define PME_MASTERPASSWORDCHANGED 2 // user changed the master password (passwords need to be decrypted and then re-encrypted) +#define PME_MASTERPASSWORDREMOVED 3 // user removed the master password (passwords need to be decrypted) class CPluginInterfaceAbstract { #ifdef INSIDE_SALAMANDER -private: // ochrana proti nespravnemu primemu volani metod (viz CPluginInterfaceEncapsulation) +private: // protection against incorrect direct calls to methods (see CPluginInterfaceEncapsulation) friend class CPluginInterfaceEncapsulation; #else // INSIDE_SALAMANDER public: #endif // INSIDE_SALAMANDER - // vola se jako reakce na tlacitko About v okne Plugins nebo prikaz z menu Help/About Plugins + // called in response to the About button in the Plugins window or the Help/About Plugins menu command virtual void WINAPI About(HWND parent) = 0; - // vola se pred unloadem pluginu (prirozene jen pokud vratil SalamanderPluginEntry - // tento objekt a ne NULL), vraci TRUE pokud unload muze probehnout, + // called before the plugin is unloaded (naturally only if SalamanderPluginEntry returned + // this object and not NULL); returns TRUE if the unload may proceed, // 'parent' je parent messageboxu, 'force' je TRUE pokud se nebere ohled na navratovou - // hodnotu, pokud vraci TRUE, nebude se tento objekt a vsechny ostatni z nej ziskane - // dale pouzivat a dojde k unloadu pluginu; pokud probiha critical shutdown (vice viz + // value is ignored; if it returns TRUE, this object and all other objects obtained from it + // will no longer be used and the plugin will be unloaded; if a critical shutdown is in progress (see // CSalamanderGeneralAbstract::IsCriticalShutdown), nema smysl se usera na cokoliv ptat - // (uz neotvirat zadna okna) + // (do not open any more windows) // POZOR!!! Je nutne ukoncit vsechny thready pluginu (pokud Release vrati TRUE, vola se - // FreeLibrary na pluginove .SPL => kod pluginu se odmapuje z pameti => thready pak uz - // nemaji co spoustet => obvykle nevypadne ani bug-report, ani Windows exception info) + // FreeLibrary is called on the plugin .SPL => the plugin code is unmapped from memory => the threads then + // have nothing left to execute => usually neither a bug report nor Windows exception info is generated) virtual BOOL WINAPI Release(HWND parent, BOOL force) = 0; // funkce pro load defaultni konfigurace a pro "load/save configuration" (load ze soukromeho klice @@ -504,11 +505,11 @@ class CPluginInterfaceAbstract // v tomto pripade se ulozeni provede jen pokud v registry existuje klic Salamandera virtual void WINAPI SaveConfiguration(HWND parent, HKEY regKey, CSalamanderRegistryAbstract* registry) = 0; - // vola se jako reakce na tlacitko Configurate v okne Plugins + // called in response to the Configuration button in the Plugins window virtual void WINAPI Configuration(HWND parent) = 0; - // vola se pro navazani pluginu do Salamandera, vola se az po LoadConfiguration, - // 'parent' je parent messageboxu, 'salamander' je sada metod pro navazovani pluginu + // called to connect the plugin to Salamander; called only after LoadConfiguration, + // 'parent' is the parent of the message boxes; 'salamander' is the set of methods used to connect the plugin /* PRAVIDLA PRO IMPLEMENTACI METODY CONNECT (pluginy musi mit ulozenou verzi konfigurace - viz DEMOPLUGin, @@ -637,33 +638,33 @@ class CPluginInterfaceAbstract */ virtual void WINAPI Connect(HWND parent, CSalamanderConnectAbstract* salamander) = 0; - // uvolni interface 'pluginData', ktery Salamander ziskal z pluginu pomoci volani + // releases the 'pluginData' interface that Salamander obtained from the plugin by calling // CPluginInterfaceForArchiverAbstract::ListArchive nebo // CPluginFSInterfaceAbstract::ListCurrentPath; pred timto volanim jeste - // dojde k uvolneni dat souboru a adresaru (CFileData::PluginData) pomoci metod + // file and directory data (CFileData::PluginData) are also released by the methods of // CPluginDataInterfaceAbstract virtual void WINAPI ReleasePluginDataInterface(CPluginDataInterfaceAbstract* pluginData) = 0; - // vraci interface archivatoru; plugin musi vracet tento interface, pokud ma - // alespon jednu z nasledujicich funkci (viz SetBasicPluginData): FUNCTION_PANELARCHIVERVIEW, + // returns the archiver interface; the plugin must return this interface if it has + // at least one of the following functions (see SetBasicPluginData): FUNCTION_PANELARCHIVERVIEW, // FUNCTION_PANELARCHIVEREDIT, FUNCTION_CUSTOMARCHIVERPACK a/nebo FUNCTION_CUSTOMARCHIVERUNPACK; // pokud plugin archivator neobsahuje, vraci NULL virtual CPluginInterfaceForArchiverAbstract* WINAPI GetInterfaceForArchiver() = 0; - // vraci interface vieweru; plugin musi vracet tento interface, pokud ma funkci - // (viz SetBasicPluginData) FUNCTION_VIEWER; pokud plugin viewer neobsahuje, vraci NULL + // returns the viewer interface; the plugin must return this interface if it has the function + // (see SetBasicPluginData) FUNCTION_VIEWER; if the plugin does not contain a viewer, it returns NULL virtual CPluginInterfaceForViewerAbstract* WINAPI GetInterfaceForViewer() = 0; - // vraci interface rozsireni menu; plugin musi vracet tento interface, pokud pridava + // returns the menu-extension interface; the plugin must return this interface if it adds // polozky do menu (viz CSalamanderConnectAbstract::AddMenuItem) nebo pokud ma // funkci (viz SetBasicPluginData) FUNCTION_DYNAMICMENUEXT; v opacnem pripade vraci NULL virtual CPluginInterfaceForMenuExtAbstract* WINAPI GetInterfaceForMenuExt() = 0; - // vraci interface file-systemu; plugin musi vracet tento interface, pokud ma funkci - // (viz SetBasicPluginData) FUNCTION_FILESYSTEM; pokud plugin file-system neobsahuje, vraci NULL + // returns the file-system interface; the plugin must return this interface if it has the function + // (see SetBasicPluginData) FUNCTION_FILESYSTEM; if the plugin does not contain a file system, it returns NULL virtual CPluginInterfaceForFSAbstract* WINAPI GetInterfaceForFS() = 0; - // vraci interface nacitace thumbnailu; plugin musi vracet tento interface, pokud informoval + // returns the thumbnail-loader interface; the plugin must return this interface if it informed // Salamandera, ze umi nacitat thumbnaily (viz CSalamanderConnectAbstract::SetThumbnailLoader); // pokud plugin neumi nacitat thumbnaily, vraci NULL virtual CPluginInterfaceForThumbLoaderAbstract* WINAPI GetInterfaceForThumbLoader() = 0; @@ -673,13 +674,13 @@ class CPluginInterfaceAbstract // POZOR: muze se zavolat kdykoliv po dokonceni entry-pointu pluginu (SalamanderPluginEntry) virtual void WINAPI Event(int event, DWORD param) = 0; - // uzivatel si preje, aby byly smazany vsechny historie (spustil Clear History z konfigurace - // ze stranky History); historii se tu mysli vse, co vznika samocinne z uzivatelem zadanych - // hodnot (napr. seznam textu spustenych v prikazove radce, seznam aktualnich cest na - // jednotlivych drivech, atd.); nepatri sem seznamy tvorene userem - napr. hot-paths, user-menu, - // atd.; 'parent' je parent pripadnych messageboxu; po ulozeni konfigurace nesmi historie - // zustat v registry; pokud ma plugin otevrena okna obsahujici historie (comboboxy), musi - // promazat historie take tam + // user requested that all histories be cleared (by running Clear History from the configuration + // History page); here, history means everything that arises automatically from values entered by the user + // (e.g. the list of texts entered on the command line, the list of current paths on + // individual drives, etc.); this does not include lists created by the user - e.g. hot paths, user menu, + // etc.; 'parent' is the parent of any message boxes; after saving the configuration, histories must not + // remain in the registry; if the plugin has open windows containing histories (combo boxes), it must + // clear the histories there as well virtual void WINAPI ClearHistory(HWND parent) = 0; // prijem informace o zmene na ceste 'path' (je-li 'includingSubdirs' TRUE, tak @@ -688,10 +689,10 @@ class CPluginInterfaceAbstract // existuje metoda CPluginFSInterfaceAbstract::AcceptChangeOnPathNotification() virtual void WINAPI AcceptChangeOnPathNotification(const char* path, BOOL includingSubdirs) = 0; - // tato metoda se vola jen u pluginu, ktery pouziva Password Manager (viz + // this method is called only for a plugin that uses Password Manager (see // CSalamanderGeneralAbstract::SetPluginUsesPasswordManager()): - // informuje plugin o zmenach v Password Manageru; 'parent' je parent pripadnych - // messageboxu/dialogu; 'event' obsahuje udalost, viz PME_XXX + // it informs the plugin about changes in Password Manager; 'parent' is the parent of any + // message boxes/dialogs; 'event' contains the event, see PME_XXX virtual void WINAPI PasswordManagerEvent(HWND parent, int event) = 0; }; @@ -701,28 +702,28 @@ class CPluginInterfaceAbstract // // sada metod ze Salamandera, ktere se pouzivaji v SalamanderPluginEntry -// flagy informujici o duvodu loadu pluginu (viz metoda CSalamanderPluginEntryAbstract::GetLoadInformation) -#define LOADINFO_INSTALL 0x0001 // prvni load pluginu (instalace do Salamandera) -#define LOADINFO_NEWSALAMANDERVER 0x0002 // nova verze Salamandera (doinstalace vsech pluginu z \ - // podadresare plugins), loadi vsechny pluginy (mozny \ - // upgrade vsech) -#define LOADINFO_NEWPLUGINSVER 0x0004 // zmena v souboru plugins.ver (instalace/upgrade pluginu), \ - // pro jednoduchost loadi vsechny pluginy (mozny upgrade \ - // vsech) -#define LOADINFO_LOADONSTART 0x0008 // load probehl, protoze byl nalezen flag "load on start" +// flags indicating the reason for plugin load (see CSalamanderPluginEntryAbstract::GetLoadInformation) +#define LOADINFO_INSTALL 0x0001 // first plugin load (installation into Salamander) +#define LOADINFO_NEWSALAMANDERVER 0x0002 // new Salamander version (installs all plugins from \ + // plugins subdirectory), loads all plugins (possible \ + // upgrade of all) +#define LOADINFO_NEWPLUGINSVER 0x0004 // change in the plugins.ver file (plugin install/upgrade), \ + // for simplicity, it loads all plugins (possible \ + // upgrade of all) +#define LOADINFO_LOADONSTART 0x0008 // load occurred because the "load on start" flag was found class CSalamanderPluginEntryAbstract { public: - // vraci verzi Salamandera, viz spl_vers.h, konstanty LAST_VERSION_OF_SALAMANDER a REQUIRE_LAST_VERSION_OF_SALAMANDER + // returns the Salamander version; see spl_vers.h and the LAST_VERSION_OF_SALAMANDER and REQUIRE_LAST_VERSION_OF_SALAMANDER constants virtual int WINAPI GetVersion() = 0; - // vraci "parent" okno Salamandera (parent pro messageboxy) + // returns Salamander's parent window (parent for message boxes) virtual HWND WINAPI GetParentWindow() = 0; - // vraci ukazatel na interface k debugovacim funkcim Salamandera, - // interface je platny po celou dobu existence pluginu (nejen v ramci - // "SalamanderPluginEntry" funkce) a jde pouze o odkaz, takze se neuvolnuje + // returns a pointer to the interface for Salamander debug functions, + // the interface is valid for the entire lifetime of the plugin (not only within the + // "SalamanderPluginEntry" function) and is only a reference, so it is not released virtual CSalamanderDebugAbstract* WINAPI GetSalamanderDebug() = 0; // nastaveni zakladnich dat o pluginu (data, ktera si o pluginu spolu se jmenem DLL souboru @@ -746,56 +747,56 @@ class CSalamanderPluginEntryAbstract const char* description, const char* regKeyName = NULL, const char* extensions = NULL, const char* fsName = NULL) = 0; - // vraci ukazatel na interface k obecne pouzitelnym funkcim Salamandera, - // interface je platny po celou dobu existence pluginu (nejen v ramci - // "SalamanderPluginEntry" funkce) a jde pouze o odkaz, takze se neuvolnuje + // returns a pointer to the interface for Salamander's general-purpose functions, + // the interface is valid for the entire lifetime of the plugin (not only within the + // "SalamanderPluginEntry" function) and is only a reference, so it is not released virtual CSalamanderGeneralAbstract* WINAPI GetSalamanderGeneral() = 0; - // vraci informace spojene s loadem pluginu; informace jsou vraceny v DWORD hodnote - // jako logicky soucet flagu LOADINFO_XXX (pro test pritomnosti flagu pouzijte - // podminku: (GetLoadInformation() & LOADINFO_XXX) != 0) + // returns information related to plugin load; the information is returned in a DWORD value + // as a logical OR of LOADINFO_XXX flags (to test for the presence of a flag, use the + // condition: (GetLoadInformation() & LOADINFO_XXX) != 0) virtual DWORD WINAPI GetLoadInformation() = 0; - // nahraje modul s jazykove zavislymi resourcy (SLG-cko); vzdy zkusi nahrat modul - // stejneho jazyku v jakem prave bezi Salamander, pokud takovy modul nenajde (nebo - // nesouhlasi verze), necha uzivatele vybrat alternativni modul (pokud existuje vic - // nez jedna alternativa + pokud uz nema ulozeny uzivateluv vyber z minuleho loadu + // loads the module with language-dependent resources (the SLG module); it always first tries to load the module + // for the same language Salamander is currently running in; if it cannot find such a module (or + // the version does not match), it lets the user choose an alternative module (if there is more than one + // alternative and the user's choice from the previous plugin load is not already stored); // pluginu); pokud nenajde zadny modul, vraci NULL -> plugin by se mel ukoncit; - // 'parent' je parent messageboxu s chybami a dialogu pro vyber alternativniho - // jazykoveho modulu; 'pluginName' je jmeno pluginu (aby uzivatel tusil o jaky plugin - // se jedna pri chybovem hlaseni nebo vyberu alternativniho jazykoveho modulu) + // 'parent' is the parent of the error message boxes and of the dialog for selecting an alternative + // language module; 'pluginName' is the plugin name (so the user knows which plugin + // the error message or the alternative language module selection refers to) // POZOR: tuto metodu je mozne volat jen jednou; ziskany handle jazykoveho modulu - // se uvolni automaticky pri unloadu pluginu + // is released automatically when the plugin is unloaded virtual HINSTANCE WINAPI LoadLanguageModule(HWND parent, const char* pluginName) = 0; - // vraci ID aktualniho jazyku zvoleneho pro prostredi Salamandera (napr. english.slg = + // returns the ID of the current language selected for the Salamander UI (e.g. english.slg = // English (US) = 0x409, czech.slg = Czech = 0x405) virtual WORD WINAPI GetCurrentSalamanderLanguageID() = 0; - // vraci ukazatel na interface poskytujici upravene Windows controly pouzivane - // v Salamanderovi, interface je platny po celou dobu existence pluginu (nejen - // v ramci "SalamanderPluginEntry" funkce) a jde pouze o odkaz, takze se neuvolnuje + // returns a pointer to the interface providing the modified Windows controls used + // in Salamander; the interface is valid for the entire lifetime of the plugin (not only + // within the "SalamanderPluginEntry" function) and is only a reference, so it is not released virtual CSalamanderGUIAbstract* WINAPI GetSalamanderGUI() = 0; - // vraci ukazatel na interface pro komfortni praci se soubory, - // interface je platny po celou dobu existence pluginu (nejen v ramci - // "SalamanderPluginEntry" funkce) a jde pouze o odkaz, takze se neuvolnuje + // returns a pointer to the interface for convenient file handling, + // the interface is valid for the entire lifetime of the plugin (not only within the + // "SalamanderPluginEntry" function) and is only a reference, so it is not released virtual CSalamanderSafeFileAbstract* WINAPI GetSalamanderSafeFile() = 0; - // nastavi URL, ktere se ma zobrazit v okne Plugins Manager jako home-page pluginu; - // hodnotu si Salamander udrzuje az do pristiho loadu pluginu (URL se zobrazuje i pro - // nenaloadene pluginy); pri kazdem loadu pluginu je URL nutne nastavit znovu, jinak - // se zadne URL nezobrazi (obrana proti drzeni neplatneho URL home-page) + // sets the URL to be displayed in the Plugins Manager window as the plugin home page; + // Salamander keeps the value until the next plugin load (the URL is shown even for + // unloaded plugins); the URL must be set again on every plugin load, otherwise + // no URL is shown (to avoid keeping an invalid home-page URL) virtual void WINAPI SetPluginHomePageURL(const char* url) = 0; - // pridani dalsiho jmena file systemu; bez FUNCTION_FILESYSTEM v parametru 'functions' - // pri volani metody SetBasicPluginData vraci tato metoda vzdy jen chybu; - // 'fsName' je navrhovane jmeno (ziskani prideleneho jmena se provede pomoci + // adds another file-system name; without FUNCTION_FILESYSTEM in the 'functions' + // parameter passed to SetBasicPluginData, this method always fails; + // 'fsName' is the proposed name (the assigned file-system name can be obtained with // CSalamanderGeneralAbstract::GetPluginFSName) file systemu (povolene znaky jsou // 'a-zA-Z0-9_+-', min. delka 2 znaky); v 'newFSNameIndex' (nesmi byt NULL) se // vraci index nove pridaneho jmena file systemu; vraci TRUE v pripade uspechu; // vraci FALSE pri fatalni chybe - v tomto pripade se 'newFSNameIndex' ignoruje - // omezeni: nesmi se volat pred metodou SetBasicPluginData + // limitation: must not be called before SetBasicPluginData virtual BOOL WINAPI AddFSName(const char* fsName, int* newFSNameIndex) = 0; }; @@ -869,7 +870,7 @@ inline BOOL SalIsWindowsVersionOrGreater(WORD wMajorVersion, WORD wMinorVersion, VER_MINORVERSION, VER_GREATER_EQUAL), VER_SERVICEPACKMAJOR, VER_GREATER_EQUAL); - SecureZeroMemory(&osvi, sizeof(osvi)); // nahrada za memset (nevyzaduje RTLko) + SecureZeroMemory(&osvi, sizeof(osvi)); // replacement for memset (does not require the RTL) osvi.dwOSVersionInfoSize = sizeof(osvi); osvi.dwMajorVersion = wMajorVersion; osvi.dwMinorVersion = wMinorVersion; From b89a2a9486ebf951de51d3bd6f074f8f092ec5dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:22:56 +0200 Subject: [PATCH 191/710] [translation] Fix src/plugins/shared/spl_menu.h comments (#563) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/plugins/shared/spl_menu.h | 53 ++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/src/plugins/shared/spl_menu.h b/src/plugins/shared/spl_menu.h index 29dbcaf95..bfc5529c5 100644 --- a/src/plugins/shared/spl_menu.h +++ b/src/plugins/shared/spl_menu.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED //**************************************************************************** // @@ -12,7 +13,7 @@ #pragma once #ifdef _MSC_VER -#pragma pack(push, enter_include_spl_menu) // aby byly struktury nezavisle na nastavenem zarovnavani +#pragma pack(push, enter_include_spl_menu) // so the structures are independent of the current alignment setting #pragma pack(4) #endif // _MSC_VER #ifdef __BORLANDC__ @@ -43,14 +44,14 @@ class CSalamanderBuildMenuAbstract virtual void WINAPI AddSubmenuStart(int iconIndex, const char* name, int id, BOOL callGetState, DWORD state_or, DWORD state_and, DWORD skillLevel) = 0; - // popis viz CSalamanderConnectAbstract::AddSubmenuEnd + // see CSalamanderConnectAbstract::AddSubmenuEnd for details virtual void WINAPI AddSubmenuEnd() = 0; - // nastavi bitmapu s ikonami pluginu pro menu; bitmapu je treba alokovat pomoci volani - // CSalamanderGUIAbstract::CreateIconList() a nasledne vytvorit a naplnit pomoci - // metod CGUIIconListAbstract interfacu; rozmery ikonek musi byt 16x16 bodu; - // Salamander si objekt bitmapy prebira do sve spravy, plugin ji po zavolani - // teto funkce nesmi destruovat; Salamander ji drzi jen v pameti, nikam se neuklada + // sets the plugin icon list for the menu; the icon list must be allocated by calling + // CSalamanderGUIAbstract::CreateIconList() and then created and filled using the + // CGUIIconListAbstract interface methods; the icon size must be 16x16 pixels; + // Salamander takes ownership of the icon list object, so the plugin must not destroy it after calling + // this function; Salamander keeps it only in memory and does not store it anywhere virtual void WINAPI SetIconListForMenu(CGUIIconListAbstract* iconList) = 0; }; @@ -59,24 +60,24 @@ class CSalamanderBuildMenuAbstract // CPluginInterfaceForMenuExtAbstract // -// flagy stavu polozek v menu (pro pluginy rozsireni menu) -#define MENU_ITEM_STATE_ENABLED 0x01 // enablovana, bez tohoto flagu je polozka disablovana -#define MENU_ITEM_STATE_CHECKED 0x02 // pred polozkou je "check" nebo "radio" znacka +// menu item state flags (for menu extension plugins) +#define MENU_ITEM_STATE_ENABLED 0x01 // enabled; without this flag the item is disabled +#define MENU_ITEM_STATE_CHECKED 0x02 // a "check" or "radio" mark is shown before the item #define MENU_ITEM_STATE_RADIO 0x04 // bez MENU_ITEM_STATE_CHECKED se ignoruje, \ - // "radio" znacka, bez tohoto flagu "check" znacka -#define MENU_ITEM_STATE_HIDDEN 0x08 // polozka se v menu vubec nema objevit + // "radio" mark; without this flag a "check" mark +#define MENU_ITEM_STATE_HIDDEN 0x08 // the item should not appear in the menu at all class CPluginInterfaceForMenuExtAbstract { #ifdef INSIDE_SALAMANDER -private: // ochrana proti nespravnemu primemu volani metod (viz CPluginInterfaceForMenuExtEncapsulation) +private: // protection against incorrect direct method calls (see CPluginInterfaceForMenuExtEncapsulation) friend class CPluginInterfaceForMenuExtEncapsulation; #else // INSIDE_SALAMANDER public: #endif // INSIDE_SALAMANDER - // vraci stav polozky menu s identifikacnim cislem 'id'; navratova hodnota je kombinaci - // flagu (viz MENU_ITEM_STATE_XXX); 'eventMask' viz CSalamanderConnectAbstract::AddMenuItem + // returns the state of the menu item with identifier 'id'; the return value is a combination + // of flags (see MENU_ITEM_STATE_XXX); for 'eventMask' see CSalamanderConnectAbstract::AddMenuItem virtual DWORD WINAPI GetMenuItemState(int id, DWORD eventMask) = 0; // spousti prikaz menu s identifikacnim cislem 'id', 'eventMask' viz @@ -96,19 +97,19 @@ class CPluginInterfaceForMenuExtAbstract virtual BOOL WINAPI ExecuteMenuItem(CSalamanderForOperationsAbstract* salamander, HWND parent, int id, DWORD eventMask) = 0; - // zobrazi napovedu pro prikaz menu s identifikacnim cislem 'id' (user stiskne Shift+F1, - // najde v menu Plugins menu tohoto pluginu a vybere z nej prikaz), 'parent' je parent - // messageboxu, vraci TRUE pokud byla zobrazena nejaka napoveda, jinak se zobrazi z helpu - // Salamandera kapitola "Using Plugins" + // displays help for the menu command with identifier 'id' (the user presses Shift+F1, + // finds this plugin's menu in the Plugins menu, and selects the command); 'parent' is the parent + // of the message box; returns TRUE if any help was displayed, otherwise the "Using Plugins" + // chapter from Salamander help is shown virtual BOOL WINAPI HelpForMenuItem(HWND parent, int id) = 0; - // funkce pro "dynamic menu extension", vola se jen pokud zadate FUNCTION_DYNAMICMENUEXT do - // SetBasicPluginData; sestavi menu pluginu pri jeho loadu, a pak vzdy znovu tesne pred - // jeho otevrenim v menu Plugins nebo na Plugin bare (navic i pred otevrenim okna Keyboard - // Shortcuts z Plugins Manageru); prikazy v novem menu by mely mit stejne ID jako ve starem, - // aby jim zustavaly uzivatelem pridelene hotkeys a aby pripadne fungovaly jako posledni - // pouzity prikaz (viz Plugins / Last Command); 'parent' je parent messageboxu, 'salamander' - // je sada metod pro stavbu menu + // function for "dynamic menu extension"; called only if FUNCTION_DYNAMICMENUEXT is specified in + // SetBasicPluginData; builds the plugin menu when the plugin is loaded, and then again just before + // it is opened in the Plugins menu or on the Plugin bar (also before the Keyboard + // Shortcuts window is opened from Plugins Manager); commands in the new menu should use the same ID + // as in the old one so user-assigned hotkeys stay assigned and they can still work as the last + // used command (see Plugins / Last Command); 'parent' is the parent of the message box, 'salamander' + // is the set of methods for building the menu virtual void WINAPI BuildMenu(HWND parent, CSalamanderBuildMenuAbstract* salamander) = 0; }; From 6c6a4038fba8b1b69b49c71f6d6cf13742ee7336 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:23:03 +0200 Subject: [PATCH 192/710] [translation] Fix src/plugins/shared/spl_thum.h comments (#564) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/plugins/shared/spl_thum.h | 91 ++++++++++++++++++----------------- 1 file changed, 46 insertions(+), 45 deletions(-) diff --git a/src/plugins/shared/spl_thum.h b/src/plugins/shared/spl_thum.h index 0bd9f031a..a687a61bb 100644 --- a/src/plugins/shared/spl_thum.h +++ b/src/plugins/shared/spl_thum.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED //**************************************************************************** // @@ -12,7 +13,7 @@ #pragma once #ifdef _MSC_VER -#pragma pack(push, enter_include_spl_thum) // aby byly struktury nezavisle na nastavenem zarovnavani +#pragma pack(push, enter_include_spl_thum) // so the structures are independent of the current packing alignment #pragma pack(4) #endif // _MSC_VER #ifdef __BORLANDC__ @@ -24,72 +25,72 @@ // CSalamanderThumbnailMakerAbstract // -// informace o obrazku, ze ktereho generujeme thumbnail, tyto flagy se pouzivaji -// v CSalamanderThumbnailMakerAbstract::SetParameters(): -#define SSTHUMB_MIRROR_HOR 1 // obrazek je potreba horizontalne zrcadlit -#define SSTHUMB_MIRROR_VERT 2 // obrazek je potreba vertikalne zrcadlit -#define SSTHUMB_ROTATE_90CW 4 // obrazek je potreba otocit o 90 stupnu ve smeru hodinovych rucicek -#define SSTHUMB_ROTATE_180 (SSTHUMB_MIRROR_VERT | SSTHUMB_MIRROR_HOR) // obrazek je potreba otocit o 180 stupnu -#define SSTHUMB_ROTATE_90CCW (SSTHUMB_ROTATE_90CW | SSTHUMB_ROTATE_180) // obrazek je potreba otocit o 90 stupnu proti smeru hodinovych rucicek -// obrazek je v horsi kvalite nebo mensi nez je potreba, Salamander po dokonceni prvniho kola -// ziskavani "rychlych" thumbnailu zkusi pro tento obrazek ziskat "kvalitni" thumbnail +// information about the image from which the thumbnail is generated; these flags are used +// in CSalamanderThumbnailMakerAbstract::SetParameters(): +#define SSTHUMB_MIRROR_HOR 1 // image must be mirrored horizontally +#define SSTHUMB_MIRROR_VERT 2 // image must be mirrored vertically +#define SSTHUMB_ROTATE_90CW 4 // image must be rotated 90 degrees clockwise +#define SSTHUMB_ROTATE_180 (SSTHUMB_MIRROR_VERT | SSTHUMB_MIRROR_HOR) // image must be rotated 180 degrees +#define SSTHUMB_ROTATE_90CCW (SSTHUMB_ROTATE_90CW | SSTHUMB_ROTATE_180) // image must be rotated 90 degrees counterclockwise +// the image is lower quality or smaller than required; after the first pass of obtaining +// fast thumbnails, Salamander will try to obtain a quality thumbnail for this image #define SSTHUMB_ONLY_PREVIEW 8 class CSalamanderThumbnailMakerAbstract { public: - // nastaveni parametru zpracovani obrazku pri tvorbe thumbnailu; nutne volat - // jako prvni metodu tohoto rozhrani; 'picWidth' a 'picHeight' jsou rozmery - // zpracovavaneho obrazku (v bodech); 'flags' je kombinace flagu SSTHUMB_XXX, - // ktera udava informace o obrazku predavanem v parametru 'buffer' v metode + // sets the image-processing parameters for thumbnail creation; this method must + // be called first on this interface; 'picWidth' and 'picHeight' are the dimensions + // of the processed image (in pixels); 'flags' is a combination of SSTHUMB_XXX flags, + // which describe the image passed in the 'buffer' parameter to // ProcessBuffer; vraci TRUE, pokud se podarilo alokovat buffery pro zmensovani // a je mozne nasledne volat ProcessBuffer; pokud vrati FALSE, doslo k chybe - // a je treba ukoncit nacitani thumbnailu + // and thumbnail loading must be aborted virtual BOOL WINAPI SetParameters(int picWidth, int picHeight, DWORD flags) = 0; - // zpracuje cast obrazku v bufferu 'buffer' (zpracovavana cast obrazku je ulozena - // po radcich shora dolu, body na radcich jsou ulozeny zleva doprava, kazdy bod - // reprezentuje 32-bitova hodnota, ktera je slozena z tri bytu s barvami R+G+B a - // ctvrteho bytu, ktery se ignoruje); rozlisujeme dva typy zpracovani: kopie - // obrazku do vysledneho thumbnailu (nepresahuje-li velikost zpracovavaneho obrazku - // velikost thumbnailu) a zmenseni obrazku do thumbnailu (obrazek vetsi nez - // thumbnail); 'buffer' je pouzit pouze pro cteni; 'rowsCount' urcuje kolik radku - // obrazku je v bufferu; + // processes part of the image in 'buffer' (the processed part of the image is stored + // row by row from top to bottom, pixels in each row are stored left to right, and each pixel + // is represented by a 32-bit value composed of three bytes with the R+G+B colors and a + // fourth byte, which is ignored); there are two processing modes: copying the image + // to the resulting thumbnail (if the processed image does not exceed the thumbnail size) + // and scaling the image down to the thumbnail (image larger than the + // thumbnail); 'buffer' is used for reading only; 'rowsCount' specifies how many rows of the + // image are in the buffer; // je-li'buffer' NULL, berou se data z vlastniho bufferu (plugin ziska pres GetBuffer); // vraci TRUE pokud ma plugin pokracovat s nacitanim obrazku, vraci-li FALSE, - // tvorba thumbnailu je hotova (byl zpracovan cely obrazek) nebo se ma co - // nejdrive prerusit (napr. uzivatel zmenil cestu v panelu, thumbnail tedy jiz - // neni potreba) + // thumbnail generation is finished (the whole image has been processed) or it should be + // aborted as soon as possible (for example, the user changed the panel path, so the thumbnail is no + // longer needed) // // POZOR: pokud je spustena metoda CPluginInterfaceForThumbLoader::LoadThumbnail, - // je blokovana zmena cesty v panelu. Z toho duvodu je treba predavat a hlavne - // nacitat vetsi obrazky po castech a testovatovanim navratove hodnoty - // metody ProcessBuffer overovat, zda se nacitani nema prerusit. - // Pokud je treba provest casove narocnejsi operace pred volanim metody SetParameters - // nebo pred volanim ProcessBuffer, je behem teto doby nutne obcas volat GetCancelProcessing. + // changing the panel path is blocked. Therefore larger images should be passed and + // loaded in chunks, and the return value of + // ProcessBuffer should be checked to see whether loading should be aborted. + // If time-consuming operations must be performed before calling SetParameters + // or before calling ProcessBuffer, GetCancelProcessing must be called occasionally during that time. virtual BOOL WINAPI ProcessBuffer(void* buffer, int rowsCount) = 0; - // vraci vlastni buffer o velikosti potrebne k ulozeni 'rowsCount' radku obrazku - // (4 * 'rowsCount' * 'picWidth' bytu); je-li objekt v chybovem stavu (po volani - // SetError), vraci NULL; - // plugin nesmi dealokovat ziskany buffer (dealokuje se v Salamanderovi automaticky) + // returns an internal buffer large enough to store 'rowsCount' rows of the image + // (4 * 'rowsCount' * 'picWidth' bytes); if the object is in the error state (after calling + // SetError), returns NULL; + // the plugin must not deallocate the returned buffer (Salamander deallocates it automatically) virtual void* WINAPI GetBuffer(int rowsCount) = 0; - // oznameni chyby pri ziskavani obrazku (thumbnail je povazovan za vadny - // a nepouzije se), ostatni metody tohoto rozhrani budou od chvile volani - // SetError uz jen vracet chyby (GetBuffer a SetParameters) nebo preruseni - // prace (ProcessBuffer) + // reports an error while obtaining the image (the thumbnail is considered invalid + // and will not be used); after SetError is called, the other methods of this interface + // only return errors (GetBuffer and SetParameters) or indicate that processing must stop + // (ProcessBuffer) virtual void WINAPI SetError() = 0; // vraci TRUE, pokud ma plugin preprusit nacitani thumbnailu // vraci FALSE, pokud ma plugin pokracovat s nacitanim obrazku // - // metodu lze volat pred i po volani metody SetParameters + // this method can be called before and after SetParameters // - // slouzi k detekci pozadavku na preruseni v pripadech, kdy plugin - // potrebuje vykonat casove narocne operace jeste pred volanim SetParameters - // nebo v pripade, kdy plugin potrebuje obrazek predrenderovat, tedy po volani - // SetParameters, ale pred volanim ProcessBuffer + // it is used to detect abort requests in cases where the plugin + // needs to perform time-consuming operations before calling SetParameters + // or when the plugin needs to prerender the image, that is, after calling + // SetParameters but before calling ProcessBuffer virtual BOOL WINAPI GetCancelProcessing() = 0; }; @@ -101,7 +102,7 @@ class CSalamanderThumbnailMakerAbstract class CPluginInterfaceForThumbLoaderAbstract { #ifdef INSIDE_SALAMANDER -private: // ochrana proti nespravnemu primemu volani metod (viz CPluginInterfaceForThumbLoaderEncapsulation) +private: // protection against incorrect direct calls to methods (see CPluginInterfaceForThumbLoaderEncapsulation) friend class CPluginInterfaceForThumbLoaderEncapsulation; #else // INSIDE_SALAMANDER public: From cd7665eb43ac1ee5b1547024a994c7175af8cf83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:23:10 +0200 Subject: [PATCH 193/710] [translation] Fix src/plugins/shared/spl_gui.h comments (#565) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/plugins/shared/spl_gui.h | 275 ++++++++++++++++++----------------- 1 file changed, 138 insertions(+), 137 deletions(-) diff --git a/src/plugins/shared/spl_gui.h b/src/plugins/shared/spl_gui.h index 776d9570d..f1836887d 100644 --- a/src/plugins/shared/spl_gui.h +++ b/src/plugins/shared/spl_gui.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED //**************************************************************************** // @@ -37,8 +38,8 @@ // (pokud dojde mysi akci, je rovno TRUE (pouzit GetMessagePos); \ // pokud jde o klavesnicovou akci VK_APPS nebo Shift+F10, je rovno FALSE)] \ // p.s. pokud vrati TRUE, dojde ke spusteni prikazu menu nebo otevreni submenu \ - // Pokud chceme v Salamu pretypovat menuPopup na CMenuPopup, \ - // pouzijeme (CMenuPopup*)(CGUIMenuPopupAbstract*)menuPopup. + // To cast menuPopup to CMenuPopup in Salamander, \ + // use (CMenuPopup*)(CGUIMenuPopupAbstract*)menuPopup. // toolbar messages #define WM_USER_TBDROPDOWN WM_APP + 220 // [HWND hToolBar, int buttonIndex] @@ -68,27 +69,27 @@ class CGUIProgressBarAbstract { public: - // nastavuje progres, pripadne text uprostred + // Sets the progress and optionally the text in the center // - // existuje bezpecnejsi varianta SetProgress2(), podivejte se na ni nez pouzijete tuto metodu + // A safer variant, SetProgress2(), exists; check it before using this method. // - // progres dokaze pracovat ve dvou rezimech: + // The progress control can work in two modes: // 1) pro 'progress' >= 0 jde o klasicky teplomer 0% az 100% - // v tomto rezimu lze pomoci promenne 'text' nastavit vlastni text zobrazeny uprostred + // in this mode, the 'text' variable can be used to set custom text shown in the center // pokud je 'text' == NULL, zobrazi se uprostred standardni procenta // 2) pro 'progress' == -1 jde o neurcity stav, kdy maly obdelnicek jezdi tam a zpet - // pohyb se ridi pomoci metod SetSelfMoveTime(), SetSelfMoveSpeed() a Stop() + // the movement is controlled by SetSelfMoveTime(), SetSelfMoveSpeed(), and Stop() // - // prekresleni se provadi okamzite; u vetsiny operaci je vhodne data ukladat v parent - // dialogu do cache a spustit si 100ms timer, na ktery teprve volat tuto metodu + // Redrawing happens immediately; for most operations it is better to cache the data in the parent + // dialog and start a 100 ms timer that calls this method. // - // mozne volat z libovolneho threadu, thread s controlem musi bezet, jinak dojde k zablokovani - // (pro doruceni hodnoty 'progress' controlu se pouziva SendMessage); + // Can be called from any thread, but the control's thread must be running or the call will block + // (SendMessage is used to deliver the 'progress' value to the control); virtual void WINAPI SetProgress(DWORD progress, const char* text) = 0; - // ma vyznam v kombinaci s volanim SetProgress(-1) - // urcuje kolik milisekund po zavolani SetProgress(-1) se jeste bude obdelnicek sam pohybovat - // pokud v tuto dobu dojde k zavolani dalsiho SetProgress(-1), cas se pocita zase od zacatku + // Used together with SetProgress(-1) + // specifies how many milliseconds after calling SetProgress(-1) the rectangle keeps moving on its own + // if another SetProgress(-1) is called during that time, the timer starts over // pokud je 'time'==0, posune se obdelnicek pouze jednou prave pri zavolani SetProgress(-1) // pro hodnotu 'time'==0xFFFFFFFF se bude obdelnicek posouvat do nekonecna (implicitni hodnota) virtual void WINAPI SetSelfMoveTime(DWORD time) = 0; @@ -102,26 +103,26 @@ class CGUIProgressBarAbstract // pokud se obdelnicek prave pohybuje (diky SetSelfMoveTime), bude zastaven virtual void WINAPI Stop() = 0; - // nastavuje progres, pripadne text uprostred + // Sets the progress and optionally the text in the center // // proti SetProgress() ma vyhodu v tom, ze pokud je 'progressCurrent' >= 'progressTotal', - // nastavi progres primo: je-li 'progressTotal' 0 nastavi 0%, jinak 100% a neprovadi vypocet - // (je nesmyslny + rve na nem RTC kvuli pretypovani), tento "nepovoleny" stav nastava - // napr. pri zvetseni souboru behem operace nebo pri praci s linky na soubor - linky maji - // nulovou velikost, ale pak jsou na nich data o velikosti nalinkovaneho souboru, - // pokud si vypocet provedete sami, je nutne tento "nepovoleny" stav osetrit - // - // progres dokaze pracovat ve dvou rezimech (viz SetProgress()), touto metodou lze - // nastavovat jen v rezimu 1): - // 1) jde o klasicky teplomer 0% az 100% - // v tomto rezimu lze pomoci promenne 'text' nastavit vlastni text zobrazeny uprostred + // it sets the progress directly: 0% if 'progressTotal' is 0, otherwise 100%, and does not do the calculation + // (it is meaningless and triggers RTC because of type conversion). This "invalid" state occurs, + // for example, when a file grows during the operation or when working with file links - the links have + // zero size, but then contain data with the size of the linked file. + // If you calculate the value yourself, you must handle this "invalid" state. + // + // The progress control can work in two modes (see SetProgress()); this method can be used + // only in mode 1: + // 1) it is a standard thermometer from 0% to 100% + // in this mode, the 'text' variable can be used to set custom text shown in the center // pokud je 'text' == NULL, zobrazi se uprostred standardni procenta // - // prekresleni se provadi okamzite; u vetsiny operaci je vhodne data ukladat v parent - // dialogu do cache a spustit si 100ms timer, na ktery teprve volat tuto metodu + // Redrawing happens immediately; for most operations it is better to cache the data in the parent + // dialog and start a 100 ms timer that calls this method. // - // mozne volat z libovolneho threadu, thread s controlem musi bezet, jinak dojde k zablokovani - // (pro doruceni hodnoty 'progress' controlu se pouziva SendMessage); + // Can be called from any thread, but the control's thread must be running or the call will block + // (SendMessage is used to deliver the 'progress' value to the control); virtual void WINAPI SetProgress2(const CQuadWord& progressCurrent, const CQuadWord& progressTotal, const char* text) = 0; @@ -182,7 +183,7 @@ class CGUIProgressBarAbstract #define STF_END_ELLIPSIS 0x0000000020 // pokud bude text prilis dlouhy, bude ukoncen vypustkou "..." #define STF_PATH_ELLIPSIS 0x0000000040 // pokud bude text prilis dlouhy, bude zkracen a bude do nej vlozena \ // vypustka "..." tak, aby byl konec viditelny -#define STF_HANDLEPREFIX 0x0000000080 // znaky za '&' budou podtrzene; nelze pouzit s STF_END_ELLIPSIS nebo s STF_PATH_ELLIPSIS +#define STF_HANDLEPREFIX 0x0000000080 // Characters after '&' are underlined; cannot be used with STF_END_ELLIPSIS or STF_PATH_ELLIPSIS class CGUIStaticTextAbstract { @@ -191,20 +192,20 @@ class CGUIStaticTextAbstract // // Control lze v dialogu navstivit z klavesnice, pokud mu priradime styl WS_TABSTOP. public: - // nastavi text controlu; volani teto metody je rychlejsi a mene vypocetne narocne - // nez nastavovani textu pomoci WM_SETTEXT; vraci TRUE v pripade uspechu, jinak FALSE + // Sets the control text; calling this method is faster and less computationally expensive + // than setting the text with WM_SETTEXT; returns TRUE on success, otherwise FALSE virtual BOOL WINAPI SetText(const char* text) = 0; - // vrati text controlu; mozne volat z libovolneho threadu; - // vrati NULL, pokud jeste nebylo volano SetText a static control byl bez textu + // Returns the control text; can be called from any thread. + // Returns NULL if SetText has not been called yet and the static control had no text virtual const char* WINAPI GetText() = 0; // nastavi znak pro oddeleni casti cesty; ma vyznam v pripade STF_PATH_ELLIPSIS; // implicitne je nastaveno na '\\'; virtual void WINAPI SetPathSeparator(char separator) = 0; - // priradi text, ktery bude zobrazen jako tooltip - // vraci TRUE, pokud se podarilo naalokovat kopii textu, jinak vraci FALSE + // Sets the text to be shown as a tooltip + // returns TRUE if a copy of the text was allocated successfully, otherwise FALSE virtual BOOL WINAPI SetToolTipText(const char* text) = 0; // priradi okno a id, kteremu se pri zobrazeni tooltipu zasle WM_USER_TTGETTEXT @@ -223,12 +224,12 @@ class CGUIHyperLinkAbstract // // Control lze v dialogu navstivit z klavesnice, pokud mu priradime styl WS_TABSTOP. public: - // nastavi text controlu; volani teto metody je rychlejsi a mene vypocetne narocne - // nez nastavovani textu pomoci WM_SETTEXT; vraci TRUE v pripade uspechu, jinak FALSE + // Sets the control text; calling this method is faster and less computationally expensive + // than setting the text with WM_SETTEXT; returns TRUE on success, otherwise FALSE virtual BOOL WINAPI SetText(const char* text) = 0; - // vrati text controlu; mozne volat z libovolneho threadu - // vrati NULL, pokud jeste nebylo volano SetText a static control byl bez textu + // Returns the control text; can be called from any thread. + // Returns NULL if SetText has not been called yet and the static control had no text virtual const char* WINAPI GetText() = 0; // priradi akci otevreni URL adresy (file="https://www.altap.cz") nebo @@ -239,19 +240,19 @@ class CGUIHyperLinkAbstract // priradi akci PostCommand(WM_COMMAND, command, 0) do parent okna virtual void WINAPI SetActionPostCommand(WORD command) = 0; - // priradi akci zobrazeni hintu a tooltipu 'text' + // Assigns the action that shows the hint and tooltip text 'text' // pokud je text NULL, je mozne tooltip priradit volanim metody // SetToolTipText nebo SetToolTip; metoda pak vraci vzdy TRUE // pokud je text ruzny od NULL, vraci metoda TRUE, pokud se podarilo // naalokovat kopii textu, jinak vraci FALSE - // tooltip je mozne zobrazit kavesou Space/Up/Down (pokud je focus - // na controlu) a kliknutim mysi; hint (tooltip) je pak zobrazen primo - // pod textem a nezavre se dokud uzivatel neklikne mimo nej mysi nebo - // nestiskne nejakou klavesu + // the tooltip can be shown with Space/Up/Down (if the control + // has focus) or by clicking the mouse; the hint (tooltip) is then shown directly + // below the text and stays open until the user clicks outside it with the mouse or + // presses a key virtual BOOL WINAPI SetActionShowHint(const char* text) = 0; - // priradi text, ktery bude zobrazen jako tooltip - // vraci TRUE, pokud se podarilo naalokovat kopii textu, jinak vraci FALSE + // Sets the text to be shown as a tooltip + // returns TRUE if a copy of the text was allocated successfully, otherwise FALSE virtual BOOL WINAPI SetToolTipText(const char* text) = 0; // priradi okno a id, kteremu se pri zobrazeni tooltipu zasle WM_USER_TTGETTEXT @@ -268,7 +269,7 @@ class CGUIButtonAbstract // Vsechny metody je mozne volat pouze z threadu parent okna, ve kterem // byl objekt pripojen na windows control a ziskan ukazatel na toto rozhrani. public: - // priradi text, ktery bude zobrazen jako tooltip; vraci TRUE v pripade uspechu, jinak FALSE + // Sets the text to be shown as a tooltip; returns TRUE on success, otherwise FALSE virtual BOOL WINAPI SetToolTipText(const char* text) = 0; // priradi okno a id, kteremu se pri zobrazeni tooltipu zasle WM_USER_TTGETTEXT @@ -409,66 +410,66 @@ Mask Members to retrieve or set. This member can be one or more of these values. Type - Typ polozky. Tato promenna muze nabivat jednu nebo vice hodnot: + Item type. This member can have one or more of these values: - MENU_TYPE_OWNERDRAW Vykresleni polozek zajisti okno vlasntici menu. - Pro kazdou polozku menu je zaslan dotaz WM_MEASUREITEM a - WM_DRAWITEM. Promenna TypeData obsahuje 32-buitovou - hodnotu definovanou aplikaci. + MENU_TYPE_OWNERDRAW Item drawing is handled by the window that owns the menu. + Each menu item receives WM_MEASUREITEM and + WM_DRAWITEM messages. The TypeData variable contains a 32-bit + application-defined value. - MENU_TYPE_RADIOCHECK Checked polozky jsou zobrazovany s teckou misto s fajfkou, + MENU_TYPE_RADIOCHECK Checked items are shown with a dot instead of a check mark, je-li HBmpChecked rovno NULL. - MENU_TYPE_SEPARATOR Horiznotalni oddelovaci cara. TypeData nema vyznam. + MENU_TYPE_SEPARATOR Horizontal separator line. TypeData has no meaning. - MENU_TYPE_STRING Polozka obsahuje textovy retezec. TypeData ukazuje na nulou - zakonceny retzec. + MENU_TYPE_STRING The item contains a text string. TypeData points to a null- + terminated string. - MENU_TYPE_BITMAP Polozka obsahuje bitmapu. + MENU_TYPE_BITMAP The item contains a bitmap. - Hodnoty MENU_TYPE_BITMAP, MENU_TYPE_SEPARATOR a MENU_TYPE_STRING nemohou byt pouzity spolecne. + MENU_TYPE_BITMAP, MENU_TYPE_SEPARATOR, and MENU_TYPE_STRING cannot be used together. State - Stav polozky. Tato promenna muze nabivat jednu nebo vice hodnot: + Item state. This member can have one or more of these values: - MENU_STATE_CHECKED Polozka je checked. + MENU_STATE_CHECKED The item is checked. - MENU_STATE_DEFAULT Menu muze obsahovat pouze jednu default polozku. Je - vykreslna tucne. + MENU_STATE_DEFAULT The menu can contain only one default item. It is + drawn in bold. - MENU_STATE_GRAYED Zakaze polozku - bude sediva a nepujde vybrat. + MENU_STATE_GRAYED Disables the item - it is shown gray and cannot be selected. SkillLevel - Uzivatelska uroven polozky. Tato promena muze nabyvat jedne z hodnot: + User skill level of the item. This member can have one of these values: - MENU_LEVEL_BEGINNER zacatecnik - bude se zobrazovat vzdy - MENU_LEVEL_INTERMEDIATE stredni - bude se zobrazovat guru a strednim uzivatelum - MENU_LEVEL_ADVANCED pokrocily - bude se zobrazovat pouze guru uzivatelum + MENU_LEVEL_BEGINNER beginner - always shown + MENU_LEVEL_INTERMEDIATE intermediate - shown to guru and intermediate users + MENU_LEVEL_ADVANCED advanced - shown only to guru users ID - Aplikaci definovana 16-bitova hodnota, ktera identifikuje polozku menu. + Application-defined 16-bit value that identifies the menu item. SubMenu - Ukazatel na popup menu pripojeneho na tutu polozku. Pokud tato polozka + Pointer to the popup menu attached to this item. If this item neotevira submenu, je SubMenu rovno NULL. HBmpChecked - Handle bitmapy, ktera je zobrazena pred polozkou v pripade, ze je polozka + Handle of the bitmap shown before the item when the item is checked. Je-li tato promenna rovna NULL, pouzije - se implicitni bitmapa. Jel-li nastaven bit MENU_TYPE_RADIOCHECK, je implicitni - bitmapa tecka, jinak zatrznitko. Je-li ImageIndex ruzne od -1, nebude - se tato bitmapa pouzivat. + bitmap is used. If the MENU_TYPE_RADIOCHECK bit is set, the default + bitmap is a dot; otherwise it is a check mark. If ImageIndex is not -1, + this bitmap is not used. HBmpUnchecked - Handle bitmapy, ktera je zobrazena pred polozkou v pripade, ze neni polozka + Handle of the bitmap shown before the item when the item is not checked. Jeli tato promenna rovna NULL, nebude - zobrazena zadna bitmapa. Je-li ImageIndex ruzne od -1, nebude - se tato bitmapa pouzivat. + bitmap is shown. If ImageIndex is not -1, + this bitmap is not used. ImageIndex Index bitmapy v ImageListu CMenuPopup::HImageList. Bitmapa je vykreslena - pred polozkou. V zavislosti na MENU_STATE_CHECKED a MENU_STATE_GRAYED. - Je-li promenna rovna -1, nebude se vykreslovat. + before the item, depending on MENU_STATE_CHECKED and MENU_STATE_GRAYED. + If the variable is -1, nothing is drawn. Enabler Ukazatel na DWORD, ktery urcuje stav polozky: TRUE->enabled, FALSE->grayed. @@ -1852,23 +1853,23 @@ class CGUIToolBarAbstract class CGUIIconListAbstract { public: - // vytvori image list s rozmerem ikony 'imageWidth' x 'imageHeight' a poctem ikon - // 'imageCount'; pomoci volani metody ReplaceIcon() je potom potreba image list naplnit; - // vraci TRUE v pripade uspechu, jinak FALSE + // Creates an image list with icon size 'imageWidth' x 'imageHeight' and 'imageCount' icons. + // The image list must then be filled by calling ReplaceIcon(). + // Returns TRUE on success, otherwise FALSE virtual BOOL WINAPI Create(int imageWidth, int imageHeight, int imageCount) = 0; - // vytvori se na zaklade dodaneho windows image listu ('hIL'); 'requiredImageSize' urcuje + // Creates the image list from the supplied Windows image list ('hIL'); 'requiredImageSize' specifies // rozmer ikony, pokud je -1, pouziji se rozmery z 'hIL'; v pripade uspechu vraci TRUE, // jinak FALSE virtual BOOL WINAPI CreateFromImageList(HIMAGELIST hIL, int requiredImageSize) = 0; - // vytvori se na zaklade dodaneho PNG resource; 'hInstance' a 'lpBitmapName' specifikuji resource, - // 'imageWidth' udava sirku jedne ikony v bodech; v pripade uspechu vraci TRUE, jinak FALSE - // poznamka: PNG musi byt pruh ikon jeden radek vysoky - // poznamka: PNG je vhodne komprimovat pomoci PNGSlim, viz https://forum.altap.cz/viewtopic.php?f=15&t=3278 + // Creates the image list from the specified PNG resource; 'hInstance' and 'lpBitmapName' specify the resource, + // 'imageWidth' specifies the width of one icon in pixels; returns TRUE on success, otherwise FALSE + // Note: the PNG must be a one-row strip of icons. + // Note: it is recommended to compress the PNG with PNGSlim; see https://forum.altap.cz/viewtopic.php?f=15&t=3278 virtual BOOL WINAPI CreateFromPNG(HINSTANCE hInstance, LPCTSTR lpBitmapName, int imageWidth) = 0; - // nahradi ikonu na danem indexu ikonou 'hIcon'; v pripade uspechu vraci TRUE, jinak FALSE + // Replaces the icon at the given index with 'hIcon'; returns TRUE on success, otherwise FALSE virtual BOOL WINAPI ReplaceIcon(int index, HICON hIcon) = 0; // vytvori ikonu z daneho indexu a vrati jeji handle; volajici je zodpovedny za jeji destrukci @@ -1886,8 +1887,8 @@ class CGUIIconListAbstract // provede se zaroven konverze na cernobilou verzi; v pripade uspechu vraci TRUE, jinak FALSE virtual BOOL WINAPI CreateAsCopy(const CGUIIconListAbstract* iconList, BOOL grayscale) = 0; - // vytvori HIMAGELIST, vraci jeho handle nebo NULL v pripade neuspechu - // vraceny imagelist je po pouziti treba destruovat pomoci API ImageList_Destroy() + // Creates an HIMAGELIST and returns its handle, or NULL on failure. + // The returned image list must be destroyed with the ImageList_Destroy() API after use virtual HIMAGELIST WINAPI GetImageList() = 0; }; @@ -1933,12 +1934,12 @@ class CGUIToolbarHeaderAbstract // (sectenych) TLBHDRMASK_xxx hodnot virtual void WINAPI CheckToolbar(DWORD checkMask) = 0; - // zavolanim teto metody volajici specifikuje okno 'hWnd', kteremu budou doruceny - // WM_COMMAND od ToolbarHeader; LOWORD(wParam) bude obsahovat 'ctrlID' z volani - // AttachToolbarHeader() a LOWORD(wParam) je jedna z hodnot TLBHDR_xxx (dle tlacitka, - // na ktere uzivatel kliknul) - // poznamka: tuto metodu je treba volat pouze ve specialnich situacich, kdy se zpravy - // maji dorucovat do jineho nez parent okna, kam se zpravy dorucuji implicitne + // By calling this method, the caller specifies the 'hWnd' window that receives + // WM_COMMAND messages from ToolbarHeader; LOWORD(wParam) contains the 'ctrlID' from + // AttachToolbarHeader(), and LOWORD(wParam) is one of the TLBHDR_xxx values (depending on the button + // clicked by the user). + // Note: call this method only in special cases when the messages + // must be delivered to a window other than the parent window, which receives them by default virtual void WINAPI SetNotifyWindow(HWND hWnd) = 0; }; @@ -2015,56 +2016,56 @@ class CSalamanderGUIAbstract // // Button // - // Slouzi pro vytvoreni tlacitka s textem nebo ikonou. Tlacitko muze obsahovat sipku - // vpravo nebo drop-down sipku. Viz flagy BTF_xxx. + // Creates a button with text or an icon. The button can contain a right arrow + // or a drop-down arrow. See the BTF_xxx flags. // - // pripoji Salamanderovsky TextArrowButton na Windows control (tento control urcuje pozici, - // text nebo ikonu a generovany command); 'hParent' je handle parent okna (dialog nebo okno); - // ctrlID je ID Windows controlu; - // pri uspesnem pripojeni vraci rozhrani CGUIButtonAbstract, jinak vraci NULL; rozhrani je - // platne az do okamziku destrukce (doruceni WM_DESTROY) Windows controlu; - // Testovano na Windows controlu "BUTTON". + // Attaches a Salamander TextArrowButton to a Windows control (that control determines the position, + // text or icon, and the generated command); 'hParent' is the handle of the parent window (dialog or window); + // ctrlID is the ID of the Windows control; + // on successful attachment, returns the CGUIButtonAbstract interface, otherwise returns NULL; the interface is + // valid until the Windows control is destroyed (WM_DESTROY is delivered); + // Tested on the Windows "BUTTON" control. virtual CGUIButtonAbstract* WINAPI AttachButton(HWND hParent, int ctrlID, DWORD flags) = 0; /////////////////////////////////////////////////////////////////////////// // // ColorArrowButton // - // Slouzi pro vytvoreni tlacitka s barevnym obdelnickem, ktery naselduje sipka smerujici vpravo. + // Creates a button with a colored rectangle followed by a right-pointing arrow. // (pokud je showArrow==TRUE) - // V obdelnicku je zobrazen text, ktery muze mit prirazenou jinou barvu nez barva pozadi obdelnicku. - // Pouziva se v konfiguracich barev, kde dokaze zobrazit jednu nebo dve barvy. - // Po stisku je vybaleno popup menu s moznosti zvolit, kterou barvu konfigurujeme.. + // The rectangle shows text that can have a different color than the rectangle background. + // It is used in color configuration dialogs, where it can display one or two colors. + // Clicking it opens a popup menu with options for selecting which color is being configured. // - // pripoji Salamanderovsky ColorArrowButton na Windows control (tento control urcuje pozici, - // text a command ColorArrowButtonu); 'hParent' je handle parent okna (dialog nebo okno); - // ctrlID je ID Windows controlu; + // Attaches a Salamander ColorArrowButton to a Windows control (that control determines the position, + // text and command of the ColorArrowButton); 'hParent' is the handle of the parent window (dialog or window); + // ctrlID is the ID of the Windows control; // pri uspesnem pripojeni vraci rozhrani ColorArrowButtonu, jinak vraci NULL; rozhrani je - // platne az do okamziku destrukce (doruceni WM_DESTROY) Windows controlu; - // Testovano na Windows controlu "BUTTON". + // valid until the Windows control is destroyed (WM_DESTROY is delivered); + // Tested on the Windows "BUTTON" control. virtual CGUIColorArrowButtonAbstract* WINAPI AttachColorArrowButton(HWND hParent, int ctrlID, BOOL showArrow) = 0; /////////////////////////////////////////////////////////////////////////// // // ChangeToArrowButton // - // Slouzi pro vytvoreni tlacitka s sipkou smerujici vpravo umistene uprostred - // tlacitka. Vklada se za vstupni pole a po stisku je vedle tlacitka vybaleno - // popup menu obsahujici polozky vlozitelne do vstupniho pole (forma napovedy). + // Creates a button with a right-pointing arrow centered on the button. + // It is placed after an edit box, and clicking it opens a popup menu next to the button + // with items that can be inserted into the edit box (a form of hint). // - // Meni styl tlacitka, aby mohlo drzet ikonku s sipkou a potom tuto ikonku - // prirazuje. Nepripojuje zadny Salamanderovsky objekt ke controlu, protoze - // vse zvladne operacni system. Vraci TRUE v pripade uspechul, jinak FALSE. - // Text tlacitka je ignorovan. - // Testovano na Windows controlu "BUTTON". + // Changes the button style so it can hold the arrow icon and then assigns the icon. + // It does not attach any Salamander object to the control because + // all handling is provided by the operating system. Returns TRUE on success, otherwise FALSE. + // The button text is ignored. + // Tested on the Windows "BUTTON" control. virtual BOOL WINAPI ChangeToArrowButton(HWND hParent, int ctrlID) = 0; /////////////////////////////////////////////////////////////////////////// // // MenuPopup // - // Slouzi pro vytvoreni prazdneho popup menu. Vraci ukazatel na iface nebo - // NULL pri chybe. + // Creates an empty popup menu. Returns an interface pointer or + // NULL on failure. virtual CGUIMenuPopupAbstract* WINAPI CreateMenuPopup() = 0; // Slouzi pro uvolneni alokovaneho menu. virtual BOOL WINAPI DestroyMenuPopup(CGUIMenuPopupAbstract* popup) = 0; @@ -2073,10 +2074,10 @@ class CSalamanderGUIAbstract // // MenuBar // - // Slouzi pro vytvoreni menu bar; polozky 'menu' budou zobrazeny v menu bar, - // jejich childy budou submenu; 'hNotifyWindow' identifikuje okno, kteremu - // budou zasilany commandy a notifikace. Vraci ukazatel na iface nebo NULL - // pri chybe. + // Creates a menu bar; the items in 'menu' are shown in the menu bar, + // and their children become submenus; 'hNotifyWindow' identifies the window + // that receives commands and notifications. Returns an interface pointer or NULL + // on failure. virtual CGUIMenuBarAbstract* WINAPI CreateMenuBar(CGUIMenuPopupAbstract* menu, HWND hNotifyWindow) = 0; // Slouzi pro uvolneni alokovane menu bar. Zaroven destruuje okno. virtual BOOL WINAPI DestroyMenuBar(CGUIMenuBarAbstract* menuBar) = 0; @@ -2146,26 +2147,26 @@ class CSalamanderGUIAbstract // ToolTip support // // Prohleda 'buf' na prvni vyskyt znaku '\t'. Pokud je 'stripHotKey' TRUE, ukonci - // se na tomto znaku retezec. Jinak se na jeho misto vlozi mezera a zbytek + // string is terminated at that character. Otherwise a space is inserted in its place and the rest // textu se ozavorkuje. Buffer 'buf' musi byt pri 'stripHotKey' FALSE dost velky - // na to, aby se text v bufferu mohl prodlouzit o dva znaky (uzavorkovani). + // for the text in the buffer to be extended by two characters (parentheses). virtual void WINAPI PrepareToolTipText(char* buf, BOOL stripHotKey) = 0; /////////////////////////////////////////////////////////////////////////// // // Subject with file/dir name truncated if needed // - // Nastavi text vznikly jako sprintf(, subjectFormatString, fileName) do staticu 'subjectWnd'. - // Formatovaci retezec 'subjectFormatString' musi obsahovat prave jedno '%s' (na miste vlozeni - // 'fileName'). Pokud by text presahl delku staticu, dojde k jeho zkraceni tim, ze se zkrati - // 'fileName'. Navic provede konverzi 'fileName' podle SALCFG_FILENAMEFORMAT (aby se shodoval + // Sets the text produced by sprintf(subjectFormatString, fileName) in the 'subjectWnd' static control. + // The format string 'subjectFormatString' must contain exactly one '%s' (where + // 'fileName' is inserted). If the text would exceed the static control length, it is truncated by shortening + // 'fileName'. It also converts 'fileName' according to SALCFG_FILENAMEFORMAT (so it matches // s tim, jak je 'fileName' zobrazeno v panelu) pomoci CSalamanderGeneralAbstract::AlterFileName. // Pokud jde o soubor, bude 'isDir' FALSE, jinak TRUE. Ma-li static 'subjectWnd' SS_NOPREFIX, - // bude 'duplicateAmpersands' FALSE, jinak TRUE (zdvoji druhy a dalsi ampersandy ('&'), prvni - // ampersand oznacuje hotkey v subjectu a musi ho obsahovat 'subjectFormatString' pred '%s'). - // Priklad pouziti: SetSubjectTruncatedText(GetDlgItem(HWindow, IDS_SUBJECT), "&Rename %s to", + // 'duplicateAmpersands' is FALSE; otherwise TRUE (it doubles the second and subsequent ampersands ('&'); the first + // ampersand marks the hotkey in the subject and must be present in 'subjectFormatString' before '%s'). + // Example: SetSubjectTruncatedText(GetDlgItem(HWindow, IDS_SUBJECT), "&Rename %s to", // file->Name, fileIsDir, TRUE) - // lze volat z libovolneho threadu + // Can be called from any thread virtual void WINAPI SetSubjectTruncatedText(HWND subjectWnd, const char* subjectFormatString, const char* fileName, BOOL isDir, BOOL duplicateAmpersands) = 0; From 6566fda70ab3390469cd2fe4bb1892ff0969c684 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:23:16 +0200 Subject: [PATCH 194/710] [translation] Fix src/plugins/shared/spl_com.h comments (#566) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/plugins/shared/spl_com.h | 385 +++++++++++++++++------------------ 1 file changed, 192 insertions(+), 193 deletions(-) diff --git a/src/plugins/shared/spl_com.h b/src/plugins/shared/spl_com.h index 2d4549d9c..e8b0bc1d8 100644 --- a/src/plugins/shared/spl_com.h +++ b/src/plugins/shared/spl_com.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED //**************************************************************************** // @@ -12,7 +13,7 @@ #pragma once #ifdef _MSC_VER -#pragma pack(push, enter_include_spl_com) // aby byly struktury nezavisle na nastavenem zarovnavani +#pragma pack(push, enter_include_spl_com) // so that the structures are independent of the current packing #pragma pack(4) #pragma warning(3 : 4706) // warning C4706: assignment within conditional expression #endif // _MSC_VER @@ -20,11 +21,10 @@ #pragma option -a4 #endif // __BORLANDC__ -// v pluginu je treba definovat promennou SalamanderVersion (int) a v SalamanderPluginEntry tuto -// promennou inicializovat: +// the plugin must define the SalamanderVersion variable (int) and initialize it in SalamanderPluginEntry: // SalamanderVersion = salamander->GetVersion(); -// globalni promenna s verzi Salamandera, ve kterem je tento plugin nacteny +// global variable with the Salamander version in which this plugin is loaded extern int SalamanderVersion; // @@ -185,11 +185,11 @@ struct CQuadWord BOOL operator<=(const CQuadWord& qw) const { return Value <= qw.Value; } BOOL operator>=(const CQuadWord& qw) const { return Value >= qw.Value; } - // prevod na double (pozor na ztratu presnosti u velkych cisel - double ma jen 15 platnych cislic) + // conversion to double (beware of precision loss for large numbers - double has only 15 significant digits) double GetDouble() const - { // MSVC neumi konverzi unsigned __int64 na double, takze si musime pomoct sami + { // MSVC cannot convert unsigned __int64 to double, so we have to help it if (Value < CQuadWord(0, 0x80000000).Value) - return (double)(__int64)Value; // kladne cislo + return (double)(__int64)Value; // positive number else return 9223372036854775808.0 + (double)(__int64)(Value - CQuadWord(0, 0x80000000).Value); } @@ -199,80 +199,80 @@ struct CQuadWord #define ICONOVERLAYINDEX_NOTUSED 15 // hodnota pro CFileData::IconOverlayIndex v pripade, ze ikona nema overlay -// zaznam kazdeho souboru a adresare v Salamanderovi (zakladni data o souboru/adresari) -struct CFileData // nesmi sem prijit destruktor ! +// record of each file and directory in Salamander (basic file/directory data) +struct CFileData // no destructor may be added here! { - char* Name; // naalokovane jmeno souboru (bez cesty), nutne alokovat na heapu - // Salamandera (viz CSalamanderGeneralAbstract::Alloc/Realloc/Free) + char* Name; // allocated file name (without the path), must be allocated on + // Salamander's heap (see CSalamanderGeneralAbstract::Alloc/Realloc/Free) char* Ext; // ukazatel do Name za prvni tecku zprava (vcetne tecky na zacatku jmena, // na Windows se chape jako pripona, narozdil od UNIXu) nebo na konec // Name, pokud pripona neexistuje; je-li v konfiguraci nastaveno FALSE // pro SALCFG_SORTBYEXTDIRSASFILES, je v Ext pro adresare ukazatel na konec // Name (adresare nemaji pripony) - CQuadWord Size; // velikost souboru v bytech - DWORD Attr; // atributy souboru - ORovane konstanty FILE_ATTRIBUTE_XXX - FILETIME LastWrite; // cas posledniho zapisu do souboru (UTC-based time) - char* DosName; // naalokovane DOS 8.3 jmeno souboru, neni-li treba je NULL, nutne - // alokovat na heapu Salamandera (viz CSalamanderGeneralAbstract::Alloc/Realloc/Free) - DWORD_PTR PluginData; // pouziva plugin skrze CPluginDataInterfaceAbstract, Salamander ignoruje + CQuadWord Size; // file size in bytes + DWORD Attr; // file attributes - ORed FILE_ATTRIBUTE_XXX constants + FILETIME LastWrite; // last-write time of the file (UTC-based time) + char* DosName; // allocated DOS 8.3 file name; if not needed it is NULL, must be + // allocated on Salamander's heap (see CSalamanderGeneralAbstract::Alloc/Realloc/Free) + DWORD_PTR PluginData; // used by the plugin through CPluginDataInterfaceAbstract; Salamander ignores it unsigned NameLen : 9; // delka retezce Name (strlen(Name)) - POZOR: maximalni delka jmena je (MAX_PATH - 5) unsigned Hidden : 1; // je hidden? (je-li 1, ikonka je pruhlednejsi o 50% - ghosted) unsigned IsLink : 1; // je link? (je-li 1, ikonka ma overlay linku) - standardni plneni viz CSalamanderGeneralAbstract::IsFileLink(CFileData::Ext), pri zobrazeni ma prednost pred IsOffline, ale IconOverlayIndex ma prednost unsigned IsOffline : 1; // je offline? (je-li 1, ikonka ma overlay offline - cerne hodiny), pri zobrazeni ma IsLink i IconOverlayIndex prednost - unsigned IconOverlayIndex : 4; // index icon-overlaye (pokud ikona nema zadny overlay, je zde hodnota ICONOVERLAYINDEX_NOTUSED), pri zobrazeni ma prednost pred IsLink a IsOffline - - // flagy pro interni pouziti v Salamanderovi: nuluji se pri pridani do CSalamanderDirectoryAbstract - unsigned Association : 1; // vyznam jen pro zobrazeni 'simple icons' - ikona asociovaneho souboru, jinak 0 - unsigned Selected : 1; // read-only flag oznaceni (0 - polozka neoznacena, 1 - polozka oznacena) - unsigned Shared : 1; // je adresar sdileny? u souboru se nepouziva - unsigned Archive : 1; // jedna se o archiv? pouziva se pro zobrazovani ikony archivu v panelu - unsigned SizeValid : 1; // je u adresare napocitana jeho velikost? - unsigned Dirty : 1; // je potreba tuto polozku prekreslit? (pouze docasna platnost; mezi nastavenim bitu a prekreslenim panelu nesmi byt pumpovana message queue, jinak muze dojit k prekresleni ikonky (icon reader) a tim resetu bitu! v dusledku se neprekresli polozka) + unsigned IconOverlayIndex : 4; // icon overlay index (if the icon has no overlay, this is ICONOVERLAYINDEX_NOTUSED); when displayed, it takes precedence over IsLink and IsOffline + + // flags for Salamander internal use: they are cleared when added to CSalamanderDirectoryAbstract + unsigned Association : 1; // meaningful only for displaying 'simple icons' - icon of the associated file, otherwise 0 + unsigned Selected : 1; // read-only selection flag (0 - item not selected, 1 - item selected) + unsigned Shared : 1; // is the directory shared? not used for files + unsigned Archive : 1; // is this an archive? used to display the archive icon in the panel + unsigned SizeValid : 1; // has the directory size already been computed? + unsigned Dirty : 1; // does this item need to be redrawn? (temporary only; the message queue must not be pumped between setting the bit and redrawing the panel, otherwise the icon may be redrawn by the icon reader and the bit reset; as a result the item will not be redrawn) unsigned CutToClip : 1; // je CUT-nutej na clipboardu? (je-li 1, ikonka je pruhlednejsi o 50% - ghosted) - unsigned IconOverlayDone : 1; // jen pro potreby icon-reader-threadu: ziskavame nebo uz jsme ziskavali icon-overlay? (0 - ne, 1 - ano) + unsigned IconOverlayDone : 1; // for icon-reader-thread use only: are we retrieving or have we already retrieved the icon overlay? (0 - no, 1 - yes) }; -// konstanty urcujici platnost dat, ktera jsou primo ulozena v CFileData (velikost, pripona, atd.) -// nebo se generuji z primo ulozenych dat automaticky (file-type se generuje z pripony); -// Name + NameLen jsou povinne (musi byt platne vzdy); platnost PluginData si ridi plugin sam -// (Salamander tento atribut ignoruje) -#define VALID_DATA_EXTENSION 0x0001 // pripona je ulozena v Ext (bez: vsechny Ext = konec Name) -#define VALID_DATA_DOSNAME 0x0002 // DOS name je ulozeno v DosName (bez: vsechny DosName = NULL) -#define VALID_DATA_SIZE 0x0004 // velikost v bytech je ulozena v Size (bez: vsechny Size = 0) -#define VALID_DATA_TYPE 0x0008 // file-type muze byt generovan z Ext (bez: negeneruje se) -#define VALID_DATA_DATE 0x0010 // datum modifikace (UTC-based) je ulozen v LastWrite (bez: vsechny datumy v LastWrite jsou 1.1.1602 v local time) -#define VALID_DATA_TIME 0x0020 // cas modifikace (UTC-based) je ulozen v LastWrite (bez: vsechny casy v LastWrite jsou 0:00:00 v local time) -#define VALID_DATA_ATTRIBUTES 0x0040 // atributy jsou ulozeny v Attr (ORovane Win32 API konstanty FILE_ATTRIBUTE_XXX) (bez: vsechny Attr = 0) -#define VALID_DATA_HIDDEN 0x0080 // "ghosted" priznak ikony je ulozen v Hidden (bez: vsechny Hidden = 0) +// constants that specify the validity of data stored directly in CFileData (size, extension, etc.) +// or generated automatically from directly stored data (file type is generated from the extension); +// Name + NameLen are mandatory (must always be valid); PluginData validity is managed by the plugin itself +// (Salamander ignores this field) +#define VALID_DATA_EXTENSION 0x0001 // extension is stored in Ext (without it: all Ext values point to the end of Name) +#define VALID_DATA_DOSNAME 0x0002 // DOS name is stored in DosName (without it: all DosName values = NULL) +#define VALID_DATA_SIZE 0x0004 // the size in bytes is stored in Size (without it: all Size values are 0) +#define VALID_DATA_TYPE 0x0008 // file type can be generated from Ext (without it: it is not generated) +#define VALID_DATA_DATE 0x0010 // modification date (UTC-based) is stored in LastWrite (without it: all dates in LastWrite are 1.1.1602 in local time) +#define VALID_DATA_TIME 0x0020 // modification time (UTC-based) is stored in LastWrite (without it: all times in LastWrite are 0:00:00 in local time) +#define VALID_DATA_ATTRIBUTES 0x0040 // attributes are stored in Attr (ORed Win32 API FILE_ATTRIBUTE_XXX constants) (without it: all Attr values are 0) +#define VALID_DATA_HIDDEN 0x0080 // 'ghosted' icon flag is stored in Hidden (without it: all Hidden values are 0) #define VALID_DATA_ISLINK 0x0100 // IsLink obsahuje 1 pokud jde o link, ikonka ma overlay linku (bez: vsechny IsLink = 0) -#define VALID_DATA_ISOFFLINE 0x0200 // IsOffline obsahuje 1 pokud jde o offline soubor/adresar, ikonka ma offline overlay (bez: vsechny IsOffline = 0) -#define VALID_DATA_PL_SIZE 0x0400 // ma smysl jen bez pouziti VALID_DATA_SIZE: plugin ma aspon pro nektere soubory/adresare ulozenou velikost v bytech (nekde v PluginData), pro ziskani teto velikosti Salamander vola CPluginDataInterfaceAbstract::GetByteSize() -#define VALID_DATA_PL_DATE 0x0800 // ma smysl jen bez pouziti VALID_DATA_DATE: plugin ma aspon pro nektere soubory/adresare ulozeny datum modifikace (nekde v PluginData), pro ziskani teto velikosti Salamander vola CPluginDataInterfaceAbstract::GetLastWriteDate() -#define VALID_DATA_PL_TIME 0x1000 // ma smysl jen bez pouziti VALID_DATA_TIME: plugin ma aspon pro nektere soubory/adresare ulozeny cas modifikace (nekde v PluginData), pro ziskani teto velikosti Salamander vola CPluginDataInterfaceAbstract::GetLastWriteTime() -#define VALID_DATA_ICONOVERLAY 0x2000 // IconOverlayIndex je index icon-overlaye (zadny overlay = hodnota ICONOVERLAYINDEX_NOTUSED) (bez: vsechny IconOverlayIndex = ICONOVERLAYINDEX_NOTUSED), zadani ikon viz CSalamanderGeneralAbstract::SetPluginIconOverlays +#define VALID_DATA_ISOFFLINE 0x0200 // IsOffline is 1 for an offline file/directory; the icon gets the offline overlay (without it: all IsOffline values are 0) +#define VALID_DATA_PL_SIZE 0x0400 // meaningful only when VALID_DATA_SIZE is not used: the plugin stores the size in bytes for at least some files/directories (somewhere in PluginData); Salamander calls CPluginDataInterfaceAbstract::GetByteSize() to retrieve it +#define VALID_DATA_PL_DATE 0x0800 // meaningful only when VALID_DATA_DATE is not used: the plugin stores the modification date for at least some files/directories (somewhere in PluginData); Salamander calls CPluginDataInterfaceAbstract::GetLastWriteDate() to retrieve it +#define VALID_DATA_PL_TIME 0x1000 // meaningful only when VALID_DATA_TIME is not used: the plugin stores the modification time for at least some files/directories (somewhere in PluginData); Salamander calls CPluginDataInterfaceAbstract::GetLastWriteTime() to retrieve it +#define VALID_DATA_ICONOVERLAY 0x2000 // IconOverlayIndex is the icon overlay index (no overlay = ICONOVERLAYINDEX_NOTUSED) (without it: all IconOverlayIndex values are ICONOVERLAYINDEX_NOTUSED); for assigning overlays see CSalamanderGeneralAbstract::SetPluginIconOverlays -#define VALID_DATA_NONE 0 // pomocna konstanta - platne je jen Name a NameLen +#define VALID_DATA_NONE 0 // helper constant - only Name and NameLen are valid #ifdef INSIDE_SALAMANDER -// VALID_DATA_ALL a VALID_DATA_ALL_FS_ARC jsou jen pro interni pouziti v Salamanderovi (jadre), -// pluginy si naORuji jen konstanty odpovidajici pluginem dodavanym datum (zamezi se tak problemum -// pri zavedeni dalsich konstant a jim odpovidajicim datum) +// VALID_DATA_ALL and VALID_DATA_ALL_FS_ARC are for Salamander core internal use only; +// plugins should OR only constants that correspond to data supplied by the plugin +// (to avoid problems when new constants and corresponding data are added) #define VALID_DATA_ALL 0xFFFF -#define VALID_DATA_ALL_FS_ARC (0xFFFF & ~VALID_DATA_ICONOVERLAY) // pro FS a archivy: vse krome icon-overlays +#define VALID_DATA_ALL_FS_ARC (0xFFFF & ~VALID_DATA_ICONOVERLAY) // for FS and archives: everything except icon overlays #endif // INSIDE_SALAMANDER -// Pokud je zapnuto skryvani hidden a system souboru a adresaru, nezobrazuji se v panelech polozky s -// Hidden==1 a Attr obsahujicim FILE_ATTRIBUTE_HIDDEN a/nebo FILE_ATTRIBUTE_SYSTEM. +// If hiding hidden and system files/directories is enabled, items with +// Hidden==1 and Attr containing FILE_ATTRIBUTE_HIDDEN and/or FILE_ATTRIBUTE_SYSTEM are not shown in panels. -// konstanty priznaku pro CSalamanderDirectoryAbstract: -// jmena souboru a adresaru (i v cestach) se maji porovnavat case-sensitive (bez tohoto flagu je -// porovnavani case-insensitive - standardni chovani ve Windows) +// CSalamanderDirectoryAbstract flag constants: +// file and directory names (including path components) are compared case-sensitively with this flag +// (without it, comparison is case-insensitive - the standard Windows behavior) #define SALDIRFLAG_CASESENSITIVE 0x0001 -// jmena podadresaru v ramci kazdeho adresare se nebudou testovat na duplicitu (tento -// test je casove narocny a je nutny jen v archivech, pokud se pridavaji polozky nejen -// do rootu - aby fungovalo napr. pridani "file1" na "dir1" nasledovane pridanim -// "dir1" - "dir1" se prida prvni operaci (automaticky se prida neexistujici cesta), -// druha operace uz jen obnovi udaje o "dir1" (nesmi ho pridat znovu)) +// subdirectory names within each directory are not checked for duplicates (this +// check is time-consuming and is needed only in archives when items are added not only +// to the root - e.g. so that adding 'file1' to 'dir1' followed by adding +// 'dir1' works correctly: the first operation adds 'dir1' automatically as a missing path, +// and the second operation only refreshes the data for 'dir1' instead of adding it again) #define SALDIRFLAG_IGNOREDUPDIRS 0x0002 class CPluginDataInterfaceAbstract; @@ -286,17 +286,17 @@ class CSalamanderDirectoryAbstract // VALID_DATA_ICONOVERLAY) a priznaku objektu (viz metoda SetFlags) virtual void WINAPI Clear(CPluginDataInterfaceAbstract* pluginData) = 0; - // zadani masky platnych dat, podle ktere se urcuje, ktera data z CFileData jsou platna - // a ktera se maji pouze "nulovat" (viz komentar k VALID_DATA_XXX); maska 'validData' - // obsahuje ORovane hodnoty VALID_DATA_XXX; standardni hodnota masky je suma vsech - // VALID_DATA_XXX krome VALID_DATA_ICONOVERLAY; masku platnych dat je potreba nastavit - // pred volanim AddFile/AddDir + // sets the valid data mask that determines which CFileData fields are valid + // and which should only be zeroed (see the VALID_DATA_XXX comment); the 'validData' mask + // contains ORed VALID_DATA_XXX values; the default mask is the sum of all + // VALID_DATA_XXX values except VALID_DATA_ICONOVERLAY; the valid data mask must be set + // before calling AddFile/AddDir virtual void WINAPI SetValidData(DWORD validData) = 0; - // nastaveni priznaku pro tento objekt; 'flags' je kombinace ORovanych priznaku SALDIRFLAG_XXX, - // standardni hodnota priznaku objektu je nula pro archivatory (zadny priznak neni nastaven) - // a SALDIRFLAG_IGNOREDUPDIRS pro file-systemy (smi se pridavat jen do rootu, test na duplicitu - // adresaru je zbytecny) + // sets flags for this object; 'flags' is a combination of ORed SALDIRFLAG_XXX flags; + // the default object flag value is zero for archivers (no flags set) + // and SALDIRFLAG_IGNOREDUPDIRS for file systems (they may add only to the root, so duplicate + // directory checks are unnecessary) virtual void WINAPI SetFlags(DWORD flags) = 0; // prida soubor na zadanou cestou (relativni k tomuto "salamander-adresari"), vraci uspech @@ -325,30 +325,30 @@ class CSalamanderDirectoryAbstract // zobrazuje se vzdy na zacatku listingu a ma specialni ikonu) virtual BOOL WINAPI AddDir(const char* path, CFileData& dir, CPluginDataInterfaceAbstract* pluginData) = 0; - // vraci pocet souboru v objektu + // returns the number of files in the object virtual int WINAPI GetFilesCount() const = 0; - // vraci pocet adresaru v objektu + // returns the number of directories in the object virtual int WINAPI GetDirsCount() const = 0; - // vraci soubor z indexu 'index', vracena data lze pouzit jen pro cteni + // returns the file at index 'index'; the returned data is read-only virtual CFileData const* WINAPI GetFile(int index) const = 0; - // vraci adresar z indexu 'index', vracena data lze pouzit jen pro cteni + // returns the directory at index 'index'; the returned data is read-only virtual CFileData const* WINAPI GetDir(int index) const = 0; - // vraci objekt CSalamanderDirectory pro adresar z indexu 'index', vraceny objekt lze - // pouzit jen pro cteni (objekty pro prazdne adresare nejsou alokovany, vraci se jeden - // globalni prazdny objekt - zmena tohoto objektu by se projevila globalne) + // returns the CSalamanderDirectory object for the directory at 'index'; the returned object is read-only + // (objects for empty directories are not allocated, so a single global empty object is returned + // - modifying that object would affect it globally) virtual CSalamanderDirectoryAbstract const* WINAPI GetSalDir(int index) const = 0; - // Pluginu umoznuje predem sdelit predpokladany pocet souboru a adresaru v tomto adresari. - // Salamander si upravi realokacni strategii tak, aby pridavani prvku prilis nebrzdilo. - // Ma smysl volat pro adresare obsahujici tisice souboru nebo adresaru. V pripade desitek - // tisic uz je zavolani teto metody temer nutnost, jinak realokace zaberou nekolik vterin. - // 'files' a 'dirs' tedy vyjadruji priblizny celkovy pocet souboru a adresaru. - // Pokud je nektera z hodnot -1, bude ji Salamander ignorovat. - // Metodu ma vyznam volat pouze pokud je adresar prazdny, tedy nebylo volano AddFile nebo AddDir. + // Lets the plugin tell Salamander the expected number of files and directories in this directory in advance. + // Salamander adjusts its reallocation strategy so adding items does not slow down too much. + // This is worth calling for directories containing thousands of files or directories. For tens of + // thousands, calling this method is almost necessary, otherwise reallocations can take several seconds. + // 'files' and 'dirs' therefore specify the approximate total number of files and directories. + // If either value is -1, Salamander ignores it. + // The method is useful only while the directory is empty, before AddFile or AddDir has been called. virtual void WINAPI SetApproximateCount(int files, int dirs) = 0; }; @@ -357,10 +357,10 @@ class CSalamanderDirectoryAbstract // SalEnumSelection a SalEnumSelection2 // -// konstanty vracene z SalEnumSelection a SalEnumSelection2 v parametru 'errorOccured' -#define SALENUM_SUCCESS 0 // chyba nenastala -#define SALENUM_ERROR 1 // nastala chyba a uzivatel si preje pokracovat v operaci (vynechaly se jen chybne soubory/adresare) -#define SALENUM_CANCEL 2 // nastala chyba a uzivatel si preje zrusit operaci +// constants returned by SalEnumSelection and SalEnumSelection2 in the 'errorOccured' parameter +#define SALENUM_SUCCESS 0 // no error occurred +#define SALENUM_ERROR 1 // an error occurred and the user chose to continue the operation (only the faulty files/directories were skipped) +#define SALENUM_CANCEL 2 // an error occurred and the user wants to cancel the operation // enumerator, vraci jmena souboru, konci vracenim NULL; // 'enumFiles' == -1 -> reset enumerace (po tomto volani zacina enumerace opet od zacatku), vsechny @@ -418,7 +418,7 @@ typedef const char*(WINAPI* SalEnumSelection2)(HWND parent, int enumFiles, const // // sada metod Salamandera pro praci se sloupci v panelu (vypinani/zapinani/pridavani/nastavovani) -// rezimy pohledu panelu +// panel view modes #define VIEW_MODE_TREE 1 #define VIEW_MODE_BRIEF 2 #define VIEW_MODE_DETAILED 3 @@ -426,29 +426,29 @@ typedef const char*(WINAPI* SalEnumSelection2)(HWND parent, int enumFiles, const #define VIEW_MODE_THUMBNAILS 5 #define VIEW_MODE_TILES 6 -#define TRANSFER_BUFFER_MAX 1024 // velikost bufferu pro prenos obsahu sloupcu z pluginu do Salamandera +#define TRANSFER_BUFFER_MAX 1024 // buffer size for transferring column contents from the plugin to Salamander #define COLUMN_NAME_MAX 30 #define COLUMN_DESCRIPTION_MAX 100 -// Identifikatory sloupcu. Sloupce vlozene pluginem maji nastaveno ID==COLUMN_ID_CUSTOM. -// Standardni sloupce Salamandera maji ostatni ID. -#define COLUMN_ID_CUSTOM 0 // sloupec je poskytovan pluginem - o ulozeni jeho dat se postara plugin -#define COLUMN_ID_NAME 1 // zarovnano vlevo, podporuje FixedWidth +// Column identifiers. Plugin-inserted columns have ID==COLUMN_ID_CUSTOM. +// Salamander standard columns have the other IDs. +#define COLUMN_ID_CUSTOM 0 // column provided by the plugin - the plugin is responsible for storing its data +#define COLUMN_ID_NAME 1 // left-aligned, supports FixedWidth // zarovnano vlevo, podporuje FixedWidth; samostatny sloupec "Ext", muze byt jen na indexu==1; // pokud sloupec neexistuje a v datech panelu (viz CSalamanderDirectoryAbstract::SetValidData()) // se nastavi VALID_DATA_EXTENSION, je sloupec "Ext" zobrazen ve sloupci "Name" #define COLUMN_ID_EXTENSION 2 -#define COLUMN_ID_DOSNAME 3 // zarovnano vlevo -#define COLUMN_ID_SIZE 4 // zarovnano vpravo -#define COLUMN_ID_TYPE 5 // zarovnano vlevo, podporuje FixedWidth -#define COLUMN_ID_DATE 6 // zarovnano vpravo -#define COLUMN_ID_TIME 7 // zarovnano vpravo -#define COLUMN_ID_ATTRIBUTES 8 // zarovnano vpravo -#define COLUMN_ID_DESCRIPTION 9 // zarovnano vlevo, podporuje FixedWidth - -// Callback pro naplneni bufferu znakama, ktere se maji zobrazit v prislusnem sloupci. -// Z duvodu optimalizace funkce nedostava/nevraci promenne prostrednictvim parametru, -// ale prostrednictvim globalni promennych (CSalamanderViewAbstract::GetTransferVariables). +#define COLUMN_ID_DOSNAME 3 // left-aligned +#define COLUMN_ID_SIZE 4 // right-aligned +#define COLUMN_ID_TYPE 5 // left-aligned, supports FixedWidth +#define COLUMN_ID_DATE 6 // right-aligned +#define COLUMN_ID_TIME 7 // right-aligned +#define COLUMN_ID_ATTRIBUTES 8 // right-aligned +#define COLUMN_ID_DESCRIPTION 9 // left-aligned, supports FixedWidth + +// Callback that fills the buffer with characters to be shown in the corresponding column. +// For optimization, the function does not receive/return variables through parameters, +// but through global variables (CSalamanderViewAbstract::GetTransferVariables). typedef void(WINAPI* FColumnGetText)(); // Callback pro ziskani indexu jednoduchych ikon pro FS s vlastnimi ikonami (pitFromPlugin). @@ -457,14 +457,14 @@ typedef void(WINAPI* FColumnGetText)(); // Z globalnich promennych callback vyuziva jen TransferFileData a TransferIsDir. typedef int(WINAPI* FGetPluginIconIndex)(); -// sloupec muze vzniknout dvema zpusoby: -// 1) Sloupec vytvoril Salamander na zaklade sablony aktualniho pohledu. -// V tomto pripade ukazatel 'GetText' (na plnici funkci) ukazuje do Salamandera -// a ziskava texty standardne z CFileData. -// Hodnota promenne 'ID' je ruzna od COLUMN_ID_CUSTOM. +// A column can be created in two ways: +// 1) The column was created by Salamander from the current view template. +// In this case, 'GetText' (the fill function pointer) points into Salamander +// and retrieves text from CFileData in the standard way. +// The 'ID' field is different from COLUMN_ID_CUSTOM. // -// 2) Sloupec pridal plugin na zaklade svych potreb. -// 'GetText' ukazuje do pluginu a 'ID' je rovno COLUMN_ID_CUSTOM. +// 2) The column was added by the plugin for its own needs. +// 'GetText' points into the plugin and 'ID' equals COLUMN_ID_CUSTOM. struct CColumn { @@ -487,62 +487,61 @@ struct CColumn // nastavi VALID_DATA_EXTENSION. Pro spojeni dvou // retezcu poslouzi CSalamanderGeneralAbstract::AddStrToStr(). - FColumnGetText GetText; // callback pro ziskani textu (popis u deklatace typu FColumnGetText) + FColumnGetText GetText; // callback used to obtain text (see the FColumnGetText declaration) - // FIXME_X64 - male pro ukazatel, neni nekdy potreba? - DWORD CustomData; // Neni pouzivana Salamanderem; plugin ji muze - // vyuzit pro rozliseni svych pridanych sloupcu. + // FIXME_X64 - too small for a pointer, is it ever needed? + DWORD CustomData; // Not used by Salamander; the plugin can + // use it to distinguish the columns added by the plugin. - unsigned SupportSorting : 1; // je sloupec mozne radit? + unsigned SupportSorting : 1; // can the column be sorted? - unsigned LeftAlignment : 1; // pro TRUE je sloupec zarovnavan vlevo; jinak vpravo + unsigned LeftAlignment : 1; // TRUE means the column is left-aligned; otherwise right-aligned - unsigned ID : 4; // identifikator sloupce - // Pro standardni sloupce poskytovane Salamanderem - // obsahuje hodnoty ruzne od COLUMN_ID_CUSTOM. - // Pro sloupce pridane pluginem obsahuje vzdy - // hodnotu COLUMN_ID_CUSTOM. + unsigned ID : 4; // column identifier + // For standard columns provided by Salamander, + // it contains values other than COLUMN_ID_CUSTOM. + // For columns added by the plugin, it always contains + // the value COLUMN_ID_CUSTOM. - // Promenne Width a FixedWidth muzou byt zmeneny uzivatelem behem prace s panelem. - // Standardni sloupce poskytovane Salamanderem maji zajisteno ukladani/nacitani - // techto hodnot. - // Hodnoty techto promennych pro sloupce poskytovane pluginem je treba ulozit/nacist - // v ramci pluginu. - // Sloupce, jejichz sirku pocita Salamander na zaklade obsahu a uzivatel ji nemuze - // menit, nazyvame 'elasticke'. Sloupce, pro ktere muze uzivatel nastavit sirku nazyvame - // 'pevne'/'fixed'. + // The Width and FixedWidth variables can be changed by the user while working with the panel. + // Salamander stores/loads these values for standard columns it provides. + // Values of these variables for plugin-provided columns must be stored/loaded + // by the plugin itself. + // Columns whose width Salamander calculates from their content and the user cannot + // change are called 'elastic'. Columns whose width the user can set are called + // 'fixed'. unsigned Width : 16; // Sirka sloupce v pripade, ze je v rezimu pevne (nastavitelne) sirky. - unsigned FixedWidth : 1; // Je sloupec v rezimu pevne (nastavitelne) sirky? - - // pracovni promenne (nikam se neukladaji a neni treba je inicializovat) - // jsou urcene pro interni potreby Salamandera a pluginy je ignoruji, - // protoze jejich obsah neni pri volani pluginu zaruceny - unsigned MinWidth : 16; // Minimalni sirka, na kterou muze byt sloupce smrsten. - // Je pocitana na zaklade nazvu sloupce a jeho raditelnosti - // tak, aby byla hlavicka sloupce vzdy viditelna + unsigned FixedWidth : 1; // is the column in fixed (user-adjustable) width mode? + + // working variables (not stored anywhere and need not be initialized) + // are reserved for Salamander's internal use and are ignored by plugins, + // because their contents are not guaranteed when plugin code is called + unsigned MinWidth : 16; // minimum width to which the column can be shrunk. + // It is computed from the column name and its sortability + // so that the column header is always visible }; -// Plugin prostrednictvim tohoto rozhrani muze pri zmene cesty zmenit rezim -// zobrazeni v panelu. Veskera prace se sloupci se tyka jen vsech detailed rezimu -// (Detailed + Types + tri volitelne rezimy Alt+8/9/0). Pri zmene cesty dostane -// plugin standardni sadu sloupcu nagenerovanou na zaklade sablony aktualniho -// pohledu. Plugin muze tuto sadu modifikovat. Modifikace neni trvaleho razu -// a pri pristi zmene cesty obdrzi plugin opet standardni sadu sloupcu. Muze tak -// napriklad odstranit nektery ze std. sloupcu. Pred novym plnenim std. sloupci -// dostane plugin prilezitost ulozeni informaci o svych sloupcich (COLUMN_ID_CUSTOM). -// Muze tak ulozit jejich 'Width' a 'FixedWidth', ktere uzivatel mohl v panelu -// nastavit (viz ColumnFixedWidthShouldChange() a ColumnWidthWasChanged() v interfacu -// CPluginDataInterfaceAbstract). Pokud plugin zmeni rezim pohledu, zmena je trvala -// (napr. prepnuti na rezim Thumbnails zustane i po opusteni pluginove cesty). +// Through this interface, the plugin can change the panel display mode when the path changes. +// All column operations apply only to the detailed modes +// (Detailed + Types + the three custom modes Alt+8/9/0). When the path changes, the +// plugin gets a standard set of columns generated from the current view template. +// The plugin can modify this set. The modification is not permanent, +// and on the next path change the plugin again receives the standard set of columns. It can, +// for example, remove one of the standard columns. Before the standard columns are rebuilt, +// the plugin gets a chance to store information about its own columns (COLUMN_ID_CUSTOM). +// It can store their 'Width' and 'FixedWidth', which the user may have changed in the panel +// (see ColumnFixedWidthShouldChange() and ColumnWidthWasChanged() in +// CPluginDataInterfaceAbstract). If the plugin changes the display mode, the change is permanent +// (e.g. switching to Thumbnails remains in effect even after leaving the plugin path). class CSalamanderViewAbstract { public: // -------------- panel ---------------- - // vraci rezim, ve kterem je zobrazen panel (tree/brief/detailed/icons/thumbnails/tiles) - // vraci jednu z hodnot VIEW_MODE_xxxx (rezim Detailed, Types a tri volitelne rezimy jsou - // vsechny VIEW_MODE_DETAILED) + // returns the panel display mode (tree/brief/detailed/icons/thumbnails/tiles) + // returns one of the VIEW_MODE_xxxx values (Detailed, Types, and the three custom modes + // all use VIEW_MODE_DETAILED) virtual DWORD WINAPI GetViewMode() = 0; // Nastavi rezim panelu na 'viewMode'. Pokud jde o nektery z detailed rezimu, muze @@ -601,23 +600,23 @@ class CSalamanderViewAbstract // ------------- columns --------------- - // vraci pocet sloupcu v panelu (vzdy minimalne jeden, protoze nazev bude vzdy zobrazen) + // returns the number of columns in the panel (always at least one, because Name is always shown) virtual int WINAPI GetColumnsCount() = 0; - // vraci ukazatel na sloupec (pouze pro cteni) - // 'index' udava, ktery ze sloupcu bude vracen; pokud sloupec 'index' neexistuje, vraci NULL + // returns a pointer to the column (read-only) + // 'index' specifies which column is returned; returns NULL if the column at 'index' does not exist virtual const CColumn* WINAPI GetColumn(int index) = 0; - // Vlozi sloupec na pozici 'index'. Na pozici 0 je vzdy umisten sloupec Name, - // pokud je zobrazen sloupec Ext, bude na pozici 1. Jinak lze sloupec umistit - // libovolne. Struktura 'column' bude prekopirovana do vnitrnich struktur - // Salamandera. Vraci TRUE pokud byl sloupec vlozen. + // Inserts a column at position 'index'. The Name column is always at position 0, + // and if the Ext column is shown, it is at position 1. Otherwise the column may be inserted + // at any position. The 'column' structure is copied into Salamander's internal structures. + // Returns TRUE if the column was inserted. virtual BOOL WINAPI InsertColumn(int index, const CColumn* column) = 0; - // Vlozi standardni sloupec s ID 'id' na pozici 'index'. Na pozici 0 je vzdy - // umisten sloupec Name, pokud je vkladan sloupec Ext, musi to byt na pozici 1. - // Jinak lze sloupec umistit libovolne. 'id' je jedna z hodnot COLUMN_ID_xxxx, - // mimo COLUMN_ID_CUSTOM a COLUMN_ID_NAME. + // Inserts the standard column with ID 'id' at position 'index'. The Name column is always + // at position 0; if the Ext column is inserted, it must be at position 1. + // Otherwise the column may be inserted at any position. 'id' is one of the COLUMN_ID_xxxx values, + // except COLUMN_ID_CUSTOM and COLUMN_ID_NAME. virtual BOOL WINAPI InsertStandardColumn(int index, DWORD id) = 0; // Nastavi nazev a popis sloupce (nesmi byt prazdne retezce ani NULL). Delky @@ -630,11 +629,11 @@ class CSalamanderViewAbstract // null-terminatory) - viz CSalamanderGeneralAbstract::AddStrToStr(). virtual BOOL WINAPI SetColumnName(int index, const char* name, const char* description) = 0; - // Odstrani sloupec na pozici 'index'. Lze odstranit jak sloupce pridane pluginem, - // tak standardni sloupce Salamandera. Nelze odstranit sloupec 'Name', ktery je vzdy - // na indexu 0. Pozor pri odstranovani sloupce 'Ext', pokud je v datech pluginu - // (viz CSalamanderDirectoryAbstract::SetValidData()) VALID_DATA_EXTENSION, musi - // se jmeno+popis sloupce 'Ext' objevit u sloupce 'Name'. + // Removes the column at position 'index'. Both plugin-added columns + // and Salamander's standard columns can be removed. The Name column, which is always + // at index 0, cannot be removed. Be careful when removing the Ext column: if plugin data + // (via CSalamanderDirectoryAbstract::SetValidData()) includes VALID_DATA_EXTENSION, + // the Ext column name+description must appear under the Name column. virtual BOOL WINAPI DeleteColumn(int index) = 0; }; @@ -670,15 +669,15 @@ class CPluginDataInterfaceAbstract // vrati TRUE, a pro vsechny adresare, pokud CallReleaseForDirs vrati TRUE virtual void WINAPI ReleasePluginData(CFileData& file, BOOL isDir) = 0; - // jen pro data archivu (pro FS se nedoplnuje up-dir symbol): - // pozmenuje navrhovany obsah up-dir symbolu (".." nahore v panelu); 'archivePath' - // je cesta v archivu, pro kterou je symbol urcen; v 'upDir' vstupuji navrzena - // data symbolu: jmeno ".." (nemenit), date&time archivu, zbytek nulovany; - // v 'upDir' vystupuji zmeny pluginu, predevsim by mel zmenit 'upDir.PluginData', - // ktery bude vyuzivan na up-dir symbolu pri ziskavani obsahu pridanych sloupcu; - // pro 'upDir' se nebude volat ReleasePluginData, jakekoliv potrebne uvolnovani - // je mozne provest vzdy pri dalsim volani GetFileDataForUpDir nebo pri uvolneni - // celeho interfacu (v jeho destruktoru - volan z + // archive data only (FS does not add an up-dir symbol): + // modifies the proposed contents of the up-dir symbol ('..' at the top of the panel); 'archivePath' + // is the archive path the symbol is for; 'upDir' receives the proposed symbol + // data: the name '..' (do not change it), the archive date&time, everything else zeroed; + // 'upDir' returns plugin changes, mainly 'upDir.PluginData', + // which is used by the up-dir symbol when obtaining the contents of added columns; + // ReleasePluginData will not be called for 'upDir'; any necessary cleanup + // can always be done on the next call to GetFileDataForUpDir or when the + // entire interface is released (in its destructor - called from // CPluginInterfaceAbstract::ReleasePluginDataInterface) virtual void WINAPI GetFileDataForUpDir(const char* archivePath, CFileData& upDir) = 0; @@ -854,30 +853,30 @@ class CSalamanderForOperationsAbstract // a podle jeji navratove hodnoty akci pripadne predcasne ukoncit virtual void WINAPI OpenProgressDialog(const char* title, BOOL twoProgressBars, HWND parent, BOOL fileProgress) = 0; - // vypise text 'txt' (i nekolik radku - provadi se rozpad na radky) do progress-dialogu + // writes text 'txt' (even multiple lines - it is split into lines) to the progress dialog virtual void WINAPI ProgressDialogAddText(const char* txt, BOOL delayedPaint) = 0; - // neni-li 'totalSize1' CQuadWord(-1, -1), nastavi 'totalSize1' jako 100 procent prvniho progress-metru, - // neni-li 'totalSize2' CQuadWord(-1, -1), nastavi 'totalSize2' jako 100 procent druheho progress-metru - // (pro progress-dialog s jednim progress-metrem je povinne 'totalSize2' CQuadWord(-1, -1)) + // if 'totalSize1' is not CQuadWord(-1, -1), sets 'totalSize1' as 100 percent of the first progress bar; + // if 'totalSize2' is not CQuadWord(-1, -1), sets 'totalSize2' as 100 percent of the second progress bar + // (for a progress dialog with a single progress bar, 'totalSize2' must be CQuadWord(-1, -1)) virtual void WINAPI ProgressSetTotalSize(const CQuadWord& totalSize1, const CQuadWord& totalSize2) = 0; - // neni-li 'size1' CQuadWord(-1, -1), nastavi velikost 'size1' (size1/total1*100 procent) na prvnim progress-metru, - // neni-li 'size2' CQuadWord(-1, -1), nastavi velikost 'size2' (size2/total2*100 procent) na druhem progress-metru - // (pro progress-dialog s jednim progress-metrem je povinne 'size2' CQuadWord(-1, -1)), vraci informaci jestli ma - // akce pokracovat (FALSE = konec) + // if 'size1' is not CQuadWord(-1, -1), sets 'size1' on the first progress bar (size1/total1*100 percent); + // if 'size2' is not CQuadWord(-1, -1), sets 'size2' on the second progress bar (size2/total2*100 percent) + // (for a progress dialog with a single progress bar, 'size2' must be CQuadWord(-1, -1)); returns whether the + // action should continue (FALSE = stop) virtual BOOL WINAPI ProgressSetSize(const CQuadWord& size1, const CQuadWord& size2, BOOL delayedPaint) = 0; - // prida (pripadne k oboum progress-metrum) velikost 'size' (size/total*100 procent progressu), - // vraci informaci jestli ma akce pokracovat (FALSE = konec) + // adds 'size' to one or both progress bars (size/total*100 percent progress), + // returns whether the action should continue (FALSE = stop) virtual BOOL WINAPI ProgressAddSize(int size, BOOL delayedPaint) = 0; - // enabluje/disabluje tlacitko Cancel + // enables/disables the Cancel button virtual void WINAPI ProgressEnableCancel(BOOL enable) = 0; - // vraci HWND dialogu progressu (hodi se pri vypisu chyb a dotazu pri otevrenem progress-dialogu) + // returns the progress dialog HWND (useful for showing errors and prompts while the progress dialog is open) virtual HWND WINAPI ProgressGetHWND() = 0; - // zavre progress-dialog + // closes the progress dialog virtual void WINAPI CloseProgressDialog() = 0; - // presune vsechny soubory ze 'source' adresare do 'target' adresare, - // navic premapovava predpony zobrazovanych jmen ('remapNameFrom' -> 'remapNameTo') - // vraci uspech operace + // moves all files from the 'source' directory to the 'target' directory, + // and also remaps displayed name prefixes ('remapNameFrom' -> 'remapNameTo') + // returns whether the operation succeeded virtual BOOL WINAPI MoveFiles(const char* source, const char* target, const char* remapNameFrom, const char* remapNameTo) = 0; }; From 2fad63be96891ee8c6d259dac244b39f0fff48ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:23:22 +0200 Subject: [PATCH 195/710] [translation] Fix src/plugins/shared/spl_file.h comments (#567) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/plugins/shared/spl_file.h | 168 ++++++++++++++++------------------ 1 file changed, 80 insertions(+), 88 deletions(-) diff --git a/src/plugins/shared/spl_file.h b/src/plugins/shared/spl_file.h index 634514801..c0f6354e3 100644 --- a/src/plugins/shared/spl_file.h +++ b/src/plugins/shared/spl_file.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED //**************************************************************************** // @@ -12,7 +13,7 @@ #pragma once #ifdef _MSC_VER -#pragma pack(push, enter_include_spl_file) // aby byly struktury nezavisle na nastavenem zarovnavani +#pragma pack(push, enter_include_spl_file) // so the structures are independent of the current packing alignment #pragma pack(4) #endif // _MSC_VER #ifdef __BORLANDC__ @@ -65,43 +66,43 @@ struct SAFE_FILE { - HANDLE HFile; // handle otevreneho souboru (pozor, je pod HANDLES jadra Salamanadera) - char* FileName; // nazev otevreneho souboru s plnou cestou - HWND HParentWnd; // handle okna hParent z volani SafeFileOpen/SafeFileCreate; pouziva se + HANDLE HFile; // handle of the open file (note: it is managed under Salamander core HANDLES) + char* FileName; // full path of the open file + HWND HParentWnd; // hParent window handle from the SafeFileOpen/SafeFileCreate call; it is used // pokud je hParent v nasledujich volani nastaven na HWND_STORED DWORD dwDesiredAccess; // > zaloha parametru pro API CreateFile - DWORD dwShareMode; // > pro jeji pripadne opakovani volani - DWORD dwCreationDisposition; // > v pripade chyb behem cteni nebo zapisu + DWORD dwShareMode; // > for possible retries + DWORD dwCreationDisposition; // > in case of read or write errors DWORD dwFlagsAndAttributes; // > - BOOL WholeFileAllocated; // TRUE pokud fce SafeFileCreate predalokovala cely soubor + BOOL WholeFileAllocated; // TRUE if SafeFileCreate preallocated the whole file }; #define HWND_STORED ((HWND) - 1) -#define SAFE_FILE_CHECK_SIZE 0x00010000 // FIXME: overit, ze nekonflikti s BUTTONS_xxx +#define SAFE_FILE_CHECK_SIZE 0x00010000 // FIXME: verify that it does not conflict with BUTTONS_xxx -// bity masky silentMask -// skip sekce -#define SILENT_SKIP_FILE_NAMEUSED 0x00000001 // preskakuje soubory, ktere nelze vytvorit, protoze uz \ - // existuje stejne pojmenovany adresar (old CNFRM_MASK_NAMEUSED) -#define SILENT_SKIP_DIR_NAMEUSED 0x00000002 // preskakuje adresare, ktere nelze vytvorit, protoze uz \ - // existuje stejne pojmenovany soubor (old CNFRM_MASK_NAMEUSED) -#define SILENT_SKIP_FILE_CREATE 0x00000004 // preskakuje soubory, ktere nelze vytvorit z jineho duvodu (old CNFRM_MASK_ERRCREATEFILE) -#define SILENT_SKIP_DIR_CREATE 0x00000008 // preskakuje adresare, ktere nelze vytvorit z jineho duvodu (old CNFRM_MASK_ERRCREATEDIR) -#define SILENT_SKIP_FILE_EXIST 0x00000010 // preskakuje soubory, ktere uz existuji (old CNFRM_MASK_FILEOVERSKIP) \ - // vylucuje se s SILENT_OVERWRITE_FILE_EXIST -#define SILENT_SKIP_FILE_SYSHID 0x00000020 // preskakuje System/Hidden soubory, ktere uz existuji (old CNFRM_MASK_SHFILEOVERSKIP) \ - // vylucuje se s SILENT_OVERWRITE_FILE_SYSHID -#define SILENT_SKIP_FILE_READ 0x00000040 // preskakuje soubory, pri jejichz cteni doslo k chybe -#define SILENT_SKIP_FILE_WRITE 0x00000080 // preskakuje soubory, pri jejichz zapisu doslo k chybe -#define SILENT_SKIP_FILE_OPEN 0x00000100 // preskakuje soubory, ktere nelze otevrit +// silentMask bit flags +// skip section +#define SILENT_SKIP_FILE_NAMEUSED 0x00000001 // skips files that cannot be created because a \\ + // a directory with the same name already exists (old CNFRM_MASK_NAMEUSED) +#define SILENT_SKIP_DIR_NAMEUSED 0x00000002 // skips directories that cannot be created because a \\ + // a file with the same name already exists (old CNFRM_MASK_NAMEUSED) +#define SILENT_SKIP_FILE_CREATE 0x00000004 // skips files that cannot be created for another reason (old CNFRM_MASK_ERRCREATEFILE) +#define SILENT_SKIP_DIR_CREATE 0x00000008 // skips directories that cannot be created for another reason (old CNFRM_MASK_ERRCREATEDIR) +#define SILENT_SKIP_FILE_EXIST 0x00000010 // skips files that already exist (old CNFRM_MASK_FILEOVERSKIP) \\ + // mutually exclusive with SILENT_OVERWRITE_FILE_EXIST +#define SILENT_SKIP_FILE_SYSHID 0x00000020 // skips existing System/Hidden files (old CNFRM_MASK_SHFILEOVERSKIP) \\ + // mutually exclusive with SILENT_OVERWRITE_FILE_SYSHID +#define SILENT_SKIP_FILE_READ 0x00000040 // skips files for which a read error occurred +#define SILENT_SKIP_FILE_WRITE 0x00000080 // skips files for which a write error occurred +#define SILENT_SKIP_FILE_OPEN 0x00000100 // skips files that cannot be opened -// overwrite sekce -#define SILENT_OVERWRITE_FILE_EXIST 0x00001000 // prepisuje soubory, ktere uz existuji (old CNFRM_MASK_FILEOVERYES) \ - // vylucuje se s SILENT_SKIP_FILE_EXIST -#define SILENT_OVERWRITE_FILE_SYSHID 0x00002000 // prepisuje System/Hidden soubory, ktere uz existuji (old CNFRM_MASK_SHFILEOVERYES) \ - // vylucuje se s SILENT_SKIP_FILE_SYSHID -#define SILENT_RESERVED_FOR_PLUGINS 0xFFFF0000 // tento prostor maji pluginy k dispozici pro vlastni flagy +// overwrite section +#define SILENT_OVERWRITE_FILE_EXIST 0x00001000 // overwrites files that already exist (old CNFRM_MASK_FILEOVERYES) \\ + // mutually exclusive with SILENT_SKIP_FILE_EXIST +#define SILENT_OVERWRITE_FILE_SYSHID 0x00002000 // overwrites existing System/Hidden files (old CNFRM_MASK_SHFILEOVERYES) \\ + // mutually exclusive with SILENT_SKIP_FILE_SYSHID +#define SILENT_RESERVED_FOR_PLUGINS 0xFFFF0000 // this range is reserved for plugin-specific flags class CSalamanderSafeFileAbstract { @@ -325,18 +326,16 @@ class CSalamanderSafeFileAbstract CQuadWord* allocateWholeFile, SAFE_FILE* file) = 0; - // // SafeFileClose - // Zavre soubor a uvolni alokovana dat ve strukture 'file'. + // Closes the file and frees the data allocated in the 'file' structure. // // Parameters // 'file' - // [in] Ukazatel na strukturu 'SAFE_FILE', ktera byla inicializovana uspesnym - // volanim metody SafeFileCreate nebo SafeFileOpen. + // [in] Pointer to a 'SAFE_FILE' structure initialized by a successful + // call to SafeFileCreate or SafeFileOpen. // // Remarks - // Metodu lze volat z libovolneho threadu. - // + // This method can be called from any thread. virtual void WINAPI SafeFileClose(SAFE_FILE* file) = 0; // @@ -450,76 +449,72 @@ class CSalamanderSafeFileAbstract DWORD* silentMask, BOOL seekForRead) = 0; - // // SafeFileGetSize - // Vraci velikost souboru. + // Returns the file size. // // 'file' - // [in] Ukazatel na strukturu 'SAFE_FILE', ktera byla inicializovana - // volanim metody SafeFileOpen nebo SafeFileCreate. + // [in] Pointer to a 'SAFE_FILE' structure initialized by a call to + // SafeFileOpen or SafeFileCreate. // - // 'lpBuffer' - // [out] Ukazatel na strukturu CQuadWord, ktera obdrzi velikost souboru. + // 'fileSize' + // [out] Pointer to a CQuadWord structure that receives the file size. // // 'error' - // [out] Ukazatel na promennou DWORD, ktera v pripade chyby bude obsahovat - // hodnotu vracenou z GetLastError(). 'error' muze byt NULL. + // [out] Pointer to a DWORD variable that receives the value returned + // by GetLastError() on failure. 'error' may be NULL. // // Return Values - // V pripade uspechu vraci TRUE a nastavi promennou 'fileSize'. - // V pripade chyby vraci FALSE a nastavi hodnotu promenne 'error', je-li ruzna od NULL. + // Returns TRUE on success and sets 'fileSize'. + // Returns FALSE on failure and sets 'error' if it is not NULL. // // Remarks - // Metodu lze volat z libovolneho threadu. - // + // This method can be called from any thread. virtual BOOL WINAPI SafeFileGetSize(SAFE_FILE* file, CQuadWord* fileSize, DWORD* error) = 0; - // // SafeFileRead - // Cte ze souboru data zacinajici na pozici ukazovatka. Po dokonceni operace je ukazovatko - // posunuto o pocet nactenych bajtu. Metoda podporuje pouze synchronni cteni, tedy nevrati - // se, dokud nejsou data nactena nebo dokud nenastala chyba. + // Reads data from the file starting at the current file pointer. After the + // operation completes, the file pointer is advanced by the number of bytes + // read. This method supports only synchronous reads, so it does not return + // until the data is read or an error occurs. // // Parameters // 'file' - // [in] Ukazatel na strukturu 'SAFE_FILE', ktera byla inicializovana - // volanim metody SafeFileOpen nebo SafeFileCreate. + // [in] Pointer to a 'SAFE_FILE' structure initialized by a call to + // SafeFileOpen or SafeFileCreate. // // 'lpBuffer' - // [out] Ukazatel na buffer, ktery obdrzi nactena data ze souboru. + // [out] Pointer to the buffer that receives the data read from the file. // // 'nNumberOfBytesToRead' - // [in] Urcuje kolik bajtu se ma ze souboru nacist. + // [in] Specifies how many bytes to read from the file. // // 'lpNumberOfBytesRead' - // [out] Ukazuje na promennou, ktera obdrzi pocet skutecne nactenych bajtu do bufferu. + // [out] Points to a variable that receives the actual number of bytes read + // into the buffer. // // 'hParent' - // [in] Handle okna, ke kteremu budou modalne zobrazovany chybove hlasky. - // Pokud je rovno HWND_STORED, pouzije se 'hParent' z volani SafeFileOpen/SafeFileCreate. + // [in] Handle of the window to which error messages are shown modally. + // If set to HWND_STORED, the 'hParent' from SafeFileOpen/SafeFileCreate is used. // // 'flags' - // [in] Jedna z hodnot BUTTONS_xxx pripadne navic s SAFE_FILE_CHECK_SIZE, urcuje tlacitka - // zobrazena v chybovych hlaskach. Pokud je nastaven bit SAFE_FILE_CHECK_SIZE, metoda SafeFileRead - // povazuje za chybu pokud se ji nepodari nacist pozadovany pocet bajtu a zobrazi chybovou - // hlasku. Bez tohoto bitu se chova stejne jako API ReadFile. + // [in] One of the BUTTONS_xxx values, optionally ORed with SAFE_FILE_CHECK_SIZE; + // determines the buttons shown in error messages. If the SAFE_FILE_CHECK_SIZE bit is set, + // SafeFileRead treats failure to read the requested number of bytes as an error and + // shows an error message. Without this bit, it behaves like the ReadFile API. // // 'pressedButton' // 'silentMask' - // Viz SafeFileOpen. + // See SafeFileOpen. // // Return Values - // V pripade uspechu vraci TRUE a hodnota promenne 'lpNumberOfBytesRead' je nastavena - // na pocet nactenych bajtu. + // On success, returns TRUE and sets 'lpNumberOfBytesRead' to the number of bytes read. // - // V pripade chyby vraci FALSE a nastavi hodnoty promennych 'pressedButton' a 'silentMask', - // jsou-li ruzne od NULL. + // On failure, returns FALSE and sets 'pressedButton' and 'silentMask' if they are not NULL. // // Remarks - // Metodu lze volat z libovolneho threadu. - // + // This method can be called from any thread. virtual BOOL WINAPI SafeFileRead(SAFE_FILE* file, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, @@ -529,47 +524,44 @@ class CSalamanderSafeFileAbstract DWORD* pressedButton, DWORD* silentMask) = 0; - // // SafeFileWrite - // Zapisuje data do souboru od pozice ukazovatka. Po dokonceni operace je ukazovatko - // posunuto o pocet zapsanych bajtu. Metoda podporuje pouze synchronni zapis, tedy nevrati - // se, dokud nejsou data zapsana nebo dokud nenastala chyba. + // Writes data to the file at the current file pointer. After the operation + // completes, the file pointer is advanced by the number of bytes written. + // This method supports only synchronous writes, so it does not return + // until the data is written or an error occurs. // // Parameters // 'file' - // [in] Ukazatel na strukturu 'SAFE_FILE', ktera byla inicializovana - // volanim metody SafeFileOpen nebo SafeFileCreate. + // [in] Pointer to a 'SAFE_FILE' structure initialized by a call to + // SafeFileOpen or SafeFileCreate. // // 'lpBuffer' - // [in] Ukazatel na buffer obsahujici data, ktera maji byt zapsana do souboru. + // [in] Pointer to the buffer containing the data to write to the file. // // 'nNumberOfBytesToWrite' - // [in] Urcuje kolik bajtu se ma z bufferu do souboru zapsat. + // [in] Specifies how many bytes to write from the buffer to the file. // // 'lpNumberOfBytesWritten' - // [out] Ukazuje na promennou, ktera obdrzi pocet skutecne zapsanych bajtu. + // [out] Points to a variable that receives the actual number of bytes written. // // 'hParent' - // [in] Handle okna, ke kteremu budou modalne zobrazovany chybove hlasky. - // Pokud je rovno HWND_STORED, pouzije se 'hParent' z volani SafeFileOpen/SafeFileCreate. + // [in] Handle of the window to which error messages are shown modally. + // If set to HWND_STORED, the 'hParent' from SafeFileOpen/SafeFileCreate is used. // // 'flags' - // [in] Jedna z hodnot BUTTONS_xxx, urcuje tlacitka zobrazena v chybovych hlaskach. + // [in] One of the BUTTONS_xxx values; determines the buttons shown in error messages. // // 'pressedButton' // 'silentMask' - // Viz SafeFileOpen. + // See SafeFileOpen. // // Return Values - // V pripade uspechu vraci TRUE a hodnota promenne 'lpNumberOfBytesWritten' je nastavena - // na pocet zapsanych bajtu. + // On success, returns TRUE and sets 'lpNumberOfBytesWritten' to the number of bytes written. // - // V pripade chyby vraci FALSE a nastavi hodnoty promennych 'pressedButton' a 'silentMask', - // jsou-li ruzne od NULL. + // On failure, returns FALSE and sets 'pressedButton' and 'silentMask' if they are not NULL. // // Remarks - // Metodu lze volat z libovolneho threadu. - // + // This method can be called from any thread. virtual BOOL WINAPI SafeFileWrite(SAFE_FILE* file, LPVOID lpBuffer, DWORD nNumberOfBytesToWrite, From 5e5c482613f90bd14c74615a303f667c7409bd0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:23:28 +0200 Subject: [PATCH 196/710] [translation] Fix src/plugins/shared/spl_fs.h comments (#568) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/plugins/shared/spl_fs.h | 250 +++++++++++++++++------------------- 1 file changed, 120 insertions(+), 130 deletions(-) diff --git a/src/plugins/shared/spl_fs.h b/src/plugins/shared/spl_fs.h index b95411019..bb721915c 100644 --- a/src/plugins/shared/spl_fs.h +++ b/src/plugins/shared/spl_fs.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED //**************************************************************************** // @@ -12,7 +13,7 @@ #pragma once #ifdef _MSC_VER -#pragma pack(push, enter_include_spl_fs) // aby byly struktury nezavisle na nastavenem zarovnavani +#pragma pack(push, enter_include_spl_fs) // so that the structures are independent of the current alignment setting #pragma pack(4) #endif // _MSC_VER #ifdef __BORLANDC__ @@ -97,33 +98,31 @@ class CSalamanderForViewFileOnFSAbstract // sada metod pluginu, ktere potrebuje Salamander pro praci s file systemem // typ ikon v panelu pri listovani FS (pouziva se v CPluginFSInterfaceAbstract::ListCurrentPath()) -#define pitSimple 0 // jednoduche ikonky pro soubory a adresare - podle pripony (asociace) -#define pitFromRegistry 1 // ikonky nacitane z registry podle pripony souboru/adresaru -#define pitFromPlugin 2 // ikonky obstarava plugin (ikony ziskava pres CPluginDataInterfaceAbstract) +#define pitSimple 0 // simple icons for files and directories - by extension (association) +#define pitFromRegistry 1 // icons loaded from the registry according to the file/directory extension +#define pitFromPlugin 2 // the plugin provides the icons (obtained via CPluginDataInterfaceAbstract) -// kody udalosti (a vyznam parametru 'param') na FS, prijima metoda CPluginFSInterfaceAbstract::Event(): -// CPluginFSInterfaceAbstract::TryCloseOrDetach vratil TRUE, ale novou cestu se nepodarilo -// otevrit, takze zustavame na soucasne ceste (FS, ktere prijme tuto zpravu); -// 'param' je panel obsahujici tento FS (PANEL_LEFT nebo PANEL_RIGHT) +// FS event codes (and the meaning of parameter 'param'), received by CPluginFSInterfaceAbstract::Event(): +// CPluginFSInterfaceAbstract::TryCloseOrDetach returned TRUE, but the new path could not be opened, so we stay on the current path (the FS that receives this message); +// 'param' is the panel containing this FS (PANEL_LEFT or PANEL_RIGHT) #define FSE_CLOSEORDETACHCANCELED 0 -// uspesne pripojeni noveho FS do panelu (po zmene cesty a jejim vylistovani) -// 'param' je panel obsahujici tento FS (PANEL_LEFT nebo PANEL_RIGHT) +// successful attachment of a new FS to the panel (after the path is changed and listed) +// 'param' is the panel containing this FS (PANEL_LEFT or PANEL_RIGHT) #define FSE_OPENED 1 -// uspesne pridani do seznamu odpojenych FS (konec rezimu "panel" FS, zacatek rezimu "detached" FS); -// 'param' je panel obsahujici tento FS (PANEL_LEFT nebo PANEL_RIGHT) +// successful addition to the list of detached FSs (end of "panel" FS mode, start of "detached" FS mode); +// 'param' is the panel containing this FS (PANEL_LEFT or PANEL_RIGHT) #define FSE_DETACHED 2 -// uspesne pripojeni odpojeneho FS (konec rezimu "detached" FS, zacatek rezimu "panel" FS); -// 'param' je panel obsahujici tento FS (PANEL_LEFT nebo PANEL_RIGHT) +// successful attachment of a detached FS (end of "detached" FS mode, start of "panel" FS mode); +// 'param' is the panel containing this FS (PANEL_LEFT or PANEL_RIGHT) #define FSE_ATTACHED 3 -// aktivace hlavniho okna Salamandera (pri minimalizovanem oknu se ceka na restore/maximize, -// a pak se teprve zasle tato udalost, aby se pripadna chybova okna ukazovala nad Salamanderem), -// chodi jen do FS, ktery je v panelu (neni odpojen), pokud se zmeny na FS nemonitoruji automaticky, -// oznamuje tato udalost vhodny okamzik k refreshi; -// 'param' je panel obsahujici tento FS (PANEL_LEFT nebo PANEL_RIGHT) +// activation of Salamander's main window (when the window is minimized, this event is sent only after restore/maximize so any error windows appear above Salamander), +// it is delivered only to an FS that is in a panel (not detached); if changes on the FS are not monitored automatically, +// this event indicates a suitable time to refresh; +// 'param' is the panel containing this FS (PANEL_LEFT or PANEL_RIGHT) #define FSE_ACTIVATEREFRESH 4 // vyprsel timeout jednoho z timeru tohoto FS, 'param' je parametr tohoto timeru; @@ -149,25 +148,19 @@ class CSalamanderForViewFileOnFSAbstract // // (FALSE, TRUE) pri zmene cesty mimo FS otevrene v panelu #define FSTRYCLOSE_CHANGEPATH 1 -// (FALSE->TRUE, FALSE) pro FS otevrene v panelu pri unloadu pluginu (user si preje unload + -// zavirani Salamandera + pred odstranenim pluginu + unload na zadost pluginu) +// (FALSE->TRUE, FALSE) for an FS open in a panel during plugin unload (user-requested unload + Salamander shutdown + before removing the plugin + unload requested by the plugin) #define FSTRYCLOSE_UNLOADCLOSEFS 2 -// (FALSE, TRUE) pri zmene cesty nebo refreshi (Ctrl+R) FS otevreneho v panelu se zjistilo, -// ze jiz zadna cesta na FS neni pristupna - Salamander se snazi zmenit cestu v panelu -// na fixed-drive (pokud mu to FS nedovoli, zustane FS v panelu bez souboru a adresaru) +// (FALSE, TRUE) when changing the path or refreshing (Ctrl+R) an FS open in a panel, it was found that no accessible path on the FS remains - Salamander tries to change the panel path to a fixed drive (if the FS does not allow it, the FS remains in the panel with no files or directories) #define FSTRYCLOSE_CHANGEPATHFAILURE 3 -// (FALSE, FALSE) pri pripojovani odpojeneho FS zpet do panelu se zjistilo, ze jiz zadna cesta -// na tomto FS neni pristupna - Salamander se snazi tento odpojeny FS zavrit (pokud FS odmitne, -// zustane dale na seznamu odpojenych FS - napr. v Alt+F1/F2 menu) +// (FALSE, FALSE) when reattaching a detached FS to a panel, it was found that no path on this FS is accessible any more - Salamander tries to close this detached FS (if the FS refuses, it remains in the list of detached FSs - e.g. in the Alt+F1/F2 menu) #define FSTRYCLOSE_ATTACHFAILURE 4 -// (FALSE->TRUE, FALSE) pro odpojeny FS pri unloadu pluginu (user si preje unload + -// zavirani Salamandera + pred odstranenim pluginu + unload na zadost pluginu) +// (FALSE->TRUE, FALSE) for a detached FS during plugin unload (user-requested unload + Salamander shutdown + before removing the plugin + unload requested by the plugin) #define FSTRYCLOSE_UNLOADCLOSEDETACHEDFS 5 -// (FALSE, FALSE) plugin zavolal CSalamanderGeneral::CloseDetachedFS() pro odpojeny FS +// (FALSE, FALSE) the plugin called CSalamanderGeneral::CloseDetachedFS() for a detached FS #define FSTRYCLOSE_PLUGINCLOSEDETACHEDFS 6 -// flagy oznacujici, ktere sluzby file-systemu plugin poskytuje - jake metody -// CPluginFSInterfaceAbstract jsou definovany): +// flags indicating which file-system services the plugin provides - which methods of +// CPluginFSInterfaceAbstract are defined: // copy from FS (F5 on FS) #define FS_SERVICE_COPYFROMFS 0x00000001 // move from FS + rename on FS (F6 on FS) @@ -221,32 +214,32 @@ class CSalamanderForViewFileOnFSAbstract // show security information (click on security icon in Directory Line, see CSalamanderGeneralAbstract::ShowSecurityIcon) #define FS_SERVICE_SHOWSECURITYINFO 0x02000000 -// chybi: Change Case, Convert, Properties, Make File List +// Missing: Change Case, Convert, Properties, Make File List -// typy kontextovych menu pro metodu CPluginFSInterfaceAbstract::ContextMenu() -#define fscmItemsInPanel 0 // kontextove menu pro polozky v panelu (oznacene/fokusle soubory a adresare) -#define fscmPathInPanel 1 // kontextove menu pro aktualni cestu v panelu -#define fscmPanel 2 // kontextove menu pro panel +// types of context menus for CPluginFSInterfaceAbstract::ContextMenu() +#define fscmItemsInPanel 0 // context menu for items in the panel (selected/focused files and directories) +#define fscmPathInPanel 1 // context menu for the current path in the panel +#define fscmPanel 2 // context menu for the panel -#define SALCMDLINE_MAXLEN 8192 // maximalni delka prikazu z prikazove radky Salamandera +#define SALCMDLINE_MAXLEN 8192 // maximum command length from the Salamander command line class CPluginFSInterfaceAbstract { #ifdef INSIDE_SALAMANDER -private: // ochrana proti nespravnemu primemu volani metod (viz CPluginFSInterfaceEncapsulation) +private: // protection against incorrect direct calls to methods (see CPluginFSInterfaceEncapsulation) friend class CPluginFSInterfaceEncapsulation; #else // INSIDE_SALAMANDER public: #endif // INSIDE_SALAMANDER - // vraci user-part aktualni cesty v tomto FS, 'userPart' je buffer o velikosti MAX_PATH - // pro cestu, vraci uspech + // returns the user-part of the current path in this FS; 'userPart' is a buffer of size MAX_PATH + // for the path; returns TRUE on success virtual BOOL WINAPI GetCurrentPath(char* userPart) = 0; - // vraci user-part plneho jmena souboru/adresare/up-diru 'file' ('isDir' je 0/1/2) na aktualni - // ceste v tomto FS; pro up-dir adresar (prvni v seznamu adresaru a zaroven pojmenovany ".."), - // je 'isDir'==2 a metoda by mela vracet aktualni cestu zkracenou o posledni komponentu; 'buf' - // je buffer o velikosti 'bufSize' pro vysledne plne jmeno, vraci uspech + // returns the user-part of the full name of file/directory/up-dir 'file' ('isDir' is 0/1/2) on the current + // path in this FS; for the up-dir entry (first in the directory list and also named ".."), + // 'isDir'==2 and the method should return the current path shortened by the last component; 'buf' + // is a buffer of size 'bufSize' for the resulting full name; returns TRUE on success virtual BOOL WINAPI GetFullName(CFileData& file, int isDir, char* buf, int bufSize) = 0; // vraci absolutni cestu (vcetne fs-name) odpovidajici relativni ceste 'path' na tomto FS; @@ -260,13 +253,13 @@ class CPluginFSInterfaceAbstract virtual BOOL WINAPI GetFullFSPath(HWND parent, const char* fsName, char* path, int pathSize, BOOL& success) = 0; - // vraci user-part rootu aktualni cesty v tomto FS, 'userPart' je buffer o velikosti MAX_PATH - // pro cestu (pouziti ve funkci "goto root"), vraci uspech + // returns the user-part of the root of the current path in this FS; 'userPart' is a buffer of size MAX_PATH + // for the path (used by the "goto root" function); returns TRUE on success virtual BOOL WINAPI GetRootPath(char* userPart) = 0; - // porovna aktualni cestu v tomto FS a cestu zadanou pres 'fsNameIndex' a 'userPart' - // (jmeno FS v ceste je z tohoto pluginu a je dane indexem 'fsNameIndex'), vraci TRUE - // pokud jsou cesty shodne; 'currentFSNameIndex' je index aktualniho jmena FS + // compares the current path in this FS with the path specified by 'fsNameIndex' and 'userPart' + // (the FS name in the path belongs to this plugin and is identified by 'fsNameIndex'); returns TRUE + // if the paths are identical; 'currentFSNameIndex' is the index of the current FS name virtual BOOL WINAPI IsCurrentPath(int currentFSNameIndex, int fsNameIndex, const char* userPart) = 0; // vraci TRUE, pokud je cesta z tohoto FS (coz znamena, ze Salamander muze cestu pustit @@ -341,19 +334,20 @@ class CPluginFSInterfaceAbstract // pokud lze zavrit/odpojit, jinak vraci FALSE virtual BOOL WINAPI TryCloseOrDetach(BOOL forceClose, BOOL canDetach, BOOL& detach, int reason) = 0; - // prijem udalosti na tomto FS, viz kody udalosti FSE_XXX; 'param' je parametr udalosti + // receives an event on this FS; see the FSE_XXX event codes; 'param' is the event parameter virtual void WINAPI Event(int event, DWORD param) = 0; - // uvolneni vsech prostredku FS krome dat listingu (behem volani teto metody se listing - // jeste muze zobrazovat v panelu); vola se tesne pred zrusenim listingu v panelu - // (listing se rusi jen u aktivnich FS, odpojene FS listing nemaji) a CloseFS pro tento FS; - // 'parent' je parent pripadnych messageboxu, probiha-li critical shutdown (vice viz - // CSalamanderGeneralAbstract::IsCriticalShutdown), zadna okna nezobrazovat + // releases all FS resources except the listing data (the listing + // may still be displayed in the panel while this method is running); called immediately before the listing in the panel + // is destroyed + // (the listing is destroyed only for active FSs; detached FSs have no listing) and before CloseFS is called for this FS; + // 'parent' is the parent for any message boxes; if critical shutdown is in progress (see + // CSalamanderGeneralAbstract::IsCriticalShutdown), do not show any windows virtual void WINAPI ReleaseObject(HWND parent) = 0; - // ziskani mnoziny podporovanych sluzeb FS (viz konstanty FS_SERVICE_XXX); vraci logicky - // soucet konstant; vola se po otevreni tohoto FS (viz CPluginInterfaceForFSAbstract::OpenFS), - // a pak po kazdem volani ChangePath a ListCurrentPath tohoto FS + // returns the set of supported FS services (see the FS_SERVICE_XXX constants); returns the bitwise + // OR of the constants; called after this FS is opened (see CPluginInterfaceForFSAbstract::OpenFS), + // and after each call to ChangePath and ListCurrentPath on this FS virtual DWORD WINAPI GetSupportedServices() = 0; // jen pokud GetSupportedServices() vraci i FS_SERVICE_GETCHANGEDRIVEORDISCONNECTITEM: @@ -387,15 +381,15 @@ class CPluginFSInterfaceAbstract // se distribuovat zpravy - prekresleni, atd.) virtual HICON WINAPI GetFSIcon(BOOL& destroyIcon) = 0; - // vraci pozadovany drop-effect pro drag&drop operaci z FS (muze byt i tento FS) do tohoto FS; - // 'srcFSPath' je zdrojova cesta; 'tgtFSPath' je cilova cesta (je z tohoto FS); 'allowedEffects' - // obsahuje povolene drop-effecty; 'keyState' je stav klaves (kombinace flagu MK_CONTROL, - // MK_SHIFT, MK_ALT, MK_BUTTON, MK_LBUTTON, MK_MBUTTON a MK_RBUTTON, viz IDropTarget::Drop); - // 'dropEffect' obsahuje doporucene drop-effecty (rovno 'allowedEffects' nebo omezeno na - // DROPEFFECT_COPY nebo DROPEFFECT_MOVE pokud uzivatel drzi klavesy Ctrl nebo Shift) a - // vraci se v nem zvoleny drop-effect (DROPEFFECT_COPY, DROPEFFECT_MOVE nebo DROPEFFECT_NONE); - // pokud metoda 'dropEffect' nezmeni a ten obsahuje vic efektu, provede se prednostni vyber - // Copy operace + // returns the requested drop effect for a drag&drop operation from an FS (possibly this FS) to this FS; + // 'srcFSPath' is the source path; 'tgtFSPath' is the target path (it belongs to this FS); 'allowedEffects' + // contains the allowed drop effects; 'keyState' is the key state (a combination of MK_CONTROL, + // MK_SHIFT, MK_ALT, MK_BUTTON, MK_LBUTTON, MK_MBUTTON, and MK_RBUTTON flags; see IDropTarget::Drop); + // 'dropEffect' contains the recommended drop effects (equal to 'allowedEffects' or limited to + // DROPEFFECT_COPY or DROPEFFECT_MOVE if the user holds Ctrl or Shift) and + // returns the selected drop effect (DROPEFFECT_COPY, DROPEFFECT_MOVE, or DROPEFFECT_NONE); + // if the method does not change 'dropEffect' and it contains more than one effect, + // Copy is preferred virtual void WINAPI GetDropEffect(const char* srcFSPath, const char* tgtFSPath, DWORD allowedEffects, DWORD keyState, DWORD* dropEffect) = 0; @@ -414,11 +408,9 @@ class CPluginFSInterfaceAbstract // delici bod neexistuje (konec textu neni povazovan za delici bod) virtual BOOL WINAPI GetNextDirectoryLineHotPath(const char* text, int pathLen, int& offset) = 0; - // jen pokud GetSupportedServices() vraci i FS_SERVICE_GETNEXTDIRLINEHOTPATH: - // uprava textu zkracene cesty, ktera se ma zobrazit v panelu (Directory Line - zkracovani - // cesty pomoci mysi - hot-tracking); pouziva se pokud hot-text z Directory Line neodpovida - // presne ceste (napr. mu chybi koncova zavorka - VMS cesty na FTP - "[DIR1.DIR2.DIR3]"); - // 'path' je in/out buffer s cestou (velikost bufferu je 'pathBufSize') + // Only if GetSupportedServices() returns FS_SERVICE_GETNEXTDIRLINEHOTPATH: + // adjusts the shortened path text to be displayed in the panel (Directory Line - path shortening with the mouse, hot-tracking); used when the hot text from the Directory Line does not exactly match the path (for example, if it is missing the closing bracket - VMS paths on FTP - "[DIR1.DIR2.DIR3]"); + // 'path' is an in/out buffer containing the path (the buffer size is 'pathBufSize') virtual void WINAPI CompleteDirectoryLineHotPath(char* path, int pathBufSize) = 0; // jen pokud GetSupportedServices() vraci i FS_SERVICE_GETPATHFORMAINWNDTITLE: @@ -437,9 +429,9 @@ class CPluginFSInterfaceAbstract // zobrazovani titulku (i v "Directory Name Only" a "Shortened Path") virtual BOOL WINAPI GetPathForMainWindowTitle(const char* fsName, int mode, char* buf, int bufSize) = 0; - // jen pokud GetSupportedServices() vraci i FS_SERVICE_SHOWINFO: - // zobrazi dialog s informacemi o FS (volne misto, kapacita, jmeno, moznosti, atd.); - // 'fsName' je aktualni jmeno FS; 'parent' je navrzeny parent zobrazovaneho dialogu + // Only if GetSupportedServices() returns FS_SERVICE_SHOWINFO: + // displays a dialog with information about the FS (free space, capacity, name, capabilities, etc.); + // 'fsName' is the current FS name; 'parent' is the suggested parent of the displayed dialog virtual void WINAPI ShowInfoDialog(const char* fsName, HWND parent) = 0; // jen pokud GetSupportedServices() vraci i FS_SERVICE_COMMANDLINE: @@ -509,11 +501,11 @@ class CPluginFSInterfaceAbstract virtual BOOL WINAPI CreateDir(const char* fsName, int mode, HWND parent, char* newName, BOOL& cancel) = 0; - // jen pokud GetSupportedServices() vraci i FS_SERVICE_VIEWFILE: - // prohlizeni souboru (adresare nelze prohlizet pres funkci View) 'file' na aktualni ceste - // na FS; 'fsName' je aktualni jmeno FS; 'parent' je parent pripadnych messageboxu - // s chybami; 'salamander' je sada metod ze Salamandera potrebnych pro implementaci - // prohlizeni s cachovanim + // Only if GetSupportedServices() returns FS_SERVICE_VIEWFILE: + // views file 'file' (directories cannot be viewed with the View command) on the current path + // on the FS; 'fsName' is the current FS name; 'parent' is the parent of any message boxes + // for errors; 'salamander' is the set of Salamander methods required to implement + // viewing with caching virtual void WINAPI ViewFile(const char* fsName, HWND parent, CSalamanderForViewFileOnFSAbstract* salamander, CFileData& file) = 0; @@ -658,34 +650,32 @@ class CPluginFSInterfaceAbstract void* nextParam, int sourceFiles, int sourceDirs, char* targetPath, BOOL* invalidPathOrCancel) = 0; - // jen pokud GetSupportedServices() vraci i FS_SERVICE_CHANGEATTRS: - // zmena atributu souboru a adresaru oznacenych v panelu; dialog se zadanim zmen atributu - // ma kazdy plugin vlastni; - // 'fsName' je aktualni jmeno FS; 'parent' je navrzeny parent vlastniho dialogu; 'panel' - // identifikuje panel (PANEL_LEFT nebo PANEL_RIGHT), ve kterem je otevrene FS (z tohoto - // panelu se ziskavaji soubory/adresare, se kterymi se pracuje); - // 'selectedFiles' + 'selectedDirs' - pocet oznacenych souboru a adresaru, - // pokud jsou obe hodnoty nulove, pracuje se se souborem/adresarem pod kurzorem - // (fokus), pred volanim metody ChangeAttributes jsou bud oznacene soubory a adresare nebo - // je alespon fokus na souboru/adresari, takze je vzdy s cim pracovat (zadne dalsi testy - // nejsou treba); pokud vraci TRUE, operace probehla korektne a oznacene soubory/adresare - // se maji odznacit; pokud chce uzivatel prerusit operaci nebo nastane chyba, vraci metoda - // FALSE a nedojde k odznaceni souboru/adresaru + // Only if GetSupportedServices() returns FS_SERVICE_CHANGEATTRS: + // changes the attributes of the files and directories selected in the panel; each plugin provides its own attribute dialog; + // 'fsName' is the current FS name; 'parent' is the suggested parent of the custom dialog; 'panel' + // identifies the panel (PANEL_LEFT or PANEL_RIGHT) in which the FS is open (this panel supplies the files/directories being operated on); + // 'selectedFiles' + 'selectedDirs' is the number of selected files and directories; + // if both values are zero, the file/directory under the cursor is used + // (focus); before ChangeAttributes is called, either files/directories are selected or there is at least + // focus on a file/directory, so there is always something to work with (no additional checks + // are needed); if it returns TRUE, the operation completed successfully and the selected files/directories + // should be deselected; if the user cancels the operation or an error occurs, the method returns + // FALSE and the files/directories are not deselected virtual BOOL WINAPI ChangeAttributes(const char* fsName, HWND parent, int panel, int selectedFiles, int selectedDirs) = 0; - // jen pokud GetSupportedServices() vraci i FS_SERVICE_SHOWPROPERTIES: - // zobrazeni okna s vlastnostmi souboru a adresaru oznacenych v panelu; okno s vlastnostmi - // ma kazdy plugin vlastni; - // 'fsName' je aktualni jmeno FS; 'parent' je navrzeny parent vlastniho okna - // (Windowsove okno s vlastnostmi je nemodalni - pozor: nemodalni okno musi - // mit vlastni thread); 'panel' identifikuje panel (PANEL_LEFT nebo PANEL_RIGHT), - // ve kterem je otevrene FS (z tohoto panelu se ziskavaji soubory/adresare, - // se kterymi se pracuje); 'selectedFiles' + 'selectedDirs' - pocet oznacenych - // souboru a adresaru, pokud jsou obe hodnoty nulove, pracuje se se souborem/adresarem - // pod kurzorem (fokus), pred volanim metody ShowProperties jsou bud oznacene - // soubory a adresare nebo je alespon fokus na souboru/adresari, takze je vzdy - // s cim pracovat (zadne dalsi testy nejsou treba) + // Only if GetSupportedServices() returns FS_SERVICE_SHOWPROPERTIES: + // displays a properties window for the files and directories selected in the panel; each plugin + // provides its own properties window; + // 'fsName' is the current FS name; 'parent' is the suggested parent of the custom window + // (a Windows properties window is modeless - note: a modeless window must + // have its own thread); 'panel' identifies the panel (PANEL_LEFT or PANEL_RIGHT) + // in which the FS is open (this panel supplies the files/directories + // being worked with); 'selectedFiles' + 'selectedDirs' is the number of selected + // files and directories; if both values are zero, the file/directory under the cursor is used + // (focus); before ShowProperties is called, either files/directories are selected + // or there is at least focus on a file/directory, so there is always + // something to work with (no additional checks are needed) virtual void WINAPI ShowProperties(const char* fsName, HWND parent, int panel, int selectedFiles, int selectedDirs) = 0; @@ -710,11 +700,11 @@ class CPluginFSInterfaceAbstract virtual void WINAPI ContextMenu(const char* fsName, HWND parent, int menuX, int menuY, int type, int panel, int selectedFiles, int selectedDirs) = 0; - // jen pokud GetSupportedServices() vraci i FS_SERVICE_CONTEXTMENU: - // pokud je v panelu otevreny FS a dorazi nektera ze zprav WM_INITPOPUP, WM_DRAWITEM, - // WM_MENUCHAR nebo WM_MEASUREITEM, zavola Salamander HandleMenuMsg, aby pluginu - // umoznil pracovat s IContextMenu2 a IContextMenu3 - // plugin vraci TRUE v pripade, ze zpravu zpracoval a FALSE jindy + // Only if GetSupportedServices() returns FS_SERVICE_CONTEXTMENU: + // if an FS is open in the panel and one of the messages WM_INITPOPUP, WM_DRAWITEM, + // WM_MENUCHAR, or WM_MEASUREITEM arrives, Salamander calls HandleMenuMsg to allow the plugin + // to work with IContextMenu2 and IContextMenu3 + // the plugin returns TRUE if it handled the message and FALSE otherwise virtual BOOL WINAPI HandleMenuMsg(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT* plResult) = 0; // jen pokud GetSupportedServices() vraci i FS_SERVICE_OPENFINDDLG: @@ -724,9 +714,9 @@ class CPluginFSInterfaceAbstract // pokud vrati FALSE, Salamander otevre standardni Find Files and Directories dialog virtual BOOL WINAPI OpenFindDialog(const char* fsName, int panel) = 0; - // jen pokud GetSupportedServices() vraci i FS_SERVICE_OPENACTIVEFOLDER: - // otevre okno Explorera pro aktualni cestu v panelu - // 'fsName' je aktualni jmeno FS; 'parent' je navrzeny parent zobrazovaneho dialogu + // Only if GetSupportedServices() returns FS_SERVICE_OPENACTIVEFOLDER: + // opens an Explorer window for the current path in the panel + // 'fsName' is the current FS name; 'parent' is the suggested parent of the displayed dialog virtual void WINAPI OpenActiveFolder(const char* fsName, HWND parent) = 0; // jen pokud GetSupportedServices() vraci FS_SERVICE_MOVEFROMFS nebo FS_SERVICE_COPYFROMFS: @@ -748,9 +738,9 @@ class CPluginFSInterfaceAbstract // teto hlasky virtual BOOL WINAPI GetNoItemsInPanelText(char* textBuf, int textBufSize) = 0; - // jen pokud GetSupportedServices() vraci FS_SERVICE_SHOWSECURITYINFO: - // uzivatel kliknul na ikone zabezpeceni (viz CSalamanderGeneralAbstract::ShowSecurityIcon; - // napr. FTPS zobrazi dialog s certifikatem serveru); 'parent' je navrzeny parent dialogu + // Only if GetSupportedServices() returns FS_SERVICE_SHOWSECURITYINFO: + // the user clicked the security icon (see CSalamanderGeneralAbstract::ShowSecurityIcon; + // for example, FTPS displays a dialog with the server certificate); 'parent' is the suggested parent of the dialog virtual void WINAPI ShowSecurityInfo(HWND parent) = 0; /* zbyva dokoncit: @@ -771,7 +761,7 @@ class CPluginFSInterfaceAbstract class CPluginInterfaceForFSAbstract { #ifdef INSIDE_SALAMANDER -private: // ochrana proti nespravnemu primemu volani metod (viz CPluginInterfaceForFSEncapsulation) +private: // protection against incorrect direct calls to methods (see CPluginInterfaceForFSEncapsulation) friend class CPluginInterfaceForFSEncapsulation; #else // INSIDE_SALAMANDER public: @@ -870,24 +860,24 @@ class CPluginInterfaceForFSAbstract CPluginFSInterfaceAbstract* pluginFS, const char* pluginFSName, int pluginFSNameIndex) = 0; - // prevadi user-part cesty v bufferu 'fsUserPart' (velikost MAX_PATH znaku) z externiho - // na interni format (napr. u FTP: interni format = cesty jak s nimi pracuje server, - // externi format = URL format = cesty obsahuji hex-escape-sekvence (napr. "%20" = " ")) + // converts the user-part of the path in buffer 'fsUserPart' (size MAX_PATH characters) from external + // to internal format (for example, on FTP: internal format = paths as used by the server, + // external format = URL format = paths containing hex escape sequences (e.g. "%20" = " ")) virtual void WINAPI ConvertPathToInternal(const char* fsName, int fsNameIndex, char* fsUserPart) = 0; - // prevadi user-part cesty v bufferu 'fsUserPart' (velikost MAX_PATH znaku) z interniho - // na externi format + // converts the user-part of the path in buffer 'fsUserPart' (size MAX_PATH characters) from internal + // to external format virtual void WINAPI ConvertPathToExternal(const char* fsName, int fsNameIndex, char* fsUserPart) = 0; - // tato metoda se vola jen u pluginu, ktery slouzi jako nahrada za Network polozku - // v Change Drive menu a v Drive barach (viz CSalamanderGeneralAbstract::SetPluginIsNethood()): - // Salamander volanim teto metody informuje plugin, ze uzivatel meni cestu z rootu UNC - // cesty "\\server\share" pres symbol up-diru ("..") do pluginoveho FS na cestu s - // user-part "\\server" v panelu 'panel' (PANEL_LEFT nebo PANEL_RIGHT); ucel teto metody: - // plugin by mel bez cekani vylistovat na teto ceste aspon tento jeden share, aby mohlo - // dojit k jeho fokusu v panelu (coz je bezne chovani pri zmene cesty pres up-dir) + // This method is called only for a plugin that serves as a replacement for the Network item + // in the Change Drive menu and in the Drive bars (see CSalamanderGeneralAbstract::SetPluginIsNethood()): + // by calling this method, Salamander informs the plugin that the user is changing the path from the root of the UNC + // path "\\server\share" via the up-dir entry ("..") to the plugin FS, to a path with + // user-part "\\server" in panel 'panel' (PANEL_LEFT or PANEL_RIGHT); purpose of this method: + // the plugin should immediately list at least this one share at that path so it can receive + // focus in the panel (which is the normal behavior when changing path via up-dir) virtual void WINAPI EnsureShareExistsOnServer(int panel, const char* server, const char* share) = 0; }; From 025743a20a716b3631e880bfef13fb250e8f9399 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:23:35 +0200 Subject: [PATCH 197/710] [translation] Fix src/plugins/shared/spl_zlib.h comments (#569) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/plugins/shared/spl_zlib.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/shared/spl_zlib.h b/src/plugins/shared/spl_zlib.h index ac013b6b9..282f4de45 100644 --- a/src/plugins/shared/spl_zlib.h +++ b/src/plugins/shared/spl_zlib.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED //**************************************************************************** // @@ -52,7 +53,7 @@ struct CSalZLIB UINT avail_in; /* number of bytes available at next_in */ ULONG total_in; /* total number of input bytes read so far */ - BYTE* next_out; /* next output byte should be put there */ + BYTE* next_out; /* where to write the next output byte */ UINT avail_out; /* remaining free space at next_out */ ULONG total_out; /* total number of bytes output so far */ From 2d9d541a40a9d0fb1eaceeb1ec686e666558fb11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:23:42 +0200 Subject: [PATCH 198/710] [translation] Fix src/plugins/shared/winliblt.h comments (#570) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/plugins/shared/winliblt.h | 111 +++++++++++++++++----------------- 1 file changed, 56 insertions(+), 55 deletions(-) diff --git a/src/plugins/shared/winliblt.h b/src/plugins/shared/winliblt.h index 58dedbd68..ece2ce343 100644 --- a/src/plugins/shared/winliblt.h +++ b/src/plugins/shared/winliblt.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED //**************************************************************************** // @@ -9,33 +10,33 @@ // //**************************************************************************** -// "light" verze WinLibu +// "light" version of WinLib #pragma once // makra pro potlaceni nepotrebnych casti WinLibLT (snazsi kompilace): // ENABLE_PROPERTYDIALOG - je-li definovano, je mozne pouzivat property sheet dialog (CPropertyDialog) -// nastaveni vlastnich textu do WinLibu -void SetWinLibStrings(const char* invalidNumber, // "neni cislo" (u transferbufferu cisel) - const char* error); // titulek "chyba" (u transferbufferu cisel) +// sets custom WinLib strings +void SetWinLibStrings(const char* invalidNumber, // "not a number" (for numeric transfer buffers) + const char* error); // title "Error" (for numeric transfer buffers) -// je potreba zavolat pred pouzitim WinLibu; 'pluginName' je jmeno pluginu (napr. "DEMOPLUG"), -// pouziva se pro odliseni jmen trid univerzalnich oken WinLibu (mezi pluginy se musi lisit, -// jinak nastane kolize jmen trid a WinLib nemuze fungovat - bude fungovat jen prvni spusteny -// plugin); 'dllInstance' je modul pluginu (pouziva se pri registraci univerzalnich trid WinLibu) +// Must be called before using WinLib; 'pluginName' is the plugin name (e.g. "DEMOPLUG"), +// used to distinguish the class names of WinLib universal windows (it must differ between plugins, +// or class-name collisions will occur and WinLib cannot work - only the first started +// plugin will work); 'dllInstance' is the plugin module (used when registering WinLib universal classes) BOOL InitializeWinLib(const char* pluginName, HINSTANCE dllInstance); -// je potreba zavolat po pouziti WinLibu; 'dllInstance' je modul pluginu (pouziva se pri zruseni -// registrace univerzalnich trid WinLibu) +// Must be called after using WinLib; 'dllInstance' is the plugin module (used when unregistering +// WinLib universal classes) void ReleaseWinLib(HINSTANCE dllInstance); -// typ callbacku pro pripojeni na HTML help +// callback type for HTML Help integration typedef void(WINAPI* FWinLibLTHelpCallback)(HWND hWindow, UINT helpID); -// nastaveni callbacku pro pripojeni na HTML help +// sets the callback for HTML Help integration void SetupWinLibHelp(FWinLibLTHelpCallback helpCallback); -// konstanty pro stringy WinLibu (jen interni pouziti ve WinLibu) +// WinLib string constants (internal use only) enum CWLS { WLS_INVALID_NUMBER, @@ -44,21 +45,21 @@ enum CWLS WLS_COUNT }; -extern char CWINDOW_CLASSNAME[100]; // jmeno tridy universalniho okna -extern char CWINDOW_CLASSNAME2[100]; // jmeno tridy universalniho okna - nema CS_VREDRAW | CS_HREDRAW +extern char CWINDOW_CLASSNAME[100]; // universal window class name +extern char CWINDOW_CLASSNAME2[100]; // universal window class name - no CS_VREDRAW | CS_HREDRAW // **************************************************************************** -enum CObjectOrigin // pouzito pri destrukci oken a dialogu +enum CObjectOrigin // used when destroying windows and dialogs { - ooAllocated, // pri WM_DESTROY se bude dealokovat - ooStatic, // pri WM_DESTROY se HWindow nastavi na NULL - ooStandard // pro modalni dlg =ooStatic, pro nemodalni dlg =ooAllocated + ooAllocated, // deallocated on WM_DESTROY + ooStatic, // HWindow is set to NULL on WM_DESTROY + ooStandard // for modal dialogs = ooStatic, for modeless dialogs = ooAllocated }; // **************************************************************************** -enum CObjectType // pro rozpoznani typu objektu +enum CObjectType // for identifying the object type { otBase, otWindow, @@ -71,7 +72,7 @@ enum CObjectType // pro rozpoznani typu objektu // **************************************************************************** -class CWindowsObject // predek vsech MS-Windows objektu +class CWindowsObject // base class for all MS-Windows objects { public: HWND HWindow; @@ -90,9 +91,9 @@ class CWindowsObject // predek vsech MS-Windows objektu SetHelpID(helpID); } - virtual ~CWindowsObject() {} // aby se u potomku volal jejich destruktor + virtual ~CWindowsObject() {} // so derived-class destructors are called - virtual BOOL Is(int) { return FALSE; } // identifikace objektu + virtual BOOL Is(int) { return FALSE; } // object type identifier virtual int GetObjectType() { return otBase; } virtual BOOL IsAllocated() { return ObjectOrigin == ooAllocated; } @@ -132,7 +133,7 @@ class CWindow : public CWindowsObject virtual BOOL Is(int type) { return type == otWindow; } virtual int GetObjectType() { return otWindow; } - // registruje univerzalni tridy WinLibu, vola se automaticky (registraci rusi tez automaticky) + // registers WinLib universal classes; called automatically (unregistration is also automatic) static BOOL RegisterUniversalClass(HINSTANCE dllInstance); // registrace vlastni univerzalni tridy; POZOR: pri unloadu pluginu je nutne zrusit registraci tridy, @@ -158,7 +159,7 @@ class CWindow : public CWindowsObject HWND hwndParent, // handle of parent or owner window HMENU hmenu, // handle of menu or child-window identifier HINSTANCE hinst, // handle of application instance - LPVOID lpvParam); // ukazatel na objekt vytvareneho okna + LPVOID lpvParam); // pointer to the object of the window being created HWND CreateEx(DWORD dwExStyle, // extended window style LPCTSTR lpszClassName, // address of registered class name @@ -171,7 +172,7 @@ class CWindow : public CWindowsObject HWND hwndParent, // handle of parent or owner window HMENU hmenu, // handle of menu or child-window identifier HINSTANCE hinst, // handle of application instance - LPVOID lpvParam); // ukazatel na objekt vytvareneho okna + LPVOID lpvParam); // pointer to the object of the window being created void AttachToWindow(HWND hWnd); void AttachToControl(HWND dlg, int ctrlID); @@ -190,8 +191,8 @@ class CWindow : public CWindowsObject enum CTransferType { - ttDataToWindow, // data jdou do okna - ttDataFromWindow // data jdou z okna + ttDataToWindow, // data goes to the window + ttDataFromWindow // data comes from the window }; // **************************************************************************** @@ -199,7 +200,7 @@ enum CTransferType class CTransferInfo { public: - int FailCtrlID; // INT_MAX - vse v poradku, jinak ID controlu s chybou + int FailCtrlID; // INT_MAX - OK, otherwise the ID of the control with the error CTransferType Type; CTransferInfo(HWND hDialog, CTransferType type) @@ -218,15 +219,15 @@ class CTransferInfo void RadioButton(int ctrlID, int ctrlValue, int& value); void CheckBox(int ctrlID, int& value); // 0-unchecked, 1-checked, 2-grayed - // kontroluje double hodnotu (pokud to neni cislo, neprojde), oddelovac muze byt '.' i ','; - // 'format' se pouziva v sprintf pri prevodu cisla na retezec (napr. "%.2f" nebo "%g") + // validates a double value (fails if the input is not numeric); the decimal separator may be '.' or ','; + // 'format' is used in sprintf when converting the number to a string (e.g. "%.2f" or "%g") void EditLine(int ctrlID, double& value, char* format, BOOL select = TRUE); - // kontroluje int hodnotu (pokud to neni cislo, neprojde) + // validates an int value (fails if the input is not numeric) void EditLine(int ctrlID, int& value, BOOL select = TRUE); protected: - HWND HDialog; // handle dialogu, pro ktery se provadi transfer + HWND HDialog; // handle of the dialog for which the transfer is performed }; // **************************************************************************** @@ -235,8 +236,8 @@ class CDialog : public CWindowsObject { public: #ifdef ENABLE_PROPERTYDIALOG - CWindowsObject::HWindow; // kvuli zkompilovatelnosti CPropSheetPage - CWindowsObject::SetObjectOrigin; // kvuli zkompilovatelnosti CPropSheetPage + CWindowsObject::HWindow; // so CPropSheetPage compiles + CWindowsObject::SetObjectOrigin; // so CPropSheetPage compiles #endif // ENABLE_PROPERTYDIALOG CDialog(HINSTANCE modul, int resID, HWND parent, @@ -268,8 +269,8 @@ class CDialog : public CWindowsObject (!Modal && ObjectOrigin == ooStandard); } void SetParent(HWND parent) { Parent = parent; } - INT_PTR Execute(); // modalni dialog - HWND Create(); // nemodalni dialog + INT_PTR Execute(); // modal dialog + HWND Create(); // modeless dialog static INT_PTR CALLBACK CDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); @@ -279,7 +280,7 @@ class CDialog : public CWindowsObject virtual void NotifDlgJustCreated() {} - BOOL Modal; // kvuli zpusobu destrukce dialogu + BOOL Modal; // because dialogs are destroyed differently HINSTANCE Modul; int ResID; HWND Parent; @@ -294,9 +295,9 @@ class CPropertyDialog; class CPropSheetPage : protected CDialog { public: - CDialog::HWindow; // HWindow zustane pristupne + CDialog::HWindow; // HWindow remains accessible - CDialog::SetObjectOrigin; // zpristupneni povolenych metod predku + CDialog::SetObjectOrigin; // make permitted base-class methods accessible CDialog::Transfer; // testovano s resourcem dialogu stranky se stylem: @@ -332,7 +333,7 @@ class CPropSheetPage : protected CDialog DWORD Flags; HICON Icon; - CPropertyDialog* ParentDialog; // vlastnik teto stranky + CPropertyDialog* ParentDialog; // owner of this page friend class CPropertyDialog; }; @@ -342,11 +343,11 @@ class CPropSheetPage : protected CDialog class CPropertyDialog : public TIndirectArray { public: - // do tohoto objektu je idealni pridat objekty jednotlivych stranek - // a pak je jako "staticke" (defaultni volba) napridavat pres metodu Add; - // 'startPage' a 'lastPage' muze byt jen jedina promenna (hodnota in/odkaz out); - // 'flags' viz help k 'PROPSHEETHEADER', pouzitelne hlavne konstanty - // PSH_NOAPPLYNOW, PSH_USECALLBACK a PSH_HASHELP (jinak staci 'flags'==0) + // it is best to add the individual page objects to this object + // and then add them via Add as "static" pages (the default); + // 'startPage' and 'lastPage' may be a single variable (value in/reference out); + // for 'flags', see the help for 'PROPSHEETHEADER'; the main usable constants are + // PSH_NOAPPLYNOW, PSH_USECALLBACK and PSH_HASHELP (otherwise 'flags'==0 is sufficient) CPropertyDialog(HWND parent, HINSTANCE modul, char* caption, int startPage, DWORD flags, HICON icon = NULL, DWORD* lastPage = NULL, PFNPROPSHEETCALLBACK callback = NULL) @@ -368,7 +369,7 @@ class CPropertyDialog : public TIndirectArray virtual int GetCurSel(); protected: - HWND Parent; // parametry pro vytvareni dialogu + HWND Parent; // parameters for creating the dialog HWND HWindow; HINSTANCE Modul; HICON Icon; @@ -389,7 +390,7 @@ class CPropertyDialog : public TIndirectArray class CWindowsManager { public: - int WindowsCount; // pocet oken obsluhovanych WinLibem (aktualni stav) + int WindowsCount; // number of windows currently managed by WinLib public: CWindowsManager() { WindowsCount = 0; } @@ -416,10 +417,10 @@ struct CWindowQueueItem class CWindowQueue { protected: - const char* QueueName; // jmeno fronty (jen pro debugovaci ucely) + const char* QueueName; // queue name (for debugging only) CWindowQueueItem* Head; - struct CCS // pristup z vice threadu -> nutna synchronizace + struct CCS // access from multiple threads - synchronization required { CRITICAL_SECTION cs; @@ -431,18 +432,18 @@ class CWindowQueue } CS; public: - CWindowQueue(const char* queueName /* napr. "DemoPlug Viewers" */) + CWindowQueue(const char* queueName /* e.g. "DemoPlug Viewers" */) { QueueName = queueName; Head = NULL; } ~CWindowQueue(); - BOOL Add(CWindowQueueItem* item); // prida polozku do fronty, vraci uspech - void Remove(HWND hWindow); // odstrani polozku z fronty - BOOL Empty(); // vraci TRUE pokud je fronta prazdna + BOOL Add(CWindowQueueItem* item); // adds an item to the queue; returns TRUE on success + void Remove(HWND hWindow); // removes an item from the queue + BOOL Empty(); // returns TRUE if the queue is empty - // posle (PostMessage - okna muzou byt v ruznych threadech) vsem oknum zpravu + // sends a message to all windows (using PostMessage; the windows may be in different threads) void BroadcastMessage(DWORD uMsg, WPARAM wParam, LPARAM lParam); // broadcastne WM_CLOSE, pak ceka na prazdnou frontu (max. cas dle 'force' bud 'forceWaitTime' From d25a39187d62829abc25fc65cff348fd85a2f4dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:23:48 +0200 Subject: [PATCH 199/710] [translation] Fix src/plugins/shared/winliblt.cpp comments (#572) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/plugins/shared/winliblt.cpp | 145 ++++++++++++++++---------------- 1 file changed, 73 insertions(+), 72 deletions(-) diff --git a/src/plugins/shared/winliblt.cpp b/src/plugins/shared/winliblt.cpp index 812212afd..2a5b6c496 100644 --- a/src/plugins/shared/winliblt.cpp +++ b/src/plugins/shared/winliblt.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED //**************************************************************************** // @@ -42,16 +43,16 @@ #endif // _MSC_VER char CWINDOW_CLASSNAME[100] = ""; -char CWINDOW_CLASSNAME2[100] = ""; // nema CS_VREDRAW | CS_HREDRAW +char CWINDOW_CLASSNAME2[100] = ""; // without CS_VREDRAW | CS_HREDRAW -ATOM AtomObject = 0; // "property" okna s ukazatelem na objekt (pouzivane ve WindowsManageru) +ATOM AtomObject = 0; // "window property" holding a pointer to the object (used in WindowsManager) CWindowsManager WindowsManager; char WinLibStrings[WLS_COUNT][101] = { "Invalid number!", "Error"}; -FWinLibLTHelpCallback WinLibLTHelpCallback = NULL; // callbacku pro pripojeni na HTML help +FWinLibLTHelpCallback WinLibLTHelpCallback = NULL; // callback for HTML Help integration // // **************************************************************************** @@ -74,7 +75,7 @@ BOOL InitializeWinLib(const char* pluginName, HINSTANCE dllInstance) lstrcpyn(CWINDOW_CLASSNAME2, pluginName, 50); strcat(CWINDOW_CLASSNAME2, " - WinLib Universal Window2"); - AtomObject = GlobalAddAtom("object handle"); // vsechny pluginy budou pouzivat stejny atom, zadna kolize + AtomObject = GlobalAddAtom("object handle"); // all plugins will use the same atom, so there is no collision if (AtomObject == 0) { TRACE_E("GlobalAddAtom has failed"); @@ -104,13 +105,13 @@ void ReleaseWinLib(HINSTANCE dllInstance) { if (WindowsManager.WindowsCount != 0) { - // pruser - po unloadu pluginu muze spadnout soft, protoze se zavola window-procedura - // v unloadnutem DLL (jde-li o okna zabita v ramci zabitych threadu, je to OK) + // problem: after the plugin is unloaded, the app can crash because a window procedure may be called + // in the unloaded DLL (if these are windows destroyed as part of terminated threads, that is OK) TRACE_E("Unable to release WinLibLT - some window or dialog (count = " << WindowsManager.WindowsCount << ") is still attached to WinLibLT!"); - // return; // pokud slo o okno v killnutem threadu, pujde WinLibLT uvolnit, jinak unregister-funkce vrati error + // if it was a window from a terminated thread, WinLibLT can still be released; otherwise the unregister function will return an error } - // provedeme odregistrovani trid, aby pri dalsim loadu pluginu mohly byt znovu zaregistrovany + // unregister the classes so they can be registered again on the next plugin load if (CWINDOW_CLASSNAME2[0] != 0 && CWINDOW_CLASSNAME[0] != 0) { if (!UnregisterClass(CWINDOW_CLASSNAME2, dllInstance)) @@ -141,7 +142,7 @@ HWND CWindow::CreateEx(DWORD dwExStyle, // extended window style HWND hwndParent, // handle of parent or owner window HMENU hmenu, // handle of menu or child-window identifier HINSTANCE hinst, // handle of application instance - LPVOID lpvParam) // ukazatel na objekt vytvareneho okna + LPVOID lpvParam) // pointer to the object of the window being created { HWND hWnd = CreateWindowEx(dwExStyle, lpszClassName, @@ -157,8 +158,8 @@ HWND CWindow::CreateEx(DWORD dwExStyle, // extended window style lpvParam); if (hWnd != 0) { - if (WindowsManager.GetWindowPtr(hWnd) == NULL) // pokud se jeste neni ve WindowsManageru - AttachToWindow(hWnd); // tak ho pridame -> subclassing + if (WindowsManager.GetWindowPtr(hWnd) == NULL) // if the window is not yet in WindowsManager + AttachToWindow(hWnd); // then add it -> subclassing } return hWnd; } @@ -173,7 +174,7 @@ HWND CWindow::Create(LPCTSTR lpszClassName, // address of registered class name HWND hwndParent, // handle of parent or owner window HMENU hmenu, // handle of menu or child-window identifier HINSTANCE hinst, // handle of application instance - LPVOID lpvParam) // ukazatel na objekt vytvareneho okna + LPVOID lpvParam) // pointer to the object of the window being created { return CreateEx(0, lpszClassName, @@ -207,7 +208,7 @@ void CWindow::AttachToWindow(HWND hWnd) HWindow = hWnd; SetWindowLongPtr(HWindow, GWLP_WNDPROC, (LONG_PTR)CWindowProc); - if (DefWndProc == CWindow::CWindowProc) // to by byla rekurze + if (DefWndProc == CWindow::CWindowProc) // that would recurse { TRACE_C("This should never happen."); DefWndProc = DefWindowProc; @@ -253,7 +254,7 @@ CWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) } if (GetWindowLong(HWindow, GWL_STYLE) & WS_CHILD) break; // pokud F1 nezpracujeme a pokud je to child okno, nechame F1 propadnout do parenta - return TRUE; // pokud to neni child, ukoncime zpracovani F1 + return TRUE; // if this is not a child window, stop processing F1 } } return CallWindowProc((WNDPROC)DefWndProc, HWindow, uMsg, wParam, lParam); @@ -265,9 +266,9 @@ CWindow::CWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) CWindow* wnd; switch (uMsg) { - case WM_CREATE: // prvni zprava - pripojeni objektu k oknu + case WM_CREATE: // first message - attach the object to the window { - // osetrim MDI_CHILD_WINDOW + // handle MDI_CHILD_WINDOW if (((CREATESTRUCT*)lParam)->dwExStyle & WS_EX_MDICHILD) wnd = (CWindow*)((MDICREATESTRUCT*)((CREATESTRUCT*)lParam)->lpCreateParams)->lParam; else @@ -280,8 +281,8 @@ CWindow::CWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) else { wnd->HWindow = hwnd; - //--- zarazeni okna podle hwnd do seznamu oken - if (!WindowsManager.AddWindow(hwnd, wnd)) // chyba + //--- add the window identified by hwnd to the window list + if (!WindowsManager.AddWindow(hwnd, wnd)) // error { TRACE_E("Error during creating of window."); return FALSE; @@ -290,7 +291,7 @@ CWindow::CWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) break; } - case WM_DESTROY: // posledni zprava - odpojeni objektu od okna + case WM_DESTROY: // last message - detach the object from the window { wnd = (CWindow*)WindowsManager.GetWindowPtr(hwnd); if (wnd != NULL && wnd->Is(otWindow)) @@ -301,7 +302,7 @@ CWindow::CWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) LRESULT res = wnd->WindowProc(uMsg, wParam, lParam); - // ted uz zase do stare procedury (kvuli subclassingu) + // now call the old procedure again (because of subclassing) WindowsManager.DetachWindow(hwnd); // pokud aktualni WndProc je jina nez nase, nebudeme ji menit, @@ -313,9 +314,9 @@ CWindow::CWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) if (wnd->IsAllocated()) delete wnd; else - wnd->HWindow = NULL; // uz neni pripojeny + wnd->HWindow = NULL; // no longer attached if (res == 0) - return 0; // aplikace ji zpracovala + return 0; // handled by the application wnd = NULL; } break; @@ -333,12 +334,12 @@ CWindow::CWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) #endif } } - //--- zavolani metody WindowProc(...) prislusneho objektu okna + //--- call WindowProc(...) of the corresponding window object if (wnd != NULL) return wnd->WindowProc(uMsg, wParam, lParam); else return DefWindowProc(hwnd, uMsg, wParam, lParam); - // chyba nebo message prisla pred WM_CREATE + // error, or the message arrived before WM_CREATE } BOOL CWindow::RegisterUniversalClass(HINSTANCE dllInstance) @@ -443,7 +444,7 @@ CDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_INITDIALOG: { TransferData(ttDataToWindow); - return TRUE; // chci focus od DefDlgProc + return TRUE; // let DefDlgProc set the focus } case WM_HELP: @@ -453,7 +454,7 @@ CDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) { WinLibLTHelpCallback(HWindow, HelpID); } - return TRUE; // F1 nenechame propadnout do parenta ani pokud nevolame WinLibLTHelpCallback() + return TRUE; // do not let F1 fall through to the parent even if we do not call WinLibLTHelpCallback() } case WM_COMMAND: @@ -497,7 +498,7 @@ CDialog::CDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) CDialog* dlg; switch (uMsg) { - case WM_INITDIALOG: // prvni zprava - pripojeni objektu k dialogu + case WM_INITDIALOG: // first message - attach the object to the dialog { dlg = (CDialog*)lParam; if (dlg == NULL) @@ -508,21 +509,21 @@ CDialog::CDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) else { dlg->HWindow = hwndDlg; - //--- zarazeni okna podle hwndDlg do seznamu oken - if (!WindowsManager.AddWindow(hwndDlg, dlg)) // chyba + //--- add the window identified by hwndDlg to the window list + if (!WindowsManager.AddWindow(hwndDlg, dlg)) // error { TRACE_E("Error during creating of dialog."); return TRUE; } - dlg->NotifDlgJustCreated(); // zavedeno jako misto pro upravu layoutu dialogu + dlg->NotifDlgJustCreated(); // added as a place to adjust the dialog layout } break; } - case WM_DESTROY: // posledni zprava - odpojeni objektu od dialogu + case WM_DESTROY: // last message - detach the object from the dialog { dlg = (CDialog*)WindowsManager.GetWindowPtr(hwndDlg); - INT_PTR ret = FALSE; // pro pripad, ze ji nezpracuje + INT_PTR ret = FALSE; // in case the dialog does not handle the message if (dlg != NULL && dlg->Is(otDialog)) { // Petr: posunul jsem dolu pod wnd->WindowProc(), aby behem WM_DESTROY @@ -535,7 +536,7 @@ CDialog::CDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) if (dlg->IsAllocated()) delete dlg; else - dlg->HWindow = NULL; // informace o odpojeni + dlg->HWindow = NULL; // mark as detached } return ret; } @@ -552,11 +553,11 @@ CDialog::CDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) #endif } } - //--- zavolani metody DialogProc(...) prislusneho objektu dialogu + //--- call DialogProc(...) of the corresponding dialog object if (dlg != NULL) return dlg->DialogProc(uMsg, wParam, lParam); else - return FALSE; // chyba nebo message neprisla mezi WM_INITDIALOG a WM_DESTROY + return FALSE; // error, or the message did not arrive between WM_INITDIALOG and WM_DESTROY } // @@ -596,7 +597,7 @@ void CPropSheetPage::Init(char* title, HINSTANCE modul, int resID, Flags = flags; Icon = icon; - ParentDialog = NULL; // nastavuje se z CPropertyDialog::Execute() + ParentDialog = NULL; // set from CPropertyDialog::Execute() } CPropSheetPage::~CPropSheetPage() @@ -664,7 +665,7 @@ CPropSheetPage::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) { ParentDialog->HWindow = Parent; TransferData(ttDataToWindow); - return TRUE; // chci focus od DefDlgProc + return TRUE; // let DefDlgProc set the focus } case WM_HELP: @@ -675,38 +676,38 @@ CPropSheetPage::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) WinLibLTHelpCallback(HWindow, HelpID); return TRUE; } - break; // F1 nechame propadnout do parenta + break; // let F1 fall through to the parent } case WM_NOTIFY: { - if (((NMHDR*)lParam)->code == PSN_KILLACTIVE) // deaktivace stranky + if (((NMHDR*)lParam)->code == PSN_KILLACTIVE) // page deactivation { if (ValidateData()) SetWindowLongPtr(HWindow, DWLP_MSGRESULT, FALSE); - else // nepovolime deaktivaci stranky + else // do not allow the page to deactivate SetWindowLongPtr(HWindow, DWLP_MSGRESULT, TRUE); return TRUE; } if (((NMHDR*)lParam)->code == PSN_HELP) - { // stisknuto tlacitko Help + { // Help button pressed if (WinLibLTHelpCallback != NULL && HelpID != -1) WinLibLTHelpCallback(HWindow, HelpID); return TRUE; } - if (((NMHDR*)lParam)->code == PSN_SETACTIVE) // aktivace stranky + if (((NMHDR*)lParam)->code == PSN_SETACTIVE) // page activation { if (ParentDialog != NULL && ParentDialog->LastPage != NULL) - { // zapamatovani posledni stranky + { // remember the last page *ParentDialog->LastPage = ParentDialog->GetCurSel(); } break; } if (((NMHDR*)lParam)->code == PSN_APPLY) - { // stisknuto tlacitko ApplyNow nebo OK + { // ApplyNow or OK button pressed if (TransferData(ttDataFromWindow)) SetWindowLongPtr(HWindow, DWLP_MSGRESULT, PSNRET_NOERROR); else @@ -715,15 +716,15 @@ CPropSheetPage::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) } if (((NMHDR*)lParam)->code == PSN_WIZFINISH) - { // stisknuto tlacitko Finish - // neprislo PSN_KILLACTIVE - provedu validaci + { // Finish button pressed + // PSN_KILLACTIVE did not arrive - perform validation if (!ValidateData()) { SetWindowLongPtr(HWindow, DWLP_MSGRESULT, TRUE); return TRUE; } - // obehnu vsechny stranky pro transfer + // iterate over all pages for data transfer for (int i = 0; i < ParentDialog->Count; i++) { if (ParentDialog->At(i)->HWindow != NULL) @@ -751,7 +752,7 @@ CPropSheetPage::CPropSheetPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, CPropSheetPage* dlg; switch (uMsg) { - case WM_INITDIALOG: // prvni zprava - pripojeni objektu k dialogu + case WM_INITDIALOG: // first message - attach the object to the dialog { dlg = (CPropSheetPage*)((PROPSHEETPAGE*)lParam)->lParam; if (dlg == NULL) @@ -763,21 +764,21 @@ CPropSheetPage::CPropSheetPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, { dlg->HWindow = hwndDlg; dlg->Parent = ::GetParent(hwndDlg); - //--- zarazeni okna podle hwndDlg do seznamu oken - if (!WindowsManager.AddWindow(hwndDlg, dlg)) // chyba + //--- add the window identified by hwndDlg to the window list + if (!WindowsManager.AddWindow(hwndDlg, dlg)) // error { TRACE_E("Error during creating of dialog."); return TRUE; } - dlg->NotifDlgJustCreated(); // zavedeno jako misto pro upravu layoutu dialogu + dlg->NotifDlgJustCreated(); // added as a place to adjust the dialog layout } break; } - case WM_DESTROY: // posledni zprava - odpojeni objektu od dialogu + case WM_DESTROY: // last message - detach the object from the dialog { dlg = (CPropSheetPage*)WindowsManager.GetWindowPtr(hwndDlg); - INT_PTR ret = FALSE; // pro pripad, ze ji nezpracuje + INT_PTR ret = FALSE; // in case the dialog does not handle the message if (dlg != NULL && dlg->Is(otDialog)) { // Petr: posunul jsem dolu pod wnd->WindowProc(), aby behem WM_DESTROY @@ -790,7 +791,7 @@ CPropSheetPage::CPropSheetPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, if (dlg->IsAllocated()) delete dlg; else - dlg->HWindow = NULL; // informace o odpojeni + dlg->HWindow = NULL; // mark as detached } return ret; } @@ -807,11 +808,11 @@ CPropSheetPage::CPropSheetPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, #endif } } - //--- zavolani metody DialogProc(...) prislusneho objektu dialogu + //--- call DialogProc(...) of the corresponding dialog object if (dlg != NULL) return dlg->DialogProc(uMsg, wParam, lParam); else - return FALSE; // chyba nebo message neprisla mezi WM_INITDIALOG a WM_DESTROY + return FALSE; // error, or the message did not arrive between WM_INITDIALOG and WM_DESTROY } // @@ -915,9 +916,9 @@ CWindowsManager::GetWindowPtr(HWND hWnd) CWindowQueue::~CWindowQueue() { if (!Empty()) - TRACE_E("Some window is still opened in " << QueueName << " queue!"); // nemelo by nastat... - // tady uz multi-threadovost nehrozi (konci plugin, thready jsou/byly ukonceny) - // dealokujeme aspon nejakou pamet + TRACE_E("Some window is still opened in " << QueueName << " queue!"); // should not happen... + // multithreading is no longer an issue here (the plugin is shutting down, the threads are already terminated) + // free at least some memory CWindowQueueItem* last; CWindowQueueItem* item = Head; while (item != NULL) @@ -949,7 +950,7 @@ void CWindowQueue::Remove(HWND hWindow) CWindowQueueItem* item = Head; while (item != NULL) { - if (item->HWindow == hWindow) // nalezeno, odstranime + if (item->HWindow == hWindow) // found, remove it { if (last != NULL) last->Next = item->Next; @@ -988,16 +989,16 @@ void CWindowQueue::BroadcastMessage(DWORD uMsg, WPARAM wParam, LPARAM lParam) BOOL CWindowQueue::CloseAllWindows(BOOL force, int waitTime, int forceWaitTime) { - // posleme zadost o zavreni vsech oken + // send a request to close all windows BroadcastMessage(WM_CLOSE, 0, 0); - // pockame az/jestli se zavrou + // wait to see whether they close DWORD ti = GetTickCount(); DWORD w = force ? forceWaitTime : waitTime; while ((w == INFINITE || w > 0) && !Empty()) { DWORD t = GetTickCount() - ti; - if (w == INFINITE || t < w) // mame jeste cekat + if (w == INFINITE || t < w) // keep waiting? { if (w == INFINITE || 50 < w - t) Sleep(50); @@ -1021,7 +1022,7 @@ BOOL CWindowQueue::CloseAllWindows(BOOL force, int waitTime, int forceWaitTime) BOOL CTransferInfo::GetControl(HWND& ctrlHWnd, int ctrlID, BOOL ignoreIsGood) { if (!ignoreIsGood && !IsGood()) - return FALSE; // dalsi nema cenu zpracovavat + return FALSE; // no point processing any further ctrlHWnd = GetDlgItem(HDialog, ctrlID); if (ctrlHWnd == NULL) { @@ -1041,8 +1042,8 @@ void CTransferInfo::EnsureControlIsFocused(int ctrlID) HWND wnd = GetFocus(); while (wnd != NULL && wnd != ctrl) wnd = ::GetParent(wnd); - if (wnd == NULL) // fokusime jen pokud neni ctrl predek GetFocusu - { // jako napr. edit-line v combo-boxu + if (wnd == NULL) // only set focus if ctrl is not an ancestor of GetFocus() + { // for example, the edit line in a combo box SendMessage(HDialog, WM_NEXTDLGCTL, (WPARAM)ctrl, TRUE); } } @@ -1100,8 +1101,8 @@ void CTransferInfo::EditLine(int ctrlID, double& value, char* format, BOOL selec BOOL decPoints = FALSE; BOOL expPart = FALSE; if (*s == '-' || *s == '+') - s++; // preskok znamenka - while (*s != 0) // prevod carky na tecku + s++; // skip a digit + while (*s != 0) // convert comma to dot { if (!expPart && !decPoints && (*s == ',' || *s == '.')) { @@ -1114,7 +1115,7 @@ void CTransferInfo::EditLine(int ctrlID, double& value, char* format, BOOL selec { expPart = TRUE; if (*(s + 1) == '+' || *(s + 1) == '-') - s++; // preskok +- za E + s++; // skip +/- after E } else { @@ -1132,7 +1133,7 @@ void CTransferInfo::EditLine(int ctrlID, double& value, char* format, BOOL selec if (*s == 0) value = atof(buff); // jen pokud je cislo else - value = 0; // pri chybe dame nulu + value = 0; // on error, use zero break; } } @@ -1162,8 +1163,8 @@ void CTransferInfo::EditLine(int ctrlID, int& value, BOOL select) char* s = buff; if (*s == '-' || *s == '+') - s++; // preskok znamenka - while (*s != 0) // kontrola cisla + s++; // skip a digit + while (*s != 0) // validate the number { if (*s < '0' || *s > '9') { From 9a7f2a3e259fc546d6ac1bac628427fd6b4127a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:23:54 +0200 Subject: [PATCH 200/710] [translation] Fix src/plugins/shared/lukas/array2.h comments (#573) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/plugins/shared/lukas/array2.h | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/plugins/shared/lukas/array2.h b/src/plugins/shared/lukas/array2.h index 017ea8f3a..a63cb3e80 100644 --- a/src/plugins/shared/lukas/array2.h +++ b/src/plugins/shared/lukas/array2.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once @@ -14,11 +15,11 @@ template class TDirectArray2 { protected: - DATA_TYPE** Blocks; // ukazatel na pole bloku - int BlockSize; // velikost jednoho bloku + DATA_TYPE** Blocks; // pointer to the block array + int BlockSize; // block size public: - int Count; // pocet prvku v poli + int Count; // number of elements in the array TDirectArray2(int blockSize) { @@ -31,15 +32,15 @@ class TDirectArray2 virtual void Destructor(int) {} - void Destroy(); // vycisti pole - BOOL Add(const DATA_TYPE& member); // prida prvek na posledni pozici - BOOL Delete(int index); // zrusi prvek na dane pozici, na jeho misto - // soupne prvek z posledniho mista a zmensi pole + void Destroy(); // clears the array + BOOL Add(const DATA_TYPE& member); // adds an element at the end + BOOL Delete(int index); // deletes the element at the given position; + // moves the last element into its place and shrinks the array /* - CDynamicArray * const &operator[](float index); // funkce se nikdy nevola, ale kdyz tu neni - // tak dela MSVC strasny veci -*/ - DATA_TYPE& operator[](int index) //vraci prvek na pozici + * this function is never called, but without it + * MSVC does terrible things + */ + DATA_TYPE& operator[](int index) // returns the element at the given index { return Blocks[index / BlockSize][index % BlockSize]; } @@ -115,8 +116,8 @@ void TDirectArray2::Destroy() for (int i = 0; i < Count; i++) Destructor(i); - //byl-li Count == BlockSize delalo to problemy - //proto je zde Count - 1 + //if Count == BlockSize, it caused problems, + //so Count - 1 is used here for (DATA_TYPE** block = Blocks; block <= Blocks + (Count - 1) / BlockSize; block++) { free(*block); From 0b4f927ae66580a6533efadf3193c47f8631f757 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:24:01 +0200 Subject: [PATCH 201/710] [translation] Fix src/plugins/shared/lukas/diff.h comments (#574) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/plugins/shared/lukas/diff.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/shared/lukas/diff.h b/src/plugins/shared/lukas/diff.h index 45b92c737..26342a2e2 100644 --- a/src/plugins/shared/lukas/diff.h +++ b/src/plugins/shared/lukas/diff.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once @@ -500,9 +501,9 @@ diff_t::operator()( ptrdiff_t d; size_t p, s; - // The ses function assumes the SES will begin and end with a delete or - // insert. The following will insure this is true by eating any beginning - // matches. This is also a quick to process sequences that match entirely. + // The ses function assumes the SES begins and ends with a delete or insert. + // The following ensures this by consuming any leading matches. + // It is also a quick way to process sequences that match entirely. // eat common prefix p = 0; From cc1de6ed0cd57039ad600b169476d4ad03895e21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:24:07 +0200 Subject: [PATCH 202/710] [translation] Fix src/plugins/shared/lukas/gdi.h comments (#575) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/plugins/shared/lukas/gdi.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/plugins/shared/lukas/gdi.h b/src/plugins/shared/lukas/gdi.h index d76781eef..e25674958 100644 --- a/src/plugins/shared/lukas/gdi.h +++ b/src/plugins/shared/lukas/gdi.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once @@ -17,24 +18,24 @@ class CBackbufferedDC ~CBackbufferedDC(); void Destroy(); - // nastavi okno ke kteremu se DC vaze + // Sets the window the DC is bound to void SetWindow(HWND window); - // aktualizuje vnitrni data v zavislosti na zmene velikosti okna/rozliseni - // obrazovky apod; nevolat mezi BeginPaint a EndPaint + // Updates internal data after changes in window size, screen + // resolution, etc.; do not call between BeginPaint and EndPaint void Update(); - // zahaji kresleni do okna, _musi_ parovat s EndPaint, nelze volat - // opakovane + // Starts drawing into the window; _must_ be paired with EndPaint; + // cannot be called repeatedly void BeginPaint(); - // ukonci kresleni a zkopiruje obsah back-bufferu na obrazovku + // Ends drawing and copies the back buffer contents to the screen void EndPaint(); - // DC pro kresleni do okna, platne jen mezi BeginPaint a EndPaint + // DC for drawing into the window, valid only between BeginPaint and EndPaint operator HDC(); - // vrati rectangle o rozmerech bufferu + // Returns a RECT with the buffer dimensions const RECT& GetRect() { return ClientRect; } private: From 85982fc158a4114dad4b1f154d5bcb81290ad6c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:24:14 +0200 Subject: [PATCH 203/710] [translation] Fix src/plugins/shared/lukas/killdbg.h comments (#576) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/plugins/shared/lukas/killdbg.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/shared/lukas/killdbg.h b/src/plugins/shared/lukas/killdbg.h index 10b33fb3e..008a43952 100644 --- a/src/plugins/shared/lukas/killdbg.h +++ b/src/plugins/shared/lukas/killdbg.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once @@ -12,7 +13,7 @@ // TRACE // -// aby nedochazelo k problemum se stredniky v nize nadefinovanych makrech +// to avoid semicolon issues in the macros defined below inline void __TraceEmptyFunction() {} #define TRACE_MI(file, line, str) __TraceEmptyFunction() @@ -44,7 +45,7 @@ inline void __TraceEmptyFunction() {} #define CALL_STACK_MESSAGE12(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12) #define CALL_STACK_MESSAGE13(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13) -// prazdne makro: oznamuje CheckStk, ze u teto funkce si call-stack message neprejeme +// empty macro: tells CheckStk that no call-stack message is wanted for this function #define CALL_STACK_MESSAGE_NONE // **************************************************************************** @@ -52,5 +53,5 @@ inline void __TraceEmptyFunction() {} // SetThreadNameInVCAndTrace // -// eliminace volani SetThreadNameInVCAndTrace +// eliminates calls to SetThreadNameInVCAndTrace inline void SetThreadNameInVCAndTrace(const char* name) {} From 30cc8b9a4778c3d8b7b1835c7d9315aa495f62d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:24:21 +0200 Subject: [PATCH 204/710] [translation] Fix src/plugins/shared/lukas/lcutils.h comments (#577) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/plugins/shared/lukas/lcutils.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/plugins/shared/lukas/lcutils.h b/src/plugins/shared/lukas/lcutils.h index 852c2d259..e9dd9b51d 100644 --- a/src/plugins/shared/lukas/lcutils.h +++ b/src/plugins/shared/lukas/lcutils.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once @@ -35,13 +36,13 @@ private: \ // utilbase.cpp // -extern HINSTANCE DLLInstance; // handle k SPL-ku - jazykove nezavisle resourcy -extern HINSTANCE HLanguage; // handle k SLG-cku - jazykove zavisle resourcy -extern BOOL WindowsVistaAndLater; // Windows Vista nebo pozdejsi z rady NT (6.0+) +extern HINSTANCE DLLInstance; // SPL handle - language-independent resources +extern HINSTANCE HLanguage; // SLG handle - language-dependent resources +extern BOOL WindowsVistaAndLater; // Windows Vista or later in the NT family (6.0+) extern BOOL WindowsXP64AndLater; // Windows XP 64, Vista or later (5.2+) -// rozhrani Open Salamandera - platna od volani InitUtils() az do -// ukonceni pluginu +// Open Salamander interface - valid from the InitUtils() call until +// plugin shutdown extern CSalamanderGeneralAbstract* SG; extern CSalamanderGUIAbstract* SalGUI; From 0eec47c02ab526f7f3b7330ed13d10c88d6c8464 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:24:27 +0200 Subject: [PATCH 205/710] [translation] Fix src/plugins/shared/lukas/messages.cpp comments (#578) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/plugins/shared/lukas/messages.cpp | 51 ++++++++++++++------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/src/plugins/shared/lukas/messages.cpp b/src/plugins/shared/lukas/messages.cpp index 6046d7dbd..d14315811 100644 --- a/src/plugins/shared/lukas/messages.cpp +++ b/src/plugins/shared/lukas/messages.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -60,7 +61,7 @@ BOOL CMessageCenter::SendMessage(CMessage* message, BOOL bufferTimeout) while (1) { - // vlezeme do kriticke sekce + // enter the critical section if (WaitForSingleObject(DataMutex, INFINITE) != WAIT_OBJECT_0) { TRACE_E("Unable to enter critical section for sending message."); @@ -72,26 +73,26 @@ BOOL CMessageCenter::SendMessage(CMessage* message, BOOL bufferTimeout) if (Buffer->WritePos + message->Size <= BufferSize) { - // nastavime ID odesilatele + // set the sender ID message->SenderID = SenderID; - // provedeme zapis + // copy the message into the buffer my_memcpy2((char*)Buffer + Buffer->WritePos, message, message->Size); - // informuje prijemce, ze ma v bufferu zpravu + // notify the receiver that the buffer contains a message if (Buffer->WritePos == sizeof(CBuffer)) { SetEvent(HaveMessage); ResetEvent(BufferFree); } Buffer->WritePos += message->Size; - // uvolnime kritickou sekci + // leave the critical section ReleaseMutex(DataMutex); - return TRUE; // uspech + return TRUE; // success } - // uvolnime kritickou sekci + // leave the critical section ReleaseMutex(DataMutex); - // pockame az se uvolni misto v bufferu, nebo server chcipne + // wait until space is freed in the buffer or the server exits HANDLE handles[] = {BufferFree, Reciever}; DWORD ret = WaitForMultipleObjects(2, handles, FALSE, bufferTimeout); if (ret == WAIT_TIMEOUT) @@ -115,7 +116,7 @@ BOOL CMessageCenter::RecieveMessages(CMessageListener* listener) if (Sender) return FALSE; - // vlezeme do kriticke sekce + // enter the critical section DWORD ret = WaitForSingleObject(DataMutex, INFINITE); if (ret == WAIT_FAILED) { @@ -125,20 +126,20 @@ BOOL CMessageCenter::RecieveMessages(CMessageListener* listener) } if (ret == WAIT_OBJECT_0) { - // vyprazdnime message buffer + // drain the message buffer for (int pos = sizeof(CBuffer); pos < Buffer->WritePos; pos += MESSAGE_AT_POS(pos)->Size) { if (MESSAGE_AT_POS(pos)->Size == 0) - break; // to by byl nekonecny cyklus a navic je to nesmysl + break; // zero-size messages would cause an infinite loop and make no sense anyway listener->RecieveMessage(MESSAGE_AT_POS(pos)); } } - // nastavime buffer na prazdny (i pro abadoned data-mutex) + // mark the buffer as empty (even for an abandoned data mutex) Buffer->WritePos = sizeof(CBuffer); SetEvent(BufferFree); ResetEvent(HaveMessage); - // uvolnime kritickou sekci + // leave the critical section ReleaseMutex(DataMutex); return TRUE; } @@ -211,7 +212,7 @@ BOOL CMessageCenter::Init() do { - // initem muze prochazet pouze jeden process + // only one process can be in Init at a time str = Concatenate(Name, " - Startup Mutex"); if (Sender) { @@ -233,7 +234,7 @@ BOOL CMessageCenter::Init() TRACE_E("Unable to create starting mutex."); break; } - // jde pustit pouze jeden prijemce + // only one receiver can be started if (GetLastError() == ERROR_ALREADY_EXISTS) { TRACE_I("Receiver '" << Name << "' is already running."); @@ -241,7 +242,7 @@ BOOL CMessageCenter::Init() } } - // vytvorime synchronizacni objekty + // create the synchronization objects str = Concatenate(Name, " - Data Mutex"); DataMutex = Sender ? OpenMutex(MUTEX_ALL_ACCESS, FALSE, str) : CreateMutex(NULL, FALSE, str); if (!DataMutex) @@ -260,10 +261,10 @@ BOOL CMessageCenter::Init() break; } - // vytvorime sdilenou cast pameti + // create the shared memory segment const char* mapname = Concatenate( Concatenate(Name, " - Buffer v"), Version); - FileMapping = Sender ? OpenFileMapping(FILE_MAP_WRITE, FALSE, mapname) : CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, // FIXME_X64 nepredavame x86/x64 nekompatibilni data? + FileMapping = Sender ? OpenFileMapping(FILE_MAP_WRITE, FALSE, mapname) : CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, // FIXME_X64: are we passing x86/x64-incompatible data? BufferSize, mapname); if (!FileMapping) { @@ -280,13 +281,13 @@ BOOL CMessageCenter::Init() if (Sender) { - // vlezeme do kriticke sekce + // enter the critical section if (WaitForSingleObject(DataMutex, INFINITE) != WAIT_OBJECT_0) { TRACE_E("Unable to enter critical section."); break; } - // otevreme si handle na prijemce + // open a handle to the receiver RecieverPid = Buffer->Pid; Reciever = OpenProcess(SYNCHRONIZE, FALSE, RecieverPid); if (!Reciever) @@ -295,25 +296,25 @@ BOOL CMessageCenter::Init() break; } SenderID = Buffer->UniqueCounter++; - // uvolnime kritickou sekci + // leave the critical section ReleaseMutex(DataMutex); } else { - // vlezeme do kriticke sekce + // enter the critical section if (WaitForSingleObject(DataMutex, INFINITE) == WAIT_FAILED) break; - // inicializujeme buffer + // initialize the buffer Buffer->Pid = GetCurrentProcessId(); Buffer->UniqueCounter = 0; Buffer->WritePos = sizeof(CBuffer); SetEvent(BufferFree); ResetEvent(HaveMessage); - // uvolnime kritickou sekci + // leave the critical section ReleaseMutex(DataMutex); } - // nechame ostatni procesy projit initem + // let the other processes continue through Init ReleaseMutex(StartupMutex); if (Sender) { From ae08baf0e9b559bd37a5cab331cfaa0af67d78fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:24:33 +0200 Subject: [PATCH 206/710] [translation] Fix src/plugins/shared/lukas/messages.h comments (#579) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/plugins/shared/lukas/messages.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/plugins/shared/lukas/messages.h b/src/plugins/shared/lukas/messages.h index 335c25920..84a461511 100644 --- a/src/plugins/shared/lukas/messages.h +++ b/src/plugins/shared/lukas/messages.h @@ -1,9 +1,10 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once -// aby byly struktury nezavisle na nastavenem zarovnavani +// to make the structures independent of the current packing alignment #pragma pack(push, 4) struct CMessage @@ -69,7 +70,7 @@ class CMessageCenter HANDLE HaveMessage; HANDLE FileMapping; CBuffer* Buffer; - HANDLE Reciever; // jen pro odesilatele, handle ciloveho procesu - DWORD RecieverPid; // jen pro odesilatele, id ciloveho procesu - int SenderID; // unikatni identifikator odesilatele + HANDLE Reciever; // sender only: target process handle + DWORD RecieverPid; // sender only: target process ID + int SenderID; // unique sender ID }; From 99d38e2653a071ee59e43e6975f5682ac6995d5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:24:40 +0200 Subject: [PATCH 207/710] [translation] Fix src/plugins/shared/lukas/resedit.cpp comments (#580) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/plugins/shared/lukas/resedit.cpp | 29 ++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/plugins/shared/lukas/resedit.cpp b/src/plugins/shared/lukas/resedit.cpp index e45c6db36..6a0fee956 100644 --- a/src/plugins/shared/lukas/resedit.cpp +++ b/src/plugins/shared/lukas/resedit.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" #include @@ -77,7 +78,7 @@ BOOL CResEdit::BeginUpdateResource(LPCSTR pFileName, BOOL bDeleteExistingResourc if (!File) return FALSE; - // nacteme headery + // read the headers DWORD pesig; DWORD lastError = 0; if (!Read(&MZHead, sizeof(IMAGE_DOS_HEADER), &lastError) || @@ -87,7 +88,7 @@ BOOL CResEdit::BeginUpdateResource(LPCSTR pFileName, BOOL bDeleteExistingResourc !Read(&PEHead, sizeof(IMAGE_FILE_HEADER)) || !Read(&OptHead, OPTHEAD_SIZE) || !Read(OptHead.DataDirectory, OptHead.NumberOfRvaAndSizes * sizeof(IMAGE_DATA_DIRECTORY)) || - OptHead.NumberOfRvaAndSizes <= IMAGE_DIRECTORY_ENTRY_RESOURCE) //zkontrolujeme jestli mame ressource dir + OptHead.NumberOfRvaAndSizes <= IMAGE_DIRECTORY_ENTRY_RESOURCE) // check whether a resource directory is present { if (lastError == ERROR_INVALID_HANDLE && ++num_of_retries <= 10) { @@ -99,8 +100,8 @@ BOOL CResEdit::BeginUpdateResource(LPCSTR pFileName, BOOL bDeleteExistingResourc goto error; } - // nactene section headery, allokujeme o jednu vice, kdyby mezi nima nebyla - // .rsrc section, tak abych ji mohli pridat bez reallokace + // section headers read; allocate one extra slot so a missing + // .rsrc section can be added without reallocating Sections = (IMAGE_SECTION_HEADER*)malloc(sizeof(IMAGE_SECTION_HEADER) * (PEHead.NumberOfSections + 1)); if (!Sections) { @@ -113,7 +114,7 @@ BOOL CResEdit::BeginUpdateResource(LPCSTR pFileName, BOOL bDeleteExistingResourc goto error; } - // najdeme resource section + // find the resource section DWORD i; RsrcSectIndex = -1; SizeOfInitializedData = 0; @@ -138,7 +139,7 @@ BOOL CResEdit::BeginUpdateResource(LPCSTR pFileName, BOOL bDeleteExistingResourc TRACE_I(".rsrc section not found."); else { - // overime ze nalezena section obsahuje resource dir + // verify that the section we found contains the resource directory if (Sections[RsrcSectIndex].VirtualAddress > OptHead.DataDirectory[IMAGE_DIRECTORY_ENTRY_RESOURCE].VirtualAddress || Sections[RsrcSectIndex].VirtualAddress + Sections[RsrcSectIndex].SizeOfRawData <= OptHead.DataDirectory[IMAGE_DIRECTORY_ENTRY_RESOURCE].VirtualAddress) { @@ -146,8 +147,8 @@ BOOL CResEdit::BeginUpdateResource(LPCSTR pFileName, BOOL bDeleteExistingResourc goto error; } - // overime .rsrc section neobsahuje jine data adresare (jako napr UPXnuty exac, - // ktery ma v .rsrc sekci ulozenou import tabulku) + // verify that the .rsrc section contains no other directory data (for + // example a UPX-packed executable that stores the import table in .rsrc) DWORD alignedSize = ((Sections[RsrcSectIndex].Misc.VirtualSize + OptHead.SectionAlignment - 1) / OptHead.SectionAlignment) * OptHead.SectionAlignment; for (i = 0; i < OptHead.NumberOfRvaAndSizes; i++) { @@ -284,7 +285,7 @@ BOOL CResEdit::SaveResourceTree() CALL_STACK_MESSAGE1("CResEdit::SaveResourceTree()"); if (ResDir->IsEmpty()) { - //odstranime resource section + //remove the resource section if (RsrcSectIndex != -1) { PEHead.NumberOfSections--; @@ -300,10 +301,10 @@ BOOL CResEdit::SaveResourceTree() } else { - //ulozime resourcy + //save the resources if (RsrcSectIndex == -1) { - //pridame resource section + //add the resource section RsrcSectIndex = PEHead.NumberOfSections; memcpy(Sections[RsrcSectIndex].Name, ".rsrc", 5); memset(Sections[RsrcSectIndex].Name + 5, 0, 3); @@ -706,7 +707,7 @@ void SortDirEntries(int left, int right, TIndirectArray2& entries) DWORD CResDir::Save(CSaveRes* save) { CALL_STACK_MESSAGE1("CResDir::Save()"); - //seradime polozky, nejprve abecedne ty se jmenem a pak ciselne ty s ID + //sort entries: named ones alphabetically first, then ID entries numerically SortDirEntries(0, DirEntries.Count - 1, DirEntries); IMAGE_RESOURCE_DIRECTORY rsdirh; @@ -898,7 +899,7 @@ CResTreeLeaf::GetCopy() BOOL CResTreeLeaf::Load(int level, DWORD offset, COffsets* offsets) { CALL_STACK_MESSAGE3("CResTreeLeaf::Load(%d, 0x%p, )", level, offsets); - //nacteme language dir + //read the language directory if (!Seek(offsets->DirRootOffset + offset)) return FALSE; @@ -917,7 +918,7 @@ BOOL CResTreeLeaf::Load(int level, DWORD offset, COffsets* offsets) //NumberOfIdEntries = 1; LangID = (LANGID)rsdir.Name; - //nacteme resource data + //read the resource data if (!Seek(offsets->DirRootOffset + rsdir.OffsetToData & ~0x80000000)) return FALSE; From eac95bb185009be3310cdeca6042266e418f20dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:24:46 +0200 Subject: [PATCH 208/710] [translation] Fix src/plugins/shared/lukas/str.cpp comments (#581) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/plugins/shared/lukas/str.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/shared/lukas/str.cpp b/src/plugins/shared/lukas/str.cpp index e12b0a0b5..b1e3c4299 100644 --- a/src/plugins/shared/lukas/str.cpp +++ b/src/plugins/shared/lukas/str.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -37,7 +38,7 @@ CSTR::CSTR() // **************************************************************************** -// optimalizace: pÅ™edpokládá, že s2 je v lowercase +// Optimization: assumes s2 is lowercase int MemCmpI(const char* s1, const char* s2, int n) { @@ -52,7 +53,7 @@ int MemCmpI(const char* s1, const char* s2, int n) return 0; } -// optimalizace: pÅ™edpokládá, že s je v lowercase +// Optimization: assumes s is lowercase char* MemChrI(char* s, char c, int n) { From e6436e5c04ed832e6354aac9986188644433bbf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:24:53 +0200 Subject: [PATCH 209/710] [translation] Fix src/plugins/shared/lukas/utilaux.cpp comments (#582) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/plugins/shared/lukas/utilaux.cpp | 37 ++++++++++++++-------------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/src/plugins/shared/lukas/utilaux.cpp b/src/plugins/shared/lukas/utilaux.cpp index 864a1454f..92caf474b 100644 --- a/src/plugins/shared/lukas/utilaux.cpp +++ b/src/plugins/shared/lukas/utilaux.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -185,13 +186,13 @@ CArgv::CArgv(const char* commandLine) : TIndirectArray(8, 8) const char* start = commandLine; while (*start) { - // orizneme white-space na zacatku + // trim leading whitespace while (*start && IsSpace(*start)) start++; if (!*start) break; const char* end = start; - // najdeme konec tokenu + // find the end of the token while (*end && !IsSpace(*end)) { if (*end++ == '"') @@ -203,7 +204,7 @@ CArgv::CArgv(const char* commandLine) : TIndirectArray(8, 8) end = start + strlen(start); } } - // pridame token do pole + // add the token to the array char* str = DupStr(start, end); RemoveCharacters(str, str, "\""); Add(str); @@ -243,12 +244,12 @@ BOOL SalGetFullName(char* name, int* errTextID, const char* curDir) CALL_STACK_MESSAGE3("SalGetFullName(%s, , %s)", name, curDir); int err = 0; - size_t rootOffset = 3; // offset zacatku adresarove casti cesty (3 pro "c:\path") + size_t rootOffset = 3; // offset of the start of the directory part of the path (3 for "c:\path") char* s = name; while (*s == ' ') s++; if (*s == '\\' && *(s + 1) == '\\') // UNC (\\server\share\...) - { // eliminace mezer na zacatku cesty + { // trim leading spaces from the path if (s != name) memmove(name, s, strlen(s) + 1); s = name + 2; @@ -257,7 +258,7 @@ BOOL SalGetFullName(char* name, int* errTextID, const char* curDir) else { while (*s != 0 && *s != '\\') - s++; // prejeti servername + s++; // skip past the server name if (*s == '\\') s++; if (*s == 0 || *s == '\\') @@ -265,20 +266,20 @@ BOOL SalGetFullName(char* name, int* errTextID, const char* curDir) else { while (*s != 0 && *s != '\\') - s++; // prejeti sharename + s++; // skip past the share name if (*s == '\\') s++; } } } - else // cesta zadana pomoci disku (c:\...) + else // drive-letter path (c:\...) { if (*s != 0) { if (*(s + 1) == ':') // "c:..." { if (*(s + 2) == '\\') // "c:\..." - { // eliminace mezer na zacatku cesty + { // trim leading spaces from the path if (s != name) memmove(name, s, strlen(s) + 1); } @@ -323,7 +324,7 @@ BOOL SalGetFullName(char* name, int* errTextID, const char* curDir) root++; if (l1 + (root - curDir) >= MAX_PATH) err = GFN_TOOLONGPATH; - else // sestaveni cesty z rootu akt. disku + else // build the path from the current drive root { memmove(name + (root - curDir), s, l1 + 1); memmove(name, curDir, root - curDir); @@ -378,32 +379,32 @@ BOOL SalGetFullName(char* name, int* errTextID, const char* curDir) } } - if (err == 0) // eliminace '.' a '..' v ceste + if (err == 0) // remove '.' and '..' from the path { if (!SG->SalRemovePointsFromPath(s)) err = GFN_PATHISINVALID; } - if (err == 0) // vyhozeni pripadneho nezadouciho backslashe z konce retezce + if (err == 0) // remove any unwanted trailing backslash { size_t l = strlen(name); - if (l > 1 && name[1] == ':') // typ cesty "c:\path" + if (l > 1 && name[1] == ':') // drive-letter path ("c:\path") { - if (l > 3) // neni root cesta + if (l > 3) // not a root path { if (name[l - 1] == '\\') - name[l - 1] = 0; // orez backslashe + name[l - 1] = 0; // trim trailing backslash } else { - name[2] = '\\'; // root cesta, backslash nutny ("c:\") + name[2] = '\\'; // root path, backslash required ("c:\") name[3] = 0; } } - else // UNC cesta + else // UNC path { if (l > 0 && name[l - 1] == '\\') - name[l - 1] = 0; // orez backslashe + name[l - 1] = 0; // trim trailing backslash } } From 3d9fdd3e2b54dd3e3ab4268960bf648a11fddea1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:25:00 +0200 Subject: [PATCH 210/710] [translation] Fix src/plugins/shared/lukas/utilbase.cpp comments (#583) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/plugins/shared/lukas/utilbase.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/plugins/shared/lukas/utilbase.cpp b/src/plugins/shared/lukas/utilbase.cpp index ffc2ba010..36afd68f5 100644 --- a/src/plugins/shared/lukas/utilbase.cpp +++ b/src/plugins/shared/lukas/utilbase.cpp @@ -1,24 +1,25 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" // **************************************************************************** -HINSTANCE DLLInstance = NULL; // handle k SPL-ku - jazykove nezavisle resourcy -HINSTANCE HLanguage = NULL; // handle k SLG-cku - jazykove zavisle resourcy +HINSTANCE DLLInstance = NULL; // Handle to the SPL - language-independent resources +HINSTANCE HLanguage = NULL; // Handle to the SLG - language-dependent resources BOOL WindowsVistaAndLater; // Windows Vista nebo pozdejsi z rady NT (6.0+) BOOL WindowsXP64AndLater; // Windows XP 64, Vista or later (5.2+) -// rozhrani Open Salamandera - platna od volani InitUtils() az do -// ukonceni pluginu +// Open Salamander interface - valid from the InitUtils() call until +// the plugin terminates CSalamanderGeneralAbstract* SG = NULL; CSalamanderGUIAbstract* SalGUI = NULL; -// definice promenne pro "dbg.h" +// Variable definition for "dbg.h" CSalamanderDebugAbstract* SalamanderDebug = NULL; -// definice promenne pro "spl_com.h" +// Variable definition for "spl_com.h" int SalamanderVersion = 0; DWORD MainThreadID; @@ -49,33 +50,33 @@ BOOL InitLCUtils(CSalamanderPluginEntryAbstract* salamander, const char* pluginN { CALL_STACK_MESSAGE_NONE - // nastavime SalamanderDebug pro "dbg.h" + // Set SalamanderDebug for "dbg.h" SalamanderDebug = salamander->GetSalamanderDebug(); - // nastavime SalamanderVersion pro "spl_com.h" + // Set SalamanderVersion for "spl_com.h" SalamanderVersion = salamander->GetVersion(); CALL_STACK_MESSAGE1("InitLCUtils()"); - // tento plugin je delany pro aktualni verzi Salamandera a vyssi - provedeme kontrolu + // Check that the current Salamander version is supported if (SalamanderVersion < LAST_VERSION_OF_SALAMANDER) - { // tady nelze volat Error, protoze pouziva SG->SalMessageBox (SG neni inicializovane + jde o nekompatibilni rozhrani) + { // Error cannot be called here because it uses SG->SalMessageBox (SG is not initialized and the interface is incompatible) MessageBox(salamander->GetParentWindow(), REQUIRE_LAST_VERSION_OF_SALAMANDER, pluginName, MB_OK | MB_ICONERROR); return FALSE; } - // nechame nacist jazykovy modul (.slg) + // Load the language module (.slg) HLanguage = salamander->LoadLanguageModule(salamander->GetParentWindow(), pluginName); if (HLanguage == NULL) return FALSE; - // ziskame rozhrani Salamandera + // Get the Salamander interface SG = salamander->GetSalamanderGeneral(); SalGUI = salamander->GetSalamanderGUI(); - // zjistime si na jakem bezime OS + // Determine which OS we are running on WindowsXP64AndLater = SalIsWindowsVersionOrGreater(5, 2, 0); WindowsVistaAndLater = SalIsWindowsVersionOrGreater(6, 0, 0); From 2358776b0a519abc43086e9ab61fe746b91788e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:25:08 +0200 Subject: [PATCH 211/710] [translation] Fix src/plugins/shared/lukas/utildlg.cpp comments (#584) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/plugins/shared/lukas/utildlg.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/plugins/shared/lukas/utildlg.cpp b/src/plugins/shared/lukas/utildlg.cpp index d11da6824..ff910b670 100644 --- a/src/plugins/shared/lukas/utildlg.cpp +++ b/src/plugins/shared/lukas/utildlg.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -53,7 +54,7 @@ void HistoryComboBox(CTransferInfo& ti, int id, char* text, int textMax, int toMove = historySize - 1; - // podivame jestli uz stejna polozka neni v historii + // Check whether the same item is already in the history. int i; for (i = 0; i < historySize; i++) { @@ -65,17 +66,17 @@ void HistoryComboBox(CTransferInfo& ti, int id, char* text, int textMax, break; } } - // alokujeme si pamet pro novou polozku + // Allocate memory for the new item. char* ptr = new char[strlen(text) + 1]; if (ptr) { - // uvolnime pamet vymazavane polozky + // Free the removed item's memory. if (history[toMove]) delete[] history[toMove]; - // vytvorime misto pro cestu kterou budeme ukladat + // Make room for the path we are about to store. for (i = toMove; i > 0; i--) history[i] = history[i - 1]; - // ulozime cestu + // Store the path. strcpy(ptr, text); history[0] = ptr; } From 699f4d944dd0115b34d65ebf2749185a733b0dc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:25:15 +0200 Subject: [PATCH 212/710] [translation] Fix src/common/allochan.cpp comments (#585) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/common/allochan.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/common/allochan.cpp b/src/common/allochan.cpp index 48c360e49..cebe5d2af 100644 --- a/src/common/allochan.cpp +++ b/src/common/allochan.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -28,15 +29,15 @@ // boundaries so we can find the real functions // that we need to call for initialization. -#pragma warning(disable : 4075) // chceme definovat poradi inicializace modulu +#pragma warning(disable : 4075) // We want to define the module initialization order. typedef void(__cdecl* _PVFV)(void); #pragma section(".i_alc$a", read) -__declspec(allocate(".i_alc$a")) const _PVFV i_allochan = (_PVFV)1; // na zacatek sekce .i_alc si dame promennou i_allochan +__declspec(allocate(".i_alc$a")) const _PVFV i_allochan = (_PVFV)1; // Place i_allochan at the start of section .i_alc. #pragma section(".i_alc$z", read) -__declspec(allocate(".i_alc$z")) const _PVFV i_allochan_end = (_PVFV)1; // a na konec sekce .i_alc si dame promennou i_allochan_end +__declspec(allocate(".i_alc$z")) const _PVFV i_allochan_end = (_PVFV)1; // Place i_allochan_end at the end of section .i_alc. void Initialize__Allochan() { @@ -101,7 +102,7 @@ int C__AllocHandlerInit::AltapNewHandler(size_t size) int ret = 1; int ti = GetTickCount(); EnterCriticalSection(&__AllocHandlerInit.CriticalSection); - if (GetTickCount() - ti <= 500) // message-box budeme ukazovat jen pokud jsme pred momentem usera nenutili resit stejny problem v jinem threadu + if (GetTickCount() - ti <= 500) // Show the message box only if another thread did not just make the user deal with the same problem. { TCHAR buf[550]; _sntprintf_s(buf, _countof(buf) - 1, __AllocHandlerMessage, size); @@ -112,7 +113,7 @@ int C__AllocHandlerInit::AltapNewHandler(size_t size) if (res == 0) { TRACE_ET(_T("AltapNewHandler: unable to open message-box!")); - Sleep(1000); // nechame masinu oddechnout a zkusime ukazat msgbox znovu + Sleep(1000); // Give the system a moment, then try to show the message box again. } } while (res == 0); if (res == IDABORT) // terminate @@ -123,15 +124,15 @@ int C__AllocHandlerInit::AltapNewHandler(size_t size) if (res == 0) { TRACE_ET(_T("AltapNewHandler: unable to open message-box with abort-warning!")); - Sleep(1000); // nechame masinu oddechnout a zkusime ukazat msgbox znovu + Sleep(1000); // Give the system a moment, then try to show the message box again. } } while (res == 0); if (res == IDYES) - TerminateProcess(GetCurrentProcess(), 777); // tvrdsi exit (ExitProcess jeste neco vola) + TerminateProcess(GetCurrentProcess(), 777); // Hard terminate the process (ExitProcess still runs additional code). } else { - if (res == IDIGNORE) // uzivatel chce poslat problem alokace do aplikace (return NULL), mista, kde se alokuji velke bloky by mely byt osetrene (jinak to spadne pri pristupu na NULL) + if (res == IDIGNORE) // Let the application handle the allocation failure (return NULL); call sites that allocate large blocks should check for this, or they will crash on NULL dereference. { do { @@ -139,16 +140,16 @@ int C__AllocHandlerInit::AltapNewHandler(size_t size) if (res == 0) { TRACE_ET(_T("AltapNewHandler: unable to open message-box with ignore-warning!")); - Sleep(1000); // nechame masinu oddechnout a zkusime ukazat msgbox znovu + Sleep(1000); // Give the system a moment, then try to show the message box again. } } while (res == 0); if (res == IDYES) - ret = 0; // vracime NULL do aplikace + ret = 0; // Return NULL to the application. } } } LeaveCriticalSection(&__AllocHandlerInit.CriticalSection); - return ret; // retry nebo NULL + return ret; // Either retry or return NULL. } #endif // ALLOCHAN_DISABLE From 91c864533167f177c946f817b181f8f013e59188 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:25:22 +0200 Subject: [PATCH 213/710] [translation] Fix src/common/allochan.h comments (#586) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/common/allochan.h | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/common/allochan.h b/src/common/allochan.h index 4e570035d..45ccd94da 100644 --- a/src/common/allochan.h +++ b/src/common/allochan.h @@ -1,26 +1,20 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once -// Zavadi handler pro reseni situace, kdy dosla pamet pri volani operatoru new nebo -// funkce malloc (tu pouzivaji calloc, realloc a dalsi, viz help). Zarucuje, ze ani -// operator new ani malloc nikdy bez vedomi uzivatele nevrati NULL. Zobrazuje -// messagebox s chybou "nedostatek pameti" a uzivatel muze po zavreni dalsich -// aplikaci zopakovat pokus o alokaci pameti. Uzivatel muze tez terminovat proces -// nebo nechat propadnout chybu alokace do aplikace (operator new nebo malloc -// vrati NULL, alokace velkych bloku pameti by na to mely byt pripravene, jinak -// dojde k padu - uzivatel je o tom informovany). +// Installs a handler for out-of-memory conditions during calls to operator new or malloc (also used by calloc, realloc, and others; see help). It guarantees that neither operator new nor malloc returns NULL without notifying the user. It displays an "insufficient memory" message box, and after closing other applications the user can retry the allocation. The user can also terminate the process or let the allocation failure propagate to the application (operator new or malloc then returns NULL; allocations of large memory blocks should be prepared for this, otherwise the application may crash, and the user is warned about that). -// nastaveni lokalizovane podoby hlasky o nedostatku pameti a varovnych hlasek -// (pokud se string nema menit, pouzijte NULL); ocekavany obsah zni: +// Sets the localized text of the out-of-memory message and warning messages +// (use NULL if a string should remain unchanged); expected contents: // message: // Insufficient memory to allocate %u bytes. Try to release some memory (e.g. // close some running application) and click Retry. If it does not help, you can // click Ignore to pass memory allocation error to this application or click Abort // to terminate this application. -// title: (pouziva se pro oboji: "message" i "warning") -// doporucujeme pouzit jmeno aplikace, at user vi, ktera aplikace si stezuje +// title: (used for both "message" and "warning") +// We recommend using the application name so the user knows which application is reporting the problem // warningIgnore: // Do you really want to pass memory allocation error to this application?\n\n // WARNING: Application may crash and then all unsaved data will be lost!\n From 22a93c3d1c012f13ece594a0cb7ae41074f3759a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:25:29 +0200 Subject: [PATCH 214/710] [translation] Fix src/common/array.h comments (#587) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/common/array.h | 67 +++++++++++++++++++++++----------------------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/src/common/array.h b/src/common/array.h index d311131f8..dc4e2cb52 100644 --- a/src/common/array.h +++ b/src/common/array.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once @@ -8,8 +9,8 @@ // Use the SAFE_ALLOC define to remove source code with testing if memory allocation // has not failed (see allochan.*). -// We need to make this module independent on TRACE macros, so if they are not defined, -// we define their fakes. Certainly error reporting will not work in such situation. +// We need to make this module independent of the TRACE macros, so if they are not defined, +// we define dummy replacements. Error reporting will not work in that case. #if !defined(TRACE_I) && !defined(TRACE_E) && !defined(TRACE_C) inline void __TraceEmptyFunction() {} #define TRACE_I(str) __TraceEmptyFunction() @@ -182,14 +183,14 @@ class TDirectArray virtual void CallDestructor(DATA_TYPE& member) { member.~DATA_TYPE(); } -private: // following methods will not be called (prevention) +private: // prevent calls to the following methods TDirectArray() {} TDirectArray(const TDirectArray&) {} TDirectArray& operator=(TDirectArray&) { return *this; } - // compiler reports error on this line: we have just wanted to catch source code designed for - // older version of TDirectArray template: use CallDestructor instead of Destructor and please - // notice that in new version of TDirectArray copy-constructors and destructors are called + // the compiler reports an error on this line: we only want to catch source code written for + // an older version of the TDirectArray template; use CallDestructor instead of Destructor, and + // note that in the new version of TDirectArray copy constructors and destructors are called virtual int Destructor(int) { return 0; } }; @@ -302,7 +303,7 @@ class TIndirectClassArray : public TIndirectArray FirstFreeIndex = 0; } -protected: // prevence proti volani nefunkcniho kodu (posouva prvky,...) +protected: // prevent calls to code that does not work (moves items, ...) void Move(CArrayDirection, int, int) {} void Insert(int, void*) {} void Insert(int, void**, int) {} @@ -324,15 +325,15 @@ class TIndirectClassArray : public TIndirectArray // -zmenseni za cenu generovani tridy podle sablony pro ruzne 'Base', 'Delta' // a zmenseni rozsahu pole -template // jen 65535 prvku +template // only 65535 items class TSmallerDirectArray { public: #if defined(_DEBUG) || defined(__ARRAY_DEBUG) - CErrorType State; // neni-li etNone stala se chyba + CErrorType State; // if not etNone, an error has occurred #endif DATA_TYPE* Data; // ukazatel na pole, public nutne misto etDestructed - WORD Count; // soucasny pocet polozek v kolekci + WORD Count; // current item count in the collection TSmallerDirectArray(); ~TSmallerDirectArray() { Destroy(); } @@ -355,12 +356,12 @@ class TSmallerDirectArray } void Insert(int index, const DATA_TYPE& member); - inline WORD Add(const DATA_TYPE& member); // prida prvek na konec Arraye, - // vraci index prvku - WORD Add(const DATA_TYPE* members, int count); // pridani count prvku members + inline WORD Add(const DATA_TYPE& member); // adds an item to the end of the array, + // returns the item index + WORD Add(const DATA_TYPE* members, int count); // adds 'count' items from 'members' - DATA_TYPE& At(int index) // vraci ukazatel na prvek na pozici - { // int pouzity jen kvuli warningum - rozsah do 65535 + DATA_TYPE& At(int index) // returns a reference to the item at 'index' + { // int is used only to avoid warnings; range up to 65535 #if defined(_DEBUG) || defined(__ARRAY_DEBUG) if (index >= 0 && index < Count) #endif @@ -371,13 +372,13 @@ class TSmallerDirectArray TRACE_C("Index is out of range (index = " << index << ", Count = " << Count << ")."); Error(etUnknownIndex); - return Data[0]; // kvuli kompileru vracim mozna neplatny prvek + return Data[0]; // because of the compiler, we return a possibly invalid item } #endif } - DATA_TYPE& operator[](int index) // vraci ukazatel na prvek na pozici - { // int pouzity jen kvuli warningum - rozsah do 65535 + DATA_TYPE& operator[](int index) // returns a reference to the item at 'index' + { // int is used only to avoid warnings; range up to 65535 #if defined(_DEBUG) || defined(__ARRAY_DEBUG) if (index >= 0 && index < Count) #endif @@ -388,7 +389,7 @@ class TSmallerDirectArray TRACE_C("Index is out of range (index = " << index << ", Count = " << Count << ")."); Error(etUnknownIndex); - return Data[0]; // kvuli kompileru vracim mozna neplatny prvek + return Data[0]; // because of the compiler, we return a possibly invalid item } #endif } @@ -404,15 +405,15 @@ class TSmallerDirectArray DATA_TYPE* GetData() { return Data; } - void DestroyMembers(); // uvolni z pameti jen prvky, pole necha - void Destroy(); // kompletni destrukce objektu - void Delete(int index); // zrusi prvek na pozici a ostatni posune - void Reduce(WORD newCount); // zrusi prvky od indexu newCount az do konce - void Delete(WORD from, WORD to); // zrusi prvky (const TSmallerDirectArray&) {} TSmallerDirectArray& operator=(TSmallerDirectArray&) { @@ -498,14 +499,14 @@ class TClassArray : public TDirectArray ~TClassArray() { Destroy(); } -private: // prevence proti volani nefunkcniho kodu (posouva prvky ...) +private: // prevent calls to code that does not work (moves items, ...) void Insert(int, const CLASS_TYPE&) {} void Insert(int, const CLASS_TYPE*, int) {} int Add(const CLASS_TYPE&) { return ULONG_MAX; } int Add(const CLASS_TYPE*, int) { return ULONG_MAX; } void Delete(int) {} void Move(CArrayDirection, int, int) {} - void DetachMembers() {} // to by nezavolalo destruktory + void DetachMembers() {} // that would not call destructors }; #define DEFINE_NEW(CLASS_TYPE) \ @@ -1190,7 +1191,7 @@ template void TSmallerDirectArray::Destroy() { #if defined(_DEBUG) || defined(__ARRAY_DEBUG) - if (State == etNone) // muze prijit etDestructed + if (State == etNone) // State can also be etDestructed { #endif if (Data != NULL) @@ -1352,7 +1353,7 @@ void TSmallerDirectArray::DestroyMembers() } template -void // int pouzity jen kvuli warningum - rozsah do 65535 +void // int is used only to avoid warnings; range up to 65535 TSmallerDirectArray::Delete(int index) { #if defined(_DEBUG) || defined(__ARRAY_DEBUG) From 2f1a87b94ca773c1d7f665cde7c17c08b2b72485 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:25:35 +0200 Subject: [PATCH 215/710] [translation] Fix src/common/dib.cpp comments (#588) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/common/dib.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/common/dib.cpp b/src/common/dib.cpp index a35bb6760..926c4e096 100644 --- a/src/common/dib.cpp +++ b/src/common/dib.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -7,7 +8,7 @@ #include #include #include -#include // potrebuju LPCOLORMAP +#include // Needed for LPCOLORMAP. #if defined(_DEBUG) && defined(_MSC_VER) // without passing file+line to 'new' operator, list of memory leaks shows only 'crtdbg.h(552)' #define new new (_NORMAL_BLOCK, __FILE__, __LINE__) @@ -21,8 +22,8 @@ #include "dib.h" -// opatreni proti runtime check failure v debug verzi: puvodni verze makra pretypovava rgb na WORD, -// takze hlasi ztratu dat (RED slozky) +// Workaround for a runtime check failure in the debug build: the original version of the macro casts rgb to WORD, +// so it reports data loss in the RED component. #undef GetGValue #define GetGValue(rgb) ((BYTE)(((rgb) >> 8) & 0xFF)) From 0592fef55e19e5f54b7c2ffd4a7b4e53e407acaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:25:41 +0200 Subject: [PATCH 216/710] [translation] Fix src/common/dib.h comments (#589) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/common/dib.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/common/dib.h b/src/common/dib.h index 96d8e4291..0b169a22f 100644 --- a/src/common/dib.h +++ b/src/common/dib.h @@ -1,11 +1,12 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once -// nacte z resourcu bitmapu hRsrc (ziskan z FindResource(...)), -// premapuje mapCount barev: mapColor[i] -> toColor[i] -// a vytvori bitmapu kompatibilni s desktopem +// loads the bitmap resource hRsrc (obtained with FindResource(...)), +// remaps mapCount colors: mapColor[i] -> toColor[i], +// and creates a bitmap compatible with the desktop HBITMAP LoadBitmapAndMapColors(HINSTANCE hInst, HRSRC hRsrc, int mapCount, COLORREF* mapColor, COLORREF* toColor); From 9e75a56b94e2ac64ce31ca8720a072c462e5cb18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:25:47 +0200 Subject: [PATCH 217/710] [translation] Fix src/common/handles.cpp comments (#590) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/common/handles.cpp | 57 +++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/src/common/handles.cpp b/src/common/handles.cpp index 9d0622479..efb010801 100644 --- a/src/common/handles.cpp +++ b/src/common/handles.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -7,7 +8,7 @@ #include #include #include -#include // potrebuju LPCOLORMAP +#include // Need LPCOLORMAP. #if defined(_DEBUG) && defined(_MSC_VER) // without passing file+line to 'new' operator, list of memory leaks shows only 'crtdbg.h(552)' #define new new (_NORMAL_BLOCK, __FILE__, __LINE__) @@ -25,15 +26,15 @@ // boundaries so we can find the real functions // that we need to call for initialization. -#pragma warning(disable : 4075) // chceme definovat poradi inicializace modulu +#pragma warning(disable : 4075) // We want to define the module initialization order. typedef void(__cdecl* _PVFV)(void); #pragma section(".i_hnd$a", read) -__declspec(allocate(".i_hnd$a")) const _PVFV i_handles = (_PVFV)1; // na zacatek sekce .i_hnd si dame promennou i_handles +__declspec(allocate(".i_hnd$a")) const _PVFV i_handles = (_PVFV)1; // Put the i_handles variable at the start of the .i_hnd section. #pragma section(".i_hnd$z", read) -__declspec(allocate(".i_hnd$z")) const _PVFV i_handles_end = (_PVFV)1; // a na konec sekce .i_hnd si dame promennou i_handles_end +__declspec(allocate(".i_hnd$z")) const _PVFV i_handles_end = (_PVFV)1; // Put the i_handles_end variable at the end of the .i_hnd section. void Initialize__Handles() { @@ -524,13 +525,13 @@ C__Handles::C__Handles() #ifdef MULTITHREADED_HANDLES_ENABLE ::InitializeCriticalSection(&CriticalSection); #else // MULTITHREADED_HANDLES_ENABLE - __HandlesMainThreadID = ::GetCurrentThreadId(); // jediny povoleny thread + __HandlesMainThreadID = ::GetCurrentThreadId(); // The only allowed thread. #endif // MULTITHREADED_HANDLES_ENABLE } C__Handles::~C__Handles() { - // vyrazeni handlu, ktere se uvolnuji automaticky + // Filter out handles that are released automatically. for (int i = Handles.Count - 1; i >= 0; i--) { if (Handles[i].Handle.Origin == __hoLoadAccelerators) @@ -540,15 +541,15 @@ C__Handles::~C__Handles() else if (Handles[i].Handle.Origin == __hoGetStockObject) Handles.Delete(i); } - // kontrola + vypis zbylych + // Check and list the remaining handles. if (Handles.Count != 0) { - // musel jsem nahradit nize polozeny kod vyuzivajici MESSAGE_E, protoze pri volani - // tohoto destruktoru jsou v ALTAPDB jiz zdestruovane facets streamu a pri poslani intu - // nebo handlu do streamu to proste spadne (dela jen VC2010 a VC2012, ve VC2008 - // to jeste slape); v Salamanderovi to nezlobi, asi kvuli RTL v DLLku (v ALTAPDB je - // static), ci co, po tom jsem uz dal nepatral, lepsi reseni by bylo zaridit - // destrukci facets az po tomto modulu, ale to bohuzel neumim (jen tez na "lib" urovni) + // I had to replace the code below that uses MESSAGE_E, because when this + // destructor is called the stream facets in ALTAPDB have already been destroyed, and sending an int + // or handle to the stream simply crashes (this happens only in VC2010 and VC2012; in VC2008 + // it still works). It does not happen in Salamander, probably because the RTL is in the DLL + // (ALTAPDB uses a static one); I did not investigate further. A better solution would be to destroy the + // facets only after this module, but unfortunately I cannot do that (only at the "lib" level). char msgBuf[1000]; sprintf_s(msgBuf, #ifdef MESSAGES_DEBUG @@ -576,7 +577,7 @@ C__Handles::~C__Handles() TRACE_I("List of opened handles:"); for (int i = 0; i < Handles.Count; i++) { - // saskarna pres msgBuf kvuli padackam v ALTAPDB, podrobnosti viz komentar vyse + // msgBuf workaround because of crashes in ALTAPDB; see the comment above for details. sprintf_s(msgBuf, "%p", Handles[i].Handle.Handle); TRACE_MI(Handles[i].File, Handles[i].Line, __GetHandlesTypeName(Handles[i].Handle.Type) << " - " << __GetHandlesOrigin(Handles[i].Handle.Origin) << " - " << msgBuf); @@ -585,7 +586,7 @@ C__Handles::~C__Handles() else { ConnectToTraceServer(); - // saskarna pres msgBuf kvuli padackam v ALTAPDB, podrobnosti viz komentar vyse + // msgBuf workaround because of crashes in ALTAPDB; see the comment above for details. sprintf_s(msgBuf, "%d", Handles.Count); TRACE_I(__HandlesMessageNumberOpened << msgBuf); } @@ -604,7 +605,7 @@ C__Handles::SetInfo(const char* file, int line, C__HandlesOutputType outputType) ::EnterCriticalSection(&CriticalSection); if (CriticalSection.RecursionCount > 1) { - DebugBreak(); // rekurzivni volani handles !!! zase nejaka maskovana message-loopa - viz call-stack + DebugBreak(); // Recursive handles call: another hidden message loop, see the call stack. } #endif // MULTITHREADED_HANDLES_ENABLE OutputType = outputType; @@ -706,7 +707,7 @@ BOOL C__Handles::DeleteHandle(C__HandlesType& type, HANDLE handle, { C__HandlesOrigin org = Handles[i].Handle.Origin; if (org != __hoLoadAccelerators && org != __hoLoadIcon && - org != __hoGetStockObject) // nejde o handle, ktery nemusi byt uvolneny (prioritne uvolnujeme handly, ktere se musi uvolnit) + org != __hoGetStockObject) // This is not a handle exempt from release (we prioritize handles that must be released). { if (origin != NULL) *origin = org; @@ -721,7 +722,7 @@ BOOL C__Handles::DeleteHandle(C__HandlesType& type, HANDLE handle, } } } - if (foundTypeOK != -1) // nalezen jen handle, ktery nemusi byt uvolneny + if (foundTypeOK != -1) // Found only a handle exempt from release. { type = Handles[foundTypeOK].Handle.Type; if (origin != NULL) @@ -729,7 +730,7 @@ BOOL C__Handles::DeleteHandle(C__HandlesType& type, HANDLE handle, Handles.Delete(foundTypeOK); return TRUE; } - if (found != -1) // nalezen jen handle se shodnym cislem + if (found != -1) // Found only a handle with the same numeric value. { #if defined(_DEBUG) || defined(__HANDLES_DEBUG) C__HandlesData* data = &(Handles[found]); @@ -944,13 +945,13 @@ C__Handles::CreateFileW(LPCWSTR lpFileName, DWORD dwDesiredAccess, HANDLE ret = ::CreateFileW(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile); - WCHAR paramsBuf[800 + 200]; // na jmena souboru omezime na 800 znaku, stejne delsi nevytiskneme diky omezeni MESSAGES + WCHAR paramsBuf[800 + 200]; // Limit file names to 800 characters; anything longer would not be printed anyway because of the MESSAGES limit. const WCHAR* params = NULL; if (ret == INVALID_HANDLE_VALUE) // parameters to buffer only when error occurs (can be displayed) { DWORD err = GetLastError(); _snwprintf_s(paramsBuf, _TRUNCATE, - L"dwDesiredAccess=0x%X,\ndwShareMode=0x%X,\ndwCreationDisposition=0x%X,\ndwFlagsAndAttributes=0x%X,\nlpFileName=%s", // lpFileName mame schvalne az na konci, muze byt az 32k dlouhe, orizne se + L"dwDesiredAccess=0x%X,\ndwShareMode=0x%X,\ndwCreationDisposition=0x%X,\ndwFlagsAndAttributes=0x%X,\nlpFileName=%s", // lpFileName is intentionally last; it can be up to 32K long and will be truncated. dwDesiredAccess, dwShareMode, dwCreationDisposition, dwFlagsAndAttributes, lpFileName); params = paramsBuf; SetLastError(err); @@ -1039,7 +1040,7 @@ HDC C__Handles::BeginPaint(HWND hwnd, LPPAINTSTRUCT lpPaint) ::LeaveCriticalSection(&CriticalSection); #endif // MULTITHREADED_HANDLES_ENABLE - HDC ret = ::BeginPaint(hwnd, lpPaint); // obsahuje message-loopu + HDC ret = ::BeginPaint(hwnd, lpPaint); // Contains a message loop. #ifdef MULTITHREADED_HANDLES_ENABLE ::EnterCriticalSection(&CriticalSection); @@ -2113,7 +2114,7 @@ BOOL C__Handles::FreeLibrary(HMODULE hLibModule) ::LeaveCriticalSection(&CriticalSection); #endif // MULTITHREADED_HANDLES_ENABLE - BOOL ret = ::FreeLibrary(hLibModule); // obsahuje volani destruktoru globalek DLLka, muze obsahovat message-loopu + BOOL ret = ::FreeLibrary(hLibModule); // Calls DLL global destructors; may contain a message loop. #ifdef MULTITHREADED_HANDLES_ENABLE ::EnterCriticalSection(&CriticalSection); @@ -2133,7 +2134,7 @@ VOID C__Handles::FreeLibraryAndExitThread(HMODULE hLibModule, DWORD dwExitCode) ::LeaveCriticalSection(&CriticalSection); #endif // MULTITHREADED_HANDLES_ENABLE - ::FreeLibraryAndExitThread(hLibModule, dwExitCode); // obsahuje volani destruktoru globalek DLLka, muze obsahovat message-loopu + ::FreeLibraryAndExitThread(hLibModule, dwExitCode); // Calls DLL global destructors; may contain a message loop. #ifdef MULTITHREADED_HANDLES_ENABLE ::EnterCriticalSection(&CriticalSection); @@ -2219,7 +2220,7 @@ BOOL C__Handles::FindCloseChangeNotification(HANDLE hChangeHandle) ::LeaveCriticalSection(&CriticalSection); #endif // MULTITHREADED_HANDLES_ENABLE - BOOL ret = ::FindCloseChangeNotification(hChangeHandle); // muze se kousnout i na dost dlouho + BOOL ret = ::FindCloseChangeNotification(hChangeHandle); // Can hang for quite a long time. #ifdef MULTITHREADED_HANDLES_ENABLE ::EnterCriticalSection(&CriticalSection); @@ -2346,7 +2347,7 @@ HFILE C__Handles::OpenFile(LPCSTR lpFileName, LPOFSTRUCT lpReOpenBuff, UINT uStyle) { HFILE ret = ::OpenFile(lpFileName, lpReOpenBuff, uStyle); - CheckCreate(ret != HFILE_ERROR, __htFile, __hoOpenFile, (HANDLE)(UINT_PTR)ret, GetLastError(), TRUE); // lpFileName je jen char i v Unicode verzi = nepouzitelna funkce (zastarala), vyradil jsem ji z vypisu parametru + CheckCreate(ret != HFILE_ERROR, __htFile, __hoOpenFile, (HANDLE)(UINT_PTR)ret, GetLastError(), TRUE); // lpFileName is only char even in the Unicode version, so this function is unusable (obsolete); I left it out of the parameter dump. return ret; } @@ -2378,7 +2379,7 @@ HDWP C__Handles::DeferWindowPos(HDWP hWinPosInfo, HWND hWnd, HWND hWndInsertAfte { HDWP ret = ::DeferWindowPos(hWinPosInfo, hWnd, hWndInsertAfter, x, y, cx, cy, uFlags); - if (ret != hWinPosInfo) // doslo k realokaci struktury - musime zmenit hodnotu hlidaneho handlu + if (ret != hWinPosInfo) // The structure was reallocated, so we must update the tracked handle value. { CheckClose(TRUE, (HANDLE)hWinPosInfo, __htDeferWindowPos, __GetHandlesOrigin(__hoDeferWindowPos), ERROR_SUCCESS, FALSE); CheckCreate(ret != NULL, __htDeferWindowPos, __hoDeferWindowPos, (HANDLE)ret, GetLastError()); @@ -2400,7 +2401,7 @@ BOOL C__Handles::EndDeferWindowPos(HDWP hWinPosInfo) ::LeaveCriticalSection(&CriticalSection); #endif // MULTITHREADED_HANDLES_ENABLE - BOOL ret = ::EndDeferWindowPos(hWinPosInfo); // obsahuje message-loopu + BOOL ret = ::EndDeferWindowPos(hWinPosInfo); // Contains a message loop. #ifdef MULTITHREADED_HANDLES_ENABLE ::EnterCriticalSection(&CriticalSection); From 207daee67e27927f38dd3301d2ae050bc7849e82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:25:54 +0200 Subject: [PATCH 218/710] [translation] Fix src/common/handles.h comments (#591) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/common/handles.h | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/common/handles.h b/src/common/handles.h index d241292a1..e54f8ab20 100644 --- a/src/common/handles.h +++ b/src/common/handles.h @@ -1,17 +1,18 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once -// makro HANDLES_ENABLE - zapina monitorovani handlu -// makro _DEBUG nebo __HANDLES_DEBUG - vypis debug hlasek do TRACE -// makro MULTITHREADED_HANDLES_ENABLE - pripravi handles pro multithreadove aplikace +// HANDLES_ENABLE macro - enables handle monitoring +// _DEBUG or __HANDLES_DEBUG macro - outputs debug messages to TRACE +// MULTITHREADED_HANDLES_ENABLE macro - prepares handles for multithreaded applications #define NOHANDLES(function) function #ifndef HANDLES_ENABLE -// aby nedochazelo k problemum se stredniky v nize nadefinovanych makrech +// to avoid problems with semicolons in the macros defined below inline void __HandlesEmptyFunction() {} #define HANDLES(function) ::function @@ -26,7 +27,7 @@ inline void __HandlesEmptyFunction() {} #ifndef MULTITHREADED_HANDLES_ENABLE -// pro kontrolu pouziti nemulti-threadove verze modulu +// for checking use of the non-multithreaded module version extern DWORD __HandlesMainThreadID; #endif // MULTITHREADED_HANDLES_ENABLE @@ -47,8 +48,8 @@ enum C__HandlesOutputType enum C__HandlesType { - __htHandle_comp_with_CloseHandle, // handle kompatibilni s CloseHandle() a DuplicateHandle() - __htHandle_comp_with_DeleteObject, // handle kompatibilni s DeleteObject() a GetStockObject() + __htHandle_comp_with_CloseHandle, // handle compatible with CloseHandle() and DuplicateHandle() + __htHandle_comp_with_DeleteObject, // handle compatible with DeleteObject() and GetStockObject() __htKey, __htIcon, __htGlobal, @@ -213,7 +214,7 @@ struct C__HandlesHandle { C__HandlesType Type; C__HandlesOrigin Origin; - HANDLE Handle; // univerzalni, pro vsechny druhy handlu + HANDLE Handle; // generic, for all handle types C__HandlesHandle() {} @@ -257,11 +258,11 @@ class C_HandlesDataArray class C__Handles { protected: - C_HandlesDataArray Handles; // vsechny kontrolovane handly - C__HandlesData TemporaryHandle; // pri vkladani nastaven z SetInfo() - C__HandlesOutputType OutputType; // typ vystupu hlasek + C_HandlesDataArray Handles; // all monitored handles + C__HandlesData TemporaryHandle; // set from SetInfo() during insertion + C__HandlesOutputType OutputType; // message output type #ifdef MULTITHREADED_HANDLES_ENABLE - CRITICAL_SECTION CriticalSection; // pro synchronizaci multi-threadu + CRITICAL_SECTION CriticalSection; // for multithreaded synchronization #endif // MULTITHREADED_HANDLES_ENABLE public: @@ -655,9 +656,9 @@ class C__Handles BOOL OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle); protected: - void AddHandle(C__HandlesHandle handle); // prida TemporaryHandle + void AddHandle(C__HandlesHandle handle); // adds TemporaryHandle - // vyjme handle, pri uspechu vraci TRUE + // removes the handle; returns TRUE on success BOOL DeleteHandle(C__HandlesType& type, HANDLE handle, C__HandlesOrigin* origin, C__HandlesType expType); From 50ed642207e065c8e73083f0db58475c7bd31ec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:26:00 +0200 Subject: [PATCH 219/710] [translation] Fix src/common/heap.cpp comments (#592) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/common/heap.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/common/heap.cpp b/src/common/heap.cpp index 6b16681a7..64e57f7e2 100644 --- a/src/common/heap.cpp +++ b/src/common/heap.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -28,15 +29,15 @@ // boundaries so we can find the real functions // that we need to call for initialization. -#pragma warning(disable : 4075) // chceme definovat poradi inicializace modulu +#pragma warning(disable : 4075) // Define the module initialization order typedef void(__cdecl* _PVFV)(void); #pragma section(".i_hea$a", read) -__declspec(allocate(".i_hea$a")) const _PVFV i_heap = (_PVFV)1; // na zacatek sekce .i_hea si dame promennou i_heap +__declspec(allocate(".i_hea$a")) const _PVFV i_heap = (_PVFV)1; // Place i_heap at the start of the .i_hea section #pragma section(".i_hea$z", read) -__declspec(allocate(".i_hea$z")) const _PVFV i_heap_end = (_PVFV)1; // a na konec sekce .i_hea si dame promennou i_heap_end +__declspec(allocate(".i_hea$z")) const _PVFV i_heap_end = (_PVFV)1; // Place i_heap_end at the end of the .i_hea section void Initialize__Heap() { @@ -69,8 +70,7 @@ int OurReportingFunction(int reportType, char* userMessage, int* retVal) // retVal to one. *retVal = 0; - // we'll report some information, but we also - // want _CrtDbgReport to get called - so we'll return FALSE + // Return FALSE after reporting some information so _CrtDbgReport still gets called return FALSE; } @@ -79,7 +79,7 @@ class C__GCHeapInit public: C__GCHeapInit() { - // uloz stav pameti na zacatku + // Save the initial memory state _CrtMemCheckpoint(&start_state); prev_reporting_hook = _CrtSetReportHook(OurReportingFunction); InitializeCriticalSection(&CriticalSection); @@ -87,32 +87,32 @@ class C__GCHeapInit } ~C__GCHeapInit() { - // zjisti aktualni stav pameti + // Capture the current memory state _CrtMemState end_state; _CrtMemCheckpoint(&end_state); - // zkontroluj, jestli jsou nejake leaky + // Check for memory leaks _CrtMemState diff; if (_CrtMemDifference(&diff, &start_state, &end_state)) { HMODULE hUsedModules[GCHEAP_MAX_USED_MODULES]; - // namapuju do pameti vsechny moduly, ve kterych se muzou hlasit memory leaky, - // tim se v reportu zobrazi jmena .cpp souboru (jinak by tam bylo jen "#File Error#") + // Map into memory all modules that may report memory leaks, + // so the report shows the .cpp file names (otherwise it would show only "#File Error#") for (int i = 0; i < UsedModulesCount; i++) hUsedModules[i] = LoadLibraryEx(UsedModules[i], NULL, DONT_RESOLVE_DLL_REFERENCES); - // vypise vsechny neuvolnene bloky + // Dump all unfreed blocks _CrtMemDumpAllObjectsSince(&start_state); - // kdyz uz mame diff, tak ho taky vypisem + // Dump the diff too, since we already have it _CrtMemDumpStatistics(&diff); - // zase uvolnime namapovane moduly + // Release the mapped modules again for (int i = 0; i < UsedModulesCount; i++) FreeLibrary(hUsedModules[i]); - // vyhod warning messagebox - MSG msg; // remove possibly buffered ESC key (not to close msgbox immediately) + // Show the warning message box + MSG msg; // Clear any buffered ESC key so the message box does not close immediately while (PeekMessage(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE)) ; MessageBoxA(NULL, "Detected memory leaks!", "Heap Message", From 7e2336e91274b70d6f1562d17f86c2cf2f04bae2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:26:07 +0200 Subject: [PATCH 220/710] [translation] Fix src/common/heap.h comments (#593) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/common/heap.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/common/heap.h b/src/common/heap.h index 407eb0dd4..3a49e1171 100644 --- a/src/common/heap.h +++ b/src/common/heap.h @@ -1,20 +1,16 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once -// Pridat do DEBUG verze projektu makro _CRTDBG_MAP_ALLOC, jinak se neukazuje zdroj leaku. +// Define _CRTDBG_MAP_ALLOC in the DEBUG build; otherwise the leak source is not shown. #if defined(_DEBUG) && !defined(HEAP_DISABLE) -#define GCHEAP_MAX_USED_MODULES 100 // kolik nejvic modulu se ma pamatovat pro load pred vypisem leaku +#define GCHEAP_MAX_USED_MODULES 100 // maximum number of modules to remember so they can be loaded before reporting memory leaks -// vola se pro moduly, ve kterych se muzou hlasit memory leaky, pokud se memory leaky detekuji, -// dojde k loadu "as image" (bez initu modulu) vsech takto registrovanych modulu (pri kontrole -// memory leaku uz jsou tyto moduly unloadle), a pak teprve k vypisu memory leaku = jsou videt -// jmena .cpp modulu misto "#File Error#" hlasek, zaroven MSVC neotravuje s hromadou generovanych -// exceptionu (jmena modulu jsou dostupna) -// mozne volat z libovolneho threadu +// Call this for modules that may report memory leaks. If leaks are detected, all modules registered this way are loaded "as image" (without module initialization; the modules are already unloaded when leaks are checked) before the leak report is printed. This shows .cpp module names instead of "#File Error#" messages, and MSVC does not flood the output with generated exceptions because the module names are available. Can be called from any thread. void AddModuleWithPossibleMemoryLeaks(const TCHAR* fileName); #endif // defined(_DEBUG) && !defined(HEAP_DISABLE) From 0bbe9f04ef0649a4eb18cff5d4c395b82b1dc3c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:26:13 +0200 Subject: [PATCH 221/710] [translation] Fix src/common/lstrfix.inc comments (#594) --- src/common/lstrfix.inc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/lstrfix.inc b/src/common/lstrfix.inc index 871e21da4..5c7521cbc 100644 --- a/src/common/lstrfix.inc +++ b/src/common/lstrfix.inc @@ -3,8 +3,8 @@ #include "lstrfix.h" -// potlaceni warningu C4996: This function or variable may be unsafe. Consider using strcat_s instead. -// duvod: lstrcat a dalsi Windows rutiny prost nejsou safe, takze to nema smysl resit tady +// Suppress warning C4996: This function or variable may be unsafe. Consider using strcat_s instead. +// Reason: lstrcat and other Windows routines simply are not safe, so it makes no sense to address it here. #pragma warning(push) #pragma warning(disable:4996) @@ -75,8 +75,8 @@ LPWSTR _sal_lstrcatW(LPWSTR lpString1, LPCWSTR lpString2) // allows us to define these names. #pragma function(strlen, wcslen, strcpy, wcscpy, strcat, wcscat) -// musel jsem si od MS pujcit implementace strlen, wcslen, strcpy, wcscpy, strcat a wcscat -// protoze se zde ignoruji default-liby, kde jsou tyto funkce umistene +// Borrowed the MS implementations of strlen, wcslen, strcpy, wcscpy, strcat, and wcscat +// because the default libraries that contain these functions are ignored here. size_t __cdecl strlen ( const char * str ) From f30b954860b4a96bbb58b640ca215952bd4b631f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:26:20 +0200 Subject: [PATCH 222/710] [translation] Fix src/common/lstrfix.h comments (#595) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/common/lstrfix.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/common/lstrfix.h b/src/common/lstrfix.h index 43b8096b8..011bbab82 100644 --- a/src/common/lstrfix.h +++ b/src/common/lstrfix.h @@ -1,13 +1,13 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once -// nasledujici funkce nepadaji pri praci s neplatnou pameti (ani pri praci s NULL): -// lstrcpy, lstrcpyn, lstrlen a lstrcat (ty jsou definovane s priponou A nebo W, proto -// je primo neredefinujeme), v zajmu snazsiho odladeni chyb potrebujeme, aby padaly, -// protoze jinak se na chybu prijde pozdeji v miste, kde uz nemusi byt jasne, co ji -// zpusobilo +// The following functions do not crash when passed invalid pointers (including NULL): +// lstrcpy, lstrcpyn, lstrlen, and lstrcat (these are defined with the A or W suffix, so +// we do not redefine them directly). For easier debugging, we need them to crash, +// because otherwise the bug is detected later, where its cause may no longer be clear #define lstrcpyA _sal_lstrcpyA #define lstrcpyW _sal_lstrcpyW #define lstrcpynA _sal_lstrcpynA From 9ad33458115f10cffb013ee0fc3f1d957f7d3863 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:26:26 +0200 Subject: [PATCH 223/710] [translation] Fix src/common/messages.cpp comments (#596) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/common/messages.cpp | 107 +++++++++++++++++----------------------- 1 file changed, 44 insertions(+), 63 deletions(-) diff --git a/src/common/messages.cpp b/src/common/messages.cpp index 98f2912bb..4283adfb5 100644 --- a/src/common/messages.cpp +++ b/src/common/messages.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -20,15 +21,15 @@ // boundaries so we can find the real functions // that we need to call for initialization. -#pragma warning(disable : 4075) // chceme definovat poradi inicializace modulu +#pragma warning(disable : 4075) // we want to define the module initialization order typedef void(__cdecl* _PVFV)(void); #pragma section(".i_msg$a", read) -__declspec(allocate(".i_msg$a")) const _PVFV i_messages = (_PVFV)1; // na zacatek sekce .i_msg si dame promennou i_messages +__declspec(allocate(".i_msg$a")) const _PVFV i_messages = (_PVFV)1; // put i_messages at the start of the .i_msg section #pragma section(".i_msg$z", read) -__declspec(allocate(".i_msg$z")) const _PVFV i_messages_end = (_PVFV)1; // a na konec sekce .i_msg si dame promennou i_messages_end +__declspec(allocate(".i_msg$z")) const _PVFV i_messages_end = (_PVFV)1; // put i_messages_end at the end of the .i_msg section void Initialize__Messages() { @@ -77,16 +78,16 @@ WCHAR __MessagesTitleBufW[200]; #ifdef MULTITHREADED_MESSAGES_ENABLE -// kriticka sekce pro cely modul - monitor +// module-wide critical section - monitor CRITICAL_SECTION __MessagesCriticalSection; -// handle aktualniho vlastniciho threadu +// ID of the current owning thread DWORD __MessagesOwnerThreadID = 0; -// pocet vnorenych volani EnterMessagesModul (v ramci aktualniho vlastniciho threadu) +// number of nested EnterMessagesModul calls within the current owning thread int __MessagesModulBlockCount = 0; #ifdef MESSAGES_DEBUG -// volani z threadu, ktery nema pristup k datum a funkcim modulu (nezalokoval) +// call from a thread that has no access to the module data and functions (did not allocate them) const char* __MessagesBadCall = "Incorrect call to function from modul MESSAGES."; #endif // MESSAGES_DEBUG @@ -139,20 +140,10 @@ void LeaveMessagesModul() C__Messages::C__Messages() : MessagesStrStream(&MessagesStringBuf) { #ifdef _DEBUG - // nove streamy pouzivaji interne locales, ktere maji implementovany - // jednotlive "facets" pomoci lazy creation - jsou alokovany na heapu - // kdyz jsou potreba, tedy kdyz nekdo posle do streamu neco, co ma - // formatovani zavisle na lokalich pravidlech, treba cislo, datum, - // nebo boolean. Tyto "facets" jsou pak dealokovany pri exitu - // programu s prioritou compiler, tzn. po nasi kontrole memory leaku. - // Takze pokud nekdo pouzije stream k vypisu cehokoli lokalizovatelneho, - // nas debug heap zacne hlasit memory leaky, i kdyz zadne nejsou. Abychom - // tomu predesli, donutime locales vytvorit vsechny "facets" ted, dokud - // jeste nehlidame heap. - // Zatim pouzivame pouze vystupni stream a pouze se stringy (bez konverze) - // a cisly. Takze poslat cislo do stringstreamu by melo stacit. Pokud - // v budoucnu zacneme pouzivat streamy vic a debug heap zacne hlasit - // leaky, budeme zde muset pridat vic vstupu/vystupu. + // New streams use internal locales whose individual "facets" are created lazily and allocated on the heap only when needed, for example when something with locale-dependent formatting such as a number, date, or boolean is sent to the stream. + // These "facets" are then deallocated at program exit with compiler priority, i.e. after our memory leak check. + // So if someone uses a stream to output anything locale-dependent, the debug heap starts reporting memory leaks even though there are none. To prevent that, force the locales to create all "facets" now, while we are not tracking the heap yet. + // For now we use only output streams, and only with strings (without conversion) and numbers. So sending a number to the stringstream should be enough. If we start using streams more in the future and the debug heap starts reporting leaks again, we will have to add more input/output here. std::stringstream s; s << 1; #endif // _DEBUG @@ -175,8 +166,8 @@ struct C__MessageBoxData }; int CALLBACK __MessagesMessageBoxThreadF(C__MessageBoxData* data) -{ // nesmi cekat na odezvu volajiciho threadu, protoze ten nebude reagovat - // proto je parent==NULL -> zadne disablovani oken atd. +{ // must not wait for the calling thread to respond, because it will not respond + // therefore parent == NULL -> no window disabling, etc. data->Return = MessageBoxA(NULL, data->Text, data->Caption, data->Type | MB_SETFOREGROUND); return 0; } @@ -188,14 +179,14 @@ int C__Messages::MessageBoxT(const char* lpCaption, UINT uType) data.Type = uType; data.Return = 0; - MessagesStrStream.flush(); // flushnuti do bufferu (v lpText) + MessagesStrStream.flush(); // flush into the buffer (lpText) #ifndef MULTITHREADED_MESSAGES_ENABLE data.Text = MessagesStringBuf.c_str(); - MessagesStringBuf.erase(); // priprava pro dalsi message + MessagesStringBuf.erase(); // prepare for the next message #else // MULTITHREADED_MESSAGES_ENABLE int len = (int)MessagesStringBuf.length() + 1; - HGLOBAL message = GlobalAlloc(GMEM_FIXED, len); // zaloha textu + HGLOBAL message = GlobalAlloc(GMEM_FIXED, len); // backup copy of the text if (message != NULL) { memcpy((char*)message, MessagesStringBuf.c_str(), len); // je to FIXED -> HANDLE==PTR @@ -203,16 +194,16 @@ int C__Messages::MessageBoxT(const char* lpCaption, UINT uType) } else data.Text = __MessagesLowMemory; - MessagesStringBuf.erase(); // priprava pro dalsi message - LeaveMessagesModul(); // ted uz muzou zacit blbnout ostatni thready + message loopy + MessagesStringBuf.erase(); // prepare for the next message + LeaveMessagesModul(); // other threads and message loops may resume now #endif // MULTITHREADED_MESSAGES_ENABLE - // MessageBox nahodime v novem threadu, aby nerozeslal message tohoto threadu + // run the MessageBox in a new thread so it does not dispatch this thread's messages DWORD threadID; HANDLE thread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)__MessagesMessageBoxThreadF, &data, 0, &threadID); if (thread != NULL) { - WaitForSingleObject(thread, INFINITE); // pockame az ho user odmackne + WaitForSingleObject(thread, INFINITE); // wait until the user dismisses it CloseHandle(thread); } else @@ -229,24 +220,24 @@ int C__Messages::MessageBoxT(const char* lpCaption, UINT uType) int C__Messages::MessageBox(HWND hWnd, const char* lpCaption, UINT uType) { int ret; - MessagesStrStream.flush(); // flushnuti do bufferu (v lpText) + MessagesStrStream.flush(); // flush into the buffer (lpText) #ifndef MULTITHREADED_MESSAGES_ENABLE if (!IsWindow(hWnd)) hWnd = NULL; ret = ::MessageBoxA(hWnd, MessagesStringBuf.c_str(), lpCaption, uType); - MessagesStringBuf.erase(); // priprava pro dalsi message + MessagesStringBuf.erase(); // prepare for the next message #else // MULTITHREADED_MESSAGES_ENABLE size_t len = MessagesStringBuf.length() + 1; - HGLOBAL message = GlobalAlloc(GMEM_FIXED, len); // zaloha textu + HGLOBAL message = GlobalAlloc(GMEM_FIXED, len); // backup copy of the text char* txt; txt = (char*)message; // je to FIXED -> HANDLE==PTR if (txt != NULL) memcpy(txt, MessagesStringBuf.c_str(), len); else txt = (char*)__MessagesLowMemory; - MessagesStringBuf.erase(); // priprava pro dalsi message - LeaveMessagesModul(); // ted uz muzou zacit blbnout ostatni thready + message loopy + MessagesStringBuf.erase(); // prepare for the next message + LeaveMessagesModul(); // other threads and message loops may resume now if (!IsWindow(hWnd)) hWnd = NULL; @@ -267,20 +258,10 @@ int C__Messages::MessageBox(HWND hWnd, const char* lpCaption, UINT uType) C__MessagesW::C__MessagesW() : MessagesStrStream(&MessagesStringBuf) { #ifdef _DEBUG - // nove streamy pouzivaji interne locales, ktere maji implementovany - // jednotlive "facets" pomoci lazy creation - jsou alokovany na heapu - // kdyz jsou potreba, tedy kdyz nekdo posle do streamu neco, co ma - // formatovani zavisle na lokalich pravidlech, treba cislo, datum, - // nebo boolean. Tyto "facets" jsou pak dealokovany pri exitu - // programu s prioritou compiler, tzn. po nasi kontrole memory leaku. - // Takze pokud nekdo pouzije stream k vypisu cehokoli lokalizovatelneho, - // nas debug heap zacne hlasit memory leaky, i kdyz zadne nejsou. Abychom - // tomu predesli, donutime locales vytvorit vsechny "facets" ted, dokud - // jeste nehlidame heap. - // Zatim pouzivame pouze vystupni stream a pouze se stringy (bez konverze) - // a cisly. Takze poslat cislo do stringstreamu by melo stacit. Pokud - // v budoucnu zacneme pouzivat streamy vic a debug heap zacne hlasit - // leaky, budeme zde muset pridat vic vstupu/vystupu. + // New streams use internal locales whose individual "facets" are created lazily and allocated on the heap only when needed, for example when something with locale-dependent formatting such as a number, date, or boolean is sent to the stream. + // These "facets" are then deallocated at program exit with compiler priority, i.e. after our memory leak check. + // So if someone uses a stream to output anything locale-dependent, the debug heap starts reporting memory leaks even though there are none. To prevent that, force the locales to create all "facets" now, while we are not tracking the heap yet. + // For now we use only output streams, and only with strings (without conversion) and numbers. So sending a number to the stringstream should be enough. If we start using streams more in the future and the debug heap starts reporting leaks again, we will have to add more input/output here. std::wstringstream s; s << 1; #endif // _DEBUG @@ -295,8 +276,8 @@ struct C__MessageBoxDataW }; int CALLBACK __MessagesWMessageBoxThreadF(C__MessageBoxDataW* data) -{ // nesmi cekat na odezvu volajiciho threadu, protoze ten nebude reagovat - // proto je parent==NULL -> zadne disablovani oken atd. +{ // must not wait for the calling thread to respond, because it will not respond + // therefore parent == NULL -> no window disabling, etc. data->Return = MessageBoxW(NULL, data->Text, data->Caption, data->Type | MB_SETFOREGROUND); return 0; } @@ -308,14 +289,14 @@ int C__MessagesW::MessageBoxT(const WCHAR* lpCaption, UINT uType) data.Type = uType; data.Return = 0; - MessagesStrStream.flush(); // flushnuti do bufferu (v lpText) + MessagesStrStream.flush(); // flush into the buffer (lpText) #ifndef MULTITHREADED_MESSAGES_ENABLE data.Text = MessagesStringBuf.c_str(); - MessagesStringBuf.erase(); // priprava pro dalsi message + MessagesStringBuf.erase(); // prepare for the next message #else // MULTITHREADED_MESSAGES_ENABLE int len = (int)MessagesStringBuf.length() + 1; - HGLOBAL message = GlobalAlloc(GMEM_FIXED, sizeof(WCHAR) * len); // zaloha textu + HGLOBAL message = GlobalAlloc(GMEM_FIXED, sizeof(WCHAR) * len); // backup copy of the text if (message != NULL) { memcpy((WCHAR*)message, MessagesStringBuf.c_str(), sizeof(WCHAR) * len); // je to FIXED -> HANDLE==PTR @@ -323,16 +304,16 @@ int C__MessagesW::MessageBoxT(const WCHAR* lpCaption, UINT uType) } else data.Text = __MessagesLowMemoryW; - MessagesStringBuf.erase(); // priprava pro dalsi message - LeaveMessagesModul(); // ted uz muzou zacit blbnout ostatni thready + message loopy + MessagesStringBuf.erase(); // prepare for the next message + LeaveMessagesModul(); // other threads and message loops may resume now #endif // MULTITHREADED_MESSAGES_ENABLE - // MessageBox nahodime v novem threadu, aby nerozeslal message tohoto threadu + // run the MessageBox in a new thread so it does not dispatch this thread's messages DWORD threadID; HANDLE thread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)__MessagesWMessageBoxThreadF, &data, 0, &threadID); if (thread != NULL) { - WaitForSingleObject(thread, INFINITE); // pockame az ho user odmackne + WaitForSingleObject(thread, INFINITE); // wait until the user dismisses it CloseHandle(thread); } else @@ -349,24 +330,24 @@ int C__MessagesW::MessageBoxT(const WCHAR* lpCaption, UINT uType) int C__MessagesW::MessageBox(HWND hWnd, const WCHAR* lpCaption, UINT uType) { int ret; - MessagesStrStream.flush(); // flushnuti do bufferu (v lpText) + MessagesStrStream.flush(); // flush into the buffer (lpText) #ifndef MULTITHREADED_MESSAGES_ENABLE if (!IsWindow(hWnd)) hWnd = NULL; ret = ::MessageBoxW(hWnd, MessagesStringBuf.c_str(), lpCaption, uType); - MessagesStringBuf.erase(); // priprava pro dalsi message + MessagesStringBuf.erase(); // prepare for the next message #else // MULTITHREADED_MESSAGES_ENABLE size_t len = MessagesStringBuf.length() + 1; - HGLOBAL message = GlobalAlloc(GMEM_FIXED, sizeof(WCHAR) * len); // zaloha textu + HGLOBAL message = GlobalAlloc(GMEM_FIXED, sizeof(WCHAR) * len); // backup copy of the text WCHAR* txt; txt = (WCHAR*)message; // je to FIXED -> HANDLE==PTR if (txt != NULL) memcpy(txt, MessagesStringBuf.c_str(), sizeof(WCHAR) * len); else txt = (WCHAR*)__MessagesLowMemoryW; - MessagesStringBuf.erase(); // priprava pro dalsi message - LeaveMessagesModul(); // ted uz muzou zacit blbnout ostatni thready + message loopy + MessagesStringBuf.erase(); // prepare for the next message + LeaveMessagesModul(); // other threads and message loops may resume now if (!IsWindow(hWnd)) hWnd = NULL; From ed6630fa1705a7e0d75c094707410a1e25131396 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:26:32 +0200 Subject: [PATCH 224/710] [translation] Fix src/common/messages.h comments (#597) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/common/messages.h | 107 ++++++++++++++++++++++++------------------ 1 file changed, 62 insertions(+), 45 deletions(-) diff --git a/src/common/messages.h b/src/common/messages.h index 3a6156250..b49b0e878 100644 --- a/src/common/messages.h +++ b/src/common/messages.h @@ -1,11 +1,12 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once -// makro MESSAGES_DISABLE - odpojeni modulu z kompilace -// makro MESSAGES_DEBUG - vypis souboru + cisla radku pred message + povoleni zprav ukazovanych pres DMESSAGE_??? -// makro MULTITHREADED_MESSAGES_ENABLE - pripravi messages pro multithreadove aplikace +// Macro MESSAGES_DISABLE - excludes the module from compilation +// Macro MESSAGES_DEBUG - prints the file and line number before the message and enables messages shown via DMESSAGE_??? +// Macro MULTITHREADED_MESSAGES_ENABLE - prepares messages for multithreaded applications #ifndef MESSAGES_DISABLE @@ -15,47 +16,47 @@ #ifdef MULTITHREADED_MESSAGES_ENABLE -// zajisti aktualnimu threadu pristup k funkcim a datum modulu +// Ensures the current thread has access to the module's functions and data void EnterMessagesModul(); -// volat az aktualni thread nebude potrebovat pristup k funkcim a datum modulu +// Call when the current thread no longer needs access to the module's functions and data void LeaveMessagesModul(); #endif // MULTITHREADED_MESSAGES_ENABLE -/// vraci ukazatel na globalni buffer, ktery naplni retezcem z resourcu +//Returns a pointer to a global buffer filled with the resource string const char* rsc(int resID); const WCHAR* rscW(int resID); -/// vraci ukazatel na globalni buffer, ktery naplni retezcem z sprintf +//Returns a pointer to a global buffer filled with the sprintf output const char* spf(const char* formatString, ...); const WCHAR* spfW(const WCHAR* formatString, ...); -/// vraci ukazatel na globalni buffer, ktery naplni retezcem z sprintf +//Returns a pointer to a global buffer filled with the sprintf output const char* spf(int formatStringResID, ...); const WCHAR* spfW(int formatStringResID, ...); -/// vraci ukazatel na globalni buffer, ktery naplni popisem chyby +//Returns a pointer to a global buffer filled with the error description const char* err(DWORD error); const WCHAR* errW(DWORD error); extern const char* __MessagesTitle; extern const WCHAR* __MessagesTitleW; extern HWND __MessagesParent; -extern HINSTANCE HInstance; // predpokladana promenna s handlem instance +extern HINSTANCE HInstance; // Expected variable holding the instance handle -/// Nastaveni titulu messageboxu generovanych makry MESSAGExx. Dela se kopie stringu. -/// Nastavuje vzdy titulek pro obe verze (ANSI + unicode). +//Sets the title of message boxes generated by the MESSAGExx macros. The string is copied. +//Always sets the title for both versions (ANSI + Unicode) void SetMessagesTitle(const char* title); void SetMessagesTitleW(const WCHAR* title); -/// Nastaveni parenta messageboxu generovanych makry MESSAGExx +//Sets the parent window of message boxes generated by the MESSAGExx macros void SetMessagesParent(HWND parent); class C__Messages { protected: - C__StringStreamBuf MessagesStringBuf; // string buffer drzici data messages streamu - C__TraceStream MessagesStrStream; // vlastni messages stream + C__StringStreamBuf MessagesStringBuf; // String buffer holding the messages stream data + C__TraceStream MessagesStrStream; // The messages stream itself public: C__Messages(); @@ -79,8 +80,8 @@ class C__Messages class C__MessagesW { protected: - C__StringStreamBufW MessagesStringBuf; // string buffer drzici data messages streamu - C__TraceStreamW MessagesStrStream; // vlastni messages stream + C__StringStreamBufW MessagesStringBuf; // String buffer holding the messages stream data + C__TraceStreamW MessagesStrStream; // The messages stream itself public: C__MessagesW(); @@ -98,18 +99,20 @@ class C__MessagesW extern C__Messages __Messages; extern C__MessagesW __MessagesW; -/**@name Makra generujici messageboxy. - * je-li nadefinovano makro MESSAGES_DEBUG, zobrazuje se v messageboxich - * na prvnim radku soubor a radek, na kterem je v kodu MESSAGExx\\ - * +/* + * @name Macros that generate message boxes. + * If MESSAGES_DEBUG is defined, the first line of each message box shows + * the file and line where MESSAGExx\ appears in the code */ #ifdef MESSAGES_DEBUG #ifndef MULTITHREADED_MESSAGES_ENABLE -/** zobrazi messagebox se zadanym textem, neni v novem threadu, distribuje message - volajiciho threadu */ +/* + * Displays a message box with the specified text in the current thread; + * dispatches the calling thread's messages + */ #define MESSAGE(parent, str, buttons) \ (__Messages.OStream() << __FILE__ << " " << __LINE__ << ":\n\n", __Messages.OStream() << str, \ __Messages) \ @@ -120,8 +123,10 @@ extern C__MessagesW __MessagesW; __MessagesW) \ .MessageBox(((parent) == NULL) ? __MessagesParent : (parent), __MessagesTitleW, (buttons)) -/** zobrazi messagebox se zadanym textem, v novem threadu, nerozdistribuje message - volajiciho threadu */ +/* + * Displays a message box with the specified text in a new thread; does not + * dispatch the calling thread's messages + */ #define MESSAGE_T(str, buttons) \ (__Messages.OStream() << __FILE__ << " " << __LINE__ << ":\n\n", __Messages.OStream() << str, \ __Messages) \ @@ -200,48 +205,60 @@ extern C__MessagesW __MessagesW; #endif // MESSAGES_DEBUG -/** zobrazi messagebox se zadanym textem a ikonou informaci, neni v novem - threadu, distribuje message volajiciho threadu */ +/* + * Displays a message box with the specified text and an information icon in + * the current thread; dispatches the calling thread's messages + */ #define MESSAGE_I(parent, str, buttons) \ MESSAGE(parent, str, MB_ICONINFORMATION | (buttons)) #define MESSAGE_IW(parent, str, buttons) \ MESSAGEW(parent, str, MB_ICONINFORMATION | (buttons)) -/** zobrazi messagebox se zadanym textem a ikonou otazky, neni v novem - threadu, distribuje message volajiciho threadu */ +/* + * Displays a message box with the specified text and a question icon in + * the current thread; dispatches the calling thread's messages + */ #define MESSAGE_Q(parent, str, buttons) \ MESSAGE(parent, str, MB_ICONQUESTION | (buttons)) #define MESSAGE_QW(parent, str, buttons) \ MESSAGEW(parent, str, MB_ICONQUESTION | (buttons)) -/** zobrazi messagebox se zadanym textem a ikonou chyby, neni v novem - threadu, distribuje message volajiciho threadu */ +/* + * Displays a message box with the specified text and an error icon in + * the current thread; dispatches the calling thread's messages + */ #define MESSAGE_E(parent, str, buttons) \ MESSAGE(parent, str, MB_ICONEXCLAMATION | (buttons)) #define MESSAGE_EW(parent, str, buttons) \ MESSAGEW(parent, str, MB_ICONEXCLAMATION | (buttons)) -/** zobrazi messagebox se zadanym textem a ikonou informaci, v novem threadu, - nerozdistribuje message volajiciho threadu */ +/* + * Displays a message box with the specified text and an information icon in a new + * thread; does not dispatch the calling thread's messages + */ #define MESSAGE_TI(str, buttons) \ MESSAGE_T(str, MB_ICONINFORMATION | (buttons)) #define MESSAGE_TIW(str, buttons) \ MESSAGE_TW(str, MB_ICONINFORMATION | (buttons)) -/** zobrazi messagebox se zadanym textem a ikonou otazky, v novem threadu, - nerozdistribuje message volajiciho threadu */ +/* + * Displays a message box with the specified text and a question icon in a new + * thread; does not dispatch the calling thread's messages + */ #define MESSAGE_TQ(str, buttons) \ MESSAGE_T(str, MB_ICONQUESTION | (buttons)) #define MESSAGE_TQW(str, buttons) \ MESSAGE_TW(str, MB_ICONQUESTION | (buttons)) -/** zobrazi messagebox se zadanym textem a ikonou chyby, v novem threadu, - nerozdistribuje message volajiciho threadu */ +/* + * Displays a message box with the specified text and an error icon in a new + * thread; does not dispatch the calling thread's messages + */ #define MESSAGE_TE(str, buttons) \ MESSAGE_T(str, MB_ICONEXCLAMATION | (buttons)) @@ -250,33 +267,33 @@ extern C__MessagesW __MessagesW; #ifdef MESSAGES_DEBUG -/// MESSAGE_I zavisla na existenci makra MESSAGES_DEBUG +//MESSAGE_I depends on MESSAGES_DEBUG being defined #define DMESSAGE_I(parent, str, buttons) MESSAGE_I(parent, str, (buttons)) #define DMESSAGE_IW(parent, str, buttons) MESSAGE_IW(parent, str, (buttons)) -/// MESSAGE_Q zavisla na existenci makra MESSAGES_DEBUG +//MESSAGE_Q depends on MESSAGES_DEBUG being defined #define DMESSAGE_Q(parent, str, buttons) MESSAGE_Q(parent, str, (buttons)) #define DMESSAGE_QW(parent, str, buttons) MESSAGE_QW(parent, str, (buttons)) -/// MESSAGE_E zavisla na existenci makra MESSAGES_DEBUG +//MESSAGE_E depends on MESSAGES_DEBUG being defined #define DMESSAGE_E(parent, str, buttons) MESSAGE_E(parent, str, (buttons)) #define DMESSAGE_EW(parent, str, buttons) MESSAGE_EW(parent, str, (buttons)) -/// MESSAGE_TI zavisla na existenci makra MESSAGES_DEBUG +//MESSAGE_TI depends on MESSAGES_DEBUG being defined #define DMESSAGE_TI(str, buttons) MESSAGE_TI(str, (buttons)) #define DMESSAGE_TIW(str, buttons) MESSAGE_TIW(str, (buttons)) -/// MESSAGE_TQ zavisla na existenci makra MESSAGES_DEBUG +//MESSAGE_TQ depends on MESSAGES_DEBUG being defined #define DMESSAGE_TQ(str, buttons) MESSAGE_TQ(str, (buttons)) #define DMESSAGE_TQW(str, buttons) MESSAGE_TQW(str, (buttons)) -/// MESSAGE_E zavisla na existenci makra MESSAGES_DEBUG +//MESSAGE_E depends on MESSAGES_DEBUG being defined #define DMESSAGE_TE(str, buttons) MESSAGE_TE(str, (buttons)) #define DMESSAGE_TEW(str, buttons) MESSAGE_TEW(str, (buttons)) #else // MESSAGES_DEBUG -// aby nedochazelo k problemum se stredniky v nize nadefinovanych makrech +// To avoid semicolon problems in the macros defined below inline int __MessagesEmptyFunction() { return 0; } #define DMESSAGE_I(parent, str, buttons) __MessagesEmptyFunction() @@ -296,7 +313,7 @@ inline int __MessagesEmptyFunction() { return 0; } #else // MESSAGES_DISABLE -// aby nedochazelo k problemum se stredniky v nize nadefinovanych makrech +// To avoid semicolon problems in the macros defined below inline int __MessagesEmptyFunction() { return 0; } #define EnterMessagesModul() __MessagesEmptyFunction() From ba73a62044cd6d8f9dfeb39f82ab6c2853728c0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:26:38 +0200 Subject: [PATCH 225/710] [translation] Fix src/common/moore.cpp comments (#598) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/common/moore.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/common/moore.cpp b/src/common/moore.cpp index e91023415..32421966f 100644 --- a/src/common/moore.cpp +++ b/src/common/moore.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -7,7 +8,7 @@ #include #include #include -#include // potrebuju LPCOLORMAP +#include // need LPCOLORMAP #if defined(_DEBUG) && defined(_MSC_VER) // without passing file+line to 'new' operator, list of memory leaks shows only 'crtdbg.h(552)' #define new new (_NORMAL_BLOCK, __FILE__, __LINE__) @@ -74,7 +75,7 @@ BOOL CSearchData::Initialize() Fail1[Pattern[i - 1]] = Length - i; Fail2[i - 1] = 2 * Length - i; } - Fail2[Length] = Length - 1; // doplneno, algoritmus na tuto hodnotu saha, dale neni treba + Fail2[Length] = Length - 1; // filled in; the algorithm uses this value, nothing else is needed i = Length; int t = Length + 1; @@ -162,7 +163,7 @@ void CSearchData::Set(const char* pattern, WORD flags) if (OriginalPattern != NULL) { memcpy(OriginalPattern, pattern, Length); - OriginalPattern[Length] = 0; // pro kompatibilitu s beznym stringem + OriginalPattern[Length] = 0; // for compatibility with regular strings } if (Pattern != NULL) { @@ -189,7 +190,7 @@ void CSearchData::Set(const char* pattern, const int length, WORD flags) if (OriginalPattern != NULL) { memcpy(OriginalPattern, pattern, Length); - OriginalPattern[Length] = 0; // pro kompatibilitu s beznym stringem + OriginalPattern[Length] = 0; // for compatibility with regular strings } if (Pattern != NULL) { From 4da1d058b93f55e630e021c7d03bf96a83abf495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:26:44 +0200 Subject: [PATCH 226/710] [translation] Fix src/common/moore.h comments (#599) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/common/moore.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/common/moore.h b/src/common/moore.h index b39a2b806..73011a655 100644 --- a/src/common/moore.h +++ b/src/common/moore.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED // **************************************************************************** // Boyer-Mooruv algoritmus hledani podretezce @@ -49,8 +50,8 @@ class CSearchData Fail1 != NULL && Fail2 != NULL; } void SetFlags(WORD flags); void Set(const char* pattern, WORD flags); - // pro patterny obsahujici '\0' - // buffer pattern musi mit delku (length + 1) znaku (kompatibilita se stringy) + // for patterns containing '\0' + // the pattern buffer must be (length + 1) characters long (for string compatibility) void Set(const char* pattern, const int length, WORD flags); inline int SearchForward(const char* text, int length, int start); @@ -60,16 +61,16 @@ class CSearchData int Minimum(int a, int b) { return (a < b) ? a : b; } int Maximum(int a, int b) { return (a > b) ? a : b; } - int* Fail1; // fail pole pro akt. pismeno - int* Fail2; // fail pole pro vyskyt substringu zprava - char* OriginalPattern; // puvodni vzorek ke hledani - char* Pattern; // vzorek ke hledani v prislusnem tvaru (Flag) - int Length; // delka vzorku + int* Fail1; // fail array for the current character + int* Fail2; // fail array for substring occurrence from the right + char* OriginalPattern; // original search pattern + char* Pattern; // search pattern in the corresponding flag-dependent form + int Length; // pattern length private: - BOOL Initialize(); // vola se jen ze SetFlags + BOOL Initialize(); // called only from SetFlags - WORD Flags; // menit pres SetFlags + WORD Flags; // modify via SetFlags }; // From fdd6bb39dd52ed675523cef122d9f4140e1c4fe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:26:50 +0200 Subject: [PATCH 227/710] [translation] Fix src/common/regexp.cpp comments (#600) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/common/regexp.cpp | 59 ++++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/src/common/regexp.cpp b/src/common/regexp.cpp index cdb28cee1..b08030c9d 100644 --- a/src/common/regexp.cpp +++ b/src/common/regexp.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED /* * regcomp and regexec -- regsub and regerror are elsewhere @@ -65,7 +66,7 @@ class C__RegExpSection C__RegExpSection __RegExpSection; -/* - moznost definice svych vlastnich hlasek, jinak staci nakopirovat do kodu +/* - custom error messages can be defined here; otherwise, just copy this into the code const char *RegExpErrorText(CRegExpErrors err) { @@ -159,7 +160,7 @@ BOOL CRegularExpression::SetFlags(WORD flags) Expression = regcomp(pattern, LastErrorText); if (Expression != NULL && (Flags & sfForward) == 0) - { // vyraz je syntakticky o.k. + backward search + { // Expression is syntactically correct; backward search. if (Expression != NULL) free(Expression); Expression = NULL; @@ -263,16 +264,16 @@ BOOL CRegularExpression::ExpandVariables(char* pattern, char* buffer, int bufSiz { char* sour = pattern; char* dest = buffer; - bufSize--; //rezervujeme si misto pro NULL + bufSize--; // Reserve space for the NULL terminator. while (*sour) { if (!bufSize) - return FALSE; //dosel nam buffer + return FALSE; // Out of buffer space. if (*sour == '\\') { sour++; if (!*sour) - break; // tady bych asi mnel hodit chybu takovato sekvence neni definovana + break; // An error should probably be reported here; this sequence is undefined. if (*sour >= '1' && *sour <= '9') { int n = *sour - '0'; @@ -308,9 +309,9 @@ int CRegularExpression::ReplaceForward(int start, char* pattern, BOOL global, char* output = buffer; int len; while (start <= LineLength && regexec(Expression, Line, start) == 1 && - Expression->endp[0] - Expression->startp[0] > 0 /*zero sized match neberem*/) + Expression->endp[0] - Expression->startp[0] > 0 /* Ignore zero-length matches. */) { - //zkopirujeme nezmeny text, ktery predchazi match + //Copy the unchanged text before the match. len = (int)((Expression->startp[0] - Line) - start); if (len + 1 > bufSize) { @@ -319,7 +320,7 @@ int CRegularExpression::ReplaceForward(int start, char* pattern, BOOL global, memcpy(output, OrigLineStart + start, len); output += len; bufSize -= len; - //nahradime co jsme nasli + //Replace the matched text. if (!ExpandVariables(pattern, output, bufSize, &len)) { return FALSE; @@ -334,7 +335,7 @@ int CRegularExpression::ReplaceForward(int start, char* pattern, BOOL global, if (ret && start < LineLength) { - //dokopirujeme text nasledujici match + //Copy the text after the match. if (LineLength - start + 1 > bufSize) { return FALSE; @@ -350,9 +351,9 @@ void CRegularExpression::ReverseRegExp(char*& dstExpEnd, char* srcExp, char* src while (s < srcExpEnd) { - //--- hledani konce atomu - pro zopakovani '*', '+' a '?' - char* ss; // ukazuje za atom - BOOL addPar; // paruji zavorky? (ma se pridat zavorka do paru) + //--- find the end of the atom for '*', '+' and '?' repetition + char* ss; // Points past the atom. + BOOL addPar; // Should a matching parenthesis be added? switch (*s) { case '\\': @@ -362,8 +363,8 @@ void CRegularExpression::ReverseRegExp(char*& dstExpEnd, char* srcExp, char* src case '(': case '[': { - int parNum = (*s == '(') ? 1 : 0; // pocty zavorek - int braNum = (*s == '[') ? 1 : 0; // pocty zavorek + int parNum = (*s == '(') ? 1 : 0; // Parenthesis count. + int braNum = (*s == '[') ? 1 : 0; // Bracket count. char* lastBra = (*s == '[') ? s : NULL; ss = s + 1; while (*ss != 0 && (parNum != 0 || braNum != 0)) @@ -373,10 +374,10 @@ void CRegularExpression::ReverseRegExp(char*& dstExpEnd, char* srcExp, char* src case '(': if (braNum == 0) parNum++; - break; // [..(..] je povoleno + break; // [..(..] is allowed. case '[': { - if (braNum == 0) // [..[..] je povoleno + if (braNum == 0) // [..[..] is allowed. { braNum++; lastBra = ss - 1; @@ -387,13 +388,13 @@ void CRegularExpression::ReverseRegExp(char*& dstExpEnd, char* srcExp, char* src case ')': if (braNum == 0 && parNum > 0) parNum--; - break; // [..)..] je povoleno + break; // [..)..] is allowed. case ']': { - if (braNum != 0) // ..].. je povoleno + if (braNum != 0) // ..].. is allowed. { - if (ss - 2 != lastBra && // []..] je povoleno - (ss - 3 != lastBra || *(ss - 2) != '^')) // [^]..] je take povoleno + if (ss - 2 != lastBra && // []..] is allowed. + (ss - 3 != lastBra || *(ss - 2) != '^')) // [^]..] is also allowed. { braNum--; } @@ -405,7 +406,7 @@ void CRegularExpression::ReverseRegExp(char*& dstExpEnd, char* srcExp, char* src { if (*ss != 0) ss++; - break; // znak za '\\' nemuze byt brany jako zavorka + break; // The character after '\\' cannot be treated as a bracket. } } } @@ -422,12 +423,12 @@ void CRegularExpression::ReverseRegExp(char*& dstExpEnd, char* srcExp, char* src break; } - //--- nakopirovani vsech '*', '+' a '?' obsazenych za atomem + //--- copy all '*', '+' and '?' following the atom char* oldSS = ss; while (*ss == '*' || *ss == '?' || *ss == '+') *--dstExpEnd = *ss++; - //--- nakopirovani obraceneho atomu + //--- copy the reversed atom switch (*s) { case '\\': @@ -449,10 +450,10 @@ void CRegularExpression::ReverseRegExp(char*& dstExpEnd, char* srcExp, char* src if (oldSS - s >= 2) // pokud vyraz nekonci otevrenou zavorkou { if (*s == '(') - { // kopie reversovaneho vyrazu - ohraniceni + { // Copy the reversed expression - parenthesized group. ReverseRegExp(dstExpEnd, s + 1, oldSS - 1); } - else // prosta kopie vnitrku - mnozina + else // Simple copy of the contents - character set. { dstExpEnd -= (oldSS - 1) - (s + 1); memcpy(dstExpEnd, s + 1, (oldSS - 1) - (s + 1)); @@ -476,7 +477,7 @@ void CRegularExpression::ReverseRegExp(char*& dstExpEnd, char* srcExp, char* src break; } - //--- prechod na dalsi atom + //--- move to the next atom s = ss; } } @@ -745,7 +746,7 @@ regexp* regcomp(char* exp, const char*& lastErrorText) } } - lastErrorText = NULL; // uspesny navrat + lastErrorText = NULL; // Successful return. __RegExpSection.Leave(); return (r); } @@ -1448,7 +1449,7 @@ int regmatch(char* prog) /* 0 failure, 1 success */ no = regrepeat(OPERAND(scan)); while (no >= min) { - /* If it could work, try it. */ + /* Try it if it might match. */ if (nextch == '\0' || *reginput == nextch) if (regmatch(next)) return (1); @@ -1460,7 +1461,7 @@ int regmatch(char* prog) /* 0 failure, 1 success */ } case END: - return (1); /* Success! */ + return (1); /* Match succeeded. */ default: return (0); /* memory corruption */ } From d6a374c4404caf97a83b59daa48cfc665338b638 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:26:57 +0200 Subject: [PATCH 228/710] [translation] Fix src/common/ms_init.cpp comments (#601) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/common/ms_init.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/common/ms_init.cpp b/src/common/ms_init.cpp index 70909dddf..21670acb7 100644 --- a/src/common/ms_init.cpp +++ b/src/common/ms_init.cpp @@ -1,12 +1,13 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" #include -// modul MS_INIT zajistuje volani konstruktoru statickych objektu ve spravnem poradi -// a na urovni "lib" (pred "user") +// MS_INIT ensures that constructors of static objects are called in the correct order +// and at the "lib" level (before "user") #pragma warning(3 : 4706) // warning C4706: assignment within conditional expression From ea9f35da0b5344ad65fa92f10de4086fc01ff09d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:27:03 +0200 Subject: [PATCH 229/710] [translation] Fix src/common/multimon.cpp comments (#602) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/common/multimon.cpp | 47 +++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/src/common/multimon.cpp b/src/common/multimon.cpp index 10b5e8d23..9e854a8f4 100644 --- a/src/common/multimon.cpp +++ b/src/common/multimon.cpp @@ -1,11 +1,12 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" #include #include -#include // potrebuju LPCOLORMAP +#include // Need LPCOLORMAP. #include #include #include @@ -24,7 +25,7 @@ HWND GetTopVisibleParent(HWND hParent) { - // hledame parenta, ktery uz neni child window (jde o POPUP/OVERLAPPED window) + // Find the first parent that is not a child window (a POPUP/OVERLAPPED window). HWND hIterator = hParent; while ((GetWindowLongPtr(hIterator, GWL_STYLE) & WS_CHILD) && (hIterator = ::GetParent(hIterator)) != NULL && @@ -46,14 +47,14 @@ void MultiMonGetClipRectByRect(const RECT* rect, RECT* workClipRect, RECT* monit void MultiMonGetClipRectByWindow(HWND hByWnd, RECT* workClipRect, RECT* monitorClipRect) { - HMONITOR hMonitor; // na tento monitor okno umistime + HMONITOR hMonitor; // Place the window on this monitor. MONITORINFO mi; mi.cbSize = sizeof(mi); - if (hByWnd != NULL && IsWindowVisible(hByWnd) && !IsIconic(hByWnd)) // pozor, tato podminka je take v MultiMonCenterWindow + if (hByWnd != NULL && IsWindowVisible(hByWnd) && !IsIconic(hByWnd)) // Note: the same condition is also used in MultiMonCenterWindow. { hMonitor = MonitorFromWindow(hByWnd, MONITOR_DEFAULTTONEAREST); - // vytahneme working area desktopu + // Get the desktop work area. GetMonitorInfo(hMonitor, &mi); } else @@ -69,14 +70,14 @@ void MultiMonGetClipRectByWindow(HWND hByWnd, RECT* workClipRect, RECT* monitorC } else { - // jinak okno centrujeme k primarnimu desktopu + // Otherwise, center the window on the primary desktop. POINT pt; - pt.x = 0; // primarni monitor + pt.x = 0; // Primary monitor. pt.y = 0; hMonitor = MonitorFromPoint(pt, MONITOR_DEFAULTTOPRIMARY); } - // vytahneme working area desktopu + // Get the desktop work area. GetMonitorInfo(hMonitor, &mi); } *workClipRect = mi.rcWork; @@ -88,18 +89,18 @@ void MultiMonCenterWindow(HWND hWindow, HWND hByWnd, BOOL findTopWindow) { if (hWindow == NULL) { - // pri praci s NULL hwnd dochazi k nechtenemu blikani oken + // Using a NULL HWND causes unwanted window flicker. TRACE_E("MultiMonCenterWindow: hWindow == NULL"); return; } if (IsZoomed(hWindow)) { - // s maximalizovany oknem nebudeme hybat + // Do not move a maximized window. return; } - // mame dohledat top-level window + // Need to find the top-level window. if (findTopWindow) { if (hByWnd != NULL) @@ -111,7 +112,7 @@ void MultiMonCenterWindow(HWND hWindow, HWND hByWnd, BOOL findTopWindow) RECT clipR; MultiMonGetClipRectByWindow(hByWnd, &clipR, NULL); RECT byR; - if (hByWnd != NULL && IsWindowVisible(hByWnd) && !IsIconic(hByWnd)) // pozor, tato podminka je take v MultiMonGetClipRectByWindow + if (hByWnd != NULL && IsWindowVisible(hByWnd) && !IsIconic(hByWnd)) // Note: the same condition is also used in MultiMonGetClipRectByWindow. GetWindowRect(hByWnd, &byR); else byR = clipR; @@ -123,14 +124,14 @@ void MultiMonCenterWindowByRect(HWND hWindow, const RECT& clipR, const RECT& byR { if (hWindow == NULL) { - // pri praci s NULL hwnd dochazi k nechtenemu blikani oken + // Using a NULL HWND causes unwanted window flicker. TRACE_E("MultiMonCenterWindowByRect: hWindow == NULL"); return; } if (IsZoomed(hWindow)) { - // s maximalizovany oknem nebudeme hybat + // Do not move a maximized window. return; } @@ -139,13 +140,13 @@ void MultiMonCenterWindowByRect(HWND hWindow, const RECT& clipR, const RECT& byR int wndWidth = wndRect.right - wndRect.left; int wndHeight = wndRect.bottom - wndRect.top; - // vycentrujeme + // Center it. wndRect.left = byR.left + (byR.right - byR.left - wndWidth) / 2; wndRect.top = byR.top + (byR.bottom - byR.top - wndHeight) / 2; wndRect.right = wndRect.left + wndWidth; wndRect.bottom = wndRect.top + wndHeight; - // ohlidame hranice + // Keep it within bounds. if (wndRect.left < clipR.left) // pokud je okno vetsi nez clipR, nechame zobrazit jeho levou cast { wndRect.left = clipR.left; @@ -171,7 +172,7 @@ void MultiMonCenterWindowByRect(HWND hWindow, const RECT& clipR, const RECT& byR { // pokud je okno vetsi nez clipR if (wndRect.left > clipR.left) - wndRect.left = clipR.left; // vyuzijeme maximalne prostor + wndRect.left = clipR.left; // Use as much space as possible. } if (wndHeight <= clipR.bottom - clipR.top) @@ -187,7 +188,7 @@ void MultiMonCenterWindowByRect(HWND hWindow, const RECT& clipR, const RECT& byR { // pokud je okno vetsi nez clipR if (wndRect.top > clipR.top) - wndRect.top = clipR.top; // vyuzijeme maximalne prostor + wndRect.top = clipR.top; // Use as much space as possible. } SetWindowPos(hWindow, NULL, wndRect.left, wndRect.top, 0, 0, @@ -242,7 +243,7 @@ BOOL MultiMonGetDefaultWindowPos(HWND hByWnd, POINT* p) // trik s dummy oknem funguje pekne pod MSVC, ale pri spusteni salamandera bez MSVC // se okno otevira na primarnim monitoru (nezjistil jsem proc, kdyz ma parenta) - // pomuzeme si -- posuneme okno na nas monitor + // Work around it by moving the window to our monitor. MONITORINFO tmpInfo; tmpInfo.cbSize = sizeof(tmpInfo); GetMonitorInfo(hTmpMonitor, &tmpInfo); @@ -271,12 +272,12 @@ BOOL MultiMonEnsureRectVisible(RECT* rect, BOOL partialOK) RECT intersectRect; BOOL intersect = IntersectRect(&intersectRect, rect, &clipRect); if (EqualRect(&intersectRect, rect)) - return FALSE; // lezime celou plochou na jednom z monitoru, neni co resit + return FALSE; // The entire rectangle is on one monitor, so return FALSE. if (intersect && partialOK) - return FALSE; // jsme zcasti viditelni, neni co resit + return FALSE; // The rectangle is already partially visible, so return FALSE. - // zajistim, aby obdelnik nepresahl pres monitor + // Make sure the rectangle does not extend past the monitor. if (rect->right - rect->left > clipRect.right - clipRect.left) rect->right = clipRect.right - clipRect.left + rect->left; if (rect->bottom - rect->top > clipRect.bottom - clipRect.top) @@ -310,6 +311,6 @@ BOOL MultiMonEnsureRectVisible(RECT* rect, BOOL partialOK) rect->bottom += y; } - // zmenili jsme nekterou z hodnot, vratime TRUE + // We changed one of the values, so return TRUE. return TRUE; } From b86b25f042d7ef5b8c01b9f37f1e821d8927f1b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:27:10 +0200 Subject: [PATCH 230/710] [translation] Fix src/common/regexp.h comments (#603) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/common/regexp.h | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/common/regexp.h b/src/common/regexp.h index 916edfbc3..dc46ebd21 100644 --- a/src/common/regexp.h +++ b/src/common/regexp.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once @@ -41,7 +42,7 @@ void regerror(const char* error); //***************************************************************************** //***************************************************************************** -// chyby, ktere mohou nastat pri compilaci a hledani reg. expr. +// Errors that may occur during regexp compilation and search. enum CRegExpErrors { reeNoError, @@ -59,7 +60,7 @@ enum CRegExpErrors reeInternalDisaster, }; -// funkce, ktera vraci text nastale chyby +// Function that returns the error text. const char* RegExpErrorText(CRegExpErrors err); // search flags @@ -74,18 +75,18 @@ const char* RegExpErrorText(CRegExpErrors err); class CRegularExpression { public: - static const char* LastError; // text posledni chyby + static const char* LastError; // Last error text. protected: const char* LastErrorText; char* OriginalPattern; - regexp* Expression; // nakompilovany regularni vyraz + regexp* Expression; // Compiled regular expression. WORD Flags; - char* Line; // buffer pro radek - const char* OrigLineStart; // pointer na zacatek puvodniho textu (predaneho do SetLine() jako 'start') - int Allocated; // kolik bytu je alokovano - int LineLength; // aktualni delka radky + char* Line; // Line buffer. + const char* OrigLineStart; // Pointer to the start of the original text (passed to SetLine() as 'start'). + int Allocated; // Number of allocated bytes. + int LineLength; // Current line length. public: CRegularExpression() @@ -114,10 +115,10 @@ class CRegularExpression const char* GetPattern() const { return OriginalPattern; } const char* GetLastErrorText() const { return LastErrorText; } - BOOL Set(const char* pattern, WORD flags); // vraci FALSE pri chybe (volat metodu GetLastErrorText) - BOOL SetFlags(WORD flags); // vraci FALSE pri chybe (volat metodu GetLastErrorText) + BOOL Set(const char* pattern, WORD flags); // Returns FALSE on error (call GetLastErrorText). + BOOL SetFlags(WORD flags); // Returns FALSE on error (call GetLastErrorText). - BOOL SetLine(const char* start, const char* end); // radek textu, ve kterem vyhledava, vraci FALSE pri chybe (volat metodu GetLastErrorText) + BOOL SetLine(const char* start, const char* end); // Sets the line of text to search in; returns FALSE on error (call GetLastErrorText). int SearchForward(int start, int& foundLen); int SearchBackward(int length, int& foundLen); @@ -130,11 +131,11 @@ class CRegularExpression BOOL ExpandVariables(char* pattern, char* buffer, int bufSize, int* count); - // navratove hodnoty + // Return values // - // 0 hledany text nebyl nalezen, do 'buffer' se nic nekopirovalo - // 1 text byl uspesne nahrazen - // 2 'buffer' je prilis maly + // 0 the text was not found, nothing was copied to 'buffer' + // 1 the text was replaced successfully + // 2 'buffer' is too small int ReplaceForward(int start, char* pattern, BOOL global, char* buffer, int bufSize); From af13912c19e25789da49a7fe928e7d8fcb6aae17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:27:16 +0200 Subject: [PATCH 231/710] [translation] Fix src/common/sheets.cpp comments (#604) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/common/sheets.cpp | 129 +++++++++++++++++++++--------------------- 1 file changed, 65 insertions(+), 64 deletions(-) diff --git a/src/common/sheets.cpp b/src/common/sheets.cpp index da97ef7c8..e99e4e945 100644 --- a/src/common/sheets.cpp +++ b/src/common/sheets.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -87,7 +88,7 @@ void CElasticLayout::FindMoveCtrls() { EnumChildWindows(HWindow, FindMoveControls, (LPARAM)this); - // najdeme obalku vsech 'move' prvku + // find the bounding box of all 'move' controls RECT rEnvelope = {0}; for (int i = 0; i < MoveCtrls.Count; i++) { @@ -107,11 +108,11 @@ void CElasticLayout::FindMoveCtrls() POINT p = {rEnvelope.right, rEnvelope.bottom}; ScreenToClient(HWindow, &p); int envelopeBottom = p.y; - // souradnice 'MoveCtrlsY' budou vztazene od spodni hrany obalky + // 'MoveCtrlsY' coordinates are relative to the bottom edge of the bounding box for (int i = 0; i < MoveCtrls.Count; i++) MoveCtrls[i].Pos.y = envelopeBottom - MoveCtrls[i].Pos.y; - // pro prvky ResizeCtrls ulozime jejich vzdalenost spodni hrany od spodni hrany obalky + // for ResizeCtrls, store the distance from their bottom edge to the bottom edge of the bounding box for (int i = 0; i < ResizeCtrls.Count; i++) { if (ResizeCtrls[i].Pos.y == 0) @@ -198,7 +199,7 @@ void CPropSheetPage::Init(const TCHAR* title, HINSTANCE modul, int resID, Flags = flags; Icon = icon; - ParentDialog = NULL; // nastavuje se z CPropertyDialog::Execute() + ParentDialog = NULL; // set from CPropertyDialog::Execute() ParentPage = NULL; HTreeItem = NULL; Expanded = NULL; @@ -290,7 +291,7 @@ CPropSheetPage::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) TransferData(ttDataToWindow); if (ElasticLayout != NULL) ElasticLayout->LayoutCtrls(); - return TRUE; // chci focus od DefDlgProc + return TRUE; // let DefDlgProc set the focus } case WM_SIZE: @@ -321,26 +322,26 @@ CPropSheetPage::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_NOTIFY: { - if (((NMHDR*)lParam)->code == PSN_KILLACTIVE) // deaktivace stranky + if (((NMHDR*)lParam)->code == PSN_KILLACTIVE) // page deactivation { if (ValidateData()) SetWindowLongPtr(HWindow, DWLP_MSGRESULT, FALSE); - else // nepovolime deaktivaci stranky + else // do not allow the page to be deactivated SetWindowLongPtr(HWindow, DWLP_MSGRESULT, TRUE); return TRUE; } - if (((NMHDR*)lParam)->code == PSN_SETACTIVE) // aktivace stranky + if (((NMHDR*)lParam)->code == PSN_SETACTIVE) // page activation { if (ParentDialog != NULL && ParentDialog->LastPage != NULL) - { // zapamatovani posledni stranky + { // remember the last page *ParentDialog->LastPage = ParentDialog->GetCurSel(); } break; } if (((NMHDR*)lParam)->code == PSN_APPLY) - { // stisknuto tlacitko ApplyNow nebo OK + { // ApplyNow or OK button pressed if (TransferData(ttDataFromWindow)) SetWindowLongPtr(HWindow, DWLP_MSGRESULT, PSNRET_NOERROR); else @@ -349,8 +350,8 @@ CPropSheetPage::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) } if (((NMHDR*)lParam)->code == PSN_WIZFINISH) - { // stisknuto tlacitko Finish - // neprislo PSN_KILLACTIVE - provedu validaci + { // Finish button pressed + // PSN_KILLACTIVE did not arrive, so run validation if (!ValidateData()) { SetWindowLongPtr(HWindow, DWLP_MSGRESULT, TRUE); @@ -385,7 +386,7 @@ CPropSheetPage::CPropSheetPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, CPropSheetPage* dlg; switch (uMsg) { - case WM_INITDIALOG: // prvni zprava - pripojeni objektu k dialogu + case WM_INITDIALOG: // first message - attach the object to the dialog { dlg = (CPropSheetPage*)((PROPSHEETPAGE*)lParam)->lParam; if (dlg == NULL) @@ -397,25 +398,25 @@ CPropSheetPage::CPropSheetPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, { dlg->HWindow = hwndDlg; dlg->Parent = ::GetParent(hwndDlg); - //--- zarazeni okna podle hwndDlg do seznamu oken - if (!WindowsManager.AddWindow(hwndDlg, dlg)) // chyba + //--- add the window identified by hwndDlg to the window list + if (!WindowsManager.AddWindow(hwndDlg, dlg)) // error { TRACE_ET(_T("Unable to create dialog.")); return TRUE; } - dlg->NotifDlgJustCreated(); // zavedeno jako misto pro upravu layoutu dialogu + dlg->NotifDlgJustCreated(); // added as a place to adjust the dialog layout } break; } - case WM_DESTROY: // posledni zprava - odpojeni objektu od dialogu + case WM_DESTROY: // last message - detach the object from the dialog { dlg = (CPropSheetPage*)WindowsManager.GetWindowPtr(hwndDlg); - INT_PTR ret = FALSE; // pro pripad, ze ji nezpracuje + INT_PTR ret = FALSE; // in case it does not handle the message if (dlg != NULL && dlg->Is(otDialog)) { - // Petr: posunul jsem dolu pod wnd->WindowProc(), aby behem WM_DESTROY - // jeste dochazely zpravy (potreboval Lukas) + // Petr: moved this below wnd->WindowProc() so messages still arrive during WM_DESTROY + // (Lukas needed this) // WindowsManager.DetachWindow(hwndDlg); ret = dlg->DialogProc(uMsg, wParam, lParam); @@ -424,7 +425,7 @@ CPropSheetPage::CPropSheetPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, if (dlg->IsAllocated()) delete dlg; else - dlg->HWindow = NULL; // informace o odpojeni + dlg->HWindow = NULL; // detached state } return ret; } @@ -441,11 +442,11 @@ CPropSheetPage::CPropSheetPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, #endif } } - //--- zavolani metody DialogProc(...) prislusneho objektu dialogu + //--- call DialogProc(...) of the corresponding dialog object if (dlg != NULL) return dlg->DialogProc(uMsg, wParam, lParam); else - return FALSE; // chyba nebo message neprisla mezi WM_INITDIALOG a WM_DESTROY + return FALSE; // error, or the message did not arrive between WM_INITDIALOG and WM_DESTROY } // @@ -511,14 +512,14 @@ int CPropertyDialog::GetCurSel() #define _TPD_IDC_CAPTION 3 #define _TPD_IDC_RECT 4 #define _TPD_IDC_OK 5 -// rozmery v dlg units -#define _TPD_LEFTMARGIN 4 // odsazeni TreeView a Captionu od leveho okraje -#define _TPD_TOPMARGIN 4 // odsazeni TreeView a Captionu od horniho okraje -#define _TPD_TREE_W 100 // sirka TreeView -#define _TPD_CAPTION_H 16 // vyska captionu -#define _TPD_BUTTON_W 50 // sirka tlacitek -#define _TPD_BUTTON_H 14 // vyska tlacitek -#define _TPD_BUTTON_MARG 4 // rozestup mezi tlacitky +// dimensions in dialog units +#define _TPD_LEFTMARGIN 4 // TreeView and caption left margin +#define _TPD_TOPMARGIN 4 // TreeView and caption top margin +#define _TPD_TREE_W 100 // TreeView width +#define _TPD_CAPTION_H 16 // caption height +#define _TPD_BUTTON_W 50 // button width +#define _TPD_BUTTON_H 14 // button height +#define _TPD_BUTTON_MARG 4 // button spacing CTPHCaptionWindow::CTPHCaptionWindow(HWND hDlg, int ctrlID) : CWindow(hDlg, ctrlID, ooAllocated) @@ -568,7 +569,7 @@ CTPHCaptionWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) GetClientRect(HWindow, &r); int devCaps = GetDeviceCaps(hdc, NUMCOLORS); - if (devCaps == -1) // gradient pouzijeme pouze pri vice nez 256 barvach + if (devCaps == -1) // use the gradient only with more than 256 colors { HBRUSH hOldBrush = (HBRUSH)GetCurrentObject(hdc, OBJ_BRUSH); #define TPH_STEPS 100 @@ -609,7 +610,7 @@ CTPHCaptionWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) HFONT hSrcFont = (HFONT)HANDLES(GetStockObject(DEFAULT_GUI_FONT)); GetObject(hSrcFont, sizeof(srcLF), &srcLF); srcLF.lfHeight = (int)(srcLF.lfHeight * 1.2); - // srcLF.lfWeight = FW_BOLD; // na vistach vypada bold dost hnusne + necitelne + // srcLF.lfWeight = FW_BOLD; // bold looks quite ugly and unreadable on Vista hFont = CreateFontIndirect(&srcLF); hOldFont = (HFONT)SelectObject(hdc, hFont); @@ -641,7 +642,7 @@ CTPHGripWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) { case WM_SETCURSOR: { - // chceme pouze north-south kurzor + // we only want the north-south cursor SetCursor(LoadCursor(NULL, IDC_SIZENS)); return TRUE; } @@ -666,9 +667,9 @@ CTreePropHolderDlg::CTreePropHolderDlg(HWND hParent, DWORD* windowHeight) INT_PTR CTreePropHolderDlg::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) { - // WM_INITDIALOG zavolame az ve chvili, kdy budeme znat rozmery okna + // call WM_INITDIALOG only once we know the window size if (TPD != NULL && uMsg != WM_INITDIALOG) - TPD->DialogProc(uMsg, wParam, lParam); // forward zprav + TPD->DialogProc(uMsg, wParam, lParam); // forward messages switch (uMsg) { case WM_INITDIALOG: @@ -695,8 +696,8 @@ CTreePropHolderDlg::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (appIsThemed) { RECT rect = {0, 0, 4, 8}; - MapDialogRect(HWindow, &rect); // ziskame baseUnitX a baseUnitY pro prepocet dlg-units na pixels - treeIndent = MulDiv(9 /* odsazeni v dlg-units */, rect.right /* baseUnitX */, 4); + MapDialogRect(HWindow, &rect); // get baseUnitX and baseUnitY for converting dialog units to pixels + treeIndent = MulDiv(9 /* indent in dialog units */, rect.right /* baseUnitX */, 4); TreeView_SetIndent(HTreeView, treeIndent); } @@ -722,7 +723,7 @@ CTreePropHolderDlg::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) GripWindow = new CTPHGripWindow(HWindow, _TPD_IDC_GRIP); - // default rozmery jsou minimalni - ulozime si je, abychom je nasledne mohli hlidat + // the default dimensions are the minimum - save them so we can enforce them later GetWindowRect(HWindow, &r); RECT cR; GetClientRect(HWindow, &cR); @@ -734,9 +735,9 @@ CTreePropHolderDlg::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) MarginSize.cy + 1 + MarginSize.cy + ButtonSize.cy + MarginSize.cy + marginH; - // nastavime uzivatelsky rozmer okna a provedeme layout prvku + // apply the user window size and lay out the controls int height = (int)*WindowHeight; - RECT clipR; // nechceme byt vetsi nez vyska obrazovky + RECT clipR; // do not exceed the screen height MultiMonGetClipRectByWindow(HWindow, &clipR, NULL); if (height > clipR.bottom - clipR.top) height = clipR.bottom - clipR.top; @@ -748,7 +749,7 @@ CTreePropHolderDlg::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) LayoutControls(); TreeView_EnsureVisible(HTreeView, TPD->At(TPD->StartPage)->HTreeItem); - TPD->DialogProc(uMsg, wParam, lParam); // forward zprav + TPD->DialogProc(uMsg, wParam, lParam); // forward messages break; } @@ -761,7 +762,7 @@ CTreePropHolderDlg::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) (GetKeyState(VK_CONTROL) & 0x8000) != 0, (GetKeyState(VK_SHIFT) & 0x8000) != 0); } - return TRUE; // F1 nenechame propadnout do parenta ani pokud nevolame WinLibHelp->OnHelp() + return TRUE; // do not let F1 fall through to the parent even if we do not call WinLibHelp->OnHelp() } case WM_COMMAND: @@ -787,7 +788,7 @@ CTreePropHolderDlg::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case _TPD_IDC_OK: { - // musim provest validaci aktualni stranky + // validate the current page if (!ChildDialog->ValidateData()) return TRUE; @@ -805,7 +806,7 @@ CTreePropHolderDlg::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) } } - // preposleme message, aby chodil enter na default tlacitka + // forward the message so Enter reaches the default buttons if (ChildDialog != NULL && HIWORD(wParam) == BN_CLICKED) ::SendMessage(ChildDialog->HWindow, uMsg, wParam, lParam); @@ -873,7 +874,7 @@ CTreePropHolderDlg::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_NCHITTEST: { - // Resize chceme pouze ve svyslem smeru + // resize only vertically LRESULT ht = DefWindowProc(HWindow, uMsg, wParam, lParam); switch (ht) { @@ -902,7 +903,7 @@ CTreePropHolderDlg::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_GETMINMAXINFO: { - // Resize chceme pouze ve svyslem smeru + // resize only vertically LPMINMAXINFO lpmmi = (LPMINMAXINFO)lParam; lpmmi->ptMinTrackSize.x = MinWindowSize.cx; lpmmi->ptMaxTrackSize.x = MinWindowSize.cx; @@ -1025,9 +1026,9 @@ void CTreePropHolderDlg::LayoutControls() SWP_NOZORDER)); HANDLES(EndDeferWindowPos(hdwp)); - // hack: v treeview/common controls je zrejme chyba: pokud naskoci diky obsahu scrollbar, - // neprekresli se selected polozka, takze je vpravo orizla; muze to souviset s full row - // select a jeste aero lookem; kazdopadne prekresleni pod W7 neblika, asi si ho muzeme dovolit + // hack: TreeView/common controls apparently have a bug: if a scrollbar appears because of the content, + // the selected item is not redrawn, so it gets clipped on the right; this may be related to full-row + // selection and the Aero look; in any case, repainting under W7 does not flicker, so we can probably afford it InvalidateRect(HTreeView, NULL, false); } } @@ -1054,11 +1055,11 @@ int CTreePropHolderDlg::BuildAndMeasureTree() tvis.item.lParam = (LPARAM)TPD->At(i); TPD->At(i)->HTreeItem = TreeView_InsertItem(HTreeView, &tvis); RECT r; - // Radeji navratovou hodnotu TreeView_GetItemRect() vezmeme v potaz + // take the return value of TreeView_GetItemRect() into account if (TreeView_GetItemRect(HTreeView, TPD->At(i)->HTreeItem, &r, TRUE) && r.right - r.left > width) width = r.right - r.left; } - // Nyni jiz muzeme pozavirat neexpandovane polozky + // now we can collapse the items that were not expanded for (int i = 0; i < TPD->Count; i++) { if (TPD->At(i)->Expanded != NULL && *TPD->At(i)->Expanded == FALSE) @@ -1224,7 +1225,7 @@ int CTreePropDialog::Execute(const TCHAR* buttonOK, RECT maxPageRect; SetRectEmpty(&maxPageRect); - // zjistim maximalni rozmery + // determine the maximum dimensions for (int i = 0; i < Count; i++) { At(i)->ParentDialog = this; @@ -1252,9 +1253,9 @@ int CTreePropDialog::Execute(const TCHAR* buttonOK, dlgStyle = *(DWORD*)(pageTemplate + 6); // style dlgCX = *(short*)(pageTemplate + 11); // cx dlgCY = *(short*)(pageTemplate + 12); // cy - WORD* t = pageTemplate + 13; // menu, preskocime na tridu dialogu, a pak na jeho titulek + WORD* t = pageTemplate + 13; // menu, skip to the dialog class, then to its title if (*t == 0) - t++; // zadne menu + t++; // no menu else { if (*t == 0xffff) @@ -1263,13 +1264,13 @@ int CTreePropDialog::Execute(const TCHAR* buttonOK, t += wcslen((wchar_t*)t) + 1; // menu string } if (*t == 0) - t++; // zadna trida dialogu + t++; // no dialog class else { if (*t == 0xffff) - t += 2; // ID tridy dialogu + t += 2; // dialog class ID else - t += wcslen((wchar_t*)t) + 1; // string tridy dialogu + t += wcslen((wchar_t*)t) + 1; // dialog class string } dlgTitle = (WCHAR*)t; @@ -1302,7 +1303,7 @@ int CTreePropDialog::Execute(const TCHAR* buttonOK, maxPageRect.bottom = dlgCY; } - // vyska od spodniho okraje dialogu ke spodku TreeView a ChildDialogu + // height from the dialog bottom to the bottom of TreeView and ChildDialog int lowMargin = 2 * _TPD_TOPMARGIN + _TPD_BUTTON_H + _TPD_TOPMARGIN + _TPD_TOPMARGIN / 2; SIZE dialogSize; dialogSize.cx = _TPD_LEFTMARGIN + _TPD_TREE_W + _TPD_LEFTMARGIN + maxPageRect.right + @@ -1310,8 +1311,8 @@ int CTreePropDialog::Execute(const TCHAR* buttonOK, dialogSize.cy = _TPD_TOPMARGIN + _TPD_CAPTION_H + _TPD_TOPMARGIN + maxPageRect.bottom + lowMargin; - // postavim template dialogu: DLG nebo DLGEX, podle formatu stranek, musi byt shodny, - // jinak dochazi k orezu controlu a lisi se pisma stranek a zbytku tree property dialogu + // build the dialog template as DLG or DLGEX to match the page format; + // otherwise controls get clipped and page fonts differ from the rest of the tree property dialog HGLOBAL hgbl; @@ -1340,7 +1341,7 @@ int CTreePropDialog::Execute(const TCHAR* buttonOK, *lpw++ = 0; // predefined dialog box class (by default) lpwsz = (LPWSTR)lpw; lpw += WinLibCopyText(lpwsz, Caption, 100); // title - *lpw++ = 8; // velikost fontu + *lpw++ = 8; // font size *lpw++ = FW_NORMAL; // font weight *(BYTE*)lpw = FALSE; // is font italic? *((BYTE*)lpw + 1) = ANSI_CHARSET; // font charset @@ -1361,7 +1362,7 @@ int CTreePropDialog::Execute(const TCHAR* buttonOK, AddItemEx(lpw, _T("static"), _TPD_IDC_CAPTION, 0, 0, 0, 0, WS_CHILD | WS_VISIBLE, 0, NULL); - // Static, ktery je behem initu nahrazen child dialogem + // static control replaced by the child dialog during init AddItemEx(lpw, _T("static"), _TPD_IDC_RECT, 0, 0, maxPageRect.right, maxPageRect.bottom, WS_CHILD, 0, NULL); @@ -1369,7 +1370,7 @@ int CTreePropDialog::Execute(const TCHAR* buttonOK, AddItemEx(lpw, _T("static"), _TPD_IDC_SEP, 0, 0, 0, 0, WS_GROUP | WS_CHILD | WS_VISIBLE | SS_ETCHEDHORZ, 0, NULL); - // Spodni rada tlacitek + // bottom row of buttons AddItemEx(lpw, _T("button"), _TPD_IDC_OK, 0, 0, 0, 0, WS_CHILD | WS_VISIBLE | BS_DEFPUSHBUTTON | WS_TABSTOP, 0, buttonOK); From 91a1cf7578b0a571ab04c3fb0d03881c66a2e8cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:27:22 +0200 Subject: [PATCH 232/710] [translation] Fix src/common/sheets.h comments (#605) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/common/sheets.h | 65 +++++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/src/common/sheets.h b/src/common/sheets.h index 3ab5b249d..d24f7fdbf 100644 --- a/src/common/sheets.h +++ b/src/common/sheets.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once @@ -10,17 +11,17 @@ class CTreePropHolderDlg; struct CElasticLayoutCtrl { - HWND HCtrl; // handl prvku, ktery mame posouvat - POINT Pos; // pozice prvku vuci spodni hrane opsane obalky + HWND HCtrl; // handle of the control to move + POINT Pos; // control position relative to the bottom edge of the bounding box }; -// pomocna trida slouzici pro layout prvku dialogu na zaklade jeho velikosti +// helper class for laying out dialog controls based on the dialog size class CElasticLayout { public: CElasticLayout(HWND hWindow); void AddResizeCtrl(int resID); - // provede rozmisteni prvku + // lays out the controls void LayoutCtrls(); protected: @@ -29,25 +30,25 @@ class CElasticLayout void FindMoveCtrls(); protected: - // handle dialogu, jehoz layout zajistujeme + // handle of the dialog whose layout we manage HWND HWindow; - // delici linka, od ktere jiz prvky posouvame (lezi na spodni hrane ResizeCntrls) - // client souradnice v bodech + // divider line from which controls start moving (lies on the bottom edge of ResizeCtrls) + // client coordinates, in pixels int SplitY; // prvky ktere s velikosti natahujeme (typicky listview) TDirectArray ResizeCtrls; - // docasne pole plnene z FindMoveCtrls; idealne by slo o lokalni promennou, ale - // pro pohodlne volani callbacku FindMoveControls (kam ho potrebujeme predat) - // ho umistuji jako atribut tridy + // temporary array populated by FindMoveCtrls; ideally this would be a local variable, but + // for easier calls to the FindMoveControls callback (which needs it passed in) + // I keep it as a class member TDirectArray MoveCtrls; }; class CPropSheetPage : protected CDialog { public: - CDialog::SetObjectOrigin; // zpristupneni povolenych metod predku + CDialog::SetObjectOrigin; // expose selected base-class methods CDialog::Transfer; - CDialog::HWindow; // HWindow zustane take pristupne + CDialog::HWindow; // HWindow also remains accessible CPropSheetPage(const TCHAR* title, HINSTANCE modul, int resID, DWORD flags /* = PSP_USETITLE*/, HICON icon, @@ -79,13 +80,13 @@ class CPropSheetPage : protected CDialog DWORD Flags; HICON Icon; - CPropertyDialog* ParentDialog; // vlastnik teto stranky - // pro TreeDialog + CPropertyDialog* ParentDialog; // owner of this page + // for TreeDialog CPropSheetPage* ParentPage; HTREEITEM HTreeItem; BOOL* Expanded; - // pokud je ruzne od NULL, se zmenou velikosti dialogu menime layout prvku + // if not NULL, resizing the dialog also updates the control layout CElasticLayout* ElasticLayout; friend class CPropertyDialog; @@ -137,8 +138,8 @@ class CPropertyDialog : public TIndirectArray class CTreePropDialog; -// sedivy stinovany pruh nad property sheet v tree variante PropertyDialog, -// kde je zobrazen nazev aktualni stranky +// gray shaded bar above the property sheet in the tree variant of PropertyDialog, +// showing the name of the current page class CTPHCaptionWindow : protected CWindow { protected: @@ -155,7 +156,7 @@ class CTPHCaptionWindow : protected CWindow virtual LRESULT WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam); }; -// na grip controlu chceme pouze top-down kurzor +// show only the resize cursor over the grip control class CTPHGripWindow : public CWindow { public: @@ -165,7 +166,7 @@ class CTPHGripWindow : public CWindow virtual LRESULT WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam); }; -// dialog, ktery drzi treeview, stinovany nadpis a aktualni property sheet +// dialog that hosts the tree view, shaded caption, and current property sheet class CTreePropHolderDlg : public CDialog { protected: @@ -176,17 +177,17 @@ class CTreePropHolderDlg : public CDialog RECT ChildDialogRect; int CurrentPageIndex; CPropSheetPage* ChildDialog; - int ExitButton; // idcko tlacitka, ktere ukoncilo dialog - - // rozmery v bodech - SIZE MinWindowSize; // minimalni rozmery dialogu (urcene podle nejvetsiho child dlg) - DWORD* WindowHeight; // aktualni vyska dialogu - int TreeWidth; // sirka treeview, pocitana na zaklade obsahu - int CaptionHeight; // vyska titulku - SIZE ButtonSize; // rozmery tlacitek na spodni hrane dialogu - int ButtonMargin; // mezera mezi tlacitky - SIZE GripSize; // rozmery resize gripu v pravem spodnim rohu dialogu - SIZE MarginSize; // vodorovny a svisly okraj + int ExitButton; // ID of the button that closed the dialog + + // dimensions in pixels + SIZE MinWindowSize; // minimum dialog size (determined by the largest child dialog) + DWORD* WindowHeight; // current dialog height + int TreeWidth; // tree view width, calculated from the contents + int CaptionHeight; // caption height + SIZE ButtonSize; // size of the buttons along the bottom edge of the dialog + int ButtonMargin; // spacing between buttons + SIZE GripSize; // size of the resize grip in the dialog's bottom-right corner + SIZE MarginSize; // horizontal and vertical margins public: CTreePropHolderDlg(HWND hParent, DWORD* windowHeight); @@ -205,7 +206,7 @@ class CTreePropHolderDlg : public CDialog friend class CTreePropDialog; }; -// datovy drzak stranek pro tree verzi PropertyDialog +// page data holder for the tree version of PropertyDialog class CTreePropDialog : public CPropertyDialog { protected: @@ -235,6 +236,6 @@ class CTreePropDialog : public CPropertyDialog // DLGTEMPLATE *DoLockDlgRes(int page); friend class CTreePropHolderDlg; - // pouze pro forwarding zprav z CTreePropHolderDlg + // only for forwarding messages from CTreePropHolderDlg virtual void DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) {}; }; From 2ff8dfa02a36199069833097427968f771dbe53d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:27:29 +0200 Subject: [PATCH 233/710] [translation] Fix src/common/str.cpp comments (#606) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/common/str.cpp | 57 +++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/src/common/str.cpp b/src/common/str.cpp index 88b762b3b..77ee9cade 100644 --- a/src/common/str.cpp +++ b/src/common/str.cpp @@ -1,12 +1,13 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" #include #include #include -#include // potrebuju LPCOLORMAP +#include // need LPCOLORMAP #if defined(_DEBUG) && defined(_MSC_VER) // without passing file+line to 'new' operator, list of memory leaks shows only 'crtdbg.h(552)' #define new new (_NORMAL_BLOCK, __FILE__, __LINE__) @@ -14,7 +15,7 @@ #ifndef STR_DISABLE -#ifdef INSIDE_SPL // pro pouziti v pluginech +#ifdef INSIDE_SPL // for use in plugins #include "spl_base.h" #include "dbg.h" #else //INSIDE_SPL @@ -26,7 +27,7 @@ #include "str.h" -#ifndef INSIDE_SPL // krome pouziti v pluginech +#ifndef INSIDE_SPL // except for use in plugins // The order here is important. // Section names must be 8 characters or less. @@ -38,15 +39,15 @@ // boundaries so we can find the real functions // that we need to call for initialization. -#pragma warning(disable : 4075) // chceme definovat poradi inicializace modulu +#pragma warning(disable : 4075) // define the module initialization order typedef void(__cdecl* _PVFV)(void); #pragma section(".i_str$a", read) -__declspec(allocate(".i_str$a")) const _PVFV i_str = (_PVFV)1; // na zacatek sekce .i_str si dame promennou i_str +__declspec(allocate(".i_str$a")) const _PVFV i_str = (_PVFV)1; // place the i_str variable at the start of the .i_str section #pragma section(".i_str$z", read) -__declspec(allocate(".i_str$z")) const _PVFV i_str_end = (_PVFV)1; // a na konec sekce .i_str si dame promennou i_str_end +__declspec(allocate(".i_str$z")) const _PVFV i_str_end = (_PVFV)1; // and place the i_str_end variable at the end of the .i_str section void Initialize__Str() { @@ -65,7 +66,7 @@ BYTE UpperCase[256]; void InitializeCase(); -class C__STR_module // automaticka inicializace modulu +class C__STR_module // automatic module initialization { public: C__STR_module() { InitializeCase(); } @@ -125,16 +126,16 @@ int StrICpy(char* dest, const char* src) while (*src != 0) *dest++ = LowerCase[*src++]; *dest = 0; - return (int)(src - s); // vratime pocet nakopirovanych znaku + return (int)(src - s); // return the number of copied characters } // //***************************************************************************** #ifdef _WIN64 -// Ani ve VC11 MS nedodali x64 ASM verze stringovych operaci, takze zatim take zustavame v C++ +// Even in VC11, MS did not provide x64 ASM versions of the string operations, so for now we stay with C++. -// puvodni funkce +// original function int StrICmp(const char* s1, const char* s2) { int res; @@ -190,8 +191,8 @@ int StrICmp(const char* s1, const char* s2) } - // navratova hodnota je v eax, abychom obesli warning prekladace - // pro funkce bez navratove hodnoty, udelame nasledujici opicarnu + // the return value is in eax to avoid a compiler warning + // for functions without a return value, use the following hack BOOL retVal; __asm {mov retVal, eax} return retVal; @@ -202,8 +203,8 @@ int StrICmp(const char* s1, const char* s2) //***************************************************************************** /* -// puvodni funkce -// pozor, zde je chyba StrNICmp("a", "aa", 2) vraci 0 +// original function +// warning: StrNICmp("a", "aa", 2) incorrectly returns 0 int StrNICmp(const char *s1, const char *s2, int n) { int res; @@ -218,9 +219,9 @@ int StrNICmp(const char *s1, const char *s2, int n) */ #ifdef _WIN64 -// Ani ve VC11 MS nedodali x64 ASM verze stringovych operaci, takze zatim take zustavame v C++ +// Even in VC11, MS did not provide x64 ASM versions of the string operations, so for now we stay with C++. -// opravena verze +// fixed version int StrNICmp(const char* s1, const char* s2, int n) { int res; @@ -293,8 +294,8 @@ int StrNICmp(const char* s1, const char* s2, int n) toend: mov eax,ecx // move return value to eax } - // navratova hodnota je v eax, abychom obesli warning prekladace - // pro funkce bez navratove hodnoty, udelame nasledujici opicarnu + // the return value is in eax to avoid a compiler warning + // for functions without a return value, use the following hack BOOL retVal; __asm {mov retVal, eax} return retVal; @@ -306,11 +307,11 @@ int StrNICmp(const char* s1, const char* s2, int n) //***************************************************************************** #ifdef _WIN64 -// Ani ve VC11 MS nedodali x64 ASM verze stringovych operaci, takze zatim take zustavame v C++ +// Even in VC11, MS did not provide x64 ASM versions of the string operations, so for now we stay with C++. int MemICmp(const void* buf1, const void* buf2, int n) { int ret = _memicmp(buf1, buf2, n); - // normalizujeme navratovou hodnotu dle nasi specifikace + // normalize the return value to match our specification if (ret == 0) return 0; return (ret < 0) ? -1 : 1; @@ -365,8 +366,8 @@ int MemICmp(const void* buf1, const void* buf2, int n) toend: mov eax,ecx // move return value to eax } - // navratova hodnota je v eax, abychom obesli warning prekladace - // pro funkce bez navratove hodnoty, udelame nasledujici opicarnu + // the return value is in eax to avoid a compiler warning + // for functions without a return value, use the following hack BOOL retVal; __asm {mov retVal, eax} return retVal; @@ -377,9 +378,9 @@ int MemICmp(const void* buf1, const void* buf2, int n) //***************************************************************************** #ifdef _WIN64 -// Ani ve VC11 MS nedodali x64 ASM verze stringovych operaci, takze zatim take zustavame v C++ +// Even in VC11, MS did not provide x64 ASM versions of the string operations, so for now we stay with C++. -// puvodni funkce +// original function int StrICmpEx(const char* s1, int l1, const char* s2, int l2) { int res, l = (l1 < l2) ? l1 : l2; @@ -466,8 +467,8 @@ int StrICmpEx(const char* s1, int l1, const char* s2, int l2) toend: mov eax,ecx // move return value to eax } - // navratova hodnota je v eax, abychom obesli warning prekladace - // pro funkce bez navratove hodnoty, udelame nasledujici opicarnu + // the return value is in eax to avoid a compiler warning + // for functions without a return value, use the following hack BOOL retVal; __asm {mov retVal, eax} if (retVal != 0) return retVal; @@ -498,7 +499,7 @@ int StrCmpEx(const char *s1, int l1, const char *s2, int l2) } */ -// rychlejsi varianta +// faster variant int StrCmpEx(const char* s1, int l1, const char* s2, int l2) { int l = (l1 < l2) ? l1 : l2; @@ -566,7 +567,7 @@ int StrLen(const char *str) while (1) { if ((((*(DWORD *)s) & 0xF0F0F0F0) - 0x10101010) & 0x8F0F0F0F) - { // je tam znak < 16 + { // contains a character < 16 if (*s != 0) s++; else break; if (*s != 0) s++; From aef809efb74f49b907835b0b82c85309b800c7ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:27:35 +0200 Subject: [PATCH 234/710] [translation] Fix src/common/str.h comments (#607) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/common/str.h | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/common/str.h b/src/common/str.h index 8aa76a078..dc64a630a 100644 --- a/src/common/str.h +++ b/src/common/str.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once @@ -19,8 +20,8 @@ // Funkce StrNICmp v C++ na Pentiu Pro beha rychleji nez v ASM varianta. // -extern BYTE LowerCase[256]; // premapovani vsech znaku na male; generovano pomoci API CharLower -extern BYTE UpperCase[256]; // premapovani vsech znaku na velke; generovano pomoci API CharUpper +extern BYTE LowerCase[256]; // maps all characters to lowercase; generated using the CharLower API +extern BYTE UpperCase[256]; // maps all characters to uppercase; generated using the CharUpper API //***************************************************************************** // @@ -142,30 +143,30 @@ int StrNICmp(const char* s1, const char* s2, int n); // int MemICmp(const void* buf1, const void* buf2, int n); -// rychlejsi strlen, jede po ctyrech znacich -// do str se saha po ctyrech bytech -> nutny vetsi buffer -// int StrLen(const char *str); // pouze 2 x rychlejsi, zbytecne riziko pristupu do nezarovnane pameti +// faster strlen; processes four characters at a time +// the string is accessed four bytes at a time -> requires a larger buffer +// int StrLen(const char *str); // only 2x faster; unnecessary risk of unaligned memory access -// nakopiruje text do nove naalokovaneho prostoru, NULL = malo pameti +// copies the text into newly allocated memory; returns NULL on out-of-memory char* DupStr(const char* txt); // nakopiruje text do nove naalokovaneho prostoru, NULL = malo pameti, // navic pri nedostatku pameti nastavi 'err' na TRUE char* DupStrEx(const char* str, BOOL& err); -// vraci prvni vyskyt 'pattern' v 'txt' nebo NULL, je case-insensitive +// returns the first case-insensitive occurrence of 'pattern' in 'txt', or NULL const char* StrIStr(const char* txt, const char* pattern); -// vraci prvni vyskyt 'pattern' v 'txt' nebo NULL, je case-insensitive +// returns the first case-insensitive occurrence of 'pattern' in 'txt', or NULL const char* StrIStr(const char* txtStart, const char* txtEnd, const char* patternStart, const char* patternEnd); -// pripoji retezec 'src' za retezec 'dest', ale neprekroci delku 'dstSize' -// retezec zakoncuje nulou, ktera spada do delky 'dstSize' -// vraci 'dst' +// appends 'src' to 'dst', but does not exceed 'dstSize' +// null-terminates the string within 'dstSize' +// returns 'dst' char* StrNCat(char* dst, const char* src, int dstSize); -// tento historicky kod uz nikdo nepouziva +// this legacy code is no longer used /* #define CONVERT_TAB_CHARS 44 #define CONVERT_TAB_MAX_CHARS 256 From 75c60e0af71dc817f99b1f47d57701c3111b0cba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:27:42 +0200 Subject: [PATCH 235/710] [translation] Fix src/common/trace.h comments (#608) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/common/trace.h | 113 +++++++++++++++++++++++---------------------- 1 file changed, 57 insertions(+), 56 deletions(-) diff --git a/src/common/trace.h b/src/common/trace.h index 4205bad02..456a77983 100644 --- a/src/common/trace.h +++ b/src/common/trace.h @@ -1,17 +1,18 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once -// makro TRACE_ENABLE - zapoji vypis hlasek na server -// makro MULTITHREADED_TRACE_ENABLE - zapoji premapovavani TID na UTID -// makro TRACE_TO_FILE - zapoji vypis hlasek do souboru v TEMPu (vyzaduje definici TRACE_ENABLE) -// makro TRACE_IGNORE_AUTOCLEAR - zakaze Trace Serveru pri pripojeni tohoto procesu smazat vsechny zpravy, -// i kdyz to ma zaple v nastaveni (hodi se pro utilitky spoustene za behu -// hlavniho programu, u kterych je mazani zprav nezadouci) -// makro __TRACESERVER - includeno z trace-serveru +// macro TRACE_ENABLE - enables sending messages to the server +// macro MULTITHREADED_TRACE_ENABLE - enables remapping TID to UTID +// macro TRACE_TO_FILE - enables writing messages to a file in TEMP (requires TRACE_ENABLE to be defined) +// macro TRACE_IGNORE_AUTOCLEAR - prevents Trace Server from clearing all messages when this process connects, +// even if that is enabled in the settings (useful for utilities started while the main +// program is running, where clearing messages is undesirable) +// macro __TRACESERVER - included from trace-server -// modul TRACE je pripraven na multi-threadove aplikace +// TRACE module is ready for multi-threaded applications // POZOR: TRACE_C se nesmi pouzivat v DllMain knihoven, ani v zadnem kodu, ktery // se z DllMainu vola, jinak dojde k deadlocku, vice viz implementace @@ -21,25 +22,25 @@ enum C__MessageType { - // druh message + // message type __mtInformation, __mtError, - // nastaveni nazvu procesu / threadu + // setting the process / thread name __mtSetProcessName, __mtSetThreadName, - // druh message - unicodove varianty zprav + // message type - Unicode message variants __mtInformationW, __mtErrorW, - // nastaveni nazvu procesu / threadu - unicodove varianty zprav + // setting the process / thread name - Unicode message variants __mtSetProcessNameW, __mtSetThreadNameW, - // zakazeme Trace Serveru pri pripojeni tohoto procesu smazat vsechny zpravy, i kdyz to ma - // zaple v nastaveni (hodi se pro utilitky spoustene za behu hlavniho programu, u kterych je - // mazani zprav nezadouci) + // prevents Trace Server from clearing all messages when this process connects, even if that is + // enabled in the settings (useful for utilities started while the main program is running, where + // clearing messages is undesirable) __mtIgnoreAutoClear, }; @@ -357,7 +358,7 @@ extern const TCHAR* __OPEN_CONNECTION_MUTEX; extern const TCHAR* __CONNECT_DATA_READY_EVENT_NAME; extern const TCHAR* __CONNECT_DATA_ACCEPTED_EVENT_NAME; -#define __PIPE_SIZE 100 // maximum dat v pipe (v kB) +#define __PIPE_SIZE 100 // maximum data in the pipe (in kB) #define __COMMUNICATION_WAIT_TIMEOUT 5000 //**************************************************************************** @@ -382,43 +383,43 @@ struct C__ClientServerInitData // // pomoci teto struktury komunikuje client se serverem pres pipu -// Pro Type == __mtInformation || Type == __mtError -// maji promenne tyto vyznamy: +// For Type == __mtInformation || Type == __mtError +// the variables have the following meanings: struct C__PipeDataHeader { - int Type; // typ zpravy (C__MessageType) - DWORD ThreadID; // pro upresneni jeste ID threadu + int Type; // message type (C__MessageType) + DWORD ThreadID; // thread ID for additional identification DWORD UniqueThreadID; // unikatni cislo threadu (systemove ID se opakuji) - SYSTEMTIME Time; // cas vzniku message - DWORD MessageSize; // delka bufferu potrebneho pro prijem textu - DWORD MessageTextOffset; // offset textu ve spolecnem bufferu s filem - DWORD Line; // cislo radky - double Counter; // presne pocitadlo v ms + SYSTEMTIME Time; // message creation time + DWORD MessageSize; // length of the buffer needed to receive the text + DWORD MessageTextOffset; // offset of the text in the buffer shared with the file name + DWORD Line; // line number + double Counter; // high-resolution counter in ms }; #define __SIZEOF_PIPEDATAHEADER 48 -// Pro Type == __mtSetProcessName -// C__MessageType Type; // typ zpravy -// DWORD MessageSize // delka bufferu potrebneho pro prijem nazvu +// For Type == __mtSetProcessName +// C__MessageType Type; // message type +// DWORD MessageSize // length of the buffer needed to receive the name // Pro Type == __mtSetThreadName -// C__MessageType Type; // typ zpravy +// C__MessageType Type; // message type // DWORD UniqueThreadID; // Unique Thread ID -// DWORD MessageSize // delka bufferu potrebneho pro prijem nazvu +// DWORD MessageSize // length of the buffer needed to receive the name // Pro Type == __mtIgnoreAutoClear -// C__MessageType Type; // typ zpravy +// C__MessageType Type; // message type // DWORD ThreadID; // 0 = neignorovat, 1 = ignorovat auto-clear na Trace Serveru -// aktualni verze clientu (porovnava se s verzi serveru) +// current client version (compared with the server version) #define TRACE_CLIENT_VERSION 7 #endif // defined(__TRACESERVER) || defined(TRACE_ENABLE) #ifndef TRACE_ENABLE -// aby nedochazelo k problemum se stredniky v nize nadefinovanych makrech +// to avoid problems with semicolons in the macros defined below inline void __TraceEmptyFunction() {} #define TRACE_MI(file, line, str) __TraceEmptyFunction() @@ -479,7 +480,7 @@ uintptr_t __TRACE_beginthreadex(void* security, unsigned stack_size, #endif // MULTITHREADED_TRACE_ENABLE -// info-trace, manualne zadana pozice v souboru +// info-trace, manually specified file position #define TRACE_MI(file, line, str) \ (::EnterCriticalSection(&__Trace.CriticalSection), __Trace.StoreLastError(), \ __Trace.OStream() << str, __Trace) \ @@ -502,7 +503,7 @@ uintptr_t __TRACE_beginthreadex(void* security, unsigned stack_size, #define TRACE_W(str) TRACE_I(str) #define TRACE_WW(str) TRACE_IW(str) -// error-trace, manualne zadana pozice v souboru +// error-trace, manually specified file position #define TRACE_ME(file, line, str) \ (::EnterCriticalSection(&__Trace.CriticalSection), __Trace.StoreLastError(), \ __Trace.OStream() << str, __Trace) \ @@ -521,15 +522,15 @@ uintptr_t __TRACE_beginthreadex(void* security, unsigned stack_size, #define TRACE_E(str) TRACE_ME(__FILE__, __LINE__, str) #define TRACE_EW(str) TRACE_MEW(__WFILE__, __LINE__, str) -// fatal-error-trace (CRASHING TRACE), manualne zadana pozice v souboru; -// zastavime soft v debuggeru, pro snadne odladeni problemu, ktery prave vznikl, -// release verze spadne a problem snad bude jasny z call-stacku v bug-reportu; -// nepouzivame DebugBreak(), protoze pri crashi softu nejde vystopovat, kde -// lezi volani DebugBreak(), protoze adresa exceptiony je kdesi v ntdll.dll -// a sekce Stack Back Trace bug reportu muze obsahovat nesmysly, pokud -// funkce, ze ktere volame TRACE_C/MC, nepouziva stary jednoduchy model ukladani -// a prace s EBP/ESP (to zalezi na kompileru a zaplych optimalizacich), proto -// aspon prozatim pouzivame stary primitivni zpusob crashe zapisem na NULL +// fatal-error-trace (CRASHING TRACE), manually specified file position; +// stop the program in the debugger to simplify debugging of the problem that just occurred; +// the release build crashes and the problem will hopefully be clear from the call stack in the bug report; +// we do not use DebugBreak(), because when the program crashes it is impossible to trace where +// DebugBreak() was called: the exception address ends up somewhere in ntdll.dll, +// and the Stack Back Trace section of the bug report may contain nonsense if +// the function from which TRACE_C/MC is called does not use the old simple model for +// saving and using EBP/ESP (depending on the compiler and enabled optimizations), so +// at least for now we use the old primitive way of crashing by writing to NULL #define TRACE_MC(file, line, str) \ ((::EnterCriticalSection(&__Trace.CriticalSection), __Trace.StoreLastError(), \ __Trace.OStream() << str, __Trace) \ @@ -587,7 +588,7 @@ class C__TraceThreadCache int UniqueThreadID; DWORD CacheTID[__TRACE_CACHE_SIZE]; - DWORD CacheUID[__TRACE_CACHE_SIZE]; // hodnota -1 -> invalidni zaznam + DWORD CacheUID[__TRACE_CACHE_SIZE]; // value -1 -> invalid record public: C__TraceThreadCache(); @@ -613,29 +614,29 @@ class C__Trace #endif // MULTITHREADED_TRACE_ENABLE protected: - HANDLE HWritePipe; // zapisovy konec pipe - HANDLE HPipeSemaphore; // slouzi pro alokaci mista v pipe (1x wait = 1kB) - DWORD BytesAllocatedForWriteToPipe; // kolik mista pro zapis je prave naalokovano v pipe + HANDLE HWritePipe; // write end of the pipe + HANDLE HPipeSemaphore; // used to allocate space in the pipe (1x wait = 1 kB) + DWORD BytesAllocatedForWriteToPipe; // amount of write space currently allocated in the pipe #ifdef TRACE_TO_FILE - HANDLE HTraceFile; // soubor otevreny pro zapis v TEMPu, ukladaji se do nej vsechny message + HANDLE HTraceFile; // file opened for writing in TEMP; all messages are stored there #ifdef __TRACESERVER - WCHAR TraceFileName[MAX_PATH]; // jmeno souboru HTraceFile + WCHAR TraceFileName[MAX_PATH]; // HTraceFile file name #endif // __TRACESERVER #endif // TRACE_TO_FILE - LARGE_INTEGER StartPerformanceCounter; // pro presny counter - uvodni hodnota - LARGE_INTEGER PerformanceFrequency; // pro presny counter + LARGE_INTEGER StartPerformanceCounter; // initial value of the high-resolution counter + LARGE_INTEGER PerformanceFrequency; // high-resolution counter frequency BOOL SupportPerformanceFrequency; - const char* File; // pomocne promenne pro predani jmena souboru (ANSI) - const WCHAR* FileW; // pomocne promenne pro predani jmena souboru (unicode) - int Line; // a cisla radku, odkud se vola TRACE_X() + const char* File; // helper variables for passing the file name (ANSI) + const WCHAR* FileW; // helper variables for passing the file name (Unicode) + int Line; // and the line number from which TRACE_X() is called C__StringStreamBuf TraceStringBuf; // string buffer drzici data trace streamu (ANSI) C__StringStreamBufW TraceStringBufW; // string buffer drzici data trace streamu (unicode) C__TraceStream TraceStrStream; // vlastni trace stream (ANSI) C__TraceStreamW TraceStrStreamW; // vlastni trace stream (unicode) - DWORD StoredLastError; // GetLastError() pred TRACE_? makrem + DWORD StoredLastError; // GetLastError() value before the TRACE_? macro public: C__Trace(); From b9a3cc8ad644f60f9c08f2e41089c497af3d4487 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:27:48 +0200 Subject: [PATCH 236/710] [translation] Fix src/common/strutils.cpp comments (#609) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/common/strutils.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/common/strutils.cpp b/src/common/strutils.cpp index e197337c9..c2778924f 100644 --- a/src/common/strutils.cpp +++ b/src/common/strutils.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -32,23 +33,23 @@ int ConvertU2A(const WCHAR* src, int srcLen, char* buf, int bufSize, BOOL compos int res = WideCharToMultiByte(codepage, compositeCheck ? WC_COMPOSITECHECK : 0, src, srcLen, buf, bufSize, NULL, NULL); if (srcLen != -1 && res > 0) res++; - if (compositeCheck && res == 0 && GetLastError() != ERROR_INSUFFICIENT_BUFFER) // nektere codepage nepodporuji WC_COMPOSITECHECK + if (compositeCheck && res == 0 && GetLastError() != ERROR_INSUFFICIENT_BUFFER) // some code pages do not support WC_COMPOSITECHECK { res = WideCharToMultiByte(codepage, 0, src, srcLen, buf, bufSize, NULL, NULL); if (srcLen != -1 && res > 0) res++; } if (res > 0 && res <= bufSize) - buf[res - 1] = 0; // uspech, zakoncime string nulou + buf[res - 1] = 0; // success, null-terminate the string else { if (res > bufSize || res == 0 && GetLastError() == ERROR_INSUFFICIENT_BUFFER) { SetLastError(ERROR_INSUFFICIENT_BUFFER); - buf[bufSize - 1] = 0; // maly buffer, vratime chybu, ale castecne prelozeny string nechame v bufferu + buf[bufSize - 1] = 0; // buffer too small: return an error, but leave the partially converted string in the buffer } else - buf[0] = 0; // jina chyba, zajistime prazdny buffer + buf[0] = 0; // other error: ensure the buffer is empty res = 0; } return res; @@ -85,7 +86,7 @@ char* ConvertAllocU2A(const WCHAR* src, int srcLen, BOOL compositeCheck, UINT co int len = WideCharToMultiByte(codepage, flags = (compositeCheck ? WC_COMPOSITECHECK : 0), src, srcLen, NULL, 0, NULL, NULL); if (srcLen != -1 && len > 0) len++; - if (compositeCheck && len == 0) // nektere codepage nepodporuji WC_COMPOSITECHECK + if (compositeCheck && len == 0) // some code pages do not support WC_COMPOSITECHECK { len = WideCharToMultiByte(codepage, flags = 0, src, srcLen, NULL, 0, NULL, NULL); if (srcLen != -1 && len > 0) @@ -104,7 +105,7 @@ char* ConvertAllocU2A(const WCHAR* src, int srcLen, BOOL compositeCheck, UINT co if (srcLen != -1 && res > 0) res++; if (res > 0 && res <= len) - txt[res - 1] = 0; // uspech, zakoncime string nulou + txt[res - 1] = 0; // success, null-terminate the string else { DWORD err = GetLastError(); @@ -142,16 +143,16 @@ int ConvertA2U(const char* src, int srcLen, WCHAR* buf, int bufSizeInChars, UINT if (srcLen != -1 && res > 0) res++; if (res > 0 && res <= bufSizeInChars) - buf[res - 1] = 0; // uspech, zakoncime string nulou + buf[res - 1] = 0; // success, null-terminate the string else { if (res > bufSizeInChars || res == 0 && GetLastError() == ERROR_INSUFFICIENT_BUFFER) { SetLastError(ERROR_INSUFFICIENT_BUFFER); - buf[bufSizeInChars - 1] = 0; // maly buffer, vratime chybu, ale castecne prelozeny string nechame v bufferu + buf[bufSizeInChars - 1] = 0; // buffer too small: return an error, but leave the partially converted string in the buffer } else - buf[0] = 0; // jina chyba, zajistime prazdny buffer + buf[0] = 0; // other error: ensure the buffer is empty res = 0; } return res; @@ -200,7 +201,7 @@ WCHAR* ConvertAllocA2U(const char* src, int srcLen, UINT codepage) if (srcLen != -1 && res > 0) res++; if (res > 0 && res <= len) - txt[res - 1] = 0; // uspech, zakoncime string nulou + txt[res - 1] = 0; // success, null-terminate the string else { DWORD err = GetLastError(); From 1820e36af27a3c1299c7fe847a728b6058539178 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:27:55 +0200 Subject: [PATCH 237/710] [translation] Fix src/common/strutils.h comments (#610) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/common/strutils.h | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/common/strutils.h b/src/common/strutils.h index c983d798b..ae9da8615 100644 --- a/src/common/strutils.h +++ b/src/common/strutils.h @@ -1,9 +1,10 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once -// makro SAFE_ALLOC odstranuje kod, ve kterem se testuje, jestli se povedla alokace pameti (viz allochan.*) +// The SAFE_ALLOC macro removes the code that checks whether memory allocation succeeded (see allochan.*) // prevod Unicodoveho stringu (UTF-16) na ANSI multibytovy string; 'src' je Unicodovy string; // 'srcLen' je delka Unicodoveho stringu (bez zakoncujici nuly; pri zadani -1 se delka urci @@ -26,13 +27,13 @@ int ConvertU2A(const WCHAR* src, int srcLen, char* buf, int bufSize, // ANSI string; pri chybe vraci NULL (detaily viz GetLastError()) char* ConvertAllocU2A(const WCHAR* src, int srcLen, BOOL compositeCheck = FALSE, UINT codepage = CP_ACP); -// prevod ANSI multibytoveho stringu na Unicodovy string (UTF-16); 'src' je ANSI string; -// 'srcLen' je delka ANSI stringu (bez zakoncujici nuly; pri zadani -1 se delka urci -// podle zakoncujici nuly); 'bufSize' (musi byt vetsi nez 0) je velikost ciloveho bufferu -// 'buf' pro Unicodovy string; 'codepage' je kodova stranka ANSI stringu; -// vraci pocet znaku zapsanych do 'buf' (vcetne zakoncujici nuly); pri chybe vraci nulu -// (detaily viz GetLastError()); vzdy zajisti nulou zakonceny 'buf' (i pri chybe); -// je-li 'buf' maly, vraci funkce nulu, ale v 'buf' je prevedena aspon cast stringu +// Converts an ANSI multibyte string to a Unicode (UTF-16) string; 'src' is the ANSI string; +// 'srcLen' is the length of the ANSI string (excluding the terminating null; if -1 is passed, +// the length is determined from the terminating null); 'bufSize' (must be greater than 0) is the size of the destination buffer +// 'buf' for the Unicode string; 'codepage' is the code page of the ANSI string; +// returns the number of characters written to 'buf' (including the terminating null); on error returns 0 +// (see GetLastError()); always ensures 'buf' is null-terminated (even on error); +// if 'buf' is too small, the function returns 0, but at least part of the string is converted into 'buf' int ConvertA2U(const char* src, int srcLen, WCHAR* buf, int bufSizeInChars, UINT codepage = CP_ACP); @@ -47,8 +48,8 @@ WCHAR* ConvertAllocA2U(const char* src, int srcLen, UINT codepage = CP_ACP); // se nepouziva allochan.*) nebo 'txt'==NULL WCHAR* DupStr(const WCHAR* txt); -// drzi ukazatel na alokovanou pamet, postara se o jeji uvolneni pri prepisu jinym ukazatelem na -// alokovanou pamet a pri sve destrukci +// Holds a pointer to allocated memory and frees it when overwritten by another pointer to allocated memory +// and when destroyed template class CAllocP { @@ -79,6 +80,6 @@ class CAllocP } }; -// drzi alokovany string, postara se o uvolneni pri prepisu jinym stringem (tez alokovanym) -// a pri sve destrukci +// Holds an allocated string and frees it when overwritten by another allocated string +// and when destroyed typedef CAllocP CStrP; From cb797c00d80665877a1a994b9f672d02eb29b80f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:28:01 +0200 Subject: [PATCH 238/710] [translation] Fix src/common/winlib.cpp comments (#611) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/common/winlib.cpp | 133 +++++++++++++++++++++--------------------- 1 file changed, 67 insertions(+), 66 deletions(-) diff --git a/src/common/winlib.cpp b/src/common/winlib.cpp index aeceb3471..970d01eb4 100644 --- a/src/common/winlib.cpp +++ b/src/common/winlib.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -8,7 +9,7 @@ #include #include #include -#include // potrebuju LPCOLORMAP +#include // need LPCOLORMAP #include #if defined(_DEBUG) && defined(_MSC_VER) // without passing file+line to 'new' operator, list of memory leaks shows only 'crtdbg.h(552)' @@ -25,23 +26,23 @@ #include "winlib.h" -// opatreni proti runtime check failure v debug verzi: puvodni verze makra pretypovava rgb na WORD, -// takze hlasi ztratu dat (RED slozky) +// workaround for a runtime check failure in the debug build: the original macro casts rgb to WORD, +// so it reports data loss (the RED component) #undef GetGValue #define GetGValue(rgb) ((BYTE)(((rgb) >> 8) & 0xFF)) const TCHAR* CWINDOW_CLASSNAME = _T("WinLib Universal Window"); -const TCHAR* CWINDOW_CLASSNAME2 = _T("WinLib Universal Window2"); // nema CS_VREDRAW | CS_HREDRAW +const TCHAR* CWINDOW_CLASSNAME2 = _T("WinLib Universal Window2"); // does not have CS_VREDRAW | CS_HREDRAW #ifndef _UNICODE const WCHAR* CWINDOW_CLASSNAMEW = L"WinLib Universal Window Unicode"; -const WCHAR* CWINDOW_CLASSNAME2W = L"WinLib Universal Window Unicode2"; // nema CS_VREDRAW | CS_HREDRAW +const WCHAR* CWINDOW_CLASSNAME2W = L"WinLib Universal Window Unicode2"; // does not have CS_VREDRAW | CS_HREDRAW #endif // _UNICODE CWinLibHelp* WinLibHelp = NULL; CWindowsManager WindowsManager; HINSTANCE HInstance = NULL; -BOOL WinLibReleased = FALSE; // TRUE = uz se volalo ReleaseWinLib() +BOOL WinLibReleased = FALSE; // TRUE = ReleaseWinLib() has already been called TCHAR WinLibStrings[WLS_COUNT][101] = { _T("Invalid number!"), @@ -71,7 +72,7 @@ BOOL InitializeWinLib() void ReleaseWinLib() { - // musime odpojit otevrena okna od WinLibu, protoze WinLib konci ... + // we must detach open windows from WinLib because WinLib is shutting down ... int c = WindowsManager.GetCount(); if (c > 0) TRACE_ET(_T("ReleaseWinLib(): WindowsManager still contains opened windows: ") << c); @@ -102,7 +103,7 @@ BOOL WinLibIsWindowsVersionOrGreater(WORD wMajorVersion, WORD wMinorVersion, WOR VER_MINORVERSION, VER_GREATER_EQUAL), VER_SERVICEPACKMAJOR, VER_GREATER_EQUAL); - SecureZeroMemory(&osvi, sizeof(osvi)); // nahrada za memset (nevyzaduje RTLko) + SecureZeroMemory(&osvi, sizeof(osvi)); // replacement for memset (does not require the RTL) osvi.dwOSVersionInfoSize = sizeof(osvi); osvi.dwMajorVersion = wMajorVersion; osvi.dwMinorVersion = wMinorVersion; @@ -128,7 +129,7 @@ HWND CWindow::CreateEx(DWORD dwExStyle, // extended window style HWND hwndParent, // handle of parent or owner window HMENU hmenu, // handle of menu or child-window identifier HINSTANCE hinst, // handle of application instance - LPVOID lpvParam) // ukazatel na objekt vytvareneho okna + LPVOID lpvParam) // pointer to the created window object { HWND hWnd = CreateWindowEx(dwExStyle, lpszClassName, @@ -144,8 +145,8 @@ HWND CWindow::CreateEx(DWORD dwExStyle, // extended window style lpvParam); if (hWnd != 0) { - if (WindowsManager.GetWindowPtr(hWnd) == NULL) // pokud se jeste neni ve WindowsManageru - AttachToWindow(hWnd); // tak ho pridame -> subclassing + if (WindowsManager.GetWindowPtr(hWnd) == NULL) // if it is not in WindowsManager yet + AttachToWindow(hWnd); // then add it -> subclassing } return hWnd; } @@ -160,7 +161,7 @@ HWND CWindow::Create(LPCTSTR lpszClassName, // address of registered class name HWND hwndParent, // handle of parent or owner window HMENU hmenu, // handle of menu or child-window identifier HINSTANCE hinst, // handle of application instance - LPVOID lpvParam) // ukazatel na objekt vytvareneho okna + LPVOID lpvParam) // pointer to the created window object { return CreateEx(0, lpszClassName, @@ -189,7 +190,7 @@ HWND CWindow::CreateExW(DWORD dwExStyle, // extended window style HWND hwndParent, // handle of parent or owner window HMENU hmenu, // handle of menu or child-window identifier HINSTANCE hinst, // handle of application instance - LPVOID lpvParam) // ukazatel na objekt vytvareneho okna + LPVOID lpvParam) // pointer to the created window object { HWND hWnd = CreateWindowExW(dwExStyle, lpszClassName, @@ -205,8 +206,8 @@ HWND CWindow::CreateExW(DWORD dwExStyle, // extended window style lpvParam); if (hWnd != 0) { - if (WindowsManager.GetWindowPtr(hWnd) == NULL) // pokud se jeste neni ve WindowsManageru - AttachToWindow(hWnd); // tak ho pridame -> subclassing + if (WindowsManager.GetWindowPtr(hWnd) == NULL) // if it is not in WindowsManager yet + AttachToWindow(hWnd); // then add it -> subclassing } return hWnd; } @@ -221,7 +222,7 @@ HWND CWindow::CreateW(LPCWSTR lpszClassName, // address of registered class nam HWND hwndParent, // handle of parent or owner window HMENU hmenu, // handle of menu or child-window identifier HINSTANCE hinst, // handle of application instance - LPVOID lpvParam) // ukazatel na objekt vytvareneho okna + LPVOID lpvParam) // pointer to the created window object { return CreateExW(0, lpszClassName, @@ -275,7 +276,7 @@ void CWindow::AttachToWindow(HWND hWnd) #ifndef _UNICODE || DefWndProc == CWindow::CWindowProcW #endif // _UNICODE - ) // to by byla rekurze + ) // that would be recursion { TRACE_CT(_T("This should never happen.")); DefWndProc = GetDefWindowProc(); @@ -329,7 +330,7 @@ CWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) } if (GetWindowLongPtr(HWindow, GWL_STYLE) & WS_CHILD) break; // pokud F1 nezpracujeme a pokud je to child okno, nechame F1 propadnout do parenta - return TRUE; // pokud to neni child, ukoncime zpracovani F1 + return TRUE; // if it is not a child, stop processing F1 } } #ifndef _UNICODE @@ -363,11 +364,11 @@ CWindow::CWindowProcInt(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL CWindow* wnd; switch (uMsg) { - case WM_CREATE: // prvni zprava - pripojeni objektu k oknu + case WM_CREATE: // first message - attach the object to the window { - // osetrim MDI_CHILD_WINDOW - if (((CREATESTRUCT*)lParam)->dwExStyle & WS_EX_MDICHILD) // CREATESTRUCTA a CREATESTRUCTW se pro dwExStyle ani lpCreateParams nelisi - wnd = (CWindow*)((MDICREATESTRUCT*)((CREATESTRUCT*)lParam)->lpCreateParams)->lParam; // MDICREATESTRUCTA a MDICREATESTRUCTW se pro lParam nelisi + // handle MDI_CHILD_WINDOW + if (((CREATESTRUCT*)lParam)->dwExStyle & WS_EX_MDICHILD) // CREATESTRUCTA and CREATESTRUCTW do not differ in dwExStyle or lpCreateParams + wnd = (CWindow*)((MDICREATESTRUCT*)((CREATESTRUCT*)lParam)->lpCreateParams)->lParam; // MDICREATESTRUCTA and MDICREATESTRUCTW do not differ in lParam else wnd = (CWindow*)((CREATESTRUCT*)lParam)->lpCreateParams; if (wnd == NULL) @@ -382,8 +383,8 @@ CWindow::CWindowProcInt(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL if (wnd->UnicodeWnd != unicode) TRACE_C("Incompatible windows procedure."); #endif // _UNICODE - //--- zarazeni okna podle hwnd do seznamu oken - if (!WindowsManager.AddWindow(hwnd, wnd)) // chyba + //--- insert the window into the window list by hwnd + if (!WindowsManager.AddWindow(hwnd, wnd)) // error { TRACE_ET(_T("Unable to create window.")); return FALSE; @@ -392,7 +393,7 @@ CWindow::CWindowProcInt(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL break; } - case WM_DESTROY: // posledni zprava - odpojeni objektu od okna + case WM_DESTROY: // last message - detach the object from the window { wnd = (CWindow*)WindowsManager.GetWindowPtr(hwnd); #ifndef _UNICODE @@ -407,7 +408,7 @@ CWindow::CWindowProcInt(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL LRESULT res = wnd->WindowProc(uMsg, wParam, lParam); - // ted uz zase do stare procedury (kvuli subclassingu) + // now back to the old procedure again (because of subclassing) WindowsManager.DetachWindow(hwnd); // pokud aktualni WndProc je jina nez nase, nebudeme ji menit, @@ -417,7 +418,7 @@ CWindow::CWindowProcInt(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL if (currentWndProc == CWindow::CWindowProc) SetWindowLongPtr(wnd->HWindow, GWLP_WNDPROC, (LONG_PTR)wnd->DefWndProc); #else // _UNICODE - if (wnd->UnicodeWnd) // je-li nase window procedura unicodova, musime pouzit "W" varianty API funkci + if (wnd->UnicodeWnd) // if our window procedure is Unicode, we must use the "W" API variants { WNDPROC currentWndProc = (WNDPROC)GetWindowLongPtrW(wnd->HWindow, GWLP_WNDPROC); if (currentWndProc == CWindow::CWindowProcW || currentWndProc == CWindow::CWindowProc) @@ -434,9 +435,9 @@ CWindow::CWindowProcInt(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL if (wnd->IsAllocated()) delete wnd; else - wnd->HWindow = NULL; // uz neni pripojeny + wnd->HWindow = NULL; // no longer attached if (res == 0) - return 0; // aplikace ji zpracovala + return 0; // the application handled the message wnd = NULL; } break; @@ -458,11 +459,11 @@ CWindow::CWindowProcInt(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL #endif // _UNICODE } } - //--- zavolani metody WindowProc(...) prislusneho objektu okna + //--- call the WindowProc(...) method of the corresponding window object LRESULT lResult; if (wnd != NULL) lResult = wnd->WindowProc(uMsg, wParam, lParam); - else // chyba nebo message prisla pred WM_CREATE + else // error or the message arrived before WM_CREATE { #ifndef _UNICODE lResult = unicode ? DefWindowProcW(hwnd, uMsg, wParam, lParam) : DefWindowProcA(hwnd, uMsg, wParam, lParam); @@ -639,7 +640,7 @@ CDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_INITDIALOG: { TransferData(ttDataToWindow); - return TRUE; // chci focus od DefDlgProc + return TRUE; // let DefDlgProc set the focus } case WM_HELP: @@ -650,7 +651,7 @@ CDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) (GetKeyState(VK_CONTROL) & 0x8000) != 0, (GetKeyState(VK_SHIFT) & 0x8000) != 0); } - return TRUE; // F1 nenechame propadnout do parenta ani pokud nevolame WinLibHelp->OnHelp() + return TRUE; // do not let F1 fall through to the parent even if we do not call WinLibHelp->OnHelp() } case WM_CONTEXTMENU: @@ -672,7 +673,7 @@ CDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) memset(&hi, 0, sizeof(hi)); hi.cbSize = sizeof(hi); hi.iContextType = HELPINFO_WINDOW; - hi.dwContextId = ResID; // ve WM_HELP taky chodi ResID a ne HelpID, tak at je to konzistentni + hi.dwContextId = ResID; // WM_HELP also receives ResID rather than HelpID, so keep it consistent GetCursorPos(&hi.MousePos); WinLibHelp->OnHelp(HWindow, HelpID, &hi, FALSE, FALSE); } @@ -706,7 +707,7 @@ CDialog::CDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) CDialog* dlg; switch (uMsg) { - case WM_INITDIALOG: // prvni zprava - pripojeni objektu k dialogu + case WM_INITDIALOG: // first message - attach the object to the dialog { dlg = (CDialog*)lParam; if (dlg == NULL) @@ -717,21 +718,21 @@ CDialog::CDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) else { dlg->HWindow = hwndDlg; - //--- zarazeni okna podle hwndDlg do seznamu oken - if (!WindowsManager.AddWindow(hwndDlg, dlg)) // chyba + //--- insert the dialog into the window list by hwndDlg + if (!WindowsManager.AddWindow(hwndDlg, dlg)) // error { TRACE_ET(_T("Unable to create dialog.")); return TRUE; } - dlg->NotifDlgJustCreated(); // zavedeno jako misto pro upravu layoutu dialogu + dlg->NotifDlgJustCreated(); // introduced as a place to adjust the dialog layout } break; } - case WM_DESTROY: // posledni zprava - odpojeni objektu od dialogu + case WM_DESTROY: // last message - detach the object from the dialog { dlg = (CDialog*)WindowsManager.GetWindowPtr(hwndDlg); - INT_PTR ret = FALSE; // pro pripad, ze ji nezpracuje + INT_PTR ret = FALSE; // in case the dialog does not handle it if (dlg != NULL && dlg->Is(otDialog)) { // Petr: posunul jsem dolu pod dlg->DialogProc(), aby behem WM_DESTROY @@ -744,7 +745,7 @@ CDialog::CDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) if (dlg->IsAllocated()) delete dlg; else - dlg->HWindow = NULL; // informace o odpojeni + dlg->HWindow = NULL; // detachment information } return ret; } @@ -761,12 +762,12 @@ CDialog::CDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) #endif } } - //--- zavolani metody DialogProc(...) prislusneho objektu dialogu + //--- call the DialogProc(...) method of the corresponding dialog object INT_PTR dlgRes; if (dlg != NULL) dlgRes = dlg->DialogProc(uMsg, wParam, lParam); else - dlgRes = FALSE; // chyba nebo message neprisla mezi WM_INITDIALOG a WM_DESTROY + dlgRes = FALSE; // error or the message did not arrive between WM_INITDIALOG and WM_DESTROY return dlgRes; } @@ -835,7 +836,7 @@ void CWindowsManager::DetachWindow(HWND hWnd) return; CS.Enter(); - if (LastHWnd[GetCacheIndex(hWnd)] == hWnd) // musime vycistit cache + if (LastHWnd[GetCacheIndex(hWnd)] == hWnd) // we must clear the cache { LastHWnd[GetCacheIndex(hWnd)] = NULL; LastWnd[GetCacheIndex(hWnd)] = NULL; @@ -877,7 +878,7 @@ CWindowsManager::GetWindowPtr(HWND hWnd) search++; #endif int i; - if (GetIndex(hWnd, i)) // nalezeno + if (GetIndex(hWnd, i)) // found { LastHWnd[GetCacheIndex(hWnd)] = hWnd; LastWnd[GetCacheIndex(hWnd)] = At(i).Wnd; @@ -888,7 +889,7 @@ CWindowsManager::GetWindowPtr(HWND hWnd) else { CS.Leave(); - return NULL; // nenalezeno + return NULL; // not found } } @@ -911,9 +912,9 @@ int CWindowsManager::GetCount() CWindowQueue::~CWindowQueue() { if (!Empty()) - TRACE_ET(_T("Some window is still opened in ") << QueueName << _T(" queue!")); // nemelo by nastat... - // tady uz multi-threadovost nehrozi (konci soft, thready jsou/byly ukonceny) - // dealokujeme aspon nejakou pamet + TRACE_ET(_T("Some window is still opened in ") << QueueName << _T(" queue!")); // should not happen... + // there is no multithreading risk here anymore (the app is shutting down, the threads are/were terminated) + // deallocate at least some memory CWindowQueueItem* last; CWindowQueueItem* item = Head; while (item != NULL) @@ -948,7 +949,7 @@ void CWindowQueue::Remove(HWND hWindow) CWindowQueueItem* item = Head; while (item != NULL) { - if (item->HWindow == hWindow) // nalezeno, odstranime + if (item->HWindow == hWindow) // found, remove it { if (last != NULL) last->Next = item->Next; @@ -1001,7 +1002,7 @@ void CWindowQueue::BroadcastMessage(DWORD uMsg, WPARAM wParam, LPARAM lParam) BOOL CTransferInfo::GetControl(HWND& ctrlHWnd, int ctrlID, BOOL ignoreIsGood) { if (!ignoreIsGood && !IsGood()) - return FALSE; // dalsi nema cenu zpracovavat + return FALSE; // no point in processing further ctrlHWnd = GetDlgItem(HDialog, ctrlID); if (ctrlHWnd == NULL) { @@ -1021,8 +1022,8 @@ void CTransferInfo::EnsureControlIsFocused(int ctrlID) HWND wnd = GetFocus(); while (wnd != NULL && wnd != ctrl) wnd = ::GetParent(wnd); - if (wnd == NULL) // fokusime jen pokud neni ctrl predek GetFocusu - { // jako napr. edit-line v combo-boxu + if (wnd == NULL) // set focus only if ctrl is not an ancestor of GetFocus() + { // for example, the edit box in a combo box SendMessage(HDialog, WM_NEXTDLGCTL, (WPARAM)ctrl, TRUE); } } @@ -1107,8 +1108,8 @@ void CTransferInfo::EditLine(int ctrlID, double& value, TCHAR* format, BOOL sele BOOL decPoints = FALSE; BOOL expPart = FALSE; if (*s == _T('-') || *s == _T('+')) - s++; // preskok znamenka - while (*s != 0) // prevod carky na tecku + s++; // skip the digit + while (*s != 0) // convert comma to dot { if (!expPart && !decPoints && (*s == _T(',') || *s == _T('.'))) { @@ -1121,7 +1122,7 @@ void CTransferInfo::EditLine(int ctrlID, double& value, TCHAR* format, BOOL sele { expPart = TRUE; if (*(s + 1) == _T('+') || *(s + 1) == _T('-')) - s++; // preskok +- za E + s++; // skip +/- after E } else { @@ -1142,7 +1143,7 @@ void CTransferInfo::EditLine(int ctrlID, double& value, TCHAR* format, BOOL sele value = _tcstod(buff, &stopString); // jen pokud je cislo } else - value = 0; // pri chybe dame nulu + value = 0; // on error, set zero break; } } @@ -1173,8 +1174,8 @@ void CTransferInfo::EditLine(int ctrlID, int& value, BOOL select) TCHAR* s = buff; if (*s == _T('-') || *s == _T('+')) - s++; // preskok znamenka - while (*s != 0) // kontrola cisla + s++; // skip the digit + while (*s != 0) // validate the number { if (*s < _T('0') || *s > _T('9')) { @@ -1187,7 +1188,7 @@ void CTransferInfo::EditLine(int ctrlID, int& value, BOOL select) } TCHAR* endptr; - value = _tcstoul(buff, &endptr, 10); // nahrada za atoi / _ttoi, ktere misto 4000000000 vraci 2147483647 (protoze je to SIGNED INT) + value = _tcstoul(buff, &endptr, 10); // replacement for atoi / _ttoi, which returns 2147483647 instead of 4000000000 (because it is SIGNED INT) break; } } @@ -1227,10 +1228,10 @@ void CTransferInfo::EditLine(int ctrlID, __int64& value, BOOL select, BOOL unsig TCHAR* s = buff; BOOL minus = !unsignedNum && *s == _T('-'); if (!unsignedNum && *s == _T('-') || *s == _T('+')) - s++; // preskok znamenka + s++; // skip the digit unsigned __int64 num = 0; BOOL overflow = FALSE; - while (*s != 0) // kontrola cisla + while (*s != 0) // validate the number { if ((*s < _T('0') || *s > _T('9')) && (!hexMode || *s < _T('A') || *s > _T('F'))) { @@ -1245,7 +1246,7 @@ void CTransferInfo::EditLine(int ctrlID, __int64& value, BOOL select, BOOL unsig else { if (hexMode && num > 0x0fffffffffffffffui64 || - !hexMode && num > 1844674407370955161ui64 || // max. je 18446744073709551615ui64 + !hexMode && num > 1844674407370955161ui64 || // max. is 18446744073709551615ui64 !hexMode && num == 1844674407370955161ui64 && *s > _T('5')) { overflow = TRUE; // unsigned overflow @@ -1257,11 +1258,11 @@ void CTransferInfo::EditLine(int ctrlID, __int64& value, BOOL select, BOOL unsig } if (*s != 0) { - value = 0; // pri chybe dame nulu + value = 0; // on error, set zero break; } - // pri preteceni davame mezni hodnoty (inspirace: value = _ttoi64(buff)) + // on overflow, use the limit values (inspired by value = _ttoi64(buff)) if (unsignedNum) { if (overflow) @@ -1294,7 +1295,7 @@ void CTransferInfo::EditLine(int ctrlID, __int64& value, BOOL select, BOOL unsig } if (overflow) { - if (ignoreOverflow) // ohlasime overflow jen pres TRACE_E + if (ignoreOverflow) // report overflow only via TRACE_E { TRACE_ET(_T("CTransferInfo::EditLine(") << ctrlID << _T("): ") << (unsignedNum ? _T("unsigned ") : _T("")) << _T("int64 overflow has occured!")); } From 65488baf3d8a384f4c608d19095a8ca5af4a2a22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:28:07 +0200 Subject: [PATCH 239/710] [translation] Fix src/common/trace.cpp comments (#612) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/common/trace.cpp | 238 +++++++++++++++++++++---------------------- 1 file changed, 119 insertions(+), 119 deletions(-) diff --git a/src/common/trace.cpp b/src/common/trace.cpp index c4aa31749..0c1ea52f1 100644 --- a/src/common/trace.cpp +++ b/src/common/trace.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -19,15 +20,15 @@ // boundaries so we can find the real functions // that we need to call for initialization. -#pragma warning(disable : 4075) // chceme definovat poradi inicializace modulu +#pragma warning(disable : 4075) // define the module initialization order typedef void(__cdecl* _PVFV)(void); #pragma section(".i_trc$a", read) -__declspec(allocate(".i_trc$a")) const _PVFV i_trace = (_PVFV)1; // na zacatek sekce .i_trc si dame promennou i_trace +__declspec(allocate(".i_trc$a")) const _PVFV i_trace = (_PVFV)1; // put the i_trace variable at the start of the .i_trc section #pragma section(".i_trc$z", read) -__declspec(allocate(".i_trc$z")) const _PVFV i_trace_end = (_PVFV)1; // a na konec sekce .i_trc si dame promennou i_trace_end +__declspec(allocate(".i_trc$z")) const _PVFV i_trace_end = (_PVFV)1; // put the i_trace_end variable at the end of the .i_trc section void Initialize__Trace() { @@ -161,25 +162,25 @@ BOOL C__TraceThreadCache::GetIndex(DWORD tid, int& index) { m = (l + r) / 2; DWORD hw = Data[m].TID; - if (hw == tid) // nalezeno + if (hw == tid) // found { index = m; return TRUE; } else if (hw > tid) { - if (l == r || l > m - 1) // nenalezeno + if (l == r || l > m - 1) // not found { - index = m; // mel by byt na teto pozici + index = m; // should be at this position return FALSE; } r = m - 1; } else { - if (l == r) // nenalezeno + if (l == r) // not found { - index = m + 1; // mel by byt az za touto pozici + index = m + 1; // should be after this position return FALSE; } l = m + 1; @@ -193,18 +194,18 @@ BOOL C__TraceThreadCache::Add(HANDLE handle, DWORD tid) BOOL found = GetIndex(tid, index); if (!found) { - if (Available == Count) // je plno, vyhazime mrtvy thready + if (Available == Count) // full, remove dead threads { DWORD code; for (int i = Count - 1; i >= 0; i--) { if (!GetExitCodeThread(Data[i].Handle, &code) || code != STILL_ACTIVE) { - DWORD id = Data[i].TID; // aktualizace cache: - if (CacheUID[__TraceCacheGetIndex(id)] != -1 && // platny zaznam - CacheTID[__TraceCacheGetIndex(id)] == id) // shodny TID + DWORD id = Data[i].TID; // cache update: + if (CacheUID[__TraceCacheGetIndex(id)] != -1 && // valid entry + CacheTID[__TraceCacheGetIndex(id)] == id) // matching TID { - CacheUID[__TraceCacheGetIndex(id)] = -1; // zneplatneni + CacheUID[__TraceCacheGetIndex(id)] = -1; // invalidate } CloseHandle(Data[i].Handle); @@ -219,7 +220,7 @@ BOOL C__TraceThreadCache::Add(HANDLE handle, DWORD tid) if (Available == Count && !EnlargeArray()) return FALSE; - Move(1, index, Count - index); // vlozime novy zaznam + Move(1, index, Count - index); // insert a new entry Data[index].Handle = handle; Data[index].TID = tid; Data[index].UID = UniqueThreadID; @@ -231,7 +232,7 @@ BOOL C__TraceThreadCache::Add(HANDLE handle, DWORD tid) Data[index].Handle = handle; Data[index].UID = UniqueThreadID; } - // aktualizace cache + // cache update CacheTID[__TraceCacheGetIndex(tid)] = tid; CacheUID[__TraceCacheGetIndex(tid)] = UniqueThreadID++; @@ -244,7 +245,7 @@ C__TraceThreadCache::GetUniqueThreadId(DWORD tid) if (CacheUID[__TraceCacheGetIndex(tid)] != -1 && // je-li platny zaznam CacheTID[__TraceCacheGetIndex(tid)] == tid) // a je-li shodny s tid { - return CacheUID[__TraceCacheGetIndex(tid)]; // uid je v cache + return CacheUID[__TraceCacheGetIndex(tid)]; // UID is in the cache } int index; @@ -255,7 +256,7 @@ C__TraceThreadCache::GetUniqueThreadId(DWORD tid) return Data[index].UID; } else - return -1; // nenalezeno -> to by se nemelo stat + return -1; // not found -> this should not happen } //***************************************************************************** @@ -371,20 +372,20 @@ CWStr::CWStr(const char* s) C__Trace::C__Trace() : TraceStrStream(&TraceStringBuf), TraceStrStreamW(&TraceStringBufW) { #ifdef _DEBUG - // nove streamy pouzivaji interne locales, ktere maji implementovany - // jednotlive "facets" pomoci lazy creation - jsou alokovany na heapu - // kdyz jsou potreba, tedy kdyz nekdo posle do streamu neco, co ma - // formatovani zavisle na lokalich pravidlech, treba cislo, datum, - // nebo boolean. Tyto "facets" jsou pak dealokovany pri exitu - // programu s prioritou compiler, tzn. po nasi kontrole memory leaku. - // Takze pokud nekdo pouzije stream k vypisu cehokoli lokalizovatelneho, - // nas debug heap zacne hlasit memory leaky, i kdyz zadne nejsou. Abychom - // tomu predesli, donutime locales vytvorit vsechny "facets" ted, dokud - // jeste nehlidame heap. - // Zatim pouzivame pouze vystupni stream a pouze se stringy (bez konverze) - // a cisly. Takze poslat cislo do stringstreamu by melo stacit. Pokud - // v budoucnu zacneme pouzivat streamy vic a debug heap zacne hlasit - // leaky, budeme zde muset pridat vic vstupu/vystupu. + // new streams use internal locales whose individual "facets" are implemented + // with lazy creation - they are allocated on the heap + // when needed, that is, when something is sent to the stream whose formatting + // depends on locale rules, such as a number, date, + // or boolean. These "facets" are then deallocated on + // program exit with compiler priority, i.e. after our memory-leak check. + // So if someone uses a stream to print anything localizable, + // our debug heap starts reporting memory leaks even though there are none. To prevent + // that, we force the locales to create all "facets" now, while + // we are not watching the heap yet. + // For now we use only output streams, and only with strings (without conversion) + // and numbers. So sending a number to stringstream should be enough. If + // we start using streams more in the future and the debug heap starts reporting + // leaks, we will have to add more input/output here. std::stringstream s; s << 1; std::wstringstream s2; @@ -446,7 +447,7 @@ BOOL C__Trace::Connect(BOOL onUserRequest) lstrcpynW(s, L"altap_traces", int(end - s)); s += wcslen(s); - if ((s - tmpDir) + 15 < MAX_PATH) // dost mista pro pripojeni "_2000000000.log" + if ((s - tmpDir) + 15 < MAX_PATH) // enough room to append "_2000000000.log" { int num = 1; while (1) @@ -462,11 +463,11 @@ BOOL C__Trace::Connect(BOOL onUserRequest) } DWORD err = GetLastError(); if (err != ERROR_FILE_EXISTS && err != ERROR_ALREADY_EXISTS) - break; // neocekavana chyba (a neni ji kam vypsat) + break; // unexpected error (and nowhere to print it) } if (HTraceFile == INVALID_HANDLE_VALUE) HTraceFile = NULL; - else // zapis headeru do souboru (identifikace sloupcu) + else // write the file header (column labels) { DWORD wr; const WCHAR* fileHeader = L"\xFEFF" /* BOM */ L"Type\tTID\t" @@ -482,7 +483,7 @@ BOOL C__Trace::Connect(BOOL onUserRequest) } #endif // TRACE_TO_FILE - if (HWritePipe != NULL) // test spojeni se serverem, jestli je down, HWritePipe se zavre a nasledne zkusime reconnect + if (HWritePipe != NULL) // test the server connection; if it is down, HWritePipe is closed and we then try to reconnect TRACE_I("Connect request received when already connected to Trace Server."); BOOL ret = FALSE; @@ -490,12 +491,12 @@ BOOL C__Trace::Connect(BOOL onUserRequest) ret = TRUE; // pokud je jiz spojeni navazano else { - // pokusim se otevrit Mutex pro pristup ke sdilene pameti + // try to open the mutex for access to the shared memory HANDLE hOpenConnectionMutex; hOpenConnectionMutex = OpenMutex(/*MUTEX_ALL_ACCESS*/ SYNCHRONIZE, FALSE, __OPEN_CONNECTION_MUTEX); - if (hOpenConnectionMutex != NULL) // server nalezen + if (hOpenConnectionMutex != NULL) // server found { - // prevezmu ConnectionMutex + // acquire ConnectionMutex DWORD waitRet; while (1) { @@ -504,16 +505,16 @@ BOOL C__Trace::Connect(BOOL onUserRequest) if (waitRet != WAIT_ABANDONED) break; } - if (waitRet == WAIT_OBJECT_0) // podaril se prevzit + if (waitRet == WAIT_OBJECT_0) // acquired successfully { - // otevru FileMapping + // open FileMapping HANDLE hFileMapping; hFileMapping = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, __FILE_MAPPING_NAME); if (hFileMapping != NULL) { - // namapuju spolecnou pamet + // map the shared memory char* mapAddress; - mapAddress = (char*)MapViewOfFile(hFileMapping, FILE_MAP_ALL_ACCESS, // FIXME_X64 nepredavame x86/x64 nekompatibilni data? + mapAddress = (char*)MapViewOfFile(hFileMapping, FILE_MAP_ALL_ACCESS, // FIXME_X64 are we passing x86/x64-incompatible data? 0, 0, __SIZEOF_CLIENTSERVERINITDATA); if (mapAddress != NULL) { @@ -523,7 +524,7 @@ BOOL C__Trace::Connect(BOOL onUserRequest) { HANDLE HReadPipe; - // vytvorim anonymous pipe + // create an anonymous pipe SECURITY_ATTRIBUTES sa; char secDesc[SECURITY_DESCRIPTOR_MIN_LENGTH]; sa.nLength = sizeof(sa); @@ -534,104 +535,104 @@ BOOL C__Trace::Connect(BOOL onUserRequest) SetSecurityDescriptorDacl(sa.lpSecurityDescriptor, TRUE, 0, FALSE); if (CreatePipe(&HReadPipe, &HWritePipe, &sa, __PIPE_SIZE * 1024)) { - // zapisu do sdilene pameti handle pro cteni z pipy + // write the pipe read handle to shared memory int expectedServerVer = TRACE_CLIENT_VERSION; - *(int*)&mapAddress[0] = expectedServerVer - 1; // Version (zkousime nejdrive starsi zpusob connectu) - *(DWORD*)&mapAddress[4] = GetCurrentProcessId(); // ClientOrServerProcessId (tady jde o PID klienta) - *(DWORD*)&mapAddress[8] = (DWORD)(DWORD_PTR)HReadPipe; // HReadOrWritePipe (tady jde o HReadPipe) + *(int*)&mapAddress[0] = expectedServerVer - 1; // Version (we try the older connect method first) + *(DWORD*)&mapAddress[4] = GetCurrentProcessId(); // ClientOrServerProcessId (here it is the client PID) + *(DWORD*)&mapAddress[8] = (DWORD)(DWORD_PTR)HReadPipe; // HReadOrWritePipe (here it is HReadPipe) *(DWORD*)&mapAddress[12] = (DWORD)(DWORD_PTR)HPipeSemaphore; // HPipeSemaphore - // otevru hReadyEvent + // open hReadyEvent HANDLE hReadyEvent; hReadyEvent = OpenEvent(EVENT_ALL_ACCESS, TRUE, __CONNECT_DATA_READY_EVENT_NAME); - // otevru hAcceptedEvent + // open hAcceptedEvent HANDLE hAcceptedEvent; hAcceptedEvent = OpenEvent(EVENT_ALL_ACCESS, TRUE, __CONNECT_DATA_ACCEPTED_EVENT_NAME); if (hReadyEvent != NULL && hAcceptedEvent != NULL) { - ResetEvent(hAcceptedEvent); // chci jen cerstvou odpoved serveru + ResetEvent(hAcceptedEvent); // wait only for a fresh response from the server while (1) { - SetEvent(hReadyEvent); // reknu serveru, ze jsem pripravil data + SetEvent(hReadyEvent); // tell the server the data is ready - // pockam, az server data zpracuje + // wait for the server to process the data waitRet = WaitForSingleObject(hAcceptedEvent, __COMMUNICATION_WAIT_TIMEOUT); if (waitRet == WAIT_OBJECT_0) { - // hlaska vypisovana na starem neunikodovem Trace Serveru (musi byt ANSI) + // message shown on the old non-Unicode Trace Server (must be ANSI) const char* oldTraceServerA = "Disconnecting: this is not Unicode version of Trace Server."; - // podivam se na vysledek ze serveru + // check the result from the server if (*((BOOL*)mapAddress) == TRUE) { - if (expectedServerVer == TRACE_CLIENT_VERSION) // hura, povedlo se pripojit na novy Trace Server! + if (expectedServerVer == TRACE_CLIENT_VERSION) // success, connected to the new Trace Server! { #ifdef TRACE_IGNORE_AUTOCLEAR - ret = SendIgnoreAutoClear(TRUE); // ignorovat, pri chybe provedeme disconnect + ret = SendIgnoreAutoClear(TRUE); // ignore; disconnect on error #else // TRACE_IGNORE_AUTOCLEAR - ret = SendIgnoreAutoClear(FALSE); // neignorovat, pri chybe provedeme disconnect + ret = SendIgnoreAutoClear(FALSE); // do not ignore; disconnect on error #endif // TRACE_IGNORE_AUTOCLEAR } else TRACE_E(oldTraceServerA); } - else // nepovedlo se: zkusime pipe vytvorit na strane serveru + else // failed: try to create the pipe on the server side { - // zapisu do sdilene pameti novou verzi, tim pozadam server o poslani handlu pro zapis do pipy + // write the new version to shared memory to ask the server to send the pipe write handle *(int*)&mapAddress[0] = expectedServerVer; // Version - SetEvent(hReadyEvent); // reknu serveru, ze jsem pripravil data + SetEvent(hReadyEvent); // tell the server the data is ready - // pockam, az server data zpracuje + // wait for the server to process the data waitRet = WaitForSingleObject(hAcceptedEvent, __COMMUNICATION_WAIT_TIMEOUT); - if (waitRet == WAIT_OBJECT_0 && *((BOOL*)mapAddress) == TRUE) // podivam se na vysledek ze serveru + if (waitRet == WAIT_OBJECT_0 && *((BOOL*)mapAddress) == TRUE) // check the result from the server { HANDLE hWritePipeFromSrv = NULL; HANDLE hPipeSemaphoreFromSrv = NULL; - // ziskani handlu server procesu + // get the server process handle HANDLE hServerProcess = OpenProcess(PROCESS_DUP_HANDLE, FALSE, - *(DWORD*)&mapAddress[4] /* ClientOrServerProcessId (tady jde o PID serveru) */); - // ziskani handlu pipy a semaforu + *(DWORD*)&mapAddress[4] /* ClientOrServerProcessId (here it is the server PID) */); + // get the pipe and semaphore handles if (hServerProcess != NULL && - DuplicateHandle(hServerProcess, (HANDLE)(DWORD_PTR)(*(DWORD*)&mapAddress[8]) /* HReadOrWritePipe (tady jde o HWritePipe) */, // server - GetCurrentProcess(), &hWritePipeFromSrv, // klient + DuplicateHandle(hServerProcess, (HANDLE)(DWORD_PTR)(*(DWORD*)&mapAddress[8]) /* HReadOrWritePipe (here it is HWritePipe) */, // server + GetCurrentProcess(), &hWritePipeFromSrv, // client GENERIC_WRITE, FALSE, 0) && DuplicateHandle(hServerProcess, (HANDLE)(DWORD_PTR)(*(DWORD*)&mapAddress[12]) /* HPipeSemaphore */, // server - GetCurrentProcess(), &hPipeSemaphoreFromSrv, // klient + GetCurrentProcess(), &hPipeSemaphoreFromSrv, // client 0, FALSE, DUPLICATE_SAME_ACCESS)) { - *((int*)mapAddress) = 3; // zapis vysledku -> 3 = povedlo se, handly mame + *((int*)mapAddress) = 3; // write result -> 3 = success, we have the handles *(DWORD*)&mapAddress[4] = GetCurrentProcessId(); // ClientOrServerProcessId (tady jde o PID klienta) } else { - *((BOOL*)mapAddress) = FALSE; // zapis vysledku -> nepovedlo se + *((BOOL*)mapAddress) = FALSE; // write result -> failed } if (hServerProcess != NULL) CloseHandle(hServerProcess); - SetEvent(hReadyEvent); // reknu serveru, ze jsem data precetl a zapsal vysledek + SetEvent(hReadyEvent); // tell the server I read the data and wrote the result - // pri uspechu: pockam, az server nastartuje thread cteni dat z pipy a posle vysledek - // pri neuspechu: dame serveru vedet, ze se to nepovedlo, vrati nam opet neuspech + // on success: wait until the server starts the thread that reads data from the pipe and sends the result + // on failure: tell the server it failed; it will return failure again waitRet = WaitForSingleObject(hAcceptedEvent, __COMMUNICATION_WAIT_TIMEOUT); - if (waitRet == WAIT_OBJECT_0 && // podivam se na vysledek ze serveru - *((int*)mapAddress) == 2 /* 2 = uspesne nastartovany cteci thread v serveru */) + if (waitRet == WAIT_OBJECT_0 && // check the result from the server + *((int*)mapAddress) == 2 /* 2 = the reader thread was started successfully in the server */) { CloseHandle(HPipeSemaphore); - HPipeSemaphore = hPipeSemaphoreFromSrv; // pouzijeme semafor ze serveru (ten klientsky zavreme) + HPipeSemaphore = hPipeSemaphoreFromSrv; // use the semaphore from the server (close the client one) CloseHandle(HWritePipe); - HWritePipe = hWritePipeFromSrv; // pouzijeme pipu ze serveru (tu klientskou zavreme) + HWritePipe = hWritePipeFromSrv; // use the pipe from the server (close the client one) if (expectedServerVer == TRACE_CLIENT_VERSION) // hura, povedlo se pripojit na novy Trace Server! { #ifdef TRACE_IGNORE_AUTOCLEAR - ret = SendIgnoreAutoClear(TRUE); // ignorovat, pri chybe provedeme disconnect + ret = SendIgnoreAutoClear(TRUE); // ignore; disconnect on error #else // TRACE_IGNORE_AUTOCLEAR - ret = SendIgnoreAutoClear(FALSE); // neignorovat, pri chybe provedeme disconnect + ret = SendIgnoreAutoClear(FALSE); // do not ignore; disconnect on error #endif // TRACE_IGNORE_AUTOCLEAR } else @@ -647,10 +648,10 @@ BOOL C__Trace::Connect(BOOL onUserRequest) } else // connect se nepovedl ani jednim zpusobem (asi stary Trace Server) { - if (expectedServerVer == TRACE_CLIENT_VERSION) // zkouseli jsme novou verzi serveru + if (expectedServerVer == TRACE_CLIENT_VERSION) // we tried the new server version { - expectedServerVer = TRACE_CLIENT_VERSION - 2; // ted zkusime starsi verzi serveru - // zapisu do sdilene pameti verzi, kterou zvlada stara verze serveru + expectedServerVer = TRACE_CLIENT_VERSION - 2; // now try the older server version + // write the version supported by the old server to shared memory *(int*)&mapAddress[0] = expectedServerVer - 1; // Version continue; } @@ -681,7 +682,7 @@ BOOL C__Trace::Connect(BOOL onUserRequest) } CloseHandle(hFileMapping); } - ReleaseMutex(hOpenConnectionMutex); // muzou se connectit jini clienti + ReleaseMutex(hOpenConnectionMutex); // other clients can connect now } CloseHandle(hOpenConnectionMutex); } @@ -752,12 +753,12 @@ BOOL C__Trace::WritePipe(LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite) BytesAllocatedForWriteToPipe += 1024; else { - if (res == WAIT_TIMEOUT) // timeout, zkontrolujem, jestli pipe na server jeste zije + if (res == WAIT_TIMEOUT) // timeout, check whether the server pipe is still alive { if (!WriteFile(HWritePipe, lpBuffer, 0, &numberOfBytesWritten, NULL)) return FALSE; } - else // jina chyba, radsi koncime, at z toho neni nekonecny cyklus + else // another error, stop to avoid an infinite loop return FALSE; } } @@ -811,7 +812,7 @@ BOOL C__Trace::SendIgnoreAutoClear(BOOL ignore) { char data[__SIZEOF_PIPEDATAHEADER]; *(int*)&data[0] = __mtIgnoreAutoClear; // Type - *(DWORD*)&data[4] = ignore ? 1 : 0; // ThreadID: 0 = neignorovat, 1 = ignorovat auto-clear na Trace Serveru + *(DWORD*)&data[4] = ignore ? 1 : 0; // ThreadID: 0 = do not ignore, 1 = ignore Trace Server auto-clear return WritePipe(data, __SIZEOF_PIPEDATAHEADER); } @@ -838,7 +839,7 @@ void C__Trace::SetThreadName(const char* name) EnterCriticalSection(&CriticalSection); DWORD storedLastError = GetLastError(); #ifdef MULTITHREADED_TRACE_ENABLE - if (ThreadCache.GetUniqueThreadId(GetCurrentThreadId()) != -1) // jen s pridelenym UID, jinak by vsechny "unknown" byly najednou pojmenovany timto jmenem + if (ThreadCache.GetUniqueThreadId(GetCurrentThreadId()) != -1) // only with an assigned UID, otherwise all "unknown" threads would suddenly get this name SendSetNameMessageToServer(name, NULL, __mtSetThreadName); #else // MULTITHREADED_TRACE_ENABLE SendSetNameMessageToServer(name, NULL, __mtSetThreadName); @@ -852,7 +853,7 @@ void C__Trace::SetThreadNameW(const WCHAR* name) EnterCriticalSection(&CriticalSection); DWORD storedLastError = GetLastError(); #ifdef MULTITHREADED_TRACE_ENABLE - if (ThreadCache.GetUniqueThreadId(GetCurrentThreadId()) != -1) // jen s pridelenym UID, jinak by vsechny "unknown" byly najednou pojmenovany timto jmenem + if (ThreadCache.GetUniqueThreadId(GetCurrentThreadId()) != -1) // only with an assigned UID, otherwise all "unknown" threads would suddenly get this name SendSetNameMessageToServer(NULL, name, __mtSetThreadNameW); #else // MULTITHREADED_TRACE_ENABLE SendSetNameMessageToServer(NULL, name, __mtSetThreadNameW); @@ -881,8 +882,8 @@ C__Trace::SetInfoW(const WCHAR* file, int line) struct C__TraceMsgBoxThreadData { - char* Msg; // alokovany text hlasky - const char* File; // jen odkaz na staticky string + char* Msg; // allocated message text + const char* File; // only a pointer to a static string int Line; }; @@ -907,8 +908,8 @@ DWORD WINAPI __TraceMsgBoxThread(void* param) struct C__TraceMsgBoxThreadDataW { - WCHAR* Msg; // alokovany text hlasky - const WCHAR* File; // jen odkaz na staticky string + WCHAR* Msg; // allocated message text + const WCHAR* File; // only a pointer to a static string int Line; }; @@ -945,7 +946,7 @@ C__Trace& C__Trace::SendMessageToServer(C__MessageType type, BOOL crash) { BOOL unicode = type == __mtInformationW || type == __mtErrorW; - // flushnuti do bufferu + // flush into the buffer if (unicode) TraceStrStreamW.flush(); else @@ -966,9 +967,9 @@ C__Trace::SendMessageToServer(C__MessageType type, BOOL crash) ::QueryPerformanceCounter(&perfCounter); static LONGLONG lastPC = 0; - if (lastPC != 0 && lastPC > perfCounter.QuadPart) // counter musi stale rust, snizeni je chyba (na vicejadrovych procesorech se tahle chyba objevuje, resenim je nastaveni affinity na jedine jadro pro ladeny proces v Task Manageru) + if (lastPC != 0 && lastPC > perfCounter.QuadPart) // the counter must keep increasing; a decrease is a bug (this happens on multicore processors; the workaround is to set the debugged process affinity to a single core in Task Manager) { - perfCounter.QuadPart = lastPC + 1; // umele zvysime hodnotu counteru na posledni hodnotu plus jedna (jen aby se nesnizil a nedoslo k uplne spatnemu zarazeni v Trace Serveru) + perfCounter.QuadPart = lastPC + 1; // artificially increase the counter to the last value plus one (just to keep it from decreasing and getting completely misordered in Trace Server) pcWarningLen = unicode ? (int)wcslen(pcWarningW) : (int)strlen(pcWarning); addToMessageSize = pcWarningLen; writePCWarning = TRUE; @@ -985,12 +986,12 @@ C__Trace::SendMessageToServer(C__MessageType type, BOOL crash) { DWORD wr; WCHAR bufW[5000]; - swprintf_s(bufW, unicode ? L"%s\t%d\t" // jmeno souboru ve FileW (unicode) + swprintf_s(bufW, unicode ? L"%s\t%d\t" // file name in FileW (Unicode) #ifdef MULTITHREADED_TRACE_ENABLE L"%d\t" #endif // MULTITHREADED_TRACE_ENABLE L"%d.%d.%d\t%d:%02d:%02d.%03d\t%.3lf\t%s\t%d\t" - : L"%s\t%d\t" // jmeno souboru ve File (ANSI) + : L"%s\t%d\t" // file name in File (ANSI) #ifdef MULTITHREADED_TRACE_ENABLE L"%d\t" #endif // MULTITHREADED_TRACE_ENABLE @@ -1018,15 +1019,15 @@ C__Trace::SendMessageToServer(C__MessageType type, BOOL crash) } } WriteFile(HTraceFile, L"\r\n", sizeof(WCHAR) * 2, &wr, NULL); - FlushFileBuffers(HTraceFile); // flushneme data na disk + FlushFileBuffers(HTraceFile); // flush the data to disk #ifdef __TRACESERVER - // pro ladeni Trace Serveru: TRACE hlasky jdou jen do souboru, kdyz prijde TRACE_E, upozornime msgboxem + // for Trace Server debugging: TRACE messages go only to the file; when TRACE_E arrives, show a msgbox if (!crash && (type == __mtError || type == __mtErrorW)) { swprintf_s(bufW, L"Error message from Trace Server has been written to file with traces:\n%s", TraceFileName); - // vypiseme hlasku v jinem threadu, aby nepumpovala zpravy aktualniho threadu + // show the message in another thread so the current thread does not pump messages DWORD id; HANDLE msgBoxThread = CreateThread(NULL, 0, __TraceMsgBoxThreadErrInTS, bufW, 0, &id); if (msgBoxThread != NULL) @@ -1061,7 +1062,7 @@ C__Trace::SendMessageToServer(C__MessageType type, BOOL crash) if (!WritePipe(data, __SIZEOF_PIPEDATAHEADER) || !WritePipe(unicode ? (void*)FileW : (void*)File, (DWORD)((unicode ? sizeof(WCHAR) : 1) * fileSize)) || writePCWarning && !WritePipe(unicode ? (void*)pcWarningW : (void*)pcWarning, - (unicode ? sizeof(WCHAR) : 1) * pcWarningLen) || // na zacatek zpravy vypisu chybu PC, pri ladeni je to dost zasadni vec (zpravy jsou mimo realne poradi) + (unicode ? sizeof(WCHAR) : 1) * pcWarningLen) || // put the PC error at the start of the message; this is quite important when debugging (messages are out of actual order) !WritePipe(unicode ? (void*)TraceStringBufW.c_str() : (void*)TraceStringBuf.c_str(), (unicode ? sizeof(WCHAR) : 1) * textSize)) { @@ -1084,7 +1085,7 @@ C__Trace::SendMessageToServer(C__MessageType type, BOOL crash) static BOOL msgBoxOpened = FALSE; C__TraceMsgBoxThreadData threadData; C__TraceMsgBoxThreadDataW threadDataW; - if (crash) // break/padacka po vypisu TRACE error hlasky (TRACE_C a TRACE_MC) + if (crash) // break/crash after displaying the TRACE error message (TRACE_C and TRACE_MC) { if (!msgBoxOpened) { @@ -1120,16 +1121,16 @@ C__Trace::SendMessageToServer(C__MessageType type, BOOL crash) } } if (unicode) - TraceStringBufW.erase(); // priprava pro dalsi trace + TraceStringBufW.erase(); // prepare for the next trace else TraceStringBuf.erase(); LeaveCriticalSection(&CriticalSection); if (crash) { - if (unicode && threadDataW.Msg != NULL || // break/padacka po vypisu TRACE error hlasky (TRACE_C a TRACE_MC) + if (unicode && threadDataW.Msg != NULL || // break/crash after displaying the TRACE error message (TRACE_C and TRACE_MC) !unicode && threadData.Msg != NULL) { - // vypiseme hlasku v jinem threadu, aby nepumpovala zpravy aktualniho threadu + // show the message in another thread so the current thread does not pump messages DWORD id; HANDLE msgBoxThread = CreateThread(NULL, 0, unicode ? __TraceMsgBoxThreadW : __TraceMsgBoxThread, unicode ? (void*)&threadDataW : (void*)&threadData, 0, &id); @@ -1140,12 +1141,12 @@ C__Trace::SendMessageToServer(C__MessageType type, BOOL crash) } msgBoxOpened = FALSE; GlobalFree(unicode ? (HGLOBAL)threadDataW.Msg : (HGLOBAL)threadData.Msg); - // pad softu vyvolame primo v kodu, kde je umisteny TRACE_C/TRACE_MC, aby - // bylo v bug reportu videt presne kde makra lezi; padacka tedy nasleduje - // po dokonceni teto metody + // we trigger the crash directly in the code where TRACE_C/TRACE_MC is placed, so + // it is clear in the bug report exactly where the macros are; the crash therefore follows + // after this method finishes } - else // ostatni thready s TRACE_C zablokujeme, az se zavre msgbox otevreny pro - { // prvni TRACE_C, tak to tam i spadne, at v tom neni bordel + else // block other threads with TRACE_C until the msgbox opened for + { // the first TRACE_C is closed; it will crash there too, to keep things tidy if (msgBoxOpened) { while (1) @@ -1158,15 +1159,14 @@ C__Trace::SendMessageToServer(C__MessageType type, BOOL crash) #endif // TRACE_ENABLE -// pasticka na vlastni definici techto "zakazanych" operatoru (aby fungovala kontrola -// zakazanych kombinaci stringu WCHAR / char v jednom TRACE nebo MESSAGE makru, -// nesmi byt nasledujici operatory definovany v jinych modulech - jinak by linker -// neohlasil chybu - idea: v DEBUG verzi chytame chyby linkeru, v RELEASE verzi chytame -// chyby vlastni definice operatoru; aby se otestovaly obe veci, musi byt povolene -// TRACE_ENABLE v DEBUG i RELEASE verzi, coz napr. u Salamandera splnuje SDK build; -// nejbeznejsi model je v DEBUG verzi mit povolene TRACE_ENABLE a v RELEASE ne, v tomto -// pripade se provede jen prvni test, ktery je dulezitejsi (zakazane kombinace stringu -// WCHAR / char)) +// trap for custom definitions of these "forbidden" operators (for the check +// for forbidden WCHAR/char string combinations in a single TRACE or MESSAGE macro +// to work, the following operators must not be defined in other modules - otherwise the linker +// would not report an error - the idea is: in the DEBUG build we catch linker errors, in the RELEASE build we catch +// errors from custom operator definitions; to test both, TRACE_ENABLE must be enabled +// in both DEBUG and RELEASE builds, which the Salamander SDK build, for example, satisfies; +// the most common setup is to have TRACE_ENABLE enabled in DEBUG and disabled in RELEASE, in that +// case only the first test runs, which is the more important one (forbidden WCHAR/char string combinations)) #ifndef _DEBUG #include From 14c35c683ecb628699cf15d3d36de01649737007 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 16:28:14 +0200 Subject: [PATCH 240/710] [translation] Fix src/common/winlib.h comments (#613) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/common/winlib.h | 99 +++++++++++++++++++++++---------------------- 1 file changed, 50 insertions(+), 49 deletions(-) diff --git a/src/common/winlib.h b/src/common/winlib.h index fd7266822..c06afd13d 100644 --- a/src/common/winlib.h +++ b/src/common/winlib.h @@ -1,11 +1,12 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once -// makro __DEBUG_WINLIB zapina nekolik testu zaludnych chyb WinLibu +// __DEBUG_WINLIB enables several checks for tricky WinLib bugs -// konstanty pro stringy WinLibu (jen interni pouziti ve WinLibu) +// WinLib string constants (for internal WinLib use only) enum CWLS { WLS_INVALID_NUMBER, @@ -14,26 +15,26 @@ enum CWLS WLS_COUNT }; -// nastaveni vlastnich textu do WinLibu -void SetWinLibStrings(const TCHAR* invalidNumber, // "neni cislo" (u transferbufferu cisel) - const TCHAR* error); // titulek "chyba" (u transferbufferu cisel) +// set custom WinLib strings +void SetWinLibStrings(const TCHAR* invalidNumber, // "not a number" (for numeric transfer buffers) + const TCHAR* error); // title "error" (for numeric transfer buffers) extern HINSTANCE HInstance; -extern const TCHAR* CWINDOW_CLASSNAME; // jmeno tridy universalniho okna -extern const TCHAR* CWINDOW_CLASSNAME2; // jmeno tridy universalniho okna - nema CS_VREDRAW | CS_HREDRAW +extern const TCHAR* CWINDOW_CLASSNAME; // universal window class name +extern const TCHAR* CWINDOW_CLASSNAME2; // universal window class name - no CS_VREDRAW | CS_HREDRAW #ifndef _UNICODE -extern const WCHAR* CWINDOW_CLASSNAMEW; // jmeno tridy unicodoveho universalniho okna -extern const WCHAR* CWINDOW_CLASSNAME2W; // jmeno tridy unicodoveho universalniho okna - nema CS_VREDRAW | CS_HREDRAW +extern const WCHAR* CWINDOW_CLASSNAMEW; // Unicode universal window class name +extern const WCHAR* CWINDOW_CLASSNAME2W; // Unicode universal window class name - no CS_VREDRAW | CS_HREDRAW #endif // _UNICODE class CWinLibHelp; -// je potreba zavolat pred pouzitim WinLibu +// must be called before using WinLib BOOL InitializeWinLib(); -// je potreba zavolat po pouziti WinLibu +// must be called after using WinLib void ReleaseWinLib(); -// je treba zavolat pred pouzivanim helpu +// must be called before using help BOOL SetupWinLibHelp(CWinLibHelp* winLibHelp); class CWinLibHelp @@ -46,16 +47,16 @@ class CWinLibHelp // **************************************************************************** -enum CObjectOrigin // pouzito pri destrukci oken a dialogu +enum CObjectOrigin // used when destroying windows and dialogs { - ooAllocated, // pri WM_DESTROY se bude dealokovat - ooStatic, // pri WM_DESTROY se HWindow nastavi na NULL - ooStandard // pro modalni dlg =ooStatic, pro nemodalni dlg =ooAllocated + ooAllocated, // deallocated on WM_DESTROY + ooStatic, // HWindow is set to NULL on WM_DESTROY + ooStandard // for modal dialogs = ooStatic, for modeless dialogs = ooAllocated }; // **************************************************************************** -enum CObjectType // pro rozpoznani typu objektu +enum CObjectType // for object type identification { otBase, otWindow, @@ -66,7 +67,7 @@ enum CObjectType // pro rozpoznani typu objektu // **************************************************************************** -class CWindowsObject // predek vsech MS-Windows objektu +class CWindowsObject // base class of all MS-Windows objects { public: HWND HWindow; @@ -102,9 +103,9 @@ class CWindowsObject // predek vsech MS-Windows objektu SetHelpID(helpID); } - virtual ~CWindowsObject() {} // aby se u potomku volal jejich destruktor + virtual ~CWindowsObject() {} // so derived destructors are called - virtual BOOL Is(int) { return FALSE; } // identifikace objektu + virtual BOOL Is(int) { return FALSE; } // object type identification virtual int GetObjectType() { return otBase; } virtual BOOL IsAllocated() { return ObjectOrigin == ooAllocated; } @@ -201,7 +202,7 @@ class CWindow : public CWindowsObject HWND hwndParent, // handle of parent or owner window HMENU hmenu, // handle of menu or child-window identifier HINSTANCE hinst, // handle of application instance - LPVOID lpvParam); // ukazatel na objekt vytvareneho okna + LPVOID lpvParam); // pointer to the window object being created HWND CreateEx(DWORD dwExStyle, // extended window style LPCTSTR lpszClassName, // address of registered class name @@ -214,7 +215,7 @@ class CWindow : public CWindowsObject HWND hwndParent, // handle of parent or owner window HMENU hmenu, // handle of menu or child-window identifier HINSTANCE hinst, // handle of application instance - LPVOID lpvParam); // ukazatel na objekt vytvareneho okna + LPVOID lpvParam); // pointer to the window object being created #ifndef _UNICODE HWND CreateW(LPCWSTR lpszClassName, // address of registered class name @@ -227,7 +228,7 @@ class CWindow : public CWindowsObject HWND hwndParent, // handle of parent or owner window HMENU hmenu, // handle of menu or child-window identifier HINSTANCE hinst, // handle of application instance - LPVOID lpvParam); // ukazatel na objekt vytvareneho okna + LPVOID lpvParam); // pointer to the window object being created HWND CreateExW(DWORD dwExStyle, // extended window style LPCWSTR lpszClassName, // address of registered class name @@ -240,7 +241,7 @@ class CWindow : public CWindowsObject HWND hwndParent, // handle of parent or owner window HMENU hmenu, // handle of menu or child-window identifier HINSTANCE hinst, // handle of application instance - LPVOID lpvParam); // ukazatel na objekt vytvareneho okna + LPVOID lpvParam); // pointer to the window object being created #endif // _UNICODE void AttachToWindow(HWND hWnd); @@ -277,8 +278,8 @@ class CWindow : public CWindowsObject enum CTransferType { - ttDataToWindow, // data jdou do okna - ttDataFromWindow // data jdou z okna + ttDataToWindow, // data to the window + ttDataFromWindow // data from the window }; // **************************************************************************** @@ -286,7 +287,7 @@ enum CTransferType class CTransferInfo { public: - int FailCtrlID; // INT_MAX - vse v poradku, jinak ID controlu s chybou + int FailCtrlID; // INT_MAX = no error, otherwise the ID of the failing control CTransferType Type; CTransferInfo(HWND hDialog, CTransferType type) @@ -315,7 +316,7 @@ class CTransferInfo #endif // _UNICODE protected: - HWND HDialog; // handle dialogu, pro ktery se provadi transfer + HWND HDialog; // handle of the dialog for which the transfer is performed }; // **************************************************************************** @@ -323,8 +324,8 @@ class CTransferInfo class CDialog : public CWindowsObject { public: - CWindowsObject::SetObjectOrigin; // kvuli zkompilovatelnosti CPropSheetPage - CWindowsObject::HWindow; // kvuli zkompilovatelnosti CPropSheetPage + CWindowsObject::SetObjectOrigin; // needed so CPropSheetPage compiles + CWindowsObject::HWindow; // needed so CPropSheetPage compiles #ifdef _UNICODE CDialog(HINSTANCE modul, int resID, HWND parent, CObjectOrigin origin = ooStandard) : CWindowsObject(origin) @@ -366,8 +367,8 @@ class CDialog : public CWindowsObject void SetParent(HWND parent) { Parent = parent; } HWND GetParent() { return Parent; } - INT_PTR Execute(); // modalni dialog - HWND Create(); // nemodalni dialog + INT_PTR Execute(); // modal dialog + HWND Create(); // modeless dialog static INT_PTR CALLBACK CDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); @@ -377,7 +378,7 @@ class CDialog : public CWindowsObject virtual void NotifDlgJustCreated() {} - BOOL Modal; // kvuli zpusobu destrukce dialogu + BOOL Modal; // because of the way the dialog is destroyed HINSTANCE Modul; int ResID; HWND Parent; @@ -395,7 +396,7 @@ struct CWindowData CWindowsObject* Wnd; }; -#define WNDMGR_CACHE_SIZE 256 // (2kB cache) musi byt v souladu s GetCacheIndex +#define WNDMGR_CACHE_SIZE 256 // (2kB cache) must be consistent with GetCacheIndex inline int GetCacheIndex(HWND hWnd) { @@ -420,7 +421,7 @@ class CWindowsManager : protected TDirectArray int search, cache, maxWndCount; #endif - CWinLibCS CS; // je public, aby slo lokalne zamezit zmenam ve Windows Manageru + CWinLibCS CS; // public so Windows Manager changes can be prevented locally public: CWindowsManager(); @@ -431,7 +432,7 @@ class CWindowsManager : protected TDirectArray int GetCount(); private: - HWND LastHWnd[WNDMGR_CACHE_SIZE]; // posledni pozadavek - cache + HWND LastHWnd[WNDMGR_CACHE_SIZE]; // last-request cache CWindowsObject* LastWnd[WNDMGR_CACHE_SIZE]; inline BOOL GetIndex(HWND hWnd, int& index); @@ -456,7 +457,7 @@ BOOL CWindowsManager::GetIndex(HWND hWnd, int& index) { m = (l + r) / 2; HWND hw = At(m).HWnd; - if (hw == hWnd) // nalezeno + if (hw == hWnd) // found { index = m; CS.Leave(); @@ -464,9 +465,9 @@ BOOL CWindowsManager::GetIndex(HWND hWnd, int& index) } else if (hw > hWnd) { - if (l == r || l > m - 1) // nenalezeno + if (l == r || l > m - 1) // not found { - index = m; // mel by byt na teto pozici + index = m; // should be at this position CS.Leave(); return FALSE; } @@ -474,9 +475,9 @@ BOOL CWindowsManager::GetIndex(HWND hWnd, int& index) } else { - if (l == r) // nenalezeno + if (l == r) // not found { - index = m + 1; // mel by byt az za touto pozici + index = m + 1; // should be after this position CS.Leave(); return FALSE; } @@ -502,13 +503,13 @@ struct CWindowQueueItem class CWindowQueue { protected: - const TCHAR* QueueName; // jmeno fronty (jen pro debugovaci ucely) + const TCHAR* QueueName; // queue name (for debugging only) CWindowQueueItem* Head; int Count; - CWinLibCS CS; // pristup z vice threadu -> nutna synchronizace + CWinLibCS CS; // access from multiple threads -> synchronization required public: - CWindowQueue(const TCHAR* queueName /* napr. "Find Dialogs" */) + CWindowQueue(const TCHAR* queueName /* e.g. "Find Dialogs" */) { QueueName = queueName; Head = NULL; @@ -516,12 +517,12 @@ class CWindowQueue } ~CWindowQueue(); - BOOL Add(CWindowQueueItem* item); // prida polozku do fronty, vraci uspech - void Remove(HWND hWindow); // odstrani polozku z fronty - BOOL Empty(); // vraci TRUE pokud je fronta prazdna - int GetWindowCount(); // vraci pocet oken ve fronte + BOOL Add(CWindowQueueItem* item); // adds an item to the queue, returns success status + void Remove(HWND hWindow); // removes an item from the queue + BOOL Empty(); // returns TRUE if the queue is empty + int GetWindowCount(); // returns the number of windows in the queue - // posle (PostMessage - okna muzou byt v ruznych threadech) vsem oknum zpravu + // posts the message to all windows (PostMessage - windows may be in different threads) void BroadcastMessage(DWORD uMsg, WPARAM wParam, LPARAM lParam); }; From 8d8351facd0999abb7f106ab0bf25b85f5dfe663 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 19:29:49 +0200 Subject: [PATCH 241/710] [translation] Fix src/plugins/7zip/update.h comments (#619) --- src/plugins/7zip/update.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/7zip/update.h b/src/plugins/7zip/update.h index a85f3b9e8..ce0d9611b 100644 --- a/src/plugins/7zip/update.h +++ b/src/plugins/7zip/update.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once @@ -147,7 +148,7 @@ class CArchiveUpdateCallback : public IArchiveUpdateCallback2, public: AString ProcessedFileName; - // synchronization for calls + // call synchronization CRITICAL_SECTION CSUpdate; TIndirectArray* FileItems; From 75420bb1ebe76c21826451fb75e82ce7b5e85dbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 19:30:07 +0200 Subject: [PATCH 242/710] [translation] Fix src/plugins/7zip/FStreams.cpp comments (#618) --- src/plugins/7zip/FStreams.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/7zip/FStreams.cpp b/src/plugins/7zip/FStreams.cpp index c04016b79..272add0e8 100644 --- a/src/plugins/7zip/FStreams.cpp +++ b/src/plugins/7zip/FStreams.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -31,8 +32,8 @@ BOOL ShowRetryAbortBox(HWND hParentWnd, int resID, DWORD err, ...) _stprintf(buf, _T("%s\n\n%s"), msg, SalamanderGeneral->GetErrorText(err)); TCHAR btnBuffer[128]; - /* used by the export_mnu.py script, which generates salmenu.mnu for the Translator - let the message box buttons handle hotkey collisions by simulating a menu + /* used by the export_mnu.py script, which generates salmenu.mnu for Translator + treat message box buttons as a menu to resolve hotkey collisions MENU_TEMPLATE_ITEM MsgBoxButtons[] = { {MNTT_PB, 0 From ac79f343006bed6febf66e2ddbad7c3328a3ccfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 19:30:30 +0200 Subject: [PATCH 243/710] [translation] Fix src/plugins/7zip/extract.cpp comments (#617) --- src/plugins/7zip/extract.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/7zip/extract.cpp b/src/plugins/7zip/extract.cpp index ea896fd2c..dd3e773e8 100644 --- a/src/plugins/7zip/extract.cpp +++ b/src/plugins/7zip/extract.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -364,7 +365,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = } } - // release OutStream so the file can be deleted if needed + // release OutStream so the file can be deleted if (OutFileStream != NULL) OutFileStreamSpec->SetMTime(&ProcessedFileInfo.LastWrite); OutFileStream.Release(); @@ -376,7 +377,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = return FALSE; case Delete: - // if cancel, bail out + // if canceled, exit if (!SafeDeleteFile(GetAnsiString(ProcessedFileInfo.FileName), DataErrorDeleteSilent)) return FALSE; break; From 7a71f5ff3ac02fb43c061757ba30b53a5eac53fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 19:30:53 +0200 Subject: [PATCH 244/710] [translation] Fix src/plugins/7zip/dialogs.cpp comments (#616) --- src/plugins/7zip/dialogs.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/7zip/dialogs.cpp b/src/plugins/7zip/dialogs.cpp index a67307b8d..e84fd8f65 100644 --- a/src/plugins/7zip/dialogs.cpp +++ b/src/plugins/7zip/dialogs.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -566,7 +567,7 @@ CExtOptionsDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (!CreateChilds()) { DestroyWindow(HWindow); // error -> do not open the dialog - return FALSE; // stop processing + return FALSE; // end processing } // set archive name From 012bf3a99ea3da03c4977b4affef29d87eb75ba6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 19:31:16 +0200 Subject: [PATCH 245/710] [translation] Fix src/plugins/7zip/7zthreads.cpp comments (#615) --- src/plugins/7zip/7zthreads.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/7zip/7zthreads.cpp b/src/plugins/7zip/7zthreads.cpp index 30258e85c..3ee1ee6d8 100644 --- a/src/plugins/7zip/7zthreads.cpp +++ b/src/plugins/7zip/7zthreads.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -36,7 +37,7 @@ BOOL CALLBACK SubClassedProgressDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPA return S_OK; case WM_7ZIP_ADDTEXT: - Salamander->ProgressDialogAddText((char*)lParam, TRUE); // delayed paint, to avoid slow down by frequent refresh + Salamander->ProgressDialogAddText((char*)lParam, TRUE); // Delayed paint to avoid slowdown from frequent refreshes return S_OK; case WM_7ZIP_CREATEFILE: From 85f91ae611c76e673bcb12277532c524905cd19f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Wed, 15 Apr 2026 19:31:54 +0200 Subject: [PATCH 246/710] [translation] Fix src/plugins/7zip/7zip.cpp comments (#614) --- src/plugins/7zip/7zip.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/7zip/7zip.cpp b/src/plugins/7zip/7zip.cpp index a8897b8a1..b6416d8a3 100644 --- a/src/plugins/7zip/7zip.cpp +++ b/src/plugins/7zip/7zip.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" #include "dbg.h" @@ -1106,7 +1107,7 @@ BOOL CPluginInterfaceForArchiver::PackToArchive(CSalamanderForOperationsAbstract BOOL ret = client.Update(salamander, fileName, sourcePath, isNewArchive, &fileList, &compressParams, passwordDefined, GetUnicodeString(password)) == OPER_OK; - // delete files afterwards if we are moving them into the archive + // delete files afterwards if moving them into the archive if (move && ret) { // first lock the archive file so we cannot delete it ourselves (bug: https://forum.altap.cz/viewtopic.php?f=3&t=3859) while (1) From 7ab4b99e3239213c084aa34e7963b326ce63f7cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 06:09:27 +0200 Subject: [PATCH 247/710] [translation] Fix src/plugins/shared/spl_gui.h comments (#622) --- src/plugins/shared/spl_gui.h | 520 +++++++++++++++++------------------ 1 file changed, 260 insertions(+), 260 deletions(-) diff --git a/src/plugins/shared/spl_gui.h b/src/plugins/shared/spl_gui.h index f1836887d..a03e53c12 100644 --- a/src/plugins/shared/spl_gui.h +++ b/src/plugins/shared/spl_gui.h @@ -13,31 +13,31 @@ #pragma once #ifdef _MSC_VER -#pragma pack(push, enter_include_spl_gui) // aby byly struktury nezavisle na nastavenem zarovnavani +#pragma pack(push, enter_include_spl_gui) // to make the structures independent of the current packing alignment #pragma pack(4) #endif // _MSC_VER #ifdef __BORLANDC__ #pragma option -a4 #endif // __BORLANDC__ -//////////////////////////////////////////////////////// +////////////////////////////////////////////////////// // // -// Prostor WM_APP + 200 az WM_APP + 399 je v const.h // -// vyjmut z prostoru pouzivaneho pro interni zpravy // -// Salamandera. // +// WM_APP + 200 through WM_APP + 399 are reserved in // +// const.h and excluded from the range used for // +// Salamander internal messages. // // // -//////////////////////////////////////////////////////// +////////////////////////////////////////////////////// // menu messages -#define WM_USER_ENTERMENULOOP WM_APP + 200 // [0, 0] doslo ke vstupu do menu -#define WM_USER_LEAVEMENULOOP WM_APP + 201 // [0, 0] byl ukoncen rezim menu loop; tato message je sendnuta pred postnutim commandu -#define WM_USER_LEAVEMENULOOP2 WM_APP + 202 // [0, 0] byl ukoncen rezim menu loop; tato message je postnuta az po commandu +#define WM_USER_ENTERMENULOOP WM_APP + 200 // [0, 0] menu mode entered +#define WM_USER_LEAVEMENULOOP WM_APP + 201 // [0, 0] menu loop mode ended; this message is sent before the command is posted +#define WM_USER_LEAVEMENULOOP2 WM_APP + 202 // [0, 0] menu loop mode ended; this message is posted only after the command #define WM_USER_INITMENUPOPUP WM_APP + 204 // [(CGUIMenuPopupAbstract*)menuPopup, LOWORD(uPos), HIWORD(uID)] #define WM_USER_UNINITMENUPOPUP WM_APP + 205 // [(CGUIMenuPopupAbstract*)menuPopup, LOWORD(uPos), HIWORD(uID)] #define WM_USER_CONTEXTMENU WM_APP + 206 // [(CGUIMenuPopupAbstract*)menuPopup, (BOOL)fromMouse \ - // (pokud dojde mysi akci, je rovno TRUE (pouzit GetMessagePos); \ - // pokud jde o klavesnicovou akci VK_APPS nebo Shift+F10, je rovno FALSE)] \ - // p.s. pokud vrati TRUE, dojde ke spusteni prikazu menu nebo otevreni submenu \ + // (if triggered by a mouse event, it is TRUE (use GetMessagePos); \ + // if triggered by the keyboard event VK_APPS or Shift+F10, it is FALSE)] \ + // p.s. if it returns TRUE, a menu command is executed or a submenu is opened \ // To cast menuPopup to CMenuPopup in Salamander, \ // use (CMenuPopup*)(CGUIMenuPopupAbstract*)menuPopup. @@ -51,13 +51,13 @@ #define WM_USER_TBENUMBUTTON2 WM_APP + 227 // [HWND hToolBar, TLBI_ITEM_INFO2 *tii] // tooltip messages -#define TOOLTIP_TEXT_MAX 5000 // maximalni delka retezce tool tipu (zprava WM_USER_TTGETTEXT) -#define WM_USER_TTGETTEXT WM_APP + 240 // [ID predany v SetCurrentToolTip, buffer omezeny TOOLTIP_TEXT_MAX] +#define TOOLTIP_TEXT_MAX 5000 // maximum tooltip text length (WM_USER_TTGETTEXT message) +#define WM_USER_TTGETTEXT WM_APP + 240 // [ID passed to SetCurrentToolTip, buffer limited to TOOLTIP_TEXT_MAX] // button pressed -#define WM_USER_BUTTON WM_APP + 244 // [(LO)WORD buttonID, (LO)WORD udalost byla vyvolana z klavesnice, pokud otevirame menu, vybrat prvni polozku] +#define WM_USER_BUTTON WM_APP + 244 // [(LO)WORD buttonID, (LO)WORD event triggered from the keyboard; if opening a menu, select the first item] // drop down of button pressed -#define WM_USER_BUTTONDROPDOWN WM_APP + 245 // [(LO)WORD buttonID, (LO)WORD udalost byla vyvolana z klavesnice, pokud otevirame menu, vybrat prvni polozku] +#define WM_USER_BUTTONDROPDOWN WM_APP + 245 // [(LO)WORD buttonID, (LO)WORD event triggered from the keyboard; if opening a menu, select the first item] #define WM_USER_KEYDOWN WM_APP + 246 // [(LO)WORD ctrlID, DWORD virtual-key code] @@ -74,92 +74,92 @@ class CGUIProgressBarAbstract // A safer variant, SetProgress2(), exists; check it before using this method. // // The progress control can work in two modes: - // 1) pro 'progress' >= 0 jde o klasicky teplomer 0% az 100% + // 1) for 'progress' >= 0 it is a standard progress bar from 0% to 100% // in this mode, the 'text' variable can be used to set custom text shown in the center - // pokud je 'text' == NULL, zobrazi se uprostred standardni procenta - // 2) pro 'progress' == -1 jde o neurcity stav, kdy maly obdelnicek jezdi tam a zpet + // if 'text' == NULL, the standard percentage is shown in the center + // 2) for 'progress' == -1 it is an indeterminate state in which a small rectangle moves back and forth // the movement is controlled by SetSelfMoveTime(), SetSelfMoveSpeed(), and Stop() // - // Redrawing happens immediately; for most operations it is better to cache the data in the parent + // Redrawing is immediate; for most operations it is better to cache the data in the parent // dialog and start a 100 ms timer that calls this method. // - // Can be called from any thread, but the control's thread must be running or the call will block + // Can be called from any thread; the control's thread must be running, otherwise the call blocks // (SendMessage is used to deliver the 'progress' value to the control); virtual void WINAPI SetProgress(DWORD progress, const char* text) = 0; // Used together with SetProgress(-1) - // specifies how many milliseconds after calling SetProgress(-1) the rectangle keeps moving on its own - // if another SetProgress(-1) is called during that time, the timer starts over - // pokud je 'time'==0, posune se obdelnicek pouze jednou prave pri zavolani SetProgress(-1) - // pro hodnotu 'time'==0xFFFFFFFF se bude obdelnicek posouvat do nekonecna (implicitni hodnota) + // specifies how many milliseconds the rectangle keeps moving on its own after SetProgress(-1) is called + // if another SetProgress(-1) is called during that time, the time is counted from the start again + // if 'time' == 0, the rectangle moves only once, exactly when SetProgress(-1) is called + // for 'time' == 0xFFFFFFFF, the rectangle keeps moving indefinitely (default value) virtual void WINAPI SetSelfMoveTime(DWORD time) = 0; - // ma vyznam v kombinaci s volanim SetProgress(-1) - // urcuje cas mezi posunutim obdelnicku v milisekundach - // implicitni hodnota je 'moveTime'==50, coz znamena 20 pohybu za vterinu + // Used together with SetProgress(-1) + // specifies the time between rectangle moves, in milliseconds + // the default value is 'moveTime' == 50, which means 20 moves per second virtual void WINAPI SetSelfMoveSpeed(DWORD moveTime) = 0; - // ma vyznam v kombinaci s volanim SetProgress(-1) - // pokud se obdelnicek prave pohybuje (diky SetSelfMoveTime), bude zastaven + // Used together with SetProgress(-1) + // if the rectangle is currently moving (because of SetSelfMoveTime), it is stopped virtual void WINAPI Stop() = 0; // Sets the progress and optionally the text in the center // - // proti SetProgress() ma vyhodu v tom, ze pokud je 'progressCurrent' >= 'progressTotal', - // it sets the progress directly: 0% if 'progressTotal' is 0, otherwise 100%, and does not do the calculation - // (it is meaningless and triggers RTC because of type conversion). This "invalid" state occurs, - // for example, when a file grows during the operation or when working with file links - the links have + // Compared to SetProgress(), this method has the advantage that if 'progressCurrent' >= 'progressTotal', + // it sets the progress directly: if 'progressTotal' is 0 it sets 0%, otherwise 100%, and does not perform the calculation + // (it is meaningless and triggers RTC because of the cast). This "disallowed" state occurs, + // for example, when a file grows during the operation or when working with file links - links have // zero size, but then contain data with the size of the linked file. - // If you calculate the value yourself, you must handle this "invalid" state. + // If you do the calculation yourself, you must handle this "disallowed" state. // // The progress control can work in two modes (see SetProgress()); this method can be used - // only in mode 1: - // 1) it is a standard thermometer from 0% to 100% + // only in mode 1): + // 1) it is a standard progress bar from 0% to 100% // in this mode, the 'text' variable can be used to set custom text shown in the center - // pokud je 'text' == NULL, zobrazi se uprostred standardni procenta + // if 'text' == NULL, the standard percentage is shown in the center // - // Redrawing happens immediately; for most operations it is better to cache the data in the parent + // Redrawing is immediate; for most operations it is better to cache the data in the parent // dialog and start a 100 ms timer that calls this method. // - // Can be called from any thread, but the control's thread must be running or the call will block + // Can be called from any thread; the control's thread must be running, otherwise the call blocks // (SendMessage is used to deliver the 'progress' value to the control); virtual void WINAPI SetProgress2(const CQuadWord& progressCurrent, const CQuadWord& progressTotal, const char* text) = 0; - // priklady pouziti: + // Usage examples: // - // 1. obdelnicek chceme posouvat rucne, bez naseho prispeni se nepohybuje + // 1. We want to move the rectangle manually; it does not move on its own // - // SetSelfMoveTime(0) // zakazeme samovolny pohyb - // SetProgress(-1, NULL) // posuneme o jeden dilek + // SetSelfMoveTime(0) // disable automatic movement + // SetProgress(-1, NULL) // move it by one step // ... - // SetProgress(-1, NULL) // posuneme o jeden dilek + // SetProgress(-1, NULL) // move it by one step // - // 2. obdelnicek se ma pohybovat samostatne a do az do zavolani Stop + // 2. The rectangle should move on its own until Stop is called // - // SetSelfMoveTime(0xFFFFFFFF) // nekonecny pohyb - // SetSelfMoveSpeed(50) // 20 pohybu za vterinu - // SetProgress(-1, NULL) // nastartujeme obdelnicek - // ... // neco kutime - // Stop() // zastavime obdelnicek + // SetSelfMoveTime(0xFFFFFFFF) // infinite movement + // SetSelfMoveSpeed(50) // 20 moves per second + // SetProgress(-1, NULL) // start the rectangle + // ... // do some work + // Stop() // stop the rectangle // - // 3. obdelnicek se ma pohybovat omezenou dobu, po ktere se zastavi - // pokud do nej behem teto doby "drcneme", doba se obnovi + // 3. The rectangle should move for a limited time and then stop + // if we "nudge" it during that time, the timeout is refreshed // - // SetSelfMoveTime(1000) // samovolne se pohybuje vterinu, pak se zastavi - // SetSelfMoveSpeed(50) // 20 pohybu za vterinu - // SetProgress(-1, NULL) // nastartujeme obdelnicek na dobu jedne vteriny + // SetSelfMoveTime(1000) // moves on its own for one second, then stops + // SetSelfMoveSpeed(50) // 20 moves per second + // SetProgress(-1, NULL) // start the rectangle for one second // ... - // SetProgress(-1, NULL) // ozivime obdelnicek na dalsi vterinu + // SetProgress(-1, NULL) // keep the rectangle alive for another second // - // 4. behem operace doslo k pausnuti a chceme to vizualizovat v progress bar + // 4. The operation was paused and we want to show it in the progress bar // // SetProgress(0, NULL) // 0% // SetProgress(100, NULL) // 10% // SetProgress(200, NULL) // 20% - // SetProgress(300, "(paused)") // 30% -- misto "30 %" se zobrazi text "(paused)" - // ... (cekame na resume) - // SetProgress(300, NULL) // 30% (text paused) zase vypneme a jedeme dal + // SetProgress(300, "(paused)") // 30% -- instead of "30 %" the text "(paused)" is shown + // ... (waiting for resume) + // SetProgress(300, NULL) // 30% -- turn off the paused text and continue // SetProgress(400, NULL) // 40% // ... }; @@ -169,28 +169,28 @@ class CGUIProgressBarAbstract // CGUIStaticTextAbstract // -#define STF_CACHED_PAINT 0x0000000001 // zobrazeni textu pojede pres cache (nebude blikat) \ - // POZOR: zobrazeni je radove pomalejsi nez bez tohoto flagu. \ - // Nepouzivat v pripade textu v dialogu, ktere se zobrazi \ - // jednou a pak zustavaji nemenne. \ - // Pouzivat u casto/rychle se menicich textu (provadena operace). -#define STF_BOLD 0x0000000002 // pro text bude pouzit tucny font -#define STF_UNDERLINE 0x0000000004 // pro text bude pouzit font s podtrzenim (pro spatnou citelnost \ - // pouzivat pouze pro HyperLink a specialni pripady) -#define STF_DOTUNDERLINE 0x0000000008 // text bude carkovane podtrzeny (pro spatnou citelnost \ - // pouzivat pouze pro HyperLink a specialni pripady) -#define STF_HYPERLINK_COLOR 0x0000000010 // barva textu bude urcena podle barvy hyperlinku -#define STF_END_ELLIPSIS 0x0000000020 // pokud bude text prilis dlouhy, bude ukoncen vypustkou "..." -#define STF_PATH_ELLIPSIS 0x0000000040 // pokud bude text prilis dlouhy, bude zkracen a bude do nej vlozena \ - // vypustka "..." tak, aby byl konec viditelny +#define STF_CACHED_PAINT 0x0000000001 // text is drawn through the cache (it will not flicker) \ + // WARNING: drawing is much slower than without this flag. \ + // Do not use it for dialog text that is displayed \ + // once and then remains unchanged. \ + // Use it for frequently or rapidly changing text (current operation). +#define STF_BOLD 0x0000000002 // a bold font is used for the text +#define STF_UNDERLINE 0x0000000004 // an underlined font is used for the text (because of poor readability \ + // use only for HyperLink and special cases) +#define STF_DOTUNDERLINE 0x0000000008 // the text uses dotted underline (because of poor readability \ + // use only for HyperLink and special cases) +#define STF_HYPERLINK_COLOR 0x0000000010 // the text color is determined by the hyperlink color +#define STF_END_ELLIPSIS 0x0000000020 // if the text is too long, it is truncated with an ellipsis "..." +#define STF_PATH_ELLIPSIS 0x0000000040 // if the text is too long, it is shortened and an ellipsis "..." is inserted \ + // so that the end remains visible #define STF_HANDLEPREFIX 0x0000000080 // Characters after '&' are underlined; cannot be used with STF_END_ELLIPSIS or STF_PATH_ELLIPSIS class CGUIStaticTextAbstract { - // Vsechny metody je mozne volat pouze z threadu parent okna, ve kterem - // byl objekt pripojen na windows control a ziskan ukazatel na toto rozhrani. + // All methods may be called only from the thread of the parent window to whose Windows control + // this object was attached and from which the pointer to this interface was obtained. // - // Control lze v dialogu navstivit z klavesnice, pokud mu priradime styl WS_TABSTOP. + // The control can be reached from the keyboard in a dialog if it is given the WS_TABSTOP style. public: // Sets the control text; calling this method is faster and less computationally expensive // than setting the text with WM_SETTEXT; returns TRUE on success, otherwise FALSE @@ -200,15 +200,15 @@ class CGUIStaticTextAbstract // Returns NULL if SetText has not been called yet and the static control had no text virtual const char* WINAPI GetText() = 0; - // nastavi znak pro oddeleni casti cesty; ma vyznam v pripade STF_PATH_ELLIPSIS; - // implicitne je nastaveno na '\\'; + // Sets the character used to separate path components; used with STF_PATH_ELLIPSIS; + // default is '\\'; virtual void WINAPI SetPathSeparator(char separator) = 0; // Sets the text to be shown as a tooltip // returns TRUE if a copy of the text was allocated successfully, otherwise FALSE virtual BOOL WINAPI SetToolTipText(const char* text) = 0; - // priradi okno a id, kteremu se pri zobrazeni tooltipu zasle WM_USER_TTGETTEXT + // Sets the window and ID to which WM_USER_TTGETTEXT is sent when the tooltip is displayed virtual void WINAPI SetToolTip(HWND hNotifyWindow, DWORD id) = 0; }; @@ -219,10 +219,10 @@ class CGUIStaticTextAbstract class CGUIHyperLinkAbstract { - // Vsechny metody je mozne volat pouze z threadu parent okna, ve kterem - // byl objekt pripojen na windows control a ziskan ukazatel na toto rozhrani. + // All methods may be called only from the thread of the parent window to whose Windows control + // this object was attached and from which the pointer to this interface was obtained. // - // Control lze v dialogu navstivit z klavesnice, pokud mu priradime styl WS_TABSTOP. + // The control can be reached from the keyboard in a dialog if it is given the WS_TABSTOP style. public: // Sets the control text; calling this method is faster and less computationally expensive // than setting the text with WM_SETTEXT; returns TRUE on success, otherwise FALSE @@ -232,19 +232,19 @@ class CGUIHyperLinkAbstract // Returns NULL if SetText has not been called yet and the static control had no text virtual const char* WINAPI GetText() = 0; - // priradi akci otevreni URL adresy (file="https://www.altap.cz") nebo - // spusteni programu (file="C:\\TEST.EXE"); na parametr je volano - // ShellExecute s 'open' commandem. + // Assigns an action that opens a URL (file="https://www.altap.cz") or + // launches a program (file="C:\\TEST.EXE"); ShellExecute + // is called for the parameter with the 'open' verb. virtual void WINAPI SetActionOpen(const char* file) = 0; - // priradi akci PostCommand(WM_COMMAND, command, 0) do parent okna + // Assigns the action PostCommand(WM_COMMAND, command, 0) to the parent window virtual void WINAPI SetActionPostCommand(WORD command) = 0; // Assigns the action that shows the hint and tooltip text 'text' - // pokud je text NULL, je mozne tooltip priradit volanim metody - // SetToolTipText nebo SetToolTip; metoda pak vraci vzdy TRUE - // pokud je text ruzny od NULL, vraci metoda TRUE, pokud se podarilo - // naalokovat kopii textu, jinak vraci FALSE + // if 'text' is NULL, the tooltip can be assigned by calling + // SetToolTipText or SetToolTip; the method then always returns TRUE + // if 'text' is not NULL, the method returns TRUE if it succeeds + // in allocating a copy of the text; otherwise it returns FALSE // the tooltip can be shown with Space/Up/Down (if the control // has focus) or by clicking the mouse; the hint (tooltip) is then shown directly // below the text and stays open until the user clicks outside it with the mouse or @@ -255,7 +255,7 @@ class CGUIHyperLinkAbstract // returns TRUE if a copy of the text was allocated successfully, otherwise FALSE virtual BOOL WINAPI SetToolTipText(const char* text) = 0; - // priradi okno a id, kteremu se pri zobrazeni tooltipu zasle WM_USER_TTGETTEXT + // Sets the window and ID to which WM_USER_TTGETTEXT is sent when the tooltip is displayed virtual void WINAPI SetToolTip(HWND hNotifyWindow, DWORD id) = 0; }; @@ -266,13 +266,13 @@ class CGUIHyperLinkAbstract class CGUIButtonAbstract { - // Vsechny metody je mozne volat pouze z threadu parent okna, ve kterem - // byl objekt pripojen na windows control a ziskan ukazatel na toto rozhrani. + // All methods may be called only from the thread of the parent window to whose Windows control + // this object was attached and from which the pointer to this interface was obtained. public: // Sets the text to be shown as a tooltip; returns TRUE on success, otherwise FALSE virtual BOOL WINAPI SetToolTipText(const char* text) = 0; - // priradi okno a id, kteremu se pri zobrazeni tooltipu zasle WM_USER_TTGETTEXT + // Sets the window and ID to which WM_USER_TTGETTEXT is sent when the tooltip is displayed virtual void WINAPI SetToolTip(HWND hNotifyWindow, DWORD id) = 0; }; @@ -283,22 +283,22 @@ class CGUIButtonAbstract class CGUIColorArrowButtonAbstract { - // Vsechny metody je mozne volat pouze z threadu parent okna, ve kterem - // byl objekt pripojen na windows control a ziskan ukazatel na toto rozhrani. + // All methods may be called only from the thread of the parent window to whose Windows control + // this object was attached and from which the pointer to this interface was obtained. public: - // nastavi barvu textu 'textColor' a barvu pozadi 'bkgndColor' + // Sets the text color 'textColor' and background color 'bkgndColor' virtual void WINAPI SetColor(COLORREF textColor, COLORREF bkgndColor) = 0; - // nastavi barvu textu 'textColor' + // Sets the text color 'textColor' virtual void WINAPI SetTextColor(COLORREF textColor) = 0; - // nastavi barvu pozadi 'bkgndColor' + // Sets the background color 'bkgndColor' virtual void WINAPI SetBkgndColor(COLORREF bkgndColor) = 0; - // vrati barvu textu + // Returns the text color virtual COLORREF WINAPI GetTextColor() = 0; - // vrati barvu pozadi + // Returns the background color virtual COLORREF WINAPI GetBkgndColor() = 0; }; @@ -319,12 +319,12 @@ class CGUIColorArrowButtonAbstract struct MENU_TEMPLATE_ITEM { int RowType; // MNTT_* - int TextResID; // resource textu + int TextResID; // text resource BYTE SkillLevel; // MNTS_* - DWORD ID; // genrovany command - short ImageIndex; // -1 = zadna ikonka + DWORD ID; // generated command + short ImageIndex; // -1 = no icon DWORD State; - DWORD* Enabler; // ridici promenna pro enablovani polozky + DWORD* Enabler; // state variable for enabling the item }; // @@ -363,9 +363,9 @@ struct MENU_TEMPLATE_ITEM #define MENU_LEVEL_ADVANCED 0x00000004 #define MENU_POPUP_THREECOLUMNS 0x00000001 -#define MENU_POPUP_UPDATESTATES 0x00000002 // pred otevrenim se zavola UpdateStates +#define MENU_POPUP_UPDATESTATES 0x00000002 // UpdateStates is called before opening -// tyto flagy jsou v prubehu vetve modifikovany pro jednolive popupy +// these flags are modified for individual popups within a Track branch #define MENU_TRACK_SELECT 0x00000001 // If this flag is set, the function select item specified by SetSelectedItemIndex. //#define MENU_TRACK_LEFTALIGN 0x00000000 // If this flag is set, the function positions the shortcut menu so that its left side is aligned with the coordinate specified by the x parameter. //#define MENU_TRACK_TOPALIGN 0x00000000 // If this flag is set, the function positions the shortcut menu so that its top side is aligned with the coordinate specified by the y parameter. @@ -375,7 +375,7 @@ struct MENU_TEMPLATE_ITEM #define MENU_TRACK_VCENTERALIGN 0x00000008 // If this flag is set, the function centers the shortcut menu vertically relative to the coordinate specified by the y parameter. #define MENU_TRACK_BOTTOMALIGN 0x00000010 // If this flag is set, the function positions the shortcut menu so that its bottom side is aligned with the coordinate specified by the y parameter. #define MENU_TRACK_VERTICAL 0x00000100 // If the menu cannot be shown at the specified location without overlapping the excluded rectangle, the system tries to accommodate the requested vertical alignment before the requested horizontal alignment. -// spolecne flagy pro jednu vetev Track +// flags shared by one Track branch #define MENU_TRACK_NONOTIFY 0x00001000 // If this flag is set, the function does not send notification messages when the user clicks on a menu item. #define MENU_TRACK_RETURNCMD 0x00002000 // If this flag is set, the function returns the menu item identifier of the user's selection in the return value. //#define MENU_TRACK_LEFTBUTTON 0x00000000 // If this flag is set, the user can select menu items with only the left mouse button. @@ -414,13 +414,13 @@ Type MENU_TYPE_OWNERDRAW Item drawing is handled by the window that owns the menu. Each menu item receives WM_MEASUREITEM and - WM_DRAWITEM messages. The TypeData variable contains a 32-bit + WM_DRAWITEM messages. TypeData contains a 32-bit application-defined value. MENU_TYPE_RADIOCHECK Checked items are shown with a dot instead of a check mark, je-li HBmpChecked rovno NULL. - MENU_TYPE_SEPARATOR Horizontal separator line. TypeData has no meaning. + MENU_TYPE_SEPARATOR Horizontal separator line. TypeData is unused. MENU_TYPE_STRING The item contains a text string. TypeData points to a null- terminated string. @@ -437,7 +437,7 @@ State MENU_STATE_DEFAULT The menu can contain only one default item. It is drawn in bold. - MENU_STATE_GRAYED Disables the item - it is shown gray and cannot be selected. + MENU_STATE_GRAYED Disables the item; it is shown in gray and cannot be selected. SkillLevel User skill level of the item. This member can have one of these values: @@ -455,31 +455,31 @@ SubMenu HBmpChecked Handle of the bitmap shown before the item when the item is - checked. Je-li tato promenna rovna NULL, pouzije + checked. If this member is NULL, the default bitmap is used. If the MENU_TYPE_RADIOCHECK bit is set, the default bitmap is a dot; otherwise it is a check mark. If ImageIndex is not -1, this bitmap is not used. HBmpUnchecked Handle of the bitmap shown before the item when the item is not - checked. Jeli tato promenna rovna NULL, nebude + checked. If this member is NULL, no bitmap is shown. If ImageIndex is not -1, this bitmap is not used. ImageIndex Index bitmapy v ImageListu CMenuPopup::HImageList. Bitmapa je vykreslena before the item, depending on MENU_STATE_CHECKED and MENU_STATE_GRAYED. - If the variable is -1, nothing is drawn. + If the member is -1, nothing is drawn. Enabler - Ukazatel na DWORD, ktery urcuje stav polozky: TRUE->enabled, FALSE->grayed. - Pokud je NULL, polozka bude enabled. + Pointer to a DWORD that determines the item state: TRUE->enabled, FALSE->grayed. + If it is NULL, the item is enabled. */ class CGUIMenuPopupAbstract { - // Vsechny metody je mozne volat pouze z threadu parent okna, ve kterem - // byl objekt pripojen na windows control a ziskan ukazatel na toto rozhrani. + // All methods may be called only from the thread of the parent window to whose Windows control + // this object was attached and from which the pointer to this interface was obtained. public: // // LoadFromTemplate @@ -1075,8 +1075,8 @@ class CGUIMenuPopupAbstract class CGUIMenuBarAbstract { - // Vsechny metody je mozne volat pouze z threadu parent okna, ve kterem - // byl objekt pripojen na windows control a ziskan ukazatel na toto rozhrani. + // All methods may be called only from the thread of the parent window to whose Windows control + // this object was attached and from which the pointer to this interface was obtained. public: // // CreateWnd @@ -1152,7 +1152,7 @@ class CGUIMenuBarAbstract // prepne menu do Menu mode (jako by user stisknul a pustil Alt) virtual void WINAPI EnterMenu() = 0; - // vraci TRUE, pokud je menu v Menu mode + // returns TRUE if the menu is in Menu mode virtual BOOL WINAPI IsInMenuLoop() = 0; // prepina menu do Help mode (Shift + F1) virtual void WINAPI SetHelpMode(BOOL helpMode) = 0; @@ -1180,13 +1180,13 @@ class CGUIMenuBarAbstract // Toolbar Styles -#define TLB_STYLE_IMAGE 0x00000001 // budou zobrazovany ikonky s ImageIndex != -1 \ - // zaroven GetNeededSpace bude pocitat s vyskou ikonek -#define TLB_STYLE_TEXT 0x00000002 // budou zobrazovany u polozek s nastavenym TLBI_STYLE_SHOWTEXT \ - // zaroven GetNeededSpace bude pocitat s velikosti fontu -#define TLB_STYLE_ADJUSTABLE 0x00000004 // lze toolbar konfigurovat? -#define TLB_STYLE_VERTICAL 0x00000008 // tlacitka jsou pod sebou, separatory vodorovne, vylucuje se s TLB_STYLE_TEXT, \ - // protoze svisle texty nejsou podporovany +#define TLB_STYLE_IMAGE 0x00000001 // icons with ImageIndex != -1 are displayed \ + // GetNeededSpace also accounts for icon height +#define TLB_STYLE_TEXT 0x00000002 // text is displayed for items with TLBI_STYLE_SHOWTEXT set \ + // GetNeededSpace also accounts for font size +#define TLB_STYLE_ADJUSTABLE 0x00000004 // can the toolbar be customized? +#define TLB_STYLE_VERTICAL 0x00000008 // buttons are arranged vertically, separators horizontally; incompatible with TLB_STYLE_TEXT, \ + // because vertical text is not supported // Toolbar Item Masks #define TLBI_MASK_ID 0x00000001 // Retrieves or sets the 'ID' member. @@ -1207,8 +1207,8 @@ class CGUIMenuBarAbstract // clicks it. The button has a different background color \ // when it is in the pressed state. -#define TLBI_STYLE_RADIO 0x00000002 // Pokud neni pri kliknuti TLBI_STATE_CHECKED, prepne se \ - // do tohoto stavu. Pokud uz tam je, zustane tam. +#define TLBI_STYLE_RADIO 0x00000002 // If TLBI_STATE_CHECKED is not set when clicked, it switches to \ + // that state. If it is already set, it stays there. #define TLBI_STYLE_DROPDOWN 0x00000004 // Creates a drop-down style button that can display a \ // list when the button is clicked. Instead of the \ @@ -1235,7 +1235,7 @@ class CGUIMenuBarAbstract #define TLBI_STYLE_SEPARATEDROPDOWN 0x00000080 // Specifies that the button will have a drop-down arrow, \ // in separated section. -#define TLBI_STYLE_FIXEDWIDTH 0x00000100 // Sirka teto polozky neni automaticky pocitana. +#define TLBI_STYLE_FIXEDWIDTH 0x00000100 // the width of this item is not calculated automatically. // Toolbar Item States #define TLBI_STATE_CHECKED 0x00000001 // The button has the TLBI_STYLE_CHECK style and is being clicked. @@ -1255,7 +1255,7 @@ struct TLBI_ITEM_INFO2 int ImageIndex; HICON HIcon; HICON HOverlay; - DWORD CustomData; // FIXME_X64 - male pro ukazatel, neni nekdy potreba? + DWORD CustomData; // FIXME_X64 - too small for a pointer; is it ever needed? DWORD* Enabler; DWORD Index; @@ -1322,18 +1322,18 @@ struct TOOLBAR_PADDING // The padding values are used to create a blank area struct TOOLBAR_TOOLTIP { - HWND HToolBar; // okno, ktere se dotazuje na tooltip - DWORD ID; // ID buttonu, pro ktere je pozadovan tooltip - DWORD Index; // index buttonu, pro ktere je pozadovan tooltip - DWORD CustomData; // custom data buttonu, pokud jsou definovany // FIXME_X64 - male pro ukazatel, neni nekdy potreba? - char* Buffer; // tento buffer je treba naplnit, maximalni pocet znaku je TOOLTIP_TEXT_MAX - // implicitne message je na nulty znak vlozen terminator + HWND HToolBar; // window that requests the tooltip + DWORD ID; // ID of the button whose tooltip is requested + DWORD Index; // index of the button whose tooltip is requested + DWORD CustomData; // custom data of the button, if defined // FIXME_X64 - too small for a pointer; is it ever needed? + char* Buffer; // this buffer must be filled; the maximum number of characters is TOOLTIP_TEXT_MAX + // by default, the message is terminated at the first character }; class CGUIToolBarAbstract { - // Vsechny metody je mozne volat pouze z threadu parent okna, ve kterem - // byl objekt pripojen na windows control a ziskan ukazatel na toto rozhrani. + // All methods may be called only from the thread of the parent window to whose Windows control + // this object was attached and from which the pointer to this interface was obtained. public: // // CreateWnd @@ -1859,8 +1859,8 @@ class CGUIIconListAbstract virtual BOOL WINAPI Create(int imageWidth, int imageHeight, int imageCount) = 0; // Creates the image list from the supplied Windows image list ('hIL'); 'requiredImageSize' specifies - // rozmer ikony, pokud je -1, pouziji se rozmery z 'hIL'; v pripade uspechu vraci TRUE, - // jinak FALSE + // the icon size; if it is -1, the size from 'hIL' is used; returns TRUE on success, + // otherwise FALSE virtual BOOL WINAPI CreateFromImageList(HIMAGELIST hIL, int requiredImageSize) = 0; // Creates the image list from the specified PNG resource; 'hInstance' and 'lpBitmapName' specify the resource, @@ -1872,19 +1872,19 @@ class CGUIIconListAbstract // Replaces the icon at the given index with 'hIcon'; returns TRUE on success, otherwise FALSE virtual BOOL WINAPI ReplaceIcon(int index, HICON hIcon) = 0; - // vytvori ikonu z daneho indexu a vrati jeji handle; volajici je zodpovedny za jeji destrukci - // (volani DestroyIcon(hIcon)); v pripade neuspechu vraci NULL + // Creates an icon from the specified index and returns its handle; the caller is responsible for destroying it + // (call DestroyIcon(hIcon)); returns NULL on failure virtual HICON WINAPI GetIcon(int index) = 0; - // vytvori se na zaklade PNG podaneho v pameti; 'rawPNG' je ukazatel na pamet obsahujici PNG - // (napriklad nactene ze souboru) a 'rawPNGSize' urcuje velikost pameti obsazene PNG v bajtech, - // 'imageWidth' udava sirku jedne ikony v bodech; v pripade uspechu vraci TRUE, jinak FALSE - // poznamka: PNG musi byt pruh ikon jeden radek vysoky - // poznamka: PNG je vhodne komprimovat pomoci PNGSlim, viz https://forum.altap.cz/viewtopic.php?f=15&t=3278 + // Creates the image list from PNG data supplied in memory; 'rawPNG' is a pointer to memory containing the PNG + // (for example loaded from a file) and 'rawPNGSize' specifies the size of the memory occupied by the PNG in bytes, + // 'imageWidth' specifies the width of one icon in pixels; returns TRUE on success, otherwise FALSE + // Note: the PNG must be a one-row strip of icons + // Note: it is recommended to compress the PNG with PNGSlim; see https://forum.altap.cz/viewtopic.php?f=15&t=3278 virtual BOOL WINAPI CreateFromRawPNG(const void* rawPNG, DWORD rawPNGSize, int imageWidth) = 0; - // vytvori se jako kopie jineho (vytvoreneho) icon listu; pokud je 'grayscale' TRUE, - // provede se zaroven konverze na cernobilou verzi; v pripade uspechu vraci TRUE, jinak FALSE + // is created as a copy of another (created) icon list; if 'grayscale' is TRUE, + // it is also converted to a black-and-white version; returns TRUE on success, otherwise FALSE virtual BOOL WINAPI CreateAsCopy(const CGUIIconListAbstract* iconList, BOOL grayscale) = 0; // Creates an HIMAGELIST and returns its handle, or NULL on failure. @@ -1903,7 +1903,7 @@ class CGUIIconListAbstract // byl objekt pripojen na windows control. // -// Bitove masky pro EnableToolbar() a CheckToolbar() +// bit masks for EnableToolbar() and CheckToolbar() #define TLBHDRMASK_MODIFY 0x01 #define TLBHDRMASK_NEW 0x02 #define TLBHDRMASK_DELETE 0x04 @@ -1911,27 +1911,27 @@ class CGUIIconListAbstract #define TLBHDRMASK_UP 0x10 #define TLBHDRMASK_DOWN 0x20 -// Identifikace tlacitek pro WM_COMMAND, viz SetNotifyWindow() +// button identifiers for WM_COMMAND; see SetNotifyWindow() #define TLBHDR_MODIFY 1 #define TLBHDR_NEW 2 #define TLBHDR_DELETE 3 #define TLBHDR_SORT 4 #define TLBHDR_UP 5 #define TLBHDR_DOWN 6 -// Pocet polozek +// number of items #define TLBHDR_COUNT 6 class CGUIToolbarHeaderAbstract { public: - // standardne jsou vsechna tlacitka povolena; po zavolani teto metody budou povolena - // pouze tlacitka odpovidajici masce 'enableMask', ktera se sklada z jedne nebo vice - // (sectenych) TLBHDRMASK_xxx hodnot + // By default all buttons are enabled; after calling this method, only the buttons matching mask 'enableMask' are enabled, + // where the mask consists of one or more + // combined TLBHDRMASK_xxx values virtual void WINAPI EnableToolbar(DWORD enableMask) = 0; - // standardne jsou vsechna tlacitka nezamacknuta; po zavolani teto metody budou zamacknuta - // tlacitka odpovidajici masce 'checkMask', ktera se sklada z jedne nebo vice - // (sectenych) TLBHDRMASK_xxx hodnot + // By default all buttons are unpressed; after calling this method, the buttons matching mask 'checkMask' are pressed, + // where the mask consists of one or more + // combined TLBHDRMASK_xxx values virtual void WINAPI CheckToolbar(DWORD checkMask) = 0; // By calling this method, the caller specifies the 'hWnd' window that receives @@ -1948,11 +1948,11 @@ class CGUIToolbarHeaderAbstract // CSalamanderGUIAbstract // -#define BTF_CHECKBOX 0x00000001 // tlacitko se chova jako checkbox -#define BTF_DROPDOWN 0x00000002 // tlacitko vzadu obsahuje drop down cast, posila WM_USER_BUTTONDROPDOWN message do parenta -#define BTF_LBUTTONDOWN 0x00000004 // tlacitko reaguje na LBUTTONDOWN a posila WM_USER_BUTTON -#define BTF_RIGHTARROW 0x00000008 // tlacitko ma na konci sipku ukazujici vpravo -#define BTF_MORE 0x00000010 // tlacitko ma na konci symbol pro rozbaleni dialogu +#define BTF_CHECKBOX 0x00000001 // button behaves like a checkbox +#define BTF_DROPDOWN 0x00000002 // button has a drop-down part at the end and sends WM_USER_BUTTONDROPDOWN to the parent +#define BTF_LBUTTONDOWN 0x00000004 // button reacts to LBUTTONDOWN and sends WM_USER_BUTTON +#define BTF_RIGHTARROW 0x00000008 // button has a right-pointing arrow at the end +#define BTF_MORE 0x00000010 // button has the symbol for expanding the dialog at the end class CSalamanderGUIAbstract { @@ -1961,55 +1961,55 @@ class CSalamanderGUIAbstract // // ProgressBar // - // Slouzi k zobrazeni stavu operace v procentech uz vykonane prace. - // Ma vyznam u operaci, ktere mohou zabrat vetsi mnostvi casu. Tam je - // progress lepsi nez pouhy kurzor WAIT. + // Used to display the state of an operation as the percentage of work already done. + // It is useful for operations that can take a longer time. In that case a + // progress bar is better than a plain WAIT cursor. // - // pripoji Salamanderovsky progress bar na Windows control (tento control urcuje pozici - // progress bary); 'hParent' je handle parent okna (dialog nebo okno); ctrlID je ID - // Windows controlu; pri uspesnem pripojeni vraci rozhrani progress bary, - // jinak vraci NULL; rozhrani je platne az do okamziku destrukce (doruceni WM_DESTROY) - // Windows controlu; po pripojeni je progress bar nastaven na 0%; - // frame si kresli ve sve rezimu, takze controlu neprirazovat flagy SS_WHITEFRAME | WS_BORDER + // Attaches a Salamander progress bar to a Windows control (this control determines the position of the + // progress bar); 'hParent' is the handle of the parent window (dialog or window); ctrlID is the ID of the + // Windows control; on successful attachment returns the progress bar interface, + // otherwise returns NULL; the interface remains valid until the Windows control is destroyed (WM_DESTROY + // is delivered to the Windows control); after attachment the progress bar is set to 0%; + // it draws its own frame, so do not assign SS_WHITEFRAME | WS_BORDER to the control virtual CGUIProgressBarAbstract* WINAPI AttachProgressBar(HWND hParent, int ctrlID) = 0; /////////////////////////////////////////////////////////////////////////// // // StaticText // - // Slouzi pro zobrazeni nestandardnich textu v dialogu (tucny, podtrzeny), - // textu ktere se rychle meni a blikaly by nebo textu s nepredvidatelnou delkou, - // ktere je treba inteligentne zkratit. - // - // pripoji Salamanderovsky StaticText na Windows control (tento control urcuje pozici - // StaticTextu); 'hParent' je handle parent okna (dialog nebo okno); ctrlID je ID; - // 'flags' je z rodiny STF_*, muze byt 0 nebo libovolna kombinace hodnot; - // Windows controlu; pri uspesnem pripojeni vraci rozhrani StaticTextu, - // jinak vraci NULL; rozhrani je platne az do okamziku destrukce (doruceni WM_DESTROY) - // Windows controlu; po pripojeni je vytazen text a zarovnani z Windows controlu. - // testovano na Windows controlu "STATIC" + // Used to display nonstandard text in a dialog (bold, underlined), + // text that changes quickly and would flicker, or text with unpredictable length + // that must be shortened intelligently. + // + // Attaches Salamander StaticText to a Windows control (this control determines the position of the + // StaticText); 'hParent' is the handle of the parent window (dialog or window); ctrlID is the ID; + // 'flags' is from the STF_* family; it can be 0 or any combination of values; + // on successful attachment returns the StaticText interface, + // otherwise returns NULL; the interface remains valid until the Windows control is destroyed (WM_DESTROY) + // is delivered to the Windows control; after attachment, the text and alignment are taken from the Windows control. + // Tested on the Windows "STATIC" control virtual CGUIStaticTextAbstract* WINAPI AttachStaticText(HWND hParent, int ctrlID, DWORD flags) = 0; /////////////////////////////////////////////////////////////////////////// // // HyperLink // - // Slouzi pro zobrazeni hyperlinku. Po kliknuti je mozne otevrit URL adresu - // nebo spustit soubor (SetActionOpen), nebo nechat postnout command zpet - // do dialogu (SetActionPostCommand). - // Control je pristupny pres klavesu TAB (muze mit focus), ale je treba mu - // nastavit WS_TABSTOP. Akci pak vyvolame klavesou Space. Pravym tlacitkem - // nebo pomoci Shift+F10 lze vyvolat menu s moznosti nakopirovat text controlu - // na clipboard. - // - // pripoji Salamanderovsky HyperLink na Windows control (tento control urcuje pozici - // HyperLinku); 'hParent' je handle parent okna (dialog nebo okno); ctrlID je ID Windows controlu; - // 'flags' je z rodiny STF_*, muze byt 0 nebo libovolna kombinace hodnot; - // doporucena kombinace pro HyperLink je STF_UNDERLINE | STF_HYPERLINK_COLOR - // pri uspesnem pripojeni vraci rozhrani HyperLinku, jinak vraci NULL; rozhrani je - // platne az do okamziku destrukce (doruceni WM_DESTROY) Windows controlu; po pripojeni - // je vytazen text a zarovnani z Windows controlu. - // testovano na Windows controlu "STATIC" + // Used to display a hyperlink. Clicking it can open a URL + // or launch a file (SetActionOpen), or post a command back + // to the dialog (SetActionPostCommand). + // The control is accessible with the TAB key (it can take focus), but it must have + // WS_TABSTOP set. The action is then invoked with the Space key. Right-clicking + // or Shift+F10 can open a menu with an option to copy the control text + // to the clipboard. + // + // Attaches Salamander HyperLink to a Windows control (this control determines the position of the + // HyperLink); 'hParent' is the handle of the parent window (dialog or window); ctrlID is the ID of the Windows control; + // 'flags' is from the STF_* family; it can be 0 or any combination of values; + // the recommended combination for HyperLink is STF_UNDERLINE | STF_HYPERLINK_COLOR + // on successful attachment returns the HyperLink interface, otherwise returns NULL; the interface is + // valid until the Windows control is destroyed (WM_DESTROY is delivered); after attachment, + // the text and alignment are taken from the Windows control. + // Tested on the Windows "STATIC" control virtual CGUIHyperLinkAbstract* WINAPI AttachHyperLink(HWND hParent, int ctrlID, DWORD flags) = 0; /////////////////////////////////////////////////////////////////////////// @@ -2032,15 +2032,15 @@ class CSalamanderGUIAbstract // ColorArrowButton // // Creates a button with a colored rectangle followed by a right-pointing arrow. - // (pokud je showArrow==TRUE) - // The rectangle shows text that can have a different color than the rectangle background. - // It is used in color configuration dialogs, where it can display one or two colors. - // Clicking it opens a popup menu with options for selecting which color is being configured. + // (if showArrow==TRUE) + // The rectangle displays text that can have a different color than the rectangle background. + // It is used in color configurations, where it can display one or two colors. + // Clicking it opens a popup menu with options for choosing which color is being configured. // - // Attaches a Salamander ColorArrowButton to a Windows control (that control determines the position, - // text and command of the ColorArrowButton); 'hParent' is the handle of the parent window (dialog or window); + // Attaches a Salamander ColorArrowButton to a Windows control (this control determines the position, + // text, and command of the ColorArrowButton); 'hParent' is the handle of the parent window (dialog or window); // ctrlID is the ID of the Windows control; - // pri uspesnem pripojeni vraci rozhrani ColorArrowButtonu, jinak vraci NULL; rozhrani je + // if attachment succeeds, returns the ColorArrowButton interface, otherwise returns NULL; the interface is // valid until the Windows control is destroyed (WM_DESTROY is delivered); // Tested on the Windows "BUTTON" control. virtual CGUIColorArrowButtonAbstract* WINAPI AttachColorArrowButton(HWND hParent, int ctrlID, BOOL showArrow) = 0; @@ -2067,7 +2067,7 @@ class CSalamanderGUIAbstract // Creates an empty popup menu. Returns an interface pointer or // NULL on failure. virtual CGUIMenuPopupAbstract* WINAPI CreateMenuPopup() = 0; - // Slouzi pro uvolneni alokovaneho menu. + // releases the allocated menu. virtual BOOL WINAPI DestroyMenuPopup(CGUIMenuPopupAbstract* popup) = 0; /////////////////////////////////////////////////////////////////////////// @@ -2079,17 +2079,17 @@ class CSalamanderGUIAbstract // that receives commands and notifications. Returns an interface pointer or NULL // on failure. virtual CGUIMenuBarAbstract* WINAPI CreateMenuBar(CGUIMenuPopupAbstract* menu, HWND hNotifyWindow) = 0; - // Slouzi pro uvolneni alokovane menu bar. Zaroven destruuje okno. + // releases the allocated menu bar. Also destroys the window. virtual BOOL WINAPI DestroyMenuBar(CGUIMenuBarAbstract* menuBar) = 0; /////////////////////////////////////////////////////////////////////////// // // ToolBar support // - // Slouzi pro vytvoreni neaktivni (sede) verze bitmap pro menu nebo toolbar. - // Ze zdrojove bitmapy 'hSource' vytvori bitmapu ve stupnich sedi 'hGrayscale' - // a cernobilou masku 'hMask'. Barva 'transparent' je povazovana za pruhlednou. - // Pri uspechu vraci TRUE a 'hGrayscale' a 'hMask'; pri chybe vraci FALSE. + // Used to create a disabled (gray) version of bitmaps for a menu or toolbar. + // From source bitmap 'hSource' it creates grayscale bitmap 'hGrayscale' + // and black-and-white mask 'hMask'. Color 'transparent' is treated as transparent. + // On success it returns TRUE and outputs 'hGrayscale' and 'hMask'; on error it returns FALSE. virtual BOOL WINAPI CreateGrayscaleAndMaskBitmaps(HBITMAP hSource, COLORREF transparent, HBITMAP& hGrayscale, HBITMAP& hMask) = 0; @@ -2097,48 +2097,48 @@ class CSalamanderGUIAbstract // // ToolBar // - // Slouzi pro vytvoreni tool bar; 'hNotifyWindow' identifikuje okno, kteremu - // budou zasilany commandy a notifikace. Vraci ukazatel na iface nebo NULL - // pri chybe. + // Used to create a toolbar; 'hNotifyWindow' identifies the window to which + // commands and notifications are sent. Returns an interface pointer or NULL + // on failure. virtual CGUIToolBarAbstract* WINAPI CreateToolBar(HWND hNotifyWindow) = 0; - // Slouzi pro uvolneni alokovane tool bar. Zaroven destruuje okno. + // releases the allocated toolbar. Also destroys the window. virtual BOOL WINAPI DestroyToolBar(CGUIToolBarAbstract* toolBar) = 0; /////////////////////////////////////////////////////////////////////////// // // ToolTip // - // Tato metoda spusti casovac a pokud do jeho vyprseni neni zavolana znovu - // pozada okno 'hNotifyWindow' o text pomoci zpravy WM_USER_TTGETTEXT, - // ktery pak zobrazi pod kurzor na jeho aktualnich souradnicich. - // Promenna 'id' slouzi k rozliseni oblasti pri komunikaci s oknem 'hNotifyWindow'. - // Pokud bude tato metoda zavolana vicekrat se stejnym parametrem 'id', budou - // se tyto dalsi volani ignorovat. - // Hodnota 0 parametru 'hNotifyWindow' je vyhrazena pro zhasnuti okna a preruseni - // beziciho casovace. + // This method starts a timer and, if it is not called again before it expires, + // asks window 'hNotifyWindow' for the text by sending message WM_USER_TTGETTEXT, + // which it then shows below the cursor at its current coordinates. + // Variable 'id' is used to distinguish areas when communicating with window 'hNotifyWindow'. + // If this method is called several times with the same 'id' parameter, + // those additional calls are ignored. + // Value 0 of parameter 'hNotifyWindow' is reserved for hiding the window and stopping + // the running timer. virtual void WINAPI SetCurrentToolTip(HWND hNotifyWindow, DWORD id) = 0; - // potlaci zobrazeni tooltipu na aktualnich souradnicich mysi - // uzitecne volat pri aktivaci okna, ve kterem se tooltipy pouzivaji - // nebude tak dochazet k nechtenemu zobrazeni tooltipu + // Suppresses tooltip display at the current mouse coordinates + // Useful to call when activating a window that uses tooltips + // so that tooltips are not shown unintentionally virtual void WINAPI SuppressToolTipOnCurrentMousePos() = 0; /////////////////////////////////////////////////////////////////////////// // // XP Visual Styles // - // Pokud je zavolana pod operacnim system podporujicim vizualni styly, - // vola SetWindowTheme(hWindow, L" ", L" ") pro zakazani vizualnich stylu - // pro okno 'hWindow' - // vraci TRUE, pokud operacni system podporuje vizualni styly, jinak vraci FALSE + // When called on an operating system that supports visual styles, + // it calls SetWindowTheme(hWindow, L" ", L" ") to disable visual styles + // for window 'hWindow' + // returns TRUE if the operating system supports visual styles, otherwise FALSE virtual BOOL WINAPI DisableWindowVisualStyles(HWND hWindow) = 0; /////////////////////////////////////////////////////////////////////////// // // IconList // - // Dve metody pro alokaci a destrukci objektu IconList slouziciho pro drzeni - // 32bpp ikonek (3 x 8 bitu pro barvu a 8 bitu pro alfa transparenci) - // Dalsi operace nad IconListem viz popis CGUIIconListAbstract + // Two methods for allocating and destroying the IconList object used to hold + // 32bpp icons (3 x 8 bits for color and 8 bits for alpha transparency) + // For other operations on IconList, see the description of CGUIIconListAbstract virtual CGUIIconListAbstract* WINAPI CreateIconList() = 0; virtual BOOL WINAPI DestroyIconList(CGUIIconListAbstract* iconList) = 0; @@ -2146,23 +2146,23 @@ class CSalamanderGUIAbstract // // ToolTip support // - // Prohleda 'buf' na prvni vyskyt znaku '\t'. Pokud je 'stripHotKey' TRUE, ukonci + // Searches 'buf' for the first occurrence of '\t'. If 'stripHotKey' is TRUE, the // string is terminated at that character. Otherwise a space is inserted in its place and the rest - // textu se ozavorkuje. Buffer 'buf' musi byt pri 'stripHotKey' FALSE dost velky - // for the text in the buffer to be extended by two characters (parentheses). + // of the text is enclosed in parentheses. Buffer 'buf' must be large enough when 'stripHotKey' is FALSE + // for the text in the buffer to grow by two characters (the parentheses). virtual void WINAPI PrepareToolTipText(char* buf, BOOL stripHotKey) = 0; /////////////////////////////////////////////////////////////////////////// // // Subject with file/dir name truncated if needed // - // Sets the text produced by sprintf(subjectFormatString, fileName) in the 'subjectWnd' static control. - // The format string 'subjectFormatString' must contain exactly one '%s' (where - // 'fileName' is inserted). If the text would exceed the static control length, it is truncated by shortening + // Sets the text produced by sprintf(, subjectFormatString, fileName) in static control 'subjectWnd'. + // Format string 'subjectFormatString' must contain exactly one '%s' (at the position where + // 'fileName' is inserted). If the text would exceed the length of the static control, it is shortened by shortening // 'fileName'. It also converts 'fileName' according to SALCFG_FILENAMEFORMAT (so it matches - // s tim, jak je 'fileName' zobrazeno v panelu) pomoci CSalamanderGeneralAbstract::AlterFileName. - // Pokud jde o soubor, bude 'isDir' FALSE, jinak TRUE. Ma-li static 'subjectWnd' SS_NOPREFIX, - // 'duplicateAmpersands' is FALSE; otherwise TRUE (it doubles the second and subsequent ampersands ('&'); the first + // the way 'fileName' is displayed in the panel) using CSalamanderGeneralAbstract::AlterFileName. + // If it is a file, 'isDir' is FALSE, otherwise TRUE. If static control 'subjectWnd' has SS_NOPREFIX, + // 'duplicateAmpersands' is FALSE, otherwise TRUE (the second and subsequent ampersands ('&') are doubled; the first // ampersand marks the hotkey in the subject and must be present in 'subjectFormatString' before '%s'). // Example: SetSubjectTruncatedText(GetDlgItem(HWindow, IDS_SUBJECT), "&Rename %s to", // file->Name, fileIsDir, TRUE) @@ -2174,31 +2174,31 @@ class CSalamanderGUIAbstract // // ToolbarHeader // - // Slouzi pro vytvoreni hlavicky nad seznamem (at uz listview nebo listbox), ktera obsahuje - // textovy popis a skupinu tlacitek na prave strane. Priklad lze videt v konfiguraci Salamandera, - // viz Hot Paths nebo User Menu. 'hParent' je handle dialogu, 'ctrlID' je ID static textu, - // kolem ktereho bude ToolbarHeader vytvoren, 'hAlignWindow' je handle seznamu, ke kteremu - // bud hlavicka prisazena, 'buttonMask' je jedna nebo (soucet) vice hodnot TLBHDRMASK_xxx - // a udava, ktera tlacitka budou v hlavicce zobrazeny. + // Used to create a header above a list (either listview or listbox) that contains + // a text description and a group of buttons on the right side. An example can be seen in Salamander configuration, + // such as Hot Paths or User Menu. 'hParent' is the handle of the dialog, 'ctrlID' is the ID of the static text, + // around which the ToolbarHeader is created, 'hAlignWindow' is the handle of the list to which + // the header is aligned, 'buttonMask' is one or a sum of multiple TLBHDRMASK_xxx values + // and specifies which buttons are shown in the header. virtual CGUIToolbarHeaderAbstract* WINAPI AttachToolbarHeader(HWND hParent, int ctrlID, HWND hAlignWindow, DWORD buttonMask) = 0; /////////////////////////////////////////////////////////////////////////// // // ArrangeHorizontalLines // - // Najde v dialogu 'hWindow' horizontalni cary a dorazi je zprava na static text - // nebo checkbox nebo radiobox, na ktery navazuji. Navic najde checkboxy a - // radioboxy, ktere tvori labely groupboxum a zkrati je podle jejich textu a - // aktualniho pisma v dialogu. Eliminuje zbytecne mezery vznikle kvuli ruznym - // DPI obrazovky. + // Finds horizontal lines in dialog 'hWindow' and extends them on the right to the static text, + // checkbox, or radio button they connect to. It also finds checkboxes and + // radio buttons that serve as groupbox labels and shortens them according to their text and the + // current dialog font. Eliminates unnecessary gaps caused by different + // screen DPI. virtual void WINAPI ArrangeHorizontalLines(HWND hWindow) = 0; /////////////////////////////////////////////////////////////////////////// // // GetWindowFontHeight // - // pro 'hWindow' ziska aktualni font pomoci WM_GETFONT a vrati jeho vysku - // pomoci GetObject() + // For 'hWindow', gets the current font using WM_GETFONT and returns its height + // using GetObject() virtual int WINAPI GetWindowFontHeight(HWND hWindow) = 0; }; From cd72190b6c2975979c87a605664916cac8bcea3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 17:04:01 +0200 Subject: [PATCH 248/710] [translation] Fix src/plugins/shared/arraylt.h comments (#623) --- src/plugins/shared/arraylt.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/shared/arraylt.h b/src/plugins/shared/arraylt.h index fa8144f41..2f44ac951 100644 --- a/src/plugins/shared/arraylt.h +++ b/src/plugins/shared/arraylt.h @@ -188,9 +188,9 @@ class TDirectArray TDirectArray(const TDirectArray&) {} TDirectArray& operator=(TDirectArray&) { return *this; } - // compiler reports error on this line: we have just wanted to catch source code designed for - // older version of TDirectArray template: use CallDestructor instead of Destructor and please - // notice that in new version of TDirectArray copy-constructors and destructors are called + // The compiler reports an error on this line on purpose: we only want to catch source code written for + // an older version of the TDirectArray template. Use CallDestructor instead of Destructor, and note + // that in the new version of TDirectArray copy constructors and destructors are called. virtual int Destructor(int) { return 0; } }; From cada4504a0d8c9b700ef992e2daf5eb96f9c9cda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 17:04:04 +0200 Subject: [PATCH 249/710] [translation] Fix src/plugins/shared/auxtools.cpp comments (#624) --- src/plugins/shared/auxtools.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/plugins/shared/auxtools.cpp b/src/plugins/shared/auxtools.cpp index 6f2e95f4e..e267fe2b4 100644 --- a/src/plugins/shared/auxtools.cpp +++ b/src/plugins/shared/auxtools.cpp @@ -222,8 +222,8 @@ BOOL CThreadQueue::KillAll(BOOL force, int waitTime, int forceWaitTime, DWORD ex TRACE_E("Thread has not ended itself, we must terminate it (" << QueueName << " queue)."); TerminateThread(item->Thread, exitCode); WaitForSingleObject(item->Thread, INFINITE); // wait until the thread actually exits; sometimes this takes quite a while - // pokud nejaky thread ceka na ukonceni prave zabiteho threadu, pustime pro nej na chvilku - // frontu, jinak zustane zasekly v UnlockItem() + // if any thread is waiting for the just-killed thread to exit, briefly release the + // queue so it can proceed; otherwise it will stay stuck in UnlockItem() leaveCS = item->Locks > 0; } else // without force, just report that something is still running @@ -311,11 +311,11 @@ CThreadQueue::StartThread(unsigned(WINAPI* body)(void*), void* param, unsigned s data.Param = param; data.Continue = Continue; - // spustime thread, nepouzivame _beginthreadex(), protoze ten ma od VC2015 side-effect v podobe - // dalsiho loadu tohoto modulu (pluginu), ktery sice pri beznem ukonceni zase uvolni, - // ale kdyz pouzijeme TerminateThread(), zustane modul naloadeny az do ukonceni procesu - // Salamandera, pak se teprve spusti destruktory globalnich objektu a to muze vest - // k necekanym padum, protoze uz jsou vsechny pluginove rozhrani uvolnene (napr. + // start the thread; we do not use _beginthreadex() because since VC2015 it causes + // another load of this module (plugin), which is released again on normal exit, + // but if we use TerminateThread(), the module stays loaded until the Salamander process exits; + // only then do the global object destructors run, which can lead + // to unexpected crashes because all plugin interfaces have already been released (e.g. // SalamanderDebug) DWORD tid; HANDLE thread = CreateThread(NULL, stack_size, CThreadQueue::ThreadBase, &data, CREATE_SUSPENDED, &tid); @@ -389,6 +389,6 @@ CThread::UniversalBody(void* param) HANDLE CThread::Create(CThreadQueue& queue, unsigned stack_size, DWORD* threadID) { - // POZOR: po volani StartThread() muze byt 'this' neplatny (proto je zapis do 'Thread' uvnitr) + // WARNING: after StartThread() returns, 'this' may already be invalid (so 'Thread' is set inside) return queue.StartThread(UniversalBody, this, stack_size, &Thread, threadID); } From fe698e8c024ae1efbfcc7393db5d2eb195a39b4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 17:04:08 +0200 Subject: [PATCH 250/710] [translation] Fix src/plugins/shared/auxtools.h comments (#625) --- src/plugins/shared/auxtools.h | 43 +++++++++++++++++------------------ 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/src/plugins/shared/auxtools.h b/src/plugins/shared/auxtools.h index 3d59a2c49..176de6fa4 100644 --- a/src/plugins/shared/auxtools.h +++ b/src/plugins/shared/auxtools.h @@ -55,15 +55,15 @@ class CThreadQueue CThreadQueue(const char* queueName /* e.g. "DemoPlug Viewers" */); ~CThreadQueue(); - // starts function 'body' with parameter 'param' in a newly created thread with a stack - // o velikosti 'stack_size' (0 = default); vraci handle threadu nebo NULL pri chybe, + // starts the function 'body' with parameter 'param' in a newly created thread with a stack + // of size 'stack_size' (0 = default); returns the thread handle or NULL on error, // also writes the result to 'threadHandle' before the thread is resumed // (if not NULL); use the returned thread handle only for NULL checks and for calling // CThreadQueue methods WaitForExit() and KillThread(); the thread handle is closed by // this queue object // POZOR: -thread se muze spustit se zpozdenim az po navratu ze StartThread() - // (if 'param' points to a structure stored on the stack, it is necessary to - // synchronize the handoff of data from 'param' - the main thread must wait + // (if 'param' points to a structure stored on the stack, the handoff of data from + // 'param' must be synchronized - the main thread must wait // until the new thread takes ownership of the data) // -the returned thread handle may already be closed if the thread finishes before // StartThread() returns and another thread calls StartThread() or @@ -72,24 +72,23 @@ class CThreadQueue HANDLE StartThread(unsigned(WINAPI* body)(void*), void* param, unsigned stack_size = 0, HANDLE* threadHandle = NULL, DWORD* threadID = NULL); - // ceka na ukonceni threadu z teto fronty; 'thread' je handle threadu, ktery jiz muze - // byt i zavreny (zavira tento objekt pri volani StartThread a KillAll); pokud se - // docka ukonceni threadu, vyradi thread z fronty a zavre jeho handle + // waits for a thread from this queue to exit; 'thread' is the thread handle, which may already + // be closed (this object closes it when StartThread or KillAll is called); if it detects that the + // thread has exited, removes it from the queue and closes its handle BOOL WaitForExit(HANDLE thread, int milliseconds = INFINITE); - // zabije thread z teto fronty (pres TerminateThread()); 'thread' je handle threadu, - // ktery jiz muze byt i zavreny (zavira tento objekt pri volani StartThread a KillAll); - // pokud thread najde, zabije ho, vyradi z fronty a zavre jeho handle (objekt threadu - // se nedealokuje, protoze jeho stav je neznamy, mozna nekonzistentni) + // kills a thread from this queue (via TerminateThread()); 'thread' is the thread handle, which + // may already be closed (this object closes it when StartThread or KillAll is called); if it + // finds the thread, kills it, removes it from the queue, and closes its handle (the thread object + // is not deallocated because its state is unknown and may be inconsistent) void KillThread(HANDLE thread, DWORD exitCode = 666); - // overi, ze vsechny thready skoncily; je-li 'force' TRUE a nejaky thread jeste bezi, - // waits 'forceWaitTime' (ms) for all threads to finish, then kills any threads still running + // verifies that all threads have finished; if 'force' is TRUE and some thread is still running, + // waits 'forceWaitTime' (ms) for all threads to finish, then kills any still-running threads // (their objects are not deallocated because their state is unknown and may be inconsistent); - // vraci TRUE, jsou-li vsechny thready ukoncene, pri 'force' TRUE vzdy vraci TRUE; + // returns TRUE if all threads have finished; when 'force' is TRUE, it always returns TRUE; // if 'force' is FALSE and some thread is still running, waits 'waitTime' (ms) for all - // vsech threadu, pokud pak jeste stale neco bezi, vraci FALSE; cas INFINITE = neomezene - // waiting + // threads to finish; if anything is still running after that, returns FALSE; INFINITE = unlimited wait // can be called from any thread BOOL KillAll(BOOL force, int waitTime = 1000, int forceWaitTime = 200, DWORD exitCode = 666); @@ -111,21 +110,21 @@ class CThreadQueue class CThread { public: - // handle threadu (NULL = thread jeste nebezi/nebezel), POZOR: po ukonceni threadu se - // sam zavira (je neplatny), navic tento objekt uz je dealokovany + // thread handle (NULL = thread is not running / has not run yet), WARNING: after the thread exits it + // closes itself (becomes invalid), and this object is already deallocated HANDLE Thread; protected: char Name[101]; // buffer for the thread name (used in TRACE and CALL-STACK to identify the thread) - // POZOR: pokud budou data threadu obsahovat odkazy na stack nebo jine docasne objekty, - // je potreba zajistit, aby se s temito odkazy pracovalo jen po dobu jejich platnosti + // WARNING: if the thread data contains references to the stack or other temporary objects, + // those references must be used only while they remain valid public: CThread(const char* name = NULL); virtual ~CThread() {} // so destructors of derived classes are called correctly - // creates (starts) a thread in thread queue 'queue'; 'stack_size' is the stack size of the - // noveho threadu v bytech (0 = default); vraci handle noveho threadu nebo NULL pri chybe; + // creates (starts) a thread in the thread queue 'queue'; 'stack_size' is the stack size of the + // new thread in bytes (0 = default); returns a handle to the new thread or NULL on error; // the 'queue' object closes the handle; if the thread is created successfully, this object is // deallocated when the thread exits; if thread startup fails, the caller deallocates the object // POZOR: bez pridani synchronizace muze thread dobehnout jeste pred navratem z Create() -> From 54f7f1b7479f8a31b62ee9828f7b42d457208563 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 17:04:12 +0200 Subject: [PATCH 251/710] [translation] Fix src/plugins/shared/dbg.cpp comments (#626) --- src/plugins/shared/dbg.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/plugins/shared/dbg.cpp b/src/plugins/shared/dbg.cpp index 315a9d674..c81d7c691 100644 --- a/src/plugins/shared/dbg.cpp +++ b/src/plugins/shared/dbg.cpp @@ -288,19 +288,20 @@ void C__Trace::SendMessageToServer(BOOL information, BOOL unicode, BOOL crash) SalamanderDebug->TraceE(File, Line, TraceStringBuf.c_str()); } } - // jen je-li crash==TRUE: - // vyrobime kopii dat, start threadu pro msgbox totiz muze vyvolat dalsi TRACE - // hlasky (napr. v DllMain reakce na DLL_THREAD_ATTACH), pokud bysme neopustili - // CriticalSection, nastal by deadlock; - // v DllMain se nesmi pouzivat TRACE_C, jinak dojde k deadlocku: - // - pokud se da do DLL_THREAD_ATTACH: chce si otevrit novy thread pro msgbox - // a to je z DllMainu blokovane - // - pokud se da do DLL_THREAD_DETACH: pri cekani na zavreni threadu s msgboxem - // predesleho TRACE_C zachytime TRACE_C z DLL_THREAD_DETACH a nechame ho - // cekat v nekonecnem cyklu, viz nize - // navic zavadime obranu proti mnozeni msgboxu pri vice TRACE_C zaroven, pusobilo - // by to jen zmatky, ted se otevre msgbox jen pro prvni a ten po uzavreni vyvola - // padacku, ostatni TRACE_C zustanou chyceny v nekonecne cekaci smycce, viz nize + // only if crash==TRUE: + // make a copy of the data; starting the message box thread can trigger more TRACE + // messages (e.g. DllMain reacting to DLL_THREAD_ATTACH), and if we did not leave the + // CriticalSection it would deadlock; + // TRACE_C must not be used in DllMain, or it will deadlock: + // - in DLL_THREAD_ATTACH it tries to open a new thread for the message box, + // which is blocked from DllMain + // - in DLL_THREAD_DETACH, while waiting for the previous TRACE_C message box + // thread to close, we catch TRACE_C from DLL_THREAD_DETACH and leave it + // waiting in an infinite loop, see below + // we also guard against multiple message boxes when several TRACE_C occur at once; + // that would only cause confusion, so only the first opens a message box and after it + // closes triggers the crash; the other TRACE_C remain stuck in the infinite wait loop, + // see below static BOOL msgBoxOpened = FALSE; C__TraceMsgBoxThreadData threadData; C__TraceMsgBoxThreadDataW threadDataW; From a6a02bf293295f9117f0cb216cbdd682b143273b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 17:04:16 +0200 Subject: [PATCH 252/710] [translation] Fix src/plugins/shared/dbg.h comments (#627) --- src/plugins/shared/dbg.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/plugins/shared/dbg.h b/src/plugins/shared/dbg.h index 4bea8e81e..d206b1f21 100644 --- a/src/plugins/shared/dbg.h +++ b/src/plugins/shared/dbg.h @@ -20,14 +20,14 @@ // TRACE is enabled by defining TRACE_ENABLE // CALL-STACK is disabled by defining CALLSTK_DISABLE -// POZOR: TRACE_C se nesmi pouzivat v DllMain knihoven, ani v zadnem kodu, ktery -// se z DllMainu vola, jinak dojde k deadlocku, vice viz implementace -// C__Trace::SendMessageToServer +// WARNING: TRACE_C must not be used in DllMain, or in any code +// called from DllMain, otherwise a deadlock will occur; see +// C__Trace::SendMessageToServer for details -// makro CALLSTK_MEASURETIMES - zapne mereni casu straveneho pri priprave call-stack hlaseni (meri se pomer proti -// celkovemu casu behu funkci) -// POZOR: nutne zapnout tez pro kazdy plugin zvlast -// makro CALLSTK_DISABLEMEASURETIMES - potlaci mereni casu straveneho pri priprave call-stack hlaseni v DEBUG verzi +// macro CALLSTK_MEASURETIMES - enables measurement of time spent preparing +// call-stack reports (measured as a ratio to the +// total function run time); it must also be enabled separately for each plugin +// macro CALLSTK_DISABLEMEASURETIMES - suppresses measurement of time spent preparing call-stack reports in DEBUG builds // overview of macro types: (all are non-empty only if CALLSTK_DISABLE is not defined) // CALL_STACK_MESSAGE - regular call-stack macro @@ -530,8 +530,8 @@ class CCallStackMessage public: #if (defined(_DEBUG) || defined(CALLSTK_MEASURETIMES)) && !defined(CALLSTK_DISABLEMEASURETIMES) - // 'doNotMeasureTimes'==TRUE = nemerit Push tohoto call-stack makra (zrejme dost zpomaluje, ale - // nechceme ho vyhodit, je prilis dulezite pro debugovani) + // 'doNotMeasureTimes'==TRUE = do not measure Push for this call-stack macro (it probably slows things down, but + // it is too important for debugging to remove) #ifdef __BORLANDC__ CCallStackMessage(BOOL doNotMeasureTimes, const char* format, ...) #else // __BORLANDC__ @@ -821,8 +821,8 @@ extern BOOL __CallStk_T; // always TRUE - just to check format string and type o // TraceAttachCurrentThread + SetThreadNameInVCAndTrace // -// nepouzivat pokud uz se SalamanderDebug->TraceAttachThread pro tento thread volalo (primo -// nebo napr. pri startu threadu pres CThreadQueue::StartThread) +// do not use if SalamanderDebug->TraceAttachThread has already been called for this thread (directly +// or, for example, when the thread was started via CThreadQueue::StartThread) inline void TraceAttachCurrentThread() { SalamanderDebug->TraceAttachThread(GetCurrentThread(), GetCurrentThreadId()); } inline void SetThreadNameInVCAndTrace(const char* name) { SalamanderDebug->SetThreadNameInVCAndTrace(name); } From 1f08903e408b9ec52bdaf7d2d525cb07f4575a5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 17:04:19 +0200 Subject: [PATCH 253/710] [translation] Fix src/plugins/shared/htmlhelp.h comments (#628) --- src/plugins/shared/htmlhelp.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/shared/htmlhelp.h b/src/plugins/shared/htmlhelp.h index 8832082d8..398b1af1f 100644 --- a/src/plugins/shared/htmlhelp.h +++ b/src/plugins/shared/htmlhelp.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED /**************************************************************************** * * @@ -224,7 +225,7 @@ extern "C" int iType; // the type of the information type ie. Inclusive, Exclusive, or Hidden LPCSTR pszCatName; // Set to the name of the Category to enumerate the info types in a category; else NULL LPCSTR pszITName; // volitile pointer to the name of the infotype. Allocated by call. Caller responsible for freeing - LPCSTR pszITDescription; // volitile pointer to the description of the infotype. + LPCSTR pszITDescription; // Pointer to the info type description. } HH_ENUM_IT, *PHH_ENUM_IT; typedef struct tagHH_ENUM_CAT @@ -274,7 +275,7 @@ extern "C" typedef struct tagHH_FTS_QUERY { - int cbStruct; // Sizeof structure in bytes. + int cbStruct; // Size of the structure in bytes. BOOL fUniCodeStrings; // TRUE if all strings are unicode. LPCTSTR pszSearchQuery; // String containing the search query. LONG iProximity; // Word proximity. @@ -301,7 +302,7 @@ extern "C" int nShowState; // IN: show state (e.g., SW_SHOW) HWND hwndHelp; // OUT: window handle - HWND hwndCaller; // OUT: who called this window + HWND hwndCaller; // OUT: caller window handle HH_INFOTYPE* paInfoTypes; // IN: Pointer to an array of Information Types From 560d3128de1e4eb6d372b4a661ed691ef6847ee9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 17:04:22 +0200 Subject: [PATCH 254/710] [translation] Fix src/plugins/shared/mhandles.cpp comments (#629) --- src/plugins/shared/mhandles.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/shared/mhandles.cpp b/src/plugins/shared/mhandles.cpp index 637c5ae70..4aa315db4 100644 --- a/src/plugins/shared/mhandles.cpp +++ b/src/plugins/shared/mhandles.cpp @@ -1938,8 +1938,8 @@ BOOL C__Handles::DuplicateHandle(HANDLE hSourceProcessHandle, HANDLE hSourceHand MB_OK); } - // GetCurrentProcess vraci jakysi pseudohandle, takze tahle konstrukce - // neni spravna, meli by se porovnat ID procesu a ne jejich handly ... + // GetCurrentProcess returns a pseudo-handle, so this construct is not correct; + // process IDs should be compared rather than their handles ... if ((dwOptions & DUPLICATE_CLOSE_SOURCE) && hSourceProcessHandle == GetCurrentProcess()) From 880ebd0f6bb8acfc94fcdfbaad8fe9233f4bd606 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 17:04:26 +0200 Subject: [PATCH 255/710] [translation] Fix src/plugins/shared/mhandles.h comments (#630) --- src/plugins/shared/mhandles.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/shared/mhandles.h b/src/plugins/shared/mhandles.h index 380192c4e..40b5aca5a 100644 --- a/src/plugins/shared/mhandles.h +++ b/src/plugins/shared/mhandles.h @@ -14,10 +14,10 @@ // MHANDLES_ENABLE macro - enables handle monitoring // POZOR: volat HANDLES_CAN_USE_TRACE() tesne po inicializaci "dbg.h" modulu -// (after SalamanderDebug and SalamanderVersion are initialized) +// (after SalamanderDebug and SalamanderVersion have been initialized) // WARNING: MHANDLES are initialized/destroyed at the "lib" level; if a plugin -// uses the "lib" (or "compiler") level, it must ensure that it does not -// use MHANDLES at those levels (see #pragma init_seg (lib)) +// uses the "lib" (or "compiler") level, it must ensure that MHANDLES are not +// used at those levels (see #pragma init_seg (lib)) // POZNAMKA: pro snazsi rozmisteni maker HANDLES() a HANDLES_Q() pouzijte program CheckHnd.exe #define NOHANDLES(function) function From 79d772bfe7e3df0012e1b17befb4d2004fce5fa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 17:04:30 +0200 Subject: [PATCH 256/710] [translation] Fix src/plugins/shared/spl_arc.h comments (#631) --- src/plugins/shared/spl_arc.h | 206 +++++++++++++++++------------------ 1 file changed, 103 insertions(+), 103 deletions(-) diff --git a/src/plugins/shared/spl_arc.h b/src/plugins/shared/spl_arc.h index 84aa568fd..1e0f88d3d 100644 --- a/src/plugins/shared/spl_arc.h +++ b/src/plugins/shared/spl_arc.h @@ -38,150 +38,150 @@ class CPluginInterfaceForArchiverAbstract public: #endif // INSIDE_SALAMANDER - // funkce pro "panel archiver view"; vola se pro nacteni obsahu archivu 'fileName'; - // obsah se plni do objektu 'dir'; Salamander zjisti obsah - // pluginem pridanych sloupcu pomoci interfacu 'pluginData' (pokud plugin sloupce - // nepridava, vraci 'pluginData'==NULL); vraci TRUE pri uspesnem nacteni obsahu archivu, - // pokud vrati FALSE, navratova hodnota 'pluginData' se ignoruje (data v 'dir' je potreba - // uvolnit pomoci 'dir.Clear(pluginData)', jinak se uvolni jen Salamanderovska cast dat); - // 'salamander' je sada uzitecnych metod vyvezenych ze Salamandera, - // POZOR: soubor fileName take nemusi existovat (pokud je otevren v panelu a odjinud smazan), - // ListArchive neni volan pro soubory nulove delky, ty maji automaticky prazdny obsah, - // pri pakovani do takovych souboru se soubor pred volanim PackToArchive smaze (pro - // kompatibilitu s externimi pakovaci) + // Function for 'panel archiver view'; called to load the contents of archive 'fileName'. + // The contents are stored in 'dir'; Salamander obtains the contents of + // plugin-added columns through the 'pluginData' interface (if the plugin does not add columns, + // 'pluginData' is returned as NULL). Returns TRUE if the archive contents are loaded successfully; + // if it returns FALSE, the returned 'pluginData' value is ignored (the data in 'dir' must be + // released with 'dir.Clear(pluginData)', otherwise only the Salamander-managed part of the data is released). + // 'salamander' is a set of useful methods exported by Salamander. + // WARNING: the file 'fileName' may also not exist (if it is open in a panel and deleted elsewhere). + // ListArchive is not called for zero-length files; they automatically have empty contents. + // When packing into such files, the file is deleted before calling PackToArchive (for + // compatibility with external packers) virtual BOOL WINAPI ListArchive(CSalamanderForOperationsAbstract* salamander, const char* fileName, CSalamanderDirectoryAbstract* dir, CPluginDataInterfaceAbstract*& pluginData) = 0; - // funkce pro "panel archiver view", vola se pri pozadavku na rozpakovani souboru/adresaru - // z archivu 'fileName' do adresare 'targetDir' z cesty v archivu 'archiveRoot'; 'pluginData' - // je interface pro praci s informacemi o souborech/adresarich, ktere jsou specificke pluginu - // (napr. data z pridanych sloupcu; jde o stejny interface, ktery vraci metoda ListArchive - // v parametru 'pluginData' - takze muze byt i NULL); soubory/adresare jsou zadany enumeracni - // funkci 'next' jejimz parametrem je 'nextParam'; vraci TRUE pri uspesnem rozpakovani (nebyl - // pouzit Cancel, mohl byt pouzit Skip) - zdroj operace v panelu je odznacen, jinak vraci - // FALSE (neprovede se odznaceni); 'salamander' je sada uzitecnych metod vyvezenych ze - // Salamandera + // Function for 'panel archiver view'; called when files/directories are to be unpacked + // from archive 'fileName' to directory 'targetDir' from archive path 'archiveRoot'; 'pluginData' + // is an interface for working with file/directory information specific to the plugin + // (for example data from added columns; it is the same interface returned by ListArchive + // in the 'pluginData' parameter, so it may be NULL); the files/directories are specified by the enumeration + // function 'next' with parameter 'nextParam'; returns TRUE if unpacking succeeds (Cancel was not + // used; Skip may have been used) - the source of the operation is then unselected in the panel; + // otherwise returns FALSE (the source is not unselected); 'salamander' is a set of useful methods exported by + // Salamander virtual BOOL WINAPI UnpackArchive(CSalamanderForOperationsAbstract* salamander, const char* fileName, CPluginDataInterfaceAbstract* pluginData, const char* targetDir, const char* archiveRoot, SalEnumSelection next, void* nextParam) = 0; - // funkce pro "panel archiver view", vola se pri pozadavku na rozpakovani jednoho souboru pro view/edit - // z archivu 'fileName' do adresare 'targetDir'; jmeno souboru v archivu je 'nameInArchive'; - // 'pluginData' je interface pro praci s informacemi o souboru, ktere jsou specificke pluginu - // (napr. data z pridanych sloupcu; jde o stejny interface, ktery vraci metoda ListArchive + // Function for 'panel archiver view'; called when one file is requested for unpacking for view/edit + // from archive 'fileName' to directory 'targetDir'; the file name inside the archive is 'nameInArchive'; + // 'pluginData' is an interface for working with file information specific to the plugin + // (for example data from added columns; it is the same interface returned by ListArchive // v parametru 'pluginData' - takze muze byt i NULL); 'fileData' je ukazatel na strukturu CFileData - // vypakovavaneho souboru (strukturu sestavil plugin pri listovani archivu); 'newFileName' (neni-li + // for the unpacked file (the structure was built by the plugin when listing the archive); 'newFileName' (if not // NULL) je nove jmeno pro rozbalovany soubor (pouziva se pokud puvodni jmeno z archivu neni mozne - // vybalit na disk (napr. "aux", "prn", atd.)); do 'renamingNotSupported' (jen neni-li 'newFileName' + // be unpacked to disk (for example 'aux', 'prn', etc.)); write TRUE to 'renamingNotSupported' (only if 'newFileName' is not // NULL) zapsat TRUE pokud plugin nepodporuje prejmenovani pri vybalovani (standardni chybova hlaska - // "renaming not supported" se zobrazi ze Salamandera); vraci TRUE pri uspesnem rozpakovani souboru - // (soubor je na zadane ceste, nebyl pouzit Cancel ani Skip), 'salamander' je sada uzitecnych metod - // vyvezenych ze Salamandera + // the standard 'renaming not supported' error message is shown by Salamander); returns TRUE if the file is unpacked successfully + // (the file is at the requested path and neither Cancel nor Skip was used); 'salamander' is a set of useful methods + // exported by Salamander virtual BOOL WINAPI UnpackOneFile(CSalamanderForOperationsAbstract* salamander, const char* fileName, CPluginDataInterfaceAbstract* pluginData, const char* nameInArchive, const CFileData* fileData, const char* targetDir, const char* newFileName, BOOL* renamingNotSupported) = 0; - // funkce pro "panel archiver edit" a "custom archiver pack", vola se pri pozadavku na zapakovani - // souboru/adresaru do archivu 'fileName' na cestu 'archiveRoot', soubory/adresare jsou zadany - // zdrojovou cestou 'sourcePath' a enumeracni funkci 'next' s parametrem 'nextParam', - // je-li 'move' TRUE, zapakovane soubory/adresare by mely byt odstranene z disku, vraci TRUE - // pokud se podari zapakovat/odstranit vsechny soubory/adresare (nebyl pouzit Cancel, mohl byt - // pouzit Skip) - zdroj operace v panelu je odznacen, jinak vraci FALSE (neprovede se odznaceni), - // 'salamander' je sada uzitecnych metod vyvezenych ze Salamandera + // Function for 'panel archiver edit' and 'custom archiver pack'; called when files/directories are to be packed + // into archive 'fileName' at path 'archiveRoot'; the files/directories are specified by + // source path 'sourcePath' and the enumeration function 'next' with parameter 'nextParam'. + // If 'move' is TRUE, the packed files/directories should be removed from disk. Returns TRUE + // if all files/directories are packed/removed successfully (Cancel was not used; Skip may have + // been used) - the source of the operation is then unselected in the panel; otherwise returns FALSE (the source is not unselected); + // 'salamander' is a set of useful methods exported by Salamander virtual BOOL WINAPI PackToArchive(CSalamanderForOperationsAbstract* salamander, const char* fileName, const char* archiveRoot, BOOL move, const char* sourcePath, SalEnumSelection2 next, void* nextParam) = 0; - // funkce pro "panel archiver edit", vola se pri pozadavku na smazani souboru/adresaru z archivu - // 'fileName'; soubory/adresare jsou zadany cestou 'archiveRoot' a enumeracni funkci 'next' - // s parametrem 'nextParam'; 'pluginData' je interface pro praci s informacemi o souborech/adresarich, - // ktere jsou specificke pluginu (napr. data z pridanych sloupcu; jde o stejny interface, ktery vraci - // metoda ListArchive v parametru 'pluginData' - takze muze byt i NULL); vraci TRUE pokud se - // podari smazat vsechny soubory/adresare (nebyl pouzit Cancel, mohl byt pouzit Skip) - zdroj - // operace v panelu je odznacen, jinak vraci FALSE (neprovede se odznaceni); 'salamander' je sada - // uzitecnych metod vyvezenych ze Salamandera + // Function for 'panel archiver edit'; called when files/directories are to be deleted from archive + // 'fileName'; the files/directories are specified by path 'archiveRoot' and the enumeration function 'next' + // with parameter 'nextParam'; 'pluginData' is an interface for working with file/directory information + // specific to the plugin (for example data from added columns; it is the same interface returned by + // ListArchive in the 'pluginData' parameter, so it may be NULL); returns TRUE if all + // files/directories are deleted successfully (Cancel was not used; Skip may have been used) - the source + // of the operation is then unselected in the panel; otherwise returns FALSE (the source is not unselected); 'salamander' is a set of + // useful methods exported by Salamander virtual BOOL WINAPI DeleteFromArchive(CSalamanderForOperationsAbstract* salamander, const char* fileName, CPluginDataInterfaceAbstract* pluginData, const char* archiveRoot, SalEnumSelection next, void* nextParam) = 0; - // funkce pro "custom archiver unpack"; vola se pri pozadavku na rozbaleni souboru/adresaru z archivu - // 'fileName' do adresare 'targetDir'; soubory/adresare jsou zadany maskou 'mask'; vraci TRUE pokud - // se podari rozbalit vsechny soubory/adresare (nebyl pouzit Cancel, mohl byt pouzit Skip); - // je-li 'delArchiveWhenDone' TRUE, je potreba napridavat do 'archiveVolumes' vsechny svazky archivu - // (vcetne null-terminatoru; neni-li vicesvazkovy, bude tam jen 'fileName'), vrati-li se z teto funkce - // TRUE (uspesne rozbaleni), dojde nasledne ke smazani vsech souboru z 'archiveVolumes'; - // 'salamander' je sada uzitecnych metod vyvezenych ze Salamandera + // Function for 'custom archiver unpack'; called when files/directories are to be unpacked from archive + // 'fileName' to directory 'targetDir'; the files/directories are specified by mask 'mask'. Returns TRUE if + // all files/directories are unpacked successfully (Cancel was not used; Skip may have been used). + // If 'delArchiveWhenDone' is TRUE, all archive volumes must be added to 'archiveVolumes' + // (including null terminators; if the archive is not multi-volume, only 'fileName' is stored there). If this function returns + // TRUE (successful unpacking), all files from 'archiveVolumes' are then deleted; + // 'salamander' is a set of useful methods exported by Salamander virtual BOOL WINAPI UnpackWholeArchive(CSalamanderForOperationsAbstract* salamander, const char* fileName, const char* mask, const char* targetDir, BOOL delArchiveWhenDone, CDynamicString* archiveVolumes) = 0; - // funkce pro "panel archiver view/edit", vola se pred zavrenim panelu s archivem + // Function for 'panel archiver view/edit'; called before the panel with the archive is closed // POZOR: pokud se nepodari otevrit novou cestu, archiv muze v panelu zustat (nezavisle na tom, - // co vrati CanCloseArchive); metodu tedy nelze pouzit pro destrukci kontextu; - // je urcena napriklad pro optimalizaci operace Delete z archivu, kdy muze pri - // jeho opousteni nabidnou "setreseni" archivu - // pro destrukci kontextu lze pouzit metodu CPluginInterfaceAbstract::ReleasePluginDataInterface, - // viz dokument archivatory.txt - // 'fileName' je jmeno archivu; 'salamander' je sada uzitecnych metod vyvezenych ze Salamandera; - // 'panel' oznacuje panel, ve kterem je archiv otevreny (PANEL_LEFT nebo PANEL_RIGHT); - // vraci TRUE pokud je zavreni mozne, je-li 'force' TRUE, vraci TRUE vzdy; pokud probiha + // whatever CanCloseArchive returns); this method therefore cannot be used to destroy the context; + // it is intended, for example, to optimize Delete from an archive, when leaving it may + // offer to 'shake' the archive + // to destroy the context, use CPluginInterfaceAbstract::ReleasePluginDataInterface, + // see archivatory.txt + // 'fileName' is the archive name; 'salamander' is a set of useful methods exported by Salamander; + // 'panel' identifies the panel in which the archive is open (PANEL_LEFT or PANEL_RIGHT); + // returns TRUE if closing is possible; if 'force' is TRUE, it always returns TRUE; if // critical shutdown (vice viz CSalamanderGeneralAbstract::IsCriticalShutdown), nema - // smysl se usera na cokoliv ptat + // there is no point in prompting the user about anything virtual BOOL WINAPI CanCloseArchive(CSalamanderForOperationsAbstract* salamander, const char* fileName, BOOL force, int panel) = 0; - // zjisti pozadovane nastaveni disk-cache (disk-cache se pouziva pro docasne kopie - // souboru pri otevirani souboru z archivu ve viewerech, editorech a pres systemove - // asociace); normalne (podari-li se po volani naalokovat kopii 'tempPath') se vola - // jen jednou a to pred prvnim pouzitim disk-cache (napr. pred prvnim otevrenim - // souboru z archivu ve vieweru/editoru); pokud vraci FALSE, pouziva - // se standardni nastaveni (soubory v TEMP adresari, kopie se mazou pomoci Win32 - // API funkce DeleteFile() az pri prekroceni limitni velikosti cache nebo pri zavreni archivu) - // a vsechny ostatni navratove hodnoty se ignoruji; vraci-li TRUE, pouzivaji se nasledujici - // navratove hodnoty: neni-li 'tempPath' (buffer o velikosti MAX_PATH) prazdny retezec, budou - // se vsechny docasne kopie vypakovane pluginem z archivu ukladat do podadresaru teto cesty - // (tyto podadresare zrusi disk-cache pri ukonceni Salamandera, ale pluginu nic nebrani - // v jejich smazani drive, napr. pri svem unloadu; zaroven je vhodne pri loadu prvni instance - // pluginu (nejen v ramci jednoho spusteneho Salamandera) promazat podadresare "SAL*.tmp" na teto - // ceste - resi problemy vznikle zamknutymi soubory a pady softu) + je-li 'ownDelete' TRUE, - // bude se pro mazani kopii volat metoda DeleteTmpCopy a PrematureDeleteTmpCopy + je-li - // 'cacheCopies' FALSE, budou se kopie mazat hned jakmile se uvolni (napr. jakmile se zavre - // viewer), je-li 'cacheCopies' TRUE, budou se kopie mazat az pri prekroceni limitni velikosti - // cache nebo pri zavreni archivu + // Gets the required disk-cache settings (the disk cache is used for temporary copies + // of files opened from an archive in viewers, editors, and through system + // associations); normally, if a copy of 'tempPath' can be allocated after the call, this method is called + // only once, before the first use of the disk cache (for example before the first opening of + // a file from the archive in a viewer/editor); if it returns FALSE, the standard + // settings are used (files in the TEMP directory, and copies are deleted with the Win32 + // API function DeleteFile() only after the cache size limit is exceeded or when the archive is closed) + // and all other return values are ignored; if it returns TRUE, the following + // return values are used: if 'tempPath' (a buffer of size MAX_PATH) is not an + // empty string, all temporary copies extracted by the plugin from the archive are stored in subdirectories of this path + // (these subdirectories are deleted by the disk cache when Salamander exits, but the plugin may + // delete them earlier, for example on unload; when the first instance of the + // plugin is loaded, not just within one running Salamander, it is also advisable to clean up the 'SAL*.tmp' subdirectories in this + // path - this handles problems caused by locked files and crashes) + if 'ownDelete' is TRUE, + // the DeleteTmpCopy and PrematureDeleteTmpCopy methods are called to delete the copies + if + // 'cacheCopies' is FALSE, the copies are deleted as soon as they are released (for example when the + // viewer is closed); if 'cacheCopies' is TRUE, the copies are deleted only after the cache size limit is exceeded + // or when the archive is closed virtual BOOL WINAPI GetCacheInfo(char* tempPath, BOOL* ownDelete, BOOL* cacheCopies) = 0; - // pouziva se jen pokud metoda GetCacheInfo vraci v parametru 'ownDelete' TRUE: - // smaze docasnou kopii vypakovanou z tohoto archivu (pozor na read-only soubory, - // u nich je treba nejprve zmenit atributy, a pak jdou teprve smazat), pokud mozno - // by nemelo zobrazovat zadna okna (uzivatel cinnost primo nevyvolal, muze ho rusit - // v jine cinnosti), pri delsich akcich se hodi vyuziti wait-okenka (viz + // Used only if GetCacheInfo returns TRUE in parameter 'ownDelete': + // deletes a temporary copy extracted from this archive (watch out for read-only files, + // their attributes must be changed before they can be deleted); if possible, + // it should not display any windows (the user did not invoke this directly and it may disturb them + // during other work); for longer actions it is useful to use a wait window (see // CSalamanderGeneralAbstract::CreateSafeWaitWindow); 'fileName' je jmeno souboru - // s kopii; pokud se maze vic souboru najednou (muze nastat napr. po zavreni - // editovaneho archivu), je 'firstFile' TRUE pro prvni soubor a FALSE pro ostatni + // for the copy; if several files are deleted at once (this can happen, for example, after an + // edited archive is closed), 'firstFile' is TRUE for the first file and FALSE for the remaining // soubory (pouziva se ke korektnimu zobrazeni wait-okenka - viz DEMOPLUG) // - // POZOR: vola se v hl. threadu na zaklade doruceni zpravy z disk-cache hl. oknu - posila se - // zprava o potrebe uvolnit docasnou kopii (typicky v okamziku zavreni vieweru nebo - // "rozeditovaneho" archivu v panelu), tedy muze dojit k opakovanemu vstupu do pluginu - // (pokud zpravu distribuuje message-loopa uvnitr pluginu), dalsi vstup do DeleteTmpCopy - // je vylouceny, protoze do ukonceni volani DeleteTmpCopy disk-cache zadne dalsi zpravy - // neposila + // WARNING: it is called in the main thread when a message from the disk cache is delivered to the main window - + // a message is sent requesting that a temporary copy be released (typically when a viewer or an + // archive being edited in a panel is closed), so reentry into the plugin may occur + // (if the message loop inside the plugin dispatches the message); another entry into DeleteTmpCopy + // is excluded because the disk cache sends no further messages until DeleteTmpCopy + // returns virtual void WINAPI DeleteTmpCopy(const char* fileName, BOOL firstFile) = 0; - // pouziva se jen pokud metoda GetCacheInfo vraci v parametru 'ownDelete' TRUE: - // pri unloadu pluginu zjisti, jestli se ma volat DeleteTmpCopy pro kopie, ktere jsou - // jeste pouzivane (napr. otevrene ve vieweru) - vola se jen pokud takove kopie - // existuji; 'parent' je parent pripadneho messageboxu s dotazem uzivateli (pripadne - // doporuceni, aby user zavrel vsechny soubory z archivu, aby je plugin mohl smazat); - // 'copiesCount' je pocet pouzivanych kopii souboru z archivu; vraci TRUE pokud se - // ma volat DeleteTmpCopy, pokud vrati FALSE, kopie zustanou na disku; pokud probiha - // critical shutdown (vice viz CSalamanderGeneralAbstract::IsCriticalShutdown), nema - // smysl se usera na cokoliv ptat a provadet zdlouhave akce (napr. shredovani souboru) - // POZNAMKA: behem provadeni PrematureDeleteTmpCopy je zajisteno, ze nedojde - // k volani DeleteTmpCopy + // Used only if GetCacheInfo returns TRUE in parameter 'ownDelete': + // on plugin unload, determines whether DeleteTmpCopy should be called for copies that are + // still in use (for example open in a viewer) - it is called only if such copies + // exist; 'parent' is the parent window of any message box shown to the user (for example + // to recommend that the user close all files from the archive so the plugin can delete them); + // 'copiesCount' is the number of copies of archive files still in use; returns TRUE if + // DeleteTmpCopy should be called; if it returns FALSE, the copies remain on disk. If a + // critical shutdown is in progress (see CSalamanderGeneralAbstract::IsCriticalShutdown), there is no + // point in prompting the user or performing lengthy actions (for example shredding files). + // NOTE: while PrematureDeleteTmpCopy is running, DeleteTmpCopy is guaranteed + // not to be called virtual BOOL WINAPI PrematureDeleteTmpCopy(HWND parent, int copiesCount) = 0; }; From a60ab2c564174d276736febf318d8ab35e99eba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 17:04:33 +0200 Subject: [PATCH 257/710] [translation] Fix src/plugins/shared/spl_bzip2.h comments (#632) --- src/plugins/shared/spl_bzip2.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/shared/spl_bzip2.h b/src/plugins/shared/spl_bzip2.h index a15a42d5c..020a9c883 100644 --- a/src/plugins/shared/spl_bzip2.h +++ b/src/plugins/shared/spl_bzip2.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED //**************************************************************************** // From b3d3c5186c460a562219a6dda575297e1028e779 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 17:04:37 +0200 Subject: [PATCH 258/710] [translation] Fix src/plugins/shared/spl_crypt.h comments (#633) --- src/plugins/shared/spl_crypt.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/shared/spl_crypt.h b/src/plugins/shared/spl_crypt.h index 8747a3e3d..4d3a96aec 100644 --- a/src/plugins/shared/spl_crypt.h +++ b/src/plugins/shared/spl_crypt.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED //**************************************************************************** // From 8d3d76c5ef20609513490359c40e719854eb3c22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 17:04:40 +0200 Subject: [PATCH 259/710] [translation] Fix src/plugins/shared/spl_gui.h comments (#634) --- src/plugins/shared/spl_gui.h | 112 +++++++++++++++++------------------ 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/src/plugins/shared/spl_gui.h b/src/plugins/shared/spl_gui.h index a03e53c12..a1ef79b3b 100644 --- a/src/plugins/shared/spl_gui.h +++ b/src/plugins/shared/spl_gui.h @@ -128,36 +128,36 @@ class CGUIProgressBarAbstract // Usage examples: // - // 1. We want to move the rectangle manually; it does not move on its own + // 1. We want to move the indicator manually; it does not move on its own // // SetSelfMoveTime(0) // disable automatic movement // SetProgress(-1, NULL) // move it by one step // ... // SetProgress(-1, NULL) // move it by one step // - // 2. The rectangle should move on its own until Stop is called + // 2. The indicator should move on its own until Stop is called // // SetSelfMoveTime(0xFFFFFFFF) // infinite movement // SetSelfMoveSpeed(50) // 20 moves per second - // SetProgress(-1, NULL) // start the rectangle + // SetProgress(-1, NULL) // start the indicator // ... // do some work - // Stop() // stop the rectangle + // Stop() // stop the indicator // - // 3. The rectangle should move for a limited time and then stop - // if we "nudge" it during that time, the timeout is refreshed + // 3. The indicator should move for a limited time and then stop + // if we "nudge" it during that time, the timeout is reset // // SetSelfMoveTime(1000) // moves on its own for one second, then stops // SetSelfMoveSpeed(50) // 20 moves per second - // SetProgress(-1, NULL) // start the rectangle for one second + // SetProgress(-1, NULL) // start the indicator for one second // ... - // SetProgress(-1, NULL) // keep the rectangle alive for another second + // SetProgress(-1, NULL) // restart the indicator for another second // - // 4. The operation was paused and we want to show it in the progress bar + // 4. The operation was paused and we want to show it on the progress bar // // SetProgress(0, NULL) // 0% // SetProgress(100, NULL) // 10% // SetProgress(200, NULL) // 20% - // SetProgress(300, "(paused)") // 30% -- instead of "30 %" the text "(paused)" is shown + // SetProgress(300, "(paused)") // 30% -- "(paused)" is shown instead of "30 %" // ... (waiting for resume) // SetProgress(300, NULL) // 30% -- turn off the paused text and continue // SetProgress(400, NULL) // 40% @@ -312,7 +312,7 @@ class CGUIColorArrowButtonAbstract #define MNTT_PE 3 // popup end #define MNTT_SP 4 // separator -#define MNTS_B 0x01 // skill level beginned +#define MNTS_B 0x01 // skill level beginner #define MNTS_I 0x02 // skill level intermediate #define MNTS_A 0x04 // skill level advanced @@ -1264,51 +1264,51 @@ struct TLBI_ITEM_INFO2 }; /* -Mask - TLBI_MASK_* - -Style - TLBI_STYLE_* - -State - TLBI_STATE_* - -ID - Command identifier associated with the button. - This identifier is used in a WM_COMMAND message when the button is chosen. - -Text - Text string displayed in the toolbar item. - -TextLen - Length of the toolbar item text, when information is received. - -Width - Width of the toolbar item text. - -ImageIndex - Zero-based index of the button image in the image list. - -HIcon - Handle to the icon to display instead of image list image. - Icon will not be destroyet. - -CustomData - Application-defined value associated with the toolbar item. - -Enabler - Pointer to the item enabler. Used in the UpdateItemsState. - 0 -> item is TLBI_STATE_GRAYED; else item is enabled - -Index - For enumeration items in customize dialog. - -Name - Name in customize dialog. - -NameLen - Name len in customize dialog. -*/ + * Mask + * TLBI_MASK_* + * + * Style + * TLBI_STYLE_* + * + * State + * TLBI_STATE_* + * + * ID + * Command identifier associated with the button. + * This identifier is used in a WM_COMMAND message when the button is selected. + * + * Text + * Text string displayed in the toolbar item. + * + * TextLen + * Length of the toolbar item text when information is retrieved. + * + * Width + * Width of the toolbar item text. + * + * ImageIndex + * Zero-based index of the button image in the image list. + * + * HIcon + * Handle to the icon to display instead of an image-list image. + * The icon is not destroyed. + * + * CustomData + * Application-defined value associated with the toolbar item. + * + * Enabler + * Pointer to the item enabler. Used in UpdateItemsState. + * 0 -> item is TLBI_STATE_GRAYED; otherwise the item is enabled + * + * Index + * Used for enumeration items in the Customize dialog. + * + * Name + * Name in the Customize dialog. + * + * NameLen + * Length of the name in the Customize dialog. + */ struct TOOLBAR_PADDING // The padding values are used to create a blank area { From 36ae286036508efd4bef659abffb1e418376c334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 17:04:43 +0200 Subject: [PATCH 260/710] [translation] Fix src/plugins/shared/spl_menu.h comments (#635) --- src/plugins/shared/spl_menu.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/plugins/shared/spl_menu.h b/src/plugins/shared/spl_menu.h index bfc5529c5..797e45e87 100644 --- a/src/plugins/shared/spl_menu.h +++ b/src/plugins/shared/spl_menu.h @@ -63,7 +63,7 @@ class CSalamanderBuildMenuAbstract // menu item state flags (for menu extension plugins) #define MENU_ITEM_STATE_ENABLED 0x01 // enabled; without this flag the item is disabled #define MENU_ITEM_STATE_CHECKED 0x02 // a "check" or "radio" mark is shown before the item -#define MENU_ITEM_STATE_RADIO 0x04 // bez MENU_ITEM_STATE_CHECKED se ignoruje, \ +#define MENU_ITEM_STATE_RADIO 0x04 // ignored without MENU_ITEM_STATE_CHECKED, \ // "radio" mark; without this flag a "check" mark #define MENU_ITEM_STATE_HIDDEN 0x08 // the item should not appear in the menu at all @@ -80,20 +80,20 @@ class CPluginInterfaceForMenuExtAbstract // of flags (see MENU_ITEM_STATE_XXX); for 'eventMask' see CSalamanderConnectAbstract::AddMenuItem virtual DWORD WINAPI GetMenuItemState(int id, DWORD eventMask) = 0; - // spousti prikaz menu s identifikacnim cislem 'id', 'eventMask' viz - // CSalamanderConnectAbstract::AddMenuItem, 'salamander' je sada pouzitelnych metod - // Salamandera pro provadeni operaci (POZOR: muze byt NULL, viz popis metody + // executes the menu command with identifier 'id'; for 'eventMask' see + // CSalamanderConnectAbstract::AddMenuItem, 'salamander' is the set of available + // Salamander methods for performing operations (WARNING: it may be NULL, see the description of the method // CSalamanderGeneralAbstract::PostMenuExtCommand), 'parent' je parent messageboxu, - // vraci TRUE pokud ma byt v panelu zruseno oznaceni (nebyl pouzit Cancel, mohl byt - // pouzit Skip), jinak vraci FALSE (neprovede se odznaceni); + // returns TRUE if the selection in the panel should be cleared (Cancel was not used; Skip may have + // been used), otherwise returns FALSE (no deselection is performed); // POZOR: Pokud prikaz zpusobi zmeny na nejake ceste (diskove/FS), mel by pouzit // CSalamanderGeneralAbstract::PostChangeOnPathNotification pro informovani - // panelu bez automatickeho refreshe a otevrene FS (aktivni i odpojene) - // POZNAMKA: pokud prikaz pracuje se soubory/adresari z cesty v aktualnim panelu nebo - // i primo s touto cestou, je treba volat + // the panel without an automatic refresh and any open FSs (active and disconnected) + // NOTE: if the command works with files/directories from the path in the current panel or + // even directly with this path, it is necessary to call // CSalamanderGeneralAbstract::SetUserWorkedOnPanelPath pro aktualni panel, - // jinak nebude cesta v tomto panelu vlozena do seznamu pracovnich - // adresaru - List of Working Directories (Alt+F12) + // otherwise the path in this panel will not be added to the list of working + // directories - List of Working Directories (Alt+F12) virtual BOOL WINAPI ExecuteMenuItem(CSalamanderForOperationsAbstract* salamander, HWND parent, int id, DWORD eventMask) = 0; From 84ac815c0a678228633e21ad74eb546b14065c2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 17:04:46 +0200 Subject: [PATCH 261/710] [translation] Fix src/plugins/shared/spl_thum.h comments (#636) --- src/plugins/shared/spl_thum.h | 76 +++++++++++++---------------------- 1 file changed, 28 insertions(+), 48 deletions(-) diff --git a/src/plugins/shared/spl_thum.h b/src/plugins/shared/spl_thum.h index a687a61bb..f32232ca7 100644 --- a/src/plugins/shared/spl_thum.h +++ b/src/plugins/shared/spl_thum.h @@ -39,35 +39,15 @@ class CSalamanderThumbnailMakerAbstract { public: - // sets the image-processing parameters for thumbnail creation; this method must - // be called first on this interface; 'picWidth' and 'picHeight' are the dimensions - // of the processed image (in pixels); 'flags' is a combination of SSTHUMB_XXX flags, - // which describe the image passed in the 'buffer' parameter to - // ProcessBuffer; vraci TRUE, pokud se podarilo alokovat buffery pro zmensovani - // a je mozne nasledne volat ProcessBuffer; pokud vrati FALSE, doslo k chybe - // and thumbnail loading must be aborted + // sets the image-processing parameters for thumbnail creation; this must be the first method called on this interface; 'picWidth' and 'picHeight' are the dimensions of the processed image (in pixels); 'flags' is a combination of SSTHUMB_XXX flags describing the image passed in the 'buffer' parameter to ProcessBuffer; returns TRUE if the downscaling buffers were allocated successfully and ProcessBuffer can then be called; if it returns FALSE, an error occurred and thumbnail loading must be terminated virtual BOOL WINAPI SetParameters(int picWidth, int picHeight, DWORD flags) = 0; - // processes part of the image in 'buffer' (the processed part of the image is stored - // row by row from top to bottom, pixels in each row are stored left to right, and each pixel - // is represented by a 32-bit value composed of three bytes with the R+G+B colors and a - // fourth byte, which is ignored); there are two processing modes: copying the image - // to the resulting thumbnail (if the processed image does not exceed the thumbnail size) - // and scaling the image down to the thumbnail (image larger than the - // thumbnail); 'buffer' is used for reading only; 'rowsCount' specifies how many rows of the - // image are in the buffer; - // je-li'buffer' NULL, berou se data z vlastniho bufferu (plugin ziska pres GetBuffer); - // vraci TRUE pokud ma plugin pokracovat s nacitanim obrazku, vraci-li FALSE, - // thumbnail generation is finished (the whole image has been processed) or it should be - // aborted as soon as possible (for example, the user changed the panel path, so the thumbnail is no - // longer needed) + // processes part of the image in 'buffer' (the processed part of the image is stored row by row from top to bottom, pixels within each row are stored left to right, and each pixel is represented by a 32-bit value composed of three R+G+B color bytes plus a fourth byte that is ignored); there are two processing modes: copying the image to the resulting thumbnail (if the processed image does not exceed the thumbnail size) and scaling the image down to the thumbnail (if the image is larger than the thumbnail); 'buffer' is read-only; 'rowsCount' specifies how many image rows are in the buffer; + // if 'buffer' is NULL, the data is taken from the internal buffer (the plugin obtains it via GetBuffer); + // returns TRUE if the plugin should continue loading the image; if it returns FALSE, thumbnail generation is finished (the whole image has been processed) or should be aborted as soon as possible (for example, the user changed the panel path, so the thumbnail is no longer needed) // - // POZOR: pokud je spustena metoda CPluginInterfaceForThumbLoader::LoadThumbnail, - // changing the panel path is blocked. Therefore larger images should be passed and - // loaded in chunks, and the return value of - // ProcessBuffer should be checked to see whether loading should be aborted. - // If time-consuming operations must be performed before calling SetParameters - // or before calling ProcessBuffer, GetCancelProcessing must be called occasionally during that time. + // NOTE: while CPluginInterfaceForThumbLoader::LoadThumbnail is running, changing the panel path is blocked. Therefore larger images should be read and passed in chunks, and the return value of ProcessBuffer should be checked to determine whether loading should be aborted. + // If time-consuming operations must be performed before calling SetParameters or before calling ProcessBuffer, GetCancelProcessing must be called occasionally during that time. virtual BOOL WINAPI ProcessBuffer(void* buffer, int rowsCount) = 0; // returns an internal buffer large enough to store 'rowsCount' rows of the image @@ -82,12 +62,12 @@ class CSalamanderThumbnailMakerAbstract // (ProcessBuffer) virtual void WINAPI SetError() = 0; - // vraci TRUE, pokud ma plugin preprusit nacitani thumbnailu - // vraci FALSE, pokud ma plugin pokracovat s nacitanim obrazku + // returns TRUE if the plugin should abort thumbnail loading + // returns FALSE if the plugin should continue loading the image // // this method can be called before and after SetParameters // - // it is used to detect abort requests in cases where the plugin + // it is used to detect abort requests when the plugin // needs to perform time-consuming operations before calling SetParameters // or when the plugin needs to prerender the image, that is, after calling // SetParameters but before calling ProcessBuffer @@ -108,32 +88,32 @@ class CPluginInterfaceForThumbLoaderAbstract public: #endif // INSIDE_SALAMANDER - // nacte thumbnail pro soubor 'filename'; 'thumbWidth' a 'thumbHeight' jsou - // rozmery pozadovaneho thumbnailu; 'thumbMaker' je rozhrani algoritmu pro - // tvorbu thumbnailu (umi prijmout hotovy thumbnail nebo ho vyrobit zmensenim - // obrazku); vraci TRUE pokud je format souboru 'filename' znamy, pokud vrati + // loads a thumbnail for file 'filename'; 'thumbWidth' and 'thumbHeight' are + // the dimensions of the requested thumbnail; 'thumbMaker' is the interface of the + // thumbnail-generation algorithm (it can accept a finished thumbnail or create it by scaling the + // image down); returns TRUE if the format of 'filename' is recognized; if it returns // FALSE, Salamander zkusi nacist thumbnail pomoci jineho pluginu; chybu pri - // ziskavani thumbnailu (napr. chybu cteni souboru) plugin hlasi pomoci + // errors while obtaining the thumbnail (for example, a file read error) are reported through // rozhrani 'thumbMaker' - viz metoda SetError; 'fastThumbnail' je TRUE v prvnim - // kole cteni thumbnailu - cilem je vratit thumbnail co nejrychleji (klidne - // v horsi kvalite nebo mensi nez je potreba), v druhem kole cteni thumbnailu - // (jen pokud se v prvnim kole nastavi flag SSTHUMB_ONLY_PREVIEW) je + // thumbnail-loading pass, the goal is to return the thumbnail as quickly as possible (even + // at lower quality or smaller than required); in the second thumbnail-loading pass + // (only if the SSTHUMB_ONLY_PREVIEW flag is set in the first pass), // 'fastThumbnail' FALSE - cilem je vratit kvalitni thumbnail - // omezeni: jelikoz se vola z threadu pro nacitani ikon (neni to hlavni thread), lze z - // CSalamanderGeneralAbstract pouzivat jen metody, ktere lze volat z libovolneho threadu + // limitation: because this is called from the icon-loading thread (not the main thread), only + // methods of CSalamanderGeneralAbstract that are safe to call from any thread may be used // - // Doporucene schema implementace: - // - pokusit se otevrit obrazek - // - pokud se nepodari, vratit FALSE - // - extrahovat rozmery obrazku + // Recommended implementation outline: + // - try to open the image + // - if that fails, return FALSE + // - extract the image dimensions // - predat je do Salamandera pres thumbMaker->SetParameters - // - pokud vrati FALSE, uklid a odchod (nepovedlo se alokovat buffery) + // - if it returns FALSE, clean up and exit (buffer allocation failed) // - SMYCKA - // - nacist cast dat z obrazku + // - load part of the image data // - poslat je do Salamandera pres thumbMaker->ProcessBuffer - // - pokud vrati FALSE, uklid a odchod (preruseni z duvodu zmeny cesty) - // - pokracovat ve SMYCCE, dokud nebude cely obrazek predan - // - uklid a odchod + // - if it returns FALSE, clean up and exit (interrupted due to a panel path change) + // - continue in SMYCCE until the entire image has been passed + // - clean up and exit virtual BOOL WINAPI LoadThumbnail(const char* filename, int thumbWidth, int thumbHeight, CSalamanderThumbnailMakerAbstract* thumbMaker, BOOL fastThumbnail) = 0; From 81e166c0b12101e23ca397169c3a9c5db690e3b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 17:04:49 +0200 Subject: [PATCH 262/710] [translation] Fix src/plugins/shared/spl_view.h comments (#637) --- src/plugins/shared/spl_view.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/plugins/shared/spl_view.h b/src/plugins/shared/spl_view.h index de9486737..809bbcb93 100644 --- a/src/plugins/shared/spl_view.h +++ b/src/plugins/shared/spl_view.h @@ -38,19 +38,19 @@ class CPluginInterfaceForViewerAbstract // Called when the viewer is requested to open and load file // 'name'; 'left'+'top'+'width'+'height'+'showCmd'+'alwaysOnTop' is the recommended window placement; - // okna, je-li 'returnLock' FALSE nemaji 'lock'+'lockOwner' zadny vyznam, je-li 'returnLock' + // window; if 'returnLock' is FALSE, 'lock'+'lockOwner' have no meaning; if 'returnLock' is // TRUE, mel by viewer vratit system-event 'lock' v nonsignaled stavu, do signaled stavu 'lock' // becomes signaled when viewing file 'name' ends (the file is removed from the temporary - // z docasneho adresare), dale by mel vratit v 'lockOwner' TRUE pokud ma byt objekt 'lock' uzavren - // volajicim (FALSE znamena, ze si viewer 'lock' rusi sam - v tomto pripade viewer musi pro - // prechod 'lock' do signaled stavu pouzit metodu CSalamanderGeneralAbstract::UnlockFileInCache); - // pokud viewer nenastavi 'lock' (zustava NULL) je soubor 'name' platny jen do ukonceni volani teto - // metody ViewFile; neni-li 'viewerData' NULL, jde o predani rozsirenych parametru viewru (viz + // directory at that moment); it should also return TRUE in 'lockOwner' if the 'lock' object is to be closed + // by the caller (FALSE means the viewer closes 'lock' itself - in that case the viewer must use + // CSalamanderGeneralAbstract::UnlockFileInCache to make 'lock' signaled); + // if the viewer does not set 'lock' (it remains NULL), file 'name' is valid only until this + // ViewFile call ends; if 'viewerData' is not NULL, it passes extended viewer parameters (see // CSalamanderGeneralAbstract::ViewFileInPluginViewer); 'enumFilesSourceUID' je UID zdroje (panelu // or Find window) from which the viewer is opened; if it is -1, the source is unknown (archives - // file_systemy nebo Alt+F11, atd.) - viz napr. CSalamanderGeneralAbstract::GetNextFileNameForViewer; + // or file systems, or Alt+F11, etc.) - see e.g. CSalamanderGeneralAbstract::GetNextFileNameForViewer; // 'enumFilesCurrentIndex' is the index of the opened file in the source (panel or Find window); if it is -1, - // neni zdroj nebo index znamy; vraci TRUE pri uspechu (FALSE znamena neuspech, 'lock' a + // the source or index is unknown; returns TRUE on success (FALSE means failure, 'lock' and // 'lockOwner' have no meaning in that case) virtual BOOL WINAPI ViewFile(const char* name, int left, int top, int width, int height, UINT showCmd, BOOL alwaysOnTop, BOOL returnLock, HANDLE* lock, @@ -58,11 +58,11 @@ class CPluginInterfaceForViewerAbstract int enumFilesSourceUID, int enumFilesCurrentIndex) = 0; // Called when the viewer is requested to open and load file - // 'name'; this method should not display any "invalid file format" dialogs; those - // dialogs are displayed only when the ViewFile method of this interface is called; checks whether - // file 'name' can be displayed in the viewer (e.g. the file has a matching signature) - // a pokud je, vraci TRUE; pokud vrati FALSE, zkusi Salamander pro 'name' najit jiny - // viewer (v prioritnim seznamu vieweru, viz konfiguracni stranka Viewers) + // 'name'; this method should not display any "invalid file format" dialogs; such + // dialogs are shown only when the ViewFile method of this interface is called; this method determines whether + // file 'name' can be displayed by the viewer (e.g. the file has a matching signature), + // and if so returns TRUE; if it returns FALSE, Salamander tries to find another + // viewer for 'name' (in the viewer priority list; see the Viewers configuration page) virtual BOOL WINAPI CanViewFile(const char* name) = 0; }; From 8d629ac02c57ddb4acc845df638cbb0a61e42a56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 17:04:53 +0200 Subject: [PATCH 263/710] [translation] Fix src/plugins/shared/winliblt.h comments (#638) --- src/plugins/shared/winliblt.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/plugins/shared/winliblt.h b/src/plugins/shared/winliblt.h index ece2ce343..4bbd62140 100644 --- a/src/plugins/shared/winliblt.h +++ b/src/plugins/shared/winliblt.h @@ -136,8 +136,8 @@ class CWindow : public CWindowsObject // registers WinLib universal classes; called automatically (unregistration is also automatic) static BOOL RegisterUniversalClass(HINSTANCE dllInstance); - // registrace vlastni univerzalni tridy; POZOR: pri unloadu pluginu je nutne zrusit registraci tridy, - // jinak pri opakovanem loadu pluginu dojde k chybe pri registraci (konflikt se starou tridou) + // registers a custom universal class; WARNING: when unloading the plugin, the class must be unregistered, + // otherwise reloading the plugin will fail during registration (conflict with the old class) static BOOL RegisterUniversalClass(UINT style, int cbClsExtra, int cbWndExtra, @@ -300,9 +300,9 @@ class CPropSheetPage : protected CDialog CDialog::SetObjectOrigin; // make permitted base-class methods accessible CDialog::Transfer; - // testovano s resourcem dialogu stranky se stylem: + // tested with a page dialog resource using the style: // DS_CONTROL | DS_3DLOOK | WS_CHILD | WS_CAPTION; - // pokud chceme pouzit primo titulek z resourcu, staci dat 'title'==NULL a + // to use the title directly from the resource, just set 'title'==NULL and // 'flags'==0 CPropSheetPage(char* title, HINSTANCE modul, int resID, DWORD flags /* = PSP_USETITLE*/, HICON icon, @@ -378,7 +378,7 @@ class CPropertyDialog : public TIndirectArray DWORD Flags; PFNPROPSHEETCALLBACK Callback; - DWORD* LastPage; // posledni zvolena stranka (muze byt NULL, pokud nezajima) + DWORD* LastPage; // last selected page (may be NULL if not needed) friend class CPropSheetPage; }; @@ -446,10 +446,10 @@ class CWindowQueue // sends a message to all windows (using PostMessage; the windows may be in different threads) void BroadcastMessage(DWORD uMsg, WPARAM wParam, LPARAM lParam); - // broadcastne WM_CLOSE, pak ceka na prazdnou frontu (max. cas dle 'force' bud 'forceWaitTime' - // nebo 'waitTime'); vraci TRUE pokud je fronta prazdna (vsechna okna se zavrela) - // nebo je 'force' TRUE; cas INFINITE = neomezene dlouhe cekani - // Poznamka: pri 'force' TRUE vraci vzdy TRUE, nema smysl na nic cekat, proto forceWaitTime = 0 + // broadcasts WM_CLOSE, then waits for the queue to become empty (the maximum wait time is 'forceWaitTime' + // or 'waitTime' depending on 'force'); returns TRUE if the queue is empty (all windows were closed) + // or if 'force' is TRUE; INFINITE means an unlimited wait + // Note: when 'force' is TRUE, it always returns TRUE; there is no point in waiting, so forceWaitTime = 0 BOOL CloseAllWindows(BOOL force, int waitTime = 1000, int forceWaitTime = 0); }; From 5b0559034fe586143e48d3a27212368d8c6ab80d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 17:04:56 +0200 Subject: [PATCH 264/710] [translation] Fix src/plugins/shared/spl_file.h comments (#639) --- src/plugins/shared/spl_file.h | 396 +++++++++++++++++----------------- 1 file changed, 195 insertions(+), 201 deletions(-) diff --git a/src/plugins/shared/spl_file.h b/src/plugins/shared/spl_file.h index c0f6354e3..f51cae602 100644 --- a/src/plugins/shared/spl_file.h +++ b/src/plugins/shared/spl_file.h @@ -20,57 +20,55 @@ #pragma option -a4 #endif // __BORLANDC__ -//**************************************************************************** +// **************************************************************************** // // CSalamanderSafeFileAbstract // -// Rodina metod SafeFile slouzi pro osetrenou praci se soubory. Metody kontroluji -// chybove stavy API volani a zobrazuji odpovidajici chybove hlasky. Chybove hlasky -// mohou obsahovat ruzne kombinace tlacitek. Od OK, pres Retry/Cancel, az po -// Retry/Skip/Skip all/Cancel. Kombinaci tlacitek urcuje volajici funkce jednim -// z parametru. -// -// Metody behem reseni problemovych stavu potrebuji znat nazev souboru, aby mohly -// zobrazit solidni chybovou hlasku. Zaroven potrebuji znat parametry oteviraneho -// souboru (jako je dwDesiredAccess, dwShareMode, atd), aby v pripade chyby mohly -// zavrit handle a znovu jej otevrit. Pokud napriklad dojde k preruseni na urovni -// sitove vrstvy behem operace ReadFile nebo WriteFile a uzivatel odstrani pricinu -// problemy a stiskne Retry, nelze znovu pouzit stary handle souboru. Je treba -// stary handle zavrit, soubor znovu otevrit, nastavit ukazovatko a operaci opakovat. -// Proto POZOR: metody SafeFileRead a SafeFileWrite pri reseni chybovych stavu mohou -// zmenit hodnotu SAFE_FILE::HFile. +// The SafeFile family provides file operations with built-in error handling. The methods check API call +// failures and display the corresponding error messages. Error messages may +// contain various button combinations, from OK through Retry/Cancel to +// Retry/Skip/Skip all/Cancel. The calling function determines the button +// combination with one of the parameters. // -// Z popsanych duvodu tedy nestacil klasicky HANDLE pro drzeni kontextu a nahrazuje -// jej struktura SAFE_FILE. V pripade metody SafeFileOpen je to nezbytny parametr, -// zatimco pro metody SafeFileCreate je tento parametr pouze [optional]. To je dano -// potrebou zachovat kompatibilni chovani metody SafeFileCreate pro sarsi pluginy. +// While handling error states, the methods need to know the file name so they can +// display a proper error message. They also need to know the parameters of the +// file being opened (such as dwDesiredAccess, dwShareMode, etc.) so that on error +// they can close the handle and reopen it. For example, if a network-layer +// interruption occurs during ReadFile or WriteFile and the user removes the cause +// of the problem and presses Retry, the old file handle cannot be reused. The old +// handle must be closed, the file reopened, the file pointer set, and the +// operation retried. Therefore, note that SafeFileRead and SafeFileWrite may +// change SAFE_FILE::HFile while handling errors. // -// Metody podporujici tlacitka Skip all/Overwrite all maji parametr 'silentMask'. -// Jedna se o ukazatel na bitove pole slozene SILENT_SKIP_xxx a SILENT_OVERWRITE_xxx. -// Pokud je ukazatel ruzny od NULL, plni bitove pole dve funkce: -// (1) vstupni: pokud je nastaven odpovidajici bit, metoda v pripade chyby nezobrazi -// chybove hlaseni a tise si odpovi bez interakce s uzivatelem. -// (2) vystupni: Pokud uzivatel odpovi na dotaz v pripade chyby tlacitkem Skip all -// nebo Overwrite all, metoda nastavi prislusny bit v bitovem poli. -// Toto bitové pole slouží jako kontext pÅ™edávaný do jednotlivých metod. Pro jednu -// logickou skupinu operací (například vybalování více souborů z archivu) pÅ™edává -// volající stejné bitové pole, které na zaÄátku inicializuje na hodnotu 0. -// Pripadne muze nektere bity v bitovem poli explicitne nastavit, aby potlacil -// prislusne dotazy. -// Salamander rezervuje cast bitoveho pole pro vnitrni stavy pluginu. -// Jedna se o jednickove bity v SILENT_RESERVED_FOR_PLUGINS. +// For these reasons, a plain HANDLE was not sufficient to hold the context and is +// replaced by the SAFE_FILE structure. For SafeFileOpen, this parameter is +// mandatory, while for SafeFileCreate it is only [optional]. This is necessary to +// preserve the compatible behavior of SafeFileCreate for older plugins. // -// Pokud neni u ukazatelu predavanych do metody rozhrani specifikovano jinak, -// nesmeji mit hodnotu NULL. +// Methods that support the Skip all/Overwrite all buttons have the 'silentMask' +// parameter. It is a pointer to a bitmask composed of SILENT_SKIP_xxx and +// SILENT_OVERWRITE_xxx. If the pointer is not NULL, the bitmask has two functions: +// (1) input: if the corresponding bit is set, the method does not display an +// error message when an error occurs and answers silently without user interaction. +// (2) output: if the user answers an error prompt with Skip all or Overwrite all, +// the method sets the corresponding bit in the bitmask. +// This bitmask serves as context passed to the individual methods. For one logical +// group of operations (for example, unpacking multiple files from an archive), the +// caller passes the same bitmask, initialized to 0 at the beginning. +// The caller may also set some bits in the bitmask explicitly to suppress the +// corresponding prompts. +// Salamander reserves part of the bitmask for internal plugin state. +// These are the 1-bits in SILENT_RESERVED_FOR_PLUGINS. // +// Unless otherwise specified, pointers passed to interface methods must not be NULL. struct SAFE_FILE { HANDLE HFile; // handle of the open file (note: it is managed under Salamander core HANDLES) char* FileName; // full path of the open file HWND HParentWnd; // hParent window handle from the SafeFileOpen/SafeFileCreate call; it is used - // pokud je hParent v nasledujich volani nastaven na HWND_STORED - DWORD dwDesiredAccess; // > zaloha parametru pro API CreateFile + // if hParent is set to HWND_STORED in subsequent calls + DWORD dwDesiredAccess; // > backup of the CreateFile API parameters DWORD dwShareMode; // > for possible retries DWORD dwCreationDisposition; // > in case of read or write errors DWORD dwFlagsAndAttributes; // > @@ -107,64 +105,62 @@ struct SAFE_FILE class CSalamanderSafeFileAbstract { public: - // // SafeFileOpen - // Otevre existujici soubor. + // Opens an existing file. // // Parameters // 'file' - // [out] Ukazatel na strukturu 'SAFE_FILE' ktera obdrzi informace o otevrenem - // souboru. Tato struktura slouzi jako kontext pro ostatni metody z rodiny - // SafeFile. Hodnoty struktury maji vyznam pouze v pripade, ze SafeFileOpen - // vratila TRUE. Pro zavreni souboru je treba zavolat metodu SafeFileClose. + // [out] Pointer to a 'SAFE_FILE' structure that receives information about the + // opened file. This structure serves as context for the other methods in the + // SafeFile family. The structure values are meaningful only if SafeFileOpen + // returned TRUE. To close the file, call SafeFileClose. // // 'fileName' - // [in] Ukazatel na retezec zakonceny nulou, ktery obsahuje nazev oteviraneho - // souboru. + // [in] Pointer to a null-terminated string that specifies the name of the + // file to open. // // 'dwDesiredAccess' // 'dwShareMode' // 'dwCreationDisposition' // 'dwFlagsAndAttributes' - // [in] viz API CreateFile. + // [in] See the CreateFile API. // // 'hParent' - // [in] Handle okna, ke kteremu budou modalne zobrazovany chybove hlasky. + // [in] Handle of the window to which error messages are shown modally. // // 'flags' - // [in] Jedna z hodnot BUTTONS_xxx, urcuje tlacitka zobrazena v chybovych hlaskach. + // [in] One of the BUTTONS_xxx values; specifies the buttons shown in error messages. // // 'pressedButton' - // [out] Ukazatel na promennou, ktera obdrzi stisknute tlacitko behem chybove - // hlasky. Promenna ma vyznam pouze v pripade, ze metoda SafeFileOpen vrati FALSE, - // jinak jeji hodnota neni definovana. Vraci jednu z hodnot DIALOG_xxx. - // V pripade chyb vraci hodnotu DIALOG_CANCEL. - // Pokud je diky 'silentMask' ignorovana nektera chybova hlaska, vraci hodnotu - // odpovidajiciho tlacitka (napriklad DIALOG_SKIP nebo DIALOG_YES). + // [out] Pointer to a variable that receives the button pressed in the error + // message. The variable is meaningful only if SafeFileOpen returns FALSE; + // otherwise its value is undefined. It returns one of the DIALOG_xxx values. + // On error it returns DIALOG_CANCEL. + // If an error message is suppressed because of 'silentMask', it returns the + // value of the corresponding button instead (for example DIALOG_SKIP or DIALOG_YES). // - // 'pressedButton' muze byt NULL (napriklad pro BUTTONS_OK nebo BUTTONS_RETRYCANCEL - // nema vyznam testovat stisknute tlacitko). + // 'pressedButton' may be NULL (for example, for BUTTONS_OK or BUTTONS_RETRYCANCEL + // there is no point in testing which button was pressed). // // 'silentMask' - // [in/out] Ukazatel na promennou obsahujici bitove pole hodnot SILENT_xxx. - // Pro metodu SafeFileOpen ma vyznam pouze hodnota SILENT_SKIP_FILE_OPEN. + // [in/out] Pointer to a variable containing a bitmask of SILENT_xxx values. + // For SafeFileOpen, only SILENT_SKIP_FILE_OPEN is meaningful. // - // Pokud je v bitovem poli nastaven bit SILENT_SKIP_FILE_OPEN, zaroven by - // zobrazena hlaska mela tlacitko Skip (rizeno parametrem 'flags') a zaroven - // dojde k chybe behem otevirani souboru, bude chybova hlaska potlacena. - // SafeFileOpen pak vrati FALSE a pokud je 'pressedButton' ruzne od NULL, - // nastavi do nej hodnotu DIALOG_SKIP. + // If the SILENT_SKIP_FILE_OPEN bit is set in the bitmask, the message would + // contain a Skip button (controlled by the 'flags' parameter), and an error + // occurs while opening the file, the error message is suppressed. + // SafeFileOpen then returns FALSE and, if 'pressedButton' is not NULL, sets + // it to DIALOG_SKIP. // // Return Values - // Vraci TRUE v pripade uspesneho otevreni souboru. Struktura 'file' je inicializovana - // a pro zavreni souboru je treba zavolat SafeFileClose. + // Returns TRUE if the file is opened successfully. The 'file' structure is initialized + // and SafeFileClose must be called to close the file. // - // V pripade chyby vraci FALSE a nastavi hodnoty promennych 'pressedButton' - // a 'silentMask', jsou-li ruzne od NULL. + // On failure returns FALSE and sets 'pressedButton' + // and 'silentMask' if they are not NULL. // // Remarks - // Metodu lze volat z libovolneho threadu. - // + // This method can be called from any thread. virtual BOOL WINAPI SafeFileOpen(SAFE_FILE* file, const char* fileName, DWORD dwDesiredAccess, @@ -178,53 +174,53 @@ class CSalamanderSafeFileAbstract // // SafeFileCreate - // Vytvori novy soubor vcetne cesty, pokud jiz neexistuje. Pokud jiz soubor existuje, - // nabidne jeho prepsani. Metoda je primarne urcena pro vytvareni souboru a adresaru - // vybalovanych z archivu. + // Creates a new file, including its path, if it does not already exist. If the file already exists, + // it offers to overwrite it. The method is primarily intended for creating files and directories + // extracted from an archive. // // Parameters // 'fileName' - // [in] Ukazatel na retezec zakonceny nulou, ktery specifikuje nazev - // vytvareneho souboru. + // [in] Pointer to a null-terminated string that specifies the name of the + // file to create. // // 'dwDesiredAccess' // 'dwShareMode' // 'dwFlagsAndAttributes' - // [in] viz API CreateFile. + // [in] See the CreateFile API. // // 'isDir' - // [in] Urcuje, zda posledni slozka cesty 'fileName' ma byt adresar (TRUE) - // nebo soubor (FALSE). Pokud je 'isDir' TRUE, budou ignorovany promenne + // [in] Specifies whether the last path component of 'fileName' is to be a directory (TRUE) + // or a file (FALSE). If 'isDir' is TRUE, the variables // 'dwDesiredAccess', 'dwShareMode', 'dwFlagsAndAttributes', 'srcFileName', - // 'srcFileInfo' a 'file'. + // 'srcFileInfo' and 'file' are ignored. // // 'hParent' - // [in] Handle okna, ke kteremu budou modalne zobrazovany chybove hlasky. + // [in] Handle of the window to which error messages are shown modally. // // 'srcFileName' - // [in] Ukazatel na retezec zakonceny nulou, ktery specifikuje nazev - // zdrojoveho souboru. Tento nazev bude zobrazen spolecne s velikosti - // a casem ('srcFileInfo') v dotazu na prepsani existujiciho souboru, - // pokud jiz soubor 'fileName' existuje. + // [in] Pointer to a null-terminated string that specifies the name of the + // source file. This name is displayed together with the size + // and time ('srcFileInfo') in the prompt to overwrite an existing file, + // if the 'fileName' file already exists. // 'srcFileName' muze byt NULL, potom je 'srcFileInfo' ignorovano. - // V tomto pripade zobrazi pripadny dotaz na prepsani obsahovat na miste - // zdrojoveho souboru text "a newly created file". + // In that case, the overwrite prompt will display the text + // "a newly created file" instead of the source file. // // 'srcFileInfo' - // [in] Ukazatel na retezec zakonceny nulou, ktery obsahuje velikost, datum - // a cas zdrojoveho souboru. Tyto informace budou zobrazeny spolecne s nazvem - // zdrojoveho souboru 'srcFileName' v dotazu na prepsani existujiciho souboru. - // Format: "velikost, datum, cas". + // [in] Pointer to a null-terminated string containing the size, date + // and time of the source file. This information is displayed together with the name + // of the source file 'srcFileName' in the prompt to overwrite an existing file. + // Format: "size, date, time". // Velikost ziskame pomoci CSalamanderGeneralAbstract::NumberToStr, - // datum pomoci GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, ... - // a cas pomoci GetTimeFormat(LOCALE_USER_DEFAULT, 0, ... - // Viz implementace metody GetFileInfo v pluginu UnFAT. - // 'srcFileInfo' muze byt NULL, pokud je take 'srcFileName' NULL. + // date by calling GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, ... + // and time by calling GetTimeFormat(LOCALE_USER_DEFAULT, 0, ... + // See the implementation of the GetFileInfo method in the UnFAT plugin. + // 'srcFileInfo' may be NULL if 'srcFileName' is also NULL. // // 'silentMask' - // [in/out] Ukazatel na bitove pole slozene ze SILENT_SKIP_xxx a SILENT_OVERWRITE_xxx, - // viz uvod na zacatku tohoto souboru. Pokud je 'silentMask' NULL, bude ignorovano. - // Metoda SafeFileCreate testuje a nastavuje tyto konstanty: + // [in/out] Pointer to a bitmask composed of SILENT_SKIP_xxx and SILENT_OVERWRITE_xxx, + // see the introduction at the beginning of this file. If 'silentMask' is NULL, it is ignored. + // SafeFileCreate checks and sets these constants: // SILENT_SKIP_FILE_NAMEUSED // SILENT_SKIP_DIR_NAMEUSED // SILENT_OVERWRITE_FILE_EXIST @@ -234,81 +230,81 @@ class CSalamanderSafeFileAbstract // SILENT_SKIP_DIR_CREATE // SILENT_SKIP_FILE_CREATE // - // Pokud je 'srcFileName' ruzne od NULL, tedy jedna se o COPY/MOVE operaci, plati: - // Je-li v konfiguraci Salamandera (stranka Confirmations) vypnuta volba - // "Confirm on file overwrite", chova se metoda jako-by 'silentMask' obsahovalo + // If 'srcFileName' is not NULL, meaning this is a COPY/MOVE operation, the following applies: + // If the "Confirm on file overwrite" option is disabled in Salamander's + // Confirmations configuration page, the method behaves as if 'silentMask' contained // SILENT_OVERWRITE_FILE_EXIST. - // Je-li vypnuto "Confirm on system or hidden file overwrite", chova se metoda - // jako-by 'silentMask' obsahovalo SILENT_OVERWRITE_FILE_SYSHID. + // If "Confirm on system or hidden file overwrite" is disabled, the method behaves + // as if 'silentMask' contained SILENT_OVERWRITE_FILE_SYSHID. // // 'allowSkip' - // [in] Specifikuje, zda dotazy a chybove hlasky budou obsahovat take tlacitka "Skip" - // a "Skip all" + // [in] Specifies whether prompts and error messages will also contain the "Skip" + // and "Skip all" buttons. // // 'skipped' - // [out] Vraci TRUE v pripade, ze uzivatel v dotazu nebo chybove hlasce kliknul na - // tlacitko "Skip" nebo "Skip all". Jinak vraci FALSE. Promenna 'skipped' muze byt NULL. - // Promenna ma vyznam pouze v pripade, ze SafeFileCreate vrati INVALID_HANDLE_VALUE. + // [out] Returns TRUE if the user clicked the "Skip" or "Skip all" button in a prompt + // or error message. Otherwise it returns FALSE. The 'skipped' variable may be NULL. + // The variable is meaningful only if SafeFileCreate returns INVALID_HANDLE_VALUE. // // 'skipPath' - // [out] Ukazatel na buffer, ktery obdrzi cestu, kterou si uzivatel v nekterem z - // dotazu pral preskocit tlacitkem "Skip" nebo "Skip all". Velikost bufferu je - // dana promennou skipPathMax, ktera nebude prekrocena. Cesta bude zakoncena nulou. - // Na zacatku metody SafeFileCreate je do bufferu nastaven prazdny retezec. + // [out] Pointer to a buffer that receives the path the user chose to skip in one of the + // prompts by clicking the "Skip" or "Skip all" button. The buffer size is + // given by the skipPathMax variable and will not be exceeded. The path is null-terminated. + // At the beginning of SafeFileCreate, the buffer is set to an empty string. // 'skipPath' muze byt NULL, 'skipPathMax' je potom ignorovano. // // 'skipPathMax' - // [in] Velikost bufferu 'skipPath' ve znacich. Musi byt nastavena je-li 'skipPath' + // [in] Size of the 'skipPath' buffer in characters. It must be set if 'skipPath' // ruzna od NULL. // // 'allocateWholeFile' - // [in/out] Ukazatel na CQuadWord udavajici velikost, na kterou by se mel soubor - // predalokovat pomoci funkce SetEndOfFile. Pokud je ukazatel NULL, bude ignorovan - // a SafeFileCreate se o predalokaci nebude pokouset. Pokud je ukazatel ruzny od - // NULL, pokusi se funkce o predalokovani. Pozadovana velikost musi byt vetsi nez + // [in/out] Pointer to a CQuadWord specifying the size to which the file should be + // preallocated using SetEndOfFile. If the pointer is NULL, it is ignored + // and SafeFileCreate does not attempt preallocation. If the pointer is not + // NULL, the function attempts preallocation. The requested size must be greater than // CQuadWord(2, 0) a mensi nez CQuadWord(0, 0x80000000) (8EB). // - // Pokud ma SafeFileCreate zaroven provest test (mechanismu predalokace nemusi byt - // vzdy funkcni), musi byt nastaven nejvyssi bit velikosti, tedy k hodnote pricteno + // If SafeFileCreate is also to perform a test (the preallocation mechanism may not always be + // functional), the highest bit of the size must be set, that is, add // CQuadWord(0, 0x80000000). // - // Pokud se soubor podari vytvorit (funkce SafeFileCreate vrati handle ruzny od - // INVALID_HANDLE_VALUE), bude promenna 'allocateWholeFile' nastavena na jednu z - // z nasledujicich hodnot: + // If the file is created successfully (SafeFileCreate returns a handle other than + // INVALID_HANDLE_VALUE), the 'allocateWholeFile' variable is set to one of + // the following values: // CQuadWord(0, 0x80000000): soubor se nepodarilo predalokovat a behem pristiho - // volani SafeFileCreate pro soubory do stejne destinace + // call to SafeFileCreate for files in the same destination // by mela byt 'allocateWholeFile' NULL // CQuadWord(0, 0): soubor se nepodarilo predalokovat, ale neni to nic - // fatalniho a pri dalsim volanim SafeFileCreate pro - // soubory s touto destinaci muzete zadat jejich predalokovani - // jina: predalokovani probehlo korektne - // V tomto pripade je nastavena SAFE_FILE::WholeFileAllocated - // na TRUE a behem SafeFileClose se zavola SetEndOfFile pro - // zkraceni souboru a zamezeni ukladani zbytecnych dat. + // fatal, and on the next call to SafeFileCreate for + // files with this destination you may request preallocation + // other: preallocation completed successfully + // In this case SAFE_FILE::WholeFileAllocated is set + // to TRUE and SetEndOfFile is called during SafeFileClose to + // truncate the file and avoid storing unnecessary data. // // 'file' - // [out] Ukazatel na strukturu 'SAFE_FILE' ktera obdrzi informace o otevrenem - // souboru. Tato struktura slouzi jako kontext pro ostatni metody z rodiny - // SafeFile. Hodnoty struktury maji vyznam pouze v pripade, ze SafeFileCreate - // vratila hodnotu ruznou od INVALID_HANDLE_VALUE. Pro zavreni souboru je treba - // zavolat metodu SafeFileClose. Pokud je 'file' ruzne od NULL, zaradi - // SafeFileCreate vytvoreny handle do HANDLES Salamandera. Pokud je 'file' NULL, - // handle nebude do HANDLES zarazen. Pokud je 'isDir' TRUE, je promenna 'file' - // ignorovana. + // [out] Pointer to a 'SAFE_FILE' structure that receives information about the opened + // file. This structure serves as context for the other methods in the + // SafeFile family. The structure values are meaningful only if SafeFileCreate + // returned a value other than INVALID_HANDLE_VALUE. To close the file, + // call the SafeFileClose method. If 'file' is not NULL, + // SafeFileCreate places the created handle into Salamander HANDLES. If 'file' is NULL, + // the handle is not placed into HANDLES. If 'isDir' is TRUE, the 'file' variable is + // ignored. // // Return Values - // Pokud je 'isDir' TRUE, vraci v pripade uspechu hodnotu ruznou od INVALID_HANDLE_VALUE. - // Pozor, nejedna se o platny handle vytvoreneho adresare. V pripade neuspechu vraci - // INVALID_HANDLE_VALUE a nastavuje promenne 'silentMask', 'skipped' a 'skipPath'. + // If 'isDir' is TRUE, returns a value other than INVALID_HANDLE_VALUE on success. + // Note that this is not a valid handle of the created directory. On failure it returns + // INVALID_HANDLE_VALUE and sets the 'silentMask', 'skipped', and 'skipPath' variables. // - // Pokud je 'isDir' FALSE, vraci v pripade uspechu handle vytvoreneho souboru a pokud + // If 'isDir' is FALSE, returns the handle of the created file on success and, if // je 'file' ruzne od NULL, plni strukturu SAFE_FILE. - // V pripade neuspechu vraci INVALID_HANDLE_VALUE a nastavuje promenne 'silentMask', - // 'skipped' a 'skipPath'. + // On failure it returns INVALID_HANDLE_VALUE and sets the 'silentMask', + // 'skipped' and 'skipPath' variables. // // Remarks - // Metodu lze volat pouze z hlavniho threadu. (muze volat API FlashWindow(MainWindow), - // ktere musi byt zavolano z threadu okna, jinak zpusobi deadlock) + // This method may be called only from the main thread. (It may call API FlashWindow(MainWindow), + // which must be called from the window thread or it will cause a deadlock.) // virtual HANDLE WINAPI SafeFileCreate(const char* fileName, DWORD dwDesiredAccess, @@ -338,108 +334,106 @@ class CSalamanderSafeFileAbstract // This method can be called from any thread. virtual void WINAPI SafeFileClose(SAFE_FILE* file) = 0; + //SafeFileSeek + // Sets the file pointer in an open file. // - // SafeFileSeek - // Nastavi ukazovatko v otevrenem souboru. - // - // Parameters + //Parameters // 'file' - // [in] Ukazatel na strukturu 'SAFE_FILE', ktera byla inicializovana - // volanim metody SafeFileOpen nebo SafeFileCreate. + // [in] Pointer to a 'SAFE_FILE' structure initialized by a call to + // SafeFileOpen or SafeFileCreate. // - // 'distance' - // [in/out] Pocet bajtu, o kolik se ma posunou ukazovatko v souboru. - // V pripade uspechu obdrzi hodnotu nove pozice ukazovatka. + // 'distance' + // [in/out] Number of bytes by which to move the file pointer. + // On success, it receives the new file pointer position. // - // Hodnota CQuadWord::Value se interpretuje jako signed a to pro - // vsechny tri hodnoty 'moveMethod' (pozor na chybu v MSDN u SetFilePointerEx, - // kde tvrdi, ze hodnota je pro FILE_BEGIN unsigned). Pokud tedy chceme - // couvat od akualniho mista (FILE_CURRENT) nebo od konce (FILE_END) souboru, - // nastavime CQuadWord::Value na zaporne cislo. Do promenne CQuadWord::Value - // lze primo priradit napriklad __int64. + // CQuadWord::Value is interpreted as signed for all three 'moveMethod' + // values (note the MSDN bug in SetFilePointerEx, which claims the value + // is unsigned for FILE_BEGIN). Therefore, if you want to move backward + // from the current position (FILE_CURRENT) or from the end of the file + // (FILE_END), set CQuadWord::Value to a negative number. You can assign + // __int64 directly to CQuadWord::Value. // - // Vracena hodnota je absolutni pozice od zacatku souboru a jeji hodnoty budou - // od 0 do 2^63. Soubory nad 2^63 zadne ze soucasnych Windows nepodporuji. + // The returned value is the absolute position from the beginning of the file + // and ranges from 0 to 2^63. No current Windows version supports files + // larger than 2^63. // // 'moveMethod' - // [in] Vychozi pozice pro ukazovatko. Muze byt jedna z hodnot: - // FILE_BEGIN, FILE_CURRENT nebo FILE_END. + // [in] Starting position for the file pointer. It can be one of: + // FILE_BEGIN, FILE_CURRENT or FILE_END. // // 'error' - // [out] Ukazatel na promennou DWORD, ktera v pripade chyby bude obsahovat - // hodnotu vracenou z GetLastError(). 'error' muze byt NULL. + // [out] Pointer to a DWORD variable that receives the value returned + // by GetLastError() on failure. 'error' may be NULL. // // Return Values - // V pripade uspechu vraci TRUE a hodnota promenne 'distance' je nastavena - // na novou pozici ukazovatka v souboru. + // On success returns TRUE and sets 'distance' to the new file + // pointer position. // - // V pripade chyby vraci FALSE a nastavi hodnotu 'error' na GetLastError, - // je-li 'error' ruzna od NULL. Chybu nezobrazuje, k tomu slouzi SafeFileSeekMsg. + // On failure returns FALSE and sets 'error' to GetLastError(), + // if 'error' is not NULL. It does not display the error; use SafeFileSeekMsg for that. // // Remarks - // Metoda vola API SetFilePointer, takze pro ni plati omezeni teto funkce. - // - // Neni chybou nastavit ukazovatko za konec souboru. Velikost souboru se - // nezvetsi dokud nezavolate SetEndOfFile nebo SafeFileWrite. Viz API SetFilePointer. + // This method calls the SetFilePointer API, so its limitations apply. // - // Metodu lze pouzit pro ziskani velikosti souboru, pokud nastavime hodnotu - // 'distance' na 0 a 'moveMethod' na FILE_END. Vracena hodnota 'distance' bude - // velikost souboru. + // Setting the file pointer beyond the end of the file is not an error. The file + // size does not increase until you call SetEndOfFile or SafeFileWrite. See the + // SetFilePointer API. // - // Metodu lze volat z libovolneho threadu. + // This method can be used to get the file size by setting 'distance' + // to 0 and 'moveMethod' to FILE_END. The returned 'distance' value will be + // the file size. // + // This method can be called from any thread. virtual BOOL WINAPI SafeFileSeek(SAFE_FILE* file, CQuadWord* distance, DWORD moveMethod, DWORD* error) = 0; - // // SafeFileSeekMsg - // Nastavi ukazovatko v otevrenem souboru. Pokud dojde k chybe, zobrazi ji. + // Sets the file pointer in an open file. Displays an error if one occurs. // // Parameters // 'file' // 'distance' // 'moveMethod' - // Viz komentar u SafeFileSeek. + // See the SafeFileSeek comment. // // 'hParent' - // [in] Handle okna, ke kteremu budou modalne zobrazovany chybove hlasky. - // Pokud je rovno HWND_STORED, pouzije se 'hParent' z volani SafeFileOpen/SafeFileCreate. + // [in] Handle of the window to which error messages are shown modally. + // If it is HWND_STORED, the 'hParent' from the SafeFileOpen/SafeFileCreate call is used. // // 'flags' - // [in] Jedna z hodnot BUTTONS_xxx, urcuje tlacitka zobrazena v chybovem hlaseni. + // [in] One of the BUTTONS_xxx values; determines the buttons shown in the error message. // // 'pressedButton' - // [out] Ukazatel na promennou, ktera obdrzi stisknute tlacitko behem chybove - // hlasky. Promenna ma vyznam pouze v pripade, ze metoda SafeFileSeekMsg vrati FALSE. - // 'pressedButton' muze byt NULL (napriklad pro BUTTONS_OK nema vyznam testovat - // stisknute tlacitko) + // [out] Pointer to a variable that receives the button pressed in the error + // message. The variable is meaningful only if SafeFileSeekMsg returns FALSE. + // 'pressedButton' may be NULL (for example, for BUTTONS_OK there is no point in testing + // which button was pressed) // // 'silentMask' - // [in/out] Ukazatel na promennou obsahujici bitove pole hodnot SILENT_SKIP_xxx. - // Podrobnosti viz komentar u SafeFileOpen. - // SafeFileSeekMsg testuje a nastavuje bit SILENT_SKIP_FILE_READ je-li - // 'seekForRead' TRUE nebo SILENT_SKIP_FILE_WRITE, je-li 'seekForRead' FALSE; + // [in/out] Pointer to a variable containing a bitmask of SILENT_SKIP_xxx values. + // See the SafeFileOpen comment for details. + // SafeFileSeekMsg checks and sets the SILENT_SKIP_FILE_READ bit if + // 'seekForRead' is TRUE, or SILENT_SKIP_FILE_WRITE if 'seekForRead' is FALSE; // // 'seekForRead' - // [in] Rika metode, za jakym ucelem jsme provadeli seek v souboru. Metoda pouzije - // tuto promennou pouze v pripade chyby. Urcuje, ktery z bitu se pouzije pro - // 'silentMask' a jaky bude titulek chybove hlasky: "Error Reading File" nebo + // [in] Tells the method whether the seek was performed for reading or writing. The method uses + // this variable only on error. It determines which bit is used for + // 'silentMask' and what the error message title will be: "Error Reading File" or // "Error Writing File". // // Return Values - // V pripade uspechu vraci TRUE a hodnota promenne 'distance' je nastavena - // na novou pozici ukazovatka v souboru. + // On success returns TRUE and sets 'distance' to the new file + // pointer position. // - // V pripade chyby vraci FALSE a nastavi hodnoty promennych 'pressedButton' - // a silentMask, jsou-li ruzne od NULL. + // On failure returns FALSE and sets 'pressedButton' + // and 'silentMask', if they are not NULL. // // Remarks - // Viz metoda SafeFileSeek. - // - // Metodu lze volat z libovolneho threadu. + // See SafeFileSeek. // + // This method can be called from any thread. virtual BOOL WINAPI SafeFileSeekMsg(SAFE_FILE* file, CQuadWord* distance, DWORD moveMethod, From de13d4c69b7d96d2515157d5123b09b634914510 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 17:04:59 +0200 Subject: [PATCH 265/710] [translation] Fix src/plugins/shared/spl_com.h comments (#640) --- src/plugins/shared/spl_com.h | 543 +++++++++++++++++------------------ 1 file changed, 270 insertions(+), 273 deletions(-) diff --git a/src/plugins/shared/spl_com.h b/src/plugins/shared/spl_com.h index e8b0bc1d8..0ffdca84b 100644 --- a/src/plugins/shared/spl_com.h +++ b/src/plugins/shared/spl_com.h @@ -27,21 +27,19 @@ // global variable with the Salamander version in which this plugin is loaded extern int SalamanderVersion; -// // **************************************************************************** // CSalamanderDirectoryAbstract // -// trida reprezentuje adresarovou strukturu - soubory a adresare na pozadovanych cestach, root cesta je "", -// oddelovace v ceste jsou backslashe ('\\') -// +// class representing a directory structure - files and directories on the requested paths, the root path is "", +// path separators are backslashes ('\\') -// CQuadWord - 64-bitovy unsigned integer pro velikosti souboru -// triky: -// -rychlejsi predani vstupniho parametru typu CQuadWord: const CQuadWord & -// -priradit 64-bit integer: quadWord.Value = XXX; -// -pocitat pomer velikosti: quadWord1.GetDouble() / quadWord2.GetDouble() // ztrata presnosti pred delenim se projevi malo (max. 1e-15) -// -oriznout na DWORD: (DWORD)quadWord.Value -// -prevest (unsigned) __int64 na CQuadWord: CQuadWord().SetUI64(XXX) +// CQuadWord - 64-bit unsigned integer for file sizes +// tricks: +// - faster passing of an input parameter of type CQuadWord: const CQuadWord & +// - assign a 64-bit integer: quadWord.Value = XXX; +// - compute a size ratio: quadWord1.GetDouble() / quadWord2.GetDouble() // precision loss before division is small (max. 1e-15) +// - truncate to DWORD: (DWORD)quadWord.Value +// - convert (unsigned) __int64 to CQuadWord: CQuadWord().SetUI64(XXX) struct CQuadWord { @@ -55,9 +53,9 @@ struct CQuadWord unsigned __int64 Value; }; - // POZOR: nesmi sem prijit operator prirazeni ani konstruktor pro jeden DWORD, - // jinak bude pouziti 8-bytovych cisel zcela nekontrolovatelne (C++ vse - // vzajemne prevede, coz nemusi byt vzdy prave ono) + // WARNING: do not add an assignment operator or a constructor for a single DWORD here, + // otherwise the use of 8-byte numbers becomes completely uncontrolled (C++ converts + // everything back and forth, which may not always be what you want) CQuadWord() {} CQuadWord(DWORD lo, DWORD hi) @@ -197,28 +195,28 @@ struct CQuadWord #define QW_MAX CQuadWord(0xFFFFFFFF, 0xFFFFFFFF) -#define ICONOVERLAYINDEX_NOTUSED 15 // hodnota pro CFileData::IconOverlayIndex v pripade, ze ikona nema overlay +#define ICONOVERLAYINDEX_NOTUSED 15 // value for CFileData::IconOverlayIndex when the icon has no overlay // record of each file and directory in Salamander (basic file/directory data) struct CFileData // no destructor may be added here! { char* Name; // allocated file name (without the path), must be allocated on // Salamander's heap (see CSalamanderGeneralAbstract::Alloc/Realloc/Free) - char* Ext; // ukazatel do Name za prvni tecku zprava (vcetne tecky na zacatku jmena, - // na Windows se chape jako pripona, narozdil od UNIXu) nebo na konec - // Name, pokud pripona neexistuje; je-li v konfiguraci nastaveno FALSE - // pro SALCFG_SORTBYEXTDIRSASFILES, je v Ext pro adresare ukazatel na konec - // Name (adresare nemaji pripony) + char* Ext; // pointer into Name after the first dot from the right (including a dot at the start of the name, + // on Windows it is understood as an extension, unlike on UNIX) or to the end of + // Name if there is no extension; if FALSE is set in the configuration + // for SALCFG_SORTBYEXTDIRSASFILES, Ext points to the end of Name for directories + // (directories have no extensions) CQuadWord Size; // file size in bytes DWORD Attr; // file attributes - ORed FILE_ATTRIBUTE_XXX constants FILETIME LastWrite; // last-write time of the file (UTC-based time) char* DosName; // allocated DOS 8.3 file name; if not needed it is NULL, must be // allocated on Salamander's heap (see CSalamanderGeneralAbstract::Alloc/Realloc/Free) DWORD_PTR PluginData; // used by the plugin through CPluginDataInterfaceAbstract; Salamander ignores it - unsigned NameLen : 9; // delka retezce Name (strlen(Name)) - POZOR: maximalni delka jmena je (MAX_PATH - 5) + unsigned NameLen : 9; // length of Name (strlen(Name)) - WARNING: the maximum name length is (MAX_PATH - 5) unsigned Hidden : 1; // je hidden? (je-li 1, ikonka je pruhlednejsi o 50% - ghosted) - unsigned IsLink : 1; // je link? (je-li 1, ikonka ma overlay linku) - standardni plneni viz CSalamanderGeneralAbstract::IsFileLink(CFileData::Ext), pri zobrazeni ma prednost pred IsOffline, ale IconOverlayIndex ma prednost - unsigned IsOffline : 1; // je offline? (je-li 1, ikonka ma overlay offline - cerne hodiny), pri zobrazeni ma IsLink i IconOverlayIndex prednost + unsigned IsLink : 1; // is it a link? (if 1, the icon gets the link overlay) - standard filling: see CSalamanderGeneralAbstract::IsFileLink(CFileData::Ext); when displayed, it takes precedence over IsOffline, but IconOverlayIndex takes precedence + unsigned IsOffline : 1; // is it offline? (if 1, the icon gets the offline overlay - black clock); when displayed, IsLink and IconOverlayIndex take precedence unsigned IconOverlayIndex : 4; // icon overlay index (if the icon has no overlay, this is ICONOVERLAYINDEX_NOTUSED); when displayed, it takes precedence over IsLink and IsOffline // flags for Salamander internal use: they are cleared when added to CSalamanderDirectoryAbstract @@ -244,7 +242,7 @@ struct CFileData // no destructor may be added here! #define VALID_DATA_TIME 0x0020 // modification time (UTC-based) is stored in LastWrite (without it: all times in LastWrite are 0:00:00 in local time) #define VALID_DATA_ATTRIBUTES 0x0040 // attributes are stored in Attr (ORed Win32 API FILE_ATTRIBUTE_XXX constants) (without it: all Attr values are 0) #define VALID_DATA_HIDDEN 0x0080 // 'ghosted' icon flag is stored in Hidden (without it: all Hidden values are 0) -#define VALID_DATA_ISLINK 0x0100 // IsLink obsahuje 1 pokud jde o link, ikonka ma overlay linku (bez: vsechny IsLink = 0) +#define VALID_DATA_ISLINK 0x0100 // IsLink is 1 for a link; the icon gets the link overlay (without it: all IsLink values are 0) #define VALID_DATA_ISOFFLINE 0x0200 // IsOffline is 1 for an offline file/directory; the icon gets the offline overlay (without it: all IsOffline values are 0) #define VALID_DATA_PL_SIZE 0x0400 // meaningful only when VALID_DATA_SIZE is not used: the plugin stores the size in bytes for at least some files/directories (somewhere in PluginData); Salamander calls CPluginDataInterfaceAbstract::GetByteSize() to retrieve it #define VALID_DATA_PL_DATE 0x0800 // meaningful only when VALID_DATA_DATE is not used: the plugin stores the modification date for at least some files/directories (somewhere in PluginData); Salamander calls CPluginDataInterfaceAbstract::GetLastWriteDate() to retrieve it @@ -280,10 +278,10 @@ class CPluginDataInterfaceAbstract; class CSalamanderDirectoryAbstract { public: - // vycisti cely objekt, pripravi ho pro dalsi pouziti; pokud 'pluginData' neni NULL, pouzije - // se pro soubory a adresare k uvolneni dat specifickych pluginu (CFileData::PluginData); - // nastavuje standardni hodnotu masky platnych dat (suma vsech VALID_DATA_XXX krome - // VALID_DATA_ICONOVERLAY) a priznaku objektu (viz metoda SetFlags) + // clears the entire object and prepares it for further use; if 'pluginData' is not NULL, it is used + // to free plugin-specific data (CFileData::PluginData) for files and directories; + // sets the default value of the valid-data mask (sum of all VALID_DATA_XXX except + // VALID_DATA_ICONOVERLAY) and object flags (see SetFlags) virtual void WINAPI Clear(CPluginDataInterfaceAbstract* pluginData) = 0; // sets the valid data mask that determines which CFileData fields are valid @@ -299,30 +297,30 @@ class CSalamanderDirectoryAbstract // directory checks are unnecessary) virtual void WINAPI SetFlags(DWORD flags) = 0; - // prida soubor na zadanou cestou (relativni k tomuto "salamander-adresari"), vraci uspech - // retezec path se pouziva jen uvnitr funkce, obsah struktury file se pouziva i mimo funkci - // (neuvolnovat pamet naalokovanou pro promenne uvnitr struktury) - // v pripade neuspechu, je treba obsah struktury file uvolnit; - // parametr 'pluginData' neni NULL jen pro archivy (FS pouzivaji jen prazdne 'path' (==NULL)); - // neni-li 'pluginData' NULL, pouziva se 'pluginData' pri zakladani novych adresaru (pokud - // 'path' neexistuje), viz CPluginDataInterfaceAbstract::GetFileDataForNewDir; - // kontrola unikatnosti jmena souboru na ceste 'path' se neprovadi + // adds a file to the specified path (relative to this "Salamander directory"), returns success + // the 'path' string is used only inside the function; the contents of the file structure are used outside the function too + // (do not free memory allocated for variables inside the structure) + // in case of failure, the contents of the file structure must be freed; + // the 'pluginData' parameter is not NULL only for archives (FSs use only an empty 'path' (==NULL)); + // if 'pluginData' is not NULL, 'pluginData' is used when creating new directories (if + // 'path' does not exist), see CPluginDataInterfaceAbstract::GetFileDataForNewDir; + // file name uniqueness on path 'path' is not checked virtual BOOL WINAPI AddFile(const char* path, CFileData& file, CPluginDataInterfaceAbstract* pluginData) = 0; - // prida adresar na zadanou cestu (relativni k tomuto "salamander-adresari"), vraci uspech - // retezec path se pouziva jen uvnitr funkce, obsah struktury file se pouziva i mimo funkci - // (neuvolnovat pamet naalokovanou pro promenne uvnitr struktury) - // v pripade neuspechu, je treba obsah struktury file uvolnit; - // parametr 'pluginData' neni NULL jen pro archivy (FS pouzivaji jen prazdne 'path' (==NULL)); - // neni-li 'pluginData' NULL, pouziva se pri zakladani novych adresaru (pokud 'path' neexistuje), - // viz CPluginDataInterfaceAbstract::GetFileDataForNewDir; - // kontrola unikatnosti jmena adresare na ceste 'path' se provadi, dochazi-li k pridani - // jiz existujiciho adresare, dojde k uvolneni puvodnich dat (neni-li 'pluginData' NULL, vola - // se pro uvolneni dat i CPluginDataInterfaceAbstract::ReleasePluginData) a ulozeni dat z 'dir' - // (je nutne pro obnovu dat adresaru, ktere se vytvori automaticky pri neexistenci 'path'); - // specialita pro FS (nebo objekt alokovany pres CSalamanderGeneralAbstract::AllocSalamanderDirectory - // s 'isForFS'==TRUE): je-li dir.Name "..", je adresar pridan jako up-dir (muze byt jen jeden, - // zobrazuje se vzdy na zacatku listingu a ma specialni ikonu) + // adds a directory to the specified path (relative to this "Salamander directory"), returns success + // the 'path' string is used only inside the function; the contents of the file structure are used outside the function too + // (do not free memory allocated for variables inside the structure) + // in case of failure, the contents of the file structure must be freed; + // the 'pluginData' parameter is not NULL only for archives (FSs use only an empty 'path' (==NULL)); + // if 'pluginData' is not NULL, it is used when creating new directories (if 'path' does not exist), + // see CPluginDataInterfaceAbstract::GetFileDataForNewDir; + // directory name uniqueness on path 'path' is checked; if an already existing + // directory is added, the original data is freed (if 'pluginData' is not NULL, + // CPluginDataInterfaceAbstract::ReleasePluginData is also called to free the data) and the data from 'dir' is stored + // (this is necessary to restore directory data for directories that were created automatically because 'path' did not exist); + // special case for FS (or an object allocated through CSalamanderGeneralAbstract::AllocSalamanderDirectory + // with 'isForFS'==TRUE): if dir.Name is "..", the directory is added as up-dir (there can be only one, + // it is always shown at the start of the listing and has a special icon) virtual BOOL WINAPI AddDir(const char* path, CFileData& dir, CPluginDataInterfaceAbstract* pluginData) = 0; // returns the number of files in the object @@ -362,52 +360,52 @@ class CSalamanderDirectoryAbstract #define SALENUM_ERROR 1 // an error occurred and the user chose to continue the operation (only the faulty files/directories were skipped) #define SALENUM_CANCEL 2 // an error occurred and the user wants to cancel the operation -// enumerator, vraci jmena souboru, konci vracenim NULL; -// 'enumFiles' == -1 -> reset enumerace (po tomto volani zacina enumerace opet od zacatku), vsechny -// dalsi parametry (az na 'param') jsou ignorovany, nema navratove hodnoty (dava -// vse na nulu) -// 'enumFiles' == 0 -> enumerace souboru a podadresaru jen z korene -// 'enumFiles' == 1 -> enumerace vsech souboru a podadresaru -// 'enumFiles' == 2 -> enumerace vsech podadresaru, soubory jen z korene; -// k chybe muze dojit jen pri 'enumFiles' == 1 nebo 'enumFiles' == 2 ('enumFiles' == 0 nekompletuje -// jmena a cesty); 'parent' je parent pripadnych messageboxu s chybami (NULL znamena nezobrazovat -// chyby); v 'isDir' (neni-li NULL) vraci TRUE pokud jde o adresar; v 'size' (neni-li NULL) vraci -// velikost souboru (u adresaru se vraci velikost jen pri 'enumFiles' == 0 - jinak je nulova); -// neni-li 'fileData' NULL, vraci se v nem ukazatel na strukturu CFileData vraceneho -// souboru/adresare (pokud enumerator vraci NULL, vraci se v 'fileData' take NULL); -// 'param' je parametr 'nextParam' predavany spolu s ukazatelem na funkci tohoto -// typu; v 'errorOccured' (neni-li NULL) se vraci SALENUM_ERROR, pokud se pri sestavovani vracenych -// jmen narazilo na prilis dlouhe jmeno a uzivatel se rozhodl preskocit jen chybne soubory/adresare, +// enumerator, returns file names and ends by returning NULL; +// 'enumFiles' == -1 -> reset enumeration (after this call, enumeration starts again from the beginning), all +// other parameters (except 'param') are ignored, it has no return values (everything is +// set to zero) +// 'enumFiles' == 0 -> enumerate files and subdirectories from the root only +// 'enumFiles' == 1 -> enumerate all files and subdirectories +// 'enumFiles' == 2 -> enumerate all subdirectories, files from the root only; +// an error can occur only for 'enumFiles' == 1 or 'enumFiles' == 2 ('enumFiles' == 0 does not build +// names and paths); 'parent' is the parent of any error message boxes (NULL means do not show +// errors); 'isDir' (if not NULL) returns TRUE if it is a directory; 'size' (if not NULL) returns +// the file size (for directories, a size is returned only for 'enumFiles' == 0 - otherwise it is zero); +// if 'fileData' is not NULL, it receives a pointer to the CFileData structure of the returned +// file/directory (if the enumerator returns NULL, 'fileData' also receives NULL); +// 'param' is the 'nextParam' parameter passed together with the pointer to a function of this +// type; 'errorOccured' (if not NULL) receives SALENUM_ERROR if a too-long name is encountered while building the returned +// names and the user chooses to skip only the faulty files/directories, // POZOR: chyba se netyka prave vraceneho jmena, to je OK; v 'errorOccured' (neni-li NULL) se vraci // SALENUM_CANCEL pokud se pri chybe uzivatel rozhodl pro zruseni operace (cancel), zaroven -// enumerator vraci NULL (konci); v 'errorOccured' (neni-li NULL) se vraci SALENUM_SUCCESS pokud -// zadna chyba nenastala +// enumerator returns NULL (ends); 'errorOccured' (if not NULL) receives SALENUM_SUCCESS if +// no error occurred typedef const char*(WINAPI* SalEnumSelection)(HWND parent, int enumFiles, BOOL* isDir, CQuadWord* size, const CFileData** fileData, void* param, int* errorOccured); -// enumerator, vraci jmena souboru, konci vracenim NULL; -// 'enumFiles' == -1 -> reset enumerace (po tomto volani zacina enumerace opet od zacatku), vsechny -// dalsi parametry (az na 'param') jsou ignorovany, nema navratove hodnoty (dava -// vse na nulu) -// 'enumFiles' == 0 -> enumerace souboru a podadresaru jen z korene -// 'enumFiles' == 1 -> enumerace vsech souboru a podadresaru -// 'enumFiles' == 2 -> enumerace vsech podadresaru, soubory jen z korene; -// 'enumFiles' == 3 -> enumerace vsech souboru a podadresaru + symbolicke linky na soubory maji -// velikost ciloveho souboru (pri 'enumFiles' == 1 maji velikost linku, coz je snad -// vzdy nula); POZOR: 'enumFiles' musi zustat 3 pro vsechna volani enumeratoru; -// k chybe muze dojit jen pri 'enumFiles' == 1, 2 nebo 3 ('enumFiles' == 0 vubec -// nepracuje s diskem ani nekompletuje jmena a cesty); 'parent' je parent pripadnych messageboxu -// s chybami (NULL znamena nezobrazovat chyby); v 'dosName' (neni-li NULL) vraci DOSovy nazev -// (8.3; jen pokud existuje, jinak NULL); v 'isDir' (neni-li NULL) vraci TRUE pokud jde o adresar; -// v 'size' (neni-li NULL) vraci velikost souboru (u adresaru nulu); v 'attr' (neni-li NULL) -// vraci atributy souboru/adresare; v 'lastWrite' (neni-li NULL) vraci cas posledniho zapisu -// do souboru/adresare; 'param' je parametr 'nextParam' predavany spolu s ukazatelem na funkci -// tohoto typu; v 'errorOccured' (neni-li NULL) se vraci SALENUM_ERROR, pokud doslo behem cteni -// dat z disku k chybe nebo se pri sestavovani vracenych jmen narazilo na prilis dlouhe jmeno -// a uzivatel se rozhodl preskocit jen chybne soubory/adresare, POZOR: chyba se netyka prave -// vraceneho jmena, to je OK; v 'errorOccured' (neni-li NULL) se vraci SALENUM_CANCEL pokud se -// pri chybe uzivatel rozhodl pro zruseni operace (cancel), zaroven enumerator vraci NULL (konci); -// v 'errorOccured' (neni-li NULL) se vraci SALENUM_SUCCESS pokud zadna chyba nenastala +// enumerator, returns file names and ends by returning NULL; +// 'enumFiles' == -1 -> reset enumeration (after this call, enumeration starts again from the beginning), all +// other parameters (except 'param') are ignored, it has no return values (everything is +// set to zero) +// 'enumFiles' == 0 -> enumerate files and subdirectories from the root only +// 'enumFiles' == 1 -> enumerate all files and subdirectories +// 'enumFiles' == 2 -> enumerate all subdirectories, files from the root only; +// 'enumFiles' == 3 -> enumerate all files and subdirectories + symbolic links to files have the +// size of the target file (for 'enumFiles' == 1 they have the size of the link itself, which is probably +// always zero); WARNING: 'enumFiles' must remain 3 for all calls to the enumerator; +// an error can occur only for 'enumFiles' == 1, 2, or 3 ('enumFiles' == 0 does not access the disk at all +// and does not build names and paths); 'parent' is the parent of any error message boxes +// (NULL means do not show errors); 'dosName' (if not NULL) returns the DOS name +// (8.3; only if it exists, otherwise NULL); 'isDir' (if not NULL) returns TRUE if it is a directory; +// 'size' (if not NULL) returns the file size (zero for directories); 'attr' (if not NULL) +// returns file/directory attributes; 'lastWrite' (if not NULL) returns the last-write time +// of the file/directory; 'param' is the 'nextParam' parameter passed together with the pointer to a function +// of this type; 'errorOccured' (if not NULL) receives SALENUM_ERROR if an error occurs while reading +// data from disk or if a too-long name is encountered while building the returned names +// and the user chooses to skip only the faulty files/directories; WARNING: the error does not concern the +// just-returned name, that one is OK; 'errorOccured' (if not NULL) receives SALENUM_CANCEL if +// on error the user chooses to cancel the operation, and the enumerator simultaneously returns NULL (ends); +// 'errorOccured' (if not NULL) receives SALENUM_SUCCESS if no error occurred typedef const char*(WINAPI* SalEnumSelection2)(HWND parent, int enumFiles, const char** dosName, BOOL* isDir, CQuadWord* size, DWORD* attr, FILETIME* lastWrite, void* param, int* errorOccured); @@ -434,9 +432,9 @@ typedef const char*(WINAPI* SalEnumSelection2)(HWND parent, int enumFiles, const // Salamander standard columns have the other IDs. #define COLUMN_ID_CUSTOM 0 // column provided by the plugin - the plugin is responsible for storing its data #define COLUMN_ID_NAME 1 // left-aligned, supports FixedWidth -// zarovnano vlevo, podporuje FixedWidth; samostatny sloupec "Ext", muze byt jen na indexu==1; -// pokud sloupec neexistuje a v datech panelu (viz CSalamanderDirectoryAbstract::SetValidData()) -// se nastavi VALID_DATA_EXTENSION, je sloupec "Ext" zobrazen ve sloupci "Name" +// left-aligned, supports FixedWidth; the separate "Ext" column can be only at index==1; +// if the column does not exist and panel data (see CSalamanderDirectoryAbstract::SetValidData()) +// contains VALID_DATA_EXTENSION, the "Ext" column is shown in the "Name" column #define COLUMN_ID_EXTENSION 2 #define COLUMN_ID_DOSNAME 3 // left-aligned #define COLUMN_ID_SIZE 4 // right-aligned @@ -451,10 +449,10 @@ typedef const char*(WINAPI* SalEnumSelection2)(HWND parent, int enumFiles, const // but through global variables (CSalamanderViewAbstract::GetTransferVariables). typedef void(WINAPI* FColumnGetText)(); -// Callback pro ziskani indexu jednoduchych ikon pro FS s vlastnimi ikonami (pitFromPlugin). -// Z duvodu optimalizace funkce nedostava/nevraci promenne prostrednictvim parametru, -// ale prostrednictvim globalni promennych (CSalamanderViewAbstract::GetTransferVariables). -// Z globalnich promennych callback vyuziva jen TransferFileData a TransferIsDir. +// Callback for obtaining simple icon indices for FSs with custom icons (pitFromPlugin). +// For optimization reasons, the function does not receive/return variables through parameters, +// but through global variables (CSalamanderViewAbstract::GetTransferVariables). +// The callback uses only the TransferFileData and TransferIsDir global variables. typedef int(WINAPI* FGetPluginIconIndex)(); // A column can be created in two ways: @@ -468,23 +466,23 @@ typedef int(WINAPI* FGetPluginIconIndex)(); struct CColumn { - char Name[COLUMN_NAME_MAX]; // "Name", "Ext", "Size", ... nazev sloupce, pod - // kterym sloupec vystupuje v pohledu a v menu - // Nesmi obsahovat prazdny retezec. + char Name[COLUMN_NAME_MAX]; // "Name", "Ext", "Size", ... column name under + // which the column appears in the view and menu + // It must not contain an empty string. // POZOR: Muze obsahovat (za prvnim null-terminatorem) - // i nazev sloupce "Ext" - toto nastava pokud neexistuje - // samostatny sloupec "Ext" a v datech panelu (viz + // also the name of the "Ext" column - this happens if there is no + // separate "Ext" column and panel data (see // CSalamanderDirectoryAbstract::SetValidData()) se - // nastavi VALID_DATA_EXTENSION. Pro spojeni dvou + // contains VALID_DATA_EXTENSION. // retezcu poslouzi CSalamanderGeneralAbstract::AddStrToStr(). char Description[COLUMN_DESCRIPTION_MAX]; // Tooltip v header line - // Nesmi obsahovat prazdny retezec. + // It must not contain an empty string. // POZOR: Muze obsahovat (za prvnim null-terminatorem) - // i popis sloupce "Ext" - toto nastava pokud neexistuje - // samostatny sloupec "Ext" a v datech panelu (viz + // also the description of the "Ext" column - this happens if there is no + // separate "Ext" column and panel data (see // CSalamanderDirectoryAbstract::SetValidData()) se - // nastavi VALID_DATA_EXTENSION. Pro spojeni dvou + // contains VALID_DATA_EXTENSION. // retezcu poslouzi CSalamanderGeneralAbstract::AddStrToStr(). FColumnGetText GetText; // callback used to obtain text (see the FColumnGetText declaration) @@ -510,7 +508,7 @@ struct CColumn // Columns whose width Salamander calculates from their content and the user cannot // change are called 'elastic'. Columns whose width the user can set are called // 'fixed'. - unsigned Width : 16; // Sirka sloupce v pripade, ze je v rezimu pevne (nastavitelne) sirky. + unsigned Width : 16; // column width when in fixed (user-adjustable) width mode. unsigned FixedWidth : 1; // is the column in fixed (user-adjustable) width mode? // working variables (not stored anywhere and need not be initialized) @@ -544,45 +542,45 @@ class CSalamanderViewAbstract // all use VIEW_MODE_DETAILED) virtual DWORD WINAPI GetViewMode() = 0; - // Nastavi rezim panelu na 'viewMode'. Pokud jde o nektery z detailed rezimu, muze - // odstranit nektere ze standardnich sloupcu (viz. 'validData'). Proto je vhodne tuto - // funkci volat jako prvni - pred ostatnimi funkcemi z toho ifacu, ktere modifikuji - // sloupce. + // Sets the panel mode to 'viewMode'. If it is one of the detailed modes, it may + // remove some standard columns (see 'validData'). It is therefore best to call this + // function first - before the other functions of this interface that modify + // columns. // - // 'viewMode' je jedna z hodnot VIEW_MODE_xxxx - // Rezim panelu nelze zmenit ani na Types ani na jeden ze tri volitelnych detailed rezimu - // (vsechny zastupuje konstanta VIEW_MODE_DETAILED pouzita pro Detailed rezim panelu). - // Ovsem pokud je zrovna jeden z techto ctyr rezimu v panelu zvoleny a 'viewMode' je + // 'viewMode' is one of the VIEW_MODE_xxxx values + // The panel mode cannot be changed to Types or to one of the three optional detailed modes + // (all of them are represented by the VIEW_MODE_DETAILED constant used for the Detailed panel mode). + // However, if one of these four modes is currently selected in the panel and 'viewMode' is // VIEW_MODE_DETAILED, zustane tento rezim zvoleny (aneb neprepne se na Detailed rezim). - // Zmena rezimu panelu je trvala (pretrva i po opusteni pluginove cesty). + // Changing the panel mode is permanent (it remains even after leaving the plugin path). // - // 'validData' informuje o tom, jaka data si plugin preje zobrazit v detailed rezimu, hodnota + // 'validData' tells which data the plugin wants to display in detailed mode; the value // se ANDuje s maskou platnych dat zadanou pomoci CSalamanderDirectoryAbstract::SetValidData - // (nema smysl zobrazovat sloupce s "nulovanymi" hodnotami). + // (there is no point in showing columns with "zeroed" values). virtual void WINAPI SetViewMode(DWORD viewMode, DWORD validData) = 0; - // Vyzvedne ze Salamandera umisteni promennych, ktere nahrazuji parametry callbacku + // Retrieves from Salamander the locations of the variables that replace the parameters of // CColumn::GetText. Na strane Salamandera se jedna o globalni promenne. Plugin si - // ukazatele na ne ulozi do vlastnich globalnich promennych. + // stores pointers to them in its own global variables. // - // promenne: - // transferFileData [IN] data, na jejichz zaklade se ma vykreslit polozka - // transferIsDir [IN] rovno 0, pokud jde o soubor (lezi v poli Files), - // rovno 1, pokud jde o adresar (lezi v poli Dirs), - // rovno 2, pokud jde o up-dir symbol - // transferBuffer [OUT] sem se nalejou data, maximalne TRANSFER_BUFFER_MAX znaku - // neni treba je terminovat nulou - // transferLen [OUT] pred navratem z callbacku se do teto promenne nastavi - // pocet naplnenych znaku bez terminatoru (terminator neni - // treba do bufferu zapisovat) - // transferRowData [IN/OUT] ukazuje na DWORD, ktery je vzdy pred kreslenim sloupcu - // pro kazdy radek nulovan; lze pouzit pro optimalizace - // Salamander ma vyhrazene bity 0x00000001 az 0x00000008. - // Ostatni bity jsou k dispozici pro plugin. - // transferPluginDataIface [IN] plugin-data-interface panelu, do ktereho se polozka + // variables: + // transferFileData [IN] data on the basis of which the item is drawn + // transferIsDir [IN] equal to 0 for a file (it is in Files), + // equal to 1 for a directory (it is in Dirs), + // equal to 2 for the up-dir symbol + // transferBuffer [OUT] output is written here, up to TRANSFER_BUFFER_MAX characters + // it does not need to be null-terminated + // transferLen [OUT] before returning from the callback, this variable is set to + // the number of filled characters without a terminator (the terminator does not + // need to be written to the buffer) + // transferRowData [IN/OUT] points to a DWORD that is always cleared before columns are drawn + // for each row; it can be used for optimizations + // Salamander reserves bits 0x00000001 to 0x00000008. + // The other bits are available to the plugin. + // transferPluginDataIface [IN] plugin-data interface of the panel in which the item is // vykresluje (patri k (*transferFileData)->PluginData) - // transferActCustomData [IN] CustomData sloupce, pro ktery se ziskava text (pro ktery - // se vola callback) + // transferActCustomData [IN] CustomData of the column for which text is being obtained (for which + // the callback is called) virtual void WINAPI GetTransferVariables(const CFileData**& transferFileData, int*& transferIsDir, char*& transferBuffer, @@ -591,11 +589,11 @@ class CSalamanderViewAbstract CPluginDataInterfaceAbstract**& transferPluginDataIface, DWORD*& transferActCustomData) = 0; - // jen pro FS s vlastnimi ikonami (pitFromPlugin): - // Nastavi callback pro ziskani indexu jednoduchych ikon (viz - // CPluginDataInterfaceAbstract::GetSimplePluginIcons). Pokud tento callback - // plugin nenastavi, bude se vykreslovat vzdy jen ikona z indexu 0. - // Z globalnich promennych callback vyuziva jen TransferFileData a TransferIsDir. + // only for FSs with custom icons (pitFromPlugin): + // sets the callback for obtaining simple icon indices (see + // CPluginDataInterfaceAbstract::GetSimplePluginIcons). If the plugin does not set this callback, + // only the icon at index 0 is always drawn. + // The callback uses only the TransferFileData and TransferIsDir global variables. virtual void WINAPI SetPluginSimpleIconCallback(FGetPluginIconIndex callback) = 0; // ------------- columns --------------- @@ -619,13 +617,13 @@ class CSalamanderViewAbstract // except COLUMN_ID_CUSTOM and COLUMN_ID_NAME. virtual BOOL WINAPI InsertStandardColumn(int index, DWORD id) = 0; - // Nastavi nazev a popis sloupce (nesmi byt prazdne retezce ani NULL). Delky - // retezu se omezi na COLUMN_NAME_MAX a COLUMN_DESCRIPTION_MAX. Vraci uspech. + // Sets the column name and description (they must not be empty strings or NULL). Their lengths + // are limited to COLUMN_NAME_MAX and COLUMN_DESCRIPTION_MAX. Returns success. // POZOR: Jmeno a popis sloupce "Name" muzou obsahovat (vzdy za prvnim - // null-terminatorem) i jmeno a popis sloupce "Ext" - toto nastava pokud - // neexistuje samostatny sloupec "Ext" a v datech panelu (viz + // null-terminator) also the name and description of the "Ext" column - this happens if there is no + // separate "Ext" column and panel data (see // CSalamanderDirectoryAbstract::SetValidData()) se nastavi VALID_DATA_EXTENSION. - // V tomto pripade je potreba nastavovat dvojite retezce (s dvoumi + // In this case, double strings must be set (with two // null-terminatory) - viz CSalamanderGeneralAbstract::AddStrToStr(). virtual BOOL WINAPI SetColumnName(int index, const char* name, const char* description) = 0; @@ -637,36 +635,35 @@ class CSalamanderViewAbstract virtual BOOL WINAPI DeleteColumn(int index) = 0; }; -// // **************************************************************************** // CPluginDataInterfaceAbstract // -// sada metod pluginu, ktere potrebuje Salamander pro ziskani specifickych dat -// pluginu do pluginem pridanych sloupcu (pracuje s CFileData::PluginData) +// set of plugin methods that Salamander needs to obtain plugin-specific data +// for columns added by the plugin (works with CFileData::PluginData) class CPluginInterfaceAbstract; class CPluginDataInterfaceAbstract { #ifdef INSIDE_SALAMANDER -private: // ochrana proti nespravnemu primemu volani metod (viz CPluginDataInterfaceEncapsulation) +private: // protection against incorrect direct method calls (see CPluginDataInterfaceEncapsulation) friend class CPluginDataInterfaceEncapsulation; #else // INSIDE_SALAMANDER public: #endif // INSIDE_SALAMANDER - // vraci TRUE pokud se ma zavolat metoda ReleasePluginData pro vsechny soubory vazane - // k tomuto interfacu, jinak vraci FALSE + // returns TRUE if ReleasePluginData should be called for all files bound + // to this interface, otherwise returns FALSE virtual BOOL WINAPI CallReleaseForFiles() = 0; - // vraci TRUE pokud se ma zavolat metoda ReleasePluginData pro vsechny adresare vazane - // k tomuto interfacu, jinak vraci FALSE + // returns TRUE if ReleasePluginData should be called for all directories bound + // to this interface, otherwise returns FALSE virtual BOOL WINAPI CallReleaseForDirs() = 0; - // uvolni data specificka pluginu (CFileData::PluginData) pro 'file' (soubor nebo - // adresar - 'isDir' FALSE nebo TRUE; struktura vlozena do CSalamanderDirectoryAbstract - // pri listovani archivu nebo FS); vola se pro vsechny soubory, pokud CallReleaseForFiles - // vrati TRUE, a pro vsechny adresare, pokud CallReleaseForDirs vrati TRUE + // releases plugin-specific data (CFileData::PluginData) for 'file' (file or + // directory - 'isDir' FALSE or TRUE; structure inserted into CSalamanderDirectoryAbstract + // when listing an archive or FS); it is called for all files if CallReleaseForFiles + // returns TRUE, and for all directories if CallReleaseForDirs returns TRUE virtual void WINAPI ReleasePluginData(CFileData& file, BOOL isDir) = 0; // archive data only (FS does not add an up-dir symbol): @@ -681,144 +678,144 @@ class CPluginDataInterfaceAbstract // CPluginInterfaceAbstract::ReleasePluginDataInterface) virtual void WINAPI GetFileDataForUpDir(const char* archivePath, CFileData& upDir) = 0; - // jen pro data archivu (FS pouziva jen root cestu v CSalamanderDirectoryAbstract): - // pri pridavani souboru/adresare do CSalamanderDirectoryAbstract se muze stat, ze - // zadana cesta neexistuje a je ji tedy potreba vytvorit, jednotlive adresare teto - // cesty se tvori automaticky a tato metoda umoznuje pluginu pridat sva specificka - // data (pro sve sloupce) k temto vytvarenym adresarum; 'dirName' je plna cesta - // pridavaneho adresare v archivu; v 'dir' vstupuji navrhovana data: jmeno adresare - // (alokovane na heapu Salamandera), date&time prevzaty od pridavaneho souboru/adresare, - // zbytek nulovany; v 'dir' vystupuji zmeny pluginu, predevsim by mel zmenit - // 'dir.PluginData'; vraci TRUE pokud se pridani dat pluginu povedlo, jinak FALSE; - // pokud vrati TRUE, bude 'dir' uvolnen klasickou cestou (Salamanderovska cast + - // ReleasePluginData) a to bud az pri kompletnim uvolneni listingu nebo jeste behem - // jeho tvorby v pripade, ze bude ten samy adresar pridan pomoci - // CSalamanderDirectoryAbstract::AddDir (premazani automatickeho vytvoreni pozdejsim - // normalnim pridanim); pokud vrati FALSE, bude z 'dir' uvolnena jen Salamanderovska cast + // archive data only (FS uses only the root path in CSalamanderDirectoryAbstract): + // when a file/directory is added to CSalamanderDirectoryAbstract, the specified path may not exist, + // in which case it must be created; the individual directories in that + // path are created automatically, and this method lets the plugin add its specific + // data (for its columns) to these created directories; 'dirName' is the full path + // of the added directory in the archive; 'dir' receives the proposed data: the directory name + // (allocated on Salamander's heap), date&time taken from the added file/directory, + // everything else zeroed; 'dir' returns the plugin's changes, and in particular it should change + // 'dir.PluginData'; returns TRUE if adding the plugin data succeeded, otherwise FALSE; + // if it returns TRUE, 'dir' is freed the normal way (Salamander part + + // ReleasePluginData), either when the listing is completely released or during + // its creation if the same directory is later added by + // CSalamanderDirectoryAbstract::AddDir (overwriting the automatic creation with a later + // normal add); if it returns FALSE, only the Salamander part of 'dir' is freed virtual BOOL WINAPI GetFileDataForNewDir(const char* dirName, CFileData& dir) = 0; - // jen pro FS s vlastnimi ikonami (pitFromPlugin): - // vraci image-list s jednoduchymi ikonami, behem kresleni polozek v panelu se - // pomoci call-backu ziskava icon-index do tohoto image-listu; vola se vzdy po - // ziskani noveho listingu (po volani CPluginFSInterfaceAbstract::ListCurrentPath), - // takze je mozne image-list predelavat pro kazdy novy listing; - // 'iconSize' urcuje pozadovanou velikost ikon a jde o jednu z hodnot SALICONSIZE_xxx - // destrukci image-listu si plugin zajisti pri dalsim volani GetSimplePluginIcons - // nebo pri uvolneni celeho interfacu (v jeho destruktoru - volan z + // only for FSs with custom icons (pitFromPlugin): + // returns an image list with simple icons; while items are drawn in the panel, + // the callback obtains the icon index into this image list; it is called after every + // new listing is obtained (after CPluginFSInterfaceAbstract::ListCurrentPath), + // so the image list can be rebuilt for each new listing; + // 'iconSize' specifies the requested icon size and is one of the SALICONSIZE_xxx values + // the plugin is responsible for destroying the image list on the next call to GetSimplePluginIcons + // or when the whole interface is released (in its destructor - called from // CPluginInterfaceAbstract::ReleasePluginDataInterface) - // pokud image-list nelze vytvorit, vraci NULL a aktualni plugin-icons-type - // degraduje na pitSimple + // if the image list cannot be created, returns NULL and the current plugin-icons-type + // degrades to pitSimple virtual HIMAGELIST WINAPI GetSimplePluginIcons(int iconSize) = 0; - // jen pro FS s vlastnimi ikonami (pitFromPlugin): - // vraci TRUE, pokud pro dany soubor/adresar ('isDir' FALSE/TRUE) 'file' - // ma byt pouzita jednoducha ikona; vraci FALSE, pokud se ma pro ziskani ikony volat - // z threadu pro nacitani ikon metoda GetPluginIcon (nacteni ikony "na pozadi"); - // zaroven v teto metode muze byt predpocitan icon-index pro jednoduchou ikonu - // (u ikon ctenych "na pozadi" se az do okamziku nacteni pouzivaji take jednoduche - // ikony) a ulozen do CFileData (nejspise do CFileData::PluginData); - // omezeni: z CSalamanderGeneralAbstract je mozne pouzivat jen metody, ktere lze - // volat z libovolneho threadu (metody nezavisle na stavu panelu) + // only for FSs with custom icons (pitFromPlugin): + // returns TRUE if a simple icon should be used for the given 'file' file/directory ('isDir' FALSE/TRUE); + // returns FALSE if GetPluginIcon should be called from the icon-loading thread + // to obtain the icon (load the icon in the background); + // in this method, the icon index for the simple icon may also be precomputed + // (for icons loaded in the background, simple icons are also used until the icon is loaded) + // and stored in CFileData (most likely in CFileData::PluginData); + // restriction: only methods of CSalamanderGeneralAbstract that can be called + // from any thread may be used (methods independent of panel state) virtual BOOL WINAPI HasSimplePluginIcon(CFileData& file, BOOL isDir) = 0; - // jen pro FS s vlastnimi ikonami (pitFromPlugin): - // vraci ikonu pro soubor nebo adresar 'file' nebo NULL pokud ikona nelze ziskat; vraci-li - // v 'destroyIcon' TRUE, vola se pro uvolneni vracene ikony Win32 API funkce DestroyIcon; - // 'iconSize' urcuje velikost pozadovane ikony a jde o jednu z hodnot SALICONSIZE_xxx - // omezeni: jelikoz se vola z threadu pro nacitani ikon (neni to hlavni thread), lze z - // CSalamanderGeneralAbstract pouzivat jen metody, ktere lze volat z libovolneho threadu + // only for FSs with custom icons (pitFromPlugin): + // returns an icon for the 'file' file or directory, or NULL if the icon cannot be obtained; if + // 'destroyIcon' is TRUE, the returned icon is freed by the Win32 API function DestroyIcon; + // 'iconSize' specifies the requested icon size and is one of the SALICONSIZE_xxx values + // restriction: because this is called from the icon-loading thread (not the main thread), only methods of + // CSalamanderGeneralAbstract that can be called from any thread may be used virtual HICON WINAPI GetPluginIcon(const CFileData* file, int iconSize, BOOL& destroyIcon) = 0; - // jen pro FS s vlastnimi ikonami (pitFromPlugin): - // porovna 'file1' (muze jit o soubor i adresar) a 'file2' (muze jit o soubor i adresar), - // nesmi pro zadne dve polozky listingu vratit, ze jsou shodne (zajistuje jednoznacne - // prirazeni vlastni ikony k souboru/adresari); pokud nehrozi duplicitni jmena v listingu - // cesty (obvykly pripad), lze jednoduse implementovat jako: + // only for FSs with custom icons (pitFromPlugin): + // compares 'file1' (may be a file or directory) and 'file2' (may be a file or directory), + // it must not report any two listing items as equal (this ensures unique + // assignment of a custom icon to a file/directory); if duplicate names in the listing + // path are not possible (the usual case), it can be implemented simply as: // {return strcmp(file1->Name, file2->Name);} - // vraci cislo mensi nez nula pokud 'file1' < 'file2', nulu pokud 'file1' == 'file2' a - // cislo vetsi nez nula pokud 'file1' > 'file2'; - // omezeni: jelikoz se vola i z threadu pro nacitani ikon (nejen z hlavniho threadu), lze - // z CSalamanderGeneralAbstract pouzivat jen metody, ktere lze volat z libovolneho threadu + // returns a value less than zero if 'file1' < 'file2', zero if 'file1' == 'file2', and + // a value greater than zero if 'file1' > 'file2'; + // restriction: because it is also called from the icon-loading thread (not only the main thread), only methods + // of CSalamanderGeneralAbstract that can be called from any thread may be used virtual int WINAPI CompareFilesFromFS(const CFileData* file1, const CFileData* file2) = 0; - // slouzi k nastaveni parametru pohledu, tato metoda je zavolana vzdy pred zobrazenim noveho - // obsahu panelu (pri zmene cesty) a pri zmene aktualniho pohledu (i rucni zmena sirky - // sloupce); 'leftPanel' je TRUE pokud jde o levy panel (FALSE pokud jde o pravy panel); - // 'view' je interface pro modifikaci pohledu (nastaveni rezimu, prace se - // sloupci); jde-li o data archivu, obsahuje 'archivePath' soucasnou cestu v archivu, + // used to set view parameters; this method is always called before displaying new + // panel contents (when the path changes) and when the current view changes (including manual + // column width changes); 'leftPanel' is TRUE for the left panel (FALSE for the right panel); + // 'view' is the interface for modifying the view (setting the mode, working with + // columns); for archive data, 'archivePath' contains the current path in the archive, // pro data FS je 'archivePath' NULL; jde-li o data archivu, je 'upperDir' ukazatel na - // nadrazeny adresar (je-li soucasna cesta root archivu, je 'upperDir' NULL), pro data + // the parent directory (if the current path is the archive root, 'upperDir' is NULL), for // FS je vzdy NULL; // POZOR: behem volani teto metody nesmi dojit k prekresleni panelu (muze se zde zmenit - // velikost ikon, atd.), takze zadne messageloopy (zadne dialogy, atd.)! - // omezeni: z CSalamanderGeneralAbstract je mozne pouzivat jen metody, ktere lze - // volat z libovolneho threadu (metody nezavisle na stavu panelu) + // icon size, etc.), so no message loops (no dialogs, etc.)! + // restriction: from CSalamanderGeneralAbstract, only methods that can be + // called from any thread may be used (methods independent of panel state) virtual void WINAPI SetupView(BOOL leftPanel, CSalamanderViewAbstract* view, const char* archivePath, const CFileData* upperDir) = 0; - // nastaveni nove hodnoty "column->FixedWidth" - uzivatel pouzil kontextove menu - // na pluginem pridanem sloupci v header-line > "Automatic Column Width"; plugin - // by si mel ulozit novou hodnotu column->FixedWidth ulozenou v 'newFixedWidth' - // (je to vzdy negace column->FixedWidth), aby pri nasledujicich volanich SetupView() mohl - // sloupec pridat uz se spravne nastavenou FixedWidth; zaroven pokud se zapina pevna - // sirka sloupce, mel by si plugin nastavit soucasnou hodnotu "column->Width" (aby - // se timto zapnutim pevne sirky nezmenila sirka sloupce) - idealni je zavolat + // setting a new value of "column->FixedWidth" - the user used the context menu + // on a plugin-added column in the header line > "Automatic Column Width"; the plugin + // should store the new value of column->FixedWidth stored in 'newFixedWidth' + // (it is always the negation of column->FixedWidth), so that in subsequent calls to SetupView() it can + // add the column with FixedWidth already set correctly; at the same time, if fixed + // column width is being enabled, the plugin should set the current value of "column->Width" (so that + // enabling fixed width this way does not change the column width) - ideally call // "ColumnWidthWasChanged(leftPanel, column, column->Width)"; 'column' identifikuje - // sloupec, ktery se ma zmenit; 'leftPanel' je TRUE pokud jde o sloupec z leveho + // the column that is to be changed; 'leftPanel' is TRUE for a column in the left // panelu (FALSE pokud jde o sloupec z praveho panelu) virtual void WINAPI ColumnFixedWidthShouldChange(BOOL leftPanel, const CColumn* column, int newFixedWidth) = 0; - // nastaveni nove hodnoty "column->Width" - uzivatel mysi zmenil sirku pluginem pridaneho - // sloupce v header-line; plugin by si mel ulozit novou hodnotu column->Width (je ulozena - // i v 'newWidth'), aby pri nasledujicich volanich SetupView() mohl sloupec pridat uz se - // spravne nastavenou Width; 'column' identifikuje sloupec, ktery se zmenil; 'leftPanel' - // je TRUE pokud jde o sloupec z leveho panelu (FALSE pokud jde o sloupec z praveho panelu) + // setting a new value of "column->Width" - the user changed the width of a plugin-added + // column in the header line with the mouse; the plugin should store the new value of column->Width (it is stored + // also in 'newWidth') so that in subsequent calls to SetupView() it can add the column with Width already + // set correctly; 'column' identifies the column that changed; 'leftPanel' + // is TRUE for a column in the left panel (FALSE for a column in the right panel) virtual void WINAPI ColumnWidthWasChanged(BOOL leftPanel, const CColumn* column, int newWidth) = 0; - // ziska obsah Information Line pro soubor/adresar ('isDir' TRUE/FALSE) 'file' - // nebo oznacene soubory a adresare ('file' je NULL a pocty oznacenych souboru/adresaru - // jsou v 'selectedFiles'/'selectedDirs') v panelu ('panel' je jeden z PANEL_XXX); + // gets the Information Line contents for the 'file' file/directory ('isDir' TRUE/FALSE) + // or for the selected files and directories ('file' is NULL and the counts of selected files/directories + // are in 'selectedFiles'/'selectedDirs') in the panel ('panel' is one of PANEL_XXX); // vola se i pri prazdnem listingu (tyka se jen FS, u archivu nemuze nastat, 'file' je NULL, - // 'selectedFiles' a 'selectedDirs' jsou 0); je-li 'displaySize' TRUE, je znama velikost - // vsech oznacenych adresaru (viz CFileData::SizeValid; pokud neni nic oznaceneho, je zde + // 'selectedFiles' and 'selectedDirs' are 0); if 'displaySize' is TRUE, the size of + // all selected directories is known (see CFileData::SizeValid; if nothing is selected, it is // TRUE); v 'selectedSize' je soucet cisel CFileData::Size oznacenych souboru a adresaru - // (pokud neni nic oznaceneho, je zde nula); 'buffer' je buffer pro vraceny text (velikost - // 1000 bytu); 'hotTexts' je pole (velikost 100 DWORDu), ve kterem se vraci informace o poloze - // hot-textu, vzdy spodni WORD obsahuje pozici hot-textu v 'buffer', horni WORD obsahuje - // delku hot-textu; v 'hotTextsCount' je velikost pole 'hotTexts' (100) a vraci se v nem pocet - // zapsanych hot-textu v poli 'hotTexts'; vraci TRUE pokud je 'buffer' + 'hotTexts' + - // 'hotTextsCount' nastaveno, vraci FALSE pokud se ma Information Line plnit standardnim + // (if nothing is selected, it is zero); 'buffer' is the buffer for the returned text (size + // 1000 bytes); 'hotTexts' is an array (size 100 DWORDs) that returns information about the position of + // hot-texts; the low WORD always contains the position of the hot-text in 'buffer', the high WORD contains + // the length of the hot-text; 'hotTextsCount' contains the size of the 'hotTexts' array (100) and returns the count + // of written hot-texts in 'hotTexts'; returns TRUE if 'buffer' + 'hotTexts' + + // 'hotTextsCount' are set, returns FALSE if the Information Line should be filled in the standard // zpusobem (jako na disku) virtual BOOL WINAPI GetInfoLineContent(int panel, const CFileData* file, BOOL isDir, int selectedFiles, int selectedDirs, BOOL displaySize, const CQuadWord& selectedSize, char* buffer, DWORD* hotTexts, int& hotTextsCount) = 0; - // jen pro archivy: uzivatel ulozil soubory/adresare z archivu na clipboard, ted zavira - // archiv v panelu: pokud metoda vrati TRUE, tento objekt zustane otevreny (optimalizace - // pripadneho Paste z clipboardu - archiv uz je vylistovany), pokud metoda vrati FALSE, - // tento objekt se uvolni (pripadny Paste z clipboardu zpusobi listovani archivu, pak - // teprve dojde k vybaleni vybranych souboru/adresaru); POZNAMKA: pokud je po zivotnost - // objektu otevreny soubor archivu, metoda by mela vracet FALSE, jinak bude po celou - // dobu "pobytu" dat na clipboardu soubor archivu otevreny (nepujde smazat, atd.) + // archives only: the user copied files/directories from the archive to the clipboard and is now closing + // the archive in the panel: if the method returns TRUE, this object remains open (optimizing + // any later Paste from the clipboard - the archive is already listed); if the method returns FALSE, + // this object is released (any later Paste from the clipboard will cause the archive to be listed first, + // and only then will the selected files/directories be unpacked); NOTE: if the archive file stays open for the lifetime + // of the object, the method should return FALSE, otherwise the archive file will remain open for the entire + // time the data stays on the clipboard (it will not be possible to delete it, etc.) virtual BOOL WINAPI CanBeCopiedToClipboard() = 0; - // jen pri zadani VALID_DATA_PL_SIZE do CSalamanderDirectoryAbstract::SetValidData(): - // vraci TRUE pokud je velikost souboru/adresare ('isDir' TRUE/FALSE) 'file' znama, - // jinak vraci FALSE; velikost vraci v 'size' + // only when VALID_DATA_PL_SIZE is passed to CSalamanderDirectoryAbstract::SetValidData(): + // returns TRUE if the size of the 'file' file/directory ('isDir' TRUE/FALSE) is known, + // otherwise returns FALSE; the size is returned in 'size' virtual BOOL WINAPI GetByteSize(const CFileData* file, BOOL isDir, CQuadWord* size) = 0; - // jen pri zadani VALID_DATA_PL_DATE do CSalamanderDirectoryAbstract::SetValidData(): - // vraci TRUE pokud je datum souboru/adresare ('isDir' TRUE/FALSE) 'file' znamy, - // jinak vraci FALSE; datum vraci v "datumove" casti struktury 'date' ("casova" cast - // by mela zustat netknuta) + // only when VALID_DATA_PL_DATE is passed to CSalamanderDirectoryAbstract::SetValidData(): + // returns TRUE if the date of the 'file' file/directory ('isDir' TRUE/FALSE) is known, + // otherwise returns FALSE; returns the date in the date part of the 'date' structure (the time part + // should remain unchanged) virtual BOOL WINAPI GetLastWriteDate(const CFileData* file, BOOL isDir, SYSTEMTIME* date) = 0; - // jen pri zadani VALID_DATA_PL_TIME do CSalamanderDirectoryAbstract::SetValidData(): - // vraci TRUE pokud je cas souboru/adresare ('isDir' TRUE/FALSE) 'file' znamy, - // jinak vraci FALSE; cas vraci v "casove" casti struktury 'time' ("datumova" cast - // by mela zustat netknuta) + // only when VALID_DATA_PL_TIME is passed to CSalamanderDirectoryAbstract::SetValidData(): + // returns TRUE if the time of the 'file' file/directory ('isDir' TRUE/FALSE) is known, + // otherwise returns FALSE; returns the time in the time part of the 'time' structure (the date part + // should remain unchanged) virtual BOOL WINAPI GetLastWriteTime(const CFileData* file, BOOL isDir, SYSTEMTIME* time) = 0; }; @@ -834,23 +831,23 @@ class CSalamanderForOperationsAbstract { public: // PROGRESS DIALOG: dialog obsahuje jeden/dva ('twoProgressBars' FALSE/TRUE) progress-metry - // otevre progress-dialog s titulkem 'title'; 'parent' je parent okno progress-dialogu (je-li + // opens a progress dialog titled 'title'; 'parent' is the parent window of the progress dialog (if // NULL, pouzije se hlavni okno); pokud obsahuje jen jeden progress-metr, muze byt popsan - // jako "File" ('fileProgress' je TRUE) nebo "Total" ('fileProgress' je FALSE) + // as "File" ('fileProgress' is TRUE) or "Total" ('fileProgress' is FALSE) // - // dialog nebezi ve vlastnim threadu; pro jeho fungovani (tlacitko Cancel + vnitrni timer) - // je treba obcas vyprazdni message queue; to zajistuji metody ProgressDialogAddText, - // ProgressAddSize a ProgressSetSize + // the dialog does not run in its own thread; for it to work (Cancel button + internal timer) + // the message queue must be flushed occasionally; this is handled by ProgressDialogAddText, + // ProgressAddSize and ProgressSetSize // - // protoze real-time zobrazovani textu a zmen v progress bare silne zdrzuje, maji - // metody ProgressDialogAddText, ProgressAddSize a ProgressSetSize parametr - // 'delayedPaint'; ten by mel byt TRUE pro vsechny rychle se menici texty a hodnoty; - // metody si pak ulozi texty a zobrazi je az po doruceni vnitrniho timeru dialogu; + // because real-time display of text and progress-bar changes slows things down considerably, + // ProgressDialogAddText, ProgressAddSize, and ProgressSetSize take the + // 'delayedPaint' parameter; it should be TRUE for all rapidly changing text and values; + // the methods then store the text and display it only after the dialog's internal timer fires; // 'delayedPaint' nastavime na FALSE pro inicializacni/koncove texty typu "preparing data..." - // nebo "canceling operation...", po jejiz zobrazeni nedame dialogu prilezitost k distribuci - // zprav (timeru); pokud je u takove operace pravdepodobne, ze bude trvat dlouho, meli - // bychom behem teto doby dialog "obcerstvovat" volanim ProgressAddSize(CQuadWord(0, 0), TRUE) - // a podle jeji navratove hodnoty akci pripadne predcasne ukoncit + // or "canceling operation...", after showing which we do not give the dialog a chance to dispatch + // messages (timer events); if such an operation is likely to take a long time, we should + // keep the dialog alive during that time by calling ProgressAddSize(CQuadWord(0, 0), TRUE) + // and use its return value to end the action early if needed virtual void WINAPI OpenProgressDialog(const char* title, BOOL twoProgressBars, HWND parent, BOOL fileProgress) = 0; // writes text 'txt' (even multiple lines - it is split into lines) to the progress dialog From 140c92bd5c3b74e82f936264db013473c5a555f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 17:05:02 +0200 Subject: [PATCH 266/710] [translation] Fix src/plugins/shared/spl_fs.h comments (#641) --- src/plugins/shared/spl_fs.h | 646 +++++++++--------------------------- 1 file changed, 166 insertions(+), 480 deletions(-) diff --git a/src/plugins/shared/spl_fs.h b/src/plugins/shared/spl_fs.h index bb721915c..6bbaaeb59 100644 --- a/src/plugins/shared/spl_fs.h +++ b/src/plugins/shared/spl_fs.h @@ -35,67 +35,44 @@ class CPluginDataInterfaceAbstract; class CSalamanderForViewFileOnFSAbstract { public: - // najde v disk-cache existujici kopii souboru nebo pokud jeste kopie souboru neni - // v disk-cache, rezervuje pro ni jmeno (cilovy soubor napr. pro download z FTP); - // 'uniqueFileName' je unikatni nazev originalniho souboru (podle tohoto nazvu - // se prohledava disk-cache; melo by stacit plne jmeno souboru v salamanderovske - // forme - "fs-name:fs-user-part"; POZOR: nazev se porovnava "case-sensitive", pokud - // plugin vyzaduje "case-insensitive", musi vsechny nazvy prevadet napr. na mala - // pismena - viz CSalamanderGeneralAbstract::ToLowerCase); 'nameInCache' je jmeno - // kopie souboru, ktera je umistena v disk-cache (ocekava se zde posledni - // cast jmena originalniho souboru, aby pozdeji v titulku viewru uzivateli pripominala - // originalni soubor); je-li 'rootTmpPath' NULL, je diskova cache ve Windows TEMP - // adresari, jinak je cesta do disk-cache v 'rootTmpPath'; pri systemove chybe vraci + // Finds an existing copy of the file in the disk cache or, if the copy is not yet + // in the disk cache, reserves a name for it (a target file, for example for an FTP download); + // 'uniqueFileName' is the unique name of the original file (the disk cache is searched + // by this name; the full file name in Salamander form should be sufficient - + // fs-name:fs-user-part; WARNING: the name is compared case-sensitively, so if the + // plugin requires case-insensitive matching, it must convert all names, for example, + // to lowercase - see CSalamanderGeneralAbstract::ToLowerCase); 'nameInCache' is the name + // of the file copy stored in the disk cache (the last component of the original file name + // is expected here so that it later reminds the user of the original file in the viewer caption); + // if 'rootTmpPath' is NULL, the disk cache is in the Windows TEMP + // directory; otherwise 'rootTmpPath' contains the path to the disk cache; on system error it returns // NULL (nemelo by vubec nastat), jinak vraci plne jmeno kopie souboru v disk-cache - // a ve 'fileExists' vraci TRUE pokud soubor v disk-cache existuje (napr. uz probehl - // download z FTP) nebo FALSE pokud je soubor teprve potreba pripravit (napr. provest - // jeho download); 'parent' je parent messageboxu s chybami (napriklad prilis dlouhy - // nazev souboru) + // and returns TRUE in 'fileExists' if the file already exists in the disk cache (for example, + // the FTP download has already been performed), or FALSE if the file still has to be prepared + // (for example by downloading it); 'parent' is the parent of error message boxes (for example, an overly long + // file name) // POZOR: pokud nevratila NULL (nenastala systemova chyba), je nutne pozdeji zavolat // FreeFileNameInCache (pro stejne 'uniqueFileName') - // POZN.: pokud FS vyuziva disk-cache, mel by alespon pri unloadu pluginu zavolat + // NOTE: if the FS uses the disk cache, it should at least call // CSalamanderGeneralAbstract::RemoveFilesFromCache("fs-name:"), jinak budou - // jeho kopie souboru zbytecne prekazet v disk-cache + // its file copies needlessly clutter the disk cache virtual const char* WINAPI AllocFileNameInCache(HWND parent, const char* uniqueFileName, const char* nameInCache, const char* rootTmpPath, BOOL& fileExists) = 0; - // otevre soubor 'fileName' z windowsove cesty v uzivatelem pozadovanem prohlizeci (bud - // pomoci asociace viewru nebo pres prikaz View With); 'parent' je parent messageboxu - // s chybami; neni-li 'fileLock' a 'fileLockOwner' NULL, vraci se v nich vazba na - // otevreny viewer (pouzije se jako parametr metody FreeFileNameInCache); vraci TRUE - // pokud byl viewer otevren + // Opens file 'fileName' from a Windows path in the viewer requested by the user (either via viewer association or via the View With command). 'parent' is the parent of error message boxes. If 'fileLock' and 'fileLockOwner' are not NULL, they return the link to the open viewer (used as a parameter of FreeFileNameInCache). Returns TRUE if the viewer was opened. virtual BOOL WINAPI OpenViewer(HWND parent, const char* fileName, HANDLE* fileLock, BOOL* fileLockOwner) = 0; - // musi parovat s AllocFileNameInCache, vola se az po otevreni vieweru (nebo po chybe pri - // priprave kopie souboru nebo otevirani vieweru); 'uniqueFileName' je unikatni nazev - // originalniho souboru (pouzivat stejny retezec jako pri volani AllocFileNameInCache); - // 'fileExists' je FALSE pokud kopie souboru v disk-cache neexistovala a TRUE pokud - // jiz existovala (shodna hodnota s vystupnim parametrem 'fileExists' metody AllocFileNameInCache); - // je-li 'fileExists' TRUE, 'newFileOK' a 'newFileSize' se ignoruji, jinak 'newFileOK' je - // TRUE pokud byla kopie souboru uspesne pripravena (napr. download probehl uspesne) a - // v 'newFileSize' je velikost pripravene kopie souboru; je-li 'newFileOK' FALSE, je - // 'newFileSize' ignorovana; 'fileLock' a 'fileLockOwner' provazuji otevreny viewer - // s kopiemi souboru v disk-cache (po zavreni vieweru disk-cache dovoli zrusit kopii - // souboru - kdy dojde ke zruseni kopie zalezi na velikosti disk-cache na disku), oba - // tyto parametry lze ziskat pri volani metody OpenViewer; pokud se viewer - // nepodarilo otevrit (nebo se nepodarilo pripravit kopii souboru do disk-cache nebo viewer - // nema vazbu s disk-cache), nastavi se 'fileLock' na NULL a 'fileLockOwner' na FALSE; - // je-li 'fileExists' TRUE (kopie souboru existovala), hodnota 'removeAsSoonAsPossible' - // se ignoruje, jinak: je-li 'removeAsSoonAsPossible' TRUE, kopie souboru se v disk-cache - // nebude skladovat dele nez je nutne (po zavreni vieweru dojde hned k vymazu; pokud se - // viewer vubec neotevrel ('fileLock' je NULL), nedojde ke vlozeni souboru do disk-cache, - // ale k vymazu) + // Must be paired with AllocFileNameInCache; it is called only after the viewer has been opened (or after an error while preparing the file copy or opening the viewer). 'uniqueFileName' is the unique name of the original file (use the same string as in AllocFileNameInCache). 'fileExists' is FALSE if the file copy did not exist in the disk cache and TRUE if it already existed (the same value as output parameter 'fileExists' of AllocFileNameInCache). If 'fileExists' is TRUE, 'newFileOK' and 'newFileSize' are ignored; otherwise 'newFileOK' is TRUE if the file copy was prepared successfully (for example the download succeeded), and 'newFileSize' contains the size of the prepared file copy. If 'newFileOK' is FALSE, 'newFileSize' is ignored. 'fileLock' and 'fileLockOwner' tie the open viewer to file copies in the disk cache (after the viewer is closed, the disk cache is allowed to delete the file copy - when it is deleted depends on the size of the disk cache on disk); both values can be obtained when calling OpenViewer. If the viewer could not be opened (or the file copy could not be prepared in the disk cache, or the viewer is not tied to the disk cache), set 'fileLock' to NULL and 'fileLockOwner' to FALSE. If 'fileExists' is TRUE (the file copy already existed), 'removeAsSoonAsPossible' is ignored; otherwise, if 'removeAsSoonAsPossible' is TRUE, the file copy is not kept in the disk cache longer than necessary (after the viewer is closed it is deleted immediately; if the viewer was not opened at all ('fileLock' is NULL), the file is not inserted into the disk cache and is deleted instead). virtual void WINAPI FreeFileNameInCache(const char* uniqueFileName, BOOL fileExists, BOOL newFileOK, const CQuadWord& newFileSize, HANDLE fileLock, BOOL fileLockOwner, BOOL removeAsSoonAsPossible) = 0; }; -// // **************************************************************************** // CPluginFSInterfaceAbstract // -// sada metod pluginu, ktere potrebuje Salamander pro praci s file systemem +// set of plugin methods that Salamander needs to work with a file system // typ ikon v panelu pri listovani FS (pouziva se v CPluginFSInterfaceAbstract::ListCurrentPath()) #define pitSimple 0 // simple icons for files and directories - by extension (association) @@ -125,28 +102,24 @@ class CSalamanderForViewFileOnFSAbstract // 'param' is the panel containing this FS (PANEL_LEFT or PANEL_RIGHT) #define FSE_ACTIVATEREFRESH 4 -// vyprsel timeout jednoho z timeru tohoto FS, 'param' je parametr tohoto timeru; +// A timer of this FS has expired; 'param' is the parameter of that timer; // POZOR: metoda CPluginFSInterfaceAbstract::Event() s kodem FSE_TIMER se vola -// z hlavniho threadu po doruceni zpravy WM_TIMER hlavnimu oknu (tedy napr. muze -// byt zrovna otevreny libovolny modalni dialog), takze reakce na timer by mela -// probehnout v tichosti (neotevirat zadna okna, atd.); k volani metody +// from the main thread after the WM_TIMER message is delivered to the main window (so, for example, +// any modal dialog may currently be open), so the timer reaction should +// happen quietly (do not open windows, etc.); a call to // CPluginFSInterfaceAbstract::Event() s kodem FSE_TIMER muze dojit hned po -// volani metody CPluginInterfaceForFS::OpenFS (pokud se v ni prida timer pro -// nove vytvoreny objekt FS) +// the call to CPluginInterfaceForFS::OpenFS (if it adds a timer for +// a newly created FS object) #define FSE_TIMER 5 -// prave probehla zmena cesty (nebo refresh) v tomto FS v panelu nebo pripojeni -// tohoto odpojeneho FS do panelu (tato udalost se posila po zmene cesty a jejim -// vylistovani); FSE_PATHCHANGED chodi po kazdem uspesnem volani ListCurrentPath -// POZNAMKA: FSE_PATHCHANGED tesne nasleduje za vsemi FSE_OPENED a FSE_ATTACHED -// 'param' je panel obsahujici tento FS (PANEL_LEFT nebo PANEL_RIGHT) +// A path change (or refresh) has just been completed in this FS in a panel, or this detached FS has just been attached to a panel (this event is sent after the path change and its listing). FSE_PATHCHANGED is sent after every successful call to ListCurrentPath. +// NOTE: FSE_PATHCHANGED follows every FSE_OPENED and FSE_ATTACHED immediately. +// 'param' is the panel containing this FS (PANEL_LEFT or PANEL_RIGHT). #define FSE_PATHCHANGED 6 -// konstanty oznacujici duvod volani CPluginFSInterfaceAbstract::TryCloseOrDetach(); -// v zavorce jsou vzdy uvedeny mozne hodnoty forceClose ("FALSE->TRUE" znamena "nejdriv -// to zkusi bez force, kdyz FS odmitne, zepta se usera a pripadne to da s force") a canDetach: +// Constants identifying the reason for calling CPluginFSInterfaceAbstract::TryCloseOrDetach(); the possible values of forceClose and canDetach are always given in parentheses (FALSE->TRUE means: first it tries without force; if the FS refuses, the user is asked and it is then retried with force): // -// (FALSE, TRUE) pri zmene cesty mimo FS otevrene v panelu +// (FALSE, TRUE) when changing to a path outside the FS open in the panel #define FSTRYCLOSE_CHANGEPATH 1 // (FALSE->TRUE, FALSE) for an FS open in a panel during plugin unload (user-requested unload + Salamander shutdown + before removing the plugin + unload requested by the plugin) #define FSTRYCLOSE_UNLOADCLOSEFS 2 @@ -242,14 +215,7 @@ class CPluginFSInterfaceAbstract // is a buffer of size 'bufSize' for the resulting full name; returns TRUE on success virtual BOOL WINAPI GetFullName(CFileData& file, int isDir, char* buf, int bufSize) = 0; - // vraci absolutni cestu (vcetne fs-name) odpovidajici relativni ceste 'path' na tomto FS; - // vraci FALSE pokud tato metoda neni implementovana (dalsi navratove hodnoty se pak ignoruji); - // 'parent' je parent pripadnych messageboxu; 'fsName' je aktualni jmeno FS; 'path' je buffer - // o velikosti 'pathSize' znaku, na vstupu je v nem relativni cesta na FS, na vystupu je v nem - // odpovidajici absolutni cesta na FS; v 'success' vraci TRUE, pokud byla cesta uspesne prelozena - // (ma se pouzit retezec v 'path' - jinak se ignoruje) - nasleduje zmena cesty (jde-li - // o cestu na toto FS, vola se ChangePath()); pokud vrati v 'success' FALSE, predpoklada - // se, ze uzivatel jiz videl chybove hlaseni + // Returns the absolute path (including fs-name) corresponding to relative path 'path' on this FS. Returns FALSE if this method is not implemented (the other return values are then ignored). 'parent' is the parent of any error message boxes; 'fsName' is the current FS name; 'path' is a buffer of size 'pathSize': on input it contains a relative path on the FS, on output it contains the corresponding absolute path on the FS. 'success' returns TRUE if the path was translated successfully (the string in 'path' should then be used; otherwise it is ignored) - a path change follows (if it is a path on this FS, ChangePath() is called). If 'success' is FALSE, the user is assumed to have already seen an error message. virtual BOOL WINAPI GetFullFSPath(HWND parent, const char* fsName, char* path, int pathSize, BOOL& success) = 0; @@ -262,76 +228,24 @@ class CPluginFSInterfaceAbstract // if the paths are identical; 'currentFSNameIndex' is the index of the current FS name virtual BOOL WINAPI IsCurrentPath(int currentFSNameIndex, int fsNameIndex, const char* userPart) = 0; - // vraci TRUE, pokud je cesta z tohoto FS (coz znamena, ze Salamander muze cestu pustit - // do ChangePath tohoto FS); cesta je vzdy na jeden z FS tohoto pluginu (napr. windows - // cesty a cesty do archivu sem vubec neprijdou); 'fsNameIndex' je index jmena FS - // v ceste (index je nula pro fs-name zadane v CSalamanderPluginEntryAbstract::SetBasicPluginData, - // u ostatnich fs-name index vraci CSalamanderPluginEntryAbstract::AddFSName); user-part - // cesty je 'userPart'; 'currentFSNameIndex' je index aktualniho jmena FS + // Returns TRUE if the path belongs to this FS (which means Salamander may pass the path to ChangePath of this FS). The path always belongs to one of this plugin's FSs (for example, Windows paths and archive paths are never passed here). 'fsNameIndex' is the index of the FS name in the path (the index is zero for the fs-name specified in CSalamanderPluginEntryAbstract::SetBasicPluginData; for other fs-names the index is returned by CSalamanderPluginEntryAbstract::AddFSName). The user-part of the path is 'userPart'; 'currentFSNameIndex' is the index of the current FS name. virtual BOOL WINAPI IsOurPath(int currentFSNameIndex, int fsNameIndex, const char* userPart) = 0; - // zmeni aktualni cestu v tomto FS na cestu zadanou pres 'fsName' a 'userPart' (presne - // nebo na nejblizsi pristupnou podcestu 'userPart' - viz hodnota 'mode'); v pripade, ze - // se cesta zkracuje z duvodu, ze jde o cestu k souboru (staci domenka, ze by mohlo jit - // o cestu k souboru - po vylistovani cesty se overuje jestli soubor existuje, pripadne - // se zobrazi uzivateli chyba) a 'cutFileName' neni NULL (mozne jen v 'mode' 3), vraci - // v bufferu 'cutFileName' (o velikosti MAX_PATH znaku) jmeno tohoto souboru (bez cesty), - // jinak v bufferu 'cutFileName' vraci prazdny retezec; 'currentFSNameIndex' je index - // aktualniho jmena FS; 'fsName' je buffer o velikosti MAX_PATH, na vstupu je v nem jmeno - // FS v ceste, ktere je z tohoto pluginu (ale nemusi se shodovat s aktualnim jmenem FS - // v tomto objektu, staci kdyz pro nej IsOurPath() vraci TRUE), na vystupu je v 'fsName' - // aktualni jmeno FS v tomto objektu (musi byt z tohoto pluginu); 'fsNameIndex' je index - // jmena FS 'fsName' v pluginu (pro snazsi detekci o jake jmeno FS jde); neni-li - // 'pathWasCut' NULL, vraci se v nem TRUE pokud doslo ke zkraceni cesty; Salamander - // pouziva 'cutFileName' a 'pathWasCut' u prikazu Change Directory (Shift+F7) pri zadani - // jmena souboru - dochazi k fokusu tohoto souboru; je-li 'forceRefresh' TRUE, jde o - // tvrdy refresh (Ctrl+R) a plugin by mel menit cestu bez pouziti informaci z cache - // (je nutne overit jestli nova cesta existuje); 'mode' je rezim zmeny cesty: - // 1 (refresh path) - zkracuje cestu, je-li treba; nehlasit neexistenci cesty (bez hlaseni - // zkratit), hlasit soubor misto cesty, nepristupnost cesty a dalsi chyby - // 2 (volani ChangePanelPathToPluginFS, back/forward in history, etc.) - zkracuje cestu, - // je-li treba; hlasit vsechny chyby cesty (soubor - // misto cesty, neexistenci, nepristupnost a dalsi) - // 3 (change-dir command) - zkracuje cestu jen jde-li o soubor nebo cestu nelze listovat - // (ListCurrentPath pro ni vraci FALSE); nehlasit soubor misto cesty - // (bez hlaseni zkratit a vratit jmeno souboru), hlasit vsechny ostatni - // chyby cesty (neexistenci, nepristupnost a dalsi) - // je-li 'mode' 1 nebo 2, vraci FALSE jen pokud na tomto FS zadna cesta neni pristupna - // (napr. pri vypadku spojeni); je-li 'mode' 3, vraci FALSE pokud neni pristupna - // pozadovana cesta nebo soubor (ke zkracovani cesty dojde jen v pripade, ze jde o soubor); - // v pripade, ze je otevreni FS casove narocne (napr. pripojeni na FTP server) a 'mode' - // je 3, je mozne upravit chovani jako u archivu - zkracovat cestu, je-li treba a vracet FALSE - // jen pokud na FS neni zadna cesta pristupna, hlaseni chyb se nemeni + // Changes the current path in this FS to the path specified by 'fsName' and 'userPart' (exactly, or to the nearest accessible subpath of 'userPart' - see 'mode'). If the path is shortened because it points to a file (it is enough to suspect that it might be a file path - after listing the path, it is verified whether the file exists and an error is shown if needed) and 'cutFileName' is not NULL (possible only in 'mode' 3), the method returns the name of that file (without the path) in the 'cutFileName' buffer (MAX_PATH characters); otherwise it returns an empty string in 'cutFileName'. 'currentFSNameIndex' is the index of the current FS name; 'fsName' is a MAX_PATH buffer: on input it contains the FS name from the path, which belongs to this plugin (it does not have to match the current FS name in this object, it is enough if IsOurPath() returns TRUE for it), and on output 'fsName' contains the current FS name in this object (it must belong to this plugin). 'fsNameIndex' is the index of FS name 'fsName' in the plugin (to make it easier to detect which FS name it is). If 'pathWasCut' is not NULL, TRUE is returned in it if the path was shortened; Salamander uses 'cutFileName' and 'pathWasCut' for the Change Directory command (Shift+F7) when a file name is entered, so that file gets focused. If 'forceRefresh' is TRUE, this is a hard refresh (Ctrl+R) and the plugin should change the path without using cached information (the new path must be verified to exist). 'mode' is the path-change mode: + // 1 (refresh path) - shorten the path if needed; do not report a missing path (shorten it without a message); report a file where a path is expected, an inaccessible path, and other errors + // 2 (ChangePanelPathToPluginFS call, back/forward in history, etc.) - shorten the path if needed; report all path errors (file where a path is expected, missing path, inaccessible path, and other errors) + // 3 (change-dir command) - shorten the path only if it is a file or the path cannot be listed (ListCurrentPath returns FALSE for it); do not report a file where a path is expected (shorten it without a message and return the file name), but report all other path errors (missing path, inaccessible path, and others) + // If 'mode' is 1 or 2, it returns FALSE only if no path on this FS is accessible (for example after a connection failure); if 'mode' is 3, it returns FALSE if the requested path or file is not accessible (path shortening occurs only if it is a file). If opening the FS is time-consuming (for example connecting to an FTP server) and 'mode' is 3, the behavior may be adjusted as for archives: shorten the path if needed and return FALSE only if no path on the FS is accessible; error reporting does not change. virtual BOOL WINAPI ChangePath(int currentFSNameIndex, char* fsName, int fsNameIndex, const char* userPart, char* cutFileName, BOOL* pathWasCut, BOOL forceRefresh, int mode) = 0; - // nacita soubory a adresare z aktualni cesty, uklada je do objektu 'dir' (na cestu NULL nebo - // "", soubory a adresare na jinych cestach jsou ignorovany; je-li pridan adresar se jmenem - // "..", vykresluje se jako "up-dir" symbol; jmena souboru a adresaru jsou plne - // zavisla na pluginu, Salamander je jen zobrazuje); Salamander zjisti obsah - // pluginem pridanych sloupcu pomoci interfacu 'pluginData' (pokud plugin sloupce nepridava - // a nema vlastni ikony, vraci 'pluginData'==NULL); v 'iconsType' vraci pozadovany zpusob - // ziskavani ikon souboru a adresaru do panelu, pitFromPlugin degraduje na pitSimple pokud - // je 'pluginData' NULL (bez 'pluginData' nelze zajistit pitFromPlugin); je-li 'forceRefresh' - // TRUE, jde o tvrdy refresh (Ctrl+R) a plugin by mel nacitat soubory a adresare bez pouziti - // cache; vraci TRUE pri uspesnem nacteni, pokud vrati FALSE jde o chybu a bude se volat - // ChangePath na aktualni cestu, ocekava se, ze ChangePath vybere pristupnou podcestu - // nebo vrati FALSE, po uspesnem volani ChangePath se bude opakovat volani ListCurrentPath; - // pokud vrati FALSE, navratova hodnota 'pluginData' se ignoruje (data v 'dir' je potreba - // uvolnit pomoci 'dir.Clear(pluginData)', jinak se uvolni jen Salamanderovska cast dat); + // Loads files and directories from the current path and stores them in object 'dir' (for path NULL or empty string, files and directories on other paths are ignored; if a directory named .. is added, it is rendered as the up-dir symbol; file and directory names are fully plugin-defined, Salamander only displays them). Salamander obtains the contents of plugin-added columns through interface 'pluginData' (if the plugin does not add columns and has no custom icons, it returns 'pluginData'==NULL). 'iconsType' returns the requested way of obtaining file and directory icons for the panel; pitFromPlugin degrades to pitSimple if 'pluginData' is NULL (without 'pluginData', pitFromPlugin cannot be provided). If 'forceRefresh' is TRUE, this is a hard refresh (Ctrl+R) and the plugin should load files and directories without using a cache. Returns TRUE on successful load; if it returns FALSE, that is an error and ChangePath will be called for the current path, where ChangePath is expected to select an accessible subpath or return FALSE; after a successful ChangePath call, ListCurrentPath will be called again. If it returns FALSE, the returned value of 'pluginData' is ignored (the data in 'dir' must be released with 'dir.Clear(pluginData)', otherwise only the Salamander part of the data is released). virtual BOOL WINAPI ListCurrentPath(CSalamanderDirectoryAbstract* dir, CPluginDataInterfaceAbstract*& pluginData, int& iconsType, BOOL forceRefresh) = 0; - // priprava FS na zavreni/odpojeni od panelu nebo zavreni odpojeneho FS; je-li 'forceClose' - // TRUE, dojde k zavreni FS bez ohledu na navratove hodnoty, akci vynutil user nebo probiha - // critical shutdown (vice viz CSalamanderGeneralAbstract::IsCriticalShutdown), kazdopadne - // nema smysl se usera na cokoliv ptat, FS se ma proste hned zavrit (uz neotvirat zadna okna); - // je-li 'forceClose' FALSE, muze se FS zavrit nebo odpojit ('canDetach' TRUE) a nebo jen - // zavrit ('canDetach' FALSE); v 'detach' vraci TRUE pokud se chce jen odpojit, FALSE znamena - // zavrit; 'reason' obsahuje duvod volani teto metody (jedna z FSTRYCLOSE_XXX); vraci TRUE - // pokud lze zavrit/odpojit, jinak vraci FALSE + // Prepares the FS to be closed/detached from the panel or closes a detached FS. If 'forceClose' is TRUE, the FS is closed regardless of return values - the action was forced by the user or a critical shutdown is in progress (see CSalamanderGeneralAbstract::IsCriticalShutdown); in any case, there is no point in asking the user anything, the FS should simply be closed immediately (do not open any windows anymore). If 'forceClose' is FALSE, the FS may either be closed or detached ('canDetach' TRUE) or only closed ('canDetach' FALSE). 'detach' returns TRUE if the FS wants only to detach; FALSE means close it. 'reason' contains the reason for calling this method (one of FSTRYCLOSE_XXX). Returns TRUE if the FS can be closed/detached; otherwise returns FALSE. virtual BOOL WINAPI TryCloseOrDetach(BOOL forceClose, BOOL canDetach, BOOL& detach, int reason) = 0; // receives an event on this FS; see the FSE_XXX event codes; 'param' is the event parameter @@ -350,35 +264,27 @@ class CPluginFSInterfaceAbstract // and after each call to ChangePath and ListCurrentPath on this FS virtual DWORD WINAPI GetSupportedServices() = 0; - // jen pokud GetSupportedServices() vraci i FS_SERVICE_GETCHANGEDRIVEORDISCONNECTITEM: - // ziskani polozky pro tento FS (aktivni nebo odpojeny) do Change Drive menu (Alt+F1/F2) - // nebo Disconnect dialogu (hotkey: F12; pripadny disconnect tohoto FS zajisti metoda + // Only if GetSupportedServices() returns FS_SERVICE_GETCHANGEDRIVEORDISCONNECTITEM: + // gets the item for this FS (active or detached) for the Change Drive menu (Alt+F1/F2) + // or the Disconnect dialog (hotkey: F12; disconnecting this FS, if needed, is handled by method // CPluginInterfaceForFSAbstract::DisconnectFS; pokud GetChangeDriveOrDisconnectItem vrati // FALSE a FS je v panelu, prida se polozka s ikonou ziskanou pres GetFSIcon a root cestou); - // je-li navratova hodnota TRUE, prida se polozka s ikonou 'icon' a textem 'title'; - // 'fsName' je aktualni jmeno FS; je-li 'icon' NULL, nema polozka ikonu; je-li - // 'destroyIcon' TRUE a 'icon' neni NULL, uvolni se 'icon' po pouziti pres Win32 API - // funkci DestroyIcon; 'title' je text alokovany na heapu Salamandera a muze obsahovat - // az tri sloupce vzajemne oddelene '\t' (viz Alt+F1/F2 menu), v Disconnect dialogu se - // pouziva jen druhy sloupec; je-li navratova hodnota FALSE, jsou navratove hodnoty - // 'title', 'icon' a 'destroyIcon' ignorovany (neprida se polozka) + // if the return value is TRUE, an item with icon 'icon' and text 'title' is added; + // 'fsName' is the current FS name; if 'icon' is NULL, the item has no icon; if + // 'destroyIcon' is TRUE and 'icon' is not NULL, 'icon' is released after use via the Win32 API + // function DestroyIcon; 'title' is text allocated on Salamander's heap and may contain + // up to three columns separated by '\t' (see the Alt+F1/F2 menu); only the second column is used in the Disconnect dialog; + // if the return value is FALSE, the output values + // 'title', 'icon', and 'destroyIcon' are ignored (no item is added) virtual BOOL WINAPI GetChangeDriveOrDisconnectItem(const char* fsName, char*& title, HICON& icon, BOOL& destroyIcon) = 0; - // jen pokud GetSupportedServices() vraci i FS_SERVICE_GETFSICON: - // ziskani ikony FS pro directory-line toolbaru nebo pripadne pro Disconnect dialog (F12); - // ikona pro Disconnect dialog se zde ziskava jen pokud pro tento FS metoda - // GetChangeDriveOrDisconnectItem nevraci polozku (napr. RegEdit a WMobile); - // vraci ikonu nebo NULL pokud se ma pouzit standardni ikona; je-li 'destroyIcon' TRUE - // a vraci ikonu (ne NULL), uvolni se vracena ikona po pouziti pres Win32 API - // funkci DestroyIcon - // Pozor: pokud je resource ikonky nacitane pomoci LoadIcon v rozmerech 16x16, vrati LoadIcon - // ikonku 32x32. Pri jejim naslednem kresleni do 16x16 vzniknou kolem ikonky barevne - // kontury. Konverzi 16->32->16 lze predejit pouzitim LoadImage: + // Only if GetSupportedServices() returns FS_SERVICE_GETFSICON: + // gets the FS icon for the Directory Line toolbar or, if needed, for the Disconnect dialog (F12). The icon for the Disconnect dialog is obtained here only if GetChangeDriveOrDisconnectItem does not return an item for this FS (for example RegEdit and WMobile). Returns an icon, or NULL if the standard icon should be used. If 'destroyIcon' is TRUE and it returns an icon (not NULL), the returned icon is released after use by the Win32 API function DestroyIcon. + // WARNING: if the icon resource is loaded by LoadIcon at 16x16, LoadIcon returns a 32x32 icon. When it is then drawn at 16x16, colored fringes appear around the icon. The 16->32->16 conversion can be avoided by using LoadImage: // (HICON)LoadImage(DLLInstance, MAKEINTRESOURCE(id), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR); // - // v teto metode se nesmi zobrazovat zadna okna (obsah panelu neni konzistentni, nesmi - // se distribuovat zpravy - prekresleni, atd.) + // No windows may be shown in this method (the panel contents are not consistent, messages such as repaint must not be dispatched, etc.). virtual HICON WINAPI GetFSIcon(BOOL& destroyIcon) = 0; // returns the requested drop effect for a drag&drop operation from an FS (possibly this FS) to this FS; @@ -394,18 +300,12 @@ class CPluginFSInterfaceAbstract DWORD allowedEffects, DWORD keyState, DWORD* dropEffect) = 0; - // jen pokud GetSupportedServices() vraci i FS_SERVICE_GETFREESPACE: - // vraci v 'retValue' (nesmi byt NULL) velikost volneho mista na FS (zobrazuje se - // vpravo na directory-line); pokud volne misto nelze zjistit, vraci - // CQuadWord(-1, -1) (udaj se nezobrazuje) + // Only if GetSupportedServices() returns FS_SERVICE_GETFREESPACE: + // returns the amount of free space on the FS in 'retValue' (it must not be NULL) (displayed on the right in the Directory Line). If the free space cannot be determined, it returns CQuadWord(-1, -1) (the value is not displayed). virtual void WINAPI GetFSFreeSpace(CQuadWord* retValue) = 0; - // jen pokud GetSupportedServices() vraci i FS_SERVICE_GETNEXTDIRLINEHOTPATH: - // nalezeni delicich bodu v textu Directory Line (pro zkracovani cesty pomoci mysi - hot-tracking); - // 'text' je text v Directory Line (cesta + pripadne filter); 'pathLen' je delka cesty v 'text' - // (zbytek je filtr); 'offset' je offset znaku, od ktereho se ma hledat delici bod; vraci TRUE - // pokud dalsi delici bod existuje, jeho pozici vraci v 'offset'; vraci FALSE pokud zadny dalsi - // delici bod neexistuje (konec textu neni povazovan za delici bod) + // Only if GetSupportedServices() returns FS_SERVICE_GETNEXTDIRLINEHOTPATH: + // finds separator positions in the Directory Line text (for mouse-based path shortening - hot tracking). 'text' is the Directory Line text (path plus optional filter); 'pathLen' is the length of the path in 'text' (the rest is the filter); 'offset' is the character offset from which the next separator should be searched. Returns TRUE if another separator exists and returns its position in 'offset'; returns FALSE if no further separator exists (the end of the text is not considered a separator). virtual BOOL WINAPI GetNextDirectoryLineHotPath(const char* text, int pathLen, int& offset) = 0; // Only if GetSupportedServices() returns FS_SERVICE_GETNEXTDIRLINEHOTPATH: @@ -413,20 +313,20 @@ class CPluginFSInterfaceAbstract // 'path' is an in/out buffer containing the path (the buffer size is 'pathBufSize') virtual void WINAPI CompleteDirectoryLineHotPath(char* path, int pathBufSize) = 0; - // jen pokud GetSupportedServices() vraci i FS_SERVICE_GETPATHFORMAINWNDTITLE: - // ziskani textu, ktery se zobrazi v titulku hlavniho okna pokud je zapnute zobrazovani - // aktualni cesty v titulku hlavniho okna (viz Configuration/Appearance/Display current - // path...); 'fsName' je aktualni jmeno FS; je-li 'mode' 1, jde o rezim - // "Directory Name Only" (ma se zobrazit jen jmeno aktualniho adresare - posledni - // komponenty cesty); je-li 'mode' 2, jde o rezim "Shortened Path" (ma se zobrazit - // zkracena forma cesty - root (vc. oddelovace cesty) + "..." + oddelovac - // cesty + posledni komponenta cesty); 'buf' je buffer o velikosti 'bufSize' pro - // vysledny text; vraci TRUE pokud vraci pozadovany text; vraci FALSE pokud se - // ma text vytvorit na zaklade udaju o delicich bodech ziskanych pres metodu + // Only if GetSupportedServices() returns FS_SERVICE_GETPATHFORMAINWNDTITLE: + // obtains the text to display in the main window title when showing the current + // path in the main window title is enabled (see Configuration/Appearance/Display current + // path...); 'fsName' is the current FS name; if 'mode' is 1, this is + // Directory Name Only mode (only the current directory name - the last + // path component - should be displayed); if 'mode' is 2, this is + // Shortened Path mode (the shortened form of the path should be displayed - + // root (including the path separator) + ... + path separator + // + the last path component); 'buf' is a buffer of size 'bufSize' for the + // resulting text; returns TRUE if it returns the requested text; returns FALSE if the // GetNextDirectoryLineHotPath() // POZNAMKA: pokud GetSupportedServices() nevraci i FS_SERVICE_GETPATHFORMAINWNDTITLE, - // zobrazuje se v titulku hlavniho okna plna cesta na FS ve vsech rezimech - // zobrazovani titulku (i v "Directory Name Only" a "Shortened Path") + // text should be generated from separator positions obtained by the method + // GetNextDirectoryLineHotPath() virtual BOOL WINAPI GetPathForMainWindowTitle(const char* fsName, int mode, char* buf, int bufSize) = 0; // Only if GetSupportedServices() returns FS_SERVICE_SHOWINFO: @@ -434,70 +334,29 @@ class CPluginFSInterfaceAbstract // 'fsName' is the current FS name; 'parent' is the suggested parent of the displayed dialog virtual void WINAPI ShowInfoDialog(const char* fsName, HWND parent) = 0; - // jen pokud GetSupportedServices() vraci i FS_SERVICE_COMMANDLINE: - // spusti prikaz pro FS v aktivnim panelu z prikazove radky pod panely; vraci FALSE pri chybe - // (prikaz se nevklada do historie prikazove radky a ostatni navratove hodnoty se ignoruji); - // vraci TRUE pri uspesnem spusteni prikazu (pozor: na vysledcich prikazu nezalezi - dulezite - // je jen jestli byl spusteny (napr. u FTP jde o to, jestli se ho podarilo dorucit serveru)); - // 'parent' je navrzeny parent pripadnych zobrazovanych dialogu; 'command' je buffer - // velikosti SALCMDLINE_MAXLEN+1, ktery na vstupu obsahuje spousteny prikaz (skutecna - // maximalni delka prikazu zavisi na verzi Windows a obsahu promenne prostredi COMSPEC) - // a na vystupu novy obsah prikazove radky (obvykle se jen vycisti na prazdny retezec); - // 'selFrom' a 'selTo' vraci pozici oznaceni v novem obsahu prikazove radky (pokud se shoduji, - // jen se umisti kurzor; je-li vystupem prazdna radka, jsou tyto hodnoty ignorovany) - // POZOR: tato metoda by nemela primo menit cestu v panelu - hrozi uzavreni FS pri chybe cesty - // (metode by prestal existovat ukazatel this) + // Only if GetSupportedServices() returns FS_SERVICE_COMMANDLINE: + // executes a command for the FS in the active panel from the command line below the panels; returns FALSE on error (the command is not added to the command-line history and the other return values are ignored). Returns TRUE if the command was started successfully (note: the command result does not matter - only whether it was started, for example for FTP whether it was delivered to the server). 'parent' is the suggested parent of any displayed dialogs; 'command' is a buffer of size SALCMDLINE_MAXLEN+1 that contains the command to execute on input (the actual maximum command length depends on the Windows version and the contents of the COMSPEC environment variable) and the new contents of the command line on output (usually it is just cleared to an empty string). 'selFrom' and 'selTo' return the selection position in the new command-line contents (if they are equal, only the caret is positioned; if the output line is empty, these values are ignored). + // WARNING: this method should not change the panel path directly - an invalid path may close the FS (the method's this pointer would cease to exist). virtual BOOL WINAPI ExecuteCommandLine(HWND parent, char* command, int& selFrom, int& selTo) = 0; - // jen pokud GetSupportedServices() vraci i FS_SERVICE_QUICKRENAME: - // rychle prejmenovani souboru nebo adresare ('isDir' je FALSE/TRUE) 'file' na FS; - // umozni otevrit vlastni dialog pro rychle prejmenovani (parametr 'mode' je 1) - // nebo pouzit standardni dialog (pri 'mode'==1 vrati FALSE a 'cancel' take FALSE, - // pak Salamander otevre standardni dialog a ziskane nove jmeno preda v 'newName' pri - // dalsim volani QuickRename s 'mode'==2); 'fsName' je aktualni jmeno FS; 'parent' je - // navrzeny parent pripadnych zobrazovanych dialogu; 'newName' je nove jmeno pokud - // 'mode'==2; pokud vraci TRUE, v 'newName' se vraci nove jmeno (max. MAX_PATH znaku; - // ne plne jmeno, jen jmeno polozky v panelu) - Salamander se ho pokusi vyfokusit po - // refreshi (o refresh se stara sam FS, napriklad pomoci metody - // CSalamanderGeneralAbstract::PostRefreshPanelFS); pokud vraci FALSE a 'mode'==2, - // vraci se v 'newName' chybne nove jmeno (pripadne nejakym zpusobem upravene - napr. - // uz muze byt aplikovana operacni maska) pokud chce uzivatel prerusit operaci, vraci - // 'cancel' TRUE; vraci-li 'cancel' FALSE, vraci metoda TRUE pri uspesnem dokonceni - // operace, pokud vrati FALSE pri 'mode'==1, ma se otevrit standardni dialog pro - // rychle prejmenovani, pokud vrati FALSE pri 'mode'==2, jde o chybu operace (chybne - // nove jmeno se vraci v 'newName' - znovu se otevre standardni dialog a uzivatel zde - // muze chybne jmeno opravit) + // Only if GetSupportedServices() returns FS_SERVICE_QUICKRENAME: + // quickly renames file 'file' or a directory ('isDir' is FALSE/TRUE) on the FS. It may open its own quick-rename dialog ('mode' is 1) or use the standard dialog (when 'mode'==1 it returns FALSE and 'cancel' FALSE; Salamander then opens the standard dialog and passes the entered new name in 'newName' on the next call to QuickRename with 'mode'==2). 'fsName' is the current FS name; 'parent' is the suggested parent of any displayed dialogs; 'newName' is the new name when 'mode'==2. If it returns TRUE, 'newName' returns the new name (max. MAX_PATH characters; not the full name, only the name of the item in the panel) - Salamander will try to focus it after refresh (the refresh is handled by the FS itself, for example via CSalamanderGeneralAbstract::PostRefreshPanelFS). If it returns FALSE and 'mode'==2, 'newName' returns the invalid new name (possibly modified in some way - for example an operation mask may already have been applied). If the user wants to cancel the operation, 'cancel' returns TRUE. When 'cancel' is FALSE, the method returns TRUE on successful completion of the operation; if it returns FALSE with 'mode'==1, the standard quick-rename dialog should be opened; if it returns FALSE with 'mode'==2, it is an operation error (the invalid new name is returned in 'newName' - the standard dialog is reopened and the user can correct the invalid name there). virtual BOOL WINAPI QuickRename(const char* fsName, int mode, HWND parent, CFileData& file, BOOL isDir, char* newName, BOOL& cancel) = 0; - // jen pokud GetSupportedServices() vraci i FS_SERVICE_ACCEPTSCHANGENOTIF: - // prijem informace o zmene na ceste 'path' (je-li 'includingSubdirs' TRUE, tak - // zahrnuje i zmenu v podadresarich cesty 'path'); tato metoda by mela rozhodnout - // jestli je treba provest refresh tohoto FS (napriklad pomoci metody + // Only if GetSupportedServices() returns FS_SERVICE_ACCEPTSCHANGENOTIF: + // receives information about a change on path 'path' (if 'includingSubdirs' is TRUE, it + // also includes changes in subdirectories of path 'path'); this method should decide + // whether this FS needs to be refreshed (for example via method // CSalamanderGeneralAbstract::PostRefreshPanelFS); tyka se jak aktivnich FS, tak - // odpojenych FS; 'fsName' je aktualni jmeno FS - // POZNAMKA: pro plugin jako celek existuje metoda + // detached FSs; 'fsName' is the current FS name + // NOTE: for the plugin as a whole, there is also the method // CPluginInterfaceAbstract::AcceptChangeOnPathNotification() virtual void WINAPI AcceptChangeOnPathNotification(const char* fsName, const char* path, BOOL includingSubdirs) = 0; - // jen pokud GetSupportedServices() vraci i FS_SERVICE_CREATEDIR: - // vytvoreni noveho adresare na FS; umozni otevrit vlastni dialog pro vytvoreni - // adresare (parametr 'mode' je 1) nebo pouzit standardni dialog (pri 'mode'==1 vrati - // FALSE a 'cancel' take FALSE, pak Salamander otevre standardni dialog a ziskane jmeno - // adresare preda v 'newName' pri dalsim volani CreateDir s 'mode'==2); - // 'fsName' je aktualni jmeno FS; 'parent' je navrzeny parent pripadnych zobrazovanych - // dialogu; 'newName' je jmeno noveho adresare pokud 'mode'==2; pokud vraci TRUE, - // v 'newName' se vraci jmeno noveho adresare (max. 2 * MAX_PATH znaku; ne plne jmeno, - // jen jmeno polozky v panelu) - Salamander se ho pokusi vyfokusit po refreshi (o refresh - // se stara sam FS, napriklad pomoci metody CSalamanderGeneralAbstract::PostRefreshPanelFS); - // pokud vraci FALSE a 'mode'==2, vraci se v 'newName' chybne jmeno adresare (max. 2 * MAX_PATH - // znaku, pripadne upravene na absolutni tvar); pokud chce uzivatel prerusit operaci, - // vraci 'cancel' TRUE; vraci-li 'cancel' FALSE, vraci metoda TRUE pri uspesnem dokonceni - // operace, pokud vrati FALSE pri 'mode'==1, ma se otevrit standardni dialog pro vytvoreni - // adresare, pokud vrati FALSE pri 'mode'==2, jde o chybu operace (chybne jmeno - // adresare se vraci v 'newName' - znovu se otevre standardni dialog a uzivatel - // zde muze chybne jmeno opravit) + // Only if GetSupportedServices() returns FS_SERVICE_CREATEDIR: + // creates a new directory on the FS. It may open its own create-directory dialog ('mode' is 1) or use the standard dialog (when 'mode'==1 it returns FALSE and 'cancel' FALSE; Salamander then opens the standard dialog and passes the directory name it obtains in 'newName' on the next call to CreateDir with 'mode'==2). 'fsName' is the current FS name; 'parent' is the suggested parent of any displayed dialogs; 'newName' is the new directory name if 'mode'==2. If it returns TRUE, 'newName' returns the new directory name (max. 2 * MAX_PATH characters; not the full name, only the item name in the panel) - Salamander will try to focus it after refresh (the refresh is handled by the FS itself, for example via CSalamanderGeneralAbstract::PostRefreshPanelFS). If it returns FALSE and 'mode'==2, 'newName' returns the invalid directory name (max. 2 * MAX_PATH characters, possibly adjusted to an absolute form). If the user wants to cancel the operation, 'cancel' returns TRUE. When 'cancel' is FALSE, the method returns TRUE on successful completion of the operation; if it returns FALSE with 'mode'==1, the standard create-directory dialog should be opened; if it returns FALSE with 'mode'==2, it is an operation error (the invalid directory name is returned in 'newName' - the standard dialog is reopened and the user can correct the invalid name there). virtual BOOL WINAPI CreateDir(const char* fsName, int mode, HWND parent, char* newName, BOOL& cancel) = 0; @@ -510,141 +369,41 @@ class CPluginFSInterfaceAbstract CSalamanderForViewFileOnFSAbstract* salamander, CFileData& file) = 0; - // jen pokud GetSupportedServices() vraci i FS_SERVICE_DELETE: - // mazani souboru a adresaru oznacenych v panelu; umozni otevrit vlastni dialog s dotazem - // na mazani (parametr 'mode' je 1; jestli se ma nebo nema zobrazit dotaz zavisi na hodnote - // SALCFG_CNFRMFILEDIRDEL - TRUE znamena, ze uzivatel chce potvrzovat mazani) - // nebo pouzit standardni dotaz (pri 'mode'==1 vrati FALSE a 'cancelOrError' take FALSE, - // pak Salamander otevre standardni dotaz (pokud je SALCFG_CNFRMFILEDIRDEL TRUE) - // a v pripade kladne odpovedi znovu zavola Delete s 'mode'==2); 'fsName' je aktualni jmeno FS; - // 'parent' je navrzeny parent pripadnych zobrazovanych dialogu; 'panel' identifikuje panel - // (PANEL_LEFT nebo PANEL_RIGHT), ve kterem je otevrene FS (z tohoto panelu se ziskavaji - // soubory/adresare, ktere se maji mazat); 'selectedFiles' + 'selectedDirs' - pocet oznacenych - // souboru a adresaru, pokud jsou obe hodnoty nulove, maze se soubor/adresar pod kurzorem - // (fokus), pred volanim metody Delete jsou bud oznacene soubory a adresare nebo je alespon - // fokus na souboru/adresari, takze je vzdy s cim pracovat (zadne dalsi testy nejsou treba); - // pokud vraci TRUE a 'cancelOrError' je FALSE, operace probehla korektne a oznacene - // soubory/adresare se maji odznacit (pokud prezily mazani); pokud chce uzivatel prerusit - // operaci nebo nastane chyba vraci se 'cancelOrError' TRUE a nedojde k odznaceni - // souboru/adresaru; pokud vraci FALSE pri 'mode'==1 a 'cancelOrError' je FALSE, ma se - // otevrit standardni dotaz na mazani + // Only if GetSupportedServices() returns FS_SERVICE_DELETE: + // deletes the files and directories selected in the panel; it may open its own delete confirmation dialog ('mode' is 1; whether the confirmation should be shown depends on SALCFG_CNFRMFILEDIRDEL - TRUE means the user wants delete confirmations) or use the standard dialog (when 'mode'==1 it returns FALSE and 'cancelOrError' FALSE; Salamander then opens the standard dialog (if SALCFG_CNFRMFILEDIRDEL is TRUE) and, if the user confirms, calls Delete again with 'mode'==2). 'fsName' is the current FS name; 'parent' is the suggested parent of any displayed dialogs; 'panel' identifies the panel (PANEL_LEFT or PANEL_RIGHT) in which the FS is open (the files/directories to delete are taken from this panel); 'selectedFiles' + 'selectedDirs' is the number of selected files and directories. If both values are zero, the file/directory under the cursor (focus) is deleted. Before Delete is called, either files/directories are selected or there is at least focus on a file/directory, so there is always something to work with (no additional checks are needed). If it returns TRUE and 'cancelOrError' is FALSE, the operation completed correctly and the selected files/directories should be deselected (if they survived the delete). If the user cancels the operation or an error occurs, 'cancelOrError' is TRUE and the files/directories are not deselected. If it returns FALSE with 'mode'==1 and 'cancelOrError' is FALSE, the standard delete confirmation dialog should be opened. virtual BOOL WINAPI Delete(const char* fsName, int mode, HWND parent, int panel, int selectedFiles, int selectedDirs, BOOL& cancelOrError) = 0; - // kopirovani/presun z FS (parametr 'copy' je TRUE/FALSE), v dalsim textu se mluvi jen o - // kopirovani, ale vse plati shodne i pro presun; 'copy' muze byt TRUE (kopirovani) jen - // pokud GetSupportedServices() vraci i FS_SERVICE_COPYFROMFS; 'copy' muze byt FALSE - // (presun nebo prejmenovani) jen pokud GetSupportedServices() vraci i FS_SERVICE_MOVEFROMFS; + // Copy/move from the FS ('copy' is TRUE/FALSE); the rest of this text speaks only about copying, but everything applies equally to moving. 'copy' may be TRUE (copy) only if GetSupportedServices() returns FS_SERVICE_COPYFROMFS; 'copy' may be FALSE (move or rename) only if GetSupportedServices() returns FS_SERVICE_MOVEFROMFS. // - // kopirovani souboru a adresaru (z FS) oznacenych v panelu; umozni otevrit vlastni dialog pro - // zadani cile kopirovani (parametr 'mode' je 1) nebo pouzit standardni dialog (vrati FALSE - // a 'cancelOrHandlePath' take FALSE, pak Salamander otevre standardni dialog a ziskanou cilovou - // cestu preda v 'targetPath' pri dalsim volani CopyOrMoveFromFS s 'mode'==2); pri 'mode'==2 - // je 'targetPath' presne retezec zadany uzivatelem (CopyOrMoveFromFS si ho muze rozanalyzovat - // po svem); pokud CopyOrMoveFromFS podporuje jen windowsove cilove cesty (nebo nedokaze - // zpracovat uzivatelem zadanou cestu - napr. vede na jiny FS nebo do archivu), muze vyuzit - // standardni zpusob zpracovani cesty v Salamanderovi (zatim umi zpracovat jen windowsove cesty, - // casem mozna zpracuje i FS a archivove cesty pres TEMP adresar pomoci sledu nekolika zakladnich - // operaci) - vrati FALSE, 'cancelOrHandlePath' TRUE a 'operationMask' TRUE/FALSE - // (podporuje/nepodporuje operacni masky - pokud nepodporuje a v ceste je maska, zobrazi se - // chybova hlaska), pak Salamander zpracuje cestu vracenou v 'targetPath' (zatim jen rozdeleni - // windowsove cesty na existujici cast, neexistujici cast a pripadne masku; umozni take vytvorit - // podadresare z neexistujici casti) a je-li cesta v poradku, zavola znovu CopyOrMoveFromFS - // s 'mode'==3 a v 'targetPath' s cilovou cestou a pripadne i s operacni maskou (dva retezce - // vzajemne oddelene nulou; zadna maska -> dve nuly na konci retezce), pokud je v ceste nejaka - // chyba, zavola znovu CopyOrMoveFromFS s 'mode'==4 v 'targetPath' s upravenou chybnou cilovou - // cestou (chyba uz byla uzivateli ohlasena; uzivatel by mel dostat moznost cestu opravit; - // v ceste mohly byt odstraneny "." a "..", atp.); + // Copies files and directories (from the FS) selected in the panel; it may open its own dialog for entering the copy target ('mode' is 1) or use the standard dialog (it returns FALSE and 'cancelOrHandlePath' FALSE, then Salamander opens the standard dialog and passes the target path entered there in 'targetPath' on the next call to CopyOrMoveFromFS with 'mode'==2). For 'mode'==2, 'targetPath' is exactly the string entered by the user (CopyOrMoveFromFS may parse it in its own way). If CopyOrMoveFromFS supports only Windows target paths (or cannot process the user-entered path - for example it leads to another FS or an archive), it may use Salamander's standard path processing (currently it handles only Windows paths; in the future it may also handle FS and archive paths via the TEMP directory using a sequence of several basic operations) - it returns FALSE, 'cancelOrHandlePath' TRUE, and 'operationMask' TRUE/FALSE (supports/does not support operation masks - if it does not support them and the path contains a mask, an error message is shown). Salamander then processes the path returned in 'targetPath' (currently only splitting a Windows path into existing part, non-existing part, and optional mask; it can also create subdirectories from the non-existing part) and, if the path is valid, calls CopyOrMoveFromFS again with 'mode'==3 and 'targetPath' containing the target path and optionally an operation mask (two strings separated by a null; no mask -> two nulls at the end of the string). If there is an error in the path, Salamander calls CopyOrMoveFromFS again with 'mode'==4 and 'targetPath' containing the corrected invalid target path (the error has already been reported to the user; the user should be allowed to correct the path; . and .. etc. may have been removed from it). // - // pokud uzivatel zada operaci drag&dropem (dropne soubory/adresare z FS do stejneho panelu - // nebo do jineho drop-targetu), je 'mode'==5 a v 'targetPath' je cilova cesta operace (muze - // byt windowsova cesta, FS cesta a do budoucna se da pocitat i s cestami do archivu), - // 'targetPath' je ukoncena dvema nulami (pro kompatibilitu s 'mode'==3); 'dropTarget' je - // v tomto pripade okno drop-targetu (vyuziva se pro reaktivaci drop-targetu po otevreni - // progress-okna operace, viz CSalamanderGeneralAbstract::ActivateDropTarget); pri 'mode'==5 ma - // smysl jen navratova hodnota TRUE; + // If the user initiates the operation by drag&drop (drops files/directories from the FS into the same panel or another drop target), 'mode'==5 and 'targetPath' is the operation target path (it may be a Windows path, an FS path, and in the future possibly an archive path); 'targetPath' is terminated by two nulls (for compatibility with 'mode'==3). In this case, 'dropTarget' is the drop-target window (used to reactivate the drop target after the operation progress window is opened; see CSalamanderGeneralAbstract::ActivateDropTarget). For 'mode'==5, only the TRUE return value is meaningful. // - // 'fsName' je aktualni jmeno FS; 'parent' je navrzeny parent pripadnych zobrazovanych dialogu; - // 'panel' identifikuje panel (PANEL_LEFT nebo PANEL_RIGHT), ve kterem je otevreny FS (z tohoto - // panelu se ziskavaji soubory/adresare, ktere se maji kopirovat); - // 'selectedFiles' + 'selectedDirs' - pocet oznacenych souboru a adresaru, pokud jsou - // obe hodnoty nulove, kopiruje se soubor/adresar pod kurzorem (fokus), pred volanim - // metody CopyOrMoveFromFS jsou bud oznacene soubory a adresare nebo je alespon fokus - // na souboru/adresari, takze je vzdy s cim pracovat (zadne dalsi testy - // nejsou treba); na vstupu 'targetPath' pri 'mode'==1 obsahuje navrzenou cilovou cestu - // (jen windowsove cesty bez masky nebo prazdny retezec), pri 'mode'==2 obsahuje retezec - // cilove cesty zadany uzivatelem ve standardnim dialogu, pri 'mode'==3 obsahuje cilovou - // cestu a masku (oddelene nulou), pri 'mode'==4 obsahuje chybnou cilovou cestu, pri 'mode'==5 - // obsahuje cilovou cestu (windowsovou, FS nebo do archivu) ukoncenou dvema nulami; pokud - // metoda vraci FALSE, obsahuje 'targetPath' na vystupu (buffer 2 * MAX_PATH znaku) pri - // 'cancelOrHandlePath'==FALSE navrzenou cilovou cestu pro standardni dialog a pri - // 'cancelOrHandlePath'==TRUE retezec cilove cesty ke zpracovani; pokud metoda vraci TRUE a - // 'cancelOrHandlePath' FALSE, obsahuje 'targetPath' jmeno polozky, na kterou ma prejit fokus - // ve zdrojovem panelu (buffer 2 * MAX_PATH znaku; ne plne jmeno, jen jmeno polozky v panelu; - // je-li prazdny retezec, fokus zustava beze zmeny); 'dropTarget' neni NULL jen v pripade - // zadani cesty operace pomoci drag&dropu (viz popis vyse) + // 'fsName' is the current FS name; 'parent' is the suggested parent of any displayed dialogs; 'panel' identifies the panel (PANEL_LEFT or PANEL_RIGHT) in which the FS is open (the files/directories to copy are taken from this panel). 'selectedFiles' + 'selectedDirs' is the number of selected files and directories; if both values are zero, the file/directory under the cursor (focus) is copied. Before CopyOrMoveFromFS is called, either files/directories are selected or there is at least focus on a file/directory, so there is always something to work with (no additional checks are needed). On input, 'targetPath' contains: for 'mode'==1, the suggested target path (Windows paths without a mask only, or an empty string); for 'mode'==2, the target path string entered by the user in the standard dialog; for 'mode'==3, the target path and mask (separated by a null); for 'mode'==4, the invalid target path; for 'mode'==5, the target path (Windows, FS, or archive) terminated by two nulls. If the method returns FALSE, 'targetPath' on output (a buffer of 2 * MAX_PATH characters) contains the suggested target path for the standard dialog when 'cancelOrHandlePath'==FALSE, and the target path string to be processed when 'cancelOrHandlePath'==TRUE. If the method returns TRUE and 'cancelOrHandlePath' is FALSE, 'targetPath' contains the name of the item that should receive focus in the source panel (a 2 * MAX_PATH character buffer; not the full name, only the item name as shown in the panel; if it is an empty string, the focus remains unchanged). 'dropTarget' is not NULL only when the operation path was entered by drag&drop (see above). // - // pokud vraci TRUE a 'cancelOrHandlePath' je FALSE, operace probehla korektne a oznacene - // soubory/adresare se maji odznacit; pokud chce uzivatel prerusit operaci nebo nastala - // chyba, vraci metoda TRUE a 'cancelOrHandlePath' TRUE, v obou pripadech nedojde k odznaceni - // souboru/adresaru; pokud vraci FALSE, ma se otevrit standardni dialog ('cancelOrHandlePath' - // je FALSE) nebo se ma standardnim zpusobem zpracovat cesta ('cancelOrHandlePath' je TRUE) + // If it returns TRUE and 'cancelOrHandlePath' is FALSE, the operation completed correctly and the selected files/directories should be deselected. If the user cancels the operation or an error occurs, the method returns TRUE and 'cancelOrHandlePath' TRUE; in both cases the files/directories are not deselected. If it returns FALSE, the standard dialog should be opened ('cancelOrHandlePath' is FALSE) or the path should be processed in the standard way ('cancelOrHandlePath' is TRUE). // - // POZNAMKA: pokud je nabizena moznost kopirovat/presouvat na cestu do ciloveho panelu, - // je treba volat CSalamanderGeneralAbstract::SetUserWorkedOnPanelPath pro cilovy - // panel, jinak nebude cesta v tomto panelu vlozena do seznamu pracovnich - // adresaru - List of Working Directories (Alt+F12) + // NOTE: if the user is offered copying/moving to a path in the target panel, CSalamanderGeneralAbstract::SetUserWorkedOnPanelPath must be called for the target panel, otherwise the path in that panel will not be added to the List of Working Directories (Alt+F12). virtual BOOL WINAPI CopyOrMoveFromFS(BOOL copy, int mode, const char* fsName, HWND parent, int panel, int selectedFiles, int selectedDirs, char* targetPath, BOOL& operationMask, BOOL& cancelOrHandlePath, HWND dropTarget) = 0; - // kopirovani/presun z windowsove cesty na FS (parametr 'copy' je TRUE/FALSE), v dalsim textu - // se mluvi jen o kopirovani, ale vse plati shodne i pro presun; 'copy' muze byt TRUE (kopirovani) - // jen pokud GetSupportedServices() vraci i FS_SERVICE_COPYFROMDISKTOFS; 'copy' muze byt FALSE - // (presun nebo prejmenovani) jen pokud GetSupportedServices() vraci i FS_SERVICE_MOVEFROMDISKTOFS; + // Copy/move from a Windows path to the FS ('copy' is TRUE/FALSE); the rest of this text speaks only about copying, but everything applies equally to moving. 'copy' may be TRUE (copy) only if GetSupportedServices() returns FS_SERVICE_COPYFROMDISKTOFS; 'copy' may be FALSE (move or rename) only if GetSupportedServices() returns FS_SERVICE_MOVEFROMDISKTOFS. // - // kopirovani vybranych (v panelu nebo jinde) souboru a adresaru na FS; pri 'mode'==1 umoznuje - // pripravit text cilove cesty pro uzivatele do standardniho dialogu pro kopirovani, jde o situaci, - // kdy je ve zdrojovem panelu (panel, kde dojde ke spusteni prikazu Copy (klavesa F5)) windowsova - // cesta a v cilovem panelu tento FS; pri 'mode'==2 a 'mode'==3 muze plugin provest operaci kopirovani nebo - // ohlasit jednu ze dvou chyb: "chyba v ceste" (napr. obsahuje nepripustne znaky nebo neexistuje) - // a "v tomto FS nelze provest pozadovanou operaci" (napr. jde sice o FTP, ale otevrena cesta - // v tomto FS je rozdilna od cilove cesty (napr. u FTP jiny FTP server) - je potreba otevrit - // jiny/novy FS; tuto chybu nemuze ohlasit nove otevreny FS); - // POZOR: tato metoda se muze zavolat pro jakoukoliv cilovou FS cestu tohoto pluginu (muze tedy - // jit i o cestu s jinym jmenem FS tohoto pluginu) + // Copies selected files and directories (from a panel or elsewhere) to the FS. With 'mode'==1 it allows the plugin to prepare the target-path text for the user in the standard copy dialog; this is used when the source panel (the panel from which the Copy command, F5, is started) contains a Windows path and the target panel contains this FS. With 'mode'==2 and 'mode'==3, the plugin may perform the copy operation or report one of two errors: invalid path (for example it contains invalid characters or does not exist) and the requested operation cannot be performed in this FS (for example it is FTP, but the currently open path in this FS differs from the target path, e.g. a different FTP server - another/new FS must be opened; a newly opened FS cannot report this error). + // WARNING: this method may be called for any target FS path of this plugin (so it may also be a path with a different FS name of this plugin). // - // 'fsName' je aktualni jmeno FS; 'parent' je navrzeny parent pripadnych zobrazovanych - // dialogu; 'sourcePath' je zdrojova windowsova cesta (vsechny vybrane soubory a adresare - // jsou adresovany relativne k ni), pri 'mode'==1 je NULL; vybrane soubory a adresare - // jsou zadany enumeracni funkci 'next' jejimz parametrem je 'nextParam', pri 'mode'==1 - // jsou NULL; 'sourceFiles' + 'sourceDirs' - pocet vybranych souboru a adresaru (soucet - // je vzdy nenulovy); 'targetPath' je in/out buffer min. 2 * MAX_PATH znaku pro cilovou - // cestu; pri 'mode'==1 je 'targetPath' na vstupu aktualni cesta na tomto FS a na vystupu cilova - // cesta pro standardni dialog kopirovani; pri 'mode'==2 je 'targetPath' na vstupu uzivatelem - // zadana cilova cesta (bez uprav, vcetne masky, atd.) a na vystupu se ignoruje az na pripad, kdy - // metoda vraci FALSE (chyba) a 'invalidPathOrCancel' TRUE (chyba v ceste), v tomto pripade je na - // vystupu upravena cilova cesta (napr. odstranene "." a ".."), kterou bude uzivatel opravovat - // ve standardnim dialogu kopirovani; pri 'mode'==3 je 'targetPath' na vstupu drag&dropem - // zadana cilova cesta a na vystupu se ignoruje; neni-li 'invalidPathOrCancel' NULL (jen 'mode'==2 - // a 'mode'==3), vraci se v nem TRUE, pokud je cesta spatne zadana (obsahuje nepripustne znaky nebo - // neexistuje, atd.) nebo doslo k preruseni operace (cancel) - chybove/cancel hlaseni se zobrazuje - // pred ukoncenim teto metody + // 'fsName' is the current FS name; 'parent' is the suggested parent of any displayed dialogs; 'sourcePath' is the source Windows path (all selected files and directories are addressed relative to it), and is NULL for 'mode'==1. The selected files and directories are provided by enumeration function 'next' with parameter 'nextParam'; for 'mode'==1 they are NULL. 'sourceFiles' + 'sourceDirs' is the number of selected files and directories (their sum is always nonzero). 'targetPath' is an in/out buffer of at least 2 * MAX_PATH characters for the target path. For 'mode'==1, 'targetPath' contains the current path on this FS on input and the target path for the standard copy dialog on output. For 'mode'==2, 'targetPath' contains the user-entered target path on input (unchanged, including mask, etc.) and the output is ignored except when the method returns FALSE (error) and 'invalidPathOrCancel' TRUE (invalid path); in that case the output contains the corrected target path (for example with . and .. removed) that the user will edit in the standard copy dialog. For 'mode'==3, 'targetPath' contains the drag&drop target path on input and the output is ignored. If 'invalidPathOrCancel' is not NULL (only for 'mode'==2 and 'mode'==3), TRUE is returned in it if the path is invalid (contains invalid characters, does not exist, etc.) or the operation was cancelled - error/cancel messages are shown before this method returns. // - // pri 'mode'==1 vraci metoda TRUE pri uspechu, pokud vraci FALSE, pouzije se jako cilova cesta - // pro standardni dialog kopirovani prazdny retezec; pokud vraci metoda FALSE pri 'mode'==2 a 'mode'==3, - // ma se pro zpracovani operace hledat jiny FS (je-li 'invalidPathOrCancel' FALSE) nebo ma - // uzivatel opravit cilovou cestu (je-li 'invalidPathOrCancel' TRUE); pokud vraci metoda TRUE - // pri 'mode'==2 nebo 'mode'==3, operace probehla a ma dojit k odznaceni vybranych souboru a adresaru - // (je-li 'invalidPathOrCancel' FALSE) nebo doslo k chybe/preruseni operace a nema dojit - // k odznaceni vybranych souboru a adresaru (je-li 'invalidPathOrCancel' TRUE) + // For 'mode'==1 the method returns TRUE on success; if it returns FALSE, an empty string is used as the target path for the standard copy dialog. If the method returns FALSE for 'mode'==2 and 'mode'==3, another FS should be searched for to handle the operation (if 'invalidPathOrCancel' is FALSE) or the user should correct the target path (if 'invalidPathOrCancel' is TRUE). If the method returns TRUE for 'mode'==2 or 'mode'==3, the operation has completed and the selected files/directories should be deselected (if 'invalidPathOrCancel' is FALSE), or an error/cancellation occurred and the selected files/directories must not be deselected (if 'invalidPathOrCancel' is TRUE). // - // POZOR: Metoda CopyOrMoveFromDiskToFS se muze volat ve trech situacich: - // - tento FS je aktivni v panelu - // - tento FS je odpojeny - // - tento FS prave vzniknul (volanim OpenFS) a po ukonceni metody zase ihned zanikne - // (volanim CloseFS) - nebyla od nej volana zadna jina metoda (ani ChangePath) + // WARNING: CopyOrMoveFromDiskToFS may be called in three situations: + // - this FS is active in a panel + // - this FS is detached + // - this FS has just been created (by OpenFS) and is destroyed again immediately after the method returns + // (by CloseFS) - no other method has been called on it yet (not even ChangePath). virtual BOOL WINAPI CopyOrMoveFromDiskToFS(BOOL copy, int mode, const char* fsName, HWND parent, const char* sourcePath, SalEnumSelection2 next, void* nextParam, int sourceFiles, int sourceDirs, @@ -679,24 +438,10 @@ class CPluginFSInterfaceAbstract virtual void WINAPI ShowProperties(const char* fsName, HWND parent, int panel, int selectedFiles, int selectedDirs) = 0; - // jen pokud GetSupportedServices() vraci i FS_SERVICE_CONTEXTMENU: - // zobrazeni kontextoveho menu pro soubory a adresare oznacene v panelu (kliknuti pravym - // tlacitkem mysi na polozkach v panelu) nebo pro aktualni cestu v panelu (kliknuti pravym - // tlacitkem mysi na change-drive tlacitku v panelove toolbare) nebo pro panel (kliknuti - // pravym tlacitkem mysi za polozkami v panelu); kontextove menu ma kazdy plugin vlastni; + // Only if GetSupportedServices() returns FS_SERVICE_CONTEXTMENU: + // displays a context menu for files and directories selected in the panel (right-click on items in the panel), for the current path in the panel (right-click on the change-drive button in the panel toolbar), or for the panel itself (right-click behind the items in the panel); each plugin provides its own context menu. // - // 'fsName' je aktualni jmeno FS; 'parent' je navrzeny parent kontextoveho menu; - // 'menuX' + 'menuY' jsou navrzene souradnice leveho horniho rohu kontextoveho menu; - // 'type' je typ kontextoveho menu (viz popisy konstant fscmXXX); 'panel' - // identifikuje panel (PANEL_LEFT nebo PANEL_RIGHT), pro ktery se ma kontextove - // menu otevrit (z tohoto panelu se ziskavaji soubory/adresare/cesta, se kterymi - // se pracuje); pri 'type'==fscmItemsInPanel je 'selectedFiles' + 'selectedDirs' - // pocet oznacenych souboru a adresaru, pokud jsou obe hodnoty nulove, pracuje se se - // souborem/adresarem pod kurzorem (focusem), pred volanim metody ContextMenu jsou bud - // oznacene soubory a adresare (a bylo na nich kliknuto) nebo je alespon fokus na - // souboru/adresari (neni na updiru), takze je vzdy s cim pracovat (zadne dalsi testy - // nejsou treba); pokud 'type'!=fscmItemsInPanel, 'selectedFiles' + 'selectedDirs' - // jsou vzdy nastaveny na nulu (ignoruji se) + // 'fsName' is the current FS name; 'parent' is the suggested parent of the context menu; 'menuX' + 'menuY' are the suggested coordinates of the top-left corner of the context menu; 'type' is the context-menu type (see the fscmXXX constants); 'panel' identifies the panel (PANEL_LEFT or PANEL_RIGHT) for which the context menu should be opened (the files/directories/path to work with are taken from this panel). If 'type'==fscmItemsInPanel, 'selectedFiles' + 'selectedDirs' is the number of selected files and directories; if both values are zero, the file/directory under the cursor (focus) is used. Before ContextMenu is called, either files/directories are selected (and were clicked) or there is at least focus on a file/directory (not on the up-dir), so there is always something to work with (no additional checks are needed). If 'type'!=fscmItemsInPanel, 'selectedFiles' + 'selectedDirs' are always zero (ignored). virtual void WINAPI ContextMenu(const char* fsName, HWND parent, int menuX, int menuY, int type, int panel, int selectedFiles, int selectedDirs) = 0; @@ -707,11 +452,8 @@ class CPluginFSInterfaceAbstract // the plugin returns TRUE if it handled the message and FALSE otherwise virtual BOOL WINAPI HandleMenuMsg(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT* plResult) = 0; - // jen pokud GetSupportedServices() vraci i FS_SERVICE_OPENFINDDLG: - // otevreni Find dialogu pro FS v panelu; 'fsName' je aktualni jmeno FS; 'panel' identifikuje - // panel (PANEL_LEFT nebo PANEL_RIGHT), pro ktery se ma otevrit Find dialog (z tohoto panelu - // se ziskava obvykle cesta pro hledani); vraci TRUE pri uspesnem otevreni Find dialogu; - // pokud vrati FALSE, Salamander otevre standardni Find Files and Directories dialog + // Only if GetSupportedServices() returns FS_SERVICE_OPENFINDDLG: + // opens the Find dialog for the FS in a panel. 'fsName' is the current FS name; 'panel' identifies the panel (PANEL_LEFT or PANEL_RIGHT) for which the Find dialog should be opened (the search path is usually taken from this panel). Returns TRUE if the Find dialog is opened successfully; if it returns FALSE, Salamander opens the standard Find Files and Directories dialog. virtual BOOL WINAPI OpenFindDialog(const char* fsName, int panel) = 0; // Only if GetSupportedServices() returns FS_SERVICE_OPENACTIVEFOLDER: @@ -719,23 +461,11 @@ class CPluginFSInterfaceAbstract // 'fsName' is the current FS name; 'parent' is the suggested parent of the displayed dialog virtual void WINAPI OpenActiveFolder(const char* fsName, HWND parent) = 0; - // jen pokud GetSupportedServices() vraci FS_SERVICE_MOVEFROMFS nebo FS_SERVICE_COPYFROMFS: - // dovoluje ovlivnit povolene drop-effecty pri drag&dropu z tohoto FS; neni-li 'allowedEffects' - // NULL, obsahuje na vstupu dosud povolene drop-effecty (kombinace DROPEFFECT_MOVE a DROPEFFECT_COPY), - // na vystupu obsahuje drop-effecty povolene timto FS (effecty by se mely jen ubirat); - // 'mode' je 0 pri volani, ktere tesne predchazi zahajeni drag&drop operace, effecty vracene - // v 'allowedEffects' se pouziji pro volani DoDragDrop (tyka se cele drag&drop operace); - // 'mode' je 1 behem tazeni mysi nad FS z tohoto procesu (muze byt toto FS nebo FS z druheho - // panelu); pri 'mode' 1 je v 'tgtFSPath' cilova cesta, ktera se pouzije pokud dojde k dropu, - // jinak je 'tgtFSPath' NULL; 'mode' je 2 pri volani, ktere tesne nasleduje po dokonceni - // drag&drop operace (uspesnemu i neuspesnemu) + // Only if GetSupportedServices() returns FS_SERVICE_MOVEFROMFS or FS_SERVICE_COPYFROMFS: + // allows the plugin to influence the allowed drop effects for drag&drop from this FS. If 'allowedEffects' is not NULL, on input it contains the drop effects allowed so far (a combination of DROPEFFECT_MOVE and DROPEFFECT_COPY); on output it contains the drop effects allowed by this FS (effects should only be removed). 'mode' is 0 for the call that immediately precedes the start of the drag&drop operation; the effects returned in 'allowedEffects' are used for the DoDragDrop call (they apply to the whole drag&drop operation). 'mode' is 1 while dragging the mouse over an FS in this process (this FS or an FS in the other panel). For 'mode' 1, 'tgtFSPath' is the target path that will be used if a drop occurs; otherwise 'tgtFSPath' is NULL. 'mode' is 2 for the call that immediately follows completion of the drag&drop operation (successful or unsuccessful). virtual void WINAPI GetAllowedDropEffects(int mode, const char* tgtFSPath, DWORD* allowedEffects) = 0; - // umoznuje pluginu zmenit standardni hlaseni "There are no items in this panel." zobrazovane - // v situaci, kdy v panelu neni zadna polozka (soubor/adresar/up-dir); vraci FALSE pokud - // se ma pouzit standardni hlaseni (navratova hodnota 'textBuf' se pak ignoruje); vraci TRUE - // pokud plugin v 'textBuf' (buffer o velikosti 'textBufSize' znaku) vraci svou alternativu - // teto hlasky + // Allows the plugin to change the standard message There are no items in this panel. displayed when there is no item in the panel (file/directory/up-dir). Returns FALSE if the standard message should be used (the value in 'textBuf' is then ignored). Returns TRUE if the plugin returns its own alternative message in 'textBuf' (a buffer of size 'textBufSize' characters). virtual BOOL WINAPI GetNoItemsInPanelText(char* textBuf, int textBufSize) = 0; // Only if GetSupportedServices() returns FS_SERVICE_SHOWSECURITYINFO: @@ -767,95 +497,67 @@ class CPluginInterfaceForFSAbstract public: #endif // INSIDE_SALAMANDER - // funkce pro "file system"; vola se pro otevreni FS; 'fsName' je jmeno FS, - // ktery se ma otevrit; 'fsNameIndex' je index jmena FS, ktery se ma otevrit - // (index je nula pro fs-name zadane v CSalamanderPluginEntryAbstract::SetBasicPluginData, - // u ostatnich fs-name index vraci CSalamanderPluginEntryAbstract::AddFSName); - // vraci ukazatel na interface otevreneho FS CPluginFSInterfaceAbstract nebo - // NULL pri chybe + // File-system entry point; called to open an FS. 'fsName' is the name of the FS to open; 'fsNameIndex' is the index of the FS name to open (the index is zero for the fs-name specified in CSalamanderPluginEntryAbstract::SetBasicPluginData; for other fs-names the index is returned by CSalamanderPluginEntryAbstract::AddFSName). Returns a pointer to the interface of the opened FS, CPluginFSInterfaceAbstract, or NULL on error. virtual CPluginFSInterfaceAbstract* WINAPI OpenFS(const char* fsName, int fsNameIndex) = 0; - // funkce pro "file system", vola se pro uzavreni FS, 'fs' je ukazatel na - // interface otevreneho FS, po tomto volani uz je v Salamanderu interface 'fs' - // povazovan za neplatny a nebude dale pouzivan (funkce paruje s OpenFS) - // POZOR: v teto metode nesmi dojit k otevreni zadneho okna ani dialogu - // (okna lze otevirat v metode CPluginFSInterfaceAbstract::ReleaseObject) + // File-system entry point; called to close an FS. 'fs' is a pointer to the interface of the opened FS. After this call, the 'fs' interface is considered invalid in Salamander and will no longer be used (this function pairs with OpenFS). + // WARNING: this method must not open any window or dialog + // (windows may be opened in CPluginFSInterfaceAbstract::ReleaseObject). virtual void WINAPI CloseFS(CPluginFSInterfaceAbstract* fs) = 0; - // provedeni prikazu na polozce pro FS v Change Drive menu nebo v Drive barach - // (jeji pridani viz CSalamanderConnectAbstract::SetChangeDriveMenuItem); - // 'panel' identifikuje panel, se kterym mame pracovat - pro prikaz z Change Drive - // menu je 'panel' vzdy PANEL_SOURCE (toto menu muze byt vybaleno jen u aktivniho - // panelu), pro prikaz z Drive bary muze byt PANEL_LEFT nebo PANEL_RIGHT (pokud - // jsou zapnute dve Drive bary, muzeme pracovat i s neaktivnim panelem) + // Executes the command on an FS item in the Change Drive menu or in the Drive bars (for adding it, see CSalamanderConnectAbstract::SetChangeDriveMenuItem). 'panel' identifies the panel we should work with - for a command from the Change Drive menu, 'panel' is always PANEL_SOURCE (this menu can be opened only for the active panel); for a command from the Drive bars, 'panel' may be PANEL_LEFT or PANEL_RIGHT (if two Drive bars are enabled, we may work with the inactive panel). virtual void WINAPI ExecuteChangeDriveMenuItem(int panel) = 0; - // otevreni kontextoveho menu na polozce pro FS v Change Drive menu nebo v Drive - // barach nebo pro aktivni/odpojeny FS v Change Drive menu; 'parent' je parent - // kontextoveho menu; 'x' a 'y' jsou souradnice pro vybaleni kontextoveho menu - // (misto kliknuti praveho tlacitka mysi nebo navrzene souradnice pri Shift+F10); + // Opens a context menu on the FS item in the Change Drive menu or in the Drive + // bars, or for an active/detached FS in the Change Drive menu; 'parent' is the parent + // of the context menu; 'x' and 'y' are the coordinates for opening the context menu + // (the right-mouse-button click position or the suggested coordinates for Shift+F10); // je-li 'pluginFS' NULL jde o polozku pro FS, jinak je 'pluginFS' interface - // aktivniho/odpojeneho FS ('isDetachedFS' je FALSE/TRUE); neni-li 'pluginFS' + // of the active/detached FS ('isDetachedFS' is FALSE/TRUE); if 'pluginFS' is not // NULL, je v 'pluginFSName' jmeno FS otevreneho v 'pluginFS' (jinak je v - // 'pluginFSName' NULL) a v 'pluginFSNameIndex' index jmena FS otevreneho - // v 'pluginFS' (pro snazsi detekci o jake jmeno FS jde; jinak je v - // 'pluginFSNameIndex' -1); pokud vrati FALSE, jsou ostatni navratove hodnoty - // ignorovany, jinak maji tento vyznam: v 'refreshMenu' vraci TRUE pokud se ma - // provest obnova Change Drive menu (pro Drive bary se ignoruje, protoze se na - // nich neukazuji aktivni/odpojene FS); v 'closeMenu' vraci TRUE pokud se ma - // zavrit Change Drive menu (pro Drive bary neni co zavirat); vraci-li 'closeMenu' + // 'pluginFSName' NULL) and 'pluginFSNameIndex' contains the index of the FS name opened + // in 'pluginFS' (to make it easier to detect which FS name it is; otherwise + // 'pluginFSNameIndex' is -1); if it returns FALSE, the other return values are + // ignored; otherwise they have this meaning: 'refreshMenu' returns TRUE if the + // Change Drive menu should be refreshed (ignored for Drive bars, because active/detached FSs are not shown there); 'closeMenu' returns TRUE if the + // Change Drive menu should be closed (there is nothing to close for Drive bars); if 'closeMenu' + // is TRUE and 'postCmd' is not zero, after the Change Drive menu is closed (for Drive bars // TRUE a 'postCmd' neni nula, je po zavreni Change Drive menu (pro Drive bary - // ihned) jeste zavolano ExecuteChangeDrivePostCommand s parametry 'postCmd' - // a 'postCmdParam'; 'panel' identifikuje panel, se kterym mame pracovat - pro - // kontextove menu v Change Drive menu je 'panel' vzdy PANEL_SOURCE (toto menu - // muze byt vybaleno jen u aktivniho panelu), pro kontextove menu v Drive barach - // muze byt PANEL_LEFT nebo PANEL_RIGHT (pokud jsou zapnute dve Drive bary, muzeme - // pracovat i s neaktivnim panelem) + // immediately) ExecuteChangeDrivePostCommand is also called with parameters 'postCmd' + // and 'postCmdParam'; 'panel' identifies the panel we should work with - for a + // context menu in the Change Drive menu, 'panel' is always PANEL_SOURCE (this menu + // can be opened only for the active panel); for a context menu in the Drive bars + // 'panel' can be PANEL_LEFT or PANEL_RIGHT (if two Drive bars are enabled, we can + // work with the inactive panel as well) virtual BOOL WINAPI ChangeDriveMenuItemContextMenu(HWND parent, int panel, int x, int y, CPluginFSInterfaceAbstract* pluginFS, const char* pluginFSName, int pluginFSNameIndex, BOOL isDetachedFS, BOOL& refreshMenu, BOOL& closeMenu, int& postCmd, void*& postCmdParam) = 0; - // provedeni prikazu z kontextoveho menu na polozce pro FS nebo pro aktivni/odpojeny FS v - // Change Drive menu az po zavreni Change Drive menu nebo provedeni prikazu z kontextoveho - // menu na polozce pro FS v Drive barach (jen pro kompatibilitu s Change Drive menu); vola - // se jako reakce na navratove hodnoty 'closeMenu' (TRUE), 'postCmd' a 'postCmdParam' - // ChangeDriveMenuItemContextMenu po zavreni Change Drive menu (pro Drive bary ihned); - // 'panel' identifikuje panel, se kterym mame pracovat - pro kontextove menu v Change Drive - // menu je 'panel' vzdy PANEL_SOURCE (toto menu muze byt vybaleno jen u aktivniho panelu), - // pro kontextove menu v Drive barach muze byt PANEL_LEFT nebo PANEL_RIGHT (pokud jsou - // zapnute dve Drive bary, muzeme pracovat i s neaktivnim panelem) + // Executes a context-menu command for an FS item or for an active/detached FS in the Change Drive menu after the Change Drive menu is closed, or executes a context-menu command for an FS item in the Drive bars (only for compatibility with the Change Drive menu). It is called in response to return values 'closeMenu' (TRUE), 'postCmd', and 'postCmdParam' from ChangeDriveMenuItemContextMenu after the Change Drive menu is closed (for Drive bars, immediately). 'panel' identifies the panel we should work with - for a context menu in the Change Drive menu, 'panel' is always PANEL_SOURCE (this menu can be opened only for the active panel); for a context menu in the Drive bars, 'panel' may be PANEL_LEFT or PANEL_RIGHT (if two Drive bars are enabled, we may work with the inactive panel). virtual void WINAPI ExecuteChangeDrivePostCommand(int panel, int postCmd, void* postCmdParam) = 0; - // provede spusteni polozky v panelu s otevrenym FS (napr. reakce na klavesu Enter v panelu; - // u podadresaru/up-diru (o up-dir jde pokud je jmeno ".." a zaroven jde o prvni adresar) - // se predpoklada zmena cesty, u souboru otevreni kopie souboru na disku s tim, ze se pripadne - // zmeny nactou zpet na FS); spousteni neni mozne provest v metode FS interfacu, protoze tam - // nelze volat metody pro zmenu cesty (muze v nich totiz dojit i k zavreni FS); - // 'panel' urcuje panel, ve kterem probiha spousteni (PANEL_LEFT nebo PANEL_RIGHT); - // 'pluginFS' je interface FS otevreneho v panelu; 'pluginFSName' je jmeno FS otevreneho - // v panelu; 'pluginFSNameIndex' je index jmena FS otevreneho v panelu (pro snazsi detekci - // o jake jmeno FS jde); 'file' je spousteny soubor/adresar/up-dir ('isDir' je 0/1/2); + // Executes an item in a panel with an open FS (for example, in response to the Enter key in the panel; + // for subdirectories/up-dir (it is an up-dir if its name is .. and it is also the first directory) + // a path change is assumed; for files, a copy of the file on disk is opened and any + // changes are then loaded back to the FS); the execution cannot be performed in an FS-interface method because + // methods that change the path cannot be called there (they may close the FS); + // 'panel' specifies the panel in which the execution takes place (PANEL_LEFT or PANEL_RIGHT); + // 'pluginFS' is the interface of the FS opened in the panel; 'pluginFSName' is the FS name opened + // in the panel; 'pluginFSNameIndex' is the index of the FS name opened in the panel (to make it easier to detect + // which FS name it is); 'file' is the file/directory/up-dir being executed ('isDir' is 0/1/2); // POZOR: volani metody pro zmenu cesty v panelu muze zneplatnit 'pluginFS' (po zavreni FS) - // a 'file'+'isDir' (zmena listingu v panelu -> zruseni polozek puvodniho listingu) + // and 'file'+'isDir' may also become invalid (a changed panel listing destroys the items of the original listing) // POZNAMKA: pokud se spousti soubor nebo se s nim jinak pracuje (napr. downloadi se), - // je treba volat CSalamanderGeneralAbstract::SetUserWorkedOnPanelPath pro panel - // 'panel', jinak nebude cesta v tomto panelu vlozena do seznamu pracovnich - // adresaru - List of Working Directories (Alt+F12) + // CSalamanderGeneralAbstract::SetUserWorkedOnPanelPath must be called for panel + // 'panel', otherwise the path in this panel will not be added to the list of working + // directories - List of Working Directories (Alt+F12) virtual void WINAPI ExecuteOnFS(int panel, CPluginFSInterfaceAbstract* pluginFS, const char* pluginFSName, int pluginFSNameIndex, CFileData& file, int isDir) = 0; - // provede disconnect FS, o ktery zadazal uzivatel v Disconnect dialogu; 'parent' je - // parent pripadnych messageboxu (jde o stale jeste otevreny Disconnect dialog); - // disconnect neni mozne provest v metode FS interfacu, protoze FS ma zaniknout; - // 'isInPanel' je TRUE pokud je FS v panelu, pak 'panel' urcuje ve kterem panelu - // (PANEL_LEFT nebo PANEL_RIGHT); 'isInPanel' je FALSE pokud je FS odpojeny, pak je - // 'panel' 0; 'pluginFS' je interface FS; 'pluginFSName' je jmeno FS; 'pluginFSNameIndex' - // je index jmena FS (pro snazsi detekci o jake jmeno FS jde); metoda vraci FALSE, - // pokud se disconnect nepodaril a Disconnect dialog ma zustat otevreny (jeho obsah - // se obnovi, aby se projevily predchozi uspesne disconnecty) + // Disconnects the FS requested by the user in the Disconnect dialog; 'parent' is the parent of any message boxes (the Disconnect dialog is still open at that time). The disconnect cannot be performed in an FS-interface method because the FS is supposed to cease to exist. 'isInPanel' is TRUE if the FS is in a panel; then 'panel' specifies which panel (PANEL_LEFT or PANEL_RIGHT). 'isInPanel' is FALSE if the FS is detached; then 'panel' is 0. 'pluginFS' is the FS interface; 'pluginFSName' is the FS name; 'pluginFSNameIndex' is the index of the FS name (to make it easier to detect which FS name it is). The method returns FALSE if the disconnect fails and the Disconnect dialog should remain open (its contents are refreshed so previous successful disconnects are reflected). virtual BOOL WINAPI DisconnectFS(HWND parent, BOOL isInPanel, int panel, CPluginFSInterfaceAbstract* pluginFS, const char* pluginFSName, int pluginFSNameIndex) = 0; @@ -888,38 +590,22 @@ class CPluginInterfaceForFSAbstract #pragma option -a #endif // __BORLANDC__ -/* Predbezna verze helpu k pluginovemu interfacu - - Otevreni, zmena, listovani a refresh cesty: - - pro otevreni cesty v novem FS se vola ChangePath (prvni volani ChangePath je vzdy pro otevreni cesty) - - pro zmenu cesty se vola ChangePath (druhe a vsechny dalsi volani ChangePath jsou zmeny cesty) - - pri fatalni chybe ChangePath vraci FALSE (FS cesta se v panelu neotevre, pokud slo - o zmenu cesty, zkusi se nasledne volat ChangePath pro puvodni cestu, pokud ani to nevyjde, - dojde k prechodu na fixed-drive cestu) - - pokud ChangePath vrati TRUE (uspech) a nedoslo ke zkraceni cesty na puvodni (jejiz - listing je prave nacteny), vola se ListCurrentPath pro ziskani noveho listingu - - po uspesnem vylistovani vraci ListCurrentPath TRUE - - pri fatalni chybe vraci ListCurrentPath FALSE a nasledne volani ChangePath - musi take vratit FALSE - - pokud aktualni cesta nejde vylistovat, vraci ListCurrentPath FALSE a nasledne volani - ChangePath musi cestu zmenit a vratit TRUE (zavola se znovu ListCurrentPath), pokud jiz - cestu nejde zmenit (root, atp.), vrati ChangePath take FALSE (FS cesta se v panelu neotevre, - pokud slo o zmenu cesty, zkusi se nasledne volat ChangePath pro puvodni cestu, pokud ani to - nevyjde, dojde k prechodu na fixed-drive cestu) - - refresh cesty (Ctrl+R) se chova stejne jako zmena cesty na aktualni cestu (cesta - se vubec nemusi zmenit nebo se muze zkratit nebo v pripade fatalni chyby zmenit na - fixed-drive); pri refreshi cesty je parametr 'forceRefresh' TRUE pro vsechna volani metod - ChangePath a ListCurrentPath (FS nesmi pouzit pro zmenu cesty ani nacteni listingu zadne - cache - user nechce pouzivat cache); - - Pri pruchodu historii (back/forward) se FS interface, ve kterem probehne vylistovani - FS cesty ('fsName':'fsUserPart'), ziska prvnim moznym zpusobem z nasledujicich: - - FS interface, ve kterem byla cesta naposledy otevrena jeste nebyl zavren - a je mezi odpojenymi nebo je aktivni v panelu (neni aktivni v druhem panelu) - - aktivni FS interface v panelu ('currentFSName') je ze stejneho pluginu jako - 'fsName' a vrati na IsOurPath('currentFSName', 'fsName', 'fsUserPart') TRUE - - prvni z odpojenych FS interfacu ('currentFSName'), ktery je ze stejneho - pluginu jako 'fsName' a vrati na IsOurPath('currentFSName', 'fsName', - 'fsUserPart') TRUE - - novy FS interface -*/ +/* + * Preliminary version of the help for the plugin interface + * + * Opening, changing, listing, and refreshing a path: + * - ChangePath is called to open a path in a new FS (the first call to ChangePath is always for opening a path) + * - ChangePath is called to change a path (the second and all subsequent ChangePath calls are path changes) + * - on a fatal error, ChangePath returns FALSE (the FS path is not opened in the panel; if this was a path change, ChangePath is then called for the original path, and if that also fails, Salamander switches to a fixed-drive path) + * - if ChangePath returns TRUE (success) and the path was not shortened back to the original path (whose listing is currently loaded), ListCurrentPath is called to obtain the new listing + * - after a successful listing, ListCurrentPath returns TRUE + * - on a fatal error, ListCurrentPath returns FALSE and the following call to ChangePath must also return FALSE + * - if the current path cannot be listed, ListCurrentPath returns FALSE and the following ChangePath call must change the path and return TRUE (ListCurrentPath is then called again); if the path can no longer be changed (root, etc.), ChangePath also returns FALSE (the FS path is not opened in the panel; if this was a path change, ChangePath is then called for the original path, and if that also fails, Salamander switches to a fixed-drive path) + * - a path refresh (Ctrl+R) behaves the same as changing to the current path (the path may remain unchanged, be shortened, or, on a fatal error, change to a fixed drive); during a path refresh, parameter 'forceRefresh' is TRUE for all ChangePath and ListCurrentPath calls (the FS must not use any cache to change the path or load the listing - the user does not want cached data) + * + * When traversing history (back/forward), the FS interface in which the FS path ('fsName':'fsUserPart') is listed is obtained by the first possible method from the following: + * - the FS interface in which the path was last opened has not yet been closed and is either detached or active in a panel (not active in the other panel) + * - the active FS interface in the panel ('currentFSName') belongs to the same plugin as 'fsName' and IsOurPath('currentFSName', 'fsName', 'fsUserPart') returns TRUE + * - the first detached FS interface ('currentFSName') that belongs to the same plugin as 'fsName' and for which IsOurPath('currentFSName', 'fsName', 'fsUserPart') returns TRUE + * - a new FS interface + */ From ae49042e9f190b43fe4b13edd3ef9637adfde929 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 17:05:06 +0200 Subject: [PATCH 267/710] [translation] Fix src/plugins/shared/spl_vers.h comments (#642) --- src/plugins/shared/spl_vers.h | 52 +++++++++++++++++------------------ 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/src/plugins/shared/spl_vers.h b/src/plugins/shared/spl_vers.h index b3c6a7713..49533b7fa 100644 --- a/src/plugins/shared/spl_vers.h +++ b/src/plugins/shared/spl_vers.h @@ -34,7 +34,7 @@ #define VERSINFO_SAL_SHORT_VERSION VERSINFO_xstr(VERSINFO_SALAMANDER_MAJOR) VERSINFO_xstr(VERSINFO_SALAMANDER_MINORA) VERSINFO_xstr(VERSINFO_SALAMANDER_MINORB) VERSINFO_BETAVERSIONSHORT_TXT #endif -#ifdef VERSINFO_MAJOR // je definovane jen pokud se pouziva z pluginu +#ifdef VERSINFO_MAJOR // defined only when used from a plugin #if (VERSINFO_MINORB == 0) // omit the trailing zero in the hundredths place: 2.50 -> 2.5 #define VERSINFO_VERSION VERSINFO_xstr(VERSINFO_MAJOR) "." VERSINFO_xstr(VERSINFO_MINORA) VERSINFO_BETAVERSION_TXT #define VERSINFO_VERSION_NO_PLATFORM VERSINFO_xstr(VERSINFO_MAJOR) "." VERSINFO_xstr(VERSINFO_MINORA) VERSINFO_BETAVERSION_TXT_NO_PLATFORM @@ -93,8 +93,8 @@ // 182 - 4.0 (CB182) // 183 - 5.0 -// ! DULEZITE: nova cisla buildu je nutne zapsat do vetve "default", a pak -// teprve do vedlejsi vetve (kompletni seznam je jen v "default" vetvi) +// ! IMPORTANT: new build numbers must be added to the "default" branch first, and only then +// to the other branch (the complete list is only in the "default" branch) #define VERSINFO_BUILDNUMBER 183 // VERSINFO_BETAVERSION_TXT: @@ -117,28 +117,28 @@ // LAST_VERSION_OF_SALAMANDER: // -// Podpora pro kontrolu aktualnosti verze Salamandera, kterou interni pluginy -// (distribuovane v jednom balicku se Salamanderem) provadi behem entry-pointu -// (SalamanderPluginEntry) viz metoda CSalamanderPluginEntryAbstract::GetVersion() -// (v spl_base.h). Slouzi hlavne pro jednoduchost: interni plugin muze volat -// jakoukoliv metodu z rozhrani Salamandera, protoze po kontrole na posledni -// verzi Salamandera ma jistotu, ze ji Salamander obsahuje (hrozi mu jen load -// do novejsi verze Salamandera, ktery tyto metody musi tez obsahovat). +// Support for checking whether the Salamander version is current, performed by internal plugins +// (distributed in the same package as Salamander) during the entry point +// (SalamanderPluginEntry); see CSalamanderPluginEntryAbstract::GetVersion() +// (in spl_base.h). This is mainly for simplicity: an internal plugin can call +// any method from the Salamander interface because, after checking against the latest +// Salamander version, it knows Salamander contains it (the only remaining risk is loading +// into a newer Salamander version, which must also contain these methods). // -// Pouziva se i opacne: aby mel interni plugin jistotu, ze mu Salamander bude -// volat vsechny metody (vcetne nejnovejsich), vraci tuto verzi, jako verzi, -// pro kterou byl plugin postaven (viz export pluginu SalamanderPluginGetReqVer). +// It is also used the other way around: to ensure Salamander will call all plugin +// methods (including the newest ones), an internal plugin returns this version as the version +// it was built for (see the SalamanderPluginGetReqVer plugin export). // -// Pokud nektery plugin vraci z SalamanderPluginGetReqVer nizsi verzi nez -// LAST_VERSION_OF_SALAMANDER (pro zpetnou kompatibilitu se starsimi verzemi -// Salamandera), mel by pridat export SalamanderPluginGetSDKVer a vracet z nej -// LAST_VERSION_OF_SALAMANDER (verze SDK pouzita pro stavbu pluginu), aby mohl -// Salamander (napr. aktualni nebo novejsi) pouzivat i metody pluginu, ktere -// ve verzi vracene z SalamanderPluginGetReqVer jeste nebyly. +// If a plugin returns a version lower than LAST_VERSION_OF_SALAMANDER from +// SalamanderPluginGetReqVer (for backward compatibility with older Salamander +// versions), it should add the SalamanderPluginGetSDKVer export and return +// LAST_VERSION_OF_SALAMANDER from it (the SDK version used to build the plugin), so that +// Salamander (for example the current or a newer version) can also use plugin methods that +// were not yet present in the version returned by SalamanderPluginGetReqVer. // -// Pri zmenach v rozhrani je potreba dodrzet postup uvedeny v doc\how_to_change.txt. +// When changing the interface, follow the procedure in doc\how_to_change.txt. // -// Prehled pouzitych hodnot LAST_VERSION_OF_SALAMANDER: +// Overview of used LAST_VERSION_OF_SALAMANDER values: // 1 - 1.6 beta 4 + 5 // 2 - 1.6 beta 6 // 3 - 1.6 beta 7 @@ -155,13 +155,13 @@ // 14 - 2.5 beta 10 // 15 - 2.5 beta 10a // 16 - 2.5 beta 11 -// 17 - 2.5 beta 12 (jen interni, pustili jsme misto ni RC1) +// 17 - 2.5 beta 12 (internal only; RC1 was released instead) // 18 - 2.5 RC1 // 19 - 2.5 RC2 // 20 - 2.5 RC3 // 21 - 2.5 // 22 - 2.51 -// 23 - 2.52 beta 1 (POZOR: nekompatibilni SDK s predchozimi a dalsimi verzemi) +// 23 - 2.52 beta 1 (WARNING: SDK incompatible with previous and later versions) // 29 - 2.52 beta 2 // 31 - 2.52 // 39 - 2.53 beta 1 + 2.53 beta 1a @@ -181,9 +181,9 @@ // 76 - 3.06 // 79 - 3.07 // 81 - 3.08 -// ! DULEZITE: vsechny verze z VC2008 musi byt < 100, vsechny verze z VC2019 musi byt >= 100, -// nova cisla verzi je nutne zapsat do vetve "default", a pak -// teprve do vedlejsi vetve (kompletni seznam je jen v "default" vetvi) +// ! IMPORTANT: all VC2008 versions must be < 100, all VC2019 versions must be >= 100, +// new version numbers must be added to the "default" branch first, and only then +// to the other branch (the complete list is only in the "default" branch) // 101 - 4.0 beta 1 (DB177) // 102 - 4.0 // 103 - 5.0 From 9b01c3e13fb1a0a2f71cf2b85ee32fb52dec35e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 17:05:10 +0200 Subject: [PATCH 268/710] [translation] Fix src/plugins/shared/winliblt.cpp comments (#643) --- src/plugins/shared/winliblt.cpp | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/plugins/shared/winliblt.cpp b/src/plugins/shared/winliblt.cpp index 2a5b6c496..27790edbf 100644 --- a/src/plugins/shared/winliblt.cpp +++ b/src/plugins/shared/winliblt.cpp @@ -17,7 +17,7 @@ #endif // _MSC_VER #include #include -//#include // potrebuju HIMAGELIST +//needed for HIMAGELIST #include #ifdef __BORLANDC__ #include @@ -124,12 +124,11 @@ void ReleaseWinLib(HINSTANCE dllInstance) GlobalDeleteAtom(AtomObject); } -// // **************************************************************************** // CWindow // -// lpvParam - v pripade, ze se pri CreateWindow zavola CWindow::CWindowProc -// (je v tride okna), musi obsahovat adresu objektu vytvareneho okna +// lpvParam - if CWindow::CWindowProc is called during CreateWindow +// (it is the window class procedure), it must contain a pointer to the window object being created HWND CWindow::CreateEx(DWORD dwExStyle, // extended window style LPCTSTR lpszClassName, // address of registered class name @@ -253,7 +252,7 @@ CWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) return TRUE; } if (GetWindowLong(HWindow, GWL_STYLE) & WS_CHILD) - break; // pokud F1 nezpracujeme a pokud je to child okno, nechame F1 propadnout do parenta + break; // if F1 is not handled and this is a child window, let F1 fall through to the parent return TRUE; // if this is not a child window, stop processing F1 } } @@ -296,8 +295,8 @@ CWindow::CWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) wnd = (CWindow*)WindowsManager.GetWindowPtr(hwnd); if (wnd != NULL && wnd->Is(otWindow)) { - // Petr: posunul jsem dolu pod wnd->WindowProc(), aby behem WM_DESTROY - // jeste dochazely zpravy (potreboval Lukas) + // Petr: moved this below wnd->WindowProc() so messages are still delivered during WM_DESTROY + // (Lukas needed this) // WindowsManager.DetachWindow(hwnd); LRESULT res = wnd->WindowProc(uMsg, wParam, lParam); @@ -305,8 +304,8 @@ CWindow::CWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) // now call the old procedure again (because of subclassing) WindowsManager.DetachWindow(hwnd); - // pokud aktualni WndProc je jina nez nase, nebudeme ji menit, - // protoze nekdo v rade subclasseni uz vratil puvodni WndProc + // if the current WndProc is not ours, do not change it, + // because someone in the subclass chain has already restored the original WndProc WNDPROC currentWndProc = (WNDPROC)GetWindowLongPtr(wnd->HWindow, GWLP_WNDPROC); if (currentWndProc == CWindow::CWindowProc) SetWindowLongPtr(wnd->HWindow, GWLP_WNDPROC, (LONG_PTR)wnd->DefWndProc); @@ -526,8 +525,8 @@ CDialog::CDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) INT_PTR ret = FALSE; // in case the dialog does not handle the message if (dlg != NULL && dlg->Is(otDialog)) { - // Petr: posunul jsem dolu pod wnd->WindowProc(), aby behem WM_DESTROY - // jeste dochazely zpravy (potreboval Lukas) + // Petr: moved this below wnd->WindowProc() so messages are still delivered during WM_DESTROY + // (Lukas needed this) // WindowsManager.DetachWindow(hwndDlg); ret = dlg->DialogProc(uMsg, wParam, lParam); @@ -781,8 +780,8 @@ CPropSheetPage::CPropSheetPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, INT_PTR ret = FALSE; // in case the dialog does not handle the message if (dlg != NULL && dlg->Is(otDialog)) { - // Petr: posunul jsem dolu pod wnd->WindowProc(), aby behem WM_DESTROY - // jeste dochazely zpravy (potreboval Lukas) + // Petr: moved this below wnd->WindowProc() so messages are still delivered during WM_DESTROY + // (Lukas needed this) // WindowsManager.DetachWindow(hwndDlg); ret = dlg->DialogProc(uMsg, wParam, lParam); @@ -1131,7 +1130,7 @@ void CTransferInfo::EditLine(int ctrlID, double& value, char* format, BOOL selec s++; } if (*s == 0) - value = atof(buff); // jen pokud je cislo + value = atof(buff); // only if it is a number else value = 0; // on error, use zero break; @@ -1177,7 +1176,7 @@ void CTransferInfo::EditLine(int ctrlID, int& value, BOOL select) } char* endptr; - value = strtoul(buff, &endptr, 10); // nahrada za atoi / _ttoi, ktere misto 4000000000 vraci 2147483647 (protoze je to SIGNED INT) + value = strtoul(buff, &endptr, 10); // replacement for atoi / _ttoi, which return 2147483647 instead of 4000000000 (because they use SIGNED INT) break; } } From b71db281ca988b885d33f96834c7d816a3b91870 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 17:05:14 +0200 Subject: [PATCH 269/710] [translation] Fix src/plugins/shared/lukas/array2.h comments (#644) --- src/plugins/shared/lukas/array2.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/shared/lukas/array2.h b/src/plugins/shared/lukas/array2.h index a63cb3e80..1839edd0b 100644 --- a/src/plugins/shared/lukas/array2.h +++ b/src/plugins/shared/lukas/array2.h @@ -6,10 +6,10 @@ // **************************************************************************** // TDirectArray2: -// -pole, ktere dynamicky roste/zmensuje se po blocich (neni nutne realokovat -// jiz obsazenou pamnet, pouze se prida dalsi blok) -// -pri mazani prvku z pole se vola metoda Destructor(index_prvku), -// ktera v zakladnim objektu nic neprovadi +// -array that grows/shrinks dynamically in blocks (occupied memory does not need +// to be reallocated; only another block is added) +// -when an element is deleted from the array, Destructor(element_index) is called, +// which does nothing in the base class template class TDirectArray2 @@ -116,7 +116,7 @@ void TDirectArray2::Destroy() for (int i = 0; i < Count; i++) Destructor(i); - //if Count == BlockSize, it caused problems, + //Count == BlockSize caused problems, //so Count - 1 is used here for (DATA_TYPE** block = Blocks; block <= Blocks + (Count - 1) / BlockSize; block++) { From 40a439917d20f9f57b634466998b60e1dad2693c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 17:05:17 +0200 Subject: [PATCH 270/710] [translation] Fix src/plugins/shared/lukas/counter.h comments (#645) --- src/plugins/shared/lukas/counter.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/shared/lukas/counter.h b/src/plugins/shared/lukas/counter.h index a461b63ec..81236feeb 100644 --- a/src/plugins/shared/lukas/counter.h +++ b/src/plugins/shared/lukas/counter.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once From 382ca35de9619ee5be1cca1911361dea2e68316e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 17:05:21 +0200 Subject: [PATCH 271/710] [translation] Fix src/plugins/shared/lukas/dumpmem.h comments (#646) --- src/plugins/shared/lukas/dumpmem.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/shared/lukas/dumpmem.h b/src/plugins/shared/lukas/dumpmem.h index 57085ae5f..03f1e59a5 100644 --- a/src/plugins/shared/lukas/dumpmem.h +++ b/src/plugins/shared/lukas/dumpmem.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once From bca4f39ccc68db0ad141ea24cd2a1d43002146e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 17:05:24 +0200 Subject: [PATCH 272/710] [translation] Fix src/plugins/shared/lukas/messages.cpp comments (#647) --- src/plugins/shared/lukas/messages.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/shared/lukas/messages.cpp b/src/plugins/shared/lukas/messages.cpp index d14315811..ecec450fe 100644 --- a/src/plugins/shared/lukas/messages.cpp +++ b/src/plugins/shared/lukas/messages.cpp @@ -216,7 +216,7 @@ BOOL CMessageCenter::Init() str = Concatenate(Name, " - Startup Mutex"); if (Sender) { - // odesilatel se muze aktivovat, jedine pokud bezi prijemce + // the sender can be started only if the receiver is running StartupMutex = OpenMutex(MUTEX_ALL_ACCESS, FALSE, str); if (!StartupMutex) { From 64988bf497233aeb34ffc18bd43f6504e8ea4e98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 17:05:28 +0200 Subject: [PATCH 273/710] [translation] Fix src/plugins/shared/lukas/resedit.cpp comments (#648) --- src/plugins/shared/lukas/resedit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/shared/lukas/resedit.cpp b/src/plugins/shared/lukas/resedit.cpp index 6a0fee956..62513ecd2 100644 --- a/src/plugins/shared/lukas/resedit.cpp +++ b/src/plugins/shared/lukas/resedit.cpp @@ -697,7 +697,7 @@ void SortDirEntries(int left, int right, TIndirectArray2& entries) i++; j--; } - } while (i <= j); //musej bejt shodny? + } while (i <= j); // must they be the same? if (left < j) SortDirEntries(left, j, entries); if (i < right) From 6ce36e69994550c282fac57923b63ee573d7c146 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 17:05:32 +0200 Subject: [PATCH 274/710] [translation] Fix src/plugins/shared/lukas/resedit.h comments (#649) --- src/plugins/shared/lukas/resedit.h | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/plugins/shared/lukas/resedit.h b/src/plugins/shared/lukas/resedit.h index 15f61d476..d12e85d23 100644 --- a/src/plugins/shared/lukas/resedit.h +++ b/src/plugins/shared/lukas/resedit.h @@ -1,20 +1,19 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once -//****************************************************************************** +// ****************************************************************************** // -// metody tridy CResEdit nahrazuji API funkce BeginUpdateResource, UpdateResource, EndUpdateResource +// CResEdit class methods replace the BeginUpdateResource, UpdateResource, and EndUpdateResource API functions. // -// co neni jeste vychytany: -// - .rsrc section musi v exaci existovat -// - .rsrc section muze byt pouze na konci PE souboru, neni-li (napr. u debug verse exace) -// dojde k prepsani zbytku exace -// -nejde smazat resource z exace (v API to lze predanim hodnoty NULL parametru 'lpData' do -// funkce UpdateResource) -// -nelze blize urcit chybu, vsechny tri metody nenastavuji last error a v pripade chyby -// vraceji pouze FALSE +// Current limitations: +// - the .rsrc section must exist in the executable +// - the .rsrc section must be at the end of the PE file; otherwise (for example, in a debug build) +// the rest of the executable is overwritten +// - deleting a resource from the executable is not supported (the API allows this by passing NULL as the 'lpData' parameter to UpdateResource) +// - the exact error cannot be determined; none of the three methods sets last error, and they return only FALSE on failure class CResEditRoot { From ed3db5188143fc5114064e119306cfe16c18e6be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 17:05:35 +0200 Subject: [PATCH 275/710] [translation] Fix src/plugins/shared/lukas/utilbase.cpp comments (#650) --- src/plugins/shared/lukas/utilbase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/shared/lukas/utilbase.cpp b/src/plugins/shared/lukas/utilbase.cpp index 36afd68f5..95c480519 100644 --- a/src/plugins/shared/lukas/utilbase.cpp +++ b/src/plugins/shared/lukas/utilbase.cpp @@ -8,7 +8,7 @@ HINSTANCE DLLInstance = NULL; // Handle to the SPL - language-independent resources HINSTANCE HLanguage = NULL; // Handle to the SLG - language-dependent resources -BOOL WindowsVistaAndLater; // Windows Vista nebo pozdejsi z rady NT (6.0+) +BOOL WindowsVistaAndLater; // Windows Vista or later from the NT family (6.0+) BOOL WindowsXP64AndLater; // Windows XP 64, Vista or later (5.2+) // Open Salamander interface - valid from the InitUtils() call until From b28a7c90f018f9c30b0642ac758fd30562b1d2b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 17:05:39 +0200 Subject: [PATCH 276/710] [translation] Fix src/plugins/shared/lukas/utildlg.cpp comments (#651) --- src/plugins/shared/lukas/utildlg.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/shared/lukas/utildlg.cpp b/src/plugins/shared/lukas/utildlg.cpp index ff910b670..80197eb12 100644 --- a/src/plugins/shared/lukas/utildlg.cpp +++ b/src/plugins/shared/lukas/utildlg.cpp @@ -73,10 +73,10 @@ void HistoryComboBox(CTransferInfo& ti, int id, char* text, int textMax, // Free the removed item's memory. if (history[toMove]) delete[] history[toMove]; - // Make room for the path we are about to store. + // Make room in the history for the new path. for (i = toMove; i > 0; i--) history[i] = history[i - 1]; - // Store the path. + // Store the path in the history. strcpy(ptr, text); history[0] = ptr; } From 7140486ef2a836984cc9ae0e52545181012923e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 17:05:42 +0200 Subject: [PATCH 277/710] [translation] Fix src/plugins/shared/lukas/gdi.cpp comments (#652) --- src/plugins/shared/lukas/gdi.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/shared/lukas/gdi.cpp b/src/plugins/shared/lukas/gdi.cpp index ccd9c3abe..fa36ffc0e 100644 --- a/src/plugins/shared/lukas/gdi.cpp +++ b/src/plugins/shared/lukas/gdi.cpp @@ -1,14 +1,14 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" #include "gdi.h" // **************************************************************************** // -// CBackbufferedDC -- DC s back bufferem, pro hladke kresleni slozitejsich -// grafickych celku -// +// CBackbufferedDC -- DC with a back buffer for smooth drawing of more +// complex graphic elements CBackbufferedDC::CBackbufferedDC() { From 822c29b2bd9807bdc34d6dc665100ef4e35ce18e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 17:05:46 +0200 Subject: [PATCH 278/710] [translation] Fix src/plugins/shared/spl_base.h comments (chunk 5/7) (#653) --- src/plugins/shared/spl_base.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/plugins/shared/spl_base.h b/src/plugins/shared/spl_base.h index 8dcf95c0d..364ce7298 100644 --- a/src/plugins/shared/spl_base.h +++ b/src/plugins/shared/spl_base.h @@ -480,7 +480,7 @@ class CPluginInterfaceAbstract // called before the plugin is unloaded (naturally only if SalamanderPluginEntry returned // this object and not NULL); returns TRUE if the unload may proceed, - // 'parent' je parent messageboxu, 'force' je TRUE pokud se nebere ohled na navratovou + // 'parent' is the parent window for message boxes, 'force' is TRUE if the return // value is ignored; if it returns TRUE, this object and all other objects obtained from it // will no longer be used and the plugin will be unloaded; if a critical shutdown is in progress (see // CSalamanderGeneralAbstract::IsCriticalShutdown), nema smysl se usera na cokoliv ptat @@ -490,19 +490,19 @@ class CPluginInterfaceAbstract // have nothing left to execute => usually neither a bug report nor Windows exception info is generated) virtual BOOL WINAPI Release(HWND parent, BOOL force) = 0; - // funkce pro load defaultni konfigurace a pro "load/save configuration" (load ze soukromeho klice - // pluginu v registry), 'parent' je parent messageboxu, je-li 'regKey' == NULL, jde o - // defaultni konfiguraci, 'registry' je objekt pro praci s registry, tato metoda se vola vzdy - // po SalamanderPluginEntry a pred ostatnimi volanimi (vola se load ze soukromeho klice, je-li - // tato funkce pluginem poskytovana a klic v registry existuje, jinak vola jen load defaultni - // konfigurace) + // method for loading the default configuration and for "load/save configuration" (loading from the plugin's private + // registry key), 'parent' is the parent window for message boxes; if 'regKey' == NULL, the default + // configuration is being loaded; 'registry' is the object used to work with the registry; this method is always called + // after SalamanderPluginEntry and before other calls (loading from the private key is performed if + // this function is provided by the plugin and the registry key exists; otherwise only the default + // configuration is loaded) virtual void WINAPI LoadConfiguration(HWND parent, HKEY regKey, CSalamanderRegistryAbstract* registry) = 0; - // funkce pro "load/save configuration", vola se pro ulozeni konfigurace pluginu do jeho soukromeho - // klice v registry, 'parent' je parent messageboxu, 'registry' je objekt pro praci s registry, - // uklada-li Salamander konfiguraci, vola take tuto metodu (je-li pluginem poskytovana); Salamander - // tez nabizi ukladani konfigurace pluginu pri jeho unloadu (napr. rucne z Plugins Manageru), - // v tomto pripade se ulozeni provede jen pokud v registry existuje klic Salamandera + // method for "load/save configuration"; called to save the plugin configuration to its private + // registry key, 'parent' is the parent window for message boxes, 'registry' is the object used to work with the registry; + // when Salamander saves its configuration, it also calls this method (if the plugin provides it); Salamander + // also supports saving the plugin configuration when the plugin is unloaded (for example, manually from Plugins Manager); + // in that case, saving is performed only if Salamander's registry key exists virtual void WINAPI SaveConfiguration(HWND parent, HKEY regKey, CSalamanderRegistryAbstract* registry) = 0; // called in response to the Configuration button in the Plugins window @@ -641,7 +641,7 @@ class CPluginInterfaceAbstract // releases the 'pluginData' interface that Salamander obtained from the plugin by calling // CPluginInterfaceForArchiverAbstract::ListArchive nebo // CPluginFSInterfaceAbstract::ListCurrentPath; pred timto volanim jeste - // file and directory data (CFileData::PluginData) are also released by the methods of + // file and directory data (CFileData::PluginData) are released using methods of // CPluginDataInterfaceAbstract virtual void WINAPI ReleasePluginDataInterface(CPluginDataInterfaceAbstract* pluginData) = 0; From 2c9fc06478c2ab5aff752b844e093ff4bfda26cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 17:05:50 +0200 Subject: [PATCH 279/710] [translation] Fix src/plugins/shared/spl_base.h comments (chunk 6/7) (#654) --- src/plugins/shared/spl_base.h | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/src/plugins/shared/spl_base.h b/src/plugins/shared/spl_base.h index 364ce7298..9491fdf5a 100644 --- a/src/plugins/shared/spl_base.h +++ b/src/plugins/shared/spl_base.h @@ -647,8 +647,8 @@ class CPluginInterfaceAbstract // returns the archiver interface; the plugin must return this interface if it has // at least one of the following functions (see SetBasicPluginData): FUNCTION_PANELARCHIVERVIEW, - // FUNCTION_PANELARCHIVEREDIT, FUNCTION_CUSTOMARCHIVERPACK a/nebo FUNCTION_CUSTOMARCHIVERUNPACK; - // pokud plugin archivator neobsahuje, vraci NULL + // FUNCTION_PANELARCHIVEREDIT, FUNCTION_CUSTOMARCHIVERPACK, and/or FUNCTION_CUSTOMARCHIVERUNPACK; + // if the plugin does not contain an archiver, it returns NULL virtual CPluginInterfaceForArchiverAbstract* WINAPI GetInterfaceForArchiver() = 0; // returns the viewer interface; the plugin must return this interface if it has the function @@ -656,22 +656,22 @@ class CPluginInterfaceAbstract virtual CPluginInterfaceForViewerAbstract* WINAPI GetInterfaceForViewer() = 0; // returns the menu-extension interface; the plugin must return this interface if it adds - // polozky do menu (viz CSalamanderConnectAbstract::AddMenuItem) nebo pokud ma - // funkci (viz SetBasicPluginData) FUNCTION_DYNAMICMENUEXT; v opacnem pripade vraci NULL + // menu items (see CSalamanderConnectAbstract::AddMenuItem) or if it has the + // FUNCTION_DYNAMICMENUEXT function (see SetBasicPluginData); otherwise it returns NULL virtual CPluginInterfaceForMenuExtAbstract* WINAPI GetInterfaceForMenuExt() = 0; // returns the file-system interface; the plugin must return this interface if it has the function // (see SetBasicPluginData) FUNCTION_FILESYSTEM; if the plugin does not contain a file system, it returns NULL virtual CPluginInterfaceForFSAbstract* WINAPI GetInterfaceForFS() = 0; - // returns the thumbnail-loader interface; the plugin must return this interface if it informed - // Salamandera, ze umi nacitat thumbnaily (viz CSalamanderConnectAbstract::SetThumbnailLoader); - // pokud plugin neumi nacitat thumbnaily, vraci NULL + // returns the thumbnail-loader interface; the plugin must return this interface if it notified + // Salamander that it can load thumbnails (see CSalamanderConnectAbstract::SetThumbnailLoader); + // if the plugin cannot load thumbnails, it returns NULL virtual CPluginInterfaceForThumbLoaderAbstract* WINAPI GetInterfaceForThumbLoader() = 0; - // prijem ruznych udalosti, viz kody udalosti PLUGINEVENT_XXX; vola se jen pokud je plugin - // nacteny; 'param' je parametr udalosti - // POZOR: muze se zavolat kdykoliv po dokonceni entry-pointu pluginu (SalamanderPluginEntry) + // receives various events; see the PLUGINEVENT_XXX event codes; called only when the plugin is + // loaded; 'param' is the event parameter + // WARNING: it may be called at any time after the plugin entry point (SalamanderPluginEntry) completes virtual void WINAPI Event(int event, DWORD param) = 0; // user requested that all histories be cleared (by running Clear History from the configuration @@ -683,10 +683,10 @@ class CPluginInterfaceAbstract // clear the histories there as well virtual void WINAPI ClearHistory(HWND parent) = 0; - // prijem informace o zmene na ceste 'path' (je-li 'includingSubdirs' TRUE, tak - // zahrnuje i zmenu v podadresarich cesty 'path'); teto metody je mozne vyuzit napr. - // k invalidovani/cisteni cache souboru/adresaru; POZNAMKA: pro pluginove file-systemy (FS) - // existuje metoda CPluginFSInterfaceAbstract::AcceptChangeOnPathNotification() + // receives notification of a change on the path 'path' (if 'includingSubdirs' is TRUE, it also + // includes changes in subdirectories of 'path'); this method can be used, for example, + // to invalidate or clear file/directory caches; NOTE: plugin file systems (FS) have the + // CPluginFSInterfaceAbstract::AcceptChangeOnPathNotification() method virtual void WINAPI AcceptChangeOnPathNotification(const char* path, BOOL includingSubdirs) = 0; // this method is called only for a plugin that uses Password Manager (see @@ -696,11 +696,10 @@ class CPluginInterfaceAbstract virtual void WINAPI PasswordManagerEvent(HWND parent, int event) = 0; }; -// // **************************************************************************** // CSalamanderPluginEntryAbstract // -// sada metod ze Salamandera, ktere se pouzivaji v SalamanderPluginEntry +// set of Salamander methods used in SalamanderPluginEntry // flags indicating the reason for plugin load (see CSalamanderPluginEntryAbstract::GetLoadInformation) #define LOADINFO_INSTALL 0x0001 // first plugin load (installation into Salamander) From ee04c23168d239d75d3a3978468943889999e411 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 17:05:54 +0200 Subject: [PATCH 280/710] [translation] Fix src/plugins/shared/spl_gen.h comments (chunk 1/5) (#655) --- src/plugins/shared/spl_gen.h | 186 +++++++++++++++++------------------ 1 file changed, 93 insertions(+), 93 deletions(-) diff --git a/src/plugins/shared/spl_gen.h b/src/plugins/shared/spl_gen.h index 28c8c00f6..5f94edbe9 100644 --- a/src/plugins/shared/spl_gen.h +++ b/src/plugins/shared/spl_gen.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED //**************************************************************************** // @@ -22,13 +23,12 @@ struct CFileData; class CPluginDataInterfaceAbstract; -// // **************************************************************************** // CSalamanderGeneralAbstract // -// obecne pouzitelne metody Salamandera (pro vsechny typy pluginu) +// General-purpose Salamander methods (for all plugin types) -// typy message-boxu +// Message box types #define MSGBOX_INFO 0 #define MSGBOX_ERROR 1 #define MSGBOX_EX_ERROR 2 @@ -37,7 +37,7 @@ class CPluginDataInterfaceAbstract; #define MSGBOX_WARNING 5 #define MSGBOX_EX_WARNING 6 -// konstanty pro CSalamanderGeneralAbstract::SalMessageBoxEx +// Constants for CSalamanderGeneralAbstract::SalMessageBoxEx #define MSGBOXEX_OK 0x00000000 // MB_OK #define MSGBOXEX_OKCANCEL 0x00000001 // MB_OKCANCEL #define MSGBOXEX_ABORTRETRYIGNORE 0x00000002 // MB_ABORTRETRYIGNORE @@ -63,12 +63,12 @@ class CPluginDataInterfaceAbstract; #define MSGBOXEX_SETFOREGROUND 0x00010000 // MB_SETFOREGROUND (bit mask) // altap specific -#define MSGBOXEX_SILENT 0x10000000 // messagebox nevyda pri otevreni zadny zvuk (bit mask) -// v pripade MB_YESNO messageboxu povoli Escape (generuje IDNO); v MB_ABORTRETRYIGNORE messageboxu -// povoli Escape (generuje IDCANCEL) (bit mask) +#define MSGBOXEX_SILENT 0x10000000 // The message box does not play any sound when opened (bit mask) +// For an MB_YESNO message box, Escape is allowed (generates IDNO); for an MB_ABORTRETRYIGNORE message box, +// Escape is allowed (generates IDCANCEL) (bit mask) #define MSGBOXEX_ESCAPEENABLED 0x20000000 -#define MSGBOXEX_HINT 0x40000000 // pokud se pouziva CheckBoxText, bude v nem vyhledan oddelovac \t a zobrazen jako hint -// Vista: defaultni tlacitko bude mit stav "pozaduje elevaci" (zobrazi se elevated icon) +#define MSGBOXEX_HINT 0x40000000 // If CheckBoxText is used, a \t separator is searched for in it and displayed as a hint +// Vista: the default button will require elevation (an elevated icon is displayed) #define MSGBOXEX_SHIELDONDEFBTN 0x80000000 #define MSGBOXEX_TYPEMASK 0x0000000F // MB_TYPEMASK @@ -78,9 +78,9 @@ class CPluginDataInterfaceAbstract; #define MSGBOXEX_MISCMASK 0x0000C000 // MB_MISCMASK #define MSGBOXEX_EXMASK 0xF0000000 -// navratove hodnoty message boxu -#define DIALOG_FAIL 0x00000000 // dialog se nepodarilo otevrit -// jednotliva tlacitka +// Message box return values +#define DIALOG_FAIL 0x00000000 // The dialog could not be opened +// Individual buttons #define DIALOG_OK 0x00000001 // IDOK #define DIALOG_CANCEL 0x00000002 // IDCANCEL #define DIALOG_ABORT 0x00000003 // IDABORT @@ -242,19 +242,19 @@ URLText */ -// identifikace panelu -#define PANEL_SOURCE 1 // zdrojovy panel (aktivni panel) -#define PANEL_TARGET 2 // cilovy panel (neaktivni panel) -#define PANEL_LEFT 3 // levy panel -#define PANEL_RIGHT 4 // pravy panel +// Panel identifiers +#define PANEL_SOURCE 1 // Source panel (active panel) +#define PANEL_TARGET 2 // Target panel (inactive panel) +#define PANEL_LEFT 3 // Left panel +#define PANEL_RIGHT 4 // Right panel -// typy cest -#define PATH_TYPE_WINDOWS 1 // windowsova cesta ("c:\path" nebo UNC cesta) -#define PATH_TYPE_ARCHIVE 2 // cesta do archivu (archiv lezi na windowsove ceste) -#define PATH_TYPE_FS 3 // cesta na pluginovy file-system +// Path types +#define PATH_TYPE_WINDOWS 1 // Windows path ("c:\path" or UNC path) +#define PATH_TYPE_ARCHIVE 2 // Path inside an archive (the archive lies on a Windows path) +#define PATH_TYPE_FS 3 // Path on a plugin file system -// Z nasledujici skupiny flagu lze vybrat pouze jeden. -// Definuji sadu zobrazenych tlacitek v ruznych chybovych hlasenich. +// Only one flag from the following group can be selected. +// They define the set of buttons displayed in various error messages. #define BUTTONS_OK 0x00000000 // OK #define BUTTONS_RETRYCANCEL 0x00000001 // Retry / Cancel #define BUTTONS_SKIPCANCEL 0x00000002 // Skip / Skip all / Cancel @@ -262,7 +262,7 @@ URLText #define BUTTONS_YESALLSKIPCANCEL 0x00000004 // Yes / All / Skip / Skip all / Cancel #define BUTTONS_YESNOCANCEL 0x00000005 // Yes / No / Cancel #define BUTTONS_YESALLCANCEL 0x00000006 // Yes / All / Cancel -#define BUTTONS_MASK 0x000000FF // interni maska, nepouzivat +#define BUTTONS_MASK 0x000000FF // Internal mask, do not use // detekci zda kombinace ma tlacitko SKIP nebo YES nechavam zde ve forme inline, aby // v pripade zavadeni novych kombinaci byla dobre na ocich a nezapomeli jsme ji doplnit inline BOOL ButtonsContainsSkip(DWORD btn) @@ -278,125 +278,125 @@ inline BOOL ButtonsContainsYes(DWORD btn) (btn & BUTTONS_MASK) == BUTTONS_YESALLCANCEL; } -// chybove konstanty pro CSalamanderGeneralAbstract::SalGetFullName -#define GFN_SERVERNAMEMISSING 1 // v UNC ceste chybi server name -#define GFN_SHARENAMEMISSING 2 // v UNC ceste chybi share name -#define GFN_TOOLONGPATH 3 // operaci by vznikla prilis dlouha cesta -#define GFN_INVALIDDRIVE 4 // u normalni cesty (c:\) neni pismenko A-Z (ani a-z) -#define GFN_INCOMLETEFILENAME 5 // relativni cesta bez zadaneho 'curDir' -> neresitelne -#define GFN_EMPTYNAMENOTALLOWED 6 // prazdny retezec 'name' -#define GFN_PATHISINVALID 7 // nelze vyloucit "..", napr. "c:\.." +// Error constants for CSalamanderGeneralAbstract::SalGetFullName +#define GFN_SERVERNAMEMISSING 1 // UNC path is missing the server name +#define GFN_SHARENAMEMISSING 2 // UNC path is missing the share name +#define GFN_TOOLONGPATH 3 // The operation would produce a path that is too long +#define GFN_INVALIDDRIVE 4 // In a normal path (c:\), the drive letter is not A-Z (or a-z) +#define GFN_INCOMLETEFILENAME 5 // Relative path without a specified 'curDir' -> cannot be resolved +#define GFN_EMPTYNAMENOTALLOWED 6 // Empty 'name' string +#define GFN_PATHISINVALID 7 // Cannot rule out "..", e.g. "c:\.." -// chybovy kod pro stav, kdy uzivatel prerusi CSalamanderGeneralAbstract::SalCheckPath klavesou ESC +// Error code for the case when the user aborts CSalamanderGeneralAbstract::SalCheckPath with the ESC key #define ERROR_USER_TERMINATED -100 -#define PATH_MAX_PATH 248 // limit pro max. delku cesty (plne jmeno adresare), pozor: v limitu uz je zapocteny null-terminator (max. delka retezce je 247 znaku) +#define PATH_MAX_PATH 248 // Limit for the maximum path length (full directory name); note: the limit already includes the null terminator (the maximum string length is 247 characters) -// chybove konstanty pro CSalamanderGeneralAbstract::SalParsePath: -// vstupem byla prazdna cesta a 'curPath' bylo NULL (prazdna cesta se nahrazuje aktualni cestou, -// ale ta tu neni znama) +// Error constants for CSalamanderGeneralAbstract::SalParsePath: +// The input path was empty and 'curPath' was NULL (an empty path is replaced with the current path, +// but it is not known here) #define SPP_EMPTYPATHNOTALLOWED 1 -// windowsova cesta (normal + UNC) neexistuje, neni pristupna nebo uzivatel prerusil test -// na pristupnost cesty (soucasti je i pokus o obnoveni sit. spojeni) +// The Windows path (normal + UNC) does not exist, is not accessible, or the user aborted the path +// accessibility test (this also includes an attempt to restore the network connection) #define SPP_WINDOWSPATHERROR 2 -// windowsova cesta zacina jmenem souboru, ktery ale neni archiv (jinak by slo o cestu do archivu) +// Windows path starts with a file name that is not an archive (otherwise it would be a path inside an archive) #define SPP_NOTARCHIVEFILE 3 -// FS cesta - jmeno pluginoveho FS (fs-name - pred ':' v ceste) neni zname (zadnemu pluginu -// nebylo toto jmeno zaregistrovano) +// FS path - the plugin FS name (fs-name - before ':' in the path) is unknown (no plugin +// has registered this name) #define SPP_NOTPLUGINFS 4 -// jde o relativni cestu, ale aktualni cesta neni znama nebo jde o FS (tam nelze poznat root -// a vubec nezname strukturu fs-user-part cesty, takze nelze provest prevod na absolutni cestu) -// je-li aktualni cesta FS ('curPathIsDiskOrArchive' je FALSE), nedojde v tomto pripade ke hlaseni -// chyby uzivateli (predpoklada se dalsi zpracovani na strane FS, ktere metodu SalParsePath volalo) +// The path is relative, but the current path is unknown, or it is an FS path (there the root cannot be determined +// and the structure of the fs-user-part path is unknown, so it cannot be converted to an absolute path) +// If the current path is an FS path ('curPathIsDiskOrArchive' is FALSE), no error is reported +// to the user in this case (further processing is expected on the FS side that called SalParsePath) #define SPP_INCOMLETEPATH 5 -// konstanty vnitrnich barev Salamandera -#define SALCOL_FOCUS_ACTIVE_NORMAL 0 // barvy pera pro ramecek kolem polozky +// Internal Salamander color constants +#define SALCOL_FOCUS_ACTIVE_NORMAL 0 // Pen colors for the border around the item #define SALCOL_FOCUS_ACTIVE_SELECTED 1 #define SALCOL_FOCUS_FG_INACTIVE_NORMAL 2 #define SALCOL_FOCUS_FG_INACTIVE_SELECTED 3 #define SALCOL_FOCUS_BK_INACTIVE_NORMAL 4 #define SALCOL_FOCUS_BK_INACTIVE_SELECTED 5 -#define SALCOL_ITEM_FG_NORMAL 6 // barvy textu polozek v panelu +#define SALCOL_ITEM_FG_NORMAL 6 // Text colors of items in the panel #define SALCOL_ITEM_FG_SELECTED 7 #define SALCOL_ITEM_FG_FOCUSED 8 #define SALCOL_ITEM_FG_FOCSEL 9 #define SALCOL_ITEM_FG_HIGHLIGHT 10 -#define SALCOL_ITEM_BK_NORMAL 11 // barvy pozadi polozek v panelu +#define SALCOL_ITEM_BK_NORMAL 11 // Background colors of items in the panel #define SALCOL_ITEM_BK_SELECTED 12 #define SALCOL_ITEM_BK_FOCUSED 13 #define SALCOL_ITEM_BK_FOCSEL 14 #define SALCOL_ITEM_BK_HIGHLIGHT 15 -#define SALCOL_ICON_BLEND_SELECTED 16 // barvy pro blend ikonek +#define SALCOL_ICON_BLEND_SELECTED 16 // Icon blend colors #define SALCOL_ICON_BLEND_FOCUSED 17 #define SALCOL_ICON_BLEND_FOCSEL 18 -#define SALCOL_PROGRESS_FG_NORMAL 19 // barvy progress bary +#define SALCOL_PROGRESS_FG_NORMAL 19 // Progress bar colors #define SALCOL_PROGRESS_FG_SELECTED 20 #define SALCOL_PROGRESS_BK_NORMAL 21 #define SALCOL_PROGRESS_BK_SELECTED 22 -#define SALCOL_HOT_PANEL 23 // barva hot polozky v panelu -#define SALCOL_HOT_ACTIVE 24 // v aktivnim window caption -#define SALCOL_HOT_INACTIVE 25 // v neaktivni caption, statusbar,... -#define SALCOL_ACTIVE_CAPTION_FG 26 // barva textu v aktivnim titulku panelu -#define SALCOL_ACTIVE_CAPTION_BK 27 // barva pozadi v aktivnim titulku panelu -#define SALCOL_INACTIVE_CAPTION_FG 28 // barva textu v neaktivnim titulku panelu -#define SALCOL_INACTIVE_CAPTION_BK 29 // barva pozadi v neaktivnim titulku panelu -#define SALCOL_VIEWER_FG_NORMAL 30 // barva textu v internim text/hex vieweru -#define SALCOL_VIEWER_BK_NORMAL 31 // barva pozadi v internim text/hex vieweru -#define SALCOL_VIEWER_FG_SELECTED 32 // barva oznaceneho textu v internim text/hex vieweru -#define SALCOL_VIEWER_BK_SELECTED 33 // barva oznaceneho pozadi v internim text/hex vieweru -#define SALCOL_THUMBNAIL_NORMAL 34 // barvy pera pro ramecek kolem thumbnail +#define SALCOL_HOT_PANEL 23 // Hot item color in the panel +#define SALCOL_HOT_ACTIVE 24 // In the active window caption +#define SALCOL_HOT_INACTIVE 25 // In the inactive caption, status bar, ... +#define SALCOL_ACTIVE_CAPTION_FG 26 // Text color in the active panel title +#define SALCOL_ACTIVE_CAPTION_BK 27 // Background color in the active panel title +#define SALCOL_INACTIVE_CAPTION_FG 28 // Text color in the inactive panel title +#define SALCOL_INACTIVE_CAPTION_BK 29 // Background color in the inactive panel title +#define SALCOL_VIEWER_FG_NORMAL 30 // Text color in the internal text/hex viewer +#define SALCOL_VIEWER_BK_NORMAL 31 // Background color in the internal text/hex viewer +#define SALCOL_VIEWER_FG_SELECTED 32 // Selected text color in the internal text/hex viewer +#define SALCOL_VIEWER_BK_SELECTED 33 // Selected background color in the internal text/hex viewer +#define SALCOL_THUMBNAIL_NORMAL 34 // Pen colors for the border around the thumbnail #define SALCOL_THUMBNAIL_SELECTED 35 #define SALCOL_THUMBNAIL_FOCUSED 36 #define SALCOL_THUMBNAIL_FOCSEL 37 -// konstanty duvodu, proc metody CSalamanderGeneralAbstract::ChangePanelPathToXXX vratily neuspech: -#define CHPPFR_SUCCESS 0 // v panelu je nova cesta, uspech (navratova hodnota je TRUE) -// novou cestu (nebo jmeno archivu) nelze prevest z relativni na absolutni nebo -// nova cesta (nebo jmeno archivu) neni pristupna nebo -// cestu na FS nelze otevrit (neni plugin, odmita svuj load, odmita otevreni FS, fatalni chyba ChangePath) +// Constants for the reasons why CSalamanderGeneralAbstract::ChangePanelPathToXXX methods returned failure: +#define CHPPFR_SUCCESS 0 // The panel contains the new path; success (return value is TRUE) +// The new path (or archive name) cannot be converted from relative to absolute, or +// the new path (or archive name) is not accessible, or +// the FS path cannot be opened (no plugin, the plugin refuses to load, it refuses to open the FS, or a fatal ChangePath error occurred) #define CHPPFR_INVALIDPATH 1 -#define CHPPFR_INVALIDARCHIVE 2 // soubor neni archiv nebo se jako archiv neda vylistovat -#define CHPPFR_CANNOTCLOSEPATH 4 // aktualni cestu nelze uzavrit -// v panelu je zkracena nova cesta, -// upresneni pro FS: v panelu je bud zkracena nova cesta nebo puvodni cesta nebo zkracena -// puvodni cesta - puvodni cesta se do panelu zkousi vratit jen pokud se nova cesta otevirala -// v aktualnim FS (metoda IsOurPath pro ni vratila TRUE) a pokud nova cesta neni pristupna -// (ani zadna jeji podcesta) +#define CHPPFR_INVALIDARCHIVE 2 // The file is not an archive or cannot be listed as an archive +#define CHPPFR_CANNOTCLOSEPATH 4 // The current path cannot be closed +// The panel contains a shortened new path, +// for FS specifically: the panel contains either the shortened new path, the original path, or the shortened +// original path - the original path is restored in the panel only if the new path was opened +// in the current FS (the IsOurPath method returned TRUE for it) and the new path is not accessible +// (and neither is any of its subpaths) #define CHPPFR_SHORTERPATH 5 -// v panelu je zkracena nova cesta; duvodem zkraceni bylo to, ze pozadovana cesta byla jmeno -// souboru - v panelu je cesta k souboru a soubor bude vyfokusen +// The panel contains a shortened new path; it was shortened because the requested path was a file +// name - the panel contains the path to the file and the file will be focused #define CHPPFR_FILENAMEFOCUSED 6 -// typy pro CSalamanderGeneralAbstract::ValidateVarString() a CSalamanderGeneralAbstract::ExpandVarString() +// Types for CSalamanderGeneralAbstract::ValidateVarString() and CSalamanderGeneralAbstract::ExpandVarString() typedef const char*(WINAPI* FSalamanderVarStrGetValue)(HWND msgParent, void* param); struct CSalamanderVarStrEntry { - const char* Name; // jmeno promenne v retezci (napr. u retezce "$(name)" je to "name") - FSalamanderVarStrGetValue Execute; // funkce, ktera vraci text reprezentujici promennou + const char* Name; // Name of the variable in the string (e.g. in the string "$(name)" it is "name") + FSalamanderVarStrGetValue Execute; // Function that returns the text representing the variable }; class CSalamanderRegistryAbstract; -// typ call-backu pouzivany pri load/save konfigurace pomoci +// callback type used for configuration load/save via // CSalamanderGeneral::CallLoadOrSaveConfiguration; 'regKey' je NULL pokud jde o load // defaultni konfigurace (save se pri 'regKey' == NULL nevola); 'registry' je objekt pro -// praci s registry; 'param' je uzivatelsky parametr funkce (viz +// working with the registry; 'param' is the user-defined function parameter (see // CSalamanderGeneral::CallLoadOrSaveConfiguration) typedef void(WINAPI* FSalLoadOrSaveConfiguration)(BOOL load, HKEY regKey, CSalamanderRegistryAbstract* registry, void* param); // zaklad struktury pro CSalamanderGeneralAbstract::ViewFileInPluginViewer (kazdy plugin -// viewer muze mit tuto strukturu rozsirenou o sve parametry - struktura se predava do +// viewer can extend this structure with its own parameters - the structure is passed to // CPluginInterfaceForViewerAbstract::ViewFile - parametry muzou byt napr. titulek okna, -// mod vieweru, offset od zacatku souboru, pozice oznaceni, atp.); POZOR !!! na pakovani +// viewer mode, offset from the start of the file, selection position, etc.); WARNING: structure packing // struktur (pozadovane je 4 byty - viz "#pragma pack(4)") struct CSalamanderPluginViewerData { - // kolik bytu od zacatku struktury je platnych (pro rozliseni verzi struktury) + // Number of bytes from the start of the structure that are valid (to distinguish structure versions) int Size; - // jmeno souboru, ktery se ma otevrit ve viewru (nepouzivat v metode - // CPluginInterfaceForViewerAbstract::ViewFile - jmeno souboru je dano parametrem 'name') + // Name of the file to open in the viewer (do not use in the method + // CPluginInterfaceForViewerAbstract::ViewFile - the file name is given by the 'name' parameter) const char* FileName; }; @@ -404,13 +404,13 @@ struct CSalamanderPluginViewerData struct CSalamanderPluginInternalViewerData : public CSalamanderPluginViewerData { int Mode; // 0 - textovy mod, 1 - hexa mod - const char* Caption; // NULL -> obsahuje caption okna FileName, jinak Caption - BOOL WholeCaption; // ma vyznam pokud je Caption != NULL. TRUE -> v titulku - // vieweru bude zobrazen pouze retezec Caption; FALSE -> za - // Caption se pripoji standardni " - Viewer". + const char* Caption; // NULL -> the window caption contains FileName, otherwise Caption + BOOL WholeCaption; // Meaningful only if Caption != NULL. TRUE -> + // only the Caption string is shown in the viewer title; FALSE -> + // Caption is followed by the standard " - Viewer". }; -// konstanty typu parametru konfigurace Salamandera (viz CSalamanderGeneralAbstract::GetConfigParameter) +// Salamander configuration parameter type constants (see CSalamanderGeneralAbstract::GetConfigParameter) #define SALCFGTYPE_NOTFOUND 0 // parameter not found #define SALCFGTYPE_BOOL 1 // TRUE/FALSE #define SALCFGTYPE_INT 2 // 32-bit integer From a7d4aa6a18726f5153f6f409e10c71c6317da525 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 17:05:58 +0200 Subject: [PATCH 281/710] [translation] Fix src/plugins/shared/spl_gen.h comments (chunk 2/5) (#656) --- src/plugins/shared/spl_gen.h | 158 +++++++++++++++++------------------ 1 file changed, 79 insertions(+), 79 deletions(-) diff --git a/src/plugins/shared/spl_gen.h b/src/plugins/shared/spl_gen.h index 5f94edbe9..e8d9a306c 100644 --- a/src/plugins/shared/spl_gen.h +++ b/src/plugins/shared/spl_gen.h @@ -417,9 +417,9 @@ struct CSalamanderPluginInternalViewerData : public CSalamanderPluginViewerData #define SALCFGTYPE_STRING 3 // null-terminated multibyte string #define SALCFGTYPE_LOGFONT 4 // Win32 LOGFONT structure -// konstanty parametru konfigurace Salamandera (viz CSalamanderGeneralAbstract::GetConfigParameter); -// v komentari je uveden typ parametru (BOOL, INT, STRING), za STRING je v zavorce potrebna -// velikost bufferu pro retezec +// constants for Salamander configuration parameters (see CSalamanderGeneralAbstract::GetConfigParameter); +// the parameter type is given in the comment (BOOL, INT, STRING); for STRING, the required +// buffer size is given in parentheses // // general parameters #define SALCFG_SELOPINCLUDEDIRS 1 // BOOL, select/deselect operations (num *, num +, num -) work also with directories @@ -480,146 +480,146 @@ struct CSalamanderPluginInternalViewerData : public CSalamanderPluginViewerData #define SALCFG_VIEWERSAVEPOSITION 125 // BOOL, TRUE = save position of viewer window, FALSE = always use position of main window #define SALCFG_VIEWERFONT 126 // LOGFONT, viewer font #define SALCFG_VIEWERWRAPTEXT 127 // BOOL, wrap text (divide long text line to more lines) -#define SALCFG_AUTOCOPYSELTOCLIPBOARD 128 // BOOL, TRUE = when user selects some text, this text is instantly copied to the cliboard +#define SALCFG_AUTOCOPYSELTOCLIPBOARD 128 // BOOL, TRUE = selected text is copied to the clipboard immediately // archivers #define SALCFG_ARCOTHERPANELFORPACK 140 // BOOL, should it pack to other panel path? #define SALCFG_ARCOTHERPANELFORUNPACK 141 // BOOL, should it unpack to other panel path? #define SALCFG_ARCSUBDIRBYARCFORUNPACK 142 // BOOL, should it unpack to subdirectory named by archive? #define SALCFG_ARCUSESIMPLEICONS 143 // BOOL, should it use simple icons in archives? -// typ callbacku pouzivany v metode CSalamanderGeneral::SalSplitGeneralPath +// callback type used by CSalamanderGeneral::SalSplitGeneralPath typedef BOOL(WINAPI* SGP_IsTheSamePathF)(const char* path1, const char* path2); -// typ callbacku pouzivany v metode CSalamanderGeneralAbstract::CallPluginOperationFromDisk -// 'sourcePath' je zdrojova cesta na disku (ostatni cesty jsou od ni vztazeny relativne); -// oznacene soubory/adresare jsou zadany enumeracni funkci 'next' jejimz parametrem je -// 'nextParam'; 'param' je parametr predavany do CallPluginOperationFromDisk jako 'param' +// callback type used by CSalamanderGeneralAbstract::CallPluginOperationFromDisk +// 'sourcePath' is the source path on disk (all other paths are relative to it); +// selected files/directories are provided by the enumeration function 'next', whose parameter is +// 'nextParam'; 'param' is passed to CallPluginOperationFromDisk as 'param' typedef void(WINAPI* SalPluginOperationFromDisk)(const char* sourcePath, SalEnumSelection2 next, void* nextParam, void* param); -// flagy pro textove vyhledavaci algoritmy (CSalamanderBMSearchData a CSalamanderREGEXPSearchData); -// flagy se daji logicky scitat -#define SASF_CASESENSITIVE 0x01 // velikost pismen je dulezita (pokud neni nastaven, hleda se bez ohledu na vel. pismen) -#define SASF_FORWARD 0x02 // hledani smerem dopredu (pokud neni nastaven, hleda se smerem zpet) +// flags for text search algorithms (CSalamanderBMSearchData and CSalamanderREGEXPSearchData); +// flags can be combined with bitwise OR +#define SASF_CASESENSITIVE 0x01 // case-sensitive search (if not set, the search is case-insensitive) +#define SASF_FORWARD 0x02 // forward search (if not set, the search runs backward) -// ikony pro GetSalamanderIcon +// icons for GetSalamanderIcon #define SALICON_EXECUTABLE 1 // exe/bat/pif/com #define SALICON_DIRECTORY 2 // dir -#define SALICON_NONASSOCIATED 3 // neasociovany soubor -#define SALICON_ASSOCIATED 4 // asociovany soubor +#define SALICON_NONASSOCIATED 3 // non-associated file +#define SALICON_ASSOCIATED 4 // associated file #define SALICON_UPDIR 5 // up-dir ".." -#define SALICON_ARCHIVE 6 // archiv +#define SALICON_ARCHIVE 6 // archive -// velikosti ikon pro GetSalamanderIcon +// icon sizes for GetSalamanderIcon #define SALICONSIZE_16 1 // 16x16 #define SALICONSIZE_32 2 // 32x32 #define SALICONSIZE_48 3 // 48x48 -// interface objektu Boyer-Moorova algoritmu pro vyhledavani v textu -// POZOR: kazdy alokovany objekt je mozne pouzivat jen v ramci jednoho threadu -// (nemusi jit o hlavni thread, nemusi jit u vsech objektu o jeden thread) +// interface of the Boyer-Moore text-search object +// WARNING: each allocated object may be used only from a single thread +// (it does not have to be the main thread, and different objects may use different threads) class CSalamanderBMSearchData { public: - // nastaveni vzorku; 'pattern' je null-terminated text vzorku; 'flags' jsou priznaky - // algoritmu (viz konstanty SASF_XXX) + // sets the pattern; 'pattern' is a null-terminated pattern string; 'flags' are algorithm flags + // (see the SASF_XXX constants) virtual void WINAPI Set(const char* pattern, WORD flags) = 0; - // nastaveni vzorku; 'pattern' je binarni vzorek o delce 'length' (buffer 'pattern' musi - // mit delku alespon ('length' + 1) znaku - jen pro kompatibilitu s textovymi vzorky); - // 'flags' jsou priznaky algoritmu (viz konstanty SASF_XXX) + // sets the pattern; 'pattern' is a binary pattern of length 'length' (the 'pattern' buffer must + // be at least ('length' + 1) bytes long; this is only for compatibility with text patterns); + // 'flags' are algorithm flags (see the SASF_XXX constants) virtual void WINAPI Set(const char* pattern, const int length, WORD flags) = 0; // nastaveni priznaku algoritmu; 'flags' jsou priznaky algoritmu (viz konstanty SASF_XXX) virtual void WINAPI SetFlags(WORD flags) = 0; - // vraci delku vzorku (pouzitelne az po uspesnem volani metody Set) + // returns the pattern length (usable only after a successful call to Set) virtual int WINAPI GetLength() const = 0; - // vraci vzorek (pouzitelne az po uspesnem volani metody Set) + // returns the pattern (usable only after a successful call to Set) virtual const char* WINAPI GetPattern() const = 0; - // vraci TRUE pokud je mozne zacit vyhledavat (vzorek i priznaky byly uspesne nastaveny, - // neuspech hrozi jen pri prazdnem vzorku) + // returns TRUE if searching can start (the pattern and flags were set successfully; + // only an empty pattern can still cause failure) virtual BOOL WINAPI IsGood() const = 0; - // hledani vzorku v textu 'text' o delce 'length' od offsetu 'start' smerem dopredu; - // vraci offset nalezeneho vzorku nebo -1 pokud vzorek nebyl nalezen; - // POZOR: algoritmus musi mit nastaveny priznak SASF_FORWARD + // searches for the pattern in 'text' of length 'length' from offset 'start' forward; + // returns the offset of the found pattern, or -1 if the pattern was not found; + // WARNING: the algorithm must have the SASF_FORWARD flag set virtual int WINAPI SearchForward(const char* text, int length, int start) = 0; - // hledani vzorku v textu 'text' o delce 'length' smerem zpet (zacina hledat na konci textu); - // vraci offset nalezeneho vzorku nebo -1 pokud vzorek nebyl nalezen; - // POZOR: algoritmus nesmi mit nastaveny priznak SASF_FORWARD + // searches for the pattern in 'text' of length 'length' backward (starts searching at the end of the text); + // returns the offset of the found pattern, or -1 if the pattern was not found; + // WARNING: the algorithm must not have the SASF_FORWARD flag set virtual int WINAPI SearchBackward(const char* text, int length) = 0; }; -// interface objektu algoritmu pro vyhledavani pomoci regularnich vyrazu v textu -// POZOR: kazdy alokovany objekt je mozne pouzivat jen v ramci jednoho threadu -// (nemusi jit o hlavni thread, nemusi jit u vsech objektu o jeden thread) +// interface of the regular-expression search object +// WARNING: each allocated object may be used only from a single thread +// (it does not have to be the main thread, and different objects may use different threads) class CSalamanderREGEXPSearchData { public: - // nastaveni regularniho vyrazu; 'pattern' je null-terminated text regularniho vyrazu; 'flags' - // jsou priznaky algoritmu (viz konstanty SASF_XXX); pri chybe vraci FALSE a popis chyby - // je mozne ziskat volanim metody GetLastErrorText + // sets the regular expression; 'pattern' is a null-terminated regular-expression string; 'flags' + // are algorithm flags (see the SASF_XXX constants); returns FALSE on error, and the error text + // can be obtained by calling GetLastErrorText virtual BOOL WINAPI Set(const char* pattern, WORD flags) = 0; - // nastaveni priznaku algoritmu; 'flags' jsou priznaky algoritmu (viz konstanty SASF_XXX); - // pri chybe vraci FALSE a popis chyby je mozne ziskat volanim metody GetLastErrorText + // sets the algorithm flags; 'flags' are algorithm flags (see the SASF_XXX constants); + // returns FALSE on error, and the error text can be obtained by calling GetLastErrorText virtual BOOL WINAPI SetFlags(WORD flags) = 0; - // vraci text chyby, ktera nastala v poslednim volani Set nebo SetFlags (muze byt i NULL) + // returns the error text from the last call to Set or SetFlags (may be NULL) virtual const char* WINAPI GetLastErrorText() const = 0; - // vraci text regularniho vyrazu (pouzitelne az po uspesnem volani metody Set) + // returns the regular-expression text (usable only after a successful call to Set) virtual const char* WINAPI GetPattern() const = 0; - // nastaveni radky textu (radka je od 'start' do 'end', 'end' ukazuje za posledni znak radky), - // ve kterem se vyhledava; vraci vzdy TRUE + // sets the line to search (the line is from 'start' to 'end', and 'end' points past the last character); + // always returns TRUE virtual BOOL WINAPI SetLine(const char* start, const char* end) = 0; - // hledani podretezce odpovidajiciho regularnimu vyrazu v radce nastavene metodou SetLine; - // hleda od offsetu 'start' smerem dopredu; vraci offset nalezeneho podretezce a jeho delku - // (ve 'foundLen') nebo -1 pokud podretezec nebyl nalezen; - // POZOR: algoritmus musi mit nastaveny priznak SASF_FORWARD + // searches the line set by SetLine for a substring matching the regular expression; + // searches forward from offset 'start'; returns the offset of the found substring and its length + // (in 'foundLen'), or -1 if no substring was found; + // WARNING: the algorithm must have the SASF_FORWARD flag set virtual int WINAPI SearchForward(int start, int& foundLen) = 0; - // hledani podretezce odpovidajiciho regularnimu vyrazu v radce nastavene metodou SetLine; - // hleda smerem zpet (zacina hledat na konci textu o delce 'length' od zacatku radky); - // vraci offset nalezeneho podretezce a jeho delku (ve 'foundLen') nebo -1 pokud podretezec - // nebyl nalezen; - // POZOR: algoritmus nesmi mit nastaveny priznak SASF_FORWARD + // searches the line set by SetLine for a substring matching the regular expression; + // searches backward (starting at the end of the text segment of length 'length' from the start of the line); + // returns the offset of the found substring and its length (in 'foundLen'), or -1 if no substring + // was found; + // WARNING: the algorithm must not have the SASF_FORWARD flag set virtual int WINAPI SearchBackward(int length, int& foundLen) = 0; }; -// typy prikazu Salamandera pouzite v metode CSalamanderGeneralAbstract::EnumSalamanderCommands +// types of Salamander commands used in CSalamanderGeneralAbstract::EnumSalamanderCommands #define sctyUnknown 0 -#define sctyForFocusedFile 1 // jen pro focusly soubor (napr. View) -#define sctyForFocusedFileOrDirectory 2 // pro focusly soubor nebo adresar (napr. Open) -#define sctyForSelectedFilesAndDirectories 3 // pro oznacene/fokusle soubory a adresare (napr. Copy) -#define sctyForCurrentPath 4 // pro aktualni cestu v panelu (napr. Create Directory) -#define sctyForConnectedDrivesAndFS 5 // pro pripojene svazky a FS (napr. Disconnect) - -// prikazy Salamandera pouzite v metodach CSalamanderGeneralAbstract::EnumSalamanderCommands -// a CSalamanderGeneralAbstract::PostSalamanderCommand -// (POZOR: pro cisla prikazu je rezerovan jen interval <0, 499>) -#define SALCMD_VIEW 0 // view (klavesa F3 v panelu) -#define SALCMD_ALTVIEW 1 // alternate view (klavesa Alt+F3 v panelu) +#define sctyForFocusedFile 1 // for the focused file only (e.g. View) +#define sctyForFocusedFileOrDirectory 2 // for the focused file or directory (e.g. Open) +#define sctyForSelectedFilesAndDirectories 3 // for selected or focused files and directories (e.g. Copy) +#define sctyForCurrentPath 4 // for the current path in the panel (e.g. Create Directory) +#define sctyForConnectedDrivesAndFS 5 // for connected drives and FS (e.g. Disconnect) + +// Salamander commands used in CSalamanderGeneralAbstract::EnumSalamanderCommands +// and CSalamanderGeneralAbstract::PostSalamanderCommand +// (WARNING: only the range <0, 499> is reserved for command numbers) +#define SALCMD_VIEW 0 // view (F3 in the panel) +#define SALCMD_ALTVIEW 1 // alternate view (Alt+F3 in the panel) #define SALCMD_VIEWWITH 2 // view with (klavesa Ctrl+Shift+F3 v panelu) -#define SALCMD_EDIT 3 // edit (klavesa F4 v panelu) +#define SALCMD_EDIT 3 // edit (F4 in the panel) #define SALCMD_EDITWITH 4 // edit with (klavesa Ctrl+Shift+F4 v panelu) -#define SALCMD_OPEN 20 // open (klavesa Enter v panelu) -#define SALCMD_QUICKRENAME 21 // quick rename (klavesa F2 v panelu) +#define SALCMD_OPEN 20 // open (Enter key in the panel) +#define SALCMD_QUICKRENAME 21 // quick rename (F2 in the panel) -#define SALCMD_COPY 40 // copy (klavesa F5 v panelu) -#define SALCMD_MOVE 41 // move/rename (klavesa F6 v panelu) -#define SALCMD_EMAIL 42 // email (klavesa Ctrl+E v panelu) -#define SALCMD_DELETE 43 // delete (klavesa Delete v panelu) -#define SALCMD_PROPERTIES 44 // show properties (klavesa Alt+Enter v panelu) -#define SALCMD_CHANGECASE 45 // change case (klavesa Ctrl+F7 v panelu) -#define SALCMD_CHANGEATTRS 46 // change attributes (klavesa Ctrl+F2 v panelu) +#define SALCMD_COPY 40 // copy (F5 in the panel) +#define SALCMD_MOVE 41 // move/rename (F6 in the panel) +#define SALCMD_EMAIL 42 // email (Ctrl+E in the panel) +#define SALCMD_DELETE 43 // delete (Delete key in the panel) +#define SALCMD_PROPERTIES 44 // show properties (Alt+Enter in the panel) +#define SALCMD_CHANGECASE 45 // change case (Ctrl+F7 in the panel) +#define SALCMD_CHANGEATTRS 46 // change attributes (Ctrl+F2 in the panel) #define SALCMD_OCCUPIEDSPACE 47 // calculate occupied space (klavesa Alt+F10 v panelu) #define SALCMD_EDITNEWFILE 70 // edit new file (klavesa Shift+F4 v panelu) From 50aebf9a5772b2a59b3adbb19d6467f8d550dc7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 17:06:01 +0200 Subject: [PATCH 282/710] [translation] Fix src/plugins/shared/spl_gen.h comments (chunk 3/5) (#657) --- src/plugins/shared/spl_gen.h | 886 +++++++++++++++++------------------ 1 file changed, 443 insertions(+), 443 deletions(-) diff --git a/src/plugins/shared/spl_gen.h b/src/plugins/shared/spl_gen.h index e8d9a306c..c1dab3cd9 100644 --- a/src/plugins/shared/spl_gen.h +++ b/src/plugins/shared/spl_gen.h @@ -623,187 +623,187 @@ class CSalamanderREGEXPSearchData #define SALCMD_OCCUPIEDSPACE 47 // calculate occupied space (klavesa Alt+F10 v panelu) #define SALCMD_EDITNEWFILE 70 // edit new file (klavesa Shift+F4 v panelu) -#define SALCMD_REFRESH 71 // refresh (klavesa Ctrl+R v panelu) -#define SALCMD_CREATEDIRECTORY 72 // create directory (klavesa F7 v panelu) -#define SALCMD_DRIVEINFO 73 // drive info (klavesa Ctrl+F1 v panelu) +#define SALCMD_REFRESH 71 // refresh (Ctrl+R in a panel) +#define SALCMD_CREATEDIRECTORY 72 // create directory (F7 in a panel) +#define SALCMD_DRIVEINFO 73 // drive info (Ctrl+F1 in a panel) #define SALCMD_CALCDIRSIZES 74 // calculate directory sizes (klavesa Ctrl+Shift+F10 v panelu) #define SALCMD_DISCONNECT 90 // disconnect (network drive or plugin-fs) (klavesa F12 v panelu) -#define MAX_GROUPMASK 1001 // max. pocet znaku (vcetne nuly na konci) ve skupinove masce +#define MAX_GROUPMASK 1001 // maximum number of characters (including the terminating null) in a group mask -// identifikatory sdilenych historii (posledne pouzitych hodnot v comboboxech) pro +// Identifiers of shared histories (last values used in combo boxes) for // CSalamanderGeneral::GetStdHistoryValues() -#define SALHIST_QUICKRENAME 1 // jmena v Quick Rename dialogu (F2) -#define SALHIST_COPYMOVETGT 2 // cilove cesty v Copy/Move dialogu (F5/F6) -#define SALHIST_CREATEDIR 3 // jmena adresaru v Create Directory dialogu (F7) -#define SALHIST_CHANGEDIR 4 // cesty v Change Directory dialogu (Shift+F7) -#define SALHIST_EDITNEW 5 // jmena v Edit New dialogu (Shift+F4) -#define SALHIST_CONVERT 6 // jmena v Conver dialogu (Ctrl+K) - -// interface objektu pro praci se skupinou souborovych masek -// POZOR: metody objektu nejsou synchronizovane, takze je mozne je pouzivat jen -// v ramci jednoho threadu (nemusi jit o hlavni thread) nebo si jejich -// synchronizaci musi zajistit plugin (nesmi se provadet "zapis" behem -// provadeni jine metody; "zapis"=SetMasksString+PrepareMasks; -// provadeni "cteni" je mozne z vice threadu najednou; "cteni"=GetMasksString+ +#define SALHIST_QUICKRENAME 1 // names in the Quick Rename dialog (F2) +#define SALHIST_COPYMOVETGT 2 // target paths in the Copy/Move dialog (F5/F6) +#define SALHIST_CREATEDIR 3 // directory names in the Create Directory dialog (F7) +#define SALHIST_CHANGEDIR 4 // paths in the Change Directory dialog (Shift+F7) +#define SALHIST_EDITNEW 5 // names in the Edit New dialog (Shift+F4) +#define SALHIST_CONVERT 6 // names in the Convert dialog (Ctrl+K) + +// Interface for working with a group of file masks +// WARNING: The object's methods are not synchronized, so they may be used only +// from a single thread (it does not have to be the main thread), or the +// plugin must provide its own synchronization (no "write" may be performed +// while another method is running; "write"=SetMasksString+PrepareMasks; +// "read" operations may run from multiple threads at the same time; "read"=GetMasksString+ // AgreeMasks) // -// Zivotni cyklus objektu: +// Object lifetime: // 1) Alokujeme metodou CSalamanderGeneralAbstract::AllocSalamanderMaskGroup -// 2) V metode SetMasksString predame skupinu masek. -// 3) Zavolame PrepareMasks pro stavbu vnitrnich dat; v pripade neuspechu -// zobrazime chybne misto a po oprave masky se vracime do bodu (3) -// 4) Libovolne volame AgreeMasks pro zjisteni, zda jmeno odpovida skupine masek. -// 5) Po pripadnem zavolani SetMasksString pokracujeme od (3) +// 2) Pass the mask group to SetMasksString. +// 3) Call PrepareMasks to build the internal data; if it fails, +// show the error position and, after correcting the mask, return to step (3) +// 4) Call AgreeMasks as needed to determine whether a name matches the mask group. +// 5) After calling SetMasksString again, continue from step (3) // 6) Destrukce objektu metodou CSalamanderGeneralAbstract::FreeSalamanderMaskGroup // -// Maska: -// '?' - libovolny znak -// '*' - libovolny retezec (i prazdny) +// Mask: +// '?' - any character +// '*' - any string, including an empty one // '#' - libovolna cislice (pouze je-li 'extendedMode'==TRUE) // -// Priklady: -// * - vsechna jmena -// *.* - vsechna jmena -// *.exe - jmena s priponou "exe" -// *.t?? - jmena s priponou zacinajici znakem 't' a obsahujici jeste dva libovolne znaky -// *.r## - jmena s priponou zacinajici znakem 'r' a obsahujici jeste dve libovolne cislice +// Examples: +// * - all names +// *.* - all names +// *.exe - names with the "exe" extension +// *.t?? - names with an extension that starts with 't' and contains two more arbitrary characters +// *.r## - names with an extension that starts with 'r' and contains two more arbitrary digits // class CSalamanderMaskGroup { public: - // nastavi retezec masek (masky jsou oddelene ';' (escape sekvence pro ';' je ";;")); - // 'masks' je retezec masek (max. delka vcetne nuly na konci je MAX_GROUPMASK) - // pokud je 'extendedMode' rovno TRUE, znak '#' odpovida libovolne cislici ('0'-'9') - // jako oddelovac lze pouzit znak '|'; nasledujici masky (uz zase oddelene ';') - // budou vyhodnocovany inverzne, tedy pokud jim bude odpovidat jmeno, - // AgreeMasks vrati FALSE; znak '|' muze stat na zacatku retezce - // - // Priklady: - // *.txt;*.cpp - vsechna jmena s priponou txt nebo cpp - // *.h*|*.html - vsechna jmena s priponou zacinajici znakem 'h', ale ne jmena s priponou "html" - // |*.txt - vsechna jmena s jinou priponou nez "txt" + // Sets the mask string (masks are separated by ';' (the escape sequence for ';' is ";;")); + // 'masks' is the mask string (maximum length including the terminating null is MAX_GROUPMASK) + // if 'extendedMode' is TRUE, '#' matches any digit ('0'-'9') + // '|' may be used as a separator; the following masks (again separated by ';') + // are evaluated inversely, i.e. if a name matches them, + // AgreeMasks returns FALSE; '|' may appear at the beginning of the string + // + // Examples: + // *.txt;*.cpp - all names with the txt or cpp extension + // *.h*|*.html - all names with an extension that starts with 'h', except names with the "html" extension + // |*.txt - all names with an extension other than "txt" virtual void WINAPI SetMasksString(const char* masks, BOOL extendedMode) = 0; - // vraci retezec masek; 'buffer' je buffer o delce alespon MAX_GROUPMASK + // Returns the mask string; 'buffer' is a buffer at least MAX_GROUPMASK characters long virtual void WINAPI GetMasksString(char* buffer) = 0; - // vraci 'extendedMode' nastaveny v metode SetMasksString + // Returns the 'extendedMode' value set by SetMasksString virtual BOOL WINAPI GetExtendedMode() = 0; - // prace se souborovymi maskami: ('?' lib. znak, '*' lib. retezec - i prazdny, pokud - // byl 'extendedMode' v metode SetMasksString TRUE, '#' lib. cislice - '0'..'9'): - // 1) prevedeme masky do jednodussiho formatu; 'errorPos' vraci pozici chyby v retezci masek; - // vraci TRUE pokud nenastala chyba (vraci FALSE -> je nastaveno 'errorPos') + // Working with file masks: ('?' any character, '*' any string - including an empty one; if + // 'extendedMode' in SetMasksString was TRUE, '#' any digit - '0'..'9'): + // 1) convert the masks to a simpler format; 'errorPos' returns the error position in the mask string; + // returns TRUE if no error occurred (FALSE means 'errorPos' is set) virtual BOOL WINAPI PrepareMasks(int& errorPos) = 0; - // 2) muzeme pouzit prevedene masky na test, jestli nektere z nich odpovida soubor 'filename'; - // 'fileExt' ukazuje bud na konec 'fileName' nebo na priponu (pokud existuje), 'fileExt' - // muze byt NULL (pripona se dohledava podle std. pravidel); vraci TRUE pokud soubor - // odpovida alespon jedne z masek + // 2) we can use the converted masks to test whether any of them matches file 'fileName'; + // 'fileExt' points either to the end of 'fileName' or to the extension (if it exists); 'fileExt' + // may be NULL (the extension is found according to the standard rules); returns TRUE if the file + // matches at least one of the masks virtual BOOL WINAPI AgreeMasks(const char* fileName, const char* fileExt) = 0; }; -// interface objektu pro vypocet MD5 +// Interface for an MD5 computation object // -// Zivotni cyklus objektu: +// Object lifetime: // // 1) Alokujeme metodou CSalamanderGeneralAbstract::AllocSalamanderMD5 -// 2) Postupne volame metodu Update() pro data, pro ktere chceme vypocitat MD5 -// 3) Zavolame metodu Finalize() -// 4) Vyzvedneme vypocitanou MD5 pomoci metody GetDigest() -// 5) Pokud chceme objekt znovu pouzit, zavolame metodu Init() -// (vola se automaticky v kroku (1)) a jdeme do kroku (2) +// 2) Call Update() repeatedly for the data whose MD5 should be computed +// 3) Call Finalize() +// 4) Retrieve the computed MD5 with GetDigest() +// 5) If you want to reuse the object, call Init() +// (it is called automatically in step (1)) and continue with step (2) // 6) Destrukce objektu metodou CSalamanderGeneralAbstract::FreeSalamanderMD5 // class CSalamanderMD5 { public: - // inicializace objektu, je automaticky zavolana v konstruktoru - // metoda je publikovana pro vicenasobne pouziti alokovaneho objektu + // Initializes the object; it is called automatically in the constructor + // this method is published so the allocated object can be reused multiple times virtual void WINAPI Init() = 0; // aktualizuje vnitrni stav objektu na zaklade bloku dat urceneho promennou 'input', // 'input_length' udava velikost bufferu v bajtech virtual void WINAPI Update(const void* input, DWORD input_length) = 0; - // pripravi MD5 pro vyzvednuti pomoci metody GetDigest - // po zavolani metody Finalize lze volat pouze metodu GetDigest() a Init() + // Prepares the MD5 for retrieval by GetDigest + // after Finalize() is called, only GetDigest() and Init() may be called virtual void WINAPI Finalize() = 0; - // vyzvedne MD5, 'dest' musi ukazovat do bufferu o velikosti 16 bajtu - // metodu lze volat pouze po zavolani metody Finalize() + // Retrieves the MD5; 'dest' must point to a buffer of size 16 bytes + // this method may be called only after Finalize() has been called virtual void WINAPI GetDigest(void* dest) = 0; }; #define SALPNG_GETALPHA 0x00000002 // pri vytvareni DIB se nastavi take alpha kanal (jinak bude roven 0) -#define SALPNG_PREMULTIPLE 0x00000004 // ma vyznam, pokud je nastaveno SALPNG_GETALPHA; prednasobi RGB slozky tak, aby bylo na bitmapu mozne zavolat AlphaBlend() s BLENDFUNCTION::AlphaFormat==AC_SRC_ALPHA +#define SALPNG_PREMULTIPLE 0x00000004 // Meaningful only when SALPNG_GETALPHA is set; premultiplies the RGB components so AlphaBlend() can be called on the bitmap with BLENDFUNCTION::AlphaFormat == AC_SRC_ALPHA class CSalamanderPNGAbstract { public: - // vytvori bitmapu na zaklade PNG resource; 'hInstance' a 'lpBitmapName' specifikuji resource, - // 'flags' obsahuje 0 nebo bity z rodiny SALPNG_xxx - // v pripade uspechu vraci handle bitmapy, jinak NULL - // plugin je zodpovedny za destrukci bitmapy volanim DeleteObject() - // mozne volat z libovolneho threadu + // Creates a bitmap from a PNG resource; 'hInstance' and 'lpBitmapName' specify the resource, + // 'flags' contains 0 or bits from the SALPNG_xxx family + // returns a bitmap handle on success, otherwise NULL + // the plugin is responsible for destroying the bitmap by calling DeleteObject() + // can be called from any thread virtual HBITMAP WINAPI LoadPNGBitmap(HINSTANCE hInstance, LPCTSTR lpBitmapName, DWORD flags, COLORREF unused) = 0; - // vytvori bitmapu na zaklade PNG podaneho v pameti; 'rawPNG' je ukazatel na pamet obsahujici PNG - // (napriklad nactene ze souboru) a 'rawPNGSize' urcuje velikost pameti obsazene PNG v bajtech, - // 'flags' obsahuje 0 nebo bity z rodiny SALPNG_xxx - // v pripade uspechu vraci handle bitmapy, jinak NULL - // plugin je zodpovedny za destrukci bitmapy volanim DeleteObject() - // mozne volat z libovolneho threadu + // Creates a bitmap from PNG data supplied in memory; 'rawPNG' points to memory containing the PNG + // (for example loaded from a file) and 'rawPNGSize' specifies the size of the memory occupied by the PNG in bytes, + // 'flags' contains 0 or bits from the SALPNG_xxx family + // returns a bitmap handle on success, otherwise NULL + // the plugin is responsible for destroying the bitmap by calling DeleteObject() + // can be called from any thread virtual HBITMAP WINAPI LoadRawPNGBitmap(const void* rawPNG, DWORD rawPNGSize, DWORD flags, COLORREF unused) = 0; - // poznamka 1: nacitane PNG je vhodne komprimovat pomoci PNGSlim, viz https://forum.altap.cz/viewtopic.php?f=15&t=3278 - // poznamka 2: ukazka primeho pristupu k datum DIB viz Demoplugin, funkce AlphaBlend - // poznamka 3: podporeny jsou non-interlaced PNG typu Greyscale, Greyscale with alpha, Truecolour, Truecolour with alpha, Indexed-colour - // podminkou je 8 bitu na jeden kanal + // Note 1: it is recommended to compress loaded PNGs with PNGSlim; see https://forum.altap.cz/viewtopic.php?f=15&t=3278 + // Note 2: for an example of direct access to DIB data, see Demoplugin, function AlphaBlend + // Note 3: supported non-interlaced PNG types are Greyscale, Greyscale with alpha, Truecolour, Truecolour with alpha, and Indexed-colour + // with 8 bits per channel }; // vsechny metody je mozne volat pouze z hlavniho threadu class CSalamanderPasswordManagerAbstract { public: - // vrati TRUE, pokud uzivatel nastavil master password v konfiguraci Salamandera, jinak vrati FALSE - // (nesouvisi s tim, zda byl MP v teto session zadan) + // Returns TRUE if the user has configured a master password in Salamander; otherwise returns FALSE + // (unrelated to whether the MP was entered in this session) virtual BOOL WINAPI IsUsingMasterPassword() = 0; - // vrati TRUE, pokud uzivatel v ramci teto session Salamandera zadal korektni master password, jinak vrati FALSE + // Returns TRUE if the user has entered the correct master password in this Salamander session; otherwise returns FALSE virtual BOOL WINAPI IsMasterPasswordSet() = 0; - // zobrazi okno s predkem 'hParent' ve kterem vyzve k zadani master password - // vraci TRUE, pokud byl spravny MP zadan, jinak vrati FALSE - // pta se i v pripade, ze jiz byl master password v teto session zadan, viz IsMasterPasswordSet() - // pokud uzivatel nepouziva master password, vraci FALSE, viz IsUsingMasterPassword() + // Displays a window with parent 'hParent' that prompts for the master password + // returns TRUE if the correct MP was entered, otherwise returns FALSE + // prompts even if the master password has already been entered in this Salamander session; see IsMasterPasswordSet() + // if the user does not use a master password, returns FALSE; see IsUsingMasterPassword() virtual BOOL WINAPI AskForMasterPassword(HWND hParent) = 0; - // precte 'plainPassword' zakonceny nulou a na zaklade promenne 'encrypt' jej bud zasifruje (pokud je TRUE) pomoci AES nebo - // pouze zascrambli (pokud je FALSE); alokovany vysledek ulozi do 'encryptedPassword' a jeho velikost vrati v promenne - // 'encryptedPasswordSize'; vraci TRUE v pripade uspechu, jinak FALSE - // pokud je 'encrypt'==TRUE, musi volajici pred volani funkce zajistit, ze je zadan master password, viz AskForMasterPassword() - // poznamka: vraceny 'encryptedPassword' je alokovany na heapu Salamandera; pokud plugin nepouziva salrtl, musi buffer uvolnit - // pomoci SalamanderGeneral->Free(), jinak staci volat free(); + // Reads the null-terminated 'plainPassword' and, depending on 'encrypt', either encrypts it with AES (if TRUE) or + // only scrambles it (if FALSE); stores the allocated result in 'encryptedPassword' and returns its size in + // 'encryptedPasswordSize'; returns TRUE on success, otherwise FALSE + // if 'encrypt' == TRUE, the caller must ensure before calling the function that the master password has been entered; see AskForMasterPassword() + // note: returned 'encryptedPassword' is allocated on Salamander's heap; if the plugin does not use salrtl, it must free the buffer + // with SalamanderGeneral->Free(), otherwise free() is sufficient; virtual BOOL WINAPI EncryptPassword(const char* plainPassword, BYTE** encryptedPassword, int* encryptedPasswordSize, BOOL encrypt) = 0; - // precte 'encryptedPassword' o velikosti 'encryptedPasswordSize' a prevede ho na otevrene heslo, ktere vrati - // v alokovanem bufferu 'plainPassword'; vrati TRUE v pripade uspechu, jinak FALSE - // poznamka: vraceny 'plainPassword' je alokovany na heapu Salamandera; pokud plugin nepouziva salrtl, musi buffer uvolnit - // pomoci SalamanderGeneral->Free(), jinak staci volat free(); + // Reads 'encryptedPassword' of size 'encryptedPasswordSize' and converts it to the plain password, which is returned + // in the allocated buffer 'plainPassword'; returns TRUE on success, otherwise FALSE + // note: returned 'plainPassword' is allocated on Salamander's heap; if the plugin does not use salrtl, it must free the buffer + // with SalamanderGeneral->Free(), otherwise free() is sufficient; virtual BOOL WINAPI DecryptPassword(const BYTE* encryptedPassword, int encryptedPasswordSize, char** plainPassword) = 0; - // vrati TRUE, pokud je 'encyptedPassword' o delce 'encyptedPasswordSize' sifrovano pomoci AES; jinak vrati FALSE + // Returns TRUE if 'encyptedPassword' of length 'encyptedPasswordSize' is encrypted with AES; otherwise returns FALSE virtual BOOL WINAPI IsPasswordEncrypted(const BYTE* encyptedPassword, int encyptedPasswordSize) = 0; }; -// rezimy pro metodu CSalamanderGeneralAbstract::ExpandPluralFilesDirs +// Modes for CSalamanderGeneralAbstract::ExpandPluralFilesDirs #define epfdmNormal 0 // XXX files and YYY directories #define epfdmSelected 1 // XXX selected files and YYY selected directories #define epfdmHidden 2 // XXX hidden files and YYY hidden directories -// prikazy pro HTML help: viz metoda CSalamanderGeneralAbstract::OpenHtmlHelp +// commands for HTML help: see CSalamanderGeneralAbstract::OpenHtmlHelp enum CHtmlHelpCommand { HHCDisplayTOC, // viz HH_DISPLAY_TOC: dwData = 0 (zadny topic) nebo: pointer to a topic within a compiled help file @@ -813,7 +813,7 @@ enum CHtmlHelpCommand }; // slouzi jako parametr OpenHtmlHelpForSalamander pri command==HHCDisplayContext -#define HTMLHELP_SALID_PWDMANAGER 1 // zobrazi napovedu pro Password Manager +#define HTMLHELP_SALID_PWDMANAGER 1 // displays help for Password Manager class CPluginFSInterfaceAbstract; @@ -826,39 +826,39 @@ class CSalamanderCryptAbstract; class CSalamanderGeneralAbstract { public: - // zobrazi message-box se zadanym textem a titulkem, parent message-boxu je HWND - // vracene metodou GetMsgBoxParent() (viz nize); pouziva SalMessageBox (viz nize) + // Displays a message box with the specified text and caption; the parent window is the HWND + // returned by GetMsgBoxParent() (see below); uses SalMessageBox (see below) // type = MSGBOX_INFO - informace (ok) - // type = MSGBOX_ERROR - chybova hlaska (ok) - // type = MSGBOX_EX_ERROR - chybova hlaska (ok/cancel) - vraci IDOK, IDCANCEL - // type = MSGBOX_QUESTION - dotaz (yes/no) - vraci IDYES, IDNO - // type = MSGBOX_EX_QUESTION - dotaz (yes/no/cancel) - vraci IDYES, IDNO, IDCANCEL + // type = MSGBOX_ERROR - error message (OK) + // type = MSGBOX_EX_ERROR - error message (OK/Cancel) - returns IDOK, IDCANCEL + // type = MSGBOX_QUESTION - question (Yes/No) - returns IDYES, IDNO + // type = MSGBOX_EX_QUESTION - question (Yes/No/Cancel) - returns IDYES, IDNO, IDCANCEL // type = MSGBOX_WARNING - varovani (ok) - // type = MSGBOX_EX_WARNING - varovani (yes/no/cancel) - vraci IDYES, IDNO, IDCANCEL - // v pripade chyby vraci 0 - // omezeni: hlavni thread + // type = MSGBOX_EX_WARNING - warning (Yes/No/Cancel) - returns IDYES, IDNO, IDCANCEL + // returns 0 on error + // main thread only virtual int WINAPI ShowMessageBox(const char* text, const char* title, int type) = 0; - // SalMessageBox a SalMessageBoxEx vytvori, zobrazi a po zvoleni nektereho z tlacitek - // zavrou message box. Message box muze obsahovat uzivatelem definovany titulek, zpravu, - // tlacitka, ikonu, checkbox s nejakym textem. + // SalMessageBox and SalMessageBoxEx create, display, and close a message box after + // one of the buttons is selected. The message box can contain a user-defined caption, message, + // buttons, an icon, and a checkbox with custom text. // - // Pokud neni 'hParent' prave foreground window (msgbox v neaktivni aplikaci), dojde - // pred vybalenim msgboxu k volani FlashWindow(mainwnd, TRUE) a po zavreni msgboxu - // k volani FlashWindow(mainwnd, FALSE), mainwnd je v rade parentu okna 'hParent' to, - // ktere uz nema parenta (typicky jde o hlavni okno Salamandera). + // If 'hParent' is not currently the foreground window (message box in an inactive application), + // FlashWindow(mainwnd, TRUE) is called before the message box is shown, and + // FlashWindow(mainwnd, FALSE) is called after it is closed; mainwnd is the parent of 'hParent' + // that no longer has a parent (typically the Salamander main window). // // SalMessageBox naplni strukturu MSGBOXEX_PARAMS (hParent->HParent, lpText->Text, - // lpCaption->Caption a uType->Flags; ostatni polozky struktury vynuluje) a vola - // SalMessageBoxEx, takze dale budeme popisovat pouze SalMessageBoxEx. - // - // SalMessageBoxEx se snazi v maximalni mire chovat stejne jako Windows API funkce - // MessageBox a MessageBoxIndirect. Rozdily jsou: - // - message box je centrovany k hParent (pokud jde o child okno, dohleda se non-child parent) - // - v pripade MB_YESNO/MB_ABORTRETRYIGNORE message boxu lze povolit - // zavreni okna klavesou Escape nebo kliknutim na krizek v titulku (flag + // lpCaption->Caption and uType->Flags; all other structure members are zeroed and + // SalMessageBoxEx is then called, so only SalMessageBoxEx is described below. + // + // SalMessageBoxEx tries to behave as much as possible like the Windows API functions + // MessageBox and MessageBoxIndirect. The differences are: + // - the message box is centered on hParent (if it is a child window, the non-child parent is used) + // - for MB_YESNO/MB_ABORTRETRYIGNORE message boxes, it is possible to enable + // closing the window with Escape or by clicking the title-bar close box (flag // MSGBOXEX_ESCAPEENABLED); navratova hodnota pak bude IDNO/IDCANCEL - // - lze potlacit pipnuti (flag MSGBOXEX_SILENT) + // - the beep can be suppressed (flag MSGBOXEX_SILENT) // // Komentar k uType viz komentar k MSGBOXEX_PARAMS::Flags // @@ -877,226 +877,226 @@ class CSalamanderGeneralAbstract // DIALOG_SKIPALL 'Skip All' button was selected. // DIALOG_ALL 'All' button was selected. // - // SalMessageBox a SalMessageBoxEx je mozne volat z libovolneho threadu + // SalMessageBox and SalMessageBoxEx can be called from any thread virtual int WINAPI SalMessageBox(HWND hParent, LPCTSTR lpText, LPCTSTR lpCaption, UINT uType) = 0; virtual int WINAPI SalMessageBoxEx(const MSGBOXEX_PARAMS* params) = 0; - // vraci HWND vhodneho parenta pro otevirane message-boxy (nebo jina modalni okna), - // jde o hlavni okno, progress-dialog, Plugins/Plugins dialog nebo jine k hlavnimu oknu - // otevrene modalni okno - // omezeni: hlavni thread, vracene HWND je vzdy z hlavniho threadu + // Returns an HWND suitable as the parent for opened message boxes (or other modal windows), + // namely the main window, a progress dialog, the Plugins/Plugins dialog, or another modal window + // opened for the main window + // main thread only; the returned HWND always belongs to the main thread virtual HWND WINAPI GetMsgBoxParent() = 0; - // vraci handle hlavniho okna Salamandera - // mozne volat z libovolneho threadu + // Returns the handle of Salamander's main window + // can be called from any thread virtual HWND WINAPI GetMainWindowHWND() = 0; - // obnovi fokus v panelu nebo v command line (podle toho co bylo naposledy aktivovano); toto - // volani je potreba, pokud plugin disabluje/enabluje hlavni okno Salamandera (vznikaji tak - // situace, kdy se aktivuje disablovane hl. okno - v disablovanem okne nelze nastavit - // fokus - po enablovani hl. okna je treba fokus obnovit touto metodou) + // Restores focus to the panel or command line, depending on what was active last; this + // call is needed if a plugin disables/enables Salamander's main window (this creates + // situations where the disabled main window becomes active - focus cannot be set in a + // disabled window - after the main window is enabled again, focus must be restored with this method) virtual void WINAPI RestoreFocusInSourcePanel() = 0; - // casto pouzivane dialogy, parent dialogu 'parent', navratove hodnoty DIALOG_XXX; - // pokud neni 'parent' prave foreground window (dialog v neaktivni aplikaci), dojde - // pred vybalenim dialogu k volani FlashWindow(mainwnd, TRUE) a po zavreni dialogu - // k volani FlashWindow(mainwnd, FALSE), mainwnd je v rade parentu okna 'parent' to, - // ktere uz nema parenta (typicky jde o hlavni okno Salamandera) + // Commonly used dialogs, parent window 'parent', return values DIALOG_XXX; + // if 'parent' is not currently the foreground window (dialog in an inactive application), + // FlashWindow(mainwnd, TRUE) is called before the dialog is shown and + // FlashWindow(mainwnd, FALSE) is called after it is closed; mainwnd is the parent of 'parent' + // that no longer has a parent (typically the Salamander main window) // ERROR: filename+error+title (pokud 'title' == NULL, jde o std. titulek "Error") // - // Promenna 'flags' urcuje zobrazena tlacitka, pro DialogError lze pouzit jednu z hodnot: + // The 'flags' variable specifies the displayed buttons; DialogError accepts one of: // BUTTONS_OK // OK (old DialogError3) // BUTTONS_RETRYCANCEL // Retry / Cancel (old DialogError4) // BUTTONS_SKIPCANCEL // Skip / Skip all / Cancel (old DialogError2) // BUTTONS_RETRYSKIPCANCEL // Retry / Skip / Skip all / Cancel (old DialogError) // - // vse je mozne volat z libovolneho threadu + // all of these can be called from any thread virtual int WINAPI DialogError(HWND parent, DWORD flags, const char* fileName, const char* error, const char* title) = 0; // CONFIRM FILE OVERWRITE: filename1+filedata1+filename2+filedata2 - // Promenna 'flags' urcuje zobrazena tlacitka, pro DialogOverwrite lze pouzit jednu z hodnot: + // The 'flags' variable specifies the displayed buttons; DialogOverwrite accepts one of: // BUTTONS_YESALLSKIPCANCEL // Yes / All / Skip / Skip all / Cancel (old DialogOverwrite) // BUTTONS_YESNOCANCEL // Yes / No / Cancel (old DialogOverwrite2) virtual int WINAPI DialogOverwrite(HWND parent, DWORD flags, const char* fileName1, const char* fileData1, const char* fileName2, const char* fileData2) = 0; // QUESTION: filename+question+title (pokud 'title' == NULL, jde o std. titulek "Question") - // Promenna 'flags' urcuje zobrazena tlacitka, pro DialogQuestion lze pouzit jednu z hodnot: + // The 'flags' variable specifies the displayed buttons; DialogQuestion accepts one of: // BUTTONS_YESALLSKIPCANCEL // Yes / All / Skip / Skip all / Cancel (old DialogQuestion) // BUTTONS_YESNOCANCEL // Yes / No / Cancel (old DialogQuestion2) // BUTTONS_YESALLCANCEL // Yes / All / Cancel (old DialogQuestion3) virtual int WINAPI DialogQuestion(HWND parent, DWORD flags, const char* fileName, const char* question, const char* title) = 0; - // pokud cesta 'dir' neexistuje, umozni ji vytvorit (zepta se usera; vytvari pripadne - // i vice adresaru na konci cesty); pokud cesta existuje nebo je uspesne vytvorena vraci TRUE; - // pokud cesta neexistuje a je-li 'quiet' TRUE, nepta se usera jestli chce vytvaret - // cestu 'dir'; pokud je 'errBuf' NULL, ukazuje chyby v oknech; pokud 'errBuf' neni NULL, - // dava popis chyb do bufferu 'errBuf' o velikosti 'errBufSize' (zadna chybova okna se - // neoteviraji); vsechny otevirana okna maji za parenta 'parent', je-li 'parent' NULL, - // pouziva se hlavni okno Salamandera; neni-li 'firstCreatedDir' NULL, jde o buffer - // o velikosti MAX_PATH pro ulozeni plneho jmena prvniho vytvareneho adresare na ceste - // 'dir' (vraci prazdny retezec pokud jiz cesta 'dir' existuje); je-li 'manualCrDir' TRUE, - // nedovoli vytvorit adresar s mezerou na zacatku jmena (Windowsum to nevadi, ale je to - // potencialne nebezpecne, napr. Explorer to taky nedovoluje) - // mozne volat z libovolneho threadu + // If path 'dir' does not exist, allows it to be created (asks the user; if needed, creates + // multiple directories at the end of the path); if the path exists or is created successfully, returns TRUE; + // if the path does not exist and 'quiet' is TRUE, it does not ask the user whether the + // path 'dir' should be created; if 'errBuf' is NULL, errors are shown in windows; if 'errBuf' is not NULL, + // error descriptions are written to buffer 'errBuf' of size 'errBufSize' (no error windows are + // opened); all opened windows use 'parent' as their parent; if 'parent' is NULL, + // Salamander's main window is used; if 'firstCreatedDir' is not NULL, it is a buffer + // of size MAX_PATH for storing the full name of the first directory created on path + // 'dir' (returns an empty string if path 'dir' already exists); if 'manualCrDir' is TRUE, + // it does not allow creating a directory with a leading space in its name (Windows does not mind, but it is + // potentially dangerous; Explorer does not allow it either) + // can be called from any thread virtual BOOL WINAPI CheckAndCreateDirectory(const char* dir, HWND parent = NULL, BOOL quiet = TRUE, char* errBuf = NULL, int errBufSize = 0, char* firstCreatedDir = NULL, BOOL manualCrDir = FALSE) = 0; - // zjisti volne misto na ceste path a pokud neni >= totalSize zepta se jestli chce user pokracovat; - // okno dotazu ma parenta 'parent', vraci TRUE pokud je dost mista nebo pokud uzivatel odpovedel - // "pokracovat"; pokud neni 'parent' prave foreground window (dialog v neaktivni aplikaci), dojde - // pred vybalenim dialogu k volani FlashWindow(mainwnd, TRUE) a po zavreni dialogu - // k volani FlashWindow(mainwnd, FALSE), mainwnd je v rade parentu okna 'parent' to, - // ktere uz nema parenta (typicky jde o hlavni okno Salamandera) - // 'messageTitle' bude zobrazena v titulku messageboxu s dotazem a melo by se jednat - // o nazev pluginu, ktery metodu zavolal - // mozne volat z libovolneho threadu + // Checks free space on path 'path' and, if it is not >= totalSize, asks whether the user wants to continue; + // the question window has parent 'parent'; returns TRUE if there is enough space or if the user answered + // "continue"; if 'parent' is not currently the foreground window (dialog in an inactive application), + // FlashWindow(mainwnd, TRUE) is called before the dialog is shown and + // FlashWindow(mainwnd, FALSE) is called after it is closed; mainwnd is the parent of 'parent' + // that no longer has a parent (typically the Salamander main window) + // 'messageTitle' is shown in the title of the question message box and should be + // the name of the plugin that called the method + // can be called from any thread virtual BOOL WINAPI TestFreeSpace(HWND parent, const char* path, const CQuadWord& totalSize, const char* messageTitle) = 0; - // vraci v 'retValue' (nesmi byt NULL) volne misto na dane ceste (zatim nejkorektnejsi - // udaj, jaky se da z Windows ziskat, na NT/W2K/XP/Vista umi pracovat i s reparse pointy - // a substy (Salamander 2.5 pracuje jen s junction-pointy)); 'path' je cesta, na - // ktere zjistujeme volne misto (nemusi byt koren); neni-li 'total' NULL, vraci se v nem - // celkova velikost disku, pokud dojde k chybe, vraci CQuadWord(-1, -1) - // mozne volat z libovolneho threadu + // Returns the free space for the given path in 'retValue' ('retValue' must not be NULL) (currently the most accurate + // value that can be obtained from Windows; on NT/W2K/XP/Vista it also works with reparse points + // and SUBST drives (Salamander 2.5 works only with junction points)); 'path' is the path + // whose free space is queried (it does not have to be the root); if 'total' is not NULL, it receives + // the total disk size; if an error occurs, it returns CQuadWord(-1, -1) + // can be called from any thread virtual void WINAPI GetDiskFreeSpace(CQuadWord* retValue, const char* path, CQuadWord* total) = 0; - // vlastni klon windowsove GetDiskFreeSpace: umi zjistit korektni udaje pro cesty obsahujici - // substy a reparse pointy pod Windows 2000/XP/Vista/7 (Salamander 2.5 pracuje jen - // s junction-pointy); 'path' je cesta, na ktere zjistujeme volne misto; ostatni parametry - // odpovidaji standardni Win32 API funkci GetDiskFreeSpace + // Custom clone of Windows GetDiskFreeSpace: it can retrieve correct data for paths containing + // SUBST drives and reparse points on Windows 2000/XP/Vista/7 (Salamander 2.5 works only + // with junction points); 'path' is the path whose free space is queried; the remaining parameters + // correspond to the standard Win32 API GetDiskFreeSpace // - // POZOR: nepouzivat navratovky 'lpNumberOfFreeClusters' a 'lpTotalNumberOfClusters', protoze - // u vetsich disku jsou v nich nesmysly (DWORD nemusi stacit pro celkovy pocet clusteru), - // resit pres predchozi metodu GetDiskFreeSpace, ktera vraci 64-bitova cisla + // WARNING: do not use the return values 'lpNumberOfFreeClusters' and 'lpTotalNumberOfClusters', because + // on larger disks they contain nonsense (DWORD may not be large enough for the total number of clusters); + // use the previous GetDiskFreeSpace method instead, which returns 64-bit numbers // - // mozne volat z libovolneho threadu + // can be called from any thread virtual BOOL WINAPI SalGetDiskFreeSpace(const char* path, LPDWORD lpSectorsPerCluster, LPDWORD lpBytesPerSector, LPDWORD lpNumberOfFreeClusters, LPDWORD lpTotalNumberOfClusters) = 0; - // vlastni klon windowsove GetVolumeInformation: umi zjistit korektni udaje i pro - // cesty obsahujici substy a reparse pointy pod Windows 2000/XP/Vista (Salamander 2.5 - // pracuje jen s junction-pointy); 'path' je cesta, pro kterou zjistujeme informace; - // v 'rootOrCurReparsePoint' (neni-li NULL, musi byt alespon MAX_PATH - // znaku velky buffer) se vraci korenovy adresar nebo aktualni (posledni) lokalni reparse - // point na ceste 'path' (Salamander 2.5 vraci cestu, pro kterou se podarilo zjistit - // udaje nebo aspon korenovy adresar); ostatni parametry odpovidaji standardni Win32 API - // funkci GetVolumeInformation - // mozne volat z libovolneho threadu + // Custom clone of Windows GetVolumeInformation: it can retrieve correct data even for + // paths containing SUBST drives and reparse points on Windows 2000/XP/Vista (Salamander 2.5 + // works only with junction points); 'path' is the path whose information is queried; + // 'rootOrCurReparsePoint' (if not NULL, it must point to a buffer at least MAX_PATH + // characters long) receives the root directory or the current (last) local reparse + // point on path 'path' (Salamander 2.5 returns the path for which the information could be retrieved + // or at least the root directory); the remaining parameters correspond to the standard Win32 API + // GetVolumeInformation + // can be called from any thread virtual BOOL WINAPI SalGetVolumeInformation(const char* path, char* rootOrCurReparsePoint, LPTSTR lpVolumeNameBuffer, DWORD nVolumeNameSize, LPDWORD lpVolumeSerialNumber, LPDWORD lpMaximumComponentLength, LPDWORD lpFileSystemFlags, LPTSTR lpFileSystemNameBuffer, DWORD nFileSystemNameSize) = 0; - // vlastni klon windowsove GetDriveType: umi zjistit korektni udaje i pro cesty - // obsahujici substy a reparse pointy pod Windows 2000/XP/Vista (Salamander 2.5 - // pracuje jen s junction-pointy); 'path' je cesta, jejiz typ zjistujeme - // mozne volat z libovolneho threadu + // Custom clone of Windows GetDriveType: it can retrieve correct data even for paths + // containing SUBST drives and reparse points on Windows 2000/XP/Vista (Salamander 2.5 + // works only with junction points); 'path' is the path whose type is queried + // can be called from any thread virtual UINT WINAPI SalGetDriveType(const char* path) = 0; - // protoze windowsova GetTempFileName nefunguje, napsali jsme si vlastni klon: - // vytvori soubor/adresar (podle 'file') na ceste 'path' (NULL -> Windows TEMP dir), - // s prefixem 'prefix', vraci jmeno vytvoreneho souboru v 'tmpName' (min. velikost MAX_PATH), - // vraci uspech (pri neuspechu vraci v 'err' (neni-li NULL) kod Windows chyby) - // mozne volat z libovolneho threadu + // Because the Windows GetTempFileName does not work, we wrote our own clone: + // creates a file/directory (depending on 'file') on path 'path' (NULL -> Windows TEMP dir), + // with prefix 'prefix', returns the created file name in 'tmpName' (minimum size MAX_PATH), + // returns success (on failure, 'err' receives the Windows error code if not NULL) + // can be called from any thread virtual BOOL WINAPI SalGetTempFileName(const char* path, const char* prefix, char* tmpName, BOOL file, DWORD* err) = 0; - // odstraneni adresare vcetne jeho obsahu (SHFileOperation je priserne pomaly) - // mozne volat z libovolneho threadu + // Removes a directory including its contents (SHFileOperation is terribly slow) + // can be called from any thread virtual void WINAPI RemoveTemporaryDir(const char* dir) = 0; - // protoze windowsova verze MoveFile nezvlada prejmenovani souboru s read-only atributem na Novellu, - // napsali jsme si vlastni (nastane-li chyba pri MoveFile, zkusi shodit read-only, provest operaci, - // a pak ho zase nahodit); vraci uspech (pri neuspechu vraci v 'err' (neni-li NULL) kod Windows chyby) - // mozne volat z libovolneho threadu + // Because the Windows MoveFile cannot rename a read-only file on Novell, + // we wrote our own version (if MoveFile fails, it tries to clear read-only, perform the operation, + // and then set it back); returns success (on failure, 'err' receives the Windows error code if not NULL) + // can be called from any thread virtual BOOL WINAPI SalMoveFile(const char* srcName, const char* destName, DWORD* err) = 0; - // varianta k windowsove verzi GetFileSize (ma jednodussi osetreni chyb); 'file' je otevreny - // soubor pro volani GetFileSize(); v 'size' vraci ziskanou velikost souboru; vraci uspech, - // pri FALSE (chyba) je v 'err' windowsovy kod chyby a v 'size' nula; - // POZNAMKA: existuje varianta SalGetFileSize2(), ktera pracuje s plnym jmenem souboru - // mozne volat z libovolneho threadu + // Alternative to the Windows GetFileSize with simpler error handling; 'file' is an open + // file handle for GetFileSize(); 'size' receives the file size; returns success, + // on FALSE (error) 'err' receives the Windows error code and 'size' is zero; + // NOTE: SalGetFileSize2() exists and works with the full file name + // can be called from any thread virtual BOOL WINAPI SalGetFileSize(HANDLE file, CQuadWord& size, DWORD& err) = 0; - // otevre soubor/adresar 'name' na ceste 'path'; ridi se Windows asociacemi, otevira - // pres polozku Open v kontextovem menu (muze pouzit i salopen.exe, zalezi na konfiguraci); - // pred spustenim nastavi aktualni adresare na lokalnich discich podle panelu; - // 'parent' je parent pripadnych oken (napr. pri otevirani neasociovaneho souboru) - // omezeni: hlavni thread (jinak by nefungoval salopen.exe - pouziva jednu sdilenou pamet) + // Opens file/directory 'name' on path 'path'; follows Windows associations and opens it + // through the Open item in the context menu (it may also use salopen.exe, depending on configuration); + // before launching, it sets the current directories on local drives according to the panel; + // 'parent' is the parent of any windows that may be opened (e.g. when opening an unassociated file) + // main thread only (otherwise salopen.exe would not work - it uses one shared memory block) virtual void WINAPI ExecuteAssociation(HWND parent, const char* path, const char* name) = 0; - // otevre browse dialog, ve kterem uzivatel vybere cestu; 'parent' je parent browse dialogu; - // 'hCenterWindow' - okno, ke kteremu bude dialog centrovan; 'title' je titulek browse dialogu; - // 'comment' je komentar v browse dialogu; 'path' je buffer pro vyslednou cestu (min. MAX_PATH - // znaku); je-li 'onlyNet' TRUE, lze prochazet jen sitove cesty (jinak neni omezeno); neni-li - // 'initDit' NULL, obsahuje cestu na ktere se ma browse dialog otevrit; vraci TRUE pokud je - // v 'path' nova vybrana cesta - // POZOR: pokud se vola mimo hlavni thread, je nutne drive inicializovat COM (mozna lepe cele - // OLE - viz CoInitialize nebo OLEInitialize) - // mozne volat z libovolneho threadu + // Opens a browse dialog in which the user selects a path; 'parent' is the browse dialog parent; + // 'hCenterWindow' is the window the dialog is centered on; 'title' is the browse dialog caption; + // 'comment' is the browse dialog comment; 'path' is the output buffer for the selected path (at least MAX_PATH + // characters); if 'onlyNet' is TRUE, only network paths can be browsed (otherwise there is no restriction); if + // 'initDir' is not NULL, it contains the path where the browse dialog should open; returns TRUE if + // 'path' contains a newly selected path + // WARNING: if called outside the main thread, COM must be initialized first (possibly better the whole + // OLE - see CoInitialize or OLEInitialize) + // can be called from any thread virtual BOOL WINAPI GetTargetDirectory(HWND parent, HWND hCenterWindow, const char* title, const char* comment, char* path, BOOL onlyNet, const char* initDir) = 0; - // prace se souborovymi maskami: ('?' lib. znak, '*' lib. retezec - i prazdny) - // vse je mozne volat z libovolneho threadu - // 1) prevedeme masku do jednodussiho formatu (src -> bufferu mask - min. velikost - // bufferu 'mask' je (strlen(src) + 1)) + // Working with file masks: ('?' any character, '*' any string - including an empty one) + // all of this can be called from any thread + // 1) convert the mask to a simpler format (src -> buffer mask; minimum size of + // buffer 'mask' is strlen(src) + 1) virtual void WINAPI PrepareMask(char* mask, const char* src) = 0; - // 2) muzeme pouzit prevedenou masku na test, jestli ji odpovida soubor filename, - // hasExtension = TRUE pokud soubor ma priponu - // vraci TRUE pokud soubor odpovida masce + // 2) we can use the converted mask to test whether it matches file 'filename', + // hasExtension = TRUE if the file has an extension + // returns TRUE if the file matches the mask virtual BOOL WINAPI AgreeMask(const char* filename, const char* mask, BOOL hasExtension) = 0; - // 3) neupravenou masku (nevolat pro ni PrepareMask) muzeme pouzit k vytvoreni jmena podle - // zadaneho jmena a masky ("a.txt" + "*.cpp" -> "a.cpp" atd.), - // buffer by mel byt velky alespon strlen(name)+strlen(mask) (hodi se 2*MAX_PATH) - // vraci vytvorene jmeno (ukazatel 'buffer') + // 3) we can use the unmodified mask (do not call PrepareMask for it) to create a name from + // the specified name and mask ("a.txt" + "*.cpp" -> "a.cpp", etc.), + // buffer should be at least strlen(name)+strlen(mask) bytes long (2*MAX_PATH works well) + // returns the created name (pointer 'buffer') virtual char* WINAPI MaskName(char* buffer, int bufSize, const char* name, const char* mask) = 0; - // prace s rozsirenymi souborovymi maskami: ('?' lib. znak, '*' lib. retezec - i prazdny, - // '#' lib. cislice - '0'..'9') - // vse je mozne volat z libovolneho threadu - // 1) prevedeme masku do jednodussiho formatu (src -> bufferu mask - min. delka strlen(src) + 1) + // Working with extended file masks: ('?' any character, '*' any string - including an empty one, + // '#' any digit - '0'..'9') + // all of this can be called from any thread + // 1) convert the mask to a simpler format (src -> buffer mask; minimum length strlen(src) + 1) virtual void WINAPI PrepareExtMask(char* mask, const char* src) = 0; - // 2) muzeme pouzit prevedenou masku na test, jestli ji odpovida soubor filename, - // hasExtension = TRUE pokud soubor ma priponu - // vraci TRUE pokud soubor odpovida masce + // 2) we can use the converted mask to test whether it matches file 'filename', + // hasExtension = TRUE if the file has an extension + // returns TRUE if the file matches the mask virtual BOOL WINAPI AgreeExtMask(const char* filename, const char* mask, BOOL hasExtension) = 0; - // alokuje novy objekt pro praci se skupinou souborovych masek - // mozne volat z libovolneho threadu + // Allocates a new object for working with a group of file masks + // can be called from any thread virtual CSalamanderMaskGroup* WINAPI AllocSalamanderMaskGroup() = 0; - // uvolni objekt pro praci se skupinou souborovych masek (ziskany metodou AllocSalamanderMaskGroup) - // mozne volat z libovolneho threadu + // Frees an object for working with a group of file masks (obtained by AllocSalamanderMaskGroup) + // can be called from any thread virtual void WINAPI FreeSalamanderMaskGroup(CSalamanderMaskGroup* maskGroup) = 0; - // alokace pameti na heapu Salamandera (pri pouziti salrtl9.dll zbytecne - staci klasicky malloc); - // pri nedostatku pameti se zobrazi uzivateli hlaseni s tlacitky Retry (dalsi pokus o alokaci), - // Abort (po dalsim dotazu terminuje aplikaci) a Ignore (pusteni chyby alokace do aplikace - po - // upozorneni uzivatele, ze aplikace muze spadnout, vrati Alloc NULL; - // osetreni na NULL ma smysl asi jen pro velke bloky pameti, napr. vic nez 500 MB, zde hrozi, - // ze alokace nebude mozna z duvodu fragmentace adresniho prostoru nactenymi DLL knihovnami); - // POZNAMKA: Realloc() byl pridan pozdeji, je nize v tomto modulu - // mozne volat z libovolneho threadu + // Allocates memory on Salamander's heap (unnecessary when using salrtl9.dll - plain malloc is enough); + // if memory is low, the user is shown a dialog with Retry (another allocation attempt), + // Abort (after another prompt, terminates the application), and Ignore (lets the allocation error reach the application - after + // warning the user that the application may crash, Alloc returns NULL; + // checking for NULL probably makes sense only for large memory blocks, e.g. more than 500 MB, where + // allocation may fail because the address space is fragmented by loaded DLLs); + // NOTE: Realloc() was added later; it is listed below in this module + // can be called from any thread virtual void* WINAPI Alloc(int size) = 0; - // dealokace pameti z heapu Salamandera (pri pouziti salrtl9.dll zbytecne - staci klasicky free) - // mozne volat z libovolneho threadu + // Deallocates memory from Salamander's heap (unnecessary when using salrtl9.dll - plain free is enough) + // can be called from any thread virtual void WINAPI Free(void* ptr) = 0; - // duplikace stringu - alokace pameti (na heapu Salamadera - heapu dostupnem pres salrtl9.dll) - // + kopie stringu; pri 'str'==NULL vraci NULL; - // mozne volat z libovolneho threadu + // Duplicates a string - allocates memory (on Salamander's heap - available through salrtl9.dll) + // + copies the string; returns NULL if 'str' == NULL; + // can be called from any thread virtual char* WINAPI DupStr(const char* str) = 0; - // vraci mapovaci tabulku na mala a velka pismena (pole 256 znaku - male/velke pismeno na - // indexu zjistovaneho pismene); neni-li 'lowerCase' NULL, vraci se v nem tabulka malych pismen; - // neni-li 'upperCase' NULL, vraci se v nem tabulka velkych pismen - // mozne volat z libovolneho threadu + // Returns the lowercase and uppercase mapping tables (an array of 256 characters - the lowercase/uppercase character is at + // the index of the queried character); if 'lowerCase' is not NULL, it receives the lowercase table; + // if 'upperCase' is not NULL, it receives the uppercase table + // can be called from any thread virtual void WINAPI GetLowerAndUpperCase(unsigned char** lowerCase, unsigned char** upperCase) = 0; // prevod retezce 'str' na mala/velka pismena; narozdil od ANSI C tolower/toupper pracuje @@ -1231,173 +1231,173 @@ class CSalamanderGeneralAbstract // Method can be called from any thread. virtual int WINAPI MemICmp(const void* buf1, const void* buf2, int n) = 0; - // porovnani dvou retezcu 's1' a 's2' bez ohledu na velikost pismen (ignore-case), + // Case-insensitive comparison of strings 's1' and 's2'; // je-li SALCFG_SORTUSESLOCALE TRUE, pouziva razeni podle regionalniho nastaveni Windows, - // jinak porovnava stejne jako CSalamanderGeneral::StrICmp, je-li SALCFG_SORTDETECTNUMBERS + // otherwise it compares them the same way as CSalamanderGeneral::StrICmp; if SALCFG_SORTDETECTNUMBERS // TRUE, pouziva ciselne razeni pro cisla obsazene v retezcich - // vraci <0 ('s1' < 's2'), ==0 ('s1' == 's2'), >0 ('s1' > 's2') + // returns <0 ('s1' < 's2'), ==0 ('s1' == 's2'), >0 ('s1' > 's2') virtual int WINAPI RegSetStrICmp(const char* s1, const char* s2) = 0; - // porovnani dvou retezcu 's1' a 's2' (o delkach 'l1' a 'l2') bez ohledu na velikost + // Compares strings 's1' and 's2' (with lengths 'l1' and 'l2') case-insensitively. // pismen (ignore-case), je-li SALCFG_SORTUSESLOCALE TRUE, pouziva razeni podle - // regionalniho nastaveni Windows, jinak porovnava stejne jako CSalamanderGeneral::StrICmp, + // Windows regional settings; otherwise it compares them the same way as CSalamanderGeneral::StrICmp, // je-li SALCFG_SORTDETECTNUMBERS TRUE, pouziva ciselne razeni pro cisla obsazene - // v retezcich; v 'numericalyEqual' (neni-li NULL) vraci TRUE, pokud jsou retezce - // numericky shodne (napr. "a01" a "a1"), je automaticky TRUE pokud jsou retezce shodne - // vraci <0 ('s1' < 's2'), ==0 ('s1' == 's2'), >0 ('s1' > 's2') + // in the strings; if 'numericalyEqual' is not NULL, it returns TRUE if the strings are + // numerically equal (for example, "a01" and "a1"); it is automatically TRUE if the strings are equal + // returns <0 ('s1' < 's2'), ==0 ('s1' == 's2'), >0 ('s1' > 's2') virtual int WINAPI RegSetStrICmpEx(const char* s1, int l1, const char* s2, int l2, BOOL* numericalyEqual) = 0; - // porovnani (case-sensitive) dvou retezcu 's1' a 's2', je-li SALCFG_SORTUSESLOCALE TRUE, - // pouziva razeni podle regionalniho nastaveni Windows, jinak porovnava stejne jako - // standardni C knihovni funkce strcmp, je-li SALCFG_SORTDETECTNUMBERS TRUE, pouziva - // ciselne razeni pro cisla obsazene v retezcich - // vraci <0 ('s1' < 's2'), ==0 ('s1' == 's2'), >0 ('s1' > 's2') + // Case-sensitive comparison of strings 's1' and 's2'; if SALCFG_SORTUSESLOCALE is TRUE, + // Windows regional collation is used; otherwise they are compared the same way as the + // standard C library function strcmp; if SALCFG_SORTDETECTNUMBERS is TRUE, numeric sorting is used + // for numbers contained in the strings + // returns <0 ('s1' < 's2'), ==0 ('s1' == 's2'), >0 ('s1' > 's2') virtual int WINAPI RegSetStrCmp(const char* s1, const char* s2) = 0; - // porovnani (case-sensitive) dvou retezcu 's1' a 's2' (o delkach 'l1' a 'l2'), je-li + // Case-sensitive comparison of strings 's1' and 's2' (with lengths 'l1' and 'l2'); if // SALCFG_SORTUSESLOCALE TRUE, pouziva razeni podle regionalniho nastaveni Windows, - // jinak porovnava stejne jako standardni C knihovni funkce strcmp, je-li + // otherwise it compares them the same way as the standard C library function strcmp; if // SALCFG_SORTDETECTNUMBERS TRUE, pouziva ciselne razeni pro cisla obsazene v retezcich; - // v 'numericalyEqual' (neni-li NULL) vraci TRUE, pokud jsou retezce numericky shodne - // (napr. "a01" a "a1"), je automaticky TRUE pokud jsou retezce shodne - // vraci <0 ('s1' < 's2'), ==0 ('s1' == 's2'), >0 ('s1' > 's2') + // in 'numericalyEqual' (if not NULL), it returns TRUE if the strings are numerically equal + // (e.g. "a01" and "a1"); it is automatically TRUE if the strings are equal + // returns <0 ('s1' < 's2'), ==0 ('s1' == 's2'), >0 ('s1' > 's2') virtual int WINAPI RegSetStrCmpEx(const char* s1, int l1, const char* s2, int l2, BOOL* numericalyEqual) = 0; - // vraci cestu v panelu; 'panel' je jeden z PANEL_XXX; 'buffer' je buffer pro cestu (muze - // byt i NULL); 'bufferSize' je velikost bufferu 'buffer' (je-li 'buffer' NULL, musi zde - // byt nula); 'type' neni-li NULL ukazuje na promennou, do ktere se ulozi typ cesty - // (viz PATH_TYPE_XXX); pokud jde o archiv a 'archiveOrFS' neni NULL a 'buffer' neni NULL, - // vraci 'archiveOrFS' nastavene do 'buffer' na pozici za soubor archivu; - // pokud jde o file-system a 'archiveOrFS' neni NULL a 'buffer' neni NULL, vraci - // 'archiveOrFS' nastavene do 'buffer' na ':' za nazvem file-systemu (za ':' je user-part - // cesty file-systemu); je-li 'convertFSPathToExternal' TRUE a v panelu je cesta na FS, - // najde se plugin jehoz cesta je (podle fs-name) a zavola se jeho - // CPluginInterfaceForFSAbstract::ConvertPathToExternal(); vraci uspech (neni-li - // 'bufferSize'==0, povazuje se za neuspech i to, kdyz se cesta nevejde do bufferu + // Returns the path in the panel; 'panel' is one of PANEL_XXX; 'buffer' is the path buffer (it may + // be NULL); 'bufferSize' is the size of buffer 'buffer' (if 'buffer' is NULL, it must + // be zero); if 'type' is not NULL, it points to a variable that receives the path type + // (see PATH_TYPE_XXX); if this is an archive and 'archiveOrFS' is not NULL and 'buffer' is not NULL, + // 'archiveOrFS' receives a pointer into 'buffer' at the position after the archive file name; + // if this is a file system and 'archiveOrFS' is not NULL and 'buffer' is not NULL, + // 'archiveOrFS' receives a pointer into 'buffer' to the ':' after the file-system name (after ':' is the user part + // of the file-system path); if 'convertFSPathToExternal' is TRUE and the panel contains an FS path, + // the plugin to which the path belongs is found (by fs-name) and its + // CPluginInterfaceForFSAbstract::ConvertPathToExternal() is called; returns success (if + // 'bufferSize' != 0, it is also considered a failure when the path does not fit in buffer // 'buffer') - // omezeni: hlavni thread + // main thread only virtual BOOL WINAPI GetPanelPath(int panel, char* buffer, int bufferSize, int* type, char** archiveOrFS, BOOL convertFSPathToExternal = FALSE) = 0; - // vraci posledni navstivenou windowsovou cestu v panelu, hodi se pro navraty z FS (prijemnejsi nez - // jit hned na fixed-drive); 'panel' je jeden z PANEL_XXX; 'buffer' je buffer pro cestu; - // 'bufferSize' je velikost bufferu 'buffer'; vraci uspech - // omezeni: hlavni thread + // Returns the last visited Windows path in the panel, useful when returning from an FS (nicer than + // going straight to a fixed drive); 'panel' is one of PANEL_XXX; 'buffer' is the path buffer; + // 'bufferSize' is the size of buffer 'buffer'; returns success + // main thread only virtual BOOL WINAPI GetLastWindowsPanelPath(int panel, char* buffer, int bufferSize) = 0; - // vraci jmeno FS pridelene "dozivotne" pluginu Salamanderem (podle navrhu z SetBasicPluginData); - // 'buf' je buffer o velikosti alespon MAX_PATH znaku; 'fsNameIndex' je index fs-name (index je - // nula pro fs-name zadane v CSalamanderPluginEntryAbstract::SetBasicPluginData, u ostatnich - // fs-name index vraci CSalamanderPluginEntryAbstract::AddFSName) - // omezeni: hlavni thread (jinak muze dojit ke zmenam v konfiguraci pluginu behem volani), - // v entry-pointu lze volat az po SetBasicPluginData, drive nemusi byt zname + // Returns the FS name assigned to the plugin by Salamander "for life" (according to the SetBasicPluginData design); + // 'buf' is a buffer at least MAX_PATH characters long; 'fsNameIndex' is the fs-name index (the index is + // zero for the fs-name specified in CSalamanderPluginEntryAbstract::SetBasicPluginData; the index of other + // fs-names is returned by CSalamanderPluginEntryAbstract::AddFSName) + // main thread only (otherwise the plugin configuration may change during the call), + // in the entry point it can be called only after SetBasicPluginData; earlier it may be unknown virtual void WINAPI GetPluginFSName(char* buf, int fsNameIndex) = 0; - // vraci interface pluginoveho file-systemu (FS) otevreneho v panelu 'panel' (jeden z PANEL_XXX); - // pokud v panelu neni otevren FS nebo jde o FS jineho pluginu (nepatri volajicimu pluginu), vraci - // metoda NULL (nelze pracovat s objektem jineho pluginu, jeho struktura je neznama) - // omezeni: hlavni thread + // Returns the interface of the plugin file system (FS) opened in panel 'panel' (one of PANEL_XXX); + // if no FS is open in the panel or it is an FS of another plugin (it does not belong to the calling plugin), the + // method returns NULL (it is not possible to work with another plugin's object because its structure is unknown) + // main thread only virtual CPluginFSInterfaceAbstract* WINAPI GetPanelPluginFS(int panel) = 0; - // vraci plugin data interface listingu panelu (muze byt i NULL), 'panel' je jeden z PANEL_XXX; - // pokud plugin data interface existuje, ale nepatri tomuto (volajicimu) pluginu, vraci - // metoda NULL (nelze pracovat s objektem jineho pluginu, jeho struktura je neznama) - // omezeni: hlavni thread + // Returns the panel listing's plugin data interface (it may also be NULL); 'panel' is one of PANEL_XXX; + // if a plugin data interface exists but does not belong to the calling plugin, the + // method returns NULL (it is not possible to work with another plugin's object because its structure is unknown) + // main thread only virtual CPluginDataInterfaceAbstract* WINAPI GetPanelPluginData(int panel) = 0; - // vraci fokusenou polozku panelu (soubor/adresar/updir("..")), 'panel' je jeden z PANEL_XXX, - // vraci NULL (zadna polozka v panelu) nebo data fokusene polozky; neni-li 'isDir' NULL, - // vraci v nem FALSE pokud jde o soubor (jinak jde o adresar nebo updir) - // POZOR: vracena data polozky jsou pouze pro cteni - // omezeni: hlavni thread + // Returns the focused panel item (file/directory/updir("..")); 'panel' is one of PANEL_XXX, + // returns NULL (no item in the panel) or the data of the focused item; if 'isDir' is not NULL, + // it receives FALSE for a file (otherwise it is a directory or updir) + // WARNING: the returned item data are read-only + // main thread only virtual const CFileData* WINAPI GetPanelFocusedItem(int panel, BOOL* isDir) = 0; - // vraci postupne polozky panelu (nejprve adresare, pak soubory), 'panel' je jeden z PANEL_XXX, - // 'index' je vstupne/vystupni promenna, ukazuje na int, ve kterem je pri prvnim volani 0, - // hodnotu pro dalsi volani si funkce ulozi pri navratu (pouziti: na zacatku vynulovat, pak - // nemenit), vraci NULL (jiz zadna polozka) nebo data dalsi (pripadne prvni) polozky; - // neni-li 'isDir' NULL, vraci v nem FALSE pokud jde o soubor (jinak jde o adresar nebo updir) - // POZOR: vracena data polozky jsou pouze pro cteni - // omezeni: hlavni thread + // Returns panel items one by one (directories first, then files); 'panel' is one of PANEL_XXX, + // 'index' is an in/out variable pointing to an int that must be 0 on the first call; + // the function stores the value for the next call before returning (usage: initialize it to 0, then + // do not modify it), returns NULL (no more items) or the data of the next (or first) item; + // if 'isDir' is not NULL, it receives FALSE for a file (otherwise it is a directory or updir) + // WARNING: the returned item data are read-only + // main thread only virtual const CFileData* WINAPI GetPanelItem(int panel, int* index, BOOL* isDir) = 0; - // vraci postupne oznacene polozky panelu (nejprve adresare, pak soubory), 'panel' je jeden z - // PANEL_XXX, 'index' je vstupne/vystupni promenna, ukazuje na int, ve kterem je pri prvnim volani 0, - // hodnotu pro dalsi volani si funkce ulozi pri navratu (pouziti: na zacatku vynulovat, pak - // nemenit), vraci NULL (jiz zadna polozka) nebo data dalsi (pripadne prvni) polozky; - // neni-li 'isDir' NULL, vraci v nem FALSE pokud jde o soubor (jinak jde o adresar nebo updir) - // POZOR: vracena data polozky jsou pouze pro cteni - // omezeni: hlavni thread + // Returns selected panel items one by one (directories first, then files); 'panel' is one of + // PANEL_XXX, 'index' is an in/out variable pointing to an int that must be 0 on the first call, + // the function stores the value for the next call before returning (usage: initialize it to 0, then + // do not modify it), returns NULL (no more items) or the data of the next (or first) item; + // if 'isDir' is not NULL, it receives FALSE for a file (otherwise it is a directory or updir) + // WARNING: the returned item data are read-only + // main thread only virtual const CFileData* WINAPI GetPanelSelectedItem(int panel, int* index, BOOL* isDir) = 0; - // zjisti kolik souboru a adresaru je oznacenych v panelu; 'panel' je jeden z PANEL_XXX; - // neni-li 'selectedFiles' NULL, vraci v nem pocet oznacenych souboru; neni-li 'selectedDirs' - // NULL, vraci v nem pocet oznacenych adresaru; vraci TRUE pokud je oznaceny aspon jeden - // soubor nebo adresar nebo pokud je fokus na souboru nebo adresari (je-li s cim - // pracovat - fokus neni na up-diru) - // omezeni: hlavni thread (jinak se muze obsah panelu menit) + // Determines how many files and directories are selected in the panel; 'panel' is one of PANEL_XXX; + // if 'selectedFiles' is not NULL, it receives the number of selected files; if 'selectedDirs' + // is not NULL, it receives the number of selected directories; returns TRUE if at least one + // file or directory is selected, or if the focus is on a file or directory (i.e. there is something + // to work with - the focus is not on updir) + // main thread only (otherwise the panel contents may change) virtual BOOL WINAPI GetPanelSelection(int panel, int* selectedFiles, int* selectedDirs) = 0; - // vraci top-index listboxu v panelu; 'panel' je jeden z PANEL_XXX - // omezeni: hlavni thread (jinak se muze obsah panelu menit) + // Returns the top index of the list box in the panel; 'panel' is one of PANEL_XXX + // main thread only (otherwise the panel contents may change) virtual int WINAPI GetPanelTopIndex(int panel) = 0; - // informuje hlavni okno Salamandera, ze se deaktivuje okno viewru, pokud se bude - // bezprostredne aktivovat hlavni okno a v panelech budou neautomaticky refreshovane - // disky nedojde k jejich refreshi (viewry nemeni obsah disku), nepovine (dojde - // k mozna zbytecnemu refrehi) - // mozne volat z libovolneho threadu + // Notifies Salamander's main window that a viewer window is being deactivated; if the + // main window is activated immediately afterward and the panels contain manually refreshed + // drives, they are not refreshed (viewers do not change disk contents); this call is optional + // (at worst it only causes an unnecessary refresh) + // can be called from any thread virtual void WINAPI SkipOneActivateRefresh() = 0; - // oznacuje/odznacuje polozku panelu, 'file' je ukazatel na menenou polozku ziskany predchozim - // "get-item" volanim (metody GetPanelFocusedItem, GetPanelItem a GetPanelSelectedItem); - // je nutne, aby od "get-item" volani nebyl opusten plugin a volani probehlo v hlavnim - // threadu (aby nedoslo k obnove panelu - zneplatneni ukazatele); 'panel' musi byt shodny - // s parametrem 'panel' prislusneho "get-item" volani; je-li 'select' TRUE dojde k oznaceni, - // jinak dojde k odznaceni; po poslednim volani je nutne pouzit RepaintChangedItems('panel') pro - // prekresleni panelu - // omezeni: hlavni thread + // Selects/deselects a panel item; 'file' is a pointer to the item to change obtained by a previous + // "get-item" call (GetPanelFocusedItem, GetPanelItem, or GetPanelSelectedItem); + // it is necessary that the plugin has not been left since the "get-item" call and that this call runs in the main + // thread (to avoid panel refresh invalidating the pointer); 'panel' must match + // the 'panel' parameter of the corresponding "get-item" call; if 'select' is TRUE, the item is selected, + // otherwise it is deselected; after the last call, RepaintChangedItems('panel') must be used to + // repaint the panel + // main thread only virtual void WINAPI SelectPanelItem(int panel, const CFileData* file, BOOL select) = 0; - // provede prekresleni polozek panelu u kterych doslo ke zmenam (oznaceni); 'panel' je - // jeden z PANEL_XXX - // omezeni: hlavni thread + // Repaints panel items whose selection state has changed; 'panel' is + // one of PANEL_XXX + // main thread only virtual void WINAPI RepaintChangedItems(int panel) = 0; - // oznacuje/odznacuje vsechny polozky v panelu, 'panel' je jeden z PANEL_XXX; je-li 'select' - // TRUE dojde k oznaceni, jinak dojde k odznaceni; je-li 'repaint' TRUE prekresli se vsechny - // zmenene polozky v panelu, jinak k prekresleni nedojde (mozne volat pozdeji RepaintChangedItems) - // omezeni: hlavni thread + // Selects/deselects all items in the panel; 'panel' is one of PANEL_XXX; if 'select' + // is TRUE, the items are selected, otherwise they are deselected; if 'repaint' is TRUE, all + // changed items in the panel are repainted; otherwise no repaint occurs (RepaintChangedItems may be called later) + // main thread only virtual void WINAPI SelectAllPanelItems(int panel, BOOL select, BOOL repaint) = 0; - // nastavi fokus v panelu, 'file' je ukazatel na fokusenou polozku ziskany predchozim - // "get-item" volanim (metody GetPanelFocusedItem, GetPanelItem a GetPanelSelectedItem); - // je nutne, aby od "get-item" volani nebyl opusten plugin a volani probehlo v hlavnim - // threadu (aby nedoslo k obnove panelu - zneplatneni ukazatele); 'panel' musi byt shodny - // s parametrem 'panel' prislusneho "get-item" volani; je-li 'partVis' TRUE a polozka bude - // viditelna jen castecne, nedojde k odrolovani panelu pri fokusu, pri FALSE odroluje panel - // tak, aby byla videt cela polozka - // omezeni: hlavni thread + // Sets the focus in the panel; 'file' is a pointer to the focused item obtained by a previous + // "get-item" call (GetPanelFocusedItem, GetPanelItem, or GetPanelSelectedItem); + // it is necessary that the plugin has not been left since the "get-item" call and that this call runs in the main + // thread (to avoid panel refresh invalidating the pointer); 'panel' must match + // the 'panel' parameter of the corresponding "get-item" call; if 'partVis' is TRUE and the item would be + // only partially visible, the panel is not scrolled when focusing it; if FALSE, the panel is scrolled + // so the whole item is visible + // main thread only virtual void WINAPI SetPanelFocusedItem(int panel, const CFileData* file, BOOL partVis) = 0; - // zjisti jestli se v panelu pouziva filtr a pokud se pouziva, ziska retezec s maskami - // tohoto filtru; 'panel' oznacuje panel, o ktery se zajimame (jedna z PANEL_XXX); - // 'masks' je buffer pro masky filtru o velikosti minimalne 'masksBufSize' bytu (doporucena - // velikost je MAX_GROUPMASK); vraci TRUE pokud se filtr pouziva a buffer 'masks' je - // dost velky; vraci FALSE pokud se filtr nepouziva nebo se retezec masek nevesel - // do 'masks' - // omezeni: hlavni thread + // Determines whether a filter is used in the panel and, if so, gets its mask string; + // 'panel' identifies the panel of interest (one of PANEL_XXX); + // 'masks' is the output buffer for the filter masks, at least 'masksBufSize' bytes long (recommended + // size is MAX_GROUPMASK); returns TRUE if a filter is used and buffer 'masks' is + // large enough; returns FALSE if no filter is used or the mask string did not fit + // into 'masks' + // main thread only virtual BOOL WINAPI GetFilterFromPanel(int panel, char* masks, int masksBufSize) = 0; - // vraci pozici zdrojoveho panelu (je vlevo nebo vpravo?), vraci PANEL_LEFT nebo PANEL_RIGHT - // omezeni: hlavni thread + // Returns the source panel position (left or right); returns PANEL_LEFT or PANEL_RIGHT + // main thread only virtual int WINAPI GetSourcePanel() = 0; - // zjistuje, ve kterem panelu je otevreny 'pluginFS'; pokud neni ani v jednom panelu, - // vraci FALSE; pokud vrati TRUE, je cislo panelu v 'panel' (PANEL_LEFT nebo PANEL_RIGHT) - // omezeni: hlavni thread (jinak se muze obsah panelu menit) + // Determines in which panel 'pluginFS' is open; if it is not open in either panel, + // returns FALSE; if it returns TRUE, the panel number is stored in 'panel' (PANEL_LEFT or PANEL_RIGHT) + // main thread only (otherwise the panel contents may change) virtual BOOL WINAPI GetPanelWithPluginFS(CPluginFSInterfaceAbstract* pluginFS, int& panel) = 0; // aktivuje druhy panel (ala klavesa TAB); panely oznacene pres PANEL_SOURCE a PANEL_TARGET @@ -1405,104 +1405,104 @@ class CSalamanderGeneralAbstract // omezeni: hlavni thread virtual void WINAPI ChangePanel() = 0; - // prevod cisla na "prehlednejsi" retezec (po trech cislicich mezera), retezec vraci v - // 'buffer' (min. velikost 50 bytu), vraci 'buffer' - // mozne volat z libovolneho threadu + // Converts a number to a more readable string (a space after every three digits), writes the string to + // 'buffer' (minimum size 50 bytes), returns 'buffer' + // can be called from any thread virtual char* WINAPI NumberToStr(char* buffer, const CQuadWord& number) = 0; - // tisk velikosti mista na disku do 'buf' (min. velikost bufferu je 100 bytu), + // Prints disk size to 'buf' (minimum buffer size 100 bytes), // mode==0 "1.23 MB", mode==1 "1 230 000 bytes, 1.23 MB", mode==2 "1 230 000 bytes", - // mode==3 "12 KB" (vzdy v celych kilo bajtech), mode==4 (jako mode==0, ale vzdy - // aspon 3 platne cislice, napr. "2.00 MB") - // vraci 'buf' - // mozne volat z libovolneho threadu + // mode==3 "12 KB" (always whole kilobytes), mode==4 (like mode==0, but always + // at least 3 significant digits, e.g. "2.00 MB") + // returns 'buf' + // can be called from any thread virtual char* WINAPI PrintDiskSize(char* buf, const CQuadWord& size, int mode) = 0; - // prevadi pocet sekund na retezec ("5 sec", "1 hr 34 min", atp.); 'buf' je - // buffer pro vysledny text, musi byt velky aspon 100 znaku; 'secs' je pocet sekund; - // vraci 'buf' - // mozne volat z libovolneho threadu + // Converts a number of seconds to a string ("5 sec", "1 hr 34 min", etc.); 'buf' is the + // output buffer and must be at least 100 characters long; 'secs' is the number of seconds; + // returns 'buf' + // can be called from any thread virtual char* WINAPI PrintTimeLeft(char* buf, const CQuadWord& secs) = 0; - // porovna root normalni (c:\path) i UNC (\\server\share\path) cesty, vraci TRUE pokud je root shodny - // mozne volat z libovolneho threadu + // Compares the roots of normal (c:\path) and UNC (\\server\share\path) paths; returns TRUE if the roots are the same + // can be called from any thread virtual BOOL WINAPI HasTheSameRootPath(const char* path1, const char* path2) = 0; - // Vrati pocet znaku spolecne cesty. Na normalni ceste musi byt root ukonceny zpetnym - // lomitkem, jinak funkce vrati 0. ("C:\"+"C:"->0, "C:\A\B"+"C:\"->3, "C:\A\B\"+"C:\A"->4, + // Returns the number of characters in the common path prefix. On a normal path, the root must end with a backslash, + // otherwise the function returns 0. ("C:\"+"C:"->0, "C:\A\B"+"C:\"->3, "C:\A\B\"+"C:\A"->4, // "C:\AA\BB"+"C:\AA\CC"->5) - // Pracuje pro normalni i UNC cesty. + // Works for both normal and UNC paths. virtual int WINAPI CommonPrefixLength(const char* path1, const char* path2) = 0; - // Vraci TRUE, pokud je cesta 'prefix' zakladem cesty 'path'. Jinak vraci FALSE. + // Returns TRUE if path 'prefix' is a prefix of path 'path'. Otherwise it returns FALSE. // "C:\aa","C:\Aa\BB"->TRUE // "C:\aa","C:\aaa"->FALSE // "C:\aa\","C:\Aa"->TRUE // "\\server\share","\\server\share\aaa"->TRUE - // Pracuje pro normalni i UNC cesty. + // Works with both normal and UNC paths. virtual BOOL WINAPI PathIsPrefix(const char* prefix, const char* path) = 0; - // porovna dve normalni (c:\path) i UNC (\\server\share\path) cesty, ignoruje mala/velka pismena, - // ignoruje take jeden backslash na zacatku a konci cest, vraci TRUE pokud jsou cesty stejne - // mozne volat z libovolneho threadu + // Compares two normal (c:\path) and UNC (\\server\share\path) paths, ignoring case, + // also ignores one leading and trailing backslash, returns TRUE if the paths are the same + // can be called from any thread virtual BOOL WINAPI IsTheSamePath(const char* path1, const char* path2) = 0; - // ziska root cestu z normalni (c:\path) i UNC (\\server\share\path) cesty 'path', v 'root' vraci - // cestu ve formatu 'c:\' nebo '\\server\share\' (min. velikost 'root' bufferu je MAX_PATH), - // vraci pocet znaku root cesty (bez null-terminatoru); pri UNC root ceste delsi nez MAX_PATH - // dojde k orezu na MAX_PATH-2 znaku a doplneni backslashe (stejne to na 100% neni root cesta) - // mozne volat z libovolneho threadu + // Gets the root path from a normal (c:\path) or UNC (\\server\share\path) path 'path'; in 'root' it returns + // a path in the form 'c:\' or '\\server\share\' (minimum size of buffer 'root' is MAX_PATH), + // returns the number of characters in the root path (without the null terminator); for a UNC root path longer than MAX_PATH, + // it is truncated to MAX_PATH-2 characters and a backslash is appended (in that case it is definitely not a full root path) + // can be called from any thread virtual int WINAPI GetRootPath(char* root, const char* path) = 0; - // zkracuje normalni (c:\path) i UNC (\\server\share\path) cestu o posledni adresar - // (zariznuti na poslednim backslashi - v oriznute ceste zustava na konci backslash - // jen u 'c:\'), 'path' je in/out buffer (min. velikost strlen(path)+2 bytu), - // v 'cutDir' (neni-li NULL) se vraci ukazatel (do bufferu 'path' za 1. null-terminator) - // na posledni adresar (odriznutou cast), tato metoda nahrazuje PathRemoveFileSpec, - // vraci TRUE pokud doslo ke zkraceni (neslo o root cestu) - // mozne volat z libovolneho threadu + // Shortens a normal (c:\path) or UNC (\\server\share\path) path by the last directory + // (cuts at the last backslash - the truncated path keeps the trailing backslash + // only for 'c:\'); 'path' is an in/out buffer (minimum size strlen(path)+2 bytes), + // if 'cutDir' is not NULL, it receives a pointer (in buffer 'path' after the first null terminator) + // to the last directory (the removed part); this method replaces PathRemoveFileSpec, + // returns TRUE if the path was shortened (i.e. it was not a root path) + // can be called from any thread virtual BOOL WINAPI CutDirectory(char* path, char** cutDir = NULL) = 0; - // pracuje s normalnimi (c:\path) i UNC (\\server\share\path) cestami, - // spoji 'path' a 'name' do 'path', zajisti spojeni backslashem, 'path' je buffer alespon - // 'pathSize' znaku, vraci TRUE pokud se 'name' veslo za 'path'; je-li 'path' nebo 'name' - // prazdne, spojovaci (pocatecni/ukoncovaci) backslash nebude (napr. "c:\" + "" -> "c:") - // mozne volat z libovolneho threadu + // Works with normal (c:\path) and UNC (\\server\share\path) paths, + // joins 'path' and 'name' into 'path', inserting a backslash if needed; 'path' is a buffer at least + // 'pathSize' characters long, returns TRUE if 'name' fit after 'path'; if 'path' or 'name' is + // empty, the separating backslash is omitted (e.g. "c:\" + "" -> "c:") + // can be called from any thread virtual BOOL WINAPI SalPathAppend(char* path, const char* name, int pathSize) = 0; - // pracuje s normalnimi (c:\path) i UNC (\\server\share\path) cestami, - // pokud jeste 'path' nekonci na backslash, prida ho na konec 'path'; 'path' je buffer - // alespon 'pathSize' znaku; vraci TRUE pokud se backslash vesel za 'path'; je-li 'path' - // prazdne, backslash se neprida - // mozne volat z libovolneho threadu + // Works with normal (c:\path) and UNC (\\server\share\path) paths, + // if 'path' does not already end with a backslash, appends one; 'path' is a buffer + // at least 'pathSize' characters long; returns TRUE if the backslash fit after 'path'; if 'path' + // is empty, no backslash is added + // can be called from any thread virtual BOOL WINAPI SalPathAddBackslash(char* path, int pathSize) = 0; - // pracuje s normalnimi (c:\path) i UNC (\\server\share\path) cestami, - // pokud je v 'path' na konci backslash, odstrani ho - // mozne volat z libovolneho threadu + // Works with normal (c:\path) and UNC (\\server\share\path) paths, + // removes a trailing backslash from 'path' if present + // can be called from any thread virtual void WINAPI SalPathRemoveBackslash(char* path) = 0; - // pracuje s normalnimi (c:\path) i UNC (\\server\share\path) cestami, - // z plneho jmena udela jmeno ("c:\path\file" -> "file") - // mozne volat z libovolneho threadu + // Works with normal (c:\path) and UNC (\\server\share\path) paths, + // strips a full path down to the name ("c:\path\file" -> "file") + // can be called from any thread virtual void WINAPI SalPathStripPath(char* path) = 0; - // pracuje s normalnimi (c:\path) i UNC (\\server\share\path) cestami, - // pokud je ve jmene pripona, odstrani ji - // mozne volat z libovolneho threadu + // Works with normal (c:\path) and UNC (\\server\share\path) paths, + // removes the extension if the name has one + // can be called from any thread virtual void WINAPI SalPathRemoveExtension(char* path) = 0; - // pracuje s normalnimi (c:\path) i UNC (\\server\share\path) cestami, - // pokud ve jmenu 'path' jeste neni pripona, prida priponu 'extension' (napr. ".txt"), - // 'path' je buffer alespon 'pathSize' znaku, vraci FALSE pokud buffer 'path' nestaci - // pro vyslednou cestu - // mozne volat z libovolneho threadu + // Works with normal (c:\path) and UNC (\\server\share\path) paths, + // if 'path' does not already have an extension, appends 'extension' (e.g. ".txt"), + // 'path' is a buffer at least 'pathSize' characters long, returns FALSE if buffer 'path' is too small + // for the resulting path + // can be called from any thread virtual BOOL WINAPI SalPathAddExtension(char* path, const char* extension, int pathSize) = 0; - // pracuje s normalnimi (c:\path) i UNC (\\server\share\path) cestami, - // zmeni/prida priponu 'extension' (napr. ".txt") ve jmenu 'path', 'path' je buffer - // alespon 'pathSize' znaku, vraci FALSE pokud buffer 'path' nestaci pro vyslednou cestu - // mozne volat z libovolneho threadu + // Works with normal (c:\path) and UNC (\\server\share\path) paths, + // changes/adds extension 'extension' (e.g. ".txt") in 'path'; 'path' is a buffer + // at least 'pathSize' characters long, returns FALSE if buffer 'path' is too small for the resulting path + // can be called from any thread virtual BOOL WINAPI SalPathRenameExtension(char* path, const char* extension, int pathSize) = 0; // pracuje s normalnimi (c:\path) i UNC (\\server\share\path) cestami, From 104325a14f67b6415e10d457a49c4d786ebd7852 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 17:06:05 +0200 Subject: [PATCH 283/710] [translation] Fix src/plugins/shared/spl_gen.h comments (chunk 10/14) (#658) --- src/plugins/shared/spl_gen.h | 530 +++++++---------------------------- 1 file changed, 109 insertions(+), 421 deletions(-) diff --git a/src/plugins/shared/spl_gen.h b/src/plugins/shared/spl_gen.h index c1dab3cd9..71013695b 100644 --- a/src/plugins/shared/spl_gen.h +++ b/src/plugins/shared/spl_gen.h @@ -1505,277 +1505,118 @@ class CSalamanderGeneralAbstract // can be called from any thread virtual BOOL WINAPI SalPathRenameExtension(char* path, const char* extension, int pathSize) = 0; - // pracuje s normalnimi (c:\path) i UNC (\\server\share\path) cestami, - // vraci ukazatel do 'path' na jmeno souboru/adresare (backslash na konci 'path' ignoruje), - // pokud jmeno neobsahuje jine backslashe nez na konci retezce, vraci 'path' - // mozne volat z libovolneho threadu + // Works with normal (c:\path) and UNC (\\server\share\path) paths. Returns a pointer into 'path' to the file/directory name (ignores a trailing backslash in 'path'). If the name contains no backslashes other than a trailing one, returns 'path'. Callable from any thread. virtual const char* WINAPI SalPathFindFileName(const char* path) = 0; - // upravuje relativni nebo absolutni normalni (c:\path) i UNC (\\server\share\path) cestu - // na absolutni bez '.', '..' a koncoveho backslashe (krom typu "c:\"); je-li 'curDir' NULL, - // relativni cesty typu "\path" a "path" vraci chybu (neurcitelne), jinak je 'curDir' platna - // upravena aktualni cesta (UNC i normalni); aktualni cesty ostatnich disku (mimo - // 'curDir' + jen normalni, ne UNC) jsou v Salamandrovskem poli DefaultDir (pred pouzitim - // je dobre zavolat metodu SalUpdateDefaultDir); 'name' - in/out buffer cesty alespon 'nameBufSize' - // znaku; neni-li 'nextFocus' NULL a zadana relativni cesta neobsahuje backslash, provede se - // strcpy(nextFocus, name); vraci TRUE - jmeno 'name' je pripraveno k pouziti, jinak neni-li - // 'errTextID' NULL obsahuje chybu (konstanty GFN_XXX - text se da ziskat pres GetGFNErrorText) - // POZOR: pred pouzitim je dobre zavolat metodu SalUpdateDefaultDir - // omezeni: hlavni thread (jinak muze dojit ke zmenam DefaultDir v hl. threadu) + // Converts a relative or absolute normal (c:\path) or UNC (\\server\share\path) path to an absolute path without '.', '..', and without a trailing backslash (except for paths of the form "c:\"). If 'curDir' is NULL, relative paths of the form "\\path" and "path" fail because the base cannot be determined; otherwise 'curDir' is a valid normalized current path (UNC or normal). Current paths of the other drives ('curDir' plus normal paths only, not UNC) are stored in Salamander's DefaultDir array; it is good to call SalUpdateDefaultDir before using them. 'name' is an input/output path buffer of at least 'nameBufSize' characters. If 'nextFocus' is not NULL and the requested relative path contains no backslash, strcpy(nextFocus, name) is performed. Returns TRUE when 'name' is ready to use; otherwise, if 'errTextID' is not NULL, it receives an error constant GFN_XXX (the text can be obtained with GetGFNErrorText). + // WARNING: it is good to call SalUpdateDefaultDir before use. + // Restriction: main thread (DefaultDir can change in the main thread). virtual BOOL WINAPI SalGetFullName(char* name, int* errTextID = NULL, const char* curDir = NULL, char* nextFocus = NULL, int nameBufSize = MAX_PATH) = 0; - // obnovi Salamandrovske pole DefaultDir podle cest v panelech, je-li 'activePrefered' TRUE, - // bude mit prednost cesta v aktivnim panelu (zapise se pozdeji do DefaultDir), jinak ma - // prednost cesta v neaktivnim panelu - // omezeni: hlavni thread (jinak muze dojit ke zmenam DefaultDir v hl. threadu) + // Updates Salamander's DefaultDir array from the panel paths. If 'activePrefered' is TRUE, the active panel path has priority and is written to DefaultDir later; otherwise the inactive panel path has priority. + // Restriction: main thread (DefaultDir can change in the main thread). virtual void WINAPI SalUpdateDefaultDir(BOOL activePrefered) = 0; - // vraci textovou reprezentaci chybove konstanty GFN_XXX; vraci 'buf' (aby slo dat GetGFNErrorText - // primo jako parametr funkce) - // mozne volat z libovolneho threadu + // Returns the text representation of the GFN_XXX error constant. Returns 'buf' so GetGFNErrorText can be used directly as a function argument. Callable from any thread. virtual char* WINAPI GetGFNErrorText(int GFN, char* buf, int bufSize) = 0; - // vraci textovou reprezentaci systemove chyby (ERROR_XXX) v bufferu 'buf' o velikosti 'bufSize'; - // vraci 'buf' (aby slo dat GetErrorText primo jako parametr funkce); 'buf' muze byt NULL nebo - // 'bufSize' 0, v tom pripade vraci text v internim bufferu (hrozi zmena textu diky zmene - // interniho bufferu zpusobene dalsimi volanimi GetErrorText i z jinych pluginu nebo Salamandera; - // buffer je dimenzovany na minimalne 10 textu, pak teprve hrozi prepis; pokud potrebujete text - // pouzit az pozdeji, doporucujeme jej zkopirovat do lokalniho bufferu o velikosti MAX_PATH + 20) - // mozne volat z libovolneho threadu + // Returns the text representation of a system error (ERROR_XXX) in 'buf' of size 'bufSize'. Returns 'buf' so GetErrorText can be used directly as a function argument. 'buf' may be NULL or 'bufSize' may be 0; in that case the text is returned in an internal buffer (the text may later change because additional GetErrorText calls from other plugins or Salamander can reuse that buffer; the buffer is sized for at least 10 texts before overwrite becomes possible. If you need the text later, copy it to a local buffer of size MAX_PATH + 20). Callable from any thread. virtual char* WINAPI GetErrorText(int err, char* buf = NULL, int bufSize = 0) = 0; - // vraci vnitrni barvu Salamandera, 'color' je konstanta barvy (viz SALCOL_XXX) - // mozne volat z libovolneho threadu + // Returns Salamander's current internal color; 'color' is a color constant (see SALCOL_XXX). Callable from any thread. virtual COLORREF WINAPI GetCurrentColor(int color) = 0; - // zajisti aktivaci hlavniho okna Salamandera + focus souboru/adresare 'name' na ceste - // 'path' v panelu 'panel'; pripadne zmeni cestu v panelu (je-li nutne); 'panel' je jeden - // z PANEL_XXX; 'path' je libovolna cesta (windowsova (diskova), na FS nebo do archivu); - // 'name' muze byt i prazdny string, pokud se nema nic focusit; - // omezeni: hlavni thread + mimo metody CPluginFSInterfaceAbstract a CPluginDataInterfaceAbstract - // (hrozi napr. zavreni FS otevreneho v panelu - metode by mohl prestat existovat 'this') + // Activates Salamander's main window and focuses file/directory 'name' at path 'path' in panel 'panel'; changes the panel path if necessary. 'panel' is one of PANEL_XXX. 'path' may be any path (Windows disk path, FS path, or archive path). 'name' may be an empty string if nothing should be focused. + // Restriction: main thread + outside CPluginFSInterfaceAbstract and CPluginDataInterfaceAbstract methods (for example, an FS open in the panel could be closed and 'this' could cease to exist). virtual void WINAPI FocusNameInPanel(int panel, const char* path, const char* name) = 0; - // zmena cesty v panelu - vstupem muze byt absolutni i relativni UNC (\\server\share\path) - // i normalni (c:\path) cesta a to jak windowsova (diskova), tak do archivu nebo cesta - // na FS (absolutni/relativni si resi primo plugin); pokud je vstupem cesta k souboru, - // dojde k fokusu tohoto souboru; neni-li suggestedTopIndex -1, bude nastaven top-index - // v panelu; neni-li suggestedFocusName NULL, zkusi se nalezt (ignore-case) a vyfokusit - // polozka stejneho jmena; neni-li 'failReason' NULL, nastavuje se na jednu z konstant + // changes the panel path - input may be an absolute or relative UNC (\\server\share\path) + // or normal (c:\path) path, either a Windows (disk) path, an archive path, or an FS path + // (absolute/relative handling is done directly by the plugin); if the input is a file path, + // that file is focused; if suggestedTopIndex is not -1, the top index is set + // in the panel; if suggestedFocusName is not NULL, an item with the same name is searched for + // case-insensitively and focused; if 'failReason' is not NULL, it is set to one of // CHPPFR_XXX (informuje o vysledku metody); je-li 'convertFSPathToInternal' TRUE a jde - // o cestu na FS, najde se plugin jehoz cesta je (podle fs-name) a zavola se jeho + // it is an FS path, the owning plugin is found (by fs-name) and its // CPluginInterfaceForFSAbstract::ConvertPathToInternal(); vraci TRUE pokud se podarilo - // vylistovat pozadovanou cestu; - // POZNAMKA: pri zadani cesty na FS dojde k pokusu o otevreni cesty v tomto poradi: ve FS - // v panelu, v odpojenem FS, nebo v novem FS (u FS z panelu a odpojenych FS se zjistuje - // jestli odpovida plugin-fs-name a jestli metoda FS IsOurPath vraci pro zadanou cestu TRUE); - // omezeni: hlavni thread + mimo metody CPluginFSInterfaceAbstract a CPluginDataInterfaceAbstract - // (hrozi napr. zavreni FS otevreneho v panelu - metode by mohl prestat existovat 'this') + // list the requested path; + // NOTE: when an FS path is entered, opening is attempted in this order: in the panel FS, + // in a detached FS, or in a new FS (for panel and detached FS instances, it is checked + // whether plugin-fs-name matches and whether FS IsOurPath returns TRUE for the given path); + // restriction: main thread + outside CPluginFSInterfaceAbstract and CPluginDataInterfaceAbstract methods + // (for example, an FS open in the panel could be closed and 'this' could cease to exist) virtual BOOL WINAPI ChangePanelPath(int panel, const char* path, int* failReason = NULL, int suggestedTopIndex = -1, const char* suggestedFocusName = NULL, BOOL convertFSPathToInternal = TRUE) = 0; - // zmena cesty v panelu na relativni nebo absolutni UNC (\\server\share\path) nebo normalni (c:\path) - // cestu, pokud neni nova cesta dostupna, zkousi uspet se zkracenymi cestami; pokud jde o zmenu - // cesty v ramci jednoho disku (vcetne archivu na tomto disku) a na disku se nepodari nalezt - // pristupnou cestu, zmeni cestu na root prvniho lokalniho fixed drivu (velka sance uspechu, - // panel nezustane prazdny); pri prekladu relativni cesty na absolutni je uprednostnovana cesta - // v panelu 'panel' (jen je-li to cesta na disk (i k archivu), jinak se nepouziva); 'panel' je - // jeden z PANEL_XXX; 'path' je nova cesta; neni-li 'suggestedTopIndex' -1, bude nastaven jako - // top-index v panelu (jen pro novou cestu, na zkracene (zmenene) ceste se nenastavuje); neni-li - // 'suggestedFocusName' NULL, zkusi se nalezt (ignore-case) a vyfokusit polozka stejneho jmena - // (jen pro novou cestu, na zkracene (zmenene) ceste se neprovadi); neni-li 'failReason' NULL, - // nastavuje se na jednu z konstant CHPPFR_XXX (informuje o vysledku metody); vraci TRUE pokud - // se podarilo vylistovat pozadovanou cestu (nezkracenou/nezmenenou) - // omezeni: hlavni thread + mimo metody CPluginFSInterfaceAbstract a CPluginDataInterfaceAbstract - // (hrozi napr. zavreni FS otevreneho v panelu - metode by mohl prestat existovat 'this') + // Changes the panel path to a relative or absolute UNC (\\server\share\path) or normal (c:\path) path. If the new path is not available, it tries shortened paths. If this is a path change within one disk, including archives on that disk, and no accessible path can be found on that disk, the panel path is changed to the root of the first local fixed drive so the panel does not stay empty. When resolving a relative path to an absolute path, the path in panel 'panel' is preferred, but only if it is a disk path, including an archive path. 'panel' is one of PANEL_XXX. 'path' is the new path. If 'suggestedTopIndex' is not -1, it is used as the panel top index, but only for the new path, not for a shortened or changed path. If 'suggestedFocusName' is not NULL, an item with the same name is searched for case-insensitively and focused, again only for the new path, not for a shortened or changed path. If 'failReason' is not NULL, it is set to one of the CHPPFR_XXX constants describing the result. Returns TRUE if the requested path was listed without shortening or other changes. Restriction: main thread + outside CPluginFSInterfaceAbstract and CPluginDataInterfaceAbstract methods (for example, an FS open in the panel could be closed and 'this' could cease to exist). virtual BOOL WINAPI ChangePanelPathToDisk(int panel, const char* path, int* failReason = NULL, int suggestedTopIndex = -1, const char* suggestedFocusName = NULL) = 0; - // zmena cesty v panelu do archivu, 'archiv' je relativni nebo absolutni UNC - // (\\server\share\path\file) nebo normalni (c:\path\file) jmeno archivu, 'archivePath' je cesta - // uvnitr archivu, pokud neni nova cesta v archivu dostupna, zkousi uspet se zkracenymi cestami; - // pri prekladu relativni cesty na absolutni je uprednostnovana cesta v panelu 'panel' - // (jen je-li to cesta na disk (i k archivu), jinak se nepouziva); 'panel' je jeden z PANEL_XXX; - // neni-li 'suggestedTopIndex' -1, bude nastaven jako top-index v panelu (jen pro novou - // cestu, na zkracene (zmenene) ceste se nenastavuje); neni-li 'suggestedFocusName' NULL, - // zkusi se nalezt (ignore-case) a vyfokusit polozka stejneho jmena (jen pro novou cestu, - // na zkracene (zmenene) ceste se neprovadi); je-li 'forceUpdate' TRUE a provadi se zmena cesty - // uvnitr archivu 'archive' (archiv uz je v panelu otevreny), provadi se test zmeny souboru - // archivu (kontrola size & time) a v pripade zmeny se archiv zavre (hrozi update editovanych - // souboru) a znovu vylistuje nebo pokud soubor prestal existovat, provede se zmena cesty na disk - // (zavreni archivu; pokud cesta na disk neni pristupna, zmeni cestu na root prvniho lokalniho - // fixed drivu); je-li 'forceUpdate' FALSE, provadi se zmeny cesty uvnitr archivu 'archive' bez - // kontroly souboru archivu; neni-li 'failReason' NULL, nastavuje se na jednu z konstant - // CHPPFR_XXX (informuje o vysledku metody); vraci TRUE pokud se podarilo vylistovat - // pozadovanou cestu (nezkracenou/nezmenenou) - // omezeni: hlavni thread + mimo metody CPluginFSInterfaceAbstract a CPluginDataInterfaceAbstract - // (hrozi napr. zavreni FS otevreneho v panelu - metode by mohl prestat existovat 'this') + // Changes the panel path into an archive. 'archive' is the relative or absolute UNC (\\server\share\path\file) or normal (c:\path\file) archive name, and 'archivePath' is the path inside the archive. If the new path in the archive is not available, it tries shortened paths. When resolving a relative path to an absolute path, the path in panel 'panel' is preferred, but only if it is a disk path, including an archive path. 'panel' is one of PANEL_XXX. If 'suggestedTopIndex' is not -1, it is used as the panel top index, but only for the new path, not for a shortened or changed path. If 'suggestedFocusName' is not NULL, an item with the same name is searched for case-insensitively and focused, again only for the new path, not for a shortened or changed path. If 'forceUpdate' is TRUE and the path inside archive 'archive' is being changed while the archive is already open in the panel, the archive file is checked for changes (size & time). If it changed, the archive is closed to protect updated edited files and listed again; if the archive file no longer exists, the path is changed to a disk path by closing the archive, or to the root of the first local fixed drive if that disk path is not accessible. If 'forceUpdate' is FALSE, changes inside archive 'archive' are performed without checking the archive file. If 'failReason' is not NULL, it is set to one of the CHPPFR_XXX constants describing the result. Returns TRUE if the requested path was listed without shortening or other changes. Restriction: main thread + outside CPluginFSInterfaceAbstract and CPluginDataInterfaceAbstract methods (for example, an FS open in the panel could be closed and 'this' could cease to exist). virtual BOOL WINAPI ChangePanelPathToArchive(int panel, const char* archive, const char* archivePath, int* failReason = NULL, int suggestedTopIndex = -1, const char* suggestedFocusName = NULL, BOOL forceUpdate = FALSE) = 0; - // zmena cesty v panelu do pluginoveho FS, 'fsName' je jmeno FS (viz GetPluginFSName; nemusi - // byt nutne z tohoto pluginu), 'fsUserPart' je cesta v ramci FS; pokud neni nova cesta v FS - // dostupna, zkousi uspet se zkracenymi cestami (opakovane volani ChangePath a ListCurrentPath, - // viz CPluginFSInterfaceAbstract); pokud jde o zmenu cesty v ramci aktualniho FS (viz - // CPluginFSInterfaceAbstract::IsOurPath) a nepodari se od nove cesty nalezt pristupnou cestu, - // zkusi najit pristupnou cestu jeste od puvodni (aktualni) cesty, a pokud zklame i ta, - // zmeni cestu na root prvniho lokalniho fixed drivu (velka sance uspechu, panel nezustane prazdny); - // 'panel' je jeden z PANEL_XXX; neni-li 'suggestedTopIndex' -1, bude nastaven jako top-index - // v panelu (jen pro novou cestu, na zkracene (zmenene) ceste se nenastavuje); neni-li - // 'suggestedFocusName' NULL, zkusi se nalezt (ignore-case) a vyfokusit polozka stejneho jmena - // (jen pro novou cestu, na zkracene (zmenene) ceste se neprovadi); je-li 'forceUpdate' TRUE, - // neoptimalizuje se (cesta se normalne vylistuje) pripad zmeny cesty na aktualni cestu v panelu - // (bud nova cesta odpovida aktualni ceste rovnou nebo na ni byla hned prvnim ChangePath - // zkracena); je-li 'convertPathToInternal' TRUE, najde se podle 'fsName' plugin a zavola se - // jeho metoda CPluginInterfaceForFSAbstract::ConvertPathToInternal() pro 'fsUserPart'; - // neni-li 'failReason' NULL, nastavuje se na jednu z konstant CHPPFR_XXX (informuje - // o vysledku metody); vraci TRUE pokud se podarilo vylistovat pozadovanou cestu - // (nezkracenou/nezmenenou) - // POZNAMKA: pokud potrebujete, aby se FS cesta zkusila otevrit i v odpojenych FS, pouzijte metodu - // ChangePanelPath (ChangePanelPathToPluginFS odpojene FS ignoruje - pracuje jen s FS otevrenym - // v panelu nebo otevira nove FS); - // omezeni: hlavni thread + mimo metody CPluginFSInterfaceAbstract a CPluginDataInterfaceAbstract - // (hrozi napr. zavreni FS otevreneho v panelu - metode by mohl prestat existovat 'this') + // Changes the panel path to a plugin FS. 'fsName' is the FS name (see GetPluginFSName; it does not have to belong to this plugin), and 'fsUserPart' is the path within the FS. If the new FS path is not available, it tries shortened paths by repeated calls to ChangePath and ListCurrentPath (see CPluginFSInterfaceAbstract). If the path is being changed within the current FS (see CPluginFSInterfaceAbstract::IsOurPath) and no accessible path can be found starting from the new path, it also tries to find an accessible path starting from the old current path, and if that also fails, it changes the panel path to the root of the first local fixed drive so the panel does not stay empty. 'panel' is one of PANEL_XXX. If 'suggestedTopIndex' is not -1, it is used as the panel top index, but only for the new path, not for a shortened or changed path. If 'suggestedFocusName' is not NULL, an item with the same name is searched for case-insensitively and focused, again only for the new path, not for a shortened or changed path. If 'forceUpdate' is TRUE, the special case of changing to the current panel path is not optimized away; the path is listed normally even if the new path already matches the current path or was shortened to it by the first ChangePath call. If 'convertPathToInternal' is TRUE, the plugin identified by 'fsName' is found and its CPluginInterfaceForFSAbstract::ConvertPathToInternal() method is called for 'fsUserPart'. If 'failReason' is not NULL, it is set to one of the CHPPFR_XXX constants describing the result. Returns TRUE if the requested path was listed without shortening or other changes. + // NOTE: If you need an FS path to be tried in detached FS instances as well, use ChangePanelPath; ChangePanelPathToPluginFS ignores detached FS instances and works only with an FS already open in a panel or opens a new FS. + // Restriction: main thread + outside CPluginFSInterfaceAbstract and CPluginDataInterfaceAbstract methods (for example, an FS open in the panel could be closed and 'this' could cease to exist). virtual BOOL WINAPI ChangePanelPathToPluginFS(int panel, const char* fsName, const char* fsUserPart, int* failReason = NULL, int suggestedTopIndex = -1, const char* suggestedFocusName = NULL, BOOL forceUpdate = FALSE, BOOL convertPathToInternal = FALSE) = 0; - // zmena cesty v panelu do odpojeneho pluginoveho FS (viz FSE_DETACHED/FSE_ATTACHED), - // 'detachedFS' je odpojeny pluginovy FS; pokud neni aktualni cesta v odpojenem FS dostupna, - // zkousi uspet se zkracenymi cestami (opakovane volani ChangePath a ListCurrentPath, viz - // CPluginFSInterfaceAbstract); 'panel' je jeden z PANEL_XXX; neni-li 'suggestedTopIndex' -1, - // bude nastaven jako top-index v panelu (jen pro novou cestu, na zkracene (zmenene) ceste - // se nenastavuje); neni-li 'suggestedFocusName' NULL, zkusi se nalezt (ignore-case) a vyfokusit - // polozka stejneho jmena (jen pro novou cestu, na zkracene (zmenene) ceste se neprovadi); - // neni-li 'failReason' NULL, nastavuje se na jednu z konstant CHPPFR_XXX (informuje o vysledku - // metody); vraci TRUE pokud se podarilo vylistovat pozadovanou cestu (nezkracenou/nezmenenou) - // omezeni: hlavni thread + mimo metody CPluginFSInterfaceAbstract a CPluginDataInterfaceAbstract - // (hrozi napr. zavreni FS otevreneho v panelu - metode by mohl prestat existovat 'this') + // Changes the panel path to a detached plugin FS (see FSE_DETACHED/FSE_ATTACHED). 'detachedFS' is a detached plugin FS. If the current path in the detached FS is not available, it tries shortened paths by repeated calls to ChangePath and ListCurrentPath (see CPluginFSInterfaceAbstract). 'panel' is one of PANEL_XXX. If 'suggestedTopIndex' is not -1, it is used as the panel top index, but only for the new path, not for a shortened or changed path. If 'suggestedFocusName' is not NULL, an item with the same name is searched for case-insensitively and focused, again only for the new path, not for a shortened or changed path. If 'failReason' is not NULL, it is set to one of the CHPPFR_XXX constants describing the result. Returns TRUE if the requested path was listed without shortening or other changes. Restriction: main thread + outside CPluginFSInterfaceAbstract and CPluginDataInterfaceAbstract methods (for example, an FS open in the panel could be closed and 'this' could cease to exist). virtual BOOL WINAPI ChangePanelPathToDetachedFS(int panel, CPluginFSInterfaceAbstract* detachedFS, int* failReason = NULL, int suggestedTopIndex = -1, const char* suggestedFocusName = NULL) = 0; - // zmena cesty v panelu na root prvniho lokalniho fixed drivu, jde o temer jistou zmenu - // aktualni cesty v panelu; 'panel' je jeden z PANEL_XXX; neni-li 'failReason' NULL, - // nastavuje se na jednu z konstant CHPPFR_XXX (informuje o vysledku metody); vraci - // TRUE pokud se podarilo vylistovat root prvniho lokalniho fixed drivu - // omezeni: hlavni thread + mimo metody CPluginFSInterfaceAbstract a CPluginDataInterfaceAbstract - // (hrozi napr. zavreni FS otevreneho v panelu - metode by mohl prestat existovat 'this') + // Changes the panel path to the root of the first local fixed drive; this almost certainly changes the current path in the panel. 'panel' is one of PANEL_XXX. If 'failReason' is not NULL, it is set to one of the CHPPFR_XXX constants describing the result. Returns TRUE if the root of the first local fixed drive was successfully listed. + // Restriction: main thread + outside CPluginFSInterfaceAbstract and CPluginDataInterfaceAbstract methods (for example, an FS open in the panel could be closed and 'this' could cease to exist). virtual BOOL WINAPI ChangePanelPathToFixedDrive(int panel, int* failReason = NULL) = 0; - // provede refresh cesty v panelu (znovu nacte listing a prenese oznaceni, ikony, fokus, atd. - // do noveho obsahu panelu); diskove a FS cesty se vzdycky nacitaji znovu, cesty do archivu - // se nacitaji jen pokud doslo ke zmene souboru archivu (kontrola size & time) nebo pokud - // je 'forceRefresh' TRUE; thumbnaily na diskovych cestach se nacitaji znovu jen pri zmene - // velikosti souboru nebo zmene datumu/casu posledniho zapisu do souboru nebo pokud je - // 'forceRefresh' TRUE; 'panel' je jeden z PANEL_XXX; je-li 'focusFirstNewItem' TRUE a - // v panelu pribyla jen jedina polozka, dojde k fokusu teto nove polozky (pouziva se napr. - // pro fokus nove vytvoreneho souboru/adresare) - // omezeni: hlavni thread a navic jen mimo metody CPluginFSInterfaceAbstract a - // CPluginDataInterfaceAbstract (hrozi napr. zavreni FS otevreneho v panelu - metode by - // mohl prestat existovat 'this') + // Refreshes the panel path (reloads the listing and transfers selections, icons, focus, etc. to the new panel contents). Disk and FS paths are always reloaded. Archive paths are reloaded only if the archive file changed (size & time check) or if 'forceRefresh' is TRUE. Thumbnails on disk paths are reloaded only if the file size or last-write date/time changed, or if 'forceRefresh' is TRUE. 'panel' is one of PANEL_XXX. If 'focusFirstNewItem' is TRUE and exactly one new item appeared in the panel, that new item is focused (for example, to focus a newly created file or directory). + // Restriction: main thread, and only outside CPluginFSInterfaceAbstract and CPluginDataInterfaceAbstract methods (for example, an FS open in the panel could be closed and 'this' could cease to exist). virtual void WINAPI RefreshPanelPath(int panel, BOOL forceRefresh = FALSE, BOOL focusFirstNewItem = FALSE) = 0; - // postne panelu zpravu o tom, ze by se mel provest refresh cesty (znovu nacte listing a - // prenese oznaceni, ikony, fokus, atd. do noveho obsahu panelu); refresh se provede az - // dojde k aktivaci hlavniho okna Salamandera (az skonci suspend-mode); diskove - // a FS cesty se vzdycky nacitaji znovu, cesty do archivu se nacitaji jen pokud doslo ke - // zmene souboru archivu (kontrola size & time); 'panel' je jeden z PANEL_XXX; je-li - // 'focusFirstNewItem' TRUE a v panelu pribyla jen jedina polozka, dojde k fokusu teto - // nove polozky (pouziva se napr. pro fokus nove vytvoreneho souboru/adresare) - // mozne volat z libovolneho threadu (pokud hlavni thread nespousti kod uvnitr pluginu, - // probehne refresh co nejdrive, jinak refresh pocka minimalne do okamziku, kdy hlavni - // thread opusti plugin) + // Posts a message to the panel requesting a path refresh (reloads the listing and transfers selections, icons, focus, etc. to the new panel contents). The refresh is performed only after Salamander's main window becomes active again, that is, after suspend mode ends. Disk and FS paths are always reloaded. Archive paths are reloaded only if the archive file changed (size & time check). 'panel' is one of PANEL_XXX. If 'focusFirstNewItem' is TRUE and exactly one new item appeared in the panel, that new item is focused (for example, to focus a newly created file or directory). Callable from any thread; if the main thread is not running code inside a plugin, the refresh happens as soon as possible, otherwise it waits at least until the main thread leaves the plugin. virtual void WINAPI PostRefreshPanelPath(int panel, BOOL focusFirstNewItem = FALSE) = 0; - // postne panelu s aktivnim FS 'modifiedFS' zpravu o tom, ze by se mel - // provest refresh cesty (znovu nacte listing a prenese oznaceni, ikony, fokus, atd. do - // noveho obsahu panelu); refresh se provede az dojde k aktivaci hlavniho okna Salamandera - // (az skonci suspend-mode); FS cesta se vzdycky nacte znovu; pokud 'modifiedFS' neni v zadnem - // panelu, neprovede se nic; je-li 'focusFirstNewItem' TRUE a v panelu pribyla jen jedina - // polozka, dojde k fokusu teto nove polozky (pouziva se napr. pro fokus nove vytvoreneho - // souboru/adresare); - // POZNAMKA: existuje jeste PostRefreshPanelFS2, ktera vraci TRUE pokud se provedl refresh, - // FALSE pokud nebyl 'modifiedFS' nalezen ani v jednom panelu; - // mozne volat z libovolneho threadu (pokud hlavni thread nespousti kod uvnitr pluginu, - // probehne refresh co nejdrive, jinak refresh pocka minimalne do okamziku, kdy hlavni - // thread opusti plugin) + // Posts a message to the panel with active FS 'modifiedFS' requesting a path refresh (reloads the listing and transfers selections, icons, focus, etc. to the new panel contents). The refresh is performed only after Salamander's main window becomes active again, that is, after suspend mode ends. The FS path is always reloaded. If 'modifiedFS' is not open in any panel, nothing happens. If 'focusFirstNewItem' is TRUE and exactly one new item appeared in the panel, that new item is focused (for example, to focus a newly created file or directory). + // NOTE: PostRefreshPanelFS2 also exists; it returns TRUE if a refresh was performed, FALSE if 'modifiedFS' was not found in either panel. + // Callable from any thread; if the main thread is not running code inside a plugin, the refresh happens as soon as possible, otherwise it waits at least until the main thread leaves the plugin. virtual void WINAPI PostRefreshPanelFS(CPluginFSInterfaceAbstract* modifiedFS, BOOL focusFirstNewItem = FALSE) = 0; - // zavre odpojeny pluginovy FS (pokud se necha, viz CPluginFSInterfaceAbstract::TryCloseOrDetach), - // 'detachedFS' je odpojeny pluginovy FS; vraci TRUE pri uspechu (FALSE znamena, ze se odpojeny - // pluginovy FS nezavrel); 'parent' je parent pripadnych messageboxu (zatim je muze otevrit jen - // CPluginFSInterfaceAbstract::ReleaseObject) - // Poznamka: plugin FS otevreny v panelu se zavre napr. pomoci ChangePanelPathToRescuePathOrFixedDrive - // omezeni: hlavni thread + mimo metody CPluginFSInterfaceAbstract (snazime se o zavreni - // odpojeneho FS - metode by mohl prestat existovat 'this') + // Closes a detached plugin FS if possible (see CPluginFSInterfaceAbstract::TryCloseOrDetach). 'detachedFS' is a detached plugin FS. Returns TRUE on success; FALSE means the detached plugin FS was not closed. 'parent' is the parent of any message boxes; currently only CPluginFSInterfaceAbstract::ReleaseObject can open them. + // Note: A plugin FS open in a panel can be closed, for example, with ChangePanelPathToRescuePathOrFixedDrive. + // Restriction: main thread + outside CPluginFSInterfaceAbstract methods (we are trying to close the detached FS, so 'this' could cease to exist). virtual BOOL WINAPI CloseDetachedFS(HWND parent, CPluginFSInterfaceAbstract* detachedFS) = 0; - // zdvojuje '&' - hodi se pro cesty zobrazovane v menu ('&&' se zobrazi jako '&'); - // 'buffer' je vstupne/vystupni retezec, 'bufferSize' je velikost 'buffer' v bytech; - // vraci TRUE pokud zdvojenim nedoslo ke ztrate znaku z konce retezce (buffer byl dost - // veliky) - // mozne volat z libovolneho threadu + // Duplicates '&'; useful for paths displayed in menus ('&&' is displayed as '&'). 'buffer' is an input/output string, and 'bufferSize' is the size of 'buffer' in bytes. Returns TRUE if duplicating '&' did not truncate characters from the end of the string, that is, the buffer was large enough. Callable from any thread. virtual BOOL WINAPI DuplicateAmpersands(char* buffer, int bufferSize) = 0; // odstrani '&' z textu; najde-li dvojici "&&", nahradi ji jednim znakem '&' // mozne volat z libovolneho threadu virtual void WINAPI RemoveAmpersands(char* text) = 0; - // ValidateVarString a ExpandVarString: - // metody pro overovani a expanzi retezcu s promennymi ve tvaru "$(var_name)", "$(var_name:num)" - // (num je sirka promenne, jde o ciselnou hodnotu od 1 do 9999), "$(var_name:max)" ("max" je - // symbol, ktery oznacuje, ze sirka promenne se ridi hodnotou v poli 'maxVarWidths', podrobnosti - // u ExpandVarString) a "$[env_var]" (expanduje hodnotu promenne prostredi); pouziva se pokud si - // uzivatel muze zadat format retezce (jako napr. v info-line) priklad retezce s promennymi: - // "$(files) files and $(dirs) directories" - promenne 'files' a 'dirs'; - // zdrojovy kod pro pouziti v info-line (bez promennych ve tvaru "$(varname:max)") je v DEMOPLUG - // - // kontroluje syntaxi 'varText' (retezce s promennymi), vraci FALSE pokud najde chybu, jeji - // pozici umisti do 'errorPos1' (offset zacatku chybne casti) a 'errorPos2' (offset konce chybne - // casti); 'variables' je pole struktur CSalamanderVarStrEntry, ktere je ukonceno strukturou s - // Name==NULL; 'msgParent' je parent message-boxu s chybami, je-li NULL, chyby se nevypisuji + // ValidateVarString and ExpandVarString: + // Methods for validating and expanding strings with variables of the form "$(var_name)", "$(var_name:num)" (where num is the variable width, a numeric value from 1 to 9999), "$(var_name:max)" (where "max" means the variable width is taken from the values in the 'maxVarWidths' array; see ExpandVarString for details), and "$[env_var]" (expands the value of an environment variable). This is used when the user can enter a string format, for example in the info line. Example string with variables: + // "$(files) files and $(dirs) directories" - variables 'files' and 'dirs'; + // source code for use in the info line, without variables of the form "$(varname:max)", is in DEMOPLUG + // + // Validates the syntax of 'varText' (a string with variables). Returns FALSE if it finds an error; the error position is stored in 'errorPos1' (offset of the start of the invalid part) and 'errorPos2' (offset of the end of the invalid part). 'variables' is an array of CSalamanderVarStrEntry structures terminated by an entry with Name==NULL. 'msgParent' is the parent of error message boxes; if NULL, no errors are displayed. virtual BOOL WINAPI ValidateVarString(HWND msgParent, const char* varText, int& errorPos1, int& errorPos2, const CSalamanderVarStrEntry* variables) = 0; - // - // naplni 'buffer' vysledkem expanze 'varText' (retezce s promennymi), vraci FALSE pokud je - // 'buffer' maly (predpoklada overeni retezce s promennymi pres ValidateVarString, jinak - // vraci FALSE i pri chybe syntaxe) nebo uzivatel kliknul na Cancel pri chybe environment-variable - // (nenalezena nebo prilis velka); 'bufferLen' je velikost bufferu 'buffer'; - // 'variables' je pole struktur CSalamanderVarStrEntry, ktere je ukonceno strukturou - // s Name==NULL; 'param' je ukazatel, ktery se predava do CSalamanderVarStrEntry::Execute - // pri expanzi nalezene promenne; 'msgParent' je parent message-boxu s chybami, je-li NULL, - // chyby se nevypisuji; je-li 'ignoreEnvVarNotFoundOrTooLong' TRUE, ignoruji se chyby - // environment-variable (nenalezena nebo prilis velka), je-li FALSE, zobrazi se messagebox - // s chybou; neni-li 'varPlacements' NULL, ukazuje na pole DWORDu o '*varPlacementsCount' polozkach, - // ktere bude naplneno DWORDy slozenymi vzdy z pozice promenne ve vystupnim bufferu (spodni WORD) - // a poctu znaku promenne (horni WORD); neni-li 'varPlacementsCount' NULL, vraci se v nem pocet - // naplnenych polozek v poli 'varPlacements' (jde vlastne o pocet promennych ve vstupnim - // retezci); - // pokud se tato metoda pouziva jen k expanzi retezce pro jednu hodnotu 'param', meli by - // byt nastaveny 'detectMaxVarWidths' na FALSE, 'maxVarWidths' na NULL a 'maxVarWidthsCount' - // na 0; pokud se ovsem pouziva tato metoda pro expanzi retezce opakovane pro urcitou - // mnozinu hodnot 'param' (napr. u Make File List je to expanze radky postupne pro vsechny - // oznacene soubory a adresare), ma smysl pouzivat i promenne ve tvaru "$(varname:max)", - // u techto promennych se sirka urci jako nejvetsi sirka expandovane promenne v ramci cele - // mnoziny hodnot; omereni nejvetsi sirky expandovane promenne se provadi v prvnim cyklu - // (pro vsechny hodnoty mnoziny) volani ExpandVarString, v prvnim cyklu ma parametr - // 'detectMaxVarWidths' hodnotu TRUE a pole 'maxVarWidths' o 'maxVarWidthsCount' polozkach - // je predem nulovane (slouzi pro ulozeni maxim mezi jednotlivymi volanimi ExpandVarString); - // samotna expanze pak probiha v druhem cyklu (pro vsechny hodnoty mnoziny) volani - // ExpandVarString, v druhem cyklu ma parametr 'detectMaxVarWidths' hodnotu FALSE a pole - // 'maxVarWidths' o 'maxVarWidthsCount' polozkach obsahuje predpocitane nejvetsi sirky - // (z prvniho cyklu) + // Fills 'buffer' with the result of expanding 'varText' (a string with variables). Returns FALSE if 'buffer' is too small (it assumes the variable string was validated by ValidateVarString; otherwise it also returns FALSE on syntax errors) or if the user clicked Cancel on an environment-variable error (not found or too long). 'bufferLen' is the size of 'buffer'. + // 'variables' is an array of CSalamanderVarStrEntry structures terminated by an entry with Name==NULL. 'param' is a pointer passed to CSalamanderVarStrEntry::Execute when an encountered variable is expanded. 'msgParent' is the parent of error message boxes; if NULL, no errors are displayed. If 'ignoreEnvVarNotFoundOrTooLong' is TRUE, environment-variable errors (not found or too long) are ignored; if FALSE, an error message box is shown. If 'varPlacements' is not NULL, it points to an array of DWORD values with '*varPlacementsCount' items; the array is filled with DWORD values composed of the variable position in the output buffer (low WORD) and the variable length in characters (high WORD). If 'varPlacementsCount' is not NULL, it receives the number of filled items in 'varPlacements' (that is, the number of variables in the input string). + // If this method is used only to expand the string for a single 'param' value, 'detectMaxVarWidths' should be FALSE, 'maxVarWidths' should be NULL, and 'maxVarWidthsCount' should be 0. If the method is used repeatedly to expand the string for a set of 'param' values (for example, in Make File List, where the line is expanded sequentially for all selected files and directories), it also makes sense to use variables of the form "$(varname:max)". For those variables, the width is the largest expanded variable width across the whole set of values. Measuring that maximum width is done in the first ExpandVarString pass over the whole set. In that first pass, 'detectMaxVarWidths' is TRUE and the 'maxVarWidths' array of 'maxVarWidthsCount' items is zero-initialized in advance (it stores maxima across individual ExpandVarString calls). The actual expansion then runs in the second ExpandVarString pass over the whole set. In that second pass, 'detectMaxVarWidths' is FALSE and the 'maxVarWidths' array of 'maxVarWidthsCount' items contains the precomputed maximum widths from the first pass. virtual BOOL WINAPI ExpandVarString(HWND msgParent, const char* varText, char* buffer, int bufferLen, const CSalamanderVarStrEntry* variables, void* param, BOOL ignoreEnvVarNotFoundOrTooLong = FALSE, @@ -1783,275 +1624,122 @@ class CSalamanderGeneralAbstract BOOL detectMaxVarWidths = FALSE, int* maxVarWidths = NULL, int maxVarWidthsCount = 0) = 0; - // nastavi flag load-on-salamander-start (loadit plugin pri startu Salamandera?) pluginu; - // 'start' je nova hodnota flagu; vraci starou hodnotu flagu; pokud se nikdy nevolala - // SetFlagLoadOnSalamanderStart, je flag nastaven na FALSE (plugin se neloadi pri startu, ale - // az v pripade potreby) - // omezeni: hlavni thread (jinak muze dojit ke zmenam v konfiguraci pluginu behem volani) + // Sets the plugin's load-on-Salamander-start flag. 'start' is the new value of the flag. Returns the old value of the flag. If SetFlagLoadOnSalamanderStart has never been called, the flag is FALSE, so the plugin is not loaded at startup but only when needed. + // Restriction: main thread (otherwise plugin configuration may change during the call). virtual BOOL WINAPI SetFlagLoadOnSalamanderStart(BOOL start) = 0; - // nastavi volajicimu pluginu priznak, ze se ma pri nejblizsi mozne prilezitosti unloadnout - // (jakmile budou provedeny vsechny postnute prikazy menu (viz PostMenuExtCommand), nebudou - // v message-queue hl. threadu zadne message a Salamander nebude "busy"); + // marks the calling plugin to be unloaded at the next possible opportunity + // (once all posted menu commands have been processed (see PostMenuExtCommand), there are no + // messages in the main-thread message queue, and Salamander is not "busy"); // POZOR: pokud se vola z jineho nez hlavniho threadu, muze dojit k zadosti o unload (probiha - // v hlavnim threadu) dokonce drive nez skonci PostUnloadThisPlugin (dalsi informace o + // in the main thread) even before PostUnloadThisPlugin returns (for more information about // unloadu - viz CPluginInterfaceAbstract::Release) - // mozne volat z libovolneho threadu (ale az po ukonceni entry-pointu pluginu, dokud se - // spousti entry-point, je mozne metodu volat jen z hlavniho threadu) + // callable from any thread, but only after the plugin entry point has finished; while the + // entry point is running, the method may be called only from the main thread virtual void WINAPI PostUnloadThisPlugin() = 0; - // vraci postupne moduly Salamandera (spustitelny soubor a .spl soubory instalovanych - // pluginu, vse vcetne verzi); 'index' je vstupne/vystupni promenna, ukazuje na int, - // ve kterem je pri prvnim volani 0, hodnotu pro dalsi volani si funkce ulozi pri navratu - // (pouziti: na zacatku vynulovat, pak nemenit); 'module' je buffer pro jmeno modulu - // (min. velikost MAX_PATH znaku); 'version' je buffer pro verzi modulu (min. velikost - // MAX_PATH znaku); vraci FALSE pokud 'module' + 'version' neni naplnene a jiz neni - // zadny dalsi modul, vraci TRUE pokud 'module' + 'version' obsahuje dalsi modul - // omezeni: hlavni thread (jinak muze dojit ke zmenam v konfiguraci pluginu behem - // volani - add/remove) + // Enumerates Salamander modules one by one (the executable file and the .spl files of installed plugins, all including version information). 'index' is an input/output variable pointing to an int; it must be 0 on the first call, and the function stores the value for the next call on return (usage: initialize it to 0, then do not modify it). 'module' is a buffer for the module name (minimum size MAX_PATH characters). 'version' is a buffer for the module version (minimum size MAX_PATH characters). Returns FALSE if 'module' and 'version' were not filled because there is no next module; returns TRUE if 'module' and 'version' contain the next module. Restriction: main thread (configuration may change during the call because of add/remove operations). virtual BOOL WINAPI EnumInstalledModules(int* index, char* module, char* version) = 0; - // vola 'loadOrSaveFunc' pro load nebo save konfigurace; je-li 'load' TRUE, jde o load - // konfigurace, pokud plugin podporuje "load/save configuration" a v dobe volani existuje - // soukromy klic pluginu v registry, vola se 'loadOrSaveFunc' pro tento klic, jinak - // se vola load defaultni konfigurace (parametr 'regKey' funkce 'loadOrSaveFunc' je NULL); - // je-li 'load' FALSE, jde o save konfigurace, 'loadOrSaveFunc' se vola jen tehdy, pokud - // plugin podporuje "load/save configuration" a v dobe volani existuje klic Salamandera; - // 'param' je uzivatelsky parametr a je predavan do 'loadOrSaveFunc' - // omezeni: hlavni thread, v entry-pointu lze volat az po SetBasicPluginData, - // drive nemusi byt znamo jestli existuje podpora pro "load/save configuration" a jmeno - // soukromeho klice v registry + // Calls 'loadOrSaveFunc' to load or save configuration. If 'load' is TRUE, this is a configuration load. If the plugin supports "load/save configuration" and the plugin's private registry key exists at call time, 'loadOrSaveFunc' is called for that key; otherwise the default configuration is loaded ('regKey' passed to 'loadOrSaveFunc' is NULL). If 'load' is FALSE, this is a configuration save, and 'loadOrSaveFunc' is called only if the plugin supports "load/save configuration" and Salamander's key exists at call time. 'param' is a user parameter passed to 'loadOrSaveFunc'. + // Restriction: main thread; in the entry point, this can be called only after SetBasicPluginData, because before that it may not yet be known whether "load/save configuration" is supported and what the private registry key name is. virtual void WINAPI CallLoadOrSaveConfiguration(BOOL load, FSalLoadOrSaveConfiguration loadOrSaveFunc, void* param) = 0; - // ulozi 'text' o delce 'textLen' (-1 znamena "pouzij strlen") na clipboard a to jak multibyte, - // tak Unicodove (jinak napr. Notepad nezvlada cestinu), v pripade uspechu muze (je-li 'echo' TRUE) - // zobrazit hlaseni "Text was successfully copied to clipboard." (parent messageboxu bude - // 'echoParent'); vraci TRUE pri uspechu - // mozne volat z libovolneho threadu + // Copies 'text' of length 'textLen' to the clipboard (-1 means "use strlen") in both multibyte and Unicode form (otherwise, for example, Notepad cannot handle Czech text). On success it may, if 'echo' is TRUE, display the message "Text was successfully copied to clipboard." ('echoParent' is the parent of the message box). Returns TRUE on success. Callable from any thread. virtual BOOL WINAPI CopyTextToClipboard(const char* text, int textLen, BOOL showEcho, HWND echoParent) = 0; - // ulozi unicodovy 'text' o delce 'textLen' (-1 znamena "pouzij wcslen") na clipboard a to jak - // unicodove, tak multibyte (jinak napr. MSVC6.0 nezvlada cestinu), v pripade uspechu muze (je-li - // 'echo' TRUE) zobrazit hlaseni "Text was successfully copied to clipboard." (parent messageboxu - // bude 'echoParent'); vraci TRUE pri uspechu - // mozne volat z libovolneho threadu + // Copies Unicode 'text' of length 'textLen' to the clipboard (-1 means "use wcslen") in both Unicode and multibyte form (otherwise, for example, MSVC6.0 cannot handle Czech text). On success it may, if 'echo' is TRUE, display the message "Text was successfully copied to clipboard." ('echoParent' is the parent of the message box). Returns TRUE on success. Callable from any thread. virtual BOOL WINAPI CopyTextToClipboardW(const wchar_t* text, int textLen, BOOL showEcho, HWND echoParent) = 0; - // spusteni prikazu menu s identifikacnim cislem 'id' v hlavnim threadu (volani + // executes the menu command identified by 'id' in the main thread (calls // CPluginInterfaceForMenuExtAbstract::ExecuteMenuItem(salamander, main-window-hwnd, 'id', 0), - // 'salamander' je NULL pokud je 'waitForSalIdle' FALSE, jinak obsahuje ukazatel na platnou - // sadu pouzitelnych metod Salamandera pro provadeni operaci; navratova hodnota - // se ignoruje); je-li 'waitForSalIdle' FALSE, pouzije se ke spusteni zprava postnuta - // hlavnimu oknu (tuto zpravu doruci kazda bezici message-loopa v hl. threadu - i modalni - // dialogy/messageboxy, i ty otevrene pluginem), takze hrozi vicenasobny vstup - // do pluginu; je-li 'waitForSalIdle' TRUE, je 'id' omezeno na interval <0, 999999> a - // prikaz se spusti jakmile nebudou v message-queue hl. threadu zadne zpravy a Salamander - // nebude "busy" (nebude otevreny zadny modalni dialog a nebude se zpracovavat zadna zprava); - // POZOR: pokud se vola z jineho nez hlavniho threadu, muze dojit ke spusteni prikazu menu - // (probiha v hlavnim threadu) dokonce drive nez skonci PostMenuExtCommand - // mozne volat z libovolneho threadu a je-li 'waitForSalIdle' FALSE, je nutne pockat az po volani + // 'salamander' is NULL if 'waitForSalIdle' is FALSE; otherwise it contains a valid + // set of Salamander methods that can be used to perform operations; the return value + // is ignored). If 'waitForSalIdle' is FALSE, execution uses a message posted to the + // main window (that message is delivered by every running message loop in the main thread, + // including modal dialogs/message boxes, even those opened by the plugin), so re-entry + // into the plugin is possible; if 'waitForSalIdle' is TRUE, 'id' is limited to <0, 999999> and + // the command runs as soon as there are no messages in the main-thread message queue and Salamander + // is not "busy" (no modal dialog is open and no message is being processed); + // WARNING: if called from a thread other than the main thread, the menu command may run + // (in the main thread) even before PostMenuExtCommand returns + // callable from any thread, and if 'waitForSalIdle' is FALSE, it is necessary to wait until after calling // CPluginInterfaceAbstract::GetInterfaceForMenuExt (vola se po entry-pointu z hlavniho threadu) virtual void WINAPI PostMenuExtCommand(int id, BOOL waitForSalIdle) = 0; - // zjisti jestli je velka sance (jiste se to urcit neda), ze Salamander v pristich par - // okamzicich nebude "busy" (nebude otevreny zadny modalni dialog a nebude se zpracovavat - // zadna zprava) - v tomto pripade vraci TRUE (jinak FALSE); neni-li 'lastIdleTime' NULL, - // vraci se v nem GetTickCount() z okamziku posledniho prechodu z "idle" do "busy" stavu; - // da se pouzit napr. jako predpoved pro doruceni prikazu postnuteho pomoci - // CSalamanderGeneralAbstract::PostMenuExtCommand s parametrem 'waitForSalIdle'==TRUE; - // je mozne volat z libovolneho threadu + // Determines whether there is a high chance, though this cannot be known with certainty, that Salamander will not be "busy" during the next few moments (no modal dialog open and no message being processed); in that case it returns TRUE, otherwise FALSE. If 'lastIdleTime' is not NULL, it receives the GetTickCount() value from the last transition from the "idle" state to the "busy" state. This can be used, for example, as a prediction for the delivery of a command posted with CSalamanderGeneralAbstract::PostMenuExtCommand and 'waitForSalIdle'==TRUE. Callable from any thread. virtual BOOL WINAPI SalamanderIsNotBusy(DWORD* lastIdleTime) = 0; - // nastavi zpravu, kterou ma vypsat Bug Report dialog pokud dojde k padu uvnitr pluginu - // (uvnitr pluginu = alespon jedna call-stack-message ulozena z pluginu) a umozni predefinovat - // standardni bug-reportovou e-mailovou adresu (support@altap.cz); 'message' je nova zprava - // (NULL znamena "zadna zprava"); 'email' je nova e-mailova adresa (NULL znamena "pouzij - // standardni"; max. delka e-mailu je 100 znaku); tuto metodu je mozne volat opakovane, puvodni - // zprava a e-mail se prepisuji; Salamander si pro dalsi spusteni nepamatuje ani zpravu ani - // e-mail, takze je nutne tuto metodu vzdy pri loadu pluginu (nejlepe v entry-pointu) znovu - // zavolat - // omezeni: hlavni thread (jinak muze dojit ke zmenam v konfiguraci pluginu behem volani) + // Sets the message that the Bug Report dialog should display if a crash occurs inside the plugin (inside the plugin means at least one call-stack message stored from the plugin), and allows the standard bug-report email address (support@altap.cz) to be overridden. 'message' is the new message (NULL means "no message"). 'email' is the new email address (NULL means "use the default"; maximum email length is 100 characters). This method may be called repeatedly; the previous message and email are overwritten. Salamander does not remember either the message or the email for the next run, so this method must be called again every time the plugin is loaded, ideally in the entry point. + // Restriction: main thread (otherwise plugin configuration may change during the call). virtual void WINAPI SetPluginBugReportInfo(const char* message, const char* email) = 0; - // zjisti jestli je plugin nainstalovan (ovsem nezjisti, jestli se da naloadit - jestli ho - // user napr. nesmazal jen z disku); 'pluginSPL' identifikuje plugin - jde o pozadovanou - // koncovou cast plne cesty .SPL souboru pluginu (napr. "ieviewer\\ieviewer.spl" identifikuje - // IEViewer dodavany se Salamanderem); vraci TRUE pokud je plugin nainstalovan - // omezeni: hlavni thread (jinak muze dojit ke zmenam v konfiguraci pluginu behem volani) + // Determines whether a plugin is installed. It does not determine whether the plugin can actually be loaded, for example if the user deleted it from disk. 'pluginSPL' identifies the plugin; it is the required trailing part of the full path to the plugin .SPL file (for example, "ieviewer\\ieviewer.spl" identifies the IEViewer shipped with Salamander). Returns TRUE if the plugin is installed. + // Restriction: main thread (otherwise plugin configuration may change during the call). virtual BOOL WINAPI IsPluginInstalled(const char* pluginSPL) = 0; - // otevre soubor ve vieweru implementovanem v pluginu nebo internim text/hex vieweru; - // je-li 'pluginSPL' NULL, ma byt pouzit interni text/hex viewer, jinak identifikuje plugin - // vieweru - jde o pozadovanou koncovou cast plne cesty .SPL souboru pluginu (napr. - // "ieviewer\\ieviewer.spl" identifikuje IEViewer dodavany se Salamanderem); 'pluginData' - // je struktura dat obsahujici jmeno viewovaneho souboru a nepovinne obsahuje take rozsirene - // parametry vieweru (viz popis CSalamanderPluginViewerData); je-li 'useCache' FALSE jsou - // 'rootTmpPath' a 'fileNameInCache' ignorovany a dojde jen k otevreni souboru ve viewru; - // je-li 'useCache' TRUE, bude soubor nejprve presunut do diskove cache pod jmenem souboru - // 'fileNameInCache' (jmeno je bez cesty), pak otevren ve vieweru a po uzavreni vieweru bude - // z diskove cache odstranen, pokud je soubor 'pluginData->FileName' na stejnem disku jako - // diskova cache, bude presun okamzity, jinak dojde ke kopirovani mezi svazky, ktere muze - // trvat delsi dobu, ale zadny progress se neukazuje (je-li 'rootTmpPath' NULL, je diskova - // cache ve Windows TEMP adresari, jinak je cesta do disk cache v 'rootTmpPath'; pro presun - // do disk cache se pouziva SalMoveFile), idealni je pouziti SalGetTempFileName - // s parametrem 'path' rovnym 'rootTmpPath'; vraci TRUE pri uspesnem otevreni souboru ve - // vieweru; vraci FALSE pokud dojde k chybe pri otevirani (konkretni duvod je ulozen v - // 'error' - 0 - uspech, 1 - nelze naloadit plugin, 2 - ViewFile z pluginu vratil - // chybu, 3 - nelze presunout soubor do disk cache), je-li 'useCache' TRUE, dojde - // k odstraneni souboru z disku (jako po uzavreni vieweru) - // omezeni: hlavni thread (jinak muze dojit ke zmenam v konfiguraci pluginu behem volani), - // navic neni mozne volat z entry-pointu (load pluginu neni reentrantni) + // Opens a file in a viewer implemented by a plugin or in the internal text/hex viewer. If 'pluginSPL' is NULL, the internal text/hex viewer is used; otherwise it identifies the viewer plugin by the required trailing part of the full path to the plugin .SPL file (for example, "ieviewer\\ieviewer.spl" identifies the IEViewer shipped with Salamander). 'pluginData' is a data structure containing the name of the viewed file and optionally additional viewer parameters (see CSalamanderPluginViewerData). If 'useCache' is FALSE, 'rootTmpPath' and 'fileNameInCache' are ignored and the file is only opened in the viewer. If 'useCache' is TRUE, the file is first moved into the disk cache under the file name 'fileNameInCache' (name only, no path), then opened in the viewer, and after the viewer is closed it is removed from the disk cache. If 'pluginData->FileName' is on the same disk as the disk cache, the move is immediate; otherwise the file is copied across volumes, which may take longer and shows no progress. If 'rootTmpPath' is NULL, the disk cache is in the Windows TEMP directory; otherwise the disk cache path is in 'rootTmpPath'. SalMoveFile is used to move the file into the disk cache; ideally use SalGetTempFileName with its 'path' parameter equal to 'rootTmpPath'. Returns TRUE if the file was opened successfully in the viewer. Returns FALSE if an error occurs while opening; the specific reason is stored in 'error' (0 - success, 1 - the plugin cannot be loaded, 2 - the plugin's ViewFile returned an error, 3 - the file cannot be moved into the disk cache). If 'useCache' is TRUE, the file is removed from disk in that case as well, just as after the viewer is closed. + // Restriction: main thread (otherwise plugin configuration may change during the call); additionally, it must not be called from the entry point (plugin loading is not reentrant). virtual BOOL WINAPI ViewFileInPluginViewer(const char* pluginSPL, CSalamanderPluginViewerData* pluginData, BOOL useCache, const char* rootTmpPath, const char* fileNameInCache, int& error) = 0; - // co nejdrive informuje Salamandera, pak vsechny nactene (loaded) pluginy a pak vsechny otevrene - // FS (v panelech i odpojene) o zmene na ceste 'path' (diskova nebo FS cesta); je dulezite pro - // cesty na nichz nelze monitorovat zmeny automaticky (viz FindFirstChangeNotification) nebo - // si toto monitorovani (auto-refresh) uzivatel vypnul, u FS si monitorovani zmen zajistuje - // sam plugin; informovani o zmenach probehne co nejdrive (pokud hlavni thread nespousti kod - // uvnitr pluginu, probehne refresh po doruceni zpravy hlavnimu oknu a pripadne po opetovnem - // povoleni refreshovani (po zavreni dialogu, atp.), jinak refresh pocka minimalne do okamziku, - // kdy hlavni thread opusti plugin); 'includingSubdirs' je TRUE v pripade, ze se zmena muze - // projevit i v podadresarich 'path'; - // POZOR: pokud se vola z jineho nez hlavniho threadu, muze dojit k informovani o zmenach - // (probiha v hlavnim threadu) dokonce drive nez skonci PostChangeOnPathNotification - // mozne volat z libovolneho threadu + // Notifies Salamander, then all loaded plugins, and then all open FS instances (in panels and detached) about a change on path 'path' (disk path or FS path) as soon as possible. This is important for paths whose changes cannot be monitored automatically (see FindFirstChangeNotification) or when the user has turned that monitoring off; for FS paths, change monitoring is handled by the plugin itself. Change notification runs as soon as possible: if the main thread is not running code inside a plugin, the refresh happens after the message is delivered to the main window and, if needed, after refreshing is allowed again (after a dialog is closed, etc.); otherwise the refresh waits at least until the main thread leaves the plugin. 'includingSubdirs' is TRUE if the change can also affect subdirectories of 'path'. + // WARNING: if called from a thread other than the main thread, change notification (which runs in the main thread) may happen even before PostChangeOnPathNotification returns. + // Callable from any thread. virtual void WINAPI PostChangeOnPathNotification(const char* path, BOOL includingSubdirs) = 0; - // zkusi pristup na windowsovou cestu 'path' (normal nebo UNC), probiha ve vedlejsim threadu, takze - // umoznuje prerusit zkousku klavesou ESC (po jiste dobe vybali okenko s hlasenim o ESC) - // 'echo' TRUE znamena povoleny vypis chybove hlasky (pokud cesta nebude pristupna); - // 'err' ruzne od ERROR_SUCCESS v kombinaci s 'echo' TRUE pouze zobrazi chybu (na cestu - // se jiz nepristupuje); 'parent' je parent messageboxu; vraci ERROR_SUCCESS v pripade, - // ze je cesta v poradku, jinak vraci standardni windowsovy kod chyby nebo ERROR_USER_TERMINATED - // v pripade, ze uzivatel pouzil klavesu ESC k preruseni testu - // omezeni: hlavni thread (opakovane volani neni mozne a hl. thread tuto metodu pouziva) + // Attempts to access Windows path 'path' (normal or UNC). It runs in a worker thread, so the test can be interrupted with the ESC key; after some time a window appears telling the user about ESC. 'echo' TRUE means error messages are allowed if the path is not accessible. If 'err' is not ERROR_SUCCESS and 'echo' is TRUE, the method only shows the error and does not access the path again. 'parent' is the parent of the message box. Returns ERROR_SUCCESS if the path is OK; otherwise it returns a standard Windows error code or ERROR_USER_TERMINATED if the user pressed ESC to cancel the test. + // Restriction: main thread (repeated calls are not possible and the main thread uses this method). virtual DWORD WINAPI SalCheckPath(BOOL echo, const char* path, DWORD err, HWND parent) = 0; - // zkusi jestli je windowsova cesta 'path' pristupna, prip. obnovi sitova spojeni (pokud jde - // o normalni cestu, zkusi ozivit zapamatovane sit. spojeni, pokud jde o UNC cestu, umozni login - // s novym uzivatelskym jmenem a heslem); vraci TRUE pokud je cesta pristupna; 'parent' je parent - // messageboxu a dialogu; 'tryNet' je TRUE pokud ma smysl zkouset obnovit sitova spojeni - // (pri FALSE degraduje na SalCheckPath; je zde jen pro moznost optimalizace) - // omezeni: hlavni thread (opakovane volani neni mozne a hl. thread tuto metodu pouziva) + // Checks whether Windows path 'path' is accessible and, if necessary, restores network connections. For a normal path it tries to revive a remembered network connection; for a UNC path it allows login with a new user name and password. Returns TRUE if the path is accessible. 'parent' is the parent of message boxes and dialogs. 'tryNet' is TRUE if trying to restore network connections makes sense; if FALSE, the method degrades to SalCheckPath and exists only as an optimization. + // Restriction: main thread (repeated calls are not possible and the main thread uses this method). virtual BOOL WINAPI SalCheckAndRestorePath(HWND parent, const char* path, BOOL tryNet) = 0; - // slozitejsi varianta metody SalCheckAndRestorePath; zkusi jestli je windowsovou cesta 'path' - // pristupna, prip. ji zkrati; je-li 'tryNet' TRUE, zkusi i obnovit sitove spojeni a nastavi - // 'tryNet' na FALSE (pokud jde o normalni cestu, zkusi ozivit zapamatovane sit. spojeni, pokud - // jde o UNC cestu, umozni login s novym uzivatelskym jmenem a heslem); je-li 'donotReconnect' - // TRUE, zjisti se pouze chyba, obnova spojeni uz se neprovede; vraci 'err' (windowsovy kod chyby - // aktualni cesty), 'lastErr' (kod chyby vedouci ke zkraceni cesty), 'pathInvalid' (TRUE pokud - // se zkusila obnova sit. spojeni bez uspechu), 'cut' (TRUE pokud je vysledna cesta zkracena); - // 'parent' je parent messageboxu; vraci TRUE pokud je vysledna cesta 'path' pristupna - // omezeni: hlavni thread (opakovane volani neni mozne a hl. thread tuto metodu pouziva) + // More complex variant of SalCheckAndRestorePath. It checks whether Windows path 'path' is accessible and, if necessary, shortens it. If 'tryNet' is TRUE, it also tries to restore network connections and then sets 'tryNet' to FALSE. For a normal path it tries to revive a remembered network connection; for a UNC path it allows login with a new user name and password. If 'donotReconnect' is TRUE, only the error is determined and no reconnection is attempted. Returns 'err' (Windows error code of the current path), 'lastErr' (the error code that led to shortening the path), 'pathInvalid' (TRUE if restoring the network connection was attempted without success), and 'cut' (TRUE if the resulting path was shortened). 'parent' is the parent of the message box. Returns TRUE if the resulting path 'path' is accessible. + // Restriction: main thread (repeated calls are not possible and the main thread uses this method). virtual BOOL WINAPI SalCheckAndRestorePathWithCut(HWND parent, char* path, BOOL& tryNet, DWORD& err, DWORD& lastErr, BOOL& pathInvalid, BOOL& cut, BOOL donotReconnect) = 0; - // rozpozna o jaky typ cesty (FS/windowsova/archiv) jde a postara se o rozdeleni na - // jeji casti (u FS jde o fs-name a fs-user-part, u archivu jde o path-to-archive a - // path-in-archive, u windowsovych cest jde o existujici cast a zbytek cesty), u FS cest - // se nic nekontroluje, u windowsovych (normal + UNC) cest se kontroluje kam az cesta existuje - // (prip. obnovi sitove spojeni), u archivu se kontroluje existence souboru archivu - // (rozliseni archivu dle pripony); - // 'path' je plna nebo relativni cesta (buffer min. 'pathBufSize' znaku; u relativnich cest se - // uvazuje aktualni cesta 'curPath' (neni-li NULL) jako zaklad pro vyhodnoceni plne cesty; - // 'curPathIsDiskOrArchive' je TRUE pokud je 'curPath' windowsova nebo archivova cesta; - // pokud je aktualni cesta archivova, obsahuje 'curArchivePath' jmeno archivu, jinak je NULL), - // do 'path' se ulozi vysledna plna cesta (musi byt min. 'pathBufSize' znaku); vraci TRUE pri - // uspesnem rozpoznani, pak 'type' je typ cesty (viz PATH_TYPE_XXX) a 'secondPart' je nastavene: - // - do 'path' na pozici za existujici cestu (za '\\' nebo na konci retezce; existuje-li - // v ceste soubor, ukazuje za cestu k tomuto souboru) (typ cesty windows), POZOR: neresi - // se delka vracene casti cesty (cela cesta muze byt delsi nez MAX_PATH) - // - za soubor archivu (typ cesty archiv), POZOR: neresi se delka cesty v archivu (muze byt - // delsi nez MAX_PATH) - // - za ':' za nazvem file-systemu - user-part cesty file-systemu (typ cesty FS), POZOR: neresi - // se delka user-part cesty (muze byt delsi nez MAX_PATH); - // pokud vraci TRUE je jeste 'isDir' nastavena na: - // - TRUE pokud existujici cast cesty je adresar, FALSE == soubor (typ cesty windows) - // - FALSE pro cesty typu archiv a FS; - // pokud vrati FALSE, userovi byla vypsana chyba (az na jednu vyjimku - viz popis SPP_INCOMLETEPATH), - // ktera pri rozpoznavani nastala (neni-li 'error' NULL, vraci se v nem jedna z konstant SPP_XXX); - // 'errorTitle' je titulek messageboxu s chybou; pokud je 'nextFocus' != NULL a windowsova/archivova - // cesta neobsahuje '\\' nebo na '\\' jen konci, nakopiruje se cesta do 'nextFocus' (viz SalGetFullName); - // POZOR: pouziva SalGetFullName, proto je dobre napred zavolat metodu - // CSalamanderGeneralAbstract::SalUpdateDefaultDir - // omezeni: hlavni thread (opakovane volani neni mozne a hl. thread tuto metodu pouziva) + // Recognizes what kind of path it is (FS/Windows/archive) and splits it into its parts (for FS paths, fs-name and fs-user-part; for archive paths, path-to-archive and path-in-archive; for Windows paths, the existing part and the rest of the path). FS paths are not validated. For Windows paths (normal + UNC), it checks how far the path exists and may restore a network connection. For archive paths, it checks whether the archive file exists (archives are recognized by extension). + // 'path' is a full or relative path (buffer of at least 'pathBufSize' characters; for relative paths, the current path 'curPath' is used as the base for resolving the full path if it is not NULL; 'curPathIsDiskOrArchive' is TRUE if 'curPath' is a Windows or archive path; if the current path is an archive path, 'curArchivePath' contains the archive name, otherwise it is NULL). The resulting full path is stored back into 'path' (it must have room for at least 'pathBufSize' characters). Returns TRUE on successful recognition. Then 'type' is the path type (see PATH_TYPE_XXX) and 'secondPart' is set to: + // - the position in 'path' just after the existing path (after '\\' or at the end of the string; if the path contains a file, it points just after the path to that file) for Windows paths; WARNING: the length of the returned path part is not limited, so the full path may be longer than MAX_PATH + // - the position after the archive file for archive paths; WARNING: the path inside the archive may be longer than MAX_PATH + // - the position after ':' after the file-system name, that is, the user part of the file-system path, for FS paths; WARNING: the user-part length may be longer than MAX_PATH + // If TRUE is returned, 'isDir' is also set to: + // - TRUE if the existing part of the path is a directory, FALSE if it is a file, for Windows paths + // - FALSE for archive and FS paths + // If FALSE is returned, an error was already reported to the user, except for one case described by SPP_INCOMLETEPATH; if 'error' is not NULL, it receives one of the SPP_XXX constants. 'errorTitle' is the title of the error message box. If 'nextFocus' != NULL and the Windows/archive path does not contain '\\' or ends right after '\\', the path is copied to 'nextFocus' (see SalGetFullName). + // WARNING: this uses SalGetFullName, so it is best to call CSalamanderGeneralAbstract::SalUpdateDefaultDir first. + // Restriction: main thread (repeated calls are not possible and the main thread uses this method). virtual BOOL WINAPI SalParsePath(HWND parent, char* path, int& type, BOOL& isDir, char*& secondPart, const char* errorTitle, char* nextFocus, BOOL curPathIsDiskOrArchive, const char* curPath, const char* curArchivePath, int* error, int pathBufSize) = 0; - // ziska z windowsove cilove cesty existujici cast a operacni masku; pripadnou neexistujici cast - // umozni vytvorit; pri uspechu vraci TRUE a existujici windowsovou cilovou cestu (v 'path') - // a nalezenou operacni masku (v 'mask' - ukazuje do bufferu 'path', ale cesta a maska jsou oddelene - // nulou; pokud v ceste neni maska, automaticky vytvori masku "*.*"); 'parent' - parent pripadnych - // messageboxu; 'title' + 'errorTitle' jsou titulky messageboxu s informaci + chybou; 'selCount' je - // pocet oznacenych souboru a adresaru; 'path' je na vstupu cilova cesta ke zpracovani, na vystupu - // (alespon 2 * MAX_PATH znaku) existujici cilova cesta; 'secondPart' ukazuje do 'path' na pozici - // za existujici cestu (za '\\' nebo na konec retezce; existuje-li v ceste soubor, ukazuje za cestu - // k tomuto souboru); 'pathIsDir' je TRUE/FALSE pokud existujici cast cesty je adresar/soubor; - // 'backslashAtEnd' je TRUE pokud byl pred provedenim "parse" na konci 'path' backslash (napr. - // SalParsePath takovy backslash rusi); 'dirName' + 'curDiskPath' nejsou NULL pokud je oznaceny - // max. jeden soubor/adresar (jeho jmeno bez cesty je v 'dirName'; pokud neni nic oznacene, bere - // se focus) a aktualni cesta je windowsova (cesta je v 'curDiskPath'); 'mask' je na vystupu - // ukazatel na operacni masku do bufferu 'path'; pokud je v ceste chyba, vraci metoda FALSE, - // problem uz byl uzivateli ohlasen - // mozne volat z libovolneho threadu + // Obtains the existing part and the operation mask from a target Windows path and allows any missing part to be created. On success it returns TRUE and provides the existing target Windows path in 'path' and the found operation mask in 'mask' (it points into the 'path' buffer, but path and mask are separated by a null character; if the path contains no mask, the method automatically creates "*.*"). 'parent' is the parent of any message boxes. 'title' and 'errorTitle' are the titles of the information and error message boxes. 'selCount' is the number of selected files and directories. 'path' on input is the target path to process; on output it must hold the existing target path and therefore must have room for at least 2 * MAX_PATH characters. 'secondPart' points into 'path' to the position after the existing path (after '\\' or at the end of the string; if the path contains a file, it points after the path to that file). 'pathIsDir' is TRUE/FALSE depending on whether the existing part of the path is a directory/file. 'backslashAtEnd' is TRUE if 'path' ended with a backslash before parsing (for example, SalParsePath removes such a backslash). 'dirName' and 'curDiskPath' are not NULL when at most one file/directory is selected (its name without path is in 'dirName'; if nothing is selected, the focused item is used) and the current path is a Windows path (stored in 'curDiskPath'). 'mask' on output is a pointer to the operation mask inside the 'path' buffer. If the path contains an error, the method returns FALSE and the problem has already been reported to the user. Callable from any thread. virtual BOOL WINAPI SalSplitWindowsPath(HWND parent, const char* title, const char* errorTitle, int selCount, char* path, char* secondPart, BOOL pathIsDir, BOOL backslashAtEnd, const char* dirName, const char* curDiskPath, char*& mask) = 0; - // ziska z cilove cesty existujici cast a operacni masku; pripadnou neexistujici cast rozpozna; pri - // uspechu vraci TRUE, relativni cestu k vytvoreni (v 'newDirs'), existujici cilovou cestu (v 'path'; - // existujici jen za predpokladu vytvoreni relativni cesty 'newDirs') a nalezenou operacni masku - // (v 'mask' - ukazuje do bufferu 'path', ale cesta a maska jsou oddelene nulou; pokud v ceste neni - // maska, automaticky vytvori masku "*.*"); 'parent' - parent pripadnych messageboxu; - // 'title' + 'errorTitle' jsou titulky messageboxu s informaci + chybou; 'selCount' je pocet oznacenych - // souboru a adresaru; 'path' je na vstupu cilova cesta ke zpracovani, na vystupu (alespon 2 * MAX_PATH - // znaku) existujici cilova cesta (vzdy konci backslashem); 'afterRoot' ukazuje do 'path' za root cesty - // (za '\\' nebo na konec retezce); 'secondPart' ukazuje do 'path' na pozici za existujici cestu (za - // '\\' nebo na konec retezce; existuje-li v ceste soubor, ukazuje za cestu k tomuto souboru); - // 'pathIsDir' je TRUE/FALSE pokud existujici cast cesty je adresar/soubor; 'backslashAtEnd' je - // TRUE pokud byl pred provedenim "parse" na konci 'path' backslash (napr. SalParsePath takovy - // backslash rusi); 'dirName' + 'curPath' nejsou NULL pokud je oznaceny max. jeden soubor/adresar - // (jeho jmeno bez cesty je v 'dirName'; jeho cesta je v 'curPath'; pokud neni nic oznacene, bere - // se focus); 'mask' je na vystupu ukazatel na operacni masku do bufferu 'path'; neni-li 'newDirs' NULL, - // pak jde o buffer (o velikosti alespon MAX_PATH) pro relativni cestu (vzhledem k existujici ceste - // v 'path'), kterou je nutne vytvorit (uzivatel s vytvorenim souhlasi, byl pouzit stejny dotaz jako - // u kopirovani z disku na disk; prazdny retezec = nic nevytvaret); je-li 'newDirs' NULL a je-li - // potreba vytvorit nejakou relativni cestu, je jen vypsana chyba; 'isTheSamePathF' je funkce pro - // porovnani dvou cest (potrebna jen pokud 'curPath' neni NULL), je-li NULL pouzije se IsTheSamePath; - // pokud je v ceste chyba, vraci metoda FALSE, problem uz byl uzivateli ohlasen - // mozne volat z libovolneho threadu + // Obtains the existing part and the operation mask from a target path and recognizes any missing part. On success it returns TRUE, the relative path to create in 'newDirs', the existing target path in 'path' (existing only under the assumption that the relative path 'newDirs' will be created), and the found operation mask in 'mask' (it points into the 'path' buffer, but path and mask are separated by a null character; if the path contains no mask, the method automatically creates "*.*"). 'parent' is the parent of any message boxes. 'title' and 'errorTitle' are the titles of the information and error message boxes. 'selCount' is the number of selected files and directories. 'path' on input is the target path to process; on output it must contain the existing target path and therefore must have room for at least 2 * MAX_PATH characters. 'afterRoot' points into 'path' just after the path root (after '\\' or at the end of the string). 'secondPart' points into 'path' to the position after the existing path (after '\\' or at the end of the string; if the path contains a file, it points after the path to that file). 'pathIsDir' is TRUE/FALSE depending on whether the existing part of the path is a directory/file. 'backslashAtEnd' is TRUE if 'path' ended with a backslash before parsing (for example, SalParsePath removes such a backslash). 'dirName' and 'curPath' are not NULL when at most one file/directory is selected (its name without path is in 'dirName'; its path is in 'curPath'; if nothing is selected, the focused item is used). 'mask' on output is a pointer to the operation mask inside the 'path' buffer. If 'newDirs' is not NULL, it is a buffer of at least MAX_PATH characters for the relative path, relative to the existing path in 'path', that must be created; the user has already agreed to create it, using the same prompt as for copying from disk to disk; an empty string means create nothing. If 'newDirs' is NULL and a relative path would need to be created, only an error is displayed. 'isTheSamePathF' is a function for comparing two paths, needed only if 'curPath' is not NULL; if it is NULL, IsTheSamePath is used. If the path contains an error, the method returns FALSE and the problem has already been reported to the user. Callable from any thread. virtual BOOL WINAPI SalSplitGeneralPath(HWND parent, const char* title, const char* errorTitle, int selCount, char* path, char* afterRoot, char* secondPart, BOOL pathIsDir, BOOL backslashAtEnd, const char* dirName, const char* curPath, char*& mask, char* newDirs, SGP_IsTheSamePathF isTheSamePathF) = 0; - // odstrani ".." (vynecha ".." spolu s jednim podadresarem vlevo) a "." (vynecha jen ".") - // z cesty; podminkou je backslash jako oddelovac podadresaru; 'afterRoot' ukazuje za root - // zpracovavane cesty (zmeny cesty se deji jen za 'afterRoot'); vraci TRUE pokud se upravy - // podarily, FALSE pokud se nedaji odstranit ".." (vlevo uz je root) - // mozne volat z libovolneho threadu + // Removes ".." (removes ".." together with one subdirectory to the left) and "." (removes only ".") from a path. It requires backslashes as subdirectory separators. 'afterRoot' points just after the root of the processed path; the path is modified only after 'afterRoot'. Returns TRUE if the adjustment succeeded, FALSE if ".." cannot be removed because the root is already to the left. Callable from any thread. virtual BOOL WINAPI SalRemovePointsFromPath(char* afterRoot) = 0; - // vraci parametr z konfigurace Salamandera; 'paramID' identifikuje o jaky parametr jde - // (viz konstanty SALCFG_XXX); 'buffer' ukazuje na buffer, do ktereho se nakopiruji - // data parametru, velikost bufferu je 'bufferSize'; neni-li 'type' NULL, vraci se - // v nem jedna z konstant SALCFGTYPE_XXX nebo SALCFGTYPE_NOTFOUND (pokud parametr s - // 'paramID' nebyl nalezen); vraci TRUE pokud je 'paramID' platne a zaroven pokud se - // hodnota parametru konfigurace vejde do bufferu 'buffer' - // poznamka: zmeny v konfiguraci Salamandera jsou hlaseny pomoci udalosti - // PLUGINEVENT_CONFIGURATIONCHANGED (viz metoda CPluginInterfaceAbstract::Event) - // omezeni: hlavni thread, zmeny konfigurace se deji jen v hl. threadu (neobsahuje jinou - // synchronizaci) + // Returns a parameter from Salamander's configuration. 'paramID' identifies which parameter is requested (see SALCFG_XXX constants). 'buffer' points to the buffer that receives the parameter data; its size is 'bufferSize'. If 'type' is not NULL, it receives one of the SALCFGTYPE_XXX constants or SALCFGTYPE_NOTFOUND if no parameter with 'paramID' was found. Returns TRUE if 'paramID' is valid and the configuration parameter value fits into 'buffer'. + // Note: Salamander configuration changes are reported by the PLUGINEVENT_CONFIGURATIONCHANGED event (see CPluginInterfaceAbstract::Event). + // Restriction: main thread; configuration changes happen only in the main thread (there is no other synchronization). virtual BOOL WINAPI GetConfigParameter(int paramID, void* buffer, int bufferSize, int* type) = 0; // meni velikost pismen ve jmene souboru (jmeno je bez cesty); 'tgtName' je buffer pro vysledek From d6ab9723738c431b6d575ca861e5091d2a2b9e0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 17:06:08 +0200 Subject: [PATCH 284/710] [translation] Fix src/plugins/shared/spl_gen.h comments (chunk 11/14) (#659) --- src/plugins/shared/spl_gen.h | 598 +++++++++++++++++------------------ 1 file changed, 298 insertions(+), 300 deletions(-) diff --git a/src/plugins/shared/spl_gen.h b/src/plugins/shared/spl_gen.h index 71013695b..bbef93bcc 100644 --- a/src/plugins/shared/spl_gen.h +++ b/src/plugins/shared/spl_gen.h @@ -1742,184 +1742,187 @@ class CSalamanderGeneralAbstract // Restriction: main thread; configuration changes happen only in the main thread (there is no other synchronization). virtual BOOL WINAPI GetConfigParameter(int paramID, void* buffer, int bufferSize, int* type) = 0; - // meni velikost pismen ve jmene souboru (jmeno je bez cesty); 'tgtName' je buffer pro vysledek - // (velikost je min. pro ulozeni retezce 'srcName'); 'srcName' je jmeno souboru (zapisuje se do nej, - // ale pred navratem z metody je vzdy obnoveno); 'format' je format vysledku (1 - velka pocatecni - // pismena slov, 2 - komplet mala pismena, 3 - komplet velka pismena, 4 - beze zmen, 5 - pokud - // je DOS jmeno (8.3) -> velka pocatecni pismena slov, 6 - soubor malymi, adresar velkymi pismeny, - // 7 - velka pocatecni pismena ve jmene a mala pismena v pripone); - // 'changedParts' urcuje jake casti jmena se maji menit (0 - meni jmeno i priponu, 1 - meni jen - // jmeno (mozne jen s format == 1, 2, 3, 4), 2 - meni jen priponu (mozne jen s - // format == 1, 2, 3, 4)); 'isDir' je TRUE pokud jde o jmeno adresare - // mozne volat z libovolneho threadu + // Changes letter case in a file name (the name does not include a path); 'tgtName' is the output + // buffer (its size must be at least enough to store string 'srcName'); 'srcName' is the file name + // (it is written to, but is always restored before the method returns); 'format' is the output format + // (1 - capitalize words, 2 - all lowercase, 3 - all uppercase, 4 - unchanged, 5 - if it is a DOS + // name (8.3) -> capitalize words, 6 - file lowercase, directory uppercase, + // 7 - capitalize the name and lowercase the extension); + // 'changedParts' specifies which parts of the name are changed (0 - change both name and extension, + // 1 - change only the name (possible only with format == 1, 2, 3, 4), 2 - change only the extension + // (possible only with format == 1, 2, 3, 4)); 'isDir' is TRUE if this is a directory name + // Can be called from any thread virtual void WINAPI AlterFileName(char* tgtName, char* srcName, int format, int changedParts, BOOL isDir) = 0; - // zobrazi/schova zpravu v okenku ve vlastnim threadu (neodcerpa message-queue); zobrazi - // najednou jen jednu zpravu, opakovane volani ohlasi chybu do TRACE (neni fatalni); - // POZN.: pouziva se v SalCheckPath a dalsich rutinach, muze tedy dojit ke kolizi mezi - // pozadavky na otevreni okenek (neni fatalni, jen se nezobrazi) - // vse je mozne volat z libovolneho threadu (ale okenko se musi obsluhovat jen - // z jednoho threadu - nelze jej ukazat z jednoho threadu a schovat z druheho) - // - // otevreni okenka s textem 'message' se zpodenim 'delay' (v ms), jen pokud je 'hForegroundWnd' NULL - // nebo identifikuje okno na popredi (foreground) - // 'message' muze byt vicerakova; jednotlive radky se oddeluji znakem '\n' - // 'caption' muze byt NULL: pouzije se pak "Open Salamander" - // 'showCloseButton' udava, zda bude okenko obsahovat tlacitko Close; ekvivalent ke klavese Escape + // Shows/hides a message in a window running in its own thread (it does not drain the + // message queue); only one message is shown at a time, repeated calls report an error + // to TRACE (not fatal); + // NOTE: this is used in SalCheckPath and other routines, so requests to open the window + // can collide (not fatal, the window is simply not shown) + // All functions can be called from any thread (but the window itself must be handled + // from only one thread - it cannot be shown from one thread and hidden from another) + // + // Opens a window with text 'message' after delay 'delay' (in ms), only if 'hForegroundWnd' is NULL + // or identifies the foreground window + // 'message' may be multiline; individual lines are separated by '\n' + // 'caption' may be NULL: 'Open Salamander' is then used + // 'showCloseButton' specifies whether the window contains a Close button; equivalent to the Escape key virtual void WINAPI CreateSafeWaitWindow(const char* message, const char* caption, int delay, BOOL showCloseButton, HWND hForegroundWnd) = 0; // zavreni okenka virtual void WINAPI DestroySafeWaitWindow() = 0; - // schovani/zobrazeni okenka (je-li otevrene); volat jako reakci na WM_ACTIVATE z okna hForegroundWnd: + // Hide/show the window (if it is open); call in response to WM_ACTIVATE from hForegroundWnd: // case WM_ACTIVATE: // { // ShowSafeWaitWindow(LOWORD(wParam) != WA_INACTIVE); // break; // } - // Pokud je thread (ze ktereho bylo okenko vytvoreno) zamestnan, nedochazi - // k distribuci zprav, takze nedojde ani k doruceni WM_ACTIVATE pri kliknuti - // na jinou aplikaci. Zpravy se doruci az ve chvili zobrazeni messageboxu, - // coz presne potrebujeme: docasne se nechame schovat a pozdeji (po zavreni - // messageboxu a aktivaci okna hForegroundWnd) zase zobrazit. + // If the thread in which the window was created is busy, messages are not dispatched, + // so WM_ACTIVATE is not delivered when the user clicks another application. The messages + // are delivered only when a message box is shown, which is exactly what we need: + // hide the window temporarily and show it again later (after the message box is closed + // and the hForegroundWnd window is activated). virtual void WINAPI ShowSafeWaitWindow(BOOL show) = 0; - // po zavolani CreateSafeWaitWindow nebo ShowSafeWaitWindow vraci funkce FALSE az do doby, - // kdy user kliknul mysi na Close tlacitko (pokud je zobrazeno); pak vraci TRUE + // After CreateSafeWaitWindow or ShowSafeWaitWindow is called, the function returns FALSE until + // the user clicks the Close button with the mouse (if it is shown); it then returns TRUE virtual BOOL WINAPI GetSafeWaitWindowClosePressed() = 0; - // slouzi pro dodatecnou zmenu textu v okenku - // POZOR: nedochazi k novemu layoutovani okna a pokud dojde k vetsimu natazeni - // textu, bude orezan; pouzivat napriklad pro countdown: 60s, 55s, 50s, ... + // Used to change the text in the window later. + // WARNING: the window layout is not recalculated, so if the text becomes much longer, + // it will be clipped; use for example for countdowns: 60s, 55s, 50s, ... virtual void WINAPI SetSafeWaitWindowText(const char* message) = 0; - // najde v disk-cache existujici kopii souboru a zamkne ji (zakaze jeji zruseni); 'uniqueFileName' - // je unikatni nazev originalniho souboru (podle tohoto nazvu se prohledava disk-cache; melo by - // stacit plne jmeno souboru v salamanderovske forme - "fs-name:fs-user-part"; POZOR: nazev se - // porovnava "case-sensitive", pokud plugin vyzaduje "case-insensitive", musi vsechny nazvy - // prevadet napr. na mala pismena - viz CSalamanderGeneralAbstract::ToLowerCase); v 'tmpName' - // se vraci ukazatel (platny az do zruseni kopie souboru v disk-cache) na plne jmeno kopie souboru, - // ktera je umistena v docasnem adresari; 'fileLock' je zamek kopie souboru, jde o systemovy event - // ve stavu nonsignaled, ktery po zpracovani kopie souboru prejde do stavu signaled (je nutne - // pouzit metodu UnlockFileInCache; plugin dava signal, ze kopii v disk-cache jiz lze zrusit); - // pokud nebyla kopie nalezena vraci FALSE a 'tmpName' NULL (jinak vraci TRUE) - // mozne volat z libovolneho threadu + // Finds an existing file copy in the disk cache and locks it (prevents its deletion); 'uniqueFileName' + // is the unique name of the original file (the disk cache is searched by this name; the full + // file name in Salamander format - 'fs-name:fs-user-part' - should be sufficient; WARNING: the + // name is compared case-sensitively; if the plugin requires case-insensitive matching, it must + // convert all names, for example to lower case - see CSalamanderGeneralAbstract::ToLowerCase); + ///tmpName' receives a pointer (valid until the file copy in the disk cache is removed) to the + // full name of the file copy located in a temporary directory; 'fileLock' is the lock for the + // file copy and must be a system event in the nonsignaled state that transitions to the signaled + // state after the file copy has been processed (you must use UnlockFileInCache; the plugin thus + // signals that the disk-cache copy may be removed); if the copy was not found, returns FALSE and + ///tmpName' is NULL (otherwise returns TRUE) + // Can be called from any thread virtual BOOL WINAPI GetFileFromCache(const char* uniqueFileName, const char*& tmpName, HANDLE fileLock) = 0; - // odemkne zamek kopie souboru v disk-cache (nastavi 'fileLock' do stavu signaled, vyzve - // disk-cache k provedeni kontroly zamku, a pak nastavi 'fileLock' zpet do stavu nonsignaled); - // pokud slo o posledni zamek, muze dojit ke zruseni kopie, kdy dojde ke zruseni kopie zalezi - // na velikosti disk-cache na disku; zamek muze byt pouzity i pro vice kopii souboru (zamek - // musi byt typu "manual reset", jinak se po odemknuti prvni kopie zamek nastavi do stavu - // nonsignaled a odemykani skonci), v tomto pripade probehne odemknuti u vsech kopii - // mozne volat z libovolneho threadu + // Unlocks the lock for a file copy in the disk cache (sets 'fileLock' to the signaled state, asks + // the disk cache to check the locks, and then sets 'fileLock' back to the nonsignaled state); + // if this was the last lock, the copy may be removed; when it is removed depends + // on the size of the disk cache on disk; one lock can also be used for multiple file copies (the lock + // must be of type 'manual reset', otherwise after the first copy is unlocked the lock is set back to + // nonsignaled and unlocking stops); in that case all copies are unlocked + // Can be called from any thread virtual void WINAPI UnlockFileInCache(HANDLE fileLock) = 0; - // vlozi (presune) kopii souboru do disk-cache (vkladana kopie neni zamcena, takze kdykoliv muze dojit - // k jejimu zruseni); 'uniqueFileName' je unikatni nazev originalniho souboru (podle tohoto - // nazvu se prohledava disk-cache; melo by stacit plne jmeno souboru v salamanderovske - // forme - "fs-name:fs-user-part"; POZOR: nazev se porovnava "case-sensitive", pokud plugin - // vyzaduje "case-insensitive", musi vsechny nazvy prevadet napr. na mala pismena - viz + // Inserts (moves) a file copy into the disk cache (the inserted copy is not locked, so it may + // be removed at any time); 'uniqueFileName' is the unique name of the original file (the + // disk cache is searched by this name; the full file name in Salamander format - + // "fs-name:fs-user-part" - should be sufficient; WARNING: the name is compared + // case-sensitively; if the plugin requires "case-insensitive" matching, it must convert all names, // CSalamanderGeneralAbstract::ToLowerCase); 'nameInCache' je jmeno kopie souboru, ktera bude umistena - // v docasnem adresari (ocekava se zde posledni cast jmena originalniho souboru, aby pozdeji - // uzivateli pripominala originalni soubor); 'newFileName' je plne jmeno ukladane kopie souboru, - // ktera bude presunuta do disk-cache pod jmenem 'nameInCache', musi byt umistena na stejnem disku - // jako diskova cache (je-li 'rootTmpPath' NULL, je diskova cache ve Windows TEMP adresari, jinak - // je cesta do disk-cache v 'rootTmpPath'; pro prejmenovani do disk cache pres Win32 API funkci - // MoveFile); 'newFileName' je idealni ziskat volanim SalGetTempFileName s parametrem 'path' rovnym - // 'rootTmpPath'); v 'newFileSize' je velikost ukladane kopie souboru; vraci TRUE pri uspechu - // (soubor byl presunut do disk-cache - zmizel z puvodniho mista na disku), vraci FALSE pri - // interni chybe nebo pokud soubor jiz je v disk-cache (neni-li 'alreadyExists' NULL, vraci - // se v nem TRUE pokud soubor jiz je v disk-cache) - // POZN.: pokud plugin vyuziva disk-cache, mel by alespon pri unloadu pluginu zavolat + // in a temporary directory (the last part of the original file name is expected here so it + // still resembles the original file to the user); 'newFileName' is the full name of the stored + // file copy that will be moved into the disk cache under the name 'nameInCache'; it must be + // located on the same disk as the disk cache (if 'rootTmpPath' is NULL, the disk cache is in + // the Windows TEMP directory, otherwise the path to the disk cache is in 'rootTmpPath'; the + // file is renamed into the disk cache by the Win32 API function MoveFile); 'newFileName' is + // best obtained by calling SalGetTempFileName with parameter 'path' equal to 'rootTmpPath'); + // 'newFileSize' is the size of the stored file copy; returns TRUE on success (the file was + // moved into the disk cache and disappeared from its original location), returns FALSE on an + // internal error or if the file is already in the disk cache ('alreadyExists' receives TRUE if it is not NULL) + // NOTE: if the plugin uses the disk cache, it should at least call // CSalamanderGeneralAbstract::RemoveFilesFromCache("fs-name:"), jinak budou - // jeho kopie souboru zbytecne prekazet v disk-cache - // mozne volat z libovolneho threadu + // otherwise its file copies will remain in the disk cache unnecessarily + // Can be called from any thread virtual BOOL WINAPI MoveFileToCache(const char* uniqueFileName, const char* nameInCache, const char* rootTmpPath, const char* newFileName, const CQuadWord& newFileSize, BOOL* alreadyExists) = 0; - // odstrani z disk-cache kopii souboru, jejiz unikatni nazev je 'uniqueFileName' (POZOR: nazev - // se porovnava "case-sensitive", pokud plugin vyzaduje "case-insensitive", musi vsechny nazvy - // prevadet napr. na mala pismena - viz CSalamanderGeneralAbstract::ToLowerCase); pokud se kopie - // souboru jeste pouziva, odstrani se az to bude mozne (az se zavrou viewery), kazdopadne uz ji - // disk-cache nikomu neposkytne jako platnou kopii souboru (je oznacena jako out-of-date) - // mozne volat z libovolneho threadu + // Removes from the disk cache the file copy whose unique name is 'uniqueFileName' (WARNING: the name + // is compared case-sensitively; if the plugin requires case-insensitive matching, it must convert all names, + // for example to lower case - see CSalamanderGeneralAbstract::ToLowerCase); if the file copy is still + // in use, it is removed when possible (after viewers are closed); in any case, the disk cache will no longer + // provide it as a valid file copy (it is marked out-of-date) + // Can be called from any thread virtual void WINAPI RemoveOneFileFromCache(const char* uniqueFileName) = 0; - // odstrani z disk-cache vsechny kopie souboru, jejichz unikatni nazvy zacinaji na 'fileNamesRoot' - // (pouziva se pri uzavreni file-systemu, kdyz uz je dale nezadouci cachovat downloadene kopie - // souboru; POZOR: nazvy se porovnavaji "case-sensitive", pokud plugin vyzaduje "case-insensitive", - // musi vsechny nazvy prevadet napr. na mala pismena - viz CSalamanderGeneralAbstract::ToLowerCase); - // pokud se kopie souboru jeste pouzivaji, odstrani se az to bude mozne (az se odemknou - // napr. po zavreni vieweru), kazdopadne uz je disk-cache nikomu neposkytne jako platne kopie - // souboru (jsou oznacene jako out-of-date) - // mozne volat z libovolneho threadu + // Removes from the disk cache all file copies whose unique names start with 'fileNamesRoot' + // (used when a file system is being closed and downloaded file copies should no longer be cached; + // WARNING: names are compared case-sensitively; if the plugin requires case-insensitive matching, + // it must convert all names, for example to lower case - see CSalamanderGeneralAbstract::ToLowerCase); + // if file copies are still in use, they are removed when possible (after they are unlocked, + // for example after a viewer is closed); in any case, the disk cache will no longer provide them as valid + // file copies (they are marked out-of-date) + // Can be called from any thread virtual void WINAPI RemoveFilesFromCache(const char* fileNamesRoot) = 0; - // vraci postupne konverzni tabulky (nactene ze souboru convert\XXX\convert.cfg - // v instalaci Salamandera - XXX je prave pouzivany adresar konverznich tabulek); + // Returns conversion tables one by one (loaded from convert\XXX\convert.cfg + // in the Salamander installation - XXX is the currently used conversion-table directory); // 'parent' je parent messageboxu (je-li NULL, je parent hlavni okno); - // 'index' je vstupne/vystupni promenna, ukazuje na int, ve kterem je pri prvnim volani 0, - // hodnotu pro dalsi volani si funkce ulozi pri navratu (pouziti: na zacatku vynulovat, pak - // nemenit); vraci FALSE, pokud jiz neexistuje zadna dalsi tabulka; pokud vraci TRUE, obsahuje - // 'name' (neni-li NULL) odkaz na jmeno konverze (muze obsahovat '&' - podtrzeny znak v menu) nebo NULL - // jde-li o separator a 'table' (neni-li NULL) odkaz na 256-bytovou konverzni tabulku nebo NULL - // jde-li o separator; odkazy 'name' a 'table' jsou platne po celou dobu behu Salamandera (neni - // nutne kopirovat obsah) + // 'index' is an input/output variable pointing to an int that is 0 on the first call; + // the function stores the value for the next call on return (usage: initialize it to 0, then + // do not modify it); returns FALSE if there is no next table; if it returns TRUE, + // 'name' (if not NULL) contains a pointer to the conversion name (it may contain '&' - the + // underlined character in the menu) or NULL if it is a separator, and 'table' (if not NULL) + // contains a pointer to a 256-byte conversion table or NULL if it is a separator; the 'name' + // and 'table' pointers remain valid for the entire Salamander run (you do not need to copy them) // POZOR: ukazatel 'table' pouzivat timto zpusobem (nutne pretypovani na "unsigned"): // *s = table[(unsigned char)*s] - // mozne volat z libovolneho threadu + // Can be called from any thread virtual BOOL WINAPI EnumConversionTables(HWND parent, int* index, const char** name, const char** table) = 0; - // vraci konverzni tabulku 'table' (buffer min. 256 znaku) pro konverzi 'conversion' (jmeno - // konverze viz soubor convert\XXX\convert.cfg v instalaci Salamandera, napr. "ISO-8859-2 - CP1250"; - // znaky <= ' ' a '-' a '&' ve jmene pri hledani nehraji roli; hleda se bez ohledu na velka a mala - // pismena); 'parent' je parent messageboxu (je-li NULL, je parent hlavni okno); vraci TRUE - // pokud byla konverze nalezena (jinak neni obsah 'table' platny); - // POZOR: pouzivat timto zpusobem (nutne pretypovani na "unsigned"): *s = table[(unsigned char)*s] - // mozne volat z libovolneho threadu + // Returns conversion table 'table' (a buffer of at least 256 characters) for conversion 'conversion' (the + // conversion name is defined in file convert\XXX\convert.cfg in the Salamander installation, e.g. + // 'ISO-8859-2 - CP1250'; characters <= ' ', '-', and '&' in the name are ignored during the search; + // the search is case-insensitive); 'parent' is the parent window of the message box (if NULL, the main + // window is the parent); returns TRUE if the conversion was found + // (otherwise the contents of 'table' are invalid); + // WARNING: use it this way (cast to 'unsigned' is required): *s = table[(unsigned char)*s] + // Can be called from any thread virtual BOOL WINAPI GetConversionTable(HWND parent, char* table, const char* conversion) = 0; - // vraci jmeno kodove stranky pouzivane ve Windows v tomto regionu (cerpa v convert\XXX\convert.cfg - // v instalaci Salamandera); jde o normalne zobrazitelne kodovani, proto se pouziva v pripade, - // ze je potreba zobrazit text, ktery byl vytvoren v jine kodove strance (zde se zada jako - // "cilove" kodovani pri hledani konverzni tabulky, viz metoda GetConversionTable); - // 'parent' je parent messageboxu (je-li NULL, je parent hlavni okno); 'codePage' je buffer - // (min. 101 znaku) pro jmeno kodove stranky (pokud neni v souboru convert\XXX\convert.cfg toto jmeno - // definovane, vraci se v bufferu prazdny retezec) - // mozne volat z libovolneho threadu + // Returns the name of the code page used by Windows in this region (read from convert\XXX\convert.cfg + // in the Salamander installation); this is a normally displayable encoding, so it is used when + // text created in a different code page needs to be displayed (it is passed as the target + // encoding when looking up the conversion table; see GetConversionTable); + // 'parent' is the parent window of the message box (if NULL, the main window is the parent); 'codePage' is a buffer + // (at least 101 characters) for the code-page name (if this name is not defined in file convert\XXX\convert.cfg, + // an empty string is returned in the buffer) + // Can be called from any thread virtual void WINAPI GetWindowsCodePage(HWND parent, char* codePage) = 0; - // zjisti z bufferu 'pattern' o delce 'patternLen' (napr. prvnich 10000 znaku) jestli jde - // o text (existuje kodova stranka, ve ktere obsahuje jen povolene znaky - zobrazitelne - // a ridici) a pokud jde o text, zjisti take jeho kodovou stranku (nejpravdepodobnejsi); + // Determines from buffer 'pattern' of length 'patternLen' (e.g. the first 10000 characters) whether it is + // text (there is a code page in which it contains only permitted characters - printable + // and control) and, if it is text, also determines its most likely code page; // 'parent' je parent messageboxu (je-li NULL, je parent hlavni okno); je-li 'forceText' // TRUE, neprovadi se kontrola na nepovolene znaky (pouziva se, pokud 'pattern' obsahuje - // text); neni-li 'isText' NULL, vraci se v nem TRUE pokud jde o text; neni-li 'codePage' + // text); if 'isText' is not NULL, TRUE is returned in it if the buffer is text; if 'codePage' // NULL, jde o buffer (min. 101 znaku) pro jmeno kodove stranky (nejpravdepodobnejsi) - // mozne volat z libovolneho threadu + // Can be called from any thread virtual void WINAPI RecognizeFileType(HWND parent, const char* pattern, int patternLen, BOOL forceText, BOOL* isText, char* codePage) = 0; - // zjisti z bufferu 'text' o delce 'textLen' jestli jde o ANSI text (obsahuje (v ANSI - // znakove sade) jen povolene znaky - zobrazitelne a ridici); rozhoduje bez kontextu - // (nezalezi na poctu znaku ani jak jdou po sobe - testovany text je mozne rozdelit - // na libovolne casti a testovat je postupne); vraci TRUE pokud jde o ANSI text (jinak - // je obsah bufferu 'text' binarni) - // mozne volat z libovolneho threadu + // Determines from buffer 'text' of length 'textLen' whether it is ANSI text (it contains only + // permitted characters in the ANSI character set - printable and control characters); it decides without context + // (it does not depend on the number of characters or their order - the tested text can be split + // into arbitrary parts and tested gradually); returns TRUE if it is ANSI text (otherwise + // the contents of buffer 'text' are binary data) + // Can be called from any thread virtual BOOL WINAPI IsANSIText(const char* text, int textLen) = 0; - // zavola funkci 'callback' s parametry 'param' a funkci pro ziskavani oznacenych - // souboru/adresaru (viz definice typu SalPluginOperationFromDisk) z panelu 'panel' - // (v panelu musi byt otevrena windowsova cesta); 'panel' je jeden z PANEL_XXX - // omezeni: hlavni thread + // Calls function 'callback' with parameters 'param' and a function for retrieving selected + // files/directories (see the SalPluginOperationFromDisk type definition) from panel 'panel' + // (a Windows path must be open in the panel); 'panel' is one of PANEL_XXX + // Restriction: main thread virtual void WINAPI CallPluginOperationFromDisk(int panel, SalPluginOperationFromDisk callback, void* param) = 0; - // vraci standardni charset, ktery ma uzivatel nastaveny (soucast regionalniho - // nastaveni); fonty je nutne konstruovat s timto charsetem, jinak nemusi byt - // texty citelne (je-li text ve standardni kodove strance, viz Win32 API funkce + // Returns the default charset configured by the user (part of the regional + // settings); fonts must be created with this charset, otherwise the + // texts may not be readable (if the text uses the default code page, see the Win32 API function // GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_IDEFAULTANSICODEPAGE, ...)) - // mozne volat z libovolneho threadu + // Can be called from any thread virtual BYTE WINAPI GetUserDefaultCharset() = 0; // alokuje novy objekt Boyer-Moorova vyhledavaciho algoritmu @@ -1939,54 +1942,54 @@ class CSalamanderGeneralAbstract // mozne volat z libovolneho threadu virtual void WINAPI FreeSalamanderREGEXPSearchData(CSalamanderREGEXPSearchData* data) = 0; - // vraci postupne prikazy Salamandera (postupuje v poradi definice konstant SALCMD_XXX); - // 'index' je vstupne/vystupni promenna, ukazuje na int, ve kterem je pri prvnim volani 0, - // hodnotu pro dalsi volani si funkce ulozi pri navratu (pouziti: na zacatku vynulovat, pak - // nemenit); vraci FALSE, pokud jiz neexistuje zadny dalsi prikaz; pokud vraci TRUE, obsahuje - // 'salCmd' (neni-li NULL) cislo prikazu Salamandera (viz konstanty SALCMD_XXX; cisla maji - // rezervovany interval 0 az 499, pokud tedy maji v menu byt prikazy Salamandera spolecne s - // jinymi prikazy, neni problem vytvorit vzajemne se neprekryvajici mnoziny hodnot prikazu - // napr. posunutim vsech hodnot o zvolene cislo - priklad viz DEMOPLUGin - - // CPluginFSInterface::ContextMenu), 'nameBuf' (buffer o velikosti 'nameBufSize' bytu) - // obsahuje jmeno prikazu (jmeno je pripraveno pro pouziti v menu - ma zdvojene ampersandy, - // podtrzene znaky oznacene ampersandy a za '\t' ma popisy klavesovych zkratek), 'enabled' - // (neni-li NULL) obsahuje stav prikazu (TRUE/FALSE pokud je enabled/disabled), 'type' - // (neni-li NULL) obsahuje typ prikazu (viz popis konstant sctyXXX) - // mozne volat z libovolneho threadu + // Returns Salamander commands one by one (in the definition order of SALCMD_XXX constants); + // 'index' is an input/output variable pointing to an int that is 0 on the first call; + // the function stores the value for the next call on return (usage: initialize it to 0, then + // do not modify it); returns FALSE if there is no next command; if it returns TRUE, + // 'salCmd' (if not NULL) receives the Salamander command number (see SALCMD_XXX constants; + // numbers 0 through 499 are reserved, so if Salamander commands need to appear in a menu together + // with other commands, it is easy to create non-overlapping command-value sets, for example by + // offsetting all values by a chosen number - see DEMOPLUGin - + // CPluginFSInterface::ContextMenu), 'nameBuf' (a buffer of size 'nameBufSize' bytes) + // contains the command name (prepared for use in a menu - ampersands are doubled, + // underlined characters are marked by ampersands, and shortcut descriptions follow '\t'), 'enabled' + // (if not NULL) contains the command state (TRUE/FALSE for enabled/disabled), and 'type' + // (if not NULL) contains the command type (see the sctyXXX constants) + // Can be called from any thread virtual BOOL WINAPI EnumSalamanderCommands(int* index, int* salCmd, char* nameBuf, int nameBufSize, BOOL* enabled, int* type) = 0; - // vraci prikaz Salamandera s cislem 'salCmd' (viz konstanty SALCMD_XXX); - // vraci FALSE, pokud takovy prikaz neexistuje; pokud vraci TRUE, obsahuje - // 'nameBuf' (buffer o velikosti 'nameBufSize' bytu) jmeno prikazu (jmeno je pripraveno pro - // pouziti v menu - ma zdvojene ampersandy, podtrzene znaky oznacene ampersandy a za '\t' ma - // popisy klavesovych zkratek), 'enabled' (neni-li NULL) obsahuje stav prikazu (TRUE/FALSE - // pokud je enabled/disabled), 'type' (neni-li NULL) obsahuje typ prikazu (viz popis konstant - // sctyXXX) - // mozne volat z libovolneho threadu + // Returns the Salamander command with number 'salCmd' (see SALCMD_XXX constants); + // returns FALSE if no such command exists; if it returns TRUE, + // 'nameBuf' (a buffer of size 'nameBufSize' bytes) contains the command name (prepared for + // use in a menu - ampersands are doubled, underlined characters are marked by ampersands, + // and shortcut descriptions follow '\t'), 'enabled' (if not NULL) contains the command state (TRUE/FALSE + // for enabled/disabled), and 'type' (if not NULL) contains the command type (see the + // sctyXXX constants) + // Can be called from any thread virtual BOOL WINAPI GetSalamanderCommand(int salCmd, char* nameBuf, int nameBufSize, BOOL* enabled, int* type) = 0; - // nastavi volajicimu pluginu priznak, ze se ma pri nejblizsi mozne prilezitosti spustit - // prikaz Salamandera s cislem 'salCmd' (jakmile nebudou v message-queue hl. threadu zadne - // message a Salamander nebude "busy" (nebude otevreny zadny modalni dialog a nebude se - // zpracovavat zadna zprava)); - // POZOR: pokud se vola z jineho nez hlavniho threadu, muze dojit ke spusteni prikazu Salamandera - // (probiha v hlavnim threadu) dokonce drive nez skonci PostSalamanderCommand - // mozne volat z libovolneho threadu + // Sets a flag for the calling plugin so that the Salamander command with number 'salCmd' is run at the + // next possible opportunity (as soon as there are no messages in the main-thread message queue and + // Salamander is not 'busy' (no modal dialog is open and no message is being + // processed)); + // WARNING: if this is called from a thread other than the main thread, the Salamander command + // (which runs in the main thread) may be executed even before PostSalamanderCommand returns + // Can be called from any thread virtual void WINAPI PostSalamanderCommand(int salCmd) = 0; - // nastavi priznak "uzivatel pracoval s aktualni cestou" v panelu 'panel' (tento priznak - // se vyuziva pri plneni seznamu pracovnich adresaru - List Of Working Directories (Alt+F12)); - // 'panel' je jeden z PANEL_XXX - // omezeni: hlavni thread + // Sets the 'user worked with the current path' flag in panel 'panel' (this flag + // is used when filling the List Of Working Directories (Alt+F12)); + // 'panel' is one of PANEL_XXX + // Restriction: main thread virtual void WINAPI SetUserWorkedOnPanelPath(int panel) = 0; - // v panelu 'panel' (jedna z konstant PANEL_XXX) ulozi vybrana (Selected) jmena - // do zvlastniho pole, ze ktereho muze uzivatel vyber obnovit prikazem Edit/Restore Selection - // vyuziva se pro prikazy, ktere zrusi aktualni vyber, aby mel uzivatel moznost - // se k nemu vratit a provest jeste dalsi operaci - // omezeni: hlavni thread + // In panel 'panel' (one of the PANEL_XXX constants), stores the selected names + // in a special array from which the user can restore the selection with Edit/Restore Selection; + // it is used for commands that clear the current selection so the user can + // return to it and perform another operation + // Restriction: main thread virtual void WINAPI StoreSelectionOnPanelPath(int panel) = 0; // @@ -2019,21 +2022,21 @@ class CSalamanderGeneralAbstract // mozne volat z libovolneho threadu virtual void WINAPI FreeSalamanderMD5(CSalamanderMD5* md5) = 0; - // V textu nalezne pary '<' '>', vyradi je z bufferu a prida odkazy na - // jejich obsah do 'varPlacements'. 'varPlacements' je pole DWORDu o '*varPlacementsCount' - // polozkach, DWORDy jsou slozene vzdy z pozice odkazu ve vystupnim bufferu (spodni WORD) - // a poctu znaku odkazu (horni WORD). Retezce "\<", "\>", "\\" jsou chapany - // jako escape sekvence a budou nahrazeny znaky '<', '>' a '\\'. - // Vraci TRUE v pripade uspechu, jinak FALSE; vzdy nastavi 'varPlacementsCount' na - // pocet zpracovanych promennych. - // mozne volat z libovolneho threadu + // Finds '<' and '>' pairs in the text, removes them from the buffer, and adds references to + // their contents to 'varPlacements'. 'varPlacements' is an array of DWORD values with + // '*varPlacementsCount' items; each DWORD is composed of the position of the reference in the output buffer (low WORD) + // and the length of the referenced text (high WORD). Strings '\<', '\>', and '\\' are treated + // as escape sequences and replaced with '<', '>', and '\\'. + // Returns TRUE on success, otherwise FALSE; 'varPlacementsCount' is always set to + // the number of processed variables. + // Can be called from any thread virtual BOOL WINAPI LookForSubTexts(char* text, DWORD* varPlacements, int* varPlacementsCount) = 0; - // cekani (maximalne 0.2 sekundy) na pusteni klavesy ESC; pouziva se pokud plugin obsahuje - // akce, ktere se prerusuji klavesou ESC (monitorovani klavesy ESC pres - // GetAsyncKeyState(VK_ESCAPE)) - zabranuje tomu, aby se po stisknuti ESC v dialogu/messageboxu - // hned prerusila i nasledujici akce monitorujici klavesu ESC - // mozne volat z libovolneho threadu + // Waits (at most 0.2 seconds) for the ESC key to be released; used if the plugin contains + // actions that are interrupted by the ESC key (monitoring the ESC key via + // GetAsyncKeyState(VK_ESCAPE)) - this prevents pressing ESC in a dialog/message box from + // immediately interrupting the next action that monitors the ESC key + // Can be called from any thread virtual void WINAPI WaitForESCRelease() = 0; // @@ -2149,32 +2152,31 @@ class CSalamanderGeneralAbstract // virtual void WINAPI MultiMonGetClipRectByWindow(HWND hByWnd, RECT* workClipRect, RECT* monitorClipRect) = 0; - // // MultiMonCenterWindow - // Centers the window against a specified window or monitor. + // Centers the window relative to a specified window or monitor. // // Parameters // 'hWindow' - // [in] Handle to the window whose parent window handle is to be retrieved. + // [in] Handle to the window to center. // // 'hByWnd' - // [in] Handle to the window against which to center. If this parameter is NULL, - // or window is not visible or is iconic, the method will center 'hWindow' against - // the working area of the monitor. Monitor with the currently active window - // from the same application will be used. Otherwise primary monitor will be used. + // [in] Handle to the window relative to which 'hWindow' is centered. If this + // parameter is NULL, or if the window is not visible or is iconic, the method + // centers 'hWindow' relative to the monitor work area. The monitor with the + // currently active window from the same application is used; otherwise the + // primary monitor is used. // // 'findTopWindow' - // [in] If this parameter is TRUE, non child visible window will be used by walking - // the chain of parent windows of 'hByWnd' as the window against which to center. + // [in] If this parameter is TRUE, the top visible non-child window found by + // walking the chain of parent windows of 'hByWnd' is used as the reference window. // - // If this parameter is FALSE, 'hByWnd' will be to the window against which to center. + // If this parameter is FALSE, 'hByWnd' itself is used as the reference window. // // Remarks - // If centered window gets over working area of the monitor, the method positions - // the window to be whole visible. + // If the centered window extends beyond the work area of the monitor, the method + // positions it so that it is fully visible. // // Method can be called from any thread. - // virtual void WINAPI MultiMonCenterWindow(HWND hWindow, HWND hByWnd, BOOL findTopWindow) = 0; // @@ -2202,152 +2204,148 @@ class CSalamanderGeneralAbstract // virtual BOOL WINAPI MultiMonEnsureRectVisible(RECT* rect, BOOL partialOK) = 0; - // // InstallWordBreakProc - // Installs special word break procedure to the specified window. This procedure - // is inteded for easier cursor movevement in the single line edit controls. - // Delimiters '\\', '/', ' ', ';', ',', and '.' are used as cursor stops when user - // navigates using Ctrl+Left or Ctrl+Right keys. - // You can use Ctrl+Backspace to delete one word. + // Installs a special word-break procedure for the specified window. This procedure + // is intended to make cursor movement easier in single-line edit controls. + // Delimiters '\\', '/', ' ', ';', ',', and '.' are used as cursor stops when the user + // navigates with Ctrl+Left or Ctrl+Right. + // Ctrl+Backspace can be used to delete one word. // // Parameters // 'hWindow' - // [in] Handle to the window or control where word break proc is to be isntalled. - // Window may be either edit or combo box with edit control. + // [in] Handle to the window or control where the word-break proc is to be installed. + // The window may be either an edit control or a combo box with an edit control. // // Return Values - // The return value is TRUE if the word break proc is installed. It is FALSE if the - // window is neither edit nor combo box with edit control, some error occured, or - // this special word break proc is not supported on your OS. + // The return value is TRUE if the word-break proc is installed. It is FALSE if the + // window is neither an edit control nor a combo box with an edit control, if an + // error occurred, or if this special word-break proc is not supported on the current OS. // // Remarks - // You needn't uninstall word break procedure before window is destroyed. + // You need not uninstall the word-break procedure before the window is destroyed. // // Method can be called from any thread. - // virtual BOOL WINAPI InstallWordBreakProc(HWND hWindow) = 0; - // Salamander 3 nebo novejsi: vraci TRUE, pokud byla tato instance Altap - // Salamandera prvni spustena (v dobe startu instance se hledaji dalsi bezici - // instance verze 3 nebo novejsi); + // Salamander 3 or later: returns TRUE if this Altap Salamander instance was the + // first one started (when the instance starts, other running instances of version 3 or later + // are searched for); // - // Poznamky k ruznym SID / Session / Integrity Level (netyka se Salamandera 2.5 a 2.51): - // funkce vrati TRUE i v pripade, ze jiz bezi instance Salamandera spustena - // pod jinym SID; na session a integrity level nezalezi, takze pokud jiz bezi - // instance Salamandera na jine session, pripadne s jinym integrity level, ale - // se shodnym SID, vrati nove spustena instance FALSE + // Notes on different SID / Session / Integrity Level combinations (does not apply to Salamander 2.5 and 2.51): + // the function returns TRUE even if a Salamander instance already running + // under a different SID exists; session and integrity level do not matter, so if a + // Salamander instance is already running in another session or with a different integrity level, but + // with the same SID, the newly started instance returns FALSE // - // mozne volat z libovolneho threadu + // Can be called from any thread virtual BOOL WINAPI IsFirstInstance3OrLater() = 0; - // support for parameter dependent strings (dealing with singles/plurals); - // 'format' is format string for resulting string - its description follows; - // resulting string is copied to 'buffer' buffer which size is 'bufferSize' bytes; - // 'parametersArray' is array of parameters; 'parametersCount' is count of - // these parameters; returns length of the resulting string + // Support for parameter-dependent strings (handling singular/plural forms); + // 'format' is the format string for the resulting string - see the description below; + // the resulting string is copied to buffer 'buffer', whose size is 'bufferSize' bytes; + // 'parametersArray' is an array of parameters; 'parametersCount' is the number of + // these parameters; returns the length of the resulting string // // format string description: - // - each format string starts with signature "{!}" - // - format string can contain following escape sequences (it allows to use special - // character without its special meaning): "\\" = "\", "\{" = "{", "\}" = "}", - // "\:" = ":", and "\|" = "|" (do not forget to double backslashes when writing C++ - // strings, this applies only to format strings placed directly in C++ source code) - // - text which is not placed in curly brackets goes directly to resulting string - // (only escape sequences are handled) - // - parameter dependent text is placed in curly brackets - // - each parameter dependent text uses one parameter from 'parametersArray' - // (it is 64-bit unsigned int) - // - parameter dependent text contains more variants of resulting text, which variant - // is used depends on parameter value, more precisely to which defined interval the - // value belongs - // - variants of resulting text and interval bounds are separated by "|" character - // - first interval is from 0 to first interval bound - // - last interval is from last interval bound plus one to infinity (2^64-1) - // - parameter dependent text "{}" is used to skip one parameter from 'parametersArray' - // (nothing goes to resulting string) - // - you can also specify index of parameter to use for parameter dependent text, - // just place its index (from one to number of parameters) to the beginning of - // parameter dependent text and follow it by ':' character - // - if you don't specify index of parameter to use, it is assigned automatically - // (starting from one to number of parameters) - // - if you specify index of parameter to use, the next index which is assigned - // automatically is not affected, - // e.g. in "{!}%d file{2:s|0||1|s} and %d director{y|1|ies}" the first parameter - // dependent text uses parameter with index 2 and second uses parameter with index 1 - // - you can use any number of parameter dependent texts with specified index - // of parameter to use + // - every format string starts with signature '{!}' + // - the format string can contain the following escape sequences (to use a special + // character without its special meaning): '\\' = '\', '\{' = '{', '\}' = '}', + // '\:' = ':', and '\|' = '|' (do not forget to double backslashes when writing C++ + // strings; this applies only to format strings placed directly in C++ source code) + // - text outside curly brackets is copied directly to the resulting string + // (only escape sequences are processed) + // - parameter-dependent text is placed in curly brackets + // - each parameter-dependent text uses one parameter from 'parametersArray' + // (a 64-bit unsigned int) + // - parameter-dependent text contains several resulting-text variants; the selected + // variant depends on the parameter value, specifically on the interval it falls into + // - resulting-text variants and interval bounds are separated by the '|' character + // - the first interval is from 0 to the first interval bound + // - the last interval is from the last interval bound plus one to infinity (2^64-1) + // - parameter-dependent text '{}' skips one parameter from 'parametersArray' + // (nothing is added to the resulting string) + // - you can also specify the index of the parameter to use for parameter-dependent text; + // just place its index (from one to the number of parameters) at the beginning of + // the parameter-dependent text and follow it with a ':' character + // - if you do not specify the index of the parameter to use, it is assigned automatically + // (from one to the number of parameters) + // - if you do specify the index of the parameter to use, the next automatically assigned + // index is not affected, + // e.g. in '{!}%d file{2:s|0||1|s} and %d director{y|1|ies}' the first parameter- + // dependent text uses parameter 2 and the second uses parameter 1 + // - you can use any number of parameter-dependent texts with an explicitly specified + // parameter index // // examples of format strings: - // - "{!}director{y|1|ies}": for parameter values from 0 to 1 resulting string will be - // "directory" and for parameter values from 2 to infinity (2^64-1) resulting string - // will be "directories" - // - "{!}%d soubor{u|0||1|y|4|u} a %d adresar{u|0||1|e|4|u}": it needs two parameters - // because there are two dependent texts in curly brackets, resulting string for - // choosen pairs of parameters (I believe it is not needed to show all possible variants): - // 0, 0: "%d souboru a %d adresaru" - // 1, 12: "%d soubor a %d adresaru" - // 3, 4: "%d soubory a %d adresare" - // 13, 1: "%d souboru a %d adresar" - // - // method can be called from any thread + // - '{!}director{y|1|ies}': for parameter values from 0 to 1 the resulting string is + // 'directory', and for parameter values from 2 to infinity (2^64-1) it is + // 'directories' + // - '{!}%d file{|1|s} and %d director{y|1|ies}': it needs two parameters because there + // are two dependent texts in curly brackets; for selected parameter pairs, for example: + // 0, 0: '%d file and %d directory' + // 1, 12: '%d file and %d directories' + // 3, 4: '%d files and %d directories' + // 13, 1: '%d files and %d directory' + // + // Method can be called from any thread. virtual int WINAPI ExpandPluralString(char* buffer, int bufferSize, const char* format, int parametersCount, const CQuadWord* parametersArray) = 0; - // v aktualni jazykove verzi Salamandera pripravi retezec "XXX (selected/hidden) - // files and YYY (selected/hidden) directories"; je-li XXX (hodnota parametru 'files') - // nebo YYY (hodnota parametru 'dirs') nula, prislusna cast retezce se vypousti (oba - // parametry zaroven nulove se neuvazuji); pouziti "selected" a "hidden" zavisi - // na rezimu 'mode' - viz popis konstant epfdmXXX; vysledny text - // se vraci v bufferu 'buffer' o velikosti 'bufferSize' bytu; vraci delku vysledneho - // textu; 'forDlgCaption' je TRUE/FALSE pokud je/neni text urceny pro titulek dialogu - // (v anglictine nutna velka pocatecni pismena) - // mozne volat z libovolneho threadu + // In the current Salamander language version, prepares the string 'XXX (selected/hidden) + // files and YYY (selected/hidden) directories'; if XXX (the value of parameter 'files') + // or YYY (the value of parameter 'dirs') is zero, the corresponding part of the string is omitted (both + // parameters being zero at the same time is not considered); the use of 'selected' and 'hidden' depends + // on mode 'mode' - see the epfdmXXX constants; the resulting text is returned in buffer 'buffer' + // of size 'bufferSize' bytes; returns the length of the resulting text; + // 'forDlgCaption' is TRUE/FALSE depending on whether the text is/is not intended for a dialog caption + // (English requires initial capitals) + // Can be called from any thread virtual int WINAPI ExpandPluralFilesDirs(char* buffer, int bufferSize, int files, int dirs, int mode, BOOL forDlgCaption) = 0; - // v aktualni jazykove verzi Salamandera pripravi retezec "BBB bytes in XXX selected - // files and YYY selected directories"; BBB je hodnota parametru 'selectedBytes'; - // je-li XXX (hodnota parametru 'files') nebo YYY (hodnota parametru 'dirs') nula, - // prislusna cast retezce se vypousti (oba parametry zaroven nulove se neuvazuji); - // je-li 'useSubTexts' TRUE, uzavorkuje se BBB do '<' a '>', aby se s BBB dalo - // dale pracovat na info-line (viz metoda CSalamanderGeneralAbstract::LookForSubTexts a - // CPluginDataInterfaceAbstract::GetInfoLineContent); vysledny text se vraci v bufferu - // 'buffer' o velikosti 'bufferSize' bytu; vraci delku vysledneho textu - // mozne volat z libovolneho threadu + // In the current Salamander language version, prepares the string 'BBB bytes in XXX selected + // files and YYY selected directories'; BBB is the value of parameter 'selectedBytes'; + // if XXX (the value of parameter 'files') or YYY (the value of parameter 'dirs') is zero, + // the corresponding part of the string is omitted (both parameters being zero at the same + // time is not considered); if 'useSubTexts' is TRUE, BBB is enclosed in '<' and '>' so it can be + // processed further on the info line (see CSalamanderGeneralAbstract::LookForSubTexts and + // CPluginDataInterfaceAbstract::GetInfoLineContent); the resulting text is returned in buffer + // 'buffer' of size 'bufferSize' bytes; returns the length of the resulting text + // Can be called from any thread virtual int WINAPI ExpandPluralBytesFilesDirs(char* buffer, int bufferSize, const CQuadWord& selectedBytes, int files, int dirs, BOOL useSubTexts) = 0; - // vraci retezec popisujici s cim se pracuje (napr. "file "test.txt"" nebo "directory "test"" - // nebo "3 files and 1 directory"); 'sourceDescr' je buffer pro vysledek o velikosti - // minimalne 'sourceDescrSize'; 'panel' popisuje zdrojovy panel operace (jedna z PANEL_XXX nebo -1 - // pokud operace nema zdrojovy panel (napr. CPluginFSInterfaceAbstract::CopyOrMoveFromDiskToFS)); - // 'selectedFiles'+'selectedDirs' - pokud ma operace zdrojovy panel, je zde pocet oznacenych - // souboru a adresaru ve zdrojovem panelu, pokud jsou obe hodnoty nulove, pracuje se se - // souborem/adresarem pod kurzorem (fokusem); 'selectedFiles'+'selectedDirs' - pokud operace nema - // zdrojovy panel, je zde pocet souboru/adresaru, se kterymi operace pracuje; - // 'fileOrDirName'+'isDir' - pouziva se jen pokud operace nema zdrojovy panel a pokud - // 'selectedFiles + selectedDirs == 1', je zde jmeno souboru/adresare a jestli jde o soubor - // nebo adresar ('isDir' je FALSE nebo TRUE); 'forDlgCaption' je TRUE/FALSE pokud je/neni - // text urceny pro titulek dialogu (v anglictine nutna velka pocatecni pismena) - // omezeni: hlavni thread (muze pracovat s panelem) + // Returns a string describing what the operation works with (e.g. 'file "test.txt"', 'directory "test"', + // or '3 files and 1 directory'); 'sourceDescr' is the output buffer and must be at least + // 'sourceDescrSize' bytes long; 'panel' describes the source panel of the operation (one of PANEL_XXX or -1 + // if the operation has no source panel, e.g. CPluginFSInterfaceAbstract::CopyOrMoveFromDiskToFS); + // 'selectedFiles'+'selectedDirs' - if the operation has a source panel, this is the number of selected + // files and directories in the source panel; if both values are zero, the operation works with the + // file/directory under the cursor (focus); 'selectedFiles'+'selectedDirs' - if the operation has no + // source panel, this is the number of files/directories the operation works with; + // 'fileOrDirName'+'isDir' - used only if the operation has no source panel and if + // 'selectedFiles + selectedDirs == 1'; they specify the file/directory name and whether it is a file + // or a directory ('isDir' is FALSE or TRUE); 'forDlgCaption' is TRUE/FALSE depending on whether the + // text is/is not intended for a dialog caption (English requires initial capitals) + // Restriction: main thread (it can access the panel) virtual void WINAPI GetCommonFSOperSourceDescr(char* sourceDescr, int sourceDescrSize, int panel, int selectedFiles, int selectedDirs, const char* fileOrDirName, BOOL isDir, BOOL forDlgCaption) = 0; - // nakopiruje retezec 'srcStr' za retezec 'dstStr' (za jeho koncovou nulu); - // 'dstStr' je buffer o velikosti 'dstBufSize' (musi byt nejmene rovno 2); - // pokud se do bufferu oba retezce nevejdou, jsou zkraceny (vzdy tak, aby se - // veslo co nejvice znaku z obou retezu) - // mozne volat z libovolneho threadu + // Copies string 'srcStr' after string 'dstStr' (after its terminating null); + // 'dstStr' is a buffer of size 'dstBufSize' (it must be at least 2); + // if both strings do not fit into the buffer, they are truncated (always so that + // as many characters as possible from both strings fit) + // Can be called from any thread virtual void WINAPI AddStrToStr(char* dstStr, int dstBufSize, const char* srcStr) = 0; - // zjisti jestli je mozne retezec 'fileNameComponent' pouzit jako komponentu - // jmena na Windows filesystemu (resi retezce delsi nez MAX_PATH-4 (4 = "C:\" - // + null-terminator), prazdny retezec, retezce znaku '.', retezce white-spaces, - // znaky "*?\\/<>|\":" a jednoducha jmena typu "prn" a "prn .txt") - // mozne volat z libovolneho threadu + // Determines whether string 'fileNameComponent' can be used as a name component + // on a Windows filesystem (handles strings longer than MAX_PATH-4 (4 = 'C:\' + + // null terminator), empty strings, strings of '.' characters, strings of white-space characters, + // and the characters '*', '?', '\\', '/', '<', '>', '|', '"', ':' as well as simple names such as 'prn' and 'prn .txt') + // Can be called from any thread virtual BOOL WINAPI SalIsValidFileNameComponent(const char* fileNameComponent) = 0; // pretvori retezec 'fileNameComponent' tak, aby mohl byt pouzity jako komponenta From cf2a98dbc75848351a1b5c5939809b5fdd8748f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 17:06:11 +0200 Subject: [PATCH 285/710] [translation] Fix src/plugins/shared/spl_gen.h comments (chunk 12/14) (#660) --- src/plugins/shared/spl_gen.h | 586 +++++++++++++++++------------------ 1 file changed, 291 insertions(+), 295 deletions(-) diff --git a/src/plugins/shared/spl_gen.h b/src/plugins/shared/spl_gen.h index bbef93bcc..24154ef0f 100644 --- a/src/plugins/shared/spl_gen.h +++ b/src/plugins/shared/spl_gen.h @@ -2348,427 +2348,423 @@ class CSalamanderGeneralAbstract // Can be called from any thread virtual BOOL WINAPI SalIsValidFileNameComponent(const char* fileNameComponent) = 0; - // pretvori retezec 'fileNameComponent' tak, aby mohl byt pouzity jako komponenta - // jmena na Windows filesystemu (resi retezce delsi nez MAX_PATH-4 (4 = "C:\" - // + null-terminator), resi prazdny retezec, retezce znaku '.', retezce - // white-spaces, znaky "*?\\/<>|\":" nahradi '_' + jednoducha jmena typu "prn" - // a "prn .txt" doplni o '_' na konci nazvu); 'fileNameComponent' musi jit - // rozsirit alespon o jeden znak (maximalne se vsak z 'fileNameComponent' - // pouzije MAX_PATH bytu) - // mozne volat z libovolneho threadu + // Transforms string 'fileNameComponent' so it can be used as a file-name component + // on the Windows file system (handles strings longer than MAX_PATH-4 (4 bytes for drive-root + // plus null terminator), empty strings, strings consisting only of '.', strings of + // white space, replaces characters such as *, ?, \\, /, <, >, |, ", and : with '_', and appends '_' to simple names such as "prn" + // and "prn .txt"); 'fileNameComponent' must be extensible by + // at least one character (but at most MAX_PATH bytes of 'fileNameComponent' + // are used) + // Can be called from any thread virtual void WINAPI SalMakeValidFileNameComponent(char* fileNameComponent) = 0; - // vraci TRUE pokud je zdroj enumerace panel, v 'panel' pak vraci PANEL_LEFT nebo - // PANEL_RIGHT; pokud nebyl zdroj enumerace nalezen nebo jde o Find okno, vraci FALSE; - // 'srcUID' je unikatni identifikator zdroje (predava se jako parametr pri otevirani - // vieweru nebo jej lze ziskat volanim GetPanelEnumFilesParams) - // mozne volat z libovolneho threadu + // Returns TRUE if the enumeration source is a panel; 'panel' then receives PANEL_LEFT or + // PANEL_RIGHT. If the enumeration source was not found or is a Find window, it returns FALSE; + // 'srcUID' is the unique source identifier (passed as a parameter when opening the + // viewer or obtainable by calling GetPanelEnumFilesParams) + // Can be called from any thread virtual BOOL WINAPI IsFileEnumSourcePanel(int srcUID, int* panel) = 0; - // vraci dalsi jmeno souboru pro viewer ze zdroje (levy/pravy panel nebo Findy); - // 'srcUID' je unikatni identifikator zdroje (predava se jako parametr pri otevirani - // vieweru nebo jej lze ziskat volanim GetPanelEnumFilesParams); 'lastFileIndex' - // (nesmi byt NULL) je IN/OUT parametr, ktery by plugin mel menit jen pokud chce vratit - // jmeno prvniho souboru, v tomto pripade nastavit 'lastFileIndex' na -1; pocatecni - // hodnota 'lastFileIndex' se predava jako parametr jak pri otevirani vieweru, tak - // pri volani GetPanelEnumFilesParams; 'lastFileName' je plne jmeno aktualniho souboru - // (prazdny retezec pokud neni zname, napr. je-li 'lastFileIndex' -1); je-li - // 'preferSelected' TRUE a aspon jedno jmeno oznacene, budou se vracet oznacena jmena; - // je-li 'onlyAssociatedExtensions' TRUE, vraci jen soubory s priponou asociovanou s - // viewerem tohoto pluginu (F3 na tomto souboru by se pokusilo otevrit viewer tohoto - // pluginu + ignoruje pripadne zastineni viewerem jineho pluginu); 'fileName' je buffer - // pro ziskane jmeno (velikost alespon MAX_PATH); vraci TRUE pokud se podari jmeno - // ziskat; vraci FALSE pri chybe: zadne dalsi jmeno souboru ve zdroji neni (neni-li - // 'noMoreFiles' NULL, vraci se v nem TRUE), zdroj je zaneprazdnen (nezpracovava zpravy; - // neni-li 'srcBusy' NULL, vraci se v nem TRUE), jinak zdroj prestal existovat (zmena - // cesty v panelu, atp.); - // mozne volat z libovolneho threadu; POZOR: pouziti z hlavniho threadu nedava smysl - // (Salamander je pri volani metody pluginu zaneprazdeny, takze vzdy vrati FALSE + TRUE - // v 'srcBusy') + // Returns the next file name for the viewer from the source (left/right panel or Find); + // 'srcUID' is the unique source identifier (passed as a parameter when opening the + // viewer or obtainable by calling GetPanelEnumFilesParams); 'lastFileIndex' + // (must not be NULL) is an IN/OUT parameter that the plugin should change only if it wants to return + // the first file name, in which case it must set 'lastFileIndex' to -1; the initial + // value of 'lastFileIndex' is passed both when opening the viewer and + // when calling GetPanelEnumFilesParams; 'lastFileName' is the full name of the current file + // (empty string if it is not known, for example if 'lastFileIndex' is -1); if + // 'preferSelected' is TRUE and at least one name is selected, selected names are returned; + // if 'onlyAssociatedExtensions' is TRUE, it returns only files whose extension is associated with + // this plugin's viewer (F3 on such a file would try to open this plugin's viewer + // and ignores any shadowing by another plugin's viewer); 'fileName' is the buffer + // for the retrieved name (size at least MAX_PATH); returns TRUE if the name is obtained + // successfully; returns FALSE on error: there is no next file name in the source (if + // 'noMoreFiles' is not NULL, it receives TRUE), the source is busy (not processing messages; + // if 'srcBusy' is not NULL, it receives TRUE), or the source no longer exists (panel path changed, + // etc.); + // Can be called from any thread; WARNING: calling it from the main thread is pointless + // (Salamander is busy while calling the plugin method, so it always returns FALSE + TRUE + // in 'srcBusy') virtual BOOL WINAPI GetNextFileNameForViewer(int srcUID, int* lastFileIndex, const char* lastFileName, BOOL preferSelected, BOOL onlyAssociatedExtensions, char* fileName, BOOL* noMoreFiles, BOOL* srcBusy) = 0; - // vraci predchozi jmeno souboru pro viewer ze zdroje (levy/pravy panel nebo Findy); - // 'srcUID' je unikatni identifikator zdroje (predava se jako parametr pri otevirani - // vieweru nebo jej lze ziskat volanim GetPanelEnumFilesParams); 'lastFileIndex' (nesmi - // byt NULL) je IN/OUT parametr, ktery by plugin mel menit jen pokud chce vratit jmeno - // posledniho souboru, v tomto pripade nastavit 'lastFileIndex' na -1; pocatecni hodnota - // 'lastFileIndex' se predava jako parametr jak pri otevirani vieweru, tak pri volani - // GetPanelEnumFilesParams; 'lastFileName' je plne jmeno aktualniho souboru (prazdny - // retezec pokud neni zname, napr. je-li 'lastFileIndex' -1); je-li 'preferSelected' - // TRUE a aspon jedno jmeno oznacene, budou se vracet oznacena jmena; je-li - // 'onlyAssociatedExtensions' TRUE, vraci jen soubory s priponou asociovanou s viewerem - // tohoto pluginu (F3 na tomto souboru by se pokusilo otevrit viewer tohoto - // pluginu + ignoruje pripadne zastineni viewerem jineho pluginu); 'fileName' je buffer - // pro ziskane jmeno (velikost alespon MAX_PATH); vraci TRUE pokud se podari jmeno - // ziskat; vraci FALSE pri chybe: zadne predchozi jmeno souboru ve zdroji neni (neni-li - // 'noMoreFiles' NULL, vraci se v nem TRUE), zdroj je zaneprazdnen (nezpracovava zpravy; - // neni-li 'srcBusy' NULL, vraci se v nem TRUE), jinak zdroj prestal existovat (zmena - // cesty v panelu, atp.) - // mozne volat z libovolneho threadu; POZOR: pouziti z hlavniho threadu nedava smysl - // (Salamander je pri volani metody pluginu zaneprazdeny, takze vzdy vrati FALSE + TRUE - // v 'srcBusy') + // Returns the previous file name for the viewer from the source (left/right panel or Find); + // 'srcUID' is the unique source identifier (passed as a parameter when opening the + // viewer or obtainable by calling GetPanelEnumFilesParams); 'lastFileIndex' (must + // not be NULL) is an IN/OUT parameter that the plugin should change only if it wants to return the + // last file name, in which case it must set 'lastFileIndex' to -1; the initial value + // of 'lastFileIndex' is passed both when opening the viewer and when calling + // GetPanelEnumFilesParams; 'lastFileName' is the full name of the current file (empty + // string if it is not known, for example if 'lastFileIndex' is -1); if 'preferSelected' + // is TRUE and at least one name is selected, selected names are returned; if + // 'onlyAssociatedExtensions' is TRUE, it returns only files whose extension is associated with + // this plugin's viewer (F3 on such a file would try to open this plugin's viewer + // and ignores any shadowing by another plugin's viewer); 'fileName' is the buffer + // for the retrieved name (size at least MAX_PATH); returns TRUE if the name is obtained + // successfully; returns FALSE on error: there is no previous file name in the source (if + // 'noMoreFiles' is not NULL, it receives TRUE), the source is busy (not processing messages; + // if 'srcBusy' is not NULL, it receives TRUE), or the source no longer exists (panel + // path changed, etc.) + // Can be called from any thread; WARNING: calling it from the main thread is pointless + // (Salamander is busy while calling the plugin method, so it always returns FALSE + TRUE + // in 'srcBusy') virtual BOOL WINAPI GetPreviousFileNameForViewer(int srcUID, int* lastFileIndex, const char* lastFileName, BOOL preferSelected, BOOL onlyAssociatedExtensions, char* fileName, BOOL* noMoreFiles, BOOL* srcBusy) = 0; - // zjisti, jestli je aktualni soubor z vieweru oznaceny (selected) ve zdroji (levy/pravy - // panel nebo Findy); 'srcUID' je unikatni identifikator zdroje (predava se jako parametr - // pri otevirani vieweru nebo jej lze ziskat volanim GetPanelEnumFilesParams); 'lastFileIndex' - // je parametr, ktery by plugin nemel menit, pocatecni hodnota 'lastFileIndex' se predava - // jako parametr jak pri otevirani vieweru, tak pri volani GetPanelEnumFilesParams; - // 'lastFileName' je plne jmeno aktualniho souboru; vraci TRUE pokud se podarilo zjistit, - // jestli je aktualni soubor oznaceny, vysledek je v 'isFileSelected' (nesmi byt NULL); - // vraci FALSE pri chybe: zdroj prestal existovat (zmena cesty v panelu, atp.) nebo soubor - // 'lastFileName' uz ve zdroji neni (pri techto dvou chybach, neni-li 'srcBusy' NULL, - // vraci se v nem FALSE), zdroj je zaneprazdnen (nezpracovava zpravy; pri teto chybe, - // neni-li 'srcBusy' NULL, vraci se v nem TRUE) - // mozne volat z libovolneho threadu; POZOR: pouziti z hlavniho threadu nedava smysl - // (Salamander je pri volani metody pluginu zaneprazdeny, takze vzdy vrati FALSE + TRUE - // v 'srcBusy') + // Determines whether the current file in the viewer is selected in the source (left/right + // panel or Find); 'srcUID' is the unique source identifier (passed as a parameter + // when opening the viewer or obtainable by calling GetPanelEnumFilesParams); 'lastFileIndex' + // is a parameter that the plugin should not change; the initial value of 'lastFileIndex' is passed + // both when opening the viewer and when calling GetPanelEnumFilesParams; + // 'lastFileName' is the full name of the current file; returns TRUE if it was possible to determine + // whether the current file is selected; the result is returned in 'isFileSelected' (must not be NULL); + // returns FALSE on error: the source no longer exists (panel path changed, etc.) or file + // 'lastFileName' is no longer in the source (for these two errors, if 'srcBusy' is not NULL, + // it receives FALSE), or the source is busy (not processing messages; for this error, + // if 'srcBusy' is not NULL, it receives TRUE) + // Can be called from any thread; WARNING: calling it from the main thread is pointless + // (Salamander is busy while calling the plugin method, so it always returns FALSE + TRUE + // in 'srcBusy') virtual BOOL WINAPI IsFileNameForViewerSelected(int srcUID, int lastFileIndex, const char* lastFileName, BOOL* isFileSelected, BOOL* srcBusy) = 0; - // nastavi oznaceni (selectionu) na aktualnim souboru z vieweru ve zdroji (levy/pravy - // panel nebo Findy); 'srcUID' je unikatni identifikator zdroje (predava se jako parametr - // pri otevirani vieweru nebo jej lze ziskat volanim GetPanelEnumFilesParams); - // 'lastFileIndex' je parametr, ktery by plugin nemel menit, pocatecni hodnota - // 'lastFileIndex' se predava jako parametr jak pri otevirani vieweru, tak pri volani - // GetPanelEnumFilesParams; 'lastFileName' je plne jmeno aktualniho souboru; 'select' - // je TRUE/FALSE pokud se ma aktualni soubor oznacit/odznacit; vraci TRUE pri uspechu; - // vraci FALSE pri chybe: zdroj prestal existovat (zmena cesty v panelu, atp.) nebo - // soubor 'lastFileName' uz ve zdroji neni (pri techto dvou chybach, neni-li 'srcBusy' - // NULL, vraci se v nem FALSE), zdroj je zaneprazdnen (nezpracovava zpravy; pri teto - // chybe, neni-li 'srcBusy' NULL, vraci se v nem TRUE) - // mozne volat z libovolneho threadu; POZOR: pouziti z hlavniho threadu nedava smysl - // (Salamander je pri volani metody pluginu zaneprazdeny, takze vzdy vrati FALSE + TRUE - // v 'srcBusy') + // Sets the selection state of the current file in the viewer in the source (left/right + // panel or Find); 'srcUID' is the unique source identifier (passed as a parameter + // when opening the viewer or obtainable by calling GetPanelEnumFilesParams); + // 'lastFileIndex' is a parameter that the plugin should not change; the initial value + // of 'lastFileIndex' is passed both when opening the viewer and when calling + // GetPanelEnumFilesParams; 'lastFileName' is the full name of the current file; 'select' + // is TRUE/FALSE depending on whether the current file should be selected/deselected; returns TRUE on success; + // returns FALSE on error: the source no longer exists (panel path changed, etc.) or + // file 'lastFileName' is no longer in the source (for these two errors, if 'srcBusy' + // is not NULL, it receives FALSE), or the source is busy (not processing messages; for this + // error, if 'srcBusy' is not NULL, it receives TRUE) + // Can be called from any thread; WARNING: calling it from the main thread is pointless + // (Salamander is busy while calling the plugin method, so it always returns FALSE + TRUE + // in 'srcBusy') virtual BOOL WINAPI SetSelectionOnFileNameForViewer(int srcUID, int lastFileIndex, const char* lastFileName, BOOL select, BOOL* srcBusy) = 0; - // vraci odkaz na sdilenou historii (posledne pouzite hodnoty) zvoleneho comboboxu; - // jde o pole alokovanych retezcu; pole ma pevny pocet retezcu, ten se vraci - // v 'historyItemsCount' (nesmi byt NULL); odkaz na pole se vraci v 'historyArr' - // (nesmi byt NULL); 'historyID' (jedna v SALHIST_XXX) urcuje, na kterou sdilenou historii se ma vracet - // odkaz - // omezeni: hlavni thread (sdilene historie se v jinem threadu nedaji pouzivat, pristup - // do nich neni nijak synchronizovany) + // Returns a pointer to the shared history (last used values) of the selected combo box; + // it is an array of allocated strings; the array has a fixed number of strings, returned + // in 'historyItemsCount' (must not be NULL); the pointer to the array is returned in 'historyArr' + // (must not be NULL); 'historyID' (one of SALHIST_XXX) specifies which shared history the pointer refers to + // Main thread only (shared histories cannot be used from another thread; access + // to them is not synchronized in any way) virtual BOOL WINAPI GetStdHistoryValues(int historyID, char*** historyArr, int* historyItemsCount) = 0; - // prida do sdilene historie ('historyArr'+'historyItemsCount') naalokovanou kopii - // nove hodnoty 'value'; je-li 'caseSensitiveValue' TRUE, hleda se hodnota (retezec) - // v poli historie pomoci case-sensitive porovnani (FALSE = case-insensitive porovnani), - // nalezena hodnota se pouze presouva na prvni misto v poli historie - // omezeni: hlavni thread (sdilene historie se v jinem threadu nedaji pouzivat, pristup - // do nich neni nijak synchronizovany) - // POZNAMKA: pokud se pouziva pro jine nez sdilene historie, je mozne volat v libovolnem threadu + // Adds an allocated copy of the new value 'value' to the shared history ('historyArr'+'historyItemsCount'); if 'caseSensitiveValue' is TRUE, the value + // (string) is searched in the history array using a case-sensitive comparison + // (FALSE = case-insensitive comparison), + // if the value is found, it is only moved to the first position in the history array + // Main thread only (shared histories cannot be used from another thread; access + // to them is not synchronized in any way) + // NOTE: if used for something other than shared histories, it can be called from any thread virtual void WINAPI AddValueToStdHistoryValues(char** historyArr, int historyItemsCount, const char* value, BOOL caseSensitiveValue) = 0; - // prida do comboboxu ('combo') texty ze sdilene historie ('historyArr'+'historyItemsCount'); - // pred pridavanim provede reset obsahu comboboxu (viz CB_RESETCONTENT) - // omezeni: hlavni thread (sdilene historie se v jinem threadu nedaji pouzivat, pristup - // do nich neni nijak synchronizovany) - // POZNAMKA: pokud se pouziva pro jine nez sdilene historie, je mozne volat v libovolnem threadu + // Adds strings from the shared history ('historyArr'+'historyItemsCount') to combo box 'combo'; + // before adding them, it resets the combo box contents (see CB_RESETCONTENT) + // Main thread only (shared histories cannot be used from another thread; access + // to them is not synchronized in any way) + // NOTE: if used for something other than shared histories, it can be called from any thread virtual void WINAPI LoadComboFromStdHistoryValues(HWND combo, char** historyArr, int historyItemsCount) = 0; - // zjisti barevnou hloubku aktualniho zobrazeni a je-li vice nez 8-bit (256 barev), vraci TRUE - // mozne volat z libovolneho threadu + // Determines the color depth of the current display and returns TRUE if it is more than 8-bit (256 colors) + // Can be called from any thread virtual BOOL WINAPI CanUse256ColorsBitmap() = 0; - // zkontroluje jestli je enablovany-root-parent okna 'parent' foreground window, pokud ne, - // udela se FlashWindow(root-parent okna 'parent', TRUE) a vrati root-parent okna 'parent', - // jinak se vraci NULL - // POUZITI: + // Checks whether the enabled root parent of window 'parent' is the foreground window; if not, + // calls FlashWindow(root parent of window 'parent', TRUE) and returns the root parent of window 'parent', + // otherwise returns NULL + // USAGE: // HWND mainWnd = GetWndToFlash(parent); // CDlg(parent).Execute(); - // if (mainWnd != NULL) FlashWindow(mainWnd, FALSE); // pod W2K+ uz asi neni potreba: flashovani se musi odstranit rucne - // mozne volat z libovolneho threadu + // if (mainWnd != NULL) FlashWindow(mainWnd, FALSE); // under W2K+ this is probably no longer needed: flashing must be cleared manually + // Can be called from any thread virtual HWND WINAPI GetWndToFlash(HWND parent) = 0; - // provede reaktivaci drop-targetu (po dropnuti pri drag&dropu) po otevreni naseho progress- - // -okna (to se pri otevreni aktivuje, cimz deaktivuje drop-target); neni-li 'dropTarget' - // NULL a zaroven nejde o panel v tomto Salamanderovi, provede aktivaci 'progressWnd' a nasledne - // aktivaci nejvzdalenejsiho enablovaneho predka 'dropTarget' (tato kombinace nas zbavi aktivovaneho - // stavu bez aktivni aplikace, ktery jinak obcas vznika) - // mozne volat z libovolneho threadu + // Reactivates the drop target (after a drop during drag&drop) after opening our progress + // window (it becomes active when opened, which deactivates the drop target); if 'dropTarget' + // is not NULL and is not a panel in this Salamander instance, it activates 'progressWnd' and then + // activates the farthest enabled ancestor of 'dropTarget' (this combination clears the active + // state without an active application, which otherwise sometimes occurs) + // Can be called from any thread virtual void WINAPI ActivateDropTarget(HWND dropTarget, HWND progressWnd) = 0; - // naplanuje otevreni Pack dialogu s vybranym packerem z tohoho pluginu (viz - // CSalamanderConnectAbstract::AddCustomPacker), pokud packer z tohoto pluginu - // neexistuje (napr. protoze ho uzivatel smazal), vypise se userovi chybova - // hlaska; dialog se otevre jakmile nebudou v message-queue hl. threadu zadne - // zpravy a Salamander nebude "busy" (nebude otevreny zadny modalni dialog - // a nebude se zpracovavat zadna zprava); opakovane volani teto metody pred - // otevrenim Pack dialogu vede jen ke zmene parametru 'delFilesAfterPacking'; - // 'delFilesAfterPacking' ovlivnuje checkbox "Delete files after packing" - // v Pack dialogu: 0=default, 1=zapnuty, 2=vypnuty - // omezeni: hlavni thread + // Schedules the Pack dialog to open with the selected packer from this plugin (see + // CSalamanderConnectAbstract::AddCustomPacker); if that packer from this plugin + // does not exist (for example because the user deleted it), an error message is shown to the user; + // the dialog opens when the main thread message queue is empty + // and Salamander is not "busy" (no modal dialog is open + // and no message is being processed); repeated calls to this method before + // the Pack dialog opens only change the 'delFilesAfterPacking' parameter; + // 'delFilesAfterPacking' controls the "Delete files after packing" check box + // in the Pack dialog: 0=default, 1=on, 2=off + // Main thread only virtual void WINAPI PostOpenPackDlgForThisPlugin(int delFilesAfterPacking) = 0; - // naplanuje otevreni Unpack dialogu s vybranym unpackerem z tohoho pluginu (viz - // CSalamanderConnectAbstract::AddCustomUnpacker), pokud unpacker z tohoto pluginu - // neexistuje (napr. protoze ho uzivatel smazal), vypise se userovi chybova - // hlaska; dialog se otevre jakmile nebudou v message-queue hl. threadu zadne - // zpravy a Salamander nebude "busy" (nebude otevreny zadny modalni dialog - // a nebude se zpracovavat zadna zprava); opakovane volani teto metody pred - // otevrenim Unpack dialogu vede jen ke zmene parametru 'unpackMask'; - // 'unpackMask' ovlivnuje masku "Unpack files": NULL=default, jinak text masky - // omezeni: hlavni thread + // Schedules the Unpack dialog to open with the selected unpacker from this plugin (see + // CSalamanderConnectAbstract::AddCustomUnpacker); if that unpacker from this plugin + // does not exist (for example because the user deleted it), an error message is shown to the user; + // the dialog opens when the main thread message queue is empty + // and Salamander is not "busy" (no modal dialog is open + // and no message is being processed); repeated calls to this method before + // the Unpack dialog opens only change the 'unpackMask' parameter; + // 'unpackMask' controls the "Unpack files" mask: NULL=default, otherwise the mask text + // Main thread only virtual void WINAPI PostOpenUnpackDlgForThisPlugin(const char* unpackMask) = 0; - // vytvoreni souboru se jmenem 'fileName' pres klasicke volani Win32 API + // Creates a file named 'fileName' using the standard Win32 API // CreateFile (lpSecurityAttributes==NULL, dwCreationDisposition==CREATE_NEW, - // hTemplateFile==NULL); tato metoda resi kolizi 'fileName' s dosovym nazvem - // jiz existujiciho souboru/adresare (jen pokud nejde i o kolizi s dlouhym - // jmenem souboru/adresare) - zajisti zmenu dosoveho jmena tak, aby se soubor se - // jmenem 'fileName' mohl vytvorit (zpusob: docasne prejmenuje konfliktni - // soubor/adresar na jine jmeno a po vytvoreni 'fileName' ho prejmenuje zpet); - // vraci handle souboru nebo pri chybe INVALID_HANDLE_VALUE (vraci v 'err' - // (neni-li NULL) kod Windows chyby) - // mozne volat z libovolneho threadu + // hTemplateFile==NULL); this method resolves collisions between 'fileName' and the DOS name + // of an existing file/directory (but only if there is no collision with the long + // file/directory name as well) - it changes the DOS name so that the file named + // 'fileName' can be created (it temporarily renames the conflicting + // file/directory to another name and renames it back after creating 'fileName'); + // returns a file handle or, on error, INVALID_HANDLE_VALUE (returns the Windows error code + // in 'err' if it is not NULL) + // Can be called from any thread virtual HANDLE WINAPI SalCreateFileEx(const char* fileName, DWORD desiredAccess, DWORD shareMode, DWORD flagsAndAttributes, DWORD* err) = 0; - // vytvoreni adresare se jmenem 'name' pres klasicke volani Win32 API - // CreateDirectory(lpSecurityAttributes==NULL); tato metoda resi kolizi 'name' - // s dosovym nazvem jiz existujiciho souboru/adresare (jen pokud nejde i o - // kolizi s dlouhym jmenem souboru/adresare) - zajisti zmenu dosoveho jmena - // tak, aby se adresar se jmenem 'name' mohl vytvorit (zpusob: docasne prejmenuje - // konfliktni soubor/adresar na jine jmeno a po vytvoreni 'name' ho - // prejmenuje zpet); dale resi jmena koncici na mezery (umi je vytvorit, narozdil - // od CreateDirectory, ktera mezery bez varovani orizne a vytvori tak vlastne - // jiny adresar); vraci TRUE pri uspechu, pri chybe FALSE (vraci v 'err' - // (neni-li NULL) kod Windows chyby) - // mozne volat z libovolneho threadu + // Creates a directory named 'name' using the standard Win32 API + // CreateDirectory(lpSecurityAttributes==NULL); this method resolves collisions of 'name' + // with the DOS name of an existing file/directory (but only if there is no + // collision with the long file/directory name as well) - it changes the DOS name + // so that the directory named 'name' can be created (it temporarily renames the + // conflicting file/directory to another name and renames it back after creating 'name'); it also handles + // names ending with spaces (it can create them, unlike CreateDirectory, which trims spaces without warning and thus creates a + // different directory); returns TRUE on success, FALSE on error (returns the Windows error code + // in 'err' if it is not NULL) + // Can be called from any thread virtual BOOL WINAPI SalCreateDirectoryEx(const char* name, DWORD* err) = 0; - // umozni odpojit/pripojit sledovani zmen (jen pro windows cesty a cesty do archivu) - // na cestach prohlizenych v jednom z panelu; ucel: pokud vasemu kodu (formatovani - // disku, shredovani disku, atp.) prekazi to, ze panel ma pro cestu otevreny handle - // "ChangeNotification", touto metodou jej muzete docasne odpojit (po pripojeni se - // vyvolava refresh pro cestu v panelu); 'panel' je jeden z PANEL_XXX; 'stopMonitoring' - // je TRUE/FALSE (odpojeni/pripojeni) - // omezeni: hlavni thread + // Allows you to disconnect/reconnect change monitoring (only for Windows paths and archive paths) + // on paths currently displayed in one of the panels; purpose: if your code (formatting + // a disk, shredding a disk, etc.) is obstructed because the panel has an open + // "ChangeNotification" handle for the path, this method lets you disconnect it temporarily (after reconnecting, + // a refresh is triggered for the panel path); 'panel' is one of PANEL_XXX; 'stopMonitoring' + // is TRUE/FALSE (disconnect/reconnect) + // Main thread only virtual void WINAPI PanelStopMonitoring(int panel, BOOL stopMonitoring) = 0; - // alokuje novy objekt CSalamanderDirectory pro praci se soubory/adresari v archivu nebo - // file-systemu; je-li 'isForFS' TRUE, je objekt prednastaven pro pouziti pro file-system, - // jinak je objekt prednastaven pro pouziti pro archiv (defaultni flagy objektu se - // lisi pro archiv a file-system, viz metoda CSalamanderDirectoryAbstract::SetFlags) - // mozne volat z libovolneho threadu + // Allocates a new CSalamanderDirectory object for working with files/directories in an archive or + // file system; if 'isForFS' is TRUE, the object is preconfigured for file-system use, + // otherwise it is preconfigured for archive use (the object's default flags differ + // for archives and file systems; see CSalamanderDirectoryAbstract::SetFlags) + // Can be called from any thread virtual CSalamanderDirectoryAbstract* WINAPI AllocSalamanderDirectory(BOOL isForFS) = 0; - // uvolni objekt CSalamanderDirectory (ziskany metodou AllocSalamanderDirectory, - // POZOR: nesmi se volat pro zadny jiny ukazatel CSalamanderDirectoryAbstract) - // mozne volat z libovolneho threadu + // Frees a CSalamanderDirectory object (obtained with AllocSalamanderDirectory, + // WARNING: must not be called for any other CSalamanderDirectoryAbstract pointer) + // Can be called from any thread virtual void WINAPI FreeSalamanderDirectory(CSalamanderDirectoryAbstract* salDir) = 0; - // prida novy timer pro objekt pluginoveho FS; az dojde k timeoutu timeru, zavola se metoda + // Adds a new timer for plugin FS object; when the timer times out, the // CPluginFSInterfaceAbstract::Event() objektu pluginoveho FS 'timerOwner' s parametry // FSE_TIMER a 'timerParam'; 'timeout' je timeout timeru od jeho pridani (v milisekundach, - // musi byt >= 0); timer se zrusi v okamziku sveho timeoutu (pred volanim + // must be >= 0); the timer is canceled when it times out (before calling // CPluginFSInterfaceAbstract::Event()) nebo pri zavreni objektu pluginoveho FS; - // vraci TRUE, pokud byl timer uspesne pridan - // omezeni: hlavni thread + // returns TRUE if the timer was added successfully + // Main thread only virtual BOOL WINAPI AddPluginFSTimer(int timeout, CPluginFSInterfaceAbstract* timerOwner, DWORD timerParam) = 0; - // zrusi bud vsechny timery objektu pluginoveho FS 'timerOwner' (je-li 'allTimers' TRUE) - // nebo jen vsechny timery s parametrem rovnym 'timerParam' (je-li 'allTimers' FALSE); - // vraci pocet zrusenych timeru - // omezeni: hlavni thread + // Cancels either all timers of plugin FS object 'timerOwner' (if 'allTimers' is TRUE) + // or only all timers whose parameter equals 'timerParam' (if 'allTimers' is FALSE); + // returns the number of canceled timers + // Main thread only virtual int WINAPI KillPluginFSTimer(CPluginFSInterfaceAbstract* timerOwner, BOOL allTimers, DWORD timerParam) = 0; - // zjistuje viditelnost polozky pro FS v Change Drive menu a v Drive barach; vraci TRUE, - // pokud je polozka viditelna, jinak vraci FALSE - // omezeni: hlavni thread (jinak muze dojit ke zmenam v konfiguraci pluginu behem volani) + // Determines the visibility of the FS item in the Change Drive menu and drive bars; returns TRUE, + // if the item is visible, otherwise returns FALSE + // Main thread only (otherwise plugin configuration may change during the call) virtual BOOL WINAPI GetChangeDriveMenuItemVisibility() = 0; - // nastavuje viditelnost polozky pro FS v Change Drive menu a v Drive barach; pouzivat - // jen pri instalaci pluginu (jinak hrozi prenastaveni uzivatelem zvolene viditelnosti); - // 'visible' je TRUE v pripade, ze polozka ma byt viditelna - // omezeni: hlavni thread (jinak muze dojit ke zmenam v konfiguraci pluginu behem volani) + // Sets the visibility of the FS item in the Change Drive menu and drive bars; use + // only during plugin installation (otherwise the user-selected visibility may be overwritten); + // 'visible' is TRUE if the item should be visible + // Main thread only (otherwise plugin configuration may change during the call) virtual void WINAPI SetChangeDriveMenuItemVisibility(BOOL visible) = 0; - // Nastavuje breakpoint na x-tou COM/OLE alokaci. Slouzi k dohledani COM/OLE leaku. - // V release verzi Salamandera nedela nic. Debug verze Salamandera pri svem ukonceni - // zobrazuje do Debug okna debuggeru a do Trace Serveru seznam COM/OLE leaku. - // V hranatych zavorkach je poradi alokace, kterou predame jako 'alloc' do volani - // OleSpySetBreak. Lze zavolat z libovolneho threadu. + // Sets a breakpoint on the x-th COM/OLE allocation. Used to locate COM/OLE leaks. + // In the release version of Salamander it does nothing. The debug version of Salamander, when it exits, + // displays a list of COM/OLE leaks in the debugger's Debug window and in Trace Server. + // The allocation number shown in square brackets is passed as 'alloc' to + // OleSpySetBreak. Can be called from any thread. virtual void WINAPI OleSpySetBreak(int alloc) = 0; - // Vraci kopie ikon, ktere Salamander pouziva v panelech. 'icon' urcuje ikonu a jde - // o jednu z hodnot SALICON_xxx. 'iconSize' urcuje jakou ma mit vracena ikona velikost - // a jde o jednu z hodnot SALICONSIZE_xxx. - // V pripade uspechu vraci handle vytvorene ikony. Destrukci ikony musi zajistit - // plugin pomoci volani API DestroyIcon. V pripade neuspechu vraci NULL. - // omezeni: hlavni thread + // Returns copies of the icons used by Salamander in panels. 'icon' specifies the icon and is + // one of the SALICON_xxx values. 'iconSize' specifies the size of the returned icon + // and is one of the SALICONSIZE_xxx values. + // On success, returns a handle to the created icon. The plugin must destroy the icon + // by calling the DestroyIcon API. On failure, returns NULL. + // Main thread only virtual HICON WINAPI GetSalamanderIcon(int icon, int iconSize) = 0; // GetFileIcon - // Function retrieves handle to large or small icon from the specified object, - // such as a file, a folder, a directory, or a drive root. + // Retrieves a handle to a large or small icon for the specified object, + // such as a file, folder, directory, or drive root. // // Parameters // 'path' - // [in] Pointer to a null-terminated string that contains the path and file - // name. If the 'pathIsPIDL' parameter is TRUE, this parameter must be the - // address of an ITEMIDLIST (PIDL) structure that contains the list of item - // identifiers that uniquely identify the file within the Shell's namespace. - // The PIDL must be a fully qualified PIDL. Relative PIDLs are not allowed. + // [in] Pointer to a null-terminated string containing the path and file + // name. If 'pathIsPIDL' is TRUE, this parameter must be the address of a + // fully qualified ITEMIDLIST (PIDL) structure containing the item identifiers + // that uniquely identify the file in the Shell namespace. Relative PIDLs are + // not allowed. // // 'pathIsPIDL' - // [in] Indicate that 'path' is the address of an ITEMIDLIST structure rather + // [in] Indicates that 'path' is the address of an ITEMIDLIST structure rather // than a path name. // // 'hIcon' - // [out] Pointer to icon handle that receive handle to the icon extracted - // from the object. + // [out] Pointer to a handle that receives the icon extracted from the object. // // 'iconSize' - // [in] Required size of icon. SALICONSIZE_xxx + // [in] Required icon size. One of the SALICONSIZE_xxx values. // // 'fallbackToDefIcon' - // [in] Value specifying whether the default (simple) icon should be used if - // the icon of the specified object is not available. If this parameter is - // TRUE, function tries to return the default (simple) icon in this situation. - // Otherwise, it returns no icon (return value is FALSE). + // [in] Specifies whether to use the default (simple) icon if the specified + // object's icon is not available. If this parameter is TRUE, the function + // tries to return the default icon in that case. Otherwise it returns no icon + // (the return value is FALSE). // // 'defIconIsDir' - // [in] Specifies whether the default (simple) icon for 'path' is icon of - // directory. This parameter is ignored unless 'fallbackToDefIcon' is TRUE. + // [in] Specifies whether the default (simple) icon for 'path' is a directory + // icon. This parameter is ignored unless 'fallbackToDefIcon' is TRUE. // // Return Values - // Returns TRUE if successful, or FALSE otherwise. + // Returns TRUE on success, or FALSE otherwise. // // Remarks - // You are responsible for freeing returned icons with DestroyIcon when you - // no longer need them. - // - // You must initialize COM with CoInitialize or OLEInitialize prior to - // calling GetFileIcon. + // You are responsible for freeing returned icons with DestroyIcon when they are + // no longer needed. // - // Method can be called from any thread. + // You must initialize COM with CoInitialize or OLEInitialize before calling + // GetFileIcon. // + // Can be called from any thread. virtual BOOL WINAPI GetFileIcon(const char* path, BOOL pathIsPIDL, HICON* hIcon, int iconSize, BOOL fallbackToDefIcon, BOOL defIconIsDir) = 0; // FileExists - // Function checks the existence of a file. It returns TRUE if the specified - // file exists. If the file does not exist, it returns 0. FileExists only checks - // the existence of files, directories are ignored. - // lze volat z libovolneho threadu + // Checks whether a file exists. Returns TRUE if the specified file exists. + // If the file does not exist, it returns FALSE. FileExists checks only files; + // directories are ignored. + // Can be called from any thread virtual BOOL WINAPI FileExists(const char* fileName) = 0; - // provede zmenu cesty v panelu na posledni znamou diskovou cestu, pokud neni pristupna, - // tak se provede zmena na uzivatelem zvolenou "zachranou" cestu (viz - // SALCFG_IFPATHISINACCESSIBLEGOTO) a pokud i ta selze, tak na root prvniho lokalniho - // fixed drivu (Salamander 2.5 a 2.51 dela jen zmenu na root prvniho lokalniho fixed drivu); - // pouziva se pro zavreni file-systemu v panelu (disconnect); 'parent' je parent pripadnych - // messageboxu; 'panel' je jeden z PANEL_XXX - // omezeni: hlavni thread + mimo metody CPluginFSInterfaceAbstract a CPluginDataInterfaceAbstract - // (hrozi napr. zavreni FS otevreneho v panelu - metode by mohl prestat existovat 'this') + // Changes the panel path to the last known disk path; if it is not accessible, + // it changes to the user-selected "rescue" path (see + // SALCFG_IFPATHISINACCESSIBLEGOTO), and if that also fails, to the root of the first local + // fixed drive (Salamander 2.5 and 2.51 only change to the root of the first local fixed drive); + // used to close the file system in a panel (disconnect); 'parent' is the parent of any + // message boxes; 'panel' is one of PANEL_XXX + // Main thread only, and not from CPluginFSInterfaceAbstract or CPluginDataInterfaceAbstract methods + // (for example, the FS open in the panel may be closed, so the method's 'this' pointer may cease to be valid) virtual void WINAPI DisconnectFSFromPanel(HWND parent, int panel) = 0; - // vraci TRUE, pokud je nazev souboru 'name' asociovan v Archives Associations in Panels - // k volajicimu pluginu - // 'name' musi byt pouze nazev souboru, ne s plnou nebo relativni cestou - // omezeni: hlavni thread + // Returns TRUE if file name 'name' is associated with the calling plugin in Archives Associations in Panels + // 'tname' must contain only the file name, not a full or relative path + // Main thread only virtual BOOL WINAPI IsArchiveHandledByThisPlugin(const char* name) = 0; - // slouzi jako LR_xxx parametr pro API funkci LoadImage() - // pokud uzivatel nema zapnute hi-color ikony v konfiguraci desktopu, - // vraci LR_VGACOLOR, aby nedoslo k chybnemu nacteni vice barevne verze ikony - // jinak vraci 0 (LR_DEFAULTCOLOR); vysledek funkce lze orovat s dalsimi LR_xxx flagy - // lze volat z libovolneho threadu + // Used as the LR_xxx parameter for the LoadImage() API function; + // if the user does not have hi-color icons enabled in the desktop configuration, + // returns LR_VGACOLOR to prevent incorrect loading of the high-color icon version + // otherwise returns 0 (LR_DEFAULTCOLOR); the result can be ORed with other LR_xxx flags + // Can be called from any thread virtual DWORD WINAPI GetIconLRFlags() = 0; - // zjisti podle pripony souboru, jestli jde o link ("lnk", "pif" nebo "url"); 'fileExtension' - // je pripona souboru (ukazatel za tecku), nesmi byt NULL; vraci 1 pokud jde o link, jinak - // vraci 0; POZNAMKA: pouziva se pro plneni CFileData::IsLink - // lze volat z libovolneho threadu + // Determines from the file extension whether it is a link ("lnk", "pif" or "url"); 'fileExtension' + // is the file extension (pointer after the dot), must not be NULL; returns 1 if it is a link, otherwise + // returns 0; NOTE: used to fill CFileData::IsLink + // Can be called from any thread virtual int WINAPI IsFileLink(const char* fileExtension) = 0; - // vrati ILC_COLOR??? podle verze Windows - odladene pro pouziti imagelistu v listviewech - // typicke pouziti: ImageList_Create(16, 16, ILC_MASK | GetImageListColorFlags(), ???, ???) - // lze volat z libovolneho threadu + // Returns ILC_COLOR??? according to the Windows version - tuned for use with image lists in list views + // Typical use: ImageList_Create(16, 16, ILC_MASK | GetImageListColorFlags(), ???, ???) + // Can be called from any thread virtual DWORD WINAPI GetImageListColorFlags() = 0; - // "bezpecna" verze GetOpenFileName()/GetSaveFileName() resi situaci, kdy podana cesta - // v OPENFILENAME::lpstrFile neni platna (napriklad z:\); v tomto pripade std. API verze - // funkce neotevre okenko a tise se vrati z FALSE a CommDlgExtendedError() vraci FNERR_INVALIDFILENAME. - // Nasledujici dve funkce v tomto pripade zavolaji API jeste jednou, ale s "bezpecne" - // existujici cestou (Documents, pripadne Desktop). + // "Safe" version of GetOpenFileName()/GetSaveFileName() that handles the case when the path + // in OPENFILENAME::lpstrFile is invalid (for example z:\); in that case the standard API version of the + // function does not open the dialog, silently returns FALSE, and CommDlgExtendedError() returns FNERR_INVALIDFILENAME. + // In this case, the following two functions call the API once more, but with a "safe" + // existing path (Documents or, if needed, Desktop). virtual BOOL WINAPI SafeGetOpenFileName(LPOPENFILENAME lpofn) = 0; virtual BOOL WINAPI SafeGetSaveFileName(LPOPENFILENAME lpofn) = 0; - // plugin musi pred pouzitim OpenHtmlHelp() zadat Salamanderovi jmeno sveho .chm souboru - // bez cesty (napr. "demoplug.chm") - // lze volat z libovolneho threadu, ale je potreba vyloucit soucasne volani s OpenHtmlHelp() + // The plugin must provide Salamander with the name of its .chm file + // without a path (for example, "demoplug.chm") before using OpenHtmlHelp() + // Can be called from any thread, but concurrent calls with OpenHtmlHelp() must be excluded virtual void WINAPI SetHelpFileName(const char* chmName) = 0; - // otevre HTML help pluginu, jazyk helpu (adresar s .chm soubory) vybira takto: - // -adresar ziskany z aktualniho .slg souboru Salamandera (viz SLGHelpDir v shared\versinfo.rc) + // Opens the plugin's HTML help; the help language (directory with .chm files) is chosen as follows: + // -directory obtained from Salamander's current .slg file (see SLGHelpDir in shared\versinfo.rc) // -HELP\ENGLISH\*.chm - // -prvni nalezeny podadresar v podadresari HELP - // plugin musi pred pouzitim OpenHtmlHelp() zavolat SetHelpFileName(); 'parent' je parent - // messageboxu s chybou; 'command' je prikaz HTML helpu, viz HHCDisplayXXX; 'dwData' je parametr - // prikazu HTML helpu, viz HHCDisplayXXX - // lze volat z libovolneho threadu - // poznamka: zobrazeni helpu Salamandera viz OpenHtmlHelpForSalamander + // -the first subdirectory found under HELP + // The plugin must call SetHelpFileName() before using OpenHtmlHelp(); 'parent' is the parent for error + // message boxes; 'command' is the HTML help command, see HHCDisplayXXX; 'dwData' is the parameter + // of the HTML help command, see HHCDisplayXXX + // Can be called from any thread + // NOTE: for Salamander help display, see OpenHtmlHelpForSalamander virtual BOOL WINAPI OpenHtmlHelp(HWND parent, CHtmlHelpCommand command, DWORD_PTR dwData, BOOL quiet) = 0; - // vraci TRUE, pokud jsou cesty 'path1' a 'path2' ze stejneho svazku; v 'resIsOnlyEstimation' - // (neni-li NULL) vraci TRUE, pokud neni vysledek jisty (jisty je jen v pripade shody cest nebo - // pokud se podari ziskat "volume name" (GUID svazku) u obou cest, coz pripada v uvahu jen pro - // lokalni cesty pod W2K nebo novejsimi z rady NT) - // mozne volat z libovolneho threadu + // Returns TRUE if paths 'path1' and 'path2' are on the same volume; 'resIsOnlyEstimation' + // (if not NULL) receives TRUE if the result is not certain (it is certain only when the paths match or + // when the "volume name" (volume GUID) can be obtained for both paths, which is possible only for + // local paths on W2K or newer NT-based systems) + // Can be called from any thread virtual BOOL WINAPI PathsAreOnTheSameVolume(const char* path1, const char* path2, BOOL* resIsOnlyEstimation) = 0; - // realokace pameti na heapu Salamandera (pri pouziti salrtl9.dll zbytecne - staci klasicky realloc); - // pri nedostatku pameti zobrazi uzivateli hlaseni s tlacitky Retry a Cancel (po dalsim dotazu - // terminuje aplikaci) - // mozne volat z libovolneho threadu + // Reallocates memory on the Salamander heap (unnecessary when using salrtl9.dll; plain realloc is enough); + // on out of memory, shows the user a dialog with Retry and Cancel buttons (on the next out-of-memory prompt, + // it terminates the application) + // Can be called from any thread virtual void* WINAPI Realloc(void* ptr, int size) = 0; - // vraci v 'enumFilesSourceUID' (nesmi byt NULL) unikatni identifikator zdroje pro panel - // 'panel' (jeden z PANEL_XXX), pouziva se ve viewerech pri enumeraci souboru - // z panelu (viz parametr 'srcUID' napr. v metode GetNextFileNameForViewer), tento - // identifikator se meni napr. pri zmene cesty v panelu; neni-li 'enumFilesCurrentIndex' - // NULL, vraci se v nem index fokusleho souboru (pokud neni fokusly soubor, vraci se -1); - // omezeni: hlavni thread (jinak se muze obsah panelu menit) + // Returns in 'enumFilesSourceUID' (must not be NULL) the unique source identifier for panel + // 'panel' (one of PANEL_XXX); it is used in viewers when enumerating files + // from a panel (see the 'srcUID' parameter, for example, in GetNextFileNameForViewer); this + // identifier changes, for example, when the panel path changes; if 'enumFilesCurrentIndex' + // is not NULL, it receives the index of the focused file (or -1 if there is no focused file); + // Main thread only (otherwise the panel contents may change) virtual void WINAPI GetPanelEnumFilesParams(int panel, int* enumFilesSourceUID, int* enumFilesCurrentIndex) = 0; - // postne panelu s aktivnim FS 'modifiedFS' zpravu o tom, ze by se mel - // provest refresh cesty (znovu nacte listing a prenese oznaceni, ikony, fokus, atd. do - // noveho obsahu panelu); refresh se provede az dojde k aktivaci hlavniho okna Salamandera - // (az skonci suspend-mode); FS cesta se vzdycky nacte znovu; pokud 'modifiedFS' neni v zadnem - // panelu, neprovede se nic; je-li 'focusFirstNewItem' TRUE a v panelu pribyla jen jedina - // polozka, dojde k fokusu teto nove polozky (pouziva se napr. pro fokus nove vytvoreneho - // souboru/adresare); vraci TRUE pokud se provedl refresh, FALSE pokud nebyl 'modifiedFS' - // nalezen ani v jednom panelu - // mozne volat z libovolneho threadu (pokud hlavni thread nespousti kod uvnitr pluginu, - // probehne refresh co nejdrive, jinak refresh pocka minimalne do okamziku, kdy hlavni - // thread opusti plugin) + // Posts a message to the panel with active FS 'modifiedFS' that it should + // refresh the path (reloads the listing and transfers selection, icons, focus, etc. to the + // new panel contents); the refresh is performed when the Salamander main window becomes active + // (when suspend mode ends); the FS path is always reloaded; if 'modifiedFS' is not in any + // panel, nothing is done; if 'focusFirstNewItem' is TRUE and exactly one new + // item was added to the panel, that new item is focused (used, for example, to focus a newly created + // file/directory); returns TRUE if the refresh was performed, FALSE if 'modifiedFS' + // was not found in any panel + // Can be called from any thread (if the main thread is not running code inside the plugin, + // the refresh is performed as soon as possible; otherwise it waits at least until the main + // thread leaves the plugin) virtual BOOL WINAPI PostRefreshPanelFS2(CPluginFSInterfaceAbstract* modifiedFS, BOOL focusFirstNewItem = FALSE) = 0; - // nacte z resourcu modulu 'module' text s ID 'resID'; vraci text v internim bufferu (hrozi - // zmena textu diky zmene interniho bufferu zpusobene dalsimi volanimi LoadStr i z jinych - // pluginu nebo Salamandera; buffer je velky 10000 znaku, prepis hrozi teprve po jeho - // zaplneni (pouziva se cyklicky); pokud potrebujete text pouzit az pozdeji, doporucujeme - // jej zkopirovat do lokalniho bufferu); je-li 'module' NULL nebo 'resID' neni v modulu, - // vraci se text "ERROR LOADING STRING" (a debug/SDK verze vypise TRACE_E) - // mozne volat z libovolneho threadu + // Loads the text with ID 'resID' from module 'module'; returns the text in an internal buffer (the text may change + // because the internal buffer can be reused by subsequent LoadStr calls from other + // plugins or Salamander; the buffer is 10000 characters long, so overwrite is only possible after it + // fills up + // (it is used cyclically); if you need the text later, we recommend + // copying it to a local buffer); if 'module' is NULL or 'resID' is not present in the module, + // it returns the text "ERROR LOADING STRING" (and the debug/SDK version outputs TRACE_E) + // Can be called from any thread virtual char* WINAPI LoadStr(HINSTANCE module, int resID) = 0; // nacte z resourcu modulu 'module' text s ID 'resID'; vraci text v internim bufferu (hrozi From 6c7de4de1bf217df588678cb08b546bdab52c256 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 17:06:15 +0200 Subject: [PATCH 286/710] [translation] Fix src/plugins/shared/spl_gen.h comments (chunk 13/14) (#661) --- src/plugins/shared/spl_gen.h | 406 +++++++++++++++++------------------ 1 file changed, 199 insertions(+), 207 deletions(-) diff --git a/src/plugins/shared/spl_gen.h b/src/plugins/shared/spl_gen.h index 24154ef0f..bfe79d6c3 100644 --- a/src/plugins/shared/spl_gen.h +++ b/src/plugins/shared/spl_gen.h @@ -2767,115 +2767,112 @@ class CSalamanderGeneralAbstract // Can be called from any thread virtual char* WINAPI LoadStr(HINSTANCE module, int resID) = 0; - // nacte z resourcu modulu 'module' text s ID 'resID'; vraci text v internim bufferu (hrozi - // zmena textu diky zmene interniho bufferu zpusobene dalsimi volanimi LoadStrW i z jinych - // pluginu nebo Salamandera; buffer je velky 10000 znaku, prepis hrozi teprve po jeho - // zaplneni (pouziva se cyklicky); pokud potrebujete text pouzit az pozdeji, doporucujeme - // jej zkopirovat do lokalniho bufferu); je-li 'module' NULL nebo 'resID' neni v modulu, - // vraci se text L"ERROR LOADING WIDE STRING" (a debug/SDK verze vypise TRACE_E) - // mozne volat z libovolneho threadu + // Loads the text with ID 'resID' from the resources of module 'module'; returns the text in an + // internal buffer (the text may change when later LoadStrW calls from other plugins or Salamander + // reuse the internal buffer; the buffer holds 10000 characters and is used cyclically, so the text + // is overwritten only after it fills up; if you need the text later, copy it to a local buffer). + // If 'module' is NULL or 'resID' is not present in the module, returns + // L"ERROR LOADING WIDE STRING" (and the debug/SDK build outputs TRACE_E). + // Can be called from any thread. virtual WCHAR* WINAPI LoadStrW(HINSTANCE module, int resID) = 0; - // zmena cesty v panelu na uzivatelem zvolenou "zachranou" cestu (viz - // SALCFG_IFPATHISINACCESSIBLEGOTO) a pokud i ta selze, tak na root prvniho lokalniho fixed - // drivu, jde o temer jistou zmenu aktualni cesty v panelu; 'panel' je jeden z PANEL_XXX; - // neni-li 'failReason' NULL, nastavuje se na jednu z konstant CHPPFR_XXX (informuje o vysledku - // metody); vraci TRUE pokud se zmena cesty podarila (na "zachranou" nebo fixed drive) - // omezeni: hlavni thread + mimo metody CPluginFSInterfaceAbstract a CPluginDataInterfaceAbstract - // (hrozi napr. zavreni FS otevreneho v panelu - metode by mohl prestat existovat 'this') + // Changes the panel path to the user-selected "rescue" path (see SALCFG_IFPATHISINACCESSIBLEGOTO) and, + // if that also fails, to the root of the first local fixed drive; this almost certainly changes the current + // path in the panel. 'panel' is one of PANEL_XXX. If 'failReason' is not NULL, it is set to one of the + // CHPPFR_XXX constants (informing about the result of the method). Returns TRUE if the path change succeeds + // (to the "rescue" path or the fixed drive). + // Limitation: main thread and outside CPluginFSInterfaceAbstract and CPluginDataInterfaceAbstract methods + // (otherwise, for example, closing the FS opened in the panel could make 'this' cease to exist for the method). virtual BOOL WINAPI ChangePanelPathToRescuePathOrFixedDrive(int panel, int* failReason = NULL) = 0; - // prihlasi plugin jako nahradu za Network polozku v Change Drive menu a v Drive barach, - // plugin musi pridavat do Salamandera file-system, na kterem se pak oteviraji nekompletni - // UNC cesty ("\\" a "\\server") z prikazu Change Directory a na ktery se odchazi - // pres symbol up-diru ("..") z rootu UNC cest; - // omezeni: volat jen z entry-pointu pluginu a to az po SetBasicPluginData + // Registers the plugin as a replacement for the Network item in the Change Drive menu and in the drive bars. + // The plugin must add a file system to Salamander that is then used to open incomplete UNC paths + // (the root-only and server-only forms) from the Change Directory command and that is entered + // via the up-dir symbol ("..") from the root of UNC paths. + // Limitation: call only from the plugin entry point and only after SetBasicPluginData. virtual void WINAPI SetPluginIsNethood() = 0; - // otevre systemove kontextove menu pro oznacene polozky nebo fokuslou polozku na sitove ceste - // ('forItems' je TRUE) nebo pro sitovou cestu ('forItems' je FALSE), vybrany prikaz z menu - // take provede; menu se ziskava prochazenim slozky CSIDL_NETWORK; 'parent' je navrzeny parent - // kontextoveho menu; 'panel' identifikuje panel (PANEL_LEFT nebo PANEL_RIGHT), pro ktery se - // ma kontextove menu otevrit (z tohoto panelu se ziskavaji fokusle/oznacene soubory/adresare, - // se kterymi se pracuje); 'menuX' + 'menuY' jsou navrzene souradnice leveho horniho rohu - // kontextoveho menu; 'netPath' je sitova cesta, povolene jsou jen "\\" a "\\server"; neni-li - // 'newlyMappedDrive' NULL, vraci se v nem pismenko ('A' az 'Z') nove namapovaneho disku (pres - // prikaz Map Network Drive z kontextoveho menu), pokud se v nem vraci nula, k zadnemu novemu - // mapovani nedoslo - // omezeni: hlavni thread + // Opens the system context menu for selected items or the focused item on a network path + // (if 'forItems' is TRUE), or for a network path itself (if 'forItems' is FALSE); it also executes the + // selected command from the menu. The menu is obtained by browsing the CSIDL_NETWORK folder. 'parent' is the + // proposed parent window of the context menu. 'panel' identifies the panel (PANEL_LEFT or PANEL_RIGHT) for + // which the context menu should be opened; the focused/selected files or directories are taken from this panel. + // 'menuX' and 'menuY' are the proposed coordinates of the upper-left corner of the context menu. 'netPath' is + // the network path; only "\\" and "\\server" are allowed. If 'newlyMappedDrive' is not NULL, it returns + // the letter ('A' to 'Z') of the newly mapped drive (via the Map Network Drive command from the context menu); + // if zero is returned there, no new mapping was created. + // Limitation: main thread virtual void WINAPI OpenNetworkContextMenu(HWND parent, int panel, BOOL forItems, int menuX, int menuY, const char* netPath, char* newlyMappedDrive) = 0; - // zdvojuje '\\' - hodi se pro texty, ktere posilame do LookForSubTexts, ktera '\\\\' - // zase zredukuje na '\\'; 'buffer' je vstupne/vystupni retezec, 'bufferSize' je velikost - // 'buffer' v bytech; vraci TRUE pokud zdvojenim nedoslo ke ztrate znaku z konce retezce - // (buffer byl dost veliky) - // mozne volat z libovolneho threadu + // Duplicates backslashes; useful for texts sent to LookForSubTexts(), which then reduces doubled + // backslashes again. 'buffer' is the input/output string and 'bufferSize' is the size of 'buffer' + // in bytes. Returns TRUE if doubling the backslashes did not truncate any characters from the end of + // the string (the buffer was large enough). + // Can be called from any thread. virtual BOOL WINAPI DuplicateBackslashes(char* buffer, int bufferSize) = 0; - // ukaze v panelu 'panel' throbber (animace informujici uzivatele o aktivite souvisejici - // s panelem, napr. "nacitam data ze site") se zpozdenim 'delay' (v ms); 'panel' je jeden - // z PANEL_XXX; neni-li 'tooltip' NULL, jde o text, ktery se ukaze po najeti mysi na - // throbber (je-li NULL, zadny text se neukazuje); pokud je uz v panelu throbber zobrazeny - // nebo ceka na zobrazeni, zmeni se jeho identifikacni cislo a tooltip (je-li zobrazeny, - // 'delay' se ignoruje, ceka-li na zobrazeni, nastavi se nove zpozdeni podle 'delay'); - // vraci identifikacni cislo throbberu (nikdy neni -1, tedy -1 je mozne pouzit jako - // prazdnou hodnotu + vsechna vracena cisla jsou unikatni, presneji receno opakovat se - // zacnou po nerealnych 2^32 zobrazeni throbberu); - // POZNAMKA: vhodne misto pro zobrazeni throbberu pro FS je prijem udalosti FSE_PATHCHANGED, - // to uz je FS v panelu (jestli se ma nebo nema throbber zobrazit se muze urcit predem - // v ChangePath nebo ListCurrentPath) - // omezeni: hlavni thread + // Shows a throbber in panel 'panel' (an animation that informs the user about activity related + // to the panel, for example "loading data from the network") after a delay of 'delay' ms; 'panel' + // is one of PANEL_XXX. If 'tooltip' is not NULL, it is the text shown when the mouse hovers over + // the throbber (if it is NULL, no text is shown). If a throbber is already shown in the panel or + // is waiting to be shown, its identifier and tooltip are changed (if it is already shown, 'delay' + // is ignored; if it is still waiting to be shown, the new delay from 'delay' is used). Returns the + // throbber identifier (never -1, so -1 can be used as an empty value; all returned identifiers are + // unique, more precisely they would repeat only after an unrealistic 2^32 throbber displays). + // NOTE: a suitable place to show the throbber for an FS is when handling FSE_PATHCHANGED; at that point + // the FS is already in the panel (whether the throbber should be shown can be decided in advance in + // ChangePath or ListCurrentPath). + // limitation: main thread virtual int WINAPI StartThrobber(int panel, const char* tooltip, int delay) = 0; - // schova throbber s identifikacnim cislem 'id'; vraci TRUE pokud dojde ke schovani - // throbberu; vraci FALSE pokud se jiz tento throbber schoval nebo se pres nej ukazal - // jiny throbber; - // POZNAMKA: throbber se automaticky schovava tesne pred zmenou cesty v panelu nebo - // pred refreshem (u FS to znamena tesne po uspesnem volani ListCurrentPath, u archivu - // je to po otevreni a vylistovani archivu, u disku je to po overeni pristupnosti cesty) - // omezeni: hlavni thread + // Hides the throbber with identifier 'id'; returns TRUE if the throbber is hidden. + // Returns FALSE if this throbber has already been hidden or another throbber has been shown over it. + // NOTE: the throbber is automatically hidden immediately before the panel path changes or + // before a refresh (for an FS, this means immediately after a successful ListCurrentPath call; for an archive + // after the archive is opened and listed; for a drive after the path accessibility is verified). + // Limitation: main thread virtual BOOL WINAPI StopThrobber(int id) = 0; - // ukaze v panelu 'panel' ikonu zabezpeceni (zamknuty nebo odemknuty zamek, napr. u FTPS informuje - // uzivatele o tom, ze je spojeni se serverem zabezpecene pomoci SSL a identita serveru je - // overena (zamknuty zamek) nebo overena neni (odemknuty zamek)); 'panel' je jeden z PANEL_XXX; + // Shows a security icon in panel 'panel' (a locked or unlocked padlock, for example FTPS uses it to inform + // the user that the connection to the server is secured with SSL and that the server identity is either + // verified (locked padlock) or not verified (unlocked padlock)); 'panel' is one of PANEL_XXX; // je-li 'showIcon' TRUE, ikona se ukaze, jinak se schova; 'isLocked' urcuje, jestli jde - // o zamknuty (TRUE) nebo odemknuty (FALSE) zamek; neni-li 'tooltip' NULL, jde o text, ktery se - // ukaze po najeti mysi na ikonu (je-li NULL, zadny text se neukazuje); pokud se ma po kliknuti - // na ikone zabezpeceni provest nejaka akce (napr. u FTPS se zobrazuje dialog s certifikatem + // whether the padlock is locked (TRUE) or unlocked (FALSE); if 'tooltip' is not NULL, it is the text shown + // when the mouse hovers over the icon (if it is NULL, no text is shown); if clicking the security icon should + // perform an action (for example, FTPS displays a server certificate dialog), it must be added to the // serveru), je nutne ji pridat do metody CPluginFSInterfaceAbstract::ShowSecurityInfo file-systemu - // zobrazeneho v panelu; - // POZNAMKA: vhodne misto pro zobrazeni ikony zabezpeceni pro FS je prijem udalosti + // displayed in the panel; + // NOTE: a suitable place to show the security icon for an FS is when handling // FSE_PATHCHANGED, to uz je FS v panelu (jestli se ma nebo nema ikona zobrazit se muze urcit - // predem v ChangePath nebo ListCurrentPath) - // POZNAMKA: ikona zabezpeceni se automaticky schovava tesne pred zmenou cesty v panelu nebo - // pred refreshem (u FS to znamena tesne po uspesnem volani ListCurrentPath, u archivu - // je to po otevreni a vylistovani archivu, u disku je to po overeni pristupnosti cesty) - // omezeni: hlavni thread + // in ChangePath or ListCurrentPath) + // NOTE: the security icon is automatically hidden immediately before the panel path changes or + // before a refresh (for an FS, this means immediately after a successful ListCurrentPath call; for archives, + // after the archive is opened and listed; for drives, after the path accessibility is verified) + // limitation: main thread virtual void WINAPI ShowSecurityIcon(int panel, BOOL showIcon, BOOL isLocked, const char* tooltip) = 0; - // odstrani aktualni cestu v panelu z historie adresaru zobrazenych v panelu (Alt+Left/Right) - // a ze seznamu pracovnich cest (Alt+F12); pouziva se pro zneviditelneni prechodnych cest, - // napr. "net:\Entire Network\Microsoft Windows Network\WORKGROUP\server\share" automaticky - // prechazi na "\\server\share" a je nezadouci, aby se tento prechod delal pri pohybu v historii - // omezeni: hlavni thread + // Removes the current panel path from the history of directories shown in the panel (Alt+Left/Right) + // and from the working directory list (Alt+F12). It is used to hide transient paths; for example, + // "net:\Entire Network\Microsoft Windows Network\WORKGROUP\server\share" automatically changes to + // "\\server\share", and it is undesirable for this transition to occur while moving through the history. + // Limitation: main thread virtual void WINAPI RemoveCurrentPathFromHistory(int panel) = 0; - // vracit TRUE, pokud je aktualni uzivatel clenem skupiny Administrators, jinak vraci FALSE - // mozne volat z libovolneho threadu + // Returns TRUE if the current user is a member of the Administrators group, otherwise FALSE. + // Can be called from any thread. virtual BOOL WINAPI IsUserAdmin() = 0; - // vraci TRUE, pokud Salamander bezi na vzdalene plose (RemoteDesktop), jinak vraci FALSE - // mozne volat z libovolneho threadu + // Returns TRUE if Salamander is running in a Remote Desktop session, otherwise FALSE. + // Can be called from any thread. virtual BOOL WINAPI IsRemoteSession() = 0; - // ekvivalent volani WNetAddConnection2(lpNetResource, NULL, NULL, CONNECT_INTERACTIVE); - // vyhodou je podrobnejsi zobrazeni chybovych stavu (napr. ze expirovalo heslo, - // ze je spatne zadane heslo nebo jmeno, ze je potreba zmenit heslo, atd.) - // mozne volat z libovolneho threadu + // Equivalent to calling WNetAddConnection2(lpNetResource, NULL, NULL, CONNECT_INTERACTIVE). + // The advantage is more detailed display of error states (for example, an expired password, + // an incorrect password or user name, or a required password change). + // Can be called from any thread. virtual DWORD WINAPI SalWNetAddConnection2Interactive(LPNETRESOURCE lpNetResource) = 0; // @@ -2915,10 +2912,10 @@ class CSalamanderGeneralAbstract // Method can be called from any thread. virtual CSalamanderCryptAbstract* WINAPI GetSalamanderCrypt() = 0; - // informuje Salamandera o tom, ze plugin pouziva Password Manager a tedy Salamander ma - // pluginu hlasit zavedeni/zmenu/zruseni master passwordu (viz - // CPluginInterfaceAbstract::PasswordManagerEvent) - // omezeni: volat jen z entry-pointu pluginu a to az po SetBasicPluginData + // Informs Salamander that the plugin uses the Password Manager, so Salamander should notify + // the plugin about creation, modification, or removal of the master password (see + // CPluginInterfaceAbstract::PasswordManagerEvent). + // Limitation: call only from the plugin entry point and only after SetBasicPluginData. virtual void WINAPI SetPluginUsesPasswordManager() = 0; // @@ -2929,15 +2926,15 @@ class CSalamanderGeneralAbstract // Method can be called from main thread only. virtual CSalamanderPasswordManagerAbstract* WINAPI GetSalamanderPasswordManager() = 0; - // otevre HTML help samotneho Salamanadera (misto help pluginu, ktery se otevira pomoci OpenHtmlHelp()), - // jazyk helpu (adresar s .chm soubory) vybira takto: - // -adresar ziskany z aktualniho .slg souboru Salamandera (viz SLGHelpDir v shared\versinfo.rc) - // -HELP\ENGLISH\*.chm - // -prvni nalezeny podadresar v podadresari HELP - // 'parent' je parent messageboxu s chybou; 'command' je prikaz HTML helpu, viz HHCDisplayXXX; - // 'dwData' je parametr prikazu HTML helpu, viz HHCDisplayXXX; pokud je command==HHCDisplayContext, - // musi byt hodnota 'dwData' z rodiny konstant HTMLHELP_SALID_XXX - // lze volat z libovolneho threadu + // Opens Salamander's own HTML help (instead of the plugin help opened by OpenHtmlHelp()). + // The help language (the directory with the .chm files) is selected in this order: + // - the directory obtained from Salamander's current .slg file (see SLGHelpDir in shared\versinfo.rc) + // - HELP\ENGLISH\*.chm + // - the first subdirectory found under HELP + // 'parent' is the parent of the error message box; 'command' is the HTML Help command, see HHCDisplayXXX. + // 'dwData' is the HTML Help command parameter, see HHCDisplayXXX; if command == HHCDisplayContext, + // 'dwData' must be a value from the HTMLHELP_SALID_XXX family of constants. + // Can be called from any thread. virtual BOOL WINAPI OpenHtmlHelpForSalamander(HWND parent, CHtmlHelpCommand command, DWORD_PTR dwData, BOOL quiet) = 0; // @@ -2972,86 +2969,84 @@ class CSalamanderGeneralAbstract // Method can be called from main thread only. virtual void WINAPI LockMainWindow(BOOL lock, HWND hToolWnd, const char* lockReason) = 0; - // jen pro pluginy "dynamic menu extension" (viz FUNCTION_DYNAMICMENUEXT): - // nastavi volajicimu pluginu priznak, ze se ma pri nejblizsi mozne prilezitosti - // (jakmile nebudou v message-queue hl. threadu zadne message a Salamander nebude - // "busy" (nebude otevreny zadny modalni dialog a nebude se zpracovavat zadna zprava)) - // znovu sestavit menu volanim metody CPluginInterfaceForMenuExtAbstract::BuildMenu; - // POZOR: pokud se vola z jineho nez hlavniho threadu, muze dojit k volani BuildMenu - // (probiha v hlavnim threadu) dokonce drive nez skonci PostPluginMenuChanged - // mozne volat z libovolneho threadu + // Only for "dynamic menu extension" plugins (see FUNCTION_DYNAMICMENUEXT): + // sets a flag for the calling plugin that causes the menu to be rebuilt at the next possible opportunity + // (as soon as the main thread message queue is empty and Salamander is not "busy" + // (no modal dialog is open and no message is being processed)) + // by calling CPluginInterfaceForMenuExtAbstract::BuildMenu(). + // WARNING: if called from a thread other than the main thread, BuildMenu + // (which runs in the main thread) may be called even before PostPluginMenuChanged returns. + // Can be called from any thread. virtual void WINAPI PostPluginMenuChanged() = 0; - // // GetMenuItemHotKey - // Search through plugin's menu items added with AddMenuItem() for item with 'id'. - // When such item is found, its 'hotKey' and 'hotKeyText' (up to 'hotKeyTextSize' characters) - // is set. Both 'hotKey' and 'hotKeyText' could be NULL. - // Returns TRUE when item with 'id' is found, otherwise returns FALSE. + // Searches the plugin's menu items added with AddMenuItem() for the item with 'id'. + // If found, stores its hot key in 'hotKey' and its text form (up to 'hotKeyTextSize' characters) + // in 'hotKeyText'. Both 'hotKey' and 'hotKeyText' may be NULL. + // Returns TRUE if an item with 'id' is found; otherwise returns FALSE. // - // Remarks + // Remarks // Method can be called from main thread only. virtual BOOL WINAPI GetMenuItemHotKey(int id, WORD* hotKey, char* hotKeyText, int hotKeyTextSize) = 0; - // nase varianty funkci RegQueryValue a RegQueryValueEx, narozdil od API variant - // zajistuji pridani null-terminatoru pro typy REG_SZ, REG_MULTI_SZ a REG_EXPAND_SZ - // POZOR: pri zjistovani potrebne velikosti bufferu vraci o jeden nebo dva (dva - // jen u REG_MULTI_SZ) znaky vic pro pripad, ze by string bylo potreba - // zakoncit nulou/nulami - // mozne volat z libovolneho threadu + // Our variants of RegQueryValue and RegQueryValueEx, unlike the API variants, + // ensure that a null terminator is added for REG_SZ, REG_MULTI_SZ, and REG_EXPAND_SZ values. + // WARNING: when querying the required buffer size, they return one or two extra characters + // (two only for REG_MULTI_SZ) in case the string needs to be terminated with one or two nulls. + // Can be called from any thread. virtual LONG WINAPI SalRegQueryValue(HKEY hKey, LPCSTR lpSubKey, LPSTR lpData, PLONG lpcbData) = 0; virtual LONG WINAPI SalRegQueryValueEx(HKEY hKey, LPCSTR lpValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData) = 0; - // protoze windowsova verze GetFileAttributes neumi pracovat se jmeny koncicimi mezerou, - // napsali jsme si vlastni (u techto jmen pridava backslash na konec, cimz uz pak - // GetFileAttributes funguje spravne, ovsem jen pro adresare, pro soubory s mezerou na - // konci reseni nemame, ale aspon se to nezjistuje od jineho souboru - windowsova verze - // orizne mezery a pracuje tak s jinym souborem/adresarem) - // mozne volat z libovolneho threadu + // Because the Windows version of GetFileAttributes cannot work with names ending in a space, + // we wrote our own version (for such names it appends a backslash, after which + // GetFileAttributes works correctly, but only for directories; for files with a trailing space + // we have no solution, but at least it no longer reads attributes from a different file - the Windows version + // trims the spaces and thus works with a different file or directory). + // Can be called from any thread. virtual DWORD WINAPI SalGetFileAttributes(const char* fileName) = 0; - // zatim neexistuje Win32 API pro detekci SSD, takze se jejich detekovani provadi heuristikou - // na zaklade dotazu na podporu pro TRIM, StorageDeviceSeekPenaltyProperty, atd - // funkce vraci TRUE, pokud disk na ceste 'path' vypada jako SSD; FALSE jindy - // vysledek neni 100%, lide hlasi nefunkcnost algoritmu napriklad na SSD PCIe kartach: + // There is currently no Win32 API for detecting SSDs, so detection is done heuristically + // based on support for TRIM, StorageDeviceSeekPenaltyProperty, and so on. + // Returns TRUE if the disk for path 'path' appears to be an SSD; otherwise FALSE. + // The result is not 100% reliable; users report failures of the algorithm, for example on SSD PCIe cards: // http://stackoverflow.com/questions/23363115/detecting-ssd-in-windows/33359142#33359142 - // umi zjistit korektni udaje i pro cesty obsahujici substy a reparse pointy pod Windows - // 2000/XP/Vista (Salamander 2.5 pracuje jen s junction-pointy); 'path' je cesta, pro kterou - // zjistujeme informace; pokud cesta vede pres sitovou cestu, tise vraci FALSE - // mozne volat z libovolneho threadu + // It can determine correct information even for paths containing SUBSTs and reparse points under Windows + // 2000/XP/Vista (Salamander 2.5 works only with junction points). 'path' is the path for which the + // information is requested; if the path goes through a network path, it silently returns FALSE. + // Can be called from any thread. virtual BOOL WINAPI IsPathOnSSD(const char* path) = 0; - // vraci TRUE, pokud jde o UNC cestu (detekuje oba formaty: \\server\share i \\?\UNC\server\share) - // mozne volat z libovolneho threadu + // Returns TRUE if this is a UNC path (detects both formats: \\server\share and \\?\UNC\server\share). + // Can be called from any thread. virtual BOOL WINAPI IsUNCPath(const char* path) = 0; - // nahradi substy v ceste 'resPath' jejich cilovymi cestami (prevod na cestu bez SUBST drive-letters); - // 'resPath' musi ukazovat na buffer o minimalne 'MAX_PATH' znacich - // vraci TRUE pri uspechu, FALSE pri chybe - // mozne volat z libovolneho threadu + // Replaces SUBST drive letters in path 'resPath' with their target paths (converts it to a path without SUBST drive letters). + // 'resPath' must point to a buffer of at least MAX_PATH characters. + // Returns TRUE on success, FALSE on error. + // Can be called from any thread. virtual BOOL WINAPI ResolveSubsts(char* resPath) = 0; - // volat jen pro cesty 'path', jejichz root (po odstraneni substu) je DRIVE_FIXED (jinde nema smysl hledat - // reparse pointy); hledame cestu bez reparse pointu, vedouci na stejny svazek jako 'path'; pro cestu - // obsahujici symlink vedouci na sitovou cestu (UNC nebo mapovanou) vracime jen root teto sitove cesty - // (ani Vista neumi delat s reparse pointy na sitovych cestach, takze to je nejspis zbytecne drazdit); - // pokud takova cesta neexistuje z duvodu, ze aktualni (posledni) lokalni reparse point je volume mount - // point (nebo neznamy typ reparse pointu), vracime cestu k tomuto volume mount pointu (nebo reparse - // pointu neznameho typu); pokud cesta obsahuje vice nez 50 reparse pointu (nejspis nekonecny cyklus), - // vracime puvodni cestu; - // - // 'resPath' je buffer pro vysledek o velikosti MAX_PATH; 'path' je puvodni cesta; v 'cutResPathIsPossible' - // (nesmi byt NULL) vracime FALSE pokud vysledna cesta v 'resPath' obsahuje na konci reparse point (volume - // mount point nebo neznamy typ reparse pointu) a tudiz ji nesmime zkracovat (dostali bysme se tim nejspis - // na jiny svazek); je-li 'rootOrCurReparsePointSet' neNULLove a obsahuje-li FALSE a na puvodni ceste je - // aspon jeden lokalni reparse point (reparse pointy na sitove casti cesty ignorujeme), vracime v teto - // promenne TRUE + v 'rootOrCurReparsePoint' (neni-li NULL) vracime plnou cestu k aktualnimu (poslednimu - // lokalnimu) reparse pointu (pozor, ne kam vede); cilovou cestu aktualniho reparse pointu (jen je-li to - // junction nebo symlink) vracime v 'junctionOrSymlinkTgt' (neni-li NULL) + typ vracime v 'linkType': - // 2 (JUNCTION POINT), 3 (SYMBOLIC LINK); v 'netPath' (neni-li NULL) vracime sitovou cestu, na kterou - // vede aktualni (posledni) lokalni symlink v ceste - v teto situaci se root sitove cesty vraci v 'resPath' - // mozne volat z libovolneho threadu + // Call only for paths 'path' whose root (after resolving SUBSTs) is DRIVE_FIXED; it makes no sense + // to search for reparse points elsewhere. The function looks for a path without reparse points that + // leads to the same volume as 'path'. For a path containing a symlink that leads to a network path + // (UNC or mapped), only the root of that network path is returned. If no such path exists because the + // current (last) local reparse point is a volume mount point (or an unknown reparse-point type), the + // path to that volume mount point (or unknown reparse point) is returned. If the path contains more + // than 50 reparse points (most likely an infinite loop), the original path is returned. + // + //'resPath' is the output buffer of size MAX_PATH; 'path' is the original path; 'cutResPathIsPossible' + // (must not be NULL) is set to FALSE if the resulting path in 'resPath' ends with a reparse point + // (a volume mount point or an unknown reparse-point type) and therefore must not be shortened. + // If 'rootOrCurReparsePointSet' is non-NULL and contains FALSE, and the original path contains at least + // one local reparse point (reparse points in the network part of the path are ignored), it is set to TRUE + // and 'rootOrCurReparsePoint' (if not NULL) receives the full path to the current (last) local reparse + // point (note: not the path it leads to). The target path of the current reparse point, but only for a + // junction or symlink, is returned in 'junctionOrSymlinkTgt' (if not NULL), and its type is returned in + // 'linkType': 2 (JUNCTION POINT), 3 (SYMBOLIC LINK). 'netPath' (if not NULL) receives the network path + // targeted by the current (last) local symlink in the path; in that case the root of the network path is + // returned in 'resPath'. + // Can be called from any thread. virtual void WINAPI ResolveLocalPathWithReparsePoints(char* resPath, const char* path, BOOL* cutResPathIsPossible, BOOL* rootOrCurReparsePointSet, @@ -3059,78 +3054,75 @@ class CSalamanderGeneralAbstract char* junctionOrSymlinkTgt, int* linkType, char* netPath) = 0; - // Provede resolve substu a reparse pointu pro cestu 'path', nasledne se pro mount-point cesty - // (pokud chybi tak pro root cesty) pokusi ziskat GUID path. Pri neuspechu vrati FALSE. Pri - // uspechu, vrati TRUE a nastavi 'mountPoint' a 'guidPath' (pokud jsou ruzne od NULL, musi - // odkazovat na buffery o velikosti minimalne MAX_PATH; retezce budou zakonceny zpetnym lomitkem). - // mozne volat z libovolneho threadu + // Resolves SUBSTs and reparse points in path 'path', then tries to obtain a GUID path for the path's mount point + // (or for the path root if no mount point is present). On failure returns FALSE. On success returns TRUE and sets + // 'mountPoint' and 'guidPath' (if they are not NULL, they must point to buffers of at least MAX_PATH; the strings + // will be terminated with a backslash). + // Can be called from any thread. virtual BOOL WINAPI GetResolvedPathMountPointAndGUID(const char* path, char* mountPoint, char* guidPath) = 0; - // nahradi v retezci posledni znak '.' decimalnim separatorem ziskanym ze systemu LOCALE_SDECIMAL - // delka retezce muze narust, protoze separator muze mit podle MSDN az 4 znaky - // vraci TRUE, pokud byl buffer dostatecne veliky a operaci se povedlo dokoncit, jinak vraci FALSE - // mozne volat z libovolneho threadu + // Replaces the last '.' character in the string with the decimal separator from the system LOCALE_SDECIMAL setting. + // The string may grow because according to MSDN the separator can be up to 4 characters long. + // Returns TRUE if the buffer was large enough and the operation completed successfully, otherwise FALSE. + // Can be called from any thread. virtual BOOL WINAPI PointToLocalDecimalSeparator(char* buffer, int bufferSize) = 0; - // nastavi pro tento plugin pole icon-overlays; po nastaveni muze plugin v listingach vracet - // index icon-overlaye (viz CFileData::IconOverlayIndex), ktery se ma zobrazit pres ikonu - // polozky listingu, takto je mozne pouzit az 15 icon-overlays (indexy 0 az 14, protoze - // index 15=ICONOVERLAYINDEX_NOTUSED aneb: nezobrazuj icon-overlay); 'iconOverlaysCount' - // je pocet icon-overlays pro plugin; pole 'iconOverlays' obsahuje pro kazdy icon-overlay - // postupne vsechny velikosti ikon: SALICONSIZE_16, SALICONSIZE_32 a SALICONSIZE_48 - tedy - // v poli 'iconOverlays' je 3 * 'iconOverlaysCount' ikon; uvolneni ikon v poli 'iconOverlays' - // zajisti Salamander (volani DestroyIcon()), samotne pole je vec volajiciho, pokud v poli - // budou nejake NULL (napr. nezdaril se load ikony), funkce selze, ale platne ikony z pole - // uvolni; pri zmene barev v systemu by mel plugin icon-overlays znovu nacist a znovu nastavit - // touto funkci, idealni je reakce na PLUGINEVENT_COLORSCHANGED ve funkci + // Sets the icon-overlays array for this plugin; once set, the plugin can return in file listings the + // icon-overlay index (see CFileData::IconOverlayIndex) that should be displayed over the item's + // icon; up to 15 icon-overlays can be used this way (indexes 0 through 14, because + // index 15=ICONOVERLAYINDEX_NOTUSED means: do not display an icon-overlay); 'iconOverlaysCount' + // is the number of icon-overlays for the plugin; the 'iconOverlays' array contains, for each icon-overlay, + // all icon sizes in order: SALICONSIZE_16, SALICONSIZE_32, and SALICONSIZE_48 - that is, + // the 'iconOverlays' array contains 3 * 'iconOverlaysCount' icons; Salamander releases the icons in + // 'iconOverlays' (by calling DestroyIcon()), but the array itself belongs to the caller; if the array contains + // any NULL entries (for example, an icon failed to load), the function fails but still releases the + // valid icons from the array; when system colors change, the plugin should reload the icon-overlays and + // set them again with this function; the ideal reaction is to handle PLUGINEVENT_COLORSCHANGED in // CPluginInterfaceAbstract::Event() // POZOR: pred Windows XP (ve W2K) je velikost ikony SALICONSIZE_48 jen 32 bodu! - // omezeni: hlavni thread + // limitation: main thread virtual void WINAPI SetPluginIconOverlays(int iconOverlaysCount, HICON* iconOverlays) = 0; - // popis viz SalGetFileSize(), prvni rozdil je, ze se soubor zadava plnou cestou; - // druhy je, ze 'err' muze byt NULL, pokud nestojime o kod chyby; + // For a description, see SalGetFileSize(); the first difference is that the file is specified + // by a full path; the second is that 'err' may be NULL if the error code is not needed; virtual BOOL WINAPI SalGetFileSize2(const char* fileName, CQuadWord& size, DWORD* err) = 0; - // zjisti velikost souboru, na ktery vede symlink 'fileName'; velikost vraci v 'size'; - // 'ignoreAll' je in + out, je-li TRUE vsechny chyby se ignoruji (pred akci je treba - // priradit FALSE, jinak se okno s chybou vubec nezobrazi, pak uz nemenit); - // pri chybe zobrazi standardni okno s dotazem Retry / Ignore / Ignore All / Cancel - // s parentem 'parent'; pokud velikost uspesne zjisti, vraci TRUE; pri chybe a stisku - // tlacitka Ignore / Igore All v okne s chybou, vraci FALSE a v 'cancel' vraci FALSE; - // je-li 'ignoreAll' TRUE, okno se neukaze, na tlacitko se neceka, chova se jako by - // uzivatel stiskl Ignore; pri chybe a stisku Cancel v okne s chybou vraci FALSE a - // v 'cancel' vraci TRUE; - // mozne volat z libovolneho threadu + // Determines the size of the file targeted by symlink 'fileName'; returns the size in 'size'. + // 'ignoreAll' is in/out: if it is TRUE, all errors are ignored (before the operation it should + // be set to FALSE, otherwise the error dialog is never shown; do not change it afterwards). + // On error, shows a standard Retry / Ignore / Ignore All / Cancel dialog with parent 'parent'; + // if the size is obtained successfully, returns TRUE. On error and Ignore / Ignore All, + // returns FALSE and sets 'cancel' to FALSE. If 'ignoreAll' is TRUE, the dialog is not shown, + // no button is waited for, and it behaves as if the user pressed Ignore. On error and Cancel, + // returns FALSE and sets 'cancel' to TRUE. + // Can be called from any thread. virtual BOOL WINAPI GetLinkTgtFileSize(HWND parent, const char* fileName, CQuadWord* size, BOOL* cancel, BOOL* ignoreAll) = 0; - // smaze link na adresar (junction point, symbolic link, mount point); pri uspechu - // vraci TRUE; pri chybe vraci FALSE a neni-li 'err' NULL, vraci kod chyby v 'err' - // mozne volat z libovolneho threadu + // Deletes a directory link (junction point, symbolic link, mount point); on success + // returns TRUE. On error returns FALSE and, if 'err' is not NULL, stores the error code in 'err'. + // Can be called from any thread. virtual BOOL WINAPI DeleteDirLink(const char* name, DWORD* err) = 0; - // pokud ma soubor/adresar 'name' read-only atribut, pokusime se ho vypnout - // (duvod: napr. aby sel smazat pres DeleteFile); pokud uz mame atributy 'name' - // nactene, predame je v 'attr', je-li 'attr' -1, ctou se atributy 'name' z disku; - // vraci TRUE pokud se provede pokus o zmenu atributu (uspech se nekontroluje); - // POZNAMKA: vypina jen read-only atribut, aby v pripade vice hardlinku nedoslo - // k zbytecne velke zmene atributu na zbyvajicich hardlinkach souboru (atributy - // vsechny hardlinky sdili) - // mozne volat z libovolneho threadu + // If file/directory 'name' has the read-only attribute, attempts to clear it + // (for example, so it can be deleted with DeleteFile). If the attributes of 'name' + // are already known, pass them in 'attr'; if 'attr' is -1, the attributes of 'name' are read from disk. + // Returns TRUE if an attempt to change the attribute is made (success is not checked). + // NOTE: only the read-only attribute is cleared, so that when a file has multiple hard links the remaining + // hard links are not affected by an unnecessarily large attribute change (all hard links share attributes). + // Can be called from any thread. virtual BOOL WINAPI ClearReadOnlyAttr(const char* name, DWORD attr = -1) = 0; - // zjisti, jestli prave probiha critical shutdown (nebo log off), pokud ano, vraci TRUE; - // pri tomto shutdownu mame cas jen 5s na ulozeni konfigurace celeho programu - // vcetne pluginu, takze casove narocnejsi operace musime vynechat, po uplynuti - // 5s system nas process nasilne ukonci, vice viz WM_ENDSESSION, flag ENDSESSION_CRITICAL, - // je to Vista+ + // Determines whether a critical shutdown (or logoff) is currently in progress; if so, returns TRUE. + // During this shutdown we have only 5 seconds to save the configuration of the whole program, + // including plugins, so more time-consuming operations must be skipped. After 5 seconds the system + // forcibly terminates the process. For more information see WM_ENDSESSION and the ENDSESSION_CRITICAL flag. + // Available on Vista+. virtual BOOL WINAPI IsCriticalShutdown() = 0; - // projde v threadu 'tid' (0 = aktualni) vsechna okna (EnumThreadWindows) a vsem enablovanym - // a viditelnym dialogum (class name "#32770") vlastnenym oknem 'parent' postne WM_CLOSE; - // pouziva se pri critical shutdown k odblokovani okna/dialogu, nad kterym jsou otevrene - // modalni dialogy, hrozi-li vice vrstev, je nutne volat opakovane + // Enumerates all windows in thread 'tid' (0 = current) via EnumThreadWindows and posts WM_CLOSE to all enabled + // and visible dialogs (class name "#32770") owned by window 'parent'. It is used during critical shutdown + // to unblock a window or dialog over which modal dialogs are open; if there are multiple layers, it must be called repeatedly. virtual void WINAPI CloseAllOwnedEnabledDialogs(HWND parent, DWORD tid = 0) = 0; }; From 12740e7b25730ec80385a97bb4bcea79515eee4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 17:06:18 +0200 Subject: [PATCH 287/710] [translation] Fix src/plugins/shared/spl_gen.h comments (chunk 14/14) (#662) From f0be327635f984b6f9f9512074170bfe4ce169a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 19:20:50 +0200 Subject: [PATCH 288/710] [translation] Fix src/plugins/shared/spl_gen.h comments (#691) --- src/plugins/shared/spl_gen.h | 250 ++++++++++++++++++++--------------- 1 file changed, 140 insertions(+), 110 deletions(-) diff --git a/src/plugins/shared/spl_gen.h b/src/plugins/shared/spl_gen.h index bfe79d6c3..d142e8a58 100644 --- a/src/plugins/shared/spl_gen.h +++ b/src/plugins/shared/spl_gen.h @@ -379,18 +379,18 @@ struct CSalamanderVarStrEntry class CSalamanderRegistryAbstract; // callback type used for configuration load/save via -// CSalamanderGeneral::CallLoadOrSaveConfiguration; 'regKey' je NULL pokud jde o load -// defaultni konfigurace (save se pri 'regKey' == NULL nevola); 'registry' je objekt pro -// working with the registry; 'param' is the user-defined function parameter (see +// CSalamanderGeneral::CallLoadOrSaveConfiguration; 'regKey' is NULL when loading +// the default configuration (save is not called with 'regKey' == NULL); 'registry' is an object for +// working with the registry; 'param' is a user-defined parameter of the function (see // CSalamanderGeneral::CallLoadOrSaveConfiguration) typedef void(WINAPI* FSalLoadOrSaveConfiguration)(BOOL load, HKEY regKey, CSalamanderRegistryAbstract* registry, void* param); -// zaklad struktury pro CSalamanderGeneralAbstract::ViewFileInPluginViewer (kazdy plugin -// viewer can extend this structure with its own parameters - the structure is passed to -// CPluginInterfaceForViewerAbstract::ViewFile - parametry muzou byt napr. titulek okna, -// viewer mode, offset from the start of the file, selection position, etc.); WARNING: structure packing -// struktur (pozadovane je 4 byty - viz "#pragma pack(4)") +// base structure for CSalamanderGeneralAbstract::ViewFileInPluginViewer (each plugin +// viewer can extend this structure with its own parameters; the structure is passed to +// CPluginInterfaceForViewerAbstract::ViewFile; parameters can be, for example, the window title, +// viewer mode, offset from the beginning of the file, selection position, etc.); WARNING: structure +// packing must be 4 bytes (see "#pragma pack(4)") struct CSalamanderPluginViewerData { // Number of bytes from the start of the structure that are valid (to distinguish structure versions) @@ -807,7 +807,7 @@ class CSalamanderPasswordManagerAbstract enum CHtmlHelpCommand { HHCDisplayTOC, // viz HH_DISPLAY_TOC: dwData = 0 (zadny topic) nebo: pointer to a topic within a compiled help file - HHCDisplayIndex, // viz HH_DISPLAY_INDEX: dwData = 0 (zadny keyword) nebo: keyword to select in the index (.hhk) file + HHCDisplayIndex, // see HH_DISPLAY_INDEX: dwData = 0 (no keyword) or: keyword to select in the index (.hhk) file HHCDisplaySearch, // viz HH_DISPLAY_SEARCH: dwData = 0 (prazdne hledani) nebo: pointer to an HH_FTS_QUERY structure HHCDisplayContext, // viz HH_HELP_CONTEXT: dwData = numeric ID of the topic to display }; @@ -828,12 +828,12 @@ class CSalamanderGeneralAbstract public: // Displays a message box with the specified text and caption; the parent window is the HWND // returned by GetMsgBoxParent() (see below); uses SalMessageBox (see below) - // type = MSGBOX_INFO - informace (ok) + // type = MSGBOX_INFO - information (OK) // type = MSGBOX_ERROR - error message (OK) // type = MSGBOX_EX_ERROR - error message (OK/Cancel) - returns IDOK, IDCANCEL // type = MSGBOX_QUESTION - question (Yes/No) - returns IDYES, IDNO // type = MSGBOX_EX_QUESTION - question (Yes/No/Cancel) - returns IDYES, IDNO, IDCANCEL - // type = MSGBOX_WARNING - varovani (ok) + // type = MSGBOX_WARNING - warning (OK) // type = MSGBOX_EX_WARNING - warning (Yes/No/Cancel) - returns IDYES, IDNO, IDCANCEL // returns 0 on error // main thread only @@ -944,15 +944,15 @@ class CSalamanderGeneralAbstract char* errBuf = NULL, int errBufSize = 0, char* firstCreatedDir = NULL, BOOL manualCrDir = FALSE) = 0; - // Checks free space on path 'path' and, if it is not >= totalSize, asks whether the user wants to continue; - // the question window has parent 'parent'; returns TRUE if there is enough space or if the user answered - // "continue"; if 'parent' is not currently the foreground window (dialog in an inactive application), + // Checks the free space on 'path' and, if it is not >= totalSize, asks whether the user wants to continue. + // The dialog has parent 'parent'. Returns TRUE if there is enough space or if the user answered + // "continue". If 'parent' is not currently the foreground window (a dialog in an inactive application), // FlashWindow(mainwnd, TRUE) is called before the dialog is shown and - // FlashWindow(mainwnd, FALSE) is called after it is closed; mainwnd is the parent of 'parent' - // that no longer has a parent (typically the Salamander main window) - // 'messageTitle' is shown in the title of the question message box and should be - // the name of the plugin that called the method - // can be called from any thread + // FlashWindow(mainwnd, FALSE) is called after it is closed; mainwnd is the ancestor of 'parent' + // that no longer has a parent (typically the Salamander main window). + // 'messageTitle' is shown in the title bar of the question message box and should be + // the name of the plugin that called the method. + // Can be called from any thread. virtual BOOL WINAPI TestFreeSpace(HWND parent, const char* path, const CQuadWord& totalSize, const char* messageTitle) = 0; @@ -998,20 +998,21 @@ class CSalamanderGeneralAbstract // can be called from any thread virtual UINT WINAPI SalGetDriveType(const char* path) = 0; - // Because the Windows GetTempFileName does not work, we wrote our own clone: - // creates a file/directory (depending on 'file') on path 'path' (NULL -> Windows TEMP dir), - // with prefix 'prefix', returns the created file name in 'tmpName' (minimum size MAX_PATH), - // returns success (on failure, 'err' receives the Windows error code if not NULL) - // can be called from any thread + // Since the Windows GetTempFileName does not work correctly, this is a custom clone: + // creates a file/directory (depending on 'file') in path 'path' (NULL -> Windows TEMP dir), + // with prefix 'prefix'; returns the name of the created file/directory in 'tmpName' + // ('tmpName' must be at least MAX_PATH characters long); returns success (on failure, + // 'err' receives the Windows error code if it is not NULL) + // Can be called from any thread virtual BOOL WINAPI SalGetTempFileName(const char* path, const char* prefix, char* tmpName, BOOL file, DWORD* err) = 0; // Removes a directory including its contents (SHFileOperation is terribly slow) // can be called from any thread virtual void WINAPI RemoveTemporaryDir(const char* dir) = 0; - // Because the Windows MoveFile cannot rename a read-only file on Novell, - // we wrote our own version (if MoveFile fails, it tries to clear read-only, perform the operation, - // and then set it back); returns success (on failure, 'err' receives the Windows error code if not NULL) + // Because the Windows version of MoveFile cannot rename a file with the read-only attribute on Novell, + // a custom version is provided (if MoveFile fails, it tries to clear the read-only attribute, perform the operation, + // and then restore it); returns success (on failure, 'err' receives the Windows error code if not NULL) // can be called from any thread virtual BOOL WINAPI SalMoveFile(const char* srcName, const char* destName, DWORD* err) = 0; @@ -1266,16 +1267,16 @@ class CSalamanderGeneralAbstract BOOL* numericalyEqual) = 0; // Returns the path in the panel; 'panel' is one of PANEL_XXX; 'buffer' is the path buffer (it may - // be NULL); 'bufferSize' is the size of buffer 'buffer' (if 'buffer' is NULL, it must + // also be NULL); 'bufferSize' is the size of 'buffer' (if 'buffer' is NULL, this must // be zero); if 'type' is not NULL, it points to a variable that receives the path type // (see PATH_TYPE_XXX); if this is an archive and 'archiveOrFS' is not NULL and 'buffer' is not NULL, - // 'archiveOrFS' receives a pointer into 'buffer' at the position after the archive file name; + // 'archiveOrFS' receives a pointer into 'buffer' to the position after the archive file name; // if this is a file system and 'archiveOrFS' is not NULL and 'buffer' is not NULL, // 'archiveOrFS' receives a pointer into 'buffer' to the ':' after the file-system name (after ':' is the user part // of the file-system path); if 'convertFSPathToExternal' is TRUE and the panel contains an FS path, // the plugin to which the path belongs is found (by fs-name) and its // CPluginInterfaceForFSAbstract::ConvertPathToExternal() is called; returns success (if - // 'bufferSize' != 0, it is also considered a failure when the path does not fit in buffer + // 'bufferSize' != 0, it is also considered a failure if the path does not fit into // 'buffer') // main thread only virtual BOOL WINAPI GetPanelPath(int panel, char* buffer, int bufferSize, int* type, @@ -1382,12 +1383,11 @@ class CSalamanderGeneralAbstract // main thread only virtual void WINAPI SetPanelFocusedItem(int panel, const CFileData* file, BOOL partVis) = 0; - // Determines whether a filter is used in the panel and, if so, gets its mask string; + // Determines whether a filter is used in the panel and, if so, retrieves its mask string; // 'panel' identifies the panel of interest (one of PANEL_XXX); - // 'masks' is the output buffer for the filter masks, at least 'masksBufSize' bytes long (recommended - // size is MAX_GROUPMASK); returns TRUE if a filter is used and buffer 'masks' is - // large enough; returns FALSE if no filter is used or the mask string did not fit - // into 'masks' + // 'masks' is the output buffer for the filter masks and must be at least 'masksBufSize' bytes long (the recommended + // size is MAX_GROUPMASK); returns TRUE if a filter is used and the 'masks' buffer is large enough; returns FALSE if + // no filter is used or the mask string does not fit into 'masks'. // main thread only virtual BOOL WINAPI GetFilterFromPanel(int panel, char* masks, int masksBufSize) = 0; @@ -1454,7 +1454,7 @@ class CSalamanderGeneralAbstract // can be called from any thread virtual int WINAPI GetRootPath(char* root, const char* path) = 0; - // Shortens a normal (c:\path) or UNC (\\server\share\path) path by the last directory + // Removes the last directory from a normal (c:\path) or UNC (\\server\share\path) path // (cuts at the last backslash - the truncated path keeps the trailing backslash // only for 'c:\'); 'path' is an in/out buffer (minimum size strlen(path)+2 bytes), // if 'cutDir' is not NULL, it receives a pointer (in buffer 'path' after the first null terminator) @@ -1532,20 +1532,20 @@ class CSalamanderGeneralAbstract virtual void WINAPI FocusNameInPanel(int panel, const char* path, const char* name) = 0; // changes the panel path - input may be an absolute or relative UNC (\\server\share\path) - // or normal (c:\path) path, either a Windows (disk) path, an archive path, or an FS path - // (absolute/relative handling is done directly by the plugin); if the input is a file path, + // or a normal (c:\path) path, either a Windows (disk) path, an archive path, or an FS path + // (absolute/relative handling is performed directly by the plugin); if the input is a file path, // that file is focused; if suggestedTopIndex is not -1, the top index is set // in the panel; if suggestedFocusName is not NULL, an item with the same name is searched for - // case-insensitively and focused; if 'failReason' is not NULL, it is set to one of - // CHPPFR_XXX (informuje o vysledku metody); je-li 'convertFSPathToInternal' TRUE a jde - // it is an FS path, the owning plugin is found (by fs-name) and its - // CPluginInterfaceForFSAbstract::ConvertPathToInternal(); vraci TRUE pokud se podarilo - // list the requested path; - // NOTE: when an FS path is entered, opening is attempted in this order: in the panel FS, - // in a detached FS, or in a new FS (for panel and detached FS instances, it is checked - // whether plugin-fs-name matches and whether FS IsOurPath returns TRUE for the given path); - // restriction: main thread + outside CPluginFSInterfaceAbstract and CPluginDataInterfaceAbstract methods - // (for example, an FS open in the panel could be closed and 'this' could cease to exist) + // case-insensitively and focused; if 'failReason' is not NULL, it is set to one of the + // CHPPFR_XXX constants (it reports the method result); if 'convertFSPathToInternal' is TRUE and + // the path is an FS path, the plugin that owns the path is found (by fs-name) and its + // CPluginInterfaceForFSAbstract::ConvertPathToInternal() is called; returns TRUE if the requested + // path was listed successfully; + // NOTE: when an FS path is entered, opening is attempted in this order: in the FS + // in the panel, in a detached FS, or in a new FS (for the FS in the panel and detached FSs, it is checked + // whether plugin-fs-name matches and whether the FS method IsOurPath returns TRUE for the given path); + // restriction: main thread + outside the methods of CPluginFSInterfaceAbstract and CPluginDataInterfaceAbstract + // (for example, an FS open in the panel could be closed and 'this' could stop existing for the method) virtual BOOL WINAPI ChangePanelPath(int panel, const char* path, int* failReason = NULL, int suggestedTopIndex = -1, const char* suggestedFocusName = NULL, @@ -1556,7 +1556,27 @@ class CSalamanderGeneralAbstract int suggestedTopIndex = -1, const char* suggestedFocusName = NULL) = 0; - // Changes the panel path into an archive. 'archive' is the relative or absolute UNC (\\server\share\path\file) or normal (c:\path\file) archive name, and 'archivePath' is the path inside the archive. If the new path in the archive is not available, it tries shortened paths. When resolving a relative path to an absolute path, the path in panel 'panel' is preferred, but only if it is a disk path, including an archive path. 'panel' is one of PANEL_XXX. If 'suggestedTopIndex' is not -1, it is used as the panel top index, but only for the new path, not for a shortened or changed path. If 'suggestedFocusName' is not NULL, an item with the same name is searched for case-insensitively and focused, again only for the new path, not for a shortened or changed path. If 'forceUpdate' is TRUE and the path inside archive 'archive' is being changed while the archive is already open in the panel, the archive file is checked for changes (size & time). If it changed, the archive is closed to protect updated edited files and listed again; if the archive file no longer exists, the path is changed to a disk path by closing the archive, or to the root of the first local fixed drive if that disk path is not accessible. If 'forceUpdate' is FALSE, changes inside archive 'archive' are performed without checking the archive file. If 'failReason' is not NULL, it is set to one of the CHPPFR_XXX constants describing the result. Returns TRUE if the requested path was listed without shortening or other changes. Restriction: main thread + outside CPluginFSInterfaceAbstract and CPluginDataInterfaceAbstract methods (for example, an FS open in the panel could be closed and 'this' could cease to exist). + // Changes the panel path to an archive. 'archive' is a relative or absolute UNC + // (\\server\share\path\file) or normal (c:\path\file) archive name; 'archivePath' is the path + // inside the archive. If the new path in the archive is not accessible, the method tries to + // succeed with shortened paths. When resolving a relative path to an absolute path, the path in + // panel 'panel' is preferred (but only if it is a disk path, including a path to an archive; + // otherwise it is not used). 'panel' is one of PANEL_XXX. If 'suggestedTopIndex' is not -1, it + // is set as the top index in the panel (only for the new path; it is not set for a shortened + // or modified path). If 'suggestedFocusName' is not NULL, the method tries to find + // (case-insensitively) and focus an item with the same name (only for the new path; this is not + // done for a shortened or modified path). If 'forceUpdate' is TRUE and the path inside archive + // 'archive' is being changed while the archive is already open in the panel, the archive file is + // tested for changes (size and time check); if it has changed, the archive is closed (to avoid + // updating edited files) and listed again, or if the file no longer exists, the path is changed + // to a disk path (the archive is closed; if the disk path is not accessible, the path is changed + // to the root of the first local fixed drive). If 'forceUpdate' is FALSE, changes to the path + // inside archive 'archive' are performed without checking the archive file. If 'failReason' is + // not NULL, it is set to one of the CHPPFR_XXX constants (describing the method result). Returns + // TRUE if the requested path (without shortening or modification) was listed successfully. + // Restriction: main thread only, and outside the methods of CPluginFSInterfaceAbstract and + // CPluginDataInterfaceAbstract (for example, an FS open in the panel could be closed, so 'this' + // could cease to exist). virtual BOOL WINAPI ChangePanelPathToArchive(int panel, const char* archive, const char* archivePath, int* failReason = NULL, int suggestedTopIndex = -1, const char* suggestedFocusName = NULL, @@ -1646,10 +1666,18 @@ class CSalamanderGeneralAbstract virtual void WINAPI CallLoadOrSaveConfiguration(BOOL load, FSalLoadOrSaveConfiguration loadOrSaveFunc, void* param) = 0; - // Copies 'text' of length 'textLen' to the clipboard (-1 means "use strlen") in both multibyte and Unicode form (otherwise, for example, Notepad cannot handle Czech text). On success it may, if 'echo' is TRUE, display the message "Text was successfully copied to clipboard." ('echoParent' is the parent of the message box). Returns TRUE on success. Callable from any thread. + // Copies 'text' of length 'textLen' to the clipboard (-1 means "use strlen") in both multibyte + // and Unicode form (otherwise, for example, Notepad cannot handle Czech text). On success it may, + // if 'showEcho' is TRUE, display the message "Text was successfully copied to clipboard." + // ('echoParent' is the parent of the message box). Returns TRUE on success. + // Can be called from any thread. virtual BOOL WINAPI CopyTextToClipboard(const char* text, int textLen, BOOL showEcho, HWND echoParent) = 0; - // Copies Unicode 'text' of length 'textLen' to the clipboard (-1 means "use wcslen") in both Unicode and multibyte form (otherwise, for example, MSVC6.0 cannot handle Czech text). On success it may, if 'echo' is TRUE, display the message "Text was successfully copied to clipboard." ('echoParent' is the parent of the message box). Returns TRUE on success. Callable from any thread. + // Copies Unicode 'text' of length 'textLen' to the clipboard (-1 means "use wcslen") in both + // Unicode and multibyte form (otherwise, for example, MSVC6.0 cannot handle Czech text correctly); + // on success, if 'showEcho' is TRUE, it may display the message "Text was successfully copied to clipboard." + // ('echoParent' is the parent window of the message box); returns TRUE on success + // Can be called from any thread virtual BOOL WINAPI CopyTextToClipboardW(const wchar_t* text, int textLen, BOOL showEcho, HWND echoParent) = 0; // executes the menu command identified by 'id' in the main thread (calls @@ -1792,17 +1820,17 @@ class CSalamanderGeneralAbstract // it will be clipped; use for example for countdowns: 60s, 55s, 50s, ... virtual void WINAPI SetSafeWaitWindowText(const char* message) = 0; - // Finds an existing file copy in the disk cache and locks it (prevents its deletion); 'uniqueFileName' + // Finds an existing copy of a file in the disk cache and locks it (prevents its deletion); 'uniqueFileName' // is the unique name of the original file (the disk cache is searched by this name; the full - // file name in Salamander format - 'fs-name:fs-user-part' - should be sufficient; WARNING: the + // file name in Salamander format - "fs-name:fs-user-part" - should be sufficient; WARNING: the // name is compared case-sensitively; if the plugin requires case-insensitive matching, it must - // convert all names, for example to lower case - see CSalamanderGeneralAbstract::ToLowerCase); - ///tmpName' receives a pointer (valid until the file copy in the disk cache is removed) to the - // full name of the file copy located in a temporary directory; 'fileLock' is the lock for the - // file copy and must be a system event in the nonsignaled state that transitions to the signaled - // state after the file copy has been processed (you must use UnlockFileInCache; the plugin thus - // signals that the disk-cache copy may be removed); if the copy was not found, returns FALSE and - ///tmpName' is NULL (otherwise returns TRUE) + // convert all names, for example to lower case - see CSalamanderGeneralAbstract::ToLowerCase); 'tmpName' + // receives a pointer (valid until the file copy in the disk cache is removed) to the full name + // of the file copy located in a temporary directory; 'fileLock' is the lock for the file copy, + // a system event in the nonsignaled state that transitions to the signaled state after the file + // copy has been processed (it is necessary to use UnlockFileInCache; the plugin signals that the + // disk-cache copy may already be removed); if the copy was not found, returns FALSE and 'tmpName' + // is NULL (otherwise returns TRUE) // Can be called from any thread virtual BOOL WINAPI GetFileFromCache(const char* uniqueFileName, const char*& tmpName, HANDLE fileLock) = 0; @@ -1816,24 +1844,25 @@ class CSalamanderGeneralAbstract virtual void WINAPI UnlockFileInCache(HANDLE fileLock) = 0; // Inserts (moves) a file copy into the disk cache (the inserted copy is not locked, so it may - // be removed at any time); 'uniqueFileName' is the unique name of the original file (the - // disk cache is searched by this name; the full file name in Salamander format - - // "fs-name:fs-user-part" - should be sufficient; WARNING: the name is compared - // case-sensitively; if the plugin requires "case-insensitive" matching, it must convert all names, - // CSalamanderGeneralAbstract::ToLowerCase); 'nameInCache' je jmeno kopie souboru, ktera bude umistena - // in a temporary directory (the last part of the original file name is expected here so it - // still resembles the original file to the user); 'newFileName' is the full name of the stored - // file copy that will be moved into the disk cache under the name 'nameInCache'; it must be - // located on the same disk as the disk cache (if 'rootTmpPath' is NULL, the disk cache is in - // the Windows TEMP directory, otherwise the path to the disk cache is in 'rootTmpPath'; the - // file is renamed into the disk cache by the Win32 API function MoveFile); 'newFileName' is - // best obtained by calling SalGetTempFileName with parameter 'path' equal to 'rootTmpPath'); - // 'newFileSize' is the size of the stored file copy; returns TRUE on success (the file was - // moved into the disk cache and disappeared from its original location), returns FALSE on an - // internal error or if the file is already in the disk cache ('alreadyExists' receives TRUE if it is not NULL) + // be removed at any time); 'uniqueFileName' is the unique name of the original file (the disk + // cache is searched by this name; the full file name in Salamander format - "fs-name:fs-user-part" + // - should be sufficient; WARNING: the name is compared case-sensitively; if the plugin + // requires case-insensitive matching, it must convert all names, for example to lowercase - see + // CSalamanderGeneralAbstract::ToLowerCase); 'nameInCache' is the name of the file copy that will + // be placed in the temporary directory (the last part of the original file name is expected here + // so that it later resembles the original file to the user); 'newFileName' is the full name of + // the stored file copy that will be moved into the disk cache under the name 'nameInCache'; it + // must be located on the same disk as the disk cache (if 'rootTmpPath' is NULL, the disk cache + // is in the Windows TEMP directory; otherwise the path to the disk cache is in 'rootTmpPath'; + // this is required for renaming into the disk cache with the Win32 API function MoveFile); + // ideally, obtain 'newFileName' by calling SalGetTempFileName with parameter 'path' equal to + // 'rootTmpPath'); 'newFileSize' is the size of the stored file copy; returns TRUE on success + // (the file was moved into the disk cache and disappeared from its original location on disk), + // returns FALSE on an internal error or if the file is already in the disk cache (if + // 'alreadyExists' is not NULL, it receives TRUE when the file is already in the disk cache) // NOTE: if the plugin uses the disk cache, it should at least call - // CSalamanderGeneralAbstract::RemoveFilesFromCache("fs-name:"), jinak budou - // otherwise its file copies will remain in the disk cache unnecessarily + // CSalamanderGeneralAbstract::RemoveFilesFromCache("fs-name:") when the plugin is + // unloaded, otherwise its file copies will remain in the disk cache unnecessarily // Can be called from any thread virtual BOOL WINAPI MoveFileToCache(const char* uniqueFileName, const char* nameInCache, const char* rootTmpPath, const char* newFileName, @@ -2228,14 +2257,14 @@ class CSalamanderGeneralAbstract virtual BOOL WINAPI InstallWordBreakProc(HWND hWindow) = 0; // Salamander 3 or later: returns TRUE if this Altap Salamander instance was the - // first one started (when the instance starts, other running instances of version 3 or later + // first instance started (when an instance starts, other running instances of version 3 or later // are searched for); // // Notes on different SID / Session / Integrity Level combinations (does not apply to Salamander 2.5 and 2.51): - // the function returns TRUE even if a Salamander instance already running - // under a different SID exists; session and integrity level do not matter, so if a - // Salamander instance is already running in another session or with a different integrity level, but - // with the same SID, the newly started instance returns FALSE + // the function returns TRUE even if a Salamander instance is already running + // under a different SID; session and integrity level do not matter, so if a + // Salamander instance is already running in another session or with a different integrity level, + // but with the same SID, the newly started instance returns FALSE // // Can be called from any thread virtual BOOL WINAPI IsFirstInstance3OrLater() = 0; @@ -2393,13 +2422,13 @@ class CSalamanderGeneralAbstract // 'srcUID' is the unique source identifier (passed as a parameter when opening the // viewer or obtainable by calling GetPanelEnumFilesParams); 'lastFileIndex' (must // not be NULL) is an IN/OUT parameter that the plugin should change only if it wants to return the - // last file name, in which case it must set 'lastFileIndex' to -1; the initial value + // name of the last file, in which case it must set 'lastFileIndex' to -1; the initial value // of 'lastFileIndex' is passed both when opening the viewer and when calling - // GetPanelEnumFilesParams; 'lastFileName' is the full name of the current file (empty + // GetPanelEnumFilesParams; 'lastFileName' is the full name of the current file (an empty // string if it is not known, for example if 'lastFileIndex' is -1); if 'preferSelected' - // is TRUE and at least one name is selected, selected names are returned; if - // 'onlyAssociatedExtensions' is TRUE, it returns only files whose extension is associated with - // this plugin's viewer (F3 on such a file would try to open this plugin's viewer + // is TRUE and at least one file is selected, selected file names are returned; if + // 'onlyAssociatedExtensions' is TRUE, only files with an extension associated with + // this plugin's viewer are returned (pressing F3 on such a file would try to open this plugin's viewer // and ignores any shadowing by another plugin's viewer); 'fileName' is the buffer // for the retrieved name (size at least MAX_PATH); returns TRUE if the name is obtained // successfully; returns FALSE on error: there is no previous file name in the source (if @@ -2449,11 +2478,12 @@ class CSalamanderGeneralAbstract const char* lastFileName, BOOL select, BOOL* srcBusy) = 0; - // Returns a pointer to the shared history (last used values) of the selected combo box; - // it is an array of allocated strings; the array has a fixed number of strings, returned - // in 'historyItemsCount' (must not be NULL); the pointer to the array is returned in 'historyArr' - // (must not be NULL); 'historyID' (one of SALHIST_XXX) specifies which shared history the pointer refers to - // Main thread only (shared histories cannot be used from another thread; access + // Returns a reference to the shared history (last used values) of the selected combo box; + // it is an array of allocated strings; the array has a fixed number of strings, which is returned + // in 'historyItemsCount' (must not be NULL); a pointer to the array is returned in 'historyArr' + // (must not be NULL); 'historyID' (one of SALHIST_XXX) specifies which shared history the reference should be returned to + // point to + // Restriction: main thread (shared histories cannot be used from another thread; access // to them is not synchronized in any way) virtual BOOL WINAPI GetStdHistoryValues(int historyID, char*** historyArr, int* historyItemsCount) = 0; @@ -2565,13 +2595,13 @@ class CSalamanderGeneralAbstract // Can be called from any thread virtual void WINAPI FreeSalamanderDirectory(CSalamanderDirectoryAbstract* salDir) = 0; - // Adds a new timer for plugin FS object; when the timer times out, the - // CPluginFSInterfaceAbstract::Event() objektu pluginoveho FS 'timerOwner' s parametry - // FSE_TIMER a 'timerParam'; 'timeout' je timeout timeru od jeho pridani (v milisekundach, + // Adds a new timer for a plugin FS object; when the timer times out, + // CPluginFSInterfaceAbstract::Event() is called on the plugin FS object 'timerOwner' with parameters + // FSE_TIMER and 'timerParam'; 'timeout' is the timer timeout from the moment it is added (in milliseconds, // must be >= 0); the timer is canceled when it times out (before calling - // CPluginFSInterfaceAbstract::Event()) nebo pri zavreni objektu pluginoveho FS; + // CPluginFSInterfaceAbstract::Event()) or when the plugin FS object is closed; // returns TRUE if the timer was added successfully - // Main thread only + // Restriction: main thread virtual BOOL WINAPI AddPluginFSTimer(int timeout, CPluginFSInterfaceAbstract* timerOwner, DWORD timerParam) = 0; @@ -2672,8 +2702,8 @@ class CSalamanderGeneralAbstract // (for example, the FS open in the panel may be closed, so the method's 'this' pointer may cease to be valid) virtual void WINAPI DisconnectFSFromPanel(HWND parent, int panel) = 0; - // Returns TRUE if file name 'name' is associated with the calling plugin in Archives Associations in Panels - // 'tname' must contain only the file name, not a full or relative path + // Returns TRUE if the file name 'name' is associated with the calling plugin in Archives Associations in Panels + // 'name' must contain only the file name, not a full or relative path // Main thread only virtual BOOL WINAPI IsArchiveHandledByThisPlugin(const char* name) = 0; @@ -2776,13 +2806,13 @@ class CSalamanderGeneralAbstract // Can be called from any thread. virtual WCHAR* WINAPI LoadStrW(HINSTANCE module, int resID) = 0; - // Changes the panel path to the user-selected "rescue" path (see SALCFG_IFPATHISINACCESSIBLEGOTO) and, - // if that also fails, to the root of the first local fixed drive; this almost certainly changes the current - // path in the panel. 'panel' is one of PANEL_XXX. If 'failReason' is not NULL, it is set to one of the - // CHPPFR_XXX constants (informing about the result of the method). Returns TRUE if the path change succeeds - // (to the "rescue" path or the fixed drive). - // Limitation: main thread and outside CPluginFSInterfaceAbstract and CPluginDataInterfaceAbstract methods - // (otherwise, for example, closing the FS opened in the panel could make 'this' cease to exist for the method). + // Changes the panel path to the user-selected "rescue" path (see + // SALCFG_IFPATHISINACCESSIBLEGOTO), and if that also fails, to the root of the first local fixed + // drive; this is very likely to change the current path in the panel. 'panel' is one of PANEL_XXX. + // If 'failReason' is not NULL, it is set to one of the CHPPFR_XXX constants (indicating the method + // result). Returns TRUE if the path change succeeds (to the "rescue" path or the fixed drive). + // Restriction: main thread only, and not from CPluginFSInterfaceAbstract or CPluginDataInterfaceAbstract + // methods (for example, the FS opened in the panel could be closed, and 'this' could stop existing). virtual BOOL WINAPI ChangePanelPathToRescuePathOrFixedDrive(int panel, int* failReason = NULL) = 0; // Registers the plugin as a replacement for the Network item in the Change Drive menu and in the drive bars. @@ -3114,10 +3144,10 @@ class CSalamanderGeneralAbstract virtual BOOL WINAPI ClearReadOnlyAttr(const char* name, DWORD attr = -1) = 0; // Determines whether a critical shutdown (or logoff) is currently in progress; if so, returns TRUE. - // During this shutdown we have only 5 seconds to save the configuration of the whole program, - // including plugins, so more time-consuming operations must be skipped. After 5 seconds the system - // forcibly terminates the process. For more information see WM_ENDSESSION and the ENDSESSION_CRITICAL flag. - // Available on Vista+. + // During this type of shutdown, only 5 seconds are available to save the configuration of the entire application, + // including plugins, so more time-consuming operations must be skipped. After 5 seconds, the system + // forcibly terminates the process. For more information, see WM_ENDSESSION and the ENDSESSION_CRITICAL flag. + // Vista+ virtual BOOL WINAPI IsCriticalShutdown() = 0; // Enumerates all windows in thread 'tid' (0 = current) via EnumThreadWindows and posts WM_CLOSE to all enabled From 5f9711f793849784b328f2aad0a73bda7fd748b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 19:22:19 +0200 Subject: [PATCH 289/710] [translation] Fix src/common/allochan.cpp comments (#663) --- src/common/allochan.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/allochan.cpp b/src/common/allochan.cpp index cebe5d2af..5a5492cc2 100644 --- a/src/common/allochan.cpp +++ b/src/common/allochan.cpp @@ -57,8 +57,8 @@ class C__AllocHandlerInit C__AllocHandlerInit() { InitializeCriticalSection(&CriticalSection); - OldNewHandler = _set_new_handler(AltapNewHandler); // operator new ma volat pri nedostatku pameti nas new-handler - OldNewMode = _set_new_mode(1); // malloc ma volat pri nedostatku pameti nas new-handler + OldNewHandler = _set_new_handler(AltapNewHandler); // Have operator new call our new-handler on out-of-memory. + OldNewMode = _set_new_mode(1); // Have malloc call our new-handler on out-of-memory. } ~C__AllocHandlerInit() { From 252d1aa95322e9f3cbcf3b5e97e4cb6c625ea6f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 19:22:22 +0200 Subject: [PATCH 290/710] [translation] Fix src/common/array.cpp comments (#664) --- src/common/array.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/common/array.cpp b/src/common/array.cpp index 91088a3a3..c9aa91955 100644 --- a/src/common/array.cpp +++ b/src/common/array.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" From ac3d9ba33070a36901aa4e8dfc1ce4b2cd650636 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 19:22:25 +0200 Subject: [PATCH 291/710] [translation] Fix src/common/array.h comments (#665) --- src/common/array.h | 56 +++++++++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/common/array.h b/src/common/array.h index dc4e2cb52..8acfa4f96 100644 --- a/src/common/array.h +++ b/src/common/array.h @@ -97,7 +97,7 @@ class TDirectArray TRACE_C("Index is out of range (index = " << index << ", Count = " << Count << ")."); Error(etUnknownIndex); - return Data[0]; // because of compiler we must return (invalid) item + return Data[0]; // compiler workaround: return a possibly invalid item } #endif } @@ -114,7 +114,7 @@ class TDirectArray TRACE_C("Index is out of range (index = " << index << ", Count = " << Count << ")."); Error(etUnknownIndex); - return Data[0]; // because of compiler we must return (invalid) item + return Data[0]; // compiler workaround: return a possibly invalid item } #endif } @@ -268,10 +268,10 @@ class TIndirectArray : public CArray // **************************************************************************** // TIndirectClassArray: -// -vhodne pro ulozeni ukazatelu na objekty, neumoznuje zmenu indexu prvku -// -nad polem se neprovadi zadne operace sesunu prvku - prvek zustava -// stale na stejnem indexu -// -pri pridavani prvku se vyplnuji mezery vznikle predchozim uvolnovanim prvku +// -suitable for storing pointers to objects; element indexes do not change +// -no element-shifting operations are performed on the array, so an element +// always stays at the same index +// -when adding elements, gaps created by earlier removals are filled template class TIndirectClassArray : public TIndirectArray @@ -316,14 +316,14 @@ class TIndirectClassArray : public TIndirectArray // **************************************************************************** // TSmallerDirectArray: -// -popis viz TDirectArray, ale neni vhodne pro ulozeni objektu (nevola -// konstruktory ani destruktory), specializace: setri pamet potrebnou -// na spravu pole tim, ze umoznuje celkovy pocet prvku pole jen 65535 - misto -// int WORD a nema virtualni metodu CallDestructor -// -vhodne jako promenna (atribut) tridy, od ktere existuje mhoho objektu -// -pametove naroky: 6 B (jen +2 B oproti klas. poli), (TDirectArray ma 25 B) -// -zmenseni za cenu generovani tridy podle sablony pro ruzne 'Base', 'Delta' -// a zmenseni rozsahu pole +// -see TDirectArray for a description, but it is not suitable for storing objects (it does not call +// constructors or destructors); the specialization saves memory needed to +// manage the array by allowing only 65535 elements, using WORD instead of +// int, and by not having a virtual CallDestructor method +// -suitable as a member variable of a class with many instances +// -memory requirements: 6 B (only 2 B more than the classic array); TDirectArray has 25 B +// -smaller at the cost of generating the class from the template for different 'Base', 'Delta' +// values and reducing the array range template // only 65535 items class TSmallerDirectArray @@ -436,19 +436,19 @@ class TSmallerDirectArray // **************************************************************************** // TClassArray: -// -vhodne pro ulozeni mnoha malych objektu, neumoznuje zmenu indexu prvku -// -alokuje objekty CLASS_TYPE primo do pole, -// provadi se volani konstruktoru i destruktoru techto objektu -// -nad polem se neprovadi zadne operace sesunu prvku - prvek zustava -// stale na stejnem indexu -// -platny prvek pole: (index_prvku < Count && !At(index_prvku).IsEmpty()) +// -suitable for storing many small objects; element indexes do not change +// -allocates CLASS_TYPE objects directly in the array, +// calling the constructors and destructors of those objects +// -no element-shifting operations are performed on the array, so an element +// always stays at the same index +// -valid array element: (index_prvku < Count && !At(index_prvku).IsEmpty()) // -// naroky na CLASS_TYPE: -// 1) existence metody IsEmpty(), ktera vraci jestli uz se volal -// destruktor objektu -// 2) nadefinovani operatoru 'new' pomoci makra DEFINE_NEW(CLASS_TYPE) +// requirements for CLASS_TYPE: +// 1) an IsEmpty() method that returns whether the object's +// destructor has already been called +// 2) operator 'new' defined using the DEFINE_NEW(CLASS_TYPE) macro // -// priklad: +// example: // class CSimpleObject // { // public: @@ -464,10 +464,10 @@ class TSmallerDirectArray // // TClassArray Simples(10, 5); // -// pridani prvku do pole: +// adding an element to the array: // int index_prvku = Simples.FirstFreeIndex; // prvni volny index v poli -// new (&Simples)CSimpleObject(); // vraci adresu objektu, pri chybe NULL, -// // prvek byl pridan a ma index index_prvku +// new (&Simples)CSimpleObject(); // returns the address of the object, NULL on error, +// // the element was added and has index index_prvku template class TClassArray : public TDirectArray From ce08e2d8033c2053105ba2384988074301097928 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 19:22:28 +0200 Subject: [PATCH 292/710] [translation] Fix src/common/crc32.cpp comments (#666) --- src/common/crc32.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/common/crc32.cpp b/src/common/crc32.cpp index f084873ef..0b595ac05 100644 --- a/src/common/crc32.cpp +++ b/src/common/crc32.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" From fc7586c3ef631ccee4c70eefa37055b9f11dce31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 19:22:31 +0200 Subject: [PATCH 293/710] [translation] Fix src/common/crc32.h comments (#667) --- src/common/crc32.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/crc32.h b/src/common/crc32.h index c6d2cecf4..a9d25c1d7 100644 --- a/src/common/crc32.h +++ b/src/common/crc32.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once @@ -15,7 +16,7 @@ extern const DWORD StaticCrcTab[256]; #endif -//fill up crc table +//populate the CRC table void MakeCrcTable(DWORD* crcTab); //run a set of bytes through the crc shift register, if buffer is a NULL From f34d0b92c185aea051670cfebceb871013281a91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 19:22:34 +0200 Subject: [PATCH 294/710] [translation] Fix src/common/dib.cpp comments (#668) --- src/common/dib.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/common/dib.cpp b/src/common/dib.cpp index 926c4e096..be8e46e2e 100644 --- a/src/common/dib.cpp +++ b/src/common/dib.cpp @@ -308,13 +308,14 @@ HBITMAP DIBToBitmap(HANDLE hDIB, HPALETTE hPal) return hBitmap; } -//--------------------------------------------------------------------- +// --------------------------------------------------------------------- // // Function: MapColor(RGB fromColor, RGB toColor) // -// vsechny barvy fromColor premapuje na barvu toColor +// Remaps every occurrence of fromColor in the DIB to +// toColor. // -//--------------------------------------------------------------------- +// --------------------------------------------------------------------- int MapColor(HANDLE hDIB, COLORREF fromColor, COLORREF toColor) { From f58645bd2d8ff03afa13c8c7cc123c976980c909 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 19:22:38 +0200 Subject: [PATCH 295/710] [translation] Fix src/common/handles.cpp comments (#669) --- src/common/handles.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/common/handles.cpp b/src/common/handles.cpp index efb010801..13adf19fd 100644 --- a/src/common/handles.cpp +++ b/src/common/handles.cpp @@ -544,12 +544,7 @@ C__Handles::~C__Handles() // Check and list the remaining handles. if (Handles.Count != 0) { - // I had to replace the code below that uses MESSAGE_E, because when this - // destructor is called the stream facets in ALTAPDB have already been destroyed, and sending an int - // or handle to the stream simply crashes (this happens only in VC2010 and VC2012; in VC2008 - // it still works). It does not happen in Salamander, probably because the RTL is in the DLL - // (ALTAPDB uses a static one); I did not investigate further. A better solution would be to destroy the - // facets only after this module, but unfortunately I cannot do that (only at the "lib" level). + // The code below that uses MESSAGE_E had to be replaced because when this destructor runs, the stream facets in ALTAPDB have already been destroyed, and sending an int or handle to the stream simply crashes (only in VC2010 and VC2012; it still works in VC2008). It does not happen in Salamander, probably because the RTL is in the DLL (ALTAPDB uses a static one), but that was not investigated further. A better solution would be to destroy the facets only after this module, but that cannot be done here (only at the "lib" level). char msgBuf[1000]; sprintf_s(msgBuf, #ifdef MESSAGES_DEBUG @@ -1891,8 +1886,8 @@ BOOL C__Handles::DuplicateHandle(HANDLE hSourceProcessHandle, HANDLE hSourceHand "current process."); } - // GetCurrentProcess vraci jakysi pseudohandle, takze tahle konstrukce - // neni spravna, meli by se porovnat ID procesu a ne jejich handly ... + // GetCurrentProcess returns a pseudo-handle, so this is not correct; + // process IDs should be compared instead of process handles ... if ((dwOptions & DUPLICATE_CLOSE_SOURCE) && hSourceProcessHandle == GetCurrentProcess()) From 01b673c1a89a8f693e405e89657aaa0149071d7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 19:22:41 +0200 Subject: [PATCH 296/710] [translation] Fix src/common/lstrfix.h comments (#670) --- src/common/lstrfix.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/lstrfix.h b/src/common/lstrfix.h index 011bbab82..eca077f36 100644 --- a/src/common/lstrfix.h +++ b/src/common/lstrfix.h @@ -7,7 +7,8 @@ // The following functions do not crash when passed invalid pointers (including NULL): // lstrcpy, lstrcpyn, lstrlen, and lstrcat (these are defined with the A or W suffix, so // we do not redefine them directly). For easier debugging, we need them to crash, -// because otherwise the bug is detected later, where its cause may no longer be clear +// because otherwise the error is only discovered later, when it may no longer be clear +// what caused it #define lstrcpyA _sal_lstrcpyA #define lstrcpyW _sal_lstrcpyW #define lstrcpynA _sal_lstrcpynA From da5e9a1e1335076e4470a98e12095bd3da8963fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 19:22:44 +0200 Subject: [PATCH 297/710] [translation] Fix src/common/regexp.cpp comments (chunk 1/3) (#671) --- src/common/regexp.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/regexp.cpp b/src/common/regexp.cpp index b08030c9d..b701e5675 100644 --- a/src/common/regexp.cpp +++ b/src/common/regexp.cpp @@ -40,14 +40,14 @@ #pragma warning(3 : 4706) // warning C4706: assignment within conditional expression -//#include "trace.h" aby to slo pripojit i k pluginum, stejne tu zatim zadny TRACE neni +//needed so this can also be built for plugins; there is no TRACE here yet #include "str.h" #include "regexp.h" //***************************************************************************** //***************************************************************************** // -// moje cast regexp.cpp +// my section of regexp.cpp // //***************************************************************************** //***************************************************************************** @@ -447,7 +447,7 @@ void CRegularExpression::ReverseRegExp(char*& dstExpEnd, char* srcExp, char* src else *--dstExpEnd = (*s == '(') ? ')' : ']'; - if (oldSS - s >= 2) // pokud vyraz nekonci otevrenou zavorkou + if (oldSS - s >= 2) // if the expression does not end with an opening parenthesis { if (*s == '(') { // Copy the reversed expression - parenthesized group. @@ -485,7 +485,7 @@ void CRegularExpression::ReverseRegExp(char*& dstExpEnd, char* srcExp, char* src //***************************************************************************** //***************************************************************************** // -// puvodni regexp.cpp +// original regexp.cpp // //***************************************************************************** //***************************************************************************** From b9ef57a23637efd9582f89e9880262116673a53e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 19:22:47 +0200 Subject: [PATCH 298/710] [translation] Fix src/common/regexp.cpp comments (chunk 2/3) (#672) --- src/common/regexp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/regexp.cpp b/src/common/regexp.cpp index b701e5675..894408083 100644 --- a/src/common/regexp.cpp +++ b/src/common/regexp.cpp @@ -1169,7 +1169,7 @@ char** regstartp; /* Pointer to startp array. */ char** regendp; /* Ditto for endp. */ /* - * Forwards. + * Forward declarations. */ int regtry(regexp* prog, char* string); int regmatch(char* prog); From 762e0ccf1da8c0eed7feca050653cee0b5ce7a2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 19:22:51 +0200 Subject: [PATCH 299/710] [translation] Fix src/common/messages.cpp comments (#673) --- src/common/messages.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/common/messages.cpp b/src/common/messages.cpp index 4283adfb5..c1d34123a 100644 --- a/src/common/messages.cpp +++ b/src/common/messages.cpp @@ -189,7 +189,7 @@ int C__Messages::MessageBoxT(const char* lpCaption, UINT uType) HGLOBAL message = GlobalAlloc(GMEM_FIXED, len); // backup copy of the text if (message != NULL) { - memcpy((char*)message, MessagesStringBuf.c_str(), len); // je to FIXED -> HANDLE==PTR + memcpy((char*)message, MessagesStringBuf.c_str(), len); // it is FIXED, so HANDLE == PTR data.Text = (char*)message; } else @@ -231,7 +231,7 @@ int C__Messages::MessageBox(HWND hWnd, const char* lpCaption, UINT uType) size_t len = MessagesStringBuf.length() + 1; HGLOBAL message = GlobalAlloc(GMEM_FIXED, len); // backup copy of the text char* txt; - txt = (char*)message; // je to FIXED -> HANDLE==PTR + txt = (char*)message; // it is FIXED, so HANDLE == PTR if (txt != NULL) memcpy(txt, MessagesStringBuf.c_str(), len); else @@ -264,7 +264,7 @@ C__MessagesW::C__MessagesW() : MessagesStrStream(&MessagesStringBuf) // For now we use only output streams, and only with strings (without conversion) and numbers. So sending a number to the stringstream should be enough. If we start using streams more in the future and the debug heap starts reporting leaks again, we will have to add more input/output here. std::wstringstream s; s << 1; -#endif // _DEBUG +#endif // MULTITHREADED_MESSAGES_ENABLE } struct C__MessageBoxDataW @@ -299,7 +299,7 @@ int C__MessagesW::MessageBoxT(const WCHAR* lpCaption, UINT uType) HGLOBAL message = GlobalAlloc(GMEM_FIXED, sizeof(WCHAR) * len); // backup copy of the text if (message != NULL) { - memcpy((WCHAR*)message, MessagesStringBuf.c_str(), sizeof(WCHAR) * len); // je to FIXED -> HANDLE==PTR + memcpy((WCHAR*)message, MessagesStringBuf.c_str(), sizeof(WCHAR) * len); // it is FIXED, so HANDLE == PTR data.Text = (WCHAR*)message; } else @@ -341,7 +341,7 @@ int C__MessagesW::MessageBox(HWND hWnd, const WCHAR* lpCaption, UINT uType) size_t len = MessagesStringBuf.length() + 1; HGLOBAL message = GlobalAlloc(GMEM_FIXED, sizeof(WCHAR) * len); // backup copy of the text WCHAR* txt; - txt = (WCHAR*)message; // je to FIXED -> HANDLE==PTR + txt = (WCHAR*)message; // it is FIXED, so HANDLE == PTR if (txt != NULL) memcpy(txt, MessagesStringBuf.c_str(), sizeof(WCHAR) * len); else From 4f364aa2c1e377738282c64923bb44c05cc31371 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 19:22:54 +0200 Subject: [PATCH 300/710] [translation] Fix src/common/sheets.cpp comments (chunk 1/2) (#674) --- src/common/sheets.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/common/sheets.cpp b/src/common/sheets.cpp index e99e4e945..66e3f94c1 100644 --- a/src/common/sheets.cpp +++ b/src/common/sheets.cpp @@ -45,7 +45,7 @@ void CElasticLayout::AddResizeCtrl(int resID) RECT r; GetWindowRect(hChild, &r); - // pokud je spodni hrana prvku vetsi nez SplitY, posuneme SplitY hranici + // if the control's bottom edge is below SplitY, move the SplitY boundary POINT p = {r.right, r.bottom}; ScreenToClient(HWindow, &p); if (p.y > SplitY) @@ -68,7 +68,7 @@ CElasticLayout::FindMoveControls(HWND hChild, LPARAM lParam) { CElasticLayout* el = (CElasticLayout*)lParam; - // pokud prvek lezi pod SplitY, pridame ho do seznamu prvku, ktere budou posouvat + // if the control is below SplitY, add it to the list of controls to move RECT r; GetWindowRect(hChild, &r); POINT p = {r.left, r.top}; @@ -310,7 +310,7 @@ CPropSheetPage::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) (GetKeyState(VK_SHIFT) & 0x8000) != 0); return TRUE; } - break; // F1 nechame propadnout do parenta + break; // let F1 fall through to the parent } case WM_CONTEXTMENU: @@ -358,7 +358,7 @@ CPropSheetPage::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) return TRUE; } - // obehnu vsechny stranky pro transfer + // iterate over all pages for transfer for (int i = 0; i < ParentDialog->Count; i++) { if (ParentDialog->At(i)->HWindow != NULL) @@ -792,7 +792,7 @@ CTreePropHolderDlg::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (!ChildDialog->ValidateData()) return TRUE; - // obehnu vsechny stranky pro transfer + // iterate over all pages for transfer for (int i = 0; i < TPD->Count; i++) if (TPD->At(i)->HWindow != NULL) if (!TPD->At(i)->TransferData(ttDataFromWindow)) @@ -1047,8 +1047,8 @@ int CTreePropHolderDlg::BuildAndMeasureTree() tvis.item.pszText = TPD->At(i)->Title; tvis.item.cchTextMax = (int)_tcslen(TPD->At(i)->Title); tvis.item.state = 0; - // POZOR: expandovatelne polozky zde musime expandovat, jinak nasledne TreeView_GetItemRect() vrati FALSE - // a nahodna data v obdelniku RECT r + // WARNING: expandable items must be expanded here, otherwise TreeView_GetItemRect() returns FALSE + // and RECT r contains random data if (TPD->At(i)->Expanded != NULL) tvis.item.state |= TVIS_EXPANDED; tvis.item.stateMask = tvis.item.state; From bae9f6cad9cb0ee562711ae0598bf9a11b905f89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 19:22:57 +0200 Subject: [PATCH 301/710] [translation] Fix src/common/moore.cpp comments (#675) --- src/common/moore.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/common/moore.cpp b/src/common/moore.cpp index 32421966f..ed3c01d1a 100644 --- a/src/common/moore.cpp +++ b/src/common/moore.cpp @@ -23,11 +23,9 @@ #include "str.h" #include "moore.h" -// // **************************************************************************** // Initialize -// vypocet poli Fail1 a Fail2 -// +// Calculation of the Fail1 and Fail2 arrays BOOL CSearchData::Initialize() { From c5f650b7fc5c4de68ca61e2113644e6887536f28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 19:23:00 +0200 Subject: [PATCH 302/710] [translation] Fix src/common/trace.cpp comments (chunk 1/3) (#676) --- src/common/trace.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/trace.cpp b/src/common/trace.cpp index 0c1ea52f1..84b74e845 100644 --- a/src/common/trace.cpp +++ b/src/common/trace.cpp @@ -243,7 +243,7 @@ DWORD C__TraceThreadCache::GetUniqueThreadId(DWORD tid) { if (CacheUID[__TraceCacheGetIndex(tid)] != -1 && // je-li platny zaznam - CacheTID[__TraceCacheGetIndex(tid)] == tid) // a je-li shodny s tid + CacheTID[__TraceCacheGetIndex(tid)] == tid) // and the TID matches { return CacheUID[__TraceCacheGetIndex(tid)]; // UID is in the cache } @@ -488,7 +488,7 @@ BOOL C__Trace::Connect(BOOL onUserRequest) BOOL ret = FALSE; if (HWritePipe != NULL) - ret = TRUE; // pokud je jiz spojeni navazano + ret = TRUE; // if the connection is already established else { // try to open the mutex for access to the shared memory From 2e972c90576b687f5a06e696bb6cce96bfd4cc68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 19:23:03 +0200 Subject: [PATCH 303/710] [translation] Fix src/common/moore.h comments (#677) --- src/common/moore.h | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/common/moore.h b/src/common/moore.h index 73011a655..e3d3cc639 100644 --- a/src/common/moore.h +++ b/src/common/moore.h @@ -3,7 +3,7 @@ // CommentsTranslationProject: TRANSLATED // **************************************************************************** -// Boyer-Mooruv algoritmus hledani podretezce +// Boyer-Moore substring search algorithm // **************************************************************************** #pragma once @@ -73,14 +73,12 @@ class CSearchData WORD Flags; // modify via SetFlags }; -// // **************************************************************************** // SearchForward -// vraci pozici Patternu nebo -1 -// text - v cem ma hledat -// length - delka stringu text -// start - prvni znak cislovano od 0 -// +// returns the index of Pattern or -1 +// text - text to search in +// length - length of the text string +// start - index of the first character, starting at 0 int CSearchData::SearchForward(const char* text, int length, int start) { @@ -119,13 +117,11 @@ int CSearchData::SearchForward(const char* text, int length, int start) return -1; } -// // **************************************************************************** // SearchBackward -// vraci pozici Patternu nebo -1 -// text - v cem ma hledat -// length - delka stringu text -// +// returns the index of Pattern or -1 +// text - text to search in +// length - length of the text string int CSearchData::SearchBackward(const char* text, int length) { From 261f3a919ad093183f11078564a5efe31375b5f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 19:23:06 +0200 Subject: [PATCH 304/710] [translation] Fix src/common/trace.cpp comments (chunk 2/3) (#678) --- src/common/trace.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/trace.cpp b/src/common/trace.cpp index 84b74e845..d353af0b1 100644 --- a/src/common/trace.cpp +++ b/src/common/trace.cpp @@ -596,7 +596,7 @@ BOOL C__Trace::Connect(BOOL onUserRequest) *(DWORD*)&mapAddress[4] /* ClientOrServerProcessId (here it is the server PID) */); // get the pipe and semaphore handles if (hServerProcess != NULL && - DuplicateHandle(hServerProcess, (HANDLE)(DWORD_PTR)(*(DWORD*)&mapAddress[8]) /* HReadOrWritePipe (here it is HWritePipe) */, // server + DuplicateHandle(hServerProcess, (HANDLE)(DWORD_PTR)(*(DWORD*)&mapAddress[8]) /* HReadOrWritePipe (here it is HWritePipe) */, // client GetCurrentProcess(), &hWritePipeFromSrv, // client GENERIC_WRITE, FALSE, 0) && DuplicateHandle(hServerProcess, (HANDLE)(DWORD_PTR)(*(DWORD*)&mapAddress[12]) /* HPipeSemaphore */, // server @@ -604,11 +604,11 @@ BOOL C__Trace::Connect(BOOL onUserRequest) 0, FALSE, DUPLICATE_SAME_ACCESS)) { *((int*)mapAddress) = 3; // write result -> 3 = success, we have the handles - *(DWORD*)&mapAddress[4] = GetCurrentProcessId(); // ClientOrServerProcessId (tady jde o PID klienta) + *(DWORD*)&mapAddress[4] = GetCurrentProcessId(); // ClientOrServerProcessId (client PID here) } else { - *((BOOL*)mapAddress) = FALSE; // write result -> failed + *((BOOL*)mapAddress) = FALSE; // write result -> failure } if (hServerProcess != NULL) CloseHandle(hServerProcess); @@ -627,7 +627,7 @@ BOOL C__Trace::Connect(BOOL onUserRequest) CloseHandle(HWritePipe); HWritePipe = hWritePipeFromSrv; // use the pipe from the server (close the client one) - if (expectedServerVer == TRACE_CLIENT_VERSION) // hura, povedlo se pripojit na novy Trace Server! + if (expectedServerVer == TRACE_CLIENT_VERSION) // successfully connected to the new Trace Server! { #ifdef TRACE_IGNORE_AUTOCLEAR ret = SendIgnoreAutoClear(TRUE); // ignore; disconnect on error From 9ad938841f6e9e1be18f8463626ec9d9cf0370ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 19:23:09 +0200 Subject: [PATCH 305/710] [translation] Fix src/common/multimon.cpp comments (#679) --- src/common/multimon.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/common/multimon.cpp b/src/common/multimon.cpp index 9e854a8f4..dc749d00b 100644 --- a/src/common/multimon.cpp +++ b/src/common/multimon.cpp @@ -59,8 +59,8 @@ void MultiMonGetClipRectByWindow(HWND hByWnd, RECT* workClipRect, RECT* monitorC } else { - // pokud nalezneme foreground okno patrici nasi aplikaci, - // centrujeme okno na stejny desktop + // If the foreground window belongs to our application, + // center the window on the same desktop. HWND hForegroundWnd = GetForegroundWindow(); DWORD processID; GetWindowThreadProcessId(hForegroundWnd, &processID); @@ -147,13 +147,13 @@ void MultiMonCenterWindowByRect(HWND hWindow, const RECT& clipR, const RECT& byR wndRect.bottom = wndRect.top + wndHeight; // Keep it within bounds. - if (wndRect.left < clipR.left) // pokud je okno vetsi nez clipR, nechame zobrazit jeho levou cast + if (wndRect.left < clipR.left) // If the window is larger than clipR, leave its left part visible. { wndRect.left = clipR.left; wndRect.right = wndRect.left + wndWidth; } - if (wndRect.top < clipR.top) // pokud je okno vetsi nez clipR, nechame zobrazit jeho hotni cast + if (wndRect.top < clipR.top) // If the window is larger than clipR, leave its top part visible. { wndRect.top = clipR.top; wndRect.bottom = wndRect.top + wndHeight; @@ -161,7 +161,7 @@ void MultiMonCenterWindowByRect(HWND hWindow, const RECT& clipR, const RECT& byR if (wndWidth <= clipR.right - clipR.left) { - // pokud je okno mensi nez clipR, osetrime aby nelezlo vpravo za hranici clipR + // If the window is smaller than clipR, make sure it does not extend past the right edge of clipR. if (wndRect.right >= clipR.right) { wndRect.left = clipR.right - wndWidth; @@ -170,14 +170,14 @@ void MultiMonCenterWindowByRect(HWND hWindow, const RECT& clipR, const RECT& byR } else { - // pokud je okno vetsi nez clipR + // If the window is larger than clipR. if (wndRect.left > clipR.left) wndRect.left = clipR.left; // Use as much space as possible. } if (wndHeight <= clipR.bottom - clipR.top) { - // pokud je okno mensi nez clipR, osetrime aby nelezlo dole za hranici clipR + // If the window is smaller than clipR, make sure it does not extend past the bottom edge of clipR. if (wndRect.bottom >= clipR.bottom) { wndRect.top = clipR.bottom - wndHeight; @@ -186,7 +186,7 @@ void MultiMonCenterWindowByRect(HWND hWindow, const RECT& clipR, const RECT& byR } else { - // pokud je okno vetsi nez clipR + // If the window is larger than clipR. if (wndRect.top > clipR.top) wndRect.top = clipR.top; // Use as much space as possible. } @@ -240,8 +240,8 @@ BOOL MultiMonGetDefaultWindowPos(HWND hByWnd, POINT* p) HMONITOR hTmpMonitor = MonitorFromWindow(wnd.HWindow, MONITOR_DEFAULTTONEAREST); if (hTmpMonitor != hMonitor) { - // trik s dummy oknem funguje pekne pod MSVC, ale pri spusteni salamandera bez MSVC - // se okno otevira na primarnim monitoru (nezjistil jsem proc, kdyz ma parenta) + // The dummy-window trick works fine under MSVC, but when Salamander runs without MSVC + // the window opens on the primary monitor (I do not know why, even though it has a parent). // Work around it by moving the window to our monitor. MONITORINFO tmpInfo; From adcee11652782815425a0bcfe4399a0ea9862ec3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 19:23:12 +0200 Subject: [PATCH 306/710] [translation] Fix src/common/trace.cpp comments (chunk 3/3) (#680) --- src/common/trace.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/common/trace.cpp b/src/common/trace.cpp index d353af0b1..5bcf286a4 100644 --- a/src/common/trace.cpp +++ b/src/common/trace.cpp @@ -1069,19 +1069,19 @@ C__Trace::SendMessageToServer(C__MessageType type, BOOL crash) CloseWritePipeAndSemaphore(); } } - // jen je-li crash==TRUE: - // vyrobime kopii dat, start threadu pro msgbox totiz muze vyvolat dalsi TRACE - // hlasky (napr. v DllMain reakce na DLL_THREAD_ATTACH), pokud bysme neopustili - // CriticalSection, nastal by deadlock; - // v DllMain se nesmi pouzivat TRACE_C, jinak dojde k deadlocku: - // - pokud se da do DLL_THREAD_ATTACH: chce si otevrit novy thread pro msgbox - // a to je z DllMainu blokovane - // - pokud se da do DLL_THREAD_DETACH: pri cekani na zavreni threadu s msgboxem - // predesleho TRACE_C zachytime TRACE_C z DLL_THREAD_DETACH a nechame ho - // cekat v nekonecnem cyklu, viz nize - // navic zavadime obranu proti mnozeni msgboxu pri vice TRACE_C zaroven, pusobilo - // by to jen zmatky, ted se otevre msgbox jen pro prvni a ten po uzavreni vyvola - // padacku, ostatni TRACE_C zustanou chyceny v nekonecne cekaji smycce, viz nize + // only if crash==TRUE: + // make a copy of the data, because starting the msgbox thread can trigger more TRACE + // messages (for example, DllMain reacting to DLL_THREAD_ATTACH); if we did not leave + // the CriticalSection, a deadlock would occur; + // TRACE_C must not be used in DllMain, otherwise a deadlock occurs: + // - if TRACE_C is used in DLL_THREAD_ATTACH: it tries to open a new thread for the msgbox + // and DllMain blocks that + // - if TRACE_C is used in DLL_THREAD_DETACH: while waiting for the msgbox thread of the + // previous TRACE_C to close, we catch TRACE_C from DLL_THREAD_DETACH and leave it + // waiting in an infinite loop, see below + // in addition, we guard against multiple msgboxes when several TRACE_C occur at once; + // that would only cause confusion, so now a msgbox is opened only for the first one and it + // triggers a crash after it closes; the other TRACE_C remain stuck in an infinite waiting loop, see below static BOOL msgBoxOpened = FALSE; C__TraceMsgBoxThreadData threadData; C__TraceMsgBoxThreadDataW threadDataW; @@ -1136,7 +1136,7 @@ C__Trace::SendMessageToServer(C__MessageType type, BOOL crash) unicode ? (void*)&threadDataW : (void*)&threadData, 0, &id); if (msgBoxThread != NULL) { - WaitForSingleObject(msgBoxThread, INFINITE); // pokud se da TRACE_C do DllMain do DLL_THREAD_ATTACH, dojde k deadlocku - silne nepravdepodobne, neresime + WaitForSingleObject(msgBoxThread, INFINITE); // if TRACE_C is used in DllMain during DLL_THREAD_ATTACH, a deadlock occurs - very unlikely, we do not handle it CloseHandle(msgBoxThread); } msgBoxOpened = FALSE; @@ -1146,7 +1146,7 @@ C__Trace::SendMessageToServer(C__MessageType type, BOOL crash) // after this method finishes } else // block other threads with TRACE_C until the msgbox opened for - { // the first TRACE_C is closed; it will crash there too, to keep things tidy + { // the first TRACE_C closes; then the first TRACE_C crashes there too, to avoid confusion if (msgBoxOpened) { while (1) From 99274e6fc2bbd5380e52b11ce067be6a9c82d0be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 19:23:15 +0200 Subject: [PATCH 307/710] [translation] Fix src/common/sheets.h comments (#681) --- src/common/sheets.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/sheets.h b/src/common/sheets.h index d24f7fdbf..744c3c723 100644 --- a/src/common/sheets.h +++ b/src/common/sheets.h @@ -120,7 +120,7 @@ class CPropertyDialog : public TIndirectArray virtual int GetCurSel(); protected: - HWND Parent; // parametry pro vytvareni dialogu + HWND Parent; // dialog creation parameters HWND HWindow; HINSTANCE Modul; HICON Icon; @@ -129,7 +129,7 @@ class CPropertyDialog : public TIndirectArray DWORD Flags; PFNPROPSHEETCALLBACK Callback; - DWORD* LastPage; // posledni zvolena stranka (muze byt NULL, pokud nezajima) + DWORD* LastPage; // last selected page (may be NULL if not needed) friend class CPropSheetPage; }; From de53d8bbf3f8ada8cf2b3431e8b6ecb1b6025bfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 19:23:18 +0200 Subject: [PATCH 308/710] [translation] Fix src/common/winlib.cpp comments (chunk 1/2) (#682) --- src/common/winlib.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/common/winlib.cpp b/src/common/winlib.cpp index 970d01eb4..622d8c067 100644 --- a/src/common/winlib.cpp +++ b/src/common/winlib.cpp @@ -111,12 +111,11 @@ BOOL WinLibIsWindowsVersionOrGreater(WORD wMajorVersion, WORD wMinorVersion, WOR return VerifyVersionInfoW(&osvi, VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR, dwlConditionMask) != FALSE; } -// // **************************************************************************** // CWindow // -// lpvParam - v pripade, ze se pri CreateWindow zavola CWindow::CWindowProc -// (je v tride okna), musi obsahovat adresu objektu vytvareneho okna +// lpvParam - if CWindow::CWindowProc is called during CreateWindow +// (it is in the window class), it must contain the address of the window object being created HWND CWindow::CreateEx(DWORD dwExStyle, // extended window style LPCTSTR lpszClassName, // address of registered class name @@ -329,7 +328,7 @@ CWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) return TRUE; } if (GetWindowLongPtr(HWindow, GWL_STYLE) & WS_CHILD) - break; // pokud F1 nezpracujeme a pokud je to child okno, nechame F1 propadnout do parenta + break; // if we do not handle F1 and this is a child window, let F1 fall through to the parent return TRUE; // if it is not a child, stop processing F1 } } From 7c1bc5ae59d5a606e79d2b20af168c6695088b0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 19:23:22 +0200 Subject: [PATCH 309/710] [translation] Fix src/common/winlib.cpp comments (chunk 2/2) (#683) --- src/common/winlib.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/common/winlib.cpp b/src/common/winlib.cpp index 622d8c067..c259383fb 100644 --- a/src/common/winlib.cpp +++ b/src/common/winlib.cpp @@ -401,8 +401,8 @@ CWindow::CWindowProcInt(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL #endif // _UNICODE if (wnd != NULL && wnd->Is(otWindow)) { - // Petr: posunul jsem dolu pod wnd->WindowProc(), aby behem WM_DESTROY - // jeste dochazely zpravy (potreboval Lukas) + // Petr: moved this below wnd->WindowProc() so messages are still delivered during WM_DESTROY + // (Lukas needed this) // WindowsManager.DetachWindow(hwnd); LRESULT res = wnd->WindowProc(uMsg, wParam, lParam); @@ -410,8 +410,8 @@ CWindow::CWindowProcInt(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL // now back to the old procedure again (because of subclassing) WindowsManager.DetachWindow(hwnd); - // pokud aktualni WndProc je jina nez nase, nebudeme ji menit, - // protoze nekdo v rade subclasseni uz vratil puvodni WndProc + // if the current WndProc is different from ours, do not change it, + // because someone else in the subclass chain has already restored the original WndProc #ifdef _UNICODE WNDPROC currentWndProc = (WNDPROC)GetWindowLongPtr(wnd->HWindow, GWLP_WNDPROC); if (currentWndProc == CWindow::CWindowProc) @@ -734,8 +734,8 @@ CDialog::CDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) INT_PTR ret = FALSE; // in case the dialog does not handle it if (dlg != NULL && dlg->Is(otDialog)) { - // Petr: posunul jsem dolu pod dlg->DialogProc(), aby behem WM_DESTROY - // jeste dochazely zpravy (potreboval Lukas) + // Petr: moved this below dlg->DialogProc() so messages are still delivered during WM_DESTROY + // (Lukas needed this) // WindowsManager.DetachWindow(hwndDlg); ret = dlg->DialogProc(uMsg, wParam, lParam); @@ -849,7 +849,7 @@ void CWindowsManager::DetachWindow(HWND hWnd) { ResetState(); TRACE_ET(_T("Unable to detach window from WindowsManager. hwnd = ") << hWnd); - At(i).Wnd = NULL; // alespon takhle ... + At(i).Wnd = NULL; // at least this way... } } else @@ -1139,7 +1139,7 @@ void CTransferInfo::EditLine(int ctrlID, double& value, TCHAR* format, BOOL sele if (*s == 0) { TCHAR* stopString; // dummy - value = _tcstod(buff, &stopString); // jen pokud je cislo + value = _tcstod(buff, &stopString); // only if the string is a number } else value = 0; // on error, set zero From 7473aeef6fe0f95bbd69daf8083a7f53890f9721 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 19:23:25 +0200 Subject: [PATCH 310/710] [translation] Fix src/common/str.h comments (#684) --- src/common/str.h | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/common/str.h b/src/common/str.h index dc64a630a..d99c2f1b6 100644 --- a/src/common/str.h +++ b/src/common/str.h @@ -7,18 +7,18 @@ //***************************************************************************** // // 20.1.2003 -// Poznamka k optimalizacim prevodem do ASM: optimalizace se projevi predevsim -// u porovnani shodnych retezcu, tedy da-li se funkcim prilezitost k prohledavat -// retezce cele. Navic je optimalizace znatelnejsi na starsich procesorech, kde -// ASM varianty dokazou pracovat 8x rychleji (stara pentia). // -// Moderni procesory (AMD Athlon, Pentium Pro) dokazou optimalizovanou C++ -// variantu vykonat temer stejne rychle jako jeji ASM variantu. Protoze ale -// zatim nejsou optimalizovane C++ varianty rychlejsi a ASM je mnohem rychlejsi -// nez debug C++ varianta, pouzivame ASM varianty. +// Note on optimizations by converting to ASM: the benefit shows up mainly +// when comparing identical strings, that is, when the functions get a chance to scan +// entire strings. The optimization is also more noticeable on older processors, +//where the ASM variants can run up to 8x faster (old Pentiums). // -// Funkce StrNICmp v C++ na Pentiu Pro beha rychleji nez v ASM varianta. +// Modern processors (AMD Athlon, Pentium Pro) can execute the optimized C++ +// variant almost as fast as its ASM variant. Because the optimized C++ variants +// are not faster yet, and ASM is much faster than the debug C++ variant, we use +//the ASM variants. // +//The C++ version of StrNICmp runs faster on Pentium Pro than the ASM variant. extern BYTE LowerCase[256]; // maps all characters to lowercase; generated using the CharLower API extern BYTE UpperCase[256]; // maps all characters to uppercase; generated using the CharUpper API @@ -150,8 +150,8 @@ int MemICmp(const void* buf1, const void* buf2, int n); // copies the text into newly allocated memory; returns NULL on out-of-memory char* DupStr(const char* txt); -// nakopiruje text do nove naalokovaneho prostoru, NULL = malo pameti, -// navic pri nedostatku pameti nastavi 'err' na TRUE +// copies the text into newly allocated memory; returns NULL on out-of-memory, +// and also sets 'err' to TRUE on out-of-memory char* DupStrEx(const char* str, BOOL& err); // returns the first case-insensitive occurrence of 'pattern' in 'txt', or NULL @@ -184,11 +184,12 @@ class CConvertTab extern CConvertTab ConvertTab; */ -//***************************************************************************** +// ***************************************************************************** // // SWPrintFToEnd_s // -// jedina odlisnost od swprintf_s je, ze zapisuje az za text umisteny v bufferu +// The only difference from swprintf_s is that it writes after the text already +// stored in the buffer template inline int SWPrintFToEnd_s(WCHAR (&_Dst)[_Size], const WCHAR* _Format, ...) @@ -207,11 +208,12 @@ inline int SWPrintFToEnd_s(WCHAR* _Dst, size_t _SizeInWords, const WCHAR* _Forma return vswprintf_s(_Dst + len, _SizeInWords - len, _Format, _ArgList); } -//***************************************************************************** +// ***************************************************************************** // // SPrintFToEnd_s // -// jedina odlisnost od swprintf_s je, ze zapisuje az za text umisteny v bufferu +// The only difference from sprintf_s is that it writes after the text already +// stored in the buffer template inline int SPrintFToEnd_s(char (&_Dst)[_Size], const char* _Format, ...) From 0e0065b0d9d9f44a26c6de3d8b5918174ca92bb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 19:23:28 +0200 Subject: [PATCH 311/710] [translation] Fix src/common/regexp.h comments (#685) --- src/common/regexp.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/common/regexp.h b/src/common/regexp.h index dc46ebd21..03337fcaa 100644 --- a/src/common/regexp.h +++ b/src/common/regexp.h @@ -7,7 +7,7 @@ //***************************************************************************** //***************************************************************************** // -// puvodni regexp.h +// original regexp.h // //***************************************************************************** //***************************************************************************** @@ -37,7 +37,7 @@ void regerror(const char* error); //***************************************************************************** //***************************************************************************** // -// moje cast regexp.h +// my section of regexp.h // //***************************************************************************** //***************************************************************************** @@ -123,11 +123,11 @@ class CRegularExpression int SearchForward(int start, int& foundLen); int SearchBackward(int length, int& foundLen); - // nahradi promnene \1 ... \9 textem zachycenym odpovidajicima zavorkama - // 'pattern' je vzor kterym se nahrazuje nalezeny match, 'buffer' buffer - // pro vystup, 'bufSize' maximalni velikost textu vcetne ukoncovaciho NULL - // znaku, v promnene 'count' vraci pocet znaku zkopirovanych do bufferu - // vraci TRUE pokud se vyraz vesel cely do bufferu + // Replaces variables \1 ... \9 with the text captured by the corresponding groups. + // 'pattern' is the replacement pattern for the matched text, 'buffer' is the output + // buffer, 'bufSize' is the maximum buffer size including the terminating NULL + // character, and 'count' receives the number of characters copied to 'buffer' + // Returns TRUE if the entire expanded text fit in 'buffer' BOOL ExpandVariables(char* pattern, char* buffer, int bufSize, int* count); @@ -140,8 +140,8 @@ class CRegularExpression char* buffer, int bufSize); protected: - // Obraci regularni vyraz - pro hledani od zadu - // VYRAZ MUSI BYT SYNTAKTICKY SPRAVNY ! JINAK NEFUNGUJE SPRAVNE ! - // napr. "a)b(d)(" -> "((d)b)a" coz je chybne + // Reverses the regular expression for backward search. + // THE EXPRESSION MUST BE SYNTACTICALLY CORRECT, OR IT WILL NOT WORK PROPERLY! + // e.g. "a)b(d)(" -> "((d)b)a", which is incorrect void ReverseRegExp(char*& dstExpEnd, char* srcExp, char* srcExpEnd); }; From 0794abd3f30356072dbd2d7c71d93c52257ffc78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 19:23:31 +0200 Subject: [PATCH 312/710] [translation] Fix src/common/winlib.h comments (chunk 2/2) (#686) --- src/common/winlib.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/winlib.h b/src/common/winlib.h index c06afd13d..81d124874 100644 --- a/src/common/winlib.h +++ b/src/common/winlib.h @@ -389,9 +389,9 @@ class CDialog : public CWindowsObject struct CWindowData { - // pokud jsou objekty oken (Wnd) umistene na stacku (typicky modalni dialogy, napr. SalMessageBox()) - // a dojde k terminovani threadu, stack se zneplatni a tim jiz objekty oken nejsou pristupne, - // resime tak, ze na objekty (Wnd) sahame jen dokud jsou platne handly oken (HWnd) + // if window objects (Wnd) are allocated on the stack (typically modal dialogs, e.g. SalMessageBox()) + // and the thread terminates, the stack becomes invalid and the window objects are no longer accessible, + // so we only access the objects (Wnd) while the window handles (HWnd) are still valid HWND HWnd; CWindowsObject* Wnd; }; From 939de6c86e8fe04c9def40a787b478a10f601082 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 19:23:34 +0200 Subject: [PATCH 313/710] [translation] Fix src/common/strutils.cpp comments (#687) --- src/common/strutils.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/common/strutils.cpp b/src/common/strutils.cpp index c2778924f..3e209ea7a 100644 --- a/src/common/strutils.cpp +++ b/src/common/strutils.cpp @@ -291,7 +291,7 @@ LPTSTR FindString( // Return value: pointer to matched substring of text, or nul res = ConvertU2A(s1 = L"ahoj", 4, buf, 4, TRUE); res = ConvertU2A(s1 = L"ahoj", 4, buf, 3, TRUE); res = ConvertU2A(s1 = L"D:\\\x0061\x0308", -1, buf, 10, TRUE); // L"D:\\\x00e4" - res = ConvertU2A(s2 = L"D:\\á", -1, buf, 4); + res = ConvertU2A(s2 = L"D:\\\x00e1", -1, buf, 4); res = ConvertU2A(s1 = L"D:\\\xfb01-\x0061\x0308-\x00e4.txt", -1, buf, 10, TRUE); res = ConvertU2A(s2 = L"fi", -1, buf, 4); @@ -299,24 +299,24 @@ LPTSTR FindString( // Return value: pointer to matched substring of text, or nul WCHAR *f = FindString(LOCALE_USER_DEFAULT, 0, s1, -1, L"fi", -1, &fLen); f = FindString(LOCALE_USER_DEFAULT, 0, s1, -1, L"f", -1, &fLen); f = FindString(LOCALE_USER_DEFAULT, 0, s1, -1, L"\x00e4", -1, &fLen); - f = FindString(LOCALE_USER_DEFAULT, 0, s1, -1, L"a", -1, &fLen); // NEFUNGUJE !!! + f = FindString(LOCALE_USER_DEFAULT, 0, s1, -1, L"a", -1, &fLen); // DOES NOT WORK !!! WCHAR *ss = wcsstr(s1, L"\x00e4"); / * -procist X:\ZUMPA\!\unicode\ch05.pdf - jak vubec ma vypadat to hledani v Unicode ??? +Read X:\ZUMPA\!\unicode\ch05.pdf - what should Unicode searching actually look like? -Nekam odswapnout + casem proverit + odladit: +Move this elsewhere, then verify and debug it later: Some time ago I implemented a FindString function which in most cases takes only O(n) time (around 1.5*n CompareString calls most of which return immediately). In the end I didn't use it because I wasn't sure whether the relevant statement in the CompareString documentation can be relied on in a strict sense: "If the two strings are of different lengths, they are compared up to the length of the shortest one. If they are equal to that point, then the return value will indicate that the longer string is greater." More specifically, the function fails for TCHAR strings that are lexically -before any of their substrings (from the beginning). For example, when looking for "á" = {U+00E1}, the function will not -find the "a?" = {U+0061, U+0301} representation, if it sorts before "a" = {U+0061} in the specified locale. In other -words: The function assumes that CompareString(lcid, flags, string, m, string, n never returns CSTR_GREATER_THAN if +before any of their substrings (from the beginning). For example, when looking for the precomposed U+00E1 form, the function will not +find the U+0061 U+0301 representation if it sorts before U+0061 in the specified locale. In other +words: The function assumes that CompareString(lcid, flags, string, m, string, n) never returns CSTR_GREATER_THAN if m <= n and the strings agree in the first m TCHARs. -Mozna by se hodilo pouzit "StringInfo Class", ktery umi rozebrat retezec -na zobrazitelne znaky (sekvence WCHARu odpovidajici jednomu zobrazenemu znaku). +It might be useful to use the "StringInfo Class", which can split a string +into display characters (a sequence of WCHARs corresponding to one displayed character). * / @@ -330,7 +330,7 @@ na zobrazitelne znaky (sekvence WCHARu odpovidajici jednomu zobrazenemu znaku). res = CompareString(LOCALE_USER_DEFAULT, 0, s1, -1, s2, -1); - res = ConvertA2U("ÂëŕäÄÄ›ÄÄ‘", -1, wbuf, 10, 1251); + res = ConvertA2U("sample CP1251 text", -1, wbuf, 10, 1251); res = ConvertA2U("ahoj", 0, wbuf, 10); res = ConvertA2U("ahoj", -1, wbuf, 5); res = ConvertA2U("ahoj", -1, wbuf, 4); @@ -352,10 +352,10 @@ na zobrazitelne znaky (sekvence WCHARu odpovidajici jednomu zobrazenemu znaku). res = ConvertU2A(L"D:\\\xfb01-\x0061\x0308-\x00e4.txt", -1, TRUE); WCHAR *wres; - wres = ConvertA2U("ÂëŕäÄÄ›ÄÄ‘", -1, 1251); + wres = ConvertA2U("sample CP1251 text", -1, 1251); wres = ConvertA2U("", -1); - wres = ConvertA2U("ahoj Äěšťíňká", 0); - wres = ConvertA2U("ahoj Äěšťíňká", 2); - wres = ConvertA2U("ahoj Äěšťíňká", -1); + wres = ConvertA2U("hello with accents", 0); + wres = ConvertA2U("hello with accents", 2); + wres = ConvertA2U("hello with accents", -1); } */ From 4af442924cc0f59378d683f0216f7022b38a6459 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 19:23:37 +0200 Subject: [PATCH 314/710] [translation] Fix src/common/messages.h comments (#688) --- src/common/messages.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/messages.h b/src/common/messages.h index b49b0e878..b8d7d8ec2 100644 --- a/src/common/messages.h +++ b/src/common/messages.h @@ -319,7 +319,7 @@ inline int __MessagesEmptyFunction() { return 0; } #define EnterMessagesModul() __MessagesEmptyFunction() #define LeaveMessagesModul() __MessagesEmptyFunction() -/* tyhle funkce musi hlasit kompilacni chybu +/* These functions must trigger a compile-time error const char *rsc(int resID); const WCHAR *rscW(int resID); const char *spf(const char *formatString, ...); From 71392e11ab87d2a7520583740f1a2d883548f4fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 19:23:41 +0200 Subject: [PATCH 315/710] [translation] Fix src/common/trace.h comments (#689) --- src/common/trace.h | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/common/trace.h b/src/common/trace.h index 456a77983..843987a00 100644 --- a/src/common/trace.h +++ b/src/common/trace.h @@ -14,9 +14,9 @@ // TRACE module is ready for multi-threaded applications -// POZOR: TRACE_C se nesmi pouzivat v DllMain knihoven, ani v zadnem kodu, ktery -// se z DllMainu vola, jinak dojde k deadlocku, vice viz implementace -// C__Trace::SendMessageToServer +// WARNING: TRACE_C must not be used in a library's DllMain, or in any code that +// is called from DllMain, otherwise a deadlock will occur; see the +// implementation of C__Trace::SendMessageToServer #if defined(__TRACESERVER) || defined(TRACE_ENABLE) @@ -381,7 +381,7 @@ struct C__ClientServerInitData // // CPipeDataHeader // -// pomoci teto struktury komunikuje client se serverem pres pipu +// This structure is used by the client and server to communicate through the pipe // For Type == __mtInformation || Type == __mtError // the variables have the following meanings: @@ -389,7 +389,7 @@ struct C__PipeDataHeader { int Type; // message type (C__MessageType) DWORD ThreadID; // thread ID for additional identification - DWORD UniqueThreadID; // unikatni cislo threadu (systemove ID se opakuji) + DWORD UniqueThreadID; // unique thread number (system IDs are reused) SYSTEMTIME Time; // message creation time DWORD MessageSize; // length of the buffer needed to receive the text DWORD MessageTextOffset; // offset of the text in the buffer shared with the file name @@ -432,14 +432,14 @@ inline void __TraceEmptyFunction() {} #define TRACE_MEW(file, line, str) __TraceEmptyFunction() #define TRACE_E(str) __TraceEmptyFunction() #define TRACE_EW(str) __TraceEmptyFunction() -// pri crashi softu pres DebugBreak() nejde vystopovat, kde lezi volani -// TRACE_C/TRACE_MC, protoze adresa exceptiony je kdesi v ntdll.dll -// a sekce Stack Back Trace bug reportu muze obsahovat nesmysly, pokud -// funkce volajici TRACE_C/TRACE_MC nepouziva stary jednoduchy model -// ukladani a prace s EBP/ESP, ovsem i v tom pripade je zde jen adresa -// odkud byla tato funkce volana (ne primo adresa TRACE_C/TRACE_MC), -// proto aspon prozatim pouzivame stary primitivni zpusob crashe -// zapisem na NULL +// when the program crashes through DebugBreak(), it is impossible to trace where +// TRACE_C/TRACE_MC was called, because the exception address ends up somewhere in ntdll.dll, +// and the Stack Back Trace section of the bug report may contain nonsense if +// the function calling TRACE_C/TRACE_MC does not use the old simple model for +// saving and using EBP/ESP; even then, only the address from which +// that function was called is available (not the TRACE_C/TRACE_MC address itself), +// so at least for now we use the old primitive way of crashing +// by writing to NULL //#define TRACE_MC(file, line, str) DebugBreak() //#define TRACE_MCW(file, line, str) DebugBreak() //#define TRACE_C(str) DebugBreak() @@ -522,14 +522,14 @@ uintptr_t __TRACE_beginthreadex(void* security, unsigned stack_size, #define TRACE_E(str) TRACE_ME(__FILE__, __LINE__, str) #define TRACE_EW(str) TRACE_MEW(__WFILE__, __LINE__, str) -// fatal-error-trace (CRASHING TRACE), manually specified file position; -// stop the program in the debugger to simplify debugging of the problem that just occurred; -// the release build crashes and the problem will hopefully be clear from the call stack in the bug report; -// we do not use DebugBreak(), because when the program crashes it is impossible to trace where -// DebugBreak() was called: the exception address ends up somewhere in ntdll.dll, +// fatal-error-trace (CRASHING TRACE), manually specified file location; +// stop the program in the debugger to make the problem that just occurred easier to debug; +// the release build crashes, and the problem will hopefully be clear from the call stack in the bug report; +// we do not use DebugBreak(), because when the program crashes through DebugBreak(), it is impossible to trace where +// TRACE_C/MC was called: the exception address ends up somewhere in ntdll.dll, // and the Stack Back Trace section of the bug report may contain nonsense if -// the function from which TRACE_C/MC is called does not use the old simple model for -// saving and using EBP/ESP (depending on the compiler and enabled optimizations), so +// the function that calls TRACE_C/MC does not use the old simple model for +// saving and using EBP/ESP (this depends on the compiler and enabled optimizations), so // at least for now we use the old primitive way of crashing by writing to NULL #define TRACE_MC(file, line, str) \ ((::EnterCriticalSection(&__Trace.CriticalSection), __Trace.StoreLastError(), \ @@ -622,7 +622,7 @@ class C__Trace HANDLE HTraceFile; // file opened for writing in TEMP; all messages are stored there #ifdef __TRACESERVER WCHAR TraceFileName[MAX_PATH]; // HTraceFile file name -#endif // __TRACESERVER +#endif // TRACE_TO_FILE #endif // TRACE_TO_FILE LARGE_INTEGER StartPerformanceCounter; // initial value of the high-resolution counter From e3e0d3d542ce35030e1bf35a34b32725dc72efb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 19:23:44 +0200 Subject: [PATCH 316/710] [translation] Fix src/common/strutils.h comments (#690) --- src/common/strutils.h | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/common/strutils.h b/src/common/strutils.h index ae9da8615..3e82316e6 100644 --- a/src/common/strutils.h +++ b/src/common/strutils.h @@ -6,25 +6,25 @@ // The SAFE_ALLOC macro removes the code that checks whether memory allocation succeeded (see allochan.*) -// prevod Unicodoveho stringu (UTF-16) na ANSI multibytovy string; 'src' je Unicodovy string; -// 'srcLen' je delka Unicodoveho stringu (bez zakoncujici nuly; pri zadani -1 se delka urci -// podle zakoncujici nuly); 'bufSize' (musi byt vetsi nez 0) je velikost ciloveho bufferu +// Converts a Unicode (UTF-16) string to an ANSI multibyte string; 'src' is the Unicode string; +// 'srcLen' is the length of the Unicode string (excluding the terminating null; if -1 is passed, +// the length is determined from the terminating null); 'bufSize' (must be greater than 0) is the size of the destination buffer // 'buf' pro ANSI string; je-li 'compositeCheck' TRUE, pouziva flag WC_COMPOSITECHECK -// (viz MSDN), nesmi se pouzit pro jmena souboru (NTFS rozlisuje jmena zapsana jako -// precomposed a composite, aneb neprovadi normalizaci jmen); 'codepage' je kodova stranka +// (see MSDN); it must not be used for file names (NTFS distinguishes between names written as +// precomposed and composite, i.e. it does not normalize names); 'codepage' is the code page of the // ANSI stringu; vraci pocet znaku zapsanych do 'buf' (vcetne zakoncujici nuly); pri chybe -// vraci nulu (detaily viz GetLastError()); vzdy zajisti nulou zakonceny 'buf' (i pri chybe); -// je-li 'buf' maly, vraci funkce nulu, ale v 'buf' je prevedena aspon cast stringu +// returns 0 (see GetLastError()); always ensures 'buf' is null-terminated (even on error); +// if 'buf' is too small, the function returns 0, but at least part of the string is converted into 'buf' int ConvertU2A(const WCHAR* src, int srcLen, char* buf, int bufSize, BOOL compositeCheck = FALSE, UINT codepage = CP_ACP); -// prevod Unicodoveho stringu (UTF-16) na alokovany ANSI multibytovy string (volajici je -// odpovedny za dealokaci stringu); 'src' je Unicodovy string; 'srcLen' je delka Unicodoveho -// stringu (bez zakoncujici nuly; pri zadani -1 se delka urci podle zakoncujici nuly); -// je-li 'compositeCheck' TRUE, pouziva flag WC_COMPOSITECHECK (viz MSDN), nesmi se pouzit -// pro jmena souboru (NTFS rozlisuje jmena zapsana jako precomposed a composite, aneb -// neprovadi normalizaci jmen); 'codepage' je kodova stranka ANSI stringu; vraci alokovany -// ANSI string; pri chybe vraci NULL (detaily viz GetLastError()) +// Converts a Unicode (UTF-16) string to an allocated ANSI multibyte string (the caller is +// responsible for freeing the string); 'src' is the Unicode string; 'srcLen' is the length of the Unicode +// string (excluding the terminating null; if -1 is passed, the length is determined from the terminating null); +// if 'compositeCheck' is TRUE, the WC_COMPOSITECHECK flag is used (see MSDN); it must not be used +// for file names (NTFS distinguishes between names written as precomposed and composite, i.e. +// it does not normalize names); 'codepage' is the code page of the ANSI string; returns the allocated +// ANSI string; on error returns NULL (see GetLastError()) char* ConvertAllocU2A(const WCHAR* src, int srcLen, BOOL compositeCheck = FALSE, UINT codepage = CP_ACP); // Converts an ANSI multibyte string to a Unicode (UTF-16) string; 'src' is the ANSI string; @@ -37,15 +37,15 @@ char* ConvertAllocU2A(const WCHAR* src, int srcLen, BOOL compositeCheck = FALSE, int ConvertA2U(const char* src, int srcLen, WCHAR* buf, int bufSizeInChars, UINT codepage = CP_ACP); -// prevod ANSI multibytoveho stringu na alokovany (volajici je odpovedny za dealokaci -// stringu) Unicodovy string (UTF-16); 'src' je ANSI string; 'srcLen' je delka ANSI -// stringu (bez zakoncujici nuly; pri zadani -1 se delka urci podle zakoncujici nuly); -// 'codepage' je kodova stranka ANSI stringu; vraci alokovany Unicodovy string; pri -// chybe vraci NULL (detaily viz GetLastError()) +// Converts an ANSI multibyte string to an allocated Unicode (UTF-16) string (the caller is responsible for freeing +// the string); 'src' is the ANSI string; 'srcLen' is the length of the ANSI +// string (excluding the terminating null; if -1 is passed, the length is determined from the terminating null); +// 'codepage' is the code page of the ANSI string; returns the allocated Unicode string; on +// error returns NULL (see GetLastError()) WCHAR* ConvertAllocA2U(const char* src, int srcLen, UINT codepage = CP_ACP); -// nakopiruje string 'txt' do nove naalokovaneho stringu, NULL = malo pameti (hrozi jen pokud -// se nepouziva allochan.*) nebo 'txt'==NULL +// Copies 'txt' into a newly allocated string; returns NULL on out of memory (only possible when +// allochan.* is not used) or if 'txt'==NULL WCHAR* DupStr(const WCHAR* txt); // Holds a pointer to allocated memory and frees it when overwritten by another pointer to allocated memory From 01de4ed538a95297d7c680c5f63fc1e6ac68c3c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 20:22:30 +0200 Subject: [PATCH 317/710] [translation] Fix src/common/dep/crypt/fileenc.h comments (#703) --- src/common/dep/crypt/fileenc.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/common/dep/crypt/fileenc.h b/src/common/dep/crypt/fileenc.h index 413afeb27..3664cff3b 100644 --- a/src/common/dep/crypt/fileenc.h +++ b/src/common/dep/crypt/fileenc.h @@ -36,13 +36,13 @@ */ /* - Pouziti knihovny viz napriklad popis implementace AES do WinZIP - AES Encryption Information: Encryption Specification AE-1 and AE-2 - http://www.winzip.com/aes_info.htm - - Pripadne text autora knihovny (Brian Gladman): - http://www.gladman.me.uk/cryptography_technology/fileencrypt/ -*/ + * For an example of how to use the library, see the description of the AES implementation in WinZIP + * AES Encryption Information: Encryption Specification AE-1 and AE-2 + * http://www.winzip.com/aes_info.htm + * + * See also the library author's notes (Brian Gladman): + * http://www.gladman.me.uk/cryptography_technology/fileencrypt/ + */ #ifndef _FENC_H #define _FENC_H From a81f16092be60f109466b7c951e3b08b5177bbed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 20:23:36 +0200 Subject: [PATCH 318/710] [translation] Fix src/common/winlib.h comments (#702) --- src/common/winlib.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/winlib.h b/src/common/winlib.h index 81d124874..836fc302f 100644 --- a/src/common/winlib.h +++ b/src/common/winlib.h @@ -122,8 +122,8 @@ class CWindowsObject // base class of all MS-Windows objects protected: CObjectOrigin ObjectOrigin; #ifndef _UNICODE - // okna: create: TRUE = okno je unicodove, jinak je ANSI; attach: TRUE = nase window procedura - // je unicodova, jinak je ANSI; dialogy: TRUE = dialog je unicodovy, jinak je ANSI + // windows: create: TRUE = the window is Unicode, otherwise ANSI; attach: TRUE = our window procedure + // is Unicode, otherwise ANSI; dialogs: TRUE = the dialog is Unicode, otherwise ANSI BOOL UnicodeWnd; #endif // _UNICODE }; From 416a4a150517d1d29d5bca8e3efc893b597bde32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 20:24:04 +0200 Subject: [PATCH 319/710] [translation] Fix src/common/trace.cpp comments (#701) --- src/common/trace.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/trace.cpp b/src/common/trace.cpp index 5bcf286a4..c7ed5dc41 100644 --- a/src/common/trace.cpp +++ b/src/common/trace.cpp @@ -242,7 +242,7 @@ BOOL C__TraceThreadCache::Add(HANDLE handle, DWORD tid) DWORD C__TraceThreadCache::GetUniqueThreadId(DWORD tid) { - if (CacheUID[__TraceCacheGetIndex(tid)] != -1 && // je-li platny zaznam + if (CacheUID[__TraceCacheGetIndex(tid)] != -1 && // valid entry CacheTID[__TraceCacheGetIndex(tid)] == tid) // and the TID matches { return CacheUID[__TraceCacheGetIndex(tid)]; // UID is in the cache From 83ed1e5110022a7002dbfbf371c6ff670d33b489 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 20:24:23 +0200 Subject: [PATCH 320/710] [translation] Fix src/common/trace.h comments (#699) From 263ed9f98c0de46b22cbde83f27f69569c5890b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 20:24:46 +0200 Subject: [PATCH 321/710] [translation] Fix src/common/sheets.h comments (#695) From d106b07dfb4d8ed5b7fb734e3aec3c018c60d83a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Thu, 16 Apr 2026 20:25:04 +0200 Subject: [PATCH 322/710] [translation] Fix src/common/strutils.h comments (#694) From 418aefe56166719dc68cb4e06977f7b04122e65b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 03:29:46 +0200 Subject: [PATCH 323/710] [translation] Fix src/plugins/shared/arraylt.h comments (#692) --- src/plugins/shared/arraylt.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/plugins/shared/arraylt.h b/src/plugins/shared/arraylt.h index 2f44ac951..d2ee89d12 100644 --- a/src/plugins/shared/arraylt.h +++ b/src/plugins/shared/arraylt.h @@ -14,8 +14,8 @@ #pragma once -// Use the _DEBUG or __ARRAY_DEBUG defines to enable various error state checking. Errors -// are displayed using TRACE_E and TRACE_C macros. +// Use the _DEBUG or __ARRAY_DEBUG defines to enable various error-state checks. Errors +// are displayed using the TRACE_E and TRACE_C macros. // We need to make this module independent of the TRACE macros, so if they are not defined, we provide dummy definitions. Error reporting will of course not work in that case. #if !defined(TRACE_I) && !defined(TRACE_E) && !defined(TRACE_C) @@ -40,8 +40,8 @@ enum CDeleteType enum CErrorType { etNone, // OK - etLowMemory, // new - NULL - etUnknownIndex, // index is out of array range + etLowMemory, // new returned NULL + etUnknownIndex, // index is out of range for the array etBadInsert, // index of inserted item is out of array range etDestructed, // array was already destructed using Destroy() method }; @@ -80,10 +80,10 @@ class TDirectArray } void Insert(int index, const DATA_TYPE& member); - int Add(const DATA_TYPE& member); // adds item to the end of array, returns item index + int Add(const DATA_TYPE& member); // adds an item to the end of the array; returns its index - void Insert(int index, const DATA_TYPE* members, int count); // insert 'count' of 'members' items - int Add(const DATA_TYPE* members, int count); // add 'count' of 'members' items + void Insert(int index, const DATA_TYPE* members, int count); // insert 'count' items from 'members' + int Add(const DATA_TYPE* members, int count); // adds 'count' items from 'members' DATA_TYPE& At(int index) // returns pointer to item at 'index' possition { @@ -131,12 +131,12 @@ class TDirectArray void DestroyMembers(); // release items from memory (calling destructors), keep array void DetachMembers(); // detach all items (destructors are NOT called), keep array void Destroy(); // complete array destruction (calling destructors) - void Delete(int index); // delete item at 'index' possition (calling destructor), move remaining items - void Delete(int index, int count); // delete 'count' of items at 'index' possition (calling destructors), move remaining items - void Detach(int index); // detach item at 'index' possition (destructor is NOT called), move remaining items - void Detach(int index, int count); // detach 'count' of items at 'index' possition (destructors are NOT called), move remaining items + void Delete(int index); // delete the item at 'index' (calling the destructor), move remaining items + void Delete(int index, int count); // delete 'count' items at 'index' position (calling destructors), move remaining items + void Detach(int index); // detach item at 'index' position (destructor is NOT called), move remaining items + void Detach(int index, int count); // detach 'count' items at 'index' position (destructors are NOT called), move remaining items - int SetDelta(int delta); // change 'Delta', return real used value; NOTE: can be used only for empty array + int SetDelta(int delta); // change 'Delta', return the actual value used; NOTE: can be used only for an empty array protected: DATA_TYPE* Data; // pointer to array @@ -154,7 +154,7 @@ class TDirectArray void EnlargeArray(); // enlarges array void ReduceArray(); // reduces array - void Move(CArrayDirection direction, int first, int count); // move selected items to next/previous index + void Move(CArrayDirection direction, int first, int count); // move selected items to the next/previous index void CallCopyConstructor(DATA_TYPE* placement, const DATA_TYPE& member) { From e1a1475ebb39e12fa3cd90a56b892e2d21d85a5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 03:29:49 +0200 Subject: [PATCH 324/710] [translation] Fix src/plugins/shared/auxtools.cpp comments (#693) --- src/plugins/shared/auxtools.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/shared/auxtools.cpp b/src/plugins/shared/auxtools.cpp index e267fe2b4..a44b9a6b9 100644 --- a/src/plugins/shared/auxtools.cpp +++ b/src/plugins/shared/auxtools.cpp @@ -107,7 +107,7 @@ BOOL CThreadQueue::FindAndLockItem(HANDLE thread) CS.Leave(); - return act != NULL; // NULL = not found + return act != NULL; // NULL means not found } void CThreadQueue::UnlockItem(HANDLE thread, BOOL deleteIfUnlocked) @@ -152,7 +152,7 @@ BOOL CThreadQueue::WaitForExit(HANDLE thread, int milliseconds) BOOL ret = TRUE; if (thread != NULL) { - if (FindAndLockItem(thread)) // thread handle found and locked; we can wait for it, then remove it + if (FindAndLockItem(thread)) // thread handle found and locked; we can wait for it, then unlock it { ret = WaitForSingleObject(thread, milliseconds) != WAIT_TIMEOUT; @@ -312,9 +312,9 @@ CThreadQueue::StartThread(unsigned(WINAPI* body)(void*), void* param, unsigned s data.Continue = Continue; // start the thread; we do not use _beginthreadex() because since VC2015 it causes - // another load of this module (plugin), which is released again on normal exit, - // but if we use TerminateThread(), the module stays loaded until the Salamander process exits; - // only then do the global object destructors run, which can lead + // this module (plugin) to be loaded again; on normal exit it is released, + // but if we use TerminateThread(), the module stays loaded until the Salamander process exits + // and only then are the global object destructors run, which can lead // to unexpected crashes because all plugin interfaces have already been released (e.g. // SalamanderDebug) DWORD tid; @@ -342,7 +342,7 @@ CThreadQueue::StartThread(unsigned(WINAPI* body)(void*), void* param, unsigned s return NULL; } - // store the handle before the thread starts running (guarantees it has not finished and its object has not been deallocated) + // write the output values before the thread starts running (this guarantees that it has not already finished and that its object has not been deallocated) if (threadHandle != NULL) *threadHandle = thread; if (threadID != NULL) From fbcf5ba56e28d5b45ad2874655234741b9d0e428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 03:29:51 +0200 Subject: [PATCH 325/710] [translation] Fix src/plugins/shared/auxtools.h comments (#696) --- src/plugins/shared/auxtools.h | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/plugins/shared/auxtools.h b/src/plugins/shared/auxtools.h index 176de6fa4..7e7a6fd51 100644 --- a/src/plugins/shared/auxtools.h +++ b/src/plugins/shared/auxtools.h @@ -57,17 +57,17 @@ class CThreadQueue // starts the function 'body' with parameter 'param' in a newly created thread with a stack // of size 'stack_size' (0 = default); returns the thread handle or NULL on error, - // also writes the result to 'threadHandle' before the thread is resumed - // (if not NULL); use the returned thread handle only for NULL checks and for calling - // CThreadQueue methods WaitForExit() and KillThread(); the thread handle is closed by - // this queue object - // POZOR: -thread se muze spustit se zpozdenim az po navratu ze StartThread() - // (if 'param' points to a structure stored on the stack, the handoff of data from - // 'param' must be synchronized - the main thread must wait - // until the new thread takes ownership of the data) - // -the returned thread handle may already be closed if the thread finishes before - // StartThread() returns and another thread calls StartThread() or - // KillAll() + // and also stores the result in 'threadHandle' before the thread is resumed + // (if it is not NULL); use the returned thread handle only for NULL checks and for calling + // the CThreadQueue methods WaitForExit() and KillThread(); this queue object + // closes the thread handle + // WARNING: -the thread may start with a delay, only after StartThread() returns + // (if 'param' is a pointer to a structure stored on the stack, the data handoff + // from 'param' must be synchronized - the main thread must wait + // until the new thread takes over the data) + // -the returned thread handle may already be closed if the thread finishes before + // StartThread() returns and StartThread() or KillAll() is called from another + // thread // can be called from any thread HANDLE StartThread(unsigned(WINAPI* body)(void*), void* param, unsigned stack_size = 0, HANDLE* threadHandle = NULL, DWORD* threadID = NULL); @@ -127,10 +127,10 @@ class CThread // new thread in bytes (0 = default); returns a handle to the new thread or NULL on error; // the 'queue' object closes the handle; if the thread is created successfully, this object is // deallocated when the thread exits; if thread startup fails, the caller deallocates the object - // POZOR: bez pridani synchronizace muze thread dobehnout jeste pred navratem z Create() -> - // therefore, after a successful call to Create(), the "this" pointer must be considered invalid, - // the same applies to the returned thread handle (use it only for NULL checks and for calling - // CThreadQueue methods WaitForExit() and KillThread()) + // WARNING: without added synchronization, the thread may finish before Create() returns -> + // therefore, after a successful call to Create(), the "this" pointer must be considered invalid, + // and the same applies to the returned thread handle (use it only for NULL checks and for calling + // CThreadQueue methods WaitForExit() and KillThread()) // can be called from any thread HANDLE Create(CThreadQueue& queue, unsigned stack_size = 0, DWORD* threadID = NULL); From 47445029ebd0bcb37b0fb5fb20bc99ccc83a48f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 03:29:53 +0200 Subject: [PATCH 326/710] [translation] Fix src/plugins/shared/dbg.cpp comments (#697) --- src/plugins/shared/dbg.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/shared/dbg.cpp b/src/plugins/shared/dbg.cpp index c81d7c691..2ab65b1a3 100644 --- a/src/plugins/shared/dbg.cpp +++ b/src/plugins/shared/dbg.cpp @@ -18,7 +18,7 @@ #endif // _MSC_VER // suppress warning C4996: This function or variable may be unsafe. Consider using strcat_s instead. -// reason: lstrcat and other Windows routines are not safe anyway, so addressing it here is pointless +// reason: lstrcat and other Windows routines simply are not safe, so addressing it here is pointless #pragma warning(push) #pragma warning(disable : 4996) @@ -369,7 +369,7 @@ void C__Trace::SendMessageToServer(BOOL information, BOOL unicode, BOOL crash) // the bug report shows exactly where the macros are; the crash therefore follows // after this method completes } - else // block other TRACE_C threads until the message box opened for the + else // block other TRACE_C threads until the message box opened for the first TRACE_C is closed { // first TRACE_C closes; they crash there too to keep things consistent if (msgBoxOpened) { From 8b4e2c2c23cde998ae2f9b6e265f46f7a0a91433 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 03:29:56 +0200 Subject: [PATCH 327/710] [translation] Fix src/plugins/shared/dbg.h comments (#698) --- src/plugins/shared/dbg.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/shared/dbg.h b/src/plugins/shared/dbg.h index d206b1f21..e5b661d18 100644 --- a/src/plugins/shared/dbg.h +++ b/src/plugins/shared/dbg.h @@ -12,13 +12,13 @@ #pragma once -// definitions of the TRACE_I, TRACE_IW, TRACE_E, TRACE_EW, TRACE_C, TRACE_CW, and CALL_STACK_MESSAGEXXX macros for plugins, -// in a plugin you must define the SalamanderDebug variable (type shown below) and +// Definitions of the TRACE_I, TRACE_IW, TRACE_E, TRACE_EW, TRACE_C, TRACE_CW, and CALL_STACK_MESSAGEXXX macros for plugins. +// In a plugin, you must define the SalamanderDebug variable (type shown below) and // initialize it in SalamanderPluginEntry: // SalamanderDebug = salamander->GetSalamanderDebug(); // -// TRACE is enabled by defining TRACE_ENABLE -// CALL-STACK is disabled by defining CALLSTK_DISABLE +// TRACE is enabled by defining the TRACE_ENABLE macro. +// CALL-STACK is disabled by defining the CALLSTK_DISABLE macro. // WARNING: TRACE_C must not be used in DllMain, or in any code // called from DllMain, otherwise a deadlock will occur; see @@ -82,7 +82,7 @@ class C__StringStreamBuf : public std::streambuf // return pointer to the beginning of the data, terminated by null const char* c_str() { - // add trailing null + // add a trailing null terminator sputc('\0'); // decrement the pointer back, trailing null is not part of the data From 436f95abca3ef09d82d7b9b6f8a947946194e880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 03:29:59 +0200 Subject: [PATCH 328/710] [translation] Fix src/plugins/shared/htmlhelp.h comments (#700) --- src/plugins/shared/htmlhelp.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/shared/htmlhelp.h b/src/plugins/shared/htmlhelp.h index 398b1af1f..0c82fc4ed 100644 --- a/src/plugins/shared/htmlhelp.h +++ b/src/plugins/shared/htmlhelp.h @@ -331,7 +331,7 @@ extern "C" LPCTSTR pszUrlJump2; // URL for HHWIN_BUTTON_JUMP2 RECT rcMinSize; // Minimum size for window (ignored in version 1) int cbInfoTypes; // size of paInfoTypes; - LPCTSTR pszCustomTabs; // multiple zero-terminated strings + LPCTSTR pszCustomTabs; // multiple null-terminated strings } HH_WINTYPE, *PHH_WINTYPE; enum @@ -404,11 +404,11 @@ extern "C" // typedef enum tagHH_GPROPID { - HH_GPROPID_SINGLETHREAD = 1, // VARIANT_BOOL: True for single thread + HH_GPROPID_SINGLETHREAD = 1, // VARIANT_BOOL: TRUE for single-threaded operation HH_GPROPID_TOOLBAR_MARGIN = 2, // long: Provides a left/right margin around the toolbar. HH_GPROPID_UI_LANGUAGE = 3, // long: LangId of the UI. HH_GPROPID_CURRENT_SUBSET = 4, // BSTR: Current subset. - HH_GPROPID_CONTENT_LANGUAGE = 5 // long: LandId for desired content. + HH_GPROPID_CONTENT_LANGUAGE = 5 // long: LANGID for desired content. } HH_GPROPID; /////////////////////////////////////////////////////////////////////////////// From 2bf7fa44a80c00fd5e6a17114aa6600c8f5ed6f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 03:30:02 +0200 Subject: [PATCH 329/710] [translation] Fix src/plugins/shared/mhandles.cpp comments (#704) --- src/plugins/shared/mhandles.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/plugins/shared/mhandles.cpp b/src/plugins/shared/mhandles.cpp index 4aa315db4..bf2c23f11 100644 --- a/src/plugins/shared/mhandles.cpp +++ b/src/plugins/shared/mhandles.cpp @@ -77,15 +77,15 @@ const char* err(DWORD error); __MessagesTitle, (buttons)) /* - * shows a message box with the specified text and error icon, not in a new - * thread, dispatches the calling thread's messages + * Shows a message box with the specified text and error icon. It does not run in a new + * thread and dispatches messages for the calling thread. */ #define MESSAGE_E(parent, str, buttons) \ MESSAGE(parent, str, MB_ICONEXCLAMATION | (buttons)) /* - * shows a message box with the specified text and information icon, in a new thread, - * does not dispatch the calling thread's messages + * Shows a message box with the specified text and information icon. It runs in a new + * thread and does not dispatch messages for the calling thread. */ #define MESSAGE_TI(str, buttons) \ MESSAGE_T(str, MB_ICONINFORMATION | (buttons)) @@ -138,7 +138,7 @@ struct C__MessageBoxData }; int CALLBACK __MessagesMessageBoxThreadF(C__MessageBoxData* data) -{ // must not wait for the calling thread's response, because it will not respond +{ // must not wait for a response from the calling thread, because it will not respond // therefore parent==NULL -> no window disabling, etc. data->Return = MessageBox(NULL, data->Text, data->Caption, data->Type | MB_SETFOREGROUND); return 0; @@ -695,7 +695,7 @@ C__Handles::~C__Handles() else if (Handles[i].Handle.Origin == __hoGetStockObject) Handles.Delete(i); } - // check and list remaining handles + // check and list remaining open handles if (Handles.Count != 0) { if (MESSAGE_E(NULL, "Some monitored handles remained opened.\n" @@ -860,7 +860,7 @@ BOOL C__Handles::DeleteHandle(C__HandlesType& type, HANDLE handle, } } } - if (foundTypeOK != -1) // found only a handle exempt from release + if (foundTypeOK != -1) // found only a handle that does not need to be released { type = Handles[foundTypeOK].Handle.Type; if (origin != NULL) @@ -2393,7 +2393,7 @@ HDWP C__Handles::DeferWindowPos(HDWP hWinPosInfo, HWND hWnd, HWND hWndInsertAfte { HDWP ret = ::DeferWindowPos(hWinPosInfo, hWnd, hWndInsertAfter, x, y, cx, cy, uFlags); - if (ret != hWinPosInfo) // the structure was reallocated - we must update the monitored handle value + if (ret != hWinPosInfo) // the structure was reallocated; we must update the tracked handle value { CheckClose(TRUE, (HANDLE)hWinPosInfo, __htDeferWindowPos, __GetHandlesOrigin(__hoDeferWindowPos), ERROR_SUCCESS, FALSE); CheckCreate(ret != NULL, __htDeferWindowPos, __hoDeferWindowPos, (HANDLE)ret, GetLastError()); From e04fe1cc0c00e4aae4a8e13d257da1956ffe1ac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 03:30:05 +0200 Subject: [PATCH 330/710] [translation] Fix src/plugins/shared/spl_arc.h comments (#705) --- src/plugins/shared/spl_arc.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/plugins/shared/spl_arc.h b/src/plugins/shared/spl_arc.h index 1e0f88d3d..4e2a3f7a5 100644 --- a/src/plugins/shared/spl_arc.h +++ b/src/plugins/shared/spl_arc.h @@ -67,18 +67,18 @@ class CPluginInterfaceForArchiverAbstract const char* archiveRoot, SalEnumSelection next, void* nextParam) = 0; - // Function for 'panel archiver view'; called when one file is requested for unpacking for view/edit + // Function for the panel archiver view; called when one file is requested for unpacking for view/edit // from archive 'fileName' to directory 'targetDir'; the file name inside the archive is 'nameInArchive'; // 'pluginData' is an interface for working with file information specific to the plugin - // (for example data from added columns; it is the same interface returned by ListArchive - // v parametru 'pluginData' - takze muze byt i NULL); 'fileData' je ukazatel na strukturu CFileData - // for the unpacked file (the structure was built by the plugin when listing the archive); 'newFileName' (if not - // NULL) je nove jmeno pro rozbalovany soubor (pouziva se pokud puvodni jmeno z archivu neni mozne - // be unpacked to disk (for example 'aux', 'prn', etc.)); write TRUE to 'renamingNotSupported' (only if 'newFileName' is not - // NULL) zapsat TRUE pokud plugin nepodporuje prejmenovani pri vybalovani (standardni chybova hlaska - // the standard 'renaming not supported' error message is shown by Salamander); returns TRUE if the file is unpacked successfully - // (the file is at the requested path and neither Cancel nor Skip was used); 'salamander' is a set of useful methods - // exported by Salamander + // (for example, data from added columns; it is the same interface returned by ListArchive + // in the 'pluginData' parameter, so it may also be NULL); 'fileData' is a pointer to the CFileData + // structure of the file being unpacked (the structure was built by the plugin when listing the archive); + // 'newFileName' (if not NULL) is the new name for the unpacked file (used if the original name from the + // archive cannot be unpacked to disk, for example, 'aux', 'prn', etc.); write TRUE to + // 'renamingNotSupported' (only if 'newFileName' is not NULL) if the plugin does not support renaming + // during unpacking (the standard 'renaming not supported' error message is shown by Salamander); + // returns TRUE if the file is unpacked successfully (the file is at the requested path and neither + // Cancel nor Skip was used); 'salamander' is a set of useful methods exported by Salamander virtual BOOL WINAPI UnpackOneFile(CSalamanderForOperationsAbstract* salamander, const char* fileName, CPluginDataInterfaceAbstract* pluginData, const char* nameInArchive, const CFileData* fileData, const char* targetDir, From 6aaac47badfb30e33b75743243f57b4e7a3ee561 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 03:30:08 +0200 Subject: [PATCH 331/710] [translation] Fix src/plugins/shared/spl_base.h comments (#706) --- src/plugins/shared/spl_base.h | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/plugins/shared/spl_base.h b/src/plugins/shared/spl_base.h index 9491fdf5a..2851e7b96 100644 --- a/src/plugins/shared/spl_base.h +++ b/src/plugins/shared/spl_base.h @@ -251,28 +251,28 @@ class CSalamanderConnectAbstract // adds the plugin to the list for "custom archiver pack", // 'title' is the user-visible name of the custom packer, 'defaultExtension' is the default extension // for new archives; if this is not an upgrade of "custom pack" (or the addition of the whole plugin) and - // 'update' je FALSE, je volani ignorovano; je-li 'update' TRUE, prepise se nastaveni na - // nove hodnoty 'title' a 'defaultExtension' - nutna prevence proti opakovanemu 'update'==TRUE - // (to avoid continually overwriting the settings) + // 'update' is FALSE, the call is ignored; if 'update' is TRUE, the settings are overwritten with the + // new values of 'title' and 'defaultExtension' - it is necessary to prevent repeated 'update'==TRUE + // (constant overwriting of the settings) virtual void WINAPI AddCustomPacker(const char* title, const char* defaultExtension, BOOL update) = 0; // adds the plugin to the list for "custom archiver unpack", - // 'title' is the user-visible name of the custom unpacker, 'masks' are archive-file masks (used to determine - // which unpacker should unpack a given archive; the separator is ';' (the escape sequence for ';' is - // ";;") and the usual '*' and '?' wildcards are used, plus '#' for '0'..'9'); if this is not an upgrade - // "custom unpack" (nebo pridani celeho pluginu) a 'update' je FALSE je volani ignorovano; - // if 'update' is TRUE, the settings are overwritten with the new 'title' and 'masks' values - repeated - // proti opakovanemu 'update'==TRUE (neustalemu prepisovani nastaveni) + // 'title' is the user-visible name of the custom unpacker, 'masks' are archive file masks (used to determine + // which unpacker should be used to unpack a given archive; the separator is ';' (the escape sequence for ';' is + // ";;") and the usual '*' and '?' wildcards are used, plus '#' for '0'..'9'); if this is not an upgrade of + // "custom unpack" (or the addition of the whole plugin) and 'update' is FALSE, the call is ignored; + // if 'update' is TRUE, the settings are overwritten with the new 'title' and 'masks' values; it is necessary to prevent + // repeated 'update'==TRUE calls (continuous overwriting of the settings) virtual void WINAPI AddCustomUnpacker(const char* title, const char* masks, BOOL update) = 0; - // adds the plugin to the list for "panel archiver view/edit", + // adds the plugin to the list for "panel archiver view/edit"; // 'extensions' are the archive extensions handled by this plugin - // (the separator is ';' (';' has no escape sequence here) and the wildcard '#' is used for - // '0'..'9'), pokud je 'edit' TRUE, resi tento plugin "panel archiver view/edit", jinak jen + // (the separator is ';' (';' has no escape sequence here), and the wildcard '#' is used for + // '0'..'9'); if 'edit' is TRUE, this plugin handles "panel archiver view/edit", otherwise only // "panel archiver view"; if this is not an upgrade of "panel archiver view/edit" (or the addition - // celeho pluginu) a 'updateExts' je FALSE je volani ignorovano; je-li 'updateExts' TRUE, - // new archive extensions are added (ensuring that all extensions from 'extensions' are present) - repeated - // prevence proti opakovanemu 'updateExts'==TRUE (neustalemu ozivovani pripon z 'extensions') + // of the entire plugin) and 'updateExts' is FALSE, the call is ignored; if 'updateExts' is TRUE, + // new archive extensions are added (ensuring that all extensions from 'extensions' are present) - + // repeated 'updateExts'==TRUE must be prevented (to avoid constantly reviving extensions from 'extensions') virtual void WINAPI AddPanelArchiver(const char* extensions, BOOL edit, BOOL updateExts) = 0; // removes an extension from the list for "panel archiver view/edit" (only from items belonging to From 5e015cdfd734704ae23d7af6e8b772cec63bfd20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 03:30:11 +0200 Subject: [PATCH 332/710] [translation] Fix src/common/strutils.h comments (#707) --- src/common/strutils.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/strutils.h b/src/common/strutils.h index 3e82316e6..d2b2b938c 100644 --- a/src/common/strutils.h +++ b/src/common/strutils.h @@ -9,10 +9,10 @@ // Converts a Unicode (UTF-16) string to an ANSI multibyte string; 'src' is the Unicode string; // 'srcLen' is the length of the Unicode string (excluding the terminating null; if -1 is passed, // the length is determined from the terminating null); 'bufSize' (must be greater than 0) is the size of the destination buffer -// 'buf' pro ANSI string; je-li 'compositeCheck' TRUE, pouziva flag WC_COMPOSITECHECK +// 'buf' for the ANSI string; if 'compositeCheck' is TRUE, the WC_COMPOSITECHECK flag is used // (see MSDN); it must not be used for file names (NTFS distinguishes between names written as // precomposed and composite, i.e. it does not normalize names); 'codepage' is the code page of the -// ANSI stringu; vraci pocet znaku zapsanych do 'buf' (vcetne zakoncujici nuly); pri chybe +// ANSI string; returns the number of characters written to 'buf' (including the terminating null); on error // returns 0 (see GetLastError()); always ensures 'buf' is null-terminated (even on error); // if 'buf' is too small, the function returns 0, but at least part of the string is converted into 'buf' int ConvertU2A(const WCHAR* src, int srcLen, char* buf, int bufSize, From 3327595867d9e2de245f2907a5cb8eb0252180d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 03:30:13 +0200 Subject: [PATCH 333/710] [translation] Fix src/common/sheets.h comments (#708) --- src/common/sheets.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/sheets.h b/src/common/sheets.h index 744c3c723..fc1bb8cec 100644 --- a/src/common/sheets.h +++ b/src/common/sheets.h @@ -35,7 +35,7 @@ class CElasticLayout // divider line from which controls start moving (lies on the bottom edge of ResizeCtrls) // client coordinates, in pixels int SplitY; - // prvky ktere s velikosti natahujeme (typicky listview) + // controls that resize with the dialog (typically list views) TDirectArray ResizeCtrls; // temporary array populated by FindMoveCtrls; ideally this would be a local variable, but // for easier calls to the FindMoveControls callback (which needs it passed in) From 4be60e6f3c728920d32b4e2adf407b15deebde03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 03:30:16 +0200 Subject: [PATCH 334/710] [translation] Fix src/plugins/shared/spl_com.h comments (#709) --- src/plugins/shared/spl_com.h | 66 ++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/src/plugins/shared/spl_com.h b/src/plugins/shared/spl_com.h index 0ffdca84b..4e8a8a6bd 100644 --- a/src/plugins/shared/spl_com.h +++ b/src/plugins/shared/spl_com.h @@ -185,9 +185,9 @@ struct CQuadWord // conversion to double (beware of precision loss for large numbers - double has only 15 significant digits) double GetDouble() const - { // MSVC cannot convert unsigned __int64 to double, so we have to help it + { // MSVC cannot convert unsigned __int64 to double, so this must be handled explicitly if (Value < CQuadWord(0, 0x80000000).Value) - return (double)(__int64)Value; // positive number + return (double)(__int64)Value; // non-negative number else return 9223372036854775808.0 + (double)(__int64)(Value - CQuadWord(0, 0x80000000).Value); } @@ -360,24 +360,24 @@ class CSalamanderDirectoryAbstract #define SALENUM_ERROR 1 // an error occurred and the user chose to continue the operation (only the faulty files/directories were skipped) #define SALENUM_CANCEL 2 // an error occurred and the user wants to cancel the operation -// enumerator, returns file names and ends by returning NULL; -// 'enumFiles' == -1 -> reset enumeration (after this call, enumeration starts again from the beginning), all -// other parameters (except 'param') are ignored, it has no return values (everything is +// Enumerator: returns file names and ends by returning NULL; +// 'enumFiles' == -1 -> reset enumeration (after this call, enumeration starts again from the beginning); all +// other parameters (except 'param') are ignored; it has no return values (everything is // set to zero) // 'enumFiles' == 0 -> enumerate files and subdirectories from the root only // 'enumFiles' == 1 -> enumerate all files and subdirectories // 'enumFiles' == 2 -> enumerate all subdirectories, files from the root only; // an error can occur only for 'enumFiles' == 1 or 'enumFiles' == 2 ('enumFiles' == 0 does not build // names and paths); 'parent' is the parent of any error message boxes (NULL means do not show -// errors); 'isDir' (if not NULL) returns TRUE if it is a directory; 'size' (if not NULL) returns -// the file size (for directories, a size is returned only for 'enumFiles' == 0 - otherwise it is zero); +// errors); 'isDir' (if not NULL) returns TRUE if the item is a directory; 'size' (if not NULL) returns +// the file size (for directories, a size is returned only for 'enumFiles' == 0; otherwise it is zero); // if 'fileData' is not NULL, it receives a pointer to the CFileData structure of the returned // file/directory (if the enumerator returns NULL, 'fileData' also receives NULL); // 'param' is the 'nextParam' parameter passed together with the pointer to a function of this // type; 'errorOccured' (if not NULL) receives SALENUM_ERROR if a too-long name is encountered while building the returned -// names and the user chooses to skip only the faulty files/directories, -// POZOR: chyba se netyka prave vraceneho jmena, to je OK; v 'errorOccured' (neni-li NULL) se vraci -// SALENUM_CANCEL pokud se pri chybe uzivatel rozhodl pro zruseni operace (cancel), zaroven +// names and the user chooses to skip only the invalid files/directories, +// NOTE: the error does not apply to the name just returned; that one is OK; 'errorOccured' (if not NULL) receives +// SALENUM_CANCEL if, after an error, the user chooses to cancel the operation; at the same time, the // enumerator returns NULL (ends); 'errorOccured' (if not NULL) receives SALENUM_SUCCESS if // no error occurred typedef const char*(WINAPI* SalEnumSelection)(HWND parent, int enumFiles, BOOL* isDir, CQuadWord* size, @@ -385,14 +385,14 @@ typedef const char*(WINAPI* SalEnumSelection)(HWND parent, int enumFiles, BOOL* // enumerator, returns file names and ends by returning NULL; // 'enumFiles' == -1 -> reset enumeration (after this call, enumeration starts again from the beginning), all -// other parameters (except 'param') are ignored, it has no return values (everything is -// set to zero) +// other parameters (except 'param') are ignored, and no output values are returned (all +// outputs are set to zero) // 'enumFiles' == 0 -> enumerate files and subdirectories from the root only // 'enumFiles' == 1 -> enumerate all files and subdirectories // 'enumFiles' == 2 -> enumerate all subdirectories, files from the root only; // 'enumFiles' == 3 -> enumerate all files and subdirectories + symbolic links to files have the -// size of the target file (for 'enumFiles' == 1 they have the size of the link itself, which is probably -// always zero); WARNING: 'enumFiles' must remain 3 for all calls to the enumerator; +// size of the target file (for 'enumFiles' == 1 they have the size of the link itself, which is +// probably always zero); WARNING: 'enumFiles' must remain 3 for all calls to the enumerator; // an error can occur only for 'enumFiles' == 1, 2, or 3 ('enumFiles' == 0 does not access the disk at all // and does not build names and paths); 'parent' is the parent of any error message boxes // (NULL means do not show errors); 'dosName' (if not NULL) returns the DOS name @@ -402,9 +402,9 @@ typedef const char*(WINAPI* SalEnumSelection)(HWND parent, int enumFiles, BOOL* // of the file/directory; 'param' is the 'nextParam' parameter passed together with the pointer to a function // of this type; 'errorOccured' (if not NULL) receives SALENUM_ERROR if an error occurs while reading // data from disk or if a too-long name is encountered while building the returned names -// and the user chooses to skip only the faulty files/directories; WARNING: the error does not concern the -// just-returned name, that one is OK; 'errorOccured' (if not NULL) receives SALENUM_CANCEL if -// on error the user chooses to cancel the operation, and the enumerator simultaneously returns NULL (ends); +// and the user chooses to skip only the problematic files/directories; WARNING: the error does not concern the +// name just returned, which is OK; 'errorOccured' (if not NULL) receives SALENUM_CANCEL if +// on error the user chooses to cancel the operation, and the enumerator returns NULL (ends); // 'errorOccured' (if not NULL) receives SALENUM_SUCCESS if no error occurred typedef const char*(WINAPI* SalEnumSelection2)(HWND parent, int enumFiles, const char** dosName, BOOL* isDir, CQuadWord* size, DWORD* attr, @@ -652,8 +652,8 @@ class CPluginDataInterfaceAbstract public: #endif // INSIDE_SALAMANDER - // returns TRUE if ReleasePluginData should be called for all files bound - // to this interface, otherwise returns FALSE + // returns TRUE if ReleasePluginData should be called for all files associated + // with this interface; otherwise returns FALSE virtual BOOL WINAPI CallReleaseForFiles() = 0; // returns TRUE if ReleasePluginData should be called for all directories bound @@ -830,24 +830,24 @@ class CPluginDataInterfaceAbstract class CSalamanderForOperationsAbstract { public: - // PROGRESS DIALOG: dialog obsahuje jeden/dva ('twoProgressBars' FALSE/TRUE) progress-metry + // PROGRESS DIALOG: the dialog contains one or two progress bars ('twoProgressBars' FALSE/TRUE) // opens a progress dialog titled 'title'; 'parent' is the parent window of the progress dialog (if - // NULL, pouzije se hlavni okno); pokud obsahuje jen jeden progress-metr, muze byt popsan + // NULL, the main window is used); if it contains only one progress bar, it can be labeled // as "File" ('fileProgress' is TRUE) or "Total" ('fileProgress' is FALSE) // - // the dialog does not run in its own thread; for it to work (Cancel button + internal timer) - // the message queue must be flushed occasionally; this is handled by ProgressDialogAddText, - // ProgressAddSize and ProgressSetSize + // the dialog does not run in its own thread; for it to work properly (Cancel button + internal timer), + // the message queue must be flushed occasionally; this is handled by the ProgressDialogAddText, + // ProgressAddSize, and ProgressSetSize methods // - // because real-time display of text and progress-bar changes slows things down considerably, - // ProgressDialogAddText, ProgressAddSize, and ProgressSetSize take the - // 'delayedPaint' parameter; it should be TRUE for all rapidly changing text and values; - // the methods then store the text and display it only after the dialog's internal timer fires; - // 'delayedPaint' nastavime na FALSE pro inicializacni/koncove texty typu "preparing data..." - // or "canceling operation...", after showing which we do not give the dialog a chance to dispatch - // messages (timer events); if such an operation is likely to take a long time, we should - // keep the dialog alive during that time by calling ProgressAddSize(CQuadWord(0, 0), TRUE) - // and use its return value to end the action early if needed + // because real-time display of text and progress-bar changes slows things down considerably, the + // ProgressDialogAddText, ProgressAddSize, and ProgressSetSize methods have a 'delayedPaint' + // parameter; it should be TRUE for all rapidly changing text and values; the methods then store + // the texts and display them only after the dialog's internal timer fires; set 'delayedPaint' to + // FALSE for initial/final texts such as "preparing data..." or "canceling operation...", after + // displaying which we do not give the dialog a chance to dispatch messages (timer events); if such + // an operation is likely to take a long time, we should keep the dialog responsive during that time + // by calling ProgressAddSize(CQuadWord(0, 0), TRUE) and possibly terminate the action early + // according to its return value virtual void WINAPI OpenProgressDialog(const char* title, BOOL twoProgressBars, HWND parent, BOOL fileProgress) = 0; // writes text 'txt' (even multiple lines - it is split into lines) to the progress dialog From de7be95580d14cd83aedb894a86dd98dd3193d68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 03:30:18 +0200 Subject: [PATCH 335/710] [translation] Fix src/common/trace.h comments (#710) --- src/common/trace.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/trace.h b/src/common/trace.h index 843987a00..4698d5e32 100644 --- a/src/common/trace.h +++ b/src/common/trace.h @@ -365,7 +365,7 @@ extern const TCHAR* __CONNECT_DATA_ACCEPTED_EVENT_NAME; // // CClientServerInitData // -// tato struktura se pri zahajeni komunikace predava od clienta do serveru +// This structure is passed from the client to the server when communication starts. struct C__ClientServerInitData { From dca7a870e35a2592145ad35f35f0dd4b3d3bd600 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 03:30:21 +0200 Subject: [PATCH 336/710] [translation] Fix src/plugins/shared/spl_file.h comments (#711) --- src/plugins/shared/spl_file.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/shared/spl_file.h b/src/plugins/shared/spl_file.h index f51cae602..81cf53752 100644 --- a/src/plugins/shared/spl_file.h +++ b/src/plugins/shared/spl_file.h @@ -71,7 +71,7 @@ struct SAFE_FILE DWORD dwDesiredAccess; // > backup of the CreateFile API parameters DWORD dwShareMode; // > for possible retries DWORD dwCreationDisposition; // > in case of read or write errors - DWORD dwFlagsAndAttributes; // > + DWORD dwFlagsAndAttributes; // saved CreateFile flags and attributes for retrying the call if a read or write error occurs BOOL WholeFileAllocated; // TRUE if SafeFileCreate preallocated the whole file }; From 8a84839c51fd0b223435e90b7725e76810cccb31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 03:30:23 +0200 Subject: [PATCH 337/710] [translation] Fix src/plugins/shared/spl_fs.h comments (#712) --- src/plugins/shared/spl_fs.h | 72 ++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/src/plugins/shared/spl_fs.h b/src/plugins/shared/spl_fs.h index 6bbaaeb59..8b08c74b9 100644 --- a/src/plugins/shared/spl_fs.h +++ b/src/plugins/shared/spl_fs.h @@ -35,27 +35,27 @@ class CPluginDataInterfaceAbstract; class CSalamanderForViewFileOnFSAbstract { public: - // Finds an existing copy of the file in the disk cache or, if the copy is not yet - // in the disk cache, reserves a name for it (a target file, for example for an FTP download); + // Finds an existing copy of the file in the disk cache or, if no copy exists yet, + // reserves a name for it (the target file, for example for an FTP download); // 'uniqueFileName' is the unique name of the original file (the disk cache is searched - // by this name; the full file name in Salamander form should be sufficient - - // fs-name:fs-user-part; WARNING: the name is compared case-sensitively, so if the - // plugin requires case-insensitive matching, it must convert all names, for example, + // by this name; the full file name in Salamander format should be sufficient - + // "fs-name:fs-user-part"; WARNING: the name is compared case-sensitively, so if the + // plugin requires case-insensitive comparison, it must convert all names, for example, // to lowercase - see CSalamanderGeneralAbstract::ToLowerCase); 'nameInCache' is the name // of the file copy stored in the disk cache (the last component of the original file name // is expected here so that it later reminds the user of the original file in the viewer caption); // if 'rootTmpPath' is NULL, the disk cache is in the Windows TEMP - // directory; otherwise 'rootTmpPath' contains the path to the disk cache; on system error it returns - // NULL (nemelo by vubec nastat), jinak vraci plne jmeno kopie souboru v disk-cache + // directory; otherwise, 'rootTmpPath' contains the path to the disk cache; on a system error it returns + // NULL (this should not happen at all), otherwise it returns the full name of the file copy in the disk cache // and returns TRUE in 'fileExists' if the file already exists in the disk cache (for example, - // the FTP download has already been performed), or FALSE if the file still has to be prepared + // the FTP download has already been performed), or FALSE if the file still needs to be prepared // (for example by downloading it); 'parent' is the parent of error message boxes (for example, an overly long // file name) - // POZOR: pokud nevratila NULL (nenastala systemova chyba), je nutne pozdeji zavolat - // FreeFileNameInCache (pro stejne 'uniqueFileName') + // WARNING: if it did not return NULL (no system error occurred), it is necessary to later call + // FreeFileNameInCache (for the same 'uniqueFileName') // NOTE: if the FS uses the disk cache, it should at least call - // CSalamanderGeneralAbstract::RemoveFilesFromCache("fs-name:"), jinak budou - // its file copies needlessly clutter the disk cache + // CSalamanderGeneralAbstract::RemoveFilesFromCache("fs-name:") when the plugin is unloaded, otherwise + // its file copies will needlessly clutter the disk cache virtual const char* WINAPI AllocFileNameInCache(HWND parent, const char* uniqueFileName, const char* nameInCache, const char* rootTmpPath, BOOL& fileExists) = 0; @@ -72,7 +72,7 @@ class CSalamanderForViewFileOnFSAbstract // **************************************************************************** // CPluginFSInterfaceAbstract // -// set of plugin methods that Salamander needs to work with a file system +// Set of plugin methods that Salamander needs to work with the file system // typ ikon v panelu pri listovani FS (pouziva se v CPluginFSInterfaceAbstract::ListCurrentPath()) #define pitSimple 0 // simple icons for files and directories - by extension (association) @@ -538,21 +538,21 @@ class CPluginInterfaceForFSAbstract // Executes a context-menu command for an FS item or for an active/detached FS in the Change Drive menu after the Change Drive menu is closed, or executes a context-menu command for an FS item in the Drive bars (only for compatibility with the Change Drive menu). It is called in response to return values 'closeMenu' (TRUE), 'postCmd', and 'postCmdParam' from ChangeDriveMenuItemContextMenu after the Change Drive menu is closed (for Drive bars, immediately). 'panel' identifies the panel we should work with - for a context menu in the Change Drive menu, 'panel' is always PANEL_SOURCE (this menu can be opened only for the active panel); for a context menu in the Drive bars, 'panel' may be PANEL_LEFT or PANEL_RIGHT (if two Drive bars are enabled, we may work with the inactive panel). virtual void WINAPI ExecuteChangeDrivePostCommand(int panel, int postCmd, void* postCmdParam) = 0; - // Executes an item in a panel with an open FS (for example, in response to the Enter key in the panel; - // for subdirectories/up-dir (it is an up-dir if its name is .. and it is also the first directory) - // a path change is assumed; for files, a copy of the file on disk is opened and any - // changes are then loaded back to the FS); the execution cannot be performed in an FS-interface method because - // methods that change the path cannot be called there (they may close the FS); - // 'panel' specifies the panel in which the execution takes place (PANEL_LEFT or PANEL_RIGHT); - // 'pluginFS' is the interface of the FS opened in the panel; 'pluginFSName' is the FS name opened - // in the panel; 'pluginFSNameIndex' is the index of the FS name opened in the panel (to make it easier to detect - // which FS name it is); 'file' is the file/directory/up-dir being executed ('isDir' is 0/1/2); - // POZOR: volani metody pro zmenu cesty v panelu muze zneplatnit 'pluginFS' (po zavreni FS) - // and 'file'+'isDir' may also become invalid (a changed panel listing destroys the items of the original listing) - // POZNAMKA: pokud se spousti soubor nebo se s nim jinak pracuje (napr. downloadi se), - // CSalamanderGeneralAbstract::SetUserWorkedOnPanelPath must be called for panel - // 'panel', otherwise the path in this panel will not be added to the list of working - // directories - List of Working Directories (Alt+F12) + // Executes an item in a panel with an open FS (for example, in response to pressing Enter in the panel; + // for a subdirectory/up-dir (it is an up-dir if its name is ".." and it is also the first directory), + // a path change is assumed; for a file, a copy of the file on disk is opened, and any + // changes are then loaded back to the FS); execution cannot be performed in an FS interface method because + // methods for changing the path cannot be called there (they may even close the FS); + // 'panel' specifies the panel in which execution takes place (PANEL_LEFT or PANEL_RIGHT); + // 'pluginFS' is the interface of the FS opened in the panel; 'pluginFSName' is the name of the FS opened + // in the panel; 'pluginFSNameIndex' is the index of the name of the FS opened in the panel (for easier detection + // of which FS name it is); 'file' is the file/directory/up-dir being executed ('isDir' is 0/1/2); + // WARNING: calling a method to change the path in the panel may invalidate 'pluginFS' (after the FS is closed) + // and 'file'+'isDir' (a change in the panel listing destroys the items of the original listing) + // NOTE: if a file is executed or otherwise used (for example, downloaded), + // CSalamanderGeneralAbstract::SetUserWorkedOnPanelPath must be called for panel + // 'panel', otherwise the path in this panel will not be added to the list of working + // directories - List of Working Directories (Alt+F12) virtual void WINAPI ExecuteOnFS(int panel, CPluginFSInterfaceAbstract* pluginFS, const char* pluginFSName, int pluginFSNameIndex, CFileData& file, int isDir) = 0; @@ -591,20 +591,20 @@ class CPluginInterfaceForFSAbstract #endif // __BORLANDC__ /* - * Preliminary version of the help for the plugin interface + * Preliminary version of the plugin interface documentation * * Opening, changing, listing, and refreshing a path: - * - ChangePath is called to open a path in a new FS (the first call to ChangePath is always for opening a path) - * - ChangePath is called to change a path (the second and all subsequent ChangePath calls are path changes) + * - ChangePath is called to open a path in a new FS (the first call to ChangePath always opens a path) + * - ChangePath is called to change a path (the second and all subsequent calls to ChangePath are path changes) * - on a fatal error, ChangePath returns FALSE (the FS path is not opened in the panel; if this was a path change, ChangePath is then called for the original path, and if that also fails, Salamander switches to a fixed-drive path) * - if ChangePath returns TRUE (success) and the path was not shortened back to the original path (whose listing is currently loaded), ListCurrentPath is called to obtain the new listing * - after a successful listing, ListCurrentPath returns TRUE - * - on a fatal error, ListCurrentPath returns FALSE and the following call to ChangePath must also return FALSE - * - if the current path cannot be listed, ListCurrentPath returns FALSE and the following ChangePath call must change the path and return TRUE (ListCurrentPath is then called again); if the path can no longer be changed (root, etc.), ChangePath also returns FALSE (the FS path is not opened in the panel; if this was a path change, ChangePath is then called for the original path, and if that also fails, Salamander switches to a fixed-drive path) - * - a path refresh (Ctrl+R) behaves the same as changing to the current path (the path may remain unchanged, be shortened, or, on a fatal error, change to a fixed drive); during a path refresh, parameter 'forceRefresh' is TRUE for all ChangePath and ListCurrentPath calls (the FS must not use any cache to change the path or load the listing - the user does not want cached data) + * - on a fatal error, ListCurrentPath returns FALSE, and the subsequent call to ChangePath must also return FALSE + * - if the current path cannot be listed, ListCurrentPath returns FALSE and the subsequent call to ChangePath must change the path and return TRUE (ListCurrentPath is then called again); if the path can no longer be changed (root, etc.), ChangePath also returns FALSE (the FS path is not opened in the panel; if this was a path change, ChangePath is then called for the original path, and if that also fails, Salamander switches to a fixed-drive path) + * - refreshing a path (Ctrl+R) behaves the same as changing to the current path (the path may remain unchanged, be shortened, or, in case of a fatal error, change to a fixed drive); during path refresh, the parameter 'forceRefresh' is TRUE for all calls to ChangePath and ListCurrentPath (the FS must not use any cache to change the path or load the listing; the user does not want cached data) * - * When traversing history (back/forward), the FS interface in which the FS path ('fsName':'fsUserPart') is listed is obtained by the first possible method from the following: - * - the FS interface in which the path was last opened has not yet been closed and is either detached or active in a panel (not active in the other panel) + * When traversing history (back/forward), the FS interface in which the FS path ('fsName':'fsUserPart') will be listed is chosen by the first applicable method from the following: + * - the FS interface in which the path was last opened has not yet been closed and is either detached or active in a panel (and is not active in the other panel) * - the active FS interface in the panel ('currentFSName') belongs to the same plugin as 'fsName' and IsOurPath('currentFSName', 'fsName', 'fsUserPart') returns TRUE * - the first detached FS interface ('currentFSName') that belongs to the same plugin as 'fsName' and for which IsOurPath('currentFSName', 'fsName', 'fsUserPart') returns TRUE * - a new FS interface From 94844cfc49a4b4bc578464f3c46bb3eb2025279d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 03:30:26 +0200 Subject: [PATCH 338/710] [translation] Fix src/plugins/shared/spl_gui.h comments (#713) --- src/plugins/shared/spl_gui.h | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/src/plugins/shared/spl_gui.h b/src/plugins/shared/spl_gui.h index a1ef79b3b..bc538d08b 100644 --- a/src/plugins/shared/spl_gui.h +++ b/src/plugins/shared/spl_gui.h @@ -417,8 +417,8 @@ Type WM_DRAWITEM messages. TypeData contains a 32-bit application-defined value. - MENU_TYPE_RADIOCHECK Checked items are shown with a dot instead of a check mark, - je-li HBmpChecked rovno NULL. + MENU_TYPE_RADIOCHECK Checked items are shown with a dot instead of a check mark + if HBmpChecked is NULL. MENU_TYPE_SEPARATOR Horizontal separator line. TypeData is unused. @@ -451,7 +451,7 @@ ID SubMenu Pointer to the popup menu attached to this item. If this item - neotevira submenu, je SubMenu rovno NULL. + does not open a submenu, SubMenu is NULL. HBmpChecked Handle of the bitmap shown before the item when the item is @@ -467,7 +467,7 @@ HBmpUnchecked this bitmap is not used. ImageIndex - Index bitmapy v ImageListu CMenuPopup::HImageList. Bitmapa je vykreslena + Bitmap index in the CMenuPopup::HImageList image list. The bitmap is drawn before the item, depending on MENU_STATE_CHECKED and MENU_STATE_GRAYED. If the member is -1, nothing is drawn. @@ -483,7 +483,7 @@ class CGUIMenuPopupAbstract public: // // LoadFromTemplate - // Builds menu contents based on 'menuTemplate', + // Builds the menu contents from 'menuTemplate'. // // Parameters // 'hInstance' @@ -493,29 +493,28 @@ class CGUIMenuPopupAbstract // [in] Pointer to a menu template. // // A menu template consists of two or more MENU_TEMPLATE_ITEM structures. - // 'MENU_TEMPLATE_ITEM::RowType' of first structure must be MNTT_PB (popup begin). - // 'MENU_TEMPLATE_ITEM::RowType' of last structure must be MNTT_PE (popup end). + // The 'MENU_TEMPLATE_ITEM::RowType' of the first structure must be MNTT_PB (popup begin). + // The 'MENU_TEMPLATE_ITEM::RowType' of the last structure must be MNTT_PE (popup end). // // 'enablersOffset' - // [in] Pointer to array of enablers. + // [in] Pointer to an array of enablers. // - // If this parameter is NULL, 'MENU_ITEM_INFO::Enabler' value is pointer to enabler - // variable. Otherwise 'MENU_ITEM_INFO::Enabler' is index to the enablers array. - // Zero index is reserved for "always enabled" item. + // If this parameter is NULL, 'MENU_ITEM_INFO::Enabler' is a pointer to an enabler + // variable. Otherwise, 'MENU_ITEM_INFO::Enabler' is an index into the enablers array. + // Index zero is reserved for the "always enabled" item. // // 'hImageList' - // [in] Handle of image list that the menu will use to display menu items images - // that are in their default state. + // [in] Handle to the image list that the menu will use to display menu item images + // in their default state. // // If this parameter is NULL, no images will be displayed in the menu items. // // 'hHotImageList' - // [in] Handle of image list that the menu will use to display menu items images - // that are in their selected or checked state. + // [in] Handle to the image list that the menu will use to display menu item images + // in their selected or checked state. // // If this parameter is NULL, normal images will be displayed instead of hot images. // - // // Return Values // Returns TRUE if successful, or FALSE otherwise. // From 7508b9b1c4de50af5ae2312bad7401c03fb2a557 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 03:30:28 +0200 Subject: [PATCH 339/710] [translation] Fix src/plugins/shared/spl_vers.h comments (#714) --- src/plugins/shared/spl_vers.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/shared/spl_vers.h b/src/plugins/shared/spl_vers.h index 49533b7fa..3448f1810 100644 --- a/src/plugins/shared/spl_vers.h +++ b/src/plugins/shared/spl_vers.h @@ -100,10 +100,10 @@ // VERSINFO_BETAVERSION_TXT: // // Changes with every build; for a release version, VERSINFO_BETAVERSION_TXT will be "". -// If we release a special beta fix build such as 2.5 beta 9a, increment +// If a special beta fix build such as 2.5 beta 9a is released, increment // VERSINFO_BUILDNUMBER by one and set VERSINFO_BETAVERSION_TXT==" beta 9a". // -// VERSINFO_BETAVERSIONSHORT_TXT is used for bug report names; it should be as short as possible +// VERSINFO_BETAVERSIONSHORT_TXT is used to name bug reports; it should be as short as possible // examples ("x86" is for the 32-bit version, "x64" for the 64-bit version; in the following examples, // x86/x64 are interchangeable): " (x86)" (for release versions), " beta 2 (x64)", " beta 2 (SDK x86)", From 245418e894f10c54f395cffdfa6899b9097c2f21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 03:30:31 +0200 Subject: [PATCH 340/710] [translation] Fix src/plugins/shared/winliblt.cpp comments (#715) --- src/plugins/shared/winliblt.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/plugins/shared/winliblt.cpp b/src/plugins/shared/winliblt.cpp index 27790edbf..a278490da 100644 --- a/src/plugins/shared/winliblt.cpp +++ b/src/plugins/shared/winliblt.cpp @@ -108,7 +108,7 @@ void ReleaseWinLib(HINSTANCE dllInstance) // problem: after the plugin is unloaded, the app can crash because a window procedure may be called // in the unloaded DLL (if these are windows destroyed as part of terminated threads, that is OK) TRACE_E("Unable to release WinLibLT - some window or dialog (count = " << WindowsManager.WindowsCount << ") is still attached to WinLibLT!"); - // if it was a window from a terminated thread, WinLibLT can still be released; otherwise the unregister function will return an error + // return; // if this was a window from a terminated thread, WinLibLT can still be released; otherwise, the unregister function will return an error } // unregister the classes so they can be registered again on the next plugin load @@ -252,7 +252,7 @@ CWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) return TRUE; } if (GetWindowLong(HWindow, GWL_STYLE) & WS_CHILD) - break; // if F1 is not handled and this is a child window, let F1 fall through to the parent + break; // if F1 is not handled and this is a child window, let F1 propagate to the parent return TRUE; // if this is not a child window, stop processing F1 } } @@ -295,13 +295,13 @@ CWindow::CWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) wnd = (CWindow*)WindowsManager.GetWindowPtr(hwnd); if (wnd != NULL && wnd->Is(otWindow)) { - // Petr: moved this below wnd->WindowProc() so messages are still delivered during WM_DESTROY - // (Lukas needed this) + // Moved below wnd->WindowProc() so messages are still delivered during WM_DESTROY + // (needed by Lukas) // WindowsManager.DetachWindow(hwnd); LRESULT res = wnd->WindowProc(uMsg, wParam, lParam); - // now call the old procedure again (because of subclassing) + // now call the old procedure again due to subclassing WindowsManager.DetachWindow(hwnd); // if the current WndProc is not ours, do not change it, @@ -453,7 +453,7 @@ CDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) { WinLibLTHelpCallback(HWindow, HelpID); } - return TRUE; // do not let F1 fall through to the parent even if we do not call WinLibLTHelpCallback() + return TRUE; // do not let F1 propagate to the parent even if we do not call WinLibLTHelpCallback() } case WM_COMMAND: @@ -556,7 +556,7 @@ CDialog::CDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) if (dlg != NULL) return dlg->DialogProc(uMsg, wParam, lParam); else - return FALSE; // error, or the message did not arrive between WM_INITDIALOG and WM_DESTROY + return FALSE; // Error, or the message was not received between WM_INITDIALOG and WM_DESTROY } // @@ -675,7 +675,7 @@ CPropSheetPage::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) WinLibLTHelpCallback(HWindow, HelpID); return TRUE; } - break; // let F1 fall through to the parent + break; // allow F1 to propagate to the parent } case WM_NOTIFY: @@ -807,11 +807,11 @@ CPropSheetPage::CPropSheetPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, #endif } } - //--- call DialogProc(...) of the corresponding dialog object + //--- call DialogProc(...) on the corresponding dialog object if (dlg != NULL) return dlg->DialogProc(uMsg, wParam, lParam); else - return FALSE; // error, or the message did not arrive between WM_INITDIALOG and WM_DESTROY + return FALSE; // error, or the message was not received between WM_INITDIALOG and WM_DESTROY } // @@ -997,7 +997,7 @@ BOOL CWindowQueue::CloseAllWindows(BOOL force, int waitTime, int forceWaitTime) while ((w == INFINITE || w > 0) && !Empty()) { DWORD t = GetTickCount() - ti; - if (w == INFINITE || t < w) // keep waiting? + if (w == INFINITE || t < w) // still waiting? { if (w == INFINITE || 50 < w - t) Sleep(50); @@ -1021,7 +1021,7 @@ BOOL CWindowQueue::CloseAllWindows(BOOL force, int waitTime, int forceWaitTime) BOOL CTransferInfo::GetControl(HWND& ctrlHWnd, int ctrlID, BOOL ignoreIsGood) { if (!ignoreIsGood && !IsGood()) - return FALSE; // no point processing any further + return FALSE; // No point in processing further ctrlHWnd = GetDlgItem(HDialog, ctrlID); if (ctrlHWnd == NULL) { @@ -1101,7 +1101,7 @@ void CTransferInfo::EditLine(int ctrlID, double& value, char* format, BOOL selec BOOL expPart = FALSE; if (*s == '-' || *s == '+') s++; // skip a digit - while (*s != 0) // convert comma to dot + while (*s != 0) // convert comma to period { if (!expPart && !decPoints && (*s == ',' || *s == '.')) { From 8c643df78e8a63306e72879a540c231d862a189e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 03:30:33 +0200 Subject: [PATCH 341/710] [translation] Fix src/plugins/shared/winliblt.h comments (#716) --- src/plugins/shared/winliblt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/shared/winliblt.h b/src/plugins/shared/winliblt.h index 4bbd62140..8773b51b3 100644 --- a/src/plugins/shared/winliblt.h +++ b/src/plugins/shared/winliblt.h @@ -72,7 +72,7 @@ enum CObjectType // for identifying the object type // **************************************************************************** -class CWindowsObject // base class for all MS-Windows objects +class CWindowsObject // base class for all Windows objects { public: HWND HWindow; From f7011ad3ea68fa308d1451c5d5a4def3733fff7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 05:32:41 +0200 Subject: [PATCH 342/710] [translation] Fix src/common/array.h comments Refines translated comments in src/common/array.h. Model: OpenAI GPT-5.4 Verification: Ran the sequential scan -> ground -> review -> resolve -> apply -> guard pipeline against OpenSalamander/salamander main at unknown with baseline OpenSalamander/salamander a28afcb958578dd219311a7b500320b162de812b; reviewed 112 comment units, accepted 20 rewritten comment hunks, reran guard in the janrysavy/salamander delivery checkout with 0 violations, and confirmed git diff --check for src/common/array.h. Telemetry: review used 13 GPT-5.4 calls and resolve used 2 GPT-5.4 calls; cumulative telemetry recorded 15 provider calls and 317835 total tokens. --- src/common/array.h | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/common/array.h b/src/common/array.h index 8acfa4f96..eba656d11 100644 --- a/src/common/array.h +++ b/src/common/array.h @@ -4,10 +4,10 @@ #pragma once -// Use the _DEBUG or __ARRAY_DEBUG defines to enable various error state checking. Errors -// are displayed using TRACE_E and TRACE_C macros. -// Use the SAFE_ALLOC define to remove source code with testing if memory allocation -// has not failed (see allochan.*). +// Use the _DEBUG or __ARRAY_DEBUG defines to enable various error-state checks. Errors +// are displayed using the TRACE_E and TRACE_C macros. +// Use the SAFE_ALLOC define to remove code that tests whether memory allocation +// failed (see allochan.*). // We need to make this module independent of the TRACE macros, so if they are not defined, // we define dummy replacements. Error reporting will not work in that case. @@ -33,8 +33,8 @@ enum CDeleteType enum CErrorType { etNone, // OK - etLowMemory, // new - NULL - etUnknownIndex, // index is out of array range + etLowMemory, // new returned NULL + etUnknownIndex, // index is out of range for the array etBadInsert, // index of inserted item is out of array range etBadDispose, // index of disposed item is out of array range etDestructed, // array was already destructed using Destroy() method @@ -80,12 +80,12 @@ class TDirectArray } void Insert(int index, const DATA_TYPE& member); - int Add(const DATA_TYPE& member); // adds item to the end of array, returns item index + int Add(const DATA_TYPE& member); // adds an item to the end of the array, returns its index - void Insert(int index, const DATA_TYPE* members, int count); // insert 'count' of 'members' items - int Add(const DATA_TYPE* members, int count); // add 'count' of 'members' items + void Insert(int index, const DATA_TYPE* members, int count); // insert 'count' items from 'members' + int Add(const DATA_TYPE* members, int count); // adds 'count' items from 'members' - DATA_TYPE& At(int index) // returns pointer to item at 'index' possition + DATA_TYPE& At(int index) // returns a reference to the item at 'index' { #if defined(_DEBUG) || defined(__ARRAY_DEBUG) if (index >= 0 && index < Count) @@ -102,7 +102,7 @@ class TDirectArray #endif } - DATA_TYPE& operator[](int index) // returns pointer to item at 'index' possition + DATA_TYPE& operator[](int index) // returns a reference to the item at 'index' { #if defined(_DEBUG) || defined(__ARRAY_DEBUG) if (index >= 0 && index < Count) @@ -131,12 +131,12 @@ class TDirectArray void DestroyMembers(); // release items from memory (calling destructors), keep array void DetachMembers(); // detach all items (destructors are NOT called), keep array void Destroy(); // complete array destruction (calling destructors) - void Delete(int index); // delete item at 'index' possition (calling destructor), move remaining items - void Delete(int index, int count); // delete 'count' of items at 'index' possition (calling destructors), move remaining items - void Detach(int index); // detach item at 'index' possition (destructor is NOT called), move remaining items - void Detach(int index, int count); // detach 'count' of items at 'index' possition (destructors are NOT called), move remaining items + void Delete(int index); // deletes the item at 'index' (calling the destructor), moves remaining items + void Delete(int index, int count); // delete 'count' items at 'index' position (calling destructors), move remaining items + void Detach(int index); // detach item at 'index' position (destructor is NOT called), move remaining items + void Detach(int index, int count); // detach 'count' items at 'index' position (destructors are NOT called), move remaining items - int SetDelta(int delta); // change 'Delta', return real used value; NOTE: can be used only for empty array + int SetDelta(int delta); // change 'Delta', return the actual value used; NOTE: can be used only for an empty array protected: DATA_TYPE* Data; // pointer to array @@ -144,7 +144,7 @@ class TDirectArray int Base; // smallest allocated size of array int Delta; // allocated array size is enlarged/reduced by this value - virtual void Error(CErrorType err) // array error handling + virtual void Error(CErrorType err) // handles array errors { if (State == etNone) State = err; @@ -154,7 +154,7 @@ class TDirectArray void EnlargeArray(); // enlarges array void ReduceArray(); // reduces array - void Move(CArrayDirection direction, int first, int count); // move selected items to next/previous index + void Move(CArrayDirection direction, int first, int count); // moves selected items to the next or previous index void CallCopyConstructor(DATA_TYPE* placement, const DATA_TYPE& member) { @@ -372,12 +372,12 @@ class TSmallerDirectArray TRACE_C("Index is out of range (index = " << index << ", Count = " << Count << ")."); Error(etUnknownIndex); - return Data[0]; // because of the compiler, we return a possibly invalid item + return Data[0]; // compiler workaround: return a possibly invalid item } #endif } - DATA_TYPE& operator[](int index) // returns a reference to the item at 'index' + DATA_TYPE& operator[](int index) // returns a reference to the item at the given position { // int is used only to avoid warnings; range up to 65535 #if defined(_DEBUG) || defined(__ARRAY_DEBUG) if (index >= 0 && index < Count) @@ -389,7 +389,7 @@ class TSmallerDirectArray TRACE_C("Index is out of range (index = " << index << ", Count = " << Count << ")."); Error(etUnknownIndex); - return Data[0]; // because of the compiler, we return a possibly invalid item + return Data[0]; // return a possibly invalid element to satisfy the compiler } #endif } @@ -696,7 +696,7 @@ TDirectArray::TDirectArray(int base, int delta) template void TDirectArray::Destroy() { - if (State == etNone) // it can be also etDestructed + if (State == etNone) // State can also be etDestructed { if (Data != NULL) { @@ -785,7 +785,7 @@ void TDirectArray::Insert(int index, const DATA_TYPE* members, int co #if defined(_DEBUG) || defined(__ARRAY_DEBUG) if (State == etNone) { - if (Count + count > Available && members + count - 1 >= Data && // array will be reallocated and inserted items are from this array (items will be released after array reallocation) + if (Count + count > Available && members + count - 1 >= Data && // array will be reallocated and the inserted items come from this array (the items will be released after reallocation) members < Data + Count) { TRACE_C("Inserted items could become invalid during operation."); From 2097a358db00210d90825a8ade52a816ce62e5ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 05:33:45 +0200 Subject: [PATCH 343/710] [translation] Fix src/common/crc32.cpp comments Refines translated comments in src/common/crc32.cpp. Model: OpenAI GPT-5.4 Verification: Ran the sequential scan -> ground -> review -> resolve -> apply -> guard pipeline against OpenSalamander/salamander main at unknown with baseline OpenSalamander/salamander a28afcb958578dd219311a7b500320b162de812b; reviewed 10 comment units, accepted 1 rewritten comment hunks, reran guard in the janrysavy/salamander delivery checkout with 0 violations, and confirmed git diff --check for src/common/crc32.cpp. Telemetry: review used 2 GPT-5.4 calls and resolve used 1 GPT-5.4 calls; cumulative telemetry recorded 3 provider calls and 64914 total tokens. --- src/common/crc32.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/common/crc32.cpp b/src/common/crc32.cpp index 0b595ac05..0749b5b91 100644 --- a/src/common/crc32.cpp +++ b/src/common/crc32.cpp @@ -76,15 +76,15 @@ void MakeCrcTable(DWORD* crcTab) const DWORD poly = 0xedb88320L; //polynomial exclusive-or pattern /* - //generate crc polonomial, using precomputed poly should be faster - // terms of polynomial defining this crc (except x^32): - static const Byte p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26}; + // Generate the CRC polynomial; using a precomputed poly should be faster + // Terms of the polynomial defining this CRC (except x^32): + static const Byte p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26}; - // make exclusive-or pattern from polynomial (0xedb88320L) - poly = 0L; - for (n = 0; n < sizeof(p)/sizeof(Byte); n++) - poly |= 1L << (31 - p[n]); -*/ + // Make the exclusive-or pattern from the polynomial (0xedb88320L) + poly = 0L; + for (n = 0; n < sizeof(p)/sizeof(Byte); n++) + poly |= 1L << (31 - p[n]); + */ for (n = 0; n < 256; n++) { c = (DWORD)n; From 0c8c013539b76f3b768a08e8f318364f7257f9f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 05:33:55 +0200 Subject: [PATCH 344/710] [translation] Fix src/common/crc32.h comments Refines translated comments in src/common/crc32.h. Model: OpenAI GPT-5.4 Verification: Ran the sequential scan -> ground -> review -> resolve -> apply -> guard pipeline against OpenSalamander/salamander main at unknown with baseline OpenSalamander/salamander a28afcb958578dd219311a7b500320b162de812b; reviewed 7 comment units, accepted 1 rewritten comment hunks, reran guard in the janrysavy/salamander delivery checkout with 0 violations, and confirmed git diff --check for src/common/crc32.h. Telemetry: review used 2 GPT-5.4 calls and resolve used 1 GPT-5.4 calls; cumulative telemetry recorded 3 provider calls and 62314 total tokens. --- src/common/crc32.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/crc32.h b/src/common/crc32.h index a9d25c1d7..e50650ac6 100644 --- a/src/common/crc32.h +++ b/src/common/crc32.h @@ -6,7 +6,7 @@ //#define STATIC_CRC_TAB -//size of crc tab in the memory +// size of the CRC table in memory #define CRC_TAB_SIZE 256 * sizeof(DWORD) //initial value of crc shift register #define INIT_CRC 0L From 80ed189bd8a5b4567cc889652d5774bd3eb66b15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 05:34:04 +0200 Subject: [PATCH 345/710] [translation] Fix src/common/dib.cpp comments Refines translated comments in src/common/dib.cpp. Model: OpenAI GPT-5.4 Verification: Ran the sequential scan -> ground -> review -> resolve -> apply -> guard pipeline against OpenSalamander/salamander main at unknown with baseline OpenSalamander/salamander a28afcb958578dd219311a7b500320b162de812b; reviewed 19 comment units, accepted 1 rewritten comment hunks, reran guard in the janrysavy/salamander delivery checkout with 0 violations, and confirmed git diff --check for src/common/dib.cpp. Telemetry: review used 2 GPT-5.4 calls and resolve used 2 GPT-5.4 calls; cumulative telemetry recorded 4 provider calls and 85659 total tokens. --- src/common/dib.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/dib.cpp b/src/common/dib.cpp index be8e46e2e..5974a76cf 100644 --- a/src/common/dib.cpp +++ b/src/common/dib.cpp @@ -83,7 +83,7 @@ HBITMAP LoadBitmapAndMapColors(HINSTANCE hInst, HRSRC hRsrc, int mapCount, TRACE_E("Unable to create bitmap."); HANDLES(ReleaseDC(NULL, hDCScreen)); - // free copy of bitmap info struct and resource itself + // free the copy of the bitmap info struct and the resource itself free(lpBitmapInfo); FreeResource(hglb); From b790b37e82d640743c2fcccd566266ec8b8d59b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 05:34:14 +0200 Subject: [PATCH 346/710] [translation] Fix src/common/handles.cpp comments Refines translated comments in src/common/handles.cpp. Model: OpenAI GPT-5.4 Verification: Ran the sequential scan -> ground -> review -> resolve -> apply -> guard pipeline against OpenSalamander/salamander main at unknown with baseline OpenSalamander/salamander a28afcb958578dd219311a7b500320b162de812b; reviewed 86 comment units, accepted 7 rewritten comment hunks, reran guard in the janrysavy/salamander delivery checkout with 0 violations, and confirmed git diff --check for src/common/handles.cpp. Telemetry: review used 4 GPT-5.4 calls and resolve used 4 GPT-5.4 calls; cumulative telemetry recorded 8 provider calls and 176796 total tokens. --- src/common/handles.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/common/handles.cpp b/src/common/handles.cpp index 13adf19fd..29fa442b5 100644 --- a/src/common/handles.cpp +++ b/src/common/handles.cpp @@ -541,7 +541,7 @@ C__Handles::~C__Handles() else if (Handles[i].Handle.Origin == __hoGetStockObject) Handles.Delete(i); } - // Check and list the remaining handles. + // Check and list remaining open handles. if (Handles.Count != 0) { // The code below that uses MESSAGE_E had to be replaced because when this destructor runs, the stream facets in ALTAPDB have already been destroyed, and sending an int or handle to the stream simply crashes (only in VC2010 and VC2012; it still works in VC2008). It does not happen in Salamander, probably because the RTL is in the DLL (ALTAPDB uses a static one), but that was not investigated further. A better solution would be to destroy the facets only after this module, but that cannot be done here (only at the "lib" level). @@ -572,7 +572,7 @@ C__Handles::~C__Handles() TRACE_I("List of opened handles:"); for (int i = 0; i < Handles.Count; i++) { - // msgBuf workaround because of crashes in ALTAPDB; see the comment above for details. + // Workaround using msgBuf because of crashes in ALTAPDB; see the comment above for details. sprintf_s(msgBuf, "%p", Handles[i].Handle.Handle); TRACE_MI(Handles[i].File, Handles[i].Line, __GetHandlesTypeName(Handles[i].Handle.Type) << " - " << __GetHandlesOrigin(Handles[i].Handle.Origin) << " - " << msgBuf); @@ -581,7 +581,7 @@ C__Handles::~C__Handles() else { ConnectToTraceServer(); - // msgBuf workaround because of crashes in ALTAPDB; see the comment above for details. + // Workaround using msgBuf because of crashes in ALTAPDB; see the comment above for details. sprintf_s(msgBuf, "%d", Handles.Count); TRACE_I(__HandlesMessageNumberOpened << msgBuf); } @@ -717,7 +717,7 @@ BOOL C__Handles::DeleteHandle(C__HandlesType& type, HANDLE handle, } } } - if (foundTypeOK != -1) // Found only a handle exempt from release. + if (foundTypeOK != -1) // Found only a handle that does not need to be released. { type = Handles[foundTypeOK].Handle.Type; if (origin != NULL) @@ -917,7 +917,7 @@ C__Handles::CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, dwFlagsAndAttributes, hTemplateFile); char paramsBuf[MAX_PATH + 200]; const char* params = NULL; - if (ret == INVALID_HANDLE_VALUE) // parameters to buffer only when error occurs (can be displayed) + if (ret == INVALID_HANDLE_VALUE) // Buffer the parameters only when an error occurs (so they can be displayed) { DWORD err = GetLastError(); _snprintf_s(paramsBuf, _TRUNCATE, @@ -942,7 +942,7 @@ C__Handles::CreateFileW(LPCWSTR lpFileName, DWORD dwDesiredAccess, dwFlagsAndAttributes, hTemplateFile); WCHAR paramsBuf[800 + 200]; // Limit file names to 800 characters; anything longer would not be printed anyway because of the MESSAGES limit. const WCHAR* params = NULL; - if (ret == INVALID_HANDLE_VALUE) // parameters to buffer only when error occurs (can be displayed) + if (ret == INVALID_HANDLE_VALUE) // Store the parameters in the buffer only when an error occurs (so they can be displayed) { DWORD err = GetLastError(); _snwprintf_s(paramsBuf, _TRUNCATE, @@ -2342,7 +2342,7 @@ HFILE C__Handles::OpenFile(LPCSTR lpFileName, LPOFSTRUCT lpReOpenBuff, UINT uStyle) { HFILE ret = ::OpenFile(lpFileName, lpReOpenBuff, uStyle); - CheckCreate(ret != HFILE_ERROR, __htFile, __hoOpenFile, (HANDLE)(UINT_PTR)ret, GetLastError(), TRUE); // lpFileName is only char even in the Unicode version, so this function is unusable (obsolete); I left it out of the parameter dump. + CheckCreate(ret != HFILE_ERROR, __htFile, __hoOpenFile, (HANDLE)(UINT_PTR)ret, GetLastError(), TRUE); // lpFileName is char-only even in the Unicode version, so this function is unusable (obsolete) and is omitted from the parameter dump. return ret; } From b5efe3553a6bd5737ac56a23766d0b1ffca651fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 05:34:24 +0200 Subject: [PATCH 347/710] [translation] Fix src/common/messages.cpp comments Refines translated comments in src/common/messages.cpp. Model: OpenAI GPT-5.4 Verification: Ran the sequential scan -> ground -> review -> resolve -> apply -> guard pipeline against OpenSalamander/salamander main at unknown with baseline OpenSalamander/salamander a28afcb958578dd219311a7b500320b162de812b; reviewed 97 comment units, accepted 1 rewritten comment hunks, reran guard in the janrysavy/salamander delivery checkout with 0 violations, and confirmed git diff --check for src/common/messages.cpp. Telemetry: review used 3 GPT-5.4 calls; cumulative telemetry recorded 3 provider calls and 49277 total tokens. --- src/common/messages.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/messages.cpp b/src/common/messages.cpp index c1d34123a..7dc745788 100644 --- a/src/common/messages.cpp +++ b/src/common/messages.cpp @@ -166,8 +166,8 @@ struct C__MessageBoxData }; int CALLBACK __MessagesMessageBoxThreadF(C__MessageBoxData* data) -{ // must not wait for the calling thread to respond, because it will not respond - // therefore parent == NULL -> no window disabling, etc. +{ // must not wait for a response from the calling thread, because it will not respond + // therefore parent == NULL -> no disabling of windows, etc. data->Return = MessageBoxA(NULL, data->Text, data->Caption, data->Type | MB_SETFOREGROUND); return 0; } From 3d4e4c3b6b392579d3b21d367d613e149d1321f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 05:34:33 +0200 Subject: [PATCH 348/710] [translation] Fix src/common/multimon.cpp comments Refines translated comments in src/common/multimon.cpp. Model: OpenAI GPT-5.4 Verification: Ran the sequential scan -> ground -> review -> resolve -> apply -> guard pipeline against OpenSalamander/salamander main at unknown with baseline OpenSalamander/salamander a28afcb958578dd219311a7b500320b162de812b; reviewed 35 comment units, accepted 2 rewritten comment hunks, reran guard in the janrysavy/salamander delivery checkout with 0 violations, and confirmed git diff --check for src/common/multimon.cpp. Telemetry: review used 5 GPT-5.4 calls and resolve used 2 GPT-5.4 calls; cumulative telemetry recorded 7 provider calls and 133317 total tokens. --- src/common/multimon.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/multimon.cpp b/src/common/multimon.cpp index dc749d00b..68748778d 100644 --- a/src/common/multimon.cpp +++ b/src/common/multimon.cpp @@ -54,7 +54,7 @@ void MultiMonGetClipRectByWindow(HWND hByWnd, RECT* workClipRect, RECT* monitorC if (hByWnd != NULL && IsWindowVisible(hByWnd) && !IsIconic(hByWnd)) // Note: the same condition is also used in MultiMonCenterWindow. { hMonitor = MonitorFromWindow(hByWnd, MONITOR_DEFAULTTONEAREST); - // Get the desktop work area. + // Get the monitor work area. GetMonitorInfo(hMonitor, &mi); } else @@ -277,7 +277,7 @@ BOOL MultiMonEnsureRectVisible(RECT* rect, BOOL partialOK) if (intersect && partialOK) return FALSE; // The rectangle is already partially visible, so return FALSE. - // Make sure the rectangle does not extend past the monitor. + // Ensure the rectangle does not extend beyond the monitor work area. if (rect->right - rect->left > clipRect.right - clipRect.left) rect->right = clipRect.right - clipRect.left + rect->left; if (rect->bottom - rect->top > clipRect.bottom - clipRect.top) From 04f9ac8a13cb012df3928dd1a51079722b67da4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 05:34:43 +0200 Subject: [PATCH 349/710] [translation] Fix src/common/regexp.cpp comments Refines translated comments in src/common/regexp.cpp. Model: OpenAI GPT-5.4 Verification: Ran the sequential scan -> ground -> review -> resolve -> apply -> guard pipeline against OpenSalamander/salamander main at unknown with baseline OpenSalamander/salamander a28afcb958578dd219311a7b500320b162de812b; reviewed 174 comment units, accepted 17 rewritten comment hunks, reran guard in the janrysavy/salamander delivery checkout with 0 violations, and confirmed git diff --check for src/common/regexp.cpp. Telemetry: review used 20 GPT-5.4 calls and resolve used 30 GPT-5.4 calls; cumulative telemetry recorded 50 provider calls and 900284 total tokens. --- src/common/regexp.cpp | 46 +++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/common/regexp.cpp b/src/common/regexp.cpp index 894408083..8c5a87e4b 100644 --- a/src/common/regexp.cpp +++ b/src/common/regexp.cpp @@ -66,7 +66,7 @@ class C__RegExpSection C__RegExpSection __RegExpSection; -/* - custom error messages can be defined here; otherwise, just copy this into the code +/* - custom error messages can be defined here; otherwise, copying this into the code is sufficient const char *RegExpErrorText(CRegExpErrors err) { @@ -209,7 +209,7 @@ BOOL CRegularExpression::SetLine(const char* start, const char* end) memcpy(Line, start, LineLength); Line[LineLength] = 0; } - else // insensitive + else // case-insensitive { char* l = Line; while (start < end) @@ -226,7 +226,7 @@ BOOL CRegularExpression::SetLine(const char* start, const char* end) *l++ = *--end; *l = 0; } - else // insensitive + else // case-insensitive { char* l = Line; while (start < end) @@ -406,7 +406,7 @@ void CRegularExpression::ReverseRegExp(char*& dstExpEnd, char* srcExp, char* src { if (*ss != 0) ss++; - break; // The character after '\\' cannot be treated as a bracket. + break; // The character after '\\' cannot be treated as a parenthesis. } } } @@ -447,13 +447,13 @@ void CRegularExpression::ReverseRegExp(char*& dstExpEnd, char* srcExp, char* src else *--dstExpEnd = (*s == '(') ? ')' : ']'; - if (oldSS - s >= 2) // if the expression does not end with an opening parenthesis + if (oldSS - s >= 2) // if the expression does not end with an opening bracket { if (*s == '(') { // Copy the reversed expression - parenthesized group. ReverseRegExp(dstExpEnd, s + 1, oldSS - 1); } - else // Simple copy of the contents - character set. + else // Simple copy of the character set contents. { dstExpEnd -= (oldSS - 1) - (s + 1); memcpy(dstExpEnd, s + 1, (oldSS - 1) - (s + 1)); @@ -609,7 +609,7 @@ void CRegularExpression::ReverseRegExp(char*& dstExpEnd, char* srcExp, char* src /* * Flags to be passed up and down. */ -#define HASWIDTH 01 /* Known never to match null string. */ +#define HASWIDTH 01 /* Known never to match the empty string. */ #define SIMPLE 02 /* Simple enough to be STAR/PLUS operand. */ #define SPSTART 04 /* Starts with * or +. */ #define WORST 0 /* Worst case. */ @@ -830,7 +830,7 @@ char* reg(int paren /* Parenthesized? */, int* flagp) } /* - - regbranch - one alternative of an | operator + * regbranch - one alternative of the | operator * * Implements the concatenation operator. */ @@ -903,7 +903,7 @@ char* regpiece(int* flagp) regoptail(ret, regnode(BACK)); /* and loop */ regoptail(ret, ret); /* back */ regtail(ret, regnode(BRANCH)); /* or */ - regtail(ret, regnode(NOTHING)); /* null. */ + regtail(ret, regnode(NOTHING)); /* empty branch. */ } else if (op == '+' && (flags & SIMPLE)) reginsert(PLUS, ret); @@ -1068,7 +1068,7 @@ char* regnode(char op) /* Location. */ ptr = ret; *ptr++ = op; - *ptr++ = '\0'; /* Null "next" pointer. */ + *ptr++ = '\0'; /* Null "next" pointer byte. */ *ptr++ = '\0'; regcode = ptr; @@ -1087,9 +1087,9 @@ void regc(char b) } /* - - reginsert - insert an operator in front of already-emitted operand + * reginsert - insert an operator in front of an already-emitted operand * - * Means relocating the operand. + * This means relocating the operand. */ void reginsert(char op, char* opnd) { @@ -1176,7 +1176,7 @@ int regmatch(char* prog); int regrepeat(char* p); /* - - regexec - match a regexp against a string + - regexec - match a regular expression against a string */ int regexec(regexp* prog, char* string, int offset) { @@ -1239,7 +1239,7 @@ int regexec(regexp* prog, char* string, int offset) s++; } else - /* We don't -- general case. */ + /* We don't know the start character -- general case. */ do { if (regtry(prog, s)) @@ -1255,9 +1255,9 @@ int regexec(regexp* prog, char* string, int offset) } /* - - regtry - try match at specific point + - regtry - try a match at a specific point */ -int regtry(regexp* prog, char* string) /* 0 failure, 1 success */ +int regtry(regexp* prog, char* string) /* Returns 0 on failure, 1 on success. */ { int i; char** sp; @@ -1285,13 +1285,13 @@ int regtry(regexp* prog, char* string) /* 0 failure, 1 success */ } /* - - regmatch - main matching routine + * regmatch - main matching routine * - * Conceptually the strategy is simple: check to see whether the current - * node matches, call self recursively to see whether the rest matches, - * and then act accordingly. In practice we make some effort to avoid - * recursion, in particular by going through "ordinary" nodes (that don't - * need to know whether the rest of the match failed) by a loop instead of + * Conceptually the strategy is simple: check whether the current + * node matches, call itself recursively to see whether the rest matches, + * and then act accordingly. In practice, some effort is made to avoid + * recursion, in particular by going through "ordinary" nodes (that do not + * need to know whether the rest of the match failed) in a loop instead of * by recursion. */ int regmatch(char* prog) /* 0 failure, 1 success */ @@ -1453,7 +1453,7 @@ int regmatch(char* prog) /* 0 failure, 1 success */ if (nextch == '\0' || *reginput == nextch) if (regmatch(next)) return (1); - /* Couldn't or didn't -- back up. */ + /* Match failed or was skipped; back up. */ no--; reginput = save + no; } From 51b4bc411bae924328e3354c31dd608e429e8633 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 05:34:53 +0200 Subject: [PATCH 350/710] [translation] Fix src/common/sheets.cpp comments Refines translated comments in src/common/sheets.cpp. Model: OpenAI GPT-5.4 Verification: Ran the sequential scan -> ground -> review -> resolve -> apply -> guard pipeline against OpenSalamander/salamander main at unknown with baseline OpenSalamander/salamander a28afcb958578dd219311a7b500320b162de812b; reviewed 123 comment units, accepted 5 rewritten comment hunks, reran guard in the janrysavy/salamander delivery checkout with 0 violations, and confirmed git diff --check for src/common/sheets.cpp. Telemetry: review used 9 GPT-5.4 calls and resolve used 2 GPT-5.4 calls; cumulative telemetry recorded 11 provider calls and 224486 total tokens. --- src/common/sheets.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/common/sheets.cpp b/src/common/sheets.cpp index 66e3f94c1..7f3bbad54 100644 --- a/src/common/sheets.cpp +++ b/src/common/sheets.cpp @@ -310,7 +310,7 @@ CPropSheetPage::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) (GetKeyState(VK_SHIFT) & 0x8000) != 0); return TRUE; } - break; // let F1 fall through to the parent + break; // Let F1 propagate to the parent } case WM_CONTEXTMENU: @@ -446,7 +446,7 @@ CPropSheetPage::CPropSheetPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, if (dlg != NULL) return dlg->DialogProc(uMsg, wParam, lParam); else - return FALSE; // error, or the message did not arrive between WM_INITDIALOG and WM_DESTROY + return FALSE; // Error, or the message was not received between WM_INITDIALOG and WM_DESTROY } // @@ -569,7 +569,7 @@ CTPHCaptionWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) GetClientRect(HWindow, &r); int devCaps = GetDeviceCaps(hdc, NUMCOLORS); - if (devCaps == -1) // use the gradient only with more than 256 colors + if (devCaps == -1) // use the gradient only when more than 256 colors are available { HBRUSH hOldBrush = (HBRUSH)GetCurrentObject(hdc, OBJ_BRUSH); #define TPH_STEPS 100 @@ -762,7 +762,7 @@ CTreePropHolderDlg::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) (GetKeyState(VK_CONTROL) & 0x8000) != 0, (GetKeyState(VK_SHIFT) & 0x8000) != 0); } - return TRUE; // do not let F1 fall through to the parent even if we do not call WinLibHelp->OnHelp() + return TRUE; // do not let F1 propagate to the parent even if we do not call WinLibHelp->OnHelp() } case WM_COMMAND: @@ -806,7 +806,7 @@ CTreePropHolderDlg::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) } } - // forward the message so Enter reaches the default buttons + // forward the message so Enter is routed to the default buttons if (ChildDialog != NULL && HIWORD(wParam) == BN_CLICKED) ::SendMessage(ChildDialog->HWindow, uMsg, wParam, lParam); From c32c05fc382e39c073aae930c608d9710e4532eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 05:35:04 +0200 Subject: [PATCH 351/710] [translation] Fix src/common/sheets.h comments Refines translated comments in src/common/sheets.h. Model: OpenAI GPT-5.4 Verification: Ran the sequential scan -> ground -> review -> resolve -> apply -> guard pipeline against OpenSalamander/salamander main at unknown with baseline OpenSalamander/salamander a28afcb958578dd219311a7b500320b162de812b; reviewed 37 comment units, accepted 2 rewritten comment hunks, reran guard in the janrysavy/salamander delivery checkout with 0 violations, and confirmed git diff --check for src/common/sheets.h. Telemetry: review used 3 GPT-5.4 calls; cumulative telemetry recorded 3 provider calls and 70765 total tokens. --- src/common/sheets.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/sheets.h b/src/common/sheets.h index fc1bb8cec..8a6197c24 100644 --- a/src/common/sheets.h +++ b/src/common/sheets.h @@ -38,8 +38,8 @@ class CElasticLayout // controls that resize with the dialog (typically list views) TDirectArray ResizeCtrls; // temporary array populated by FindMoveCtrls; ideally this would be a local variable, but - // for easier calls to the FindMoveControls callback (which needs it passed in) - // I keep it as a class member + // for convenient calls to the FindMoveControls callback (to which it must be passed) + // it is stored as a class member TDirectArray MoveCtrls; }; @@ -179,7 +179,7 @@ class CTreePropHolderDlg : public CDialog CPropSheetPage* ChildDialog; int ExitButton; // ID of the button that closed the dialog - // dimensions in pixels + // dimensions in points SIZE MinWindowSize; // minimum dialog size (determined by the largest child dialog) DWORD* WindowHeight; // current dialog height int TreeWidth; // tree view width, calculated from the contents From 6867566dbc1ccfccb6f66e4391b088810307a9ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 05:35:14 +0200 Subject: [PATCH 352/710] [translation] Fix src/common/str.cpp comments Refines translated comments in src/common/str.cpp. Model: OpenAI GPT-5.4 Verification: Ran the sequential scan -> ground -> review -> resolve -> apply -> guard pipeline against OpenSalamander/salamander main at unknown with baseline OpenSalamander/salamander a28afcb958578dd219311a7b500320b162de812b; reviewed 126 comment units, accepted 11 rewritten comment hunks, reran guard in the janrysavy/salamander delivery checkout with 0 violations, and confirmed git diff --check for src/common/str.cpp. Telemetry: review used 9 GPT-5.4 calls and resolve used 25 GPT-5.4 calls; cumulative telemetry recorded 34 provider calls and 629852 total tokens. --- src/common/str.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/common/str.cpp b/src/common/str.cpp index 77ee9cade..94cde9e2d 100644 --- a/src/common/str.cpp +++ b/src/common/str.cpp @@ -143,7 +143,7 @@ int StrICmp(const char* s1, const char* s2) { res = (unsigned)LowerCase[*s1] - (unsigned)LowerCase[*s2++]; if (res != 0) - return (res < 0) ? -1 : 1; // < a > + return (res < 0) ? -1 : 1; // < or > if (*s1++ == 0) return 0; // == } @@ -160,14 +160,14 @@ int StrICmp(const char* s1, const char* s2) mov edi,[s1] // edi = s1 mov edx,table // edx = LowerCase - mov eax,255 // fall into loop + mov eax,255 // enter the loop xor ebx,ebx align 4 // compare chk_null: - or al,al // not that if al == 0, then eax == 0! + or al,al // note that if al == 0, then eax == 0 jz short done mov al,[esi] // al = *s2 @@ -259,14 +259,14 @@ int StrNICmp(const char* s1, const char* s2, int n) lupe: mov al,[esi] // al = *s1 - or eax,eax // see if *s1 is null + or eax,eax // check whether *s1 is null mov bl,[edi] // bl = *s2 jz short eject // jump if *s1 is null or ebx,ebx // see if *s2 is null - jz short eject // jump if so + jz short eject // jump if *s2 is null inc esi inc edi @@ -388,16 +388,16 @@ int StrICmpEx(const char* s1, int l1, const char* s2, int l2) { res = (unsigned)LowerCase[*s1++] - (unsigned)LowerCase[*s2++]; if (res != 0) - return (res < 0) ? -1 : 1; // < a > + return (res < 0) ? -1 : 1; // < or > } if (l1 != l2) - return (l1 < l2) ? -1 : 1; // < a > + return (l1 < l2) ? -1 : 1; // < or > else return 0; } /* -// princip asm funkce +// logic of the assembly function int StrICmpEx(const char *s1, int l1, const char *s2, int l2) { int l = (l1 < l2) ? l1 : l2; @@ -426,7 +426,7 @@ int StrICmpEx(const char* s1, int l1, const char* s2, int l2) // load up arguments mov ecx,[l] // ecx = byte count or ecx,ecx - jz toend // if count = 0, we are done + jz toend // if the byte count is 0, we are done mov esi,s1 // esi = buf1 mov edi,s2 // edi = buf2 @@ -485,7 +485,7 @@ int StrICmpEx(const char* s1, int l1, const char* s2, int l2) //***************************************************************************** /* -// puvodni funkce +// original function int StrCmpEx(const char *s1, int l1, const char *s2, int l2) { int res, l = (l1 < l2) ? l1 : l2; @@ -586,7 +586,7 @@ int StrLen(const char *str) /* //***************************************************************************** // -// Tabulky pro prevod kodu Kamenickych do MS Windows +// Tables for converting Kamenicky encoding to MS Windows // BYTE KodKamenickych[CONVERT_TAB_CHARS] = From 2d986fa1e9b5cf419d9153eace95f4406e3e7a14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 05:35:24 +0200 Subject: [PATCH 353/710] [translation] Fix src/common/trace.cpp comments Refines translated comments in src/common/trace.cpp. Model: OpenAI GPT-5.4 Verification: Ran the sequential scan -> ground -> review -> resolve -> apply -> guard pipeline against OpenSalamander/salamander main at unknown with baseline OpenSalamander/salamander a28afcb958578dd219311a7b500320b162de812b; reviewed 178 comment units, accepted 6 rewritten comment hunks, reran guard in the janrysavy/salamander delivery checkout with 0 violations, and confirmed git diff --check for src/common/trace.cpp. Telemetry: review used 16 GPT-5.4 calls and resolve used 2 GPT-5.4 calls; cumulative telemetry recorded 18 provider calls and 398227 total tokens. --- src/common/trace.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/common/trace.cpp b/src/common/trace.cpp index c7ed5dc41..8d1107b87 100644 --- a/src/common/trace.cpp +++ b/src/common/trace.cpp @@ -494,7 +494,7 @@ BOOL C__Trace::Connect(BOOL onUserRequest) // try to open the mutex for access to the shared memory HANDLE hOpenConnectionMutex; hOpenConnectionMutex = OpenMutex(/*MUTEX_ALL_ACCESS*/ SYNCHRONIZE, FALSE, __OPEN_CONNECTION_MUTEX); - if (hOpenConnectionMutex != NULL) // server found + if (hOpenConnectionMutex != NULL) // server available { // acquire ConnectionMutex DWORD waitRet; @@ -577,7 +577,7 @@ BOOL C__Trace::Connect(BOOL onUserRequest) else TRACE_E(oldTraceServerA); } - else // failed: try to create the pipe on the server side + else // failed; try creating the pipe on the server side { // write the new version to shared memory to ask the server to send the pipe write handle *(int*)&mapAddress[0] = expectedServerVer; // Version @@ -627,7 +627,7 @@ BOOL C__Trace::Connect(BOOL onUserRequest) CloseHandle(HWritePipe); HWritePipe = hWritePipeFromSrv; // use the pipe from the server (close the client one) - if (expectedServerVer == TRACE_CLIENT_VERSION) // successfully connected to the new Trace Server! + if (expectedServerVer == TRACE_CLIENT_VERSION) // success, connected to the new Trace Server { #ifdef TRACE_IGNORE_AUTOCLEAR ret = SendIgnoreAutoClear(TRUE); // ignore; disconnect on error @@ -646,7 +646,7 @@ BOOL C__Trace::Connect(BOOL onUserRequest) CloseHandle(hPipeSemaphoreFromSrv); } } - else // connect se nepovedl ani jednim zpusobem (asi stary Trace Server) + else // connect failed both ways (probably an old Trace Server) { if (expectedServerVer == TRACE_CLIENT_VERSION) // we tried the new server version { @@ -1022,7 +1022,7 @@ C__Trace::SendMessageToServer(C__MessageType type, BOOL crash) FlushFileBuffers(HTraceFile); // flush the data to disk #ifdef __TRACESERVER - // for Trace Server debugging: TRACE messages go only to the file; when TRACE_E arrives, show a msgbox + // for Trace Server debugging: TRACE messages go only to the file; when TRACE_E arrives, notify with a message box if (!crash && (type == __mtError || type == __mtErrorW)) { swprintf_s(bufW, L"Error message from Trace Server has been written to file with traces:\n%s", TraceFileName); @@ -1145,7 +1145,7 @@ C__Trace::SendMessageToServer(C__MessageType type, BOOL crash) // it is clear in the bug report exactly where the macros are; the crash therefore follows // after this method finishes } - else // block other threads with TRACE_C until the msgbox opened for + else // block other threads with TRACE_C until the message box opened by the first TRACE_C closes { // the first TRACE_C closes; then the first TRACE_C crashes there too, to avoid confusion if (msgBoxOpened) { From 1f3eecb0251e8cc36c55f6683c0db7788b765fcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 05:35:33 +0200 Subject: [PATCH 354/710] [translation] Fix src/common/winlib.cpp comments Refines translated comments in src/common/winlib.cpp. Model: OpenAI GPT-5.4 Verification: Ran the sequential scan -> ground -> review -> resolve -> apply -> guard pipeline against OpenSalamander/salamander main at unknown with baseline OpenSalamander/salamander a28afcb958578dd219311a7b500320b162de812b; reviewed 157 comment units, accepted 9 rewritten comment hunks, reran guard in the janrysavy/salamander delivery checkout with 0 violations, and confirmed git diff --check for src/common/winlib.cpp. Telemetry: review used 15 GPT-5.4 calls and resolve used 1 GPT-5.4 calls; cumulative telemetry recorded 16 provider calls and 332312 total tokens. --- src/common/winlib.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/common/winlib.cpp b/src/common/winlib.cpp index c259383fb..11372a806 100644 --- a/src/common/winlib.cpp +++ b/src/common/winlib.cpp @@ -26,8 +26,8 @@ #include "winlib.h" -// workaround for a runtime check failure in the debug build: the original macro casts rgb to WORD, -// so it reports data loss (the RED component) +// precaution against a runtime check failure in the debug build: the original macro casts rgb to WORD, +// so it reports data loss in the RED component #undef GetGValue #define GetGValue(rgb) ((BYTE)(((rgb) >> 8) & 0xFF)) @@ -329,7 +329,7 @@ CWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) } if (GetWindowLongPtr(HWindow, GWL_STYLE) & WS_CHILD) break; // if we do not handle F1 and this is a child window, let F1 fall through to the parent - return TRUE; // if it is not a child, stop processing F1 + return TRUE; // if this is not a child window, stop processing F1 } } #ifndef _UNICODE @@ -436,7 +436,7 @@ CWindow::CWindowProcInt(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL else wnd->HWindow = NULL; // no longer attached if (res == 0) - return 0; // the application handled the message + return 0; // the application processed the message wnd = NULL; } break; @@ -462,7 +462,7 @@ CWindow::CWindowProcInt(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL LRESULT lResult; if (wnd != NULL) lResult = wnd->WindowProc(uMsg, wParam, lParam); - else // error or the message arrived before WM_CREATE + else // an error occurred, or the message was received before WM_CREATE { #ifndef _UNICODE lResult = unicode ? DefWindowProcW(hwnd, uMsg, wParam, lParam) : DefWindowProcA(hwnd, uMsg, wParam, lParam); @@ -717,7 +717,7 @@ CDialog::CDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) else { dlg->HWindow = hwndDlg; - //--- insert the dialog into the window list by hwndDlg + //--- register the window in the window list under hwndDlg if (!WindowsManager.AddWindow(hwndDlg, dlg)) // error { TRACE_ET(_T("Unable to create dialog.")); @@ -1021,8 +1021,8 @@ void CTransferInfo::EnsureControlIsFocused(int ctrlID) HWND wnd = GetFocus(); while (wnd != NULL && wnd != ctrl) wnd = ::GetParent(wnd); - if (wnd == NULL) // set focus only if ctrl is not an ancestor of GetFocus() - { // for example, the edit box in a combo box + if (wnd == NULL) // Set focus only if ctrl is not an ancestor of the focused window. + { // This occurs, for example, with the edit box in a combo box. SendMessage(HDialog, WM_NEXTDLGCTL, (WPARAM)ctrl, TRUE); } } @@ -1108,7 +1108,7 @@ void CTransferInfo::EditLine(int ctrlID, double& value, TCHAR* format, BOOL sele BOOL expPart = FALSE; if (*s == _T('-') || *s == _T('+')) s++; // skip the digit - while (*s != 0) // convert comma to dot + while (*s != 0) // convert comma to period { if (!expPart && !decPoints && (*s == _T(',') || *s == _T('.'))) { @@ -1187,7 +1187,7 @@ void CTransferInfo::EditLine(int ctrlID, int& value, BOOL select) } TCHAR* endptr; - value = _tcstoul(buff, &endptr, 10); // replacement for atoi / _ttoi, which returns 2147483647 instead of 4000000000 (because it is SIGNED INT) + value = _tcstoul(buff, &endptr, 10); // replacement for atoi / _ttoi, which returns 2147483647 instead of 4000000000 because it uses signed int break; } } From e2856d5013d88be0b87a7b28c1d086511363a0cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 05:35:43 +0200 Subject: [PATCH 355/710] [translation] Fix src/common/winlib.h comments Refines translated comments in src/common/winlib.h. Model: OpenAI GPT-5.4 Verification: Ran the sequential scan -> ground -> review -> resolve -> apply -> guard pipeline against OpenSalamander/salamander main at unknown with baseline OpenSalamander/salamander a28afcb958578dd219311a7b500320b162de812b; reviewed 137 comment units, accepted 3 rewritten comment hunks, reran guard in the janrysavy/salamander delivery checkout with 0 violations, and confirmed git diff --check for src/common/winlib.h. Telemetry: review used 6 GPT-5.4 calls; cumulative telemetry recorded 6 provider calls and 126869 total tokens. --- src/common/winlib.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/winlib.h b/src/common/winlib.h index 836fc302f..19a97b242 100644 --- a/src/common/winlib.h +++ b/src/common/winlib.h @@ -67,7 +67,7 @@ enum CObjectType // for object type identification // **************************************************************************** -class CWindowsObject // base class of all MS-Windows objects +class CWindowsObject // base class for all Windows objects { public: HWND HWindow; @@ -122,8 +122,8 @@ class CWindowsObject // base class of all MS-Windows objects protected: CObjectOrigin ObjectOrigin; #ifndef _UNICODE - // windows: create: TRUE = the window is Unicode, otherwise ANSI; attach: TRUE = our window procedure - // is Unicode, otherwise ANSI; dialogs: TRUE = the dialog is Unicode, otherwise ANSI + // for windows: on create, TRUE = the window is Unicode, otherwise ANSI; on attach, TRUE = our window procedure + // is Unicode, otherwise ANSI; for dialogs: TRUE = the dialog is Unicode, otherwise ANSI BOOL UnicodeWnd; #endif // _UNICODE }; @@ -303,7 +303,7 @@ class CTransferInfo void EnsureControlIsFocused(int ctrlID); void EditLine(int ctrlID, TCHAR* buffer, DWORD bufferSizeInChars, BOOL select = TRUE); - void EditLine(int ctrlID, double& value, TCHAR* format, BOOL select = TRUE); // format napr. _T("%.2lf") + void EditLine(int ctrlID, double& value, TCHAR* format, BOOL select = TRUE); // format, e.g. _T("%.2lf") void EditLine(int ctrlID, int& value, BOOL select = TRUE); void EditLine(int ctrlID, __int64& value, BOOL select = TRUE, BOOL unsignedNum = FALSE /* signed number */, BOOL hexMode = FALSE /* decimal mode */, BOOL ignoreOverflow = FALSE, BOOL quiet = FALSE); From ddeffefa540ee10b2c149c4c36cb6dd4ed3fc7ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 09:58:31 +0200 Subject: [PATCH 356/710] [translation] Fix src/plugins/shared/auxtools.h comments (#731) Co-authored-by: Jan Rysavy --- src/plugins/shared/auxtools.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/shared/auxtools.h b/src/plugins/shared/auxtools.h index 7e7a6fd51..eab7a5464 100644 --- a/src/plugins/shared/auxtools.h +++ b/src/plugins/shared/auxtools.h @@ -21,7 +21,7 @@ struct CThreadQueueItem { HANDLE Thread; DWORD ThreadID; // debugging only (to find the thread in the debugger thread list) - int Locks; // pocet zamku, je-li > 0 nesmime zavrit 'Thread' + int Locks; // lock count; if > 0, 'Thread' must not be closed CThreadQueueItem* Next; CThreadQueueItem(HANDLE thread, DWORD tid) @@ -104,8 +104,8 @@ class CThreadQueue // **************************************************************************** // CThread // -// POZOR: musi se alokovat (neni mozne mit CThread jen na stacku); dealokuje se sam -// jen v pripade uspesneho vytvoreni threadu metodou Create() +// WARNING: it must be heap-allocated (it cannot exist only on the stack); it deallocates itself +// only if the thread is created successfully by the Create() method class CThread { From 727b3e5e1aecfb48f324ab7376f0cf1fc09652fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 09:58:35 +0200 Subject: [PATCH 357/710] [translation] Fix src/plugins/shared/dbg.h comments (#732) Co-authored-by: Jan Rysavy --- src/plugins/shared/dbg.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/shared/dbg.h b/src/plugins/shared/dbg.h index e5b661d18..f63d35969 100644 --- a/src/plugins/shared/dbg.h +++ b/src/plugins/shared/dbg.h @@ -495,8 +495,8 @@ class C__Trace int Line; // and the line number from which TRACE_X() is called C__StringStreamBuf TraceStringBuf; // string buffer drzici data trace streamu (ANSI) C__StringStreamBufW TraceStringBufW; // string buffer drzici data trace streamu (unicode) - C__TraceStream TraceStrStream; // vlastni trace stream (ANSI) - C__TraceStreamW TraceStrStreamW; // vlastni trace stream (unicode) + C__TraceStream TraceStrStream; // trace stream object (ANSI) + C__TraceStreamW TraceStrStreamW; // trace stream object (Unicode) public: C__Trace(); From fa016e2c873a0750f52434bdf209c7338f5eb754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 09:58:38 +0200 Subject: [PATCH 358/710] [translation] Fix src/plugins/shared/mhandles.cpp comments (#733) Co-authored-by: Jan Rysavy --- src/plugins/shared/mhandles.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/shared/mhandles.cpp b/src/plugins/shared/mhandles.cpp index bf2c23f11..d3d97a971 100644 --- a/src/plugins/shared/mhandles.cpp +++ b/src/plugins/shared/mhandles.cpp @@ -38,7 +38,7 @@ C__Handles __Handles; //***************************************************************************** // -// vlozeny modul MESSAGES (zobrazovani messageboxu v aktualnim nebo vlastnim threadu) +// embedded MESSAGES module (displaying message boxes in the current or a separate thread) // //***************************************************************************** @@ -54,7 +54,7 @@ HWND __MessagesParent = NULL; // Ensures the current thread has access to the module's functions and data. void EnterMessagesModul(); -// Call when the current thread no longer needs access to the module's functions and data. +// Call only after the current thread no longer needs access to the module's functions and data. void LeaveMessagesModul(); // Returns a pointer to a global buffer containing the sprintf result. @@ -239,7 +239,7 @@ const char* err(DWORD error) //***************************************************************************** // -// konec vlozeneho modulu MESSAGES +// end of embedded MESSAGES module // //***************************************************************************** @@ -1016,7 +1016,7 @@ C__Handles::CreateFile(LPCTSTR lpFileName, DWORD dwDesiredAccess, dwFlagsAndAttributes, hTemplateFile); char paramsBuf[MAX_PATH + 200]; const char* params = NULL; - if (ret == INVALID_HANDLE_VALUE) // format parameters into the buffer only on error (for display) + if (ret == INVALID_HANDLE_VALUE) // format parameters into the buffer only when an error occurs (so they can be displayed) { #ifdef __BORLANDC__ _snprintf(paramsBuf, MAX_PATH + 200, From 16a94ceef3b4a84ed8887c074bcad41c5b320400 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 09:58:41 +0200 Subject: [PATCH 359/710] [translation] Fix src/plugins/shared/lukas/array2.h comments (#734) Co-authored-by: Jan Rysavy --- src/plugins/shared/lukas/array2.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/shared/lukas/array2.h b/src/plugins/shared/lukas/array2.h index 1839edd0b..6905d7e2a 100644 --- a/src/plugins/shared/lukas/array2.h +++ b/src/plugins/shared/lukas/array2.h @@ -48,8 +48,8 @@ class TDirectArray2 // **************************************************************************** // CArray2: -// -predek vsech indirect poli -// -drzi typ (void *) v DWORD poli (kvuli uspore mista v .exe) +// -base class for all indirect arrays +// -stores (void *) values in a DWORD array (to save space in the .exe) class CArray2 : public TDirectArray2 { @@ -74,8 +74,8 @@ class CArray2 : public TDirectArray2 // **************************************************************************** // TIndirectArray2: -// -vhodne pro ulozeni ukazatelu na objekty -// -ostatni vlastnosti viz CArray +// -suitable for storing pointers to objects +// -for other properties, see CArray template class TIndirectArray2 : public CArray2 From 48d5d087709f4891d7084fb7e222f9133afd5542 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 09:58:44 +0200 Subject: [PATCH 360/710] [translation] Fix src/plugins/shared/lukas/messages.h comments (#735) Co-authored-by: Jan Rysavy --- src/plugins/shared/lukas/messages.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/shared/lukas/messages.h b/src/plugins/shared/lukas/messages.h index 84a461511..2fe17818b 100644 --- a/src/plugins/shared/lukas/messages.h +++ b/src/plugins/shared/lukas/messages.h @@ -10,7 +10,7 @@ struct CMessage { int Size; - int SenderID; // doplni message center pri odeslani + int SenderID; // filled in by the message center when sending }; #pragma pack(pop) From da288989a921c2ca7aab902b53cc3ece5ea171b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 09:58:48 +0200 Subject: [PATCH 361/710] [translation] Fix src/plugins/shared/lukas/gdi.h comments (#736) Co-authored-by: Jan Rysavy --- src/plugins/shared/lukas/gdi.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/plugins/shared/lukas/gdi.h b/src/plugins/shared/lukas/gdi.h index e25674958..ee00805f8 100644 --- a/src/plugins/shared/lukas/gdi.h +++ b/src/plugins/shared/lukas/gdi.h @@ -6,9 +6,8 @@ // **************************************************************************** // -// CBackbufferedDC -- DC s back bufferem, pro hladke kresleni slozitejsich -// grafickych celku -// +// CBackbufferedDC -- DC with a back buffer for smooth drawing of more +// complex graphics class CBackbufferedDC { From e82d31266e0711dc9bea3ceda60947ca91f0dffb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 09:58:52 +0200 Subject: [PATCH 362/710] [translation] Fix src/plugins/shared/lukas/lcutils.h comments (#737) Co-authored-by: Jan Rysavy --- src/plugins/shared/lukas/lcutils.h | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/plugins/shared/lukas/lcutils.h b/src/plugins/shared/lukas/lcutils.h index e9dd9b51d..e72c72caa 100644 --- a/src/plugins/shared/lukas/lcutils.h +++ b/src/plugins/shared/lukas/lcutils.h @@ -48,8 +48,7 @@ extern CSalamanderGUIAbstract* SalGUI; // **************************************************************************** // -// CCS -- samo-inicializujici se a samo-destruujici se kriticka sekce -// +// CCS -- self-initializing and self-destructing critical section struct CCS { @@ -81,10 +80,9 @@ const char* Concatenate(const char* string1, const char* string2); // **************************************************************************** // -// CDialogStack -- slouzi k ukladani hiearchie oken na zasobnik, vrchol -// zasobniku je parent pro zobrazovane message- a error-boxy, kazdy thread -// ma svou vlastni hierarchii oken -// +// CDialogStack -- stores the window hierarchy on a stack; the top of the +// stack is the parent for displayed message and error boxes; each thread +// has its own window hierarchy class CDialogStack { @@ -192,8 +190,7 @@ class CSynchronizedCounter // **************************************************************************** // -// CArgv -- Vytvori argument-vector z commanline retezce -// +// CArgv -- creates an argument vector from a command-line string class CArgv : public TIndirectArray { From 67b60b72d548bb34778c48d69a7e06df74fee01c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 09:58:55 +0200 Subject: [PATCH 363/710] [translation] Fix src/plugins/shared/spl_menu.h comments (#738) Co-authored-by: Jan Rysavy --- src/plugins/shared/spl_menu.h | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/plugins/shared/spl_menu.h b/src/plugins/shared/spl_menu.h index 797e45e87..f7c555ef6 100644 --- a/src/plugins/shared/spl_menu.h +++ b/src/plugins/shared/spl_menu.h @@ -22,14 +22,13 @@ class CSalamanderForOperationsAbstract; -// // **************************************************************************** // CSalamanderBuildMenuAbstract // -// sada metod Salamandera pro stavbu menu pluginu +// set of Salamander methods for building a plugin menu // -// jde o podmnozinu metod CSalamanderConnectAbstract, metody se stejne chovaji, -// pouzivaji se stejne konstanty, popis viz CSalamanderConnectAbstract +// this is a subset of the CSalamanderConnectAbstract methods; the methods behave the same, +// use the same constants; see CSalamanderConnectAbstract for details class CSalamanderBuildMenuAbstract { @@ -81,17 +80,17 @@ class CPluginInterfaceForMenuExtAbstract virtual DWORD WINAPI GetMenuItemState(int id, DWORD eventMask) = 0; // executes the menu command with identifier 'id'; for 'eventMask' see - // CSalamanderConnectAbstract::AddMenuItem, 'salamander' is the set of available - // Salamander methods for performing operations (WARNING: it may be NULL, see the description of the method - // CSalamanderGeneralAbstract::PostMenuExtCommand), 'parent' je parent messageboxu, + // CSalamanderConnectAbstract::AddMenuItem; 'salamander' is the set of Salamander methods + // available for performing operations (WARNING: it may be NULL; see the description of + // CSalamanderGeneralAbstract::PostMenuExtCommand); 'parent' is the parent window for message boxes, // returns TRUE if the selection in the panel should be cleared (Cancel was not used; Skip may have - // been used), otherwise returns FALSE (no deselection is performed); - // POZOR: Pokud prikaz zpusobi zmeny na nejake ceste (diskove/FS), mel by pouzit - // CSalamanderGeneralAbstract::PostChangeOnPathNotification pro informovani + // been used); otherwise returns FALSE (the selection is left unchanged); + // WARNING: if the command causes changes on some path (disk/FS), it should use + // CSalamanderGeneralAbstract::PostChangeOnPathNotification to notify // the panel without an automatic refresh and any open FSs (active and disconnected) // NOTE: if the command works with files/directories from the path in the current panel or - // even directly with this path, it is necessary to call - // CSalamanderGeneralAbstract::SetUserWorkedOnPanelPath pro aktualni panel, + // directly with that path itself, it is necessary to call + // CSalamanderGeneralAbstract::SetUserWorkedOnPanelPath for the current panel, // otherwise the path in this panel will not be added to the list of working // directories - List of Working Directories (Alt+F12) virtual BOOL WINAPI ExecuteMenuItem(CSalamanderForOperationsAbstract* salamander, HWND parent, From edb51b1b972d181086a263b1db763097e9dfc546 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 09:58:59 +0200 Subject: [PATCH 364/710] [translation] Fix src/plugins/shared/spl_thum.h comments (#739) Co-authored-by: Jan Rysavy Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/plugins/shared/spl_thum.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/plugins/shared/spl_thum.h b/src/plugins/shared/spl_thum.h index f32232ca7..415d0d641 100644 --- a/src/plugins/shared/spl_thum.h +++ b/src/plugins/shared/spl_thum.h @@ -92,13 +92,13 @@ class CPluginInterfaceForThumbLoaderAbstract // the dimensions of the requested thumbnail; 'thumbMaker' is the interface of the // thumbnail-generation algorithm (it can accept a finished thumbnail or create it by scaling the // image down); returns TRUE if the format of 'filename' is recognized; if it returns - // FALSE, Salamander zkusi nacist thumbnail pomoci jineho pluginu; chybu pri - // errors while obtaining the thumbnail (for example, a file read error) are reported through - // rozhrani 'thumbMaker' - viz metoda SetError; 'fastThumbnail' je TRUE v prvnim - // thumbnail-loading pass, the goal is to return the thumbnail as quickly as possible (even + // FALSE, Salamander will try to load the thumbnail using another plugin; errors while + // obtaining the thumbnail (for example, a file read error) are reported through + // the 'thumbMaker' interface - see the SetError method; 'fastThumbnail' is TRUE in the first + // thumbnail-loading pass, where the goal is to return the thumbnail as quickly as possible (even // at lower quality or smaller than required); in the second thumbnail-loading pass // (only if the SSTHUMB_ONLY_PREVIEW flag is set in the first pass), - // 'fastThumbnail' FALSE - cilem je vratit kvalitni thumbnail + // 'fastThumbnail' is FALSE - the goal is to return a high-quality thumbnail // limitation: because this is called from the icon-loading thread (not the main thread), only // methods of CSalamanderGeneralAbstract that are safe to call from any thread may be used // @@ -106,13 +106,13 @@ class CPluginInterfaceForThumbLoaderAbstract // - try to open the image // - if that fails, return FALSE // - extract the image dimensions - // - predat je do Salamandera pres thumbMaker->SetParameters + // - pass them to Salamander through thumbMaker->SetParameters // - if it returns FALSE, clean up and exit (buffer allocation failed) - // - SMYCKA + // - LOOP // - load part of the image data - // - poslat je do Salamandera pres thumbMaker->ProcessBuffer + // - pass it to Salamander through thumbMaker->ProcessBuffer // - if it returns FALSE, clean up and exit (interrupted due to a panel path change) - // - continue in SMYCCE until the entire image has been passed + // - continue the LOOP until the entire image has been passed // - clean up and exit virtual BOOL WINAPI LoadThumbnail(const char* filename, int thumbWidth, int thumbHeight, CSalamanderThumbnailMakerAbstract* thumbMaker, From af89d11add1d72cd007994677d551bf135bcd47d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 09:59:02 +0200 Subject: [PATCH 365/710] [translation] Fix src/plugins/shared/spl_file.h comments (#740) Co-authored-by: Jan Rysavy --- src/plugins/shared/spl_file.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/plugins/shared/spl_file.h b/src/plugins/shared/spl_file.h index 81cf53752..a92134f87 100644 --- a/src/plugins/shared/spl_file.h +++ b/src/plugins/shared/spl_file.h @@ -202,7 +202,7 @@ class CSalamanderSafeFileAbstract // source file. This name is displayed together with the size // and time ('srcFileInfo') in the prompt to overwrite an existing file, // if the 'fileName' file already exists. - // 'srcFileName' muze byt NULL, potom je 'srcFileInfo' ignorovano. + // 'srcFileName' may be NULL; 'srcFileInfo' is then ignored. // In that case, the overwrite prompt will display the text // "a newly created file" instead of the source file. // @@ -211,7 +211,7 @@ class CSalamanderSafeFileAbstract // and time of the source file. This information is displayed together with the name // of the source file 'srcFileName' in the prompt to overwrite an existing file. // Format: "size, date, time". - // Velikost ziskame pomoci CSalamanderGeneralAbstract::NumberToStr, + // Size is obtained using CSalamanderGeneralAbstract::NumberToStr, // date by calling GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, ... // and time by calling GetTimeFormat(LOCALE_USER_DEFAULT, 0, ... // See the implementation of the GetFileInfo method in the UnFAT plugin. @@ -251,18 +251,18 @@ class CSalamanderSafeFileAbstract // prompts by clicking the "Skip" or "Skip all" button. The buffer size is // given by the skipPathMax variable and will not be exceeded. The path is null-terminated. // At the beginning of SafeFileCreate, the buffer is set to an empty string. - // 'skipPath' muze byt NULL, 'skipPathMax' je potom ignorovano. + // 'skipPath' may be NULL; 'skipPathMax' is then ignored. // // 'skipPathMax' // [in] Size of the 'skipPath' buffer in characters. It must be set if 'skipPath' - // ruzna od NULL. + // is not NULL. // // 'allocateWholeFile' // [in/out] Pointer to a CQuadWord specifying the size to which the file should be // preallocated using SetEndOfFile. If the pointer is NULL, it is ignored // and SafeFileCreate does not attempt preallocation. If the pointer is not // NULL, the function attempts preallocation. The requested size must be greater than - // CQuadWord(2, 0) a mensi nez CQuadWord(0, 0x80000000) (8EB). + // CQuadWord(2, 0) and less than CQuadWord(0, 0x80000000) (8EB). // // If SafeFileCreate is also to perform a test (the preallocation mechanism may not always be // functional), the highest bit of the size must be set, that is, add @@ -271,10 +271,10 @@ class CSalamanderSafeFileAbstract // If the file is created successfully (SafeFileCreate returns a handle other than // INVALID_HANDLE_VALUE), the 'allocateWholeFile' variable is set to one of // the following values: - // CQuadWord(0, 0x80000000): soubor se nepodarilo predalokovat a behem pristiho + // CQuadWord(0, 0x80000000): the file could not be preallocated, and on the next // call to SafeFileCreate for files in the same destination - // by mela byt 'allocateWholeFile' NULL - // CQuadWord(0, 0): soubor se nepodarilo predalokovat, ale neni to nic + // 'allocateWholeFile' should be NULL + // CQuadWord(0, 0): the file could not be preallocated, but this is not // fatal, and on the next call to SafeFileCreate for // files with this destination you may request preallocation // other: preallocation completed successfully @@ -298,7 +298,7 @@ class CSalamanderSafeFileAbstract // INVALID_HANDLE_VALUE and sets the 'silentMask', 'skipped', and 'skipPath' variables. // // If 'isDir' is FALSE, returns the handle of the created file on success and, if - // je 'file' ruzne od NULL, plni strukturu SAFE_FILE. + // if 'file' is not NULL, the SAFE_FILE structure is filled. // On failure it returns INVALID_HANDLE_VALUE and sets the 'silentMask', // 'skipped' and 'skipPath' variables. // From f5295e0431c01c7c66760bb73aca861edd446dcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 09:59:05 +0200 Subject: [PATCH 366/710] [translation] Fix src/plugins/shared/winliblt.h comments (#741) Co-authored-by: Jan Rysavy --- src/plugins/shared/winliblt.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/shared/winliblt.h b/src/plugins/shared/winliblt.h index 8773b51b3..1a5f4ffa6 100644 --- a/src/plugins/shared/winliblt.h +++ b/src/plugins/shared/winliblt.h @@ -14,8 +14,8 @@ #pragma once -// makra pro potlaceni nepotrebnych casti WinLibLT (snazsi kompilace): -// ENABLE_PROPERTYDIALOG - je-li definovano, je mozne pouzivat property sheet dialog (CPropertyDialog) +// macros for omitting unneeded parts of WinLibLT (easier compilation): +// ENABLE_PROPERTYDIALOG - if defined, the property sheet dialog (CPropertyDialog) can be used // sets custom WinLib strings void SetWinLibStrings(const char* invalidNumber, // "not a number" (for numeric transfer buffers) From 975fe1b7d71bb515503f8a41118340ed677295a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 09:59:09 +0200 Subject: [PATCH 367/710] [translation] Fix src/plugins/mmviewer/ogg/oggparser.cpp comments (#742) Co-authored-by: Jan Rysavy --- src/plugins/mmviewer/ogg/oggparser.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/mmviewer/ogg/oggparser.cpp b/src/plugins/mmviewer/ogg/oggparser.cpp index 879af2600..26b184005 100644 --- a/src/plugins/mmviewer/ogg/oggparser.cpp +++ b/src/plugins/mmviewer/ogg/oggparser.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -25,7 +26,7 @@ typedef struct char* str; } OGG_COMMENT; -int FindComment(const char* in_string, int& offset, OGG_COMMENT comments[]) //s=string za '=' +int FindComment(const char* in_string, int& offset, OGG_COMMENT comments[]) // s=string after '=' { const char* in_string_orig = in_string; int i = 0; @@ -90,8 +91,8 @@ CParserOGG::GetFileInfo(COutputInterface* output) { if (f) { - // tags will be printed in this order. reorder them as you like - // musi byt upcase + // Tags will be printed in this order. Reorder them as you like. + // Tag names must be uppercase. OGG_COMMENT comments[] = { {"TRACKNUMBER", IDS_OGG_TRACK, NULL}, //The track number of this piece if part of a specific larger collection or album From 9973fadc7bdb00bec3635076b79808d622e1c415 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 09:59:12 +0200 Subject: [PATCH 368/710] [translation] Fix src/plugins/ftp/datacon1.cpp comments (#743) Co-authored-by: Jan Rysavy --- src/plugins/ftp/datacon1.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/plugins/ftp/datacon1.cpp b/src/plugins/ftp/datacon1.cpp index d7850b8a7..3330c5dd8 100644 --- a/src/plugins/ftp/datacon1.cpp +++ b/src/plugins/ftp/datacon1.cpp @@ -845,7 +845,7 @@ void CDataConnectionSocket::JustConnected() ReceivedConnected = TRUE; // if FD_READ arrives before FD_CONNECT (either way it must be connected) TransferSpeedMeter.JustConnected(); // Since we are already in CSocketsThread::CritSect, this call - // is allowed even from CSocket::SocketCritSect (no deadlock risk) + // is allowed even from CSocket::SocketCritSect (no deadlock risk) DoPostMessageToWorker(WorkerMsgConnectedToServer); // since we are already in the CSocketsThread::CritSect section, this call // can also be made from the CSocket::SocketCritSect section (no deadlock risk) @@ -1044,8 +1044,8 @@ void CDataConnectionSocket::ReceiveNetEvent(LPARAM lParam, int index) sendFDCloseAgain = TRUE; // if no timer for flushing data with the DATACON_FLUSHTIMEOUT timeout has been created yet, - // and the need to flush the buffer has not yet been recorded (NeedFlushReadBuf == 0), - // create a timer for flushing the data + // and the need to flush the buffer has not yet been recorded (NeedFlushReadBuf == 0), + // create a timer for flushing the data if (!FlushTimerAdded && NeedFlushReadBuf == 0) { // since we are already in CSocketsThread::CritSect, this call @@ -1110,7 +1110,7 @@ void CDataConnectionSocket::ReceiveNetEvent(LPARAM lParam, int index) else // all data are stored in the ReadBytes buffer { if (!lowMem && - ReadBytesAllocatedSize - ValidBytesInReadBytesBuf < DATACON_BYTESTOREADONSOCKET) // maly buffer 'ReadBytes' + ReadBytesAllocatedSize - ValidBytesInReadBytesBuf < DATACON_BYTESTOREADONSOCKET) // 'ReadBytes' buffer too small { int newSize = ValidBytesInReadBytesBuf + DATACON_BYTESTOREADONSOCKET + DATACON_BYTESTOREADONSOCKETPREALLOC; @@ -1287,11 +1287,11 @@ void CDataConnectionSocket::SocketWasClosed(DWORD error) NetEventLastError = error; // Since we are already in CSocketsThread::CritSect, this call - // is allowed even from CSocket::SocketCritSect (no deadlock risk) + // is allowed even from CSocket::SocketCritSect (no deadlock risk) DoPostMessageToWorker(WorkerMsgConnectionClosed); // Since we are already in CSocketsThread::CritSect, this call - // is allowed even from CSocket::SocketCritSect (no deadlock risk) + // is allowed even from CSocket::SocketCritSect (no deadlock risk) SocketsThread->DeleteTimer(UID, DATACON_TESTNODATATRTIMERID); HANDLES(LeaveCriticalSection(&SocketCritSect)); @@ -1382,7 +1382,7 @@ void CDataConnectionSocket::CloseTgtFile() if (FTPDiskThread->CancelWork(&DiskWork, &workIsInProgress)) { if (workIsInProgress) - DiskWork.FlushDataBuffer = NULL; // the work is in progress; we cannot free the buffer with the data being written/tested, leave it to the disk-work thread (see the cancellation part) - DiskWork can be written because after Cancel the disk thread must no longer access it (it may no longer exist) + DiskWork.FlushDataBuffer = NULL; // the work is already underway, so we cannot free the buffer with the data being written/tested; leave it to the disk-work thread (see the cancellation part) - we can still write to DiskWork because after Cancel the disk thread must no longer access it (it may not even exist anymore) else { // the work was cancelled before the disk thread started processing it - deallocate the flush buffer if (DiskWork.FlushDataBuffer != NULL) From dcba91b7d4f2320af6456e11d68aacebf7794a99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 09:59:15 +0200 Subject: [PATCH 369/710] [translation] Fix src/plugins/shared/spl_fs.h comments (#744) Co-authored-by: Jan Rysavy --- src/plugins/shared/spl_fs.h | 72 ++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 37 deletions(-) diff --git a/src/plugins/shared/spl_fs.h b/src/plugins/shared/spl_fs.h index 8b08c74b9..0d6c063fd 100644 --- a/src/plugins/shared/spl_fs.h +++ b/src/plugins/shared/spl_fs.h @@ -25,12 +25,11 @@ class CPluginFSInterfaceAbstract; class CSalamanderDirectoryAbstract; class CPluginDataInterfaceAbstract; -// // **************************************************************************** // CSalamanderForViewFileOnFSAbstract // -// sada metod ze Salamandera pro podporu provedeni ViewFile v CPluginFSInterfaceAbstract, -// platnost interfacu je omezena na metodu, ktere je interface predan jako parametr +// set of methods from Salamander for supporting ViewFile in CPluginFSInterfaceAbstract, +// the interface is valid only within the method to which it is passed as a parameter class CSalamanderForViewFileOnFSAbstract { @@ -74,7 +73,7 @@ class CSalamanderForViewFileOnFSAbstract // // Set of plugin methods that Salamander needs to work with the file system -// typ ikon v panelu pri listovani FS (pouziva se v CPluginFSInterfaceAbstract::ListCurrentPath()) +// icon type in the panel when listing the FS (used in CPluginFSInterfaceAbstract::ListCurrentPath()) #define pitSimple 0 // simple icons for files and directories - by extension (association) #define pitFromRegistry 1 // icons loaded from the registry according to the file/directory extension #define pitFromPlugin 2 // the plugin provides the icons (obtained via CPluginDataInterfaceAbstract) @@ -103,11 +102,11 @@ class CSalamanderForViewFileOnFSAbstract #define FSE_ACTIVATEREFRESH 4 // A timer of this FS has expired; 'param' is the parameter of that timer; -// POZOR: metoda CPluginFSInterfaceAbstract::Event() s kodem FSE_TIMER se vola +// WARNING: the CPluginFSInterfaceAbstract::Event() method with code FSE_TIMER is called // from the main thread after the WM_TIMER message is delivered to the main window (so, for example, // any modal dialog may currently be open), so the timer reaction should -// happen quietly (do not open windows, etc.); a call to -// CPluginFSInterfaceAbstract::Event() s kodem FSE_TIMER muze dojit hned po +// happen quietly (do not open any windows, etc.); a call to +// the CPluginFSInterfaceAbstract::Event() method with code FSE_TIMER may occur immediately after // the call to CPluginInterfaceForFS::OpenFS (if it adds a timer for // a newly created FS object) #define FSE_TIMER 5 @@ -266,15 +265,15 @@ class CPluginFSInterfaceAbstract // Only if GetSupportedServices() returns FS_SERVICE_GETCHANGEDRIVEORDISCONNECTITEM: // gets the item for this FS (active or detached) for the Change Drive menu (Alt+F1/F2) - // or the Disconnect dialog (hotkey: F12; disconnecting this FS, if needed, is handled by method - // CPluginInterfaceForFSAbstract::DisconnectFS; pokud GetChangeDriveOrDisconnectItem vrati - // FALSE a FS je v panelu, prida se polozka s ikonou ziskanou pres GetFSIcon a root cestou); + // or the Disconnect dialog (hotkey: F12; any disconnect of this FS is handled by the + // CPluginInterfaceForFSAbstract::DisconnectFS method; if GetChangeDriveOrDisconnectItem returns + // FALSE and the FS is in a panel, an item with the icon obtained via GetFSIcon and the root path is added); // if the return value is TRUE, an item with icon 'icon' and text 'title' is added; // 'fsName' is the current FS name; if 'icon' is NULL, the item has no icon; if // 'destroyIcon' is TRUE and 'icon' is not NULL, 'icon' is released after use via the Win32 API // function DestroyIcon; 'title' is text allocated on Salamander's heap and may contain - // up to three columns separated by '\t' (see the Alt+F1/F2 menu); only the second column is used in the Disconnect dialog; - // if the return value is FALSE, the output values + // up to three columns separated by '\t' (see the Alt+F1/F2 menu); only the second column is used + // in the Disconnect dialog; if the return value is FALSE, the output values // 'title', 'icon', and 'destroyIcon' are ignored (no item is added) virtual BOOL WINAPI GetChangeDriveOrDisconnectItem(const char* fsName, char*& title, HICON& icon, BOOL& destroyIcon) = 0; @@ -313,20 +312,20 @@ class CPluginFSInterfaceAbstract // 'path' is an in/out buffer containing the path (the buffer size is 'pathBufSize') virtual void WINAPI CompleteDirectoryLineHotPath(char* path, int pathBufSize) = 0; - // Only if GetSupportedServices() returns FS_SERVICE_GETPATHFORMAINWNDTITLE: - // obtains the text to display in the main window title when showing the current - // path in the main window title is enabled (see Configuration/Appearance/Display current - // path...); 'fsName' is the current FS name; if 'mode' is 1, this is - // Directory Name Only mode (only the current directory name - the last - // path component - should be displayed); if 'mode' is 2, this is - // Shortened Path mode (the shortened form of the path should be displayed - - // root (including the path separator) + ... + path separator - // + the last path component); 'buf' is a buffer of size 'bufSize' for the - // resulting text; returns TRUE if it returns the requested text; returns FALSE if the - // GetNextDirectoryLineHotPath() - // POZNAMKA: pokud GetSupportedServices() nevraci i FS_SERVICE_GETPATHFORMAINWNDTITLE, - // text should be generated from separator positions obtained by the method - // GetNextDirectoryLineHotPath() + // loads files and directories from the current path and stores them in the 'dir' object (for path NULL or + // "", files and directories on other paths are ignored; if a directory named + // ".." is added, it is drawn as the "up-dir" symbol; file and directory names are fully + // determined by the plugin, Salamander only displays them); Salamander obtains the contents of + // plugin-added columns through the 'pluginData' interface (if the plugin does not add columns + // and has no custom icons, it returns 'pluginData'==NULL); in 'iconsType' it returns the requested method + // of obtaining file and directory icons for the panel; pitFromPlugin degrades to pitSimple if + // 'pluginData' is NULL (without 'pluginData', pitFromPlugin cannot be provided); if 'forceRefresh' is + // TRUE, this is a hard refresh (Ctrl+R) and the plugin should load files and directories without using + // the cache; returns TRUE if loading succeeds; if it returns FALSE, an error occurred and ChangePath + // will be called on the current path; ChangePath is expected to select an accessible subpath + // or return FALSE; after a successful call to ChangePath, ListCurrentPath will be called again; + // if it returns FALSE, the return value 'pluginData' is ignored (the data in 'dir' must be + // released using 'dir.Clear(pluginData)', otherwise only the Salamander part of the data is released); virtual BOOL WINAPI GetPathForMainWindowTitle(const char* fsName, int mode, char* buf, int bufSize) = 0; // Only if GetSupportedServices() returns FS_SERVICE_SHOWINFO: @@ -508,27 +507,26 @@ class CPluginInterfaceForFSAbstract // Executes the command on an FS item in the Change Drive menu or in the Drive bars (for adding it, see CSalamanderConnectAbstract::SetChangeDriveMenuItem). 'panel' identifies the panel we should work with - for a command from the Change Drive menu, 'panel' is always PANEL_SOURCE (this menu can be opened only for the active panel); for a command from the Drive bars, 'panel' may be PANEL_LEFT or PANEL_RIGHT (if two Drive bars are enabled, we may work with the inactive panel). virtual void WINAPI ExecuteChangeDriveMenuItem(int panel) = 0; - // Opens a context menu on the FS item in the Change Drive menu or in the Drive + // opens a context menu on the FS item in the Change Drive menu or in the Drive // bars, or for an active/detached FS in the Change Drive menu; 'parent' is the parent // of the context menu; 'x' and 'y' are the coordinates for opening the context menu // (the right-mouse-button click position or the suggested coordinates for Shift+F10); - // je-li 'pluginFS' NULL jde o polozku pro FS, jinak je 'pluginFS' interface + // if 'pluginFS' is NULL, this is the item for the FS; otherwise 'pluginFS' is the interface // of the active/detached FS ('isDetachedFS' is FALSE/TRUE); if 'pluginFS' is not - // NULL, je v 'pluginFSName' jmeno FS otevreneho v 'pluginFS' (jinak je v - // 'pluginFSName' NULL) and 'pluginFSNameIndex' contains the index of the FS name opened + // NULL, 'pluginFSName' contains the name of the FS opened in 'pluginFS' (otherwise + // 'pluginFSName' is NULL) and 'pluginFSNameIndex' contains the index of the FS name opened // in 'pluginFS' (to make it easier to detect which FS name it is; otherwise // 'pluginFSNameIndex' is -1); if it returns FALSE, the other return values are // ignored; otherwise they have this meaning: 'refreshMenu' returns TRUE if the // Change Drive menu should be refreshed (ignored for Drive bars, because active/detached FSs are not shown there); 'closeMenu' returns TRUE if the // Change Drive menu should be closed (there is nothing to close for Drive bars); if 'closeMenu' - // is TRUE and 'postCmd' is not zero, after the Change Drive menu is closed (for Drive bars - // TRUE a 'postCmd' neni nula, je po zavreni Change Drive menu (pro Drive bary - // immediately) ExecuteChangeDrivePostCommand is also called with parameters 'postCmd' - // and 'postCmdParam'; 'panel' identifies the panel we should work with - for a + // is TRUE and 'postCmd' is not zero, after the Change Drive menu is closed (for Drive bars, + // immediately), ExecuteChangeDrivePostCommand is also called with parameters 'postCmd' + // and 'postCmdParam'; 'panel' identifies the panel to work with - for a // context menu in the Change Drive menu, 'panel' is always PANEL_SOURCE (this menu - // can be opened only for the active panel); for a context menu in the Drive bars - // 'panel' can be PANEL_LEFT or PANEL_RIGHT (if two Drive bars are enabled, we can - // work with the inactive panel as well) + // can be opened only for the active panel); for a context menu in the Drive bars, + // 'panel' can be PANEL_LEFT or PANEL_RIGHT (if two Drive bars are enabled, work can also + // continue with the inactive panel) virtual BOOL WINAPI ChangeDriveMenuItemContextMenu(HWND parent, int panel, int x, int y, CPluginFSInterfaceAbstract* pluginFS, const char* pluginFSName, int pluginFSNameIndex, From b9394118c7c622745f56ce2350daf98b82eb5d5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 09:59:19 +0200 Subject: [PATCH 370/710] [translation] Fix src/plugins/shared/spl_com.h comments (#745) Co-authored-by: Jan Rysavy --- src/plugins/shared/spl_com.h | 149 +++++++++++++++++------------------ 1 file changed, 73 insertions(+), 76 deletions(-) diff --git a/src/plugins/shared/spl_com.h b/src/plugins/shared/spl_com.h index 4e8a8a6bd..338c1935d 100644 --- a/src/plugins/shared/spl_com.h +++ b/src/plugins/shared/spl_com.h @@ -187,7 +187,7 @@ struct CQuadWord double GetDouble() const { // MSVC cannot convert unsigned __int64 to double, so this must be handled explicitly if (Value < CQuadWord(0, 0x80000000).Value) - return (double)(__int64)Value; // non-negative number + return (double)(__int64)Value; // positive number else return 9223372036854775808.0 + (double)(__int64)(Value - CQuadWord(0, 0x80000000).Value); } @@ -214,7 +214,7 @@ struct CFileData // no destructor may be added here! // allocated on Salamander's heap (see CSalamanderGeneralAbstract::Alloc/Realloc/Free) DWORD_PTR PluginData; // used by the plugin through CPluginDataInterfaceAbstract; Salamander ignores it unsigned NameLen : 9; // length of Name (strlen(Name)) - WARNING: the maximum name length is (MAX_PATH - 5) - unsigned Hidden : 1; // je hidden? (je-li 1, ikonka je pruhlednejsi o 50% - ghosted) + unsigned Hidden : 1; // is it hidden? (if 1, the icon is 50% more transparent - ghosted) unsigned IsLink : 1; // is it a link? (if 1, the icon gets the link overlay) - standard filling: see CSalamanderGeneralAbstract::IsFileLink(CFileData::Ext); when displayed, it takes precedence over IsOffline, but IconOverlayIndex takes precedence unsigned IsOffline : 1; // is it offline? (if 1, the icon gets the offline overlay - black clock); when displayed, IsLink and IconOverlayIndex take precedence unsigned IconOverlayIndex : 4; // icon overlay index (if the icon has no overlay, this is ICONOVERLAYINDEX_NOTUSED); when displayed, it takes precedence over IsLink and IsOffline @@ -226,7 +226,7 @@ struct CFileData // no destructor may be added here! unsigned Archive : 1; // is this an archive? used to display the archive icon in the panel unsigned SizeValid : 1; // has the directory size already been computed? unsigned Dirty : 1; // does this item need to be redrawn? (temporary only; the message queue must not be pumped between setting the bit and redrawing the panel, otherwise the icon may be redrawn by the icon reader and the bit reset; as a result the item will not be redrawn) - unsigned CutToClip : 1; // je CUT-nutej na clipboardu? (je-li 1, ikonka je pruhlednejsi o 50% - ghosted) + unsigned CutToClip : 1; // is it cut to the clipboard? (if 1, the icon is 50% more transparent - ghosted) unsigned IconOverlayDone : 1; // for icon-reader-thread use only: are we retrieving or have we already retrieved the icon overlay? (0 - no, 1 - yes) }; @@ -350,10 +350,8 @@ class CSalamanderDirectoryAbstract virtual void WINAPI SetApproximateCount(int files, int dirs) = 0; }; -// // **************************************************************************** -// SalEnumSelection a SalEnumSelection2 -// +// SalEnumSelection and SalEnumSelection2 // constants returned by SalEnumSelection and SalEnumSelection2 in the 'errorOccured' parameter #define SALENUM_SUCCESS 0 // no error occurred @@ -410,11 +408,10 @@ typedef const char*(WINAPI* SalEnumSelection2)(HWND parent, int enumFiles, const BOOL* isDir, CQuadWord* size, DWORD* attr, FILETIME* lastWrite, void* param, int* errorOccured); -// // **************************************************************************** // CSalamanderViewAbstract // -// sada metod Salamandera pro praci se sloupci v panelu (vypinani/zapinani/pridavani/nastavovani) +// set of Salamander methods for working with panel columns (hiding/showing/adding/configuring) // panel view modes #define VIEW_MODE_TREE 1 @@ -467,29 +464,29 @@ typedef int(WINAPI* FGetPluginIconIndex)(); struct CColumn { char Name[COLUMN_NAME_MAX]; // "Name", "Ext", "Size", ... column name under - // which the column appears in the view and menu + // which the column appears in the view and menu. // It must not contain an empty string. - // POZOR: Muze obsahovat (za prvnim null-terminatorem) - // also the name of the "Ext" column - this happens if there is no + // WARNING: After the first null terminator, it may also contain + // the name of the "Ext" column - this happens when there is no // separate "Ext" column and panel data (see - // CSalamanderDirectoryAbstract::SetValidData()) se - // contains VALID_DATA_EXTENSION. - // retezcu poslouzi CSalamanderGeneralAbstract::AddStrToStr(). + // CSalamanderDirectoryAbstract::SetValidData()) has + // VALID_DATA_EXTENSION set. Use CSalamanderGeneralAbstract::AddStrToStr() to join the two + // strings. - char Description[COLUMN_DESCRIPTION_MAX]; // Tooltip v header line + char Description[COLUMN_DESCRIPTION_MAX]; // Tooltip in the header line // It must not contain an empty string. - // POZOR: Muze obsahovat (za prvnim null-terminatorem) - // also the description of the "Ext" column - this happens if there is no + // WARNING: After the first null terminator, it may also contain + // the description of the "Ext" column - this happens when there is no // separate "Ext" column and panel data (see - // CSalamanderDirectoryAbstract::SetValidData()) se - // contains VALID_DATA_EXTENSION. - // retezcu poslouzi CSalamanderGeneralAbstract::AddStrToStr(). + // CSalamanderDirectoryAbstract::SetValidData()) has + // VALID_DATA_EXTENSION set. Use CSalamanderGeneralAbstract::AddStrToStr() to join the two + // strings. FColumnGetText GetText; // callback used to obtain text (see the FColumnGetText declaration) // FIXME_X64 - too small for a pointer, is it ever needed? DWORD CustomData; // Not used by Salamander; the plugin can - // use it to distinguish the columns added by the plugin. + // FIXME_X64 - too small for a pointer; is it ever needed? unsigned SupportSorting : 1; // can the column be sorted? @@ -543,7 +540,7 @@ class CSalamanderViewAbstract virtual DWORD WINAPI GetViewMode() = 0; // Sets the panel mode to 'viewMode'. If it is one of the detailed modes, it may - // remove some standard columns (see 'validData'). It is therefore best to call this + // remove some standard columns (see 'validData'). It is therefore advisable to call this // function first - before the other functions of this interface that modify // columns. // @@ -551,34 +548,34 @@ class CSalamanderViewAbstract // The panel mode cannot be changed to Types or to one of the three optional detailed modes // (all of them are represented by the VIEW_MODE_DETAILED constant used for the Detailed panel mode). // However, if one of these four modes is currently selected in the panel and 'viewMode' is - // VIEW_MODE_DETAILED, zustane tento rezim zvoleny (aneb neprepne se na Detailed rezim). + // VIEW_MODE_DETAILED, that mode remains selected (it does not switch to the Detailed mode). // Changing the panel mode is permanent (it remains even after leaving the plugin path). // // 'validData' tells which data the plugin wants to display in detailed mode; the value - // se ANDuje s maskou platnych dat zadanou pomoci CSalamanderDirectoryAbstract::SetValidData - // (there is no point in showing columns with "zeroed" values). + // is ANDed with the mask of valid data specified by CSalamanderDirectoryAbstract::SetValidData + // (there is no point in showing columns whose values are zeroed). virtual void WINAPI SetViewMode(DWORD viewMode, DWORD validData) = 0; - // Retrieves from Salamander the locations of the variables that replace the parameters of - // CColumn::GetText. Na strane Salamandera se jedna o globalni promenne. Plugin si - // stores pointers to them in its own global variables. + // Retrieves from Salamander the addresses of the variables that replace the parameters of + // CColumn::GetText. On Salamander's side these are global variables. The plugin stores + // pointers to them in its own global variables. // // variables: - // transferFileData [IN] data on the basis of which the item is drawn - // transferIsDir [IN] equal to 0 for a file (it is in Files), - // equal to 1 for a directory (it is in Dirs), - // equal to 2 for the up-dir symbol + // transferFileData [IN] data used to draw the item + // transferIsDir [IN] 0 for a file (it is in Files), + // 1 for a directory (it is in Dirs), + // 2 for the up-dir symbol // transferBuffer [OUT] output is written here, up to TRANSFER_BUFFER_MAX characters // it does not need to be null-terminated - // transferLen [OUT] before returning from the callback, this variable is set to - // the number of filled characters without a terminator (the terminator does not + // transferLen [OUT] before the callback returns, this variable is set to + // the number of written characters without the terminator (the terminator does not // need to be written to the buffer) // transferRowData [IN/OUT] points to a DWORD that is always cleared before columns are drawn // for each row; it can be used for optimizations // Salamander reserves bits 0x00000001 to 0x00000008. - // The other bits are available to the plugin. + // The remaining bits are available to the plugin. // transferPluginDataIface [IN] plugin-data interface of the panel in which the item is - // vykresluje (patri k (*transferFileData)->PluginData) + // drawn (it belongs to (*transferFileData)->PluginData) // transferActCustomData [IN] CustomData of the column for which text is being obtained (for which // the callback is called) virtual void WINAPI GetTransferVariables(const CFileData**& transferFileData, @@ -619,12 +616,12 @@ class CSalamanderViewAbstract // Sets the column name and description (they must not be empty strings or NULL). Their lengths // are limited to COLUMN_NAME_MAX and COLUMN_DESCRIPTION_MAX. Returns success. - // POZOR: Jmeno a popis sloupce "Name" muzou obsahovat (vzdy za prvnim - // null-terminator) also the name and description of the "Ext" column - this happens if there is no + // WARNING: The name and description of the "Name" column may also contain (always after the first + // null terminator) the name and description of the "Ext" column - this happens if there is no // separate "Ext" column and panel data (see - // CSalamanderDirectoryAbstract::SetValidData()) se nastavi VALID_DATA_EXTENSION. - // In this case, double strings must be set (with two - // null-terminatory) - viz CSalamanderGeneralAbstract::AddStrToStr(). + // CSalamanderDirectoryAbstract::SetValidData()) has VALID_DATA_EXTENSION set. + // In that case, double strings must be supplied (with two + // null terminators) - see CSalamanderGeneralAbstract::AddStrToStr(). virtual BOOL WINAPI SetColumnName(int index, const char* name, const char* description) = 0; // Removes the column at position 'index'. Both plugin-added columns @@ -738,31 +735,31 @@ class CPluginDataInterfaceAbstract // of CSalamanderGeneralAbstract that can be called from any thread may be used virtual int WINAPI CompareFilesFromFS(const CFileData* file1, const CFileData* file2) = 0; - // used to set view parameters; this method is always called before displaying new + // Used to set view parameters; this method is always called before displaying new // panel contents (when the path changes) and when the current view changes (including manual // column width changes); 'leftPanel' is TRUE for the left panel (FALSE for the right panel); // 'view' is the interface for modifying the view (setting the mode, working with // columns); for archive data, 'archivePath' contains the current path in the archive, - // pro data FS je 'archivePath' NULL; jde-li o data archivu, je 'upperDir' ukazatel na - // the parent directory (if the current path is the archive root, 'upperDir' is NULL), for - // FS je vzdy NULL; - // POZOR: behem volani teto metody nesmi dojit k prekresleni panelu (muze se zde zmenit - // icon size, etc.), so no message loops (no dialogs, etc.)! - // restriction: from CSalamanderGeneralAbstract, only methods that can be - // called from any thread may be used (methods independent of panel state) + // for FS data, 'archivePath' is NULL; for archive data, 'upperDir' points to the + // parent directory (if the current path is the archive root, 'upperDir' is NULL); for + // FS it is always NULL; + // WARNING: During this method call, the panel must not be redrawn (its state may change + // here), so no message loops (no dialogs, etc.)! + // Restriction: from CSalamanderGeneralAbstract, only methods that can be + // called from any thread may be used (methods independent of panel state) virtual void WINAPI SetupView(BOOL leftPanel, CSalamanderViewAbstract* view, const char* archivePath, const CFileData* upperDir) = 0; // setting a new value of "column->FixedWidth" - the user used the context menu // on a plugin-added column in the header line > "Automatic Column Width"; the plugin - // should store the new value of column->FixedWidth stored in 'newFixedWidth' - // (it is always the negation of column->FixedWidth), so that in subsequent calls to SetupView() it can + // should store the new value of column->FixedWidth from 'newFixedWidth' + // (it is always the negation of column->FixedWidth), so that on subsequent calls to SetupView() it can // add the column with FixedWidth already set correctly; at the same time, if fixed - // column width is being enabled, the plugin should set the current value of "column->Width" (so that - // enabling fixed width this way does not change the column width) - ideally call - // "ColumnWidthWasChanged(leftPanel, column, column->Width)"; 'column' identifikuje - // the column that is to be changed; 'leftPanel' is TRUE for a column in the left - // panelu (FALSE pokud jde o sloupec z praveho panelu) + // column width is being enabled, the plugin should store the current value of "column->Width" (so + // this change to fixed width does not change the column width) - ideally by calling + // "ColumnWidthWasChanged(leftPanel, column, column->Width)"; 'column' identifies the + // column to be changed; 'leftPanel' is TRUE for a column in the left + // panel (FALSE for a column in the right panel) virtual void WINAPI ColumnFixedWidthShouldChange(BOOL leftPanel, const CColumn* column, int newFixedWidth) = 0; @@ -777,17 +774,17 @@ class CPluginDataInterfaceAbstract // gets the Information Line contents for the 'file' file/directory ('isDir' TRUE/FALSE) // or for the selected files and directories ('file' is NULL and the counts of selected files/directories // are in 'selectedFiles'/'selectedDirs') in the panel ('panel' is one of PANEL_XXX); - // vola se i pri prazdnem listingu (tyka se jen FS, u archivu nemuze nastat, 'file' je NULL, + // it is also called for an empty listing (FS only; this cannot happen for archives: 'file' is NULL, // 'selectedFiles' and 'selectedDirs' are 0); if 'displaySize' is TRUE, the size of // all selected directories is known (see CFileData::SizeValid; if nothing is selected, it is - // TRUE); v 'selectedSize' je soucet cisel CFileData::Size oznacenych souboru a adresaru + // TRUE); 'selectedSize' is the sum of CFileData::Size values for the selected files and directories // (if nothing is selected, it is zero); 'buffer' is the buffer for the returned text (size - // 1000 bytes); 'hotTexts' is an array (size 100 DWORDs) that returns information about the position of - // hot-texts; the low WORD always contains the position of the hot-text in 'buffer', the high WORD contains - // the length of the hot-text; 'hotTextsCount' contains the size of the 'hotTexts' array (100) and returns the count - // of written hot-texts in 'hotTexts'; returns TRUE if 'buffer' + 'hotTexts' + + // 1000 bytes); 'hotTexts' is an array (size 100 DWORDs) that returns the positions of + // hot texts: the low WORD always contains the hot-text position in 'buffer', the high WORD contains + // its length; 'hotTextsCount' contains the size of the 'hotTexts' array (100) on input and returns the number + // of written hot texts in 'hotTexts'; returns TRUE if 'buffer', 'hotTexts', and // 'hotTextsCount' are set, returns FALSE if the Information Line should be filled in the standard - // zpusobem (jako na disku) + // way (as on disk) virtual BOOL WINAPI GetInfoLineContent(int panel, const CFileData* file, BOOL isDir, int selectedFiles, int selectedDirs, BOOL displaySize, const CQuadWord& selectedSize, char* buffer, DWORD* hotTexts, int& hotTextsCount) = 0; @@ -819,13 +816,13 @@ class CPluginDataInterfaceAbstract virtual BOOL WINAPI GetLastWriteTime(const CFileData* file, BOOL isDir, SYSTEMTIME* time) = 0; }; -// -// **************************************************************************** +//**************************************************************************** // CSalamanderForOperationsAbstract // -// sada metod ze Salamandera pro podporu provadeni operaci, platnost interfacu je -// omezena na metodu, ktere je interface predan jako parametr; tedy lze volat pouze -// z tohoto threadu a v teto metode (objekt je na stacku, takze po navratu zanika) +//set of Salamander methods that support operations; the interface is valid only +// for the method to which it is passed as a parameter, so it may be called only +// from that thread and in that method (the object is on the stack, so it ceases to +// exist after the method returns) class CSalamanderForOperationsAbstract { @@ -833,20 +830,20 @@ class CSalamanderForOperationsAbstract // PROGRESS DIALOG: the dialog contains one or two progress bars ('twoProgressBars' FALSE/TRUE) // opens a progress dialog titled 'title'; 'parent' is the parent window of the progress dialog (if // NULL, the main window is used); if it contains only one progress bar, it can be labeled - // as "File" ('fileProgress' is TRUE) or "Total" ('fileProgress' is FALSE) + // "File" ('fileProgress' is TRUE) or "Total" ('fileProgress' is FALSE) // - // the dialog does not run in its own thread; for it to work properly (Cancel button + internal timer), - // the message queue must be flushed occasionally; this is handled by the ProgressDialogAddText, + // the dialog does not run in its own thread; to keep it working (Cancel button + internal timer), + // the message queue must be pumped occasionally; this is done by the ProgressDialogAddText, // ProgressAddSize, and ProgressSetSize methods // - // because real-time display of text and progress-bar changes slows things down considerably, the + // because real-time updates of text and progress bars slow things down considerably, the // ProgressDialogAddText, ProgressAddSize, and ProgressSetSize methods have a 'delayedPaint' // parameter; it should be TRUE for all rapidly changing text and values; the methods then store - // the texts and display them only after the dialog's internal timer fires; set 'delayedPaint' to + // the text and display it only after the dialog's internal timer fires; set 'delayedPaint' to // FALSE for initial/final texts such as "preparing data..." or "canceling operation...", after - // displaying which we do not give the dialog a chance to dispatch messages (timer events); if such - // an operation is likely to take a long time, we should keep the dialog responsive during that time - // by calling ProgressAddSize(CQuadWord(0, 0), TRUE) and possibly terminate the action early + // which the dialog is not given a chance to dispatch messages (timer events); if such + // an operation is likely to take a long time, the dialog should be refreshed during that time + // by calling ProgressAddSize(CQuadWord(0, 0), TRUE), and the action may be terminated early // according to its return value virtual void WINAPI OpenProgressDialog(const char* title, BOOL twoProgressBars, HWND parent, BOOL fileProgress) = 0; From a8fc6451931149b6c238f767a1986fac5bbd175a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 09:59:23 +0200 Subject: [PATCH 371/710] [translation] Fix src/plugins/shared/spl_base.h comments (chunk 1/2) (#746) Co-authored-by: Jan Rysavy --- src/plugins/shared/spl_base.h | 137 ++++++++++++++++------------------ 1 file changed, 66 insertions(+), 71 deletions(-) diff --git a/src/plugins/shared/spl_base.h b/src/plugins/shared/spl_base.h index 2851e7b96..d5a47cd75 100644 --- a/src/plugins/shared/spl_base.h +++ b/src/plugins/shared/spl_base.h @@ -63,7 +63,7 @@ extern "C" } #endif -// the original SDK that shipped with VC6 had this value defined as 0x00000040 (year 1998, when the attribute was not yet used; it only arrived with W2K) +// the original SDK that shipped with VC6 defined this value as 0x00000040 (in 1998 the attribute did not yet exist; it was introduced with W2K) #if (FILE_ATTRIBUTE_ENCRYPTED != 0x00004000) #pragma message(__FILE__ " ERROR: FILE_ATTRIBUTE_ENCRYPTED != 0x00004000. You have to install latest version of Microsoft SDK. This value has changed!") #endif @@ -79,16 +79,15 @@ class CSalamanderGUIAbstract; class CSalamanderSafeFileAbstract; class CGUIIconListAbstract; -// // **************************************************************************** // CSalamanderDebugAbstract // -// sada metod ze Salamandera, ktere se pouzivaji pro hledani chyb v debug i release verzi +// set of Salamander methods used for debugging in both debug and release builds -// makro CALLSTK_MEASURETIMES - zapne mereni casu straveneho pri priprave call-stack hlaseni (meri se pomer proti -// celkovemu casu behu funkci) -// POZOR: nutne zapnout tez pro kazdy plugin zvlast -// makro CALLSTK_DISABLEMEASURETIMES - potlaci mereni casu straveneho pri priprave call-stack hlaseni v DEBUG/SDK/PB verzi +// CALLSTK_MEASURETIMES macro - enables measurement of time spent preparing call-stack reports (measured as a ratio to +// the total function runtime) +// WARNING: must also be enabled separately for each plugin +// CALLSTK_DISABLEMEASURETIMES macro - suppresses measurement of time spent preparing call-stack reports in DEBUG/SDK/PB builds #if (defined(_DEBUG) || defined(CALLSTK_MEASURETIMES)) && !defined(CALLSTK_DISABLEMEASURETIMES) struct CCallStackMsgContext @@ -118,8 +117,8 @@ class CSalamanderDebugAbstract // _beginthreadex and CreateThread; optional (UID is then -1) virtual void WINAPI TraceAttachThread(HANDLE thread, unsigned tid) = 0; - // nastavi jmeno aktivniho threadu pro TRACE, nepovine (thread je oznacen jako "unknown") - // POZOR: vyzaduje registraci threadu u TRACE (viz TraceAttachThread), jinak nic nedela + // sets the active thread name for TRACE; optional (the thread is then marked as "unknown") + // WARNING: requires the thread to be registered with TRACE (see TraceAttachThread), otherwise it does nothing virtual void WINAPI TraceSetThreadName(const char* name) = 0; virtual void WINAPI TraceSetThreadNameW(const WCHAR* name) = 0; @@ -129,12 +128,12 @@ class CSalamanderDebugAbstract // it runs 'threadBody' with the 'param' parameter and returns the result of 'threadBody' virtual unsigned WINAPI CallWithCallStack(unsigned(WINAPI* threadBody)(void*), void* param) = 0; - // uklada na CALL-STACK zpravu ('format'+'args' viz vsprintf), pri padu aplikace je - // obsah CALL-STACKU vypsan do okna Bug Report ohlasujiciho pad aplikace + // stores a message on the CALL-STACK ('format'+'args', see vsprintf); if the application crashes, + // the CALL-STACK contents are written to the Bug Report window reporting the crash virtual void WINAPI Push(const char* format, va_list args, CCallStackMsgContext* callStackMsgContext, BOOL doNotMeasureTimes) = 0; - // odstranuje z CALL-STACKU posledni zpravu, volani musi parovat s Push + // removes the last message from the CALL-STACK; the call must be paired with Push virtual void WINAPI Pop(CCallStackMsgContext* callStackMsgContext) = 0; // sets the active thread name for the VC debugger @@ -157,13 +156,12 @@ class CSalamanderDebugAbstract virtual void WINAPI AddModuleWithPossibleMemoryLeaks(const char* fileName) = 0; }; -// // **************************************************************************** // CSalamanderRegistryAbstract // -// sada metod Salamandera pro praci se systemovym registry, -// pouziva se v CPluginInterfaceAbstract::LoadConfiguration -// a CPluginInterfaceAbstract::SaveConfiguration +// set of Salamander methods for working with the system registry, +// used in CPluginInterfaceAbstract::LoadConfiguration +// and CPluginInterfaceAbstract::SaveConfiguration class CSalamanderRegistryAbstract { @@ -200,12 +198,11 @@ class CSalamanderRegistryAbstract virtual BOOL WINAPI GetSize(HKEY key, const char* name, DWORD type, DWORD& bufferSize) = 0; }; -// // **************************************************************************** // CSalamanderConnectAbstract // -// sada metod Salamandera pro navazani pluginu do Salamandera -// (custom pack/unpack + panel archiver view/edit + file viewer + menu-items) +// set of Salamander methods for connecting a plugin to Salamander +// (custom pack/unpack + panel archiver view/edit + file viewer + menu items) // constants for CSalamanderConnectAbstract::AddMenuItem #define MENU_EVENT_TRUE 0x0001 // always occurs @@ -238,11 +235,11 @@ class CSalamanderRegistryAbstract // #define SALHOTKEY(vk,mods,cst) ((DWORD)(((BYTE)(vk)|((WORD)((BYTE)(mods))<<8))|(((DWORD)(BYTE)(cst))<<16))) #define SALHOTKEY(vk, mods) ((DWORD)(((BYTE)(vk) | ((WORD)((BYTE)(mods)) << 8)))) -// makro pro pripravu 'hotKey' pro AddMenuItem() -// rika Salamanderu, ze polozky menu bude obsahovat horkou klavesu (oddelenou znakem '\t') -// Salamander nebude v tomto pripade kricet pomoci TRACE_E a horkou klavesu zobrazi v menu Plugins -// POZOR: nejedna se o horkou klavesu, kterou by Salamander dorucil pluginu, jde skutecne pouze o napis -// pokud uzivatel priradi v Plugin Manageru tomuto commandu vlastni horkou klavesu, bude hint potlacen +// macro for preparing 'hotKey' for AddMenuItem() +// tells Salamander that the menu item text contains a hot-key hint (separated by '\t') +// in this case Salamander will not complain via TRACE_E and will display the hot key in the Plugins menu +// WARNING: this is not a hot key that Salamander delivers to the plugin; it is really only a label +// if the user assigns this command a custom hot key in Plugin Manager, the hint is suppressed #define SALHOTKEY_HINT ((DWORD)0x00020000) class CSalamanderConnectAbstract @@ -281,12 +278,12 @@ class CSalamanderConnectAbstract virtual void WINAPI ForceRemovePanelArchiver(const char* extension) = 0; // adds the plugin to the list for "file viewer", - // 'masks' are the viewer masks handled by this plugin + // 'masks' are the viewer masks that this plugin should handle // (the separator is ';' (the escape sequence for ';' is ";;") and the '*' and '?' wildcards are used; // if possible, avoid spaces, and the '|' character is forbidden (inverse masks are not allowed)), // if this is not an upgrade of "file viewer" (or the addition of the whole plugin) and 'force' is FALSE, - // je volani ignorovano; je-li 'force' TRUE, prida 'masks' vzdy (pokud jiz nejsou na - // seznamu) - nutna prevence proti opakovanemu 'force'==TRUE (neustalemu pridavani 'masks') + // the call is ignored; if 'force' is TRUE, 'masks' are always added (if they are not already on the + // list) - repeated 'force'==TRUE must be prevented (to avoid constantly adding 'masks') virtual void WINAPI AddViewer(const char* masks, BOOL force) = 0; // removes a mask from the list for "file viewer" (only from items belonging to this plugin); @@ -297,32 +294,32 @@ class CSalamanderConnectAbstract // adds items to the Plugins/"plugin name" menu in Salamander, 'iconIndex' is the // item icon index (-1=no icon; for assigning a bitmap with icons see // CSalamanderConnectAbstract::SetBitmapWithIcons; u separatoru se ignoruje), 'name' je - // jmeno polozky (max. MAX_PATH - 1 znaku) nebo NULL jde-li o separator (parametry - // 'state_or'+'state_and' parameters have no meaning in that case); 'hotKey' is the hot key - // for the item, obtained with the SALHOTKEY macro; 'name' may contain a hot-key hint, + // the item name (max. MAX_PATH - 1 characters), or NULL for a separator (the + // 'state_or'+'state_and' parameters have no meaning in that case); 'hotKey' is the item's hot key + // obtained with the SALHOTKEY macro; 'name' may contain a hot-key hint, // separated by '\t'; in that case the 'hotKey' variable must be assigned the // SALHOTKEY_HINT, vice viz komentar k SALHOTKEY_HINT; 'id' je unikatni identifikacni - // cislo polozky v ramci pluginu (u separatoru ma vyznam jen je-li 'callGetState' TRUE), - // pokud je 'callGetState' TRUE, vola se pro zjisteni stavu polozky metoda + // item's unique identifier within the plugin (for a separator it matters only if 'callGetState' is TRUE), + // if 'callGetState' is TRUE, the item state is obtained by calling // CPluginInterfaceForMenuExtAbstract::GetMenuItemState (u separatoru ma vyznam jen stav // MENU_ITEM_STATE_HIDDEN, ostatni se ignoruji), jinak se k vypoctu stavu polozky (enabled/disabled) // is computed from 'state_or'+'state_and' - the item state is calculated by first building the mask // ('eventMask') as the logical OR of all events that occurred (see - // MENU_EVENT_XXX), polozka bude "enable" pokud bude nasl. vyraz TRUE: + // MENU_EVENT_XXX); the item is enabled if the following expression is TRUE: // ('eventMask' & 'state_or') != 0 && ('eventMask' & 'state_and') == 'state_and', // the 'skillLevel' parameter specifies for which user levels the item (or separator) // is displayed; the value contains one or more MENU_SKILLLEVEL_XXX constants ORed together; // menu items are updated on every plugin load (the items may change with configuration) - // POZOR: pro "dynamic menu extension" se pouziva CSalamanderBuildMenuAbstract::AddMenuItem + // WARNING: use CSalamanderBuildMenuAbstract::AddMenuItem for a "dynamic menu extension" virtual void WINAPI AddMenuItem(int iconIndex, const char* name, DWORD hotKey, int id, BOOL callGetState, DWORD state_or, DWORD state_and, DWORD skillLevel) = 0; // adds a submenu to the Plugins/"plugin name" menu in Salamander, 'iconIndex' // is the submenu icon index (-1=no icon; for assigning a bitmap with icons - // viz CSalamanderConnectAbstract::SetBitmapWithIcons), 'name' je jmeno + // see CSalamanderConnectAbstract::SetBitmapWithIcons), 'name' is the submenu // name (max. MAX_PATH - 1 characters), 'id' is the unique menu-item identifier - // menu v ramci pluginu (u submenu ma vyznam jen je-li 'callGetState' TRUE), - // pokud je 'callGetState' TRUE, vola se pro zjisteni stavu submenu metoda + // within the plugin menu (for a submenu it matters only if 'callGetState' is TRUE), + // if 'callGetState' is TRUE, the submenu state is obtained by calling // CPluginInterfaceForMenuExtAbstract::GetMenuItemState (vyznam maji jen stavy // MENU_ITEM_STATE_ENABLED and MENU_ITEM_STATE_HIDDEN states matter; the others are ignored), otherwise // the item state (enabled/disabled) is computed from 'state_or'+'state_and' - for the state calculation @@ -331,21 +328,21 @@ class CSalamanderConnectAbstract // MENU_SKILLLEVEL_XXX constants ORed together; the submenu is closed by calling // CSalamanderConnectAbstract::AddSubmenuEnd(); // menu items are updated on every plugin load (the items may change with configuration) - // POZOR: pro "dynamic menu extension" se pouziva CSalamanderBuildMenuAbstract::AddSubmenuStart + // WARNING: use CSalamanderBuildMenuAbstract::AddSubmenuStart for a "dynamic menu extension" virtual void WINAPI AddSubmenuStart(int iconIndex, const char* name, int id, BOOL callGetState, DWORD state_or, DWORD state_and, DWORD skillLevel) = 0; - // ukonci submenu v menu Plugins/"jmeno pluginu" v Salamanderu, dalsi polozky budou - // pridavany do vyssi (rodicovske) urovne menu; - // polozky v menu se updatuji pri kazdem loadu pluginu (mozna zmena polozek dle konfigurace) - // POZOR: pro "dynamic menu extension" se pouziva CSalamanderBuildMenuAbstract::AddSubmenuEnd + // ends the submenu in the Plugins/"plugin name" menu in Salamander; subsequent items are added + // to the higher-level (parent) menu; + // menu items are updated on every plugin load (the items may change with configuration) + // WARNING: use CSalamanderBuildMenuAbstract::AddSubmenuEnd for a "dynamic menu extension" virtual void WINAPI AddSubmenuEnd() = 0; - // nastavuje polozku pro FS v Change Drive menu a v Drive barach; 'title' je jeji text, - // 'iconIndex' je index jeji ikony (-1=zadna ikona; zadani bitmapy s ikonami viz + // sets the item for FS in the Change Drive menu and in drive bars; 'title' is its text, + // 'iconIndex' is the icon index (-1=no icon; for assigning a bitmap with icons see // CSalamanderConnectAbstract::SetBitmapWithIcons), 'title' muze obsahovat az tri sloupce - // vzajemne oddelene '\t' (viz Alt+F1/F2 menu); viditelnost polozky je mozne nastavit - // z Plugins Manageru nebo primo z pluginu pomoci metody + // separated by '\t' (see the Alt+F1/F2 menu); item visibility can be set + // from Plugins Manager or directly from the plugin by calling // CSalamanderGeneralAbstract::SetChangeDriveMenuItemVisibility virtual void WINAPI SetChangeDriveMenuItem(const char* title, int iconIndex) = 0; @@ -355,21 +352,21 @@ class CSalamanderConnectAbstract // CPluginInterfaceForThumbLoaderAbstract::LoadThumbnail virtual void WINAPI SetThumbnailLoader(const char* masks) = 0; - // nastavi bitmapu s ikonami pluginu; Salamander si obsah bitmapy kopiruje do internich - // struktur, plugin je zodpovedny za destrukci bitmapy (ze strany Salamanadera se - // bitmapa pouzije pouze behem teto funkce); pocet ikon se odvozuje ze - // sirky bitmapy, ikony jsou vzdy 16x16 bodu; transparentni cast ikon tvori fialova - // barva (RGB(255,0,255)), barevna hloubka bitmapy muze byt 4 nebo 8 bitu (16 nebo 256 - // barev), idealni je mit pripravene obe barevne varianty a vybirat z nich podle + // sets the bitmap with plugin icons; Salamander copies the bitmap contents into its internal + // structures, and the plugin is responsible for destroying the bitmap (on Salamander's side the + // bitmap is used only during this function); the number of icons is derived from the + // bitmap width, and the icons are always 16x16 pixels; the transparent part of the icons is + // purple (RGB(255,0,255)); the bitmap color depth may be 4 or 8 bits (16 or 256 + // colors); ideally, prepare both color variants and choose between them according to the // vysledku metody CSalamanderGeneralAbstract::CanUse256ColorsBitmap() - // POZOR: tato metoda je zastarala, nepodporuje alpha transparenci, pouzijte misto ni + // WARNING: this method is obsolete, does not support alpha transparency; use // SetIconListForGUI() virtual void WINAPI SetBitmapWithIcons(HBITMAP bitmap) = 0; // sets the plugin icon index used for the plugin in the Plugins/Plugins Manager window, // in the Help/About Plugin menu, and optionally also for the plugin submenu in the Plugins menu (for details - // viz CSalamanderConnectAbstract::SetPluginMenuAndToolbarIcon()); pokud plugin tuto - // method, the standard Salamander plugin icon is used; 'iconIndex' + // see CSalamanderConnectAbstract::SetPluginMenuAndToolbarIcon()); if the plugin does not call this + // method, the standard Salamander icon for the plugin is used; 'iconIndex' // is the icon index to set (for assigning a bitmap with icons see // CSalamanderConnectAbstract::SetBitmapWithIcons) virtual void WINAPI SetPluginIcon(int iconIndex) = 0; @@ -377,11 +374,11 @@ class CSalamanderConnectAbstract // sets the icon index for the plugin submenu, used for the plugin submenu // in the Plugins menu and optionally also in the top toolbar for the drop-down button used // to display the plugin submenu; if the plugin does not call this method, the - // plugin icon is used for the plugin submenu in the Plugins menu (configured by - // CSalamanderConnectAbstract::SetPluginIcon) and no toolbar button is shown - // for the plugin; 'iconIndex' is the icon index to set (-1=use the plugin icon - // pluginu, viz CSalamanderConnectAbstract::SetPluginIcon(); zadani bitmapy - // s ikonami viz CSalamanderConnectAbstract::SetBitmapWithIcons); + // plugin icon is used for the plugin submenu in the Plugins menu (see + // CSalamanderConnectAbstract::SetPluginIcon) and no button appears in the top toolbar + // for the plugin; 'iconIndex' is the icon index to set (-1=use the plugin icon, + // see CSalamanderConnectAbstract::SetPluginIcon(); for assigning a bitmap with icons see + // CSalamanderConnectAbstract::SetBitmapWithIcons); virtual void WINAPI SetPluginMenuAndToolbarIcon(int iconIndex) = 0; // sets the icon list with plugin icons; the icon list must be allocated by calling @@ -394,11 +391,10 @@ class CSalamanderConnectAbstract virtual void WINAPI SetIconListForGUI(CGUIIconListAbstract* iconList) = 0; }; -// // **************************************************************************** // CDynamicString // -// dynamicky string: realokuje se podle potreby +// dynamic string: reallocates as needed class CDynamicString { @@ -409,19 +405,18 @@ class CDynamicString virtual BOOL WINAPI Add(const char* str, int len = -1) = 0; }; -// // **************************************************************************** // CPluginInterfaceAbstract // -// sada metod pluginu, ktere potrebuje Salamander pro praci s pluginem +// set of plugin methods that Salamander needs to work with the plugin // -// Pro vetsi prehlednost jsou oddelene casti pro: -// archivatory - viz CPluginInterfaceForArchiverAbstract, -// viewry - viz CPluginInterfaceForViewerAbstract, -// rozsireni menu - viz CPluginInterfaceForMenuExtAbstract, -// file-systemy - viz CPluginInterfaceForFSAbstract, -// nacitace thumbnailu - viz CPluginInterfaceForThumbLoaderAbstract. -// Casti jsou pripojeny k CPluginInterfaceAbstract pres CPluginInterfaceAbstract::GetInterfaceForXXX +// For better clarity, separate parts are provided for: +// archivers - see CPluginInterfaceForArchiverAbstract, +// viewers - see CPluginInterfaceForViewerAbstract, +// menu extensions - see CPluginInterfaceForMenuExtAbstract, +// file systems - see CPluginInterfaceForFSAbstract, +// thumbnail loaders - see CPluginInterfaceForThumbLoaderAbstract. +// These parts are attached to CPluginInterfaceAbstract through CPluginInterfaceAbstract::GetInterfaceForXXX // flags indicating which functions the plugin provides (which methods of the // CPluginInterfaceAbstract descendant are actually implemented in the plugin): From 9126ea477fffafc167676b1b276547c9022eb737 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 09:59:26 +0200 Subject: [PATCH 372/710] [translation] Fix src/plugins/shared/spl_base.h comments (chunk 2/2) (#747) Co-authored-by: Jan Rysavy --- src/plugins/shared/spl_base.h | 69 +++++++++++++++++------------------ 1 file changed, 33 insertions(+), 36 deletions(-) diff --git a/src/plugins/shared/spl_base.h b/src/plugins/shared/spl_base.h index d5a47cd75..b6ca2aae7 100644 --- a/src/plugins/shared/spl_base.h +++ b/src/plugins/shared/spl_base.h @@ -473,16 +473,16 @@ class CPluginInterfaceAbstract // called in response to the About button in the Plugins window or the Help/About Plugins menu command virtual void WINAPI About(HWND parent) = 0; - // called before the plugin is unloaded (naturally only if SalamanderPluginEntry returned + // called before the plugin is unloaded (only if SalamanderPluginEntry returned // this object and not NULL); returns TRUE if the unload may proceed, - // 'parent' is the parent window for message boxes, 'force' is TRUE if the return + // 'parent' is the parent window for message boxes; 'force' is TRUE if the return // value is ignored; if it returns TRUE, this object and all other objects obtained from it // will no longer be used and the plugin will be unloaded; if a critical shutdown is in progress (see // CSalamanderGeneralAbstract::IsCriticalShutdown), nema smysl se usera na cokoliv ptat - // (do not open any more windows) + // (do not open any windows) // POZOR!!! Je nutne ukoncit vsechny thready pluginu (pokud Release vrati TRUE, vola se - // FreeLibrary is called on the plugin .SPL => the plugin code is unmapped from memory => the threads then - // have nothing left to execute => usually neither a bug report nor Windows exception info is generated) + // FreeLibrary is called on the plugin .SPL, so the plugin code is unmapped from memory and the threads + // have nothing left to run; usually neither a bug report nor Windows exception info is generated) virtual BOOL WINAPI Release(HWND parent, BOOL force) = 0; // method for loading the default configuration and for "load/save configuration" (loading from the plugin's private @@ -634,8 +634,8 @@ class CPluginInterfaceAbstract virtual void WINAPI Connect(HWND parent, CSalamanderConnectAbstract* salamander) = 0; // releases the 'pluginData' interface that Salamander obtained from the plugin by calling - // CPluginInterfaceForArchiverAbstract::ListArchive nebo - // CPluginFSInterfaceAbstract::ListCurrentPath; pred timto volanim jeste + // CPluginInterfaceForArchiverAbstract::ListArchive or + // CPluginFSInterfaceAbstract::ListCurrentPath; before this call, // file and directory data (CFileData::PluginData) are released using methods of // CPluginDataInterfaceAbstract virtual void WINAPI ReleasePluginDataInterface(CPluginDataInterfaceAbstract* pluginData) = 0; @@ -752,14 +752,14 @@ class CSalamanderPluginEntryAbstract virtual DWORD WINAPI GetLoadInformation() = 0; // loads the module with language-dependent resources (the SLG module); it always first tries to load the module - // for the same language Salamander is currently running in; if it cannot find such a module (or - // the version does not match), it lets the user choose an alternative module (if there is more than one - // alternative and the user's choice from the previous plugin load is not already stored); - // pluginu); pokud nenajde zadny modul, vraci NULL -> plugin by se mel ukoncit; - // 'parent' is the parent of the error message boxes and of the dialog for selecting an alternative + // for the same language Salamander is currently running in; if no such module is found (or + // the version does not match), it lets the user choose an alternative module (if more + // than one alternative exists and the user's choice from the previous plugin load is not already stored); + // if no module is found, it returns NULL and the plugin should terminate; + // 'parent' is the parent window for error message boxes and the dialog for selecting an alternative // language module; 'pluginName' is the plugin name (so the user knows which plugin // the error message or the alternative language module selection refers to) - // POZOR: tuto metodu je mozne volat jen jednou; ziskany handle jazykoveho modulu + // WARNING: this method may be called only once; the returned handle to the language module // is released automatically when the plugin is unloaded virtual HINSTANCE WINAPI LoadLanguageModule(HWND parent, const char* pluginName) = 0; @@ -785,51 +785,48 @@ class CSalamanderPluginEntryAbstract // adds another file-system name; without FUNCTION_FILESYSTEM in the 'functions' // parameter passed to SetBasicPluginData, this method always fails; - // 'fsName' is the proposed name (the assigned file-system name can be obtained with - // CSalamanderGeneralAbstract::GetPluginFSName) file systemu (povolene znaky jsou - // 'a-zA-Z0-9_+-', min. delka 2 znaky); v 'newFSNameIndex' (nesmi byt NULL) se - // vraci index nove pridaneho jmena file systemu; vraci TRUE v pripade uspechu; - // vraci FALSE pri fatalni chybe - v tomto pripade se 'newFSNameIndex' ignoruje + // 'fsName' is the proposed file-system name (the assigned name can be obtained with + // CSalamanderGeneralAbstract::GetPluginFSName); allowed characters are + // 'a-zA-Z0-9_+-'; the minimum length is 2 characters; 'newFSNameIndex' (must not be NULL) + // receives the index of the newly added file-system name; returns TRUE on success; + // returns FALSE on a fatal error - in that case 'newFSNameIndex' is ignored // limitation: must not be called before SetBasicPluginData virtual BOOL WINAPI AddFSName(const char* fsName, int* newFSNameIndex) = 0; }; -// // **************************************************************************** // FSalamanderPluginEntry // // Open Salamander 1.6 or Later Plugin Entry Point Function Type, -// tuto funkci plugin vyvazi jako "SalamanderPluginEntry" a Salamander ji vola -// pro pripojeni pluginu v okamziku loadu pluginu -// vraci interface pluginu v pripade uspesneho pripojeni, jinak NULL, -// interface pluginu se uvolnuje volanim jeho metody Release pred unloadem pluginu +// the plugin exports this function as "SalamanderPluginEntry", and Salamander calls it +// when the plugin is loaded to connect it; +// returns the plugin interface if the connection succeeds, otherwise NULL; +// the plugin interface is released by calling its Release method before the plugin is unloaded typedef CPluginInterfaceAbstract*(WINAPI* FSalamanderPluginEntry)(CSalamanderPluginEntryAbstract* salamander); -// // **************************************************************************** // FSalamanderPluginGetReqVer // // Open Salamander 2.5 Beta 2 or Later Plugin Get Required Version of Salamander Function Type, -// tuto funkci plugin vyvazi jako "SalamanderPluginGetReqVer" a Salamander ji vola -// jako prvni funkci pluginu (pred "SalamanderPluginGetSDKVer" a "SalamanderPluginEntry") -// v okamziku loadu pluginu; -// vraci verzi Salamandera, pro kterou je plugin staven (nejstarsi verze, do ktere lze plugin nacist) +// the plugin exports this function as "SalamanderPluginGetReqVer", and Salamander calls it +// as the first plugin function (before "SalamanderPluginGetSDKVer" and "SalamanderPluginEntry") +// when the plugin is loaded; +// returns the Salamander version the plugin was built for (the oldest version into which the plugin can be loaded) typedef int(WINAPI* FSalamanderPluginGetReqVer)(); -// // **************************************************************************** // FSalamanderPluginGetSDKVer // // Open Salamander 2.52 beta 2 (PB 22) or Later Plugin Get SDK Version Function Type, -// tuto funkci plugin volitelne vyvazi jako "SalamanderPluginGetSDKVer" a Salamander -// ji zkousi volat jako druhou funkci pluginu (pred "SalamanderPluginEntry") -// v okamziku loadu pluginu; -// vraci verzi SDK, pouziteho pro stavbu pluginu (informuje Salamandera, ktere metody -// plugin poskytuje); exportovat "SalamanderPluginGetSDKVer" ma smysl jen pokud vraci -// "SalamanderPluginGetReqVer" mensi cislo nez LAST_VERSION_OF_SALAMANDER; je vhodne -// vracet primo LAST_VERSION_OF_SALAMANDER +// the plugin may optionally export this function as "SalamanderPluginGetSDKVer", and Salamander +// tries to call it as the second plugin function (before "SalamanderPluginEntry") +// when the plugin is loaded; +// returns the SDK version used to build the plugin (it tells Salamander which methods +// the plugin provides); exporting "SalamanderPluginGetSDKVer" only makes sense if +// "SalamanderPluginGetReqVer" returns a number smaller than LAST_VERSION_OF_SALAMANDER; it is best +// to return LAST_VERSION_OF_SALAMANDER directly typedef int(WINAPI* FSalamanderPluginGetSDKVer)(); From d8b616eff66a90c6a941a5d9e47de0d4790ce7df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 12:25:36 +0200 Subject: [PATCH 373/710] [translation] Fix src/plugins/regedt/fs5.cpp comments (#748) Co-authored-by: Jan Rysavy <7381864+janrysavy@users.noreply.github.com> --- src/plugins/regedt/fs5.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/regedt/fs5.cpp b/src/plugins/regedt/fs5.cpp index 2e0941efe..930d4c403 100644 --- a/src/plugins/regedt/fs5.cpp +++ b/src/plugins/regedt/fs5.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -1099,7 +1100,7 @@ void CPluginFSInterface::OpenActiveFolder(const char* fsName, HWND parent) // regedit has no parameter to set which Registry path should be displayed // but we can set HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit\LastKey // in the form (e.g.) "Computer\HKEY_CURRENT_USER\AppEvents\Schemes\Apps" - // NOTE: the word "Computer" is localized as "PoÄítaÄ" on Czech Win7, fortunately regedit.exe + // NOTE: on localized Win7, the word "Computer" may be translated, but regedit.exe // does not require the word and the path may start directly at the HKEY_* root // store the current panel path into the LastKey value for RegEdit From af27a04f7b3fb42db1c3711d3cf1d315ad6a7bf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 12:26:30 +0200 Subject: [PATCH 374/710] [translation] Fix src/plugins/unmime/parser.cpp comments (#753) Co-authored-by: Jan Rysavy <7381864+janrysavy@users.noreply.github.com> --- src/plugins/unmime/parser.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/plugins/unmime/parser.cpp b/src/plugins/unmime/parser.cpp index 90a4c449c..2b2ad71cb 100644 --- a/src/plugins/unmime/parser.cpp +++ b/src/plugins/unmime/parser.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED /****************************************************************************************\ ** ** @@ -641,7 +642,7 @@ static void DestroyIllegalChars(LPSTR pszPath) } } -////// JMENA DEKODOVANYCH SOUBORU ////////////////////////////////////////////// +////// NAMES OF DECODED FILES ////////////////////////////////////////////// static void SetDefaultFileName(BOOL bAppendCharset) { @@ -721,7 +722,7 @@ static void MakeNamesUnique(CParserOutput* pOutput) } // sort the index qsort(index, numblocks, sizeof(char*), compare_file_names); - // identical names now lie next to each other and we can easily catch them + // identical names are now adjacent, so we can detect them easily int k, l; for (k = 1, l = 0; k < numblocks; k++) { @@ -871,7 +872,7 @@ static void EndCalcSize(CParserOutput* pOutput) } } -////// FUNKCE PRO ULOZENI/OBNOVENI STAVU PARSERU /////////////////////////////// +//FUNCTIONS FOR SAVING/RESTORING PARSER STATE /////////////////////////////// static void SaveState() { @@ -1039,7 +1040,7 @@ static BOOL TestUUBlock(CParserOutput* pOutput, BOOL& bEnd) static BOOL TestYEncBlock(CParserOutput* pOutput, BOOL& bEnd) { - // are we on a header? + // is this the header? if (memcmp(cLine, "=ybegin", 7)) return FALSE; From fc37f3d888654bd4adca0fc6064f5189896fbde0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 12:27:12 +0200 Subject: [PATCH 375/710] [translation] Fix src/plugins/shared/spl_gui.h comments (#752) Co-authored-by: Jan Rysavy <7381864+janrysavy@users.noreply.github.com> --- src/plugins/shared/spl_gui.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/shared/spl_gui.h b/src/plugins/shared/spl_gui.h index bc538d08b..410c812a6 100644 --- a/src/plugins/shared/spl_gui.h +++ b/src/plugins/shared/spl_gui.h @@ -1895,11 +1895,11 @@ class CGUIIconListAbstract // **************************************************************************** // CGUIToolbarHeaderAbstract // -// Pomocna lista umistena nad seznamem (napr. konfigurace HotPaths, UserMenu), -// ktera muze vpravo obsahovat toolbar s tlacitky pro ovladadni seznamu. +// Helper bar placed above a list (e.g. HotPaths or UserMenu configuration), +// which may contain a toolbar with buttons for controlling the list on the right. // -// Vsechny metody je mozne volat pouze z threadu okna, ve kterem -// byl objekt pripojen na windows control. +// All methods may be called only from the thread of the window in which +// the object was attached to a Windows control. // // bit masks for EnableToolbar() and CheckToolbar() From 9592edcebfa5f82ab3d8d47eb38f60ab04789443 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 12:27:55 +0200 Subject: [PATCH 376/710] [translation] Fix src/plugins/shared/spl_gen.h comments (#751) Co-authored-by: Jan Rysavy <7381864+janrysavy@users.noreply.github.com> --- src/plugins/shared/spl_gen.h | 78 ++++++++++++++++++------------------ 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/src/plugins/shared/spl_gen.h b/src/plugins/shared/spl_gen.h index d142e8a58..90b5caf25 100644 --- a/src/plugins/shared/spl_gen.h +++ b/src/plugins/shared/spl_gen.h @@ -13,7 +13,7 @@ #pragma once #ifdef _MSC_VER -#pragma pack(push, enter_include_spl_gen) // aby byly struktury nezavisle na nastavenem zarovnavani +#pragma pack(push, enter_include_spl_gen) // to keep structures independent of the current packing/alignment setting #pragma pack(4) #endif // _MSC_VER #ifdef __BORLANDC__ @@ -400,7 +400,7 @@ struct CSalamanderPluginViewerData const char* FileName; }; -// rozsireni struktury CSalamanderPluginViewerData pro interni text/hex viewer +// extension of the CSalamanderPluginViewerData structure for the internal text/hex viewer struct CSalamanderPluginInternalViewerData : public CSalamanderPluginViewerData { int Mode; // 0 - textovy mod, 1 - hexa mod @@ -530,7 +530,7 @@ class CSalamanderBMSearchData // 'flags' are algorithm flags (see the SASF_XXX constants) virtual void WINAPI Set(const char* pattern, const int length, WORD flags) = 0; - // nastaveni priznaku algoritmu; 'flags' jsou priznaky algoritmu (viz konstanty SASF_XXX) + // sets algorithm flags; 'flags' are algorithm flags (see SASF_XXX constants) virtual void WINAPI SetFlags(WORD flags) = 0; // returns the pattern length (usable only after a successful call to Set) @@ -650,18 +650,18 @@ class CSalamanderREGEXPSearchData // AgreeMasks) // // Object lifetime: -// 1) Alokujeme metodou CSalamanderGeneralAbstract::AllocSalamanderMaskGroup +// 1) Allocate it with CSalamanderGeneralAbstract::AllocSalamanderMaskGroup // 2) Pass the mask group to SetMasksString. // 3) Call PrepareMasks to build the internal data; if it fails, // show the error position and, after correcting the mask, return to step (3) // 4) Call AgreeMasks as needed to determine whether a name matches the mask group. // 5) After calling SetMasksString again, continue from step (3) -// 6) Destrukce objektu metodou CSalamanderGeneralAbstract::FreeSalamanderMaskGroup +// 6) Destroy the object with CSalamanderGeneralAbstract::FreeSalamanderMaskGroup // // Mask: // '?' - any character // '*' - any string, including an empty one -// '#' - libovolna cislice (pouze je-li 'extendedMode'==TRUE) +// '#' - any digit (only if 'extendedMode'==TRUE) // // Examples: // * - all names @@ -723,8 +723,8 @@ class CSalamanderMD5 // this method is published so the allocated object can be reused multiple times virtual void WINAPI Init() = 0; - // aktualizuje vnitrni stav objektu na zaklade bloku dat urceneho promennou 'input', - // 'input_length' udava velikost bufferu v bajtech + // updates the internal object state from the data block specified by 'input', + // 'input_length' specifies the buffer size in bytes virtual void WINAPI Update(const void* input, DWORD input_length) = 0; // Prepares the MD5 for retrieval by GetDigest @@ -736,7 +736,7 @@ class CSalamanderMD5 virtual void WINAPI GetDigest(void* dest) = 0; }; -#define SALPNG_GETALPHA 0x00000002 // pri vytvareni DIB se nastavi take alpha kanal (jinak bude roven 0) +#define SALPNG_GETALPHA 0x00000002 // when creating the DIB, the alpha channel is also initialized (otherwise it would be 0) #define SALPNG_PREMULTIPLE 0x00000004 // Meaningful only when SALPNG_GETALPHA is set; premultiplies the RGB components so AlphaBlend() can be called on the bitmap with BLENDFUNCTION::AlphaFormat == AC_SRC_ALPHA class CSalamanderPNGAbstract @@ -812,7 +812,7 @@ enum CHtmlHelpCommand HHCDisplayContext, // viz HH_HELP_CONTEXT: dwData = numeric ID of the topic to display }; -// slouzi jako parametr OpenHtmlHelpForSalamander pri command==HHCDisplayContext +// used as a parameter of OpenHtmlHelpForSalamander when command==HHCDisplayContext #define HTMLHELP_SALID_PWDMANAGER 1 // displays help for Password Manager class CPluginFSInterfaceAbstract; @@ -848,19 +848,19 @@ class CSalamanderGeneralAbstract // FlashWindow(mainwnd, FALSE) is called after it is closed; mainwnd is the parent of 'hParent' // that no longer has a parent (typically the Salamander main window). // - // SalMessageBox naplni strukturu MSGBOXEX_PARAMS (hParent->HParent, lpText->Text, - // lpCaption->Caption and uType->Flags; all other structure members are zeroed and - // SalMessageBoxEx is then called, so only SalMessageBoxEx is described below. + // SalMessageBox fills the MSGBOXEX_PARAMS structure (hParent->HParent, lpText->Text, + // lpCaption->Caption and uType->Flags; all other structure members are zeroed) and + // then calls SalMessageBoxEx, so only SalMessageBoxEx is described below. // // SalMessageBoxEx tries to behave as much as possible like the Windows API functions // MessageBox and MessageBoxIndirect. The differences are: // - the message box is centered on hParent (if it is a child window, the non-child parent is used) // - for MB_YESNO/MB_ABORTRETRYIGNORE message boxes, it is possible to enable // closing the window with Escape or by clicking the title-bar close box (flag - // MSGBOXEX_ESCAPEENABLED); navratova hodnota pak bude IDNO/IDCANCEL + // MSGBOXEX_ESCAPEENABLED); the return value will then be IDNO/IDCANCEL // - the beep can be suppressed (flag MSGBOXEX_SILENT) // - // Komentar k uType viz komentar k MSGBOXEX_PARAMS::Flags + // Comment for uType: see comment for MSGBOXEX_PARAMS::Flags // // Return Values // DIALOG_FAIL (0) The function fails. @@ -1100,9 +1100,9 @@ class CSalamanderGeneralAbstract // can be called from any thread virtual void WINAPI GetLowerAndUpperCase(unsigned char** lowerCase, unsigned char** upperCase) = 0; - // prevod retezce 'str' na mala/velka pismena; narozdil od ANSI C tolower/toupper pracuje - // rovnou s retezcem a podporuje nejen znaky 'A' az 'Z' (prevod na mala pismena provadi pres - // pole inicializovane Win32 API funkci CharLower) + // converts string 'str' to lowercase/uppercase; unlike ANSI C tolower/toupper it works + // directly on the string and supports more than just characters 'A' to 'Z' (conversion to lowercase is performed via + // an array initialized by the Win32 API function CharLower) virtual void WINAPI ToLowerCase(char* str) = 0; virtual void WINAPI ToUpperCase(char* str) = 0; @@ -1233,16 +1233,16 @@ class CSalamanderGeneralAbstract virtual int WINAPI MemICmp(const void* buf1, const void* buf2, int n) = 0; // Case-insensitive comparison of strings 's1' and 's2'; - // je-li SALCFG_SORTUSESLOCALE TRUE, pouziva razeni podle regionalniho nastaveni Windows, - // otherwise it compares them the same way as CSalamanderGeneral::StrICmp; if SALCFG_SORTDETECTNUMBERS - // TRUE, pouziva ciselne razeni pro cisla obsazene v retezcich + // if SALCFG_SORTUSESLOCALE is TRUE, Windows regional collation is used, + // otherwise they are compared the same way as CSalamanderGeneral::StrICmp; if SALCFG_SORTDETECTNUMBERS is + // TRUE, numeric sorting is used for numbers contained in the strings // returns <0 ('s1' < 's2'), ==0 ('s1' == 's2'), >0 ('s1' > 's2') virtual int WINAPI RegSetStrICmp(const char* s1, const char* s2) = 0; // Compares strings 's1' and 's2' (with lengths 'l1' and 'l2') case-insensitively. - // pismen (ignore-case), je-li SALCFG_SORTUSESLOCALE TRUE, pouziva razeni podle - // Windows regional settings; otherwise it compares them the same way as CSalamanderGeneral::StrICmp, - // je-li SALCFG_SORTDETECTNUMBERS TRUE, pouziva ciselne razeni pro cisla obsazene + // If SALCFG_SORTUSESLOCALE is TRUE, Windows regional collation is used, + // otherwise it compares them the same way as CSalamanderGeneral::StrICmp; + // if SALCFG_SORTDETECTNUMBERS is TRUE, numeric sorting is used for numbers contained // in the strings; if 'numericalyEqual' is not NULL, it returns TRUE if the strings are // numerically equal (for example, "a01" and "a1"); it is automatically TRUE if the strings are equal // returns <0 ('s1' < 's2'), ==0 ('s1' == 's2'), >0 ('s1' > 's2') @@ -1257,9 +1257,9 @@ class CSalamanderGeneralAbstract virtual int WINAPI RegSetStrCmp(const char* s1, const char* s2) = 0; // Case-sensitive comparison of strings 's1' and 's2' (with lengths 'l1' and 'l2'); if - // SALCFG_SORTUSESLOCALE TRUE, pouziva razeni podle regionalniho nastaveni Windows, + // SALCFG_SORTUSESLOCALE is TRUE, Windows regional collation is used, // otherwise it compares them the same way as the standard C library function strcmp; if - // SALCFG_SORTDETECTNUMBERS TRUE, pouziva ciselne razeni pro cisla obsazene v retezcich; + // SALCFG_SORTDETECTNUMBERS is TRUE, numeric sorting is used for numbers contained in the strings; // in 'numericalyEqual' (if not NULL), it returns TRUE if the strings are numerically equal // (e.g. "a01" and "a1"); it is automatically TRUE if the strings are equal // returns <0 ('s1' < 's2'), ==0 ('s1' == 's2'), >0 ('s1' > 's2') @@ -1622,8 +1622,8 @@ class CSalamanderGeneralAbstract // Duplicates '&'; useful for paths displayed in menus ('&&' is displayed as '&'). 'buffer' is an input/output string, and 'bufferSize' is the size of 'buffer' in bytes. Returns TRUE if duplicating '&' did not truncate characters from the end of the string, that is, the buffer was large enough. Callable from any thread. virtual BOOL WINAPI DuplicateAmpersands(char* buffer, int bufferSize) = 0; - // odstrani '&' z textu; najde-li dvojici "&&", nahradi ji jednim znakem '&' - // mozne volat z libovolneho threadu + // removes '&' from the text; if it finds the pair "&&", it replaces it with a single '&' + // can be called from any thread virtual void WINAPI RemoveAmpersands(char* text) = 0; // ValidateVarString and ExpandVarString: @@ -1798,7 +1798,7 @@ class CSalamanderGeneralAbstract // 'showCloseButton' specifies whether the window contains a Close button; equivalent to the Escape key virtual void WINAPI CreateSafeWaitWindow(const char* message, const char* caption, int delay, BOOL showCloseButton, HWND hForegroundWnd) = 0; - // zavreni okenka + // closing the window virtual void WINAPI DestroySafeWaitWindow() = 0; // Hide/show the window (if it is open); call in response to WM_ACTIVATE from hForegroundWnd: // case WM_ACTIVATE: @@ -1888,7 +1888,7 @@ class CSalamanderGeneralAbstract // Returns conversion tables one by one (loaded from convert\XXX\convert.cfg // in the Salamander installation - XXX is the currently used conversion-table directory); - // 'parent' je parent messageboxu (je-li NULL, je parent hlavni okno); + // 'parent' is the parent of the message box (if NULL, the main window is the parent); // 'index' is an input/output variable pointing to an int that is 0 on the first call; // the function stores the value for the next call on return (usage: initialize it to 0, then // do not modify it); returns FALSE if there is no next table; if it returns TRUE, @@ -1896,7 +1896,7 @@ class CSalamanderGeneralAbstract // underlined character in the menu) or NULL if it is a separator, and 'table' (if not NULL) // contains a pointer to a 256-byte conversion table or NULL if it is a separator; the 'name' // and 'table' pointers remain valid for the entire Salamander run (you do not need to copy them) - // POZOR: ukazatel 'table' pouzivat timto zpusobem (nutne pretypovani na "unsigned"): + // WARNING: use pointer 'table' this way (cast to "unsigned" is required): // *s = table[(unsigned char)*s] // Can be called from any thread virtual BOOL WINAPI EnumConversionTables(HWND parent, int* index, const char** name, const char** table) = 0; @@ -1924,10 +1924,10 @@ class CSalamanderGeneralAbstract // Determines from buffer 'pattern' of length 'patternLen' (e.g. the first 10000 characters) whether it is // text (there is a code page in which it contains only permitted characters - printable // and control) and, if it is text, also determines its most likely code page; - // 'parent' je parent messageboxu (je-li NULL, je parent hlavni okno); je-li 'forceText' - // TRUE, neprovadi se kontrola na nepovolene znaky (pouziva se, pokud 'pattern' obsahuje + // 'parent' is the parent of the message box (if NULL, the main window is the parent); if 'forceText' + // is TRUE, the check for disallowed characters is skipped (used when 'pattern' contains // text); if 'isText' is not NULL, TRUE is returned in it if the buffer is text; if 'codePage' - // NULL, jde o buffer (min. 101 znaku) pro jmeno kodove stranky (nejpravdepodobnejsi) + // is not NULL, it is a buffer (min. 101 characters) for the code-page name (the most likely one) // Can be called from any thread virtual void WINAPI RecognizeFileType(HWND parent, const char* pattern, int patternLen, BOOL forceText, BOOL* isText, char* codePage) = 0; @@ -2868,14 +2868,14 @@ class CSalamanderGeneralAbstract // Shows a security icon in panel 'panel' (a locked or unlocked padlock, for example FTPS uses it to inform // the user that the connection to the server is secured with SSL and that the server identity is either // verified (locked padlock) or not verified (unlocked padlock)); 'panel' is one of PANEL_XXX; - // je-li 'showIcon' TRUE, ikona se ukaze, jinak se schova; 'isLocked' urcuje, jestli jde - // whether the padlock is locked (TRUE) or unlocked (FALSE); if 'tooltip' is not NULL, it is the text shown + // if 'showIcon' is TRUE, the icon is shown, otherwise it is hidden; 'isLocked' determines whether + // the padlock is locked (TRUE) or unlocked (FALSE); if 'tooltip' is not NULL, it is the text shown // when the mouse hovers over the icon (if it is NULL, no text is shown); if clicking the security icon should // perform an action (for example, FTPS displays a server certificate dialog), it must be added to the - // serveru), je nutne ji pridat do metody CPluginFSInterfaceAbstract::ShowSecurityInfo file-systemu - // displayed in the panel; + // file-system's CPluginFSInterfaceAbstract::ShowSecurityInfo method + // shown for the file system displayed in the panel; // NOTE: a suitable place to show the security icon for an FS is when handling - // FSE_PATHCHANGED, to uz je FS v panelu (jestli se ma nebo nema ikona zobrazit se muze urcit + // FSE_PATHCHANGED, once the FS is already in the panel (whether the icon should be shown or hidden can be determined // in ChangePath or ListCurrentPath) // NOTE: the security icon is automatically hidden immediately before the panel path changes or // before a refresh (for an FS, this means immediately after a successful ListCurrentPath call; for archives, From bd8509606bec9b9da172864af6430e425a7d3f03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 12:28:24 +0200 Subject: [PATCH 377/710] [translation] Fix src/plugins/shared/spl_base.h comments (#750) Co-authored-by: Jan Rysavy <7381864+janrysavy@users.noreply.github.com> --- src/plugins/shared/spl_base.h | 207 +++++++++++++++++----------------- 1 file changed, 104 insertions(+), 103 deletions(-) diff --git a/src/plugins/shared/spl_base.h b/src/plugins/shared/spl_base.h index b6ca2aae7..f32f50823 100644 --- a/src/plugins/shared/spl_base.h +++ b/src/plugins/shared/spl_base.h @@ -506,97 +506,97 @@ class CPluginInterfaceAbstract // called to connect the plugin to Salamander; called only after LoadConfiguration, // 'parent' is the parent of the message boxes; 'salamander' is the set of methods used to connect the plugin - /* PRAVIDLA PRO IMPLEMENTACI METODY CONNECT - (pluginy musi mit ulozenou verzi konfigurace - viz DEMOPLUGin, - promenna ConfigVersion a konstanta CURRENT_CONFIG_VERSION; nize je - nazorny PRIKLAD pridani pripony "dmp2" do DEMOPLUGinu): - - -s kazdou zmenou je potreba zvysit cislo verze konfigurace - CURRENT_CONFIG_VERSION - (v prvni verzi metody Connect je CURRENT_CONFIG_VERSION=1) - -do zakladni casti (pred podminky "if (ConfigVersion < YYY)"): - -se napise kod pro instalaci pluginu (uplne prvni load pluginu): - viz metody CSalamanderConnectAbstract - -pri upgradech je nutne aktualizovat seznamy pripon pro instalaci pro "custom archiver +/* RULES FOR IMPLEMENTING THE CONNECT METHOD + (plugins must store the configuration version - see DEMOPLUGin, + variable ConfigVersion and constant CURRENT_CONFIG_VERSION; below is + an illustrative EXAMPLE of adding the "dmp2" extension to DEMOPLUGin): + + -with every change, increase the configuration version number - CURRENT_CONFIG_VERSION + (in the first version of the Connect method, CURRENT_CONFIG_VERSION=1) + -in the basic section (before the condition "if (ConfigVersion < YYY)"): + -write code for plugin installation (the very first plugin load): + see methods of CSalamanderConnectAbstract + -during upgrades, update the extension lists used for installation for "custom archiver unpack" (AddCustomUnpacker), "panel archiver view/edit" (AddPanelArchiver), - "file viewer" (AddViewer), polozky menu (AddMenuItem), atd. - -u volani AddPanelArchiver a AddViewer nechame 'updateExts' a 'force' FALSE - (jinak bysme uzivateli nutili nejen nove, ale i stare pripony, ktere uz treba - rucne smazal) - -u volani AddCustomPacker/AddCustomUnpacker dame do parametru 'update' podminku - "ConfigVersion < XXX", kde XXX je cislo posledni verze, kde se menily - pripony pro custom packery/unpackery (obe volani je potreba posuzovat zvlast; - zde pro jednoduchost vnutime uzivateli vsechny pripony, pokud si nejake promazal - nebo pridal, ma smulu, bude to muset udelat rucne znovu) - -AddMenuItem, SetChangeDriveMenuItem a SetThumbnailLoader funguje pri kazdem loadu - pluginu stejne (instalace/upgrady se nelisi - vzdy se zacina na zelene louce) - -jen pri upgradech: do casti pro upgrady (za zakladni casti): - -pridame podminku "if (ConfigVersion < XXX)", kde XXX je nova hodnota - konstanty CURRENT_CONFIG_VERSION + pridame komentar od teto verze; - v tele teto podminky zavolame: - -pokud pribyly pripony pro "panel archiver", zavolame - "AddPanelArchiver(PPP, EEE, TRUE)", kde PPP jsou jen nove pripony oddelene - strednikem a EEE je TRUE/FALSE ("panel view+edit"/"jen panel view") - -pokud pribyly pripony pro "viewer", zavolame "AddViewer(PPP, TRUE)", - kde PPP jsou jen nove pripony oddelene strednikem - -pokud se maji smazat nejake stare pripony pro "viewer", zavolame - pro kazdou takovou priponu PPP "ForceRemoveViewer(PPP)" - -pokud se maji smazat nejake stare pripony pro "panel archiver", zavolame - pro kazdou takovou priponu PPP "ForceRemovePanelArchiver(PPP)" - - KONTROLA: po techto upravach doporucuji vyzkouset, jestli to funguje, jak ma, - staci nakompilovat plugin a zkusit ho naloadit do Salama, melo by - dojit k automatickemu upgradu z predesle verze (bez potreby - vyhozeni a pridani pluginu): - -viz menu Options/Configuration: - -Viewery jsou na strance Viewers: najdete pridane pripony, - zkontrolujte, ze odebrane pripony jiz neexistuji - -Panel Archivers jsou na strance Archives Associations in Panels: - najdete pridane pripony - -Custom Unpackers jsou na strance Unackers in Unpack Dialog Box: - najdete vas plugin a zkontrolujte, jestli je seznam masek OK - -zkontrolovat novou podobu submenu pluginu (v menu Plugins) - -zkontrolovat novou podobu Change Drive menu (Alt+F1/F2) - -zkontrolovat v Plugins Manageru (v menu Plugins) masky thumbnaileru: - fokusnout vas plugin, pak zkontrolovat editbox "Thumbnails" - +nakonec muzete jeste taky zkusit vyhodit a pridat plugin, jestli - funguje "instalace" pluginu: kontrola viz vsechny predesle body - - POZNAMKA: pri pridani pripon pro "panel archiver" je tez potreba doplnit - seznam pripon v parametru 'extensions' metody SetBasicPluginData - - PRIKLAD PRIDANI PRIPONY "dmp2" VIEWERU A ARCHIVERU: - (radky zacinajici na "-" byly odstraneny, radky zacinajici na "+" pridany, - symbol "=====" na zacatku radky znaci preruseni souvisleho useku kodu) - Prehled zmen: - -zvysila se verze konfigurace z 2 na 3: - -pridany komentar k verzi 3 - -zvyseni CURRENT_CONFIG_VERSION na 3 - -pridani pripony "dmp2" do parametru 'extensions' SetBasicPluginData - (protoze pridavame priponu "dmp2" pro "panel archiver") - -pridani masky "*.dmp2" do AddCustomUnpacker + zvyseni verze z 1 na 3 - v podmince (protoze pridavame priponu "dmp2" pro "custom unpacker") - -pridani pripony "dmp2" do AddPanelArchiver (protoze pridavame priponu - "dmp2" pro "panel archiver") - -pridani masky "*.dmp2" do AddViewer (protoze pridavame priponu "dmp2" - pro "viewer") - -pridani podminky pro upgrade na verzi 3 + komentar tohoto upgradu, - telo podminky: - -volani AddPanelArchiver pro priponu "dmp2" s 'updateExts' TRUE - (protoze pridavame priponu "dmp2" pro "panel archiver") - -volani AddViewer pro masku "*.dmp2" s 'force' TRUE (protoze - pridavame priponu "dmp2" pro "viewer") + "file viewer" (AddViewer), menu items (AddMenuItem), etc. + -for AddPanelArchiver and AddViewer, keep 'updateExts' and 'force' FALSE + (otherwise we would force not only new but also old extensions on the user, even if + they had removed them manually) + -for AddCustomPacker/AddCustomUnpacker, pass an 'update' condition + "ConfigVersion < XXX", where XXX is the last version number in which the + custom packer/unpacker extensions changed (the two calls must be evaluated separately; + for simplicity here we force all extensions back onto the user, so if they removed + or added some, they will have to fix it manually again) + -AddMenuItem, SetChangeDriveMenuItem and SetThumbnailLoader work the same on every plugin load + (installation/upgrades do not differ - everything always starts from a clean slate) + -only during upgrades: in the upgrade section (after the basic section): + -add a condition "if (ConfigVersion < XXX)", where XXX is the new value + of constant CURRENT_CONFIG_VERSION + add a comment for that version; + in the body of that condition call: + -if new extensions were added for "panel archiver", call + "AddPanelArchiver(PPP, EEE, TRUE)", where PPP are only the new extensions separated + by semicolons and EEE is TRUE/FALSE ("panel view+edit"/"panel view only") + -if new extensions were added for "viewer", call "AddViewer(PPP, TRUE)", + where PPP are only the new extensions separated by semicolons + -if some old extensions for "viewer" must be removed, call + "ForceRemoveViewer(PPP)" for each such extension PPP + -if some old extensions for "panel archiver" must be removed, call + "ForceRemovePanelArchiver(PPP)" for each such extension PPP + + CHECK: after these changes, I recommend testing that everything works as expected. + It is enough to compile the plugin and try loading it into Salamander; there should + be an automatic upgrade from the previous version (without needing + to remove and add the plugin again): + -see menu Options/Configuration: + -Viewers are on the Viewers page: find the added extensions, + check that the removed extensions no longer exist + -Panel Archivers are on the Archives Associations in Panels page: + find the added extensions + -Custom Unpackers are on the Unpackers in Unpack Dialog Box page: + find your plugin and check that the mask list is correct + -check the new form of the plugin submenu (in the Plugins menu) + -check the new form of the Change Drive menu (Alt+F1/F2) + -check thumbnailer masks in Plugins Manager (in the Plugins menu): + focus your plugin, then check the "Thumbnails" edit box + +finally, you can also try removing and adding the plugin again to check whether + plugin "installation" works: use all the checks listed above + + NOTE: when adding extensions for a "panel archiver", it is also necessary to update + the extension list in the 'extensions' parameter of SetBasicPluginData + + EXAMPLE OF ADDING THE "dmp2" EXTENSION TO THE VIEWER AND ARCHIVER: + (lines starting with "-" were removed, lines starting with "+" were added, + the "=====" symbol at the start of a line means the continuous code section was truncated) + Summary of changes: + -the configuration version was increased from 2 to 3: + -comment added for version 3 + -CURRENT_CONFIG_VERSION increased to 3 + -extension "dmp2" added to the 'extensions' parameter of SetBasicPluginData + (because we are adding the "dmp2" extension for the "panel archiver") + -mask "*.dmp2" added to AddCustomUnpacker + version in the condition increased from 1 to 3 + (because we are adding the "dmp2" extension for the "custom unpacker") + -extension "dmp2" added to AddPanelArchiver (because we are adding extension + "dmp2" for the "panel archiver") + -mask "*.dmp2" added to AddViewer (because we are adding extension "dmp2" + for the "viewer") + -condition for upgrade to version 3 added + comment for this upgrade, + body of the condition: + -call AddPanelArchiver for extension "dmp2" with 'updateExts' TRUE + (because we are adding extension "dmp2" for the "panel archiver") + -call AddViewer for mask "*.dmp2" with 'force' TRUE (because + we are adding extension "dmp2" for the "viewer") ===== - // ConfigVersion: 0 - zadna konfigurace se z Registry nenacetla (jde o instalaci pluginu), - // 1 - prvni verze konfigurace - // 2 - druha verze konfigurace (pridane nejake hodnoty do konfigurace) -+ // 3 - treti verze konfigurace (pridani pripony "dmp2") + // ConfigVersion: 0 - no configuration was loaded from the Registry (plugin installation), + // 1 - first configuration version + // 2 - second configuration version (some values added to the configuration) ++ // 3 - third configuration version (the "dmp2" extension added) int ConfigVersion = 0; - #define CURRENT_CONFIG_VERSION 2 + #define CURRENT_CONFIG_VERSION 3 const char *CONFIG_VERSION = "Version"; ===== - // nastavime zakladni informace o pluginu + // set basic plugin information salamander->SetBasicPluginData("Salamander Demo Plugin", FUNCTION_PANELARCHIVERVIEW | FUNCTION_PANELARCHIVEREDIT | FUNCTION_CUSTOMARCHIVERPACK | FUNCTION_CUSTOMARCHIVERUNPACK | @@ -613,7 +613,7 @@ class CPluginInterfaceAbstract { CALL_STACK_MESSAGE1("CPluginInterface::Connect(,)"); - // zakladni cast: + // basic section: salamander->AddCustomPacker("DEMOPLUG (Plugin)", "dmp", FALSE); - salamander->AddCustomUnpacker("DEMOPLUG (Plugin)", "*.dmp", ConfigVersion < 1); + salamander->AddCustomUnpacker("DEMOPLUG (Plugin)", "*.dmp;*.dmp2", ConfigVersion < 3); @@ -621,9 +621,9 @@ class CPluginInterfaceAbstract + salamander->AddPanelArchiver("dmp;dmp2", TRUE, FALSE); - salamander->AddViewer("*.dmp", FALSE); + salamander->AddViewer("*.dmp;*.dmp2", FALSE); -===== (vynechal jsem pridavani polozek do menu, nastavovani ikon a masek thumbnailu) - // cast pro upgrady: -+ if (ConfigVersion < 3) // verze 3: pridani pripony "dmp2" +===== (I omitted adding menu items, setting icons and thumbnail masks) + // upgrade section: ++ if (ConfigVersion < 3) // version 3: the "dmp2" extension was added + { + salamander->AddPanelArchiver("dmp2", TRUE, TRUE); + salamander->AddViewer("*.dmp2", TRUE); @@ -720,22 +720,23 @@ class CSalamanderPluginEntryAbstract // "SalamanderPluginEntry" function) and is only a reference, so it is not released virtual CSalamanderDebugAbstract* WINAPI GetSalamanderDebug() = 0; - // nastaveni zakladnich dat o pluginu (data, ktera si o pluginu spolu se jmenem DLL souboru - // Salamander pamatuje), nutne volat, jinak nemuze byt plugin pripojen; - // 'pluginName' je jmeno pluginu; 'functions' obsahuje naORovane vsechny funkce, ktere plugin - // podporuje (viz konstanty FUNCTION_XXX); 'version'+'copyright'+'description' jsou data pro - // uzivatele zobrazovana v okne Plugins; 'regKeyName' je navrhovany nazev soukromeho klice - // pro ulozeni konfigurace v registry (bez FUNCTION_LOADSAVECONFIGURATION je ignorovan); - // 'extensions' jsou zakladni pripony (napr. jen "ARJ"; "A01", atd. uz ne) zpracovavanych - // archivu oddelene ';' (zde nema ';' zadnou escape sekvenci) - Salamander tyto pripony pouziva - // jen pri hledani nahrady za odstranene panelove archivatory (nastava pri odstraneni pluginu; - // resi se problem "co se ted postara o priponu XXX, kdyz byl puvodni asociovany archivator - // odstranen v ramci pluginu PPP?") (bez FUNCTION_PANELARCHIVERVIEW a bez FUNCTION_PANELARCHIVEREDIT - // je ignorovan); 'fsName' je navrhovane jmeno (ziskani prideleneho jmena se provede pomoci - // CSalamanderGeneralAbstract::GetPluginFSName) file systemu (bez FUNCTION_FILESYSTEM je - // ignorovan, povolene znaky jsou 'a-zA-Z0-9_+-', min. delka 2 znaky), pokud plugin potrebuje - // vic jmen file systemu, muze pouzit metodu CSalamanderPluginEntryAbstract::AddFSName; - // vraci TRUE pri uspesnem prijeti dat + // sets the basic plugin data (data Salamander remembers about the plugin together with the DLL file name); + // this call is required, otherwise the plugin cannot be connected; + // 'pluginName' is the plugin name; 'functions' contains all functions supported by the plugin ORed + // together (see FUNCTION_XXX constants); 'version'+'copyright'+'description' are values shown to the + // user in the Plugins window; 'regKeyName' is the proposed name of the private key + // for storing configuration in the registry (ignored without FUNCTION_LOADSAVECONFIGURATION); + // 'extensions' are the basic extensions of handled archives (e.g. just "ARJ"; not "A01", etc.) + // separated by ';' (here ';' has no escape meaning) - Salamander uses these extensions + // only when searching for a replacement for removed panel archivers (this happens when the plugin is removed; + // it solves the problem "which associated archiver should handle extension XXX now + // that the original archiver from plugin PPP has been removed?") (ignored without + // FUNCTION_PANELARCHIVERVIEW and FUNCTION_PANELARCHIVEREDIT); 'fsName' is the proposed name + // (the actually assigned name is obtained by calling + // CSalamanderGeneralAbstract::GetPluginFSName) of the file system (ignored without FUNCTION_FILESYSTEM; + // allowed characters are 'a-zA-Z0-9_+-', minimum length 2 characters). If the plugin needs + // more file-system names, it can use CSalamanderPluginEntryAbstract::AddFSName; + // returns TRUE if the data was accepted successfully virtual BOOL WINAPI SetBasicPluginData(const char* pluginName, DWORD functions, const char* version, const char* copyright, const char* description, const char* regKeyName = NULL, From c7899623438fbd9a23722491b2a35f09251707d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Fri, 17 Apr 2026 12:28:50 +0200 Subject: [PATCH 378/710] [translation] Fix src/plugins/unlha/lha.cpp comments (#749) Co-authored-by: Jan Rysavy <7381864+janrysavy@users.noreply.github.com> --- src/plugins/unlha/lha.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/plugins/unlha/lha.cpp b/src/plugins/unlha/lha.cpp index 65af80fa5..0ef4a06c7 100644 --- a/src/plugins/unlha/lha.cpp +++ b/src/plugins/unlha/lha.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED /*****************************************************************************************\ ** ** @@ -446,7 +447,7 @@ int LHAGetHeader(FILE* fp, LHA_HEADER* lpHeader) name_length += dir_length; } - OemToChar(lpHeader->name, lpHeader->name); // ÄeÅ¡tiňka ... :-) + OemToChar(lpHeader->name, lpHeader->name); // convert Czech characters for (i = 0;; i++) if (lha_methods[i] == NULL) @@ -1845,7 +1846,7 @@ int LHAOpenArchive(FILE*& f, LPCTSTR lpName) /* found "-l??-" keyword (as METHOD type string) */ if (p[0] == '-' && p[1] == 'l' && p[4] == '-') { - /* size and checksum validate check */ + /* header size and checksum are valid */ if ((p[I_HEADER_LEVEL - 2] == 0 || p[I_HEADER_LEVEL - 2] == 0) && p[I_HEADER_SIZE - 2] > 20 && p[I_HEADER_CHECKSUM - 2] == calc_sum((char*)p, p[-2])) { fseek(f, (long)((p - 2) - buffer2) - n, SEEK_CUR); @@ -1868,9 +1869,9 @@ int LHAOpenArchive(FILE*& f, LPCTSTR lpName) return FALSE; // archive is neither LHZ nor SFX LHZ } -// TestLHAOpenArchive - verifies LHAOpenArchive by running it on every -// file on the "path" (recursively walks subdirectories). If it does not crash, -// everything is fine :-) +// TestLHAOpenArchive - tests LHAOpenArchive by running it on every +// file under "path" (including subdirectories). If it does not crash, +// everything is OK :-) // // Call it like this: // char path[MAX_PATH] = "c:"; From 11e0b770505181e72bb1f74bcca7709fc4ae949a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:11:34 +0200 Subject: [PATCH 379/710] [translation] Fix src/worker.cpp comments Refines translated comments in src/worker.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #953 for src/worker.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/worker.cpp | 360 ++++++++++++++++++++++++------------------------- 1 file changed, 180 insertions(+), 180 deletions(-) diff --git a/src/worker.cpp b/src/worker.cpp index 517eba544..4fa5382e3 100644 --- a/src/worker.cpp +++ b/src/worker.cpp @@ -56,16 +56,16 @@ void CTransferSpeedMeter::GetSpeed(CQuadWord* speed) DWORD lastPacketTime = LastPacketsTime[lastPacket]; DWORD totalTime = lastPacketTime - LastPacketsTime[firstPacket]; // time between receiving the first and last packet if (totalTime >= ((DWORD)(CountOfLastPackets - 1) * TRSPMETER_STPCKTSMININTERVAL) / TRSPMETER_NUMOFSTOREDPACKETS) - { // this is a low speed (up to TRSPMETER_NUMOFSTOREDPACKETS packets per TRSPMETER_STPCKTSMININTERVAL ms) - if (time - lastPacketTime > 2000) // two-second "protection" period for the last computed slow speed - { // check whether the speed has dropped by more than double compared to the speed of the last packet; if so, display - // zero speed (so that when a slow transfer stops we do not keep showing the last recorded speed value) + { // low speed (up to TRSPMETER_NUMOFSTOREDPACKETS packets per TRSPMETER_STPCKTSMININTERVAL ms) + if (time - lastPacketTime > 2000) // two-second "protection" period for the last computed low speed + { // check whether the speed has dropped to less than half the speed of the last packet; if so, display + // zero speed (so that when a slow transfer stops, we do not keep showing the last recorded speed value) int preLastPacket = ((TRSPMETER_NUMOFSTOREDPACKETS + 1) + ActIndexInLastPackets - 2) % (TRSPMETER_NUMOFSTOREDPACKETS + 1); if ((UINT64)2 * MaxPacketSize * (lastPacketTime - LastPacketsTime[preLastPacket]) < (UINT64)LastPacketsSize[lastPacket] * (time - lastPacketTime)) { speed->SetUI64(0); ResetSpeed = TRUE; - return; // speed dropped at least two times, better show zero + return; // speed dropped by at least half, better show zero } } if (totalTime > TRSPMETER_ACTSPEEDSTEP * TRSPMETER_ACTSPEEDNUMOFSTEPS) @@ -93,7 +93,7 @@ void CTransferSpeedMeter::GetSpeed(CQuadWord* speed) speed->SetUI64((1000 * totalSize) / totalTime); return; // low speed computed, we are done } - else // this is a high speed (more than TRSPMETER_NUMOFSTOREDPACKETS packets per TRSPMETER_STPCKTSMININTERVAL ms), + else // high speed case: more than TRSPMETER_NUMOFSTOREDPACKETS packets per TRSPMETER_STPCKTSMININTERVAL ms. { // perform a sudden speed drop test (especially when copying zero-sized files or creating empty directories begins) if (time - lastPacketTime > 800) { // if no packet has arrived for 800 ms, report zero speed @@ -103,7 +103,7 @@ void CTransferSpeedMeter::GetSpeed(CQuadWord* speed) } } } - else // nothing to calculate from yet, report "0 B/s" + else // nothing to calculate yet, report "0 B/s" { speed->SetUI64(0); return; @@ -111,12 +111,12 @@ void CTransferSpeedMeter::GetSpeed(CQuadWord* speed) // high speed (more than TRSPMETER_NUMOFSTOREDPACKETS packets per TRSPMETER_STPCKTSMININTERVAL ms) if (CountOfTrBytesItems > 0) // after the connection is established this is "always true" { - int actIndexAdded = 0; // 0 = current index not included, 1 = current index included + int actIndexAdded = 0; // 0 = current index was not included, 1 = current index was included int emptyTrBytes = 0; // number of counted empty steps UINT64 total = 0; // total number of bytes over the last at most TRSPMETER_ACTSPEEDNUMOFSTEPS steps int addFromTrBytes = CountOfTrBytesItems - 1; // number of closed steps to add from the queue DWORD restTime = 0; // time from the last counted step to now - if ((int)(time - ActIndexInTrBytesTimeLim) >= 0) // current index already closed + empty steps may be needed + if ((int)(time - ActIndexInTrBytesTimeLim) >= 0) // current index already closed; empty steps may also be needed { emptyTrBytes = (time - ActIndexInTrBytesTimeLim) / TRSPMETER_ACTSPEEDSTEP; restTime = (time - ActIndexInTrBytesTimeLim) % TRSPMETER_ACTSPEEDSTEP; @@ -190,7 +190,7 @@ void CTransferSpeedMeter::BytesReceived(DWORD count, DWORD time, DWORD maxPacket if (CountOfLastPackets < TRSPMETER_NUMOFSTOREDPACKETS + 1) CountOfLastPackets++; } - if ((int)(time - ActIndexInTrBytesTimeLim) < 0) // within the current time interval, just add the byte count to the interval + if ((int)(time - ActIndexInTrBytesTimeLim) < 0) // within the current time interval, add the byte count to the interval { TransferedBytes[ActIndexInTrBytes] += count; } @@ -233,7 +233,7 @@ void CTransferSpeedMeter::AdjustProgressBufferLimit(DWORD* progressBufferLimit, if (ti - LastPacketsTime[i] > 2000) { packets -= c; - break; // take packets at most 2 seconds old (trying to compute the "current" speed) + break; // use only packets at most 2 seconds old (trying to compute the "current" speed) } } DWORD totalTime = min(ti - LastPacketsTime[i], ti - lastFileStartTime); // LastPacketsTime[i] may be older than lastFileStartTime (it is the last packet of the previous file); we care only about the time spent on this file @@ -309,15 +309,15 @@ void CProgressSpeedMeter::GetSpeed(CQuadWord* speed) DWORD lastPacketTime = LastPacketsTime[lastPacket]; DWORD totalTime = lastPacketTime - LastPacketsTime[firstPacket]; // time between receiving the first and last packet if (totalTime >= ((DWORD)(CountOfLastPackets - 1) * PRSPMETER_STPCKTSMININTERVAL) / PRSPMETER_NUMOFSTOREDPACKETS) - { // this is a low speed (up to PRSPMETER_NUMOFSTOREDPACKETS packets per PRSPMETER_STPCKTSMININTERVAL ms) + { // low speed (up to PRSPMETER_NUMOFSTOREDPACKETS packets per PRSPMETER_STPCKTSMININTERVAL ms) if (time - lastPacketTime > 5000) // five-second "protection" period for the last computed slow speed - { // check whether the speed has dropped by more than four times compared to the speed of the last packet; if so, display - // zero speed (so that when a slow transfer stops we do not keep showing the last recorded time-left value) + { // check whether the speed has dropped to less than one quarter of the speed of the last packet; if so, display + // zero speed (so that when a slow transfer stops, we do not keep showing the last recorded time-left value) int preLastPacket = ((PRSPMETER_NUMOFSTOREDPACKETS + 1) + ActIndexInLastPackets - 2) % (PRSPMETER_NUMOFSTOREDPACKETS + 1); if ((UINT64)4 * MaxPacketSize * (lastPacketTime - LastPacketsTime[preLastPacket]) < (UINT64)LastPacketsSize[lastPacket] * (time - lastPacketTime)) { speed->SetUI64(0); - return; // speed dropped at least two times, better show zero + return; // speed dropped by at least a factor of four; show zero instead } } if (totalTime > PRSPMETER_ACTSPEEDSTEP * PRSPMETER_ACTSPEEDNUMOFSTEPS) @@ -345,7 +345,7 @@ void CProgressSpeedMeter::GetSpeed(CQuadWord* speed) speed->SetUI64((1000 * totalSize) / totalTime); return; // low speed computed, we are done } - else // this is a high speed (more than PRSPMETER_NUMOFSTOREDPACKETS packets per PRSPMETER_STPCKTSMININTERVAL ms), + else // High speed: more than PRSPMETER_NUMOFSTOREDPACKETS packets per PRSPMETER_STPCKTSMININTERVAL ms. { // perform a sudden speed drop test (especially when copying zero-sized files or creating empty directories begins) if (time - lastPacketTime > 5000) { // if no packet has arrived for 5000 ms, report zero speed @@ -354,7 +354,7 @@ void CProgressSpeedMeter::GetSpeed(CQuadWord* speed) } } } - else // nothing to calculate from yet, report "0 B/s" + else // nothing to calculate from yet, so report "0 B/s" { speed->SetUI64(0); return; @@ -362,12 +362,12 @@ void CProgressSpeedMeter::GetSpeed(CQuadWord* speed) // high speed (more than PRSPMETER_NUMOFSTOREDPACKETS packets per PRSPMETER_STPCKTSMININTERVAL ms) if (CountOfTrBytesItems > 0) // after the connection is established this is "always true" { - int actIndexAdded = 0; // 0 = current index not included, 1 = current index included + int actIndexAdded = 0; // 0 = current index was not included, 1 = current index was included int emptyTrBytes = 0; // number of counted empty steps UINT64 total = 0; // total number of bytes over the last at most PRSPMETER_ACTSPEEDNUMOFSTEPS steps int addFromTrBytes = CountOfTrBytesItems - 1; // number of closed steps to add from the queue DWORD restTime = 0; // time from the last counted step to now - if ((int)(time - ActIndexInTrBytesTimeLim) >= 0) // current index already closed + empty steps may be needed + if ((int)(time - ActIndexInTrBytesTimeLim) >= 0) // current index is already closed; empty steps may also be needed { emptyTrBytes = (time - ActIndexInTrBytesTimeLim) / PRSPMETER_ACTSPEEDSTEP; restTime = (time - ActIndexInTrBytesTimeLim) % PRSPMETER_ACTSPEEDSTEP; @@ -638,11 +638,11 @@ void COperations::AddBytesToSpeedMetersAndTFSandPS(DWORD bytesCount, BOOL onlyTo int idealTotalTime = idealTotalTime64 < 10000 ? (int)idealTotalTime64 : 10000; if (idealTotalTime > (int)(ti - LastSetupTime)) { - sleepNow = idealTotalTime - (ti - LastSetupTime); // need to brake (we are faster or only slightly slower than the speed limit) - if (sleepNow > 1000) // waiting longer than a second makes no sense (the meter will accept at most *limitBufferSize) + sleepNow = idealTotalTime - (ti - LastSetupTime); // need to slow down (we are faster than the speed limit, or only slightly slower) + if (sleepNow > 1000) // waiting longer than a second makes no sense (credit at most *limitBufferSize to the meter) sleepNow = 1000; } - // else sleepNow = 0; // we are slower than the speed limit (at ideal speed we would wait the proportional part of SleepAfterWrite) + // else sleepNow = 0; // we are slower than the speed limit (at the ideal speed, we would wait for a proportional fraction of SleepAfterWrite) CalcLimitBufferSize(limitBufferSize, bufferSize); LastBufferLimit = *limitBufferSize; @@ -667,14 +667,14 @@ void COperations::AddBytesToSpeedMetersAndTFSandPS(DWORD bytesCount, BOOL onlyTo if (SleepAfterWrite > 0) { sleepNow = (SleepAfterWrite * bytesCount) / LastBufferLimit; - if (sleepNow > 1000) // waiting longer than a second makes no sense (the meter will accept at most the speed limit) + if (sleepNow > 1000) // waiting longer than a second makes no sense (credit at most the speed limit to the meter) sleepNow = 1000; } } } if (bytesCount > SpeedLimit) // a slowdown occurred during the operation (for example, a 32 KB buffer read & write happened and the speed limit is 1 B/s, so theoretically we should now wait 32768 seconds, which is naturally unrealistic) bytesCountForSpeedMeters = SpeedLimit; // add to the speed meter only the bytes allowed by the speed limit (e.g., just 1 B) - if (sleepNow > 0) // braking because of the speed limit + if (sleepNow > 0) // slow down because of the speed limit { HANDLES(LeaveCriticalSection(&StatusCS)); Sleep(sleepNow); @@ -793,7 +793,7 @@ void COperations::InitSpeedMeters(BOOL operInProgress) LastSetupTime = GetTickCount(); BytesTrFromLastSetup.SetUI64(0); } - // after a pause, a speed limit change, or an error dialog discard the old data + // discard old data after a pause, a speed limit change, or an error dialog if (operInProgress) { LastFileBlockCount = 0; @@ -844,7 +844,7 @@ struct CAsyncCopyParams BOOL UseAsyncAlg; // TRUE = use the asynchronous algorithm (data must be allocated), FALSE = old synchronous algorithm (allocate nothing) - BOOL HasFailed; // TRUE = failed to create an event for the Overlapped array, the structure is unusable + BOOL HasFailed; // TRUE = failed to create one of the events for the Overlapped array, the structure is unusable CAsyncCopyParams(); ~CAsyncCopyParams(); @@ -945,7 +945,7 @@ void InitWorker() { if (NtDLL != NULL) // "always true" { - DynNtQueryInformationFile = (NTQUERYINFORMATIONFILE)GetProcAddress(NtDLL, "NtQueryInformationFile"); // has no header + DynNtQueryInformationFile = (NTQUERYINFORMATIONFILE)GetProcAddress(NtDLL, "NtQueryInformationFile"); // no header available DynNtFsControlFile = (NTFSCONTROLFILE)GetProcAddress(NtDLL, "NtFsControlFile"); // has no header } } @@ -1037,8 +1037,8 @@ struct CProgressDlgData }; void SetProgressDialog(HWND hProgressDlg, CProgressData* data, CProgressDlgData& dlgData) -{ // wait for the response; the dialog must be updated - WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be in suspend mode, wait ... +{ // wait for the response; the dialog needs to change + WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be suspended, wait ... if (!*dlgData.CancelWorker) // we need to stop the main thread SendMessage(hProgressDlg, WM_USER_SETDIALOG, (WPARAM)data, 0); } @@ -1050,7 +1050,7 @@ int CaclProg(const CQuadWord& progressCurrent, const CQuadWord& progressTotal) void SetProgress(HWND hProgressDlg, int operation, int summary, CProgressDlgData& dlgData) { // notify about the change and continue without waiting for a reply - WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be in suspend mode, wait ... + WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we are supposed to be suspended, wait ... if (!*dlgData.CancelWorker && (*dlgData.OperationProgress != operation || *dlgData.SummaryProgress != summary)) { @@ -1127,8 +1127,8 @@ void GetDirInfo(char* buffer, const char* dir) BOOL ok = FALSE; FILETIME lastWrite; if (NameEndsWithBackslash(dirFindFirst)) - { // FindFirstFile fails for a dir ending with a backslash (used for invalid directory names), - // so in this situation we handle it through CreateFile and GetFileTime + { // FindFirstFile fails for a directory ending with a backslash (used for invalid directory names), + // so in this case we handle it through CreateFile and GetFileTime HANDLE file = HANDLES_Q(CreateFile(dirFindFirst, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL)); if (file != INVALID_HANDLE_VALUE) @@ -1282,9 +1282,9 @@ void GainWriteOwnerAccess() } } /* -// Purpose: Determines if the user is a member of the administrators group. -// Return: TRUE if user is a admin -// FALSE if not +// Purpose: Determines whether the user is a member of the Administrators group. +// Return: TRUE if the user is an admin +// FALSE otherwise #define STATUS_SUCCESS ((NTSTATUS)0x00000000L) // ntsubauth #define STATUS_BUFFER_TOO_SMALL ((NTSTATUS)0xC0000023L) #define NT_SUCCESS(Status) ((NTSTATUS)(Status) >= 0) @@ -1304,7 +1304,7 @@ BOOL IsUserAdmin() GainWriteOwnerAccess(); - FNtQueryInformationToken DynNTNtQueryInformationToken = (FNtQueryInformationToken)GetProcAddress(NtDLL, "NtQueryInformationToken"); // has no header + FNtQueryInformationToken DynNTNtQueryInformationToken = (FNtQueryInformationToken)GetProcAddress(NtDLL, "NtQueryInformationToken"); // no header available if (DynNTNtQueryInformationToken == NULL) { TRACE_E("Getting NtQueryInformationToken export failed!"); @@ -1328,7 +1328,7 @@ BOOL IsUserAdmin() if (!OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &hUserToken)) return FALSE; - // Create Admins domain sid. + // Create the Administrators domain SID. Status = AllocateAndInitializeSid( &authNT, 2, @@ -1338,7 +1338,7 @@ BOOL IsUserAdmin() &AdminsDomainSid ); - // Test if user is in the Admins domain + // Test whether the user is in the Administrators domain // Get a list of groups in the token Status = DynNTNtQueryInformationToken( @@ -1382,7 +1382,7 @@ BOOL IsUserAdmin() } - // Search group list for Admins alias + // Search the group list for the Administrators alias FoundAdmins = FALSE; for (GroupIndex=0; GroupIndex < TokenGroupList->GroupCount; GroupIndex++ ) @@ -1524,8 +1524,8 @@ BOOL DoCopySecurity(const char* sourceName, const char* targetName, DWORD* err, if (!ret) { - // if the owner and group cannot be changed (we do not have the rights in the directory - for example we only have "change" rights), - // check whether the owner and group are already set (that would not be an error) + // if the owner and group cannot be changed (we do not have sufficient rights in the directory, for example only "change" rights), + // check whether the owner and group are already set that way (that would not be an error) PSID tgtOwner = NULL; PSID tgtGroup = NULL; PACL tgtDACL = NULL; @@ -1533,10 +1533,10 @@ BOOL DoCopySecurity(const char* sourceName, const char* targetName, DWORD* err, BOOL tgtRead = GetNamedSecurityInfo((char*)targetNameSec, SE_FILE_OBJECT, DACL_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | OWNER_SECURITY_INFORMATION, &tgtOwner, &tgtGroup, &tgtDACL, NULL, &tgtSD) == ERROR_SUCCESS; - // if the owner of the target file is not the current user, try to set it ("take ownership") - only - // provided we have the right to write the owner so that we can write back the original owner afterwards + // if the current user is not the owner of the target file, try to set it ("take ownership") - only + // if we have the right to write the owner, so that we can restore the original owner afterwards BOOL ownerOfFile = FALSE; - if (!tgtRead || // if the security info cannot be read from the target, the owner is most likely not the current user (the owner has unblocked read rights) + if (!tgtRead || // if the security info cannot be read from the target, the owner is most likely not the current user (the owner has read rights that cannot be blocked) tgtOwner == NULL || // probably nonsense, the file must have some owner; if it happens, try to set the owner to the current user CurrentProcessTokenUserValid && CurrentProcessTokenUser->User.Sid != NULL && !EqualSid(tgtOwner, CurrentProcessTokenUser->User.Sid)) @@ -1567,7 +1567,7 @@ BOOL DoCopySecurity(const char* sourceName, const char* targetName, DWORD* err, BOOL ownerOK = FALSE; BOOL groupOK = FALSE; if (ownerOfFile && CurrentProcessTokenUserValid && CurrentProcessTokenUser->User.Sid != NULL) - { // we are the file owner -> the DACL can be written; try to allow owner/group/DACL write and set the required values + { // we are the file owner -> the DACL can be written; try to grant write access to the owner, group, and DACL and set the required values int allowChPermDACLSize = sizeof(ACL) + sizeof(ACCESS_ALLOWED_ACE) - sizeof(ACCESS_ALLOWED_ACE().SidStart) + GetLengthSid(CurrentProcessTokenUser->User.Sid) + 200 /* +200 bytes is just paranoia */; char buff3[500]; @@ -1730,7 +1730,7 @@ DWORD MyEncryptFile(HWND hProgressDlg, char* fileName, DWORD attrs, DWORD finalA { // if it has and will keep the SYSTEM attribute, ask the user whether they really mean it if (!dlgData.EncryptSystemAll) { - WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be in suspend mode, wait ... + WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be suspended, wait ... if (*dlgData.CancelWorker) return retEnc; @@ -1961,7 +1961,7 @@ BOOL CheckFileOrDirADS(const char* fileName, BOOL isDir, CQuadWord* adsSize, wch } if (onlyDiscardableStreams != NULL) - { // if an ADS appears that is unknown or indispensable, switch 'onlyDiscardableStreams' to FALSE + { // if an unknown or non-discardable ADS appears, switch 'onlyDiscardableStreams' to FALSE if ((psi->NameLength < 29 * 2 || _memicmp(psi->Name, L":\x05Q30lsldxJoudresxAaaqpcawXc:", 29 * 2) != 0) && // Win2K thumbnail in an ADS: 5952 bytes (depends on JPEG compression) (psi->NameLength < 40 * 2 || _memicmp(psi->Name, L":{4c8cc155-6c1e-11d1-8e41-00c04fb9386d}:", 40 * 2) != 0) && // Win2K thumbnail in an ADS: 0 bytes (psi->NameLength < 9 * 2 || _memicmp(psi->Name, L":KAVICHS:", 9 * 2) != 0)) // Kaspersky antivirus: 36/68 bytes @@ -2010,7 +2010,7 @@ BOOL CheckFileOrDirADS(const char* fileName, BOOL isDir, CQuadWord* adsSize, wch } if (streamNamesAux != NULL) { - if (lowMem || !ret) // lack of memory or no ADS, release all names + if (lowMem || !ret) // out of memory or no ADS, free all names { int i; for (i = 0; i < streamNamesAux->Count; i++) @@ -2062,7 +2062,7 @@ BOOL DeleteAllADS(HANDLE file, const char* fileName) { if (psi->NameLength != 7 * 2 || _memicmp(psi->Name, L"::$DATA", 7 * 2)) // ignore default stream { - if (adsFullName[0] == 0) // convert the file name only when needed for the first time to save CPU time + if (adsFullName[0] == 0) // convert the file name only when first needed to save CPU time { if (ConvertA2U(fileName, -1, adsFullName, 2 * MAX_PATH) == 0) return FALSE; // "always false" @@ -2143,7 +2143,7 @@ BOOL SalSetFilePointer(HANDLE file, const CQuadWord& offset) lo == (LONG)offset.LoDWord && hi == (LONG)offset.HiDWord; } -#define RETRYCOPY_TAIL_MINSIZE (32 * 1024) // at least two blocks of this size are verified at the end of the file tested in CheckTailOfOutFile(); afterwards the block size grows up to ASYNC_COPY_BUF_SIZE (if reading is fast enough); NOTE: must be <= ASYNC_COPY_BUF_SIZE +#define RETRYCOPY_TAIL_MINSIZE (32 * 1024) // at least two blocks of this size are checked at the end of the file in CheckTailOfOutFile(); then the block size increases up to ASYNC_COPY_BUF_SIZE (if reading is fast enough); NOTE: must be <= ASYNC_COPY_BUF_SIZE #define RETRYCOPY_TESTINGTIME 3000 // duration of the CheckTailOfOutFile() test in [ms] void CheckTailOfOutFileShowErr(const char* txt) @@ -2289,7 +2289,7 @@ BOOL CheckTailOfOutFile(CAsyncCopyParams* asyncPar, HANDLE in, HANDLE out, const } } if (ti - startTime > RETRYCOPY_TESTINGTIME) - break; // we have been reading long enough; stop after the mandatory two rounds + break; // we have been reading long enough; stop now (the mandatory two rounds are done) if (ti - roundStartTime < 300 && curBufSize < ASYNC_COPY_BUF_SIZE) { // when reading is fast enough, enlarge the buffer to avoid excessive reverse seeking (toward the beginning of the file) curBufSize *= 2; @@ -2328,9 +2328,9 @@ BOOL CheckTailOfOutFile(CAsyncCopyParams* asyncPar, HANDLE in, HANDLE out, const return ok; } -// copies ADS into the newly created file/directory -// returns FALSE only when cancelled; success + Skip both return TRUE; Skip sets 'skip' -// (when not NULL) to TRUE +// Copies ADS to the newly created file/directory. +// Returns FALSE only on Cancel; success and Skip both return TRUE; on Skip, sets 'skip' +// (if not NULL) to TRUE. BOOL DoCopyADS(HWND hProgressDlg, const char* sourceName, BOOL isDir, const char* targetName, CQuadWord const& totalDone, CQuadWord& operDone, CQuadWord const& operTotal, CProgressDlgData& dlgData, COperations* script, BOOL* skip, void* buffer) @@ -2344,7 +2344,7 @@ BOOL DoCopyADS(HWND hProgressDlg, const char* sourceName, BOOL isDir, const char CQuadWord lastTransferredFileSize, finalTransferredFileSize; script->GetTFSandResetTrSpeedIfNeeded(&lastTransferredFileSize); finalTransferredFileSize = lastTransferredFileSize; - if (operTotal > operDone) // it should always be at least equal, but we play it safe... + if (operTotal > operDone) // operTotal should always be >= operDone, but we play it safe... finalTransferredFileSize += (operTotal - operDone); COPY_ADS_AGAIN: @@ -2352,7 +2352,7 @@ BOOL DoCopyADS(HWND hProgressDlg, const char* sourceName, BOOL isDir, const char if (CheckFileOrDirADS(sourceName, isDir, NULL, &streamNames, &streamNamesCount, &lowMemory, &adsWinError, 0, NULL, NULL) && !lowMemory && streamNames != NULL) - { // we have the list of ADS, let's try to copy them to the target file/directory + { // we have the list of ADS streams; try to copy them to the target file/directory wchar_t srcName[2 * MAX_PATH]; // MAX_PATH for the file name as well as the ADS name (no idea what the actual maximum lengths are) wchar_t tgtName[2 * MAX_PATH]; char longSourceName[MAX_PATH + 100]; @@ -2421,7 +2421,7 @@ BOOL DoCopyADS(HWND hProgressDlg, const char* sourceName, BOOL isDir, const char // if possible, pre-allocate the required space (avoids disk fragmentation and smooths writes to floppies) BOOL wholeFileAllocated = FALSE; - if (fileSize > CQuadWord(limitBufferSize, 0) && // pointless to pre-allocate below the copy buffer size + if (fileSize > CQuadWord(limitBufferSize, 0) && // Pre-allocating the file below the copy buffer size is pointless fileSize < CQuadWord(0, 0x80000000)) // file size must be positive (otherwise seeking fails – values above 8 EB, so practically never) { BOOL fatal = TRUE; @@ -2477,8 +2477,8 @@ BOOL DoCopyADS(HWND hProgressDlg, const char* sourceName, BOOL isDir, const char { if (read == 0) break; // EOF - if (!script->ChangeSpeedLimit) // if the speed limit can change, this is not a "suitable" place to wait - WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be in suspend mode, wait ... + if (!script->ChangeSpeedLimit) // if the speed limit can change, this is not an appropriate place to wait + WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be suspended, wait ... if (*dlgData.CancelWorker) { COPY_ERROR_ADS: @@ -2507,7 +2507,7 @@ BOOL DoCopyADS(HWND hProgressDlg, const char* sourceName, BOOL isDir, const char DWORD err; err = GetLastError(); - WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be in suspend mode, wait ... + WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be suspended, wait ... if (*dlgData.CancelWorker) goto COPY_ERROR_ADS; @@ -2546,7 +2546,7 @@ BOOL DoCopyADS(HWND hProgressDlg, const char* sourceName, BOOL isDir, const char FILE_FLAG_SEQUENTIAL_SCAN, NULL); HANDLES_ADD_EX(__otQuiet, out != INVALID_HANDLE_VALUE, __htFile, __hoCreateFile, out, GetLastError(), TRUE); - if (out != INVALID_HANDLE_VALUE) // opened successfully; now adjust the offset + if (out != INVALID_HANDLE_VALUE) // opened successfully; now set the offset { LONG lo, hi; lo = GetFileSize(out, (DWORD*)&hi); @@ -2560,7 +2560,7 @@ BOOL DoCopyADS(HWND hProgressDlg, const char* sourceName, BOOL isDir, const char goto COPY_AGAIN_ADS; } } - else // still cannot open; problem persists + else // still cannot open it; the problem persists { out = NULL; goto WRITE_ERROR_ADS; @@ -2612,7 +2612,7 @@ BOOL DoCopyADS(HWND hProgressDlg, const char* sourceName, BOOL isDir, const char CaclProg(totalDone + operDone + operationDone, script->TotalSize), dlgData); - if (script->ChangeSpeedLimit) // speed limit may change; this is the right place to wait until the + if (script->ChangeSpeedLimit) // speed limit may change; this is the right place to wait until the worker resumes { // worker resumes and fetch a fresh copy buffer size WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be in suspend mode, wait ... script->GetNewBufSize(&limitBufferSize, bufferSize); @@ -2624,7 +2624,7 @@ BOOL DoCopyADS(HWND hProgressDlg, const char* sourceName, BOOL isDir, const char DWORD err; err = GetLastError(); - WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be in suspend mode, wait ... + WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be suspended, wait ... if (*dlgData.CancelWorker) goto COPY_ERROR_ADS; @@ -2687,7 +2687,7 @@ BOOL DoCopyADS(HWND hProgressDlg, const char* sourceName, BOOL isDir, const char if (endProcessing) break; - if (wholeFileAllocated && // the entire target layout was pre-allocated + if (wholeFileAllocated && // the entire target file was pre-allocated operationDone < fileSize) // and the source file shrank { if (!SetEndOfFile(out)) // trim it here @@ -2710,7 +2710,7 @@ BOOL DoCopyADS(HWND hProgressDlg, const char* sourceName, BOOL isDir, const char goto WRITE_ERROR_ADS; } - // commented out because it sets the attributes of the file/directory that owns the ADS instead of the ADS attributes + // commented out because it sets the attributes of the file/directory that owns the ADS rather than the attributes of the ADS // DWORD attr = DynGetFileAttributesW(srcName); // if (attr != INVALID_FILE_ATTRIBUTES) DynSetFileAttributesW(tgtName, attr); @@ -2742,7 +2742,7 @@ BOOL DoCopyADS(HWND hProgressDlg, const char* sourceName, BOOL isDir, const char goto COPY_OVERWRITE; } - WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be in suspend mode, wait ... + WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be suspended, wait ... if (*dlgData.CancelWorker) goto CANCEL_OPEN2_ADS; @@ -2814,7 +2814,7 @@ BOOL DoCopyADS(HWND hProgressDlg, const char* sourceName, BOOL isDir, const char else { DWORD err = GetLastError(); - WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be in suspend mode, wait ... + WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be suspended, wait ... if (*dlgData.CancelWorker) { doCopyADSRet = FALSE; @@ -2877,7 +2877,7 @@ BOOL DoCopyADS(HWND hProgressDlg, const char* sourceName, BOOL isDir, const char { if (adsWinError != NO_ERROR) // display the Windows error (low-memory warning goes only to TRACE_E) { - WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be in suspend mode, wait ... + WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be suspended, wait ... if (*dlgData.CancelWorker) return FALSE; @@ -2941,7 +2941,7 @@ HANDLE SalCreateFileEx(const char* fileName, DWORD desiredAccess, *encryptionNotSupported = TRUE; NOHANDLES(CloseHandle(out)); out = INVALID_HANDLE_VALUE; - if (!DeleteFile(fileName)) // XP and Vista ignore this scenario, so do the same (at worst warn user that a zero-length file was added on disk and cannot be deleted) + if (!DeleteFile(fileName)) // XP and Vista ignore this, so it is ignored here as well (at most, the user could be warned that a zero-length file was added to a disk from which it cannot be deleted) TRACE_I("Unable to delete testing target file: " << fileName); } } @@ -2957,7 +2957,7 @@ HANDLE SalCreateFileEx(const char* fileName, DWORD desiredAccess, if (err != ERROR_ACCESS_DENIED || (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { const char* tgtName = SalPathFindFileName(fileName); - if (StrICmp(tgtName, data.cAlternateFileName) == 0 && // match only for DOS name + if (StrICmp(tgtName, data.cAlternateFileName) == 0 && // match only on the DOS name StrICmp(tgtName, data.cFileName) != 0) // (full name differs) { // rename ("tidy up") the file/directory with the conflicting DOS name to a temporary 8.3 name (no extra DOS name needed) @@ -3110,7 +3110,7 @@ void SetCompressAndEncryptedAttrs(const char* name, DWORD attr, HANDLE* out, BOO *out = HANDLES_Q(CreateFile(name, GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, asyncPar->GetOverlappedFlag() | FILE_FLAG_SEQUENTIAL_SCAN, NULL)); } - if (*out == INVALID_HANDLE_VALUE) // still a problem: cannot reopen; delete it + report an error + if (*out == INVALID_HANDLE_VALUE) // still failed to reopen the file; delete it and report an error { err = GetLastError(); DeleteFile(name); @@ -3155,7 +3155,7 @@ void SetTFSandPSforSkippedFile(COperation* op, CQuadWord& lastTransferredFileSiz if (op->FileSize < COPY_MIN_FILE_SIZE) { lastTransferredFileSize += op->FileSize; // file size - if (op->Size > COPY_MIN_FILE_SIZE) // should always be at least COPY_MIN_FILE_SIZE, but be safe... + if (op->Size > COPY_MIN_FILE_SIZE) // should always be at least COPY_MIN_FILE_SIZE, but check to be safe lastTransferredFileSize += op->Size - COPY_MIN_FILE_SIZE; // add the ADS size } else @@ -3179,7 +3179,7 @@ void DoCopyFileLoopOrig(HANDLE& in, HANDLE& out, void* buffer, int& limitBufferS autoRetryAttemptsSNAP = 0; if (read == 0) break; // EOF - if (!script->ChangeSpeedLimit) // when the speed limit can change, this is not a suitable wait point + if (!script->ChangeSpeedLimit) // when the speed limit can change, this is not a suitable place to wait WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be in suspend mode, wait ... if (*dlgData.CancelWorker) { @@ -3225,7 +3225,7 @@ void DoCopyFileLoopOrig(HANDLE& in, HANDLE& out, void* buffer, int& limitBufferS SendMessage(hProgressDlg, WM_USER_DIALOG, 0, (LPARAM)data); switch (ret) { - case IDRETRY: // on a network we must reopen the handle; local access forbids it due to sharing + case IDRETRY: // On a network, we must reopen the handle; locally, sharing does not allow it. { if (out != NULL) { @@ -3242,7 +3242,7 @@ void DoCopyFileLoopOrig(HANDLE& in, HANDLE& out, void* buffer, int& limitBufferS if (lo == INVALID_FILE_SIZE && GetLastError() != NO_ERROR || // cannot obtain the size CQuadWord(lo, hi) < operationDone || // file is too small wholeFileAllocated && CQuadWord(lo, hi) > fileSize && - CQuadWord(lo, hi) > operationDone + CQuadWord(read, 0) || // pre-allocated file is too large (beyond the reserved size and beyond the written portion including the current block) = extra bytes were appended (allocWholeFileOnStart should be 0 /* need-test */) + CQuadWord(lo, hi) > operationDone + CQuadWord(read, 0) || // the preallocated file is too large (larger than the preallocated size and also larger than the written size including the last written block) = written bytes were appended to the end of the file (allocWholeFileOnStart should be 0 /* need-test */) !CheckTailOfOutFile(NULL, in, out, operationDone, operationDone + CQuadWord(read, 0), FALSE)) { // restart the whole operation HANDLES(CloseHandle(in)); @@ -3285,15 +3285,15 @@ void DoCopyFileLoopOrig(HANDLE& in, HANDLE& out, void* buffer, int& limitBufferS script->AddBytesToSpeedMetersAndTFSandPS(read, FALSE, bufferSize, &limitBufferSize); - if (!script->ChangeSpeedLimit) // when the speed limit can change, this is not a suitable wait point - WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be in suspend mode, wait ... + if (!script->ChangeSpeedLimit) // if the speed limit can change, this is not a suitable place to wait + WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be suspended, wait ... operationDone += CQuadWord(read, 0); SetProgressWithoutSuspend(hProgressDlg, CaclProg(operationDone, op->Size), CaclProg(totalDone + operationDone, script->TotalSize), dlgData); - if (script->ChangeSpeedLimit) // speed limit may change; this is the right place to wait until the + if (script->ChangeSpeedLimit) // the speed limit may change, so this is a suitable place to wait for the worker to resume { // worker resumes and fetches a fresh copy buffer size - WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be in suspend mode, wait ... + WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be suspended, wait ... script->GetNewBufSize(&limitBufferSize, bufferSize); } } @@ -3317,7 +3317,7 @@ void DoCopyFileLoopOrig(HANDLE& in, HANDLE& out, void* buffer, int& limitBufferS } if (err == ERROR_NETNAME_DELETED && ++autoRetryAttemptsSNAP <= 3) - { // on SNAP server reading sometimes randomly fails with ERROR_NETNAME_DELETED; Retry button reportedly helps, so trigger it automatically + { // on the SNAP server, file reads sometimes fail randomly with ERROR_NETNAME_DELETED; the Retry button reportedly works, so try it automatically Sleep(100); goto RETRY_COPY; } @@ -3358,7 +3358,7 @@ void DoCopyFileLoopOrig(HANDLE& in, HANDLE& out, void* buffer, int& limitBufferS return; } } - else // still cannot open; problem persists + else // still cannot be opened; the problem persists { in = NULL; goto READ_ERROR; @@ -3383,7 +3383,7 @@ void DoCopyFileLoopOrig(HANDLE& in, HANDLE& out, void* buffer, int& limitBufferS } } - if (wholeFileAllocated) // we pre-allocated the complete file layout (meaning the allocation was useful; for example, the file cannot be empty) + if (wholeFileAllocated) // we preallocated the entire file (meaning the allocation was worthwhile; for example, the file cannot be empty) { if (operationDone < fileSize) // and the source file shrank { @@ -3426,7 +3426,7 @@ void DoCopyFileLoopOrig(HANDLE& in, HANDLE& out, void* buffer, int& limitBufferS HANDLES(CloseHandle(out)); out = NULL; - ClearReadOnlyAttr(op->TargetName); // if it somehow became read-only (should never happen), so we know how to handle it + ClearReadOnlyAttr(op->TargetName); // if it was created as read-only (should never happen), make sure we can handle it if (DeleteFile(op->TargetName)) { HANDLES(CloseHandle(in)); @@ -3465,7 +3465,7 @@ struct CCopy_Context { CAsyncCopyParams* AsyncPar; - CCopy_ForceOp ForceOp; // TRUE = must read now, FALSE = must write now + CCopy_ForceOp ForceOp; // fopReading = must read now, fopWriting = must write now BOOL ReadingDone; // TRUE = the source file has been fully read CCopy_BlkState BlockState[8]; // block state DWORD BlockDataLen[8]; // for each block: expected data (cbsReading + cbsTestingEOF), valid data (cbsWriting) @@ -3475,10 +3475,10 @@ struct CCopy_Context int FreeBlocks; // current number of free blocks (cbsFree) int FreeBlockIndex; // candidate index of a free block (cbsFree); must be verified int ReadingBlocks; // current number of blocks being read(cbsReading and cbsTestingEOF) - int WritingBlocks; // current number of blocks being written (cbsWriting) - CQuadWord ReadOffset; // offset for reading the next block from the source file (previous one is already in progress) - CQuadWord WriteOffset; // offset for writing the next block to the target file (previous one is already in progress) - int AutoRetryAttemptsSNAP; // number of automatic Retry attempts (max 3): SNAP servers sporadically return ERROR_NETNAME_DELETED while reading, Retry button reportedly helps, so trigger it automatically + int WritingBlocks; // current number of blocks currently being written to the file (cbsWriting) + CQuadWord ReadOffset; // offset for reading the next block from the source file (the previous one is already being read or has already been read) + CQuadWord WriteOffset; // offset for writing the next block to the target file (the previous one is already being written/has been written) + int AutoRetryAttemptsSNAP; // number of automatic Retry attempts (max. 3): SNAP servers sporadically return ERROR_NETNAME_DELETED while reading files; the Retry button reportedly helps, so press it automatically // selected DoCopyFileLoopAsync parameters to avoid passing a long argument list everywhere CProgressDlgData* DlgData; @@ -3543,10 +3543,10 @@ struct CCopy_Context // interrupts any pending asynchronous operations void CancelOpPhase1(); - // ensures that all asynchronous operations have really finished + positions the pointer at the end of the contiguous - // portion of the target file so the file is truncated correctly (before a possible closing and deletion) - // WARNING: frees unnecessary blocks; only those with data read from the input file remain, and they still - // follow WriteOffset (usable for retry) + // ensures that all asynchronous operations have actually finished and positions the pointer at the end of the contiguous + // written part of the target file so the file is truncated correctly (before a possible close and deletion) + // WARNING: frees unnecessary blocks; only blocks with data read from the input file remain, and only those + // contiguous with WriteOffset (usable for retry) void CancelOpPhase2(int errBlkIndex); BOOL RetryCopyReadErr(DWORD* err, BOOL* copyAgain, BOOL* errAgain); BOOL RetryCopyWriteErr(DWORD* err, BOOL* copyAgain, BOOL* errAgain, const CQuadWord& allocFileSize, @@ -3564,7 +3564,7 @@ BOOL DisableLocalBuffering(CAsyncCopyParams* asyncPar, HANDLE file, DWORD* err) ULONG status = DynNtFsControlFile(file, asyncPar->Overlapped[0].hEvent, NULL, 0, &ioStatus, 0x00140390 /* IOCTL_LMR_DISABLE_LOCAL_BUFFERING */, NULL, 0, NULL, 0); - if (status == STATUS_PENDING) // must wait for the operation to finish; it runs asynchronously + if (status == STATUS_PENDING) // must wait for the operation to complete; it runs asynchronously { CALL_STACK_MESSAGE1("DisableLocalBuffering(): STATUS_PENDING"); WaitForSingleObject(asyncPar->Overlapped[0].hEvent, INFINITE); @@ -3597,8 +3597,8 @@ BOOL CCopy_Context::StartReading(int blkIndex, DWORD readSize, DWORD* err, BOOL else return FALSE; } - // if the read was completed synchronously (or via cache, which we cannot detect), - // we must write something now; otherwise writing may idle and slow down the whole operation + // if the read completed synchronously (or from cache, which unfortunately cannot be detected), + // we must write something now; otherwise the write may stall and slow down the whole operation BOOL opCompleted = HasOverlappedIoCompleted(AsyncPar->GetOverlapped(blkIndex)); ForceOp = opCompleted ? fopWriting : fopNotUsed; @@ -3607,11 +3607,11 @@ BOOL CCopy_Context::StartReading(int blkIndex, DWORD readSize, DWORD* err, BOOL #endif // ASYNC_COPY_DEBUG_MSG if (opCompleted && !Script->ChangeSpeedLimit) // when the speed limit can change, this is not a suitable wait point - WaitForSingleObject(DlgData->WorkerNotSuspended, INFINITE); // if we should be in suspend mode, wait ... + WaitForSingleObject(DlgData->WorkerNotSuspended, INFINITE); // if the worker should be suspended, wait ... if (*DlgData->CancelWorker) { *err = ERROR_CANCELLED; - return FALSE; // cancellation will be handled in the error-handling + return FALSE; // cancellation is handled in error handling } BlockOffset[blkIndex] = ReadOffset; @@ -3658,7 +3658,7 @@ BOOL CCopy_Context::StartWriting(int blkIndex, DWORD* err) if (*DlgData->CancelWorker) { *err = ERROR_CANCELLED; - return FALSE; // cancellation will be handled in the error-handling + return FALSE; // cancellation will be handled during error handling } WriteOffset.Value += BlockDataLen[blkIndex]; @@ -3697,7 +3697,7 @@ void CCopy_Context::DiscardBlocksBehindEOF(const CQuadWord& fileSize, int exclud CCopy_BlkState st = BlockState[i]; if ((st == cbsRead || st == cbsReading) && BlockOffset[i] >= fileSize) { - if (st == cbsRead) // discard data read beyond the end of the file; they are useless + if (st == cbsRead) // discard data read past the end of the file; keeping them is pointless FreeBlock(i); else { @@ -3792,10 +3792,10 @@ void CCopy_Context::CancelOpPhase2(int errBlkIndex) } } - ReadOffset = WriteOffset; // determine how far we have contiguous data from the offset where writing should resume + ReadOffset = WriteOffset; // determine how far we have contiguous data from the offset where we need to start writing for (int i = 0; i < _countof(BlockState); i++) { - if (BlockState[i] == cbsRead && BlockOffset[i] == ReadOffset) // block read directly after ReadOffset + if (BlockState[i] == cbsRead && BlockOffset[i] == ReadOffset) // a block immediately following ReadOffset has been read { ReadOffset.Value += BlockDataLen[i]; i = -1; // start the search from the beginning again (with 8 blocks this is affordable, max 36 loop iterations) @@ -3810,9 +3810,9 @@ void CCopy_Context::CancelOpPhase2(int errBlkIndex) // when deleting the target file, set the file pointer to the end of the written portion; // the caller will truncate it with SetEndOfFile before deletion (otherwise zeroes might be written - // from the end of the written part to the end of the pre-allocated file - pre-allocation is + // from the end of the written part to the end of the pre-allocated file - pre-allocation is // used to prevent fragmentation) - if (*Out != NULL) // only if the target file was not closed meanwhile + if (*Out != NULL) // only if the target file has not been closed in the meantime { if (!SalSetFilePointer(*Out, WriteOffset)) { @@ -3829,17 +3829,17 @@ BOOL CCopy_Context::RetryCopyReadErr(DWORD* err, BOOL* copyAgain, BOOL* errAgain *In = HANDLES_Q(CreateFile(Op->SourceName, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, AsyncPar->GetOverlappedFlag() | FILE_FLAG_SEQUENTIAL_SCAN, NULL)); - if (*In != INVALID_HANDLE_VALUE) // opened successfully; now adjust the offset + if (*In != INVALID_HANDLE_VALUE) // opened successfully; now set the offset { CQuadWord size; size.LoDWord = GetFileSize(*In, (DWORD*)&size.HiDWord); if ((size.LoDWord != INVALID_FILE_SIZE || GetLastError() == NO_ERROR) && size >= ReadOffset) - { // size obtained and the file is large enough + { // the size can be obtained and the file is large enough // if the source is on a network: disable local client-side in-memory caching // http://msdn.microsoft.com/en-us/library/ee210753%28v=vs.85%29.aspx // - // using Overlapped[0].hEvent from AsyncPar is OK; nothing is "in-progress" now, the event is unused - // (but WARNING: for example Buffers[0] from AsyncPar may still be in use) + // using Overlapped[0].hEvent from AsyncPar is OK; nothing is "in-progress" now, so the event is not used + // (but WARNING: for example, Buffers[0] from AsyncPar may still be in use) if ((Op->OpFlags & OPFL_SRCPATH_IS_NET) && !DisableLocalBuffering(AsyncPar, *In, err)) TRACE_E("CCopy_Context::RetryCopyReadErr(): IOCTL_LMR_DISABLE_LOCAL_BUFFERING failed for network source file: " << Op->SourceName << ", error: " << GetErrorText(*err)); // using Overlapped[0 and 1].hEvent and Overlapped[0 and 1] from AsyncPar is OK; nothing is @@ -3852,7 +3852,7 @@ BOOL CCopy_Context::RetryCopyReadErr(DWORD* err, BOOL* copyAgain, BOOL* errAgain Script->SetTFSandProgressSize(*LastTransferredFileSize + *OperationDone, *TotalDone + *OperationDone); SetProgressWithoutSuspend(HProgressDlg, CaclProg(*OperationDone, Op->Size), CaclProg(*TotalDone + *OperationDone, Script->TotalSize), *DlgData); - return TRUE; // success: proceed with retry + return TRUE; // success: retry } } // cannot obtain the size, the file is too small, or the last written part differs from the source -> restart from scratch @@ -3864,7 +3864,7 @@ BOOL CCopy_Context::RetryCopyReadErr(DWORD* err, BOOL* copyAgain, BOOL* errAgain *copyAgain = TRUE; // goto COPY_AGAIN; return FALSE; } - else // still cannot open; problem persists + else // still cannot open it; the problem persists { *err = GetLastError(); *In = NULL; @@ -3922,7 +3922,7 @@ BOOL CCopy_Context::HandleReadingErr(int blkIndex, DWORD err, BOOL* copyError, B else { if (errAgain) - break; // same problem again; repeat the message + break; // same problem again; show the message again return FALSE; // copyAgain==TRUE, goto COPY_AGAIN; } } @@ -3959,14 +3959,14 @@ BOOL CCopy_Context::RetryCopyWriteErr(DWORD* err, BOOL* copyAgain, BOOL* errAgai } *Out = HANDLES_Q(CreateFile(Op->TargetName, GENERIC_WRITE | GENERIC_READ, 0, NULL, OPEN_ALWAYS, AsyncPar->GetOverlappedFlag() | FILE_FLAG_SEQUENTIAL_SCAN, NULL)); - if (*Out != INVALID_HANDLE_VALUE) // opened successfully; now adjust the offset + if (*Out != INVALID_HANDLE_VALUE) // opened; now set the offset { BOOL ok = TRUE; CQuadWord size; size.LoDWord = GetFileSize(*Out, (DWORD*)&size.HiDWord); if (size.LoDWord == INVALID_FILE_SIZE && GetLastError() != NO_ERROR || // cannot obtain the size size < WriteOffset || // file is too small - WholeFileAllocated && size > allocFileSize && size > maxWriteOffset) // pre-allocated file is too large (greater than the pre-allocated size and the written portion including the current block) = extra bytes appended (allocWholeFileOnStart should be 0 /* need-test */) + WholeFileAllocated && size > allocFileSize && size > maxWriteOffset) // the preallocated file is too large (larger than the preallocated size and also larger than the written size including the last block) = written bytes were appended to the end of the file (allocWholeFileOnStart should be 0 /* need-test */) { // restart the entire thing ok = FALSE; } @@ -3978,8 +3978,8 @@ BOOL CCopy_Context::RetryCopyWriteErr(DWORD* err, BOOL* copyAgain, BOOL* errAgai // (but WARNING: for example Buffers[0] from AsyncPar may still be in use) if (ok && (Op->OpFlags & OPFL_TGTPATH_IS_NET) && !DisableLocalBuffering(AsyncPar, *Out, err)) TRACE_E("CCopy_Context::RetryCopyWriteErr(): IOCTL_LMR_DISABLE_LOCAL_BUFFERING failed for network target file: " << Op->TargetName << ", error: " << GetErrorText(*err)); - // using Overlapped[0 and 1].hEvent and Overlapped[0 and 1] from AsyncPar is OK; nothing is - // "in-progress", the event nor the overlapped structures are used (but WARNING: for example Buffers[0] + // Using Overlapped[0 and 1].hEvent and Overlapped[0 and 1] from AsyncPar is OK; nothing is + // "in progress" now, so the events and OVERLAPPED structures are not in use (but WARNING: for example Buffers[0] // from AsyncPar may still be in use) if (!ok || !CheckTailOfOutFile(AsyncPar, *In, *Out, WriteOffset, WriteOffset, FALSE)) { @@ -4113,11 +4113,11 @@ void DoCopyFileLoopAsync(CAsyncCopyParams* asyncPar, HANDLE& in, HANDLE& out, vo BOOL doCopy = TRUE; while (doCopy) { - if (ctx.ForceOp != fopWriting && ctx.FreeBlocks > 0 && !ctx.ReadingDone && ctx.ReadingBlocks < (numOfBlocks + 1) / 2) // read in parallel at most up to half of the blocks + if (ctx.ForceOp != fopWriting && ctx.FreeBlocks > 0 && !ctx.ReadingDone && ctx.ReadingBlocks < (numOfBlocks + 1) / 2) // read in parallel into at most half of the blocks { DWORD toRead = ctx.ReadOffset + CQuadWord(limitBufferSize, 0) <= fileSize ? limitBufferSize : (fileSize - ctx.ReadOffset).LoDWord; BOOL testEOF = toRead == 0; - if (!testEOF || ctx.ReadingBlocks == 0) // data read or EOF test (the EOF test runs only when all reads are finished) + if (!testEOF || ctx.ReadingBlocks == 0) // read data or test EOF (the EOF test runs only when all reads are finished) { if (ctx.BlockState[ctx.FreeBlockIndex] != cbsFree) ctx.FreeBlockIndex = ctx.FindBlock(cbsFree); @@ -4134,7 +4134,7 @@ void DoCopyFileLoopAsync(CAsyncCopyParams* asyncPar, HANDLE& in, HANDLE& out, vo } // reading has already been issued or is unnecessary, check whether something is completed BOOL shouldWait = TRUE; // TRUE = nothing else can be queued asynchronously, we must wait for some pending operation to finish - BOOL retryCopy = FALSE; // TRUE = after an error we should run Retry = start over from the beginning of the "doCopy" loop + BOOL retryCopy = FALSE; // TRUE = after an error, perform Retry = restart from the beginning of the "doCopy" loop // two passes are needed only for synchronous writes (we want to mark it // completed immediately and not after another read, mainly for progress reporting) for (int afterWriting = 0; afterWriting < 2; afterWriting++) @@ -4166,8 +4166,8 @@ void DoCopyFileLoopAsync(CAsyncCopyParams* asyncPar, HANDLE& in, HANDLE& out, vo ctx.AutoRetryAttemptsSNAP = 0; if (!res) // EOF at the beginning of the block (for cbsReading only: EOF can also be before this block and will be handled later in a block with a lower offset) { - // when GetOverlappedResult() returns FALSE it does not have to return bytes==0 - // (TRACE_C existed for that and crashes happened), so zero the bytes explicitly + // when GetOverlappedResult() returns FALSE, it does not necessarily return bytes==0 + // (TRACE_C was added for this and crashes still occurred), so zero bytes explicitly bytes = 0; if (testingEOF) ctx.ReadingDone = TRUE; // confirmed end of the source file, stop reading further @@ -4243,9 +4243,9 @@ void DoCopyFileLoopAsync(CAsyncCopyParams* asyncPar, HANDLE& in, HANDLE& out, vo SetProgressWithoutSuspend(hProgressDlg, CaclProg(operationDone, op->Size), CaclProg(totalDone + operationDone, script->TotalSize), dlgData); - if (script->ChangeSpeedLimit) // the speed limit is likely to change, this is a "suitable" place to wait until the + if (script->ChangeSpeedLimit) // the speed limit will probably change; this is a suitable place to wait until the worker resumes { // worker resumes so we can get the buffer size for copying again - WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be in suspend mode, wait ... + WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be suspended, wait ... script->GetNewBufSize(&limitBufferSize, bufferSize); } @@ -4302,8 +4302,8 @@ void DoCopyFileLoopAsync(CAsyncCopyParams* asyncPar, HANDLE& in, HANDLE& out, vo if (!doCopy || retryCopy) continue; - if (shouldWait) // another pass through the loop is pointless, no chance to start a new read or write, wait - { // for the oldest asynchronous operation to finish + if (shouldWait) // another pass through the loop is pointless; there is no chance to start a new read or write, so wait + { // wait for the oldest asynchronous operation to finish DWORD oldestBlockTime = 0; int oldestBlockIndex = -1; for (int i = 0; i < _countof(ctx.BlockState); i++) @@ -4344,7 +4344,7 @@ void DoCopyFileLoopAsync(CAsyncCopyParams* asyncPar, HANDLE& in, HANDLE& out, vo if (ctx.ReadOffset != ctx.WriteOffset || operationDone != ctx.WriteOffset) TRACE_C("DoCopyFileLoopAsync(): unexpected situation after copy: ReadOffset != WriteOffset || operationDone != ctx.WriteOffset"); - if (wholeFileAllocated) // we allocated the full size of the file (meaning the allocation made sense, e.g. the file cannot be empty) + if (wholeFileAllocated) // we allocated the entire file size (that is, the allocation made sense, e.g. the file cannot be empty) { if (operationDone < allocFileSize) // and the source file shrank, trim it here { @@ -4368,13 +4368,13 @@ void DoCopyFileLoopAsync(CAsyncCopyParams* asyncPar, HANDLE& in, HANDLE& out, vo } } - if (allocWholeFileOnStart == 0 /* need-test */) + if (allocWholeFileOnStart == 0 /* needs testing */) { CQuadWord curFileSize; curFileSize.LoDWord = GetFileSize(out, &curFileSize.HiDWord); BOOL getFileSizeSuccess = (curFileSize.LoDWord != INVALID_FILE_SIZE || GetLastError() == NO_ERROR); if (getFileSizeSuccess && curFileSize == operationDone) - { // verify that no extra bytes were appended to the end of the file + that we can truncate the file + { // verify that no bytes were appended to the end of the file and that we can truncate the file allocWholeFileOnStart = 1 /* yes */; } else @@ -4431,14 +4431,14 @@ BOOL DoCopyFile(COperation* op, HWND hProgressDlg, void* buffer, if (script->CopyAttrs && copyAsEncrypted) TRACE_E("DoCopyFile(): unexpected parameter value: copyAsEncrypted is TRUE when script->CopyAttrs is TRUE!"); - // if the path ends with a space/dot, it is invalid and we must not copy it, - // CreateFile would trim the spaces/dots and copy a different file or under a different name + // if the path ends with a space or dot, it is invalid and we must not copy it, + // CreateFile would trim the trailing spaces or dots and copy a different file or copy it under a different name BOOL invalidSrcName = FileNameIsInvalid(op->SourceName, TRUE); BOOL invalidTgtName = FileNameIsInvalid(op->TargetName, TRUE); // optimization: skipping all "older and identical" files is about 4x faster, - // slowing down when the file is newer is 5%, so it should be well worth it - // (it is safe to assume the user enables "Overwrite Older" when the skips occur) + // while the slowdown when the file is newer is 5%, so this should be well worth it + // (it is reasonable to assume the user enables "Overwrite Older" when those skips occur) BOOL tgtNameCaseCorrected = FALSE; // TRUE = the letter case in the target name was already adjusted to match the existing target file (so overwriting does not change it) WIN32_FIND_DATA dataIn, dataOut; if ((op->OpFlags & OPFL_OVERWROLDERALRTESTED) == 0 && @@ -4472,7 +4472,7 @@ BOOL DoCopyFile(COperation* op, HWND hProgressDlg, void* buffer, CQuadWord fileSize(op->FileSize); if (fileSize < COPY_MIN_FILE_SIZE) { - if (op->Size > COPY_MIN_FILE_SIZE) // should always be at least COPY_MIN_FILE_SIZE, but play it safe... + if (op->Size > COPY_MIN_FILE_SIZE) // should always be at least COPY_MIN_FILE_SIZE, but guard against smaller values... fileSize += op->Size - COPY_MIN_FILE_SIZE; // add the size of ADS streams } else @@ -4603,7 +4603,7 @@ BOOL DoCopyFile(COperation* op, HWND hProgressDlg, void* buffer, lossEncryptionAttr = TRUE; else { - WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be in suspend mode, wait ... + WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if the worker should be suspended, wait ... if (*dlgData.CancelWorker) goto CANCEL_ENCNOTSUP; @@ -4662,7 +4662,7 @@ BOOL DoCopyFile(COperation* op, HWND hProgressDlg, void* buffer, // if possible, allocate the required space for the file (prevents disk fragmentation + smoother writes to floppies) BOOL wholeFileAllocated = FALSE; - if (!skipAllocWholeFileOnStart && // last time failed, so the same would probably happen now + if (!skipAllocWholeFileOnStart && // an error occurred last time, so the same would probably happen now allocWholeFileOnStart != 2 /* no */ && // allocating the whole file is not forbidden fileSize > CQuadWord(limitBufferSize, 0) && // allocation is pointless below the copy buffer size fileSize < CQuadWord(0, 0x80000000)) // file size is positive number (otherwise seeking is impossible - numbers above 8EB, so likely never happens) @@ -4894,13 +4894,13 @@ BOOL DoCopyFile(COperation* op, HWND hProgressDlg, void* buffer, if (!adsSkip) return FALSE; // cancel the entire operation if (skip != NULL) - *skip = TRUE; // it is a Skip, must report higher up (Move must not delete the source file) + *skip = TRUE; // this is Skip; report it to the caller (Move must not delete the source file) } } if (out != NULL) { - if (!ignoreGetFileTimeErr) // only if we did not ignore the error while reading the file time (nothing to set otherwise) + if (!ignoreGetFileTimeErr) // only if we did not ignore the error reading the file time (otherwise there is nothing to set) { BOOL ignoreSetFileTimeErr = FALSE; while (!ignoreSetFileTimeErr && @@ -5041,7 +5041,7 @@ BOOL DoCopyFile(COperation* op, HWND hProgressDlg, void* buffer, DWORD err; if (!DoCopySecurity(op->SourceName, op->TargetName, &err, NULL)) { - WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be in suspend mode, wait ... + WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if the worker should be suspended, wait ... if (*dlgData.CancelWorker) goto COPY_ERROR_2; @@ -5161,7 +5161,7 @@ BOOL DoCopyFile(COperation* op, HWND hProgressDlg, void* buffer, } out = NULL; - WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be in suspend mode, wait ... + WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we are supposed to be in suspend mode, wait... if (*dlgData.CancelWorker) goto CANCEL_OPEN; @@ -5235,12 +5235,12 @@ BOOL DoCopyFile(COperation* op, HWND hProgressDlg, void* buffer, DWORD attr = SalGetFileAttributes(op->TargetName); if (attr != INVALID_FILE_ATTRIBUTES && (attr & (FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM))) { - if (!dlgData.OverwriteHiddenAll && dlgData.CnfrmSHFileOver) // ignore script->OverwriteOlder here; user wants to see that this is a SYSTEM or HIDDEN file even with the option enabled + if (!dlgData.OverwriteHiddenAll && dlgData.CnfrmSHFileOver) // Ignore script->OverwriteOlder here; the user wants to see that this is a SYSTEM or HIDDEN file even when the option is enabled. { HANDLES(CloseHandle(in)); in = NULL; - WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be in suspend mode, wait ... + WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we are supposed to be in suspend mode, wait ... if (*dlgData.CancelWorker) goto CANCEL_OPEN; @@ -5296,7 +5296,7 @@ BOOL DoCopyFile(COperation* op, HWND hProgressDlg, void* buffer, if (DeleteFile(op->TargetName)) goto OPEN_TGT_FILE; // if it is read-only (clearing the attribute may have failed), it can be deleted only on Samba with "delete readonly" enabled - else // cannot delete either, end with an error... + else // cannot delete it either, abort with an error... { err = GetLastError(); if (chAttr) @@ -5309,7 +5309,7 @@ BOOL DoCopyFile(COperation* op, HWND hProgressDlg, void* buffer, { // if we have not yet tested truncating the file to zero, obtain the current file size CQuadWord origFileSize(0, 0); // file size before truncation - if (mustDeleteFileBeforeOverwrite == 0 /* need test */) + if (mustDeleteFileBeforeOverwrite == 0 /* needs testing */) { out = HANDLES_Q(CreateFile(op->TargetName, 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL)); @@ -5339,7 +5339,7 @@ BOOL DoCopyFile(COperation* op, HWND hProgressDlg, void* buffer, if (out == INVALID_HANDLE_VALUE && fileAttrs != (asyncPar->GetOverlappedFlag() | FILE_FLAG_SEQUENTIAL_SCAN)) // when the target disk cannot create an Encrypted file (observed on NTFS network disk (tested on share from XP) while logged in under a different username than we have in the system (on the current console) - the remote machine has a same-named user without a password, so it cannot be used over the network) out = HANDLES_Q(CreateFile(op->TargetName, access, 0, NULL, CREATE_ALWAYS, asyncPar->GetOverlappedFlag() | FILE_FLAG_SEQUENTIAL_SCAN, NULL)); if (script->CopyAttrs && out == INVALID_HANDLE_VALUE) - { // if read access to the directory is denied (we added it only for setting the Compressed attribute), try opening the file for write only + { // if read access to the directory is not allowed (we added it only for setting the Compressed attribute), try opening the file for writing only access = GENERIC_WRITE; out = HANDLES_Q(CreateFile(op->TargetName, access, 0, NULL, CREATE_ALWAYS, fileAttrs, NULL)); if (out == INVALID_HANDLE_VALUE && fileAttrs != (asyncPar->GetOverlappedFlag() | FILE_FLAG_SEQUENTIAL_SCAN)) // when the target disk cannot create an Encrypted file (observed on NTFS network disk (tested on share from XP) while logged in under a different username than we have in the system (on the current console) - the remote machine has a same-named user without a password, so it cannot be used over the network) @@ -5352,7 +5352,7 @@ BOOL DoCopyFile(COperation* op, HWND hProgressDlg, void* buffer, // (deletion works, but direct overwrite does not (cannot open for writing) - workaround: // delete and recreate the file) // (Samba can allow deleting read-only files, which enables deleting them, - // otherwise Windows cannot delete a read-only file and we cannot drop + // otherwise Windows cannot delete a read-only file and we cannot drop // the "read-only" attribute because the current user is not the owner) if (chAttr) SetFileAttributes(op->TargetName, attr); @@ -5372,11 +5372,11 @@ BOOL DoCopyFile(COperation* op, HWND hProgressDlg, void* buffer, } // if we have not yet tested truncating the file to zero, obtain the new file size - if (mustDeleteFileBeforeOverwrite == 0 /* need test */) + if (mustDeleteFileBeforeOverwrite == 0 /* needs testing */) { HANDLES(CloseHandle(out)); out = HANDLES_Q(CreateFile(op->TargetName, access, 0, NULL, OPEN_ALWAYS, asyncPar->GetOverlappedFlag() | FILE_FLAG_SEQUENTIAL_SCAN, NULL)); - if (out == INVALID_HANDLE_VALUE) // cannot reopen the target file we just opened, unlikely, try deleting and recreating it + if (out == INVALID_HANDLE_VALUE) // Could not reopen the target file we just opened; unlikely, try deleting and recreating it { targetCannotOpenForWrite = TRUE; continue; @@ -5403,7 +5403,7 @@ BOOL DoCopyFile(COperation* op, HWND hProgressDlg, void* buffer, encryptionNotSupported = FALSE; SetCompressAndEncryptedAttrs(op->TargetName, (!lossEncryptionAttr && copyAsEncrypted ? FILE_ATTRIBUTE_ENCRYPTED : 0) | (script->CopyAttrs ? (op->Attr & (FILE_ATTRIBUTE_COMPRESSED | (lossEncryptionAttr ? 0 : FILE_ATTRIBUTE_ENCRYPTED))) : 0), &out, script->CopyAttrs, &encryptionNotSupported, asyncPar); - if (encryptionNotSupported) // unable to apply the Encrypted attribute, ask the user what to do... + if (encryptionNotSupported) // Cannot apply the Encrypted attribute; ask the user what to do... { if (dlgData.FileOutLossEncrAll) lossEncryptionAttr = TRUE; @@ -5449,7 +5449,7 @@ BOOL DoCopyFile(COperation* op, HWND hProgressDlg, void* buffer, goto COPY; } - else // regular error + else // normal error { NORMAL_ERROR: @@ -5494,7 +5494,7 @@ BOOL DoCopyFile(COperation* op, HWND hProgressDlg, void* buffer, if (invalidSrcName) err = ERROR_INVALID_NAME; if (asyncPar->Failed()) - err = ERROR_NOT_ENOUGH_MEMORY; // cannot create the synchronization event = lack of resources (will probably never happens, so we do not bother) + err = ERROR_NOT_ENOUGH_MEMORY; // cannot create the synchronization event = out of resources (this will probably never happen, so we do not handle it specially) WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be in suspend mode, wait ... if (*dlgData.CancelWorker) return FALSE; @@ -5666,7 +5666,7 @@ BOOL DoMoveFile(COperation* op, HWND hProgressDlg, void* buffer, DWORD err; if (!DoCopySecurity(sourceNameMvDir, targetNameMvDir, &err, &srcSecurity)) { - WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be in suspend mode, wait ... + WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if the worker should be suspended, wait ... if (*dlgData.CancelWorker) goto MOVE_ERROR_2; @@ -5703,12 +5703,12 @@ BOOL DoMoveFile(COperation* op, HWND hProgressDlg, void* buffer, { if (CompareFileTime(&dirTimeModified, &movedDirTimeModified) == 0) { - if (*setDirTimeAfterMove == 0 /* need test */) + if (*setDirTimeAfterMove == 0 /* test needed */) *setDirTimeAfterMove = 2 /* no */; } else { - if (*setDirTimeAfterMove == 0 /* need test */) + if (*setDirTimeAfterMove == 0 /* needs testing */) *setDirTimeAfterMove = 1 /* yes */; DoCopyDirTime(hProgressDlg, targetNameMvDir, &dirTimeModified, dlgData, TRUE); // ignore any failure, this is just a hack (we already ignore time read errors from the directory); MoveFile should not change times } @@ -5745,7 +5745,7 @@ BOOL DoMoveFile(COperation* op, HWND hProgressDlg, void* buffer, SetFileAttributes(sourceNameMvDir, attr); } - if (StrICmp(op->SourceName, op->TargetName) != 0 && // provided this is not just a change of case + if (StrICmp(op->SourceName, op->TargetName) != 0 && // if this is not just a case change (err == ERROR_FILE_EXISTS || // verify whether this is only overwriting the DOS name of the file/directory err == ERROR_ALREADY_EXISTS) && targetNameMvDir == op->TargetName) // no invalid names are allowed here @@ -5783,10 +5783,10 @@ BOOL DoMoveFile(COperation* op, HWND hProgressDlg, void* buffer, break; } } - if (tmpName[0] != 0) // if we managed to "tidy up" the conflicting file/directory, try moving it again + if (tmpName[0] != 0) // if we managed to move the conflicting file/directory aside, try moving the file/directory again { // then restore the original name of the "tidied" file/directory BOOL moveDone = SalMoveFile(sourceNameMvDir, op->TargetName); - if (script->CopyAttrs && (op->Attr & FILE_ATTRIBUTE_ARCHIVE) == 0) // the Archive attribute was not set; MoveFile turned it on, clear it again + if (script->CopyAttrs && (op->Attr & FILE_ATTRIBUTE_ARCHIVE) == 0) // the Archive attribute was not set; MoveFile set it, so clear it again SetFileAttributes(op->TargetName, op->Attr); // leave without handling or retry, not important (it normally toggles chaotically) if (!SalMoveFile(tmpName, origFullName)) { // this apparently can happen; inexplicably, Windows creates a file named origFullName instead of op->TargetName (the DOS name) @@ -5848,7 +5848,7 @@ BOOL DoMoveFile(COperation* op, HWND hProgressDlg, void* buffer, HANDLES(CloseHandle(in)); HANDLES(CloseHandle(out)); - WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be in suspend mode, wait ... + WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we are supposed to be in suspend mode, wait... if (*dlgData.CancelWorker) goto CANCEL_OPEN; @@ -5919,7 +5919,7 @@ BOOL DoMoveFile(COperation* op, HWND hProgressDlg, void* buffer, DWORD attr = SalGetFileAttributes(op->TargetName); if (attr != INVALID_FILE_ATTRIBUTES && (attr & (FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM))) { - if (!dlgData.OverwriteHiddenAll && dlgData.CnfrmSHFileOver) // ignore script->OverwriteOlder here; user wants to see that this is a SYSTEM or HIDDEN file even with the option enabled + if (!dlgData.OverwriteHiddenAll && dlgData.CnfrmSHFileOver) // ignore script->OverwriteOlder here; the user should still see that this is a SYSTEM or HIDDEN file even when the option is enabled { WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be in suspend mode, wait ... if (*dlgData.CancelWorker) @@ -5966,7 +5966,7 @@ BOOL DoMoveFile(COperation* op, HWND hProgressDlg, void* buffer, { DWORD err2 = GetLastError(); if (err2 == ERROR_FILE_NOT_FOUND) - break; // if the user already deleted the file manually, everything is fine + break; // if the user has already deleted the file, everything is fine WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be in suspend mode, wait ... if (*dlgData.CancelWorker) @@ -6072,7 +6072,7 @@ BOOL DoMoveFile(COperation* op, HWND hProgressDlg, void* buffer, clearReadonlyMask, &skip, lantasticCheck, mustDeleteFileBeforeOverwrite, allocWholeFileOnStart, dlgData, copyADS, copyAsEncrypted, TRUE, asyncPar); - if (notError && !skip) // still need to clean up the file from the source + if (notError && !skip) // still need to delete the source file { ClearReadOnlyAttr(op->SourceName); // ensure it can be deleted while (1) @@ -6117,8 +6117,8 @@ BOOL DoMoveFile(COperation* op, HWND hProgressDlg, void* buffer, BOOL DoDeleteFile(HWND hProgressDlg, char* name, const CQuadWord& size, COperations* script, CQuadWord& totalDone, DWORD attr, CProgressDlgData& dlgData) { - // if the path ends with a space/dot it is invalid and we must not delete it, - // DeleteFile would trim the spaces/dots and remove a different file + // if the path ends with a space or dot, it is invalid and we must not delete it, + // because DeleteFile would trim the spaces/dots and delete a different file BOOL invalidName = FileNameIsInvalid(name, TRUE); DWORD err; @@ -6315,7 +6315,7 @@ BOOL SalCreateDirectoryEx(const char* name, DWORD* err) { HANDLES(FindClose(find)); const char* tgtName = SalPathFindFileName(name); - if (StrICmp(tgtName, data.cAlternateFileName) == 0 && // match only for the DOS name + if (StrICmp(tgtName, data.cAlternateFileName) == 0 && // matches only the DOS name StrICmp(tgtName, data.cFileName) != 0) // (the full name differs) { // rename ("tidy up") the file/directory whose DOS name conflicts to a temporary 8.3 name (no extra DOS name needed) @@ -6343,7 +6343,7 @@ BOOL SalCreateDirectoryEx(const char* name, DWORD* err) } } if (tmpName[0] != 0) // if we managed to "tidy up" the conflicting file, retry the move - { // and then restore the original name of the "tidied" file + { // restore the original name of the "tidied" file BOOL createDirDone = CreateDirectory(name, NULL); if (!SalMoveFile(tmpName, origFullName)) { // this can apparently happen: inexplicably Windows creates a file named origFullName instead of name (the DOS name) @@ -6359,7 +6359,7 @@ BOOL SalCreateDirectoryEx(const char* name, DWORD* err) else { if ((origFullNameAttr & FILE_ATTRIBUTE_ARCHIVE) == 0) - SetFileAttributes(origFullName, origFullNameAttr); // leave it without extra handling or retries; not important (normally toggles unpredictably) + SetFileAttributes(origFullName, origFullNameAttr); // leave it without special handling or retries; not important (normally gets set unpredictably) } if (createDirDone) @@ -6543,10 +6543,10 @@ BOOL DoCreateDir(HWND hProgressDlg, char* name, DWORD attr, changeAttrErr = MyEncryptFile(hProgressDlg, name, currentAttrs, 0 /* allow encrypting directories with the SYSTEM attribute */, dlgData, dummyCancelOper, FALSE); - if ( //(WindowsVistaAndLater || script->TargetPathSupEFS) && // complain regardless of OS version and EFS support; originally directories on FAT could not be encrypted before Vista, we behave the same (to match Explorer, the Encrypted attribute is not that important) + if ( //(WindowsVistaAndLater || script->TargetPathSupEFS) && // complain regardless of the OS version and EFS support; originally, only Vista and later complained that directories on FAT cannot be encrypted; we behave the same way (to match Explorer, the Encrypted attribute is not that important) !dlgData.DirCrLossEncrAll && changeAttrErr != ERROR_SUCCESS) { // failed to set the Encrypted attribute on the directory, ask the user what to do - WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be in suspend mode, wait ... + WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we are supposed to be suspended, wait ... if (*dlgData.CancelWorker) goto CANCEL_CRDIR; @@ -6647,7 +6647,7 @@ BOOL DoCreateDir(HWND hProgressDlg, char* name, DWORD attr, } } - if (sourceDir != NULL && script->CopySecurity) // should NTFS security permissions be copied? + if (sourceDir != NULL && script->CopySecurity) // should NTFS security permissions be copied here? { DWORD err2; if (!DoCopySecurity(sourceDir, name, &err2, NULL)) @@ -6732,7 +6732,7 @@ BOOL DoCreateDir(HWND hProgressDlg, char* name, DWORD attr, } } alreadyExisted = TRUE; - return TRUE; // o.k. + return TRUE; // OK } WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be in suspend mode, wait ... @@ -6791,7 +6791,7 @@ BOOL DoCreateDir(HWND hProgressDlg, char* name, DWORD attr, { SKIP_CREATE_ERROR: - skip = TRUE; // this is a skip (all operations within the directory must be skipped) + skip = TRUE; // skip requested (all operations in this directory must be skipped) return TRUE; } case IDCANCEL: @@ -6872,7 +6872,7 @@ BOOL DoDeleteDir(HWND hProgressDlg, char* name, const CQuadWord& size, COperatio if (AutoRetryCounter < 4 && GetTickCount() - startTime + (AutoRetryCounter + 1) * 100 <= 2000 && (err == ERROR_DIR_NOT_EMPTY || err == ERROR_SHARING_VIOLATION)) - { // add auto-retry to handle this case: I have directories 1\2\3, deleting 1 including subdirectories while 3 is shown in a panel (watching for changes) -> removing 2 reports "directory not empty" because 3 stays in a transitional state due to change notifications (it is deleted, so it cannot be listed, but it still exists on disk briefly; quite a mess) + { // Add auto-retry to handle this case: if directories 1\\2\\3 exist and 1 is deleted including subdirectories while 3 is open in a panel (its changes are being watched), deleting 2 can report "directory not empty" because 3 remains in a transient state due to change notifications (it is already deleted, so it cannot be listed, etc., but it still still exists on disk briefly) // TRACE_I("DoDeleteDir(): err: " << GetErrorText(err)); AutoRetryCounter++; Sleep(AutoRetryCounter * 100); @@ -7173,7 +7173,7 @@ BOOL DoConvert(HWND hProgressDlg, char* name, char* sourceBuffer, char* targetBu char* terminator = strrchr(tmpPath, '\\'); if (terminator == NULL) { - // sanity check + // temporary test TRACE_E("Parameter 'name' must be full path to file (including path)"); HANDLES(CloseHandle(hSource)); return FALSE; @@ -7241,7 +7241,7 @@ BOOL DoConvert(HWND hProgressDlg, char* name, char* sourceBuffer, char* targetBu DWORD written; if (read == 0) break; // EOF - WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be in suspend mode, wait ... + WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we are supposed to be suspended, wait ... if (*dlgData.CancelWorker) { CONVERT_ERROR: @@ -7326,7 +7326,7 @@ BOOL DoConvert(HWND hProgressDlg, char* name, char* sourceBuffer, char* targetBu DWORD err; err = GetLastError(); - WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be in suspend mode, wait ... + WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be suspended, wait ... if (*dlgData.CancelWorker) goto CONVERT_ERROR; @@ -7390,7 +7390,7 @@ BOOL DoConvert(HWND hProgressDlg, char* name, char* sourceBuffer, char* targetBu else { DWORD err = GetLastError(); - WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be in suspend mode, wait ... + WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be suspended, wait ... if (*dlgData.CancelWorker) goto CONVERT_ERROR; @@ -7420,7 +7420,7 @@ BOOL DoConvert(HWND hProgressDlg, char* name, char* sourceBuffer, char* targetBu // close the files and update the global progress // do not reuse operationDone so the progress stays correct even if the file changes "under our feet" HANDLES(CloseHandle(hSource)); - if (!HANDLES(CloseHandle(hTarget))) // even after a failed call we assume the handle is closed, + if (!HANDLES(CloseHandle(hTarget))) // Even after a failed call, we assume the handle is closed. { // see https://forum.altap.cz/viewtopic.php?f=6&t=8455 hSource = hTarget = NULL; // (it states that the target file can be deleted, so the handle was not left open) goto WRITE_ERROR_CONVERT; @@ -7443,7 +7443,7 @@ BOOL DoConvert(HWND hProgressDlg, char* name, char* sourceBuffer, char* targetBu { DWORD err = GetLastError(); - WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be in suspend mode, wait ... + WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be suspended, wait ... if (*dlgData.CancelWorker) return FALSE; @@ -7477,7 +7477,7 @@ BOOL DoConvert(HWND hProgressDlg, char* name, char* sourceBuffer, char* targetBu { DWORD err = GetLastError(); - WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be in suspend mode, wait ... + WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be suspended, wait ... if (*dlgData.CancelWorker) { CANCEL_CONVERT: @@ -7640,8 +7640,8 @@ BOOL DoChangeAttrs(HWND hProgressDlg, char* name, const CQuadWord& size, DWORD a CProgressDlgData& dlgData) { // if the path ends with a space/dot, we must append '\\'; otherwise - // SetFileAttributes (and others) trims the spaces/dots and operates - // on a different path + // SetFileAttributes (and others) trim the spaces/dots and work + // with a different path const char* nameSetAttrs = name; char nameSetAttrsCopy[3 * MAX_PATH]; MakeCopyWithBackslashIfNeeded(nameSetAttrs, nameSetAttrsCopy); @@ -8158,7 +8158,7 @@ unsigned ThreadWorkerBody(void* parameter) } if (Error) break; - WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be in suspend mode, wait ... + WaitForSingleObject(dlgData.WorkerNotSuspended, INFINITE); // if we should be suspended, wait ... } if (!Error && !*dlgData.CancelWorker && i == script->Count && totalDone != script->TotalSize && (totalDone != CQuadWord(0, 0) || script->TotalSize != CQuadWord(1, 0))) // intentional change of script->TotalSize to one (prevents division by zero) From fed7a59ef1eeab1f9b705f5a49ddac3b670aa0c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:16:05 +0200 Subject: [PATCH 380/710] [translation] Fix src/plugins/unlha/lha.cpp comments Refines translated comments in src/plugins/unlha/lha.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #792 for src/plugins/unlha/lha.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/plugins/unlha/lha.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/plugins/unlha/lha.cpp b/src/plugins/unlha/lha.cpp index 0ef4a06c7..2f388c2af 100644 --- a/src/plugins/unlha/lha.cpp +++ b/src/plugins/unlha/lha.cpp @@ -406,8 +406,8 @@ int LHAGetHeader(FILE* fp, LHA_HEADER* lpHeader) break; case 0x50: /* - * UNIX permission - */ + * UNIX permissions + */ if (lpHeader->extend_type == EXTEND_UNIX) lpHeader->unix_mode = get_word(); break; @@ -472,8 +472,7 @@ int LHAGetHeader(FILE* fp, LHA_HEADER* lpHeader) // PROGRESS /////////////////////////////////////////////////////////////////////////// -BOOL(*pfLHAProgress) -(int size) = NULL; +BOOL (*pfLHAProgress)(int size) = NULL; static int iProgress; #define PROGRESS_MASK 0xffff8000 // progress meter position updates every 32 KB @@ -602,7 +601,7 @@ typedef short node; #define MAX_DICSIZ (1 << MAX_DICBIT) #define MATCHBIT 8 /* bits for MAXMATCH - THRESHOLD */ #define MAXMATCH 256 /* formerly F (not more than UCHAR_MAX + 1) */ -#define THRESHOLD 3 /* choose optimal value */ +#define THRESHOLD 3 /* optimal value */ #define CBIT 9 /* $\lfloor \log_2 NC \rfloor + 1$ */ #define USHRT_BIT 16 /* (CHAR_BIT * sizeof(ushort)) */ @@ -950,7 +949,7 @@ static void decode_start_st1() static void make_table(short nchar, uchar bitlen[], short tablebits, ushort table[]) { - unsigned short count2[17]; /* count of bitlen */ + unsigned short count2[17]; /* count for each bit length */ unsigned short weight[17]; /* 0x10000ul >> bitlen */ unsigned short start[17]; /* first code of bitlen */ unsigned short total; @@ -971,7 +970,7 @@ static void make_table(short nchar, uchar bitlen[], short tablebits, ushort tabl for (i = 0; (int)i < nchar; i++) count2[bitlen[i]]++; - /* calculate first code */ + /* calculate the first code */ total = 0; for (i = 1; i <= 16; i++) { @@ -982,7 +981,7 @@ static void make_table(short nchar, uchar bitlen[], short tablebits, ushort tabl error("make_table()", "Bad table (5)\n");*/ //FIX - /* shift data for make table. */ + /* Shift data for make_table(). */ m = 16 - tablebits; for (i = 1; (int)i <= tablebits; i++) { @@ -1822,7 +1821,7 @@ int LHAOpenArchive(FILE*& f, LPCTSTR lpName) if (LHAGetHeader(f, &hdr) != GH_ERROR) { // try to read one header fseek(f, 0, SEEK_SET); - return TRUE; // everything is OK, the archive is LHZ + return TRUE; // archive is LHZ } // failed to read the first header, check whether the archive is an SFX @@ -1846,7 +1845,7 @@ int LHAOpenArchive(FILE*& f, LPCTSTR lpName) /* found "-l??-" keyword (as METHOD type string) */ if (p[0] == '-' && p[1] == 'l' && p[4] == '-') { - /* header size and checksum are valid */ + /* Check the header size and checksum. */ if ((p[I_HEADER_LEVEL - 2] == 0 || p[I_HEADER_LEVEL - 2] == 0) && p[I_HEADER_SIZE - 2] > 20 && p[I_HEADER_CHECKSUM - 2] == calc_sum((char*)p, p[-2])) { fseek(f, (long)((p - 2) - buffer2) - n, SEEK_CUR); From b0552a2f1ad3e16bd1c605dd649f8dc8efa3afe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:16:45 +0200 Subject: [PATCH 381/710] [translation] Fix src/plugins/unmime/parser.cpp comments Refines translated comments in src/plugins/unmime/parser.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #795 for src/plugins/unmime/parser.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/plugins/unmime/parser.cpp | 38 +++++++++++++++++------------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/plugins/unmime/parser.cpp b/src/plugins/unmime/parser.cpp index 2b2ad71cb..6b96b2449 100644 --- a/src/plugins/unmime/parser.cpp +++ b/src/plugins/unmime/parser.cpp @@ -129,10 +129,10 @@ int iErrorStr; #define MIN_WEIGHT 5 -// List of header names - used to recognize the header block. 'name' is the header name, -// 'main' is a boolean that determines whether the header appears only in the main headers -// of the entire mail; 'weight' is the name weight - for a block to qualify as a header, the sum -// of the header-name weights must be at least MIN_WEIGHT. +// List of header names used to recognize a header block. 'name' is the header name, +// 'main' is a boolean indicating whether the header appears only in the headers +// of the entire mail; 'weight' is the header-name weight. For a block to qualify +// as a header, the sum of the header-name weights must be at least MIN_WEIGHT. static struct HEADERINFO { @@ -194,7 +194,7 @@ static struct HEADERINFO // MIN_WEIGHT. static BOOL bHeaderNamesSorted = FALSE; // the list of names is sorted during the first pass -// of ParseMailFile and bHeaderNamesSorted is set to TRUE +// ParseMailFile sorts it and sets bHeaderNamesSorted to TRUE // comparison function for qsort and bsearch static int __cdecl compare_header_names(const void* elem1, const void* elem2) @@ -533,8 +533,8 @@ static void ParseContentType(LPCSTR pszText, LPSTR pszType, int iMaxType, LPSTR static BOOL GetParameter(LPSTR pszText, LPCSTR pszParam, LPSTR pszBuffer, int iBufferSize) { CALL_STACK_MESSAGE3("GetParameter(%s, , , %d)", pszText, iBufferSize); - // create lowercase copies of the strings so I can search case-insensitively, - // I was afraid to use StrStrI... (I do not know if it is available on all systems) + // create lowercase copies of the strings so the search can be case-insensitive, + // StrStrI is avoided because it may not be available on all systems char* text = new char[strlen(pszText) + 1]; strcpy(text, pszText); CharLower(text); @@ -685,7 +685,7 @@ static void InsertSuffix(char* filename, int suffix) { char temp[MAX_PATH]; char* ext = strrchr(filename, '.'); - if (ext != NULL) // ".cvspass" is an extension in Windows + if (ext != NULL) // ".cvspass" is treated as a file extension on Windows { *ext++ = 0; sprintf(temp, "%s(%ld).%s", filename, suffix, ext); @@ -954,7 +954,7 @@ static BOOL TestUUBlock(CParserOutput* pOutput, BOOL& bEnd) SkipWSP(line); if (!*line) return FALSE; - while (*line && *line != ' ' && *line != '\t') // is a sequence of octal digits following? + while (*line && *line != ' ' && *line != '\t') // does a sequence of octal digits follow? if ((BYTE)*line < (BYTE)'0' || (BYTE)*line > (BYTE)'7') return FALSE; else @@ -965,9 +965,9 @@ static BOOL TestUUBlock(CParserOutput* pOutput, BOOL& bEnd) GetWord(line, filename, MAX_PATH, " \t"); // the file name also has to be present SkipWSP(line); if (*line) - return FALSE; // and nothing more + return FALSE; // nothing else must follow - // we found a UU header + // we found a uuencoded header SaveState(); // save the position in case we need to return int iLineStart = InputFile.iCurrentLine; int size = 0; @@ -1354,8 +1354,8 @@ BOOL ParseMailFile(LPCTSTR pszFileName, CParserOutput* pOutput, BOOL bAppendChar } goback = TRUE; } - else // Handling the case when the previous multipart - { // was not properly terminated, yet we are at a boundary + else // Handling the previous multipart case + { // the previous multipart was not properly terminated, but we are at a boundary int i; for (i = STACKTOP - 1; i >= 0; i--) // one of the previous ones. if (IsBoundary(cBoundaries[i], &bEnd2)) @@ -1414,7 +1414,7 @@ BOOL ParseMailFile(LPCTSTR pszFileName, CParserOutput* pOutput, BOOL bAppendChar while ((cNextLine[0] == ' ' || cNextLine[0] == '\t') && !IsWhiteLine(cNextLine)) { if (strlen(cLine) + strlen(cNextLine + 1) >= LINE_MAX) - break; // overflow test + break; // overflow check pDummyDecoder->DecodeLine(cNextLine, bLast); strcat(cLine, cNextLine + 1); bLast = bNextLast; @@ -1430,7 +1430,7 @@ BOOL ParseMailFile(LPCTSTR pszFileName, CParserOutput* pOutput, BOOL bAppendChar char cType[20], cSubType[20]; ParseContentType(cText, cType, sizeof(cType), cSubType, sizeof(cSubType)); if (iMultipart < MULTIPARTSTACK_MAX && !_stricmp(cType, "multipart")) - { // if the message is multipart, we care about the string that separates the individual parts + { // if the message is multipart, we care about the boundary string that separates the individual parts char cBoundary[BOUNDARY_MAX]; if (GetParameter(cText, "boundary", cBoundary, BOUNDARY_MAX)) { @@ -1489,7 +1489,7 @@ BOOL ParseMailFile(LPCTSTR pszFileName, CParserOutput* pOutput, BOOL bAppendChar p = strrchr(cDisp, '/'); p = max(p, p2); if (p && p[1]) - { // Do not take empty fname from from e.g. http://www.altap.cz/ + { // Do not take an empty file name from URLs such as http://www.altap.cz/ iNameOrigin = 3; bNextBlockIsAttachment = TRUE; strcpy(cFileName, p + 1); @@ -1504,10 +1504,10 @@ BOOL ParseMailFile(LPCTSTR pszFileName, CParserOutput* pOutput, BOOL bAppendChar } else if (!*p) { - // Hack: Handle .MHT files created by MSIE7 or Win7 problem report creation tool: + // Hack: Handle .MHT files created by MSIE7 or the Windows 7 problem reporting tool: // Content-Location: screenshot_0001.jpeg - // But right now I cannot find any example with file: :-((( - // Should we look for \ and / as well? + // No example using file: has been found yet. + // Should we also look for \\ and /? iNameOrigin = 3; bNextBlockIsAttachment = TRUE; strcpy(cFileName, cDisp); From d539d4fcb388bcd0249a977366e3dc98f5baa388 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:17:24 +0200 Subject: [PATCH 382/710] [translation] Fix src/cache.h comments Refines translated comments in src/cache.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #842 for src/cache.h, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/cache.h | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/src/cache.h b/src/cache.h index 6c321ba79..1cd198166 100644 --- a/src/cache.h +++ b/src/cache.h @@ -43,7 +43,7 @@ class CCacheData // tmp-name, info about file or directory on disk, internal use // system objects - array of (HANDLE): state "signaled" -> remove this 'lock' TDirectArray LockObject; - // the object ownership - array of (BOOL): TRUE -> call CloseHandle('lock') + // object ownership: array of BOOL values; TRUE -> call CloseHandle('lock') TDirectArray LockObjOwner; BOOL Cached; // is it a cached tmp-file? (did CrtCache already arrive?) @@ -106,7 +106,7 @@ class CCacheData // tmp-name, info about file or directory on disk, internal use // see CDiskCache::AssignName() for a description // - // handles - object for tracking 'lock' objects + // handles - object for tracking 'lock' handles BOOL AssignName(CCacheHandles* handles, HANDLE lock, BOOL lockOwner, CCacheRemoveType remove); // see CDiskCache::ReleaseName() for a description @@ -125,8 +125,8 @@ class CCacheData // tmp-name, info about file or directory on disk, internal use // lastLock - pointer to a BOOL that is set to TRUE if there are no more links to the tmp-file BOOL WaitSatisfied(HANDLE lock, BOOL* lastLock); - // if we change our mind about deleting the tmp-file on disk (e.g. it was not possible to pack it, - // so we leave it in temp, so that the users don't kill us) + // if we decide not to delete the temporary file on disk (for example, packing failed, + // it is safer to leave it in the temp directory) void DetachTmpFile() { Detached = TRUE; } // changes type of tmp-file to crtDirect (direct deletion after use) @@ -177,21 +177,21 @@ class CCacheDirData // tmp-directory, contains unique tmp-names, internal use BOOL ContainTmpName(const char* tmpName, const char* rootTmpPath, int rootTmpPathLen, BOOL* canContainThisName); - // searches for 'name' in the tmp-directory; if it's found, returns TRUE and values 'name' and 'tmpPath', - // so that they match expected values from CDiskCache::GetName(); if it's not found, - // returns FALSE + // Searches for 'name' in the tmp directory; if found, returns TRUE and sets 'tmpPath' + // and the related state so they match the expected values from CDiskCache::GetName(); if not found, + // returns FALSE. // - // name - unique item identification - // exists - pointer to BOOL, which is set per the description above + // name - unique item identifier + // exists - pointer to a BOOL set as described above // tmpPath - return value of CDiskCache::GetName() (NULL && 'exists'==TRUE -> fatal error) // - // if 'onlyAdd' is TRUE, it is possible to create only a new name or restore a deleted tmp-file - // (the name exists, but the tmp-file is not prepared) - if the name exists, returns TRUE, - // 'exists' FALSE and 'tmpPath' NULL ("file already exists"); - // 'canBlock' is TRUE if waiting for readiness of the tmp-file is expected, in case 'name' - // is in cache, but it's not prepared, if 'canBlock' is FALSE and the tmp-file is not prepared, - // returns TRUE, 'exists' FALSE and 'tmpPath' NULL ("not found"); - // if 'errorCode' is not NULL, the error code is returned in it (see DCGNE_XXX) + // If 'onlyAdd' is TRUE, only a new name may be created, or a deleted tmp file may be restored + // (the name exists, but the tmp file is not prepared); if the name already exists, + // returns TRUE, 'exists' FALSE, and 'tmpPath' NULL ("file already exists"); + // 'canBlock' is TRUE if the call should wait for the tmp file to become ready when + // 'name' is in the cache but is not prepared; if 'canBlock' is FALSE and the tmp file is not + // prepared, returns TRUE, 'exists' FALSE, and 'tmpPath' NULL ("not found"); + // if 'errorCode' is not NULL, it receives the error code that occurred (see DCGNE_XXX) BOOL GetName(CDiskCache* monitor, const char* name, BOOL* exists, const char** tmpPath, BOOL canBlock, BOOL onlyAdd, int* errorCode); @@ -413,17 +413,17 @@ class CDiskCache // assigns names for tmp-files // remove - when to delete the tmp-file BOOL AssignName(const char* name, HANDLE lock, BOOL lockOwner, CCacheRemoveType remove); - // called only when NamePrepared() or AssignName() cannot be called after GetName(); - // used for errors while acquiring the tmp-file or the 'lock' object (the launched - // application for which the tmp-file was being acquired) - // if NamePrepared() would have to be called, gives other threads a chance to create the - // tmp-file (those waiting until the tmp-file is prepared); if AssignName() would have to - // be called, cancels the tmp-file's waiting state for assignment of the 'lock' object, and the - // tmp-file may be deleted; if 'storeInCache' is TRUE and the tmp-file is prepared and not - // locked, it is marked as cached (if the maximum cache capacity allows it, it will not be - // deleted) + // Called only when NamePrepared() or AssignName() cannot be called after GetName(). + // Used in case of an error while acquiring the tmp file or the 'lock' object (the + // launched application for which the tmp file was being acquired). + // If NamePrepared() would otherwise need to be called, it gives other threads a chance + // to create the tmp file (those waiting until the tmp file is prepared). If AssignName() + // would otherwise need to be called, it cancels the tmp file's waiting state for assignment + // of the 'lock' object, and the tmp file may be deleted. If 'storeInCache' is TRUE and the + // tmp file is prepared and not locked, it is marked as cached (if the maximum cache capacity + // allows it, it will not be deleted). // - // returns success + // Returns success. // // name - item identifier (used later for lookup) BOOL ReleaseName(const char* name, BOOL storeInCache); From d5ea9af79993a0ba58088a80da33ebda25e9001b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:17:40 +0200 Subject: [PATCH 383/710] [translation] Fix src/callstk.cpp comments Refines translated comments in src/callstk.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #843 for src/callstk.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/callstk.cpp | 50 ++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/src/callstk.cpp b/src/callstk.cpp index efcf39ef1..733029365 100644 --- a/src/callstk.cpp +++ b/src/callstk.cpp @@ -100,11 +100,11 @@ BOOL PreventSetUnhandledExceptionFilterAux() newJump[0] = 0xE9; // JMP rel32 memcpy(&newJump[1], &dwRelativeAddr, sizeof(pNewFunc)); #elif _M_X64 - // We must use R10 or R11, because these are "scratch" registers - // which need not to be preserved accross function calls - // For more info see: Register Usage for x64 64-Bit + // We must use R10 or R11 because these are "scratch" registers + // that do not need to be preserved across function calls. + // For more information, see: Register Usage for x64 64-Bit // http://msdn.microsoft.com/en-us/library/ms794547.aspx - // Thanks to Matthew Smith!!! + // Thanks to Matthew Smith. newJump[0] = 0x49; // MOV R11, ... newJump[1] = 0xBB; // ... memcpy(&newJump[2], &pNewFunc, sizeof(pNewFunc)); @@ -264,22 +264,22 @@ CCallStack::CCallStack(BOOL dontSuspend) OldUnhandledExceptionFilter = SetUnhandledExceptionFilter(TopLevelExceptionFilter); // Try to disable the unhandled exception filter for subsequent calls. - // When a DLL library (plugin, shell extension) that uses a different RTL is - // loaded into Salamander process, that RTL installs this filter during its - // initialization. Additionally, starting with MSVC 2005, various sanity checks no - // longer throw exceptions but instead print a message and directly call + // If a DLL (plugin, shell extension) that uses a different RTL is loaded + // into the Salamander process, that RTL takes over this filter during its + // initialization. Also, since MSVC 2005, various sanity checks no longer + // throw exceptions, but instead display a message and call // UnhandledExceptionFilter(), which opens the Watson dialog. - // For example, Salamander used to crash without a bug report - // from TortoiseSVN shell extension. The call below should - // ensure we catch all unhandled crashes including MSVC 2005 sanity - // checks. + // This used to make Salamander crash without a bug report, for example + // with the TortoiseSVN shell extension. + // The following call should let us catch all unhandled crashes, including + // MSVC 2005 sanity checks. // - // More on this topic in "A proposal to make Dr.Watson invocation configurable": + // More on this topic: "A proposal to make Dr.Watson invocation configurable": // http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=101337 - // and two hardcore solutions: + // and two hard-core solutions: // http://www.debuginfo.com/articles/debugfilters.html // http://blog.kalmbachnet.de/?postid=75 - // 3/2012 - update pro x64: http://blog.kalmbach-software.de/2008/04/02/unhandled-exceptions-in-vc8-and-above-for-x86-and-x64/ + // 3/2012 - x64 update: http://blog.kalmbach-software.de/2008/04/02/unhandled-exceptions-in-vc8-and-above-for-x86-and-x64/ PreventSetUnhandledExceptionFilter(); } @@ -359,7 +359,7 @@ CCallStack::~CCallStack() // TRACE_I("CCallStack::~CCallStack(): MonitoredItemsSize=" << MonitoredItemsSize); if (OldestItemIndex != -1) { - while (1) // go through the queue again and print final states of critical call-stack invocations + while (1) // Process the queue once more and print the final states of critical call-stack calls { if (!MonitoredItems[OldestItemIndex].NotAlreadyReported) // if it was already reported, print final values { @@ -404,7 +404,7 @@ CCallStack::~CCallStack() if (BugReportThread != NULL) { - // by ending this thread, the code enters here one more time because CCallStack exited for it as well + // when this thread terminates, execution reaches this code once more because CCallStack also exits for this thread SetEvent(TBRData.TerminateEvent); // terminate the bug report thread WaitForSingleObject(BugReportThread, 1000); // wait at most one second for the thread to finish NOHANDLES(CloseHandle(BugReportThread)); @@ -442,7 +442,7 @@ void CCallStack::ReleaseBeforeExitThreadBody() // TRACE_I("CCallStack::~CCallStack(): MonitoredItemsSize=" << MonitoredItemsSize); if (OldestItemIndex != -1) { - while (1) // go through the queue again and print final states of critical call-stack invocations + while (1) // go through the queue again and print the final values of critical call-stack invocations { if (!MonitoredItems[OldestItemIndex].NotAlreadyReported) // if it was already reported, print final values { @@ -620,10 +620,10 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = if (res != DIALOG_IGNORE) { HKEY hSalamander; - if (OpenKey(HKEY_CURRENT_USER, SalamanderConfigurationRoots[0], hSalamander)) // write data only if a configuration exists in the registry (hich should almost always be the cas) + if (OpenKey(HKEY_CURRENT_USER, SalamanderConfigurationRoots[0], hSalamander)) // write data only if a configuration exists in the registry (which should almost always be the case) { HKEY actKey; - if (OpenKey(hSalamander, SALAMANDER_CONFIG_REG, actKey)) // write data only if a configuration exists in the registry (hich should almost always be the cas) + if (OpenKey(hSalamander, SALAMANDER_CONFIG_REG, actKey)) // write data only if a configuration exists in the registry (which should almost always be the case) { CloseKey(actKey); if (CreateKey(hSalamander, SALAMANDER_CONFIG_REG, actKey)) @@ -791,7 +791,7 @@ int CCallStack::HandleException(EXCEPTION_POINTERS* e, DWORD shellExtCrashID, co // in the DEBUG version we check for a debugger; in SDK/RELEASE version we rather skip this test #if defined(_DEBUG) && !defined(ENABLE_BUGREPORT_DEBUGGING) if (IsDebuggerPresent()) // if the software is currently being debugged, showing the Bug Report dialog makes no sense - return EXCEPTION_CONTINUE_SEARCH; // pass the exception on ... the debugger will catch it + return EXCEPTION_CONTINUE_SEARCH; // propagate the exception further; the debugger will catch it #endif static char bugReportPath[MAX_PATH]; @@ -850,7 +850,7 @@ int CCallStack::HandleException(EXCEPTION_POINTERS* e, DWORD shellExtCrashID, co reportInThisThread = TBRData.EventProcessedRet == FALSE; // if generation failed in the thread, try here too } - // if the bug-report thread didn't run or failed to generate the report, we will try again in this thread + // if the bug-report thread did not run or failed to generate the report, we will try again in this thread if (reportInThisThread) { // Concurrent generation of two reports caused issues (with a 200 ms @@ -924,7 +924,7 @@ void CCallStack::CheckCallFrequency(DWORD_PTR callerAddress, LARGE_INTEGER* push act = MonitoredItemsSize - 1; } } - if (OldestItemIndex != -1) // first remove outdated items (make space for a new one) + if (OldestItemIndex != -1) // first remove stale items (make room for a new one) { while (1) { @@ -932,7 +932,7 @@ void CCallStack::CheckCallFrequency(DWORD_PTR callerAddress, LARGE_INTEGER* push break; else { - if (!MonitoredItems[OldestItemIndex].NotAlreadyReported) // if it was reported, print final values + if (!MonitoredItems[OldestItemIndex].NotAlreadyReported) // if it was already reported, log the final values { TRACE_I("Info for Too Frequently Used Call Stack Message: call address: 0x" << std::hex << MonitoredItems[OldestItemIndex].CallerAddress << std::dec << ", total push-time: " << (DWORD)(MonitoredItems[OldestItemIndex].PushesPerfTime * 1000 / CCallStack::SavedPerfFreq.QuadPart) << "ms, total number of calls in monitored period: " << MonitoredItems[OldestItemIndex].NumberOfCalls); } @@ -1003,7 +1003,7 @@ void CCallStack::CheckCallFrequency(DWORD_PTR callerAddress, LARGE_INTEGER* push // CCallStackMessage // -// so I do not include the entire intrin.h +// to avoid including the entire intrin.h extern "C" { void* _AddressOfReturnAddress(void); From c60cebe1472c739578671a0ca38c316248880dfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:17:55 +0200 Subject: [PATCH 384/710] [translation] Fix src/callstk.h comments Refines translated comments in src/callstk.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #844 for src/callstk.h, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/callstk.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/callstk.h b/src/callstk.h index 1d1c48daa..b5515cae7 100644 --- a/src/callstk.h +++ b/src/callstk.h @@ -39,8 +39,8 @@ struct CCallStackMonitoredItem DWORD_PTR CallerAddress; // address where the call-stack macro was invoked DWORD NumberOfCalls; // number of calls during the last CALLSTACK_TRACETIME milliseconds __int64 PushesPerfTime; // total "time" of Push operations for this call-stack macro - BOOL NotAlreadyReported; // TRUE = if the issue has not been reported - // (to avoid flooding the Trace Server) + BOOL NotAlreadyReported; // TRUE = the problem has not yet been reported + // (to avoid unnecessary flooding of the Trace Server) }; #endif // (defined(_DEBUG) || defined(CALLSTK_MEASURETIMES)) && !defined(CALLSTK_DISABLEMEASURETIMES) @@ -55,12 +55,12 @@ class CCallStack // terminating null, the length of the // previous string is always stored (two bytes) // followed immediately by the next string - char* End; // pointer to the last two zeros - int Skipped; // number of messages that could not be stored + char* End; // pointer to the last two nulls + int Skipped; // number of messages that could not be saved char* Enum; // pointer to the last printed text BOOL FirstCallstack; // are we the first instance? - const char* PluginDLLName; // plug-in DLL currently running in the thread + const char* PluginDLLName; // plugin DLL currently running in the thread // (NULL if it is salamand.exe) int PluginDLLNameUses; // the Pop() operation count at which PluginDLLName should be set to NULL // (nesting level) @@ -84,7 +84,7 @@ class CCallStack public: DWORD PushesCounter; // counter of Push calls invoked in this object (in one thread) LARGE_INTEGER PushPerfTimeCounter; // total time spent in Push calls invoked in this object (one thread) - LARGE_INTEGER IgnoredPushPerfTimeCounter; // total time spent in unmeasured (ignored) Push calls invoked here (one thread) + LARGE_INTEGER IgnoredPushPerfTimeCounter; // total time spent in unmeasured (ignored) Push calls invoked in this object (in one thread) static LARGE_INTEGER SavedPerfFreq; // nonzero result of QueryPerformanceFrequency #define CALLSTK_BENCHMARKTIME 100 // time in milliseconds during which the call-stack speed is measured static DWORD SpeedBenchmark; // how many measured call-stack macros can be pushed+poped within CALLSTK_BENCHMARKTIME milliseconds @@ -108,7 +108,7 @@ class CCallStack void Pop(); #endif // (defined(_DEBUG) || defined(CALLSTK_MEASURETIMES)) && !defined(CALLSTK_DISABLEMEASURETIMES) - // called only when storing a call-stack message from a plug-in + // called only when storing a call-stack message from a plugin void PushPluginDLLName(const char* dllName) { if (PluginDLLName == NULL) @@ -120,7 +120,7 @@ class CCallStack PluginDLLNameUses++; } - // called only when retrieving a call-stack message from a plug-in + // called only when retrieving a call-stack message from a plugin void PopPluginDLLName() { if (PluginDLLNameUses <= 1) @@ -193,7 +193,7 @@ class CCallStackMessage #if (defined(_DEBUG) || defined(CALLSTK_MEASURETIMES)) && !defined(CALLSTK_DISABLEMEASURETIMES) -extern BOOL __CallStk_T; // always TRUE - just to check format string and type of parameters of call-stack macros +extern BOOL __CallStk_T; // always TRUE; only used to check the format string and parameter types of call-stack macros #define CALL_STACK_MESSAGE1(p1) CCallStackMessage CALLSTK_UNIQUE(_m)(FALSE, 0, p1) #define CALL_STACK_MESSAGE2(p1, p2) CCallStackMessage CALLSTK_UNIQUE(_m)(FALSE, (__CallStk_T ? 0 : printf(p1, p2)), p1, p2) From dbe115b617f7bc7355f988707913905f32467e66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:18:11 +0200 Subject: [PATCH 385/710] [translation] Fix src/codetbl.h comments Refines translated comments in src/codetbl.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #847 for src/codetbl.h, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/codetbl.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/codetbl.h b/src/codetbl.h index b1afc32bf..72aa20a1a 100644 --- a/src/codetbl.h +++ b/src/codetbl.h @@ -70,16 +70,16 @@ class CCodeTables // otherwise it returns FALSE BOOL GetPreloadedIndex(const char* dirName, int* index); - // selects the best matching item from the Preloaded array + // Selects the best matching item from the Preloaded array // cfgDirName points to the recommended directory name (from the configuration) - // dirName must point to a buffer of MAX_PATH characters where the directory name is returned; - // if none exists, an empty string is returned - // criteria: + // dirName must point to a buffer of size MAX_PATH where the directory name is returned; + // if no such item exists, an empty string is returned + // Criteria: // 1. cfgDirName - // 2. item matching the OS code page + // 2. Item matching the OS code page // 3. westeuro - // 4. first in the list - // 5. if there is no item in the list, we will return an empty string + // 4. First item in the list + // 5. If the list is empty, an empty string is returned void GetBestPreloadedConversion(const char* cfgDirName, char* dirName); // prepares the object for use (loads 'convert.cfg' script), hWindow is the parent window for message boxes From bb822c35a13d1463f348e920a40372e44e7a42b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:18:26 +0200 Subject: [PATCH 386/710] [translation] Fix src/color.cpp comments Refines translated comments in src/color.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #848 for src/color.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/color.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/color.cpp b/src/color.cpp index 6595f11f7..595e07a86 100644 --- a/src/color.cpp +++ b/src/color.cpp @@ -36,7 +36,7 @@ void ColorRGBToHLS(COLORREF clrRGB, WORD* pwHue, WORD* pwLuminance, WORD* pwSatu int h, l, s; // output HLS values WORD cMax, cMin; // max and min RGB values WORD cSum, cDif; - int rDelta, gDelta, bDelta; // intermediate value: % of spread from max + int rDelta, gDelta, bDelta; // intermediate value: % of the spread from the maximum // get R, G, and B out of DWORD r = GetRValue(clrRGB); @@ -95,7 +95,7 @@ WORD HueToRGB(WORD n1, WORD n2, WORD hue) if (hue > HLSMAX) hue -= HLSMAX; - // return r,g, or b value from this tridrant + // return the r, g, or b value for this hue segment if (hue < (HLSMAX / 6)) return (n1 + (((n2 - n1) * hue + (HLSMAX / 12)) / (HLSMAX / 6))); if (hue < (HLSMAX / 2)) @@ -109,7 +109,7 @@ WORD HueToRGB(WORD n1, WORD n2, WORD hue) COLORREF ColorHLSToRGB(WORD wHue, WORD wLuminance, WORD wSaturation) { WORD r, g, b; // RGB component values - WORD magic1, magic2; // calculated magic numbers (really!) + WORD magic1, magic2; // computed magic numbers if (wSaturation == 0) { // achromatic case From 4a6e6ca3d843ab01b6e75b50892e0d3b9a9b5b5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:19:06 +0200 Subject: [PATCH 387/710] [translation] Fix src/dialogs2.cpp comments Refines translated comments in src/dialogs2.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #851 for src/dialogs2.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/dialogs2.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/dialogs2.cpp b/src/dialogs2.cpp index 776bf8bbc..cd722edbe 100644 --- a/src/dialogs2.cpp +++ b/src/dialogs2.cpp @@ -269,7 +269,7 @@ CCommonDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) else CallEndStopRefresh = FALSE; - // when opening the dialog set the plug-ins' msgbox parent to this dialog (main thread only) + // when opening the dialog, set the message-box parent for plugins to this dialog (main thread only) if (Modal && MainThreadID == GetCurrentThreadId()) { HOldPluginMsgBoxParent = PluginMsgBoxParent; @@ -301,15 +301,15 @@ CCommonDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_DESTROY: { - if (GetKeyState(VK_ESCAPE) & 0x8000) // measure to avoid interrupting panel listing after each ESC + if (GetKeyState(VK_ESCAPE) & 0x8000) // safeguard against interrupting panel listing on each Esc WaitForESCReleaseBeforeTestingESC = TRUE; - // the dialog is closing - the user might have changed the clipboard - // (for example pasted text from an editline), so we'll verify it + // the dialog is closing; the user might have changed the clipboard + // (for example by putting text into an edit line), so we will check it IdleRefreshStates = TRUE; // force the state variables check during the next Idle IdleCheckClipboard = TRUE; // also let the clipboard be checked - // when closing the dialog restore the msgbox parent for plug-ins + // when closing the dialog restore the msgbox parent for plugins if (HOldPluginMsgBoxParent != NULL) PluginMsgBoxParent = HOldPluginMsgBoxParent; @@ -875,7 +875,7 @@ void CLanguageSelectorDialog::LoadListView() void CLanguageSelectorDialog::Transfer(CTransferInfo& ti) { - if (PluginName != NULL) // show this checkbox only when selecting an alternative language for a plug-in + if (PluginName != NULL) // show this checkbox only when selecting an alternative language for a plugin ti.CheckBox(IDC_USESAMESLGINOTHERPLUGINS, Configuration.UseAsAltSLGInOtherPlugins); if (ti.Type == ttDataToWindow) @@ -894,7 +894,7 @@ void CLanguageSelectorDialog::Transfer(CTransferInfo& ti) if (index != -1) { lstrcpy(SLGName, Items[index].FileName); - if (PluginName != NULL) // store the alternative language name only when selecting an alternative language for a plug-in + if (PluginName != NULL) // store the alternative language name only when selecting an alternative language for a plugin { if (Configuration.UseAsAltSLGInOtherPlugins) lstrcpy(Configuration.AltPluginSLGName, SLGName); @@ -923,7 +923,7 @@ BOOL CLanguageSelectorDialog::Initialize(const char* slgSearchPath, HINSTANCE pl do { char* point = strrchr(file.cFileName, '.'); - if (point != NULL && stricmp(point + 1, "slg") == 0) // it was returning *.slg* + if (point != NULL && stricmp(point + 1, "slg") == 0) // FindFirstFile was returning *.slg* too { CLanguage lang; if (lang.Init(file.cFileName, pluginDLL)) @@ -950,7 +950,7 @@ int CLanguageSelectorDialog::GetPreferredLanguageIndex(const char* selectSLGName WORD primaryID = PRIMARYLANGID(langID); int localeIndex = -1; // index corresponding to the user's locale int primarylocaleIndex = -1; // index corresponding to the user's primary language locale - int englishIndex = -1; // index of the file "english.slg" + int englishIndex = -1; // index of the "english.slg" file int i; for (i = 0; i < Items.Count; i++) { @@ -1014,18 +1014,18 @@ CLanguageSelectorDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) { if (PluginName != NULL) { - // put the plug-in name in the title so the user knows which plug-in the language is for + // put the plugin name in the title so the user knows which plugin the language is for char buf[200]; _snprintf_s(buf, _TRUNCATE, "%s: ", PluginName); - buf[99] = 0; // use only 100 characters for the plug-in name so some space remains for the original title dialog + buf[99] = 0; // use only 100 characters for the plugin name so some space remains for the original title dialog int len = (int)strlen(buf); if (GetWindowText(HWindow, buf + len, 200 - len)) SetWindowText(HWindow, buf); } } - if (!OpenedFromConfiguration && PluginName == NULL) // turn the Cancel button into Exit + if (!OpenedFromConfiguration && PluginName == NULL) // change the Cancel button to Exit SetDlgItemText(HWindow, IDCANCEL, ExitButtonLabel); - if (PluginName != NULL) // disable closing + if (PluginName != NULL) // disable the Close command EnableMenuItem(GetSystemMenu(HWindow, FALSE), SC_CLOSE, MF_BYCOMMAND | MF_GRAYED); Web = new CHyperLink(HWindow, IDC_SLG_WEB, STF_HYPERLINK_COLOR); From 0f6a02350534002188d0ef9cb5a16f167ce916a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:19:21 +0200 Subject: [PATCH 388/710] [translation] Fix src/dialogs3.cpp comments Refines translated comments in src/dialogs3.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #852 for src/dialogs3.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/dialogs3.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/dialogs3.cpp b/src/dialogs3.cpp index e11ad66ef..08e30d070 100644 --- a/src/dialogs3.cpp +++ b/src/dialogs3.cpp @@ -226,7 +226,7 @@ CConvertFilesDlg::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) SetMenuItemBitmaps(hMenu, mi.wID, MF_BYCOMMAND, NULL, HMenuCheckDot); } - // insert a separator after none + // insert a separator after 'None' mi.fMask = MIIM_TYPE; mi.fType = MFT_SEPARATOR; InsertMenuItem(hMenu, 1, TRUE, &mi); @@ -519,8 +519,8 @@ CEditNewFileDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) { if (LOWORD(wParam) == IDB_BROWSE) { - /* used by the export_mnu.py script which generates salmenu.mnu for the Translator - keep synchronized with the InsertMenu() call below... + /* Used by the export_mnu.py script that generates salmenu.mnu for Translator. + Keep synchronized with the InsertMenu() call below. MENU_TEMPLATE_ITEM EditNewFileDialogMenu[] = { {MNTT_PB, 0 @@ -687,7 +687,7 @@ void CCopyMoveMoreDialog::TransferCriteriaControls(CTransferInfo& ti) { Criteria->Masks.SetMasksString(masks); int errpos = 0; - // masks must go out in the Prepared state + // masks must be passed out in the Prepared state if (!Criteria->Masks.PrepareMasks(errpos)) // invalid mask, this shouldn't happen thanks to validation Criteria->UseMasks = FALSE; char dummy[200]; @@ -723,7 +723,7 @@ void CCopyMoveMoreDialog::TransferCriteriaControls(CTransferInfo& ti) { speedLimNum /= 1024; speedLimUnits++; - if (speedLimNum == 0 || speedLimUnits > 3) // cannot happen, just for peace of mind + if (speedLimNum == 0 || speedLimUnits > 3) // cannot happen; defensive check { TRACE_E("CCopyMoveMoreDialog::TransferCriteriaControls(): unexpected situation!"); speedLimNum = 4; @@ -1644,7 +1644,7 @@ CDriveInfo::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) HDC hdc = HANDLES(GetDC(HWindow)); int devCaps = GetDeviceCaps(hdc, NUMCOLORS); HANDLES(ReleaseDC(HWindow, hdc)); - if (devCaps == -1) // more than 256 colors + if (devCaps == -1) // more than 256 colors available { FreeLight = RGB(35, 245, 156); FreeDark = RGB(9, 159, 96); @@ -1667,7 +1667,7 @@ CDriveInfo::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (cr != NULL) cr->SetColor(UsedLight); - Graph = new CColorGraph(HWindow, IDB_GRAPH); // JRYFIXME - rewrite to W10 look; see disk properties, it won't be comfortable to use GDI+ maybe our SVG? + Graph = new CColorGraph(HWindow, IDB_GRAPH); // JRYFIXME - rewrite to match the Windows 10 look; see disk properties. Would it be better to use GDI+ or our SVGs? if (Graph != NULL) Graph->SetColor(FreeLight, FreeDark, UsedLight, UsedDark); @@ -1826,7 +1826,7 @@ void CPackDialog::Transfer(CTransferInfo& ti) char* s = strrchr(Path, '.'); char* s2 = strrchr(Path, '\\'); int nameLen = (int)strlen(Path); - if ((s == NULL || s2 != NULL && s2 > s) && // '.cvspass' in Windows is considered an extension ... + if ((s == NULL || s2 != NULL && s2 > s) && // '.cvspass' is treated as an extension in Windows ... (s2 == NULL || (s2 - Path + 1) < nameLen) && nameLen > 0 && nameLen + 1 + 1 + strlen(ext) < MAX_PATH) @@ -1862,7 +1862,7 @@ BOOL CPackDialog::ChangeExtension(char* name, const char* ext) { char* s = strrchr(name, '.'); char* s2 = strrchr(name, '\\'); - if (s != NULL && // '.cvspass' in Windows is considered an extension ... + if (s != NULL && // '.cvspass' is treated as an extension in Windows ... //if (s != NULL && s > name && (s2 == NULL || s > s2) && strlen(ext) + 1 + ((s + 1) - name) < MAX_PATH) @@ -2589,7 +2589,7 @@ void CWaitWindow::PaintText(HDC hDC) HFONT hOldFont = (HFONT)SelectObject(hDestDC, EnvFont); int prevBkMode = SetBkMode(hDestDC, TRANSPARENT); SetTextColor(hDestDC, GetSysColor(COLOR_BTNTEXT)); - // we won't clip so that we survive minor text extension + // do not clip, to tolerate minor text extension // that may occur during a SetText call DrawText(hDestDC, Text, (int)strlen(Text), &r, DT_LEFT | DT_NOPREFIX | DT_NOCLIP | (NeedWrap ? DT_WORDBREAK : 0)); SetBkMode(hDestDC, prevBkMode); From b2c2e63944892bde82ddd2758b933bd6e4f8d0c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:19:41 +0200 Subject: [PATCH 389/710] [translation] Fix src/editwnd.cpp comments Refines translated comments in src/editwnd.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #853 for src/editwnd.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/editwnd.cpp | 56 ++++++++++++++++++++++++------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/editwnd.cpp b/src/editwnd.cpp index 2dd4d6796..dcc74e972 100644 --- a/src/editwnd.cpp +++ b/src/editwnd.cpp @@ -193,7 +193,7 @@ BSHandlerSubclassProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) case WM_KEYDOWN: { - // handles Ctrl+Backspace for deleting a word + // handles Ctrl+Backspace to delete a word if (wParam == VK_BACK) { BOOL controlPressed = (GetKeyState(VK_CONTROL) & 0x8000) != 0; @@ -204,13 +204,13 @@ BSHandlerSubclassProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) int iStart, iEnd; SendMessage(hwnd, EM_GETSEL, (WPARAM)&iStart, (LPARAM)&iEnd); - // if a selection exists, cancel it and move the cursor to the end + // if a selection exists, clear it and move the cursor to the end if (iStart != iEnd) { SendMessage(hwnd, EM_SETSEL, iEnd, iEnd); iStart = iEnd; } - // if (iStart == iEnd) // nothing can't be selected + // if (iStart == iEnd) // nothing must be selected // { char buff[10000]; int len = GetWindowTextLength(hwnd); @@ -242,8 +242,8 @@ BSHandlerSubclassProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) return CallWindowProc(OldWndProc, hwnd, message, wParam, lParam); } -// we don't use WinLib's subclass so we don't step on its toes -// (some windows we need to attach may already be or will be under WinLib) +// We do not use WinLib subclassing so that we do not interfere with it +// (some windows we need to attach to are already or will be managed by WinLib) BOOL AttachBackspaceHandler(HWND hwndEdit) { WNDPROC oldWndProc = (WNDPROC)GetWindowLongPtr(hwndEdit, GWLP_WNDPROC); @@ -301,11 +301,11 @@ BOOL IsChangeDirAttempt(const char* text) int GetCmdLineLimit() { /* - Measured limits when launching via COMSPEC: - (4094 + length of the exe string) W2K (not dependent on COMSPEC length) - (8190 + length of the exe string) XP (not dependent on COMSPEC length) - 8156 Vista + Win7 with COMSPEC=C:\Windows\system32\cmd.exe (depends on COMSPEC lenght: longer COMSPEC = smaller limit) -*/ + Measured limits when launching via COMSPEC: + (4094 + length of the exe string) W2K (does not depend on COMSPEC length) + (8190 + length of the exe string) XP (does not depend on COMSPEC length) + 8156 Vista + Win7 with COMSPEC=C:\Windows\system32\cmd.exe (depends on COMSPEC length: longer COMSPEC = smaller limit) + */ #if SALCMDLINE_MAXLEN != 8192 // maximum value that GetCmdLineLimit() can return #pragma message(__FILE__ " ERROR: SALCMDLINE_MAXLEN != 8192. SALCMDLINE_MAXLEN and GetCmdLineLimit() must contain the same maximal value!") @@ -383,7 +383,7 @@ CEditLine::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) BOOL executed = FALSE; CFilesWindow* panel = MainWindow->GetActivePanel(); - if (panel->Is(ptDisk)) // running commands on disk -> executed in DOS Prompt + if (panel->Is(ptDisk)) // running commands on disk -> run in the DOS Prompt { // users coming from TC and other file managers tend to change the panel path via the command line // we'll try to break this habit @@ -447,7 +447,7 @@ CEditLine::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (strlen(cmd) + strlen(cmdLine) + 2 < SALCMDLINE_MAXLEN + MAX_PATH) { strcat(cmd, "\""); - strcat(cmd, cmdLine); // the user's command line must be quoted, otherwise commands containing quotes fail (e.g. >>"C:\APPS\WinRAR\UnRAR.exe" e "test.rar"<< prints >>'C:\APPS\WinRAR\UnRAR.exe" e "test.rar' is not recognized<<) + strcat(cmd, cmdLine); // the user's command line must be enclosed in quotes, otherwise commands containing quotes do not work (e.g. >>"C:\APPS\WinRAR\UnRAR.exe" e "test.rar"<< prints >>'C:\APPS\WinRAR\UnRAR.exe" e "test.rar' is not recognized<<) strcat(cmd, "\""); } else @@ -461,8 +461,8 @@ CEditLine::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) POINT p; if (MultiMonGetDefaultWindowPos(MainWindow->HWindow, &p)) { - // if the main window is on another monitor, we should open - // the created window there as well, ideally at the default position (same as on the primary) + // if the main window is on another monitor, the new window should open there as well, + // ideally at the default position (the same as on the primary monitor) si.dwFlags |= STARTF_USEPOSITION; si.dwX = p.x; si.dwY = p.y; @@ -791,7 +791,7 @@ CEditLine::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) // panel". I am not interested in this special Alt-Ctrl-functionality in // Salamander, I am definitely more interested in being able to type the // mentioned characters on the command line. - if ((controlPressed && !shiftPressed && !altPressed) /* || // Shift+number from the edit line won't work (you need to type '*' and others) + if ((controlPressed && !shiftPressed && !altPressed) /* || // Shift+number does not work in the edit line (you need to type '*' and other characters) (Configuration.ShiftForHotPaths && !controlPressed && shiftPressed) */ ) { @@ -857,7 +857,7 @@ CEditLine::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) { case VK_RETURN: { - if (controlPressed && !altPressed) // filename of the selected file to the command line + if (controlPressed && !altPressed) // Insert the selected file name into the command line { SkipCharacter = TRUE; char path[MAX_PATH + 1]; @@ -1024,7 +1024,7 @@ class CEditDropTarget : public IDropTarget private: long RefCount; // object lifetime IDataObject* DataObject; // IDataObject that entered the drag - IDataObject* ForbiddenDataObject; // IDataObject we ignore (we are its source) + IDataObject* ForbiddenDataObject; // IDataObject to ignore (its source is this object) BOOL UseUnicode; // is Unicode text in DataObject? (otherwise we try ANSI text) CEditLine* EditLine; // edit line we operate on int EditWidth; @@ -1139,7 +1139,7 @@ class CEditDropTarget : public IDropTarget char* start = buff; if ((GetKeyState(VK_MENU) & 0x8000) != 0) { - // we do not want the whole path - trim it + // we do not want the full path - trim it int len = lstrlen(buff); if (len > 2) { @@ -1256,7 +1256,7 @@ class CEditDropTarget : public IDropTarget } ReleaseStgMedium(&stgMedium); } - /* removed overly strict check - dropping pagefile.sys failed + /* removed an unnecessarily strict check; pagefile.sys could not be dropped if (ret && path != NULL) { DWORD attrs = SalGetFileAttributes(path); @@ -1268,7 +1268,7 @@ class CEditDropTarget : public IDropTarget } STDMETHOD(QueryInterface) - (REFIID refiid, void FAR* FAR* ppv) + (REFIID refiid, void FAR * FAR * ppv) { if (refiid == IID_IUnknown || refiid == IID_IDropTarget) { @@ -1291,7 +1291,7 @@ class CEditDropTarget : public IDropTarget if (--RefCount == 0) { delete this; - return 0; // must not touch the object, it no longer exists + return 0; // must not access the object; it no longer exists } return RefCount; } @@ -1435,7 +1435,7 @@ class CEditDropTarget : public IDropTarget char* path = (char*)HANDLES(GlobalLock(stgMedium.hGlobal)); if (path != NULL) { - // change the path + // adjust the path if (UseUnicode) path = ConvertAllocU2A((const WCHAR*)path, -1); if (path != NULL) @@ -1450,9 +1450,9 @@ class CEditDropTarget : public IDropTarget else { char path[2 * MAX_PATH]; - if (GetNameFromDataObject(pDataObject, path)) // at most MAX_PATH characters are placed into 'path' + if (GetNameFromDataObject(pDataObject, path)) // at most MAX_PATH characters are written to 'path' { - // change the path + // Adjust the path if (!IsPluginFSPath(path)) { int l = (int)strlen(path); @@ -1867,15 +1867,15 @@ CEditWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (WindowsVistaAndLater) { - // Vista finally fixed the combobox flickering during resize - // so we must manually clear the area between child windows and the - // combobox edge, otherwise garbage remains there + // Vista finally fixed combobox flicker during resizing, + // so we must manually erase the area between the child windows and the + // combobox border; otherwise garbage remains there (HPEN) SelectObject(hDC, WndPen); Rectangle(hDC, cr.left + EL_XBORDER - 1, cr.top + 4 - 1, cr.right - GetSystemMetrics(SM_CXVSCROLL) - 1, cr.bottom - 4 + 1); } - // if a visual style is active, we won't decorate the button + // if a visual style is active, do not draw the button ourselves if (IsAppThemed()) { SelectObject(hDC, hOldPen); From b5bb7546bcd67eb5c86173f2d2b5bf0050c9fa45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:19:57 +0200 Subject: [PATCH 390/710] [translation] Fix src/drivelst.cpp comments Refines translated comments in src/drivelst.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #854 for src/drivelst.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/drivelst.cpp | 80 ++++++++++++++++++++++++------------------------ 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/src/drivelst.cpp b/src/drivelst.cpp index 961520deb..af4daacce 100644 --- a/src/drivelst.cpp +++ b/src/drivelst.cpp @@ -115,7 +115,7 @@ BOOL GetUserName(const char* drive, const char* remoteName, char* userName, DWOR type = REG_SZ; res = SalRegQueryValueEx(driveKey, "UserName", 0, &type, (unsigned char*)userName, &keyNameSize); - if (res == ERROR_SUCCESS && type == REG_SZ && userName[0] != 0) // do we have a user? + if (res == ERROR_SUCCESS && type == REG_SZ && userName[0] != 0) // do we have a user name? TRACE_I("Found user name: " << keyName << ", " << userName); else userName[0] = 0; @@ -124,7 +124,7 @@ BOOL GetUserName(const char* drive, const char* remoteName, char* userName, DWOR type = REG_SZ; res = SalRegQueryValueEx(driveKey, "ProviderName", 0, &type, (unsigned char*)providerBuf, &keyNameSize); - if (res != ERROR_SUCCESS || type != REG_SZ) // if we do not have a provider, we will reset the buffer + if (res != ERROR_SUCCESS || type != REG_SZ) // if we do not have a provider, clear the buffer providerBuf[0] = 0; } HANDLES(RegCloseKey(driveKey)); @@ -158,7 +158,7 @@ DWORD WINAPI NBWNetAC3ThreadF(void* param) { CALL_STACK_MESSAGE_NONE CNBWNetAC3ThreadFParams* data = &NBWNetAC3ThreadFParams; - data->err = WNetAddConnection3(NULL /* we're not using CONNECT_INTERACTIVE, we're in another thread */, + data->err = WNetAddConnection3(NULL /* CONNECT_INTERACTIVE is not used because this runs in another thread */, &data->netResource, data->lpPassword, data->lpUserName, data->dwFlags); memset(data->bufPassword, 0, sizeof(data->bufPassword)); if (data->err == ERROR_EXTENDED_ERROR && @@ -189,7 +189,7 @@ BOOL NonBlockingWNetAddConnection3(DWORD& err, LPNETRESOURCE lpNetResource, if (errProviderName != NULL) errProviderName[0] = 0; - // first all we will wait for the previous "calculation" to finish + // first wait for the previous "operation" to finish GetAsyncKeyState(VK_ESCAPE); // init GetAsyncKeyState - see help if (NBWNetAC3Thread.ShutdownArrived) return FALSE; // the application is already shutting down; no further action @@ -210,7 +210,7 @@ BOOL NonBlockingWNetAddConnection3(DWORD& err, LPNETRESOURCE lpNetResource, NBWNetAC3Thread.Close(); } - // then we will set the parameters and try to start a new thread + // then set the parameters and try to start a new thread if (lpUserName != NULL) { lstrcpyn(NBWNetAC3ThreadFParams.bufUserName, lpUserName, USERNAME_MAXLEN); @@ -278,7 +278,7 @@ BOOL NonBlockingWNetAddConnection3(DWORD& err, LPNETRESOURCE lpNetResource, BOOL IsLogonFailureErr(DWORD err) { - return err == ERROR_ACCESS_DENIED || // defense against e.g. "no files found" + return err == ERROR_ACCESS_DENIED || // guard against e.g. "no files found" err == ERROR_LOGON_FAILURE || err == ERROR_ACCOUNT_RESTRICTION || err == ERROR_INVALID_LOGON_HOURS || @@ -357,7 +357,7 @@ BOOL IsAdminShareExtraLogonFailureErr(DWORD err, const char* root) const char* server = root + 2; root++; while (*++root != 0 && *root != '\\' && CharIsAllowedInServerName(*root)) - ; // skip server name + simple test (incomplete, e.g. forbids dots in IPv4 and IPv6), whether it is really an invalid name (in that case we will not ask for username+password) + ; // skip the server name and do a simple check (incomplete; for example, it also rejects dots in IPv4 and IPv6) whether this is really an invalid name (in that case, we will not ask for a username and password) if (*root == '.') // we will take care of IPv4 adresses (let's ignore IPv6) { const char* r = root; @@ -488,7 +488,7 @@ BOOL RestoreNetworkConnection(HWND parent, const char* name, const char* remoteN if (end != NULL && *(end + 1) != '\\' && *(end + 1) != 0) { const char* last = strchr(end + 2, '\\'); - if (last == NULL || *(last + 1) == 0) // show the custom dialog under XP and Vista only for simple UNC paths: "\\server\share" and "\\server\\share\\" + if (last == NULL || *(last + 1) == 0) // show the custom dialog on XP and Vista only for simple UNC paths: "\\server\share" and "\\server\share\\" lstrcpyn(serverName, remoteName + 2, (int)min(MAX_PATH, (end - (remoteName + 2)) + 1)); } } @@ -542,7 +542,7 @@ BOOL RestoreNetworkConnection(HWND parent, const char* name, const char* remoteN char messageBuf[MAX_PATH + 100]; messageBuf[0] = 0; - if (name == NULL) // mapping UNC paths to "none" + if (name == NULL) // map UNC paths to "none" { if (!Windows7AndLater && // Windows 7 uses a new dialog again, and no interface for it has been found yet credUIPromptForCredentialsA != NULL && credUIConfirmCredentialsA != NULL /*&& credUIParseUserNameA != NULL*/ && @@ -618,7 +618,7 @@ BOOL RestoreNetworkConnection(HWND parent, const char* name, const char* remoteN memset(dlg.Passwd, 0, sizeof(dlg.Passwd)); passwd = NULL; - if (err == ERROR_CANCELLED) // cancel + if (err == ERROR_CANCELLED) // canceled { ret = FALSE; break; @@ -732,7 +732,7 @@ BOOL RestoreNetworkConnection(HWND parent, const char* name, const char* remoteN { if (lpNetResource == NULL) UpdateWindow(MainWindow->HWindow); // not meaningful when used from Network Neighborhood - if (err == NO_ERROR) // user confirmed with OK + if (err == NO_ERROR) // user clicked OK { if (name == NULL) confirmCred = TRUE; @@ -805,7 +805,7 @@ BOOL RestoreNetworkConnection(HWND parent, const char* name, const char* remoteN if (MainWindow != NULL && MainWindow->HWindow != NULL) PostMessage(MainWindow->HWindow, WM_USER_DRIVES_CHANGE, 0, 0); - break; // returning TRUE + break; // return TRUE } } memset(dlg.Passwd, 0, sizeof(dlg.Passwd)); @@ -826,7 +826,7 @@ BOOL CheckAndRestoreNetworkConnection(HWND parent, const char drive, BOOL& pathI GetNetworkDrives(netDrives, netRemotePath); - if (netDrives & (1 << (LowerCase[drive] - 'a'))) // the drive existed, try to restore it + if (netDrives & (1 << (LowerCase[drive] - 'a'))) // the drive existed, so try to restore it { char name[4] = " :"; name[0] = drive; @@ -836,7 +836,7 @@ BOOL CheckAndRestoreNetworkConnection(HWND parent, const char drive, BOOL& pathI name[3] = 0; DWORD err = NO_ERROR; char* netPath = netRemotePath[LowerCase[drive] - 'a']; - if (netPath[0] == '\\' && netPath[1] == '\\' && strchr(netPath + 2, '\\') != NULL && // at least a primitive test of a valid UNC path + if (netPath[0] == '\\' && netPath[1] == '\\' && strchr(netPath + 2, '\\') != NULL && // at least a basic validity check for the UNC path (err = SalCheckPath(FALSE, name, ERROR_SUCCESS, TRUE, parent)) != ERROR_SUCCESS && err != ERROR_USER_TERMINATED && // mapped disk is not accessible (err = SalCheckPath(FALSE, netPath, ERROR_SUCCESS, TRUE, parent)) == ERROR_SUCCESS && // UNC is accessible (err = SalCheckPath(FALSE, name, ERROR_SUCCESS, TRUE, parent)) == ERROR_SUCCESS) // now the mapped disk is accessible again @@ -864,7 +864,7 @@ BOOL CheckAndConnectUNCNetworkPath(HWND parent, const char* UNCPath, BOOL& pathI CALL_STACK_MESSAGE3("CheckAndConnectUNCNetworkPath(, %s, , %d)", UNCPath, donotReconnect); pathInvalid = FALSE; if (!IsUNCPath(UNCPath) || UNCPath[2] == '?') - return FALSE; // not a UNC path in the basic format + return FALSE; // not a UNC path in the basic UNC format char root[MAX_PATH + 4]; char* s = root + GetRootPath(root, UNCPath); @@ -882,7 +882,7 @@ BOOL CheckAndConnectUNCNetworkPath(HWND parent, const char* UNCPath, BOOL& pathI DWORD err = GetLastError(); BOOL trySharepoint = err == ERROR_BAD_NET_NAME; // try to call shell when error 67 occurs, so that it can make the path accessible if (!donotReconnect && - (err == ERROR_FILE_NOT_FOUND || err == ERROR_PATH_NOT_FOUND)) // on XP, this error is returned if the user does not have access to the server or if the share does not exist on the server; to distinguish between the two, we call WNetAddConnection3 + (err == ERROR_FILE_NOT_FOUND || err == ERROR_PATH_NOT_FOUND)) // on XP, this error is returned if the user does not have access to the server or if the share does not exist; we call WNetAddConnection3 to distinguish between the two cases { NETRESOURCE ns; ns.dwType = RESOURCETYPE_DISK; @@ -893,7 +893,7 @@ BOOL CheckAndConnectUNCNetworkPath(HWND parent, const char* UNCPath, BOOL& pathI err = ERROR_PATH_NOT_FOUND; // ESC } - if (IsLogonFailureErr(err) || // protection against errors such as "no files found" + if (IsLogonFailureErr(err) || // guard against e.g. "no files found" IsAdminShareExtraLogonFailureErr(err, root)) { if (donotReconnect) @@ -911,7 +911,7 @@ BOOL CheckAndConnectUNCNetworkPath(HWND parent, const char* UNCPath, BOOL& pathI } else { - if (trySharepoint) // if error 67 occurs, try calling the shell to make the path accessible + if (trySharepoint) // if error 67 occurs, try calling the shell so it can make the path accessible { SHFILEINFO fi; if (SHGetFileInfoAux(UNCPath, 0, &fi, sizeof(fi), SHGFI_ATTRIBUTES)) @@ -1136,7 +1136,7 @@ unsigned ReadCDVolNameThreadFBody(void* param) // directory accessibility test HANDLES(EnterCriticalSection(&ReadCDVolNameCS)); BOOL run = FALSE; - if (uid == ReadCDVolNameReqUID) // someone is still waiting for an answer + if (uid == ReadCDVolNameReqUID) // someone is still waiting for the response { lstrcpyn(root, ReadCDVolNameBuffer, MAX_PATH); run = TRUE; @@ -1240,7 +1240,7 @@ int GetIndexForDrvText(CPluginFSInterfaceEncapsulation** fsList, int count, { CPluginFSInterfaceEncapsulation* fs = NULL; int z; - for (z = 0; z < count; z++) // found FS encapsulation (if memory runs low, the indexes in fsList and Drives may not match from firstFSIndex onward) + for (z = 0; z < count; z++) // found FS encapsulation (if memory is low, the indexes in fsList and Drives may not match from firstFSIndex onward) { if (fsList[z]->GetInterface() == fsIface) { @@ -1258,7 +1258,7 @@ int GetIndexForDrvText(CPluginFSInterfaceEncapsulation** fsList, int count, return currentIndex; } -// creates a black-and-white version of the icon from 'hSrcIcon' +// creates a grayscale version of the icon from 'hSrcIcon' // WARNING: slow; use with caution HICON ConvertIcon16x16ToGray(HICON hSrcIcon) { @@ -1463,7 +1463,7 @@ void InitOneDrivePath() OneDrivePath[0] = 0; // The OneDrive path is resolved every time, because after the "Unlink OneDrive" command in OneDrive, it should no longer be shown. BOOL done = FALSE; - if (WindowsVistaAndLater) // SHGetKnownFolderPath has existed since Vista + if (WindowsVistaAndLater) // SHGetKnownFolderPath has been available since Vista { typedef HRESULT(WINAPI * FSHGetKnownFolderPath)(REFKNOWNFOLDERID rfid, DWORD /* KNOWN_FOLDER_FLAG */ dwFlags, @@ -1490,7 +1490,7 @@ void InitOneDrivePath() HKEY hKey; char path[MAX_PATH]; - for (int i = 0; !done && i < 2; i++) // theoretically only needed for Windows 8 and lower (from 8.1 we have FOLDERID_SkyDrive) + for (int i = 0; !done && i < 2; i++) // theoretically only needed for Windows 8 and earlier (since 8.1 we have FOLDERID_SkyDrive) { if (HANDLES_Q(RegOpenKeyEx(HKEY_CURRENT_USER, Windows8_1AndLater && !Windows10AndLater ? (i == 0 ? "Software\\Microsoft\\Windows\\CurrentVersion\\OneDrive" : // jen Win 8.1 @@ -1504,7 +1504,7 @@ void InitOneDrivePath() type == REG_SZ && size > 1) { //TRACE_I("OneDrive path (UserFolder): " << path); - strcpy_s(OneDrivePath, path); // we have needed path + strcpy_s(OneDrivePath, path); // we have the required path done = TRUE; } HANDLES(RegCloseKey(hKey)); @@ -1536,7 +1536,7 @@ void InitOneDrivePath() size = sizeof(path); // size in bytes if (SalRegQueryValueEx(hAccount, "UserFolder", 0, &type, (BYTE*)path, &size) == ERROR_SUCCESS && type == REG_SZ && size > 1) - { // Collect everything that has DisplayName and UserFolder and offer it to the user as "OneDrive" + { // Collect everything that has DisplayName and UserFolder and offer it to the user under "OneDrive" //TRACE_I("OneDrive Business: DisplayName: " << disp << ", UserFolder: " << path); OneDriveBusinessStorages.SortIn(new COneDriveBusinessStorage(DupStr(disp), DupStr(path))); } @@ -1610,7 +1610,7 @@ BOOL CDrivesList::BuildData(BOOL noTimeout, TDirectArray* copyDrives ZeroMemory(&drvSeparator, sizeof(drvSeparator)); drvSeparator.DriveType = drvtSeparator; - if (copyDrives != NULL) // optimization: the data is simply copied (e.g. this is the second Drives Bar, so we copy it from the first Drives Bar; we retrieved that data from the system a few ms ago) + if (copyDrives != NULL) // optimization: the data is simply copied (e.g. this is the second Drives Bar, so we copy the data from the first Drives Bar, for which we retrieved it from the system a few ms ago) { CachedDrivesMask = copyCachedDrivesMask; @@ -1679,7 +1679,7 @@ BOOL CDrivesList::BuildData(BOOL noTimeout, TDirectArray* copyDrives // Add drives A..Z while (i != 0) { - if (!(noDrivesPolicy & i) && ((mask & i) || (netDrives & i))) // disk is accessible + if (!(noDrivesPolicy & i) && ((mask & i) || (netDrives & i))) // drive is accessible { root[0] = drive; int driveType; @@ -1853,8 +1853,8 @@ BOOL CDrivesList::BuildData(BOOL noTimeout, TDirectArray* copyDrives // we separate drives that the user wanted to separate if (separateNextDrive && Drives->Count > 0 && !IsLastItemSeparator()) Drives->Add(drvSeparator); - // if there is no drive A or B in the system and the user has set the separator after A or B, we displayed it after C - // therefore we have to clear the flag in every case, not just in the previous condition + // if drive A or B is not present in the system and the user set a separator after A or B, we displayed it after C + // therefore we must clear the flag in every case, not just in the previous condition separateNextDrive = FALSE; int index = Drives->Add(drv); @@ -1999,7 +1999,7 @@ BOOL CDrivesList::BuildData(BOOL noTimeout, TDirectArray* copyDrives char itemText[200 + ONEDRIVE_MAXBUSINESSDISPLAYNAME]; HICON oneDriveIco = c == 0 ? NULL : SalLoadIcon(HInstance, IDI_ONEDRIVE, iconSize); BOOL destroyOneDriveIco = oneDriveIco != NULL; - if (forDriveBar && c > 1) // data for the drive bar when there are multiple storages = let the user choose from the menu (drop-down) + if (forDriveBar && c > 1) // for the drive bar with multiple storages, let the user choose from a drop-down menu { strcpy_s(itemText, LoadStr(IDS_ONEDRIVE)); AddToDrives(drv, 0, 0, drvtOneDriveMenu, getGrayIcons, oneDriveIco, destroyOneDriveIco, itemText); @@ -2007,7 +2007,7 @@ BOOL CDrivesList::BuildData(BOOL noTimeout, TDirectArray* copyDrives } else // data for change drive menu || drive-bar && the only storage (we give a simple button on the drive-bar) { - if (OneDrivePath[0] != 0) // personal + if (OneDrivePath[0] != 0) // personal storage { if (c == 1) strcpy_s(itemText, LoadStr(IDS_ONEDRIVE)); // the only personal storage = we write only: OneDrive @@ -2073,7 +2073,7 @@ BOOL CDrivesList::BuildData(BOOL noTimeout, TDirectArray* copyDrives } else { - if (CurrentPath[0] != 0) // only if we have a path (it's not ptPluginFS) + if (CurrentPath[0] != 0) // only if we have a path (it is not ptPluginFS) { if (currentDiskIndex != -1) FocusIndex = currentDiskIndex; @@ -2196,7 +2196,7 @@ BOOL CDrivesList::BuildData(BOOL noTimeout, TDirectArray* copyDrives if (Drives->Count > 0 && IsLastItemSeparator()) Drives->Delete(Drives->Count - 1); - if (drv.DestroyIcon) // no hot path, we have to remove the icon here + if (drv.DestroyIcon) // not a hot path, so we have to destroy the icon here { HANDLES(DestroyIcon(drv.HIcon)); } @@ -2900,7 +2900,7 @@ BOOL CDrivesList::OnContextMenu(BOOL posByMouse, int itemIndex, int panel, const } } } - if (refreshMenu) // plugin asks for menu refresh + if (refreshMenu) // plugin requests a menu refresh { PostMessage(MainWindow->HWindow, WM_USER_DRIVES_CHANGE, 0, 0); } @@ -2982,7 +2982,7 @@ BOOL CDrivesList::OnContextMenu(BOOL posByMouse, int itemIndex, int panel, const BOOL releaseLeft = FALSE; // disconnect left panel from disk? BOOL releaseRight = FALSE; // disconnect right panel from disk? - char cmdName[2000]; // we have 2000 instead of 200 on purpose, shell extensions sometimes write double (consideration: unicode = 2 * "number of characters"), etc. + char cmdName[2000]; // we intentionally use 2000 instead of 200; shell extensions sometimes write twice as much (roughly: Unicode = 2 * "number of characters"), etc. if (AuxGetCommandString(MainWindow->ContextMenuChngDrv, cmd, GCS_VERB, NULL, cmdName, 200) != NOERROR) { cmdName[0] = 0; @@ -3037,9 +3037,9 @@ BOOL CDrivesList::OnContextMenu(BOOL posByMouse, int itemIndex, int panel, const if (changeToFixedDrv) { MainWindow->LeftPanel->ChangeToFixedDrive(MainWindow->LeftPanel->HWindow); - // WARNING: The window must be invalidated to break the cached bitmap of the Alt+F1/2 menu - // otherwise, an old part of the panel was displayed in this situation: - // the left panel shows drive S:; Alt+F1, right-click S, Format + // WARNING: The window must be invalidated to discard the cached bitmap of the Alt+F1/2 menu + // otherwise, an old part of the panel would be displayed in this situation: + // the left panel shows drive S:; Alt+F1, right-click S:, Format InvalidateRect(MainWindow->LeftPanel->HWindow, NULL, TRUE); } else @@ -3058,7 +3058,7 @@ BOOL CDrivesList::OnContextMenu(BOOL posByMouse, int itemIndex, int panel, const DisplayMenuAux(MainWindow->ContextMenuChngDrv, (CMINVOKECOMMANDINFO*)&ici); - // the clipboard can be changed from the context menu, so we will check it ... + // the context menu can change the clipboard, so we will check it ... IdleRefreshStates = TRUE; // we will force the check of the state variables at the next Idle IdleCheckClipboard = TRUE; // we will the clipboard to be checked as well @@ -3141,7 +3141,7 @@ BOOL CDrivesList::FindPanelPathIndex(CFilesWindow* panel, DWORD* index) if (path[0] == '\\' && path[1] == '\\') { if (path[2] == '.' && path[3] == '\\' && path[4] != 0 && path[5] == ':') - return FALSE; // path of the "\\.\C:\" type + return FALSE; // path in the "\\.\C:\" form CPluginData* nethoodPlugin = NULL; Plugins.GetFirstNethoodPluginFSName(NULL, &nethoodPlugin); int i; From 46e836bfd34f57c7f45833918d61eea642e59a06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:20:12 +0200 Subject: [PATCH 391/710] [translation] Fix src/edtlbwnd.cpp comments Refines translated comments in src/edtlbwnd.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #855 for src/edtlbwnd.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/edtlbwnd.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/edtlbwnd.cpp b/src/edtlbwnd.cpp index 1f573779f..314698ca4 100644 --- a/src/edtlbwnd.cpp +++ b/src/edtlbwnd.cpp @@ -139,9 +139,9 @@ CEditListBox::CEditListBox(HWND hDlg, int ctrlID, DWORD flags, CObjectOrigin ori int itemHeight = max(tm.tmHeight + 4, IconSizes[ICONSIZE_16]); SendMessage(HWindow, LB_SETITEMHEIGHT, 0, MAKELPARAM(itemHeight, 0)); - // MakeDragList subclasses the list box and we stop receiving basic messages - // such as WM_LBUTTONDOWN, WM_MOUSEMOVE, ect. That makes this function unusable, - // so we implement drag&drop support ourselves. + // MakeDragList subclasses the list box, and we stop receiving basic messages + // such as WM_LBUTTONDOWN, WM_MOUSEMOVE, etc. This makes this function unusable, + // so drag-and-drop support is implemented directly here. // MakeDragList(HWindow); // DragNotify = RegisterWindowMessage(DRAGLISTMSGSTRING); } @@ -835,7 +835,7 @@ CEditListBox::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_KEYUP: { - if (Dragging) // We don't want the listbox processing this if we are dragging. + if (Dragging) // We do not want the list box to process this while dragging. return 0; break; } @@ -1077,7 +1077,7 @@ CEditListBox::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (Dragging) { LRESULT ret = CWindow::WindowProc(uMsg, wParam, lParam); - return ret | DLGC_WANTMESSAGE; // we want Escape + return ret | DLGC_WANTMESSAGE; // handle Escape } break; } From da1749a3154278896ed35d5e05f42c16a088b9e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:20:28 +0200 Subject: [PATCH 392/710] [translation] Fix src/edtlbwnd.h comments Refines translated comments in src/edtlbwnd.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #856 for src/edtlbwnd.h, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/edtlbwnd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/edtlbwnd.h b/src/edtlbwnd.h index 40db688f8..8372d0bcd 100644 --- a/src/edtlbwnd.h +++ b/src/edtlbwnd.h @@ -114,7 +114,7 @@ class CEditListBox : public CWindow BOOL SetCurSel(int index); - // returns index of the selected item - for a new item it is one more than + // returns index of the selected item - for a new item it is 1 more than // the number of items BOOL GetCurSel(int& index); // returns -1 for an empty item From badfa3be5210dd274aacd2c0fdf123053b343b36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:20:43 +0200 Subject: [PATCH 393/710] [translation] Fix src/execute.cpp comments Refines translated comments in src/execute.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #857 for src/execute.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/execute.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/execute.cpp b/src/execute.cpp index a68741043..6d987f8a8 100644 --- a/src/execute.cpp +++ b/src/execute.cpp @@ -57,7 +57,7 @@ void CComboboxEdit::GetSel(DWORD* start, DWORD* end) void CComboboxEdit::ReplaceText(const char* text) { - // we must refresh the selection because the dumb combobox forgot it + // we must restore the selection because the combo box lost it SendMessage(HWindow, EM_SETSEL, SelStart, SelEnd); SendMessage(HWindow, EM_REPLACESEL, TRUE, (LPARAM)text); } @@ -333,7 +333,7 @@ CExecuteItem CommandExecutes[] = // Arguments - External View/Edit -/* used by the export_mnu.py script that generates salmenu.mnu for the Translator +/* used by the export_mnu.py script, which generates salmenu.mnu for Translator keep synchronized with the array below... MENU_TEMPLATE_ITEM ArgumentsExecutes[] = { @@ -389,7 +389,7 @@ CExecuteItem ArgumentsExecutes[] = // Initial directory -/* used by the export_mnu.py script that generates salmenu.mnu for the Translator +/* used by the export_mnu.py script, which generates salmenu.mnu for Translator keep synchronized with the array below... MENU_TEMPLATE_ITEM InitDirExecutes[] = { @@ -580,7 +580,7 @@ struct CExecuteExpData char Buffer[MAX_PATH]; BOOL* FileNameUsed; - CUserMenuAdvancedData* UserMenuAdvancedData; // applies only to User Menu, otherwise NULL here + CUserMenuAdvancedData* UserMenuAdvancedData; // used only for User Menu; otherwise NULL here }; const char* WINAPI ExecuteExpDrive(HWND msgParent, void* param) // drive ("D:", "\\server\share") without backslash @@ -724,7 +724,7 @@ const char* WINAPI ExecuteExpNamePart(HWND msgParent, void* param) strcpy(data->Buffer, s + 1); char* ss = strrchr(data->Buffer, '.'); // if (ss != NULL && ss != data->Buffer) // extension is present ('.' not at the begining of the name, e.g. ".cvspass") - if (ss != NULL) // extension is present (".cvspass" is considered an extension in Windows) + if (ss != NULL) // An extension is present (".cvspass" is considered an extension in Windows) *ss = 0; return data->Buffer; } @@ -743,7 +743,7 @@ const char* WINAPI ExecuteExpExtPart(HWND msgParent, void* param) strcpy(data->Buffer, s + 1); s = strrchr(data->Buffer, '.'); // if (s != NULL && s != data->Buffer) // extension is present ('.' not at the begining of the name, e.g. ".cvspass") - if (s != NULL) // extension is present (".cvspass" is considered an extension in Windows) + if (s != NULL) // An extension is present here (".cvspass" is considered an extension in Windows) return s + 1; return ""; } @@ -762,7 +762,7 @@ const char* WINAPI ExecuteExpDOSNamePart(HWND msgParent, void* param) strcpy(data->Buffer, s + 1); char* ss = strrchr(data->Buffer, '.'); // if (ss != NULL && ss != data->Buffer) // extension is present ('.' not at the begining of the name, e.g. ".cvspass") - if (ss != NULL) // extension is present (".cvspass" is considered an extension in Windows) + if (ss != NULL) // An extension is present (".cvspass" is considered an extension in Windows) *ss = 0; return data->Buffer; } @@ -781,7 +781,7 @@ const char* WINAPI ExecuteExpDOSExtPart(HWND msgParent, void* param) strcpy(data->Buffer, s + 1); s = strrchr(data->Buffer, '.'); // if (s != NULL && s != data->Buffer) // extension is present ('.' not at the begining of the name, e.g. ".cvspass") - if (s != NULL) // extension is present (".cvspass" is considered an extension in Windows) + if (s != NULL) // extension present (".cvspass" is considered an extension in Windows) return s + 1; return ""; } @@ -1647,10 +1647,10 @@ CSalamanderVarStrEntry InitDirExpArray[] = { {EXECUTE_DRIVE, ExecuteExpDrive}, {EXECUTE_PATH, ExecuteExpPath2}, // j.r. I have no idea why the special versions of variables without - {EXECUTE_FULLPATH, ExecuteExpFullPath2}, // trailing backslashes are used; anyway, I added a call to + {EXECUTE_FULLPATH, ExecuteExpFullPath2}, // without trailing backslashes; anyway, I have now added a call to {EXECUTE_WINDIR, ExecuteExpWinDir2}, // RemoveDoubleBackslahesFromPath so we could probably switch to the {EXECUTE_SYSDIR, ExecuteExpSysDir2}, // versions with backslashes at the end -- we would just trim the - {EXECUTE_SALDIR, ExecuteExpSalDir2}, // last backslash in ExpandInitDir() (unless it's the root) + {EXECUTE_SALDIR, ExecuteExpSalDir2}, // remove the last backslash (unless this is the root) {NULL, NULL}}; // !!! do not use InfoLineExpArray directly; use GetInfoLineExpArray() @@ -1834,7 +1834,7 @@ BOOL ValidateInfoLineItems(HWND msgParent, const char* varText, int& errorPos1, { CALL_STACK_MESSAGE2("ValidateInfoLineItems(, %s, ,)", varText); return ValidateVarString(msgParent, varText, errorPos1, errorPos2, - GetInfoLineExpArray(TRUE /* for validation there is no difference between TRUE and FALSE */)); + GetInfoLineExpArray(TRUE /* TRUE and FALSE are equivalent for validation. */)); } BOOL ExpandInfoLineItems(HWND msgParent, const char* varText, CPluginDataInterfaceEncapsulation* pluginData, From e8a7e5910452db49f8aecc92aea2f36ae3899c64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:20:58 +0200 Subject: [PATCH 394/710] [translation] Fix src/execute.h comments Refines translated comments in src/execute.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #858 for src/execute.h, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/execute.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/execute.h b/src/execute.h index ff1bf06bb..5c3c0daa8 100644 --- a/src/execute.h +++ b/src/execute.h @@ -101,8 +101,8 @@ struct CUserMenuValidationData // additional data used to validate User Menu: ar BOOL MustHandleItemsAsGroup; // TRUE = items must be processed as a group: ListOfSelectedNames, ListOfSelectedFullNames, FileToCompareXXX, DirToCompareXXX BOOL MustHandleItemsOneByOne; // TRUE = items must be processed individually: FullName, Name, NamePart, ExtPart, DOSFullName, DOSName, DOSNamePart, DOSExtPart int UsedCompareType; // 0 = none yet, 1 = file-left-right, 2 = file-active-inactive, 3 = dir-left-right, 4 = dir-active-inactive, 5 = multiple types (invalid), 6 = file-or-dir-left-right, 7 = file-or-dir-active-inactive - BOOL UsedCompareLeftOrActive; // TRUE = at least one variable compare-left or compare-active is used (we're testing if both parameters are used; otherwise it's nonsense) - BOOL UsedCompareRightOrInactive; // TRUE = at least one variable compare-right or compare-inactive is used (we're testing if both parameters are used; otherwise it's nonsense) + BOOL UsedCompareLeftOrActive; // TRUE = at least one compare-left or compare-active variable is used (we test whether both parameters are used; otherwise it makes no sense) + BOOL UsedCompareRightOrInactive; // TRUE = at least one compare-right or compare-inactive variable is used (we test whether both parameters are used; otherwise it makes no sense) }; struct CUserMenuAdvancedData // additional data used only for the User Menu: array Arguments From ccd8135167dfbc44caebe853b8593ae670cae1c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:21:14 +0200 Subject: [PATCH 395/710] [translation] Fix src/filesbox.h comments Refines translated comments in src/filesbox.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #859 for src/filesbox.h, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/filesbox.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/filesbox.h b/src/filesbox.h index d2e7f48cc..bddc8b5f8 100644 --- a/src/filesbox.h +++ b/src/filesbox.h @@ -193,8 +193,8 @@ class CFilesBox : public CWindow // returns the new TopIndex that EnsureItemVisible would set for scroll == FALSE int PredictTopIndex(int index); - // special version: scrolls only the part of the screen that doesn't contain - // the item index, then repaints the remaining items + // special version of the function: scrolls only the part of the screen that does not contain + // item index; then repaints the remaining items void EnsureItemVisible2(int newTopIndex, int index); // returns TRUE if item 'index' is at least partially visible; if 'isFullyVisible' is not NULL, @@ -222,7 +222,7 @@ class CFilesBox : public CWindow void SetupScrollBars(DWORD flags = UPDATE_VERT_SCROLL | UPDATE_HORZ_SCROLL); // updates scrollbar information BOOL ShowHideChilds(); // shows or hides children based on Mode; returns TRUE when a change occurs otherwise returns FALSE void UpdateInternalData(); - void CheckAndCorrectBoundaries(); // ensures scrollbars are in valid ranges, adjusting them if needed + void CheckAndCorrectBoundaries(); // ensures the scrollbars are in valid positions, adjusting them if needed void OnHScroll(int scrollCode, int pos); void OnVScroll(int scrollCode, int pos); From 264dc510daea8577d46164bbc5d7f868010128c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:21:30 +0200 Subject: [PATCH 396/710] [translation] Fix src/filesbx1.cpp comments Refines translated comments in src/filesbx1.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #860 for src/filesbx1.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/filesbx1.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/filesbx1.cpp b/src/filesbx1.cpp index 9f60f86bb..90ee09f00 100644 --- a/src/filesbx1.cpp +++ b/src/filesbx1.cpp @@ -826,7 +826,7 @@ BOOL CFilesBox::IsItemVisible(int index, BOOL* isFullyVisible) break; } } - return TRUE; // it is visible + return TRUE; // visible } // assumes scroll == FALSE - the whole item will be visible @@ -945,7 +945,7 @@ void CFilesBox::EnsureItemVisible2(int newTopIndex, int index) void CFilesBox::OnHScroll(int scrollCode, int pos) { - if (Parent->DragBox && !Parent->ScrollingWindow) // dragging the cage - block mouse wheel scrolling + if (Parent->DragBox && !Parent->ScrollingWindow) // dragging the DragBox - block mouse wheel scrolling return; if (ViewMode == vmDetailed) { @@ -1431,7 +1431,7 @@ CFilesBox::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_MOUSEACTIVATE: { if (MainWindow->HasLockedUI()) - break; // when the UI is locked we want a click on the panel to bring Salamander to front + break; // when the UI is locked, we want a click on the panel to bring Salamander to the front if (LOWORD(lParam) == HTCLIENT) { if (!IsIconic(MainWindow->HWindow) && @@ -1632,7 +1632,7 @@ CFilesBox::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) // therefore we will now also catch the message in individual windows where it can potentially appear (depending on focus) // and then route it so that it is delivered to the window under the cursor, as we always did - // if the message arrived "recently" through the other channel, ignore this one + // if the message was delivered "recently" through the other channel, ignore this one if (MouseWheelMSGThroughHook && MouseWheelMSGTime != 0 && (GetTickCount() - MouseWheelMSGTime < MOUSEWHEELMSG_VALID)) return 0; MouseWheelMSGThroughHook = FALSE; @@ -1699,9 +1699,9 @@ CFilesBox::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) wheelScroll = max(1, min(wheelScroll, si.nPage - 1)); // limit at most to page height } - // wheelScrollLines under WinVista with IntelliMouse Explorer 4.0 and IntelliPoint drivers is 40 at maximum wheel speed - // stepsPerLine would then be 120 / 31 = 3.870967..., after truncation 3, which is a large rounding error - // therefore I multiply values by 1000 to push the error three orders further + // Under WinVista with IntelliMouse Explorer 4.0 and IntelliPoint drivers, wheelScrollLines is 40 at the highest wheel speed + // stepsPerLine would then be 120 / 31 = 3.870967..., which truncates to 3 and causes a large rounding error + // therefore the values are multiplied by 1000 to move the error three orders of magnitude further MouseWheelAccumulator += 1000 * zDelta; int stepsPerLine = max(1, (1000 * WHEEL_DELTA) / wheelScroll); int linesToScroll = MouseWheelAccumulator / stepsPerLine; @@ -2016,7 +2016,7 @@ int CFilesBox::GetIndex(int x, int y, BOOL nearest, RECT* labelRect) SelectObject(hDC, hOldFont); maxWidth += 4; - if (isItemUpDir) // updir is just "..", we must extend it to the displayed size + if (isItemUpDir) // updir is only ".."; we must widen it to the displayed width { // see CFilesWindow::DrawIconThumbnailItem maxWidth = max(maxWidth, (Parent->GetViewMode() == vmThumbnails ? ThumbnailWidth : 32) + 4); @@ -2075,7 +2075,7 @@ int CFilesBox::GetIndex(int x, int y, BOOL nearest, RECT* labelRect) int maxTextWidth = ItemWidth - TILE_LEFT_MARGIN - IconSizes[ICONSIZE_48] - TILE_LEFT_MARGIN - 4; int widthNeeded = 0; - char buff[3 * 512]; // destination buffer for strings + char buff[3 * 512]; // buffer for strings char* out0 = buff; int out0Len; char* out1 = buff + 512; From 40bf6924660d82bc0c366929f9952cb6114366ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:21:45 +0200 Subject: [PATCH 397/710] [translation] Fix src/filesbx2.cpp comments Refines translated comments in src/filesbx2.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #861 for src/filesbx2.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/filesbx2.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/filesbx2.cpp b/src/filesbx2.cpp index 27552d6a6..ba22a744d 100644 --- a/src/filesbx2.cpp +++ b/src/filesbx2.cpp @@ -348,8 +348,8 @@ void CHeaderLine::SetMinWidths() if (column->SupportSorting == 1) column->MinWidth += 2 * SORT_BITMAP_W; - // when measuring the "Name" column and the next column isn't "Ext" - // and integration of "Ext" into "Name" is allowed, add the width of "Ext" + // when measuring the "Name" column and integration of "Ext" into "Name" is enabled, + // add the width of "Ext" if (i == 0 && !Parent->Parent->IsExtensionInSeparateColumn() && (Parent->Parent->ValidFileData & VALID_DATA_EXTENSION)) { @@ -380,7 +380,7 @@ CHeaderLine::HitTest(int xPos, int yPos, int& index, BOOL& extInName) right = left + column->Width; if (xPos >= left && xPos < right) { - // test the separators + // check the dividers if (xPos < left + 2 && i > 0 && Columns->At(i - 1).FixedWidth == 1) { index = i - 1; From f649a7a19a75e3eafac99c626c1de49dfdbc4bd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:22:01 +0200 Subject: [PATCH 398/710] [translation] Fix src/filesmap.cpp comments Refines translated comments in src/filesmap.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #862 for src/filesmap.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/filesmap.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/filesmap.cpp b/src/filesmap.cpp index 6937e814a..986459295 100644 --- a/src/filesmap.cpp +++ b/src/filesmap.cpp @@ -119,7 +119,7 @@ BOOL CFilesMap::CreateMap() AlterFileName(formatedFileName, f->Name, -1, Configuration.FileNameFormat, 0, isDir); const char* s = formatedFileName; - // skip the ".." + // suppress ".." if (*s == '.' && *(s + 1) == '.' && *(s + 2) == 0) s = NULL; @@ -418,7 +418,7 @@ void CFilesMap::SetPoint(int x, int y) } item = GetMapItem(col, row); - if (item == NULL) // there were several crashes in CFilesMap::SetPoint; cause unknown + if (item == NULL) // Several crashes occurred in CFilesMap::SetPoint; cause unknown continue; // this avoids a crash; at worst, selection will not work BOOL inOld = PointInRect(col, row, oldRect); From ca64d82f9a32a1a2a0666c6edd125628043e1536 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:22:18 +0200 Subject: [PATCH 399/710] [translation] Fix src/fileswn0.cpp comments Refines translated comments in src/fileswn0.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #863 for src/fileswn0.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/fileswn0.cpp | 150 +++++++++++++++++++++++------------------------ 1 file changed, 75 insertions(+), 75 deletions(-) diff --git a/src/fileswn0.cpp b/src/fileswn0.cpp index 882e101c2..bd62f6227 100644 --- a/src/fileswn0.cpp +++ b/src/fileswn0.cpp @@ -183,7 +183,7 @@ void CFilesWindow::CtrlPageDnOrEnter(WPARAM key) int index = GetCaretIndex(); if (key != VK_NEXT || index >= 0 && index < Dirs->Count || // Enter or directory or index >= Dirs->Count && index < Files->Count + Dirs->Count && - (Files->At(index - Dirs->Count).Archive || IsNethoodFS())) // an archive file or a file in the Nethood FS (it has servers listed as files and Entire Network as a directory, so the panel is sorted correctly -> Ctrl+PageDown must also open servers and their shares, because they are "directories") + (Files->At(index - Dirs->Count).Archive || IsNethoodFS())) // an archive file or a file in the Nethood FS (it lists servers as files and Entire Network as a directory so the panel sorts correctly; Ctrl+PageDown must therefore also open servers and their shares, because they are "directories") { Execute(index); } @@ -223,8 +223,8 @@ void CFilesWindow::FocusShortcutTarget(CFilesWindow* panel) return; } - //!!! ATTENTION, Resolve may display a dialog and messages will start to be dispatched - // the panel can be refreshed, so from this moment on it is not possible to access + //!!! WARNING: Resolve may display a dialog and messages may start to be dispatched + // the panel may be refreshed, so from this point on it is no longer possible to access // the file pointer BOOL invalid = FALSE; @@ -235,7 +235,7 @@ void CFilesWindow::FocusShortcutTarget(CFilesWindow* panel) strcpy(junctionOrSymlinkTgt, fullName); if (GetReparsePointDestination(junctionOrSymlinkTgt, junctionOrSymlinkTgt, MAX_PATH, &repPointType, FALSE)) { - // MOUNT POINT: I can't get this path in the panel (e.g., \??\Volume{98c0ba30-71ff-11e1-9099-005056c00008}\) + // MOUNT POINT: this path cannot be shown in the panel (e.g., \\??\\Volume{98c0ba30-71ff-11e1-9099-005056c00008}\\) if (repPointType == 1 /* MOUNT POINT */) mountPoint = TRUE; else @@ -282,7 +282,7 @@ void CFilesWindow::FocusShortcutTarget(CFilesWindow* panel) fullName[0] = 0; ITEMIDLIST* pidl; if (link->GetIDList(&pidl) == S_OK && pidl != NULL) - { // we get the ID-list and ask for the name of the last ID in the list, we expect "\\\\server" + { // get the ID list and ask for the name of its last ID; we expect "\\server" IMalloc* alloc; if (SUCCEEDED(CoGetMalloc(1, &alloc))) { @@ -403,7 +403,7 @@ void CFilesWindow::SelectFocusedIndex() { int index = GetCaretIndex(); SetSel(!GetSel(index), index); - if (index + 1 >= 0 && index + 1 < Dirs->Count + Files->Count) // a move + if (index + 1 >= 0 && index + 1 < Dirs->Count + Files->Count) // move SetCaretIndex(index + 1, FALSE); else RedrawIndex(index); @@ -666,7 +666,7 @@ int CFilesWindow::GetSelItems(int itemsCountMax, int* items, BOOL /*focusedItemF } } // we fill the second part of the list: from the first selected item towards firstItem - for (i = 0; i < firstItem; i++) // this is executed only if focusedItemFirst==TRUE is set + for (i = 0; i < firstItem; i++) // executed only if focusedItemFirst==TRUE { CFileData* item = (i < Dirs->Count) ? &Dirs->At(i) : &Files->At(i - Dirs->Count); if (item->Selected == 1) @@ -887,8 +887,8 @@ BOOL CFilesWindow::OnChar(WPARAM wParam, LPARAM lParam, LRESULT* lResult) BOOL controlPressed = (GetKeyState(VK_CONTROL) & 0x8000) != 0; BOOL altPressed = (GetKeyState(VK_MENU) & 0x8000) != 0; - // if we are in QuickSearchEnterAlt mode, we must set the focus to - // the command line and buffer the letter there + // If we are in QuickSearchEnterAlt mode, we must give focus to + // the command line and buffer the character there if (!controlPressed && !altPressed && !QuickSearchMode && wParam > 32 && wParam < 256 && @@ -905,23 +905,23 @@ BOOL CFilesWindow::OnChar(WPARAM wParam, LPARAM lParam, LRESULT* lResult) return FALSE; } - if (wParam > 31 && wParam < 256 && // only normal characters + if (wParam > 31 && wParam < 256 && // only printable characters Dirs->Count + Files->Count > 0) // at least 1 item { int index = FocusedIndex; - // On a German keyboard, the slash is on Shift+7, so it conflicts with HotPaths - // therefore, for * in QS, we will use backslash in addition to slash and sacrifice this + // On a German keyboard, slash is on Shift+7, so it conflicts with HotPaths + // therefore, for * in QS, we will use backslash in addition to slash and give up this // infrequently used function // // 8/2006: German users continue to complain that entering QS is - // difficult for them because with German layout enabled they have to press AltGr+\ - // however, they have the '<' key free, which by the way, when switching to an English - // keyboard means a backslash, so we will start catching the '<' character in addition to '\\' and '/' + // difficult for them because with the German layout enabled they have to press AltGr+\ + // however, they have a free '<' key, which maps to a backslash when the layout is switched + // to English, so we will also start catching the '<' character in addition to '\\' and '/' // the '<' character is also not allowed in a file name // //if (QuickSearchMode && (char)wParam == '\\') //{ - // // when the '\\' character is pressed during QS, we jump to the first item that matches QuickSearchMask + // // when the '\\' character is pressed during QS, jump to the first item that matches QuickSearchMask // if (!QSFindNext(GetCaretIndex(), TRUE, FALSE, TRUE, (char)0, index)) // QSFindNext(GetCaretIndex(), FALSE, TRUE, TRUE, (char)0, index); //} @@ -931,7 +931,7 @@ BOOL CFilesWindow::OnChar(WPARAM wParam, LPARAM lParam, LRESULT* lResult) QSFindNext(GetCaretIndex(), FALSE, TRUE, FALSE, (char)wParam, index); //} - if (!QuickSearchMode) // initialization of search + if (!QuickSearchMode) // Initialize quick search { if (GetViewMode() == vmDetailed) ListBox->OnHScroll(SB_THUMBPOSITION, 0); @@ -1056,8 +1056,8 @@ BOOL CFilesWindow::OnSysKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT return TRUE; if (wParam == VK_SPACE && !shiftPressed && !controlPressed && !altPressed) - { // spacebar will be used for selection (names usually don't start with ' ') - if (!QuickSearchMode) // it can be in the middle of a name + { // spacebar toggles selection (names usually don't start with a space) + if (!QuickSearchMode) // ' ' can be in the middle of a name { SkipCharacter = TRUE; int index = GetCaretIndex(); @@ -1087,7 +1087,7 @@ BOOL CFilesWindow::OnSysKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT } } } - if (index + 1 >= 0 && index + 1 < Dirs->Count + Files->Count) // a move + if (index + 1 >= 0 && index + 1 < Dirs->Count + Files->Count) // move SetCaretIndex(index + 1, FALSE); else RedrawIndex(index); @@ -1368,7 +1368,7 @@ BOOL CFilesWindow::OnSysKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT return TRUE; } - case VK_ESCAPE: // end quick search mode via ESC + case VK_ESCAPE: // end quick search mode with Esc { EndQuickSearch(); return TRUE; @@ -1425,7 +1425,7 @@ BOOL CFilesWindow::OnSysKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT strcmp(name, "..") != 0) && name[len] != 0) { - // if there is still another one + // if there is another one QuickSearch[len] = name[len]; QuickSearch[len + 1] = 0; int len2 = (int)strlen(QuickSearchMask); @@ -1632,7 +1632,7 @@ BOOL CFilesWindow::OnSysKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT { case VK_SPACE: { - return TRUE; // I don't want space + return TRUE; // ignore Space } case VK_INSERT: // selection / deselection of a listbox item + move to the next one @@ -1690,7 +1690,7 @@ BOOL CFilesWindow::OnSysKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT else if (GetViewMode() == vmDetailed) { int i; - for (i = 0; i < 5; i++) // let's do some macro programming + for (i = 0; i < 5; i++) // a bit of macro programming SendMessage(ListBox->HWindow, WM_HSCROLL, SB_LINEUP, 0); } break; @@ -1703,7 +1703,7 @@ BOOL CFilesWindow::OnSysKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT else if (GetViewMode() == vmDetailed) { int i; - for (i = 0; i < 5; i++) // let's do some macro programming + for (i = 0; i < 5; i++) // repeat the scroll message several times SendMessage(ListBox->HWindow, WM_HSCROLL, SB_LINEDOWN, 0); } break; @@ -1738,7 +1738,7 @@ BOOL CFilesWindow::OnSysKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT { if (newFocusedIndex > 0) { - if (altPressed) // Petr: in all modes, we go to the previous selected item (it might seem strange with icons/thumbnails/tiles, but it doesn't seem useful to me to search for a selected item only in the current column) + if (altPressed) // Petr: in all modes, go to the previous selected item (this may look odd in icons/thumbnails/tiles mode, but it does not seem useful to search for a selected item only in the current column) { int index; BOOL found = SelectFindNext(GetCaretIndex(), FALSE, TRUE, index); @@ -1780,7 +1780,7 @@ BOOL CFilesWindow::OnSysKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT { if (newFocusedIndex < Dirs->Count + Files->Count - 1) { - if (altPressed) // Petr: in all modes, we go to the next selected item (it might seem strange with icons/thumbnails/tiles, but it doesn't seem useful to me to search for a selected item only in the current column) + if (altPressed) // Petr: in all modes, go to the next selected item (this may seem odd for icons/thumbnails/tiles, but searching for a selected item only in the current column does not seem useful) { int index; BOOL found = SelectFindNext(GetCaretIndex(), TRUE, TRUE, index); @@ -1976,7 +1976,7 @@ BOOL CFilesWindow::OnSysKeyDown(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT if (newFocusedIndex != FocusedIndex || forceSelect) { - if (shiftPressed) // shift+movement selecting + if (shiftPressed) // Shift+movement selection { BOOL select = SelectItems; // we'll get the state that the item had when Shift was pressed int targetIndex = newFocusedIndex; @@ -2047,7 +2047,7 @@ void CFilesWindow::OnSetFocus(BOOL focusVisible) // change: instead of immediate redrawing, we only invalidate the area; // the focus will not be so aggressive when switching to Salamander and will wait // until other items are drawn. - if (Dirs->Count + Files->Count == 0) // we ensure that the text about an empty panel is drawn + if (Dirs->Count + Files->Count == 0) // ensure the empty-panel text is drawn InvalidateRect(ListBox->HWindow, &ListBox->FilesRect, FALSE); else { @@ -2079,7 +2079,7 @@ void CFilesWindow::OnKillFocus(HWND hwndGetFocus) // change: instead of immediate redrawing, we only invalidate the area; // the focus will not be so aggressive when switching to Salamander and will wait // until other items are drawn. - if (Dirs->Count + Files->Count == 0) // we ensure that the text about an empty panel is drawn + if (Dirs->Count + Files->Count == 0) // ensure the empty panel text is redrawn InvalidateRect(ListBox->HWindow, &ListBox->FilesRect, FALSE); else { @@ -2113,7 +2113,7 @@ void ReleaseListingBody(CPanelType oldPanelType, CSalamanderDirectory*& oldArchi } if (oldPluginData.NotEmpty()) { - // we release plug-in data for individual files and directories + // we release plugin data for individual files and directories BOOL releaseFiles = oldPluginData.CallReleaseForFiles(); BOOL releaseDirs = oldPluginData.CallReleaseForDirs(); if (releaseFiles || releaseDirs) @@ -2186,7 +2186,7 @@ BOOL AreTheSameDirs(DWORD validFileData, CPluginDataInterfaceEncapsulation* plug SYSTEMTIME st2; BOOL validDate2, validTime2; GetFileDateAndTimeFromPanel(validFileData, pluginData2, f2, TRUE, &st2, &validDate2, &validTime2); - if (validDate1 == validDate2 && validTime1 == validTime2 && // The same parts of the structures must be valid. + if (validDate1 == validDate2 && validTime1 == validTime2 && // The same parts of both structures must be valid. (!validDate1 || st1.wYear == st2.wYear && st1.wMonth == st2.wMonth && @@ -2272,14 +2272,14 @@ void CFilesWindow::RefreshDirectory(BOOL probablyUselessRefresh, BOOL forceReloa BOOL focusFirstNewItem = FocusFirstNewItem; // the first ReadDirectory resets it, so we make a backup BOOL cutToClipChanged = CutToClipChanged; // the first ReadDirectory resets it, so we make a backup - // we'll save the top-index and xoffset so that there won't be unnecessary "jumps" in the panel content + // save the top index and xoffset to avoid unnecessary "jumps" in the panel contents int topIndex = ListBox->GetTopIndex(); int xOffset = ListBox->GetXOffset(); // we'll remember if the old listing is an FS with custom icons (pitFromPlugin) BOOL pluginFSIconsFromPlugin = Is(ptPluginFS) && GetPluginIconsType() == pitFromPlugin; - // we'll save the focus item data - we'll look for it later (and focus it) + // save the focused item's data; we will look for it later (and focus it) BOOL ensureFocusIndexVisible = FALSE; BOOL wholeItemVisible = FALSE; // partial item visibility is enough for us int focusIndex = GetCaretIndex(); @@ -2302,7 +2302,7 @@ void CFilesWindow::RefreshDirectory(BOOL probablyUselessRefresh, BOOL forceReloa CIconCache* oldIconCache = NULL; if (UseSystemIcons || UseThumbnails) SleepIconCacheThread(); // we'll stop the icon-reader (IconCache/Files/Dirs might change) - if (!TemporarilySimpleIcons && // if we shouldn't use the IconCache, we won't transfer anything from it to the new cache (e.g. when switching views to/from Thumbnails) + if (!TemporarilySimpleIcons && // if we should not use IconCache, we will not transfer anything from it to the new cache (e.g. when switching to or from Thumbnails view) (UseSystemIcons || UseThumbnails)) { oldIconCache = IconCache; @@ -2484,14 +2484,14 @@ void CFilesWindow::RefreshDirectory(BOOL probablyUselessRefresh, BOOL forceReloa EndStopRefresh(); if (setWait) SetCursor(oldCur); - return; // exit without performing a refresh (error exit) + return; // return without refreshing (error exit) } int oldSelectedCount = SelectedCount; BOOL clearWMUpdatePanel = FALSE; if (!OnlyDetachFSListing) { - // we secure the listbox against errors arising from a request to redraw (we have just cut the data) + // protect the list box against errors caused by redraw requests (we have just cut off its data) ListBox->SetItemsCount(0, 0, 0, TRUE); // TRUE - we disable setting the scrollbar SelectedCount = 0; @@ -2506,18 +2506,18 @@ void CFilesWindow::RefreshDirectory(BOOL probablyUselessRefresh, BOOL forceReloa BOOL oldCanAddToDirHistory = MainWindow->CanAddToDirHistory; MainWindow->CanAddToDirHistory = FALSE; - // a real mess: we have to postpone the start of reading icons in the icon-reader (this is started inside ChangePathToDisk, etc.), - // so that we have time to stop reading icons a few lines below (partly so we can take over old versions of icons+thumbnails - // and partly so that we can completely skip reading icons (icons loaded in the previous round will be used) in case - // 'probablyUselessRefresh' is TRUE and we don't recognize any changes in the directory); another place where this mess - // is used is when 'isInactiveRefresh' is TRUE, InactWinOptimizedReading is set to TRUE; a cleaner solution - // would be to not start reading icons at all in this case (not execute WakeupIconCacheThread()), but that seems quite - // non-trivial, so we are handling it like this via Sleep in the icon-reader + // Temporary workaround: postpone the start of icon loading in the icon reader (started inside ChangePathToDisk, etc.) + // so it can be stopped a few lines below. This lets us reuse previous icon and thumbnail versions, + // and also skip icon loading entirely (reusing icons loaded in the previous pass) when + // 'probablyUselessRefresh' is TRUE and no directory changes are detected; the same workaround + // is also used when 'isInactiveRefresh' is TRUE, by setting InactWinOptimizedReading to TRUE. A cleaner solution + // would be to avoid starting icon loading at all in this case (do not call WakeupIconCacheThread()), but that appears + // to be nontrivial, so this is handled via Sleep in the icon reader // - // ATTENTION: before leaving this function, we must put zero back into WaitBeforeReadingIcons !!! + // WARNING: before leaving this function, WaitBeforeReadingIcons must be reset to zero. WaitBeforeReadingIcons = 30; - // refresh of the path (change to the same one with forceUpdate TRUE) + // refresh the path (switching to the same path with forceUpdate TRUE) BOOL noChange; BOOL result; char buf1[MAX_PATH]; @@ -2544,8 +2544,8 @@ void CFilesWindow::RefreshDirectory(BOOL probablyUselessRefresh, BOOL forceReloa oldPluginData.GetVersion(), oldPluginData.GetPluginInterface(), oldPluginData.GetBuiltForVersion()); SetValidFileData(GetArchiveDir()->GetValidData()); - // We'll keep the new IconCache so we don't lose the old one with loaded icons - // We'll keep Files and Dirs new so that synchronization can be performed (select and cut-to-clip) + // Keep the new IconCache so we do not lose the old one with loaded icons + // Keep the new Files and Dirs so synchronization can be performed (selection and cut-to-clipboard) CommonRefresh(HWindow, -1, NULL, FALSE, TRUE, TRUE); // without listbox refresh noChange = FALSE; // change in Files+Dirs @@ -2564,7 +2564,7 @@ void CFilesWindow::RefreshDirectory(BOOL probablyUselessRefresh, BOOL forceReloa result = ChangePathToPluginFS(GetPluginFS()->GetPluginFSName(), buf1, -1, NULL, TRUE, 1 /*refresh*/, &noChange, FALSE, NULL, TRUE); } - else // should not happen if the plug-in is written intelligently + else // should not happen if the plugin is written intelligently { ChangeToFixedDrive(HWindow, &noChange, FALSE); // we can safely end quick-search, it would end anyway result = FALSE; @@ -2591,9 +2591,9 @@ void CFilesWindow::RefreshDirectory(BOOL probablyUselessRefresh, BOOL forceReloa PeekMessage(&msg2, HWindow, WM_USER_UPDATEPANEL, WM_USER_UPDATEPANEL, PM_REMOVE); } - if (!result || noChange) // refresh failed or is useless + if (!result || noChange) // refresh failed or is unnecessary { - if (noChange) // we'll return the old listing (no replacement was created), we perform cleanup (sort-dir, etc.) + if (noChange) // restore the old listing (no replacement was created), perform cleanup (sort-dir, etc.) { if (!OnlyDetachFSListing) { @@ -2631,7 +2631,7 @@ void CFilesWindow::RefreshDirectory(BOOL probablyUselessRefresh, BOOL forceReloa if (oldIconCache != NULL) { delete oldIconCache; - oldIconCache = NULL; // so we don't perform a useless wake-up of the icon-reader + oldIconCache = NULL; // to avoid an unnecessary wake-up of the icon reader } topIndex = -1; // different listing -> ignore @@ -2680,7 +2680,7 @@ void CFilesWindow::RefreshDirectory(BOOL probablyUselessRefresh, BOOL forceReloa iconReaderIsSleeping = TRUE; BOOL newPluginFSIconsFromPlugin = Is(ptPluginFS) && GetPluginIconsType() == pitFromPlugin; if (pluginFSIconsFromPlugin && newPluginFSIconsFromPlugin) - { // both the old and new listing are FS with custom icons -> transferring old icons makes sense + we must pass 'dataIface' + { // both the old and new listings are FS listings with custom icons, so transferring the old icons makes sense and we must pass 'dataIface' IconCache->GetIconsAndThumbsFrom(oldIconCache, &PluginData); // we load the old versions of icons and thumbnails into it } else @@ -2727,7 +2727,7 @@ void CFilesWindow::RefreshDirectory(BOOL probablyUselessRefresh, BOOL forceReloa int oldCount = oldDirs->Count + oldFiles->Count; int count = Dirs->Count + Files->Count; if (count != oldCount + 1 && focusFirstNewItem) - focusFirstNewItem = FALSE; // one item wasn't added + focusFirstNewItem = FALSE; // no single item was added // if 'caseSensitive' is TRUE, we require exact (case sensitive) matching of name // during the following flag synchronization @@ -2748,7 +2748,7 @@ void CFilesWindow::RefreshDirectory(BOOL probablyUselessRefresh, BOOL forceReloa if (oldData->NameLen == 2 && oldData->Name[0] == '.' && oldData->Name[1] == '.') j++; } - for (; j < oldDirs->Count; j++) // first directories + for (; j < oldDirs->Count; j++) // directories first { CFileData* oldData = &oldDirs->At(j); if (focusFirstNewItem || oldData->Selected || oldData->SizeValid || oldData->CutToClip || @@ -2774,7 +2774,7 @@ void CFilesWindow::RefreshDirectory(BOOL probablyUselessRefresh, BOOL forceReloa if (!LessNameExt(*oldData, *newData2, FALSE)) // old == new (exact) - we prefer exact match over case insensitive match { exactMatch = TRUE; - if (ii > i) // we skipped at least one item (it was smaller than the searched old item) + if (ii > i) // we skipped at least one item (it was smaller than the old item being searched for) { if (focusFirstNewItem) // found a new item { @@ -2786,7 +2786,7 @@ void CFilesWindow::RefreshDirectory(BOOL probablyUselessRefresh, BOOL forceReloa newData = newData2; } } - break; // in any case, we end the search for exact match + break; // in any case, we stop searching for an exact match } ii++; } @@ -2821,7 +2821,7 @@ void CFilesWindow::RefreshDirectory(BOOL probablyUselessRefresh, BOOL forceReloa break; // end of searching for selected items } } - if (focusFirstNewItem && i == Dirs->Count - 1) // found a new item + if (focusFirstNewItem && i == Dirs->Count - 1) // new item found { strcpy(NextFocusName, Dirs->At(i).Name); firstNewItemIsDir = 1 /* is directory */; @@ -2829,7 +2829,7 @@ void CFilesWindow::RefreshDirectory(BOOL probablyUselessRefresh, BOOL forceReloa } i = 0; - for (j = 0; j < oldFiles->Count; j++) // after directories also files + for (j = 0; j < oldFiles->Count; j++) // after the directories, also files { CFileData* oldData = &oldFiles->At(j); if (focusFirstNewItem || oldData->Selected || oldData->CutToClip || @@ -2855,11 +2855,11 @@ void CFilesWindow::RefreshDirectory(BOOL probablyUselessRefresh, BOOL forceReloa if (!LessNameExt(*oldData, *newData2, FALSE)) // old == new (exact) - we prefer exact match over case insensitive match { exactMatch = TRUE; - if (ii > i) // we skipped at least one item (it was smaller than the searched old item) + if (ii > i) // we skipped at least one item (it was smaller than the old item being searched for) { if (focusFirstNewItem) // found a new item { - if (!Is(ptDisk) || (newData->Attr & FILE_ATTRIBUTE_TEMPORARY) == 0) // on disk, we ignore tmp files (they disappear immediately), see https://forum.altap.cz/viewtopic.php?t=2496 + if (!Is(ptDisk) || (newData->Attr & FILE_ATTRIBUTE_TEMPORARY) == 0) // on disk, we ignore temporary files (they disappear immediately), see https://forum.altap.cz/viewtopic.php?t=2496 { strcpy(NextFocusName, newData->Name); firstNewItemIsDir = 0 /* is file */; @@ -2891,7 +2891,7 @@ void CFilesWindow::RefreshDirectory(BOOL probablyUselessRefresh, BOOL forceReloa { if (focusFirstNewItem) // found a new item { - if (!Is(ptDisk) || (newData->Attr & FILE_ATTRIBUTE_TEMPORARY) == 0) // on disk, we ignore tmp files (they disappear immediately), see https://forum.altap.cz/viewtopic.php?t=2496 + if (!Is(ptDisk) || (newData->Attr & FILE_ATTRIBUTE_TEMPORARY) == 0) // on disk, we ignore temporary files (they disappear again immediately), see https://forum.altap.cz/viewtopic.php?t=2496 { strcpy(NextFocusName, newData->Name); firstNewItemIsDir = 0 /* is file */; @@ -2907,7 +2907,7 @@ void CFilesWindow::RefreshDirectory(BOOL probablyUselessRefresh, BOOL forceReloa } if (focusFirstNewItem && i == Files->Count - 1) // found a new item { - if (!Is(ptDisk) || (Files->At(i).Attr & FILE_ATTRIBUTE_TEMPORARY) == 0) // on disk, we ignore tmp files (they disappear immediately), see https://forum.altap.cz/viewtopic.php?t=2496 + if (!Is(ptDisk) || (Files->At(i).Attr & FILE_ATTRIBUTE_TEMPORARY) == 0) // on disk, we ignore temporary files (they disappear again immediately), see https://forum.altap.cz/viewtopic.php?t=2496 { strcpy(NextFocusName, Files->At(i).Name); firstNewItemIsDir = 0 /* is file */; @@ -2929,14 +2929,14 @@ void CFilesWindow::RefreshDirectory(BOOL probablyUselessRefresh, BOOL forceReloa if (iconCacheBackuped && (UseSystemIcons || UseThumbnails)) // wake-up after SortDirectory() { - if (!oldIconCacheValid || // if the icon reading didn't finish + if (!oldIconCacheValid || // if icon reading did not finish oldInactWinOptimizedReading || // if only icons from the visible part of the panel were read !transferIconsAndThumbnailsAsNew) // if the listing has changed { WakeupIconCacheThread(); // we'll let it read all icons again (we'll show old versions in the meantime) } else - IconCacheValid = TRUE; // we won't start the icon-reader, the icons/thumbnails/overlays are loaded, nothing to do (avoids an infinite refresh cycle in case of a network drive, where at least one icon can't be read - if we start the icon-reader, it will try to read it, which will trigger a refresh and we'll cycle) + IconCacheValid = TRUE; // do not start the icon reader; the icons/thumbnails/overlays are already loaded, so there is nothing to do (this prevents an infinite refresh cycle on a network drive when at least one icon cannot be loaded - starting the icon reader would make it try again, trigger another refresh, and loop) } // we find the index of the focus item @@ -2961,14 +2961,14 @@ void CFilesWindow::RefreshDirectory(BOOL probablyUselessRefresh, BOOL forceReloa CFileData* f = (i < Dirs->Count) ? &Dirs->At(i) : &Files->At(i - Dirs->Count); if (f->NameLen == (unsigned)l && StrICmpEx(f->Name, f->NameLen, NextFocusName, l) == 0 && - (firstNewItemIsDir == -1 /* we don't know what it is */ || + (firstNewItemIsDir == -1 /* type unknown */ || firstNewItemIsDir == 0 /* is file */ && i >= Dirs->Count || firstNewItemIsDir == 1 /* is directory */ && i < Dirs->Count)) { foundFocus = TRUE; ensureFocusIndexVisible = TRUE; wholeItemVisible = TRUE; // we want complete visibility of the new item - if (StrCmpEx(f->Name, f->NameLen, NextFocusName, l) == 0) // found: exact + if (StrCmpEx(f->Name, f->NameLen, NextFocusName, l) == 0) // found: exact match { focusIndex = i; break; @@ -2978,11 +2978,11 @@ void CFilesWindow::RefreshDirectory(BOOL probablyUselessRefresh, BOOL forceReloa } } if (i == count && found != -1) - focusIndex = found; // found: ignore-case + focusIndex = found; // found: case-insensitive match NextFocusName[0] = 0; } - // first, we search for the old focus in the new listing (according to the case-sensitivity of the current listing) + // first, we look up the old focus in the new listing according to the current listing's case sensitivity if (!foundFocus && focusData.Name != NULL) { if (focusIsDir) @@ -3049,7 +3049,7 @@ void CFilesWindow::RefreshDirectory(BOOL probablyUselessRefresh, BOOL forceReloa break; } - if (focusData.Name != NULL) // we should search for the focus + if (focusData.Name != NULL) // look for the focused item { if (focusIsDir) { @@ -3060,7 +3060,7 @@ void CFilesWindow::RefreshDirectory(BOOL probablyUselessRefresh, BOOL forceReloa for (; i < count; i++) { CFileData* d2 = &Dirs->At(i); - if (!lessDirs(*d2, focusData, ReverseSort)) // due to sorting, it will be TRUE only on the first larger item + if (!lessDirs(*d2, focusData, ReverseSort)) // due to sorting, this becomes TRUE at the first item that is not smaller { focusIndex = i; break; @@ -3073,7 +3073,7 @@ void CFilesWindow::RefreshDirectory(BOOL probablyUselessRefresh, BOOL forceReloa for (i = 0; i < count; i++) { CFileData* d2 = &Files->At(i); - if (!lessFiles(*d2, focusData, ReverseSort)) // due to sorting, it will be TRUE only on the first larger item + if (!lessFiles(*d2, focusData, ReverseSort)) // due to sorting, this becomes TRUE at the first larger item { focusIndex = Dirs->Count + i; break; @@ -3087,7 +3087,7 @@ void CFilesWindow::RefreshDirectory(BOOL probablyUselessRefresh, BOOL forceReloa focusIndex = max(0, count - 1); } - // release the backup of the old listing + // release the saved old listing ReleaseListingBody(oldPanelType, oldArchiveDir, oldPluginFSDir, oldPluginData, oldFiles, oldDirs, TRUE); @@ -3189,8 +3189,8 @@ void CFilesWindow::SetQuickSearchCaretPos() { x = r.left + 3 + IconSizes[ICONSIZE_16] + s.cx + offset; y = r.top + 2; - // if the column width is manually limited, we ensure that - // the caret doesn't go beyond the limit; otherwise, it would spill into other columns + // if the Name column width is manually limited, ensure that + // the caret stops at the maximum width; otherwise it would extend into the next columns if (GetViewMode() == vmDetailed && !ext && x >= (int)Columns[0].Width) x = Columns[0].Width - 3; x -= ListBox->XOffset; From 4a42e12f8306a4fa6576529d82f83daf100e26e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:22:34 +0200 Subject: [PATCH 400/710] [translation] Fix src/fileswn1.cpp comments Refines translated comments in src/fileswn1.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #864 for src/fileswn1.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/fileswn1.cpp | 94 ++++++++++++++++++++++++------------------------ 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/src/fileswn1.cpp b/src/fileswn1.cpp index 1b504d80c..d4da1ba08 100644 --- a/src/fileswn1.cpp +++ b/src/fileswn1.cpp @@ -124,7 +124,7 @@ BOOL CFilesWindowAncestor::IsPathFromActiveFS(const char* fsName, char* fsUserPa fsNameIndex = -1; if (Is(ptPluginFS) && PluginFS.NotEmpty()) { - if (Plugins.AreFSNamesFromSamePlugin(PluginFS.GetPluginFSName(), fsName, fsNameIndex)) // we compare whether the file systems are from the same plug-in + if (Plugins.AreFSNamesFromSamePlugin(PluginFS.GetPluginFSName(), fsName, fsNameIndex)) // Check whether the file systems are from the same plugin { if (convertPathToInternal) { @@ -291,7 +291,7 @@ void CFilesWindowAncestor::SetPath(const char* path) ((CFilesWindow*)this)->SetAutomaticRefresh(FALSE, TRUE); } } - else // ptPluginFS - do not perform any refreshes; the plug-in manages them itself + else // ptPluginFS - do not perform any refreshes; the plugin manages them itself { ((CFilesWindow*)this)->SetAutomaticRefresh(TRUE, TRUE); } @@ -525,7 +525,7 @@ unsigned IconThreadThreadFBody(void* parameter) else TRACE_E("Unexpected situation."); } - // before starting set "ReadingDone" of all icon-cache items and "IconOverlayDone" of all panel items to FALSE + // Before starting, set "ReadingDone" to FALSE for all icon-cache items and "IconOverlayDone" to FALSE for all items in the panel int x; if (!repeatedRound) for (x = 0; x < window->IconCache->Count; x++) @@ -543,12 +543,12 @@ unsigned IconThreadThreadFBody(void* parameter) int selectMode = 1; // 1 = sequential traversal (VisibleItemsArray.IsArrValid() == FALSE), - // 2 = traversal according to VisibleItemsArray, - // 3 = traversal according to VisibleItemsArraySurround, + // 2 = traversal using VisibleItemsArray, + // 3 = traversal using VisibleItemsArraySurround, // 4 = sequential traversal (VisibleItemsArray.IsArrValid() == TRUE) BOOL canReadIconOverlays = firstRound && window->Is(ptDisk) && iconReadersIconOverlayIds != NULL; - BOOL readIconOverlaysNow = FALSE; // TRUE = reading overlays now, FALSE = reading icons + thumbnails + BOOL readIconOverlaysNow = FALSE; // TRUE = reading overlays now, FALSE = reading icons and thumbnails // TRACE_I("wanted=" << wanted << ", selectMode=" << selectMode); @@ -559,7 +559,7 @@ unsigned IconThreadThreadFBody(void* parameter) while (1) { BOOL callWaitForObjects = TRUE; // optimization only - while searching for an item (takes almost no time) WaitForMultipleObjects is not called - if (i < (readIconOverlaysNow ? window->Files->Count + window->Dirs->Count : window->IconCache->Count)) // loading an icon from a file/directory or retrieving icon overlay for a file/directory + if (i < (readIconOverlaysNow ? window->Files->Count + window->Dirs->Count : window->IconCache->Count)) // load an icon from a file/directory or retrieve the icon overlay for a file/directory { CIconData* iconData = readIconOverlaysNow ? NULL : &window->IconCache->At(i); @@ -716,9 +716,9 @@ unsigned IconThreadThreadFBody(void* parameter) iconData->GetFlag() == wanted) { iconData->SetReadingDone(1); // mark that we have already worked with this icon so we do not try again during this cycle - if (wanted == 0 || wanted == 2) // loading icons directly from a file or from a plug-in + if (wanted == 0 || wanted == 2) // loading icons directly from a file or from a plugin { - if (!pluginFSIconsFromPlugin) // icon on disk + if (!pluginFSIconsFromPlugin) // icon from disk { if (strlen(iconData->NameAndData) + (name - path) < MAX_PATH) { @@ -761,7 +761,7 @@ unsigned IconThreadThreadFBody(void* parameter) TRACE_I("Too long filename to get icon from: " << path << iconData->NameAndData); } } - else // icon in a plug-in FS - reading cannot be interrupted (risk of PluginData being destroyed) + else // icon in a plugin FS - loading cannot be interrupted (risk of PluginData being destroyed) { const CFileData* f = iconData->GetFSFileData(); if (f != NULL) @@ -783,12 +783,12 @@ unsigned IconThreadThreadFBody(void* parameter) } else { - if (wanted == 3) // loading icons from the icon-location + if (wanted == 3) // loading icons from icon-location { shi.hIcon = NULL; char* nameAndData = iconData->NameAndData; int size = (int)strlen(nameAndData) + 4; - size -= (size & 0x3); // size % 4 (alignment to four bytes) + size -= (size & 0x3); // size % 4 (4-byte alignment) char* s = nameAndData + size; // skip the alignment zeros BOOL doExtractIcons = FALSE; BOOL doLoadImage = FALSE; @@ -870,14 +870,14 @@ unsigned IconThreadThreadFBody(void* parameter) HANDLES(EnterCriticalSection(&window->ICSleepSection)); } - else // wanted == 4 or 6; loading thumbnails from a plug-in ("thumbnail loader") + else // wanted == 4 or 6; loading thumbnails from a plugin ("thumbnail loader") { shi.hIcon = NULL; // precaution against incorrect icon deallocation (none is created here) char* s = iconData->NameAndData; int len = (int)strlen(s); int size = len + 4; - size -= (size & 0x3); // size % 4 (alignment to four bytes) + size -= (size & 0x3); // size % 4 (4-byte alignment) if (strlen(s) + (name - path) < MAX_PATH) { strcpy(name, s); @@ -894,9 +894,9 @@ unsigned IconThreadThreadFBody(void* parameter) { thumbnailFlag = wanted == 4 /* first thumbnail loading round */ ? (thumbMaker.IsOnlyPreview() ? 6 /* low-quality/smaller */ : 5 /* quality */) : 5 /* in the second round all obtained thumbnails are quality */; thumbMaker.HandleIncompleteImages(); - break; // the thumbnail may be loaded; do not try another plug-in + break; // the thumbnail may be loaded; do not try another plugin } - loader++; // try the next plug-in in line, it might load the thumbnail + loader++; // try the next plugin in line, it might load the thumbnail } if (*loader == NULL) thumbMaker.Clear(); // failed thumbnail -> clean it up @@ -915,7 +915,7 @@ unsigned IconThreadThreadFBody(void* parameter) { thumbMaker.Clear(); // the thumbnail will no longer be needed - // if this is not an icon from a plug-in that forbids icon destruction, destroy it + // if this is not an icon from a plugin that forbids icon destruction, destroy it if (shi.hIcon != NULL && (!pluginFSIconsFromPlugin || destroyPluginIcon)) { ::NOHANDLES(DestroyIcon(shi.hIcon)); @@ -939,9 +939,9 @@ unsigned IconThreadThreadFBody(void* parameter) HANDLES(LeaveCriticalSection(&window->ICSectionUsingIcon)); - // find the index of the item for which we loaded the icon + // find the index of the item whose icon we loaded - if (pluginFSIconsFromPlugin) // pitFromPlugin: let the plug-in compare items itself (must compare with no duplicates) + if (pluginFSIconsFromPlugin) // pitFromPlugin: let the plugin compare the items itself (the comparison must not treat any two items in the listing as equal) { const CFileData* file = iconData->GetFSFileData(); if (file != NULL) @@ -973,7 +973,7 @@ unsigned IconThreadThreadFBody(void* parameter) } } } - else // duplicate names are not a problem (e.g., archives where identical names cannot have different icons) + else // duplicate names are not a problem (or are not an obstacle, as for example in an archive, where { char* name2 = iconData->NameAndData; CFilesArray* arr = window->Dirs; @@ -1024,7 +1024,7 @@ unsigned IconThreadThreadFBody(void* parameter) if (thumbMaker.RenderToThumbnailData(thumbnailData)) { iconData->SetFlag(thumbnailFlag); // already loaded - if (thumbnailFlag == 6 /* low-quality/smaller thumbnail in the first loading round */) + if (thumbnailFlag == 6 /* lower-quality/smaller thumbnail in the first thumbnail-loading pass */) iconData->SetReadingDone(0); // another round will follow, so mark as not "done" thumbnailCreated = TRUE; } @@ -1032,7 +1032,7 @@ unsigned IconThreadThreadFBody(void* parameter) if (thumbnailCreated) { - // find the index of the file (directories have no thumbnails) for which we loaded the thumbnail + // find the index of the file (directories have no thumbnails) whose thumbnail we loaded char* name2 = iconData->NameAndData; int z; for (z = 0; z < window->Files->Count; z++) @@ -1087,13 +1087,13 @@ unsigned IconThreadThreadFBody(void* parameter) canReadIconOverlays = FALSE; // loading order: new icons, new thumbnails, old icons, old thumbnails - BOOL done = FALSE; // TRUE == break, everything is loaded + BOOL done = FALSE; // TRUE = stop, everything has already been loaded switch (wanted) { case 0: // new icons have already been loaded { - // if thumbnails should be read and this is the first round (plug-ins do not work - // randomly like the system, so if they fail the first time they will never load), read + // if thumbnails should be loaded and this is the first loading pass (plugins do not behave + // nondeterministically like the system, so if they do not load the first time, they will never load), load // new thumbnails (wanted == 4) if (readThumbnails && firstRound) wanted = 4; @@ -1187,7 +1187,7 @@ unsigned IconThreadThreadFBody(void* parameter) } } } - if (wait == WAIT_TIMEOUT) // reason to retry reading icons (visible area change or usermenu icons finished) + if (wait == WAIT_TIMEOUT) // reason to retry reading icons (visible area changed or user-menu icon reading finished) { if (!UserMenuIconBkgndReader.IsReadingIcons()) // if usermenu icons are done, read icons outside the visible area { @@ -1212,7 +1212,7 @@ unsigned IconThreadThreadFBody(void* parameter) if (window->Is(ptDisk) && failed && firstRound) { // try again (not all icons were loaded) firstRound = FALSE; // only one extra round - waitBeforeFirstReadIcon = TRUE; // prevent immediate rereading (low chance of success) + waitBeforeFirstReadIcon = TRUE; // avoid reading the icon again immediately (low chance of success) // TRACE_I("Going to second round of reading (some icons have not been read in the first round)."); goto SECOND_ROUND; // postRefresh = TRUE; @@ -1291,7 +1291,7 @@ unsigned IconThreadThreadFEH(void* param) { TRACE_I("Thread IconReader: calling ExitProcess(1)."); // ExitProcess(1); - TerminateProcess(GetCurrentProcess(), 1); // harder exit (this call still performs some operations) + TerminateProcess(GetCurrentProcess(), 1); // harder exit (the referent of "this one" is unclear here) return 1; } #endif // CALLSTK_DISABLE @@ -1526,7 +1526,7 @@ void CFilesWindow::WakeupIconCacheThread() CALL_STACK_MESSAGE_NONE ICStopWork = FALSE; // so that the work is not interrupted right from the start SetEvent(ICEventWork); // switch to work mode without waiting for a response - MSG msg; // remove any WM_USER_ICONREADING_END that would set IconCacheValid = TRUE + MSG msg; // remove any pending WM_USER_ICONREADING_END that would set IconCacheValid = TRUE while (PeekMessage(&msg, HWindow, WM_USER_ICONREADING_END, WM_USER_ICONREADING_END, PM_REMOVE)) ; } @@ -1565,7 +1565,7 @@ BOOL CFilesWindow::CanUnloadPlugin(HWND parent, CPluginInterfaceAbstract* plugin HANDLES(EnterCriticalSection(&TimeCounterSection)); int t1 = MyTimeCounter++; HANDLES(LeaveCriticalSection(&TimeCounterSection)); - PostMessage(HWindow, WM_USER_REFRESH_DIR, 0, t1); // ensure the icon cache is refilled (ideally after the plug-in unload/remove) + PostMessage(HWindow, WM_USER_REFRESH_DIR, 0, t1); // ensure the icon cache is refilled (ideally after the plugin unload/remove) } } } @@ -1587,27 +1587,27 @@ BOOL CFilesWindow::CanUnloadPlugin(HWND parent, CPluginInterfaceAbstract* plugin else { if (Is(ptZIPArchive)) - { // an archive may not use PluginData, therefore we must also test archive associations - // this part matters only when shutting Salamander down—otherwise the plug-in - // could unload while the archiver is still in use (each archiver function loads the plug-in) - // NOTE: icon overlays from the plug-in are an exception; after unload they would stop drawing - // (the plug-in's overlay table is released during unload) + { // an archive may not use PluginData, so we must also check archive associations + // this part matters only when Salamander is shutting down; otherwise the plugin + // could be unloaded while the archiver is still in use (each archiver function loads the plugin) + // NOTE: icon overlays from the plugin are an exception; after the plugin is unloaded, they stop being drawn + // (the plugin's icon-overlay array is released during unload) int format = PackerFormatConfig.PackIsArchive(GetZIPArchive()); if (format != 0) // found a supported archive { format--; CPluginData* data; int index = PackerFormatConfig.GetUnpackerIndex(format); - if (index < 0) // view: is this internal processing (plug-in)? + if (index < 0) // is this handled internally by a plugin? { data = Plugins.Get(-index - 1); if (data != NULL && data->GetPluginInterface()->GetInterface() == plugin) used = TRUE; } - if (PackerFormatConfig.GetUsePacker(format)) // has an editor? + if (PackerFormatConfig.GetUsePacker(format)) // supports editing? { index = PackerFormatConfig.GetPackerIndex(format); - if (index < 0) // is this internal processing (plug-in)? + if (index < 0) // handled by a plugin? { data = Plugins.Get(-index - 1); if (data != NULL && data->GetPluginInterface()->GetInterface() == plugin) @@ -1620,7 +1620,7 @@ BOOL CFilesWindow::CanUnloadPlugin(HWND parent, CPluginInterfaceAbstract* plugin } if (used) { - if (Is(ptZIPArchive) || Is(ptPluginFS)) // archive -> just leave it; plug-in FS -> return to the last disk path + if (Is(ptZIPArchive) || Is(ptPluginFS)) // archive -> just leave it; plugin FS -> return to the last disk path { char path[MAX_PATH]; strcpy(path, GetPath()); @@ -1878,7 +1878,7 @@ void CFilesWindow::StoreGlobalSelection() int totalCount = Dirs->Count + Files->Count; if (clipboard) { - // we should put the list on the clipboard + // put the list on the clipboard // compute the required buffer size (name1CRLFname2CRLF...nameNCRLF) DWORD size = 0; @@ -2140,11 +2140,11 @@ void CFilesWindow::SetAutomaticRefresh(BOOL value, BOOL force) if (force || AutomaticRefresh != value) { AutomaticRefresh = value; - /* // "throwing away" the refresh mark from the directory line - // it crashed here; a destroyed object was called - if (DirectoryLine != NULL) - DirectoryLine->SetAutomatic(AutomaticRefresh); -*/ + /* // removing the refresh flag from the directory line + // it crashed here; a method was called on a destroyed object + if (DirectoryLine != NULL) + DirectoryLine->SetAutomatic(AutomaticRefresh); + */ } } @@ -2244,9 +2244,9 @@ void CFilesWindow::OpenActiveFolder() #ifndef _WIN64 // replace "C:\\Windows\\sysnative\\*" with "C:\\Windows\\system32\\*" on 64-bit systems - // the Explorer process knows nothing about "sysnative", so let's not bother users with it, + // the 64-bit Explorer process knows nothing about "sysnative", so minimize user disruption, // also replace "C:\\Windows\\system32\\*" with "C:\\Windows\\SysWOW64\\*" - // (except for a group of directories excluded from the redirector that thus point back to System32) + // (except for a group of directories excluded from the redirector that thus point back to System32) char dirName[MAX_PATH]; dirName[0] = 0; if (Windows64Bit && WindowsDirectory[0] != 0) From d1967f510fef6d0452c5eb63d64ffa53181e7f12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:22:50 +0200 Subject: [PATCH 401/710] [translation] Fix src/fileswn2.cpp comments Refines translated comments in src/fileswn2.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #865 for src/fileswn2.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/fileswn2.cpp | 234 +++++++++++++++++++++++------------------------ 1 file changed, 117 insertions(+), 117 deletions(-) diff --git a/src/fileswn2.cpp b/src/fileswn2.cpp index 823328a09..133f775cb 100644 --- a/src/fileswn2.cpp +++ b/src/fileswn2.cpp @@ -100,7 +100,7 @@ void CFilesWindow::Execute(int index) BOOL linkIsFile = FALSE; // TRUE -> shortcut to file -> test archive BOOL linkIsNet = FALSE; // TRUE -> shortcut to network -> ChangePathToPluginFS DWORD err = ERROR_SUCCESS; - if (StrICmp(file->Ext, "lnk") == 0) // is it not a directory shortcut? + if (StrICmp(file->Ext, "lnk") == 0) // is this a directory shortcut? { strcpy(fullName, GetPath()); if (!SalPathAppend(fullName, fileName, MAX_PATH)) @@ -129,7 +129,7 @@ void CFilesWindow::Execute(int index) if (link->GetPath(fullName, MAX_PATH, &data, SLGP_UNCPRIORITY) == NOERROR) { // the obtained path will be used for accessibility test, after Resolve it may change err = CheckPath(FALSE, fullName); // fullName is a full path (shortcuts support no other) - if (err != ERROR_USER_TERMINATED) // if user didn't press ESC, ignore the error + if (err != ERROR_USER_TERMINATED) // If the user did not press Esc, ignore the error. { err = ERROR_SUCCESS; // Resolve may change the path, then we check again } @@ -202,7 +202,7 @@ void CFilesWindow::Execute(int index) if (err != ERROR_SUCCESS) { EndStopRefresh(); - return; // path error or aborted + return; // path error or interruption } if (linkIsDir || linkIsNet) // link points to network or directory, path is OK, we switch to it { @@ -236,7 +236,7 @@ void CFilesWindow::Execute(int index) } } BOOL noChange; - if (ChangePathToArchive(fullName, "", -1, NULL, FALSE, &noChange)) // entering the archive successfully + if (ChangePathToArchive(fullName, "", -1, NULL, FALSE, &noChange)) // successfully entered the archive { if (linkIsFile) TopIndexMem.Clear(); // long jump @@ -369,7 +369,7 @@ void CFilesWindow::Execute(int index) } else // failure { - if (!IsTheSamePath(path, GetPath())) // we're not on the original path -> long jump + if (!IsTheSamePath(path, GetPath())) // no longer on the original path -> long jump { // the condition "!noChange" is not enough - it signals "path change or reload - access-denied-dir" TopIndexMem.Clear(); } @@ -430,7 +430,7 @@ void CFilesWindow::Execute(int index) } } } - else // we're shortening path inside archive + else // shorten the path inside the archive { // we split zip-path into new zip-path and prev-dir strcpy(path, GetZIPPath()); @@ -589,7 +589,7 @@ void CFilesWindow::ChangeSortType(CSortType newType, BOOL reverse, BOOL force) } else { - i = Dirs->Count; // we're searching for a file + i = Dirs->Count; // searching for a file count = Dirs->Count + Files->Count; // there was a bug here; count wasn't initialized } @@ -610,7 +610,7 @@ void CFilesWindow::ChangeSortType(CSortType newType, BOOL reverse, BOOL force) if (i < Dirs->Count) { CFileData* d2 = &Dirs->At(i); - if (!lessDirs(*d2, d1, ReverseSort)) // due to sorting this becomes TRUE only at the searched item + if (!lessDirs(*d2, d1, ReverseSort)) // due to sorting, this becomes TRUE at the sought item { if (!lessDirs(d1, *d2, ReverseSort)) focusIndex = i; // condition unnecessary; should be "always true" @@ -623,7 +623,7 @@ void CFilesWindow::ChangeSortType(CSortType newType, BOOL reverse, BOOL force) if (!lessFiles(*d2, d1, ReverseSort)) // due to sorting this becomes TRUE only at the searched item { if (!lessFiles(d1, *d2, ReverseSort)) - focusIndex = i; // condition unnecessary; should be "always true" + focusIndex = i; // unnecessary condition; should always be TRUE break; } } @@ -665,7 +665,7 @@ BOOL CFilesWindow::ChangeToRescuePathOrFixedDrive(HWND parent, BOOL* noChange, B { if (failReason != NULL) *failReason = failReasonInt; - return FALSE; // the issue "cannot close the current path in the panel" won't be solved by switching to a fixed drive (we would just ask about disconnect twice) + return FALSE; // the issue "cannot close the current path in the panel" will not be resolved by switching to a fixed drive (it would only prompt for disconnect twice in a row) } noChangeUsed = TRUE; } @@ -829,8 +829,8 @@ void CFilesWindow::DisconnectNet() if (releaseRight) MainWindow->RightPanel->HandsOff(TRUE); - // Under Windows XP the WNetDisconnectDialog is modeless. Users lost it behind Salamander - // and wondered why accelerators didn't work. When closing Salamander it crashed here + // Under Windows XP, WNetDisconnectDialog is modeless. It could end up behind Salamander, + // and users then wondered why accelerators did not work. When Salamander was closing, it crashed in this method // because MainWindow was NULL; // WNetDisconnectDialog(HWindow, RESOURCETYPE_DISK); @@ -1030,7 +1030,7 @@ BOOL CFilesWindow::SelectViewTemplate(int templateIndex, BOOL canRefreshPath, CViewTemplate* newTemplate = &Parent->ViewTemplates.Items[templateIndex]; if (lstrlen(newTemplate->Name) == 0) { - // undefined view is not desired - we force the detailed view which always exists + // Do not allow an undefined view; force Detailed, which is guaranteed to exist templateIndex = 2; newTemplate = &Parent->ViewTemplates.Items[templateIndex]; } @@ -1066,7 +1066,7 @@ BOOL CFilesWindow::SelectViewTemplate(int templateIndex, BOOL canRefreshPath, ListBox->SetMode(newViewMode, headerLine); } - // we build new columns + // build new columns BuildColumnsTemplate(); CopyColumnsTemplateToColumns(); DeleteColumnsWithoutData(columnValidMask); @@ -1091,7 +1091,7 @@ BOOL CFilesWindow::SelectViewTemplate(int templateIndex, BOOL canRefreshPath, // until ReadDirectory we work with simple icons because the icon geometry changes TemporarilySimpleIcons = TRUE; - // let it compute item sizes and ensure the focused item is visible + // compute item sizes and ensure the focused item is visible RefreshListBox(0, -1, FocusedIndex, FALSE, FALSE); // perform a hard refresh @@ -1212,7 +1212,7 @@ BOOL CFilesWindow::PrepareCloseCurrentPath(HWND parent, BOOL canForce, BOOL canD BOOL someFilesChanged = FALSE; if (AssocUsed) { - // if the user didn't suppress it, we show info about closing an archive that contains edited files + // if the user did not suppress it, show information about closing an archive that contains edited files if (Configuration.CnfrmCloseArchive && !CriticalShutdown) { char title[100]; @@ -1237,10 +1237,10 @@ BOOL CFilesWindow::PrepareCloseCurrentPath(HWND parent, BOOL canForce, BOOL canD } // pack modified files again (only if it's not a critical shutdown) we prepare them for next use UnpackedAssocFiles.CheckAndPackAndClear(parent, &someFilesChanged); - // during critical shutdown we pretend updated files don't exist because there is no time to pack - // them back to the archive. We must not delete them so the user can manually repack them after restart, - // exception is when nothing was edited then everything may be deleted even during - // critical shutdown (it's fast and not confusing for the user with unnecessary questions) + // during critical shutdown, treat updated files as if they did not exist: there is no time to pack + // them back into the archive, but they must not be deleted, so the user still has a chance to pack them + // back into the archive manually after restart; the exception is when nothing was edited, in which case + // everything may be deleted even during critical shutdown (it is fast and minimizes unnecessary prompts) if (!someFilesChanged || !CriticalShutdown) { SetEvent(ExecuteAssocEvent); // start file cleanup @@ -1269,7 +1269,7 @@ BOOL CFilesWindow::PrepareCloseCurrentPath(HWND parent, BOOL canForce, BOOL canD BOOL userAsked = FALSE; CPluginData* plugin = NULL; int index = PackerFormatConfig.GetUnpackerIndex(format); - if (index < 0) // view: is it internal processing (plugin)? + if (index < 0) // note: is this internal processing (plugin)? { plugin = Plugins.Get(-index - 1); if (plugin != NULL) @@ -1292,7 +1292,7 @@ BOOL CFilesWindow::PrepareCloseCurrentPath(HWND parent, BOOL canForce, BOOL canD } } } - if (PackerFormatConfig.GetUsePacker(format)) // supports editing? + if (PackerFormatConfig.GetUsePacker(format)) // does it have an editor? { index = PackerFormatConfig.GetPackerIndex(format); if (index < 0) // is it internal processing (plugin)? @@ -1302,7 +1302,7 @@ BOOL CFilesWindow::PrepareCloseCurrentPath(HWND parent, BOOL canForce, BOOL canD plugin = Plugins.Get(-index - 1); if (plugin != NULL) { - if (!plugin->CanCloseArchive(this, GetZIPArchive(), userForce || CriticalShutdown)) // it refuses to close + if (!plugin->CanCloseArchive(this, GetZIPArchive(), userForce || CriticalShutdown)) // cannot be closed { canclose = FALSE; if (canForce && !userAsked) // we can ask the user whether to force it @@ -1328,7 +1328,7 @@ BOOL CFilesWindow::PrepareCloseCurrentPath(HWND parent, BOOL canForce, BOOL canD { if (Is(ptPluginFS)) { - if (!canForce && !CriticalShutdown) // we can't ask the user about forcing + if (!canForce && !CriticalShutdown) // we cannot ask the user whether to force it { detachFS = FALSE; // to ensure a known value in case the plugin doesn't modify it BOOL r = GetPluginFS()->TryCloseOrDetach(FALSE, canDetach, detachFS, tryCloseReason); @@ -1336,7 +1336,7 @@ BOOL CFilesWindow::PrepareCloseCurrentPath(HWND parent, BOOL canForce, BOOL canD detachFS = FALSE; // verification/correction of the output value return r; } - else // forcing is allowed -> we must close, detaching isn't permitted + else // force-closing is allowed -> we must close; detaching is not permitted { if (GetPluginFS()->TryCloseOrDetach(CriticalShutdown, FALSE, detachFS, tryCloseReason) || // try closing without forceClose==TRUE (except during critical shutdown) CriticalShutdown) @@ -1344,7 +1344,7 @@ BOOL CFilesWindow::PrepareCloseCurrentPath(HWND parent, BOOL canForce, BOOL canD detachFS = FALSE; return TRUE; // closed successfully } - else // ask the user whether to close it against the FS's will + else // ask the user whether to force-close it despite the FS { char path[2 * MAX_PATH]; GetGeneralPath(path, 2 * MAX_PATH); @@ -1500,7 +1500,7 @@ void CFilesWindow::CloseCurrentPath(HWND parent, BOOL cancel, BOOL detachFS, BOO sendDetachEvent = TRUE; // the call mustn't happen here because the FS isn't detached yet (it's still in the panel) } - if (!detachFS) // we're closing the FS; let it deallocate and display final messageboxes + if (!detachFS) // closing the FS; let it deallocate and display the final message boxes { GetPluginFS()->ReleaseObject(parent); } @@ -1519,7 +1519,7 @@ void CFilesWindow::CloseCurrentPath(HWND parent, BOOL cancel, BOOL detachFS, BOO SimplePluginIcons = NULL; } - if (!detachFS) // we're closing the FS + if (!detachFS) // closing the FS { CPluginInterfaceForFSEncapsulation plugin(GetPluginFS()->GetPluginInterfaceForFS()->GetInterface(), GetPluginFS()->GetPluginInterfaceForFS()->GetBuiltForVersion()); @@ -1551,7 +1551,7 @@ void CFilesWindow::RefreshPathHistoryData() CALL_STACK_MESSAGE1("CFilesWindow::RefreshPathHistoryData()"); int index = GetCaretIndex(); - if (index >= 0 && index < Files->Count + Dirs->Count) // bounds check to prevent data inconsistency + if (index >= 0 && index < Files->Count + Dirs->Count) // if the data are still in sync { int topIndex = ListBox->GetTopIndex(); CFileData* file = index < Dirs->Count ? &Dirs->At(index) : &Files->At(index - Dirs->Count); @@ -1681,7 +1681,7 @@ BOOL CFilesWindow::ChangePathToDisk(HWND parent, const char* path, int suggested int errTextID; // if (!SalGetFullName(backup, &errTextID, MainWindow->GetActivePanel()->Is(ptDisk) ? // MainWindow->GetActivePanel()->GetPath() : NULL)) - if (!SalGetFullName(backup, &errTextID, Is(ptDisk) ? GetPath() : NULL)) // for the FTP plugin - relative path in "target panel path" during connect + if (!SalGetFullName(backup, &errTextID, Is(ptDisk) ? GetPath() : NULL)) // because of the FTP plugin: a relative path in "target panel path" when connecting { SalMessageBox(parent, LoadStr(errTextID), LoadStr(IDS_ERRORCHANGINGDIR), MB_OK | MB_ICONEXCLAMATION); @@ -1698,7 +1698,7 @@ BOOL CFilesWindow::ChangePathToDisk(HWND parent, const char* path, int suggested oldCur = SetCursor(LoadCursor(NULL, IDC_WAIT)); BeginStopRefresh(); // no refreshes please -> they would cause recursion - // BOOL firstRun = TRUE; // commented out because forceUpdate is disabled + // BOOL firstRun = TRUE; // commented out because `forceUpdate` is commented out BOOL fixedDrive = FALSE; BOOL canTryUserRescuePath = FALSE; // allows using Configuration.IfPathIsInaccessibleGoTo right before the fixed-drive path BOOL openIfPathIsInaccessibleGoToCfg = FALSE; @@ -1727,33 +1727,33 @@ BOOL CFilesWindow::ChangePathToDisk(HWND parent, const char* path, int suggested BOOL pathInvalid, cut; SalCheckAndRestorePathWithCut(parent, changedPath, tryNet, err, lastErr, pathInvalid, cut, FALSE); if (cut) - { // invalidate proposed listbox settings (we'll list a different path) + { // invalidate the proposed list box settings (we will list a different path) suggestedTopIndex = -1; suggestedFocusName = NULL; } if (!pathInvalid && err == ERROR_SUCCESS) { - /* // commented optimization for cases when the new path matches the old one -> unusual for disks... - if (!forceUpdate && firstRun && Is(ptDisk) && IsTheSamePath(changedPath, GetPath())) - { // no reason to change the path - CloseCurrentPath(parent, TRUE, detachFS, FALSE, isRefresh, FALSE); // "cancel" - remain on the current path - EndStopRefresh(); - if (setWait) SetCursor(oldCur); - if (IsTheSamePath(path, GetPath())) - { - return TRUE; // the new path matches the current path, nothing to do - } - else - { - // shortened path matches the current path - // occurs for example when attempting to enter an inaccessible directory (immediate return) - CheckPath(TRUE, path, lastErr, TRUE, parent); // report the error that caused path shortening - return FALSE; // the requested path is not accessible - } - } - firstRun = FALSE; -*/ + /* // disabled optimization for the case when the new path matches the old one; for drives this was unusual... + if (!forceUpdate && firstRun && Is(ptDisk) && IsTheSamePath(changedPath, GetPath())) + { // no reason to change the path + CloseCurrentPath(parent, TRUE, detachFS, FALSE, isRefresh, FALSE); // "cancel" - stay on the current path + EndStopRefresh(); + if (setWait) SetCursor(oldCur); + if (IsTheSamePath(path, GetPath())) + { + return TRUE; // the new path matches the current path, nothing to do + } + else + { + // the shortened path matches the current path + // this occurs, for example, when trying to enter an inaccessible directory (immediate return) + CheckPath(TRUE, path, lastErr, TRUE, parent); // report the error that caused the path to be shortened + return FALSE; // the requested path is not accessible + } + } + firstRun = FALSE; + */ BOOL updateIcon; updateIcon = !Is(ptDisk) || // simple because forceUpdate is commented out !HasTheSameRootPath(changedPath, GetPath()); @@ -1781,7 +1781,7 @@ BOOL CFilesWindow::ChangePathToDisk(HWND parent, const char* path, int suggested MainWindow->CanAddToDirHistory = oldCanAddToDirHistory; } - // we hide the throbber and security icon; we don't need them on a disk + // hide the throbber and security icon; they are not needed on a disk path if (DirectoryLine != NULL) DirectoryLine->HideThrobberAndSecurityIcon(); @@ -1791,7 +1791,7 @@ BOOL CFilesWindow::ChangePathToDisk(HWND parent, const char* path, int suggested SetPanelType(ptDisk); SetPath(changedPath); if (updateIcon || - !GetNetworkDrive()) // to ensure icons display correctly when switching to a mounted-volume (doesn't slow on local, so hoppefully no issues) + !GetNetworkDrive()) // to ensure the icons display correctly when switching to a mounted volume (it does not slow local access, so it should not cause problems) { UpdateDriveIcon(FALSE); } @@ -1804,7 +1804,7 @@ BOOL CFilesWindow::ChangePathToDisk(HWND parent, const char* path, int suggested cannotList = !CommonRefresh(parent, suggestedTopIndex, suggestedFocusName, refreshListBox, TRUE, isRefresh); if (isRefresh && !cannotList && GetMonitorChanges() && !AutomaticRefresh) { // auto-refresh failure; we verify whether the directory displayed in the panel is being deleted (happened to me while deleting through the network from another machine) ... If ignored, the panel will never refresh (because auto-refresh is broken) - Sleep(400); // we take a break, so the deletion can proceed (so the directory becomes deleted enough to become unlistable) + Sleep(400); // pause briefly so the directory deletion can proceed far enough for listing to fail // TRACE_I("Calling CommonRefresh again... (unable to receive change notifications, first listing was OK, but maybe current directory is being deleted)"); cannotList = !CommonRefresh(parent, suggestedTopIndex, suggestedFocusName, refreshListBox, TRUE, isRefresh); // repeat the listing; this one should fail } @@ -1851,7 +1851,7 @@ BOOL CFilesWindow::ChangePathToDisk(HWND parent, const char* path, int suggested { root[0] = d; if (GetDriveType(root) == DRIVE_FIXED) - break; // we have our "escape drive" + break; // we found our "escape drive" } disks >>= 1; d++; @@ -1861,7 +1861,7 @@ BOOL CFilesWindow::ChangePathToDisk(HWND parent, const char* path, int suggested } if (done) { - if (LowerCase[root[0]] != LowerCase[changedPath[0]]) // prevention againts an infinite loop + if (LowerCase[root[0]] != LowerCase[changedPath[0]]) // guard against an infinite loop { // UNC or another disk (like "c:\") strcpy(changedPath, root); // we'll try our "escape drive" change = TRUE; @@ -1892,7 +1892,7 @@ BOOL CFilesWindow::ChangePathToDisk(HWND parent, const char* path, int suggested if (lastErr != ERROR_SUCCESS && (!isRefresh || openIfPathIsInaccessibleGoToCfg) && shorterPathWarning) { // if it's not a refresh and messages about path-shortening are supposed to be shown ... - if (!refreshListBox) // we'll display a message; we must perform refresh-list-box + if (!refreshListBox) // we are about to display a message, so we must refresh the list box { RefreshListBox(0, -1, -1, FALSE, FALSE); } @@ -1956,7 +1956,7 @@ BOOL CFilesWindow::ChangePathToDisk(HWND parent, const char* path, int suggested } else { - if (!pathInvalid && // the user already knows the UNC path couldn't be revived + if (!pathInvalid && // the user already knows that restoring the UNC path failed err != ERROR_USER_TERMINATED) // the user also knows about the abort (ESC) { CheckPath(TRUE, changedPath, err, TRUE, parent); // other errors - just display the message @@ -2059,7 +2059,7 @@ BOOL CFilesWindow::ChangePathToArchive(const char* archive, const char* archiveP BOOL checkPath = TRUE; BOOL forceUpdateInt = FALSE; // is path change required? (possibly even to disk) BOOL tryPathWithArchiveOnError = isHistory; - if (!Is(ptZIPArchive) || StrICmp(GetZIPArchive(), archive) != 0) // not the archive or a different archive + if (!Is(ptZIPArchive) || StrICmp(GetZIPArchive(), archive) != 0) // not an archive or a different archive { _REOPEN_ARCHIVE: @@ -2082,7 +2082,7 @@ BOOL CFilesWindow::ChangePathToArchive(const char* archive, const char* archiveP CloseCurrentPath(HWindow, TRUE, detachFS, FALSE, isRefresh, FALSE); // failure, stay on the original path if (forceUpdateInt) // a path change is required; opening the archive failed, go back to disk - { // we're certainly in an archive (it's a panel refresh of an archive) + { // we are certainly in an archive (this is a refresh of an archive in the panel) // if possible, exit the archive (possibly all the way to the "fixed-drive") ChangePathToDisk(HWindow, GetPath(), -1, NULL, noChange, refreshListBox, FALSE, isRefresh); } @@ -2109,8 +2109,8 @@ BOOL CFilesWindow::ChangePathToArchive(const char* archive, const char* archiveP if (failReason != NULL) *failReason = CHPPFR_INVALIDPATH; if (tryPathWithArchiveOnError) - tryPathWithArchiveOnError = (err == ERROR_SUCCESS && !pathInvalid); // shorter path is accessible, we'll try it - if (!isRefresh) // during refresh path-shortening messages are not displayed + tryPathWithArchiveOnError = (err == ERROR_SUCCESS && !pathInvalid); // the shorter path is accessible; we will try it + if (!isRefresh) // path-shortening messages are not displayed during refresh { sprintf(text, LoadStr(IDS_FILEERRORFORMAT), archive, GetErrorText(lastErr)); SalMessageBox(HWindow, text, LoadStr(IDS_ERRORTITLE), MB_OK | MB_ICONEXCLAMATION); @@ -2120,7 +2120,7 @@ BOOL CFilesWindow::ChangePathToArchive(const char* archive, const char* archiveP if (PackerFormatConfig.PackIsArchive(archive)) // is it an archive? { - // retrieve file info (does it exist?, size, date & time) + // determine file information (exists?, size, date & time) DWORD err2 = NO_ERROR; HANDLE file = HANDLES_Q(CreateFile(archive, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)); @@ -2178,9 +2178,9 @@ BOOL CFilesWindow::ChangePathToArchive(const char* archive, const char* archiveP isTheSamePath = TRUE; } - // success, switch to the new path - because listing the archive can be time-consuming - // the path changes even if the target path doesn't exist - applies to - // Change Directory (Shift+F7) which otherwise wouldn't change it + // success, switch to the new path; because listing an archive can be time-consuming, + // the path is changed even if the target path does not exist; this applies to the + // Change Directory (Shift+F7) command, which otherwise would not change the path in this situation CloseCurrentPath(HWindow, FALSE, detachFS, isTheSamePath, isRefresh, !isTheSamePath); // we just received a new listing; if there are any reported panel changes, we cancel them @@ -2242,7 +2242,7 @@ BOOL CFilesWindow::ChangePathToArchive(const char* archive, const char* archiveP return FALSE; } } - else // already opened archive + else // archive already open { if (forceUpdate) // should we check whether the archive changed? { @@ -2278,7 +2278,7 @@ BOOL CFilesWindow::ChangePathToArchive(const char* archive, const char* archiveP else { err = GetLastError(); // unable to open the archive file - if (!isRefresh) // during refresh missing-path messages are not displayed + if (!isRefresh) // during refresh, messages about a nonexistent path are not displayed { sprintf(text, LoadStr(IDS_FILEERRORFORMAT), archive, GetErrorText(err)); SalMessageBox(HWindow, text, LoadStr(IDS_ERRORTITLE), MB_OK | MB_ICONEXCLAMATION); @@ -2384,7 +2384,7 @@ BOOL CFilesWindow::ChangePathToArchive(const char* archive, const char* archiveP refreshListBox, TRUE, isRefresh); if (refreshListBox && !ok && useFileName && GetCaretIndex() == 0) - { // attempt to focus a file name failed -> it wasn't a file name + { // Attempt to focus the file name failed; it was not a file name. if (failReason != NULL) *failReason = CHPPFR_SHORTERPATH; } @@ -2425,9 +2425,9 @@ BOOL CFilesWindow::ChangeAndListPathOnFS(const char* fsName, int fsNameIndex, co if (cutFileName != NULL) *cutFileName = 0; char bufFSUserPart[MAX_PATH]; - const char* origUserPart; // user-part to which we switch the path to + const char* origUserPart; // user part to which the path should be changed int origFSNameIndex; - if (fsUserPart == NULL) // detached FS, restoration of the listing... + if (fsUserPart == NULL) // detached FS, restore the listing... { if (!pluginFS.GetCurrentPath(bufFSUserPart)) { @@ -2504,7 +2504,7 @@ BOOL CFilesWindow::ChangeAndListPathOnFS(const char* fsName, int fsNameIndex, co forceUpdate, mode); if (changePathRet) // ChangePath doesn't return an error { - if (StrICmp(newFSName, fsName) != 0) // fs-name change, verify the new fs-name + if (StrICmp(newFSName, fsName) != 0) // FS name changed; verify the new FS name { BOOL ok2 = FALSE; int index; @@ -2535,7 +2535,7 @@ BOOL CFilesWindow::ChangeAndListPathOnFS(const char* fsName, int fsNameIndex, co fsNameIndex = newFSNameIndex; } } - if (changePathRet) // store the used fs-name in 'pluginFS' + if (changePathRet) // store the fs-name in 'pluginFS' pluginFS.SetPluginFS(fsName, fsNameIndex); } @@ -2557,7 +2557,7 @@ BOOL CFilesWindow::ChangeAndListPathOnFS(const char* fsName, int fsNameIndex, co break; } - if (keepOldListing == NULL || !*keepOldListing) // not dead-code (used when allocating workDir fails) + if (keepOldListing == NULL || !*keepOldListing) // not dead code (used when workDir allocation fails) { // release listing data in the panel if (UseSystemIcons || UseThumbnails) @@ -2578,7 +2578,7 @@ BOOL CFilesWindow::ChangeAndListPathOnFS(const char* fsName, int fsNameIndex, co } // attempt to list files and directories from the current path - if (pluginFS.ListCurrentPath(workDir, pluginData, pluginIconsType, forceUpdate)) // succeeded ... + if (pluginFS.ListCurrentPath(workDir, pluginData, pluginIconsType, forceUpdate)) // completed successfully... { if (keepOldListing != NULL && *keepOldListing) // we already have the new listing; discard the old one { @@ -2609,7 +2609,7 @@ BOOL CFilesWindow::ChangeAndListPathOnFS(const char* fsName, int fsNameIndex, co TRACE_E("Invalid plugin-icons-type!"); pluginIconsType = pitSimple; } - if (pluginIconsType == pitFromPlugin && pluginData == NULL) // not allowed, degrade the type + if (pluginIconsType == pitFromPlugin && pluginData == NULL) // this would not work; fall back to a simpler type { TRACE_E("Plugin-icons-type is pitFromPlugin and plugin-data is NULL!"); pluginIconsType = pitSimple; @@ -2620,7 +2620,7 @@ BOOL CFilesWindow::ChangeAndListPathOnFS(const char* fsName, int fsNameIndex, co } // we prepare dir for further use (release leftovers if the plugin left any) workDir->Clear(NULL); - // path isn't o.k.; we'll try shortening it in the next cycle pass + // the path is not OK; we will try to shorten it in the next loop iteration if (!pluginFS.GetCurrentPath(user)) { TRACE_E("Unexpected situation in CFilesWindow::ChangeAndListPathOnFS()"); @@ -2631,7 +2631,7 @@ BOOL CFilesWindow::ChangeAndListPathOnFS(const char* fsName, int fsNameIndex, co { TRACE_I("Unable to open FS path " << fsName << ":" << origUserPart); - if (firstCall && (keepOldListing == NULL || !*keepOldListing)) // not dead-code (used when allocating workDir fails) + if (firstCall && (keepOldListing == NULL || !*keepOldListing)) // not dead code (used when workDir allocation fails) { // release listing data in the panel if (UseSystemIcons || UseThumbnails) @@ -2656,11 +2656,11 @@ BOOL CFilesWindow::ChangeAndListPathOnFS(const char* fsName, int fsNameIndex, co if (dir != workDir) delete workDir; // 'workDir' wasn't used, free it - // we try to find a file to focus in the FS listing - not perfect when the file is hidden - // from the panel listing (e.g., "don't show hidden files" or filters) because it cannot - // be focused and the user won't know about this "error" - but it's probably - // not really an error if the file does exist, so we ignore it (same as with - // disk paths)... + // Attempts to find the file to focus in the FS listing; this is not perfect if the file is hidden + // from the panel listing (for example by "don't show hidden files" or by filters), because then it + // cannot be focused in the panel and the user will not learn about this "error"; however, it is + // probably not possible to report it as an error when the file actually exists, so it is ignored + // (as with disk paths)... if (ok && useCutFileName && cutFileName != NULL && *cutFileName != 0) { CFilesArray* files = dir->GetFiles(""); @@ -2748,7 +2748,7 @@ BOOL CFilesWindow::ChangePathToPluginFS(const char* fsName, const char* fsUserPa char cutFileNameBuf[MAX_PATH]; int fsNameIndex; if (!Is(ptPluginFS) || !IsPathFromActiveFS(fsName, fsUserPart2, fsNameIndex, convertPathToInternal)) - { // is not FS or the path is from a different FS (even within a single plug-in - one FS name) + { // is not FS or the path is from a different FS (even within a single plugin - one FS name) BOOL detachFS; if (PrepareCloseCurrentPath(HWindow, FALSE, TRUE, detachFS, FSTRYCLOSE_CHANGEPATH)) { // the current path can be closed, attempt to open the new path @@ -2757,12 +2757,12 @@ BOOL CFilesWindow::ChangePathToPluginFS(const char* fsName, const char* fsUserPa *failReason = CHPPFR_INVALIDPATH; if (Plugins.IsPluginFS(fsName, index, fsNameIndex)) // find the plugin index { - // obtain the plug-in containing the FS + // obtain the plugin containing the FS CPluginData* plugin = Plugins.Get(index); if (plugin != NULL) { // open the new FS - // load the plug-in before obtaining DLLName, Version, and plugin interfaces + // load the plugin before obtaining DLLName, Version, and plugin interfaces CPluginFSInterfaceAbstract* auxFS = plugin->OpenFS(fsName, fsNameIndex); CPluginFSInterfaceEncapsulation pluginFS(auxFS, plugin->DLLName, plugin->Version, plugin->GetPluginInterfaceForFS()->GetInterface(), @@ -2980,8 +2980,8 @@ BOOL CFilesWindow::ChangePathToPluginFS(const char* fsName, const char* fsUserPa { suggestedFocusName = NULL; - // the new path shortened back to the original ("unlistable subdirectory"), - // keep topIndex and focusName from before the operation starts (so the user doesn't lose focus) + // the new path shortened back to the original path ("unlistable subdirectory"); preserve + // topIndex and focusName from before the operation so the user does not lose focus if (currentPathOK && GetPluginFS()->IsCurrentPath(GetPluginFS()->GetPluginFSNameIndex(), currentPathFSNameIndex, currentPath)) @@ -3022,7 +3022,7 @@ BOOL CFilesWindow::ChangePathToPluginFS(const char* fsName, const char* fsUserPa } else { - if (shorterPath && cutFileName != NULL && *cutFileName != 0 && refreshListBox) // the file needs to be focused + if (shorterPath && cutFileName != NULL && *cutFileName != 0 && refreshListBox) // focus the file { int focusIndexCase = -1; int focusIndexIgnCase = -1; @@ -3058,7 +3058,7 @@ BOOL CFilesWindow::ChangePathToPluginFS(const char* fsName, const char* fsUserPa } } - if (focusIndexIgnCase != -1) // at least one file was found with potencial case difference + if (focusIndexIgnCase != -1) // at least one file with a possible case difference was found { SetCaretIndex(focusIndexCase != -1 ? focusIndexCase : focusIndexIgnCase, FALSE); } @@ -3067,7 +3067,7 @@ BOOL CFilesWindow::ChangePathToPluginFS(const char* fsName, const char* fsUserPa ok = TRUE; } - else // requested path is not accessible, try returning to the original path + else // requested path is not accessible, try to return to the original path { if (noChange != NULL) *noChange = FALSE; // the listing will be cleared or changed @@ -3077,8 +3077,8 @@ BOOL CFilesWindow::ChangePathToPluginFS(const char* fsName, const char* fsUserPa *GetPluginFS(), GetPluginFSDir(), pluginData, shorterPath, pluginIconsType, mode, FALSE, NULL, NULL, -1, FALSE, NULL, &keepOldListing)) - { // success, the original path (or its subpath) was listed - // invalidate proposed listbox settings (we'll list a different path) + { // success, the original path (or one of its subpaths) was listed + // invalidate the proposed list box settings (we will list a different path) suggestedTopIndex = -1; suggestedFocusName = NULL; @@ -3092,7 +3092,7 @@ BOOL CFilesWindow::ChangePathToPluginFS(const char* fsName, const char* fsUserPa // add the path we just left (paths inside the FS remain open, // so DirHistoryAddPathUnique hasn't been called yet) - if (currentPathOK && shorterPath) // if shorterPath is FALSE, the path didn't change... + if (currentPathOK && shorterPath) // if shorterPath is FALSE, the path did not change... { if (UserWorkedOnThisPath) { @@ -3140,7 +3140,7 @@ BOOL CFilesWindow::ChangePathToPluginFS(const char* fsName, const char* fsUserPa // notify the FS that the path changed GetPluginFS()->Event(FSE_PATHCHANGED, GetPanelCode()); } - else // show an empty panel, nothing can be read from the FS, switch to the fixed drive + else // show an empty panel; nothing can be loaded from the FS, switch to the fixed drive { if (keepOldListing) { @@ -3152,14 +3152,14 @@ BOOL CFilesWindow::ChangePathToPluginFS(const char* fsName, const char* fsUserPa ListBox->SetItemsCount(0, 0, 0, TRUE); SelectedCount = 0; } - else // not dead-code, see 'workDir' allocation error in ChangeAndListPathOnFS() + else // not dead code; see the 'workDir' allocation error in ChangeAndListPathOnFS() { // clean the message queue from buffered WM_USER_UPDATEPANEL MSG msg2; PeekMessage(&msg2, HWindow, WM_USER_UPDATEPANEL, WM_USER_UPDATEPANEL, PM_REMOVE); } - // we hide the throbber and security icon; because we're leaving the FS... + // hide the throbber and security icon because we are leaving the FS... if (DirectoryLine != NULL) DirectoryLine->HideThrobberAndSecurityIcon(); @@ -3397,7 +3397,7 @@ BOOL CFilesWindow::ChangePathToDetachedFS(int fsIndex, int suggestedTopIndex, } else { - if (closeDetachedFS) // no path can be opened on the FS anymore, close it + if (closeDetachedFS) // No path can be opened in this FS anymore; close it { BOOL dummy; if (pluginFS->TryCloseOrDetach(FALSE, FALSE, dummy, FSTRYCLOSE_ATTACHFAILURE)) @@ -3438,10 +3438,10 @@ void CFilesWindow::RefreshDiskFreeSpace(BOOL check, BOOL doNotRefreshOtherPanel) if (!doNotRefreshOtherPanel) { - // if the other panel uses a path with the same root, we refresh - // disk-free-space there as well (it is not perfect - ideally we would - // test whether both paths are on the same volume, but that would be too slow; - // this simplification should be more than enough for normal use) + // if the path in the other panel has the same root, refresh the + // disk free space there as well (this is not perfect; ideally we would + // test whether the paths are on the same volume, but that would be too slow; + // this simplification is more than sufficient for normal use) CFilesWindow* otherPanel = (MainWindow->LeftPanel == this) ? MainWindow->RightPanel : MainWindow->LeftPanel; if (otherPanel->Is(ptDisk) && HasTheSameRootPath(GetPath(), otherPanel->GetPath())) otherPanel->RefreshDiskFreeSpace(TRUE, TRUE /* otherwise we'd recurse endlessly */); @@ -3491,7 +3491,7 @@ void GetCommonFileTypeStr(char* buf, int* resLen, const char* ext) *d++ = UpperCase[*ext++]; *d = 0; if (*ext == 0 && uppercaseExt[0] != 0) - { // we have the entire extension in uppercase (no spaces and shorter than MAX_PATH) + it is not empty + { // we have the entire extension in uppercase (it contains no spaces, is shorter than MAX_PATH, and is not empty) *resLen = _snprintf_s(buf, TRANSFER_BUFFER_MAX, _TRUNCATE, CommonFileTypeName2, uppercaseExt); if (*resLen < 0) *resLen = TRANSFER_BUFFER_MAX - 1; // _snprintf_s reports truncation to the buffer size @@ -3816,7 +3816,7 @@ void CFilesWindow::RefreshListBox(int suggestedXOffset, if (autoWidthColumns & VIEW_SHOW_TYPE) { //--- file-type - if (!isDir) // it is a file + if (!isDir) // file { char buf[TRANSFER_BUFFER_MAX]; BOOL commonFileType = TRUE; @@ -3831,7 +3831,7 @@ void CFilesWindow::RefreshListBox(int suggestedXOffset, if (Associations.GetIndex(buf, index)) { src = Associations[index].Type; - if (src != NULL) // if it is not an empty string + if (src != NULL) // if the string is not empty { commonFileType = FALSE; GetTextExtentPoint32(dc, src, (int)strlen(src), &act); @@ -3851,7 +3851,7 @@ void CFilesWindow::RefreshListBox(int suggestedXOffset, columnWidthType = act.cx; } } - else // it is a directory + else // directory { if (!dirTypeDone) // only if we have not computed it yet { @@ -4069,11 +4069,11 @@ void CFilesWindow::RefreshListBox(int suggestedXOffset, if (suggestedFocusIndex != -1) { FocusedIndex = suggestedFocusIndex; - // if no TopIndex is suggested or focus visibility - // is required, compute a new TopIndex + // if no TopIndex is suggested or focus visibility is required, + // compute a new TopIndex // -- clearer version with support for vmIcons and vmThumbnails - // -- change for partially visible items: previously TopIndex was recalculated - // and causing unnecessary jumps; now we keep TopIndex unchanged + // -- change for partially visible items: TopIndex used to be recalculated + // and caused unnecessary jumps; now we leave TopIndex unchanged BOOL findTopIndex = TRUE; // TRUE - search for TopIndex; FALSE - keep the current one if (suggestedTopIndex != -1) @@ -4106,7 +4106,7 @@ void CFilesWindow::RefreshListBox(int suggestedXOffset, { if (suggestedTopIndex + cols * ListBox->EntireItemsInColumn <= suggestedFocusIndex) - break; // focus lies past the panel, must find a better TopIndex + break; // focus lies past the panel; we must find a better TopIndex } // focus is at least partially visible, skip TopIndex search @@ -4128,12 +4128,12 @@ void CFilesWindow::RefreshListBox(int suggestedXOffset, if (wholeItemVisible) { if (suggestedTopIndex + rows <= suggestedFocusIndex + 1) // avoid partial visibility, hence the +1 - break; // focus lies below the panel, we must find a better TopIndex + break; // focused item lies below the panel; we need to find a better TopIndex } else { if (suggestedTopIndex + rows <= suggestedFocusIndex) - break; // focus lies below the panel, we must find a better TopIndex + break; // the focus is below the panel; we need to find a better TopIndex } // focus is fully visible, skip TopIndex search @@ -4153,7 +4153,7 @@ void CFilesWindow::RefreshListBox(int suggestedXOffset, if (wholeItemVisible) { if (suggestedTop < suggestedTopIndex) - break; // focus is above the panel; we must find a better TopIndex + break; // focus lies above the panel, we must find a better TopIndex if (suggestedBottom > suggestedTopIndex + ListBox->FilesRect.bottom - ListBox->FilesRect.top) @@ -4162,7 +4162,7 @@ void CFilesWindow::RefreshListBox(int suggestedXOffset, else { if (suggestedBottom <= suggestedTopIndex) - break; // focus is above the panel; we must find a better TopIndex + break; // focus lies above the panel, we must find a better TopIndex if (suggestedTop >= suggestedTopIndex + ListBox->FilesRect.bottom - ListBox->FilesRect.top) @@ -4208,7 +4208,7 @@ void CFilesWindow::RefreshListBox(int suggestedXOffset, // (e.g., Back in history to a place where the previously focused file no longer exists) if (ensureFocusIndexVisible && suggestedTopIndex != -1) // focus must be visible { - suggestedTopIndex = -1; // cannot set top-index (the focus wouldn't be visible) + suggestedTopIndex = -1; // cannot set the top index (the focus would not be visible) } } From 5ff030b97767a7923372a08d68b0d98db3790e1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:23:05 +0200 Subject: [PATCH 402/710] [translation] Fix src/fileswn4.cpp comments Refines translated comments in src/fileswn4.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #867 for src/fileswn4.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/fileswn4.cpp | 58 ++++++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/src/fileswn4.cpp b/src/fileswn4.cpp index a28d08622..bf34f3794 100644 --- a/src/fileswn4.cpp +++ b/src/fileswn4.cpp @@ -238,17 +238,17 @@ void CFilesWindow::DrawIcon(HDC hDC, CFileData* f, BOOL isDir, BOOL isItemUpDir, } } } - else // it's a file + else // file { int index; BOOL exceptions = *(DWORD*)lowerExtension == *(DWORD*)"scr" || // icons in the file, - *(DWORD*)lowerExtension == *(DWORD*)"pif" || // even though it isn't visible + *(DWORD*)lowerExtension == *(DWORD*)"pif" || // even though it is not visible in the Registry *(DWORD*)lowerExtension == *(DWORD*)"lnk"; // in the Registry - if (exceptions || Associations.GetIndex(lowerExtension, index)) // the extension has an icon (association) + if (exceptions || Associations.GetIndex(lowerExtension, index)) // the extension has an associated icon { if (!exceptions) - TransferAssocIndex = index; // remember the valid index in Associations + TransferAssocIndex = index; // store the valid index in Associations if (exceptions || Associations[index].GetIndex(iconSize) < 0) // dynamic icon (from the file) or a loaded static icon { // icon in the file int icon; @@ -316,7 +316,7 @@ void CFilesWindow::DrawIcon(HDC hDC, CFileData* f, BOOL isDir, BOOL isItemUpDir, if (!IconCache->GetIndex(NULL /*fileName*/, icon, &PluginData, f) || // the icon-thread isn't loading it IconCache->At(icon).GetFlag() != 1 && IconCache->At(icon).GetFlag() != 2 || // neither new nor old icon is loaded !IconCache->GetIcon(IconCache->At(icon).GetIndex(), &iconList, &iconListIndex)) // failed to obtain its icon - { // we will display a simple symbol from the plug-in + { // we will display a simple symbol from the plugin // the simple icon index will be obtained via the GetPluginIconIndex callback TransferFileData = f; TransferIsDir = isDir ? (isItemUpDir ? 2 : 1) : 0; @@ -495,9 +495,9 @@ void CFilesWindow::DrawBriefDetailedItem(HDC hTgtDC, int itemIndex, RECT* itemRe // TRACE_I("DrawingSmall itemIndex="<Ext[0] == 0 || f->Ext <= f->Name + 1) // empty value in the Ext column (exception for names like ".htaccess", which are shown in the Name column even though they look like extensions) TransferLen = 0; else { @@ -850,7 +850,7 @@ void CFilesWindow::DrawBriefDetailedItem(HDC hTgtDC, int itemIndex, RECT* itemRe ExtTextOut(hDC, r.left, y, ETO_OPAQUE, &adjR, "", 0, NULL); // just clearing else { - if (column->FixedWidth == 1) // NarrowedNameColumn does not apply here (not Name column) + if (column->FixedWidth == 1) // NarrowedNameColumn does not apply here (this is not the Name column) { int fitChars; // for fixed-width columns we must check whether the entire text fits @@ -954,7 +954,7 @@ void CFilesWindow::DrawBriefDetailedItem(HDC hTgtDC, int itemIndex, RECT* itemRe DrawFocusRect(hDC, &r, (f->Selected == 1), Parent->EditMode); /* - // for debugging the dual cursor issue we need to distinguish normal focus and drop target + // to debug the two-cursor bug, we need to distinguish normal focus from the drop target if (itemIndex == DropTargetIndex) { MoveToEx(hDC, r.left, r.top + 3, NULL); @@ -1002,7 +1002,7 @@ void SplitText(HDC hDC, const char* text, int textLen, int* maxWidth, char* out2, int* out2Len, int* out2Width) { SIZE sz; - // measure the width of every character + // measure the widths of all characters GetTextExtentExPoint(hDC, text, textLen, 0, NULL, DrawItemAlpDx, &sz); if (sz.cx > *maxWidth) @@ -1017,7 +1017,7 @@ void SplitText(HDC hDC, const char* text, int textLen, int* maxWidth, int maxW = *maxWidth; int w = 0; int index = 0; - while (index < maxW) // this condition should not be applied + while (index < maxW) // this condition should not apply { if (text[index] == ' ') lastSpaceIndex = index; @@ -1061,7 +1061,7 @@ void SplitText(HDC hDC, const char* text, int textLen, int* maxWidth, if (*out1Len >= 3) memmove(out1 + *out1Len - 3, "...", 3); - // look for a space where we can continue to the next line + // look for a space where we can break to the next line while (index < textLen) { if (text[index++] == ' ') @@ -1180,7 +1180,7 @@ void CFilesWindow::DrawIconThumbnailItem(HDC hTgtDC, int itemIndex, RECT* itemRe BOOL isItemFocusedOrEditMode = FALSE; if (FocusedIndex == itemIndex) // drawing the cursor { - if (FocusVisible || Parent->EditMode && Parent->GetActivePanel() == this) // switched in the command-line + if (FocusVisible || Parent->EditMode && Parent->GetActivePanel() == this) // switched to the command line isItemFocusedOrEditMode = TRUE; } @@ -1295,7 +1295,7 @@ void CFilesWindow::DrawIconThumbnailItem(HDC hTgtDC, int itemIndex, RECT* itemRe // outer rectangle from which we clear towards the inner one RECT outerRect = rect; - // rectangle we will clear to + // rectangle towards which we will clear RECT innerRect; BOOL thickFrame = FALSE; // for Thumbnails only -- should the frame be doubled? if (GetViewMode() == vmThumbnails) @@ -1485,7 +1485,7 @@ void CFilesWindow::DrawIconThumbnailItem(HDC hTgtDC, int itemIndex, RECT* itemRe y = outerRect.top + 4; } - // inner rectangle we clear towards + // inner rectangle towards which we clear RECT r; r.left = rect.left + (itemWidth - maxWidth) / 2 - 2; r.top = y - 2; @@ -1495,10 +1495,10 @@ void CFilesWindow::DrawIconThumbnailItem(HDC hTgtDC, int itemIndex, RECT* itemRe r.bottom += FontCharHeight; // clear the background around the text - if ((drawFlags & DRAWFLAG_MASK) == 0) // when drawing the mask (b&w), the background color must not be painted + if ((drawFlags & DRAWFLAG_MASK) == 0) // When drawing the mask (B&W), do not draw the background color FillIntersectionRegion(hDC, &outerRect, &r); - if (drawFocusFrame) // if there won't be a frame displayed, reduce the area by it + if (drawFocusFrame) // if the focus frame will be drawn, shrink the area for it InflateRect(&r, -1, -1); int oldRTop = r.top; @@ -1556,7 +1556,7 @@ void TruncateSringToFitWidth(HDC hDC, char* buffer, int* bufferLen, int maxTextW // search from the end for the character after which we can copy "..." and it fits in the column while (fitChars > 0 && DrawItemAlpDx[fitChars - 1] + TextEllipsisWidth > maxTextWidth) fitChars--; - // copy part of the original string to another buffer + // copy part of the original string within the buffer if (fitChars > 0) { // and append "..." @@ -1739,9 +1739,9 @@ void CFilesWindow::DrawTileItem(HDC hTgtDC, int itemIndex, RECT* itemRect, DWORD // TRACE_I("DrawTileItem itemIndex="<HWindow, TRUE); DestroySafeWaitWindow(); - // if Salamander is active, call SetFocus on the remembered window (SetFocus doesn't work - // when the main window is disabled - after reactivation/activation of the disabled main window - // the active panel lacks focus) + // if Salamander is active, call SetFocus on the remembered window (SetFocus does not work + // when the main window is disabled; after deactivation and reactivation of the disabled main window, + // the active panel does not have focus) HWND hwnd = GetForegroundWindow(); while (hwnd != NULL && hwnd != MainWindow->HWindow) hwnd = GetParent(hwnd); @@ -1062,7 +1062,7 @@ void CFilesWindow::DropCopyMove(BOOL copy, char* targetPath, CCopyMoveData* data BOOL occupiedSpTooBig = script->OccupiedSpace != CQuadWord(0, 0) && script->BytesPerCluster != 0 && // we have disk information script->OccupiedSpace > script->FreeSpace && - !IsSambaDrivePath(targetPath); // Samba returns an invalid cluster size, so we can rely only on TotalFileSize + !IsSambaDrivePath(targetPath); // Samba returns a bogus cluster size, so we can only rely on TotalFileSize if (occupiedSpTooBig || script->BytesPerCluster != 0 && // we have disk information script->TotalFileSize > script->FreeSpace) @@ -1242,7 +1242,7 @@ BOOL CFilesWindow::BuildScriptMain(COperations* script, CActionType type, BOOL targetIsFAT32 = FALSE; CTargetPathState targetPathState = tpsUnknown; DWORD srcAndTgtPathsFlags = 0; // flags only for Copy and Move - if (type == atMove || type == atCopy) // outside Copy and Move it makes no sense to check + if (type == atMove || type == atCopy) // It makes no sense to check this outside Copy and Move { sourceSupADS = (filterCriteria == NULL || !filterCriteria->IgnoreADS) && IsPathOnVolumeSupADS(sourcePath, NULL); @@ -1269,7 +1269,7 @@ BOOL CFilesWindow::BuildScriptMain(COperations* script, CActionType type, char dummy2[MAX_PATH]; if (MyGetVolumeInformation(targetPath, NULL, NULL, NULL, NULL, 0, NULL, &dummy1, &flags, dummy2, MAX_PATH) && (flags & FS_PERSISTENT_ACLS) == 0) - { // wants to copy permissions, but the target path doesn't support them, so we inform the user (the API function for setting security doesn't report any errors — which is poor design) + { // permissions are to be copied, but the target path does not support them, so inform the user (the API function for setting security reports no errors) int res = SalMessageBox(HWindow, LoadStr(IDS_ACLNOTSUPPORTEDONTGTPATH), LoadStr(IDS_QUESTION), MB_YESNO | MB_ICONQUESTION | MSGBOXEX_ESCAPEENABLED); UpdateWindow(MainWindow->HWindow); @@ -1313,7 +1313,7 @@ BOOL CFilesWindow::BuildScriptMain(COperations* script, CActionType type, if (selCount > 0 || oneFile != NULL) { - if (type == atMove || type == atCopy) // outside Copy and Move it makes no sense to check + if (type == atMove || type == atCopy) // checking this only makes sense for Copy and Move { DWORD d1, d2, d3, d4; if (MyGetDiskFreeSpace(targetPath, &d1, &d2, &d3, &d4)) @@ -1335,7 +1335,7 @@ BOOL CFilesWindow::BuildScriptMain(COperations* script, CActionType type, } i++; // oneFile points to the selected or caret item in the filebox - if (oneFile->Attr & FILE_ATTRIBUTE_DIRECTORY) // jde o ptDisk + if (oneFile->Attr & FILE_ATTRIBUTE_DIRECTORY) // this is ptDisk { if (subDirectories) { @@ -1380,7 +1380,7 @@ BOOL CFilesWindow::BuildScriptMain(COperations* script, CActionType type, } else { - if ((op.TargetName = BuildName(sourcePath, oneFile->Name)) == NULL) // too long name already handled by previous condition + if ((op.TargetName = BuildName(sourcePath, oneFile->Name)) == NULL) // the previous condition already handles names that are too long { free(op.SourceName); SetCurrentDirectoryToSystem(); @@ -1492,7 +1492,7 @@ void GetADSStreamsNames(char* listBuf, int bufSize, char* fileName, BOOL isDir) free(streamNames); } - if (bufSize > 0 && (StrICmp(listBuf, "Zone.Identifier") == 0 || // this stream is automatically created by XP SP2 and should be ignored, so we won't bother the user with it + if (bufSize > 0 && (StrICmp(listBuf, "Zone.Identifier") == 0 || // this stream is automatically created by Windows XP SP2 and should be ignored, so it is not shown to the user StrICmp(listBuf, "encryptable") == 0)) // this stream appears mostly on thumbs.db, nobody knows what it is, but Windows creates it, so we ignore it too { listBuf[0] = 0; @@ -1531,7 +1531,7 @@ BOOL CFilesWindow::BuildScriptDir(COperations* script, CActionType type, char* s else st = sourceEnd; if (st - sourcePath + strlen(dirName) >= MAX_PATH - 2) // -2 determined experimentally (longer paths cannot be listed) - { // data are on disk, which doesn't mean they can't exceed MAX_PATH + { // the data is on disk, which does not mean it cannot exceed MAX_PATH *sourceEnd = 0; // restoring original sourcePath _snprintf_s(text, _TRUNCATE, LoadStr(IDS_NAMEISTOOLONG), dirName, sourcePath); BOOL skip = TRUE; @@ -1544,8 +1544,8 @@ BOOL CFilesWindow::BuildScriptDir(COperations* script, CActionType type, char* s params.Caption = LoadStr(IDS_ERRORBUILDINGSCRIPT); params.Text = text; char aliasBtnNames[200]; - /* used by export_mnu.py script that generates salmenu.mnu for the Translator - we let the msgbox buttons resolve hotkey collisions by simulating that it is a menu + /* used by the export_mnu.py script, which generates salmenu.mnu for the Translator + for msgbox buttons, let hotkey collisions be resolved by simulating a menu MENU_TEMPLATE_ITEM MsgBoxButtons[] = { {MNTT_PB, 0 @@ -1588,9 +1588,9 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = char* s2; if (mapName == NULL) { - // Petr: a bit of a hack: the *.* mask doesn't produce a copy of the source name, which is a problem when copying - // directories with invalid names, e.g. "c ..." + "*.*" = "c ", so we'll help ourselves a bit and - // change the mask to NULL = a simple textual copy of the name + // Petr: a bit of a hack: the *.* mask does not create a copy of the source name, which is a problem when copying + // directories with invalid names, e.g. "c ..." + "*.*" = "c ", so the mask is changed + // to NULL, i.e. a simple textual copy of the name char* opMask = mask != NULL && strcmp(mask, "*.*") == 0 ? NULL : mask; s2 = MaskName(finalName, 2 * MAX_PATH + 200, dirName, opMask); if (opMask != NULL) @@ -1613,8 +1613,8 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = params.Caption = LoadStr(IDS_ERRORBUILDINGSCRIPT); params.Text = text; char aliasBtnNames[200]; - /* used by export_mnu.py script that generates salmenu.mnu for the Translator - we let the msgbox buttons resolve hotkey collisions by simulating that it is a menu + /* used by the export_mnu.py script, which generates salmenu.mnu for Translator + for message box buttons, hotkey collisions are resolved by simulating a menu MENU_TEMPLATE_ITEM MsgBoxButtons[] = { {MNTT_PB, 0 @@ -1674,7 +1674,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = int res = SalMessageBox(MainWindow->HWindow, text, LoadStr(IDS_QUESTION), MB_YESNOCANCEL | MB_ICONQUESTION); UpdateWindow(MainWindow->HWindow); - if (res == IDNO || res == IDCANCEL) // if CANCEL or NO was chosen, we end or skip the directory + if (res == IDNO || res == IDCANCEL) // if CANCEL or NO was chosen, stop or skip the directory { *sourceEnd = 0; // restoring sourcePath if (targetEnd != NULL) @@ -1754,7 +1754,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = { srcAndTgtPathsFlags &= ~(OPFL_SRCPATH_IS_NET | OPFL_SRCPATH_IS_FAST); srcAndTgtPathsFlags |= GetPathFlagsForCopyOp(sourcePath, OPFL_SRCPATH_IS_NET, OPFL_SRCPATH_IS_FAST); - if (targetPathState == tpsEncryptedExisting || targetPathState == tpsNotEncryptedExisting) // target directory exists, get to know its flags (otherwise inherit flags from the parent target directory) + if (targetPathState == tpsEncryptedExisting || targetPathState == tpsNotEncryptedExisting) // target directory exists, determine its flags (otherwise keep the flags from the parent target directory) { srcAndTgtPathsFlags &= ~(OPFL_TGTPATH_IS_NET | OPFL_TGTPATH_IS_FAST); srcAndTgtPathsFlags |= GetPathFlagsForCopyOp(targetPath, OPFL_TGTPATH_IS_NET, OPFL_TGTPATH_IS_FAST); @@ -1812,7 +1812,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = } dirCreated = TRUE; } - else // copying to a non-NTFS filesystem (prompt to discard ADS) + else // copying to a filesystem other than NTFS (prompt to drop ADS) { int res; if (ConfirmADSLossAll) @@ -1889,8 +1889,8 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = params.Caption = LoadStr(IDS_ERRORTITLE); params.Text = text; char aliasBtnNames[200]; - /* used by export_mnu.py script that generates salmenu.mnu for the Translator - we let the msgbox buttons resolve hotkey collisions by simulating that it is a menu + /* used by the export_mnu.py script that generates salmenu.mnu for the Translator + for message box buttons, resolve hotkey collisions by simulating a menu MENU_TEMPLATE_ITEM MsgBoxButtons[] = { {MNTT_PB, 0 @@ -1952,7 +1952,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = { op.Opcode = ocCreateDir; op.OpFlags = checkNewDirName ? 0 : OPFL_IGNORE_INVALID_NAME; - if (!script->CopyAttrs && // when copying attributes, the heuristic for setting the Encrypted attribute is skipped + if (!script->CopyAttrs && // when copying attributes, the heuristic for setting the Encrypted attribute does not apply ((sourceDirAttr & FILE_ATTRIBUTE_ENCRYPTED) || targetPathState == tpsEncryptedExisting || targetPathState == tpsEncryptedNotExisting)) { @@ -2008,7 +2008,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = BOOL copyMoveDirIsLink = FALSE; BOOL copyMoveSkipLinkContent = FALSE; - if ((type == atCopy || type == atMove) && // if it's a link, determine whether to skip or copy its content + if ((type == atCopy || type == atMove) && // if it is a link, determine whether to skip or copy its content (sourceDirAttr & FILE_ATTRIBUTE_REPARSE_POINT)) { copyMoveDirIsLink = TRUE; @@ -2069,7 +2069,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = //--- build the path to sourceDirName and start searching for contained files BOOL delDirectory = TRUE; // delete a non-empty directory? BOOL delDirectoryReturn = TRUE; // return value when a non-empty directory isn't removed - BOOL canDelDirAfterMove = TRUE; // Move only: FALSE if not everything is moved (filter skipped something), source directory can't be removed (won't be empty) + BOOL canDelDirAfterMove = TRUE; // Move only: FALSE if not everything is moved (the filter skipped something); the source directory cannot be removed because it will not be empty if (!copyMoveDirIsLink || !copyMoveSkipLinkContent) { WIN32_FIND_DATA f; @@ -2080,7 +2080,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = { DWORD err = GetLastError(); if (err == ERROR_PATH_NOT_FOUND && type == atCountSize && dirDOSName != NULL && strcmp(dirName, dirDOSName) != 0) - { // workaround for computing the size of a directory that must be accessed via DOS-name when we can't handle the UNICODE name (the multibyte version converted back to UNICODE doesn't match the original) + { // workaround for computing the size of a directory that must be accessed via a DOS name when the Unicode name cannot be used (the multibyte version converted back to Unicode does not match the original directory name) lstrcpyn(finalName, sourcePath, 2 * MAX_PATH + 200); if (CutDirectory(finalName) && SalPathAppend(finalName, dirDOSName, 2 * MAX_PATH + 200) && @@ -2110,8 +2110,8 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = params.Caption = LoadStr(IDS_ERRORTITLE); params.Text = text; char aliasBtnNames[200]; - /* used by export_mnu.py script that generates salmenu.mnu for the Translator - we let the msgbox buttons resolve hotkey collisions by simulating that it is a menu + /* used by the export_mnu.py script, which generates salmenu.mnu for Translator + for message box buttons, resolve hotkey collisions by simulating a menu MENU_TEMPLATE_ITEM MsgBoxButtons[] = { {MNTT_PB, 0 @@ -2125,7 +2125,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = DIALOG_NO, LoadStr(IDS_MSGBOXBTN_SKIPALL)); params.AliasBtnNames = aliasBtnNames; int msgRes = SalMessageBoxEx(¶ms); - if (msgRes != DIALOG_YES /* Skip */ && msgRes != DIALOG_NO /* Skip All */) + if (msgRes != DIALOG_YES /* Skip All */ && msgRes != DIALOG_NO /* Skip All */) skip = FALSE; if (msgRes == DIALOG_NO /* Skip All */) ErrListDirSkipAll = TRUE; @@ -2171,7 +2171,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = } askDirDelete = FALSE; } - //--- does anyone want to interrupt script building? + //--- check whether script building should be interrupted if (GetTickCount() - LastTickCount > BS_TIMEOUT) { if (UserWantsToCancelSafeWaitWindow()) @@ -2248,8 +2248,8 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = params.Caption = LoadStr(IDS_ERRORTITLE); params.Text = text; char aliasBtnNames[200]; - /* used by export_mnu.py script that generates salmenu.mnu for the Translator - we let the msgbox buttons resolve hotkey collisions by simulating that it is a menu + /* used by the export_mnu.py script that generates salmenu.mnu for Translator + for message box buttons, we resolve hotkey collisions by simulating a menu MENU_TEMPLATE_ITEM MsgBoxButtons[] = { {MNTT_PB, 0 @@ -2293,7 +2293,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = { return skip; } - if ((op.TargetName = BuildName(sourcePath, dirName)) == NULL) // overly long name not a concern here, previous condition would handle it + if ((op.TargetName = BuildName(sourcePath, dirName)) == NULL) // an overly long name is not a concern here; it would already have been handled by the previous condition { free(op.SourceName); return FALSE; @@ -2337,8 +2337,8 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = } else { - // if directory's time&date should be preserved, store an operation to set the directory's time&date - // (can be done only after finishing writing subdirectories and files into this directory) + // if the directory's date and time should be preserved, store an operation to set them + // (this can be done only after finishing writing subdirectories and files into this directory) if ((type == atCopy || type == atMove) && filterCriteria != NULL && filterCriteria->PreserveDirTime && createDirIndex >= 0 && createDirIndex < script->Count) @@ -2361,7 +2361,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = } // if we need to delete the directory or a link to it at sourcePath + dirName (delete and move) - if (copyMoveDirIsLink && type == atMove || // for a link canDelDirAfterMove is irrelevant (a link can always be removed) + if (copyMoveDirIsLink && type == atMove || // for a link, canDelDirAfterMove is irrelevant (a link can always be deleted) !copyMoveDirIsLink && type == atMove && canDelDirAfterMove || type == atDelete) // delete the source directory or the link to the directory { if (type == atDelete && !delDirectory) @@ -2377,7 +2377,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = &ErrTooLongDirNameSkipAll, sourcePath)) == NULL) { if (skip) - skipTooLongSrcNameErr = TRUE; // we also want to add a flag to skip directory creation + skipTooLongSrcNameErr = TRUE; // we also want to add a flag to skip creating the directory else return FALSE; } @@ -2490,7 +2490,7 @@ BOOL CFilesWindow::BuildScriptFile(COperations* script, CActionType type, char* op.Opcode = (type == atCopy) ? ocCopyFile : ocMoveFile; op.FileSize = fileSizeLoc; op.OpFlags = srcAndTgtPathsFlags; - if (!script->CopyAttrs && // when copying attributes, the heuristic for setting the Encrypted attribute is skipped + if (!script->CopyAttrs && // when copying attributes, the heuristic for setting the Encrypted attribute does not apply ((sourceFileAttr & FILE_ATTRIBUTE_ENCRYPTED) || targetPathState == tpsEncryptedExisting || targetPathState == tpsEncryptedNotExisting)) { @@ -2521,8 +2521,8 @@ BOOL CFilesWindow::BuildScriptFile(COperations* script, CActionType type, char* params.Caption = LoadStr(IDS_ERRORTITLE); params.Text = message; char aliasBtnNames[200]; - /* used by export_mnu.py script that generates salmenu.mnu for the Translator - we let the msgbox buttons resolve hotkey collisions by simulating that it is a menu + /* used by the export_mnu.py script, which generates salmenu.mnu for the Translator + for message box buttons, we resolve hotkey collisions by simulating a menu MENU_TEMPLATE_ITEM MsgBoxButtons[] = { {MNTT_PB, 0 @@ -2545,9 +2545,9 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = char finalName[2 * MAX_PATH + 200]; // +200 is a reserve (Windows creates paths longer than MAX_PATH) if (mapName == NULL) { - // Petr: a bit of a hack: the *.* mask doesn't create a copy of the source name, which is a problem when copying - // files with invalid names, e.g. "c ..." + "*.*" = "c ", so we help ourselves - // by changing the mask to NULL = a simple textual copy of the name + // Petr: a bit of a hack: the *.* mask does not create a copy of the source name, which is a problem when copying + // files with invalid names, e.g. "c ..." + "*.*" = "c ", so the mask is changed + // to NULL, i.e. a simple textual copy of the name char* opMask = mask != NULL && strcmp(mask, "*.*") == 0 ? NULL : mask; if ((op.TargetName = BuildName(targetPath, MaskName(finalName, 2 * MAX_PATH + 200, fileName, opMask), @@ -2571,7 +2571,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = { free(op.SourceName); free(op.TargetName); - if (type == atMove) // moving where it already is ... + if (type == atMove) // moving to the same location ... { SalMessageBox(MainWindow->HWindow, LoadStr(IDS_CANNOTMOVEFILETOITSELF), LoadStr(IDS_ERRORTITLE), MB_OK | MB_ICONEXCLAMATION); @@ -2594,12 +2594,12 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = script->SameRootButDiffVolume || !HasTheSameRootPath(sourcePath, targetPath)) { // if the path ends with a space/period, it is invalid and we must not perform the copy, - // CreateFile trims spaces/periods, potentially resulting in copying a different file or to a different name + // because CreateFile trims spaces/periods and could copy a different file or copy it under a different name BOOL invalidSrcName = FileNameIsInvalid(op.SourceName, TRUE); - // optimization "overwrite older" for copying from a slow network to a fast local disk - // (reading file times over a slow network is much faster when the directory - // listing is read sequentially instead of querying each file individually) + // "overwrite older" optimization for copying from a slow network to a fast local disk + // (reading file timestamps over a slow network is much faster when the directory + // listing is read sequentially than when each file is queried individually) if (!invalidSrcName && (srcAndTgtPathsFlags & OPFL_TGTPATH_IS_NET) == 0 && script->OverwriteOlder && fileLastWriteTime != NULL) { BOOL invalidTgtName = FileNameIsInvalid(op.TargetName, TRUE); @@ -2621,7 +2621,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = *(unsigned __int64*)&roundedInTime = *(unsigned __int64*)fileLastWriteTime - (*(unsigned __int64*)fileLastWriteTime % 10000000); *(unsigned __int64*)&dataOut.ftLastWriteTime = *(unsigned __int64*)&dataOut.ftLastWriteTime - (*(unsigned __int64*)&dataOut.ftLastWriteTime % 10000000); - if (CompareFileTime(&roundedInTime, &dataOut.ftLastWriteTime) <= 0) // source file is not newer than the target one - skip the copy operation + if (CompareFileTime(&roundedInTime, &dataOut.ftLastWriteTime) <= 0) // source file is not newer than the target file - skip the copy operation { free(op.SourceName); free(op.TargetName); @@ -2645,7 +2645,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = // we have a new file size, we need to handle this again: // file too large for FAT32 (warn the user the operation will likely fail) - if (targetPathIsFAT32 && fileSizeLoc > CQuadWord(0xFFFFFFFF /* 4GB minus 1 Byte */, 0)) + if (targetPathIsFAT32 && fileSizeLoc > CQuadWord(0xFFFFFFFF /* 4 GB minus 1 byte */, 0)) { free(op.TargetName); op.TargetName = NULL; @@ -2662,7 +2662,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = else op.Size = COPY_MIN_FILE_SIZE; // zero/small files take at least as long as files of size COPY_MIN_FILE_SIZE - if (sourcePathSupADS && // if there's a chance that ADS will be found and + if (sourcePathSupADS && // if there is a chance of finding ADS and ADS should not be ignored (targetPathSupADS || !ConfirmADSLossAll)) // if ADS should not be ignored { CQuadWord adsSize; @@ -2729,13 +2729,13 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = } } } - else // an error occurred or no ADS + else // an error occurred or no ADS are present { if (invalidSrcName || adsWinError != NO_ERROR && // an error occurred (adsWinError != ERROR_INVALID_FUNCTION || StrNICmp(op.SourceName, "\\\\tsclient\\", 11) != 0) && // paths to local disks in Terminal Server do not support ADS listing (even though ADS is otherwise supported, irony of ironies) (adsWinError != ERROR_INVALID_PARAMETER && adsWinError != ERROR_NO_MORE_ITEMS || - (srcAndTgtPathsFlags & OPFL_SRCPATH_IS_NET) == 0)) // mounted FAT/FAT32 disk cannot be detected on a network drive (e.g. \petr\f\drive_c) plus a Novell NetWare volume browsed via NDS - we think it is NTFS and thus try to read ADS, which reports this error + (srcAndTgtPathsFlags & OPFL_SRCPATH_IS_NET) == 0)) // a mounted FAT/FAT32 disk cannot be detected on a network drive (e.g. \\petr\\f\\drive_c), and for a Novell NetWare volume browsed via NDS we assume it is NTFS and therefore try to read ADS, which reports this error { // firstly, we try whether an error occurs even during opening the file - such an error // the user understands it more easily, so we show it preferentially (before the ADS read error) @@ -2779,7 +2779,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = } } } - else // report a file open error + else // report a file opening error { DWORD err = GetLastError(); if (invalidSrcName) @@ -2888,13 +2888,13 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = memmove(name + l, fileName, 1 + strlen(fileName)); // name is always < MAX_PATH CQuadWord s; DWORD err = NO_ERROR; - if (FileBasedCompression && !onlySize && // if compression is even possible - (sourceFileAttr & (FILE_ATTRIBUTE_COMPRESSED | FILE_ATTRIBUTE_SPARSE_FILE))) // if the file is compressed or sparse (sparse file) + if (FileBasedCompression && !onlySize && // if file-based compression is enabled at all + (sourceFileAttr & (FILE_ATTRIBUTE_COMPRESSED | FILE_ATTRIBUTE_SPARSE_FILE))) // if the file is compressed or sparse { s.LoDWord = GetCompressedFileSize(name, &s.HiDWord); err = GetLastError(); if (err == ERROR_FILE_NOT_FOUND && fileDOSName != NULL && strcmp(fileName, fileDOSName) != 0) - { // workaround for computing the size of a file that must be accessed via DOS-name when we cannot do it via the UNICODE name (the multibyte version of the name converted back to UNICODE doesn't match the original file name) + { // workaround for determining the size of a file that must be accessed via its DOS name when we cannot use the Unicode name (the multibyte version of the name converted back to Unicode does not match the original Unicode file name) memmove(name + l, fileDOSName, 1 + strlen(fileDOSName)); // name is always < MAX_PATH s.LoDWord = GetCompressedFileSize(name, &s.HiDWord); err = GetLastError(); @@ -2915,7 +2915,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = MB_YESNO | MB_ICONEXCLAMATION) == IDYES; UpdateWindow(MainWindow->HWindow); } - s = fileSizeLoc; // cannot determine compressed size, we settle for the normal size + s = fileSizeLoc; // Cannot determine the compressed size; use the normal size. } script->Sizes.Add(fileSizeLoc); // the output dialog is prepared for the case when this array is in an error state @@ -3013,7 +3013,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = { return skip; } - if ((op.TargetName = BuildName(sourcePath, fileName)) == NULL) // if the name is too long, it will manifest already at this earlier condition + if ((op.TargetName = BuildName(sourcePath, fileName)) == NULL) // if the name is too long, it is already handled by the previous condition { free(op.SourceName); return FALSE; @@ -3036,7 +3036,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = return TRUE; } } - return FALSE; // cannot do anything else + return FALSE; // does not support anything else } void CFilesWindow::CalculateDirSizes() @@ -3068,12 +3068,12 @@ void CFilesWindow::ExecuteFromArchive(int index, BOOL edit, HWND editWithMenuPar int format = PackerFormatConfig.PackIsArchive(GetZIPArchive()); if (format != 0) // "always-true" - we found a supported archive { - if (!PackerFormatConfig.GetUsePacker(format - 1)) // no Edit? + if (!PackerFormatConfig.GetUsePacker(format - 1)) // no edit support? { if (SalMessageBox(HWindow, LoadStr(IDS_EDITPACKNOTSUPPORTED), LoadStr(IDS_QUESTION), MB_YESNO | MB_DEFBUTTON2 | MB_ICONQUESTION) != IDYES) { - return; // action aborted (user does not want to edit if the archive cannot be updated) + return; // action canceled (the user does not want to edit if the archive cannot be updated) } } } @@ -3094,7 +3094,7 @@ void CFilesWindow::ExecuteFromArchive(int index, BOOL edit, HWND editWithMenuPar int j; for (j = 0; j < count; j++) { - if (index != j) // do not compare the same item + if (index != j) // do not compare an item with itself { CFileData* f2 = j < Dirs->Count ? &Dirs->At(j) : &Files->At(j - Dirs->Count); if (f2->NameLen == f->NameLen && @@ -3122,7 +3122,7 @@ void CFilesWindow::ExecuteFromArchive(int index, BOOL edit, HWND editWithMenuPar { format--; int index2 = PackerFormatConfig.GetUnpackerIndex(format); - if (index2 < 0) // view: is this internal handling (plug-in)? + if (index2 < 0) // view: is this internal handling (plugin)? { CPluginData* data = Plugins.Get(-index2 - 1); if (data != NULL) @@ -3161,7 +3161,7 @@ void CFilesWindow::ExecuteFromArchive(int index, BOOL edit, HWND editWithMenuPar char tmpPath[MAX_PATH]; memcpy(tmpPath, name, backSlash - name); tmpPath[backSlash - name] = 0; - BeginStopRefresh(); // the snooper can take a break + BeginStopRefresh(); // stop refreshing SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_NORMAL); HCURSOR oldCur = SetCursor(LoadCursor(NULL, IDC_WAIT)); if (PackUnpackOneFile(this, GetZIPArchive(), PluginData.GetInterface(), @@ -3242,7 +3242,7 @@ void CFilesWindow::ExecuteFromArchive(int index, BOOL edit, HWND editWithMenuPar if (UnpackedAssocFiles.AddFile(GetZIPArchive(), GetZIPPath(), buf, s, dosName, lastWrite, fileSize, attr)) { // this file doesn't have the disk-cache 'lock' object ExecuteAssocEvent yet - DiskCache.AssignName(dcFileName, ExecuteAssocEvent, FALSE, crtCache); // arcCacheCacheCopies has no effect – caching is done until the archive is closed, we won't unpack earlier + DiskCache.AssignName(dcFileName, ExecuteAssocEvent, FALSE, crtCache); // arcCacheCacheCopies has no effect - caching continues until the archive is closed, and we will not unpack earlier } else { // it is unnecessary to add the same 'lock' object to a tmp file From 73d570de0d50f6231d2696d3d6913198f8e529ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:23:36 +0200 Subject: [PATCH 404/710] [translation] Fix src/fileswn8.cpp comments Refines translated comments in src/fileswn8.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #871 for src/fileswn8.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/fileswn8.cpp | 70 ++++++++++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/src/fileswn8.cpp b/src/fileswn8.cpp index 4a230002b..a5b26f2d9 100644 --- a/src/fileswn8.cpp +++ b/src/fileswn8.cpp @@ -64,8 +64,8 @@ BOOL CFilesWindow::DeleteThroughRecycleBin(int* selection, int selCount, CFileDa SalPathAddBackslash(path, MAX_PATH); int pathLen = (int)strlen(path); // Verify that the path does not contain components ending with a space or dot; - // as this can confuse the Recycle Bin and cause it to delete from a different path (it quietly trims - // those spaces or dots) + // this confuses the Recycle Bin and causes it to delete from a different path (it silently trims + // those spaces or dots). if (!PathContainsValidComponents(path, TRUE)) { char textBuf[2 * MAX_PATH + 200]; @@ -108,7 +108,7 @@ BOOL CFilesWindow::DeleteThroughRecycleBin(int* selection, int selCount, CFileDa fo.fAnyOperationsAborted = FALSE; fo.hNameMappings = NULL; fo.lpszProgressTitle = ""; - // Perform the actual deletion - wonderfully simple, unfortunately it sometimes crashes ;-) + // Perform the actual deletion; unfortunately, it sometimes crashes. CALL_STACK_MESSAGE1("CFilesWindow::DeleteThroughRecycleBin::SHFileOperation"); BOOL ret = DeleteThroughRecycleBinAux(&fo) == 0; SetCurrentDirectoryToSystem(); @@ -127,7 +127,7 @@ void PluginFSConvertPathToExternal(char* path) Plugins.IsPluginFS(fsName, index, fsNameIndex)) { CPluginData* plugin = Plugins.Get(index); - if (plugin != NULL && plugin->InitDLL(MainWindow->HWindow, FALSE, TRUE, FALSE)) // the plugin may not be loaded, let it load if needed + if (plugin != NULL && plugin->InitDLL(MainWindow->HWindow, FALSE, TRUE, FALSE)) // the plugin may not be loaded yet; load it if necessary plugin->GetPluginInterfaceForFS()->ConvertPathToExternal(fsName, fsNameIndex, fsUserPart); } } @@ -270,7 +270,7 @@ void CFilesWindow::FilesAction(CActionType type, CFilesWindow* target, int count // if packing to the archive in the other panel is not possible, leave the path empty int format = PackerFormatConfig.PackIsArchive(target->GetZIPArchive()); - if (format != 0) // we found a supported archive + if (format != 0) // supported archive found { if (!PackerFormatConfig.GetUsePacker(format - 1)) // no edit -> empty operation target { @@ -286,7 +286,7 @@ void CFilesWindow::FilesAction(CActionType type, CFilesWindow* target, int count (type == atCopy && target->GetPluginFS()->IsServiceSupported(FS_SERVICE_COPYFROMDISKTOFS) || type == atMove && target->GetPluginFS()->IsServiceSupported(FS_SERVICE_MOVEFROMDISKTOFS))) { - // // this is just a modification of the target path text in the plug-in -> no point in lowering the thread's priority + // // this is just a modification of the target path text in the plugin -> no point in lowering the thread's priority int selFiles = 0; int selDirs = 0; if (count > 0) // some files are selected @@ -294,7 +294,7 @@ void CFilesWindow::FilesAction(CActionType type, CFilesWindow* target, int count selFiles = files; selDirs = count - files; } - else // take the focused item + else // use the focused item { int index = GetCaretIndex(); if (index >= Dirs->Count) @@ -341,7 +341,7 @@ void CFilesWindow::FilesAction(CActionType type, CFilesWindow* target, int count if (invertRecycleBin) { if (Configuration.UseRecycleBin == 0) - recycle = 1; // all + recycle = 1; // for all else recycle = 0; // none } @@ -397,7 +397,7 @@ void CFilesWindow::FilesAction(CActionType type, CFilesWindow* target, int count else expanded[0] = 0; // not used } - else // count-files in directories and individualfiles + else // `count - files` directories and `files` files { ExpandPluralFilesDirs(expanded, 200, files, count - files, epfdmNormal, FALSE); } @@ -440,7 +440,7 @@ void CFilesWindow::FilesAction(CActionType type, CFilesWindow* target, int count DWORD clusterSize = 0; CChangeCaseData changeCaseData; CCriteriaData criteria; - if (CopyMoveOptions.Get() != NULL) // if they exist, pull the defaults + if (CopyMoveOptions.Get() != NULL) // if they exist, load the defaults criteria = *CopyMoveOptions.Get(); CCriteriaData* criteriaPtr = NULL; // pointer to 'criteria'; if NULL, they are ignored BOOL copyToExistingDir = FALSE; @@ -461,7 +461,7 @@ void CFilesWindow::FilesAction(CActionType type, CFilesWindow* target, int count while (1) { if (strlen(path) >= 2 * MAX_PATH) - path[0] = 0; // the path is too long; not an ideal solution but I'm not up for a better one now :( + path[0] = 0; // the path is too long; this is not an ideal solution res = (int)CCopyMoveMoreDialog(HWindow, path, 2 * MAX_PATH, (type == atCopy) ? LoadStr(IDS_COPY) : LoadStr(IDS_MOVE), &str, (type == atCopy) ? IDD_COPYDIALOG : IDD_MOVEDIALOG, @@ -527,7 +527,7 @@ void CFilesWindow::FilesAction(CActionType type, CFilesWindow* target, int count { if (pathType == PATH_TYPE_ARCHIVE) // path into an archive { - if (strlen(secondPart) >= MAX_PATH) // isn't the path inside the archive too long? + if (strlen(secondPart) >= MAX_PATH) // is the path inside the archive too long? { SalMessageBox(HWindow, LoadStr(IDS_TOOLONGPATH), (type == atCopy) ? LoadStr(IDS_ERRORCOPY) : LoadStr(IDS_ERRORMOVE), @@ -535,7 +535,7 @@ void CFilesWindow::FilesAction(CActionType type, CFilesWindow* target, int count continue; } - if (criteriaPtr != NULL && Configuration.CnfrmCopyMoveOptionsNS) // archives do not support options from the Copy/Move dialog + if (criteriaPtr != NULL && Configuration.CnfrmCopyMoveOptionsNS) // archives do not support the options from the Copy/Move dialog { MSGBOXEX_PARAMS params; memset(¶ms, 0, sizeof(params)); @@ -557,7 +557,7 @@ void CFilesWindow::FilesAction(CActionType type, CFilesWindow* target, int count data.IndexesCount = count; data.Indexes = indexes; // deallocated via 'indexes' } - else // take the focused item + else // use the focused item { oneIndex = GetCaretIndex(); data.IndexesCount = 1; @@ -599,7 +599,7 @@ void CFilesWindow::FilesAction(CActionType type, CFilesWindow* target, int count { nullFile = (size == CQuadWord(0, 0)); - //--- if it's a zero-size file, we must delete it; archivers can not handle them + //--- if it is a zero-size file, we must delete it; archivers cannot handle such files DWORD nullFileAttrs; if (nullFile) { @@ -635,7 +635,7 @@ void CFilesWindow::FilesAction(CActionType type, CFilesWindow* target, int count } else { - if (nullFile) // it failed, we have to create it again + if (nullFile) // The previous attempt failed, so we have to create it again { HANDLE hFile2 = HANDLES_Q(CreateFile(path, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, @@ -694,9 +694,9 @@ void CFilesWindow::FilesAction(CActionType type, CFilesWindow* target, int count } else { - if (pathType == PATH_TYPE_FS) // file-system path + if (pathType == PATH_TYPE_FS) // file system path { - if (strlen(secondPart) >= MAX_PATH) // is the user's part of the FS path too long? + if (strlen(secondPart) >= MAX_PATH) // is the user-entered part of the FS path too long? { SalMessageBox(HWindow, LoadStr(IDS_TOOLONGPATH), (type == atCopy) ? LoadStr(IDS_ERRORCOPY) : LoadStr(IDS_ERRORMOVE), @@ -731,7 +731,7 @@ void CFilesWindow::FilesAction(CActionType type, CFilesWindow* target, int count data.IndexesCount = count; data.Indexes = indexes; // deallocated via 'indexes' } - else // take the focused item + else // use the focused item { oneIndex = GetCaretIndex(); if (oneIndex >= Dirs->Count) @@ -802,13 +802,13 @@ void CFilesWindow::FilesAction(CActionType type, CFilesWindow* target, int count PluginFSConvertPathToExternal(targetPath); strcpy(path, targetPath); invalidPath = TRUE; - break; // we must go back to the copy/move dialog + break; // return to the Copy/Move dialog } // trying another FS } } } - if (i == list->Count) // active and detached FS couldn't handle it, we will create a new FS + if (i == list->Count) // neither the active nor the detached FS could handle it, so create a new FS { int index; int fsNameIndex; @@ -842,16 +842,16 @@ void CFilesWindow::FilesAction(CActionType type, CFilesWindow* target, int count { // done/cancel unselect = !invalidPathOrCancel; } - else // syntax error/plugin error + else // syntax error or plugin error { if (invalidPathOrCancel) { // convert the path to external format (before displaying it in the dialog) PluginFSConvertPathToExternal(targetPath); strcpy(path, targetPath); - invalidPath = TRUE; // we must go back to the Copy/Move dialog + invalidPath = TRUE; // we must return to the Copy/Move dialog } - else // plugin error (new FS, but returns "requested operation cannot be performed on this FS" error) + else // plugin error (new FS, but it returns "requested operation cannot be performed on this FS") { TRACE_E("CopyOrMoveFromDiskToFS on new (empty) FS may not return error 'unable to process operation'."); } @@ -880,7 +880,7 @@ void CFilesWindow::FilesAction(CActionType type, CFilesWindow* target, int count if (invalidPath) continue; // back to the copy/move dialog - if (unselect) // unselect files/directories in the panel + if (unselect) // deselect files/directories in the panel { SetSel(FALSE, -1, TRUE); // explicit redraw PostMessage(HWindow, WM_USER_SELCHANGED, 0, 0); // sel-change notify @@ -935,7 +935,7 @@ void CFilesWindow::FilesAction(CActionType type, CFilesWindow* target, int count break; } } - if (res == IDOK && // begin disk operation + if (res == IDOK && // begin disk operations CheckPath(TRUE) == ERROR_SUCCESS) { if (type == atDelete && recycle == 1) @@ -1118,7 +1118,7 @@ void CFilesWindow::FilesAction(CActionType type, CFilesWindow* target, int count script->ResetState(); FreeScript(script); } - else // removing selected index + else // clear the selected index { if (res2) { @@ -1163,9 +1163,9 @@ void CFilesWindow::FilesAction(CActionType type, CFilesWindow* target, int count } } -// extracts all subdirectories from 'path' directory and calls itself recursively -// adds files mapi -// returns TRUE, if everything succeeded; otherwise returns FALSE +// extracts all subdirectories from the 'path' directory and calls itself recursively +// adds files to MAPI +// returns TRUE if everything succeeded; otherwise returns FALSE BOOL EmailFilesAddDirectory(CSimpleMAPI* mapi, const char* path, BOOL* errGetFileSizeOfLnkTgtIgnAll) { WIN32_FIND_DATA file; @@ -1232,9 +1232,9 @@ BOOL EmailFilesAddDirectory(CSimpleMAPI* mapi, const char* path, BOOL* errGetFil return ok; } -// pulls the selection from the panel and processes every item: -// if it's a directory, calls EmailFilesAddDirectory for it -// if it's a file, adds it to mapi +// gets the selection from the panel and processes all items: +// if it is a directory, calls EmailFilesAddDirectory for it +// if it is a file, adds it to MAPI // if everything succeeds, creates the email void CFilesWindow::EmailFiles() { @@ -1377,9 +1377,9 @@ BOOL CFilesWindow::OpenFocusedInOtherPanel(BOOL activate) if (otherPanel == NULL) return FALSE; - // allow opening the up-dir + // allow opening the parent directory // if (FocusedIndex == 0 && FocusedIndex < Dirs->Count && - // strcmp(Dirs->At(0).Name, "..") == 0) return FALSE; // do not handle the up-dir + // strcmp(Dirs->At(0).Name, "..") == 0) return FALSE; // do not consider the parent directory if (FocusedIndex < 0 || FocusedIndex >= Files->Count + Dirs->Count) return FALSE; // ignore invalid index From 079f9e393806a573f7ee7135d41718d988a0cd4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:23:51 +0200 Subject: [PATCH 405/710] [translation] Fix src/fileswn9.cpp comments Refines translated comments in src/fileswn9.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #872 for src/fileswn9.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/fileswn9.cpp | 54 ++++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/fileswn9.cpp b/src/fileswn9.cpp index 442aebc8f..f69a0bdb8 100644 --- a/src/fileswn9.cpp +++ b/src/fileswn9.cpp @@ -200,7 +200,7 @@ BOOL CFilesWindow::ClipboardPaste(BOOL onlyLinks, BOOL onlyTest, const char* pas BOOL ourClipDataObject = FALSE; DWORD effect = 0; - if (ownRutine) // if there's a chance for our own handling, check if it's copy or move + if (ownRutine) // if our own handling is possible, check whether this is a copy or move { DWORD dropEffect = 0; UINT cfPrefDrop = RegisterClipboardFormat(CFSTR_PREFERREDDROPEFFECT); @@ -226,7 +226,7 @@ BOOL CFilesWindow::ClipboardPaste(BOOL onlyLinks, BOOL onlyTest, const char* pas if (GetClipboardData(cfSalDataObject) != NULL) ourClipDataObject = TRUE; else - ownRutine = FALSE; // if it is not our IDataObject, we won't perform our own operation + ownRutine = FALSE; // if it is not our IDataObject, do not perform our own operation CloseClipboard(); } else @@ -241,7 +241,7 @@ BOOL CFilesWindow::ClipboardPaste(BOOL onlyLinks, BOOL onlyTest, const char* pas } filesOnClip = files && ourClipDataObject; - if (ownRutine) // execute our own routine - copy or move + if (ownRutine) // perform the internal copy or move routine { if (pastePath != NULL) strcpy(DropPath, pastePath); @@ -290,7 +290,7 @@ BOOL CFilesWindow::ClipboardPaste(BOOL onlyLinks, BOOL onlyTest, const char* pas } else { - if (files && !onlyTest) // perform paste/pastelink + if (files && !onlyTest) // perform Paste/Paste Link { // MainWindow->ReleaseMenuNew(); // Windows are not designed for multiple context menus @@ -415,7 +415,7 @@ BOOL CFilesWindow::ClipboardPasteToArcOrFS(BOOL onlyTest, DWORD* pasteDefEffect) if (IsSimpleSelection(dataObj, namesList)) // check if these are files/directories from disk and if they come from the same path { ret = TRUE; - // check if it's copy or move + // determine whether this is a copy or move operation DWORD dropEffect = DROPEFFECT_COPY | DROPEFFECT_MOVE; // if we can't determine the effect, assume both (Copy takes priority) UINT cfPrefDrop = RegisterClipboardFormat(CFSTR_PREFERREDDROPEFFECT); if (OpenClipboard(HWindow)) @@ -563,7 +563,7 @@ BOOL CFilesWindow::IsTextOnClipboard() else { if (attempt++ <= 10) - Sleep(10); // wait to see if the clipboard gets released (max. 100 ms) + Sleep(10); // wait for the clipboard to be released (max. 100 ms) else { TRACE_E("OpenClipboard() has failed!"); @@ -585,7 +585,7 @@ BOOL CFilesWindow::PostProcessPathFromUser(HWND parent, char (&buff)[2 * MAX_PAT // trim quotes, see https://forum.altap.cz/viewtopic.php?t=4160 CutDoubleQuotesFromBothSides(buff); - if (IsFileURLPath(buff)) // it is a URL: convert URL (file://) to a Windows path + if (IsFileURLPath(buff)) // it is a URL: convert the URL (file://) to a Windows path { char path[MAX_PATH]; DWORD pathLen = _countof(path); @@ -605,8 +605,8 @@ BOOL CFilesWindow::PostProcessPathFromUser(HWND parent, char (&buff)[2 * MAX_PAT return TRUE; // let the FS plugin handle the processing } - // expand ENV variables (as frequently requested on the forum and for internal use) - // if an ENV variable does not exist, a directory with the same name gets a chance to be expanded + // expand ENV variables (at frequent request on the forum and for internal use) + // if an ENV variable does not exist, a directory with the same name gets a chance instead char expandedBuff[_countof(buff) + 1]; DWORD auxRes = ExpandEnvironmentStrings(buff, expandedBuff, _countof(expandedBuff)); if (auxRes == 0 || auxRes > _countof(buff)) @@ -717,7 +717,7 @@ BOOL CFilesWindow::OnLButtonDown(WPARAM wParam, LPARAM lParam, LRESULT* lResult) } // compatibility with Windows Explorer: clicking outside (in either the active or inactive panel) - // means confirming the rename; other actions (Alt+Tab), unlike Explorer, are considered + // confirms the rename; other actions (Alt+Tab), unlike in Explorer, are treated // as canceling the rename if (!MainWindow->DoQuickRename()) { @@ -1145,7 +1145,7 @@ void CFilesWindow::OfferArchiveUpdateIfNeeded(HWND parent, int textID, BOOL* arc CFilesWindow* otherPanel = MainWindow->LeftPanel == this ? MainWindow->RightPanel : MainWindow->LeftPanel; BOOL otherPanelArchMaybeUpdated = FALSE; if (otherPanel->Is(ptZIPArchive) && StrICmp(GetZIPArchive(), otherPanel->GetZIPArchive()) == 0) - { // the same archive is in the other panel, we must update it as well + { // the same archive is open in the other panel, so we must update it as well otherPanel->OfferArchiveUpdateIfNeededAux(parent, textID, &otherPanelArchMaybeUpdated); if (otherPanelArchMaybeUpdated) *archMaybeUpdated = TRUE; @@ -1173,21 +1173,21 @@ BOOL CFilesWindow::OnMouseMove(WPARAM wParam, LPARAM lParam, LRESULT* lResult) { CALL_STACK_MESSAGE_NONE *lResult = 0; - if (BeginDragDrop && (wParam & (MK_LBUTTON | MK_RBUTTON))) // "dragging" for drag&drop + if (BeginDragDrop && (wParam & (MK_LBUTTON | MK_RBUTTON))) // start drag-and-drop when the mouse is dragged { int x = abs(LButtonDown.x - (short)LOWORD(lParam)); int y = abs(LButtonDown.y - (short)HIWORD(lParam)); if (x > GetSystemMetrics(SM_CXDRAG) || y > GetSystemMetrics(SM_CYDRAG)) // move { - // the condition "!PerformingDragDrop" was added after AS 2.52 due to a bug report from ehter: - // in the directory there must be two files (one EXE downloaded via IE, which contains a security ADS) and another file - // dragging the other file onto the EXE triggers a security dialog, which triggers a security dialog that is NONMODAL and has its own message loop - // thus Salamander's main thread gets stuck in ShellAction(); then a second drag&drop leads to a crash - // this patch disables new drag&drop, just like Windows Explorer does - // the solution isn't perfect because Salamander only appears to be running (the main thread isn't in our app loop) + // The "!PerformingDragDrop" condition was added after AS 2.52 because of a state reported by ehter: + // the directory must contain two files (one EXE downloaded via IE so it contains a security ADS) and another file + // dragging the other file onto the EXE opens a security dialog, but it is NONMODAL and has its own message loop + // so Salamander's main thread gets stuck in ShellAction(); then a second drag&drop led to a crash + // this patch disables a new drag&drop operation, just as Windows Explorer does + // the solution is not clean, because Salamander only appears to be running (the main thread is not in our application loop) if (!PerformingDragDrop) { - if (Is(ptZIPArchive) && AssocUsed) // if the user edited files from the archive we must update them before operating on it, otherwise we'd work with old versions of the edited files stored directly in the archive + if (Is(ptZIPArchive) && AssocUsed) // If the user edited files from the archive, we must update them before operating on the archive; otherwise, we would work with old versions of the edited files stored directly in the archive. { BOOL archMaybeUpdated; OfferArchiveUpdateIfNeeded(MainWindow->HWindow, IDS_ARCHIVECLOSEEDIT3, &archMaybeUpdated); @@ -1244,7 +1244,7 @@ BOOL CFilesWindow::OnMouseMove(WPARAM wParam, LPARAM lParam, LRESULT* lResult) return TRUE; } - if (BeginBoxSelect && (wParam & (MK_LBUTTON | MK_RBUTTON))) // "opening" selection box + if (BeginBoxSelect && (wParam & (MK_LBUTTON | MK_RBUTTON))) // Start the selection box { short xPos = (short)LOWORD(lParam); short yPos = (short)HIWORD(lParam); @@ -1684,7 +1684,7 @@ CFilesWindow::CreateDragImage(int cursorX, int cursorY, int& dxHotspot, int& dyH // DrawBriefDetailedItem(hDC, itemIndex, &r, DRAWFLAG_NO_FRAME | DRAWFLAG_NO_STATE | DRAWFLAG_SKIP_VISTEST | DRAWFLAG_DRAGDROP | DRAWFLAG_ICON_ONLY); } ListBox->XOffset = oldXOffset; - if (GetViewMode() == vmBrief) // not sure what is in XOffset in brief mode, so ensure dxHotspot is correct + if (GetViewMode() == vmBrief) // XOffset in brief mode is uncertain, so make sure dxHotspot is correct oldXOffset = 0; } else if (GetViewMode() == vmIcons || GetViewMode() == vmThumbnails) @@ -1810,7 +1810,7 @@ BOOL CopyUNCPathToClipboard(const char* path, const char* name, BOOL isDir, HWND } if (!isDir) strcat(uncPath, name); - if (SalGetFullName(uncPath)) // root "c:\\", others without '\\' at the end + if (SalGetFullName(uncPath)) // root "c:\\", others without a trailing '\\' return CopyTextToClipboard(uncPath); } @@ -1864,7 +1864,7 @@ BOOL CFilesWindow::CopyFocusedNameToClipboard(CCopyFocusedNameModeEnum mode) if (FocusedIndex == 0 && FocusedIndex < Dirs->Count && strcmp(Dirs->At(0).Name, "..") == 0) - return FALSE; // do not accept up-directory entries + return FALSE; // ignore the up-directory entry if (FocusedIndex < 0 || FocusedIndex >= Files->Count + Dirs->Count) return FALSE; // ignore an invalid index @@ -2019,7 +2019,7 @@ BOOL CFilesWindow::BuildColumnsTemplate() { lstrcpy(column.Name, LoadStr(item->NameResID)); lstrcpy(column.Description, LoadStr(item->DescResID)); - if (i == 0) // column "Name" + if (i == 0) // "Name" column { if ((ViewTemplate->Flags & VIEW_SHOW_EXTENSION) == 0) // "Ext" is part of the "Name" column, the name and description of the "Ext" column are after the terminating null of the name and description { @@ -2110,7 +2110,7 @@ void CFilesWindow::DeleteColumnsWithoutData(DWORD columnValidMask) { Columns.Delete(i); if (!Columns.IsGood()) - Columns.ResetState(); // cannot fail, the array just wasn't reduced + Columns.ResetState(); // this cannot fail; only the array was not reduced } } } @@ -2158,7 +2158,7 @@ void CFilesWindow::OnHeaderLineColWidthChanged() } if (column->ID == COLUMN_ID_CUSTOM) // it is a column added by a plugin { - if (column->FixedWidth && PluginData.NotEmpty()) // only non-elastic columns + "always true" + if (column->FixedWidth && PluginData.NotEmpty()) // only fixed-width columns + "always true" { PluginData.ColumnWidthWasChanged(leftPanel, column, column->Width); pluginColMaybeChanged = TRUE; @@ -2166,7 +2166,7 @@ void CFilesWindow::OnHeaderLineColWidthChanged() } else { - if (colIndex != -1) // "always true" + if (colIndex != -1) // "always TRUE" { if (leftPanel) ViewTemplate->Columns[colIndex].LeftWidth = column->Width; From fee995867e91c3bb5936b18d2b4012f257d8fd4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:24:07 +0200 Subject: [PATCH 406/710] [translation] Fix src/fileswna.cpp comments Refines translated comments in src/fileswna.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #873 for src/fileswna.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/fileswna.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/fileswna.cpp b/src/fileswna.cpp index d5d2df197..7a5ddecb7 100644 --- a/src/fileswna.cpp +++ b/src/fileswna.cpp @@ -35,7 +35,7 @@ void CFilesWindow::PluginFSFilesAction(CPluginFSActionType type) { // count how many directories are selected (the remaining selected items are files) int i; - for (i = 0; i < Dirs->Count; i++) // ".." cannot be selected, the check would be useless + for (i = 0; i < Dirs->Count; i++) // ".." cannot be selected, so the check would be redundant { if (Dirs->At(i).Selected) selectedDirs++; @@ -176,7 +176,7 @@ void CFilesWindow::PluginFSFilesAction(CPluginFSActionType type) if (ParsePath(targetPath, pathType, pathIsDir, secondPart, errTitle, NULL, &error, MAX_PATH)) { // instead of using a 'switch' statement, we use 'if' so that 'break' and 'continue' work properly - if (pathType == PATH_TYPE_WINDOWS) // Windows path (disk + UNC) + if (pathType == PATH_TYPE_WINDOWS) // Windows path (drive + UNC) { char* mask; if (SalSplitWindowsPath(HWindow, LoadStr(copy ? IDS_COPY : IDS_MOVE), @@ -188,7 +188,7 @@ void CFilesWindow::PluginFSFilesAction(CPluginFSActionType type) { // masks not supported and mask is empty, cut it off *mask = 0; // double-null terminated } - if (!operationMask && mask != NULL && *mask != 0) // mask exists but isn't allowed + if (!operationMask && mask != NULL && *mask != 0) // mask is present but not allowed { char* e = targetPath + strlen(targetPath); // fix 'targetPath' (merge 'targetPath' and 'mask') if (e > targetPath && *(e - 1) != '\\') @@ -264,7 +264,7 @@ void CFilesWindow::PluginFSFilesAction(CPluginFSActionType type) BOOL ret = GetPluginFS()->Delete(GetPluginFS()->GetPluginFSName(), 1, HWindow, panel, count - selectedDirs, selectedDirs, cancelOrError); - if (!cancelOrError) // not a cancel/operation error + if (!cancelOrError) // not canceled and no operation error { if (!ret) { @@ -474,7 +474,7 @@ void CFilesWindow::DragDropToArcOrFS(CTmpDragDropOperData* data) newF.IsLink = IsFileLink(newF.Ext); } - if ((newF.Attr & FILE_ATTRIBUTE_DIRECTORY) && !baseDir->AddDir("", newF, NULL) || // directory, certainly a disk + if ((newF.Attr & FILE_ATTRIBUTE_DIRECTORY) && !baseDir->AddDir("", newF, NULL) || // directory; this is definitely on disk (newF.Attr & FILE_ATTRIBUTE_DIRECTORY) == 0 && !baseDir->AddFile("", newF, NULL)) // file { free(newF.Name); @@ -576,7 +576,7 @@ void CFilesWindow::DragDropToArcOrFS(CTmpDragDropOperData* data) if (PackCompress(HWindow, this, data->ArchiveOrFSName, data->ArchivePathOrUserPart, !data->Copy, data->Data->SrcPath, PanelEnumDiskSelection, &dataEnum)) { // packing succeeded - if (nullFile && // zero-length file might have had a different compressed attribute, set archive accordingly + if (nullFile && // the zero-length file might have had a different compressed attribute; set the archive file to match nullFileAttrs != INVALID_FILE_ATTRIBUTES) { HANDLE hFile2 = HANDLES_Q(CreateFile(data->ArchiveOrFSName, GENERIC_READ | GENERIC_WRITE, @@ -642,12 +642,12 @@ void CFilesWindow::DragDropToArcOrFS(CTmpDragDropOperData* data) MB_OK | MB_ICONEXCLAMATION); } } - else // to FS + else // Route to FS { int selFiles = dataEnum.Files->Count; int selDirs = dataEnum.Dirs->Count; - // lower thread's priority to "normal" (so that operations don't burden the machine too much) + // lower the thread priority to "normal" (so the operation does not put too much load on the machine) SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_NORMAL); // select the FS that performs the operation (priority: active, then new) @@ -658,7 +658,7 @@ void CFilesWindow::DragDropToArcOrFS(CTmpDragDropOperData* data) fs = GetPluginFS(); int fsNameIndex; - if (fs != NULL && fs->NotEmpty() && // interface is valid + if (fs != NULL && fs->NotEmpty() && // FS interface is valid fs->IsFSNameFromSamePluginAsThisFS(data->ArchiveOrFSName, fsNameIndex)) // FS name is from the same plugin (otherwise it's not worth trying) { BOOL invalidPathOrCancel; @@ -676,22 +676,22 @@ void CFilesWindow::DragDropToArcOrFS(CTmpDragDropOperData* data) dataEnum.Reset(); if (invalidPathOrCancel) - done = TRUE; // invalid path + user cannot fix it, ending - // else ; // we should try a new FS + done = TRUE; // invalid path + user cannot correct the path, stop + // else ; // try a new FS } } - if (!done) // active FS failed, create a new FS + if (!done) // the active FS could not handle it, create a new FS { int index; int fsNameIndex2; if (Plugins.IsPluginFS(data->ArchiveOrFSName, index, fsNameIndex2)) // determine plugin index { - // obtain the plug-in associated with the FS + // obtain the plugin associated with the FS CPluginData* plugin = Plugins.Get(index); if (plugin != NULL) { // open a new FS - // load the plug-in before obtaining DLLName, Version and plugin interfaces + // load the plugin before obtaining DLLName, Version and plugin interfaces CPluginFSInterfaceAbstract* auxFS = plugin->OpenFS(data->ArchiveOrFSName, fsNameIndex2); CPluginFSInterfaceEncapsulation pluginFS(auxFS, plugin->DLLName, plugin->Version, plugin->GetPluginInterfaceForFS()->GetInterface(), From 61f60fe852761340a6186337d302a057a8c3f4fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:24:23 +0200 Subject: [PATCH 407/710] [translation] Fix src/filter.cpp comments Refines translated comments in src/filter.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #875 for src/filter.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/filter.cpp | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/filter.cpp b/src/filter.cpp index 7d0198749..ec07ab43a 100644 --- a/src/filter.cpp +++ b/src/filter.cpp @@ -7,7 +7,7 @@ // Attributes const char* FILTERCRITERIA_ATTRIBUTESMASK_REG = "Attributes Mask"; const char* FILTERCRITERIA_ATTRIBUTESVALUE_REG = "Attributes Value"; -// Size Min/Max +// Minimum/maximum size const char* FILTERCRITERIA_USEMINSIZE_REG = "UseMinSize"; const char* FILTERCRITERIA_MINSIZELO_REG = "MinSizeLo"; const char* FILTERCRITERIA_MINSIZEHI_REG = "MinSizeHi"; @@ -30,8 +30,8 @@ const char* FILTERCRITERIA_USETOTIME_REG = "UseToTime"; const char* FILTERCRITERIA_TOLO_REG = "ToLo"; const char* FILTERCRITERIA_TOHI_REG = "ToHi"; -// we used the following variables in Altap Salamander 2.5, -// where we switched to CFilterCriteria and its Save/Load +// the following variables were used up to Altap Salamander 2.5, +// when we switched to CFilterCriteria and its Save/Load const char* OLD_FINDOPTIONSITEM_ARCHIVE_REG = "Archive"; const char* OLD_FINDOPTIONSITEM_READONLY_REG = "ReadOnly"; const char* OLD_FINDOPTIONSITEM_HIDDEN_REG = "Hidden"; @@ -86,7 +86,7 @@ void CFilterCriteria::Reset() AttributesMask = 0; // 0 -> indeterminate checkbox state AttributesValue = 0; - // Size Min/Max + // Minimum/Maximum Size UseMinSize = FALSE; MinSize.Set(1, 0); MinSizeUnits = fcsuKB; @@ -230,7 +230,7 @@ void CFilterCriteria::PrepareForTest() { SYSTEMTIME st; // 'st' can be modified, see the reset of hours, minutes, and seconds GetLocalTime(&st); - // weekday is redundant information; we will not work with it + // the weekday is redundant information; we will not use it st.wDayOfWeek = 0; SYSTEMTIME stCurrent = st; // current time that we won't modify @@ -364,8 +364,8 @@ void CFilterCriteria::PrepareForTest() } if (SystemTimeToFileTime(&st, (FILETIME*)&MaxTime)) { - // we want to be the absolute maximum time, sticking right at the very end of the interval - // at the resolution of FILETIME + // we want the absolute maximum time, so we move all the way to the end of the interval + // at FILETIME resolution MaxTime += 9999999; // almost one second UseMaxTime = TRUE; @@ -385,7 +385,7 @@ BOOL CFilterCriteria::Test(DWORD attributes, const CQuadWord* size, const FILETI // Attributes BOOL ok = ((attributes & AttributesMask) == (AttributesValue & AttributesMask)); - // Size Min/Max + // Min/max size if (ok && (UseMinSize || UseMaxSize)) { if ((attributes & FILE_ATTRIBUTE_DIRECTORY) != 0) @@ -395,7 +395,7 @@ BOOL CFilterCriteria::Test(DWORD attributes, const CQuadWord* size, const FILETI } else { - // it's a file, so we can compare its size + // this is a file, so we can compare its size if (UseMinSize) ok = *size >= MinSizeBytes; if (ok && UseMaxSize) @@ -489,8 +489,8 @@ BOOL CFilterCriteria::GetAdvancedDescription(char* buffer, int maxLen, BOOL& dir BOOL CFilterCriteria::Save(HKEY hKey) { - // space optimization in the Registry: we store only "non-default values" - // before saving, it is necessary to clear the key where we will store the data + // registry space optimization: we store only non-default values; + // therefore, before saving, the target key must be cleared CFilterCriteria def; // Attributes @@ -499,7 +499,7 @@ BOOL CFilterCriteria::Save(HKEY hKey) if (AttributesValue != def.AttributesValue) SetValue(hKey, FILTERCRITERIA_ATTRIBUTESVALUE_REG, REG_DWORD, &AttributesValue, sizeof(DWORD)); - // Size Min/Max + // Minimum/maximum size if (UseMinSize != def.UseMinSize) SetValue(hKey, FILTERCRITERIA_USEMINSIZE_REG, REG_DWORD, &UseMinSize, sizeof(DWORD)); if (MinSize != def.MinSize) @@ -537,7 +537,7 @@ BOOL CFilterCriteria::Save(HKEY hKey) // note: starting with 2.53 we'll "forget" the times in disabled FROM/TO controls (see TimeMode == fctmFromTo condition) // if users request a return to the old behavior, we could by default disable the checkboxes in the Date controls, // which would not meet the UseFromDate/UseToDate condition; we would enable the checkbox only when the user enables the control via radio buttons - if (From != def.From && TimeMode == fctmFromTo && (UseFromDate || UseFromTime)) // there's no point in storing times when they are not used (controls would insert the current time) + if (From != def.From && TimeMode == fctmFromTo && (UseFromDate || UseFromTime)) // No need to store times when they are not used (the controls then fill in the current time) { SetValue(hKey, FILTERCRITERIA_FROMLO_REG, REG_DWORD, &(((FILETIME*)&From)->dwLowDateTime), sizeof(DWORD)); SetValue(hKey, FILTERCRITERIA_FROMHI_REG, REG_DWORD, &(((FILETIME*)&From)->dwHighDateTime), sizeof(DWORD)); @@ -546,7 +546,7 @@ BOOL CFilterCriteria::Save(HKEY hKey) SetValue(hKey, FILTERCRITERIA_USETODATE_REG, REG_DWORD, &UseToDate, sizeof(DWORD)); if (UseToTime != def.UseToTime) SetValue(hKey, FILTERCRITERIA_USETOTIME_REG, REG_DWORD, &UseToTime, sizeof(DWORD)); - if (To != def.To && TimeMode == fctmFromTo && (UseToDate || UseToTime)) // there's no point in storing times when they are not used (controls would insert the current time) + if (To != def.To && TimeMode == fctmFromTo && (UseToDate || UseToTime)) // There is no point in storing times when they are not used (the controls then insert the current time) { SetValue(hKey, FILTERCRITERIA_TOLO_REG, REG_DWORD, &(((FILETIME*)&To)->dwLowDateTime), sizeof(DWORD)); SetValue(hKey, FILTERCRITERIA_TOHI_REG, REG_DWORD, &(((FILETIME*)&To)->dwHighDateTime), sizeof(DWORD)); @@ -560,7 +560,7 @@ BOOL CFilterCriteria::Load(HKEY hKey) GetValue(hKey, FILTERCRITERIA_ATTRIBUTESMASK_REG, REG_DWORD, &AttributesMask, sizeof(DWORD)); GetValue(hKey, FILTERCRITERIA_ATTRIBUTESVALUE_REG, REG_DWORD, &AttributesValue, sizeof(DWORD)); - // Size Min/Max + // Minimum/maximum size GetValue(hKey, FILTERCRITERIA_USEMINSIZE_REG, REG_DWORD, &UseMinSize, sizeof(DWORD)); GetValue(hKey, FILTERCRITERIA_MINSIZELO_REG, REG_DWORD, &MinSize.LoDWord, sizeof(DWORD)); GetValue(hKey, FILTERCRITERIA_MINSIZEHI_REG, REG_DWORD, &MinSize.HiDWord, sizeof(DWORD)); @@ -1029,7 +1029,7 @@ void CFilterCriteriaDialog::Transfer(CTransferInfo& ti) } st.wMilliseconds = 0; if (!SystemTimeToFileTime(&st, (FILETIME*)&Data->From)) - Data->From = (unsigned __int64)0; // error for validation + Data->From = (unsigned __int64)0; // error for Validate Data->UseToDate = DateTime_GetSystemtime(GetDlgItem(HWindow, IDC_FFA_TO_DATE), &st) == GDT_VALID; Data->UseToTime = DateTime_GetSystemtime(GetDlgItem(HWindow, IDC_FFA_TO_TIME), &st2) == GDT_VALID; @@ -1047,7 +1047,7 @@ void CFilterCriteriaDialog::Transfer(CTransferInfo& ti) } st.wMilliseconds = 0; if (!SystemTimeToFileTime(&st, (FILETIME*)&Data->To)) - Data->To = (unsigned __int64)0; // error for validation + Data->To = (unsigned __int64)0; // Error for Validate() } if (ti.Type == ttDataToWindow) @@ -1197,14 +1197,14 @@ void CFilterCriteriaDialog::EnableControls() BOOL minOrMax = FALSE; - // Size Min + // Minimum Size checked = IsDlgButtonChecked(HWindow, IDC_FFA_SIZEMIN) == BST_CHECKED; minOrMax |= checked; EnableWindow(GetDlgItem(HWindow, IDC_FFA_SIZEMIN_VALUE), checked); EnableWindow(GetDlgItem(HWindow, IDC_FFA_SIZEMIN_UPDOWN), checked); EnableWindow(GetDlgItem(HWindow, IDC_FFA_SIZEMIN_UNITS), checked); - // Size Max + // Maximum Size checked = IsDlgButtonChecked(HWindow, IDC_FFA_SIZEMAX) == BST_CHECKED; minOrMax |= checked; EnableWindow(GetDlgItem(HWindow, IDC_FFA_SIZEMAX_VALUE), checked); @@ -1276,9 +1276,9 @@ CFilterCriteriaDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_NOTHOUSANDS, 0, 0, 0, 0, HWindow, upDownID[i], HInstance, hEdit, 10000, i == 2 ? 1 : 0, 0); - // move the UpDown control in the z-order right after the edit line, otherwise - // on a slow machine the dialog display looked odd - // (the UpDown was drawn after all the other controls) + // move the UpDown control immediately behind the edit box in the Z-order; otherwise, + // the dialog could display oddly on a slow machine + // (the UpDown was drawn only after all other controls) SetWindowPos(hWnd, hEdit, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); } if (!EnableDirectory) @@ -1310,12 +1310,12 @@ CFilterCriteriaDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (LOWORD(wParam) == IDC_FFA_SIZEMIN_VALUE) { - // size min + // minimum size FillUnits(IDC_FFA_SIZEMIN_VALUE, IDC_FFA_SIZEMIN_UNITS, sizeUnits, TRUE); } if (LOWORD(wParam) == IDC_FFA_SIZEMAX_VALUE) { - // size max + // maximum size FillUnits(IDC_FFA_SIZEMAX_VALUE, IDC_FFA_SIZEMAX_UNITS, sizeUnits, TRUE); } if (LOWORD(wParam) == IDC_FFA_TIMEDURING_VALUE) From 109d07561f58322899b305b0ba1ffe0be6679e69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:24:38 +0200 Subject: [PATCH 408/710] [translation] Fix src/find.cpp comments Refines translated comments in src/find.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #877 for src/find.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/find.cpp | 68 ++++++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/src/find.cpp b/src/find.cpp index 91b290db6..d450128d0 100644 --- a/src/find.cpp +++ b/src/find.cpp @@ -380,7 +380,7 @@ BOOL CFindIgnore::Save(HKEY hKey) if (CreateKey(hKey, buf, subKey)) { SetValue(subKey, FINDIGNOREITEM_PATH_REG, REG_SZ, Items[i]->Path, -1); - if (!Items[i]->Enabled) // save only if it is FALSE + if (!Items[i]->Enabled) // save only when FALSE SetValue(subKey, FINDIGNOREITEM_ENABLED_REG, REG_DWORD, &Items[i]->Enabled, sizeof(DWORD)); CloseKey(subKey); } @@ -413,9 +413,9 @@ BOOL CFindIgnore::Load(HKEY hKey, DWORD cfgVersion) item->Enabled = TRUE; // saved only if it is FALSE if (Configuration.ConfigVersion < 32) { - // users were confused that this folder was not searched - // so we keep it listed but uncheck the checkbox - // anyone interested can manually enable it + // users were confused that this folder was not being searched + // so we keep it in the list, but clear the checkbox + // anyone who wants to can enable it if (strcmp(item->Path, "Local Settings\\Temporary Internet Files") == 0) item->Enabled = FALSE; } @@ -550,7 +550,7 @@ BOOL CFindIgnore::Contains(const char* path, int startPathLen) m = StrIStr(m, item->Path); if (m != NULL) // found { - if ((m - path) + item->Len > startPathLen) // is it a subpath? then ignore it + if ((m - path) + item->Len > startPathLen) // subpath: ignore it return TRUE; m++; // look for another occurrence, maybe it will be in a subpath } @@ -694,8 +694,8 @@ class CDuplicateCandidates : public TIndirectArray // before calling this method, the array must be sorted with QuickSort void RemoveSingleFiles(BOOL byName, BOOL bySize, BOOL byMD5); - // goes through all stored items and uses CompareFunc assign them - // to groups; Alternates the Different bit for the groups (0, 1, 0, 1, 0, 1, ...) + // Goes through all stored items and uses CompareFunc to assign them + // to groups; alternates the Different bit for the groups (0, 1, 0, 1, 0, 1, ...) // before calling this method, the array must be sorted with QuickSort void SetDifferentFlag(BOOL byName, BOOL bySize, BOOL byMD5); @@ -780,7 +780,7 @@ void CDuplicateCandidates::QuickSort(int left, int right, BOOL byName, BOOL bySi } } while (i <= j); - // the following "nice" code was replaced by a version that saves stack space (max. log(N) recursion depth) + // the following code was replaced by a version that uses substantially less stack space (max. log(N) recursion depth) // if (left < j) QuickSort(left, j, byName, bySize, byMD5); // if (i < right) QuickSort(i, right, byName, bySize, byMD5); @@ -839,7 +839,7 @@ BOOL CDuplicateCandidates::GetMD5Digest(CGrepData* data, CFoundFilesData* file, DWORD read; // number of bytes that were actually read while (TRUE) { - // read a segment from a file 'file' into 'buffer' + // read a segment from file 'file' into 'buffer' if (!ReadFile(hFile, buffer, DUPLICATES_BUFFER_SIZE, &read, NULL)) { // error reading the file @@ -1019,7 +1019,7 @@ void CDuplicateCandidates::Examine(CGrepData* data) // search completed, preparing results (MD5 computation may still follow) data->SearchingText->Set(LoadStr(IDS_FIND_DUPS_RESULTS)); - // sort them according to selected criteria + // sort them by the selected criteria QuickSort(0, Count - 1, byName, bySize, FALSE); // remove items that occur only once @@ -1087,7 +1087,7 @@ void CDuplicateCandidates::Examine(CGrepData* data) int j; for (j = 0; j <= i; j++) Delete(0); - break; // show at least the duplicates that have been already found + break; // show at least the duplicates found so far } // an error occurred during reading the file but the user wants to continue // exclude the file from candidates @@ -1250,10 +1250,10 @@ BOOL TestFileContentAux(BOOL& ok, CQuadWord& fileOffset, const CQuadWord& totalS fileOffset + CQuadWord(viewSize, 0) < totalSize) // the end of the file is not in the file view { // the line can continue beyond the boundary of the current view of the file fileOffset += CQuadWord(DWORD(beg - txt), 0); - return TRUE; // continue with the next view segment + return TRUE; // continue with the next file view } - // line beg->end + // line: beg->end if (data->RegExp.SetLine(beg, end)) { int foundLen, start = 0; @@ -1385,7 +1385,7 @@ BOOL TestFileContent(DWORD sizeLow, DWORD sizeHigh, const char* path, CGrepData* CQuadWord allocGran(AllocationGranularity, 0); while (!data->StopSearch && fileOffset < totalSize) { - // ensure the offset matches the granularity + // ensure the offset is aligned to the allocation granularity CQuadWord mapFileOffset(fileOffset); mapFileOffset = (mapFileOffset / allocGran) * allocGran; @@ -1401,7 +1401,7 @@ BOOL TestFileContent(DWORD sizeLow, DWORD sizeHigh, const char* path, CGrepData* viewSize)); if (txt != NULL) { - // let the file view be examined + // let the file view be searched DWORD diff = (DWORD)(fileOffset - mapFileOffset).Value; BOOL err2 = !TestFileContentAux(ok, fileOffset, totalSize, viewSize - diff, path, txt + diff, data); @@ -1445,7 +1445,7 @@ BOOL AddFoundItem(const char* path, const char* name, DWORD sizeLow, DWORD sizeH DWORD attr, const FILETIME* lastWrite, BOOL isDir, CGrepData* data, CDuplicateCandidates* duplicateCandidates) { - if (duplicateCandidates != NULL && isDir) // directories are irrelevant to us when searching for duplicates + if (duplicateCandidates != NULL && isDir) // directories are ignored when searching for duplicates return TRUE; CFoundFilesData* foundData = new CFoundFilesData; @@ -1513,16 +1513,16 @@ BOOL AddFoundItem(const char* path, const char* name, DWORD sizeLow, DWORD sizeH return TRUE; } -// 'dirStack' stores directories for late grepping. Otherwise, -// during searching in the current directory, recursive searching in subdirectories would occur. With this -// trick all files and directories matching the criteria are found first and -// then this function is called for all discovered directories. -// 'dirStack' only grows. When items are removed from it, they are just destroyed but -// not removed from the array, therefore the variable 'dirStackCount' holds the +// 'dirStack' stores directories to be grep-searched later. Otherwise, +// searching the current directory would recursively search its subdirectories. +// With this workaround, all files and directories matching the criteria are found first, +// and then this function is called for all discovered directories. +// 'dirStack' only grows. When items are removed from it, they are only destroyed, +// but not removed from the array. Therefore, the variable 'dirStackCount' holds the // actual number of items in the array (always less than or equal to dirStack->Count). // If memory is low or subdirectories are not searched, // 'dirStack' is NULL. -// If 'duplicateCandidates' != NULL, found items will be added to this array +// If 'duplicateCandidates' != NULL, found items are added to this array // instead of data->FoundFilesListView void SearchDirectory(char (&path)[MAX_PATH], char* end, int startPathLen, CMaskGroup* masksGroup, BOOL includeSubDirs, CGrepData* data, @@ -1598,7 +1598,7 @@ void SearchDirectory(char (&path)[MAX_PATH], char* end, int startPathLen, { // file name // let the extension be resolved if ext==NULL - if (masksGroup->AgreeMasks(file.cFileName, NULL)) // mask is OK + if (masksGroup->AgreeMasks(file.cFileName, NULL)) // mask matches { BOOL ok; if (data->Grep) @@ -1639,11 +1639,11 @@ void SearchDirectory(char (&path)[MAX_PATH], char* end, int startPathLen, } } } - if (isDir && includeSubDirs && !ignoreDir) // directory + not "." or ".." + if (isDir && includeSubDirs && !ignoreDir) // directory and not "." or ".." { int l = (int)strlen(file.cFileName); - if ((end - path) + l + 1 /* 1 za backslash */ < _countof(path)) + if ((end - path) + l + 1 /* 1 for the backslash */ < _countof(path)) { BOOL searchNow = TRUE; @@ -1700,7 +1700,7 @@ void SearchDirectory(char (&path)[MAX_PATH], char* end, int startPathLen, } } } - else // too long file-name + else // file name too long { FIND_LOG_ITEM log; log.Flags = FLI_ERROR; @@ -1803,7 +1803,7 @@ void RefineData(CMaskGroup* masksGroup, CGrepData* data) { char buf[20]; sprintf(buf, "%d%%", progress); - data->SearchingText->Set(buf); // set the current path + data->SearchingText->Set(buf); // update the progress text oldProgress = progress; } } @@ -1938,8 +1938,8 @@ unsigned GrepThreadFBody(void* ptr) TRACE_E(LOW_MEMORY); // the algorithm will run even without the stack } - // create a local copy of the ignore list since it has to be processed anyway - // and as a bonus the user can edit the ignore list while searching + // make a local copy of the ignore list, since it has to be processed anyway + // this also allows the user to edit the ignore list while the search is in progress CFindIgnore* ignoreList = new CFindIgnore; if (ignoreList == NULL) TRACE_E(LOW_MEMORY); // the algorithm will run even without the ignore list @@ -2138,10 +2138,10 @@ unsigned ThreadFindDialogMessageLoopBody(void* parameter) if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { if (msg.message == WM_QUIT) - break; // equivalent to the situation when GetMessage() is returning FALSE + break; // equivalent to the situation where GetMessage() returns FALSE haveMSG = TRUE; // a message is pending; process it without calling GetMessage() } - else // if there is no message in the queue, perform Idle processing + else // if the queue is empty, perform idle processing { if (findDialog != NULL) findDialog->OnEnterIdle(); @@ -2153,7 +2153,7 @@ unsigned ThreadFindDialogMessageLoopBody(void* parameter) } #ifndef CALLSTK_DISABLE - CCallStack::ReleaseBeforeExitThread(); // before exiting the thread, we must release call-stack data (still in protected section - generating our bug report) + CCallStack::ReleaseBeforeExitThread(); // before the thread exits, call-stack data must be released (we are still in the protected section used to generate our bug report) #endif // CALLSTK_DISABLE _endthreadex(ok ? 0 : 1); return ok ? 0 : 1; // dead code to keep the compiler happy @@ -2172,7 +2172,7 @@ unsigned ThreadFindDialogMessageLoopEH(void* param) { TRACE_I("Thread FindDialogMessageLoop: calling ExitProcess(1)."); // ExitProcess(1); - TerminateProcess(GetCurrentProcess(), 1); // harder exit (this call still performs some operations) + TerminateProcess(GetCurrentProcess(), 1); // more forceful exit (ExitProcess still calls some code) return 1; } #endif // CALLSTK_DISABLE From 5a956fba8b0cd5887e41a85d6670d44662a8d0d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:24:53 +0200 Subject: [PATCH 409/710] [translation] Fix src/find.h comments Refines translated comments in src/find.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #878 for src/find.h, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/find.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/find.h b/src/find.h index ae69e76f1..c24e8fbaf 100644 --- a/src/find.h +++ b/src/find.h @@ -269,9 +269,9 @@ class CFindIgnoreItem }; // The CFindIgnore object serves two purposes: -// 1. A global object holding the list of paths editable in the Find/Options/Ignore Directory List -// 2. A temporary copy used for searching -- contains only Enabled items which are -// adjusted (backslashes added) and classified (CFindIgnoreItem::Type set) +// 1. A global object holding the list of paths editable in Find/Options/Ignore Directory List +// 2. A temporary copy of this array for searching; it contains only enabled items, which are +// additionally adjusted (backslashes added) and qualified (CFindIgnoreItem::Type set) class CFindIgnore { protected: @@ -691,7 +691,7 @@ class CFindDialog : public CCommonDialog int ResultsY; // position of the results list int AdvancedY; // position of the Advanced button int AdvancedTextY; // position of the text after the Advanced button - int AdvancedTextX; // position of the text after the Advanced button + int AdvancedTextX; // X position of the text after the Advanced button int FindTextY; // position of the header above the results int FindTextH; // height of the header int CombosX; // position of the comboboxes @@ -715,7 +715,7 @@ class CFindDialog : public CCommonDialog CMenuBar* MenuBar; HWND HStatusBar; HWND HProgressBar; // status bar child window shown for certain operations in a special field - BOOL TwoParts; // does the status bar have two texts? + BOOL TwoParts; // does the status bar have two text fields? // CFindAdvancedDialog FindAdvanced; CFoundFilesListView* FoundFilesListView; char FoundFilesDataTextBuffer[MAX_PATH]; // for obtaining text from CFoundFilesData::GetText @@ -746,7 +746,7 @@ class CFindDialog : public CCommonDialog CBitmap* CacheBitmap; // used when drawing the path - BOOL FlashIconsOnActivation; // flash the status icons when we get activated + BOOL FlashIconsOnActivation; // flash the status icons on activation char FindNowText[100]; From 0297f1e64711e2836dbef7284819287f85c10613 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:25:08 +0200 Subject: [PATCH 410/710] [translation] Fix src/finddlg1.cpp comments Refines translated comments in src/finddlg1.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #879 for src/finddlg1.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/finddlg1.cpp | 66 ++++++++++++++++++++++++------------------------ 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/src/finddlg1.cpp b/src/finddlg1.cpp index dd15f41b7..2bf89bffe 100644 --- a/src/finddlg1.cpp +++ b/src/finddlg1.cpp @@ -460,7 +460,7 @@ void CFoundFilesListView::SortItems(int sortBy) BOOL enabledPathTime = TRUE; if (FindDialog->GrepData.FindDuplicates) { - enabledPathTime = FALSE; // path and time are irrelevant for duplicates + enabledPathTime = FALSE; // not meaningful for duplicates // sorting by name and size works for duplicates only // when searching for identical name and size enabledNameSize = (FindDialog->GrepData.FindDupFlags & FIND_DUPLICATES_NAME) && @@ -607,7 +607,7 @@ int CFoundFilesListView::CompareFunc(CFoundFilesData* f1, CFoundFilesData* f2, i int next = sortBy; do { - if (f1->IsDir == f2->IsDir) // are the items from the same group (directories/files)? + if (f1->IsDir == f2->IsDir) // Are the items in the same group (directories/files)? { switch (next) { @@ -948,7 +948,7 @@ CFoundFilesListView::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) HANDLES(EnterCriticalSection(&DataCriticalSection)); BOOL selExists = FALSE; - if (FileNamesEnumData.PreferSelected) // if needed, check whether there is a selection + if (FileNamesEnumData.PreferSelected) // if needed, check whether anything is selected { int i = -1; int selCount = 0; // ignore the state where the only marked item is the focused one (this cannot logically be considered as selected items) @@ -981,7 +981,7 @@ CFoundFilesListView::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) } else { - if (FileNamesEnumData.LastFileName[0] != 0) // the full name at 'index' is known; check for shifts and search for a new index if needed + if (FileNamesEnumData.LastFileName[0] != 0) // the full file name at 'index' is known; check whether the array has shifted and find the new index if needed { BOOL ok = FALSE; CFoundFilesData* f = (index >= 0 && index < count) ? Data[index] : NULL; @@ -997,7 +997,7 @@ CFoundFilesListView::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) } } if (!ok) - { // the name at index 'index' isn't FileNamesEnumData.LastFileName, try to find a new index for that name + { // the name at index 'index' is not FileNamesEnumData.LastFileName; try to find that name's new index int i; for (i = 0; i < count; i++) { @@ -1240,7 +1240,7 @@ BOOL CFoundFilesListView::InitColumns() p++; if (IsAlpha[*p]) { - // contains alphabetic characters -- we must find the longest month and day text + // contains alphabetic characters -- we must find the longest month and day names int maxMonth = 0; int sats[] = {1, 5, 4, 1, 6, 3, 1, 5, 2, 7, 4, 2}; int mo; @@ -1776,9 +1776,9 @@ void CFindDialog::BuildSerchForData() char* begin; char* end; - // Users often want to enter just "i_am_dummy" to find files "*i_am_dummy*". - // Therefore, we must inspect each item from the mask group and, if it lacks - // any wildcard or '.', surround it with asterisks. + // Users often want to enter just "i_am_dummy" to find files like "*i_am_dummy*". + // Therefore, we must inspect each item in the mask group and, if it contains neither + // a wildcard nor '.', surround it with asterisks. char* iterator = named; begin = Data.NamedText; while (1) @@ -1950,7 +1950,7 @@ void CFindDialog::StartSearch(WORD command) case CM_FIND_INTERSECT: { - // if this is a refine operation, copy data into the DataForRefine array + // if this is a refine operation, move the data to the DataForRefine array FoundFilesListView->TakeDataForRefine(); GrepData.Refine = 1; break; @@ -1993,7 +1993,7 @@ void CFindDialog::StartSearch(WORD command) GrepData.EOL_CRLF = Configuration.EOL_CRLF; GrepData.EOL_CR = Configuration.EOL_CR; GrepData.EOL_LF = Configuration.EOL_LF; - // GrepData.EOL_NULL = Configuration.EOL_NULL; // can't handle this with regexp :( + // GrepData.EOL_NULL = Configuration.EOL_NULL; // regexp cannot handle this GrepData.Regular = Data.RegularExpresions; GrepData.WholeWords = Data.WholeWords; if (Data.RegularExpresions) @@ -2087,7 +2087,7 @@ void CFindDialog::StopSearch() while (1) { BOOL oldCanClose = CanClose; - CanClose = FALSE; // don't allow closing while we are inside this method + CanClose = FALSE; // do not allow closing while this method is running if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { // message loop for messages from the grep thread @@ -2097,7 +2097,7 @@ void CFindDialog::StopSearch() CanClose = oldCanClose; if (GrepThread == NULL) - return; // DispatchMessage may call us again and we've already handled closing + return; // DispatchMessage may call us again, and closing has already been handled if (WaitForSingleObject(GrepThread, 100) != WAIT_TIMEOUT) break; } @@ -2106,7 +2106,7 @@ void CFindDialog::StopSearch() GrepThread = NULL; SearchInProgress = FALSE; - if (OKButton != NULL) // trigger the drop-down arrow + if (OKButton != NULL) // enable the drop-down arrow { DWORD flags = OKButton->GetFlags(); flags |= BTF_DROPDOWN; @@ -2487,7 +2487,7 @@ void CFindDialog::OnViewFileWith() MainWindow->GetActivePanel()->ViewFileWith(longName, FoundFilesListView->HWindow, &menuPoint, &handlerID, -1, -1); if (handlerID != 0xFFFFFFFF) { - if (SalamanderBusy) // almost impossible, but Salamander could be busy + if (SalamanderBusy) // unlikely, but Salamander could have become busy { Sleep(200); // give Salamander time-if we switched from the main window // the menu's message queue might still be running @@ -2534,7 +2534,7 @@ void CFindDialog::OnEditFileWith() MainWindow->GetActivePanel()->EditFileWith(longName, FoundFilesListView->HWindow, &menuPoint, &handlerID); if (handlerID != 0xFFFFFFFF) { - if (SalamanderBusy) // almost impossible, but Salamander could be busy + if (SalamanderBusy) // almost impossible, but someone could have kept Salamander busy { Sleep(200); // give Salamander time-if we switched from the main window // the menu's message queue might still be running @@ -2562,9 +2562,9 @@ void CFindDialog::OnUserMenu() MainWindow->FillUserMenu(&menu, FALSE); // keep customization disabled POINT p; GetListViewContextMenuPos(FoundFilesListView->HWindow, &p); - // another locking round (BeginUserMenuIconsInUse+EndUserMenuIconsInUse) will happen - // inside WM_USER_ENTERMENULOOP and WM_USER_LEAVEMENULOOP; it's nested and has no overhead, - // so we ignore it and don't try to fight it + // another locking round (BeginUserMenuIconsInUse+EndUserMenuIconsInUse) will occur + // in WM_USER_ENTERMENULOOP+WM_USER_LEAVEMENULOOP, but it is already nested and adds no overhead, + // so it is ignored and no special handling is needed DWORD cmd = menu.Track(MENU_TRACK_RETURNCMD, p.x, p.y, HWindow, NULL); UserMenuIconBkgndReader.EndUserMenuIconsInUse(); @@ -2746,7 +2746,7 @@ void CFindDialog::InsertDrives(HWND hEdit, BOOL network) int i = 1; while (i != 0) { - if (mask & i) // the drive is accessible + if (mask & i) // the drive is available { root[0] = drive; DWORD driveType = GetDriveType(root); @@ -2867,7 +2867,7 @@ BOOL CFindDialog::ManageHiddenShortcuts(const MSG* msg) } } } - return FALSE; // not our message + return FALSE; // message not handled here } void CFindDialog::SetFullRowSelect(BOOL fullRow) @@ -3086,7 +3086,7 @@ CFindDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) query = FALSE; else { - if (SearchInProgress) // stop searching immediately if the user wants + if (SearchInProgress) // stop searching immediately if the user wants to StopSearch(); } } @@ -3323,7 +3323,7 @@ CFindDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) StopSearch(); return TRUE; } - else // no, it is the start + else // no, this is a start request { if (!ValidateData() || !TransferData(ttDataFromWindow)) return TRUE; @@ -3859,7 +3859,7 @@ MENU_TEMPLATE_ITEM FindLookInBrowseMenu[] = if (SkipCharacter) // suppress the beep on Alt+Enter { SkipCharacter = FALSE; - return TRUE; // MSDN says we should return 0, but that beeps, so I am not sure + return TRUE; // MSDN says we should return 0, but that causes a beep } break; } @@ -3872,7 +3872,7 @@ MENU_TEMPLATE_ITEM FindLookInBrowseMenu[] = { case NM_DBLCLK: { - if (((LPNMITEMACTIVATE)lParam)->iItem >= 0) // double-click outside items does nothing + if (((LPNMITEMACTIVATE)lParam)->iItem >= 0) // double-click outside an item does not open anything OnOpen(TRUE); break; } @@ -3880,14 +3880,14 @@ MENU_TEMPLATE_ITEM FindLookInBrowseMenu[] = case NM_RCLICK: { int clickedIndex = ((LPNMITEMACTIVATE)lParam)->iItem; - if (clickedIndex >= 0) // right-click outside the item won't show the menu + if (clickedIndex >= 0) // right-click outside an item will not show the menu { BOOL controlPressed = (GetKeyState(VK_CONTROL) & 0x8000) != 0; BOOL altPressed = (GetKeyState(VK_MENU) & 0x8000) != 0; BOOL shiftPressed = (GetKeyState(VK_SHIFT) & 0x8000) != 0; - // when clicking outside the selection while holding Shift (Alt+Ctrl doesn't matter) or - // holding only Alt, the selection changes to the clicked item before the menu is opened + // when clicking outside the selection while holding Shift (Alt+Ctrl does not matter), or + // while holding only Alt, the selection changes to the clicked item before the menu opens HWND hListView = FoundFilesListView->HWindow; if ((shiftPressed || altPressed && !controlPressed) && (ListView_GetItemState(hListView, clickedIndex, LVIS_SELECTED) & LVIS_SELECTED) == 0) @@ -3936,7 +3936,7 @@ MENU_TEMPLATE_ITEM FindLookInBrowseMenu[] = CacheBitmap->CreateBmp(hDC, 1, 1); } if (CacheBitmap == NULL) - break; // out of memory; let the list view draw it; we're done + break; // out of memory; let the list view handle drawing; abort custom drawing RECT r; // rectangle around the sub item ListView_GetSubItemRect(FoundFilesListView->HWindow, cd->nmcd.dwItemSpec, cd->iSubItem, LVIR_BOUNDS, &r); @@ -3988,8 +3988,8 @@ MENU_TEMPLATE_ITEM FindLookInBrowseMenu[] = SelectObject(CacheBitmap->HMemDC, (HFONT)SendMessage(FoundFilesListView->HWindow, WM_GETFONT, 0, 0)); int oldTextColor = SetTextColor(CacheBitmap->HMemDC, GetSysColor(textColor)); - // DT_PATH_ELLIPSIS doesn't work on some strings and causing clipped text to be printed - // PathCompactPath() requires a copy in a local buffer but doesn't clip text + // DT_PATH_ELLIPSIS does not work for some strings and can cause clipped text to be drawn + // PathCompactPath() requires a copy in a local buffer, but it does not clip the text char buff[2 * MAX_PATH]; strncpy_s(buff, _countof(buff), item2->Path, _TRUNCATE); PathCompactPath(CacheBitmap->HMemDC, buff, r2.right - r2.left); @@ -4289,8 +4289,8 @@ MENU_TEMPLATE_ITEM FindLookInBrowseMenu[] = case WM_ACTIVATEAPP: { - if (wParam == FALSE) // when deactivated we leave directories shown in panels - { // so they can be deleted, dissconected, etc. by other software + if (wParam == FALSE) // when deactivated, we leave the directories shown in the panels + { // so other software can delete or disconnect them, etc. if (CanChangeDirectory()) SetCurrentDirectoryToSystem(); } From 4e65f82ae463575323233d3df6af5d41cbe3a0a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:25:24 +0200 Subject: [PATCH 411/710] [translation] Fix src/finddlg2.cpp comments Refines translated comments in src/finddlg2.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #880 for src/finddlg2.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/finddlg2.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/finddlg2.cpp b/src/finddlg2.cpp index 934815360..875874c9c 100644 --- a/src/finddlg2.cpp +++ b/src/finddlg2.cpp @@ -438,7 +438,7 @@ void CFindTBHeader::StartFlashIcon() { StopFlash = FALSE; if (GetForegroundWindow() != HNotifyWindow) - SendMessage(HNotifyWindow, WM_USER_FLASHICON, 0, 0); // if we are not active, postpone flashing + SendMessage(HNotifyWindow, WM_USER_FLASHICON, 0, 0); // if we are not active, defer flashing until later else SetTimer(HWindow, IDT_FLASHICON, FLASH_ICON_DELAY, NULL); FlashIconCounter = FLASH_ICON_COUNT; @@ -1235,7 +1235,7 @@ BOOL CFindDialog::GetCommonPrefixPath(char* buffer, int bufferMax, int& commonPr pathLen = count; } if (count == 0) - return FALSE; // there is no common path part + return FALSE; // no common part of the path } } } while (index != -1); @@ -1394,10 +1394,10 @@ void CFindDialog::OnDrag(BOOL rightMouseButton) { // returns dwEffect == 0 for MOVE, see the "Handling Shell Data Transfer Scenarios" section // "Handling Optimized Move Operations": http://msdn.microsoft.com/en-us/library/windows/desktop/bb776904%28v=vs.85%29.aspx - // shortened: an optimized Move is performed, meaning no copy is made to the target followed by deletion - // of the original. this avoids accidentally deleting the source before it’s actually moved (which might not be moved yet), - // the operation returns DROPEFFECT_NONE or DROPEFFECT_COPY, - // so we implement this workaround + // shortened: an optimized Move is performed, meaning no copy to the target followed by deletion + // of the original is done, so the source does not accidentally delete the original before it + // is actually moved; the operation result is DROPEFFECT_NONE or DROPEFFECT_COPY, + // so we use this workaround if (!rightMouseButton && // right button has a menu: dropSource->LastEffect contains the effect before showing the menu, not the final one: the final effect (except for Move) is in dwEffect - for Move it is 0, same as for Cancel, so we cannot distinguish Move from Cancel and therefore we’d better not delete anything (dropSource->LastEffect & DROPEFFECT_MOVE)) { From 4dd2db553aa76ac7408d44500c39f29493f7c9d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:25:39 +0200 Subject: [PATCH 412/710] [translation] Fix src/geticon.cpp comments Refines translated comments in src/geticon.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #881 for src/geticon.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/geticon.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/geticon.cpp b/src/geticon.cpp index cfd92ae58..2058db47f 100644 --- a/src/geticon.cpp +++ b/src/geticon.cpp @@ -66,7 +66,7 @@ BOOL SalGetIconFromPIDL(IShellFolder* psf, const char* path, LPCITEMIDLIST pidl, { BOOL ret = FALSE; - IExtractIconA* pxi = NULL; // if 'isIExtractIconW' is TRUE, this pointer is actually IExtractIconW + IExtractIconA* pxi = NULL; // if 'isIExtractIconW' is TRUE, this pointer is of type IExtractIconW BOOL isIExtractIconW = FALSE; HICON hIconSmall = NULL; HICON hIconLarge = NULL; @@ -227,7 +227,7 @@ BOOL SalGetIconFromPIDL(IShellFolder* psf, const char* path, LPCITEMIDLIST pidl, else hres = pxi->Extract(iconFile, iconIndex, &hIconLarge, &hIconSmall, MAKELONG(IconSizes[largeIconSize], IconSizes[ICONSIZE_16])); //TRACE_I(" SalGetIconFromPIDL() pxi->Extract() hIconLarge="<ToolTip->SetCurrentToolTip(HWindow, 1, -1); MainWindow->ToolTip->Show(r.left + xOffset, r.bottom, FALSE, TRUE, HWindow); - // note: Show has the parameter 'modal'==TRUE, so control returns here only after the tooltip is closed + // Show is called with modal == TRUE, so execution returns here only after the tooltip is closed. return TRUE; } @@ -988,7 +988,7 @@ CStaticText::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) { if (wParam == TRUE) break; - // if someone hides us, we must dismiss the tooltip + // if we are hidden, we must dismiss the tooltip if (MainWindow != NULL && MainWindow->ToolTip != NULL && MainWindow->ToolTip->HWindow != NULL) MainWindow->ToolTip->Hide(); //PostMessage(MainWindow->ToolTip->HWindow, WM_CANCELMODE, 0, 0); @@ -1065,7 +1065,7 @@ CStaticText::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) PAINTSTRUCT ps; HANDLES(BeginPaint(HWindow, &ps)); - // if we have a bitmap,we will draw into it, otherwise directly to the screen + // if we have a bitmap, draw into it; otherwise draw directly to the screen HDC hDC; if (Bitmap != NULL) hDC = Bitmap->HMemDC; @@ -1121,8 +1121,8 @@ CStaticText::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) else drawFlags |= DT_LEFT; // because ClearType spills beyond the control and leaves stray colored dots, we must - // clip everything; the issue is visible in the Plugins Manager Salamander 2.51 when scrolling - // the plugin list, leaving a red dot before the URL + // clip everything; the issue is visible in Salamander 2.51's Plugins Manager when scrolling + // the plugin list up and down: a red dot remains before the URL // if (!ClipDraw) drawFlags |= DT_NOCLIP; @@ -1281,15 +1281,15 @@ BOOL CHyperLink::ExecuteIt() void CHyperLink::OnContextMenu(int x, int y) { - /* used by the export_mnu.py script that generates salmenu.mnu for the Translator + /* used by the export_mnu.py script, which generates salmenu.mnu for Translator keep synchronized with the InsertMenu() call below... -MENU_TEMPLATE_ITEM HyperLinkMenu[] = -{ - {MNTT_PB, 0 - {MNTT_IT, IDS_COPYTOCLIPBOARD - {MNTT_PE, 0 -}; -*/ + MENU_TEMPLATE_ITEM HyperLinkMenu[] = + { + {MNTT_PB, 0 + {MNTT_IT, IDS_COPYTOCLIPBOARD + {MNTT_PE, 0 + }; + */ HMENU hMenu = CreatePopupMenu(); InsertMenu(hMenu, 0, MF_BYPOSITION, 1, LoadStr(IDS_COPYTOCLIPBOARD)); DWORD cmd = TrackPopupMenuEx(hMenu, TPM_RETURNCMD | TPM_LEFTALIGN | TPM_RIGHTBUTTON, @@ -1771,7 +1771,7 @@ int CButton::HitTest(LPARAM lParam) RECT r = ClientRect; r.left = r.right - GetDropPartWidth() - 1; if (PtInRect(&r, p)) - return 2; // drop down + return 2; // drop-down part } return 1; // button @@ -2953,10 +2953,10 @@ CAnimate::IsGood() void CAnimate::Paint(HDC hdc) { - // just to be safe, we synchronize access to the bitmap + // just to be safe, synchronize access to the bitmap HANDLES(EnterCriticalSection(&GDICriticalSection)); - // if no DC is provided, we obtain our own + // if no DC is provided, obtain our own HDC hDC; if (hdc == NULL) hDC = HANDLES(GetDC(HWindow)); @@ -3046,8 +3046,8 @@ CAnimate::ThreadF(void *param) handles[0] = animate->HTerminateEvent; // must be at index zero because it has priority handles[1] = animate->HRunEvent; - // raise the thread priority so the animation doesn't buffer - // we can afford it because it consumes almost no time + // raise the thread priority so the animation does not stutter + // we can afford it because it takes almost no time SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_HIGHEST); while (TRUE) @@ -3055,9 +3055,9 @@ CAnimate::ThreadF(void *param) DWORD wait = WaitForMultipleObjects(2, handles, FALSE, INFINITE); if (wait == WAIT_OBJECT_0) - break; // we need to terminate the thread + break; // terminate the thread - if (animate->SleepThread) // we should stop the animation + if (animate->SleepThread) // stop the animation { animate->FirstFrame(); // move to the first frame ResetEvent(animate->HRunEvent); // and disable running @@ -3067,8 +3067,8 @@ CAnimate::ThreadF(void *param) animate->Paint(); // move to the next one animate->NextFrame(); - // 1000ms / 40ms = 25 frames per second, just like in a movie - WaitForSingleObject(animate->HTerminateEvent, 40); // if we should exit, we wll not wait unnecessarily + // 1000 ms / 40 ms = 25 frames per second, like in a movie + WaitForSingleObject(animate->HTerminateEvent, 40); // if we are terminating, do not wait here unnecessarily } TRACE_I("End"); return 0; @@ -3089,7 +3089,7 @@ CAnimate::AuxThreadEH(void *param) { TRACE_I("Thread in CAnimate: calling ExitProcess(1)."); // ExitProcess(1); - TerminateProcess(GetCurrentProcess(), 1); // harder exit (this call still performs some operations) + TerminateProcess(GetCurrentProcess(), 1); // more forceful exit return 1; } #endif // CALLSTK_DISABLE @@ -3341,7 +3341,7 @@ void CondenseStaticTexts(HWND hWindow, int* staticsArr) while (staticsArr[count] != 0) count++; if (count < 2) - return; // there isnothing to do + return; // nothing to do HFONT hFont = (HFONT)SendDlgItemMessage(hWindow, staticsArr[0], WM_GETFONT, 0, 0); HDC hDC = HANDLES(GetDC(hWindow)); @@ -3388,7 +3388,7 @@ BOOL CALLBACK FindHorizLines(HWND hwnd, LPARAM lParam) { RECT r; GetClientRect(hwnd, &r); - if (r.bottom == 0) // horizontal line 0 points high + if (r.bottom == 0) // horizontal line with zero height { LONG style = GetWindowLong(hwnd, GWL_STYLE); if ((style & SS_TYPEMASK) == SS_ETCHEDHORZ) @@ -3426,7 +3426,7 @@ struct CDataForFindHorizLineLabel BOOL CALLBACK FindHorizLineLabel(HWND hwnd, LPARAM lParam) { CDataForFindHorizLineLabel* data = (CDataForFindHorizLineLabel*)lParam; - if (data->Line != hwnd) // skip the line for which we search a label + if (data->Line != hwnd) // skip the line whose label we are looking for { RECT r; GetWindowRect(hwnd, &r); @@ -3454,7 +3454,7 @@ BOOL CALLBACK FindHorizLineLabel(HWND hwnd, LPARAM lParam) } else { - if (stricmp(className, "Button") == 0) // it's a button (check box, radio button, or push button) + if (stricmp(className, "Button") == 0) // this is a button (check box, radio button, or push button) { if (((style & BS_TYPEMASK) == BS_CHECKBOX || (style & BS_TYPEMASK) == BS_AUTOCHECKBOX || @@ -3491,7 +3491,7 @@ struct CDataForFindGroupBoxLabel BOOL CALLBACK FindGroupBoxLabel(HWND hwnd, LPARAM lParam) { CDataForFindGroupBoxLabel* data = (CDataForFindGroupBoxLabel*)lParam; - if (data->GroupBox != hwnd) // skip the group box for which we search a label + if (data->GroupBox != hwnd) // skip the group box whose label we are looking for { RECT r; GetWindowRect(hwnd, &r); @@ -3595,7 +3595,7 @@ void ArrangeHorizontalLines(HWND hWindow) -lf.lfHeight < 16 ? 20 : // < 150% DPI -lf.lfHeight < 21 ? 25 - : 27; // < 200% DPI : == 200% DPI + : 27; // >= 200% DPI if (p2.x + (data.LineRect.right - data.LineRect.left) > p.x + boxSize + txtR.right + 2 * spaceWidth) { MoveWindow(data.Label, p.x, p.y, boxSize + txtR.right + spaceWidth, labelRect.bottom - labelRect.top, TRUE); From b52c02c848ce380ead2ff342ac9021d8d48897cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:26:10 +0200 Subject: [PATCH 414/710] [translation] Fix src/inflate.cpp comments Refines translated comments in src/inflate.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #883 for src/inflate.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/inflate.cpp | 112 ++++++++++++++++++++++++------------------------ 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/src/inflate.cpp b/src/inflate.cpp index f651b39fc..1926aec4a 100644 --- a/src/inflate.cpp +++ b/src/inflate.cpp @@ -9,8 +9,8 @@ /* inflate.c -- modified by Lucas Cerman & Petr Solin version 1.1, Feb 2007 - based on file inflate.c distributed with infozip, - writen by Mark Adler + based on the inflate.c file distributed with Info-ZIP, + written by Mark Adler version c16b, 29 March 1998 */ /* @@ -78,7 +78,7 @@ end-of-block. Note however that the static length tree defines 288 codes just to fill out the Huffman codes. Codes 286 and 287 cannot be used though, since there is no length base or extra bits - defined for them. Similarily, there are up to 30 distance codes. + defined for them. Similarly, there are up to 30 distance codes. However, static trees define 32 codes (all 5 bits) to fill out the Huffman codes, but the last two had better not show up in the data. 7. Unzip can check dynamic Huffman blocks for complete code sets. @@ -141,7 +141,7 @@ int huft_build(CDecompressionObject* decompress, circular buffer. The index is updated simply by incrementing and then and'ing with 0x7fff (32K-1) (window size - 1). */ // sliding window is defined in CDecompressionObject and could be -// any size greater or equal 32K +// any size greater than or equal to 32K /* Tables for deflate from PKZIP's appnote.txt. */ /* Order of the bit length code lengths */ @@ -186,7 +186,7 @@ static const uch cpdext32[] = { #define MAXDISTS 30 #endif -/* And'ing with mask_bits[n] masks the lower n bits */ +/* ANDing with mask_bits[n] masks the lower n bits */ const ush mask_bits[] = { 0x0000, 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, @@ -200,16 +200,16 @@ const ush mask_bits[] = { DUMPBITS(j) where NEEDBITS makes sure that b has at least j bits in it, and - DUMPBITS removes the bits from b. The macros use the variable k - for the number of bits in b. Normally, b and k are register - variables for speed and are initialized at the begining of a + DUMPBITS removes the bits from b. The macros use the variable k + for the number of bits in b. Normally, b and k are register + variables for speed and are initialized at the beginning of a routine that uses these macros from a global bit buffer and count. - In order to not ask for more bits than there are in the compressed - stream, the Huffman tables are constructed to only ask for just - enough bits to make up the end-of-block code (value 256). Then no - bytes need to be "returned" to the buffer at the end of the last - block. See the huft_build() routine. + In order not to ask for more bits than there are in the compressed + stream, the Huffman tables are constructed to ask for just enough + bits to make up the end-of-block code (value 256). Then no bytes + need to be "returned" to the buffer at the end of the last block. + See the huft_build() routine. */ //this function should replace NEXTBYTE macro @@ -270,7 +270,7 @@ uch NextByte(CDecompressionObject* decompress) the longer codes. The time it costs to decode the longer codes is then traded against the time it takes to make longer tables. - This results of this trade are in the variables lbits and dbits + The results of this tradeoff are reflected in the variables lbits and dbits below. lbits is the number of bits the first level table for literal/ length codes can decode in one step, and dbits is the same thing for the distance codes. Subsequent tables are also less than or equal to @@ -287,7 +287,7 @@ uch NextByte(CDecompressionObject* decompress) than five bits, flat. The optimum values for speed end up being about one bit more than those, so lbits is 8+1 and dbits is 5+1. The optimum values may differ though from machine to machine, and - possibly even between compilers. Your mileage may vary. + possibly even between compilers. */ static const int lbits = 9; /* bits in base literal/length lookup table */ @@ -295,10 +295,10 @@ static const int dbits = 6; /* bits in base distance lookup table */ #ifndef ASM_INFLATECODES -/* inflate (decompress) the codes in a deflated (compressed) block. - Return an error code or zero if it all goes ok. */ +/* Inflate (decompress) the codes in a deflated (compressed) block. + Returns an error code, or zero on success. */ int inflate_codes(CDecompressionObject* decompress, - struct huft* tl, //literal/length + struct huft* tl, // literal/length decoder tables struct huft* td, //distance decoder tables int bl, int bd) //number of bits decoded by tl[] and td[] { @@ -323,7 +323,7 @@ int inflate_codes(CDecompressionObject* decompress, /* inflate the coded data */ ml = mask_bits[bl]; /* precompute masks for speed */ md = mask_bits[bd]; - while (1) /* do until end of block */ + while (1) /* Repeat until the end of the block */ { NEEDBITS((unsigned)bl, decompress) t = tl + ((unsigned)b & ml); @@ -408,7 +408,7 @@ int inflate_codes(CDecompressionObject* decompress, break; } - if (e == 31) /* it's the EOB signal */ + if (e == 31) /* end-of-block (EOB) code */ { /* sorry for this goto, but we have to exit two loops at once */ goto cleanup_decode; @@ -438,7 +438,7 @@ int inflate_codes(CDecompressionObject* decompress, #endif /* ASM_INFLATECODES */ -// "decompress" an inflated type 0 (stored) block. +// Decompress a type 0 (stored) block. int inflate_stored(CDecompressionObject* decompress) { unsigned n; // number of bytes in block @@ -447,7 +447,7 @@ int inflate_stored(CDecompressionObject* decompress) unsigned outBytes, inBytes; //temporary variables - // make local copies of globals + // make local copies of the decompressor state b = decompress->BitBuf; // initialize bit buffer k = decompress->BitCount; @@ -464,20 +464,20 @@ int inflate_stored(CDecompressionObject* decompress) return 1; // error in compressed data DUMPBITS(16) - /* old copy routine, the new should be faster (I hope so) - // read and output the compressed data - while (n--) - { - NEEDBITS(8, decompress) - decompress->SlideWin[w++] = (uch)b; - if (w == decompress->WinSize) - { - decompress->Flush(w); - w = 0; - } - DUMPBITS(8, decompress) - } -*/ + /* old copy routine; the new one should be faster + // read and output the uncompressed data + while (n--) + { + NEEDBITS(8, decompress) + decompress->SlideWin[w++] = (uch)b; + if (w == decompress->WinSize) + { + decompress->Flush(w); + w = 0; + } + DUMPBITS(8, decompress) + } + */ //copy bytes from input to the output while (n) @@ -501,7 +501,7 @@ int inflate_stored(CDecompressionObject* decompress) bytesLeft -= inBytes; decompress->WinPos += inBytes; outBytes -= inBytes; - if (!bytesLeft && outBytes) // longer input is needed, but we don't have it (everything is in decompress->Data) + if (!bytesLeft && outBytes) // More input is needed, but none is available (everything is in decompress->Data) { TRACE_I("inflate_stored: input error"); return 4; @@ -525,9 +525,9 @@ int inflate_stored(CDecompressionObject* decompress) return 0; } -// decompress an inflated type 1 (fixed Huffman codes) block. We should -// either replace this with a custom decoder, or at least precompute the -// Huffman tables. +// Decompress a type 1 (fixed Huffman codes) block. +// This should either be replaced with a custom decoder or at least have the +// Huffman tables precomputed. int inflate_fixed(CDecompressionObject* decompress) { // if first time, set up tables for fixed blocks @@ -543,7 +543,7 @@ int inflate_fixed(CDecompressionObject* decompress) l[i] = 9; for (; i < 280; i++) l[i] = 7; - for (; i < 288; i++) // make a complete, but wrong code set + for (; i < 288; i++) // make a complete but incorrect code set l[i] = 8; decompress->fixed_bl = 7; if ((i = huft_build(decompress, l, 288, 257, @@ -574,7 +574,7 @@ int inflate_fixed(CDecompressionObject* decompress) decompress->fixed_bl, decompress->fixed_bd) != 0; } -/* decompress an inflated type 2 (dynamic Huffman codes) block. */ +/* Decompress a type 2 (dynamic Huffman codes) block. */ int inflate_dynamic(CDecompressionObject* decompress) { int i; /* temporary variables */ @@ -589,7 +589,7 @@ int inflate_dynamic(CDecompressionObject* decompress) unsigned nb; /* number of bit length codes */ unsigned nl; /* number of literal/length codes */ unsigned nd; /* number of distance codes */ - unsigned ll[MAXLITLENS + MAXDISTS]; /* lit./length and distance code lengths */ + unsigned ll[MAXLITLENS + MAXDISTS]; /* literal/length and distance code lengths */ register ulg b; /* bit buffer */ register unsigned k; /* number of bits in bit buffer */ @@ -597,7 +597,7 @@ int inflate_dynamic(CDecompressionObject* decompress) b = decompress->BitBuf; k = decompress->BitCount; - /* read in table lengths */ + /* read the table lengths */ NEEDBITS(5, decompress) nl = 257 + ((unsigned)b & 0x1f); /* number of literal/length codes */ DUMPBITS(5) @@ -610,7 +610,7 @@ int inflate_dynamic(CDecompressionObject* decompress) if (nl > MAXLITLENS || nd > MAXDISTS) return 1; /* bad lengths */ - /* read in bit-length-code lengths */ + /* Read bit-length code lengths. */ for (j = 0; j < nb; j++) { NEEDBITS(3, decompress) @@ -620,7 +620,7 @@ int inflate_dynamic(CDecompressionObject* decompress) for (; j < 19; j++) ll[border[j]] = 0; - /* build decoding table for trees--single level, 7 bit lookup */ + /* build a decoding table for the trees -- single-level, 7-bit lookup */ bl = 7; i = huft_build(decompress, ll, 19, 19, NULL, NULL, &tl, &bl); if (bl == 0) /* no bit lengths */ @@ -740,13 +740,13 @@ int inflate_dynamic(CDecompressionObject* decompress) if (i = inflate_codes(decompress, tl, td, bl, bd)) TRACE_I("inflate_dynamic: error in inflate_codes"); - /* free the decoding tables, return */ + /* Free the decoding tables and return. */ huft_free(decompress, tl); huft_free(decompress, td); return i; } -/* decompress an inflated block */ +/* Decompress a deflated block */ int inflate_block(CDecompressionObject* decompress, int* e) // int *e; { @@ -758,12 +758,12 @@ int inflate_block(CDecompressionObject* decompress, int* e) b = decompress->BitBuf; k = decompress->BitCount; - /* read in last block bit */ + /* read the last-block bit */ NEEDBITS(1, decompress) *e = (int)b & 1; DUMPBITS(1) - /* read in block type */ + /* read the block type */ NEEDBITS(2, decompress) t = (unsigned)b & 3; DUMPBITS(2) @@ -785,7 +785,7 @@ int inflate_block(CDecompressionObject* decompress, int* e) return 2; } -//decompress an inflated entry +// Decompress a deflated entry int Inflate(CDecompressionObject* decompress) { CALL_STACK_MESSAGE1("Inflate()"); @@ -794,7 +794,7 @@ int Inflate(CDecompressionObject* decompress) /* #ifdef DEBUG - unsigned h = 0; // maximum struct huft's malloc'ed + unsigned h = 0; // maximum number of allocated struct huft instances #endif */ @@ -963,7 +963,7 @@ int huft_build(CDecompressionObject* decompress, if ((j = *p++) != 0) v[x[j]++] = i; } while (++i < n); - n = x[g]; /* set n to length of v */ + n = x[g]; /* set n to the length of v */ /* Generate the Huffman codes and for each, make the table entries */ x[0] = i = 0; /* first Huffman code is zero */ @@ -972,7 +972,7 @@ int huft_build(CDecompressionObject* decompress, w = l[-1] = 0; /* no bits decoded yet */ u[0] = (struct huft*)NULL; /* just to keep compilers happy */ q = (struct huft*)NULL; /* ditto */ - z = 0; /* ditto */ + z = 0; /* just to keep compilers happy */ /* go through the bit lengths (k already is bits in shortest code) */ for (; k <= g; k++) @@ -1002,9 +1002,9 @@ int huft_build(CDecompressionObject* decompress, if ((unsigned)w + j > el && (unsigned)w < el) j = el - w; /* make EOB code end at table */ z = 1 << j; /* table entries for j-bit table */ - l[h] = j; /* set table size in stack */ + l[h] = j; /* save table size on the stack */ - /* allocate and link in new table */ + /* allocate and link the new table */ if ((q = (struct huft*)malloc((z + 1) * sizeof(struct huft))) == (struct huft*)NULL) { From 3b397c167818d472dcdece6f16b246024ed9752c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:26:25 +0200 Subject: [PATCH 415/710] [translation] Fix src/jumplist.cpp comments Refines translated comments in src/jumplist.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #884 for src/jumplist.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/jumplist.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/jumplist.cpp b/src/jumplist.cpp index bfee26196..cd3442fee 100644 --- a/src/jumplist.cpp +++ b/src/jumplist.cpp @@ -21,8 +21,8 @@ DEFINE_PROPERTYKEY(PKEY_Title, 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 2); DEFINE_PROPERTYKEY(PKEY_AppUserModel_IsDestListSeparator, 0x9F4C2855, 0x9F79, 0x4B39, 0xA8, 0xD0, 0xE1, 0xD4, 0x2D, 0xE1, 0xD5, 0xF3, 6); -// We want to link the unique process ID with the configuration -// (two different versions of Salamander may, for example, have different hot paths) +// Associate the unique process ID with the configuration +// (for example, two different versions of Salamander may have different hot paths) //const char *SALAMANDER_APP_ID = "OPENSAL.OpenSalamanderAppID." VERSINFO_xstr(VERSINFO_BUILDNUMBER); //typedef WINSHELLAPI HRESULT (WINAPI *FT_SetCurrentProcessExplicitAppUserModelID)(PCWSTR appID); @@ -170,7 +170,7 @@ HRESULT CreateShellLink(const char* path, const char* name, IShellLink** psl) lstrcpyn(desc, path, _countof(desc)); if (strlen(path) >= _countof(desc)) strcpy(desc + _countof(desc) - 4, "..."); // indicates the path has been truncated - ret->SetDescription(desc); // MAX_PATH+1 is the limit (at least on Windows 7 where I'm testing now); longer = the jump list won't show at all + ret->SetDescription(desc); // MAX_PATH+1 is the limit (at least on Windows 7, where this was tested); if it is longer, the jump list will not be shown ret->SetIconLocation("shell32.dll", -319); // this icon exists from Windows XP onwards // To set the link title, we require the property store of the link. @@ -284,7 +284,7 @@ void CreateJumpList() IID_PPV_ARGS(&pcdl)); if (SUCCEEDED(hr)) { - //important to setup App Id for the Jump List + // Important to set up the App ID for the Jump List //wchar_t appID[500]; //ConvertA2U(SALAMANDER_APP_ID, -1, appID, _countof(appID)); //hr = pcdl->SetAppID(appID); From 9f32243f1252fb67eb83569901346e9739e1e2a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:26:41 +0200 Subject: [PATCH 416/710] [translation] Fix src/logo.cpp comments Refines translated comments in src/logo.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #885 for src/logo.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/logo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/logo.cpp b/src/logo.cpp index ff491b560..6e452bb36 100644 --- a/src/logo.cpp +++ b/src/logo.cpp @@ -166,7 +166,7 @@ BOOL CSplashScreen::PrepareBitmap() svgGrad.AlphaBlend(hDC, 0, GradientY, gradSize.cx, Height - GradientY, SVGSTATE_ORIGINAL); svgHand.AlphaBlend(hDC, Width - handSize.cx, 0, handSize.cx, handSize.cy, SVGSTATE_ORIGINAL); - // fixed texts + // static text PaintText(SALAMANDER_TEXT_VERSION, VersionR.left, VersionR.top, @@ -457,7 +457,7 @@ CAboutDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (WindowsVistaAndLater) return (BOOL)(UINT_PTR)HGradientBkBrush; else - return (BOOL)(UINT_PTR)GetStockObject(NULL_BRUSH); // under XP this still worked fine + return (BOOL)(UINT_PTR)GetStockObject(NULL_BRUSH); // this still worked correctly on XP } break; } From aec201fb26213fa12cf458fd70900fe7a3566ad9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:26:57 +0200 Subject: [PATCH 417/710] [translation] Fix src/logo.h comments Refines translated comments in src/logo.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #886 for src/logo.h, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/logo.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/logo.h b/src/logo.h index 6bf4cd879..862f923d3 100644 --- a/src/logo.h +++ b/src/logo.h @@ -12,5 +12,5 @@ BOOL SplashScreenOpen(); // opens splash screen window void SplashScreenCloseIfExist(); // if window exists, closes it BOOL ExistSplashScreen(); // detects existence of splash screen window -HWND GetSplashScreenHandle(); // returns handle of splash screen, or NULL if it doesn't exist +HWND GetSplashScreenHandle(); // returns the splash screen handle, or NULL if it does not exist void IfExistSetSplashScreenText(const char* text); // if it exists, sets text that will be displayed immediately From a2e1ccd7ebf90e1b4c2553d5abedc76173b6f33e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:27:12 +0200 Subject: [PATCH 418/710] [translation] Fix src/mainwnd.h comments Refines translated comments in src/mainwnd.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #887 for src/mainwnd.h, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/mainwnd.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/mainwnd.h b/src/mainwnd.h index 355e19c57..11f2fd744 100644 --- a/src/mainwnd.h +++ b/src/mainwnd.h @@ -212,7 +212,7 @@ class CHotPathItems int GetUnassignedHotPathIndex(); BOOL GetVisible(int index) { return Items[index].Visible; } - BOOL CleanName(char* name); // trims spaces and returns TRUE if the name is valid + BOOL CleanName(char* name); // trims spaces and returns TRUE if name is not empty BOOL SwapItems(int index1, int index2); // swaps two items in the array @@ -354,7 +354,7 @@ struct CDynString free(Buffer); } - BOOL Append(const char* str, int len); // returns TRUE on success; if 'len' is -1 the length is calculated using "len = strlen(str)" + BOOL Append(const char* str, int len); // returns TRUE on success; if 'len' is -1, "len = strlen(str)" is used const char* GetString() const { return Buffer; } }; @@ -403,7 +403,7 @@ class CMainWindow : public CMainWindowAncestor CUserMenuItems* UserMenuItems; CViewerMasks* ViewerMasks; - CRITICAL_SECTION ViewerMasksCS; // section used only for synchronizing access to 'ViewerMasks' (writes anywhere and reads outside the main thread) + CRITICAL_SECTION ViewerMasksCS; // critical section used only to synchronize access to 'ViewerMasks' (writes anywhere and reads outside the main thread) CViewerMasks* AltViewerMasks; CEditorMasks* EditorMasks; CHighlightMasks* HighlightMasks; @@ -441,7 +441,7 @@ class CMainWindow : public CMainWindowAncestor int ActivateSuspMode; // counter of WM_ACTIVATEAPP activations/deactivations; some messages may get lost - RECT WindowRect; // current window position + RECT WindowRect; // current window rectangle BOOL CaptionIsActive; // is the main window caption active? @@ -487,7 +487,7 @@ class CMainWindow : public CMainWindowAncestor void EnterViewerMasksCS() { HANDLES(EnterCriticalSection(&ViewerMasksCS)); } void LeaveViewerMasksCS() { HANDLES(LeaveCriticalSection(&ViewerMasksCS)); } - BOOL GetViewersAssoc(int wantedViewerType, CDynString* strViewerMasks); // helper: collects all masks associated with the given viewer type "wantedViewerType"; returns TRUE on success (when enough memory for the string) + BOOL GetViewersAssoc(int wantedViewerType, CDynString* strViewerMasks); // helper method: collects all masks associated with viewer type "wantedViewerType"; returns TRUE on success (if there is enough memory for the string) void ClearHistory(); // clears all histories @@ -503,7 +503,7 @@ class CMainWindow : public CMainWindowAncestor // these functions have no effect if CFilesWindow::CanBeFocused is not satisfied void ChangePanel(BOOL force = FALSE); // respects EditMode; activates the inactive panel; (ignores ZOOM if force is TRUE) - void FocusPanel(CFilesWindow* focus, BOOL testIfMainWndActive = FALSE); // clears EditMode because focus is put into the panel + void FocusPanel(CFilesWindow* focus, BOOL testIfMainWndActive = FALSE); // clears EditMode because it sets focus to the panel void FocusLeftPanel(); // calls FocusPanel for the left panel // compares directories in the left and right panels @@ -584,7 +584,7 @@ class CMainWindow : public CMainWindowAncestor BOOL ToggleBottomToolBar(); BOOL ToggleUserMenuToolBar(BOOL storePos = TRUE); BOOL ToggleHotPathsBar(BOOL storePos = TRUE); - // If 'twoDriveBars' is TRUE, the user wants two drive lists; otherwise only one + // If 'twoDriveBars' is TRUE, the user wants to toggle two drive bars; otherwise only one BOOL ToggleDriveBar(BOOL twoDriveBars, BOOL storePos = TRUE); void ToggleToolBarGrips(); @@ -675,7 +675,7 @@ class CMainWindow : public CMainWindowAncestor BOOL CanEnterHelpMode(); void OnContextHelp(); HWND SetHelpCapture(POINT point, BOOL* pbDescendant); - BOOL ProcessHelpMsg(MSG& msg, DWORD* pContext, HWND* hDirtyWindow); // hDirtyWindow: returns the window to which we sent WM_USER_HELP_MOUSEMOVE and that needs to receive WM_USER_HELP_MOUSELEAVE + BOOL ProcessHelpMsg(MSG& msg, DWORD* pContext, HWND* hDirtyWindow); // hDirtyWindow: returns the window to which WM_USER_HELP_MOUSEMOVE was sent and which needs to receive WM_USER_HELP_MOUSELEAVE void ExitHelpMode(); DWORD MapClientArea(POINT point); DWORD MapNonClientArea(int iHit); From 8bec74d1c4742a2183437805098775532c8b3a00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:27:28 +0200 Subject: [PATCH 419/710] [translation] Fix src/mainwnd1.cpp comments Refines translated comments in src/mainwnd1.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #888 for src/mainwnd1.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/mainwnd1.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/mainwnd1.cpp b/src/mainwnd1.cpp index f71f50329..ab21b8a5f 100644 --- a/src/mainwnd1.cpp +++ b/src/mainwnd1.cpp @@ -198,8 +198,8 @@ BOOL CHotPathItems::Save(HKEY hKey) if (*name == 0 && *path == 0 && visible == TRUE) { - // optimization: don't clutter the registry unless needed - // not ready for configuration merging, but neither is the rest of our configuration + // Optimization: do not write to the registry unless necessary + // Not ready for configuration merging, but neither is the rest of the configuration ClearKey(actKey); CloseKey(actKey); DeleteKey(hKey, keyName); @@ -238,7 +238,7 @@ BOOL CHotPathItems::Load(HKEY hKey) CleanName(name); if (GetValue(actKey, SALAMANDER_HOTPATHS_PATH, REG_SZ, path, HOTPATHITEM_MAXPATH)) { - if (Configuration.ConfigVersion < 47) // the old path limit was MAX_PATH, so it fits with expansion + if (Configuration.ConfigVersion < 47) // the old path was limited to MAX_PATH, so it still fits after expansion DuplicateDollars(path, HOTPATHITEM_MAXPATH); // if the path is long and contains '$', the end might be truncated; we ignore it } GetValue(actKey, SALAMANDER_HOTPATHS_VISIBLE, REG_DWORD, &visible, sizeof(DWORD)); @@ -267,7 +267,7 @@ BOOL CHotPathItems::Load1_52(HKEY hKey) itoa(i, keyName, 10); if (GetValue(hKey, keyName, REG_SZ, path, MAX_PATH)) { - DuplicateDollars(path, MAX_PATH); // if the path is long and contains '$', the end might be truncated; ignore it + DuplicateDollars(path, MAX_PATH); // if the path is long and contains '$', the end may be truncated; this is not addressed strcpy(name, path); } @@ -352,7 +352,7 @@ CMainWindow::CMainWindow() : ChangeNotifArray(3, 5) item = new CViewerMasksItem(); if (ViewerMasks != NULL && item != NULL) { - ViewerMasks->Add(item); // no critical section needed, we're in the constructor + ViewerMasks->Add(item); // no critical section needed; this is the constructor item->Set("*.htm;*.html;*.xml;*.mht", "", "", ""); item->ViewerType = -4; // IE viewer (4th plugin in the default configuration) } @@ -360,7 +360,7 @@ CMainWindow::CMainWindow() : ChangeNotifArray(3, 5) item = new CViewerMasksItem(); if (ViewerMasks != NULL && item != NULL) { - ViewerMasks->Add(item); // no critical section needed, we're in the constructor + ViewerMasks->Add(item); // no critical section is needed; this is the constructor item->Set("*.rpm", "", "", ""); item->ViewerType = -2; // TAR (2nd plugin in the default configuration) } @@ -368,7 +368,7 @@ CMainWindow::CMainWindow() : ChangeNotifArray(3, 5) item = new CViewerMasksItem(); if (ViewerMasks != NULL && item != NULL) { - ViewerMasks->Add(item); // no critical section needed, we're in the constructor + ViewerMasks->Add(item); // no critical section is needed; this is the constructor item->Set("*.*", "", "", ""); item->ViewerType = VIEWER_INTERNAL; // internal viewer } @@ -558,7 +558,7 @@ BOOL CMainWindow::TogglePluginsBar(BOOL storePos) if (!PluginsBar->CreateWnd(HTopRebar)) return FALSE; // IdleForceRefresh = TRUE; // force an update - // IdleRefreshStates = TRUE; // on next Idle, enforce a check on status variables + // IdleRefreshStates = TRUE; // on the next Idle, force a check of the state variables PluginsBar->CreatePluginButtons(); InsertPluginsBarBand(); ShowWindow(PluginsBar->HWindow, SW_SHOW); @@ -1182,7 +1182,7 @@ void CMainWindow::EditWindowSetDirectory() EditWindow->Enable(TRUE); // cached in EditWindow EditWindow->SetDirectory(dir); } - else // disable/hide edit-line + else // disable/hide the edit line { if (EditMode && panel != NULL) // release focus from command line before disabling it FocusPanel(panel, TRUE); @@ -1241,7 +1241,7 @@ void CMainWindow::SetUnescapedHotPath(int index, const char* path) lstrcpyn(HotPathSetBufferName, path, MAX_PATH); lstrcpyn(HotPathSetBufferPath, path, HOTPATHITEM_MAXPATH); DuplicateDollars(HotPathSetBufferPath, HOTPATHITEM_MAXPATH); - // open the HotPaths page and edit item index + // open the HotPaths page and start editing item index PostMessage(HWindow, WM_USER_CONFIGURATION, 1, index); } else @@ -1760,7 +1760,7 @@ void CMainWindow::GetFormatedPathForTitle(char* path) if (chars < pathLen) lastChars = chars; else - break; // end of path isn't a point of division;bug in GetNextDirectoryLineHotPath implementation + break; // end of path is not a split point; bug in GetNextDirectoryLineHotPath implementation } trimEnd = path + lastChars; } @@ -1813,7 +1813,7 @@ void CMainWindow::GetFormatedPathForTitle(char* path) if (chars < pathLen) lastChars = chars; else - break; // end of path isn't a point of division; bug in GetNextDirectoryLineHotPath implementation + break; // end of path is not a split point; bug in GetNextDirectoryLineHotPath implementation } if (lastChars > 0) { @@ -3053,7 +3053,7 @@ void CMainWindow_RefreshCommandStates(CMainWindow* obj) void CMainWindow::RefreshCommandStates() { - CMainWindow_RefreshCommandStates(this); // this hack exists because we can't obtain the object's method address (as a plain function we can) + CMainWindow_RefreshCommandStates(this); // this workaround exists because the address of an object method cannot be obtained here (unlike for a plain function) } void CMainWindow::OnEnterIdle() From 0c13be99ce9268926026e3b76a82a3f7d423a6e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:28:07 +0200 Subject: [PATCH 420/710] [translation] Fix src/mainwnd4.cpp comments Refines translated comments in src/mainwnd4.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #891 for src/mainwnd4.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/mainwnd4.cpp | 84 ++++++++++++++++++++++++------------------------ 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/src/mainwnd4.cpp b/src/mainwnd4.cpp index d545c40ce..6e6bf89c8 100644 --- a/src/mainwnd4.cpp +++ b/src/mainwnd4.cpp @@ -129,7 +129,7 @@ BOOL CMainWindow::CloseDetachedFS(HWND parent, CPluginFSInterfaceEncapsulation* CALL_STACK_MESSAGE1("CMainWindow::CloseDetachedFS()"); BOOL dummy; // ignored return value if (!detachedFS->TryCloseOrDetach(CriticalShutdown, FALSE, dummy, FSTRYCLOSE_UNLOADCLOSEDETACHEDFS) && - !CriticalShutdown) // test close; forceClose==TRUE only during a "critical shutdown" + !CriticalShutdown) // try closing; forceClose==TRUE only during a "critical shutdown" { // ask the user whether to close it even against the FS wishes char path[2 * MAX_PATH]; strcpy(path, detachedFS->GetPluginFSName()); @@ -146,7 +146,7 @@ BOOL CMainWindow::CloseDetachedFS(HWND parent, CPluginFSInterfaceEncapsulation* detachedFS->TryCloseOrDetach(TRUE, FALSE, dummy, FSTRYCLOSE_UNLOADCLOSEDETACHEDFS); } else - return FALSE; // user doesn't want to close the detached FS + return FALSE; // the user chose not to close the detached FS } // close the FS @@ -171,12 +171,12 @@ BOOL CMainWindow::CanUnloadPlugin(HWND parent, CPluginInterfaceAbstract* plugin) if (RightPanel != NULL && !RightPanel->CanUnloadPlugin(parent, plugin)) return FALSE; - // find detached FS belonging to the plug-in 'plugin' and attempt to close them + // find detached FS belonging to the plugin 'plugin' and attempt to close them int i; for (i = DetachedFSList->Count - 1; i >= 0; i--) // iterate backwards; as we will be deleting from the array (quadratic complexity) { CPluginFSInterfaceEncapsulation* detachedFS = DetachedFSList->At(i); - if (detachedFS->GetPluginInterface() == plugin) // belongs to plug-in 'plugin' + if (detachedFS->GetPluginInterface() == plugin) // belongs to plugin 'plugin' { if (CloseDetachedFS(parent, detachedFS)) { @@ -185,16 +185,16 @@ BOOL CMainWindow::CanUnloadPlugin(HWND parent, CPluginInterfaceAbstract* plugin) DetachedFSList->ResetState(); } else - return FALSE; // unload cannot proceed (user refused to close the plug-in's detached FS) + return FALSE; // unload cannot proceed (user refused to close the plugin's detached FS) } } // check if data from the plugin is not in SalShExtPastedData - // (panels leaving archives might have stored them there due to plug-in unload) + // (panels leaving archives might have stored them there due to plugin unload) if (!SalShExtPastedData.CanUnloadPlugin(parent, plugin)) return FALSE; // unload cannot proceed - return TRUE; // unload is possible; all plug-in resources were released + return TRUE; // unload can proceed; all plugin resources have been released } void CMainWindow::MakeFileList() @@ -393,7 +393,7 @@ BOOL GetNextFileFromPanel(int index, char* path, char* name, void* param) { name[0] = 0; // for up-dir or for the first item of an empty panel the name will be empty... } - else // copy the name for others + else // otherwise copy the name { CFileData* f = &((index < data->Window->Dirs->Count) ? data->Window->Dirs->At(index) : data->Window->Files->At(index - data->Window->Dirs->Count)); strcpy(name, f->Name); @@ -427,27 +427,27 @@ BOOL GetNextFileFromPanel(int index, char* path, char* name, void* param) BOOL CheckIfCanBeExecuted(BOOL buildBat, int commandLen, int argumentsLen) { - /* MEASURED LIMITS: - Batch file: - W2K: 2041 including executable name, spaces and parameters - XP64/XP: 8185 including executable name, spaces and parameters - Win7/Vista: 32776 including executable name, spaces and parameters - - ShellExecuteEx: - XP/XP64/Vista/W2K: 2080 including executable name (without quotes), spaces and parameters - Win7: 32764 including executable name (without quotes), spaces and parameters -*/ - - // WARNING: if a .bat file is executed that runs a .exe and passes all parameters (%*), a long .exe name - // can still trigger "too long name" error even when respecting the limit here. The limit is exceeded once - // parameters are passed to the .exe. (I wouldn't solve this issue; it would require parsing - // .bat files etc., which is just nonsense.) + /* MEASURED VALUES: + Batch file: + W2K: 2041 including the executable name, spaces, and parameters + XP64/XP: 8185 including the executable name, spaces, and parameters + Win7/Vista: 32776 including the executable name, spaces, and parameters + + ShellExecuteEx: + XP/XP64/Vista/W2K: 2080 including the executable name (without quotes), spaces, and parameters + Win7: 32764 including the executable name (without quotes), spaces, and parameters + */ + + // WARNING: if a .bat file is executed that runs a .exe and passes all parameters (%*), + // a longer .exe name than the .bat file name can still trigger a "too long name" error even when the + // limit given here is respected. The limit is exceeded after the parameters are expanded for the .exe. + // This problem would not be addressed; it would require parsing .bat files, which is not worth it. int cmdLineLen = commandLen + argumentsLen + 1; // +1 for the space between command and arguments if (buildBat) // launching via a .bat file { if (WindowsVistaAndLater) - return cmdLineLen <= 8191; // Vista/Win7: in reality it's 32776 but only 8191 works (with longer parameters, probably due to a Windows bug, characters get erased; tested on Vista and Win7) + return cmdLineLen <= 8191; // Vista/Win7: in reality the limit is 32776, but only 8191 works (with longer parameters, characters are apparently erased due to a Windows bug; tested on Vista and Win7) return cmdLineLen <= 8185; // XP/XP64 } else // launching via ShellExecuteEx @@ -464,18 +464,18 @@ BOOL CheckIfCanBeExecuted(BOOL buildBat, int commandLen, int argumentsLen) // // parent - parent window (for error dialogs) // cmd - buffer for the expanded command -// cmdSize - size of 'cmd' buffer +// cmdSize - size of the 'cmd' buffer // args - buffer for receiving arguments -// argsSize - size of 'args' buffer +// argsSize - size of the 'args' buffer // buildBat - if TRUE, arguments are placed into 'cmd' -// initDir - buffer for the path where the execution should take place -// initDirSize - length of initDir buffer +// initDir - buffer for the path where execution should take place +// initDirSize - length of the initDir buffer // item - user-menu item // path - long path to the file // longName - long filename // fileNameUsed - returns TRUE if a file name or path was used during argument expansion -// userMenuAdvancedData - advanced parameter`s values for User Menu: the Arguments array -// ignoreEnvVarNotFoundOrTooLong - see ExpandVarString description +// userMenuAdvancedData - values of the advanced parameters for User Menu: the Arguments field +// ignoreEnvVarNotFoundOrTooLong - see the ExpandVarString description // // returns success of the operation @@ -844,7 +844,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = strcpy(prevInitDir, initDir); BOOL expandOK = ExpandCommand2(parent, cmdLine, USRMNUCMDLINE_MAXLEN, - arguments, USRMNUARGS_MAXLEN, buildBat, // if we are running via a batch file, allow + arguments, USRMNUARGS_MAXLEN, buildBat, // when running via a batch file, initDir, MAX_PATH, // arguments will be inserted into cmdLine UserMenuItems->At(itemIndex), path, name, &fileNameUsed, @@ -882,7 +882,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = break; } } - else // direct execution + else // run directly { // the original launching via CreateProcess couldn't run screen savers (*.SCR) // or Control Panel items (*.cpl) and people kept complaining @@ -893,15 +893,15 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = // set correct default directories for individual drives MainWindow->SetDefaultDirectories((initDir[0] != 0) ? initDir : NULL); - // to work with old configurations, remove the " character from the start and end of cmdLine + // to support old configurations, remove the '"' character from the beginning and end of cmdLine int cmdLen = (int)strlen(cmdLine); if (cmdLen > 1 && cmdLine[0] == '\"' && cmdLine[cmdLen - 1] == '\"') { memmove(cmdLine, cmdLine + 1, cmdLen - 2); cmdLine[cmdLen - 2] = 0; } - // better not swallow backslashes so that we don't destroy some OLE paths - //RemoveRedundantBackslahes(cmdLine); // ShellExecuteEx dislikes multiple backslashes, "$(SalDir)\salamand.exe" + // It is better not to strip backslashes so we do not break some OLE paths + //RemoveRedundantBackslahes(cmdLine); // ShellExecuteEx does not like multiple backslashes, "$(SalDir)\salamand.exe" CShellExecuteWnd shellExecuteWnd; SHELLEXECUTEINFO sei; @@ -997,7 +997,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = HANDLES(CloseHandle(pi.hThread)); } } - else // an empty .BAT is not worth running (in case of low memory or other crazy errors) + else // an empty .BAT is not worth running (in case of low memory or other serious errors) { DiskCache.ReleaseName(batUniqueName, FALSE); } @@ -1053,7 +1053,7 @@ BOOL CMainWindow::HandleCtrlLetter(char c) else // NC + Windows Ctrl+? hotkeys { WPARAM cmd; - switch (c) // only upper-case characters reach here + switch (c) // only uppercase characters are handled here { case 'A': cmd = CM_ACTIVESELECTALL; @@ -1842,8 +1842,8 @@ BOOL CMainWindow::ProcessHelpMsg(MSG& msg, DWORD* pContext, HWND* hDirtyWindow) return FALSE; } ReleaseCapture(); - // the message we peeked changes into a non-client because - // of the release capture. + // the message we peeked becomes a non-client message because + // capture is released. GetMessage(&msg, NULL, WM_NCLBUTTONDOWN, WM_NCLBUTTONDOWN); DispatchMessage(&msg); GetCursorPos(&point); @@ -1885,7 +1885,7 @@ BOOL CMainWindow::ProcessHelpMsg(MSG& msg, DWORD* pContext, HWND* hDirtyWindow) // Hit one of our apps windows (or desktop) -- dispatch the message. PeekMessage(&msg, NULL, msg.message, msg.message, PM_REMOVE); - // Dispatch mouse messages that hit the desktop! + // Dispatch mouse messages to the desktop. DispatchMessage(&msg); } } @@ -1903,8 +1903,8 @@ BOOL CMainWindow::ProcessHelpMsg(MSG& msg, DWORD* pContext, HWND* hDirtyWindow) { GetMessage(&msg, NULL, msg.message, msg.message); - // ensure sending messages to our menu (avoiding the need for a keyboard hook) - // this supports entering the menu via Alt/F10/Alt+letter during help mode + // ensure that messages are delivered to our menu (avoiding the need for a keyboard hook) + // this allows entry into the menu via Alt/F10/Alt+letter during help mode if (MenuBar == NULL || !MenuBar->IsMenuBarMessage(&msg)) { TranslateMessage(&msg); From 5606e78f7cf9abdeb0ed0865f1ad44c7886abe0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:28:22 +0200 Subject: [PATCH 421/710] [translation] Fix src/mainwnd5.cpp comments Refines translated comments in src/mainwnd5.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #892 for src/mainwnd5.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/mainwnd5.cpp | 76 ++++++++++++++++++++++++------------------------ 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/src/mainwnd5.cpp b/src/mainwnd5.cpp index ccbaaaef8..84d70240c 100644 --- a/src/mainwnd5.cpp +++ b/src/mainwnd5.cpp @@ -17,7 +17,7 @@ void GetFileDateAndTimeFromPanel(DWORD validFileData, CPluginDataInterfaceEncaps *validDate = FALSE; *validTime = FALSE; FILETIME ft; - if (validFileData & (VALID_DATA_DATE | VALID_DATA_TIME)) // at least something is in LastWrite + if (validFileData & (VALID_DATA_DATE | VALID_DATA_TIME)) // LastWrite contains at least the date or time { if (FileTimeToLocalFileTime(&f->LastWrite, &ft) && FileTimeToSystemTime(&ft, st)) @@ -40,14 +40,14 @@ void GetFileDateAndTimeFromPanel(DWORD validFileData, CPluginDataInterfaceEncaps { *validTime = TRUE; } - if (!*validDate) // no date set, reset it... + if (!*validDate) // no date set, initialize it to the default date... { st->wYear = 1602; st->wMonth = 1; st->wDay = 1; st->wDayOfWeek = 2; } - if (!*validTime) // no time set, reset it... + if (!*validTime) // no time set, zero it out... { st->wHour = 0; st->wMinute = 0; @@ -99,10 +99,10 @@ int CompareFilesByTime(CFilesWindow* leftPanel, const CFileData* l, BOOL lFAT, FILETIME lf, rf; if (Configuration.UseTimeResolution) { - // trim time with second precision + // truncate time to whole seconds stLeft.wMilliseconds = 0; stRight.wMilliseconds = 0; - // convert time to numbers + // convert times to numeric values if (!SystemTimeToFileTime(&stLeft, &lf)) { TRACE_E("CompareFilesByTime(): date&time of left file is invalid!"); @@ -162,7 +162,7 @@ int CompareFilesByTime(CFilesWindow* leftPanel, const CFileData* l, BOOL lFAT, { if (lFAT == rFAT) res = MyCompareFileTime(&lf, &rf, foundDSTShifts, compResNoDSTShiftIgn); // same filesystems -> OK - else // FAT plus a different filesystem -> adjust the non-FAT time to FAT time (by 2 seconds) + else // FAT + different filesystem -> convert the non-FAT time to FAT time (2-second resolution) { WORD date, time; // FAT values FILETIME t; @@ -257,16 +257,16 @@ int CompareFilesBySize(CFilesWindow* leftPanel, CFileData* l, CFilesWindow* righ return 0; } -// compares files 'file1' and 'file2' specified by full path by their content -// on successful comparison, it returns TRUE and sets 'different' -// variable (TRUE if a difference was found, otherwise FALSE) -// on error or user abort, returns FALSE and sets 'canceled' variable -// (TRUE if the user canceled the operation, otherwise FALSE) +// compares the contents of files 'file1' and 'file2', specified by full paths +// on successful comparison, the function returns TRUE and sets +// 'different' (TRUE if a difference was found, otherwise FALSE) +// on error or cancellation, it returns FALSE and sets +// 'canceled' (TRUE if the user canceled the operation, otherwise FALSE) #define COMPARE_BUFFER_SIZE (2 * 1024 * 1024) // buffer size for comparison in bytes (does not necessarily need to be fully used) #define COMPARE_BLOCK_SIZE (32 * 1024) // size of a block read continuously from the file; NOTE: COMPARE_BUFFER_SIZE must be divisible by COMPARE_BLOCK_SIZE #define COMPARE_BLOCK_GROUP 8 // how many blocks can be read at once when reading is fast enough (more than 1 MB/s, see COMPARE_BUF_TIME_LIMIT); NOTE: the number of blocks in the buffer (COMPARE_BUFFER_SIZE / COMPARE_BLOCK_SIZE) must be divisible by COMPARE_BLOCK_GROUP -#define COMPARE_BUF_TIME_LIMIT 2000 // time limit in milliseconds for reading the entire buffer (COMPARE_BUFFER_SIZE) - if met, blocks are read in groups COMPARE_BLOCK_GROUP which speeds up network reading on Vista+ 2-3x; otherwise reading is done block by block (COMPARE_BLOCK_SIZE) +#define COMPARE_BUF_TIME_LIMIT 2000 // time limit in milliseconds for reading the entire buffer (COMPARE_BUFFER_SIZE) - if met, blocks are read in groups of COMPARE_BLOCK_GROUP, which makes network reading on Vista+ 2x to 3x faster; otherwise, reading is done one block at a time (COMPARE_BLOCK_SIZE) void AddProgressSizeWithLimit(CCmpDirProgressDialog* progressDlg, DWORD read, CQuadWord* fileProgressTotal, const CQuadWord& sizeLimit) { @@ -324,7 +324,7 @@ BOOL CompareFilesByContent(HWND hWindow, CCmpDirProgressDialog* progressDlg, // DWORD measureStart = GetTickCount(); // unsigned __int64 measuredSize = 0; BOOL readErr = FALSE; - BOOL readingIsFast1 = FALSE; // FALSE = wait until speed reaches the limit and we can read in groups (COMPARE_BLOCK_GROUP) + BOOL readingIsFast1 = FALSE; // FALSE = wait until the speed reaches the limit and we can read in groups (COMPARE_BLOCK_GROUP) BOOL readingIsFast2 = FALSE; while (TRUE) { @@ -374,7 +374,7 @@ BOOL CompareFilesByContent(HWND hWindow, CCmpDirProgressDialog* progressDlg, } if (readErr || *canceled) break; - readingIsFast1 = WindowsVistaAndLater && // on W2K/XP this should not speed things up, so we will not tempt fate + readingIsFast1 = WindowsVistaAndLater && // on W2K/XP this should not make things faster, so we will not try it there GetTickCount() - readBegTime < (DWORD)(((unsigned __int64)read1 * COMPARE_BUF_TIME_LIMIT) / COMPARE_BUFFER_SIZE); // measure the speed so it is over 1 MB/s /* // read the entire buffer at once from one file (on Vista, when both files are on the same physical disk and the buffer is large, this is slightly faster than reading in 32KB blocks) @@ -446,7 +446,7 @@ BOOL CompareFilesByContent(HWND hWindow, CCmpDirProgressDialog* progressDlg, } if (readErr || ret || *canceled) break; - readingIsFast2 = WindowsVistaAndLater && // on W2K/XP this should not speed things up, so we will not tempt fate + readingIsFast2 = WindowsVistaAndLater && // on W2K/XP this should not make things faster, so we will not try it there GetTickCount() - readBegTime < (DWORD)(((unsigned __int64)read2 * COMPARE_BUF_TIME_LIMIT) / COMPARE_BUFFER_SIZE); // measure the speed so it is over 1 MB/s /* // read the entire buffer at once from one file (on Vista, when both files are on the same physical disk and the buffer is large, this is slightly faster than reading in 32KB blocks) @@ -720,7 +720,7 @@ BOOL ReadDirsAndFilesAux(HWND hWindow, DWORD flags, CCmpDirProgressDialog* progr if (zipFiles == NULL || zipDirs == NULL) { *canceled = TRUE; - return FALSE; // low memory, bail out + return FALSE; // low memory, abort } files->SetDeleteData(FALSE); // shallow data copies only @@ -737,7 +737,7 @@ BOOL ReadDirsAndFilesAux(HWND hWindow, DWORD flags, CCmpDirProgressDialog* progr { TRACE_E(LOW_MEMORY); *canceled = TRUE; - return FALSE; // low memory, bail out + return FALSE; // low memory, abort } } } @@ -752,7 +752,7 @@ BOOL ReadDirsAndFilesAux(HWND hWindow, DWORD flags, CCmpDirProgressDialog* progr { TRACE_E(LOW_MEMORY); *canceled = TRUE; - return FALSE; // low memory, bail out + return FALSE; // low memory, abort } } } @@ -767,16 +767,16 @@ BOOL ReadDirsAndFilesAux(HWND hWindow, DWORD flags, CCmpDirProgressDialog* progr return TRUE; } -// recursive function searching for differences between directories -// directories are determined by the paths in the left and right panel -// and the variables 'leftSubDir' and 'rightSubDir' -// leftFAT and rightFAT indicate whether the respective panel is on a FAT system; if an archive is opened, -// the corresponding xxxFAT will be set to FALSE -// 'flags' specifies comparison criteria and comes from the COMPARE_DIRECTORIES_xxx family -// the function returns TRUE on successful comparison and sets 'different' (TRUE +// recursive function that searches for differences between directories +// the directories are specified by the paths in the left and right panels +// and by the variables 'leftSubDir' and 'rightSubDir' +// leftFAT and rightFAT indicate whether the corresponding panel is on a FAT file system; if an archive is open, +// the corresponding xxxFAT is set to FALSE +// 'flags' specifies the comparison criteria and comes from the COMPARE_DIRECTORIES_xxx family +// the function returns TRUE if the comparison succeeds and sets 'different' (TRUE // if the directories differ, otherwise FALSE). -// on error or user abort it returns FALSE -// and sets the variable 'canceled' (TRUE if aborted by the user, otherwise FALSE) +// if an error occurs or the operation is canceled by the user, the function returns FALSE +// and sets the variable 'canceled' (TRUE if canceled by the user, otherwise FALSE) // supports ptDisk and ptZIPArchive @@ -961,7 +961,7 @@ BOOL CompareDirsAux(HWND hWindow, CCmpDirProgressDialog* progressDlg, // directories are not compared by time } - if (timeDiffWithDSTShiftExists) // we found no other difference, so we report an unignored DST time shift including a warning + if (timeDiffWithDSTShiftExists) // no other difference found, so report the non-ignored DST time shift including a warning { (*foundDSTShifts)++; *different = TRUE; @@ -1071,7 +1071,7 @@ BOOL CompareDirsAux(HWND hWindow, CCmpDirProgressDialog* progressDlg, if (*different) { *foundDSTShifts += foundDSTShiftsInSubDir; - return TRUE; // found a difference in a subdirectory, stop + return TRUE; // found a difference in a subdirectory, return early } foundDSTShiftsInThisDir += foundDSTShiftsInSubDir; } @@ -1182,7 +1182,7 @@ void CMainWindow::CompareDirectories(DWORD flags) // lower the thread priority to "normal" (so the operation doesn't overburden the machine) SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_NORMAL); - //--- open the progress dialog + //--- open the progress dialog box BOOL displayDialogBox = (flags & COMPARE_DIRECTORIES_BYCONTENT) != 0 || // for quick actions there's no point in showing the dialog (flags & COMPARE_DIRECTORIES_SUBDIRS) != 0; BOOL displayProgressBar = (flags & COMPARE_DIRECTORIES_BYCONTENT) != 0; @@ -1251,9 +1251,9 @@ void CMainWindow::CompareDirectories(DWORD flags) getTotal = FALSE; // FALSE: we mark differences, compare files by content CQuadWord total(0, 0); // total number of bytes that may need to be compared in the worst case - // the 'dirSubTotal' array contains sizes of individual subdirectories (files contained in them) + // the 'dirSubTotal' array contains the sizes of individual subdirectories (the files they contain) // the array is filled in the first pass (getTotal == TRUE) - // it is used in the second pass (getTotal == FALSE): if a subdirectory differs we know how much to skip on the total progress + // it is used in the second pass (getTotal == FALSE): if a subdirectory differs, we know how much to skip in the total progress TDirectArray dirSubTotal(max(1, min(leftDirs->Count, rightDirs->Count)), 1); int subTotalIndex; // index into the dirSubTotal array @@ -1352,7 +1352,7 @@ void CMainWindow::CompareDirectories(DWORD flags) // By Content if (flags & COMPARE_DIRECTORIES_BYCONTENT) { - if (leftFile->Size == rightFile->Size) // size test is intentionally not covered by the following optimization so both files are marked and unnecessary DST warnings don't pop up + if (leftFile->Size == rightFile->Size) // the size check is intentionally not gated by the following optimization condition so both files are marked and unnecessary DST warnings do not pop up { if (!selectLeft && !leftIsNewer || !selectRight && !rightIsNewer) // if both files are already flagged, there is no point in comparing them by content { @@ -1412,7 +1412,7 @@ void CMainWindow::CompareDirectories(DWORD flags) if (!getTotal) { if (leftIsNewerNoDSTShiftIgn && !selectLeft || rightIsNewerNoDSTShiftIgn && !selectRight) - foundDSTShifts += isDSTShift; // count only time differences of files that are not already marked for another reason (e.g., due to a difference by another criterion) -- motivation: if we don't need to show a complex DST warning, don't show it + foundDSTShifts += isDSTShift; // count only time differences for files that are not already marked for another reason (e.g. because of a difference by another criterion) -- motivation: if the complex DST warning does not need to be shown, do not show it if (selectLeft || leftIsNewer) { @@ -1459,8 +1459,8 @@ void CMainWindow::CompareDirectories(DWORD flags) } // Sal2.0 and TC compare without directories in such a way that they even ignore their names - // people kept pointing this out to us, so we'll behave the same (with - // COMPARE_DIRECTORIES_ONEPANELDIRS disabled) + // this behavior is kept for compatibility because users kept pointing it out + // (when COMPARE_DIRECTORIES_ONEPANELDIRS is not set) if ((flags & COMPARE_DIRECTORIES_SUBDIRS) || (flags & COMPARE_DIRECTORIES_ONEPANELDIRS)) { // now compare subdirectories @@ -1853,14 +1853,14 @@ BOOL CDynString::Append(const char* str, int len) len = (int)strlen(str); if (Length + len >= Allocated) { - int size = Length + len + 1 + 256; // +256 characters as reserve so we don't allocate so often + int size = Length + len + 1 + 256; // +256 characters in reserve so reallocations are less frequent char* newBuf = (char*)realloc(Buffer, size); if (newBuf != NULL) { Buffer = newBuf; Allocated = size; } - else // out of memory, tough luck... + else // Out of memory. { TRACE_E(LOW_MEMORY); return FALSE; From 762c1ce4b66b61e4a63c8a1be1350a3904d4ece7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:28:38 +0200 Subject: [PATCH 422/710] [translation] Fix src/mapi.cpp comments Refines translated comments in src/mapi.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #893 for src/mapi.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/mapi.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mapi.cpp b/src/mapi.cpp index 6e22fb383..0fe7a6f75 100644 --- a/src/mapi.cpp +++ b/src/mapi.cpp @@ -28,9 +28,9 @@ BOOL CSimpleMAPI::Init(HWND hParent) HLibrary = HANDLES_Q(LoadLibrary("mapi32.dll")); if (HLibrary == NULL) { - // under NT4.0 US + IE 4.01 US, mapi32.dll is not installed - // but I found msoemapi.dll there which has the necessary export and more importantly, it works, - // so why not try it... + // Under NT 4.0 US + IE 4.01 US, mapi32.dll is not installed, + // but I found msoemapi.dll there. It has the required export and, + // more importantly, it works, so it is worth trying. HLibrary = HANDLES_Q(LoadLibrary("msoemapi.dll")); if (HLibrary == NULL) { @@ -144,7 +144,7 @@ BOOL CSimpleMAPI::SendMail() message.nFileCount = FileNames.Count; message.lpFiles = fileDesc; - char* subject = (char*)malloc(subjectSize + strlen(LoadStr(IDS_EMAILFILES_SUBJECT)) + 2); // space for "emailing" and the terminating NULL + char* subject = (char*)malloc(subjectSize + strlen(LoadStr(IDS_EMAILFILES_SUBJECT)) + 2); // space for the email subject and the terminating NULL if (subject == NULL) { TRACE_E(LOW_MEMORY); @@ -183,8 +183,8 @@ BOOL CSimpleMAPI::SendMail() free(subject); free(fileDesc); - // report nothing because various clients return different values - // for example Outlook 6 on XP returned 1 when cancelling a message or 3 + // do not report anything, because different clients return different values + // for example, Outlook 6 on XP returned 1 when cancelling a message or 3 // when cancelling the connection wizard (if it was not configured) /* if (ret != 0) From 3733fd7f0df20bf690a1407d8929361d8bd672e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:28:53 +0200 Subject: [PATCH 423/710] [translation] Fix src/masks.cpp comments Refines translated comments in src/masks.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #894 for src/masks.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/masks.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/masks.cpp b/src/masks.cpp index 00b2c91c8..34978b2c6 100644 --- a/src/masks.cpp +++ b/src/masks.cpp @@ -71,7 +71,7 @@ BOOL AgreeMask(const char* filename, const char* mask, BOOL hasExtension, BOOL e } if (*mask == '*') mask++; // asterisk '*' afterwards -> represents "" -> everything is ok - if (!hasExtension && *mask == '.') // without extension mask "*.*" must still match... + if (!hasExtension && *mask == '.') // without an extension, the mask "*.*" must still match... return *(mask + 1) == 0 || (*(mask + 1) == '*' && *(mask + 2) == 0); else return *mask == 0; @@ -88,11 +88,11 @@ char* MaskName(char* buffer, int bufSize, const char* name, const char* mask) return buffer; } - // the first dot in the mask separates two operational parts: the first for the name, + // the first dot in the mask separates the two parts of the working mask: the first for the name, // the second for the extension (example: "a.b.c.d" + "*.*.old": "a.b.c" + "*" = "a.b.c"; // "d" + "*.old" = "d.old" -> the result is the combination "a.b.c.d.old") - int ignPoints = 0; // how many dots the name contains (this section corresponds to the text of the mask from the start to the first dot); the rest matches the extension (after the fisrt dot) + int ignPoints = 0; // how many dots the name contains (this section corresponds to the text of the mask from the start to the first dot); the rest corresponds to the extension (after the first dot) const char* n = name; while (*n != 0) if (*n++ == '.') @@ -204,10 +204,10 @@ char* MaskName(char* buffer, int bufSize, const char* name, const char* mask) // Functions for quick-search // the '/' character represents any number of characters (like '*' in a standard mask) -// returns TRUE if it is a wildcard character replacing '*' -// it must be a character not allowed in file names -// and at the same time, it should be easy to type (see the '<' on the German keyboard; -// for the backslash on the German keyboard you must press AltGr+\) +// returns TRUE if this is a character used in place of '*' +// it must be a character that is not allowed in file names +// and at the same time, it should be easy to type (see the '<' on a German keyboard; +// for a backslash on a German keyboard, you must press AltGr+\) BOOL IsQSWildChar(char ch) { return (ch == '/' || ch == '\\' || ch == '<'); @@ -249,7 +249,7 @@ BOOL AgreeQSMaskAux(const char* filename, BOOL hasExtension, const char* filenam if (!wholeString && *mask == 0) { offset = (int)(filename - filenameBase); - return TRUE; // end of mask, 'offset' = how far it reaches into the file name + return TRUE; // end of mask, 'offset' = how far it extends into the file name } if (LowerCase[*filename] == LowerCase[*mask]) { @@ -342,7 +342,7 @@ CMaskGroup::operator=(const CMaskGroup& s) if (!s.NeedPrepare) { int errpos = 0; - if (!PrepareMasks(errpos)) // an error shouldn't occur, the source mask is valid + if (!PrepareMasks(errpos)) // an error should not occur because the source mask is valid TRACE_E("CMaskGroup::operator= Internal error, PrepareMasks() failed."); } return *this; @@ -359,7 +359,7 @@ void CMaskGroup::ReleaseMasksHashArray() { free(MasksHashArray[i].Mask); CMasksHashEntry* next = MasksHashArray[i].Next; - while (next != NULL) // if there are multiple masks at the same entry (hash) + while (next != NULL) // if there are multiple masks in the same hash bucket { CMasksHashEntry* nextNext = next->Next; if (next->Mask != NULL) @@ -588,7 +588,7 @@ BOOL CMaskGroup::PrepareMasks(int& errorPos, const char* masksString) s++; } - if (hashableMasks >= 10) // to be worthwhile there should be at least 10 + if (hashableMasks >= 10) // only do this if there are at least 10 of them { MasksHashArraySize = 2 * hashableMasks; MasksHashArray = (CMasksHashEntry*)malloc(MasksHashArraySize * sizeof(CMasksHashEntry)); @@ -609,7 +609,7 @@ BOOL CMaskGroup::PrepareMasks(int& errorPos, const char* masksString) MasksHashArray[hash].Mask = mask; PreparedMasks.Detach(i2); if (!PreparedMasks.IsGood()) - PreparedMasks.ResetState(); // Detach always succeeds (at most the array won't shift, which is fine) + PreparedMasks.ResetState(); // Detach always succeeds (at worst the array will not be shifted, which is fine) } else { @@ -658,7 +658,7 @@ BOOL CMaskGroup::PrepareMasks(int& errorPos, const char* masksString) #endif // _DEBUG */ } - else // out of memory -> we simply won't accelerate searching in masks + else // out of memory -> mask searching will not be accelerated { TRACE_E(LOW_MEMORY); MasksHashArraySize = 0; @@ -686,7 +686,7 @@ BOOL CMaskGroup::AgreeMasks(const char* fileName, const char* fileExt) fileExt++; } const char* ext = fileExt; - if (*ext == 0 && *fileName == '.' && *(ext - 1) != '.') // may be the ".cvspass" case; ".." has no extension + if (*ext == 0 && *fileName == '.' && *(ext - 1) != '.') // this may be the ".cvspass" case; ".." has no extension { TRACE_E("CMaskGroup::AgreeMasks: Unexpected situation: fileName starts with '.' but fileExt points to end of name: " << fileName); ext = fileName + 1; From 6e31b4dab6246de571b61221c15c604a9c9244ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:29:08 +0200 Subject: [PATCH 424/710] [translation] Fix src/menu1.cpp comments Refines translated comments in src/menu1.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #895 for src/menu1.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/menu1.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/menu1.cpp b/src/menu1.cpp index 0d185723f..b41d91ee8 100644 --- a/src/menu1.cpp +++ b/src/menu1.cpp @@ -284,7 +284,7 @@ void CMenuItem::DecodeSubTextLenghtsAndWidths(CMenuSharedResources* sharedRes, B ColumnL2 = NULL; ColumnR = NULL; - // set column pointers and character counts + // set pointers and character counts for each column while (inifiniteLoop) { if (*iterator == '\t' || *iterator == 0) From 057c5b4099ad4900c66a1fdc5bbc85dc2c06724f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:29:24 +0200 Subject: [PATCH 425/710] [translation] Fix src/menubar.cpp comments Refines translated comments in src/menubar.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #898 for src/menubar.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/menubar.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/menubar.cpp b/src/menubar.cpp index b993a0368..7ec31063d 100644 --- a/src/menubar.cpp +++ b/src/menubar.cpp @@ -396,7 +396,7 @@ void CMenuBar::EnterMenuInternal(int index, BOOL openWidthSelect, BOOL byMouse) case WM_KEYDOWN: { BOOL shiftPressed = (GetKeyState(VK_SHIFT) & 0x8000) != 0; - if (msg.wParam == VK_MENU && (msg.lParam & 0x40000000) == 0 || // Alt down, but not an autorepeat + if (msg.wParam == VK_MENU && (msg.lParam & 0x40000000) == 0 || // Alt down, but not auto-repeat (!shiftPressed && msg.wParam == VK_F10)) { leaveLoop = TRUE; @@ -556,7 +556,7 @@ void CMenuBar::EnterMenuInternal(int index, BOOL openWidthSelect, BOOL byMouse) // remove ourselves from monitoring closing messages MenuWindowQueue.Remove(HWindow); - // if we hooked, we will also unhook + // if we hooked the thread, we will also unhook it if (hOldHookProc != NULL) OldMenuHookTlsAllocator.UnhookThread(hOldHookProc); @@ -715,7 +715,7 @@ BOOL CMenuBar::IsMenuBarMessage(CONST MSG* lpMsg) } else { - WheelDuringMenu = FALSE; // if the user scrolled the wheel and then typed a number (Alt+numXXX), we will ignore the scrolling + WheelDuringMenu = FALSE; // if the user scrolled the wheel and then typed a number (Alt+numXXX), scrolling is ignored HandlingVK_MENU = FALSE; } if (wParam == VK_F10) @@ -754,7 +754,7 @@ BOOL CMenuBar::IsMenuBarMessage(CONST MSG* lpMsg) if (WheelDuringMenu) { WheelDuringMenu = FALSE; - return TRUE; // suppress releasing Alt after Alt+Wheel, otherwise the window menu opens (without being shown) + return TRUE; // suppress Alt release after Alt+Wheel; otherwise the window menu is entered without being shown } // if the user did not use the wheel, we must not process the message // Alt+num064 (etc.) is used for inserting characters @@ -826,7 +826,7 @@ CMenuBar::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_ERASEBKGND: { - if (WindowsVistaAndLater) // under Vista the rebar flickers + if (WindowsVistaAndLater) // On Vista, the rebar flickers return TRUE; RECT r; GetClientRect(HWindow, &r); @@ -908,7 +908,7 @@ CMenuBar::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) int newHotIndex = HotIndex; if (hitItem) { - if (!HelpMode2 && !MenuLoop && !MouseIsTracked) // capture is needed only in the track mode + if (!HelpMode2 && !MenuLoop && !MouseIsTracked) // mouse leave tracking is needed only in track mode { TRACKMOUSEEVENT tme; tme.cbSize = sizeof(tme); From 17323bed5cae503dc4b6fdc87b95c4ab0a22b3d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:29:39 +0200 Subject: [PATCH 426/710] [translation] Fix src/msgbox.cpp comments Refines translated comments in src/msgbox.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #899 for src/msgbox.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/msgbox.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/msgbox.cpp b/src/msgbox.cpp index 38774c7e1..532533f6a 100644 --- a/src/msgbox.cpp +++ b/src/msgbox.cpp @@ -191,9 +191,9 @@ BOOL CMessageBox::EscapeEnabled() return TRUE; } -// returns a copy of 'src' into which 'n' characters are inserted so that the resulting maximum -// width does not exceed 'maxWidth'. Assumes that the hDC has the correct font selected. -// returns NULL in case of failure +// returns a copy of 'src' with '\n' characters inserted so that the resulting maximum +// width does not exceed 'maxWidth'. Assumes that 'hDC' has the appropriate font selected. +// returns NULL on failure char* DuplicateStrAndInsertEOLs(const char* src, HDC hDC, int maxWidth) { @@ -581,7 +581,7 @@ CMessageBox::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) // maximum width relative to the desktop where the dialog will appear int maxTextWidth = (int)((clipRect.right - clipRect.left) / 1.8); - if (maxTextWidth > fontCharWidth * 90) // since Windows Vista dialogs are narrower again - wrap at 90 average characters + if (maxTextWidth > fontCharWidth * 90) // Since Windows Vista, dialogs are narrower again, so wrap at 90 average-width characters. maxTextWidth = fontCharWidth * 90; tR.right = maxTextWidth; @@ -589,8 +589,8 @@ CMessageBox::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (tR.right > maxTextWidth) { - // text width exceeds maxTextWidth limit, so we create a new one - // text into which we will insert hard line breaks + // text width exceeds the maxTextWidth limit, so we create new text + // with hard line breaks inserted const char* newText = DuplicateStrAndInsertEOLs(Text.Get(), hDC, maxTextWidth); if (newText != NULL) { @@ -790,7 +790,7 @@ CMessageBox::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) // assign text BOOL btnTextWasSet = FALSE; - if (AliasBtnNames != NULL) // alias button names + if (AliasBtnNames != NULL) // button name aliases { char tmpBuff[1000]; char seps[] = "\t"; From 4dd98311f9c6df087d04cce49bc710d624dceb0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:29:55 +0200 Subject: [PATCH 427/710] [translation] Fix src/olespy.cpp comments Refines translated comments in src/olespy.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #900 for src/olespy.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/olespy.cpp | 84 +++++++++++++++++++++++++------------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/src/olespy.cpp b/src/olespy.cpp index 7293cf0eb..d7fa50926 100644 --- a/src/olespy.cpp +++ b/src/olespy.cpp @@ -12,49 +12,49 @@ // // Notes on the implementation of IMallocSpy // -// 1) OLE caches (among other things) BSTRs, so under a normal OS it returns -// nonsensical leaks via IMallocSpy. Caching can be disabled by setting the environment -// variable OANOCACHE=1 and using the debug (Checked) version of OLE. Ideally, -// use the complete Checked Build of W2K or extract the appropriate DLL from the -// Checked version of the Service Pack which is freely available. +// 1) OLE caches (among other things) BSTRs, so under a normal OS IMallocSpy reports +// bogus leaks. Caching can be disabled by setting the OANOCACHE=1 environment +// variable and using the debug (Checked) version of OLE. Ideally, use the full +// Checked Build of W2K, or extract the appropriate DLLs from the Checked version +// of the Service Pack, which is freely available. // -// 2) If there are any remaining leaks in OLE, when trying to unregister the spy via -// CoRevokeMallocSpy, it returns E_ACCESSDENIED value and postpones the Release call. -// In practice, Release is never going to call us (W2K). Because some allocations are -// freed only during DLL_PROCESS_DETACH in OLEAUT32.DLL, the spy reports -// them as leaks. It is useful to compare the reported leaks with what the -// CairOLE system outputs to the debug window under the W2K Checked Build. +// 2) If any leaks remain in OLE, an attempt to unregister the spy by calling +// CoRevokeMallocSpy returns E_ACCESSDENIED and defers the call to Release. +// In practice, Release is never called later (W2K). Because some allocations are +// freed only during DLL_PROCESS_DETACH in OLEAUT32.DLL, the spy reports them +// as leaks. It is useful to compare the reported leaks with what the CairOLE +// system reports to the debug window under the W2K Checked Build. // -// 3) Two issues had to be avoided: we do not want the CRT to report a memory -// leak caused by allocating the CMallocSpy instance on the heap. At the same -// time, we need to keep the instance of this object alive as long as possible because OLE will -// call our methods (especially PreFree and PostFree with fSpy == FALSE) even -// after CoRevokeMallocSpy is called. We solve it by copying the object into static -// memory in OleSpyRegister(). The destructor is thus never called and the -// critical section is never destroyed. +// 3) Two problems had to be avoided: the CRT must not report a memory leak caused +// by allocating the CMallocSpy instance on the heap. At the same time, the +// instance of this object must be kept alive as long as possible, because OLE +// calls our methods (especially PreFree and PostFree with fSpy == FALSE) even +// after CoRevokeMallocSpy is called. This is handled by copying the object into +// static memory; see OleSpyRegister(). As a result, the destructor is never +// called and the critical section is never destroyed. // -// 4) When testing under W2K Checked Build, more reports can be obtained from OLE by -// adding a section to win.ini file: +// 4) When testing under the W2K Checked Build, OLE can be made to produce more +// reports by adding a section to the win.ini file: // [CairOLE InfoLevels] // cairole=7 // heap=7 // -// if we want to display detailed messages including call stacks of individual allocations -// we have to set both values to the decimal equivalent of 0xffffffff: +// To display detailed messages including the call stacks of individual allocations, +// both values must be set to the decimal equivalent of 0xffffffff: // [CairOLE InfoLevels] // cairole=4294967295 // heap=4294967295 // -// CairOLE often reports a higher amount of leaks than our spy detects. It is also common -// that CairOLE reports leaks while the spy reports that everything is OK. What -// matters is that these leaks are consistent (for example on Salamander -// start/exit CairOLE reports 13 leaks and about 800 bytes of memory). Since this number -// does not increase, I consider it unimportant. +// CairOLE often reports more leaks than the spy detects. It is also common for +// CairOLE to report leaks while the spy reports that everything is OK. The key +// point is that these leaks should remain constant (for example, on Salamander +// startup and exit CairOLE reports 13 leaks and about 800 bytes of memory). This +// number does not increase, so it is not considered important. // -// 5) The spy will report leaks from calls to functions like SHBrowseForFolder or -// SHGetSpecialFolderLocation. These are not real leaks but cached PIDLs which -// shell32.dll frees only when it detaches from the process. We can recognize -// them by the fact that repeated calls do not increase the number of leaks. +// 5) The spy reports leaks from calls to functions such as SHBrowseForFolder or +// SHGetSpecialFolderLocation. These are not real leaks, but cached PIDLs that +// shell32.dll frees only when it detaches from the process. They can be recognized +// by the fact that repeated calls do not increase the number of leaks. // //------------------------------------------------------------------------- @@ -73,7 +73,7 @@ #endif #define SHID_COMPUTER 0x20 -#define SHID_COMPUTER_1 0x21 // free +#define SHID_COMPUTER_1 0x21 // unused #define SHID_COMPUTER_REMOVABLE (0x20 | DRIVE_REMOVABLE) // 2 #define SHID_COMPUTER_FIXED (0x20 | DRIVE_FIXED) // 3 #define SHID_COMPUTER_REMOTE (0x20 | DRIVE_REMOTE) // 4 @@ -124,7 +124,7 @@ #define IS_VALID_READ_BUFFER(ptr, type, len) (!IsBadReadPtr((ptr), sizeof(type)*(len))) #define IS_VALID_PIDL(ptr) (IsValidPIDL(ptr)) -// IsBadReadPtr throws exceptions in the debug version and we don't want that +// IsBadReadPtr throws exceptions in debug builds, which is undesirable BOOL IsValidPIDL(LPCITEMIDLIST pidl) { @@ -134,7 +134,7 @@ IsValidPIDL(LPCITEMIDLIST pidl) } */ -// IsBadReadPtr throws exceptions in the debug version and we don't want that +// IsBadReadPtr throws exceptions in debug builds, and we do not want that BOOL IsGoodPIDL(LPCITEMIDLIST pidl, int cb) { if (cb < sizeof(USHORT) || cb < (int)(pidl->mkid.cb + sizeof(USHORT))) @@ -742,7 +742,7 @@ CMallocSpy::SpyPreFree(void* pvRequest) size_t CMallocSpy::SpyPreRealloc(void* pvRequest, size_t cbRequest, void** ppv) { - ASSERT(pvRequest != NULL); // in this case OLE calls IMallocSpy::PreAlloc + ASSERT(pvRequest != NULL); // in this case OLE calls IMallocSpy::PreFree ASSERT(cbRequest != 0); // in this case OLE calls IMallocSpy::PreFree size_t cb; @@ -815,7 +815,7 @@ BOOL IsAsciiString(LPSTR pv, int cb) cb--; pv++; } - return (!cb && bRet && !*pv); // we've only had ascii characters, and we're null terminated + return (!cb && bRet && !*pv); // ASCII characters only, and null-terminated } STDAPI _StrRetToBuf(STRRET* psr, LPCITEMIDLIST pidl, LPSTR pszBuf, UINT cchBuf) @@ -904,15 +904,15 @@ BOOL CMallocSpy::DumpLeaks() int leakedAllocs = 0; SPYBLK* psbWalk = _psbHead; - // reach the end and move forward + // Move to the end, then iterate forward if (psbWalk != NULL) while (psbWalk->psbNext != NULL) psbWalk = psbWalk->psbNext; while (psbWalk != NULL) { - // FIXME_X64 psbWalk->cbRequest is of type size_t, yet we print it as %d which is likely wrong - // check the rest of the code where the bug might appear; it probably should be (%Id) - http://msdn.microsoft.com/en-us/library/tcxf1dw6.aspx + // FIXME_X64 psbWalk->cbRequest is of type size_t, but we print it as %d, which is probably wrong + // check the rest of the code for places where the same bug may occur; it should probably be (%Id) - http://msdn.microsoft.com/en-us/library/tcxf1dw6.aspx sprintf(buff, "[%u] Leaked %Iu bytes at 0x%p, from thread 0x%X", psbWalk->cOrder, psbWalk->cbRequest, (BYTE*)psbWalk + sizeof(SPYBLK), psbWalk->dwThreadId); @@ -1049,9 +1049,9 @@ BOOL OleSpyRegister() // a correct instance of the object CMallocSpy templateSpy; - // dirty hack: we do not want memory leaks in the CRT so the object is not - // allocated on the heap, and we also need a correctly constructed VMT, so - // we copy the contents of the template + // workaround: we do not want CRT memory leaks, so the object is not + // allocated on the heap; at the same time, we need a correctly constructed + // VMT, so we copy the contents of the template object static byte _Spy[sizeof(templateSpy)]; memcpy(_Spy, &templateSpy, sizeof(templateSpy)); From 0425717be75aa6399f3fd5f757de89b2f6efa128 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:30:11 +0200 Subject: [PATCH 428/710] [translation] Fix src/olespy.h comments Refines translated comments in src/olespy.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #901 for src/olespy.h, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/olespy.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/olespy.h b/src/olespy.h index b6097a3cc..e95916064 100644 --- a/src/olespy.h +++ b/src/olespy.h @@ -11,7 +11,7 @@ // Details on finding OLE leaks are described in OLESPY.CPP. // Attaches our IMallocSpy to OLE; COM must be initialized first. -// If it returns TRUE, the followed functions can be called. +// If it returns TRUE, the following functions can be called. BOOL OleSpyRegister(); // Detaches the Spy from OLE; OleSpyDump can still be called after this function. From 417e52abfbe6df1d8bd218068add08bbb38210a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:30:27 +0200 Subject: [PATCH 429/710] [translation] Fix src/pack.h comments Refines translated comments in src/pack.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #902 for src/pack.h, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/pack.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pack.h b/src/pack.h index 1b4c6b427..a97b0fca9 100644 --- a/src/pack.h +++ b/src/pack.h @@ -587,7 +587,7 @@ class CPackerFormatConfigData { public: char* Ext; // list of extensions the archive can have - BOOL UsePacker; // true if PackerIndex is valid (we can also pack) + BOOL UsePacker; // true if PackerIndex is valid (packing is also supported) int PackerIndex; // reference to the packer table int UnpackerIndex; // reference to the unpacker table @@ -662,7 +662,7 @@ class CPackerFormatConfig int GetFormatsCount() { return Formats.Count; } // returns the number of items in the array // BOOL SwapFormats(int index1, int index2); // swaps two items in the array - BOOL MoveFormat(int srcIndex, int dstIndex); // moves the item + BOOL MoveFormat(int srcIndex, int dstIndex); // moves the format void DeleteFormat(int index); int GetUnpackerIndex(int index) { return Formats[index]->UnpackerIndex; } @@ -757,7 +757,7 @@ void PackAutoconfig(HWND parent); // runs the external program cmdLine and interprets the return code according to errorTable BOOL PackExecute(HWND parent, char* cmdLine, const char* currentDir, TPackErrorTable* const errorTable); -// callback for enumeration by mask (used to extract all files matching the mask) +// callback for enumeration by mask (used to unpack all files matching the mask) const char* WINAPI PackEnumMask(HWND parent, int enumFiles, BOOL* isDir, CQuadWord* size, const CFileData** fileData, void* param, int* errorOccured); From 6fcf3046e93ab2460f12cf445665e7b39ac0ad28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:31:06 +0200 Subject: [PATCH 430/710] [translation] Fix src/pack2.cpp comments Refines translated comments in src/pack2.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #904 for src/pack2.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/pack2.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pack2.cpp b/src/pack2.cpp index c6a4f2ebd..94ad5af5b 100644 --- a/src/pack2.cpp +++ b/src/pack2.cpp @@ -189,12 +189,12 @@ BOOL PackCompress(HWND parent, CFilesWindow* panel, const char* archiveFileName, if (archiveRoot != NULL && *archiveRoot != '\0') { strcpy(archiveRootPath, archiveRoot); - if (!modifyTable->CanPackToDir) // the archiver program does not support it + if (!modifyTable->CanPackToDir) // the archiver does not support it { if ((*PackErrorHandlerPtr)(parent, IDS_PACKQRY_ARCPATH)) strcpy(archiveRootPath, "\\"); // the user wants to ignore it else - return FALSE; // the user will mind + return FALSE; // the user objects } } else @@ -355,7 +355,7 @@ BOOL PackUniversalCompress(HWND parent, const char* command, TPackErrorTable* co return (*PackErrorHandlerPtr)(parent, IDS_PACKERR_PATH, buffer); } - // and put it into the list + // and add it to the list file if (!isDir) { if (fprintf(listFile, "%s\n", namecnv) <= 0) @@ -524,7 +524,7 @@ BOOL PackUniversalCompress(HWND parent, const char* command, TPackErrorTable* co { HANDLES(FindClose(find)); // this name already exists with some extension, searching further (*PackErrorHandlerPtr)(parent, IDS_PACKERR_UNABLETOREN, src, dst); - return TRUE; // succeeded, only the resulting archive names differ slightly (even multivolume) + return TRUE; // Succeeded; only the names of the resulting archive differ slightly (including multivolume archives) } } else @@ -658,7 +658,7 @@ BOOL PackDelFromArc(HWND parent, CFilesWindow* panel, const char* archiveFileNam CharToOem(name, namecnv); else strcpy(namecnv, name); - // and put it into the list + // and add it to the list file if (!isDir) { if (fprintf(listFile, "%s%s\n", rootPath, namecnv) <= 0) From ea3ee0e094b14cfaf6a9319741ef04a2aa447cc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:31:22 +0200 Subject: [PATCH 431/710] [translation] Fix src/pack3.cpp comments Refines translated comments in src/pack3.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #905 for src/pack3.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/pack3.cpp | 88 +++++++++++++++++++++++++-------------------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/src/pack3.cpp b/src/pack3.cpp index 01ca3822d..2902f9372 100644 --- a/src/pack3.cpp +++ b/src/pack3.cpp @@ -585,10 +585,10 @@ BOOL CPackerFormatConfig::SetFormat(int index, const char* ext, BOOL usePacker, } } -// returns the format table index + 1 or FALSE (0) when it's not an archive +// Returns the format table index + 1, or FALSE (0) if it is not an archive. int CPackerFormatConfig::PackIsArchive(const char* archiveName, int archiveNameLen) { - // j.r. I disabled the macro because PackIsArchive is heavily called from CFilesWindow::CommonRefresh() + // j.r. The macro was disabled because PackIsArchive is called heavily from CFilesWindow::CommonRefresh() CALL_STACK_MESSAGE_NONE // CALL_STACK_MESSAGE2("PackIsArchive(%s)", archiveName); if (archiveName[0] == 0) @@ -755,10 +755,10 @@ CArchiverConfig::CArchiverConfig(/*BOOL disableDefaultValues*/) : Archivers(20, 10) { /* - // set default values if it is not disabled - if (!disableDefaultValues) - AddDefault(0); -*/ + // set default values unless this is disabled + if (!disableDefaultValues) + AddDefault(0); + */ } void CArchiverConfig::InitializeDefaultValues() @@ -840,7 +840,7 @@ void CArchiverConfig::AddDefault(int SalamVersion) // initializes the configuration based on another configuration BOOL CArchiverConfig::Load(CArchiverConfig& src) { - // clear what we have (if we have anything) + // clear what we have, if anything DeleteAllArchivers(); // and add what we received int i; @@ -951,10 +951,10 @@ BOOL CArchiverConfig::Save(int index, HKEY hKey) d = GetArchiverUID(index); if (ret) ret &= SetValue(hKey, SALAMANDER_PPC_UID, REG_DWORD, &d, sizeof(d)); - // (saves the title) - because it is translated it can no longer be used for identification - // of the archiver (UID is now used instead), there is no point in storing it + // (saves the title) - because it is translated, it can no longer be used to identify the archiver + // (UID is used instead), so there is no point in storing it // if (ret) ret &= SetValue(hKey, SALAMANDER_PPC_TITLE, REG_SZ, GetArchiverTitle(index), -1); - // save the executable path + // saves the executable path if (ret) ret &= SetValue(hKey, SALAMANDER_PPC_PACKEXE, REG_SZ, GetPackerExeFile(index), -1); // save whether packer and unpacker are the same @@ -1014,7 +1014,7 @@ BOOL CArchiverConfig::Load(HKEY hKey) { CArchiverConfigData* arch = Archivers[i]; // for keys that are complete and whose title matches the default value, take over their paths - if (Configuration.ConfigVersion <= 64 && stricmp(title, arch->Title) == 0 || // Title is now translated and cannot be used anymore + if (Configuration.ConfigVersion <= 64 && stricmp(title, arch->Title) == 0 || // The title is now localized and can no longer be used Configuration.ConfigVersion > 64 && uid == arch->UID) // thus we introduced a standard UID { SetPackerExeFile(i, packExe); @@ -1040,22 +1040,22 @@ CArchiverConfig::Load(HKEY hKey) if (ret) ret &= GetValue(hKey, SALAMANDER_PPC_TITLE, REG_SZ, title, max); // loads the packing executable if (ret) ret &= GetValue(hKey, SALAMANDER_PPC_PACKEXE, REG_SZ, packExe, max); - // determine whether the unpacker is the same + // determines whether the unpacker is the same if (ret) ret &= GetValue(hKey, SALAMANDER_PPC_EXESAME, REG_DWORD, &exesAreSame, sizeof(DWORD)); - // loads the unpacker executable, if it is different from the packer + // loads the unpacking executable if it differs from the packing executable if (!exesAreSame) if (ret) ret &= GetValue(hKey, SALAMANDER_PPC_UNPACKEXE, REG_SZ, unpackExe, max); EPackExeType type; const char *name, *variablePack, *variableUnpack = NULL, *exePack, *exeUnpack = NULL; - // and now convert to a newer configuration - missing information is taken from defaults - // (none of it is configurable anyway :-)) + // convert to the newer configuration; missing information is taken from defaults + // (none of it is configurable anyway) if (ret) { int index; if ((index = AddArchiver()) == -1) return FALSE; - // I now assume the indices in the configuration keep their order. If not, nothing is loaded + // assumes the indices in the configuration keep the same order; otherwise nothing is loaded switch (index) { case 0: @@ -1137,14 +1137,14 @@ CArchiverConfig::Load(HKEY hKey) Archivers.Delete(index); // To avoid leaving an uninitialized structure; Salamander 2.0 crashed in SaveConfig return FALSE; } - // verify we are really adding the packer we think we are adding + // verifies that the packer being added is the expected one if (strncmp(title, name, 10) || (exesAreSame && exeUnpack != NULL) || (!exesAreSame && exeUnpack == NULL)) { TRACE_E("Inconsistency in configuration of packers."); Archivers.Delete(index); // To avoid leaving an uninitialized structure; Salamander 2.0 crashed in SaveConfig return FALSE; } - // and set all information + // sets all information ret &= SetArchiver(index, name, type, exesAreSame, variablePack, variableUnpack, exePack, exeUnpack, packExe, unpackExe); } @@ -1235,7 +1235,7 @@ const char* WINAPI PackExpArcDosName(HWND msgParent, void* param) if (data->DOSTmpFilePossible) // use a substitute name { - if (data->DOSTmpFile[0] == 0) // it needs to be generated + if (data->DOSTmpFile[0] == 0) // generate the temporary DOS name { char path[MAX_PATH + 50]; strcpy(path, data->ArcName); @@ -1262,8 +1262,8 @@ const char* WINAPI PackExpArcDosName(HWND msgParent, void* param) // while (--ext > data->ArcName && *ext != '\\' && *ext != '.'); while (--ext >= data->ArcName && *ext != '\\' && *ext != '.') ; - // if (ext > data->ArcName && *ext == '.' && *(ext - 1) != '\\') // copy the archive extension (used by multi-volume archivers: ARJ->A01,A02,...); ".cvspass" in Windows is an extension ... - if (ext >= data->ArcName && *ext == '.') // copy the archive extension (used by multi-volume archivers: ARJ->A01,A02,...) + // if (ext > data->ArcName && *ext == '.' && *(ext - 1) != '\\') // copy the archive extension (used by multi-volume archivers: ARJ->A01,A02,...); in Windows, ".cvspass" is also an extension ... + if (ext >= data->ArcName && *ext == '.') // copy the archive extension (used by multivolume archivers: ARJ -> A01, A02, ...) { int count = 4; // copy '.' plus at most 3 allowed extension characters (of the 8.3 format) while (count-- && *ext < 128 && *ext != '[' && *ext != ']' && @@ -1428,8 +1428,8 @@ PackExpExeName(unsigned int index, BOOL unpacker = FALSE) exe = ArchiverConfig.GetUnpackerExecutable(index); else { - // on older Windows it was impossible to redirect output from a DOS program in a directory - // with a long name; I no longer feel like patching and risking this that it won't work + // on older Windows, it was not possible to redirect output from a DOS program in a directory + // with a long name; this is left unchanged to avoid risking that it will stop working buff[0] = '\0'; DWORD len = GetShortPathName(exe, buff, MAX_PATH); // if the path was shortened successfully, return the short name @@ -1723,8 +1723,8 @@ BOOL PackExecute(HWND parent, char* cmdLine, const char* currentDir, TPackErrorT POINT p; if (MultiMonGetDefaultWindowPos(MainWindow->HWindow, &p)) { - // if the main window is on another monitor we should open the new window there - // preferably at the default position (as on the primary monitor) + // if the main window is on another monitor, we should also open the new window there + // preferably at the default position, as on the primary monitor si.dwFlags |= STARTF_USEPOSITION; si.dwX = p.x; si.dwY = p.y; @@ -1782,16 +1782,16 @@ BOOL PackExecute(HWND parent, char* cmdLine, const char* currentDir, TPackErrorT DWORD ret; do { - /* // Petr: pumping only WM_PAINT leads to blocking all other instances of Salamander - // (even newly started ones) and other softwares (at least during Paste), if we - // put a file or directory on the clipboard before packing. Accessing clipboard - // data causes OLE to communicate with this process which doesn't respond - // because it pumps only WM_PAINT. - // Original Tom's variant: - ret = MsgWaitForMultipleObjects(1, objects, FALSE, - PackWinTimeout <= 0 ? INFINITE : PackWinTimeout - elapsed, - QS_PAINT); -*/ + /* // Petr: pumping only WM_PAINT blocks all other Salamander instances + // (including newly started ones) and other applications (at least during Paste) if a + // file or directory is placed on the clipboard before packing. When clipboard data is + // accessed, OLE tries to communicate with this process, but it does not respond + // because it pumps only WM_PAINT. + // Tom's original variant: + ret = MsgWaitForMultipleObjects(1, objects, FALSE, + PackWinTimeout <= 0 ? INFINITE : PackWinTimeout - elapsed, + QS_PAINT); + */ ret = MsgWaitForMultipleObjects(1, objects, FALSE, PackWinTimeout <= 0 ? INFINITE : PackWinTimeout - elapsed, QS_ALLINPUT); @@ -1799,10 +1799,10 @@ BOOL PackExecute(HWND parent, char* cmdLine, const char* currentDir, TPackErrorT { // if a message arrived, handle it MSG msg; - /* // Original Tom's variant: (see description above) - while (PeekMessage(&msg, NULL, WM_PAINT, WM_PAINT, PM_REMOVE)) - DispatchMessage(&msg); -*/ + /* // Tom's original variant: (see description above) + while (PeekMessage(&msg, NULL, WM_PAINT, WM_PAINT, PM_REMOVE)) + DispatchMessage(&msg); + */ while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { TranslateMessage(&msg); @@ -1834,9 +1834,9 @@ BOOL PackExecute(HWND parent, char* cmdLine, const char* currentDir, TPackErrorT } while (win != NULL); do { - /* // Original Tom's variant: (see description above) - ret = MsgWaitForMultipleObjects(1, objects, FALSE, INFINITE, QS_PAINT); -*/ + /* // Tom's original variant: (see description above) + ret = MsgWaitForMultipleObjects(1, objects, FALSE, INFINITE, QS_PAINT); + */ ret = MsgWaitForMultipleObjects(1, objects, FALSE, INFINITE, QS_ALLINPUT); MSG msg; if (ret == WAIT_OBJECT_0 + 1) @@ -1926,9 +1926,9 @@ BOOL PackExecute(HWND parent, char* cmdLine, const char* currentDir, TPackErrorT } } // - // now come the external program errors + // external program errors follow // - // if errorTable == NULL, no translation is done (table doesn't exist) + // if errorTable == NULL, no translation is done (the table does not exist) if (!errorTable) { char buffer[1000]; From bb7d6a20e6e17979f11e32de08fb5134b41cc357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:31:37 +0200 Subject: [PATCH 432/710] [translation] Fix src/packers.cpp comments Refines translated comments in src/packers.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #907 for src/packers.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/packers.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/packers.cpp b/src/packers.cpp index 856224b0d..aa6c51e1b 100644 --- a/src/packers.cpp +++ b/src/packers.cpp @@ -219,7 +219,7 @@ void CPackerConfig::AddDefault(int SalamVersion) SetPacker(index, 3, "PAK (Plugin)", "pak", TRUE); case 3: // added after beta2 case 4: // beta 3 but with old configuration (contains $(SpawnName)) - case 5:; // what is new in beta4? + case 5:; // new in beta4? // if ((index = AddPacker()) == -1) return; // SetPacker(index, 2, "TAR (Plugin)", "tgz", TRUE); } @@ -359,7 +359,7 @@ void CPackerConfig::AddDefault(int SalamVersion) free(cmdC); // an ugly hack because of RAR if (i == 2) - // if it's RAR we cannot tell whether it is 16-bit or 32-bit directly, only from long-name support + // for RAR, we cannot tell directly whether it is 16-bit or 32-bit, only from long-name support if (GetPackerSupLongNames(index)) cmdC = DupStr(PackConversionTable[i].variable); else @@ -373,7 +373,7 @@ void CPackerConfig::AddDefault(int SalamVersion) free(cmdM); // an ugly hack because of RAR if (i == 2) - // if it's RAR we cannot tell whether it is 16-bit or 32-bit directly, only from long-name support + // if it is RAR, we cannot tell directly whether it is 16-bit or 32-bit, only by long-name support if (GetPackerSupLongNames(index)) cmdM = DupStr(PackConversionTable[i].variable); else @@ -424,7 +424,7 @@ void CPackerConfig::AddDefault(int SalamVersion) { if ((GetPackerOldType(index) && GetPackerType(index) != 1) || (!GetPackerOldType(index) && GetPackerType(index) != CUSTOMPACKER_EXTERNAL)) - { // take only plug-ins (not external packers) + { // take only plugins (not external packers) char* s = Packers[index]->Title; char* f; if (s != NULL && (f = strstr(s, "(Internal)")) != NULL) // contains (Internal) @@ -483,7 +483,7 @@ void CPackerConfig::AddDefault(int SalamVersion) s = DupStr(newLHAMoveArgs); if (s != NULL) { - free(Packers[index]->CmdArgsMove); // cannot be NULL (old arguments here) + free(Packers[index]->CmdArgsMove); // cannot be NULL (it contains the old arguments) Packers[index]->CmdArgsMove = s; } } @@ -617,7 +617,7 @@ void CPackerConfig::AddDefault(int SalamVersion) // convert to new arguments (added "-scol") free(Packers[index]->CmdArgsCopy); // cannot be NULL (old arguments here) Packers[index]->CmdArgsCopy = DupStr(newRAR5CopyVolArgs); - free(Packers[index]->CmdArgsMove); // cannot be NULL (old arguments here) + free(Packers[index]->CmdArgsMove); // cannot be NULL (the old arguments are stored here) Packers[index]->CmdArgsMove = DupStr(newRAR5MoveVolArgs); } } @@ -905,7 +905,7 @@ BOOL CPackerConfig::Load(HKEY hKey) if (ret) { if (!GetValue(hKey, SALAMANDER_CPU_ANSILIST, REG_DWORD, &needANSI, sizeof(DWORD))) - needANSI = FALSE; // in older versions it wasn't present, assumed FALSE + needANSI = FALSE; // in older versions, it was not present; FALSE was assumed } if (ret) @@ -1077,7 +1077,7 @@ void CUnpackerConfig::AddDefault(int SalamVersion) } case 3: // what was added after beta2 case 4: // beta 3 but without the $(SpawnName) variable - // in older versions the $(SpawnName) variable might exist, it no longer does - we must remove it + // older versions may contain the $(SpawnName) variable, which no longer exists, so we must remove it for (index = 0; index < GetUnpackersCount(); index++) if (GetUnpackerType(index) == 1) { @@ -1126,7 +1126,7 @@ void CUnpackerConfig::AddDefault(int SalamVersion) free(cmd); // an ugly hack because of RAR if (i == 2) - // if it's RAR we cannot tell whether it is 16-bit or 32-bit directly, only from long-name support + // if it is RAR, we cannot tell directly whether it is 16-bit or 32-bit, only by long-name support if (GetUnpackerSupLongNames(index)) cmd = DupStr(PackConversionTable[i].variable); else @@ -1173,7 +1173,7 @@ void CUnpackerConfig::AddDefault(int SalamVersion) { if ((GetUnpackerOldType(index) && GetUnpackerType(index) != 1) || (!GetUnpackerOldType(index) && GetUnpackerType(index) != CUSTOMUNPACKER_EXTERNAL)) - { // take only plug-ins (not external unpackers) + { // take only plugins (not external unpackers) char* s = Unpackers[index]->Title; char* f; if (s != NULL && (f = strstr(s, "(Internal)")) != NULL) // contains (Internal) @@ -1238,7 +1238,7 @@ void CUnpackerConfig::AddDefault(int SalamVersion) s = DupStr(newPKZIP25Ext); if (s != NULL) { - free(Unpackers[index]->Ext); // cannot be NULL (old arguments here) + free(Unpackers[index]->Ext); // cannot be NULL (the old arguments are here) Unpackers[index]->Ext = s; } } @@ -1272,7 +1272,7 @@ void CUnpackerConfig::AddDefault(int SalamVersion) strcmp(extrArgs, "x \"$(ArchiveFullName)\" @\"$(ListFullName)\"") == 0) { // convert to new arguments (added "-scol") - free(Unpackers[index]->CmdArgsExtract); // cannot be NULL (old arguments here) + free(Unpackers[index]->CmdArgsExtract); // cannot be NULL (the old arguments are present) Unpackers[index]->CmdArgsExtract = DupStr(newRAR5Args); } } @@ -1518,7 +1518,7 @@ BOOL CUnpackerConfig::Load(HKEY hKey) if (ret) { if (!GetValue(hKey, SALAMANDER_CPU_ANSILIST, REG_DWORD, &needANSI, sizeof(DWORD))) - needANSI = FALSE; // in older versions it wasn't present, assumed FALSE + needANSI = FALSE; // In older versions, it was not present; FALSE was assumed. } if (ret) From bd673910d9c09c13d26d03e562caecbcb1c44582 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:32:41 +0200 Subject: [PATCH 433/710] [translation] Fix src/plugins2.cpp comments Refines translated comments in src/plugins2.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #910 for src/plugins2.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/plugins2.cpp | 96 ++++++++++++++++++++++++------------------------ 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/src/plugins2.cpp b/src/plugins2.cpp index 072815257..5f64db434 100644 --- a/src/plugins2.cpp +++ b/src/plugins2.cpp @@ -83,7 +83,7 @@ BOOL CreateGrayscaleDIB(HBITMAP hSource, COLORREF transparent, HBITMAP& hGraysca bi.bmiHeader.biBitCount = 24; bi.bmiHeader.biCompression = BI_RGB; - // retrieve the actual bitmap data + // retrieve the bitmap data if (!GetDIBits(hDC, hSource, 0, bi.bmiHeader.biHeight, @@ -478,7 +478,7 @@ BOOL CPlugins::AreFSNamesFromSamePlugin(const char* fsName1, const char* fsName2 BOOL CPlugins::FindLastCommand(int* pluginIndex, int* menuItemIndex, BOOL rebuildDynMenu, HWND parent) { - // we must know the path to the plugin that owned the last command + // we must know the path to the plugin the last command belonged to if (LastPlgCmdPlugin != NULL) { int i; @@ -488,7 +488,7 @@ BOOL CPlugins::FindLastCommand(int* pluginIndex, int* menuItemIndex, BOOL rebuil // locate the plugin if (stricmp(p->DLLName, LastPlgCmdPlugin) == 0) { - if (p->GetLoaded()) // if the plugin isn't loaded we pretend we didn't find anything + if (p->GetLoaded()) // If the plugin is not loaded, pretend nothing was found. { // last-cmd from dynamic menu: rebuild required so we show the item from the // updated menu version (otherwise after opening a submenu and rebuilding the menu, the last-cmd item could disappear) @@ -508,7 +508,7 @@ BOOL CPlugins::FindLastCommand(int* pluginIndex, int* menuItemIndex, BOOL rebuil } } } - break; // no further match of DLLName is possible + break; // no further DLLName match is possible } } // command was not found, clear Last Command item to avoid "resurrection" of old commands after reloading the plugin or re-adding an item to the dynamic menu @@ -525,8 +525,8 @@ BOOL CPlugins::OnLastCommand(CFilesWindow* panel, HWND parent) int menuItemIndex; if (FindLastCommand(&pluginIndex, &menuItemIndex, FALSE, parent)) // returns FALSE if the plugin isn't loaded { - // OnLastCommand can be triggered via Ctrl+I so the menu may not be shown - // and the state cache might not be computed + // OnLastCommand can be invoked via Ctrl+I, so the menu might not have been displayed + // and the state cache therefore might not have been computed CalculateStateCache(); CPluginData* pluginData = Data[pluginIndex]; @@ -537,7 +537,7 @@ BOOL CPlugins::OnLastCommand(CFilesWindow* panel, HWND parent) BOOL unselect; if (pluginData->ExecuteMenuItem2(panel, parent, pluginIndex, LastPlgCmdID, unselect)) { - return unselect; // processed, stop + return unselect; // handled, stop here } } } @@ -559,7 +559,7 @@ BOOL CPlugins::ExecuteCommand(int pluginIndex, int menuItemIndex, CFilesWindow* BOOL unselect; if (pluginData->ExecuteMenuItem2(panel, parent, pluginIndex, id, unselect)) { - return unselect; // processed, stop + return unselect; // handled, stop here } } } @@ -588,7 +588,7 @@ void CPlugins::InitMenuItems(HWND parent, CMenuPopup* root) if (!root->RemoveItemsRange(RootMenuItemsCount, count - 1)) return; // error - // add submenus for plugins that have any items and clear their SUIDs + // add submenus for plugins that have items and clear the items' SUIDs // (new numbers will be assigned) count = RootMenuItemsCount; UpdatePluginsOrder(Configuration.KeepPluginsSorted); @@ -597,7 +597,7 @@ void CPlugins::InitMenuItems(HWND parent, CMenuPopup* root) int orderIndex = Order[i].Index; CPluginData* p = Data[orderIndex]; p->SubMenu = NULL; // this plugin has no submenu yet - if (p->SupportDynMenuExt || p->MenuItems.Count > 0) // dynamic menu or it has some items + if (p->SupportDynMenuExt || p->MenuItems.Count > 0) // dynamic menu or has some items { // due to SkillLevel reduction the submenu might be empty; skip empty submenus BOOL containVisibleItem = p->SupportDynMenuExt; @@ -624,7 +624,7 @@ void CPlugins::InitMenuItems(HWND parent, CMenuPopup* root) else { if (type == pmitEndSubmenu && --level == 0) - break; // end of submenu reached + break; // end of submenu found } } } @@ -785,7 +785,7 @@ BOOL CPlugins::InitPluginMenuItemsForBar(HWND parent, int index, CMenuPopup* men plugin->InitMenuItems(parent, index, menu); menu->SetImageList(plugin->CreateImageList(TRUE), TRUE); // the imagelist is destroyed in CMainWindow::WindowProc / WM_USER_UNINITMENUPOPUP (menu must have ID CML_PLUGINS_SUBMENU) menu->SetHotImageList(plugin->CreateImageList(FALSE), TRUE); - plugin->ReleasePluginDynMenuIcons(); // icons are in the menu image lists and this object is no longer needed (everything is obtained again when the menu shows next time) + plugin->ReleasePluginDynMenuIcons(); // the icons are in the menu image lists and this object is no longer needed (everything is obtained again the next time the menu is shown) return TRUE; } @@ -825,8 +825,8 @@ void CPlugins::CalculateStateCache() if (MainWindow->GetActivePanel()->Is(ptPluginFS)) { CPluginFSInterfaceEncapsulation* fs = MainWindow->GetActivePanel()->GetPluginFS(); - if (fs->NotEmpty()) // should be "always true" - { // according to the interface, we find the plug-in index in the active panel + if (fs->NotEmpty()) // This should always be TRUE. + { // find the plugin index in the active panel by its interface StateCache.ActiveFSIndex = Plugins.GetIndex(fs->GetPluginInterface()); } } @@ -860,8 +860,8 @@ void CPlugins::CalculateStateCache() if (MainWindow->GetNonActivePanel()->Is(ptPluginFS)) { CPluginFSInterfaceEncapsulation* fs = MainWindow->GetNonActivePanel()->GetPluginFS(); - if (fs->NotEmpty()) // should be "always true" - { // according to the interface, we find the plug-in index in the non-active panel + if (fs->NotEmpty()) // this should always be true + { // use the interface to find the plugin index in the inactive panel StateCache.NonactiveFSIndex = Plugins.GetIndex(fs->GetPluginInterface()); } } @@ -896,7 +896,7 @@ void CPlugins::CalculateStateCache() MainWindow->GetActivePanel()->Dirs->Count); int format = PackerFormatConfig.PackIsArchive(file->Name); - if (format != 0) // not an error + if (format != 0) // nonzero is not an error { format--; int index = PackerFormatConfig.GetUnpackerIndex(format); @@ -944,7 +944,7 @@ void CPlugins::CalculateStateCache() void CPlugins::InitSubMenuItems(HWND parent, CMenuPopup* submenu) { - // we check whether they are not entering any of the plug-in's submenus + // we check whether they are not entering any of the plugin's submenus int i; for (i = 0; i < Data.Count; i++) { @@ -982,7 +982,7 @@ BOOL CPlugins::HelpForMenuItem(HWND parent, int suid) { CPluginData* pluginData = Data[i]; if (pluginData->HelpForMenuItem(parent, i, suid, helpDisplayed)) - return helpDisplayed; // processed, stop + return helpDisplayed; // handled, return } return FALSE; } @@ -1332,7 +1332,7 @@ void CPlugins::Load(HWND parent, HKEY regKey) GetValue(itemKey, SALAMANDER_PLUGINS_FS, REG_DWORD, &fs, sizeof(DWORD)); dynMenuExt = FALSE; } - else // new version (fstores functions in a single DWORD using bit fields) + else // new version (stores functions in a single DWORD as bit flags) { DWORD functions = 0; ok = GetValue(itemKey, SALAMANDER_PLUGINS_NAME, REG_SZ, name, MAX_PATH) && @@ -1633,7 +1633,7 @@ void CPlugins::Save(HWND parent, HKEY regKey, HKEY regKeyConfig, HKEY regKeyOrde SetValue(itemKey, SALAMANDER_PLUGINS_FUNCTIONS, REG_DWORD, &functions, sizeof(DWORD)); - if (p->LoadOnStart) // will store only TRUE to save space in the registry + if (p->LoadOnStart) // store only TRUE to save space in the registry { DWORD loadOnStartDWORD = TRUE; SetValue(itemKey, SALAMANDER_PLUGINS_LOADONSTART, REG_DWORD, &loadOnStartDWORD, sizeof(DWORD)); @@ -1664,7 +1664,7 @@ void CPlugins::Save(HWND parent, HKEY regKey, HKEY regKeyConfig, HKEY regKeyOrde { SetValue(itemKey, SALAMANDER_PLUGINS_LASTSLGNAME, REG_SZ, p->LastSLGName, -1); } - if (p->PluginHomePageURL != NULL && p->PluginHomePageURL[0] != 0) // store it if is not an empty string + if (p->PluginHomePageURL != NULL && p->PluginHomePageURL[0] != 0) // store it if it is not an empty string { SetValue(itemKey, SALAMANDER_PLUGINS_HOMEPAGE, REG_SZ, p->PluginHomePageURL, -1); } @@ -1703,7 +1703,7 @@ void CPlugins::Save(HWND parent, HKEY regKey, HKEY regKeyConfig, HKEY regKeyOrde CPluginMenuItem* item = p->MenuItems[i2]; if (item->Name != NULL || item->StateMask == -1) { // we store "state" only if it is an item or a separator with "call-get-state" - DWORD state = p->SupportDynMenuExt ? -1 : item->StateMask; // dynamic menu: this hack handles the situation when a plugin with a dynamic menu switches to a static one during loading and fails in the entry point (the dynamic menu contents remain and if it lacks call-get-state items, the menu might appear even without loading the plugin) + DWORD state = p->SupportDynMenuExt ? -1 : item->StateMask; // dynamic menu: this hack handles the case where a plugin with a dynamic menu switches to a static menu during loading and then fails in the entry point (the dynamic menu contents remain, and if they contain no call-get-state items, the menu may appear even though the plugin is not loaded) SetValue(menuItemKey, SALAMANDER_PLUGINS_MENUITEMSTATE, REG_DWORD, &state, sizeof(DWORD)); SetValue(menuItemKey, SALAMANDER_PLUGINS_MENUITEMID, REG_DWORD, @@ -1826,7 +1826,7 @@ BOOL IsArchiveIndexOK(int i, CPluginFunctionType type) if (i < 0) { CPluginData* p = Plugins.Get(-i - 1); // plugin index - if (p != NULL) // plugin exists; check whether it has the requested function + if (p != NULL) // the plugin exists; now check whether it supports the requested function { return type == pftPanelView && p->SupportPanelView || type == pftPanelEdit && p->SupportPanelEdit || @@ -2049,7 +2049,7 @@ void CPlugins::CheckData() MainWindow->LeaveViewerMasksCS(); } else // default configuration, convert old external+ZIP+TAR+PAK types for "custom pack/unpack" - { // and mark all data as new, also convert old types for "file viewer" and mark + { // and mark all data as new; also convert the old "file viewer" types and flag // the data as new // PackerFormatConfig.GetPackerIndex(i) remains -1 for ZIP, -2 for TAR, -3 for PAK @@ -2064,7 +2064,7 @@ void CPlugins::CheckData() // conversions for "custom pack" for (i = 0; i < PackerConfig.GetPackersCount(); i++) { - if (PackerConfig.GetPackerOldType(i)) // convert old values + if (PackerConfig.GetPackerOldType(i)) // remap old values { PackerConfig.SetPackerOldType(i, FALSE); switch (PackerConfig.GetPackerType(i)) @@ -2074,7 +2074,7 @@ void CPlugins::CheckData() break; // ZIP case 1: PackerConfig.SetPackerType(i, CUSTOMPACKER_EXTERNAL); - break; // external + break; // external packer case 2: PackerConfig.SetPackerType(i, -2); break; // TAR @@ -2158,7 +2158,7 @@ void CPlugins::CheckData() { if (!IsArchiveIndexOK(PackerFormatConfig.GetPackerIndex(i), pftPanelEdit)) { - TRACE_E("Invalid packer index in PackerFormatConfig, ext = " << PackerFormatConfig.GetExt(i)); // when importing configuration from version 2.0, this error is reported because UnCAB released with version 2.0 incorrectly claimed that it could pack archives; (which is nonsense, and this is where the error is corrected) — no further action needed... + TRACE_E("Invalid packer index in PackerFormatConfig, ext = " << PackerFormatConfig.GetExt(i)); // when importing configuration from version 2.0, this error is reported because UnCAB shipped with version 2.0 incorrectly claimed to support packing as well; that is incorrect and is corrected here, so no further action is needed... PackerFormatConfig.SetUsePacker(i, FALSE); // invalid packer index -> "packing is not supported" } } @@ -2300,7 +2300,7 @@ void CPlugins::GetUniqueFSName(char* uniqueFSName, const char* fsName, TIndirect char* num = s + offset; while (*num != 0 && *num >= '0' && *num <= '9') num++; - if (*num == 0) // numeric suffix -> this old fs-name can be used for the sought fs-name + if (*num == 0) // numeric suffix -> this old fs-name can be used for the target fs-name { lstrcpyn(uniqueFSName + offset, s + offset, MAX_PATH - offset); oldFSNameUsed = TRUE; @@ -2324,7 +2324,7 @@ void CPlugins::GetUniqueFSName(char* uniqueFSName, const char* fsName, TIndirect { if (!oldFSNameUsed) sprintf(uniqueFSName + offset, "%d", number++); // change the key name - else // old name is no longer unique, search for another unique name + else // The old name is no longer unique, so search for another unique name. { oldFSNameUsed = FALSE; uniqueFSName[offset] = 0; @@ -2471,7 +2471,7 @@ void CPlugins::FindViewEdit(const char* extensions, int exclude, BOOL& viewFound for (i = 0; i < Data.Count; i++) { if (i == exclude) - continue; // this index cannot be the result + continue; // this index cannot be returned as a result CPluginData* p = Data[i]; len = (int)strlen(p->Extensions); @@ -2543,7 +2543,7 @@ void CPlugins::FindViewEdit(const char* extensions, int exclude, BOOL& viewFound int j; for (j = 0; j < extArray.Count; j++) { - if (StrICmp(externalArchivers[i].ext, extArray[j]) == 0) // ext. archiver found + if (StrICmp(externalArchivers[i].ext, extArray[j]) == 0) // external archiver found { if (!viewFound) { @@ -2733,10 +2733,10 @@ void SearchForSPLs(char* buf, char* s, TIndirectArray& foundFiles, WIN32_F { do { - if ((data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) // it's a file + if ((data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) // File, not a directory { char* str = strrchr(data.cFileName, '.'); - // if (str != NULL && str > data.cFileName && StrICmp(str, ".spl") == 0) // ".cvspass" in Windows is treated as an extension ... + // if (str != NULL && str > data.cFileName && StrICmp(str, ".spl") == 0) // ".cvspass" in Windows is an extension ... if (str != NULL && StrICmp(str, ".spl") == 0) { // SPL extension, add to the list of found files strcpy(s, data.cFileName); @@ -2754,7 +2754,7 @@ void SearchForSPLs(char* buf, char* s, TIndirectArray& foundFiles, WIN32_F TRACE_E(LOW_MEMORY); } } - else // it's a directory + else // directory { if (data.cFileName[0] != 0 && strcmp(data.cFileName, ".") != 0 && strcmp(data.cFileName, "..") != 0) { // not "." or "..", search the subdirectory... @@ -2768,7 +2768,7 @@ void SearchForSPLs(char* buf, char* s, TIndirectArray& foundFiles, WIN32_F } BOOL SearchForAddedSPLs(char* buf, char* s, TIndirectArray& foundFiles) -{ // returns TRUE if plugins from 'foundFiles' should be installed and all plugins loaded +{ // returns TRUE if the plugins from 'foundFiles' should be installed and all plugins loaded strcpy(s, "\\plugins.ver"); HANDLE file = HANDLES_Q(CreateFile(buf, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL)); @@ -2786,7 +2786,7 @@ BOOL SearchForAddedSPLs(char* buf, char* s, TIndirectArray& foundFiles) if (read == 0) isEOF = TRUE; // EOF, no point in reading the file further, just process the remaining buffer char* end = line + off + read; // end of valid bytes in buffer - char* eol = line; // first EOL byte (marks line end) + char* eol = line; // first EOL byte (points to the end of the line) while (eol < end && (*eol == '\r' || *eol == '\n')) eol++; // skip EOLs (even multiple) char* start = eol; // first byte of the line @@ -2810,7 +2810,7 @@ BOOL SearchForAddedSPLs(char* buf, char* s, TIndirectArray& foundFiles) else name[0] = 0; - // (ver + name) - contents of the currently read line + // (ver + name) - contents of the line just read if (firstRow) // first line of the file { firstRow = FALSE; @@ -2871,7 +2871,7 @@ BOOL SearchForAddedSPLs(char* buf, char* s, TIndirectArray& foundFiles) } } -#ifdef _WIN64 // FIXME_X64_WINSCP - this will likely need a different approach... (ignoring missing WinSCP in the 64-bit Salamander) +#ifdef _WIN64 // FIXME_X64_WINSCP - this will probably need to be handled differently... (ignoring missing WinSCP in the 64-bit version of Salamander) BOOL IsPluginUnsupportedOnX64(const char* dllName, const char** pluginNameEN) { const char* nameEN = ""; @@ -2958,7 +2958,7 @@ BOOL CPlugins::ReadPluginsVer(HWND parent, BOOL importFromOldConfig) for (int i = 0; i < Data.Count; i++) { if (!Data[i]->GetLoaded() -#ifdef _WIN64 // FIXME_X64_WINSCP - this will likely need a different approach... (ignoring missing WinSCP in the 64-bit Salamander) +#ifdef _WIN64 // FIXME_X64_WINSCP - this will likely need to be handled differently... (ignoring missing WinSCP in the 64-bit version of Salamander) && !IsPluginUnsupportedOnX64(Data[i]->DLLName) #endif // _WIN64 ) @@ -3069,7 +3069,7 @@ void CPlugins::LoadAll(HWND parent) for (int i = 0; i < Data.Count; i++) { if (!Data[i]->GetLoaded() -#ifdef _WIN64 // FIXME_X64_WINSCP - this will likely need a different approach... (ignoring missing WinSCP in the 64-bit Salamander) +#ifdef _WIN64 // FIXME_X64_WINSCP - this will probably need to be handled differently... (ignoring missing WinSCP in the 64-bit version of Salamander) && !IsPluginUnsupportedOnX64(Data[i]->DLLName) #endif // _WIN64 ) @@ -3273,7 +3273,7 @@ void CPlugins::RemoveNoLongerExistingPlugins(BOOL canDelPluginRegKey, BOOL loadA } } - if (loadAllPlugins) // load all plugins; we care which ones fail to load (their configuration won't transfer from the old version) + if (loadAllPlugins) // load all plugins; track which ones fail to load (their configuration will not transfer from the old version to the new one) { LoadInfoBase |= LOADINFO_NEWSALAMANDERVER; @@ -3293,7 +3293,7 @@ void CPlugins::RemoveNoLongerExistingPlugins(BOOL canDelPluginRegKey, BOOL loadA _snprintf_s(textProgress, _TRUNCATE, "%s\n%s", LoadStr(IDS_AUTOINSTALLPLUGINS), Data[i]->DLLName); analysing.SetText(textProgress); - if (!Data[i]->InitDLL(parent, TRUE, FALSE)) // suppress the excessive repeated blinking of the cursor + if (!Data[i]->InitDLL(parent, TRUE, FALSE)) // suppress excessive cursor blinking { if (notLoadedPluginNames != NULL && Data[i]->RegKeyName != NULL && Data[i]->RegKeyName[0] != 0) { // if it has a registry key, store its name @@ -3389,7 +3389,7 @@ void CPlugins::AutoInstallStdPluginsDir(HWND parent) _snprintf_s(textProgress, _TRUNCATE, "%s\n%s", LoadStr(IDS_AUTOINSTALLPLUGINS), pluginName); analysing.SetText(textProgress); - if (Plugins.AddPlugin(parent, pluginName)) // whatever we add, will already be loaded (loading verifies it is a plugin) + if (Plugins.AddPlugin(parent, pluginName)) // Whatever we add here will already be loaded (loading checks whether it is actually a plugin) { CPluginData* p = Plugins.Get(Plugins.GetCount() - 1); if (StrICmp(p->DLLName, "nethood\\nethood.spl") == 0) @@ -3409,7 +3409,7 @@ void CPlugins::AutoInstallStdPluginsDir(HWND parent) for (int i = 0; i < Data.Count; i++) { if (!Data[i]->GetLoaded() -#ifdef _WIN64 // FIXME_X64_WINSCP - this will likely need a different approach... (ignoring missing WinSCP in the 64-bit Salamander) +#ifdef _WIN64 // FIXME_X64_WINSCP - this will probably need to be handled differently... (ignoring the missing WinSCP in the 64-bit version of Salamander) && !IsPluginUnsupportedOnX64(Data[i]->DLLName) #endif // _WIN64 ) @@ -3548,7 +3548,7 @@ BOOL CPlugins::QueryHotKey(WPARAM wParam, LPARAM lParam, int* pluginIndex, int* CALL_STACK_MESSAGE3("CPlugins::QueryHotKey(0x%IX, 0x%IX, , )", wParam, lParam); BYTE vk = UpperCase[(BYTE)wParam]; // we should be case-insensitive; the user might accidentally have caps lock on and the hotkey edit line always treats the key as uppercase if (vk == 0) - return FALSE; // hotkeys with vk == 0 are disabled for plugins + return FALSE; // plugins do not support hotkeys with vk == 0 BOOL controlPressed = (GetKeyState(VK_CONTROL) & 0x8000) != 0; BOOL shiftPressed = (GetKeyState(VK_SHIFT) & 0x8000) != 0; BOOL altPressed = (GetKeyState(VK_MENU) & 0x8000) != 0; @@ -3585,7 +3585,7 @@ BOOL CPlugins::HandleKeyDown(WPARAM wParam, LPARAM lParam, CFilesWindow* activeP PeekMessage(&msg, hParent, WM_SYSCHAR, WM_SYSCHAR, PM_REMOVE); PeekMessage(&msg, hParent, WM_CHAR, WM_CHAR, PM_REMOVE); - // lower the thread priority to "normal" so the operation doesn't burden the machine too much + // lower the thread priority to "normal" so the operation does not put too much load on the machine SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_NORMAL); if (ExecuteCommand(pluginIndex, menuItemIndex, activePanel, hParent)) @@ -3682,7 +3682,7 @@ int CPlugins::GetNumOfPluginsToLoad() for (int i = 0; i < Data.Count; i++) { if (!Data[i]->GetLoaded() -#ifdef _WIN64 // FIXME_X64_WINSCP - this will likely need a different approach... (ignoring missing WinSCP in the 64-bit Salamander) +#ifdef _WIN64 // FIXME_X64_WINSCP - this will likely need to be handled differently... (ignoring the missing WinSCP in the 64-bit version of Salamander) && !IsPluginUnsupportedOnX64(Data[i]->DLLName) #endif // _WIN64 ) From d79891ac2304cc5a8199597749c97371ac21c2a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:32:56 +0200 Subject: [PATCH 434/710] [translation] Fix src/plugins4.cpp comments Refines translated comments in src/plugins4.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #911 for src/plugins4.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/plugins4.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins4.cpp b/src/plugins4.cpp index d5819c413..d5f712319 100644 --- a/src/plugins4.cpp +++ b/src/plugins4.cpp @@ -99,7 +99,7 @@ void CPlugins::UpdatePluginsOrder(BOOL sortByName) } } DWORD flags = 1; - if (foundIndex == -1) // this plugin has no record in the Order array => append it to the end + if (foundIndex == -1) // this plugin has no entry in the Order array => append it to the end { foundIndex = AddPluginToOrder(pluginData->DLLName, TRUE); if (firstAdded) @@ -254,7 +254,7 @@ int CPlugins::FindIndexForNewPluginFSTimer(DWORD timeoutAbs) if (actTimeoutAbs == timeoutAbs) { while (++m < PluginFSTimers.Count && PluginFSTimers[m]->AbsTimeout - timeoutAbsBase == timeoutAbs) - ; // return the index after the last identical timer + ; // return the index after the last timer with the same timeout return m; // found } else if (actTimeoutAbs > timeoutAbs) @@ -327,12 +327,12 @@ int CPlugins::KillPluginFSTimer(CPluginFSInterfaceAbstract* timerOwner, BOOL all ret++; } } - if (setTimer) // the timer with the nearest timeout was cancelled, the timeout must be reset + if (setTimer) // the timer with the nearest timeout was canceled; the timeout must be reset { if (PluginFSTimers.Count > 0) { DWORD ti = PluginFSTimers[0]->AbsTimeout - GetTickCount(); - if ((int)ti > 0) // if the new timer hasn't already timed out (the difference can even be negative), adjust or start the Windows timer + if ((int)ti > 0) // if the new timer has not already expired (the time difference can even be negative), adjust or start the Windows timer { SetTimer(MainWindow->HWindow, IDT_PLUGINFSTIMERS, ti, NULL); } @@ -411,7 +411,7 @@ void CPlugins::HandlePluginFSTimers() if (PluginFSTimers.Count > 0) { DWORD ti = PluginFSTimers[0]->AbsTimeout - GetTickCount(); - if ((int)ti > 0) // if the new timer hasn't already timed out (the difference can even be negative), adjust or start the Windows timer + if ((int)ti > 0) // if the new timer has not already expired (the time difference can even be negative), adjust or start the Windows timer SetTimer(MainWindow->HWindow, IDT_PLUGINFSTIMERS, ti, NULL); else PostMessage(MainWindow->HWindow, WM_TIMER, IDT_PLUGINFSTIMERS, 0); // process the next timeout as soon as possible From dcc90c3ae5cb24cd36dec546b2f5036b2becf8eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:33:11 +0200 Subject: [PATCH 435/710] [translation] Fix src/pwdmngr.h comments Refines translated comments in src/pwdmngr.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #913 for src/pwdmngr.h, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/pwdmngr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pwdmngr.h b/src/pwdmngr.h index e346be41e..7f7b48869 100644 --- a/src/pwdmngr.h +++ b/src/pwdmngr.h @@ -96,7 +96,7 @@ class CPasswordManager private: BOOL UseMasterPassword; // the user has (at some point) provided the master password used for data encryption; the plaintext value may later be NULL and must be requested again char* PlainMasterPassword; // allocated password (in plaintext) terminated by a null character; NULL if the user has not entered it during this session; not stored into the registry - char* OldPlainMasterPassword; // temporarily holds the previous PlainMasterPassword during the call to Plugins.PasswordManagerEvent(), allowing the plug-in to request decryption of its passwords + char* OldPlainMasterPassword; // temporarily holds the previous PlainMasterPassword during the call to Plugins.PasswordManagerEvent(), allowing the plugin to request decryption of its passwords CMasterPasswordVerifier* MasterPasswordVerifier; // used to verify the correctness of the master password; stored in the registry; may be NULL CSalamanderCryptAbstract* SalamanderCrypt; // interface for the work with cryptographic library From f32b6d4f10bcd42495f2be3b28dca3ee56924d95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:33:26 +0200 Subject: [PATCH 436/710] [translation] Fix src/regwork.cpp comments Refines translated comments in src/regwork.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #914 for src/regwork.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/regwork.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/regwork.cpp b/src/regwork.cpp index 64066ea9f..b08890b41 100644 --- a/src/regwork.cpp +++ b/src/regwork.cpp @@ -733,7 +733,7 @@ BOOL CRegistryWorkerThread::CInUseHandler::CanUseThread(CRegistryWorkerThread* t t->InUse = TRUE; T = t; // destructor will set T->InUse = FALSE } - // otherwise // this is a recursive call (due to the message loop and thus message distribution) = we reject running the work there + // otherwise this is a recursive call (due to the message loop and thus message dispatch), so we reject running the work in the thread return ret; } return FALSE; From 0da779c559c0478ddec7611065eb6fd61c37b94c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:33:42 +0200 Subject: [PATCH 437/710] [translation] Fix src/regwork.h comments Refines translated comments in src/regwork.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #915 for src/regwork.h, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/regwork.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/regwork.h b/src/regwork.h index 0ef5d7f0e..17cdaa251 100644 --- a/src/regwork.h +++ b/src/regwork.h @@ -88,7 +88,7 @@ class CRegistryWorkerThread BOOL CreateKey(HKEY key, const char* name, HKEY& createdKey); // opens the existing subkey 'name' of key 'key'; returns the handle in 'openedKey' - // and TRUE on success. The returned key ('createdKey') must be closed by calling the CloseKey. + // and TRUE on success. The returned key ('openedKey') must be closed by calling CloseKey. BOOL OpenKey(HKEY key, const char* name, HKEY& openedKey); // closes a key previously opened via OpenKey or CreateKey @@ -121,7 +121,7 @@ class CRegistryWorkerThread // thread body - all work takes place here unsigned Body(); - static DWORD WINAPI ThreadBody(void* param); // helper function for the thread body + static DWORD WINAPI ThreadBody(void* param); // thread entry function static unsigned ThreadBodyFEH(void* param); // helper function for the thread body }; From e50624af2404daaa6a32fd0fd79d705f11871d82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:33:57 +0200 Subject: [PATCH 438/710] [translation] Fix src/safefile.cpp comments Refines translated comments in src/safefile.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #916 for src/safefile.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/safefile.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/safefile.cpp b/src/safefile.cpp index 6ec833bed..1505343ac 100644 --- a/src/safefile.cpp +++ b/src/safefile.cpp @@ -171,7 +171,7 @@ CSalamanderSafeFile::SafeFileCreate(const char* fileName, break; } } - if (tmpName[0] != 0) // if we managed to "clean up" the conflicting file/directory, try creating the target + if (tmpName[0] != 0) // if we managed to "clean up" the conflicting file/directory, try creating the target file/directory { // file/directory and then restore the original name to the "cleaned" file/directory hFile = INVALID_HANDLE_VALUE; // if (!isDir) // file @@ -211,7 +211,7 @@ CSalamanderSafeFile::SafeFileCreate(const char* fileName, if (attrs & FILE_ATTRIBUTE_DIRECTORY) { int ret; - // it is a directory + // directory if (isDir) { // if we wanted a directory, that is fine @@ -414,7 +414,7 @@ CSalamanderSafeFile::SafeFileCreate(const char* fileName, if (!isDir) { char* ptr = strrchr(namecopy, '\\'); - // does a path exist that we could create? + // is there a path that we could create? if (ptr == NULL) goto CREATE_FILE; // if so, keep only the path @@ -572,7 +572,7 @@ CSalamanderSafeFile::SafeFileCreate(const char* fileName, *++ptr = '\\'; *++ptr = '\0'; } - // add another one + // add another backslash const char* src = namecopy + strlen(namecpy2); while (*src == '\\') src++; @@ -637,14 +637,14 @@ CSalamanderSafeFile::SafeFileCreate(const char* fileName, CREATE_ALWAYS, dwFlagsAndAttributes, NULL))) == INVALID_HANDLE_VALUE) { DWORD err = GetLastError(); - // handles the situation when a file needs to be overwritten on Samba: - // the file has permissions 440+different_owner and is in a directory where the current user can write to - // (it can be deleted, but not overwritten directly (cannot be opened for writing) - we work around it: - // delete and create the file again) - // (on Samba it is possible to allow deleting read-only files, which allows deleting a read-only file, - // otherwise it cannot be deleted because Windows cannot delete a read-only file and at the same time - // the "read-only" attribute cannot be cleared on that file because the current user is not the owner) - if (DeleteFile(fileName)) // if it is read-only, it can be deleted only on Samba with "delete readonly" allowed + // handles the situation where a file needs to be overwritten on Samba: + // the file has permissions 440+another_owner and is in a directory where the current user can write + // (it can be deleted, but it cannot be overwritten directly because it cannot be opened for writing; + // workaround: delete the file and create it again) + // (on Samba, deletion of read-only files can be allowed, which makes it possible to delete + // a read-only file; otherwise it cannot be deleted because Windows cannot delete a read-only + // file, and the "read-only" attribute cannot be cleared because the current user is not the owner) + if (DeleteFile(fileName)) // if it is read-only, it can be deleted only on Samba with "delete readonly" enabled { // add the handle to HANDLES at the end only if the SAFE_FILE structure is being filled hFile = NOHANDLES(CreateFile(fileName, dwDesiredAccess, dwShareMode, NULL, CREATE_ALWAYS, dwFlagsAndAttributes, NULL)); @@ -757,7 +757,7 @@ CSalamanderSafeFile::SafeFileCreate(const char* fileName, // return the result - if we got this far, we return success if (isDir) return (void*)1; // for a directory, just return anything other than INVALID_HANDLE_VALUE - if (file != NULL) // our task is to initialize the SAFE_FILE structure + if (file != NULL) // initialize the SAFE_FILE structure { file->FileName = DupStr(fileName); if (file->FileName == NULL) @@ -889,7 +889,7 @@ BOOL CSalamanderSafeFile::SafeFileRead(SAFE_FILE* file, LPVOID lpBuffer, long currentSeekHi = 0; DWORD currentSeekLo = SetFilePointer(file->HFile, 0, ¤tSeekHi, FILE_CURRENT); if (currentSeekLo == 0xFFFFFFFF && GetLastError() != NO_ERROR) - goto READ_ERROR; // cannot set the offset, try again + goto READ_ERROR; // Failed to set the offset, try again while (TRUE) { @@ -999,7 +999,7 @@ BOOL CSalamanderSafeFile::SafeFileWrite(SAFE_FILE* file, LPVOID lpBuffer, long currentSeekHi = 0; DWORD currentSeekLo = SetFilePointer(file->HFile, 0, ¤tSeekHi, FILE_CURRENT); if (currentSeekLo == 0xFFFFFFFF && GetLastError() != NO_ERROR) - goto WRITE_ERROR; // cannot set the offset, try again + goto WRITE_ERROR; // cannot set the offset; retry while (TRUE) { @@ -1040,7 +1040,7 @@ BOOL CSalamanderSafeFile::SafeFileWrite(SAFE_FILE* file, LPVOID lpBuffer, LONG hi = currentSeekHi; lo = SetFilePointer(file->HFile, lo, &hi, FILE_BEGIN); if (lo == 0xFFFFFFFF && GetLastError() != NO_ERROR) - goto WRITE_ERROR; // cannot set the offset, try again + goto WRITE_ERROR; // could not set the offset; try again if (lo != (long)currentSeekLo || hi != currentSeekHi) { SetLastError(ERROR_SEEK_ON_DEVICE); From 40db7f934640a67de02ba2e478f430cc39878b5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:34:13 +0200 Subject: [PATCH 439/710] [translation] Fix src/salamdr2.cpp comments Refines translated comments in src/salamdr2.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #918 for src/salamdr2.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/salamdr2.cpp | 170 +++++++++++++++++++++++------------------------ 1 file changed, 85 insertions(+), 85 deletions(-) diff --git a/src/salamdr2.cpp b/src/salamdr2.cpp index f157cd3a7..8e82a8c6f 100644 --- a/src/salamdr2.cpp +++ b/src/salamdr2.cpp @@ -152,7 +152,7 @@ char* GetErrorText(DWORD error) char* ret = act; // NOTE: sprintf_s fills the entire buffer in the debug build, so we cannot pass it the whole buffer (it contains - // other strings as well); either handle it via _CrtSetDebugFillThreshold or provide a smaller size) + // other strings as well); either use _CrtSetDebugFillThreshold or pass a smaller size int l = sprintf(act, ((int)error < 0 ? "(%08X) " : "(%d) "), error); int fl; if ((fl = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, @@ -189,7 +189,7 @@ WCHAR* GetErrorTextW(DWORD error) WCHAR* ret = act; // NOTE: swprintf_s fills the entire buffer in the debug build, so we cannot pass it the whole buffer (it contains - // other strings as well); either handle it via _CrtSetDebugFillThreshold or provide a smaller size) + // other strings as well); either use _CrtSetDebugFillThreshold or pass a smaller size int l = swprintf(act, _countof(buffer) - (act - buffer), ((int)error < 0 ? L"(%08X) " : L"(%d) "), error); int fl; if ((fl = FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM, @@ -231,7 +231,7 @@ BOOL SalamanderActive() { HWND foreground = GetForegroundWindow(); if (foreground == NULL) - return TRUE; // during the Salamander activation blocked by the wait window, GetForegroundWindow() returns NULL + return TRUE; // when Salamander activation is blocked by the wait window, GetForegroundWindow() returns NULL DWORD pid; GetWindowThreadProcessId(foreground, &pid); return pid == GetCurrentProcessId(); @@ -277,8 +277,8 @@ void ThreadSafeWaitWindowFBody(BOOL showCloseButton) { case WM_USER_CREATEWAITWND: { - hForegroundWnd = (HWND)msg.wParam; // if it is not NULL, open the window only if hForegroundWnd is active - if ((int)msg.lParam > 0) // if the delay > 0 + hForegroundWnd = (HWND)msg.wParam; // if hForegroundWnd is not NULL, open the window only if it is active + if ((int)msg.lParam > 0) // if delay > 0 { if (timer != 0) { @@ -335,8 +335,8 @@ void ThreadSafeWaitWindowFBody(BOOL showCloseButton) showWindow = pid == GetCurrentProcessId(); } - // seemingly redundant call to SetWindowPos twice, but otherwise the window unfortunately stays - // all the way at the bottom (above the desktop but below all other windows) + // A seemingly redundant double call to SetWindowPos, but otherwise the window unfortunately stays + // at the very bottom (above the desktop, but below all other windows) SetWindowPos(waitWnd.HWindow, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE); SetWindowPos(waitWnd.HWindow, HWND_NOTOPMOST, 0, 0, 0, 0, @@ -352,10 +352,10 @@ void ThreadSafeWaitWindowFBody(BOOL showCloseButton) BOOL show = (BOOL)msg.wParam; if (show) { - // postpone the display for a brief moment; the reason is the case where the display - // happens because hForegroundWnd is activated after closing a MessageBox; - // if the user interrupted the operation there, an immediate display would - // cause a brief flash of the wait window and its immediate destruction; + // postpone showing the window briefly; this is needed when showing it + // is triggered by activation of hForegroundWindow after a MessageBox closes; + // if the user cancelled the operation there, showing it immediately would + // cause the wait window to flash briefly and then be destroyed immediately; // the delay prevents that if (timer == 0) timer = SetTimer(NULL, 0, 100, NULL); // show the window again after 100ms @@ -374,27 +374,27 @@ void ThreadSafeWaitWindowFBody(BOOL showCloseButton) break; } /* - case WM_USER_ACTIVATEWAITMSG: - { - if (waitWnd.HWindow != NULL) // only if the window is open - { - // seemingly redundant call to SetWindowPos twice, but otherwise the window unfortunately stays - // all the way at the bottom (above the desktop but below all other windows) - - // It is necessary to show the window only in the second operation, - // because changing the Z-order while the window is shown means the window loses - // its cached bitmap (it has CS_SAVEBITS set) and after it closes - // it triggers a repaint of the windows beneath it. - - BOOL visible = IsWindowVisible(waitWnd.HWindow); - SetWindowPos(waitWnd.HWindow, HWND_TOPMOST, 0, 0, 0, 0, - SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE); - SetWindowPos(waitWnd.HWindow, HWND_NOTOPMOST, 0, 0, 0, 0, - visible ? SWP_SHOWWINDOW : 0 | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE); - } - break; - } -*/ + case WM_USER_ACTIVATEWAITMSG: + { + if (waitWnd.HWindow != NULL) // only if the window is open + { + // apparently redundant double call to SetWindowPos, but otherwise the window unfortunately stays + // at the very bottom (above the desktop, but below all other windows) + + // The window must be shown only in the second operation, + // because changing the Z-order while the window is visible means the window loses + // its cached bitmap (it has CS_SAVEBITS set) and after it closes + // triggers a repaint of the windows beneath it. + + BOOL visible = IsWindowVisible(waitWnd.HWindow); + SetWindowPos(waitWnd.HWindow, HWND_TOPMOST, 0, 0, 0, 0, + SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE); + SetWindowPos(waitWnd.HWindow, HWND_NOTOPMOST, 0, 0, 0, 0, + visible ? SWP_SHOWWINDOW : 0 | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE); + } + break; + } + */ case WM_USER_DESTROYWAITWND: { if (timer != 0) @@ -413,7 +413,7 @@ void ThreadSafeWaitWindowFBody(BOOL showCloseButton) waitWnd.HWindow = NULL; } if (msg.wParam) - run = FALSE; // terminate the thread + run = FALSE; // terminate the worker thread hForegroundWnd = NULL; break; } @@ -479,7 +479,7 @@ void CreateSafeWaitWindow(const char* message, const char* caption, HANDLES(LeaveCriticalSection(&SafeWaitMessageCallerSetSection.cs)); SafeWaitWindowClosePressed = FALSE; SafeWaitMessageCallerID = GetCurrentThreadId(); - if (!SafeWaitMessageThreadStarted) // the thread is not running + if (!SafeWaitMessageThreadStarted) // the thread has not been started { HANDLE thread = HANDLES(CreateThread(NULL, 0, ThreadSafeWaitWindowF, (void*)(UINT_PTR)showCloseButton, 0, &SafeWaitMessageThreadID)); @@ -508,7 +508,7 @@ void CreateSafeWaitWindow(const char* message, const char* caption, if (GetLastError() == ERROR_INVALID_THREAD_ID) Sleep(100); // not started yet, wait else - break; // different error + break; // another error } } else @@ -521,9 +521,9 @@ void CreateSafeWaitWindow(const char* message, const char* caption, void DestroySafeWaitWindow(BOOL killThread) { HANDLES(EnterCriticalSection(&SafeWaitMessageCallerSetSection.cs)); - if (killThread || // kill applies to everyone + if (killThread || // killThread bypasses these checks SafeWaitMessageCallerSet && // the window is created - SafeWaitMessageCallerID == GetCurrentThreadId()) // this is the thread that opened it + SafeWaitMessageCallerID == GetCurrentThreadId()) // this is the thread that created it { SafeWaitMessageCallerSet = FALSE; HANDLES(LeaveCriticalSection(&SafeWaitMessageCallerSetSection.cs)); @@ -548,7 +548,7 @@ BOOL GetSafeWaitWindowClosePressed() SafeWaitMessageCallerID == GetCurrentThreadId()) // this is the thread that opened it { HANDLES(LeaveCriticalSection(&SafeWaitMessageCallerSetSection.cs)); - if (SafeWaitMessageThreadStarted) // the thread is running + if (SafeWaitMessageThreadStarted) // the thread has started { return SafeWaitWindowClosePressed; } @@ -570,11 +570,11 @@ BOOL UserWantsToCancelSafeWaitWindow() void ShowSafeWaitWindow(BOOL show) { HANDLES(EnterCriticalSection(&SafeWaitMessageCallerSetSection.cs)); - if (SafeWaitMessageCallerSet && // the window is created + if (SafeWaitMessageCallerSet && // the window has been created SafeWaitMessageCallerID == GetCurrentThreadId()) // this is the thread that opened it { HANDLES(LeaveCriticalSection(&SafeWaitMessageCallerSetSection.cs)); - if (SafeWaitMessageThreadStarted) // the thread is running; send a command to show or hide + if (SafeWaitMessageThreadStarted) // the thread is running; send a message to show or hide the window { PostThreadMessage(SafeWaitMessageThreadID, WM_USER_SHOWWAITWND, show, 0); // we must reset the pressed button and this is a good opportunity, @@ -589,11 +589,11 @@ void ShowSafeWaitWindow(BOOL show) void SetSafeWaitWindowText(const char* message) { HANDLES(EnterCriticalSection(&SafeWaitMessageCallerSetSection.cs)); - if (SafeWaitMessageCallerSet && // the window is created + if (SafeWaitMessageCallerSet && // window created SafeWaitMessageCallerID == GetCurrentThreadId()) // this is the thread that opened it { HANDLES(LeaveCriticalSection(&SafeWaitMessageCallerSetSection.cs)); - if (SafeWaitMessageThreadStarted) // the thread is running; send a command to show or hide + if (SafeWaitMessageThreadStarted) // the thread is running; post a command to show or hide { HANDLES(EnterCriticalSection(&SafeWaitMessageTextSection)); if (SafeWaitMessageText != NULL) @@ -627,9 +627,9 @@ BOOL FileExists(const char* fileName) return TRUE; } */ - // forget that; we will do it via attributes + // ignore that and use attributes instead // - // j.r. FIXME: discuss with Petr; I tried removing the file's right to read + // j.r. FIXME: Discuss with Petr; I tried removing the file's permission to read // attributes, but SalGetFileAttributes() still does not report an error. How is that possible? DWORD attr = SalGetFileAttributes(fileName); return (attr != INVALID_FILE_ATTRIBUTES && (attr & FILE_ATTRIBUTE_DIRECTORY) == 0); @@ -755,7 +755,7 @@ BOOL DoExpandVarString(HWND msgParent, const char* varText, BOOL validateOnly, i } else { - if (!validateOnly && validMax && !detectMax) // phase of using precomputed values + if (!validateOnly && validMax && !detectMax) // use precomputed values { if (currentMaxVarIndex < maxVarWidthsCount) { @@ -939,7 +939,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = if (buffer != NULL) { int totalLen = (valueOutLen > 0) ? valueOutLen : len; - if (out + totalLen + 1 <= outEnd) // it must still be possible to null-terminate it + if (out + totalLen + 1 <= outEnd) // there must still be room for the null terminator { if (varPlacementIndex < varPlacementIndexCount) { @@ -1085,7 +1085,7 @@ CQuadWord MyGetDiskFreeSpace(const char* path, CQuadWord* total) *total = CQuadWord(a, 0) * CQuadWord(b, 0) * CQuadWord(d, 0); } else - ret = CQuadWord(-1, -1); // error, do not display it + ret = CQuadWord(-1, -1); // error, do not display } return ret; } @@ -1152,7 +1152,7 @@ BOOL ResolveSubsts(char* resPath) break; } char tgt[MAX_PATH]; - if (GetSubstInformation(LowerCase[resPath[0]] - 'a', tgt, MAX_PATH) && tgt[0] != '\\' /* mapped network disks handled elsewhere */) + if (GetSubstInformation(LowerCase[resPath[0]] - 'a', tgt, MAX_PATH) && tgt[0] != '\\' /* mapped network drives are handled elsewhere */) { if (!SalPathAppend(tgt, resPath + 2, MAX_PATH)) { @@ -1234,14 +1234,14 @@ void ResolveLocalPathWithReparsePoints(char* resPath, const char* path, BOOL* cu firstRepPoint = FALSE; UINT drvType = getRepPointDestRes && repPointPath[0] != 0 && repPointPath[1] == ':' ? GetDriveTypeForDriveLetterPath(repPointPath) : DRIVE_UNKNOWN; if (getRepPointDestRes && (IsUNCPath(repPointPath) || drvType == DRIVE_REMOTE)) // symlink to a UNC or mapped network path (available since Vista) - { // it only makes sense to look for reparse points on fixed disks, so stop here (network paths are a problem because their reparse points will return "local paths" (C:\...), which, if used on this machine (instead of the remote one they come from), it will lead to nonsensical results) + { // It only makes sense to look for reparse points on fixed disks, so stop here (network paths are a problem because their reparse points return "local paths" (C:\...), which, if used on this machine instead of the remote one they come from, lead to nonsensical results) if (netPath != NULL) lstrcpyn(netPath, repPointPath, MAX_PATH); GetRootPath(resPath, repPointPath); break; } if (!getRepPointDestRes || repPointPath[0] == 0 || repPointPath[1] != ':') - { // unknown reparse point or volume mount point; in any case do not traverse it, let the system try + the path must not be shortened or it may refer to another volume + { // unknown reparse point or volume mount point; in any case, do not traverse it, let the system handle it, and do not shorten the path or it may refer to another volume *cutResPathIsPossible = FALSE; break; } @@ -1266,7 +1266,7 @@ void ResolveLocalPathWithReparsePoints(char* resPath, const char* path, BOOL* cu break; } if (drvType != DRIVE_FIXED) - break; // reparse points only make sense to look for on fixed disks + break; // only look for reparse points on fixed disks } } } @@ -1282,7 +1282,7 @@ BOOL MyGetDiskFreeSpace(const char* path, LPDWORD lpSectorsPerCluster, lstrcpyn(resPath, path, MAX_PATH); ResolveSubsts(resPath); GetRootPath(ourPath, resPath); - if (!IsUNCPath(ourPath) && GetDriveType(ourPath) == DRIVE_FIXED) // reparse points only make sense to look for on fixed disks + if (!IsUNCPath(ourPath) && GetDriveType(ourPath) == DRIVE_FIXED) // only look for reparse points on fixed disks { // gradually try shortening the path; on a mounted directory it can return the mounted disk parameters // if it is not a root path, try traversing the reparse points as well BOOL cutPathIsPossible = TRUE; @@ -1319,7 +1319,7 @@ BOOL MyGetVolumeInformation(const char* path, char* rootOrCurReparsePoint, char* lstrcpyn(resPath, path, MAX_PATH); ResolveSubsts(resPath); GetRootPath(ourPath, resPath); - if (!IsUNCPath(ourPath) && GetDriveType(ourPath) == DRIVE_FIXED) // reparse points only make sense to look for on fixed disks + if (!IsUNCPath(ourPath) && GetDriveType(ourPath) == DRIVE_FIXED) // it only makes sense to look for reparse points on fixed disks { // gradually try shortening the path; on a mounted directory it can return the mounted disk parameters // if it is not a root path, try traversing the reparse points as well BOOL rootOrCurReparsePointSet = FALSE; @@ -1344,7 +1344,7 @@ BOOL MyGetVolumeInformation(const char* path, char* rootOrCurReparsePoint, char* GetRootPath(resPath, path); ResolveSubsts(resPath); GetRootPath(rootOrCurReparsePoint, path); - if (strlen(resPath) < strlen(ourPath)) // if the path we return volume info for is longer than the path obtained by resolving the subst, we must append this part of the path after the subst root + if (strlen(resPath) < strlen(ourPath)) // if the path for which we return volume information is longer than the path obtained by resolving the subst, we must append this part of the path after the subst root { if (_strnicmp(resPath, ourPath, strlen(resPath)) == 0) // always true { @@ -1496,7 +1496,7 @@ BOOL GetReparsePointDestination(const char* repPointDir, char* repPointDstBuf, D TRACE_E("GetReparsePointDestination(): Unexpected format of symbolic link name (it is not a local path): " << repPointDir); return FALSE; } - symlinkAbsPath[0] = (WCHAR)(unsigned char)repPointDir[0]; // a bit of a hack (we rely on a fact that 'a-zA-Z' convert to Unicode 1:1) + symlinkAbsPath[0] = (WCHAR)(unsigned char)repPointDir[0]; // a bit of a hack (we rely on the fact that 'a-zA-Z' map to Unicode 1:1) symlinkAbsPath[1] = L':'; if (*s == L'\\') lstrcpynW(symlinkAbsPath + 2, s, 1000 - 2); @@ -1601,9 +1601,9 @@ UINT MyGetDriveType(const char* path) ResolveLocalPathWithReparsePoints(ourPath, path, &cutPathIsPossible, NULL, NULL, NULL, NULL, NULL); while ((ret = GetDriveType(ourPath)) == DRIVE_UNKNOWN) - { // NOTE: differs from MyGetVolumeInformation because GetDriveType returns success for any path (not just root + mounted volume) + { // NOTE: differs from MyGetVolumeInformation in that GetDriveType succeeds for any path (not just a root or mounted volume) if (!cutPathIsPossible || !CutDirectory(ourPath)) - break; // we must not cut it or even the root did not succeed; end with error + break; // cannot shorten the path, or even the root did not succeed; stop with an error SalPathAddBackslash(ourPath, MAX_PATH); } } @@ -1702,7 +1702,7 @@ void GetMessagePos(POINT& p) void AlterFileName(char* tgtName, char* filename, int filenameLen, int format, int change, BOOL dir) { - // j.r. I disabled the macro because AlterFileName is called heavily from RefreshListBox() + // j.r. The macro was disabled because AlterFileName is called heavily from RefreshListBox() CALL_STACK_MESSAGE_NONE // CALL_STACK_MESSAGE6("AlterFileName(, %s, %d, %d, %d, %d)", filename, filenameLen, format, change, dir); if (format == 6) @@ -1714,7 +1714,7 @@ void AlterFileName(char* tgtName, char* filename, int filenameLen, int format, i if (change != 0 && format != 5 && format != 7) { char* s = filename; - while (*s != 0) // searching for the last dot (file extensions) + while (*s != 0) // find the last dot (file extension) if (*s++ == '.') ext = s; // if (ext != NULL && ext <= filename + 1) ext = NULL; // ".cvspass" in Windows is considered an extension .. @@ -1829,7 +1829,7 @@ void AlterFileName(char* tgtName, char* filename, int filenameLen, int format, i case 7: // name mixed case, extension lower case { char* s = filename; - while (*s != 0) // searching for the last dot (file extension) + while (*s != 0) // find the last dot (file extension) if (*s++ == '.') ext = s; // if (ext == NULL || ext <= filename + 1) ext = s; // ".cvspass" in Windows is considered an extension ... @@ -1839,7 +1839,7 @@ void AlterFileName(char* tgtName, char* filename, int filenameLen, int format, i BOOL capital = TRUE; char* tgt = tgtName; char* name = filename; - while (name < ext) // name mixed case + while (name < ext) // name in mixed case { if (!capital) { @@ -1870,7 +1870,7 @@ void AlterFileName(char* tgtName, char* filename, int filenameLen, int format, i } } - if (change == 1 && format != 5 && format != 7) // change only the name + if (change == 1 && format != 5 && format != 7) // change only the file name { if (ext != NULL) { @@ -1907,8 +1907,8 @@ void MinimizeApp(HWND mainWnd) // **************************************************************************** BOOL CheckOnlyOneInstance(const CCommandLineParams* cmdLineParams) { - // :-) a small gift for the transition to the text config :-)))) - // load even if ForceOnlyOneInstance == TRUE + // Compatibility for the transition to the text config: + // load the setting even if ForceOnlyOneInstance == TRUE LoadSaveToRegistryMutex.Enter(); HKEY salamander; if (SALAMANDER_ROOT_REG != NULL && @@ -1934,7 +1934,7 @@ BOOL CheckOnlyOneInstance(const CCommandLineParams* cmdLineParams) /* BOOL CheckOnlyOneInstance(const char *leftPath, const char *rightPath, const char *activePath, BYTE activatePanel) { - // :-) a small gift for the transition to the text config :-)))) + // temporary aid for the transition to a text config // load even if ForceOnlyOneInstance == TRUE LoadSaveToRegistryMutex.Enter(); HKEY salamander; @@ -1955,18 +1955,18 @@ BOOL CheckOnlyOneInstance(const char *leftPath, const char *rightPath, const cha if (Configuration.ForceOnlyOneInstance || Configuration.OnlyOneInstance) { HWND wnd; - int c = 100; // wait up to five seconds to find the predecessor (it may not have opened the main window yet) + int c = 100; // wait up to five seconds to find the previous instance (it may not have opened the main window yet) while (c--) { wnd = FindWindow(CMAINWINDOW_CLASSNAME, NULL); - if (wnd == NULL && !FirstLocalInstance_252b1_or_later) + if (wnd == NULL && !FirstLocalInstance_252b1_or_later) Sleep(50); - else - break; // professional optimization since 2.52 -- why loop 100 times ;-) + else + break; // optimization since 2.52: stop polling once it is no longer needed } - if (wnd != NULL) // we have a predecessor + if (wnd != NULL) // a previous instance exists { - // allow the use of SetForegroundWindow, otherwise Salamander will not be able to bring itself to the front + // allow SetForegroundWindow, otherwise Salamander will not be able to bring itself to the foreground DWORD otherSalPID; GetWindowThreadProcessId(wnd, &otherSalPID); AllowSetForegroundWindow(otherSalPID); @@ -1974,28 +1974,28 @@ BOOL CheckOnlyOneInstance(const char *leftPath, const char *rightPath, const cha PostMessage(wnd, WM_USER_SHOWWINDOW, 0, 0); // allocate shared space in pagefile.sys - HANDLE fm = HANDLES(CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, // FIXME_X64 are we passing x86/x64 incompatible data? + HANDLE fm = HANDLES(CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, // FIXME_X64 are we passing x86/x64-incompatible data? sizeof(CSetPathsParams), NULL)); if (fm != NULL) { int c = -1; - CSetPathsParams *params = (CSetPathsParams*)HANDLES(MapViewOfFile(fm, FILE_MAP_WRITE, 0, 0, 0)); // FIXME_X64 are we passing x86/x64 incompatible data? + CSetPathsParams *params = (CSetPathsParams*)HANDLES(MapViewOfFile(fm, FILE_MAP_WRITE, 0, 0, 0)); // FIXME_X64 are we passing x86/x64-incompatible data? if (params != NULL) { ZeroMemory(params, sizeof(CSetPathsParams)); lstrcpyn(params->LeftPath, leftPath, MAX_PATH); lstrcpyn(params->RightPath, rightPath, MAX_PATH - 1); // Salamander older than 2.52 could crash on a path of length MAX_PATH - 1 - // unfortunately when receiving mapped memory we cannot determine its size to the byte (only with page-size granularity) - // so we use a "trick" -- append a signature after the structure; if it is there, it is very likely our data - // and the receiver can keep reading + // unfortunately, when receiving mapped memory we cannot determine its exact byte size + // only with memory-page granularity, so we use a trick: append a signature after the structure; + // if it is present, the data is very likely ours and the receiver can continue reading params->MagicSignature1 = 0x07f2ab13; params->MagicSignature2 = 0x471e0901; params->StructVersion = 1; lstrcpyn(params->ActivePath, activePath, MAX_PATH); params->ActivatePanel = activatePanel; - // let the old process read the memory and change directories + // let the old process read the memory and change the directories c = 51; // give it 5 seconds while (--c) { @@ -2008,7 +2008,7 @@ BOOL CheckOnlyOneInstance(const char *leftPath, const char *rightPath, const cha } } - // then we wrap it up + // clean up HANDLES(UnmapViewOfFile(params)); } HANDLES(CloseHandle(fm)); @@ -2054,7 +2054,7 @@ void DrawSplitLine(HWND HWindow, int newDragSplitX, int oldDragSplitX, RECT clie int r0 = client.left + newDragSplitX + splitThick; if (newDragSplitX == -1) r0 = l0 = -1; - if (oldDragSplitX != -1) // compute the stripe for invalidation + if (oldDragSplitX != -1) // compute the strip to invalidate { int l1 = client.left + oldDragSplitX; int r1 = client.left + oldDragSplitX + splitThick; @@ -2158,8 +2158,8 @@ BOOL LoadRGB(HKEY hKey, const char* name, COLORREF& color) { char buf[50]; DWORD returnedType; - // for backward compatibility (up to reg:\HKEY_CURRENT_USER\Software\Altap\Altap Salamander 2.53 beta 1 (DB 33) inclusive) we can load both - // the representation as a string and the more efficient binary one + // for backward compatibility (up to reg:\HKEY_CURRENT_USER\Software\Altap\Altap Salamander 2.53 beta 1 (DB 33) inclusive), both + // the string representation and the more efficient binary one can be loaded if (GetValue2(hKey, name, REG_SZ, REG_DWORD, &returnedType, buf, 50)) { if (returnedType == REG_SZ) @@ -2209,8 +2209,8 @@ BOOL LoadRGBF(HKEY hKey, const char* name, SALCOLOR& color) { char buf[50]; DWORD returnedType; - // for backward compatibility (up to reg:\HKEY_CURRENT_USER\Software\Altap\Altap Salamander 2.53 beta 1 (DB 33) inclusive) we can load both - // the representation as a string and the more efficient binary one + // for backward compatibility (up to reg:\HKEY_CURRENT_USER\Software\Altap\Altap Salamander 2.53 beta 1 (DB 33) inclusive), both + // the string representation and the more efficient binary one can be loaded if (GetValue2(hKey, name, REG_SZ, REG_DWORD, &returnedType, buf, 50)) { if (returnedType == REG_SZ) @@ -2773,7 +2773,7 @@ BOOL ImportConfiguration(HWND hParent, const char* fileName, BOOL ignoreIfNotExi if (buf != NULL) { - // first try to parse it into memory; if it contains format errors we will not shove it into the registry at all + // first try to parse it into memory; if it contains syntax errors, we will not put it into the registry at all CSalamanderRegistryExAbstract* memReg = REG_MemRegistryFactory(); LPTSTR bufMem = _tcsdup(buf); // the Parse call changes the buffer, so we must keep the original for the next Parse TRACE_I("ImportConfiguration(): Parse to memory: begin"); @@ -2833,7 +2833,7 @@ BOOL ImportConfiguration(HWND hParent, const char* fileName, BOOL ignoreIfNotExi case RPE_INVALID_MBCS: case RPE_INVALID_FORMAT: errTextID = IDS_IMPORTCFG_INVALIDFORMAT; - break; // format error + break; // syntax error // case RPE_OUT_OF_MEMORY: // case RPE_KEY_OPEN: From 497556d3ec26abbc1fe0ed056e4f5492e3d63dfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:34:52 +0200 Subject: [PATCH 440/710] [translation] Fix src/salamdr4.cpp comments Refines translated comments in src/salamdr4.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #920 for src/salamdr4.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/salamdr4.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/salamdr4.cpp b/src/salamdr4.cpp index 3ac0a8d0f..ded5e11cd 100644 --- a/src/salamdr4.cpp +++ b/src/salamdr4.cpp @@ -156,7 +156,7 @@ CTruncatedString::Get() BOOL CTruncatedString::TruncateText(HWND hWindow, BOOL forMessageBox) { - // if there is nothing to truncate, exit + // if there is nothing to truncate, return if (SubStrIndex == -1) return TRUE; @@ -190,7 +190,7 @@ BOOL CTruncatedString::TruncateText(HWND hWindow, BOOL forMessageBox) GetTextExtentExPoint(hDC, Text + SubStrIndex, SubStrLen, maxWidth, &fitChars, alpDx, &sz); if (fitChars < SubStrLen) { - // first part with the truncated substring + // first part with a truncated substring memcpy(TruncatedText, Text, SubStrIndex + fitChars); // ellipsis memcpy(TruncatedText + SubStrIndex + fitChars, "...", 3); @@ -231,7 +231,7 @@ BOOL CTruncatedString::TruncateText(HWND hWindow, BOOL forMessageBox) width -= (alpDx[index] - alpDx[index - 1]); index--; } - // the first part with the shortened substring + // first part with the truncated substring memcpy(TruncatedText, Text, index); // ellipsis memcpy(TruncatedText + index, "...", 3); @@ -331,7 +331,7 @@ int ExpandPluralString(char* lpOut, int nOutMax, const char* lpFmt, int nParCoun if (nOutMax > 0 && lpOut != NULL) *lpOut = 0; - // check and skip the {!} signature + // check for and skip the {!} marker if (input != NULL && *input++ == '{' && *input++ == '!' && *input++ == '}' && nOutMax > 0) { while (*input != 0) @@ -341,7 +341,7 @@ int ExpandPluralString(char* lpOut, int nOutMax, const char* lpFmt, int nParCoun *(input + 1) == '{' || *(input + 1) == '}')) // escape sequence { input++; - if (output >= outputNullTerm) // the buffer must also fit the terminating zero + if (output >= outputNullTerm) // the buffer must also have room for the terminating null { lpOut[nOutMax - 1] = 0; TRACE_E("ExpandPluralString: truncated output string."); @@ -351,7 +351,7 @@ int ExpandPluralString(char* lpOut, int nOutMax, const char* lpFmt, int nParCoun } else { - if (*input == '{') // perform expansion of the curly brace + if (*input == '{') // expand the brace expression { input++; @@ -376,7 +376,7 @@ int ExpandPluralString(char* lpOut, int nOutMax, const char* lpFmt, int nParCoun return (int)(output - lpOut); } } - else // use the next parameter in order + else // use the next parameter in sequence { if (actParIndex < nParCount) { @@ -451,7 +451,7 @@ int ExpandPluralString(char* lpOut, int nOutMax, const char* lpFmt, int nParCoun (*(subStr + 1) == '|' || *(subStr + 1) == '\\' || *(subStr + 1) == ':' || *(subStr + 1) == '{' || *(subStr + 1) == '}')) // escape sequence subStr++; - if (output >= outputNullTerm) // the buffer must also fit the terminating zero + if (output >= outputNullTerm) // the buffer must also have room for the terminating null { lpOut[nOutMax - 1] = 0; TRACE_E("ExpandPluralString: truncated output string."); @@ -476,7 +476,7 @@ int ExpandPluralString(char* lpOut, int nOutMax, const char* lpFmt, int nParCoun } else { - if (output >= outputNullTerm) // the buffer must also fit the terminating zero + if (output >= outputNullTerm) // the buffer must also have room for the terminating null { lpOut[nOutMax - 1] = 0; TRACE_E("ExpandPluralString: truncated output string."); @@ -930,7 +930,7 @@ DWORD AddUnicodeToClipboard(const char* str, int textLen) { if (textLen > 0 && MultiByteToWideChar(CP_ACP, 0, str, textLen, unicodeStr, unicodeLen + 1) == 0) err = GetLastError(); - unicodeStr[unicodeLen] = 0; // terminating zero + unicodeStr[unicodeLen] = 0; // terminating null HANDLES(GlobalUnlock(unicode)); if (err == ERROR_SUCCESS && SetClipboardData(CF_UNICODETEXT, unicode) == NULL) err = GetLastError(); @@ -1012,7 +1012,7 @@ BOOL CopyHTextToClipboardW(HGLOBAL hGlobalText, int textLen) else err = GetLastError(); - if (SetClipboardData(CF_UNICODETEXT, hGlobalText) == NULL) // then store the multibyte text + if (SetClipboardData(CF_UNICODETEXT, hGlobalText) == NULL) // then store the text in multibyte format err = GetLastError(); } else @@ -1375,7 +1375,7 @@ void WINAPI InternalGetTimeOnlyForDisk() void WINAPI InternalGetAttr() { TransferLen = 0; - // WARNING: if we want to display more attributes, we must rework GetAttrsString() and the DISPLAYED_ATTRIBUTES mask!!! + // WARNING: if we want to display additional attributes, GetAttrsString() and the DISPLAYED_ATTRIBUTES mask must be reworked! if (TransferFileData->Attr & FILE_ATTRIBUTE_READONLY) TransferBuffer[TransferLen++] = 'R'; if (TransferFileData->Attr & FILE_ATTRIBUTE_HIDDEN) @@ -1575,7 +1575,7 @@ BOOL CSalamanderView::SetColumnName(int index, const char* name, const char* des return FALSE; } if (index == 0 && !Panel->IsExtensionInSeparateColumn() && (Panel->ValidFileData & VALID_DATA_EXTENSION)) - { // check double (twice null-terminated) strings + the non-emptiness of the second one + and their copy + { // validate the double string (double-null-terminated), ensure the second string is non-empty, and copy both const char* s = name + strlen(name) + 1; const char* beg = s; while (s < name + COLUMN_NAME_MAX && *s != 0) From 59f10c88bfcab95668603ae34d1dd5473a0b2d5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:35:07 +0200 Subject: [PATCH 441/710] [translation] Fix src/salamdr5.cpp comments Refines translated comments in src/salamdr5.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #921 for src/salamdr5.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/salamdr5.cpp | 92 ++++++++++++++++++++++++------------------------ 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/src/salamdr5.cpp b/src/salamdr5.cpp index eedca0ab4..44c341a47 100644 --- a/src/salamdr5.cpp +++ b/src/salamdr5.cpp @@ -75,7 +75,7 @@ BOOL InitializeCheckThread() // try to start the first check-path thread DWORD ThreadID; ThreadCheckPath[0] = HANDLES(CreateThread(NULL, 0, ThreadCheckPathF, (void*)0, 0, &ThreadID)); - if (ThreadCheckPath[0] == NULL) // it failed, but that is fine ... + if (ThreadCheckPath[0] == NULL) // failure here is acceptable... { TRACE_E("Unable to start the first CheckPath thread."); } @@ -139,7 +139,7 @@ unsigned ThreadCheckPathFBody(void* param) // directory accessibility test { CPFirstFree = TRUE; // for entering the thread, otherwise a redundant safeguard ;-) // TRACE_I("First check-path thread: Wait for start"); - WaitForSingleObject(CPFirstStart, INFINITE); // wait for startup or termination + WaitForSingleObject(CPFirstStart, INFINITE); // wait for the start signal or termination // TRACE_I("First check-path thread: Wait satisfied"); CPFirstFree = FALSE; if (CPFirstTerminate) // termination @@ -157,7 +157,7 @@ unsigned ThreadCheckPathFBody(void* param) // directory accessibility test BOOL threadValid = (SalGetFileAttributes(threadPath) != 0xFFFFFFFF); DWORD error = GetLastError(); if (!threadValid && error == ERROR_INVALID_PARAMETER) // reports on the root of removable media (CD/DVD, ZIP) - error = ERROR_NOT_READY; // bit of a hack,but basically it is about the "not ready" issue and not "invalid parameter" ;-) + error = ERROR_NOT_READY; // Treat this as a "not ready" problem, not "invalid parameter". // We are bypassing an error when reading attributes (since W2K, reading attributes can be disabled in Properties/Security), at least on fixed disks. if (!threadValid && error == ERROR_ACCESS_DENIED && @@ -175,9 +175,9 @@ unsigned ThreadCheckPathFBody(void* param) // directory accessibility test HANDLE find = HANDLES_Q(FindFirstFile(threadPath, &data)); if (find != INVALID_HANDLE_VALUE) { - // the path is probably OK after all (cannot be used without the fixed-disk test, unfortunately FindFirstFile - // most likely runs from the cache because a disconnected network disk happily starts listing, so - // for check-path it is unusable (we already had it and had to replace it)) + // the path is probably OK after all (unfortunately this cannot be used without the fixed-disk test; FindFirstFile + // most likely uses the cache, because it will happily start listing a disconnected network drive, so + // it is unusable for check-path (it was already used here once and had to be replaced)) threadValid = TRUE; HANDLES(FindClose(find)); } @@ -336,7 +336,7 @@ DWORD SalCheckPath(BOOL echo, const char* path, DWORD err, BOOL postRefresh, HWN else lastError = ERROR_SUCCESS; } - else // network path -> go to one of the secondary threads + else // network path -> run in one of the worker threads { Sleep(100); // take a short break and test again goto TEST_AGAIN; @@ -374,7 +374,7 @@ DWORD SalCheckPath(BOOL echo, const char* path, DWORD err, BOOL postRefresh, HWN { DWORD exit; GetAsyncKeyState(VK_ESCAPE); // init GetAsyncKeyState - see help - if (freeThreadIndex == 0) // first check-path thread, completion check + if (freeThreadIndex == 0) // check whether the first check-path thread has finished { if (WaitForSingleObject(CPFirstEnd, 200) != WAIT_TIMEOUT) // 200 ms - grace period { @@ -415,7 +415,7 @@ DWORD SalCheckPath(BOOL echo, const char* path, DWORD err, BOOL postRefresh, HWN if (freeThreadIndex == 0) // first check-path thread, completion check { - if (WaitForSingleObject(CPFirstEnd, 200) != WAIT_TIMEOUT) // 200 ms before the next test + if (WaitForSingleObject(CPFirstEnd, 200) != WAIT_TIMEOUT) // 200 ms before the next check { exit = CPFirstExit; // return value replacement } @@ -424,7 +424,7 @@ DWORD SalCheckPath(BOOL echo, const char* path, DWORD err, BOOL postRefresh, HWN } else { - WaitForSingleObject(ThreadCheckPath[freeThreadIndex], 200); // 200 ms before the next test + WaitForSingleObject(ThreadCheckPath[freeThreadIndex], 200); // 200 ms before the next check if (!GetExitCodeThread(ThreadCheckPath[freeThreadIndex], &exit)) exit = STILL_ACTIVE; } @@ -433,7 +433,7 @@ DWORD SalCheckPath(BOOL echo, const char* path, DWORD err, BOOL postRefresh, HWN } DestroySafeWaitWindow(); } - if (exit == 0) // it was completed successfully + if (exit == 0) // completed successfully { valid = ThreadValid; lastError = ThreadLastError; @@ -447,7 +447,7 @@ DWORD SalCheckPath(BOOL echo, const char* path, DWORD err, BOOL postRefresh, HWN else // it was terminated; let it finish { valid = FALSE; - lastError = ERROR_USER_TERMINATED; // my error code + lastError = ERROR_USER_TERMINATED; // internal error code MSG msg; // discard buffered ESC while (PeekMessage(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE)) @@ -558,7 +558,7 @@ BOOL SalCheckAndRestorePath(HWND parent, const char* path, BOOL tryNet) ok = TRUE; } } - else // if the user does not have an account on the requested machine at all + else // if the user does not have an account on the target machine { // test the accessibility of the UNC path and let the user log in if necessary if (CheckAndConnectUNCNetworkPath(parent, path, pathInvalid, FALSE)) @@ -630,7 +630,7 @@ BOOL SalCheckAndRestorePathWithCut(HWND parent, char* path, BOOL& tryNet, DWORD& if (!donotReconnect && CheckAndRestoreNetworkConnection(parent, path[0], pathInvalid)) continue; } - else // if the user does not have an account on the requested machine at all + else // if the user does not have an account on the target machine { // we test the accessibility of the UNC path and let the user log in if necessary if (CheckAndConnectUNCNetworkPath(parent, path, pathInvalid, donotReconnect)) @@ -771,7 +771,7 @@ BOOL SalParsePath(HWND parent, char* path, int& type, BOOL& isDir, char*& second char root[MAX_PATH]; GetRootPath(root, path); - // we do not test network paths if they were recently accessed + // do not test network paths if we have just accessed them BOOL tryNet = !curPathIsDiskOrArchive || curPath == NULL || !HasTheSameRootPath(root, curPath); // we check/reconnect the root path; if the root path works, the rest of the path should work as well @@ -793,17 +793,17 @@ BOOL SalParsePath(HWND parent, char* path, int& type, BOOL& isDir, char*& second // if the path contains a mask, cut it off without calling SalGetFileAttributes BOOL hasMask = FALSE; - if (end > afterRoot) // not just the root yet + if (end > afterRoot) // not just the root { char* end2 = end; - while (*--end2 != '\\') // it is certain that there is at least one '\\' after the root path + while (*--end2 != '\\') // there is guaranteed to be at least one '\\' after the root path { if (*end2 == '*' || *end2 == '?') hasMask = TRUE; } if (hasMask) // the name contains a mask -> trim it { - CutSpacesFromBothSides(end2 + 1); // spaces at the beginning and end of the mask must be removed at all costs; they only cause trouble (e.g. "*.* " + "a" = "a. ") + CutSpacesFromBothSides(end2 + 1); // spaces at the beginning and end of the mask must be removed; they only cause problems (e.g. "*.* " + "a" = "a. ") end = end2; lastChar = *end; *end = 0; @@ -822,7 +822,7 @@ BOOL SalParsePath(HWND parent, char* path, int& type, BOOL& isDir, char*& second DWORD attrs = len2 < MAX_PATH ? SalGetFileAttributes(path) : 0xFFFFFFFF; if (attrs != 0xFFFFFFFF) // this part of the path exists { - if ((attrs & FILE_ATTRIBUTE_DIRECTORY) == 0) // it is a file + if ((attrs & FILE_ATTRIBUTE_DIRECTORY) == 0) // file { if (lastChar != 0 || backslashAtEnd || mustBePath) // is there a backslash after the archive name? { @@ -837,7 +837,7 @@ BOOL SalParsePath(HWND parent, char* path, int& type, BOOL& isDir, char*& second return TRUE; } - else // it was supposed to be an archive (a path inside the file is provided), report it loudly + else // it should have been an archive (a path inside the file is specified), report an error { text = LoadStr(IDS_NOTARCHIVEPATH); if (error != NULL) @@ -845,12 +845,12 @@ BOOL SalParsePath(HWND parent, char* path, int& type, BOOL& isDir, char*& second break; // report the error } } - else // no trimming yet + no '\\' at the end -> this is a file overwrite + else // nothing has been trimmed yet, and there is no '\\' at the end -> file overwrite { // the existing path must not contain the file name, trim it... isDir = FALSE; while (*--end != '\\') - ; // it is certain that there is at least one '\\' after the root path + ; // there is definitely at least one '\\' after the root path lastChar = *end; // so the path is not destroyed break; // ordinary Windows path - but to a file } @@ -874,7 +874,7 @@ BOOL SalParsePath(HWND parent, char* path, int& type, BOOL& isDir, char*& second } *end = lastChar; // restore 'path' while (*--end != '\\') - ; // it is certain that there is at least one '\\' after the root path + ; // there is definitely at least one '\\' after the root path lastChar = *end; *end = 0; } @@ -929,7 +929,7 @@ BOOL SalSplitWindowsPath(HWND parent, const char* title, const char* errorTitle, { if (mask - 1 > path && *(mask - 2) == '\\' && (mask - 1 > afterRoot || *path == '\\')) // not a root or it is a UNC root - { // it is necessary to remove the redundant backslash from the end of the string + { // remove the redundant backslash from the end of the string memmove(mask - 2, mask - 1, 1 + strlen(mask) + 1); // '\0' + mask + '\0' mask--; } @@ -1014,7 +1014,7 @@ BOOL SalSplitGeneralPath(HWND parent, const char* title, const char* errorTitle, if (pathIsDir) // the existing part of the path is a directory { - if (*secondPart != 0) // there is also a non-existent part of the path here + if (*secondPart != 0) // the path also contains a non-existent part { // analyze the non-existent part of the path - file/directory + mask? char* s = secondPart; @@ -1033,7 +1033,7 @@ BOOL SalSplitGeneralPath(HWND parent, const char* title, const char* errorTitle, } } - if (maskFrom != secondPart) // there is some path before the mask + if (maskFrom != secondPart) // path before the mask { memcpy(tmpNewDirs, secondPart, maskFrom - secondPart); tmpNewDirs[maskFrom - secondPart] = 0; @@ -1072,9 +1072,9 @@ BOOL SalSplitGeneralPath(HWND parent, const char* title, const char* errorTitle, strcpy(mask, "*.*"); } } - CutSpacesFromBothSides(mask); // spaces at the beginning and end of the mask must be removed at all costs; they only cause trouble + CutSpacesFromBothSides(mask); // remove spaces at the beginning and end of the mask; they only cause trouble - if (tmpNewDirs[0] != 0) // there are still new directories to create + if (tmpNewDirs[0] != 0) // new directories still need to be created { if (newDirs != NULL) // creation is supported { @@ -1122,7 +1122,7 @@ BOOL SalSplitGeneralPath(HWND parent, const char* title, const char* errorTitle, } return TRUE; // leave the Copy/Move dialog loop and perform the operation } - else // there is no non-existent part of the path (the specified path exists completely) + else // no part of the path is missing (the specified path fully exists) { if (dirName != NULL && curPath != NULL && !backslashAtEnd && selCount <= 1) // without '\\' at the end of the path (force directory) + one source @@ -1157,7 +1157,7 @@ BOOL SalSplitGeneralPath(HWND parent, const char* title, const char* errorTitle, return TRUE; // leave the Copy/Move dialog loop and perform the operation } } - else // file overwrite - 'secondPart' points to the file name in the 'path' + else // file overwrite - 'secondPart' points to the file name in path 'path' { char* nameEnd = secondPart; while (*nameEnd != 0 && *nameEnd != '\\') @@ -1179,7 +1179,7 @@ BOOL SalSplitGeneralPath(HWND parent, const char* title, const char* errorTitle, // CutSpacesFromBothSides(mask); // cannot do that here: a file with exactly this name exists; removing the spaces would point to a different file (not a problem: the "invalid" file already existed before the operation, nothing new "invalid" will be created) return TRUE; // leave the Copy/Move dialog loop and perform the operation } - else // path into the archive? not possible here... + else // archive path? not supported here... { SalMessageBox(parent, LoadStr(IDS_ARCPATHNOTSUPPORTED), errorTitle, MB_OK | MB_ICONEXCLAMATION); if (backslashAtEnd) @@ -1218,15 +1218,15 @@ BOOL FileNameIsInvalid(const char* name, BOOL isFullName, BOOL ignInvalidName) if (*s == ':') return TRUE; if (ignInvalidName) - return FALSE; // periods and spaces at the end do not concern us now (a directory of that name can exist on the disk) + return FALSE; // trailing periods and spaces do not matter here (a directory with that name can exist on disk) int nameLen = (int)(s - name); return nameLen > 0 && (name[nameLen - 1] <= ' ' || name[nameLen - 1] == '.'); } BOOL SalMoveFile(const char* srcName, const char* destName) { - // if the name ends with a space/period, we must append '\\', otherwise MoveFile - // spaces/periods are trimmed and it therefore works with a different name + // if the name ends with a space or period, we must append '\\', otherwise MoveFile + // trims the spaces or periods and therefore works with a different name char srcNameCopy[3 * MAX_PATH]; MakeCopyWithBackslashIfNeeded(srcName, srcNameCopy); char destNameCopy[3 * MAX_PATH]; @@ -1378,7 +1378,7 @@ BOOL CSystemPolicies::GetMyCanRun(const char* fileName) while (*p != 0 && *p == ' ') p++; if (strlen(p) >= MAX_PATH) - return RestrictRun == 0; // forbid execution if only selected commands are allowed to run (this one could not be separated from the command line) + return RestrictRun == 0; // disallow execution if only selected commands are allowed (this command could not be separated from the command line) char name[MAX_PATH]; lstrcpyn(name, p, MAX_PATH); // trim spaces from the right @@ -1490,9 +1490,9 @@ BOOL SalGetFileSize2(const char* fileName, CQuadWord& size, DWORD* err) DWORD SalGetFileAttributes(const char* fileName) { CALL_STACK_MESSAGE2("SalGetFileAttributes(%s)", fileName); - // if the path ends with a space/period, we must append '\\', otherwise GetFileAttributes - // trims spaces/periods and works with a different path; it does not work for files, - // but it is still better than retrieving attributes of a different file/directory (for "c:\\file.txt " + // if the path ends with a space or period, we must append '\\'; otherwise GetFileAttributes + // trims spaces and periods and works with a different path; although this does not work for files, + // it is still better than retrieving attributes of a different file or directory (for "c:\\file.txt " // it works with the name "c:\\file.txt") char fileNameCopy[3 * MAX_PATH]; MakeCopyWithBackslashIfNeeded(fileName, fileNameCopy); @@ -1595,7 +1595,7 @@ BOOL IsLantasticDrive(const char* path, char* lastLantasticCheckRoot, BOOL& last GetRootPath(lastLantasticCheckRoot, path); lastIsLantasticPath = FALSE; - if (path[0] != '\\') // not UNC - it may not be a network path (it cannot be LANTASTIC) + if (path[0] != '\\') // not UNC - it does not have to be a network path (it cannot be LANTASTIC) { if (GetDriveType(lastLantasticCheckRoot) != DRIVE_REMOTE) return FALSE; // not a network path @@ -1699,13 +1699,13 @@ BOOL SalIsValidFileNameComponent(const char* fileNameComponent) const char* s = fileNameComponent + strlen(fileNameComponent); if (s - fileNameComponent > MAX_PATH - 4) return FALSE; - // test white-spaces and '.' at the end of the name (the file system would trim them) + // Check for whitespace and '.' at the end of the name (the file system would trim them) s--; if (s >= start && (*s <= ' ' || *s == '.')) return FALSE; BOOL testSimple = TRUE; - BOOL simple = TRUE; // TRUE = risk of "lpt1", "prn" and other critical names, better append '_' + BOOL simple = TRUE; // TRUE = names like "lpt1", "prn", and other reserved names may occur, so append '_' BOOL wasSpace = FALSE; while (*fileNameComponent != 0) @@ -1727,7 +1727,7 @@ BOOL SalIsValidFileNameComponent(const char* fileNameComponent) { wasSpace = TRUE; if (*fileNameComponent != ' ') - return FALSE; // disallowed white-space + return FALSE; // disallowed whitespace } else { @@ -1753,7 +1753,7 @@ BOOL SalIsValidFileNameComponent(const char* fileNameComponent) fileNameComponent++; } if (simple && IsDeviceNameAux(start, fileNameComponent)) - return FALSE; // simple name + device + return FALSE; // simple name that matches a device name return TRUE; } @@ -1761,7 +1761,7 @@ void SalMakeValidFileNameComponent(char* fileNameComponent) { char* start = fileNameComponent; BOOL testSimple = TRUE; - BOOL simple = TRUE; // TRUE = risk of "lpt1", "prn" and other critical names, better append '_' + BOOL simple = TRUE; // TRUE = risk of "lpt1", "prn", and other reserved device names, better append '_' BOOL wasSpace = FALSE; // removal of leading white-spaces (Petr: commented out because spaces at the beginning of file and directory names are simply allowed) /* @@ -1785,7 +1785,7 @@ void SalMakeValidFileNameComponent(char* fileNameComponent) s--; if (s >= start) *(s + 1) = 0; - else // empty string or a sequence of '.' characters and white-spaces -> replace with the name "_" (the system trims all of this as well) + else // empty string or a sequence of '.' characters and whitespace -> replace with "_" (the system trims all of this as well) { strcpy(start, "_"); simple = FALSE; @@ -1870,7 +1870,7 @@ void SetThreadNameInVC(LPCSTR szThreadName) THREADNAME_INFO info; info.dwType = 0x1000; info.szName = szThreadName; - info.dwThreadID = -1 /* caller thread */; + info.dwThreadID = -1 /* calling thread */; info.dwFlags = 0; __try From 57142ba413e5d08ea4d6068984a816a143d1196c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:35:23 +0200 Subject: [PATCH 442/710] [translation] Fix src/salamdr6.cpp comments Refines translated comments in src/salamdr6.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #922 for src/salamdr6.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/salamdr6.cpp | 66 ++++++++++++++++++++++++------------------------ 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/src/salamdr6.cpp b/src/salamdr6.cpp index 6691df28d..43dfe6d7b 100644 --- a/src/salamdr6.cpp +++ b/src/salamdr6.cpp @@ -77,7 +77,7 @@ BOOL CALLBACK CloseAllOwnedEnabledDialogsEnumProc(HWND wnd, LPARAM lParam) } } } - return TRUE; // walk through all windows; there may be multiple dialogs next to each other from the same owner + return TRUE; // walk through all windows; there may be multiple adjacent dialogs with the same owner } void CloseAllOwnedEnabledDialogs(HWND parent, DWORD tid) @@ -216,7 +216,7 @@ BOOL GetFileNameForViewer(CFileNamesEnumRequestType requestType, int srcUID, int { HANDLES(EnterCriticalSection(&FileNamesEnumDataSect)); waitRes = WaitForSingleObject(FileNamesEnumDone, 0); - if (waitRes == WAIT_OBJECT_0) // done (the timeout was a false alarm; the message was delivered, the name lookup just was not finished) + if (waitRes == WAIT_OBJECT_0) // done (the timeout was a false alarm; the message was delivered, but the name lookup did not finish) { *lastFileIndex = FileNamesEnumData.LastFileIndex; if (fileName != NULL) @@ -229,7 +229,7 @@ BOOL GetFileNameForViewer(CFileNamesEnumRequestType requestType, int srcUID, int *isFileSelected = FileNamesEnumData.IsFileSelected; ret = FileNamesEnumData.Found; } - else // a real timeout (timed out while delivering the message to the source) + else // actual timeout (message delivery to the source timed out) { FileNamesEnumData.TimedOut = TRUE; if (srcBusy != NULL) @@ -400,7 +400,7 @@ BOOL IsPathOnVolumeSupADS(const char* path, BOOL* isFAT32) if (!MyGetVolumeInformation(path, NULL, NULL, NULL, NULL, 0, NULL, NULL, &fileSystemFlags, fileSystemNameBuffer, 100)) { TRACE_E("MyGetVolumeInformation failed for: " << path); - return TRUE; // we would rather assume the filesystem supports ADS; if not, something will fail later + return TRUE; // we would rather assume that the filesystem supports ADS; otherwise, something will fail later } if (isFAT32 != NULL) *isFAT32 = StrICmp(fileSystemNameBuffer, "FAT32") == 0; @@ -443,7 +443,7 @@ char* PrintDiskSize(char* buf, const CQuadWord& size2, int mode) for (; i < 6; i++) { if (sizeDouble >= 1023.5) - sizeDouble /= 1024; // division in double! + sizeDouble /= 1024; // use floating-point division else break; } @@ -863,8 +863,8 @@ BOOL CNames::LoadFromClipboard(HWND hWindow) if (size == 0) TRACE_E("CNames::LoadFromClipboard(): unexpected situation: size == 0!"); - // for example Miranda appends additional Unicode data after the text, so we - // prefer to find the end of the null-terminated string ourselves, but without exceeding + // for example, Miranda appends additional Unicode data after the text, so we + // find the end of the null-terminated string ourselves, without exceeding // the end of the allocated memory block const WCHAR* s = textW; const WCHAR* end = textW + size / sizeof(WCHAR); @@ -880,7 +880,7 @@ BOOL CNames::LoadFromClipboard(HWND hWindow) HANDLES(GlobalUnlock(handle)); } } - if (text == NULL) // probably not Unicode, try ANSI (when Unicode is present, ANSI is usually broken — without diacritics) + if (text == NULL) // Probably not Unicode; try ANSI (when Unicode is present, ANSI is usually broken, without diacritics) { handle = GetClipboardData(CF_TEXT); if (handle != NULL) @@ -1466,15 +1466,15 @@ HWND CShellExecuteWnd::Create(HWND hParent, const char* format, ...) RECT r; if (!IsWindow(hParent) || !GetClientRect(hParent, &r)) { - // hopefully a good default... + // reasonable default window size r.right = 800; r.bottom = 600; } - // the window will be stretched across the MainWindow/Find area and must be transparent (otherwise the dialog background will not redraw) - // example: if I remove WS_EX_TRANSPARENT, open Find and press Delete (to the Recycle Bin), then move the - // confirmation dialog for deleting to the Recycle Bin, the background of the Find window will not repaint beneath it (this shell window, - // which has WM_ERASEBKGND/WM_PAINT suppressed, will show up there) + // the window will cover the MainWindow/Find area and must be transparent (otherwise the dialog background will not be drawn) + // example: if WS_EX_TRANSPARENT is removed, opening Find and pressing Delete (to the Recycle Bin), then moving the + // confirmation dialog for Recycle Bin deletion is enough to stop the Find window background from repainting underneath + // it; this shell window, with WM_ERASEBKGND/WM_PAINT suppressed, will be shown there CWindow::CreateEx(WS_EX_TRANSPARENT, SHELLEXECUTE_CLASSNAME, buff, @@ -1510,7 +1510,7 @@ CShellExecuteWnd::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (!CanClose) { MSG msg; // flush the message queue (WMP9 buffered Enter and pressed OK for us) - // while (PeekMessage(&msg, HWindow, 0, 0, PM_REMOVE)); // Petr: replaced it with just discarding messages from the keyboard (without TranslateMessage and DispatchMessage an endless loop threatens; observed when unloading Automation with memory leaks, before the message box about leaks appeared there was an infinite loop, WM_PAINT kept being added to the queue and we kept throwing it away) + // while (PeekMessage(&msg, HWindow, 0, 0, PM_REMOVE)); // Petr: replaced this with discarding only keyboard messages (without TranslateMessage and DispatchMessage, an infinite loop can occur; this was found while unloading Automation with memory leaks, before the leak message box was displayed, WM_PAINT kept being added to the queue and we kept discarding it) while (PeekMessage(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE)) ; @@ -1532,9 +1532,9 @@ CShellExecuteWnd::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) while (1) Sleep(1000); /* - // the creation of the bug report has started in a separate thread - // now we ensure this thread gets stuck as long as the bug report dialog is open - // this thread will freeze on the following macro thanks to the DontSuspend and ExceptionExists variables + // Bug report creation started in a separate thread. + // Now block this thread for as long as the bug report dialog remains open. + // This thread will freeze at the following macro due to the DontSuspend and ExceptionExists variables. CALL_STACK_MESSAGE1("CShellExecuteWnd::WindowProc: LOCK"); */ } @@ -1576,7 +1576,7 @@ BOOL CALLBACK EnumChildProc(HWND hwnd, LPARAM lParam) } data->Count++; } - return TRUE; // keep searching; we want every window + return TRUE; // Continue searching; we want all windows } int EnumCShellExecuteWnd(HWND hParent, char* text, int textMax) @@ -1676,7 +1676,7 @@ CTargetPathState GetTargetPathState(CTargetPathState upperDirState, const char* case tpsNotEncryptedExisting: { DWORD attr = SalGetFileAttributes(targetPath); - if (attr == INVALID_FILE_ATTRIBUTES) // the next subdirectory no longer exists, inherit the Encrypted attribute + if (attr == INVALID_FILE_ATTRIBUTES) // subdirectory no longer exists; inherit the encrypted attribute return upperDirState == tpsEncryptedExisting ? tpsEncryptedNotExisting : tpsNotEncryptedNotExisting; if (attr & FILE_ATTRIBUTE_ENCRYPTED) return tpsEncryptedExisting; @@ -1708,7 +1708,7 @@ BOOL SafeGetOpenFileName(LPOPENFILENAME lpofn) ret = GetOpenFileName(lpofn); lpofn->lpstrInitialDir = oldInitDir; } - if (!ret && CommDlgExtendedError() != 0 /* only if this is not Cancel in the dialog */) + if (!ret && CommDlgExtendedError() != 0 /* only if the dialog was not canceled */) TRACE_E("Cannot open OpenFile dialog box. CommDlgExtendedError()=" << CommDlgExtendedError()); return ret; } @@ -1729,7 +1729,7 @@ BOOL SafeGetSaveFileName(LPOPENFILENAME lpofn) ret = GetSaveFileName(lpofn); lpofn->lpstrInitialDir = oldInitDir; } - if (!ret && CommDlgExtendedError() != 0 /* only if this is not Cancel in the dialog */) + if (!ret && CommDlgExtendedError() != 0 /* only if the dialog was not canceled */) TRACE_E("Cannot open SaveFile dialog box. CommDlgExtendedError()=" << CommDlgExtendedError()); return ret; } @@ -1801,7 +1801,7 @@ BOOL DuplicateBackslashes(char* buffer, int bufferSize) l++; s++; } - else // it does not fit; trim the buffer + else // does not fit; trim the buffer { ret = FALSE; memmove(s + 1, s, l - (s - buffer)); // double '\\', cut off one character @@ -1839,7 +1839,7 @@ BOOL DuplicateDollars(char* buffer, int bufferSize) l++; s++; } - else // it does not fit; trim the buffer + else // does not fit; truncate the buffer { ret = FALSE; memmove(s + 1, s, l - (s - buffer)); // double the '$', cut off one character @@ -1866,7 +1866,7 @@ BOOL AddDoubleQuotesIfNeeded(char* buf, int bufSize) char* sp = beg; while (*++sp > ' ') ; - if (sp < end) // the name contains at least one space, we need to add quotation marks + if (sp < end) // the name contains at least one space, so we need to add double quotes { if ((bufEnd - buf) + 2 >= bufSize) return FALSE; // not enough room in the buffer @@ -2022,11 +2022,11 @@ BOOL GetSidMD5(BYTE* sidMD5) /* // according to http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=748596&SiteID=1 // the integrity level should be set on Vista, but I have not been able to reproduce the problem on Vista/Server 2008 -// so for now I am keeping it only in the comment until we run into it +// so for now I am leaving this only as a comment until we run into it // // Windows Integrity Mechanism Design // http://msdn.microsoft.com/en-us/library/bb625963.aspx -if (windowsVistaAndLater) // FIXME: I have not encountered a situation on Vista where I had to deal with integrity levels (between AsAdmin / regular applications) +if (windowsVistaAndLater) // FIXME: I have not encountered a case on Vista where I would have to deal with the integrity level (between AdAdmin / normal application) { PSECURITY_DESCRIPTOR pSD; ConvertStringSecurityDescriptorToSecurityDescriptor( @@ -2133,12 +2133,12 @@ BOOL GetProcessIntegrityLevel(DWORD* integrityLevel) BOOL ret = FALSE; - if (WindowsVistaAndLater) // integrity levels were introduced starting with Windows Vista + if (WindowsVistaAndLater) // integrity levels were introduced in Windows Vista { hProcess = GetCurrentProcess(); if (OpenProcessToken(hProcess, TOKEN_QUERY, &hToken)) { - // Get the Integrity level. + // Get the integrity level. if (!GetTokenInformation(hToken, (_TOKEN_INFORMATION_CLASS)25 /*TokenIntegrityLevel*/, NULL, 0, &dwLengthNeeded)) { dwError = GetLastError(); @@ -2203,14 +2203,14 @@ LONG SalRegQueryValue(HKEY hKey, LPCSTR lpSubKey, LPSTR lpData, PLONG lpcbData) { if (*lpcbData < 1 || ((char*)lpData)[*lpcbData - 1] != 0) { - if ((DWORD)*lpcbData < dataBufSize) // only values of REG_SZ and REG_EXPAND_SZ type reach this point, so one null terminator is enough + if ((DWORD)*lpcbData < dataBufSize) // Only REG_SZ and REG_EXPAND_SZ values can reach this point, so one null terminator is enough { ((char*)lpData)[*lpcbData] = 0; (*lpcbData)++; } else // not enough room for the null terminator in the buffer { - (*lpcbData)++; // request the necessary null terminator + (*lpcbData)++; // request space for the required null terminator return ERROR_MORE_DATA; } } @@ -2232,7 +2232,7 @@ LONG SalRegQueryValueEx(HKEY hKey, LPCSTR lpValueName, LPDWORD lpReserved, lpcbData != NULL && (ret == ERROR_MORE_DATA || lpData == NULL && ret == ERROR_SUCCESS)) { - (*lpcbData) += type == REG_MULTI_SZ ? 2 : 1; // proactively ask for the possible extra null terminator(s) + (*lpcbData) += type == REG_MULTI_SZ ? 2 : 1; // request space for possible extra null terminator(s) return ret; } if (ret == ERROR_SUCCESS && lpData != NULL) @@ -2246,7 +2246,7 @@ LONG SalRegQueryValueEx(HKEY hKey, LPCSTR lpValueName, LPDWORD lpReserved, } else // not enough room for the null terminator in the buffer { - (*lpcbData) += type == REG_MULTI_SZ ? 2 : 1; // request the necessary null terminator(s) + (*lpcbData) += type == REG_MULTI_SZ ? 2 : 1; // account for the required null terminator(s) return ERROR_MORE_DATA; } } @@ -2259,7 +2259,7 @@ LONG SalRegQueryValueEx(HKEY hKey, LPCSTR lpValueName, LPDWORD lpReserved, } else // not enough room for the second null terminator in the buffer { - (*lpcbData)++; // request the necessary null terminator + (*lpcbData)++; // request space for the required null terminator return ERROR_MORE_DATA; } } From 91c66cffa01a8ffc48298c33a0c10ecdf8a9aa3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:36:02 +0200 Subject: [PATCH 443/710] [translation] Fix src/salinflt.cpp comments Refines translated comments in src/salinflt.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #924 for src/salinflt.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/salinflt.cpp | 114 +++++++++++++++++++++++------------------------ 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/src/salinflt.cpp b/src/salinflt.cpp index f214c4e05..47b120d90 100644 --- a/src/salinflt.cpp +++ b/src/salinflt.cpp @@ -141,7 +141,7 @@ int huft_build(CDecompressionObject* decompress, circular buffer. The index is updated simply by incrementing and then and'ing with 0x7fff (32K-1) (window size - 1). */ // sliding window is defined in CDecompressionObject and could be -// any size greater or equal 32K +// any size greater than or equal to 32K /* Tables for deflate from PKZIP's appnote.txt. */ /* Order of the bit length code lengths */ @@ -186,7 +186,7 @@ static const uch cpdext32[] = { #define MAXDISTS 30 #endif -/* And'ing with mask_bits[n] masks the lower n bits */ +/* ANDing with mask_bits[n] masks the lower n bits */ const ush mask_bits[] = { 0x0000, 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, @@ -200,16 +200,16 @@ const ush mask_bits[] = { DUMPBITS(j) where NEEDBITS makes sure that b has at least j bits in it, and - DUMPBITS removes the bits from b. The macros use the variable k - for the number of bits in b. Normally, b and k are register - variables for speed and are initialized at the begining of a + DUMPBITS removes the bits from b. The macros use the variable k + for the number of bits in b. Normally, b and k are register + variables for speed and are initialized at the beginning of a routine that uses these macros from a global bit buffer and count. - In order to not ask for more bits than there are in the compressed - stream, the Huffman tables are constructed to only ask for just - enough bits to make up the end-of-block code (value 256). Then no - bytes need to be "returned" to the buffer at the end of the last - block. See the huft_build() routine. + In order not to ask for more bits than there are in the compressed + stream, the Huffman tables are constructed to ask for just enough + bits to make up the end-of-block code (value 256). Then no bytes + need to be "returned" to the buffer at the end of the last block. + See the huft_build() routine. */ //this function should replace NEXTBYTE macro @@ -270,7 +270,7 @@ uch NextByte(CDecompressionObject* decompress) the longer codes. The time it costs to decode the longer codes is then traded against the time it takes to make longer tables. - This results of this trade are in the variables lbits and dbits + The results of this tradeoff are reflected in the variables lbits and dbits below. lbits is the number of bits the first level table for literal/ length codes can decode in one step, and dbits is the same thing for the distance codes. Subsequent tables are also less than or equal to @@ -287,7 +287,7 @@ uch NextByte(CDecompressionObject* decompress) than five bits, flat. The optimum values for speed end up being about one bit more than those, so lbits is 8+1 and dbits is 5+1. The optimum values may differ though from machine to machine, and - possibly even between compilers. Your mileage may vary. + possibly even between compilers. */ static const int lbits = 9; /* bits in base literal/length lookup table */ @@ -295,15 +295,15 @@ static const int dbits = 6; /* bits in base distance lookup table */ #ifndef ASM_INFLATECODES -/* inflate (decompress) the codes in a deflated (compressed) block. - Return an error code or zero if it all goes ok. */ +/* Inflate (decompress) the codes in a deflated (compressed) block. + Returns an error code, or zero on success. */ int inflate_codes(CDecompressionObject* decompress, - struct huft* tl, //literal/length + struct huft* tl, // literal/length decoder tables struct huft* td, //distance decoder tables int bl, int bd) //number of bits decoded by tl[] and td[] { unsigned e; /* table entry flag/number of extra bits */ - unsigned n, d; /* length and index for copy */ + unsigned n, d; /* length and distance for copy */ unsigned w; /* current window position */ struct huft* t; /* pointer to table entry */ unsigned ml, md; /* masks for bl and bd bits */ @@ -323,7 +323,7 @@ int inflate_codes(CDecompressionObject* decompress, /* inflate the coded data */ ml = mask_bits[bl]; /* precompute masks for speed */ md = mask_bits[bd]; - while (1) /* do until end of block */ + while (1) /* Repeat until the end of the block */ { NEEDBITS((unsigned)bl, decompress) t = tl + ((unsigned)b & ml); @@ -389,7 +389,7 @@ int inflate_codes(CDecompressionObject* decompress, w += e; d += e; } - else /* do it slowly to avoid memcpy() overlap */ + else /* copy byte-by-byte to handle overlap */ #endif /* !NOMEMCPY */ do { @@ -408,7 +408,7 @@ int inflate_codes(CDecompressionObject* decompress, break; } - if (e == 31) /* it's the EOB signal */ + if (e == 31) /* end-of-block (EOB) code */ { /* sorry for this goto, but we have to exit two loops at once */ goto cleanup_decode; @@ -438,7 +438,7 @@ int inflate_codes(CDecompressionObject* decompress, #endif /* ASM_INFLATECODES */ -// "decompress" an inflated type 0 (stored) block. +// Decompress a type 0 (stored) block. int inflate_stored(CDecompressionObject* decompress) { unsigned n; // number of bytes in block @@ -451,7 +451,7 @@ int inflate_stored(CDecompressionObject* decompress) b = decompress->BitBuf; // initialize bit buffer k = decompress->BitCount; - // go to byte boundary + // align to a byte boundary n = k & 7; DUMPBITS(n); @@ -464,20 +464,20 @@ int inflate_stored(CDecompressionObject* decompress) return 1; // error in compressed data DUMPBITS(16) - /* old copy routine, the new should be faster (I hope so) - // read and output the compressed data - while (n--) - { - NEEDBITS(8, decompress) - decompress->SlideWin[w++] = (uch)b; - if (w == decompress->WinSize) - { - decompress->Flush(w); - w = 0; - } - DUMPBITS(8, decompress) - } -*/ + /* old copy routine; the new one should be faster + // read and output the compressed data + while (n--) + { + NEEDBITS(8, decompress) + decompress->SlideWin[w++] = (uch)b; + if (w == decompress->WinSize) + { + decompress->Flush(w); + w = 0; + } + DUMPBITS(8, decompress) + } + */ //copy bytes from input to the output while (n) @@ -525,12 +525,12 @@ int inflate_stored(CDecompressionObject* decompress) return 0; } -// decompress an inflated type 1 (fixed Huffman codes) block. We should -// either replace this with a custom decoder, or at least precompute the -// Huffman tables. +// Decompress a type 1 (fixed Huffman codes) block. +// This should either be replaced with a custom decoder or at least have the +// Huffman tables precomputed. int inflate_fixed(CDecompressionObject* decompress) { - // if first time, set up tables for fixed blocks + // if this is the first time, set up tables for fixed blocks if (decompress->fixed_tl == (struct huft*)NULL) { int i; // temporary variable @@ -543,7 +543,7 @@ int inflate_fixed(CDecompressionObject* decompress) l[i] = 9; for (; i < 280; i++) l[i] = 7; - for (; i < 288; i++) // make a complete, but wrong code set + for (; i < 288; i++) // make a complete but incorrect code set l[i] = 8; decompress->fixed_bl = 7; if ((i = huft_build(decompress, l, 288, 257, @@ -574,7 +574,7 @@ int inflate_fixed(CDecompressionObject* decompress) decompress->fixed_bl, decompress->fixed_bd) != 0; } -/* decompress an inflated type 2 (dynamic Huffman codes) block. */ +/* Decompress a type 2 (dynamic Huffman codes) block. */ int inflate_dynamic(CDecompressionObject* decompress) { int i; /* temporary variables */ @@ -589,7 +589,7 @@ int inflate_dynamic(CDecompressionObject* decompress) unsigned nb; /* number of bit length codes */ unsigned nl; /* number of literal/length codes */ unsigned nd; /* number of distance codes */ - unsigned ll[MAXLITLENS + MAXDISTS]; /* lit./length and distance code lengths */ + unsigned ll[MAXLITLENS + MAXDISTS]; /* literal/length and distance code lengths */ ulg b; /* bit buffer */ unsigned k; /* number of bits in bit buffer */ @@ -597,7 +597,7 @@ int inflate_dynamic(CDecompressionObject* decompress) b = decompress->BitBuf; k = decompress->BitCount; - /* read in table lengths */ + /* read the table lengths */ NEEDBITS(5, decompress) nl = 257 + ((unsigned)b & 0x1f); /* number of literal/length codes */ DUMPBITS(5) @@ -608,9 +608,9 @@ int inflate_dynamic(CDecompressionObject* decompress) nb = 4 + ((unsigned)b & 0xf); /* number of bit length codes */ DUMPBITS(4) if (nl > MAXLITLENS || nd > MAXDISTS) - return 1; /* bad lengths */ + return 1; /* invalid code counts */ - /* read in bit-length-code lengths */ + /* Read bit-length code lengths. */ for (j = 0; j < nb; j++) { NEEDBITS(3, decompress) @@ -620,7 +620,7 @@ int inflate_dynamic(CDecompressionObject* decompress) for (; j < 19; j++) ll[border[j]] = 0; - /* build decoding table for trees--single level, 7 bit lookup */ + /* build a decoding table for the trees -- single-level, 7-bit lookup */ bl = 7; i = huft_build(decompress, ll, 19, 19, NULL, NULL, &tl, &bl); if (bl == 0) /* no bit lengths */ @@ -644,7 +644,7 @@ int inflate_dynamic(CDecompressionObject* decompress) DUMPBITS(j) j = td->v.n; if (j < 16) /* length of code in bits (0..15) */ - ll[i++] = l = j; /* save last length in l */ + ll[i++] = l = j; /* save the last length in l */ else if (j == 16) /* repeat last length 3 to 6 times */ { NEEDBITS(2, decompress) @@ -740,13 +740,13 @@ int inflate_dynamic(CDecompressionObject* decompress) if ((i = inflate_codes(decompress, tl, td, bl, bd)) != 0) TRACE_I("inflate_dynamic: error in inflate_codes"); - /* free the decoding tables, return */ + /* Free the decoding tables and return. */ huft_free(decompress, tl); huft_free(decompress, td); return i; } -/* decompress an inflated block */ +/* decompress a deflated block */ int inflate_block(CDecompressionObject* decompress, int* e) // int *e; { @@ -758,12 +758,12 @@ int inflate_block(CDecompressionObject* decompress, int* e) b = decompress->BitBuf; k = decompress->BitCount; - /* read in last block bit */ + /* read the last-block bit */ NEEDBITS(1, decompress) *e = (int)b & 1; DUMPBITS(1) - /* read in block type */ + /* read the block type */ NEEDBITS(2, decompress) t = (unsigned)b & 3; DUMPBITS(2) @@ -785,7 +785,7 @@ int inflate_block(CDecompressionObject* decompress, int* e) return 2; } -//decompress an inflated entry +//decompress a deflated entry int Inflate(CDecompressionObject* decompress) { CALL_STACK_MESSAGE1("Inflate()"); @@ -794,7 +794,7 @@ int Inflate(CDecompressionObject* decompress) /* #ifdef DEBUG - unsigned h = 0; // maximum struct huft's malloc'ed + unsigned h = 0; // maximum number of malloc'ed struct huft objects #endif */ @@ -852,8 +852,8 @@ int FreeFixedHufman(CDecompressionObject* decompress) } /* - * GRR: moved huft_build() and huft_free() down here; used by explode() - * and fUnZip regardless of whether USE_ZLIB defined or not + * Moved huft_build() and huft_free() here; they are used by explode() + * and fUnZip regardless of whether USE_ZLIB is defined. */ /* If BMAX needs to be larger than 16, then h and x[] should be ulg. */ @@ -1002,9 +1002,9 @@ int huft_build(CDecompressionObject* decompress, if ((unsigned)w + j > el && (unsigned)w < el) j = el - w; /* make EOB code end at table */ z = 1 << j; /* table entries for j-bit table */ - l[h] = j; /* set table size in stack */ + l[h] = j; /* save table size on the stack */ - /* allocate and link in new table */ + /* allocate and link the new table */ if ((q = (struct huft*)malloc((z + 1) * sizeof(struct huft))) == (struct huft*)NULL) { From b304a93c224a92660e1c8681c9ccf8dd4a74bddc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:36:17 +0200 Subject: [PATCH 444/710] [translation] Fix src/salmoncl.cpp comments Refines translated comments in src/salmoncl.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #925 for src/salmoncl.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/salmoncl.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/salmoncl.cpp b/src/salmoncl.cpp index 7825ddca6..b4221ceb5 100644 --- a/src/salmoncl.cpp +++ b/src/salmoncl.cpp @@ -12,7 +12,7 @@ HANDLE HSalmonProcess = NULL; //**************************************************************************** -// WARNING: we are running from the entry point, before RTL, global objects, etc. are initialized. +// WARNING: running from the entry point before RTL, global objects, etc. are initialized // Do not call TRACE, HANDLES, RTL, ... HANDLE GetBugReporterRegistryMutex() @@ -39,8 +39,8 @@ BOOL SalmonGetBugReportUID(DWORD64* uid) const char* BUG_REPORTER_KEY = "Software\\Open Salamander\\Bug Reporter"; const char* BUG_REPORTER_UID = "ID"; - // this section runs during Salamander start-up and theoretically concurrent registry reads/writes may occur - // so we guard access with a global mutex + // This section runs during Salamander startup, and concurrent registry reads and writes may theoretically occur. + // We therefore guard access with a global mutex. HANDLE hMutex = GetBugReporterRegistryMutex(); if (hMutex != NULL) WaitForSingleObject(hMutex, INFINITE); @@ -99,7 +99,7 @@ BOOL SalmonSharedMemInit(CSalmonSharedMemory* mem) RtlFillMemory(mem, sizeof(CSalmonSharedMemory), 0); mem->Version = SALMON_SHARED_MEMORY_VERSION; - // Salmon runs as a child process with bInheritHandles == TRUE, so it can access these handles directly + // Salmon will be started as a child process with bInheritHandles == TRUE, so it can access these handles directly mem->ProcessId = GetCurrentProcessId(); mem->Process = NOHANDLES(OpenProcess(SYNCHRONIZE | PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, TRUE, mem->ProcessId)); mem->Fire = NOHANDLES(CreateEvent(&sa, TRUE, FALSE, NULL)); // "nonsignaled" state, manual @@ -112,7 +112,7 @@ BOOL SalmonSharedMemInit(CSalmonSharedMemory* mem) if (SHGetFolderPath(NULL, CSIDL_LOCAL_APPDATA, NULL, 0, mem->BugPath) == S_OK) { int len = lstrlen(mem->BugPath); - if (len > 0 && mem->BugPath[len - 1] == '\\') // better check for a trailing backslash at the end of the path + if (len > 0 && mem->BugPath[len - 1] == '\\') // check whether the path ends with a backslash mem->BugPath[len - 1] = 0; lstrcat(mem->BugPath, "\\Open Salamander"); } @@ -173,8 +173,8 @@ BOOL SalmonStartProcess(const char* fileMappingName) //Configuration.LoadedSLGNa *(strrchr(rtlDir, '\\') + 1) = 0; GetCurrentDirectory(MAX_PATH, oldCurDir); - // another attempt to solve the problem before we split SALMON.EXE into EXE + DLL - // extend the PATH environment variable for the child process (SALMON.EXE) by adding the RTL path. + // another attempt to solve the problem before splitting SALMON.EXE into an EXE + DLL + // extend the child process PATH environment variable with the RTL path if (GetEnvironmentVariable("PATH", envPATH, MAX_ENV_PATH) != 0) { if (lstrlen(envPATH) + 2 + lstrlen(rtlDir) < MAX_ENV_PATH) @@ -202,7 +202,7 @@ BOOL SalmonStartProcess(const char* fileMappingName) //Configuration.LoadedSLGNa // the running SALMON.EXE could set the current directory and load SALMON.DLL at runtime, which should hopefully work. // ---- // On my computer each of the three path-setting strategies works independently (ENV PATH, SetCurrentDirectory, and the rtlDir parameter in the CreateProcess call) - if (NOHANDLES(CreateProcess(NULL, cmd, NULL, NULL, TRUE, // bInheritHandles == TRUE, the event handles must be passed on! + if (NOHANDLES(CreateProcess(NULL, cmd, NULL, NULL, TRUE, // bInheritHandles == TRUE so the event handles are inherited CREATE_DEFAULT_ERROR_MODE | HIGH_PRIORITY_CLASS, NULL, rtlDir, &si, &pi))) { @@ -311,7 +311,7 @@ void SalmonSetSLG(const char* slgName) arr[0] = HSalmonProcess; arr[1] = SalmonSharedMemory->Done; DWORD waitRet = WaitForMultipleObjects(2, arr, FALSE, INFINITE); - if (waitRet != WAIT_OBJECT_0 + 1) // Salmon exited or something went wrong in the communication + if (waitRet != WAIT_OBJECT_0 + 1) // Salmon exited or communication failed { if (!SalmonNotRunningReported && HLanguage != NULL) { @@ -332,7 +332,7 @@ void SalmonCheckBugs() arr[0] = HSalmonProcess; arr[1] = SalmonSharedMemory->Done; DWORD waitRet = WaitForMultipleObjects(2, arr, FALSE, INFINITE); - if (waitRet != WAIT_OBJECT_0 + 1) // Salmon exited or something went wrong in the communication + if (waitRet != WAIT_OBJECT_0 + 1) // Salmon was terminated or communication failed { if (!SalmonNotRunningReported && HLanguage != NULL) { From a140313b6587eaa0388537970997faef1ffa13f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:36:33 +0200 Subject: [PATCH 445/710] [translation] Fix src/salmoncl.h comments Refines translated comments in src/salmoncl.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #926 for src/salmoncl.h, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/salmoncl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/salmoncl.h b/src/salmoncl.h index a746ca130..26366b05c 100644 --- a/src/salmoncl.h +++ b/src/salmoncl.h @@ -65,7 +65,7 @@ void SalmonSetSLG(const char* slgName); // sets the language in salmon void SalmonCheckBugs(); // stores the exception info in shared memory and asks Salmon to create a minidump; then waits for it to finish -// returns TRUE if successful, FALSE if Salmon could not be invoked for some reason +// returns TRUE on success, FALSE if Salmon could not be invoked for some reason BOOL SalmonFireAndWait(const EXCEPTION_POINTERS* e, char* bugReportPath); #endif //INSIDE_SALAMANDER From 97a2cdc336e34782b6cda16bb1f4650dc167402f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:36:48 +0200 Subject: [PATCH 446/710] [translation] Fix src/salshlib.cpp comments Refines translated comments in src/salshlib.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #927 for src/salshlib.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/salshlib.cpp | 62 ++++++++++++++++++++++++------------------------ 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/src/salshlib.cpp b/src/salshlib.cpp index a09baa483..b53cf051d 100644 --- a/src/salshlib.cpp +++ b/src/salshlib.cpp @@ -60,7 +60,7 @@ void InitSalShLib() if (SalShExtSharedMemMutex != NULL) { WaitForSingleObject(SalShExtSharedMemMutex, INFINITE); - SalShExtSharedMem = HANDLES_Q(CreateFileMapping(INVALID_HANDLE_VALUE, saPtr, PAGE_READWRITE, // FIXME_X64 are we passing incompatible x86/x64 data? + SalShExtSharedMem = HANDLES_Q(CreateFileMapping(INVALID_HANDLE_VALUE, saPtr, PAGE_READWRITE, // FIXME_X64: are we passing x86/x64-incompatible data? 0, sizeof(CSalShExtSharedMem), SALSHEXT_SHAREDMEMNAME)); BOOL created; @@ -76,13 +76,13 @@ void InitSalShLib() if (SalShExtSharedMem != NULL) { - SalShExtSharedMemView = (CSalShExtSharedMem*)HANDLES(MapViewOfFile(SalShExtSharedMem, // FIXME_X64 are we passing incompatible x86/x64 data? + SalShExtSharedMemView = (CSalShExtSharedMem*)HANDLES(MapViewOfFile(SalShExtSharedMem, // FIXME_X64: are we passing x86/x64-incompatible data? FILE_MAP_WRITE, 0, 0, 0)); if (SalShExtSharedMemView != NULL) { if (created) { - memset(SalShExtSharedMemView, 0, sizeof(CSalShExtSharedMem)); // it should already be zeroed, but we do not count on it + memset(SalShExtSharedMemView, 0, sizeof(CSalShExtSharedMem)); // it should already be zeroed, but we do not rely on that SalShExtSharedMemView->Size = sizeof(CSalShExtSharedMem); } } @@ -368,12 +368,12 @@ CFakeCopyPasteDataObject::Release(void) { OurDataOnClipboard = FALSE; - if (CutOrCopyDone) // if an error occurred during cut/copy, waiting makes no sense and we perform the cleanup elsewhere + if (CutOrCopyDone) // if an error occurred during cut/copy, waiting makes no sense and cleanup is performed elsewhere { // TRACE_I("CFakeCopyPasteDataObject::Release(): deleting clipfake directory!"); // now we can cancel the "paste" in shared memory, clean up the fake dir, and remove the data object - if (SalShExtSharedMemView != NULL) // store the timestamp in shared memory (to distinguish between paste and another copy/move of the fake dir) + if (SalShExtSharedMemView != NULL) // store the time in shared memory (to distinguish paste from another copy/move of the fake dir) { // TRACE_I("CFakeCopyPasteDataObject::Release(): DoPasteFromSalamander = FALSE"); WaitForSingleObject(SalShExtSharedMemMutex, INFINITE); @@ -395,7 +395,7 @@ CFakeCopyPasteDataObject::Release(void) } delete this; - return 0; // we must not touch the object; it no longer exists + return 0; // we must not access the object; it no longer exists } return RefCount; } @@ -423,7 +423,7 @@ STDMETHODIMP CFakeCopyPasteDataObject::GetData(FORMATETC* formatEtc, STGMEDIUM* // only afterwards, it is released and replaced with a new object from Explorer (the problem is a 2-second // timeout due to waiting for the copy hook callback — we always expect it after GetData) DWORD ti = GetTickCount(); - if (ti - LastGetDataCallTime >= 100) // optimization: store a new time only if it changes by at least 100 ms + if (ti - LastGetDataCallTime >= 100) // optimization: store a new timestamp only if it changes by at least 100 ms { LastGetDataCallTime = ti; if (SalShExtSharedMemView != NULL) // store the timestamp in shared memory (to distinguish between paste and another copy/move of the fake dir) @@ -480,12 +480,12 @@ BOOL CSalShExtPastedData::SetData(const char* archiveFileName, const char* pathI for (i = 0; i < selIndexesCount; i++) { int index = selIndexes[i]; - if (index < dirs->Count) // it is a directory + if (index < dirs->Count) // directory { if (!SelFilesAndDirs.Add(TRUE, dirs->At(index).Name)) break; } - else // it is a file + else // file { if (!SelFilesAndDirs.Add(FALSE, files->At(index - dirs->Count).Name)) break; @@ -519,7 +519,7 @@ void CSalShExtPastedData::ReleaseStoredArchiveData() { if (StoredPluginData.NotEmpty()) { - // release the plug-in data for individual files and directories + // release the plugin data for individual files and directories BOOL releaseFiles = StoredPluginData.CallReleaseForFiles(); BOOL releaseDirs = StoredPluginData.CallReleaseForDirs(); if (releaseFiles || releaseDirs) @@ -542,7 +542,7 @@ BOOL CSalShExtPastedData::WantData(const char* archiveFileName, CSalamanderDirec { CALL_STACK_MESSAGE1("CSalShExtPastedData::WantData()"); - if (!Lock /* should not happen, but we play it safe */ && + if (!Lock /* should not happen, but we guard against it */ && StrICmp(ArchiveFileName, archiveFileName) == 0 && archiveSize != CQuadWord(-1, -1) && // a corrupted date & time mark indicates an archive that must be reloaded (!pluginData.NotEmpty() || pluginData.CanBeCopiedToClipboard())) @@ -568,25 +568,25 @@ BOOL CSalShExtPastedData::CanUnloadPlugin(HWND parent, CPluginInterfaceAbstract* { if (ArchiveFileName[0] != 0) { - // find out whether the unloaded plug-in has anything to do with our archive; - // the plug-in could unload itself while the archiver is used (each archiver function - // loads the plug-in itself), but better safe than sorry, so we cancel any pedning archive listing + // find out whether the unloaded plugin has anything to do with our archive; + // the plugin could unload itself while the archiver is used (each archiver function + // loads the plugin itself), but better safe than sorry, so we cancel any pedning archive listing int format = PackerFormatConfig.PackIsArchive(ArchiveFileName); if (format != 0) // we found a supported archive { format--; CPluginData* data; int index = PackerFormatConfig.GetUnpackerIndex(format); - if (index < 0) // view: is it processed internally (plug-in)? + if (index < 0) // view: is it processed internally (plugin)? { data = Plugins.Get(-index - 1); if (data != NULL && data->GetPluginInterface()->GetInterface() == plugin) used = TRUE; } - if (PackerFormatConfig.GetUsePacker(format)) // does it have an editor? + if (PackerFormatConfig.GetUsePacker(format)) // does it use a packer? { index = PackerFormatConfig.GetPackerIndex(format); - if (index < 0) // is it processed internally (plug-in)? + if (index < 0) // is it processed internally (plugin)? { data = Plugins.Get(-index - 1); if (data != NULL && data->GetPluginInterface()->GetInterface() == plugin) @@ -598,8 +598,8 @@ BOOL CSalShExtPastedData::CanUnloadPlugin(HWND parent, CPluginInterfaceAbstract* } if (used) - ReleaseStoredArchiveData(); // we are using plug-in data, so we should release them - return TRUE; // unloading the plug-in is possible + ReleaseStoredArchiveData(); // we are using plugin data, so it should be released + return TRUE; // the plugin can be unloaded } void CSalShExtPastedData::DoPasteOperation(BOOL copy, const char* tgtPath) @@ -630,7 +630,7 @@ void CSalShExtPastedData::DoPasteOperation(BOOL copy, const char* tgtPath) panel->OfferArchiveUpdateIfNeeded(MainWindow->HWindow, IDS_ARCHIVECLOSEEDIT2, &archMaybeUpdated); if (archMaybeUpdated) { - EndStopRefresh(); // the snooper starts now + EndStopRefresh(); // refresh monitoring resumes now return; } // reuse the data from the panel (we are in the main thread, the panel cannot change during the operation) @@ -640,7 +640,7 @@ void CSalShExtPastedData::DoPasteOperation(BOOL copy, const char* tgtPath) } } - if (StoredArchiveDir != NULL) // if we have any archive data stored + if (StoredArchiveDir != NULL) // if we have stored archive data { if (archiveDir != NULL) ReleaseStoredArchiveData(); // the archive is open in a panel, discard the stored data @@ -658,7 +658,7 @@ void CSalShExtPastedData::DoPasteOperation(BOOL copy, const char* tgtPath) SalGetFileSize(file, archiveSize, err); // returns "success?" — ignore it, we test 'err' later HANDLES(CloseHandle(file)); - if (err == NO_ERROR && // size & date are obtained and + if (err == NO_ERROR && // size and date were obtained CompareFileTime(&archiveDate, &StoredArchiveDate) == 0 && // the date is identical and archiveSize == StoredArchiveSize) // the size is identical as well { @@ -682,7 +682,7 @@ void CSalShExtPastedData::DoPasteOperation(BOOL copy, const char* tgtPath) TRACE_E(LOW_MEMORY); else { - // find information about the file (does it exist? size, date, and time) + // get file information (exists?, size, date and time) DWORD err = NO_ERROR; FILETIME archiveDate; // archive file`s date & time CQuadWord archiveSize; // archive file`s size @@ -691,7 +691,7 @@ void CSalShExtPastedData::DoPasteOperation(BOOL copy, const char* tgtPath) if (file != INVALID_HANDLE_VALUE) { GetFileTime(file, NULL, NULL, &archiveDate); - SalGetFileSize(file, archiveSize, err); // returns "success?" — ignore it, we test 'err' later + SalGetFileSize(file, archiveSize, err); // returns "success?" - ignored; 'err' is tested later HANDLES(CloseHandle(file)); } else @@ -728,7 +728,7 @@ void CSalShExtPastedData::DoPasteOperation(BOOL copy, const char* tgtPath) plugin->GetPluginInterface()->GetInterface(), plugin->BuiltForVersion); } else - StoredPluginData.Init(NULL, NULL, NULL, NULL, 0); // used only by plug-ins, not by Salamander + StoredPluginData.Init(NULL, NULL, NULL, NULL, 0); // used only by plugins, not by Salamander StoredArchiveDate = archiveDate; StoredArchiveSize = archiveSize; @@ -742,7 +742,7 @@ void CSalShExtPastedData::DoPasteOperation(BOOL copy, const char* tgtPath) } } - if (archiveDir != NULL) // if we have the archive data, perform the Paste + if (archiveDir != NULL) // if we have archive data, perform the paste { CPanelTmpEnumData data; SelFilesAndDirs.Sort(); @@ -774,7 +774,7 @@ void CSalShExtPastedData::DoPasteOperation(BOOL copy, const char* tgtPath) { if (SelFilesAndDirs.Contains(TRUE, dirs->At(i).Name, &foundOnIndex) && foundOnIndex >= 0 && foundOnIndex < SelFilesAndDirs.GetDirsCount() && - !foundDirs[foundOnIndex]) // mark only the first instance of the name (if there are multiple identical names in SelFilesAndDirs, it does not work; halving in Contains always arrives at the same one) + !foundDirs[foundOnIndex]) // mark only the first occurrence of the name (if there are multiple identical names in SelFilesAndDirs, this does not work; the halving in Contains always arrives at the same one) { foundDirs[foundOnIndex] = TRUE; // this name has just been found data.Indexes[actIndex++] = i; @@ -789,7 +789,7 @@ void CSalShExtPastedData::DoPasteOperation(BOOL copy, const char* tgtPath) { if (SelFilesAndDirs.Contains(FALSE, files->At(i).Name, &foundOnIndex) && foundOnIndex >= 0 && foundOnIndex < SelFilesAndDirs.GetFilesCount() && - !foundFiles[foundOnIndex]) // mark only the first instance of the name (if there are multiple identical names in SelFilesAndDirs, it does not work; halving in Contains always arrives at the same one) + !foundFiles[foundOnIndex]) // mark only the first occurrence of the name (if there are multiple identical names in SelFilesAndDirs, this does not work; the bisection in Contains always finds the same one) { foundFiles[foundOnIndex] = TRUE; // this name has just been found data.Indexes[actIndex++] = dirs->Count + i; // all files have their index shifted after directories, as is customary in the panel @@ -797,7 +797,7 @@ void CSalShExtPastedData::DoPasteOperation(BOOL copy, const char* tgtPath) } } data.IndexesCount = actIndex; - if (data.IndexesCount == 0) // our ZIP root vanished completely + if (data.IndexesCount == 0) // the ZIP root vanished completely { SalMessageBox(MainWindow->HWindow, LoadStr(IDS_ARCFILESNOTFOUND), LoadStr(IDS_ERRORUNPACK), MB_OK | MB_ICONEXCLAMATION); @@ -805,7 +805,7 @@ void CSalShExtPastedData::DoPasteOperation(BOOL copy, const char* tgtPath) else { BOOL unpack = TRUE; - if (data.IndexesCount != SelFilesAndDirs.GetCount()) // not all items selected on the clipboard were found (duplicate names or files deleted from the archive) + if (data.IndexesCount != SelFilesAndDirs.GetCount()) // not all selected clipboard items were found (duplicate names or files deleted from the archive) { unpack = SalMessageBox(MainWindow->HWindow, LoadStr(IDS_ARCFILESNOTFOUND2), LoadStr(IDS_ERRORUNPACK), @@ -857,5 +857,5 @@ void CSalShExtPastedData::DoPasteOperation(BOOL copy, const char* tgtPath) free(foundFiles); } - EndStopRefresh(); // the snooper starts now + EndStopRefresh(); // refresh notifications resume now } From 151e1a1749276c37bde62cb6e49ba009286390d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:37:28 +0200 Subject: [PATCH 447/710] [translation] Fix src/shares.cpp comments Refines translated comments in src/shares.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #929 for src/shares.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/shares.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/shares.cpp b/src/shares.cpp index 0a8289f9b..33d856e52 100644 --- a/src/shares.cpp +++ b/src/shares.cpp @@ -19,7 +19,7 @@ CSharesItem::CSharesItem(const char* localPath, const char* remoteName, const ch char buff[MAX_PATH]; lstrcpyn(buff, localPath, MAX_PATH); SalPathAddBackslash(buff, MAX_PATH); // in case it was only "c:", make sure a root is created - if (SalGetFullName(buff)) // root "c\\", others without the trailing '\\' at the end + if (SalGetFullName(buff)) // root "c:\\", others without a trailing '\\' { LocalPath = DupStr(buff); RemoteName = DupStr(remoteName); @@ -27,7 +27,7 @@ CSharesItem::CSharesItem(const char* localPath, const char* remoteName, const ch if (LocalPath != NULL && RemoteName != NULL && Comment != NULL) { char* s = strrchr(LocalPath, '\\'); - if (s == NULL || *(s + 1) == 0) // root path; s == NULL is only for safety, but it can never happen + if (s == NULL || *(s + 1) == 0) // root path; s == NULL is just a safeguard and should never occur LocalName = LocalPath; else LocalName = s + 1; @@ -262,7 +262,7 @@ BOOL CShares::GetUNCPath(const char* path, char* uncPath, int uncPathMax) // append the share name strcat(unc, item->RemoteName); SalPathAddBackslash(unc, 2 * MAX_PATH); // we want a backslash at the end - // from the original path, append the directories starting from the share + // append the directories from the original path after the share if (strlen(item->LocalPath) < strlen(path)) { const char* s = path + strlen(item->LocalPath); @@ -270,7 +270,7 @@ BOOL CShares::GetUNCPath(const char* path, char* uncPath, int uncPathMax) s++; // skip an optional backslash strcat(unc, s); } - if (!SalGetFullName(unc)) // root "c\\", others without the trailing '\\' at the end + if (!SalGetFullName(unc)) // root "c:\", others without a trailing '\\' { TRACE_E("Unexpected path in CSharesItem::GetUNCPath()"); HANDLES(LeaveCriticalSection(&CS)); From 976a1ba6bb24b41c3a244867b104e7e792c3c581 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:38:07 +0200 Subject: [PATCH 448/710] [translation] Fix src/shellsup.cpp comments Refines translated comments in src/shellsup.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #932 for src/shellsup.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/shellsup.cpp | 70 ++++++++++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/src/shellsup.cpp b/src/shellsup.cpp index a243e0e9c..b0866365d 100644 --- a/src/shellsup.cpp +++ b/src/shellsup.cpp @@ -269,7 +269,7 @@ const char* GetCurrentDir(POINTL& pt, void* param, DWORD* effect, BOOL rButton, { format--; if (PackerFormatConfig.GetUsePacker(format) && - (*effect & (DROPEFFECT_MOVE | DROPEFFECT_COPY)) != 0 || // Edit available? + is the effect copy or move? + (*effect & (DROPEFFECT_MOVE | DROPEFFECT_COPY)) != 0 || // archive editing is available, and the drop effect includes copy or move index == 0 && panel->Dirs->Count > 0 && strcmp(panel->Dirs->At(0).Name, "..") == 0 && (panel->GetZIPPath()[0] == 0 || panel->GetZIPPath()[0] == '\\' && panel->GetZIPPath()[1] == 0)) // drop onto a disk path { @@ -348,7 +348,7 @@ const char* GetCurrentDir(POINTL& pt, void* param, DWORD* effect, BOOL rButton, if (!rButton && (keyState & (MK_CONTROL | MK_SHIFT | MK_ALT)) == 0) { tgtType = idtttWindows; - return NULL; // without modifiers, the stop cursor remains (prevents accidental copying into the current directory) + return NULL; // without modifier keys, the stop cursor remains (preventing accidental copying into the current directory) } if (effect != NULL) *effect &= ~DROPEFFECT_MOVE; @@ -450,7 +450,7 @@ const char* GetCurrentDir(POINTL& pt, void* param, DWORD* effect, BOOL rButton, { // directory onto itself panel->SetDropTarget(-1); // hide the marker (the copy/shortcut goes to the active directory, not the focused subdirectory) if (!rButton && (keyState & (MK_CONTROL | MK_SHIFT | MK_ALT)) == 0) - return NULL; // without modifiers, the stop cursor remains (prevents accidental copying into the current directory) + return NULL; // Without modifiers, the stop cursor remains (preventing accidental copying into the current directory) if (effect != NULL) *effect &= ~DROPEFFECT_MOVE; return panel->GetPath(); @@ -518,10 +518,10 @@ const char* GetCurrentDir(POINTL& pt, void* param, DWORD* effect, BOOL rButton, // if it is a shortcut, we need to analyze it BOOL linkIsDir = FALSE; // TRUE -> shortcut to a directory -> ChangePathToDisk - BOOL linkIsFile = FALSE; // TRUE -> shortcut to a file -> test archive + BOOL linkIsFile = FALSE; // TRUE -> shortcut to a file -> test the archive char linkTgt[MAX_PATH]; linkTgt[0] = 0; - if (StrICmp(file->Ext, "lnk") == 0) // is it not a directory shortcut? + if (StrICmp(file->Ext, "lnk") == 0) // is it not a shortcut to a directory? { IShellLink* link; if (CoCreateInstance(CLSID_ShellLink, NULL, @@ -914,7 +914,7 @@ void DoDragFromArchiveOrFS(CFilesWindow* panel, BOOL& dropDone, char* targetPath if (SalGetTempFileName(NULL, "SAL", fakeRootDir, FALSE)) { fakeName = fakeRootDir + strlen(fakeRootDir); - // jr: I found a note on the net "Did implementing "IPersistStream" and providing the undocumented + // jr: I found a note online: "Did implementing "IPersistStream" and providing the undocumented // "OleClipboardPersistOnFlush" format solve the problem?" -- in case we need to // get rid of the DROPFAKE method if (SalPathAppend(fakeRootDir, "DROPFAKE", MAX_PATH)) @@ -955,13 +955,13 @@ void DoDragFromArchiveOrFS(CFilesWindow* panel, BOOL& dropDone, char* targetPath LastWndFromGetData = NULL; // just in case fakeDataObject->GetData is not called hr = DoDragDrop(fakeDataObject, dropSource, allowedEffects, &dwEffect); DropSourcePanel = NULL; - // read the drag&drop results - // Note: returns dwEffect == 0 for MOVE, so we introduce a workaround via dropSource->LastEffect, - // see "Handling Shell Data Transfer Scenarios", section "Handling Optimized Move Operations" for the reasons: + // Read the drag&drop results. + // Note: dwEffect == 0 is returned for MOVE, so we use a workaround via dropSource->LastEffect; + // for the reasons, see "Handling Shell Data Transfer Scenarios", section "Handling Optimized Move Operations": // http://msdn.microsoft.com/en-us/library/windows/desktop/bb776904%28v=vs.85%29.aspx // (in short: an optimized Move is performed, which means no copy to the target followed by deletion - // of the original is not used. This prevents the source from accidentally deleting the original (it might not have been moved yet), it gets - // the operation result DROPEFFECT_NONE or DROPEFFECT_COPY) + // of the original is done, so the source does not accidentally delete the original + // before it has actually been moved; it receives DROPEFFECT_NONE or DROPEFFECT_COPY) if (hr == DRAGDROP_S_DROP && dropSource->LastEffect != DROPEFFECT_NONE) { WaitForSingleObject(SalShExtSharedMemMutex, INFINITE); @@ -1305,7 +1305,7 @@ void ShellAction(CFilesWindow* panel, CShellAction action, BOOL useSelection, delete[] (indexes); EndStopRefresh(); - if (dropDone) // let the operation complete + if (dropDone) // let the operation proceed { char* p = DupStr(targetPath); if (p != NULL) @@ -1318,7 +1318,7 @@ void ShellAction(CFilesWindow* panel, CShellAction action, BOOL useSelection, { if (action == saCopyToClipboard) { - if (SalShExtSharedMemView != NULL) // shared memory is available (when copy&paste fails we cannot handle it) + if (SalShExtSharedMemView != NULL) // shared memory is available (we cannot handle copy & paste failures) { CALL_STACK_MESSAGE1("ShellAction::archive::clipcopy_files"); @@ -1522,13 +1522,13 @@ void ShellAction(CFilesWindow* panel, CShellAction action, BOOL useSelection, } else { - if (onlyPanelMenu) // panel menu (click below the items in the panel) + if (onlyPanelMenu) // panel menu (click in the empty area of the panel) { panel->GetPluginFS()->ContextMenu(panel->GetPluginFS()->GetPluginFSName(), panel->GetListBoxHWND(), p.x, p.y, fscmPanel, panelID, 0, 0); } - else // menu for the current path (click on the change-drive button) + else // menu for the current path (clicking the Change Drive button) { panel->GetPluginFS()->ContextMenu(panel->GetPluginFS()->GetPluginFSName(), panel->GetListBoxHWND(), p.x, p.y, fscmPathInPanel, @@ -1589,7 +1589,7 @@ void ShellAction(CFilesWindow* panel, CShellAction action, BOOL useSelection, allowedEffects, 2 /* FS */, srcFSPath, action == saLeftDragFiles); panel->GetPluginFS()->GetAllowedDropEffects(2 /* end */, NULL, NULL); - if (dropDone) // let the operation complete + if (dropDone) // let the operation be performed { char* p = DupStr(targetPath); if (p != NULL) @@ -1613,7 +1613,7 @@ void ShellAction(CFilesWindow* panel, CShellAction action, BOOL useSelection, if (indexes != NULL) delete[] (indexes); EndStopRefresh(); - return; // for safety do not allow other panel types further + return; // Do not allow other panel types past this point. } #ifndef _WIN64 @@ -1744,7 +1744,7 @@ void ShellAction(CFilesWindow* panel, CShellAction action, BOOL useSelection, CFileData* f = (idx < panel->Dirs->Count) ? &panel->Dirs->At(idx) : &panel->Files->At(idx - panel->Dirs->Count); f->CutToClip = 1; f->Dirty = 1; - if (samePaths) // select the file/directory in the other panel (quadratic complexity, not great ...) + if (samePaths) // mark the file/directory in the other panel (quadratic complexity, not a concern ...) { if (idx < panel->Dirs->Count) // search among directories { @@ -1761,7 +1761,7 @@ void ShellAction(CFilesWindow* panel, CShellAction action, BOOL useSelection, } } } - else // search among files + else // search the files { int total = anotherPanel->Files->Count; int k; @@ -1837,7 +1837,7 @@ void ShellAction(CFilesWindow* panel, CShellAction action, BOOL useSelection, if (panel->Is(ptZIPArchive)) { - if (useSelection) // only when it concerns items in the panel (not the current path in the panel) + if (useSelection) // only for items in the panel (not for the current panel path) { // if command states need to be computed, do it (ArchiveMenu.UpdateItemsState uses them) MainWindow->OnEnterIdle(); @@ -1852,7 +1852,7 @@ void ShellAction(CFilesWindow* panel, CShellAction action, BOOL useSelection, } else { - if (onlyPanelMenu) // context menu in the panel (behind the items) -> paste only + if (onlyPanelMenu) // context menu on the panel background (behind the items) -> paste only { // if command states need to be computed, do it (ArchivePanelMenu.UpdateItemsState uses them) MainWindow->OnEnterIdle(); @@ -2029,7 +2029,7 @@ void ShellAction(CFilesWindow* panel, CShellAction action, BOOL useSelection, mi.cch = 500; if (GetMenuItemInfo(h, i, TRUE, &mi)) { - if (mi.hSubMenu == NULL && (mi.fType & MFT_SEPARATOR) == 0) // not a submenu nor a separator + if (mi.hSubMenu == NULL && (mi.fType & MFT_SEPARATOR) == 0) // not a submenu or a separator { if (AuxGetCommandString(panel->ContextMenu, mi.wID, GCS_VERB, NULL, cmdName, 200) == NOERROR) { @@ -2147,7 +2147,7 @@ MENU_TEMPLATE_ITEM PanelBkgndMenu[] = } } - if (GetMenuItemCount(h) > 0) // protection against a completely cut-out menu + if (GetMenuItemCount(h) > 0) // guard against a completely empty menu { CMenuPopup contextPopup; contextPopup.SetTemplateMenu(h); @@ -2193,7 +2193,7 @@ MENU_TEMPLATE_ITEM PanelBkgndMenu[] = cmd = 10000; // the command will be executed elsewhere } } - else // paste do panel->GetPath() + else // paste into panel->GetPath() { strcpy(pastePath, panel->GetPath()); cmd = 10000; // the command will be executed elsewhere @@ -2212,7 +2212,7 @@ MENU_TEMPLATE_ITEM PanelBkgndMenu[] = if (cmd < 5000 && stricmp(cmdName, "rename") == 0) { int specialIndex; - if (count == 1) // select + if (count == 1) // selected item { panel->GetSelItems(1, &specialIndex); } @@ -2224,7 +2224,7 @@ MENU_TEMPLATE_ITEM PanelBkgndMenu[] = { BOOL releaseLeft = FALSE; // disconnect the left panel from the drive? BOOL releaseRight = FALSE; // disconnect the right panel from the drive? - if (!useSelection && cmd < 5000 && // this is a context menu for a directory + if (!useSelection && cmd < 5000 && // directory context menu stricmp(cmdName, "properties") != 0 && // not necessary for properties stricmp(cmdName, "find") != 0 && // not necessary for Find stricmp(cmdName, "open") != 0 && // not necessary for Open @@ -2233,14 +2233,14 @@ MENU_TEMPLATE_ITEM PanelBkgndMenu[] = { char root[MAX_PATH]; GetRootPath(root, panel->GetPath()); - if (strlen(root) >= strlen(panel->GetPath())) // menu for the whole drive - because of commands like + if (strlen(root) >= strlen(panel->GetPath())) // menu for the whole drive - because of commands like "format..." { // for "format..." we must "take our hands off" the media CFilesWindow* win; int i; for (i = 0; i < 2; i++) { win = i == 0 ? MainWindow->LeftPanel : MainWindow->RightPanel; - if (HasTheSameRootPath(win->GetPath(), root)) // the same drive (UNC and normal) + if (HasTheSameRootPath(win->GetPath(), root)) // same drive (UNC or regular) { if (i == 0) releaseLeft = TRUE; @@ -2356,7 +2356,7 @@ MENU_TEMPLATE_ITEM PanelBkgndMenu[] = } else { - if (cmd == 10001) // our own "paste shortcuts" on pastePath + if (cmd == 10001) // our own "paste shortcuts" for pastePath { panel->ClipboardPaste(TRUE, FALSE, pastePath); } @@ -2481,9 +2481,9 @@ void ExecuteAssociation(HWND hWindow, const char* path, const char* name) strcpy(execName, path); if (SalPathAppend(execName, name, MAX_PATH + 200) && SalOpenExecute(hWindow, execName)) { - if (ExecuteAssociationTlsIndex != TLS_OUT_OF_INDEXES) // a new call is possible now + if (ExecuteAssociationTlsIndex != TLS_OUT_OF_INDEXES) // a new call is now possible TlsSetValue(ExecuteAssociationTlsIndex, (void*)0); - return; // done, it was launched in the salopen.exe process + return; // launched in the salopen.exe process } // if salopen.exe fails, launch the classic way (there is a risk of open handles in the directory) @@ -2546,7 +2546,7 @@ void ExecuteAssociation(HWND hWindow, const char* path, const char* name) // ask whether Salamander should continue or generate a bug report if (SalMessageBox(hWindow, LoadStr(IDS_SHELLEXTBREAK4), SALAMANDER_TEXT_VERSION, MSGBOXEX_CONTINUEABORT | MB_ICONINFORMATION | MSGBOXEX_SETFOREGROUND) == IDABORT) - { // break into the debugger + { // break strcpy(BugReportReasonBreak, "Attempt to call ExecuteAssociation() recursively."); TaskList.FireEvent(TASKLIST_TODO_BREAK, GetCurrentProcessId()); // freeze this thread @@ -2556,9 +2556,9 @@ void ExecuteAssociation(HWND hWindow, const char* path, const char* name) } } -// returns TRUE if it is "safe" to provide a special invisible window as the parent window to the shell extension, -// which the shell extension could kill via DestroyWindow (normally it closes Explorer, but used to crash Salamander) -// there are exceptions when the Salamander main window must be passed as the parent +// returns TRUE if it is "safe" to provide a special invisible window to the shell extension as the parent window, +// which the shell extension may then destroy via DestroyWindow (this normally closes Explorer, but used to crash Salamander) +// there are exceptions where the Salamander main window must be passed as the parent BOOL CanUseShellExecuteWndAsParent(const char* cmdName) { // for Map Network Drive we cannot use shellExecuteWnd, otherwise it hangs (MainWindow->HWindow gets disabled and the Map Network Drive window does not open) From b4acc9b3bda69e8f672361116b4d2c3bebc8e63c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:38:23 +0200 Subject: [PATCH 449/710] [translation] Fix src/shiconov.cpp comments Refines translated comments in src/shiconov.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #935 for src/shiconov.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/shiconov.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/shiconov.cpp b/src/shiconov.cpp index 65e3a23df..681015fcb 100644 --- a/src/shiconov.cpp +++ b/src/shiconov.cpp @@ -107,7 +107,7 @@ BOOL GetGoogleDrivePath(char* gdPath, int gdPathMax, CSQLite3DynLoadBase** sqlit sqlite3_stmt* pStmt; char utf8Select[] = "SELECT data_value FROM data WHERE entry_key = 'local_sync_root_path';"; // UTF8 string (if any extra character is added, it must be converted ANSI->UTF-8) - // sqlite3_open_v2 requires a UTF-8 path, so convert it from ANSI to UTF-8 + // sqlite3_open_v2 requires a UTF-8 path, so we convert it from ANSI to UTF-8 if (ConvertA2U(sDbPath, -1, widePath, _countof(widePath)) && ConvertU2A(widePath, -1, mbPath, _countof(mbPath), FALSE, CP_UTF8)) { @@ -624,9 +624,9 @@ void CShellIconOverlayItem::Cleanup() CShellIconOverlayItem::~CShellIconOverlayItem() { - // VC2015 did not like the __try / __except block in the destructor; the linker complained in the x64 build: + // VC2015 rejected the __try / __except block in the destructor; the x64 linker reported: // error LNK2001: unresolved external symbol __C_specific_handler_noexcept - // moving the code into a function solved the issue + // moving the code into a helper function resolved the issue Cleanup(); } @@ -667,7 +667,7 @@ void CreateIconReadersIconOverlayIdsAuxAux(CLSID* clsid, const char* name, IShel (LPVOID*)&iconOverlayIdentifier) == S_OK && iconOverlayIdentifier != NULL) // probably a redundant check, just playing it safe { - // call the usual methods for form's sake (as if we were Explorer and wanted to display the overlays) + // call the usual methods as a formality, as if we were Explorer displaying the overlays OLECHAR iconFile[MAX_PATH]; int iconIndex; DWORD flags; @@ -759,7 +759,7 @@ BOOL GetIconOverlayIndexAuxAux(IShellIconOverlayIdentifier** iconReadersIconOver } else { - if (res != S_FALSE && res != 0x80070002) // 0x80070002 is "file not found", returned by "Offline Files" for anything not available offline + if (res != S_FALSE && res != 0x80070002) // 0x80070002 means "file not found"; "Offline Files" returns it for anything not available offline TRACE_I("CShellIconOverlays::GetIconOverlayIndex(): overlay " << name << ": IsMemberOf() returns error: 0x" << std::hex << res << std::dec); } return FALSE; @@ -816,9 +816,9 @@ CShellIconOverlays::GetIconOverlayIndex(WCHAR* wPath, WCHAR* wName, char* aPath, // if (SHGetFileInfoAux(aPath, 0, &fi, sizeof(fi), SHGFI_ATTRIBUTES)) // { // Google Drive crashes when IsMemberOf() is called concurrently from both icon readers: one thread allocates, - // the other one deallocates and the heap gets corrupted (hard to say why, their bug). The critical section slows things down - // considerably (by 2x) when reading both panels at once, so we try to use it only when GD is - // active (inside its directory) + // the other deallocates, and the heap gets corrupted (hard to say why; their bug). This critical section slows things down + // considerably (about 2x) when both panels are being read at the same time, so we try to use it only when Google Drive is + // active (in its directory). BOOL isGD_CS_entered = FALSE; for (int i = 0; i < Overlays.Count; i++) { @@ -964,7 +964,7 @@ void CShellIconOverlays::InitGoogleDrivePath(CSQLite3DynLoadBase** sqlite3_Dyn_I if (!found) { // Google Drive is installed in the variant matching Windows (x86 / x64). Therefore Salamander x86 - // on x64 Windows (and vice versa) does not find GD icon handlers and that is not a bug. + // on x64 Windows (and vice versa) does not find GD icon handlers, and that is not an error. #ifdef _WIN64 if (Windows64Bit) #else // _WIN64 From 17e5df06925f6fd55777cc9f2e84dfd0dd3ba979 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:38:38 +0200 Subject: [PATCH 450/710] [translation] Fix src/shiconov.h comments Refines translated comments in src/shiconov.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #936 for src/shiconov.h, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/shiconov.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shiconov.h b/src/shiconov.h index 87512593c..96b1b29c7 100644 --- a/src/shiconov.h +++ b/src/shiconov.h @@ -31,7 +31,7 @@ struct CShellIconOverlayItem CLSID IconOverlayIdCLSID; // CLSID of the respective IShellIconOverlayIdentifier object int Priority; // priority of this icon overlay (0-100, the highest priority is zero) HICON IconOverlay[ICONSIZE_COUNT]; // icon overlay in all sizes - BOOL GoogleDriveOverlay; // TRUE = Google Drive handler (their handler crashes, so we handle it with extra synchronization) + BOOL GoogleDriveOverlay; // TRUE = Google Drive handler (it crashes, so extra synchronization is used) void Cleanup(); @@ -44,7 +44,7 @@ class CShellIconOverlays protected: TIndirectArray Overlays; // priority-sorted list of icon overlays CRITICAL_SECTION GD_CS; // for Google Drive we need to mutually exclude calls to IsMemberOf from both icon readers (otherwise it crashes and corrupts its heap) - BOOL GetGDAlreadyCalled; // TRUE = we already checked where the folder for Google Drive is located + BOOL GetGDAlreadyCalled; // TRUE = the location of the Google Drive folder has already been checked char GoogleDrivePath[MAX_PATH]; // folder for Google Drive (we do not call their handler elsewhere; it is disgustingly slow and, without the extra synchronization, it crashes) BOOL GoogleDrivePathIsFromCfg; // TRUE if the folder for Google Drive obtained from the Google Drive configuration (FALSE = it may be only the default one and Google Drive may not be installed at all) BOOL GoogleDrivePathExists; // does the folder for Google Drive exist on disk? From 0b5d410b7712f2772716e82ebd67aaccec02063b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:38:53 +0200 Subject: [PATCH 451/710] [translation] Fix src/snooper.cpp comments Refines translated comments in src/snooper.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #937 for src/snooper.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/snooper.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/snooper.cpp b/src/snooper.cpp index 96d64861b..b8234dfde 100644 --- a/src/snooper.cpp +++ b/src/snooper.cpp @@ -41,7 +41,7 @@ void DoWantDataEvent() ReleaseMutex(DataUsageMutex); // release the data to the main thread WaitForSingleObject(WantDataEvent, INFINITE); // wait until it takes ownership WaitForSingleObject(DataUsageMutex, INFINITE); // once it finishes, take ownership again - SetEvent(ContinueEvent); // we own it again, let the main thread continue + SetEvent(ContinueEvent); // we own the data again; allow the main thread to continue } unsigned ThreadSnooperBody(void* /*param*/) // do not call main-thread functions (not even TRACE) !!! @@ -60,7 +60,7 @@ unsigned ThreadSnooperBody(void* /*param*/) // do not call main-thread functions sharesKey = NULL; TRACE_E("Unable to open key in registry (LanMan Shares). error: " << GetErrorText(res)); } - else // the key is OK, enable notifications (otherwise RegNotifyChangeKeyValue will not be called again) + else // key opened successfully; enable notifications (otherwise RegNotifyChangeKeyValue will not be called again) { if ((res = RegNotifyChangeKeyValue(sharesKey, TRUE, REG_NOTIFY_CHANGE_NAME | REG_NOTIFY_CHANGE_LAST_SET, SharesEvent, TRUE)) != ERROR_SUCCESS) @@ -152,7 +152,7 @@ unsigned ThreadSnooperBody(void* /*param*/) // do not call main-thread functions } case WAIT_TIMEOUT: - break; // ignore it (the mode for ignoring directory changes has just ended) + break; // ignore it; the directory-change ignore mode has ended default: { @@ -221,7 +221,7 @@ unsigned ThreadSnooperBody(void* /*param*/) // do not call main-thread functions } SetEvent(ContinueEvent); // no longer suspended; allow the main thread to continue - if (setSharesEvent) // resume monitoring further registry changes + if (setSharesEvent) // continue monitoring further changes in the registry { if (MainWindowCS.LockIfNotClosed()) { @@ -291,7 +291,7 @@ unsigned ThreadSnooperBody(void* /*param*/) // do not call main-thread functions } case WAIT_TIMEOUT: - break; // ignore it (end of directory change ignoring mode) + break; // ignore it (end of the mode that ignores directory changes) default: { @@ -301,7 +301,7 @@ unsigned ThreadSnooperBody(void* /*param*/) // do not call main-thread functions { DWORD err = GetLastError(); TRACE_E("Unexpected value returned from WaitForMultipleObjects(): " << res); - break; // in case res holds some other value + break; // for any other value of res } // calling FindNextChangeNotification invalidates other handles for the same path @@ -374,7 +374,7 @@ unsigned ThreadSnooperBody(void* /*param*/) // do not call main-thread functions PostMessage(WindowArray[index]->HWindow, WM_USER_REFRESH_DIR, TRUE, MyTimeCounter++); HANDLES(LeaveCriticalSection(&TimeCounterSection)); - if (r != WAIT_TIMEOUT) // if the error is cleared, request the next change + if (r != WAIT_TIMEOUT) // if there is no error, request the next change { FindNextChangeNotification((HANDLE)ObjectArray[index]); // discard this change } @@ -571,8 +571,8 @@ void AddDirectory(CFilesWindow* win, const char* path, BOOL registerDevNotificat WaitForSingleObject(DataUsageMutex, INFINITE); // wait for it SetEvent(WantDataEvent); // the snooper can resume waiting on DataUsageMutex //--- the data now belong to the main thread; the snooper is waiting - // if the path ends with a space or dot we must append '\\', otherwise FindFirstChangeNotification - // trims the trailing spaces/dots and thus works with a different path + // if the path ends with a space or dot, we must append '\\'; otherwise FindFirstChangeNotification + // trims trailing spaces and dots and thus works with a different path char pathCopy[3 * MAX_PATH]; MakeCopyWithBackslashIfNeeded(path, pathCopy); HANDLE h = HANDLES_Q(FindFirstChangeNotification(path, FALSE, @@ -713,8 +713,8 @@ void ChangeDirectory(CFilesWindow* win, const char* newPath, BOOL registerDevNot SetEvent(SafeFindCloseStart); // start the cleanup WaitForSingleObject(SafeFindCloseFinished, 200); // 200 ms timeout for closing the handle - // if the path ends with a space or dot we must append '\\', otherwise FindFirstChangeNotification - // trims the trailing spaces/dots and thus works with a different path + // if the path ends with a space or dot, we must append '\\'; otherwise FindFirstChangeNotification + // trims trailing spaces and dots and thus works with a different path char newPathCopy[3 * MAX_PATH]; MakeCopyWithBackslashIfNeeded(newPath, newPathCopy); ObjectArray[i] = HANDLES_Q(FindFirstChangeNotification(newPath, FALSE, @@ -743,8 +743,8 @@ void ChangeDirectory(CFilesWindow* win, const char* newPath, BOOL registerDevNot //--- not found -> add it if (i == WindowArray.Count) { - // if the path ends with a space or dot we must append '\\', otherwise FindFirstChangeNotification - // trims the trailing spaces/dots and thus works with a different path + // if the path ends with a space or dot, we must append '\\'; otherwise FindFirstChangeNotification + // trims trailing spaces and dots and thus works with a different path char newPathCopy[3 * MAX_PATH]; MakeCopyWithBackslashIfNeeded(newPath, newPathCopy); HANDLE h = HANDLES_Q(FindFirstChangeNotification(newPath, FALSE, @@ -941,7 +941,7 @@ void EndSuspendMode(BOOL debugDoNotTestCaller) if (SnooperSuspended < 1) { TRACE_E("Incorrect call to EndSuspendMode()"); - SnooperSuspended = 0; // reset; maybe someone is misusing CM_LEFTREFRESH, CM_RIGHTREFRESH, or CM_ACTIVEREFRESH again + SnooperSuspended = 0; // maybe CM_LEFTREFRESH, CM_RIGHTREFRESH, or CM_ACTIVEREFRESH is being misused again } else { @@ -955,7 +955,7 @@ void EndSuspendMode(BOOL debugDoNotTestCaller) } /* -#ifdef _DEBUG // verify whether BeginSuspendMode() and EndSuspendMode() are invoked from the same function (based on the return address of the calling function -> cannot detect a "bug" when called from different functions that are both invoked from the same function) +#ifdef _DEBUG // verify whether BeginSuspendMode() and EndSuspendMode() are called from the same function (based on the caller's return address, so it will not detect a "bug" when two different functions are both called from the same function) void EndSuspendMode(BOOL debugDoNotTestCaller) { DWORD *register_ebp; @@ -965,7 +965,7 @@ void EndSuspendMode(BOOL debugDoNotTestCaller) { called_from = *(DWORD*)((char*)register_ebp + 4); -if this code ever needs to be revived, use the fact that it can be replaced (x86 and x64): +if this code ever needs to be re-enabled, note that it can be replaced with this (x86 and x64): called_from = *(DWORD_PTR *)_AddressOfReturnAddress(); caller_called_from = *(DWORD*)((char*)(*register_ebp) + 4); From aed422ca8e79333be2e25ac92b32c8b0ab72ae47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:39:08 +0200 Subject: [PATCH 452/710] [translation] Fix src/sort.cpp comments Refines translated comments in src/sort.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #938 for src/sort.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/sort.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/sort.cpp b/src/sort.cpp index b1b1b802d..fdf68b99e 100644 --- a/src/sort.cpp +++ b/src/sort.cpp @@ -67,7 +67,7 @@ int StrCmpLogicalEx(const char* s1, int l1, const char* s2, int l2, BOOL* numeri } } - if (isStr1 || isStr2) // comparison of text, dots, or mixed pairs of text, dot, or number (everything except two numbers compares as strings) + if (isStr1 || isStr2) // comparison of text, dots, or mixed pairs of text, dots, or numbers (everything except two numbers is compared as strings) { int ret; if (Configuration.SortUsesLocale) @@ -90,13 +90,13 @@ int StrCmpLogicalEx(const char* s1, int l1, const char* s2, int l2, BOOL* numeri return ret; } } - else // comparison of two numbers + else // compare two numbers { if (numBeg1 == NULL) { if (numBeg2 == NULL) // both numbers are zero { - if (suggestion == 0) // only the first "suggested" result matters to us + if (suggestion == 0) // only the first suggested result matters { if (end1 - beg1 > end2 - beg2) suggestion = -1; // "000" < "00" @@ -144,9 +144,9 @@ int StrCmpLogicalEx(const char* s1, int l1, const char* s2, int l2, BOOL* numeri *numericalyEqual = FALSE; return ret; } - else // the numeric values match; if they differ only by the number of leading zeros, take it into account in the suggested result + else // the numeric values are equal; if they differ only in the number of leading zeros, reflect that in the suggested result { - if (suggestion == 0) // only the first "suggested" result matters to us + if (suggestion == 0) // only the first suggested result matters { if (end1 - beg1 > end2 - beg2) suggestion = -1; // "0001" < "001" @@ -168,7 +168,7 @@ int StrCmpLogicalEx(const char* s1, int l1, const char* s2, int l2, BOOL* numeri if (numericalyEqual != NULL) *numericalyEqual = TRUE; // s1 and s2 are identical or numerically equal - return suggestion; // when equal or numerically equal, return the "suggested" result + return suggestion; // if equal or numerically equal, return the suggested result } // @@ -318,8 +318,8 @@ int CmpNameExt(const CFileData& f1, const CFileData& f2) //--- compare the whole Name (including Ext), same as Explorer int res = RegSetStrICmpEx(f1.Name, f1.NameLen, f2.Name, f2.NameLen, NULL); if (res != 0 || f1.Name == f2.Name) - return res; // if the addresses are identical, they must match - //--- identical names (archives or FS) - try whether they differ at least in letter case + return res; // if the addresses are identical, they must be equal + //--- identical names (archives or FS) - check whether they differ at least in letter case return RegSetStrCmpEx(f1.Name, f1.NameLen, f2.Name, f2.NameLen, NULL); } @@ -422,10 +422,10 @@ BOOL LessExtName(const CFileData& f1, const CFileData& f2, BOOL reverse) f2.Name, (*f2.Ext != 0) ? (int)(f2.Ext - 1 - f2.Name) : f2.NameLen, &numericalyEqual2); if (numericalyEqual2 && res1 != 0) - return reverse ? res1 > 0 : res1 < 0; // extensions are identical or numerically equal and names are only numerically equal (name comparison has priority) + return reverse ? res1 > 0 : res1 < 0; // extensions are identical or numerically equal, and the names are only numerically equal (name comparison takes precedence) else { - if (res2 == 0 && f1.Name != f2.Name) // identical names (archives or FS) - try whether they differ at least in letter case + if (res2 == 0 && f1.Name != f2.Name) // identical names (archives or FS) - check whether they differ at least in letter case { res1 = RegSetStrCmpEx(f1.Ext, f1.NameLen - (int)(f1.Ext - f1.Name), f2.Ext, f2.NameLen - (int)(f2.Ext - f2.Name), @@ -437,7 +437,7 @@ BOOL LessExtName(const CFileData& f1, const CFileData& f2, BOOL reverse) f2.Name, (*f2.Ext != 0) ? (int)(f2.Ext - 1 - f2.Name) : f2.NameLen, &numericalyEqual2); if (numericalyEqual2 && res1 != 0) - return reverse ? res1 > 0 : res1 < 0; // names are identical or numerically equal and extensions are only numerically equal (extension comparison has priority) + return reverse ? res1 > 0 : res1 < 0; // names are identical or numerically equal, and the extensions are only numerically equal (extension comparison takes precedence) } return reverse ? res2 > 0 : res2 < 0; } From a165406e6b6e12d79f99961a885699e49631d07e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:39:24 +0200 Subject: [PATCH 453/710] [translation] Fix src/svg.cpp comments Refines translated comments in src/svg.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #939 for src/svg.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/svg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/svg.cpp b/src/svg.cpp index 89eaba7cd..4650e7a3b 100644 --- a/src/svg.cpp +++ b/src/svg.cpp @@ -125,7 +125,7 @@ void RenderSVGImage(NSVGrasterizer* rast, HDC hDC, int x, int y, const char* svg if (!enabled) { - DWORD disabledColor = GetSVGSysColor(COLOR_BTNSHADOW); // JRYFIXME - initial draft: where will we take the disabled color from? + DWORD disabledColor = GetSVGSysColor(COLOR_BTNSHADOW); // JRYFIXME - initial draft: where will we get the disabled color from? NSVGshape* shape = image->shapes; while (shape != NULL) { From 1346df2c73c53940adb1a480771e1c3e471534f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:39:39 +0200 Subject: [PATCH 454/710] [translation] Fix src/stswnd.h comments Refines translated comments in src/stswnd.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #940 for src/stswnd.h, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/stswnd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stswnd.h b/src/stswnd.h index 222f49942..e9e0a6a4d 100644 --- a/src/stswnd.h +++ b/src/stswnd.h @@ -72,7 +72,7 @@ class CStatusWindow : public CWindow int TextLen; // Number of characters in 'Text' pointer without the terminator char* Size; int PathLen; // -1 (the path occupies the entire Text); otherwise the path length in Text (the remainder is the filter) - BOOL History; // Show the arrow between the text and the size? + BOOL History; // Show the history drop-down arrow between the text and the size? BOOL Hidden; // Show the filter symbol? int HiddenFilesCount; // how many files are filtered out? int HiddenDirsCount; // And directories From 23e7b1106f32734be93668220acb534fc7a16a29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:39:55 +0200 Subject: [PATCH 455/710] [translation] Fix src/sort.h comments Refines translated comments in src/sort.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #941 for src/sort.h, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/sort.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sort.h b/src/sort.h index b1e365af5..2dcfe0a21 100644 --- a/src/sort.h +++ b/src/sort.h @@ -31,7 +31,7 @@ typedef BOOL (*CLessFunction)(const CFileData&, const CFileData&, BOOL); int CmpNameExt(const CFileData& f1, const CFileData& f2); int CmpNameExtIgnCase(const CFileData& f1, const CFileData& f2); // ignore-case variant -// NOTE: sort codes in RefreshDirectory, ChangeSortType and CompareDirectories must match!!! +// WARNING: the sort codes in RefreshDirectory, ChangeSortType, and CompareDirectories must match!! BOOL LessNameExt(const CFileData& f1, const CFileData& f2, BOOL reverse); BOOL LessNameExtIgnCase(const CFileData& f1, const CFileData& f2, BOOL reverse); From a90ba1ce5f9660dda5ea1aaf2c8a6a112dda48da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:40:10 +0200 Subject: [PATCH 456/710] [translation] Fix src/svg.h comments Refines translated comments in src/svg.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #942 for src/svg.h, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/svg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/svg.h b/src/svg.h index ffa96b4da..64f26afc0 100644 --- a/src/svg.h +++ b/src/svg.h @@ -64,7 +64,7 @@ class CSVGSprite void ColorizeSVG(NSVGimage* image, DWORD state); protected: - int Width; // dimension of a single image in points + int Width; // Width of a single image in points int Height; HBITMAP HBitmaps[SVGSTATE_COUNT]; }; From 2655a59cad82a67e6450ce7f12750c12f90a755c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:40:25 +0200 Subject: [PATCH 457/710] [translation] Fix src/versinfo.cpp comments Refines translated comments in src/versinfo.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #943 for src/versinfo.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/versinfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/versinfo.cpp b/src/versinfo.cpp index 1fce904b7..4e2a961d9 100644 --- a/src/versinfo.cpp +++ b/src/versinfo.cpp @@ -211,7 +211,7 @@ CVersionInfo::LoadBlock(const BYTE*& ptr, CVersionBlock* parent) return NULL; } - // Skip the value. + // Skip Value. ptr += valSize; // Skip the padding. ptr = ALIGN_DWORD(BYTE*, ptr); From f5d826f5d5554e9aac8640270ef410b99a7fc1df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:41:52 +0200 Subject: [PATCH 458/710] [translation] Fix src/viewer.cpp comments Refines translated comments in src/viewer.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #947 for src/viewer.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/viewer.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/viewer.cpp b/src/viewer.cpp index b30a3174d..f98483721 100644 --- a/src/viewer.cpp +++ b/src/viewer.cpp @@ -113,7 +113,7 @@ void HistoryComboBox(HWND hWindow, CTransferInfo& ti, int ctrlID, char* Text, { if (history[i] != NULL) { - if (strcmp(history[i], Text) == 0) // already in the history + if (strcmp(history[i], Text) == 0) // already in history { // move it to position 0 if (i > 0) { @@ -151,7 +151,7 @@ void HistoryComboBox(HWND hWindow, CTransferInfo& ti, int ctrlID, char* Text, if (!changeOnlyHistory) { int i; - for (i = 0; i < historySize; i++) // fill the combo-box list + for (i = 0; i < historySize; i++) // populate the combo box list if (history[i] != NULL) SendMessage(hwnd, CB_ADDSTRING, 0, (LPARAM)history[i]); else @@ -339,7 +339,7 @@ void CFindSetDialog::Transfer(CTransferInfo& ti) if (ti.Type == ttDataToWindow) { // initialize the search text based on the selection in the viewer (the parent of this dialog) CWindowsObject* win = WindowsManager.GetWindowPtr(Parent); - if (win != NULL && win->Is(otViewerWindow)) // just to be sure, check that it is a viewer window + if (win != NULL && win->Is(otViewerWindow)) // check that this is a viewer window { CViewerWindow* view = (CViewerWindow*)win; char buf[FIND_TEXT_LEN]; @@ -425,7 +425,7 @@ CFindSetDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) } if (item->Keyword != EXECUTE_HELP && !regular) { - // the user selected an expression, so tick the checkbox for regular search + // The user selected an expression, so check the regular expression search box CheckDlgButton(HWindow, IDC_VIEWREGEXP, BST_CHECKED); PostMessage(HWindow, WM_COMMAND, MAKELPARAM(IDC_VIEWREGEXP, BN_CLICKED), 0); } @@ -707,7 +707,7 @@ int GetHexOffsetMode(unsigned __int64 fileSize, int& hexOffsetLength) hexOffsetLength = 14; return 3; } - else // 16 characters are necessary + else // 16 characters are required { hexOffsetLength = 19; return 4; @@ -727,14 +727,14 @@ void PrintHexOffset(char* s, unsigned __int64 offset, int mode) return; // 4 characters are enough case 2: sprintf(s, "%04X %04X", LOWORD64(offset >> 16), LOWORD64(offset)); - return; // 8 characters are enough + return; // 8 digits are enough case 3: sprintf(s, "%04X %04X %04X", LOWORD64(offset >> 32), LOWORD64(offset >> 16), LOWORD64(offset)); return; // 12 characters are enough case 4: sprintf(s, "%04X %04X %04X %04X", LOWORD64(offset >> 48), LOWORD64(offset >> 32), LOWORD64(offset >> 16), LOWORD64(offset)); - return; // 16 characters are necessary + return; // 16 characters are needed } TRACE_E("Unexpected situation in PrintHexOffset()."); } @@ -804,7 +804,7 @@ void CViewerWindow::Paint(HDC dc) char line[2001]; // holds at most 2000 fully visible characters per line plus 1 partially visible character char* s; BOOL fatalErr = FALSE; - if (columns <= 2000) // only when this maximum is not exceeded + if (columns <= 2000) // only if this limit is not exceeded { // determine which rows need to be repainted RECT clipRect; @@ -1077,7 +1077,7 @@ void CViewerWindow::Paint(HDC dc) if (r.top <= r.bottom) FillRect(dc, &r, BkgndBrush); - if (EOL) // add the last empty line to the LineOffset array -> the line cannot be ignored + if (EOL) // add the last empty line to the LineOffset array -> the line must not be ignored { LineOffset.Add(lineOffset); LineOffset.Add(lineOffset); @@ -1253,7 +1253,7 @@ void CViewerWindow::Paint(HDC dc) } } - if (len == -1) // the line continues into a yet unread section + if (len == -1) // the line continues into an unread section { len = Prepare(NULL, lineOffset + fullLineLen, APROX_LINE_LEN, fatalErr); // if (fatalErr) FatalFileErrorOccured(); // see below From 99313f54e2ef5e9c4625a35df2f111f85e38b756 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:42:08 +0200 Subject: [PATCH 459/710] [translation] Fix src/viewer2.cpp comments Refines translated comments in src/viewer2.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #948 for src/viewer2.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/viewer2.cpp | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/viewer2.cpp b/src/viewer2.cpp index e401452d7..d49ee7aa0 100644 --- a/src/viewer2.cpp +++ b/src/viewer2.cpp @@ -107,7 +107,7 @@ unsigned ThreadViewerMessageLoopBody(void* parameter) // TRACE_I("MoresStanislav: ThreadViewerMessageLoopBody 10"); // CALL_STACK_MESSAGE1("MoresStanislav: ThreadViewerMessageLoopBody 10"); - if (ok) // if the window was created, run the application loop + if (ok) // if the window was created, run the message loop { CALL_STACK_MESSAGE1("ThreadViewerMessageLoopBody::message_loop"); if (SalGetFullName(name)) @@ -289,7 +289,7 @@ CViewerWindow::Prepare(HANDLE* hFile, __int64 offset, __int64 bytes, BOOL& fatal fatalErr = FALSE; if (Seek <= offset) if (Seek + Loaded >= offset + bytes) - return bytes; // o.k. + return bytes; // OK else { if (Seek + Loaded == FileSize) // data loaded up to the end of the file @@ -330,9 +330,9 @@ CViewerWindow::Prepare(HANDLE* hFile, __int64 offset, __int64 bytes, BOOL& fatal } if (Seek <= offset) if (Seek + Loaded >= offset + bytes) - return bytes; // o.k. + return bytes; // OK else - return Seek + Loaded > offset ? Seek + Loaded - offset : 0; // shortened + return Seek + Loaded > offset ? Seek + Loaded - offset : 0; // shortened result else return 0; // nothing is usable (because the beginning was not loaded) } @@ -449,7 +449,7 @@ BOOL CViewerWindow::LoadBefore(HANDLE* hFile) if (hFile == NULL) // if the caller does not close the handle, it is up to us HANDLES(CloseHandle(file)); - if (!ret && kill) // possibly end working with this file + if (!ret && kill) // if necessary, stop working with this file { free(FileName); FileName = NULL; @@ -603,7 +603,7 @@ BOOL CViewerWindow::LoadBehind(HANDLE* hFile) if (hFile == NULL) // if the caller does not close the handle, it is up to us HANDLES(CloseHandle(file)); - if (!ret && kill) // possibly end working with this file + if (!ret && kill) // possibly stop working with this file { free(FileName); FileName = NULL; @@ -730,8 +730,8 @@ void CViewerWindow::ReleaseMouseDrag() int CViewerWindow::SalMessageBoxViewerPaintBlocked(HWND hParent, LPCTSTR lpText, LPCTSTR lpCaption, UINT uType) { BOOL oldEnablePaint = EnablePaint; - // showing a message box triggers Paint = reading the file = more errors, - // therefore disable Paint = only the viewer background will be cleared (e.g., parts of the file already displayed) + // Showing a message box triggers Paint, which reads the file and can cause further errors. + // Therefore, disable Paint; only the viewer background will be erased (for example, parts of the file already displayed). EnablePaint = FALSE; int res = SalMessageBox(hParent, lpText, lpCaption, uType); EnablePaint = oldEnablePaint; @@ -877,7 +877,7 @@ void CViewerWindow::FileChanged(HANDLE file, BOOL testOnlyFileSize, BOOL& fatalE int c = CodeTables.GetConversionToWinCodePage(codePage); if (CodeTables.Valid(c)) SetCodeType(c); - else // conversion "none" + else // "none" conversion { CodeType = 0; UseCodeTable = FALSE; @@ -897,7 +897,7 @@ void CViewerWindow::FileChanged(HANDLE file, BOOL testOnlyFileSize, BOOL& fatalE defCodeType = 0; if (CodeTables.Valid(defCodeType)) SetCodeType(defCodeType); - else // conversion "none" + else // "none" conversion { CodeType = 0; UseCodeTable = FALSE; @@ -1185,7 +1185,7 @@ BOOL CViewerWindow::FindPreviousEOL(HANDLE* hFile, __int64 seek, __int64 minSeek if (lineBegin < minSeek) break; previousLineEnd = lineBegin - 1; - if (*s == '\n' && Configuration.EOL_CRLF) // test for '\r\n' + if (*s == '\n' && Configuration.EOL_CRLF) // check for '\r\n' { len = min(lineBegin, 2); len = Prepare(NULL, lineBegin - len, len, fatalErr); @@ -1224,8 +1224,8 @@ BOOL CViewerWindow::FindPreviousEOL(HANDLE* hFile, __int64 seek, __int64 minSeek tabAdd += tab - 1; tabsCount--; } - if ((takeLineBegin && lineBegin + columns - tabAdd > seek) || // treat "seek" as the offset of the character in the line (at line boundaries it acts as the start of the line) - (!takeLineBegin && lineBegin + columns - tabAdd >= seek)) // treat "seek" as the offset of the end of the line (at line boundaries it acts as the end of the line) + if ((takeLineBegin && lineBegin + columns - tabAdd > seek) || // treat "seek" as the character offset within the line (at line boundaries it acts as the start of the line) + (!takeLineBegin && lineBegin + columns - tabAdd >= seek)) // treat "seek" as the end-of-line offset (at line boundaries, it acts as the end of the line) { if (takeLineBegin && addLineIfSeekIsWrap && originalLineBegin < lineBegin && lineBegin == seek) { @@ -1244,13 +1244,13 @@ BOOL CViewerWindow::FindPreviousEOL(HANDLE* hFile, __int64 seek, __int64 minSeek { if (originalLineBegin < lineBegin) // wrapped line *firstLineEndOff = lineBegin; // the start of this wrapped line is also the end of the previous wrapped line - firstLineEndOff = NULL; // we have what we wanted, no further adjustments (could potentially concern ends of previous lines up to the count of "lines") + firstLineEndOff = NULL; // we have what we wanted, no further adjustments (they could affect the ends of previous lines up to the count in "lines") } if (originalLineBegin < lineBegin) // wrapped line { if (lines != NULL && *lines > 0) - { // if we need to look for the start of more lines, do it while we are here (so the loaded data is used) + { // if we need to look for the start of additional lines, do it now so the loaded data is used (*lines)--; takeLineBegin = FALSE; // from now on treat "seek" as the offset of the end of the line seek = lineBegin; @@ -1469,7 +1469,7 @@ BOOL CViewerWindow::GetOffsetOrXAbs(__int64 x, __int64* offset, __int64* offsetX return TRUE; } } - break; // execution never reaches here + break; // unreachable } case vtHex: @@ -1558,7 +1558,7 @@ void CViewerWindow::SetScrollBar() __int64 max = ViewSize + MaxSeekY; ScrollScaleY = ((double)max) / 20000.0; if (ScrollScaleY < 0.00001) - ScrollScaleY = 0.00001; // against "divide by zero" + ScrollScaleY = 0.00001; // avoid "divide by zero" int page = (int)(ViewSize / ScrollScaleY + 0.5 + 1); if (max == 0 || si.nMin != 0 || si.nMax != max / ScrollScaleY + 0.5 + 1 || si.nPage != (DWORD)page || @@ -1594,7 +1594,7 @@ void CViewerWindow::SetScrollBar() ScrollScaleX = ((double)max) / 20000.0; if (ScrollScaleX < 0.00001) - ScrollScaleX = 0.00001; // against "divide by zero" + ScrollScaleX = 0.00001; // avoid "divide by zero" page = (int)(((Width - BORDER_WIDTH) / CharWidth) / ScrollScaleX + 0.5 + 2); if (max == 0 || si.nMin != 0 || si.nMax != max / ScrollScaleX + 0.5 + 1 || si.nPage != (DWORD)page || @@ -1688,7 +1688,7 @@ BOOL CViewerWindow::CheckSelectionIsNotTooBig(HWND parent, BOOL* msgBoxDisplayed TooBigSelAction = 1 /* YES */; return res == IDNO; } - return TRUE; // less than 100MB = YES + return TRUE; // under 100 MB = YES } HGLOBAL From f296cd8abe17e63f383c4b8abc103819798f2533 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:43:35 +0200 Subject: [PATCH 460/710] [translation] Fix src/zip.cpp comments Refines translated comments in src/zip.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #952 for src/zip.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/zip.cpp | 152 ++++++++++++++++++++++++++-------------------------- 1 file changed, 76 insertions(+), 76 deletions(-) diff --git a/src/zip.cpp b/src/zip.cpp index 776a7fbe5..5b97a919d 100644 --- a/src/zip.cpp +++ b/src/zip.cpp @@ -250,7 +250,7 @@ void CZIPUnpackProgress::NewLine(const char* txt, BOOL delayedPaint) if (txt == NULL) return; - while (1) // output even multiple lines into the dialog + while (1) // output multiple lines to the dialog { while (*txt != 0 && (*txt == '\r' || *txt == '\n' || *txt == ' ' || *txt == '\t')) txt++; @@ -266,7 +266,7 @@ void CZIPUnpackProgress::NewLine(const char* txt, BOOL delayedPaint) char* s = LinesCache[CacheIndex]; char* sEnd = s + 300 - 1; - while (*txt != 0 && *txt != '\r' && *txt != '\n') // read one line + convert '/' -> '\\' + while (*txt != 0 && *txt != '\r' && *txt != '\n') // read one line and convert '/' to '\\' { if (*txt == '/') { @@ -386,7 +386,7 @@ CZIPUnpackProgress::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) { case WM_INITDIALOG: { - if (ResID == IDD_ZIPUNPACKPROG && FileProgress) // it is necessary to replace the text "Total:" with "File:" + if (ResID == IDD_ZIPUNPACKPROG && FileProgress) // Replace the text "Total:" with "File:" SetDlgItemText(HWindow, IDT_PROGTITLE, LoadStr(IDS_UNPACKFILEPROGRESS)); SetWindowText(HWindow, Title); @@ -468,7 +468,7 @@ void CSalamanderGeneral::Clear() int CSalamanderGeneral::ShowMessageBox(const char* text, const char* title, int type) { - if (MainThreadID != GetCurrentThreadId()) // Petr: just close; I do not have the energy to track down every wrong call + if (MainThreadID != GetCurrentThreadId()) // Petr: just log an error; tracking down every incorrect call is not worth it here TRACE_E("You can call CSalamanderGeneral::ShowMessageBox() only from main thread!"); HWND parent = GetMsgBoxParent(); switch (type) @@ -528,7 +528,7 @@ int CSalamanderGeneral::SalMessageBoxEx(const MSGBOXEX_PARAMS* params) HWND CSalamanderGeneral::GetMsgBoxParent() { - if (MainThreadID != GetCurrentThreadId()) // Petr: just close; I do not have the energy to track down every wrong call + if (MainThreadID != GetCurrentThreadId()) // Petr: just log an error; I do not have the energy to track down every incorrect call TRACE_E("You can call CSalamanderGeneral::GetMsgBoxParent() only from main thread!"); // if the following code should change, it must also be updated in EnterPlugin - so the check keeps working return PluginProgressDialog != NULL ? PluginProgressDialog : PluginMsgBoxParent; @@ -559,7 +559,7 @@ int DialogError(HWND parent, DWORD flags, const char* fileName, case BUTTONS_SKIPCANCEL: { resID = IDD_ERROR2; - noSkip = FALSE; // does not apply; something about resID == 0 + noSkip = FALSE; // noSkip has no effect here; it is only used when resID == 0 break; } @@ -1034,7 +1034,7 @@ BOOL CSalamanderGeneral::GetPanelPath(int panel, char* buffer, int bufferSize, i int l = (int)strlen(buf) + 1; if (l > bufferSize) - return bufferSize == 0; // if the user does not want the path back, we do not treat it as an error + return bufferSize == 0; // if the caller does not want the path returned, we do not treat it as an error memcpy(buffer, buf, l); if (archiveOrFS != NULL && offset != -1) @@ -1142,7 +1142,7 @@ CSalamanderGeneral::GetPanelItem(int panel, int* index, BOOL* isDir) { int i = *index; if (i < 0) - return NULL; // enumeration already finished + return NULL; // enumeration has already finished if (i < p->Files->Count + p->Dirs->Count) // enumerate more items { *index = i + 1; // next time move to the following item @@ -1248,14 +1248,14 @@ void CSalamanderGeneral::SelectPanelItem(int panel, const CFileData* file, BOOL CFileData* first = &p->Dirs->At(0); CFileData* last = &p->Dirs->At(p->Dirs->Count - 1); if (first <= file && file <= last) - index = (int)(file - first); // it is a directory + index = (int)(file - first); // directory } if (index == -1 && p->Files->Count > 0) { CFileData* first = &p->Files->At(0); CFileData* last = &p->Files->At(p->Files->Count - 1); if (first <= file && file <= last) - index = p->Dirs->Count + (int)(file - first); // it is a directory + index = p->Dirs->Count + (int)(file - first); // directory } if (index != -1) p->SetSel(select, index, FALSE); // change selection @@ -1314,14 +1314,14 @@ void CSalamanderGeneral::SetPanelFocusedItem(int panel, const CFileData* file, B CFileData* first = &p->Dirs->At(0); CFileData* last = &p->Dirs->At(p->Dirs->Count - 1); if (first <= file && file <= last) - index = (int)(file - first); // it is a directory + index = (int)(file - first); // this is a directory } if (index == -1 && p->Files->Count > 0) { CFileData* first = &p->Files->At(0); CFileData* last = &p->Files->At(p->Files->Count - 1); if (first <= file && file <= last) - index = p->Dirs->Count + (int)(file - first); // it is a directory + index = p->Dirs->Count + (int)(file - first); // directory } if (index != -1) p->SetCaretIndex(index, partVis); // change focus @@ -1366,8 +1366,8 @@ int CSalamanderGeneral::GetSourcePanel() return PANEL_RIGHT; } -// activates the other panel (like the TAB key); panels marked through PANEL_SOURCE and PANEL_TARGET -// swap naturally as a result +// activates the other panel (like the Tab key); panels marked with PANEL_SOURCE and PANEL_TARGET +// naturally swap as a result void CSalamanderGeneral::ChangePanel() { if (MainThreadID != GetCurrentThreadId()) @@ -1808,7 +1808,7 @@ void CSalamanderGeneral::PostUnloadThisPlugin() TRACE_E("Unexpected situation in CSalamanderGeneral::PostUnloadThisPlugin()."); } } - else // outside the entry point the Plugin is certainly set... + else // Outside the entry point, Plugin is already set... { if (MainWindow != NULL && MainWindow->HWindow != NULL) { @@ -1847,7 +1847,7 @@ void CSalamanderGeneral::PostPluginMenuChanged() TRACE_E("Unexpected situation in CSalamanderGeneral::PostPluginMenuChanged()."); } } - else // outside the entry point the Plugin is certainly set... + else // Outside the entry point, Plugin is certainly already set... { if (MainWindow != NULL && MainWindow->HWindow != NULL) { @@ -1894,7 +1894,7 @@ void CSalamanderGeneral::PostMenuExtCommand(int id, BOOL waitForSalIdle) TRACE_E("Unexpected situation in CSalamanderGeneral::PostMenuExtCommand()."); } } - else // outside the entry point the Plugin is certainly set... + else // outside the entry point, Plugin is guaranteed to be set... { if (MainWindow != NULL && MainWindow->HWindow != NULL) { @@ -2305,7 +2305,7 @@ BOOL CSalamanderGeneral::CloseDetachedFS(HWND parent, CPluginFSInterfaceAbstract { CPluginFSInterfaceEncapsulation* fs = list->At(i); BOOL dummy; - if (fs->TryCloseOrDetach(FALSE, FALSE, dummy, FSTRYCLOSE_PLUGINCLOSEDETACHEDFS)) // the FS has no objection to closing + if (fs->TryCloseOrDetach(FALSE, FALSE, dummy, FSTRYCLOSE_PLUGINCLOSEDETACHEDFS)) // the FS allows closing { CPluginInterfaceForFSEncapsulation plugin(fs->GetPluginInterfaceForFS()->GetInterface(), fs->GetPluginInterfaceForFS()->GetBuiltForVersion()); @@ -2398,7 +2398,7 @@ BOOL CSalamanderGeneral::CopyTextToClipboard(const char* text, int textLen, BOOL BOOL CSalamanderGeneral::CopyTextToClipboardW(const wchar_t* text, int textLen, BOOL showEcho, HWND echoParent) { CALL_STACK_MESSAGE3("CSalamanderGeneral::CopyTextToClipboardW(, %d, %d,)", textLen, showEcho); - // j.r. threw the text parameter, which did not have to be null-terminated + // j.r. removed the text parameter, since it did not have to be null-terminated if (text == NULL) { TRACE_E("Unexpected parameter (NULL) in CSalamanderGeneral::CopyTextToClipboardW()."); @@ -2450,7 +2450,7 @@ BOOL ViewFileInPluginViewer(const char* pluginSPL, const char* fileName; // name of the file we will pass to the viewer if (useCache) { - // verify that 'fileNameInCache' is valid (a name without path) + // verify that 'fileNameInCache' was not specified incorrectly (a name without a path) const char* s = NULL; if (fileNameInCache != NULL) { @@ -2533,7 +2533,7 @@ BOOL ViewFileInPluginViewer(const char* pluginSPL, // finally open the viewer itself BOOL diskCacheNameClosed = FALSE; error = 0; - if (pluginSPL != NULL) // viewer from a plug-in + if (pluginSPL != NULL) // viewer from a plugin { CPluginData* data = Plugins.GetPluginDataFromSuffix(pluginSPL); if (data != NULL && data->SupportViewer) @@ -2617,7 +2617,7 @@ BOOL ViewFileInPluginViewer(const char* pluginSPL, DiskCache.ReleaseName(viewUniqueName, FALSE); // ::DeleteFile(fileName); // the cache already removed the file and deallocated fileName } - return error == 0; // returning success? + return error == 0; // return success? } BOOL CSalamanderGeneral::ViewFileInPluginViewer(const char* pluginSPL, @@ -2664,7 +2664,7 @@ int CSalamanderGeneral::GetPanelTopIndex(int panel) CFilesWindow* p = GetPanel(panel); if (p != NULL) return p->ListBox->GetTopIndex(); - return 0; // error; should not happen... + return 0; // error, should not occur... } void CSalamanderGeneral::GetPanelEnumFilesParams(int panel, int* enumFilesSourceUID, int* enumFilesCurrentIndex) @@ -3082,7 +3082,7 @@ BOOL CSalamanderGeneral::GetConfigParameter(int paramID, void* buffer, int buffe memcpy(buffer, auxBuf, auxDataSize); else { - if (bufferSize > 0 && auxDataSize > 0) // copy at least what fits + if (bufferSize > 0 && auxDataSize > 0) // copy at least what fits in the buffer { memcpy(buffer, auxBuf, bufferSize); if (auxType == SALCFGTYPE_STRING) @@ -3147,7 +3147,7 @@ BOOL CSalamanderGeneral::GetFileFromCache(const char* uniqueFileName, const char const char* name = DiskCache.GetName(uniqueFileName, NULL, &fileExists, FALSE, NULL, FALSE, NULL, NULL); if (name != NULL) // file found { - if (!fileExists) // some helpful soul deleted it straight from the disk + if (!fileExists) // someone deleted it directly from disk { // cannot prepare the file; tell the disk cache we give up DiskCache.ReleaseName(uniqueFileName, FALSE); @@ -3185,7 +3185,7 @@ BOOL CSalamanderGeneral::MoveFileToCache(const char* uniqueFileName, const char* return FALSE; } - // verify that 'nameInCache' is valid (a name without a path) + // verify that 'nameInCache' was not specified incorrectly (a name without a path) const char* s = nameInCache; while (*s != 0 && *s != '\\' && *s != '/' && *s != ':' && *s >= 32 && *s != '<' && *s != '>' && *s != '|' && *s != '"') @@ -3199,7 +3199,7 @@ BOOL CSalamanderGeneral::MoveFileToCache(const char* uniqueFileName, const char* // add the file 'newFileName' to the disk cache under the name 'uniqueFileName' BOOL exists; const char* fileName = DiskCache.GetName(uniqueFileName, nameInCache, &exists, TRUE, rootTmpPath, FALSE, NULL, NULL); - if (fileName == NULL) // error (if 'exists' is TRUE -> fatal, otherwise "file already exists") + if (fileName == NULL) // error (if `exists` is TRUE, it is fatal; otherwise "file already exists") { if (alreadyExists != NULL) *alreadyExists = !exists; @@ -3375,7 +3375,7 @@ void CSalamanderGeneral::CallPluginOperationFromDisk(int panel, SalPluginOperati else p->GetSelItems(count, data.Indexes); } - else // take the focus + else // use the focused item { oneIndex = p->GetCaretIndex(); @@ -3633,7 +3633,7 @@ void CSalamanderGeneral::PostSalamanderCommand(int salCmd) TRACE_E("Unexpected situation in CSalamanderGeneral::PostSalamanderCommand()."); } } - else // outside the entry point the Plugin is certainly set... + else // Outside the entry point, Plugin is already certainly set... { if (MainWindow != NULL && MainWindow->HWindow != NULL) { @@ -4161,7 +4161,7 @@ void ActivateDropTarget(HWND dropTarget, HWND progressWnd) while ((tmp = ::GetParent(tgtWnd)) != NULL && IsWindowEnabled(tmp)) tgtWnd = tmp; if (MainWindow != NULL && tgtWnd != MainWindow->HWindow) - { // perform it only if it is not an operation inside our Salamander + { // perform this only if it is not an operation inside Salamander SetForegroundWindow(progressWnd); SetForegroundWindow(tgtWnd); // TRACE_I("SetForegroundWindow: " << hex << tgtWnd); @@ -4274,7 +4274,7 @@ void CSalamanderGeneral::FreeSalamanderDirectory(CSalamanderDirectoryAbstract* s } BOOL CSalamanderGeneral::AddPluginFSTimer(int timeout, CPluginFSInterfaceAbstract* timerOwner, - DWORD timerParam) // FIXME_X64 - review the Salamander interface to ensure we do not pass parameters that should hold x64 pointers; for example here 'timerParam' + DWORD timerParam) // FIXME_X64 - review the Salamander interface to ensure we do not pass parameters that should be able to hold x64 pointers; for example, 'timerParam' here { CALL_STACK_MESSAGE3("CSalamanderGeneral::AddPluginFSTimer(%d, , 0x%X)", timeout, timerParam); if (MainThreadID != GetCurrentThreadId()) @@ -4449,7 +4449,7 @@ class CSalamanderPNG : public CSalamanderPNGAbstract virtual HBITMAP WINAPI LoadPNGBitmap(HINSTANCE hInstance, LPCTSTR lpBitmapName, DWORD flags, COLORREF unused) { HBITMAP hBitmap = ::LoadPNGBitmap(hInstance, lpBitmapName, flags); - if (hBitmap != NULL) // the handle is handed over to the plug-in; the plug-in is responsible for destroying it, remove it from Salamander HANDLES + if (hBitmap != NULL) // the handle is handed over to the plugin; the plugin is responsible for destroying it, so remove it from Salamander HANDLES HANDLES_REMOVE(hBitmap, __htHandle_comp_with_DeleteObject, "DeleteObject"); return hBitmap; } @@ -4457,7 +4457,7 @@ class CSalamanderPNG : public CSalamanderPNGAbstract virtual HBITMAP WINAPI LoadRawPNGBitmap(const void* rawPNG, DWORD rawPNGSize, DWORD flags, COLORREF unused) { HBITMAP hBitmap = ::LoadRawPNGBitmap(rawPNG, rawPNGSize, flags); - if (hBitmap != NULL) // the handle is handed over to the plug-in; the plug-in is responsible for destroying it, remove it from Salamander HANDLES + if (hBitmap != NULL) // the handle is handed over to the plugin; the plugin is responsible for destroying it, so remove it from Salamander HANDLES HANDLES_REMOVE(hBitmap, __htHandle_comp_with_DeleteObject, "DeleteObject"); return hBitmap; } @@ -4619,7 +4619,7 @@ BOOL CSalamanderGeneral::IsArchiveHandledByThisPlugin(const char* name) { format--; int index = PackerFormatConfig.GetUnpackerIndex(format); - if (index < 0) // view: is it internal processing (plug-in)? + if (index < 0) // does this mean internal plugin handling? { CPluginData* foundData = Plugins.Get(-index - 1); if (foundData == data) // is it us? @@ -4768,7 +4768,7 @@ void CSalamanderGeneral::OpenNetworkContextMenu(HWND parent, int panel, BOOL for CFilesWindow* p = GetPanel(panel); if (p != NULL) { - BeginStopRefresh(); // no refreshes needed (formality: the call comes from a plug-in, so refreshes are already disabled by EnterPlugin) + BeginStopRefresh(); // no refreshes needed (formality: the call comes from a plugin, so refreshes are already disabled by EnterPlugin) int* indexes = NULL; int index = 0; @@ -4833,7 +4833,7 @@ void CSalamanderGeneral::OpenNetworkContextMenu(HWND parent, int panel, BOOL for RemoveUselessSeparatorsFromMenu(h); int cmd = 0; - if (GetMenuItemCount(h) > 0) // guard against a completely trimmed menu + if (GetMenuItemCount(h) > 0) // guard against a completely empty menu { CMenuPopup contextPopup; contextPopup.SetTemplateMenu(h); @@ -4859,7 +4859,7 @@ void CSalamanderGeneral::OpenNetworkContextMenu(HWND parent, int panel, BOOL for if (SalPathAppend(root, (focus < p->Dirs->Count ? p->Dirs->At(focus) : p->Files->At(focus - p->Dirs->Count)).Name, MAX_PATH)) { char newDrive = 0; - p->ConnectNet(TRUE, root, FALSE /* called from a plug-in; must not change the panel path, otherwise + p->ConnectNet(TRUE, root, FALSE /* called from a plugin; must not change the panel path, otherwise we would return to a deallocated FS object */ , &newDrive); @@ -5508,7 +5508,7 @@ void CSalamanderForViewFileOnFS::FreeFileNameInCache(const char* uniqueFileName, DiskCache.AssignName(uniqueFileName, fileLock, fileLockOwner, (fileExists || removeAsSoonAsPossible) ? crtDirect : crtCache); // for files present in the disk cache we use crtDirect, because it does not affect the "lifetime" setting (it stays as the file's author requested) } - else // the viewer did not open or simply does not have a "lock" object + else // the viewer either did not open or does not have a "lock" object { DiskCache.ReleaseName(uniqueFileName, !fileExists && !removeAsSoonAsPossible); // if 'removeAsSoonAsPossible' is not TRUE, at least try to keep a copy of the file in the disk cache (if it was not an existing file, we do not change its "lifetime") } @@ -5532,7 +5532,7 @@ CSalamanderDirectory::CSalamanderDirectory(BOOL isForFS, DWORD validData, DWORD CSalamanderDirectory::~CSalamanderDirectory() { - Clear(NULL); // plug-in data are released only in the root sal-dir + Clear(NULL); // plugin data are released only in the root sal-dir FreeAddCache(); } @@ -5574,7 +5574,7 @@ int CSalamanderDirectory::SalDirStrCmpEx(const char* s1, int l1, const char* s2, void CSalamanderDirectory::Clear(CPluginDataInterfaceAbstract* pluginData) { - if (pluginData != NULL) // release plug-in-specific data + if (pluginData != NULL) // release plugin-specific data { CPluginDataInterfaceEncapsulation plugin(pluginData, STR_NONE, STR_NONE, NULL, 0); BOOL releaseFiles = plugin.CallReleaseForFiles(); @@ -5661,7 +5661,7 @@ CSalamanderDirectory::AllocSalamDir(int index) // 's' - output: points past the first name in the path 'path' // 'i' - output: index of the found subdirectory (which should continue processing the path 's') // 'file' - input: if the directory must be created, where to copy data from -// 'pluginData' - input: interface for creating plug-in-specific data for the new directory (if needed) +// 'pluginData' - input: interface for creating plugin-specific data for the new directory (if needed) // 'archivePath' - input: full path in the archive ('path' and 's' both point into it) BOOL CSalamanderDirectory::FindDir(const char* path, const char*& s, int& i, const CFileData& file, @@ -5725,13 +5725,13 @@ BOOL CSalamanderDirectory::FindDir(const char* path, const char*& s, int& i, con data.IconOverlayIndex = ICONOVERLAYINDEX_NOTUSED; data.IconOverlayDone = 0; - if (pluginData != NULL) // let the plug-in add its specific data + if (pluginData != NULL) // let the plugin add its specific data { char arcPath[MAX_PATH]; // name of the added directory inside the archive memcpy(arcPath, archivePath, s - archivePath); arcPath[s - archivePath] = 0; CPluginDataInterfaceEncapsulation plugin(pluginData, STR_NONE, STR_NONE, NULL, 0); - if (!plugin.GetFileDataForNewDir(arcPath, data)) // cannot add the plug-in data + if (!plugin.GetFileDataForNewDir(arcPath, data)) // failed to add plugin data { free(data.Name); return FALSE; @@ -5742,7 +5742,7 @@ BOOL CSalamanderDirectory::FindDir(const char* path, const char*& s, int& i, con if (!Dirs.IsGood()) { Dirs.ResetState(); - if (pluginData != NULL) // release plug-in-specific data + if (pluginData != NULL) // release plugin-specific data { CPluginDataInterfaceEncapsulation plugin(pluginData, STR_NONE, STR_NONE, NULL, 0); if (plugin.CallReleaseForDirs()) @@ -5753,27 +5753,27 @@ BOOL CSalamanderDirectory::FindDir(const char* path, const char*& s, int& i, con } //--- adding the Salamander directory corresponding to the new directory /* - CSalamanderDirectory *dir = new CSalamanderDirectory(IsForFS, ValidData, Flags); - if (dir != NULL) SalamDirs.Add((DWORD)dir); - else TRACE_E(LOW_MEMORY); - if (dir == NULL || !SalamDirs.IsGood()) - { - if (dir != NULL) delete dir; - SalamDirs.ResetState(); - if (pluginData != NULL) // release plug-in-specific data - { - CPluginDataInterfaceEncapsulation plugin(pluginData, STR_NONE, STR_NONE, NULL, 0); - if (plugin.CallReleaseForDirs()) plugin.ReleasePluginData2(Dirs[Dirs.Count - 1], TRUE); - } - Dirs.Delete(Dirs.Count - 1); - return FALSE; - } -*/ + CSalamanderDirectory *dir = new CSalamanderDirectory(IsForFS, ValidData, Flags); + if (dir != NULL) SalamDirs.Add((DWORD)dir); + else TRACE_E(LOW_MEMORY); + if (dir == NULL || !SalamDirs.IsGood()) + { + if (dir != NULL) delete dir; + SalamDirs.ResetState(); + if (pluginData != NULL) // release plugin-specific data + { + CPluginDataInterfaceEncapsulation plugin(pluginData, STR_NONE, STR_NONE, NULL, 0); + if (plugin.CallReleaseForDirs()) plugin.ReleasePluginData2(Dirs[Dirs.Count - 1], TRUE); + } + Dirs.Delete(Dirs.Count - 1); + return FALSE; + } + */ SalamDirs.Add(NULL); // add NULL (the object will be allocated the first time it is needed) if (!SalamDirs.IsGood()) { SalamDirs.ResetState(); - if (pluginData != NULL) // release plug-in-specific data + if (pluginData != NULL) // release plugin-specific data { CPluginDataInterfaceEncapsulation plugin(pluginData, STR_NONE, STR_NONE, NULL, 0); if (plugin.CallReleaseForDirs()) @@ -5860,7 +5860,7 @@ BOOL CSalamanderDirectory::AddFile(const char* path, CFileData& file, CPluginDat file.CutToClip = 0; file.IconOverlayDone = 0; - // if we have the path cached from the previous addition, we can insert the file right into its place + // if the path is cached from the previous add, we can insert the file directly there if (path != NULL && AddCache != NULL && pathLen > 0 && pathLen == AddCache->PathLen && memcmp(path, AddCache->Path, pathLen) == 0) { @@ -5876,7 +5876,7 @@ BOOL CSalamanderDirectory::AddFile(const char* path, CFileData& file, CPluginDat CSalamanderDirectory* ret = AddFileInt(path, file, pluginData, path); - // if the insertion succeeded and the cache is used, remember the path + // if adding succeeded and the cache is in use, store the path if (ret != NULL && AddCache != NULL && pathLen > 0) { AddCache->PathLen = pathLen; @@ -6007,7 +6007,7 @@ CSalamanderDirectory* CSalamanderDirectory::AddFileInt(const char* path, CFileData& file, CPluginDataInterfaceAbstract* pluginData, const char* archivePath) { - CALL_STACK_MESSAGE_NONE // time-critical method; in addition, path may be NULL + CALL_STACK_MESSAGE_NONE // time-critical method; path may also be NULL // CALL_STACK_MESSAGE3("CSalamanderDirectory::AddFileInt(%s, , , %s)", path, archivePath); if (path != NULL) @@ -6046,7 +6046,7 @@ CSalamanderDirectory* CSalamanderDirectory::AddDirInt(const char* path, CFileData& dir, CPluginDataInterfaceAbstract* pluginData, const char* archivePath) { - CALL_STACK_MESSAGE_NONE // time-critical method; in addition, path may be NULL + CALL_STACK_MESSAGE_NONE // performance-critical method; path may also be NULL // CALL_STACK_MESSAGE3("CSalamanderDirectory::AddDirInt(%s, , , %s)", path, archivePath); if (path != NULL) @@ -6072,7 +6072,7 @@ CSalamanderDirectory::AddDirInt(const char* path, CFileData& dir, } BOOL newDir = TRUE; - if ((Flags & SALDIRFLAG_IGNOREDUPDIRS) == 0) // if we should test for duplicate directories + if ((Flags & SALDIRFLAG_IGNOREDUPDIRS) == 0) // if duplicate directories should be checked { int i; for (i = 0; i < Dirs.Count; i++) @@ -6083,7 +6083,7 @@ CSalamanderDirectory::AddDirInt(const char* path, CFileData& dir, newDir = (i == Dirs.Count); // not created yet if (!newDir) // updating existing data { - if (pluginData != NULL) // release plug-in-specific data + if (pluginData != NULL) // release plugin-specific data { CPluginDataInterfaceEncapsulation plugin(pluginData, STR_NONE, STR_NONE, NULL, 0); if (plugin.CallReleaseForDirs()) @@ -6245,7 +6245,7 @@ CSalamanderDirectory::GetDirs(const char* path) return salDir->GetDirs(s); } else - return NULL; // low memory error (as if the directory did not exist) + return NULL; // out-of-memory error (as if the directory did not exist) } } } @@ -6263,7 +6263,7 @@ CSalamanderDirectory::GetFiles(const char* path) { if (*path == '\\') path++; - if (*path != 0) // some subdirectory + if (*path != 0) // a subdirectory { const char* s = path; while (*s != 0 && *s != '\\') @@ -6281,7 +6281,7 @@ CSalamanderDirectory::GetFiles(const char* path) return salDir->GetFiles(s); } else - return NULL; // low memory error (as if the directory did not exist) + return NULL; // out-of-memory error (as if the directory did not exist) } } } @@ -6299,7 +6299,7 @@ CSalamanderDirectory::GetUpperDir(const char* path) { if (*path == '\\') path++; - if (*path != 0) // some subdirectory + if (*path != 0) // a subdirectory { const char* s = path; while (*s != 0 && *s != '\\') @@ -6321,15 +6321,15 @@ CSalamanderDirectory::GetUpperDir(const char* path) return salDir->GetUpperDir(s); } else - return NULL; // low memory error (as if the directory did not exist) + return NULL; // out of memory error (as if the directory did not exist) } } } } else - return NULL; // for root return NULL + return NULL; // return NULL for the root } - return NULL; // for root and unknown paths return NULL + return NULL; // return NULL for the root and unknown paths } CQuadWord @@ -6415,7 +6415,7 @@ CSalamanderDirectory::GetSalamanderDir(const char* path, BOOL readOnly) { if (*path == '\\') path++; - if (*path != 0) // some subdirectory + if (*path != 0) // a subdirectory { const char* s = path; while (*s != 0 && *s != '\\') @@ -6440,7 +6440,7 @@ CSalamanderDirectory::GetSalamanderDir(const char* path, BOOL readOnly) return salDir->GetSalamanderDir(s, readOnly); } else - return NULL; // allocation error + return NULL; // allocation failed } } } From c167057cb20d2c69d5a15fc139908f625ebe5e99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:44:03 +0200 Subject: [PATCH 461/710] [translation] Fix src/bugreprt.cpp comments Refines translated comments in src/bugreprt.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #840 for src/bugreprt.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/bugreprt.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/bugreprt.cpp b/src/bugreprt.cpp index af36fe22e..d83320d4d 100644 --- a/src/bugreprt.cpp +++ b/src/bugreprt.cpp @@ -43,7 +43,7 @@ BOOL GetProcessorSpeed(DWORD* mhz) HANDLE t, p; if (!QueryPerformanceFrequency(&f)) - return FALSE; // installed hardware doesn't supports a high-resolution performance counter + return FALSE; // installed hardware does not support a high-resolution performance counter // temporarily raise priority t = GetCurrentThread(); @@ -70,7 +70,7 @@ BOOL GetProcessorSpeed(DWORD* mhz) c2 = __rdtsc(); QueryPerformanceCounter(&t2); - // restore original priority + // restore the original priorities SetThreadPriority(t, tp); SetPriorityClass(p, pp); @@ -173,7 +173,7 @@ MonitorEnumProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dw sprintf(buf, "Monitor %d: (%d,%d)-(%d,%d) %dx%d pixels", data->Index, r.left, r.top, r.right, r.bottom, r.right - r.left, r.bottom - r.top); - // hdcMonitor is NULL, we must create a DC + // hdcMonitor is NULL, so we must create a DC HDC hdc = NOHANDLES(CreateDC(mi.szDevice, mi.szDevice, NULL, NULL)); int planes = GetDeviceCaps(hdc, PLANES); int bitsPixels = GetDeviceCaps(hdc, BITSPIXEL); @@ -575,8 +575,8 @@ void CCallStack::PrintBugReport(EXCEPTION_POINTERS* Exception, DWORD ThreadID, D PrintLine(param, buf, TRUE); if (IsDebuggerPresent()) { - // the x64/Debug build on W7 started from the MSVC debugger did not generate a valid minidump (function failed, dump incomplete) - // outside MSVC everything worked correctly - note that we are running from the debugger + // The x64/Debug build on Windows 7 started from the MSVC debugger did not generate a valid minidump + // outside MSVC everything worked correctly, so note that we are running under the debugger sprintf(buf, "Debugger is present!"); PrintLine(param, buf, TRUE); } @@ -2026,8 +2026,8 @@ void CCallStack::PrintBugReport(EXCEPTION_POINTERS* Exception, DWORD ThreadID, D int i; for (i = 0; i < CCallStack::CallStacks.Count; i++) { - // !!! accesses to CCallStack::CallStacks array should be protected by a critical section - // otherwise we risk touching non-existing memory + // !!! access to the CCallStack::CallStacks array should be protected by a critical section + // otherwise we risk accessing invalid memory CCallStack* stack; stack = CCallStack::CallStacks[i]; @@ -2054,7 +2054,7 @@ void CCallStack::PrintBugReport(EXCEPTION_POINTERS* Exception, DWORD ThreadID, D BOOL threadWithException = (Exception != NULL && Exception->ContextRecord != NULL && stack->ThreadID == ThreadID); if (stack->ThreadID != GetCurrentThreadId() || threadWithException) { - // if this isn't our thread, suspend it so we can retrieve context + // if this is not our thread, suspend it so we can retrieve its context if (threadWithException || SuspendThread(hThread) != -1) { if (!firstTime) @@ -2098,7 +2098,7 @@ void CCallStack::PrintBugReport(EXCEPTION_POINTERS* Exception, DWORD ThreadID, D // // this function's ebp // points here ------------\ - // ebp-0x8 ebp-0x4 ebp+0x0 ebp+0x4 ebp+0x8 ebp+0xC + // ebp-0x8 ebp-0x4 ebp+0x0 ebp+0x4 ebp+0x8 ebp+0xC // caller's return // local1 local0 ebp addr param0 param1 // ... 00000000 00000000 00000000 00000000 00000000 00000000 ... @@ -2372,11 +2372,11 @@ void CCallStack::PrintBugReport(EXCEPTION_POINTERS* Exception, DWORD ThreadID, D PrintLine(param, "", FALSE); /* - // leaving thread enumeration unfinished for now because Petr suggested showing - // the back trace for the thread where the crash occurred (we know its ID) + // leaving thread enumeration unfinished for now because Petr suggested displaying + // the backtrace for the thread in which the crash occurred (we know its ID) - // the knownThreads array contains a list of displayed threads; - // now we attempt to find those not yet shown + // the knownThreads array contains the list of threads already shown; + // now we will try to find those not yet shown if (knownThreads.IsGood()) { HANDLE snap = CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, 0); From 84d4b02b09909b69aa6f56beec9ba606c612e533 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:44:33 +0200 Subject: [PATCH 462/710] [translation] Fix src/dialogs.cpp comments Refines translated comments in src/dialogs.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #849 for src/dialogs.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/dialogs.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/dialogs.cpp b/src/dialogs.cpp index 5443eb4d5..79dde1512 100644 --- a/src/dialogs.cpp +++ b/src/dialogs.cpp @@ -126,7 +126,7 @@ void CChangeAttrDialog::Transfer(CTransferInfo& ti) DateTime_SetSystemtime(HModifiedDate, GDT_NONE, &TimeModified); DateTime_SetSystemtime(HCreatedDate, GDT_NONE, &TimeCreated); DateTime_SetSystemtime(HAccessedDate, GDT_NONE, &TimeAccessed); - // fill in the times + // populate the time fields DateTime_SetSystemtime(HModifiedTime, GDT_VALID, &TimeModified); DateTime_SetSystemtime(HCreatedTime, GDT_VALID, &TimeCreated); DateTime_SetSystemtime(HAccessedTime, GDT_VALID, &TimeAccessed); @@ -310,7 +310,7 @@ unsigned ThreadProgressDlgBody(void* parameter) CProgressDialog dlg(NULL, data->Script, data->Caption, attrsData, convertData, TRUE, data); INT_PTR res = dlg.Execute(); - if (res == 0 || res == -1 || res == IDABORT) // failed to open the dialog or worker thread + if (res == 0 || res == -1 || res == IDABORT) // failed to open the dialog or start the worker thread SetEvent(data->ContEvent); // let the main thread continue (opening the dialog or starting the operation failed) if (workPath1[0] != 0) @@ -683,7 +683,7 @@ CProgressDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) WorkerNotSuspended = NULL; HANDLES(CloseHandle(WContinue)); WContinue = NULL; - EndDialog(HWindow, IDABORT); // fatal error + EndDialog(HWindow, IDABORT); // abort } else { @@ -918,7 +918,7 @@ CProgressDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) { if (wParam == IDT_REPAINT) { - if (!FlushCachedData()) // WM_USER_SETDIALOG did not arrive, we can safely cancel the timer + if (!FlushCachedData()) // WM_USER_SETDIALOG was not received, so the timer can be safely canceled { TimerIsRunning = FALSE; KillTimer(HWindow, IDT_REPAINT); @@ -993,7 +993,7 @@ CProgressDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) */ secs.Value++; // add one second so we finish the operation with "time left: 1 sec" (instead of 0 sec) - // rounding calculation (roughly 10% error + rounded to nice numbers 1,2,5,10,20,40) + // rounding calculation (approximately 10% error; rounded to nice values: 1, 2, 5, 10, 20, 40) CQuadWord dif = (secs + CQuadWord(5, 0)) / CQuadWord(10, 0); int expon = 0; while (dif >= CQuadWord(50, 0)) @@ -1205,7 +1205,7 @@ MENU_TEMPLATE_ITEM ProgressDialogMenu2[] = { if (CanClose) { - if (!IsWindowEnabled(HWindow)) // there is a modal dialog above this dialog (a message box asking about operation canceling or reporting an error) + if (!IsWindowEnabled(HWindow)) // a modal dialog is open over this dialog (a message box asking whether to cancel the operation or reporting an operation error) CloseAllOwnedEnabledDialogs(HWindow); CancelWorker = TRUE; // set worker cancel EnableWindow(GetDlgItem(HWindow, IDB_PAUSERESUME), FALSE); @@ -1235,7 +1235,7 @@ MENU_TEMPLATE_ITEM ProgressDialogMenu2[] = SetThreadPriority(Worker, THREAD_PRIORITY_NORMAL); AcceptCommands = TRUE; } - if (!IsWindowEnabled(HWindow)) // there is a modal window above this dialog (a message box asking about operation canceling or reporting an error) + if (!IsWindowEnabled(HWindow)) // a modal window is open over this dialog (a message box asking whether to cancel the operation or reporting an operation error) { HWND dlg = GetLastActivePopup(HWindow); if (dlg != NULL && dlg != HWindow) @@ -1269,7 +1269,7 @@ MENU_TEMPLATE_ITEM ProgressDialogMenu2[] = if (RunningInOwnThread && !Configuration.AlwaysOnTop && GetForegroundWindow() == HWindow) { // Prior to Windows Vista we only called GetNextWindow(), which was enough to reach the next window in the Z-order. - // Vista introduced new hidden helper windows such as "MSCTFIME UI" and "Default IME" that sit between us and + // Vista introduced new hidden helper windows such as "MSCTFIME UI" and "Default IME" that sit between us and // our window (main, viver, ect.). So we skip hidden windows here. BOOL valid; HWND hNext = HWindow; @@ -1353,8 +1353,8 @@ MENU_TEMPLATE_ITEM ProgressDialogMenu2[] = int ret = SalMessageBox(HWindow, LoadStr(IDS_CANCELOPERATION), LoadStr(IDS_QUESTION), MB_YESNO | MB_ICONQUESTION /*| MSGBOXEX_ESCAPEENABLED*/); // Escape key is not a good - // idea -- Zarevak accidentally started deleting a large batch of files, then began hitting Escape (the machine was - // heavily loaded so it did not respond immediately) canceling the confirmation, therefore the confirmation can + // idea -- Zarevak accidentally started deleting a large batch of files, then began hitting Escape (the machine was + // heavily loaded so it did not respond immediately) canceling the confirmation, therefore the confirmation can // no longer be closed with Escape. // BeginSuspendMode(); // we are doing something again ... @@ -1379,10 +1379,10 @@ MENU_TEMPLATE_ITEM ProgressDialogMenu2[] = if ((CancelWorker || ShowPause) && // only if it's Cancel or the operation isn't paused WorkerNotSuspended != NULL) { - SetEvent(WorkerNotSuspended); // may be NULL if the message box was closed from IDOK via WM_CLOSE + SetEvent(WorkerNotSuspended); // may be NULL if the message box was closed by IDOK via WM_CLOSE } } - return TRUE; // only the worker using IDOK will terminate the dialog ... + return TRUE; // only the worker can close the dialog using IDOK ... } case CM_RESUMEOPER: // resume posted from the operations queue @@ -1478,8 +1478,8 @@ MENU_TEMPLATE_ITEM ProgressDialogMenu2[] = SetThreadPriority(Worker, THREAD_PRIORITY_NORMAL); AcceptCommands = TRUE; } - if (wParam == FALSE) // when deactivated we leave directories shown in the panels, - { // so they can be deleted, disconnected, etc. from other software + if (wParam == FALSE) // when deactivated, we leave the directories shown in the panels + { // so other software can delete or disconnect them if (!RunningInOwnThread && CanChangeDirectory()) SetCurrentDirectoryToSystem(); } @@ -2070,7 +2070,7 @@ CBetaExpiredDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) hl = new CHyperLink(HWindow, IDC_BETAEXPIREDURL); if (hl != NULL) { - // if the environment is Czech or Slovak, we will automatically show the Czech version of the web + // if the language is Czech or Slovak, automatically show the Czech version of the website BOOL english = LanguageID != 0x405 /* Czech */ && LanguageID != 0x41B /* Slovak */; const char* url = @@ -2100,7 +2100,7 @@ CBetaExpiredDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) sprintf(buff, orig, today, expired); SetDlgItemText(HWindow, IDC_BETAEXPIREDDATE, buff); - // the OK button will show numbers counting down, store the original text + // The OK button will display countdown numbers; store the original text. GetDlgItemText(HWindow, IDOK, OldOK, 100); EnableWindow(GetDlgItem(HWindow, IDOK), FALSE); @@ -2186,7 +2186,7 @@ void CSetSpeedLimDialog::Transfer(CTransferInfo& ti) { speedLimNum /= 1024; speedLimUnits++; - if (speedLimNum == 0 || speedLimUnits > 3) // should not happen, just for peace of mind + if (speedLimNum == 0 || speedLimUnits > 3) // cannot occur; defensive check { TRACE_E("CSetSpeedLimDialog::Transfer(): unexpected situation!"); speedLimNum = 4; From f665ae8a1d5910fc5b64812dc6507757d47471df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:44:42 +0200 Subject: [PATCH 463/710] [translation] Fix src/mainwnd3.cpp comments Refines translated comments in src/mainwnd3.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #890 for src/mainwnd3.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/mainwnd3.cpp | 216 +++++++++++++++++++++++------------------------ 1 file changed, 108 insertions(+), 108 deletions(-) diff --git a/src/mainwnd3.cpp b/src/mainwnd3.cpp index 333896cc9..384465dd3 100644 --- a/src/mainwnd3.cpp +++ b/src/mainwnd3.cpp @@ -39,14 +39,14 @@ extern "C" #include "find.h" #include "viewer.h" -// critical shutdown: the maximum time we can spend in WM_QUERYENDSESSION (after that, -// KILL comes from Windows). It is 5s (5s with an open message box, 10s without pumping -// messages). I left a 500ms reserve. Tested on Vista, Win7, Win8, Win10. +// critical shutdown: the maximum time that can be spent in WM_QUERYENDSESSION (after that, +// Windows sends KILL) is 5 s (5 s with an open message box, 10 s without pumping +// messages); a 500 ms reserve was left. Tested on Vista, Win7, Win8, and Win10. #define QUERYENDSESSION_TIMEOUT 4500 // variables used when saving configuration during shutdown, log-off or restart // we must pump messages so the system does not kill us as "not responding" -CWaitWindow* GlobalSaveWaitWindow = NULL; // if a global wait window for Save exists, it's here (otherwise NULL) +CWaitWindow* GlobalSaveWaitWindow = NULL; // if a global wait window for Save exists, it is here (otherwise NULL) int GlobalSaveWaitWindowProgress = 0; // current progress value of the global wait window for Save // borrow constants from a newer SDK @@ -58,7 +58,7 @@ int GlobalSaveWaitWindowProgress = 0; // current progress value of the globa #define GET_APPCOMMAND_LPARAM(lParam) ((short)(HIWORD(lParam) & ~FAPPCOMMAND_MASK)) #define APPCOMMAND_BROWSER_BACKWARD 1 #define APPCOMMAND_BROWSER_FORWARD 2 -/* not supported yet +/* not currently supported #define APPCOMMAND_BROWSER_SEARCH 5 #define APPCOMMAND_HELP 27 #define APPCOMMAND_BROWSER_REFRESH 3 @@ -111,8 +111,8 @@ BOOL MainFrameIsActive = FALSE; // HtmlHelp support // -// universal callback for our MessageBox when the user clicks the HELP button -// should be called, for example, like this: +// universal callback for our MessageBox when the user clicks the Help button +// call it, for example, like this: // MSGBOXEX_PARAMS params; // params.Flags = MSGBOXEX_OK | MSGBOXEX_HELP | MSGBOXEX_ICONEXCLAMATION; // params.ContextHelpId = IDH_LICENSE; @@ -178,7 +178,7 @@ BOOL OpenHtmlHelp(char* helpFileName, HWND parent, CHtmlHelpCommand command, DWO !DirExists(helpPath)) { // the directory from the current .slg file does not exist lstrcpyn(helpPath, CurrentHelpDir, MAX_PATH); - if (_stricmp(helpSubdir, "english") == 0 || // we already tested "english" and it does not exist so no point in trying again + if (_stricmp(helpSubdir, "english") == 0 || // we already checked "english" and it does not exist, so there is no point in trying again !SalPathAppend(helpPath, "english", MAX_PATH) || !DirExists(helpPath)) { // the ENGLISH directory does not exist @@ -274,7 +274,7 @@ BOOL OpenHtmlHelp(char* helpFileName, HWND parent, CHtmlHelpCommand command, DWO } } - if (helpFileName != NULL) // plugin help: to open the window in the right position + if (helpFileName != NULL) // plugin help: open the help window in the correct position and restore the Favorites list correctly { // with remembered Favorites, we must open "salamand.chm" first (then // the plugin help opens in this same window) lstrcpyn(helpPath, CurrentHelpDir, MAX_PATH); @@ -366,7 +366,7 @@ class CMWDropTarget : public IDropTarget } STDMETHOD(QueryInterface) - (REFIID refiid, void FAR* FAR* ppv) + (REFIID refiid, void FAR * FAR * ppv) { if (refiid == IID_IUnknown || refiid == IID_IDropTarget) { @@ -389,7 +389,7 @@ class CMWDropTarget : public IDropTarget if (--RefCount == 0) { delete this; - return 0; // cannot touch the object anymore, it no longer exists + return 0; // must not touch the object; it no longer exists } return RefCount; } @@ -705,7 +705,7 @@ BOOL CMainWindow::IsPanelZoomed(BOOL leftPanel) void CMainWindow::ToggleSmartColumnMode(CFilesWindow* panel) { - if (panel->GetViewMode() == vmDetailed) // the panel must be running in detailed mode + if (panel->GetViewMode() == vmDetailed) // the panel must be in detailed mode { if (panel->Columns.Count < 1) return; @@ -822,13 +822,13 @@ BOOL CMainWindow::SHChangeNotifyInitialize() entry.pidl = pidl; entry.fRecursive = TRUE; - // message WM_USER_SHCHANGENOTIFY, which will be delivered to us on notifications, crosses process boundaries - // by using the constant SHCNRF_NewDelivery (also known as SHCNF_NO_PROXY) we assume responsibility - // for accessing the memory passed with the message (via SHChangeNotification_Lock) and tell the OS not to - // create proxy windows (note: a bug has been reported on XP where the proxy window is created but not destroyed): + // The WM_USER_SHCHANGENOTIFY message delivered for these notifications crosses process boundaries. + // By using the SHCNRF_NewDelivery constant (also known as SHCNF_NO_PROXY), we assume responsibility + // for accessing the memory passed with the message (using SHChangeNotification_Lock), and the OS must not + // create proxy windows (note: under XP, a bug was reported where the proxy window is created but not destroyed): // http://groups.google.com/groups?selm=3CDFD449.6BA0CDB4%40ic.ac.uk&output=gplain // - // through SHCNE_ASSOCCHANGED we receive notifications about association changes + // Using SHCNE_ASSOCCHANGED, we receive notifications about association changes. SHChangeNotifyRegisterID = SHChangeNotifyRegister(HWindow, SHCNRF_ShellLevel | SHCNRF_NewDelivery, SHCNE_MEDIAINSERTED | SHCNE_MEDIAREMOVED | SHCNE_DRIVEREMOVED | SHCNE_DRIVEADD | SHCNE_NETSHARE | SHCNE_NETUNSHARE | @@ -865,17 +865,17 @@ BOOL CMainWindow::OnAssociationsChangedNotification(BOOL showWaitWnd) // tweak the icon size LoadSaveToRegistryMutex.Enter(); // users reported shrunken icons, see https://forum.altap.cz/viewtopic.php?t=638 - // this synchronization ensures that two Salamanders do not interfere with each other - // unfortunately the trick with changing "Shell Icon Size" to rebuild the cache is used by many tools (including Tweak UI), - // so if they refresh at the same time as Salamander, conflicts occur - // we try to avoid this by postponing the following mess using IDT_ASSOCIATIONSCHNG + // this synchronization ensures that two Salamander instances do not interfere with each other + // unfortunately, the trick of changing "Shell Icon Size" to rebuild the cache is used by many tools (including Tweak UI), + // so if they refresh at the same time as Salamander, a conflict occurs + // we try to avoid this by delaying the following hack using IDT_ASSOCIATIONSCHNG HKEY hKey; if (HANDLES(RegOpenKeyEx(HKEY_CURRENT_USER, "Control Panel\\Desktop\\WindowMetrics", 0, KEY_READ | KEY_WRITE, &hKey)) == ERROR_SUCCESS) { // older SHELL32.DLL versions may not export this, fileIconInit will be NULL FT_FileIconInit fileIconInit = NULL; - fileIconInit = (FT_FileIconInit)GetProcAddress(Shell32DLL, MAKEINTRESOURCE(660)); // no header available + fileIconInit = (FT_FileIconInit)GetProcAddress(Shell32DLL, MAKEINTRESOURCE(660)); // no header char size[50]; BOOL deleteVal = FALSE; @@ -894,7 +894,7 @@ BOOL CMainWindow::OnAssociationsChangedNotification(BOOL showWaitWnd) deleteVal = TRUE; } int val = atoi(size); - if (val > 0) // unfortunately (according to net) users set icon sizes randomly (72, 96, 128, etc.) so we cannot filter out "strange" sizes + if (val > 0) // unfortunately, users set icon sizes arbitrarily (72, 96, 128, etc.), so we cannot filter out "strange" sizes { IgnoreWM_SETTINGCHANGE = TRUE; @@ -922,7 +922,7 @@ BOOL CMainWindow::OnAssociationsChangedNotification(BOOL showWaitWnd) if (fileIconInit != NULL) fileIconInit(TRUE); - // debug icon display + // icon display for debugging SHFILEINFO shi; HIMAGELIST systemIL = (HIMAGELIST)SHGetFileInfo("C:\\TEST.QWE", 0, &shi, sizeof(shi), SHGFI_SYSICONINDEX | SHGFI_SMALLICON | SHGFI_SHELLICONSIZE); @@ -1249,7 +1249,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = case WM_SETTINGCHANGE: { - if (IgnoreWM_SETTINGCHANGE || LeftPanel == NULL || RightPanel == NULL) // a bug report showed that WM_SETTINGCHANGE was delivered immediately from WM_CREATE of the main window (panels didn't exist yet, causing a NULL access) + if (IgnoreWM_SETTINGCHANGE || LeftPanel == NULL || RightPanel == NULL) // a bug report showed that WM_SETTINGCHANGE can be delivered during WM_CREATE of the main window (the panels did not exist yet, so it crashed on NULL access) return 0; // detection based on EXPLORER.EXE on NT4 @@ -1414,7 +1414,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = HANDLES(LeaveCriticalSection(&TimeCounterSection)); PostMessage(panel->HWindow, WM_USER_REFRESH_DIR, 0, t1); } - if (type == DRIVE_NO_ROOT_DIR) // device disappeared (the drive is invalid) + if (type == DRIVE_NO_ROOT_DIR) // the device disappeared (the drive is invalid) { if (LeftPanel == panel) { @@ -1439,15 +1439,15 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = } /* - // WM_DEVICECHANGE didn't work well, for example under Win XP when connecting the DSC F707 camera. - // A notification about device connection arrived, but the subsequent device name detection + // WM_DEVICECHANGE did not work reliably, for example on Win XP when connecting a DSC F707 camera. + // A device connection notification was delivered, but the subsequent device name detection // (if the Alt+F1/2 menu was displayed) via SHGetFileInfo returned an empty string. - // I found a thread on Google where someone complains about the same problem + // I found a Google thread where someone reported the same problem. // // http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=99a435fa.0203280715.69a286a8%40posting. // google.com&rnum=1&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26q%3Ddevice%2Bname%2Bshgetfileinfo // - // and he solved it with a wait. People recommended abandoning WM_DEVICECHANGE and switching to + // He solved it by waiting. People recommended abandoning WM_DEVICECHANGE and switching to // the undocumented function SHChangeNotifyRegister... // (http://www.geocities.com/SiliconValley/4942/notify.html) case WM_DEVICECHANGE: @@ -1455,7 +1455,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = if (wParam == DBT_DEVICEARRIVAL || wParam == DBT_DEVICEREMOVECOMPLETE || wParam == DBT_CONFIGCHANGED) // CD-ROM media change { - // if the Alt+F1/F2 menu is open, refresh (read volume name) + // if the Alt+F1/F2 menu is open, refresh it (read the volume name) CFilesWindow *panel = GetActivePanel(); if (panel != NULL) PostMessage(MainWindow->HWindow, WM_USER_DRIVES_CHANGE, 0, 0); @@ -1468,7 +1468,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = UINT type = MyGetDriveType(panel->GetPath()); if (type == DRIVE_CDROM || type == DRIVE_REMOVABLE) { - HANDLES(EnterCriticalSection(&TimeCounterSection)); // capture the time when a refresh is needed + HANDLES(EnterCriticalSection(&TimeCounterSection)); // capture the time when the refresh is needed int t1 = MyTimeCounter++; HANDLES(LeaveCriticalSection(&TimeCounterSection)); PostMessage(panel->HWindow, WM_USER_REFRESH_DIR, 0, t1); @@ -1484,8 +1484,8 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = case WM_USER_PROCESSDELETEMAN: { - // delay data processing due to the main window activation after ESC from the viewer on WinXP; - // without this hack, it somehow did not catch up - the main window stayed inactive and the safe-wait window never appeared + // delay data processing because the main window is activated after pressing Esc in the viewer on WinXP + // without this hack, the timing was too tight: the main window stayed inactive, so the safe-wait window was not shown if (!SetTimer(HWindow, IDT_DELETEMNGR_PROCESS, 200, NULL)) DeleteManager.ProcessData(); // if the timer fails, run immediately; forget about WinXP return 0; @@ -1582,9 +1582,9 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = UserMenuIconBkgndReader.BeginUserMenuIconsInUse(); CMenuPopup menu; FillUserMenu(&menu); - // another lock/unlock cycle (BeginUserMenuIconsInUse + EndUserMenuIconsInUse) + // another lock cycle (BeginUserMenuIconsInUse + EndUserMenuIconsInUse) // will occur in WM_USER_ENTERMENULOOP + WM_USER_LEAVEMENULOOP, but - // it is nested and lightweight, so we ignore it and do not fight it + // it is nested and has no overhead, so we ignore it menu.Track(0, r.left, r.bottom, HWindow, &r); UserMenuIconBkgndReader.EndUserMenuIconsInUse(); break; @@ -1680,9 +1680,9 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = iterator++; CMenuPopup menu; FillUserMenu2(&menu, &iterator, endIndex); - // another lock/unlock cycle (BeginUserMenuIconsInUse + EndUserMenuIconsInUse) + // Another lock/unlock cycle (BeginUserMenuIconsInUse + EndUserMenuIconsInUse) // will occur in WM_USER_ENTERMENULOOP + WM_USER_LEAVEMENULOOP, - // but it is nested and lightweight, so we ignore it + // but it is already nested and has no overhead, so we ignore it menu.Track(0, r.left, r.bottom, HWindow, &r); UserMenuIconBkgndReader.EndUserMenuIconsInUse(); } @@ -1728,12 +1728,12 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = { SalamanderBusy = TRUE; // now BUSY LastSalamanderIdleTime = GetTickCount(); - BringWindowToTop(HWindow); // probably not important, but I saw it in a sample so I am adding it here too + BringWindowToTop(HWindow); // probably not important, but it appears in one sample, so add it here too if (IsIconic(HWindow)) { - // SetForegroundWindow: this is crucial. If we don't call it and - // "only one instance" with the tray is active, Salamander sometimes - // appears in the background and only later moves to the front. + // SetForegroundWindow: this is very important. If we do not call it and + // "only one instance" with the tray is enabled, Salamander sometimes + // appears in the background and only later comes to the foreground. SetForegroundWindow(HWindow); ShowWindow(HWindow, SW_RESTORE); } @@ -1771,7 +1771,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = GetCurrentProcess(), &fm, // this process file-mapping 0, FALSE, DUPLICATE_SAME_ACCESS))) { - CSetPathsParams *unsafe = (CSetPathsParams *)HANDLES(MapViewOfFile(fm, FILE_MAP_WRITE, 0, 0, sizeof(CSetPathsParams))); // FIXME_X64 are we passing x86/x64 incompatible data? + CSetPathsParams *unsafe = (CSetPathsParams *)HANDLES(MapViewOfFile(fm, FILE_MAP_WRITE, 0, 0, sizeof(CSetPathsParams))); // FIXME_X64: are x86/x64-incompatible data being passed here? if (unsafe != NULL) { alreadyDone = unsafe->Received; @@ -1782,12 +1782,12 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = if (unsafe->MagicSignature1 == 0x07f2ab13 && unsafe->MagicSignature2 == 0x471e0901) { - // new features since 2.52 - // WORD version = unsafe->StructVersion; // not used yet, the first version is recognized by the presence of signatures + // changes since 2.52 + // WORD version = unsafe->StructVersion; // not used yet, the first version is recognized by the presence of the signatures lstrcpyn(params.ActivePath, unsafe->ActivePath, MAX_PATH); params.ActivatePanel = unsafe->ActivatePanel; } - // we return the result value having taken over the data + // return confirmation that the data were accepted unsafe->Received = TRUE; } HANDLES(UnmapViewOfFile(unsafe)); @@ -1818,9 +1818,9 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = if (IsWindow(hCaller)) { // If the window that invoked us still exists, try to bring it to - // the foreground. This is a bit dirty because if it opens a modal - // dialog in the meantime, it won't get activation. But I don't care, - // the viewer will (hopefully) end up inside Salamander - in the plugin ;-) + // the foreground. This is a bit of a hack, because if it opens a modal + // dialog in the meantime, it will not receive activation. That is acceptable, + // because the viewer will hopefully end up in Salamander, that is, in the plugin. SetForegroundWindow(hCaller); } return 0; @@ -1842,7 +1842,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = UserMenuIconBkgndReader.ResetSysColorsChanged(); // now, we start watching system color changes (icon reload required) BOOL readingUMIcons = UserMenuIconBkgndReader.IsReadingIcons(); - if (readingUMIcons) // new icons are on their way to the user menu; show them after configuration is done (on OK reload icons again so newly added ones are read as well) + if (readingUMIcons) // new icons are being loaded for the user menu; show them only after the configuration is finished (on OK, reload the icons so any newly added ones are loaded too) UserMenuIconBkgndReader.BeginUserMenuIconsInUse(); BOOL oldUseCustomPanelFont = UseCustomPanelFont; LOGFONT oldLogFont = LogFont; @@ -1856,7 +1856,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = IdleRefreshStates = TRUE; // force status variable check on next Idle IdleCheckClipboard = TRUE; // also check the clipboard - if (res == IDOK) // values changed -> refresh everything possible + if (res == IDOK) // values changed -> refresh as much as possible { if (dlg.PageView.IsDirty()) { @@ -1944,10 +1944,10 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = if (HasLockedUI()) break; - // if the user pressed the Alt button while the initial splash window was shown, - // the system menu could be entered before MainWindow appeared and the splash + // if the user pressed Alt while the initial splash window was displayed, + // the system menu of the not-yet-visible MainWindow could be entered and the splash // window remained open until the user pressed Escape - // if MainWindow is not yet visible, disable entering the Window menu + // if MainWindow is not yet visible, disable access to the Window menu if (wParam == SC_KEYMENU && !IsWindowVisible(HWindow)) return 0; @@ -2147,7 +2147,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = if (LOWORD(wParam) >= CM_PLUGINCMD_MIN && LOWORD(wParam) <= CM_PLUGINCMD_MAX) { // command from a plugin menu - // lower the thread priority to "normal" (so operations don't burden the system) + // lower the thread priority to "normal" (so operations do not burden the system) SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_NORMAL); if (Plugins.ExecuteMenuItem(activePanel, HWindow, LOWORD(wParam))) @@ -2344,7 +2344,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = int tgtSelCount = inactivePanel->Is(ptDisk) ? inactivePanel->GetSelItems(2, tgtIndexes) : 0; // interested in: 0-1=number selected, 2=more than one if (selCount == 2) // two selected items in the source panel { - if ((indexes[0] < activePanel->Dirs->Count) == (indexes[1] < activePanel->Dirs->Count)) // both items are files/directories + if ((indexes[0] < activePanel->Dirs->Count) == (indexes[1] < activePanel->Dirs->Count)) // both items are either files or directories { f1 = (indexes[0] < activePanel->Dirs->Count) ? &activePanel->Dirs->At(indexes[0]) : &activePanel->Files->At(indexes[0] - activePanel->Dirs->Count); f2 = (indexes[1] < activePanel->Dirs->Count) ? &activePanel->Dirs->At(indexes[1]) : &activePanel->Files->At(indexes[1] - activePanel->Dirs->Count); @@ -2359,7 +2359,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = userMenuAdvancedData.CompareNamesAreDirs = (indexes[0] < activePanel->Dirs->Count); if (!focusOnUpDir && focus != indexes[0] && tgtSelCount != 1) { - if ((focus < activePanel->Dirs->Count) == userMenuAdvancedData.CompareNamesAreDirs) // both items are files/directories + if ((focus < activePanel->Dirs->Count) == userMenuAdvancedData.CompareNamesAreDirs) // both items are of the same type: either files or directories { f2 = (focus < activePanel->Dirs->Count) ? &activePanel->Dirs->At(focus) : &activePanel->Files->At(focus - activePanel->Dirs->Count); } @@ -2367,7 +2367,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = } else { - if (selCount == 0) // no selected item in the source panel, take the focus + if (selCount == 0) // no item is selected in the source panel, use the focused item { if (!focusOnUpDir) { @@ -3057,7 +3057,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = { ChangePanel(); if (GetActivePanel() != RightPanel) - return 0; // the panel cannot be activated + return 0; // the panel could not be activated UpdateWindow(HWindow); // render the focus before the menu appears } if (RightPanel->DirectoryLine != NULL) @@ -3297,7 +3297,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = char temporarySelected[MAX_PATH]; activePanel->SelectFocusedItemAndGetName(temporarySelected, MAX_PATH); - if (activePanel->Is(ptDisk)) // source is disk - all operations go here + if (activePanel->Is(ptDisk)) // source is a disk; all operations go through here { CActionType type; switch (LOWORD(wParam)) @@ -3324,7 +3324,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = } else { - if (activePanel->Is(ptZIPArchive)) // source is an archive - all operations go here + if (activePanel->Is(ptZIPArchive)) // source is an archive; all operations are handled here { BOOL archMaybeUpdated; activePanel->OfferArchiveUpdateIfNeeded(HWindow, IDS_ARCHIVECLOSEEDIT2, &archMaybeUpdated); @@ -3346,7 +3346,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = } else { - if (activePanel->Is(ptPluginFS)) // source is a FS - all operations go here + if (activePanel->Is(ptPluginFS)) // source is FS - all operations are routed here { CPluginFSActionType type; switch (LOWORD(wParam)) @@ -3613,7 +3613,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = case CM_FINDFILE: { - if (activePanel->Is(ptDisk)) // does Find relate to the current path? (archives and FS not yet) + if (activePanel->Is(ptDisk)) // does Find apply to the current path? (not yet for archives and file systems) { activePanel->UserWorkedOnThisPath = TRUE; } @@ -3902,9 +3902,9 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = FillUserMenu(&menu); POINT p; activePanel->GetContextMenuPos(&p); - // another lock/unlock cycle (BeginUserMenuIconsInUse + EndUserMenuIconsInUse) will occur - // in WM_USER_ENTERMENULOOP + WM_USER_LEAVEMENULOOP, but it is nested and lightweight, - // so we ignore it and do not fight it + // Another lock/unlock cycle (BeginUserMenuIconsInUse + EndUserMenuIconsInUse) + // will occur in WM_USER_ENTERMENULOOP + WM_USER_LEAVEMENULOOP, + // but it is already nested and has no overhead, so we ignore it menu.Track(0, p.x, p.y, HWindow, NULL); UserMenuIconBkgndReader.EndUserMenuIconsInUse(); @@ -3965,7 +3965,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = } else { - if (EditPermanentVisible || EditWindow->IsEnabled()) // there may be an archive in the panel + if (EditPermanentVisible || EditWindow->IsEnabled()) // the panel may contain an archive ShowCommandLine(); } return 0; @@ -4426,7 +4426,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = SendMessage(LeftPanel->HWindow, WM_USER_REFRESH_DIR, 0, t1); SendMessage(RightPanel->HWindow, WM_USER_REFRESH_DIR, 0, t2); - // distribute this news among plug-ins as well + // distribute this news among plugins as well Plugins.Event(PLUGINEVENT_CONFIGURATIONCHANGED, 0); return 0; } @@ -4490,7 +4490,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = case WM_USER_DISPACHCHANGENOTIF: { - if (LastDispachChangeNotifTime < lParam) // not an outdated message + if (LastDispachChangeNotifTime < lParam) // not an old message { if (AlreadyInPlugin || StopRefresh > 0) NeedToResentDispachChangeNotif = TRUE; @@ -4518,7 +4518,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = } else ok = FALSE; - if (!ok) // store the time of the last refresh (still in the critical section) + if (!ok) // store the time of the last dispatch attempt (still in the critical section) { HANDLES(EnterCriticalSection(&TimeCounterSection)); LastDispachChangeNotifTime = MyTimeCounter++; @@ -4526,9 +4526,9 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = } HANDLES(LeaveCriticalSection(&DispachChangeNotifCS)); - if (ok) // distribute a notification about the change on 'path' with 'includingSubdirs' + if (ok) // dispatch a change notification for 'path' with 'includingSubdirs' { - // send the message to all loaded plugins + // dispatch the notification to all loaded plugins Plugins.AcceptChangeOnPathNotification(path, includingSubdirs); if (GetNonActivePanel() != NULL) // non-active panel first (due to timestamps of subdirectory changes on NTFS) @@ -4542,8 +4542,8 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = if (DetachedFSList->Count > 0) { - // for better input/output optimization with plugins, the EnterPlugin/LeavePlugin section - // is exported here (not inside the interface encapsulation) + // to optimize plugin entry/exit, the EnterPlugin/LeavePlugin section + // is moved out here (it is not inside the interface encapsulation) EnterPlugin(); int i; for (i = 0; i < DetachedFSList->Count; i++) @@ -4691,7 +4691,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = popup->SetHotImageList(NULL); // just to be safe, so the popup doesn't own an invalid handle ImageList_Destroy(hIcons); } - if (popupID == CML_PLUGINS) // closing the Plugins menu; dynamic icons can be freed (they are rebuilt before each next menu opening) + if (popupID == CML_PLUGINS) // closing the Plugins menu; the dynamic icons can be freed (they are rebuilt before each subsequent menu opening) Plugins.ReleasePluginDynMenuIcons(); break; } @@ -5200,7 +5200,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = r2.right = r.right; DrawSplitLine(HWindow, -1, DragSplitX, r2); SendMessage(ToolTipWindow.HWindow, TTM_ACTIVATE, FALSE, 0); - DestroyWindow(ToolTipWindow.HWindow); // just detaches the tooltip from the control + DestroyWindow(ToolTipWindow.HWindow); // destroys the tooltip window if (uMsg == WM_LBUTTONUP) { // accept the position only when the drag finishes legally @@ -5599,7 +5599,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = CALL_STACK_MESSAGE4("CPluginInterfaceForMenuExt::ExecuteMenuItem(, , %d,) (%s v. %s)", (int)lParam, data->DLLName, data->Version); - // lower the thread priority to "normal" (so operations don't burden the system) + // lower the thread priority to "normal" (so the operation does not put too much load on the machine) SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_NORMAL); data->GetPluginInterfaceForMenuExt()->ExecuteMenuItem(NULL, HWindow, (int)lParam, 0); @@ -5782,7 +5782,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = MSG msg; CanCloseButInEndSuspendMode = CanClose; BOOL oldCanClose = CanClose; - CanClose = FALSE; // don't let ourselves be closed; we are inside the method + CanClose = FALSE; // do not allow closing while inside this method BOOL postWM_USER_CLOSE_MAINWND = FALSE; BOOL postWM_USER_FORCECLOSE_MAINWND = FALSE; while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) @@ -5954,7 +5954,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = // if (IsWindowVisible(HWindow)) // now handled by FirstActivateApp // { - if (wParam == TRUE) // activating the app + if (wParam == TRUE) // app activation { if (!LeftPanel->DontClearNextFocusName) LeftPanel->NextFocusName[0] = 0; @@ -6171,7 +6171,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = if (uMsg == WM_QUERYENDSESSION && (lParam & ENDSESSION_CRITICAL) != 0) endAfterCleanup = TRUE; // cannot be refused -> perform minimal cleanup else - return 0; // refuse close/shutdown/logoff; a forced shutdown will be detected in WM_ENDSESSION + return 0; // reject close/shutdown/logoff; detect any forced shutdown only in WM_ENDSESSION } } @@ -6205,7 +6205,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = TRACE_E("WM_USER_CLOSE_MAINWND: SalamanderBusy == TRUE!"); if (uMsg == WM_QUERYENDSESSION) TRACE_I("WM_QUERYENDSESSION: cancelling shutdown: SalamanderBusy is TRUE"); - return 0; // refuse close/shutdown/logoff; a forced shutdown will be detected in WM_ENDSESSION + return 0; // Reject close/shutdown/logoff; detect any forced shutdown in WM_ENDSESSION } } } @@ -6266,7 +6266,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = if (uMsg == WM_QUERYENDSESSION) TRACE_I("WM_QUERYENDSESSION: cancelling shutdown: user rejects to close all disk operation progress dialogs"); // the user does not want to exit yet - return 0; // refuse closing/shutdown/logoff; any "forced shutdown" will be detected later in WM_ENDSESSION + return 0; // refuse close/shutdown/logoff; any "forced shutdown" will be detected later in WM_ENDSESSION } UpdateWindow(HWindow); } @@ -6283,7 +6283,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = GetTickCount() - msgArrivalTime <= QUERYENDSESSION_TIMEOUT - 200) Sleep(200); WaitInEndSession = TRUE; - return TRUE; // continue to WM_ENDSESSION where we will either finish or be killed while waiting + return TRUE; // proceed to WM_ENDSESSION, where we either finish or get killed if we wait any longer } int i = 0; @@ -6329,11 +6329,11 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = if (findDlg != NULL) // if the window still exists, we send it a close query (otherwise it is pointless) { BOOL myPost = findDlg->StateOfFindCloseQuery == sofcqNotUsed; - if (myPost) // if this is not nesting (maybe possible, not verified but unlikely) + if (myPost) // if this is not a nested call (probably possible, not investigated, but unlikely) { findDlg->StateOfFindCloseQuery = sofcqSentToFind; PostMessage(destroyArray[i], WM_USER_QUERYCLOSEFIND, 0, - uMsg == WM_QUERYENDSESSION && (lParam & ENDSESSION_CRITICAL) != 0); // during critical shutdown we don't ask, we just cancel + uMsg == WM_QUERYENDSESSION && (lParam & ENDSESSION_CRITICAL) != 0); // during critical shutdown, do not ask and cancel immediately } BOOL cont = TRUE; while (cont) @@ -6406,7 +6406,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = // window size and a few other minor things won't be saved, but we ignore that) // note: the !endAfterCleanup check here is unnecessary because outside critical shutdown // endAfterCleanup is always FALSE - if (uMsg != WM_QUERYENDSESSION || (lParam & ENDSESSION_CRITICAL) == 0) // mimo criticky shutdown + if (uMsg != WM_QUERYENDSESSION || (lParam & ENDSESSION_CRITICAL) == 0) // except during critical shutdown { for (i = 0; i < destroyArray.Count; i++) { @@ -6456,7 +6456,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = Sleep(200); WaitInEndSession = TRUE; - return TRUE; // continue to WM_ENDSESSION where we finish or are killed if we wait longer + return TRUE; // Proceed to WM_ENDSESSION, where we finish or are terminated if we wait longer. } if (uMsg == WM_QUERYENDSESSION && (lParam & ENDSESSION_CRITICAL) != 0) // this applies to Vista+ @@ -6483,7 +6483,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = } BOOL backupOK = FALSE; - if (cfgOK) // old configuration seems OK; back it up in case saving the new configuration fails + if (cfgOK) // the old configuration seems OK; back it up in case saving the configuration fails { char backup[200]; sprintf_s(backup, "%s.backup.63A7CD13", SALAMANDER_ROOT_REG); // "63A7CD13" prevents the key name from matching a user key @@ -6514,14 +6514,14 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = GetTickCount() - msgArrivalTime <= QUERYENDSESSION_TIMEOUT - 200) Sleep(200); - if (backupOK) // backup done, configuration will be saved in WM_ENDSESSION, - SaveCfgInEndSession = TRUE; // if we get killed during it, the configuration will load from the backup + if (backupOK) // backup is ready; the configuration will be saved in WM_ENDSESSION, + SaveCfgInEndSession = TRUE; // if we are killed during this, the configuration will be loaded from the backup else { // EndStopRefresh(); // during critical shutdown we don't end stop-refresh (refreshes are sent to panels) WaitInEndSession = TRUE; // backup failed, we won't risk saving the configuration } - return TRUE; // we want 5s in WM_ENDSESSION, so return TRUE + return TRUE; // we want 5 seconds in WM_ENDSESSION, so return TRUE } if ((uMsg == WM_QUERYENDSESSION || uMsg == WM_ENDSESSION) && HLanguage != NULL && @@ -6534,7 +6534,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = CWaitWindow analysing(HWindow, IDS_SAVINGCONFIGURATION, FALSE, ooStatic, TRUE); HWND oldPluginMsgBoxParent = PluginMsgBoxParent; BOOL shutdown = uMsg == WM_QUERYENDSESSION || uMsg == WM_ENDSESSION; - if (shutdown) // during shutdown/log-off/restart show a wait window for all Saves (including plugins) and process the message loop (so we aren't marked as "not responding" and killed early) + if (shutdown) // During shutdown/logoff/restart, show a wait window for all save operations (including plugins) and process the message loop so we are not marked as "not responding" and terminated prematurely. { // start a thread that will handle registry work while saving the configuration; // meanwhile this (main) thread will pump messages in the message loop @@ -6580,7 +6580,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = if (uMsg == WM_QUERYENDSESSION || uMsg == WM_ENDSESSION) MyShutdownBlockReasonDestroy(HWindow); - if (uMsg != WM_ENDSESSION) // during critical shutdown we don't end stop-refresh (refreshes are sent to the panels) + if (uMsg != WM_ENDSESSION) // During a critical shutdown, do not end stop-refresh; refreshes are being dispatched to the panels. { EndStopRefresh(); return 0; // refuse close/shutdown/logoff; any "forced shutdown" will be detected in WM_ENDSESSION @@ -6602,7 +6602,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = reason + (int)strlen(reason), BUG_REPORT_REASON_MAX - ((int)strlen(reason) + 1)) > 0) { // ask whether Salamander should continue or generate a bug report - if (CriticalShutdown || // during critical shutdown there's no point in asking anything, let the system terminate us quietly + if (CriticalShutdown || // during a critical shutdown, do not prompt; allow the system to terminate us SalMessageBox(shutdown ? analysing.HWindow : HWindow, LoadStr(IDS_SHELLEXTBREAK3), SALAMANDER_TEXT_VERSION, MSGBOXEX_CONTINUEABORT | MB_ICONINFORMATION) != IDABORT) @@ -6627,7 +6627,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = { BOOL canClose = FALSE; BOOL detachFS1, detachFS2; - if (LeftPanel->PrepareCloseCurrentPath(shutdown ? analysing.HWindow : LeftPanel->HWindow, TRUE, FALSE, detachFS1, FSTRYCLOSE_UNLOADCLOSEFS /* unnecessary - plugins (including FS) already unloaded */)) + if (LeftPanel->PrepareCloseCurrentPath(shutdown ? analysing.HWindow : LeftPanel->HWindow, TRUE, FALSE, detachFS1, FSTRYCLOSE_UNLOADCLOSEFS /* unnecessary - plugins (including FS) are already unloaded */)) { if (RightPanel->PrepareCloseCurrentPath(shutdown ? analysing.HWindow : RightPanel->HWindow, TRUE, FALSE, detachFS2, FSTRYCLOSE_UNLOADCLOSEFS /* unnecessary - plugins (including FS) already unloaded */)) { @@ -6636,7 +6636,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = RightPanel->SleepIconCacheThread(); RightPanel->CloseCurrentPath(shutdown ? analysing.HWindow : RightPanel->HWindow, FALSE, detachFS2, FALSE, FALSE, TRUE); // close the right panel - // protect the list box from errors caused by redraw requests (we just cut its data) + // protect the list box against errors caused by redraw requests (we just cut off its data) RightPanel->ListBox->SetItemsCount(0, 0, 0, TRUE); RightPanel->SelectedCount = 0; // If WM_USER_UPDATEPANEL is delivered, the panel contents are redrawn @@ -6651,7 +6651,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = LeftPanel->SleepIconCacheThread(); LeftPanel->CloseCurrentPath(shutdown ? analysing.HWindow : LeftPanel->HWindow, FALSE, detachFS1, FALSE, FALSE, TRUE); // close the left panel - // Protect the list box from errors caused by redraw requests (after we just cut the data) + // Protect the list box from errors caused by redraw requests (we have just cut off its data) LeftPanel->ListBox->SetItemsCount(0, 0, 0, TRUE); LeftPanel->SelectedCount = 0; // If WM_USER_UPDATEPANEL is delivered, the panel contents are redrawn @@ -6710,7 +6710,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = DiskCache.PrepareForShutdown(); // clean any empty tmp directories from disk // if (TipOfTheDayDialog != NULL) - // DestroyWindow(TipOfTheDayDialog->HWindow); // the dialog already saved its data (transfer happens there at runtime) + // DestroyWindow(TipOfTheDayDialog->HWindow); // the dialog has already saved its data (transfer happens there at runtime) MainWindowCS.SetClosed(); @@ -6815,7 +6815,7 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = // some crazy shell extension has just called DestroyWindow on Salamander's main window MSG msg; // flush the message queue (WMP9 buffered Enter and dismissed our OK) - // while (PeekMessage(&msg, HWindow, 0, 0, PM_REMOVE)); // Petr: I replaced it by discarding key messages only; without TranslateMessage and DispatchMessage we risk an endless loop (discovered during unloading Automation with memory leaks; before showing the leak message box, an infinite loop occurred because WM_PAINT kept being added to the queue and we kept discarding it) + // while (PeekMessage(&msg, HWindow, 0, 0, PM_REMOVE)); // Petr: replaced this with discarding only keyboard messages; without TranslateMessage and DispatchMessage, an infinite loop can occur (found while unloading Automation with memory leaks; before displaying the leak message box, WM_PAINT kept being added to the queue and we kept discarding it) while (PeekMessage(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE)) ; @@ -6947,15 +6947,15 @@ MENU_TEMPLATE_ITEM AddToSystemMenu[] = } if (uMouseMsg == WM_RBUTTONDOWN) { - /* used by the export_mnu.py script which generates salmenu.mnu for the Translator; + /* used by the export_mnu.py script, which generates salmenu.mnu for Translator; keep synchronized with the InsertMenu() call below... -MENU_TEMPLATE_ITEM TaskBarIconMenu[] = -{ - {MNTT_PB, 0 - {MNTT_IT, IDS_CONTEXTMENU_EXIT - {MNTT_PE, 0 -}; -*/ + MENU_TEMPLATE_ITEM TaskBarIconMenu[] = + { + {MNTT_PB, 0 + {MNTT_IT, IDS_CONTEXTMENU_EXIT + {MNTT_PE, 0 + }; + */ HMENU hMenu = CreatePopupMenu(); InsertMenu(hMenu, 0, MF_BYPOSITION | MF_STRING, CM_EXIT, LoadStr(IDS_CONTEXTMENU_EXIT)); @@ -6997,7 +6997,7 @@ MENU_TEMPLATE_ITEM TaskBarIconMenu[] = int count = activePanel->GetSelCount(); if (count != 0) { - // determine the index of the nth (index) selected item + // get the index of the nth selected item int totalCount = activePanel->Dirs->Count + activePanel->Files->Count; if (totalCount == 0 || index >= totalCount) return 0; From c686573953eb0501dc65c3907f139136083c904b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:44:52 +0200 Subject: [PATCH 464/710] [translation] Fix src/pack1.cpp comments Refines translated comments in src/pack1.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #903 for src/pack1.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/pack1.cpp | 53 +++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/src/pack1.cpp b/src/pack1.cpp index 8a4c334f2..5748d3375 100644 --- a/src/pack1.cpp +++ b/src/pack1.cpp @@ -19,8 +19,7 @@ // // Pointer to the error handling function -BOOL(*PackErrorHandlerPtr) -(HWND parent, const WORD errNum, ...) = EmptyErrorHandler; +BOOL (*PackErrorHandlerPtr)(HWND parent, const WORD errNum, ...) = EmptyErrorHandler; const char* SPAWN_EXE_NAME = "salspawn.exe"; const char* SPAWN_EXE_PARAMS = "-c10000"; @@ -152,7 +151,7 @@ const SPackBrowseTable PackBrowseTable[] = char* PackGetField(char* buffer, const int index, const int nameidx, const char separator) { CALL_STACK_MESSAGE5("PackGetField(%s, %d, %d, %u)", buffer, index, nameidx, separator); - // the requested item does not exist for the given archiver program + // the requested item does not exist for the given archiver if (index == 0) return NULL; @@ -170,7 +169,7 @@ char* PackGetField(char* buffer, const int index, const int nameidx, const char { // skip the item if (i == nameidx) - // if we are on the name, only a newline is a separator + // for the name field, only a newline is a separator while (*buffer != '\0' && *buffer != '\n') buffer++; else @@ -180,13 +179,13 @@ char* PackGetField(char* buffer, const int index, const int nameidx, const char *buffer != separator) buffer++; - // skip the spaces behind it + // skip the spaces after it while (*buffer != '\0' && (*buffer == ' ' || *buffer == '\t' || *buffer == '\n' || *buffer == 0x10 || *buffer == 0x11 || *buffer == separator)) buffer++; - // we are on the next item + // now at the next item i++; } return buffer; @@ -364,7 +363,7 @@ BOOL PackScanLine(char* buffer, CSalamanderDirectory& dir, const int index, t.wYear += 2000; } - // ted cas + // time idx = configTable->TimeIdx; if (ARJHack) idx--; @@ -575,8 +574,8 @@ BOOL PackScanLine(char* buffer, CSalamanderDirectory& dir, const int index, // IN: panel is Salamander's file panel // archiveFileName is the name of the archive file to be listed // OUT: dir is filled with archive data -// pluginData is the interface to column data defined by the archiver plug-in -// plugin is the plug-in record that performed ListArchive +// pluginData is the interface to column data defined by the archiver plugin +// plugin is the plugin record that performed ListArchive BOOL PackList(CFilesWindow* panel, const char* archiveFileName, CSalamanderDirectory& dir, CPluginDataInterfaceAbstract*& pluginData, CPluginData*& plugin) @@ -717,7 +716,7 @@ BOOL PackList(CFilesWindow* panel, const char* archiveFileName, CSalamanderDirec return (*PackErrorHandlerPtr)(NULL, IDS_PACKERR_PROCESS, SpawnExe, GetErrorText(err)); } - // We no longer need these handles; the child will close the duplicates, we keep only StdOutRd + // These handles are no longer needed; the child closes the duplicates, and we keep only StdOutRd HANDLES(CloseHandle(StdOutWr)); HANDLES(CloseHandle(StdErrWr)); @@ -872,7 +871,7 @@ BOOL PackList(CFilesWindow* panel, const char* archiveFileName, CSalamanderDirec // a few local variables char* line = NULL; // buffer for building a "multi-line line" int lines = 0; // how many lines of the multi-line item we have read - int validData = 0; // whether we read header/footer or valid data + int validData = 0; // whether we are reading header/footer data or valid data int toSkip = browseTable->LinesToSkip; int alwaysSkip = browseTable->AlwaysSkip; int linesPerFile = browseTable->LinesPerFile; @@ -886,7 +885,7 @@ BOOL PackList(CFilesWindow* panel, const char* archiveFileName, CSalamanderDirec switch (validData) { case 0: // we are in the header - // determine whether we stay in it + // determine whether we stay in the header if (!strncmp(lineArray[i], browseTable->StartString, strlen(browseTable->StartString))) validData++; @@ -977,13 +976,13 @@ BOOL PackList(CFilesWindow* panel, const char* archiveFileName, CSalamanderDirec free(line); line = NULL; if (!ret) - return FALSE; // no need to call the error function, PackScanLine already did the call + return FALSE; // no need to call the error function; PackScanLine already called it // initialize variables lines = 0; } - // if we ended somewhere else than in the footer, we have a problem + // if we ended up anywhere other than in the footer, we have a problem if (validData < 2) return (*PackErrorHandlerPtr)(NULL, IDS_PACKERR_PARSE); @@ -1036,7 +1035,7 @@ BOOL PackUC2List(const char* archiveFileName, CPackLineArray& lineArray, if (!strncmp(txtPtr, "END", 3)) break; - // if the item is LIST, we determine which directory we are in + // if the item is LIST, determine which directory we are in if (!strncmp(txtPtr, "LIST", 4)) { // run to the start of the name @@ -1067,7 +1066,7 @@ BOOL PackUC2List(const char* archiveFileName, CPackLineArray& lineArray, continue; } - // if the item is FILE/DIR, we create a file/directory + // if the item is FILE/DIR, we create a file or directory if (!strncmp(txtPtr, "DIR", 3) || !strncmp(txtPtr, "FILE", 4)) { // what is it, a file or a directory? @@ -1090,8 +1089,8 @@ BOOL PackUC2List(const char* archiveFileName, CPackLineArray& lineArray, newfile.DosName = NULL; newfile.PluginData = -1; // just -1, ignored - // main parsing loop of a file/directory - // ends once we hit an unknown keyword + // the main file/directory parsing loop + // ends as soon as we encounter an unknown keyword while (1) { // prepare the next line @@ -1294,7 +1293,7 @@ BOOL PackUC2List(const char* archiveFileName, CPackLineArray& lineArray, free(newfile.Name); return (*PackErrorHandlerPtr)(NULL, IDS_PACKERR_GENERAL, buffer); } - // and finally just create a new object + // and finally just create a new file object newfile.IsOffline = 0; if (isDir) { @@ -1677,7 +1676,7 @@ const char* WINAPI PackEnumMask(HWND parent, int enumFiles, BOOL* isDir, CQuadWo if (fileData != NULL) *fileData = NULL; - // if there are no more masks return NULL - finished + // if there are no more masks, return NULL - end if (param == NULL || *(char**)param == NULL) return NULL; @@ -1756,16 +1755,16 @@ const char* WINAPI PackEnumMask(HWND parent, int enumFiles, BOOL* isDir, CQuadWo // Function for extracting a single file from an archive (for the viewer). // // RET: returns TRUE on success, FALSE on error -// on error the callback function *PackErrorHandlerPtr is called +// on error, calls the callback function *PackErrorHandlerPtr // IN: panel is the Salamander file panel -// archiveFileName is the name of the archive from which we extract -// nameInArchive is the name of the file we extract +// archiveFileName is the name of the archive from which the file is extracted +// nameInArchive is the name of the file to extract // fileData is a pointer to the CFileData structure of the extracted file // targetDir is the path where the file should be extracted -// newFileName (if not NULL) is the new name of the extracted file (during extraction, the file -// must be renamed from its original name to this new one) -// renamingNotSupported (only if newFileName is not NULL) - set TRUE if the plugin -// does not support renaming during extraction, Salamander will show an error +// newFileName (if not NULL) is the new name of the extracted file (during extraction, +// the file must be renamed from its original name to this new name) +// renamingNotSupported (only if newFileName is not NULL) - set to TRUE if the plugin +// does not support renaming during extraction; Salamander will display an error message // OUT: BOOL PackUnpackOneFile(CFilesWindow* panel, const char* archiveFileName, From 356ab402aa2c013b41ef9f36836974e05c7d271f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:45:02 +0200 Subject: [PATCH 465/710] [translation] Fix src/plugins.h comments Refines translated comments in src/plugins.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #908 for src/plugins.h, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/plugins.h | 96 +++++++++++++++++++++++++-------------------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/src/plugins.h b/src/plugins.h index bb609229e..516e7dab0 100644 --- a/src/plugins.h +++ b/src/plugins.h @@ -138,7 +138,7 @@ class CPluginInterfaceForArchiverEncapsulation } // ******************************************************************************** - // WARNING: lower thread priority before executing plug-in operations! + // WARNING: lower thread priority before executing plugin operations! // ******************************************************************************** }; @@ -301,23 +301,23 @@ class CPluginInterfaceForFSEncapsulation // called right after ChangeDriveMenuItemContextMenu -- the plugin is definitely loaded void ExecuteChangeDrivePostCommand(int panel, int postCmd, void* postCmdParam); - // direct interface call (does not go through CPluginData + InitDLL), call-stack-message is created; + // direct interface call (does not go through CPluginData + InitDLL), call-stack message is created; // called only when 'pluginFS' is in a panel - the plugin is definitely loaded void ExecuteOnFS(int panel, CPluginFSInterfaceAbstract* pluginFS, const char* pluginFSName, int pluginFSNameIndex, CFileData& file, int isDir); - // direct interface call (does not go through CPluginData + InitDLL), call-stack-message is created; + // direct interface call (does not go through CPluginData + InitDLL), call-stack message is created; // called only when 'pluginFS' exists (either in a panel or detached) - the plugin is definitely loaded BOOL DisconnectFS(HWND parent, BOOL isInPanel, int panel, CPluginFSInterfaceAbstract* pluginFS, const char* pluginFSName, int pluginFSNameIndex); - // direct interface call (does not go through CPluginData + InitDLL), call-stack-message is created; + // direct interface call (does not go through CPluginData + InitDLL), call-stack message is created; // called only when the plugin is loaded (its FS is open) void ConvertPathToInternal(const char* fsName, int fsNameIndex, char* fsUserPart); - // direct interface call (does not go through CPluginData + InitDLL), call-stack-message is created; + // direct interface call (does not go through CPluginData + InitDLL), call-stack message is created; // called only when the plugin is loaded (its FS is open) void ConvertPathToExternal(const char* fsName, int fsNameIndex, char* fsUserPart); @@ -990,10 +990,10 @@ class CPluginFSInterfaceEncapsulation // returns a reference to the string from the CPluginData of the plugin that created this interface const char* GetVersion() { return Version; } - // returns the plug-in interface that created the FS interface (FS part) + // returns the plugin interface that created the FS interface (FS part) CPluginInterfaceForFSEncapsulation* GetPluginInterfaceForFS() { return &IfaceForFS; } - // returns the plug-in interface that created the FS interface (base class) + // returns the plugin interface that created the FS interface (base class) CPluginInterfaceAbstract* GetPluginInterface() { return Iface; } // returns the name of the opened FS @@ -1362,7 +1362,7 @@ class CPluginFSInterfaceEncapsulation LoadStr(IDS_ERRORTITLE), MB_OK | MB_ICONEXCLAMATION); if (invalidPathOrCancel != NULL) *invalidPathOrCancel = TRUE; - return FALSE; // let the user fix the target path (copy/move to this path is not supported) + return FALSE; // let the user fix the target path (copying/moving to this path is not supported) } } } @@ -1853,7 +1853,7 @@ class CSalamanderPasswordManager : public CSalamanderPasswordManagerAbstract class CSalamanderGeneral : public CSalamanderGeneralAbstract { protected: - CPluginInterfaceAbstract* Plugin; // plug-in used by this iface; !!! note: may be NULL + CPluginInterfaceAbstract* Plugin; // plugin used by this iface; !!! note: may be NULL // (plugin not loaded) or -1 (during the plugin's entry point) char HelpFileName[MAX_PATH]; // if not empty, this is the name (without path) of the .chm help file used by this plugin (optimization only, not stored anywhere) @@ -2362,7 +2362,7 @@ struct CPluginMenuItem DWORD StateMask; // hiword is an OR mask, loword is an AND mask; if it is -1, // CPluginInterfaceAbstract::GetMenuItemState is used DWORD SkillLevel; // which user levels should see this item MENU_SKILLLEVEL_XXX - int ID; // plug-in UID - unique item number within the plugin + int ID; // plugin UID - unique item number within the plugin DWORD HotKey; // hot key: LOWORD=hotkey(LOBYTE:vk, HIBYTE:mods), HIWORD=(0:user kept it, 1:user changed it,it is dirty) // helper data: @@ -2473,7 +2473,7 @@ struct CPluginData #endif protected: - HINSTANCE DLL; // handle of the plug-in’s DLL file + HINSTANCE DLL; // handle of the plugin’s DLL file CPluginInterfaceEncapsulation PluginIface; // plugin interface (set to -1 during the entry point call) CPluginInterfaceForArchiverEncapsulation PluginIfaceForArchiver; // plugin interface: archiver CPluginInterfaceForViewerEncapsulation PluginIfaceForViewer; // plugin interface: viewer @@ -2501,13 +2501,13 @@ struct CPluginData CPluginInterfaceForViewerEncapsulation* GetPluginInterfaceForViewer() { return &PluginIfaceForViewer; } CPluginInterfaceForThumbLoaderEncapsulation* GetPluginInterfaceForThumbLoader() { return &PluginIfaceForThumbLoader; } - // loads the DLL into memory, attaches to it and verifies the validity of the stored information (SupportXXX, etc.) - // loads only a DLL that matches exactly, otherwise the plugin reinstallation is required - // 'parent' is the parent window for message boxes; if it is 'quiet'==TRUE no error messages are shown + // loads the DLL into memory, attaches to it, and verifies the validity of the information stored here (SupportXXX, etc.) + // loads only a DLL that matches exactly; otherwise, the plugin must be reinstalled + // 'parent' is the parent window for message boxes; if 'quiet'==TRUE, no error messages are shown // (however, messages from inside the plugin are still displayed) - // 'waitCursor' shows the Wait cursor while loading the DLL library - // if 'showUnsupOnX64' is TRUE, a message box warns about plugins unsupported on x64 - // if 'releaseDynMenuIcons' is TRUE, plugins`s dynamic menu icons are released (they are reloaded before opening the menu) + // 'waitCursor' shows the wait cursor while the DLL is being loaded + // if 'showUnsupOnX64' is TRUE, a message box is shown for plugins unsupported on x64 + // if 'releaseDynMenuIcons' is TRUE, the plugin's dynamic menu icons are released (they are reacquired before the menu is opened) BOOL InitDLL(HWND parent, BOOL quiet = FALSE, BOOL waitCursor = TRUE, BOOL showUnsupOnX64 = TRUE, BOOL releaseDynMenuIcons = TRUE); @@ -2581,10 +2581,10 @@ struct CPluginData BOOL HelpForMenuItem(HWND parent, int index, int suid, BOOL& helpDisplayed); // plugin call: BuildMenu - // let the plugin build a new menu; 'parent' is the parent message box window; + // lets the plugin build a new menu; 'parent' is the parent window of the message box; // if 'force' is TRUE, 'DynMenuWasAlreadyBuild' is ignored and the menu is always built; // returns TRUE if the plugin is loaded and has a static menu or has a dynamic menu and - // also returns the menu-extension interface + // provides the menu-extension interface BOOL BuildMenu(HWND parent, BOOL force); // plugin call: ListArchive @@ -2667,14 +2667,14 @@ struct CPluginData // plugin call: PrematureDeleteTmpCopy BOOL PrematureDeleteTmpCopy(HWND parent, int copiesCount); - // returns TRUE if the plugin is an archiver and has its own mechanism for deleting copies of files extracted from the archive + // returns TRUE if the plugin is an archiver and has its own mechanism for deleting copies of files extracted from the archive // must work even after unloading the plugin (until it is loaded again) BOOL IsArchiverAndHaveOwnDelete() { return ArcCacheOwnDelete; } HIMAGELIST CreateImageList(BOOL gray); - // fills 'mii::State' and 'mii::Type' structuresaccording to the command for 'pluginIndex' and 'menuItemIndex' - // returns TRUE if the item is enabled and FALSE if it is grayed + // fills the 'mii::State' and 'mii::Type' members according to the command specified by 'pluginIndex' and 'menuItemIndex' + // returns TRUE if the item is enabled and FALSE if it is GRAYED BOOL GetMenuItemStateType(int pluginIndex, int menuItemIndex, MENU_ITEM_INFO* mii); // synchronizes old hot keys (from configuration) with new ones (from Connect()): @@ -2791,7 +2791,7 @@ class CPlugins BOOL DefaultConfiguration; // TRUE => ZIP+TAR+PAK; allows recoding of old archiver data - TIndirectArray PluginFSTimers; // timers of individual plugin FS + TIndirectArray PluginFSTimers; // timers of individual plugin file systems DWORD TimerTimeCounter; // "time" for adding timer (prevents endless loops inside CPlugins::HandlePluginFSTimers()) BOOL StopTimerHandlerRecursion; // prevents recursive calls to HandlePluginFSTimers() CPluginFSInterfaceEncapsulation* WorkingPluginFS; // working plugin FS object (neither in a panel nor among detached FS yet) @@ -2852,13 +2852,13 @@ class CPlugins void CheckData(); // removes from Data all plugins whose .spl file no longer exists; if 'canDelPluginRegKey' is TRUE, - // their configuration in the registry is also deleted. in the 'notLoadedPluginNames' (buffer of size - // 'notLoadedPluginNamesSize') returns a list of names (up to 'maxNotLoadedPluginNames' names) of - // plugins that were not loaded but with the configuration in the registry(either removed or failed InitDLL()), - // separated by ", " + in 'numOfSkippedNotLoadedPluginNames' (if not NULL) returns the number of - // names that are not stored in 'notLoadedPluginNames'. in 'loadAllPlugins' is TRUE only when upgrading - // to a new Salamander version and all plugins should be loaded; those that fail and still - // have the configuration in the registryare should be stored in 'notLoadedPluginNames' + // their configuration in the registry is also deleted. in 'notLoadedPluginNames' (a buffer of size + // 'notLoadedPluginNamesSize') it returns a list of names (up to 'maxNotLoadedPluginNames' names) of + // plugins not loaded but having configuration in the registry (either removed or with failed InitDLL()), + // separated by ", "; in 'numOfSkippedNotLoadedPluginNames' (if not NULL) it returns the number of + // names that are not stored in 'notLoadedPluginNames'. 'loadAllPlugins' is TRUE only if upgrading + // to a new Salamander version and all plugins are to be loaded; those that fail and still + // have configuration in the registry are to be stored in 'notLoadedPluginNames' void RemoveNoLongerExistingPlugins(BOOL canDelPluginRegKey, BOOL loadAllPlugins = FALSE, char* notLoadedPluginNames = NULL, int notLoadedPluginNamesSize = 0, @@ -2870,9 +2870,9 @@ class CPlugins // those not yet added) and automatically uninstalls plugins whose .spl files disappeared void AutoInstallStdPluginsDir(HWND parent); - // handles addition of newly installed plugins (reads plugins.ver); returns TRUE if a new - // version of plugins.ver file was found (configuration must be saved so the process doesn't repeat - // on the next start of Salamander) + // handles adding newly installed plugins (reads plugins.ver); returns TRUE if a new + // version of the plugins.ver file was found (the configuration must be saved so this does not repeat + // the next time Salamander starts) BOOL ReadPluginsVer(HWND parent, BOOL importFromOldConfig); // loads all plugins and calls their ClearHistory methods @@ -2924,11 +2924,11 @@ class CPlugins // the name is based on 'regKeyName' void GetUniqueRegKeyName(char* uniqueKeyName, const char* regKeyName); - // it stores a unique FS name based on 'fsName' in 'uniqueFSName'; - // 'uniqueFSNames' (if not NULL) is an array of names to which the resulting + // Stores a unique FS name based on 'fsName' in 'uniqueFSName'; + // 'uniqueFSNames' (if not NULL) is an array of names against which the resulting // 'uniqueFSName' must also be unique; 'oldFSNames' (if not NULL) is an array of old - // fs names from previous plugin loads from which a unique name is preferably selected - // and removed (so the user's FS name doesn't change with each plugin load) + // fs names from previous plugin loads, from which a unique FS name is preferably selected + // and removed (so the user's FS name does not change on each plugin load) void GetUniqueFSName(char* uniqueFSName, const char* fsName, TIndirectArray* uniqueFSNames, TIndirectArray* oldFSNames); @@ -3133,7 +3133,7 @@ class CPlugins // adds a new timer to the PluginFSTimers array; the absolute timeout is GetTickCount() + 'relTimeout'. // Once GetTickCount() returns a value greater than or equal to that timeout, - // the FS object's Event() method is called with FSE_TIMER and 'timerParam'. + // the Event() method of the FS object 'timerOwner' is called with FSE_TIMER and 'timerParam'. // Returns TRUE on success (timer successfully added) BOOL AddPluginFSTimer(DWORD relTimeout, CPluginFSInterfaceAbstract* timerOwner, DWORD timerParam); @@ -3170,7 +3170,7 @@ class CPlugins int GetPluginSaveCount(); // after changing Salamander's language clears LastSLGName for all plugins so a new fallback - // language is chosen for a plugin (used if the plug-in does not support the language currently selected in Salamander) + // language is chosen for a plugin (used if the plugin does not support the language currently selected in Salamander) void ClearLastSLGNames(); // returns the number of plugins that can be loaded (GetLoaded() returns TRUE) @@ -3182,19 +3182,19 @@ class CPlugins BOOL GetFirstNethoodPluginFSName(char* fsName = NULL, CPluginData** nethoodPlugin = NULL); // invokes PasswordManagerEvent method for all plugins using the Password Manager. - // See CSalamanderGeneralAbstract::SetPluginUsesPasswordManager (loads unloaded plug-ins if necessary) + // See CSalamanderGeneralAbstract::SetPluginUsesPasswordManager (loads unloaded plugins if necessary) void PasswordManagerEvent(HWND parent, int event); // releases and clears each plugin's 'PluginDynMenuIcons' void ReleasePluginDynMenuIcons(); protected: - // based on the LastPlgCmdXXX variables finds the plugin and item in its menu corresponding to - // the the last executed command from the Plugins menu; 'rebuildDynMenu' is TRUE if, in the case of a - // dynamic menu, BuildMenu() should be called before searching; 'parent' is the parent message box - // window (only when 'rebuildDynMenu' is TRUE); - // if the command is found, TRUE is returned and 'pluginIndex' holds the plugin index in CPlugins::Data - // and 'menuItemIndex' holds the index in the MenuItems array + // uses the LastPlgCmdXXX variables to find the plugin and the item in its menu corresponding to + // the last command executed from the Plugins menu; 'rebuildDynMenu' is TRUE if, for a dynamic + // menu, BuildMenu() should be called before searching; 'parent' is the parent window of the + // message box (only when 'rebuildDynMenu' is TRUE); + // if the command is found, TRUE is returned and 'pluginIndex' contains the plugin index in + // CPlugins::Data and 'menuItemIndex' contains the index in the MenuItems array // otherwise FALSE is returned BOOL FindLastCommand(int* pluginIndex, int* menuItemIndex, BOOL rebuildDynMenu, HWND parent); @@ -3206,7 +3206,7 @@ class CPlugins // adds a record to the Order array; returns the index in the array on success, otherwise returns -1 int AddPluginToOrder(const char* dllName, BOOL showInBar); - // Sorts the Orders array by plugin name (used for newly added plug-ins to ensure alphabetical order) + // Sorts the Orders array by plugin name (used for newly added plugins to ensure alphabetical order) void QuickSortPluginsByName(int left, int right); // used only for the conversion from the old configuration (the visibility variable has been moved to CPluginData) @@ -3229,7 +3229,7 @@ class CSalamanderPluginEntry : public CSalamanderPluginEntryAbstract BOOL Valid; // TRUE if SetBasicPluginData was called successfully BOOL Error; // has an error already been displayed? DWORD LoadInfo; // DWORD value returned by GetLoadInformation() - TIndirectArray OldFSNames; // array of old fs-names (names from the registry, replaced during plug-in loading) + TIndirectArray OldFSNames; // array of old fs names (names from the registry, replaced during plugin loading) public: CSalamanderPluginEntry(HWND parent, CPluginData* plugin) : OldFSNames(1, 10) From a053879c4164ef37c7921c098a06d6afc5d3e12f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:45:11 +0200 Subject: [PATCH 466/710] [translation] Fix src/plugins1.cpp comments Refines translated comments in src/plugins1.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #909 for src/plugins1.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/plugins1.cpp | 120 +++++++++++++++++++++++------------------------ 1 file changed, 60 insertions(+), 60 deletions(-) diff --git a/src/plugins1.cpp b/src/plugins1.cpp index 35055c99c..2ce5969a2 100644 --- a/src/plugins1.cpp +++ b/src/plugins1.cpp @@ -31,8 +31,8 @@ void EnterPlugin() { #ifdef _DEBUG // verification code for the CSalamanderGeneral::GetMsgBoxParent() method - // if there's an issue, another window for PluginMsgBoxParent must be added, - // if the following code is modified, it must also be updated in CSalamanderGeneral::GetMsgBoxParent + // if an error occurs, another window for PluginMsgBoxParent must be added; + // if the following code is modified, it must also be changed in CSalamanderGeneral::GetMsgBoxParent() HWND wnd = PluginProgressDialog != NULL ? PluginProgressDialog : PluginMsgBoxParent; if (!IsWindowEnabled(wnd)) { @@ -41,7 +41,7 @@ void EnterPlugin() #endif // _DEBUG AllowChangeDirectory(FALSE); // we do not want the current directory to change automatically - BeginStopRefresh(TRUE); // we do not want panels to refresh while a plug-in is running + BeginStopRefresh(TRUE); // we do not want panels to refresh while a plugin is running AlreadyInPlugin = 1; } else @@ -121,7 +121,7 @@ BOOL CPluginFSInterfaceEncapsulation::ListCurrentPath(CSalamanderDirectoryAbstra BOOL r = Interface->ListCurrentPath(dir, pluginData, iconsType, forceRefresh); //TRACE_I("list path: end"); #ifdef _DEBUG - if (r && pluginData != NULL) // increase OpenedPDCounter + if (r && pluginData != NULL) // increment OpenedPDCounter { CPluginData* data = Plugins.GetPluginData(Iface); if (data != NULL) @@ -195,7 +195,7 @@ void CPluginInterfaceForFSEncapsulation::CloseFS(CPluginFSInterfaceAbstract* fs) data->DLLName, data->Version); EnterPlugin(); Interface->CloseFS(fs); - Plugins.KillPluginFSTimer(fs, TRUE, 0); // we must remove timers of the closing FS (they wouldn't deliver and TRACE_E would appear) + Plugins.KillPluginFSTimer(fs, TRUE, 0); // we must cancel timers for the closing FS (they could not be delivered and TRACE_E would appear) LeavePlugin(); if (MainWindow != NULL) @@ -360,7 +360,7 @@ void CSalamanderDebug::TraceAttachThread(HANDLE thread, unsigned tid) { #if defined(MULTITHREADED_TRACE_ENABLE) && defined(TRACE_ENABLE) HANDLE handle; - if (NOHANDLES(DuplicateHandle(GetCurrentProcess(), thread, GetCurrentProcess(), // HANDLES cannot be used -> module + if (NOHANDLES(DuplicateHandle(GetCurrentProcess(), thread, GetCurrentProcess(), // HANDLES cannot be used here; the thread handle may come from another module &handle, 0, FALSE, DUPLICATE_SAME_ACCESS))) // TRACE does not use HANDLES { HANDLES(EnterCriticalSection(&__Trace.CriticalSection)); @@ -689,7 +689,7 @@ void CSalamanderConnect::AddViewer(const char* masks, BOOL force) int i; for (i = 0; i < MainWindow->ViewerMasks->Count; i++) { - if (MainWindow->ViewerMasks->At(i)->ViewerType == -Index - 1) // correct plug-in + if (MainWindow->ViewerMasks->At(i)->ViewerType == -Index - 1) // correct plugin { const char* m = MainWindow->ViewerMasks->At(i)->Masks->GetMasksString(); len = (int)strlen(m); @@ -724,7 +724,7 @@ void CSalamanderConnect::AddViewer(const char* masks, BOOL force) int k; for (k = 0; k < extArray.Count; k++) { - if (StrICmp(ss, extArray[k]) == 0) // we already have this mask, don't add it + if (StrICmp(ss, extArray[k]) == 0) // this mask is already present; do not add it { extArray.Delete(k); if (!extArray.IsGood()) @@ -743,7 +743,7 @@ void CSalamanderConnect::AddViewer(const char* masks, BOOL force) for (k = 0; k < extArray.Count; k++) { if (extArray[k][0] == ';' && s != ext2) - *s++ = ' '; // space is necessary (otherwise the previous ';' wouldn't act as a separator but will merge with this ';') + *s++ = ' '; // the space is necessary (otherwise the previous ';' would not act as a separator and would merge with this ';') strcpy(s, extArray[k]); if (k + 1 < extArray.Count) strcat(s, ";"); @@ -752,8 +752,8 @@ void CSalamanderConnect::AddViewer(const char* masks, BOOL force) masks = ext2; } - if (Viewer && !force || // plug-in installation - !Viewer && force) // plug-in update, but not during its installation + if (Viewer && !force || // plugin installation + !Viewer && force) // plugin update, but not during its installation { CViewerMasksItem* item = new CViewerMasksItem(masks, "", "", "", -Index - 1, FALSE); if (item != NULL && item->IsGood()) @@ -802,7 +802,7 @@ void CSalamanderConnect::ForceRemoveViewer(const char* mask) int i; for (i = 0; i < MainWindow->ViewerMasks->Count; i++) { - if (MainWindow->ViewerMasks->At(i)->ViewerType == -Index - 1) // correct plug-in + if (MainWindow->ViewerMasks->At(i)->ViewerType == -Index - 1) // correct plugin { const char* m = MainWindow->ViewerMasks->At(i)->Masks->GetMasksString(); int len = (int)strlen(m); @@ -851,7 +851,7 @@ void CSalamanderConnect::ForceRemoveViewer(const char* mask) if (strcmp(ext2, m) != 0) MainWindow->ViewerMasks->At(i)->Set(ext2, "", "", ""); } - else // entry removed (last mask deleted) + else // remove the entry (the last mask was removed) { MainWindow->EnterViewerMasksCS(); MainWindow->ViewerMasks->Delete(i); @@ -869,7 +869,7 @@ void CSalamanderConnect::AddPanelArchiver(const char* extensions, BOOL edit, BOO CALL_STACK_MESSAGE3("CSalamanderConnect::AddPanelArchiver(%s, %d)", extensions, edit); if (!PanelView && (!edit || !PanelEdit) && !updateExts) - return; // nothing to do (neither a plug-in upgrade nor extension update) + return; // nothing to do (neither a plugin upgrade nor extension update) char ext[300]; // copy of extensions (replace ';' with '\0') int len = (int)strlen(extensions); @@ -890,7 +890,7 @@ void CSalamanderConnect::AddPanelArchiver(const char* extensions, BOOL edit, BOO extArray.ResetState(); } - int index = -1; // index of the desired intersection of extensions or a record where the plugin provides at least + int index = -1; // index of the sought intersection of extensions, or of a record where the plugin provides at least // "view" when updating extensions (the plugin extends/modifies an existing record) char ext2[300]; // copy of the extension from PackerFormatConfig (replace ';' with '\0') int i; @@ -899,7 +899,7 @@ void CSalamanderConnect::AddPanelArchiver(const char* extensions, BOOL edit, BOO BOOL found = FALSE; // TRUE if this plugin provides at least "view" during extension update if (updateExts) // when updating extensions { - if (PackerFormatConfig.GetUnpackerIndex(i) == -Index - 1) // and if the plug-in is configured at least for "view" + if (PackerFormatConfig.GetUnpackerIndex(i) == -Index - 1) // and if the plugin is configured at least for "view" { found = TRUE; } @@ -922,7 +922,7 @@ void CSalamanderConnect::AddPanelArchiver(const char* extensions, BOOL edit, BOO int j; for (j = 0; j < extArray.Count; j++) { - if (found || StrICmp(s + 1, extArray[j]) == 0) // upgrade or extension sets have a non-empty intersection + if (found || StrICmp(s + 1, extArray[j]) == 0) // extension update or the extension sets have a non-empty intersection { index = i; @@ -1045,7 +1045,7 @@ void CSalamanderConnect::AddPanelArchiver(const char* extensions, BOOL edit, BOO // } } } - if (updateExts && newItem) // all plugin entries were removed by the user; add at least the new ones + if (updateExts && newItem) // the user removed all plugin entries; add at least the new ones { CPluginData* p = Plugins.Get(Index); if (p != NULL && p->SupportPanelView) @@ -1079,7 +1079,7 @@ void CSalamanderConnect::ForceRemovePanelArchiver(const char* extension) for (int i = 0; i < PackerFormatConfig.GetFormatsCount(); i++) { - if (PackerFormatConfig.GetUnpackerIndex(i) == -Index - 1) // if the plug-in is configured at least for "view" + if (PackerFormatConfig.GetUnpackerIndex(i) == -Index - 1) // if the plugin is configured at least for "view" { char ext[300]; lstrcpyn(ext, PackerFormatConfig.GetExt(i), _countof(ext)); @@ -1091,7 +1091,7 @@ void CSalamanderConnect::ForceRemovePanelArchiver(const char* extension) ; if (extEnd != NULL) *extEnd = 0; - if (StrICmp(s + 1, extension) == 0) // the searched extension found + if (StrICmp(s + 1, extension) == 0) // requested extension found { if (s < ext) { @@ -1667,7 +1667,7 @@ BOOL CSalamanderPluginEntry::SetBasicPluginData(const char* pluginName, DWORD fu if (s != NULL) { Plugin->FSNames.Add(s); - if (!Plugin->FSNames.IsGood()) // should not happen (adding the first array element), just in case + if (!Plugin->FSNames.IsGood()) // cannot happen (adding the first array element), just in case { Plugin->FSNames.ResetState(); free(s); @@ -1757,7 +1757,7 @@ CSalamanderPluginEntry::LoadLanguageModule(HWND parent, const char* pluginName) SalMessageBoxEx(¶ms); } } - else // try to load the .slg chosen during the previous plugin load + else // try to load the .slg selected when the plugin was last loaded { lstrcpyn(slgName, Plugin->LastSLGName, slgNameBufSize); lang = HANDLES_Q(LoadLibrary(path)); @@ -1811,7 +1811,7 @@ CSalamanderPluginEntry::LoadLanguageModule(HWND parent, const char* pluginName) lstrcpyn(slgName, selSLGName, slgNameBufSize); lang = HANDLES_Q(LoadLibrary(path)); if (lang == NULL || !IsSLGFileValid(Plugin->GetPluginDLL(), lang, languageID, NULL)) - { // shouldn't theoretically happen (dialog verifies the validity of the .SLG module) + { // this should theoretically never happen (the dialog verifies the validity of the .SLG module) if (lang != NULL) HANDLES(FreeLibrary(lang)); lang = NULL; @@ -2190,7 +2190,7 @@ BOOL CPluginData::InitDLL(HWND parent, BOOL quiet, BOOL waitCursor, BOOL showUns } else // connect to the DLL { - FSalamanderPluginEntry entry = (FSalamanderPluginEntry)GetProcAddress(DLL, "SalamanderPluginEntry"); // plug-in entry point + FSalamanderPluginEntry entry = (FSalamanderPluginEntry)GetProcAddress(DLL, "SalamanderPluginEntry"); // plugin entry point if (entry != NULL) { #ifdef _DEBUG @@ -2209,7 +2209,7 @@ BOOL CPluginData::InitDLL(HWND parent, BOOL quiet, BOOL waitCursor, BOOL showUns salamander.AddLoadInfo(Plugins.LoadInfoBase); // base (none/auto-install/new-plugins.ver) // if (LoadOnStart) salamander.AddLoadInfo(LOADINFO_LOADONSTART); // "load on start" flag - // remove commands inherited from the previous load (the array should be empty anyway) + // Remove commands inherited from the previous load (the array will be empty 99.9% of the time) Commands.DestroyMembers(); // drop icon overlays (just in case; it should already be empty) @@ -2228,7 +2228,7 @@ BOOL CPluginData::InitDLL(HWND parent, BOOL quiet, BOOL waitCursor, BOOL showUns if (getReqVer != NULL && (BuiltForVersion = getReqVer()) >= PLUGIN_REQVER) { FSalamanderPluginGetSDKVer getSDKVer = (FSalamanderPluginGetSDKVer)GetProcAddress(DLL, "SalamanderPluginGetSDKVer"); // plugin function - if (getSDKVer != NULL) // if the plugin exports this function it likely wants to raise BuiltForVersion (it pretends to be old for compatibility with older Salamander versions but wants to use new services with newer versions) + if (getSDKVer != NULL) // if the plugin exports this function, it likely wants to increase BuiltForVersion (it presents itself as old for compatibility with older Salamander versions, but wants to use newer services when running with newer Salamander versions) { int verSDK = getSDKVer(); if (BuiltForVersion <= verSDK) @@ -2241,7 +2241,7 @@ BOOL CPluginData::InitDLL(HWND parent, BOOL quiet, BOOL waitCursor, BOOL showUns if (!oldVer) { if (PluginHomePageURL != NULL) - { // delete the plugin URL just before calling the entry point so it remains available if loading of the plugin fails due to an old plugin version (the user can use the URL to obtain a new version of the plugin) + { // delete the plugin URL only just before calling the entry point so it does not disappear if plugin loading fails because the plugin is too old (the user can use the URL to obtain a newer plugin version) free(PluginHomePageURL); PluginHomePageURL = NULL; } @@ -2462,7 +2462,7 @@ BOOL CPluginData::InitDLL(HWND parent, BOOL quiet, BOOL waitCursor, BOOL showUns ReleaseIconOverlays(); if (!oldVer && salamander.ShowError()) - { // the plugin is the correct version and did not call SetBasicPluginData successfully or unsuccessfully + { // the plugin is the correct version, but SetBasicPluginData was not called if (Name == NULL || Name[0] == 0) sprintf(bufText, LoadStr(IDS_PLUGININVALID2), s); else @@ -2472,7 +2472,7 @@ BOOL CPluginData::InitDLL(HWND parent, BOOL quiet, BOOL waitCursor, BOOL showUns } } } - else // the plugin has no Salamander Plugin Entry Point ... + else // the plugin does not have a Salamander Plugin Entry Point ... { HANDLES(FreeLibrary(DLL)); DLL = NULL; @@ -2663,7 +2663,7 @@ BOOL CPluginData::Remove(HWND parent, int index, BOOL canDelPluginRegKey) if (unloaded) { - // adjust "file viewer" - delete the records related to this plug-in + measures due to the shift of the Plugins array + // adjust "file viewer" - delete the records related to this plugin + measures due to the shift of the Plugins array CViewerMasks* viewerMasks; MainWindow->EnterViewerMasksCS(); int k; @@ -2677,7 +2677,7 @@ BOOL CPluginData::Remove(HWND parent, int index, BOOL canDelPluginRegKey) for (i = 0; i < viewerMasks->Count; i++) { int type = viewerMasks->At(i)->ViewerType; - if (type < 0) // not external or internal -> plug-in viewer + if (type < 0) // neither external nor internal -> plugin viewer { type = -type - 1; if (type == index) @@ -2695,7 +2695,7 @@ BOOL CPluginData::Remove(HWND parent, int index, BOOL canDelPluginRegKey) } MainWindow->LeaveViewerMasksCS(); - // adjust "custom pack" - delete the records related to this plug-in + measures due to the shift of the Plugins array + // adjust "custom pack" - delete the records related to this plugin + measures due to the shift of the Plugins array int i; for (i = 0; i < PackerConfig.GetPackersCount(); i++) { @@ -2707,7 +2707,7 @@ BOOL CPluginData::Remove(HWND parent, int index, BOOL canDelPluginRegKey) PackerConfig.DeletePacker(i--); // this plugin -> delete record else { - if (type > index) // the Plugins array shifts -> decrease 'type' by one + if (type > index) // the Plugins array shifts, so decrease 'type' by one { type--; PackerConfig.SetPackerType(i, -type - 1); @@ -2716,7 +2716,7 @@ BOOL CPluginData::Remove(HWND parent, int index, BOOL canDelPluginRegKey) } } - // adjust "custom unpack" - delete the records related to this plug-in + measures due to the shift of the Plugins array + // adjust "custom unpack" - delete the records related to this plugin + measures due to the shift of the Plugins array for (i = 0; i < UnpackerConfig.GetUnpackersCount(); i++) { int type = UnpackerConfig.GetUnpackerType(i); @@ -2727,7 +2727,7 @@ BOOL CPluginData::Remove(HWND parent, int index, BOOL canDelPluginRegKey) UnpackerConfig.DeleteUnpacker(i--); // this plugin -> delete record else { - if (type > index) // the Plugins array shifts -> decrease 'type' by one + if (type > index) // the Plugins array shifts, so decrease 'type' by one { type--; UnpackerConfig.SetUnpackerType(i, -type - 1); @@ -2754,7 +2754,7 @@ BOOL CPluginData::Remove(HWND parent, int index, BOOL canDelPluginRegKey) removeUnpack = TRUE; // this plugin -> delete record else { - if (unpack > index) // Plugins array shifts -> decrease 'unpack' by one + if (unpack > index) // the Plugins array shifts -> decrease 'unpack' by one { unpack--; PackerFormatConfig.SetUnpackerIndex(i, -unpack - 1); @@ -2768,7 +2768,7 @@ BOOL CPluginData::Remove(HWND parent, int index, BOOL canDelPluginRegKey) removePack = TRUE; // this plugin -> delete record else { - if (pack > index) // the Plugins array shifts -> decrease 'pack' by one + if (pack > index) // the Plugins array shifts, so decrease 'pack' by one { pack--; PackerFormatConfig.SetPackerIndex(i, -pack - 1); @@ -2776,7 +2776,7 @@ BOOL CPluginData::Remove(HWND parent, int index, BOOL canDelPluginRegKey) } } - if (removePack || removeUnpack) // a replacement for "view" and/or "edit" is needed + if (removePack || removeUnpack) // find a replacement for "view" and/or "edit" { // we will search for an archiver that supports "view" and/or "edit" for some of the extensions int newView, newEdit; @@ -2794,7 +2794,7 @@ BOOL CPluginData::Remove(HWND parent, int index, BOOL canDelPluginRegKey) else PackerFormatConfig.DeleteFormat(i--); // cannot work without "view" } - if (removePack && // need to replace "edit" and + if (removePack && // need to replace "edit" (!removeUnpack || viewFound)) // record was not deleted { if (editFound) @@ -2806,7 +2806,7 @@ BOOL CPluginData::Remove(HWND parent, int index, BOOL canDelPluginRegKey) } PackerFormatConfig.BuildArray(); - if (SupportLoadSave && canDelPluginRegKey) // if the plugin supports load/save configuration + we can delete its registry key (not an import of the configuration from an older version of Salamander) + if (SupportLoadSave && canDelPluginRegKey) // if the plugin supports loading/saving configuration and we can delete its registry key (this is not an import of configuration from an older Salamander version) { // try to open the private registry key; if successful, delete it, it's no longer needed BOOL shouldDelete = FALSE; LoadSaveToRegistryMutex.Enter(); @@ -2909,7 +2909,7 @@ void CPluginData::AcceptChangeOnPathNotification(const char* path, BOOL includin void CPluginData::PasswordManagerEvent(HWND parent, int event) { CALL_STACK_MESSAGE4("CPluginData::PasswordManagerEvent(, %d) (%s v. %s)", event, DLLName, Version); - if (GetLoaded() && PluginUsesPasswordManager) // in case the plugin stopped using the Password Manager (did not call SetPluginUsesPasswordManager()) + if (GetLoaded() && PluginUsesPasswordManager) // in case the plugin has stopped using the Password Manager (did not call SetPluginUsesPasswordManager()) PluginIface.PasswordManagerEvent(parent, event); } @@ -2986,7 +2986,7 @@ void CPluginData::CallLoadOrSaveConfiguration(BOOL load, { DWORD saveInProgress = 1; if (GetValueAux(NULL, salamander, SALAMANDER_SAVE_IN_PROGRESS, REG_DWORD, &saveInProgress, sizeof(DWORD))) - { // GetValueAux, because we do not want a Load Configuration message + { // GetValueAux, because we do not want a Load Configuration message box cfgIsOK = FALSE; // corrupted configuration; saving won't fix it (not all data is stored) TRACE_E("CPluginData::CallLoadOrSaveConfiguration(): unable to save configuration, configuration key in registry is corrupted, plugin: " << Name); } @@ -3140,7 +3140,7 @@ BOOL CPluginData::Unload(HWND parent, BOOL ask) PluginIfaceForThumbLoader.Init(NULL, NULL, NULL); SalamanderGeneral.Init(NULL); - // when unloading the plugin, remove its icon overlays + // when unloading the plugin, remove its icon overlays ReleaseIconOverlays(); // disconnect the unloaded plugin from the delete manager and the disk cache @@ -3159,7 +3159,7 @@ BOOL CPluginData::GetMenuItemStateType(int pluginIndex, int menuItemIndex, MENU_ DWORD mask = GetMaskForMenuItems(pluginIndex); - if (item->StateMask == -1) // should the item’s state be queried directly from the plug-in? + if (item->StateMask == -1) // should the item’s state be queried directly from the plugin? { DWORD state = 0; if (PluginIfaceForMenuExt.NotEmpty()) @@ -3204,11 +3204,11 @@ void CPluginData::AddMenuItemsToSubmenuAux(CMenuPopup* menu, int& i, int count, if (item->Type == pmitEndSubmenu) return; // return from the submenu BOOL skipSubMenu = FALSE; - if (item->SkillLevel & CfgSkillLevelToMenu(::Configuration.SkillLevel)) // apply the skill-level menu reduction + if (item->SkillLevel & CfgSkillLevelToMenu(::Configuration.SkillLevel)) // apply skill-level menu filtering { BOOL hidden = FALSE; MENU_ITEM_INFO mi; - if (item->Name == NULL) // separator or failed allocation of start-submenu name + if (item->Name == NULL) // separator or failed allocation of the start-submenu name { if (item->Type == pmitStartSubmenu) skipSubMenu = TRUE; // failed to allocate start-submenu name: insert separator and skip the rest of the submenu @@ -3221,7 +3221,7 @@ void CPluginData::AddMenuItemsToSubmenuAux(CMenuPopup* menu, int& i, int count, mi.SkillLevel |= MENU_LEVEL_INTERMEDIATE; if (item->SkillLevel & MENU_SKILLLEVEL_ADVANCED) mi.SkillLevel |= MENU_LEVEL_ADVANCED; - if (item->StateMask == -1) // should the visibility of the separator be queried directly from the plug-in? + if (item->StateMask == -1) // should the visibility of the separator be queried directly from the plugin? { DWORD state = PluginIfaceForMenuExt.GetMenuItemState(item->ID, mask); @@ -3229,7 +3229,7 @@ void CPluginData::AddMenuItemsToSubmenuAux(CMenuPopup* menu, int& i, int count, hidden = TRUE; } } - else // a regular menu or submenu item + else // regular menu item or submenu { mi.Mask = MENU_MASK_TYPE | MENU_MASK_STATE | MENU_MASK_ID | MENU_MASK_STRING | MENU_MASK_SKILLLEVEL | MENU_MASK_IMAGEINDEX | @@ -3266,7 +3266,7 @@ void CPluginData::AddMenuItemsToSubmenuAux(CMenuPopup* menu, int& i, int count, mi.SkillLevel |= MENU_LEVEL_INTERMEDIATE; if (item->SkillLevel & MENU_SKILLLEVEL_ADVANCED) mi.SkillLevel |= MENU_LEVEL_ADVANCED; - if (item->StateMask == -1) // should the item’s state be queried directly from the plug-in? + if (item->StateMask == -1) // should the item’s state be queried directly from the plugin? { DWORD state = PluginIfaceForMenuExt.GetMenuItemState(item->ID, mask); @@ -3303,7 +3303,7 @@ void CPluginData::AddMenuItemsToSubmenuAux(CMenuPopup* menu, int& i, int count, else TRACE_E("Too much commands in plugins."); - if (item->Type == pmitStartSubmenu && !hidden) // let the submenu be populated + if (item->Type == pmitStartSubmenu && !hidden) // populate the submenu { mi.SubMenu = new CMenuPopup(); if ((mi.State & MENU_STATE_GRAYED) == 0 && mi.SubMenu != NULL) @@ -3336,7 +3336,7 @@ void CPluginData::AddMenuItemsToSubmenuAux(CMenuPopup* menu, int& i, int count, skipSubMenu = TRUE; // item hidden due to skill level if (skipSubMenu && item->Type == pmitStartSubmenu) - { // if it is a submenu, skip nested items and submenus (they won't be touched at all) + { // if this is a submenu, skip its nested items and submenus (they will not be touched at all) int level = 1; for (i++; i < MenuItems.Count; i++) { @@ -3346,7 +3346,7 @@ void CPluginData::AddMenuItemsToSubmenuAux(CMenuPopup* menu, int& i, int count, else { if (type == pmitEndSubmenu && --level == 0) - break; // end of submenu found + break; // end of submenu reached } } } @@ -3410,7 +3410,7 @@ void CPluginData::InitMenuItems(HWND parent, int index, CMenuPopup* menu) { CPluginMenuItem* item = MenuItems[i]; BOOL skipSubMenu = FALSE; - if (item->SkillLevel & CfgSkillLevelToMenu(::Configuration.SkillLevel)) // apply the skill-level menu reduction + if (item->SkillLevel & CfgSkillLevelToMenu(::Configuration.SkillLevel)) // apply the skill-level reduction to the menu { if (item->StateMask == -1) { @@ -3440,7 +3440,7 @@ void CPluginData::InitMenuItems(HWND parent, int index, CMenuPopup* menu) skipSubMenu = TRUE; // item hidden due to skill level if (skipSubMenu && item->Type == pmitStartSubmenu) - { // if it is a submenu, skip nested items and submenus (they won't be touched at all) + { // if this is a submenu, skip its nested items and submenus (they will not be touched at all) int level = 1; for (i++; i < MenuItems.Count; i++) { @@ -3524,7 +3524,7 @@ BOOL CPluginData::HelpForMenuItem(HWND parent, int index, int suid, BOOL& helpDi int i; for (i = 0; i < MenuItems.Count; i++) { - if (MenuItems[i]->SUID == suid) // comparing the menu item's SUID with the executed command + if (MenuItems[i]->SUID == suid) // compare the menu item's SUID with the invoked command { id = MenuItems[i]->ID; if (InitDLL(parent) && PluginIfaceForMenuExt.NotEmpty()) @@ -3712,7 +3712,7 @@ BOOL CPluginData::ViewFile(const char* name, int left, int top, int width, int h returnLock, lock, lockOwner, NULL, enumFilesSourceUID, enumFilesCurrentIndex); if (ret && returnLock && *lock != NULL && *lockOwner) - { // add the 'lock' handle to HANDLES (disk cache will want to close it - it will search for it) + { // add the 'lock' handle to HANDLES (the disk cache will want to close it; it will look for it there) HANDLES_ADD(__htEvent, __hoCreateEvent, *lock); } } @@ -3764,7 +3764,7 @@ BOOL CPluginData::ChangeDriveMenuItemContextMenu(HWND parent, int panel, int x, isDetachedFS, refreshMenu, closeMenu, postCmd, postCmdParam); } - return FALSE; // error, so return "value parameters should be ignored" + return FALSE; // error, so return "output parameters should be ignored" } void CPluginData::EnsureShareExistsOnServer(HWND parent, int panel, const char* server, const char* share) @@ -3772,7 +3772,7 @@ void CPluginData::EnsureShareExistsOnServer(HWND parent, int panel, const char* CALL_STACK_MESSAGE6("CPluginData::EnsureShareExistsOnServer(, %d, %s, %s) (%s v. %s)", panel, server, share, DLLName, Version); if (InitDLL(parent, TRUE) && // we don't want to report possible load errors; EnsureShareExistsOnServer provides only supplementary info (if it isn't called, almost nothing happens) - PluginIsNethood && // in case the plug-in stops replacing Network (i.e., it does not call SetPluginIsNethood()) right during this load + PluginIsNethood && // in case the plugin stops replacing Network (i.e., it does not call SetPluginIsNethood()) right during this load PluginIfaceForFS.NotEmpty()) // PluginIsNethood is independent of PluginIfaceForFS, so we check it separately { PluginIfaceForFS.EnsureShareExistsOnServer(panel, server, share); @@ -3816,7 +3816,7 @@ void CPluginData::GetCacheInfo(char* arcCacheTmpPath, BOOL* arcCacheOwnDelete, B TRACE_E(LOW_MEMORY); } ArcCacheOwnDelete = *arcCacheOwnDelete; // is set in every case; reason: method IsArchiverAndHaveOwnDelete()() - if (l == 0 || p != NULL) // with low memory the settings cannot be cached -> the plugin will be queried multiple times + if (l == 0 || p != NULL) // with insufficient memory, the settings cannot be cached -> the plugin will be queried multiple times { ArcCacheHaveInfo = TRUE; ArcCacheTmpPath = p; @@ -3937,7 +3937,7 @@ void CPluginData::HotKeysEnsureIntegrity() int menuItemIndex; if (Plugins.FindHotKey(hotKey, TRUE, this, &pluginIndex, &menuItemIndex)) { - if (dirty) // if we have a predefined hot key, remove it from the competitor instead + if (dirty) // if we have a predefined hot key, clear it on the conflicting item instead Plugins.Get(pluginIndex)->MenuItems[menuItemIndex]->HotKey = 0; else item->HotKey = 0; From a023e762deaad7b557cebd24e0a634145b5111f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:45:21 +0200 Subject: [PATCH 467/710] [translation] Fix src/salamdr3.cpp comments Refines translated comments in src/salamdr3.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #919 for src/salamdr3.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/salamdr3.cpp | 88 ++++++++++++++++++++++++------------------------ 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/src/salamdr3.cpp b/src/salamdr3.cpp index 0e080c6ea..6ea309275 100644 --- a/src/salamdr3.cpp +++ b/src/salamdr3.cpp @@ -300,7 +300,7 @@ int HandleFileException(EXCEPTION_POINTERS* e, char* fileMem, DWORD fileMemSize) else { if (e->ExceptionRecord->ExceptionCode == EXCEPTION_ACCESS_VIOLATION && // access violation signals a file error only when the failing address falls within the file - (e->ExceptionRecord->NumberParameters >= 2 && // we have something to test + (e->ExceptionRecord->NumberParameters >= 2 && // we have something to check e->ExceptionRecord->ExceptionInformation[1] >= (ULONG_PTR)fileMem && // pointer to the fault is within the mapped file e->ExceptionRecord->ExceptionInformation[1] < ((ULONG_PTR)fileMem) + fileMemSize)) { @@ -387,7 +387,7 @@ BOOL SalRemovePointsFromPath(WCHAR* afterRoot) d = l; } else - return FALSE; // cannot remove ".." + return FALSE; // ".." cannot be removed } else { @@ -586,7 +586,7 @@ BOOL SalGetFullName(char* name, int* errTextID, const char* curDir, char* nextFo if (err == 0) // removal of any unwanted trailing backslash from the string { int l = (int)strlen(name); - if (l > 1 && name[1] == ':') // path type "c:\path" + if (l > 1 && name[1] == ':') // path of the form "c:\path" { if (l > 3) // not a root path { @@ -601,7 +601,7 @@ BOOL SalGetFullName(char* name, int* errTextID, const char* curDir, char* nextFo } else { - if (name[0] == '\\' && name[1] == '\\' && name[2] == '.' && name[3] == '\\' && name[4] != 0 && name[5] == ':') // path like "\\.\C:\" + if (name[0] == '\\' && name[1] == '\\' && name[2] == '.' && name[3] == '\\' && name[4] != 0 && name[5] == ':') // path of the form "\\.\C:\" { if (l > 7) // not a root path { @@ -639,7 +639,7 @@ void AuxThreadBody(BOOL add, HANDLE thread, BOOL testIfFinished) CEnterCriticalSection enterCS(cs); static BOOL finished = FALSE; - if (!finished) // after calling TerminateAuxThreads(), we no longer accept anything + if (!finished) // after calling TerminateAuxThreads(), no more threads are accepted { if (add) { @@ -714,7 +714,7 @@ class CStopRefreshStack public: CStopRefreshStack() {Count = 0; Ignored = 0;} - ~CStopRefreshStack() {CheckIfEmpty(3);} // three BeginStopRefresh() calls are OK: for both panels BeginStopRefresh() is called, and the third comes from WM_USER_CLOSE_MAINWND (invoked first) + ~CStopRefreshStack() {CheckIfEmpty(3);} // three BeginStopRefresh() calls are OK: BeginStopRefresh() is called for both panels, and a third call comes from WM_USER_CLOSE_MAINWND (invoked first) void Push(DWORD caller_called_from, DWORD called_from); void Pop(DWORD caller_called_from, DWORD called_from); @@ -856,7 +856,7 @@ if this code ever needs to be revived, keep in mind it can be replaced (x86 and } if (MainWindow != NULL && MainWindow->NeedToResentDispachChangeNotif && - !AlreadyInPlugin) // if it is still inside a plug-in, posting the notification is pointless + !AlreadyInPlugin) // if it is still inside a plugin, posting the notification is pointless { MainWindow->NeedToResentDispachChangeNotif = FALSE; @@ -1068,7 +1068,7 @@ BOOL CheckAndCreateDirectory(const char* dir, HWND parent, BOOL quiet, char* err if (newDir != NULL) newDir[0] = 0; int dirLen = (int)strlen(dir); - if (dirLen >= MAX_PATH) // too long name + if (dirLen >= MAX_PATH) // path is too long { if (errBuf != NULL) strncpy_s(errBuf, errBufSize, LoadStr(IDS_TOOLONGNAME), _TRUNCATE); @@ -1083,7 +1083,7 @@ BOOL CheckAndCreateDirectory(const char* dir, HWND parent, BOOL quiet, char* err { char root[MAX_PATH]; GetRootPath(root, dir); - if (dirLen <= (int)strlen(root)) // the directory is a root directory + if (dirLen <= (int)strlen(root)) // dir is the root directory { sprintf(buf, LoadStr(IDS_CREATEDIRFAILED), dir); if (errBuf != NULL) @@ -1145,11 +1145,11 @@ BOOL CheckAndCreateDirectory(const char* dir, HWND parent, BOOL quiet, char* err break; // we have reached the root directory } attrs = SalGetFileAttributes(name); - if (attrs != 0xFFFFFFFF) // the name exists + if (attrs != 0xFFFFFFFF) // the path exists { if (attrs & FILE_ATTRIBUTE_DIRECTORY) break; // we will build from this directory - else // it is a file, that would not work ... + else // it is a file, so that would not work... { sprintf(buf, LoadStr(IDS_NAMEUSEDFORFILE), name); if (errBuf != NULL) @@ -1235,7 +1235,7 @@ BOOL CheckAndCreateDirectory(const char* dir, HWND parent, BOOL quiet, char* err } if (attrs & FILE_ATTRIBUTE_DIRECTORY) return TRUE; - else // it is a file, that would not work ... + else // existing file, so this would not work ... { sprintf(buf, LoadStr(IDS_NAMEUSEDFORFILE), dir); if (errBuf != NULL) @@ -1294,7 +1294,7 @@ CPathHistoryItem::CPathHistoryItem(int type, const char* pathOrArchiveOrFSName, GetRootPath(root, pathOrArchiveOrFSName); const char* e = pathOrArchiveOrFSName + strlen(pathOrArchiveOrFSName); if ((int)strlen(root) < e - pathOrArchiveOrFSName || // not a root path - pathOrArchiveOrFSName[0] == '\\') // it is a UNC path + pathOrArchiveOrFSName[0] == '\\') // this is a UNC path { if (*(e - 1) == '\\') e--; @@ -1362,7 +1362,7 @@ void CPathHistoryItem::ChangeData(int topIndex, const char* focusedName) if (FocusedName != NULL) { if (focusedName != NULL && strcmp(FocusedName, focusedName) == 0) - return; // no change -> done + return; // no change -> return free(FocusedName); } if (focusedName != NULL) @@ -1386,7 +1386,7 @@ void CPathHistoryItem::GetPath(char* buffer, int bufferSize) l = bufferSize; memcpy(buffer, PathOrArchiveOrFSName, l - 1); buffer[l - 1] = 0; - if (Type == 1 || Type == 2) // archive or FS + if (Type == 1 || Type == 2) // archive or file system { buffer += l - 1; bufferSize -= l - 1; @@ -1561,7 +1561,7 @@ BOOL CPathHistoryItem::Execute(CFilesWindow* panel) } } - break; // done, no further match with PluginFS is possible + break; // no further match with PluginFS is possible } } } @@ -1583,11 +1583,11 @@ BOOL CPathHistoryItem::Execute(CFilesWindow* panel) if (list->At(i)->IsPathFromThisFS(PathOrArchiveOrFSName, ArchivePathOrFSUserPart)) { done = TRUE; - // we try to switch to the requested path while attaching the detached FS + // try to switch to the requested path while attaching the detached FS if (!panel->ChangePathToDetachedFS(i, TopIndex, FocusedName, TRUE, &failReason, PathOrArchiveOrFSName, ArchivePathOrFSUserPart)) { - if (failReason == CHPPFR_SHORTERPATH) // almost success (the path was only shortened) (CHPPFR_FILENAMEFOCUSED cannot occur here) + if (failReason == CHPPFR_SHORTERPATH) // almost successful: the path was only shortened (CHPPFR_FILENAMEFOCUSED cannot occur here) { // refresh the record about the FS interface if (panel->Is(ptPluginFS)) PluginFS = panel->GetPluginFS()->GetInterface(); @@ -1598,7 +1598,7 @@ BOOL CPathHistoryItem::Execute(CFilesWindow* panel) clear = FALSE; // no jump, no need to clear stored top indices } } - else // full success + else // complete success { // refresh the record about the FS interface if (panel->Is(ptPluginFS)) PluginFS = panel->GetPluginFS()->GetInterface(); @@ -1615,7 +1615,7 @@ BOOL CPathHistoryItem::Execute(CFilesWindow* panel) if (!panel->ChangePathToPluginFS(PathOrArchiveOrFSName, ArchivePathOrFSUserPart, TopIndex, FocusedName, FALSE, 2, NULL, TRUE, &failReason)) { - if (failReason == CHPPFR_SHORTERPATH || // almost success (the path was only shortened) + if (failReason == CHPPFR_SHORTERPATH || // partial success (the path was only shortened) failReason == CHPPFR_FILENAMEFOCUSED) // almost success (the path only changed to a file and that file was focused) { // refresh the record about the FS interface if (panel->Is(ptPluginFS)) @@ -1627,7 +1627,7 @@ BOOL CPathHistoryItem::Execute(CFilesWindow* panel) clear = FALSE; // no jump, no need to clear stored top indices } } - else // full success + else // complete success { // refresh the record about the FS interface if (panel->Is(ptPluginFS)) PluginFS = panel->GetPluginFS()->GetInterface(); @@ -1637,7 +1637,7 @@ BOOL CPathHistoryItem::Execute(CFilesWindow* panel) } } if (clear) - panel->TopIndexMem.Clear(); // long jump + panel->TopIndexMem.Clear(); // a long jump occurred } UpdateWindow(MainWindow->HWindow); return ret; @@ -1849,7 +1849,7 @@ void CPathHistory::Execute(int index, BOOL forward, CFilesWindow* panel, BOOL al if (HasBackward() || allItems && HasPaths()) { int count = ((ForwardIndex == -1) ? Paths.Count : ForwardIndex) - 1; - if (count - index >= 0) // there is a destination (not the last item) + if (count - index >= 0) // there is somewhere to go (not the last item) { if (count - index < Paths.Count) { @@ -1919,7 +1919,7 @@ void CPathHistory::ChangeActualPathData(int type, const char* pathOrArchiveOrFSN else n2 = Paths[Paths.Count - 1]; - if (n2 != NULL && n.IsTheSamePath(*n2, curPluginFS)) // same paths -> update the data + if (n2 != NULL && n.IsTheSamePath(*n2, curPluginFS)) // same path -> update the data n2->ChangeData(topIndex, focusedName); } } @@ -1937,7 +1937,7 @@ void CPathHistory::RemoveActualPath(int type, const char* pathOrArchiveOrFSName, { CPathHistoryItem n(type, pathOrArchiveOrFSName, archivePathOrFSUserPart, NULL, pluginFS); CPathHistoryItem* n2 = Paths[Paths.Count - 1]; - if (n.IsTheSamePath(*n2, curPluginFS)) // same paths -> remove the record + if (n.IsTheSamePath(*n2, curPluginFS)) // identical paths -> remove the entry Paths.Delete(Paths.Count - 1); } else @@ -1974,7 +1974,7 @@ void CPathHistory::AddPath(int type, const char* pathOrArchiveOrFSName, const ch if (n2 != NULL && n->IsTheSamePath(*n2, curPluginFS)) { delete n; - return; // same paths -> nothing to do + return; // same path -> nothing to do } } @@ -2261,7 +2261,7 @@ CUserMenuIconBkgndReader::CUserMenuIconBkgndReader() CUserMenuIconBkgndReader::~CUserMenuIconBkgndReader() { - if (UserMenuIIU_BkgndReaderData != NULL) // they truly are no longer needed, release them now + if (UserMenuIIU_BkgndReaderData != NULL) // they are no longer needed, so release them { delete UserMenuIIU_BkgndReaderData; UserMenuIIU_BkgndReaderData = NULL; @@ -2297,14 +2297,14 @@ unsigned BkgndReadingIconsThreadBody(void* param) if (item->UMCommand[0] != 0) { // if the previous attempt failed, try to obtain the icon from the system DWORD attrs = SalGetFileAttributes(item->UMCommand); - if (attrs != INVALID_FILE_ATTRIBUTES) // accessibility check (instead of CheckPath) + if (attrs != INVALID_FILE_ATTRIBUTES) // access check (instead of CheckPath) { umIcon = GetFileOrPathIconAux(item->UMCommand, FALSE, (attrs != INVALID_FILE_ATTRIBUTES && (attrs & FILE_ATTRIBUTE_DIRECTORY))); } } } - item->LoadedIcon = umIcon; // store the result: the loaded icon or NULL if it failed + item->LoadedIcon = umIcon; // store the result: the loaded icon or NULL on error } UserMenuIconBkgndReader.ReadingFinished(threadID, bkgndReaderData); @@ -2486,7 +2486,7 @@ BOOL CUserMenuIconBkgndReader::EnterCSIfCanUpdateUMIcons(CUserMenuIconDataArr** void CUserMenuIconBkgndReader::LeaveCSAfterUMIconsUpdate() { - CurIRThreadIDIsValid = FALSE; // the icons are now handed over to the user menu (IsReadingIcons() must return FALSE) + CurIRThreadIDIsValid = FALSE; // at this point, the icons are handed over to the user menu (IsReadingIcons() must return FALSE) HANDLES(LeaveCriticalSection(&CS)); } @@ -2540,7 +2540,7 @@ CUserMenuItem::CUserMenuItem(CUserMenuItem& item, CUserMenuIconDataArr* bkgndRea { if (bkgndReaderData == NULL) // this is a copy for the config dialog; do not propagate newly loaded icons (wait until the dialog ends) { - UMIcon = DuplicateIcon(NULL, item.UMIcon); // GetIconHandle() unnecessarily slowed things down. + UMIcon = DuplicateIcon(NULL, item.UMIcon); // GetIconHandle() unnecessarily slowed things down. if (UMIcon != NULL) // add the 'UMIcon' handle to HANDLES HANDLES_ADD(__htIcon, __hoLoadImage, UMIcon); } @@ -2700,7 +2700,7 @@ BOOL CUserMenuItem::GetIconHandle(CUserMenuIconDataArr* bkgndReaderData, BOOL ge if (bkgndReaderData != NULL) { - if (getIconsFromReader) // icons are already loaded, just take the right one + if (getIconsFromReader) // icons are already loaded, just use the correct one { UMIcon = bkgndReaderData->GiveIconForUMI(fileName, iconIndex, umCommand); if (UMIcon != NULL) @@ -2813,7 +2813,7 @@ UINT GetMouseWheelScrollLines() { msgGetScrollLines = ::RegisterWindowMessage(MSH_SCROLL_LINES); if (msgGetScrollLines == 0) - nRegisteredMessage = 1; // couldn't register! never try again + nRegisteredMessage = 1; // registration failed; do not try again else nRegisteredMessage = 2; // it worked: use it } @@ -2889,7 +2889,7 @@ BOOL PostMouseWheelMessage(MSG* pMSG) } // if this is a scrollbar with a parent window, post the message to the parent. // Scrollbars in the panels are not subclassed, so this is currently the only way - // for the panel to learn about the wheel when the cursor is over the scroll bar. + // for the panel to receive wheel messages when the cursor is over the scrollbar. className[0] = 0; if (GetClassName(hWindow, className, 100) == 0 || StrICmp(className, "scrollbar") == 0) { @@ -3002,7 +3002,7 @@ BOOL CFileTimeStampsItem::Set(const char* zipRoot, const char* sourcePath, const if (*zipRoot == '\\') zipRoot++; ZIPRoot = DupStr(zipRoot); - if (ZIPRoot != NULL) // zip-root has no '\\' at the beginning or at the end. + if (ZIPRoot != NULL) // zipRoot has no leading or trailing '\\' { int l = (int)strlen(ZIPRoot); if (l > 0 && ZIPRoot[l - 1] == '\\') @@ -3064,7 +3064,7 @@ BOOL CFileTimeStamps::AddFile(const char* zipFile, const char* zipRoot, const ch StrICmp(item->SourcePath, item2->SourcePath) == 0) { delete item; - return FALSE; // already present, do not add another one + return FALSE; // already present, do not add a duplicate } } @@ -3285,8 +3285,8 @@ void CFileTimeStamps::CheckAndPackAndClear(HWND parent, BOOL* someFilesChanged, { if (someFilesChanged != NULL) *someFilesChanged = TRUE; - // during a critical shutdown we pretend the updated files do not exist; we cannot re-pack them into the archive, - // but we must not delete them either — after startup, the user must still have a chance to manually pack the updated files into the archive + // during a critical shutdown, we pretend the updated files do not exist; we cannot pack them back into the archive, + // but we must not delete them either, so the user still has a chance to pack the updated files into the archive manually after startup if (!CriticalShutdown) { CArchiveUpdateDlg dlg(parent, this, Panel); @@ -3317,7 +3317,7 @@ void CFileTimeStamps::CheckAndPackAndClear(HWND parent, BOOL* someFilesChanged, CFileTimeStampsItem* item2 = List[i]; char* r2 = item2->ZIPRoot; char* s2 = item2->SourcePath; - if (strcmp(r1, r2) == 0 && // identical zip root (case-sensitive comparison required - update test\A.txt and Test\b.txt must not run simultaneously) + if (strcmp(r1, r2) == 0 && // identical ZIP root (case-sensitive comparison required - updates to test\A.txt and Test\b.txt must not run at the same time) StrICmp(s1, s2) == 0) // identical source path { packList.Add(item2); @@ -3390,9 +3390,9 @@ void CTopIndexMem::Push(const char* path, int topIndex) ok = s - path == l && StrNICmp(path, Path, l) == 0; } - if (ok) // it follows -> remember the next top index + if (ok) // if it continues, remember the next top index { - if (TopIndexesCount == TOP_INDEX_MEM_SIZE) // it is necessary to drop the first stored top index + if (TopIndexesCount == TOP_INDEX_MEM_SIZE) // need to discard the oldest top index { int i; for (i = 0; i < TOP_INDEX_MEM_SIZE - 1; i++) @@ -3402,7 +3402,7 @@ void CTopIndexMem::Push(const char* path, int topIndex) strcpy(Path, path); TopIndexes[TopIndexesCount++] = topIndex; } - else // not sequential -> first top index in the series + else // path does not match -> first top index in the sequence { strcpy(Path, path); TopIndexesCount = 1; @@ -3434,7 +3434,7 @@ BOOL CTopIndexMem::FindAndPop(const char* path, int& topIndex) topIndex = TopIndexes[--TopIndexesCount]; return TRUE; } - else // we no longer have this value (it was never stored or was dropped due to low memory) + else // we no longer have this value (it was not stored or was dropped due to low memory) { Clear(); return FALSE; @@ -3474,7 +3474,7 @@ BOOL CFileHistory::AddFile(CFileHistoryItemTypeEnum type, DWORD handlerID, const if (i > 0) { Files.Detach(i); - if (!Files.IsGood()) + if (!Files.IsGood()) Files.ResetState(); // cannot fail; it only reports an out-of-memory condition when shrinking the array Files.Insert(0, item); if (!Files.IsGood()) From 45bed2ae4459589f91d1a7fe08d6bcee858f818c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:45:30 +0200 Subject: [PATCH 468/710] [translation] Fix src/salamdr7.cpp comments Refines translated comments in src/salamdr7.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #923 for src/salamdr7.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/salamdr7.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/salamdr7.cpp b/src/salamdr7.cpp index a44c5f5e0..83e9ae111 100644 --- a/src/salamdr7.cpp +++ b/src/salamdr7.cpp @@ -114,8 +114,8 @@ class CEnvVariables // sorts the array case-insensitively by name void QuickSort(int left, int right); - // if it finds the 'name' item in the array, it returns its index; otherwise it returns -1 - // it assumes the array is sorted alphabetically, it uses interval bisection + // if it finds an item named 'name' in the array, it returns its index; otherwise it returns -1 + // assumes the array is sorted alphabetically; uses binary search int FindItemIndex(const char* name); // adds a copy of the item to the array and sets Type @@ -205,7 +205,7 @@ void CEnvVariables::LoadFromProcess() // if this is not the current directory for drives, store the found item into the array // We ignore: // =::=::\ - // =C:=C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE + // =C:=C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE // =E:=E:\Source\salamand\vcproj if (*begin != '=') { @@ -275,7 +275,7 @@ void CEnvVariables::FindDifferences(CEnvVariables* oldVars, CEnvVariables* newVa } else { - // differences are ignored for now, for example in PATH, etc. + // Differences are ignored for now, for example in PATH. // if (strcmp(oldVar->Value, newVar->Value) != 0) // TRACE_I("DIFF: " << oldVar->Name << " = "<Value<<" : "<Value); // else @@ -507,7 +507,7 @@ BOOL GetResolvedPathMountPointAndGUID(const char* path, char* mountPoint, char* char rootPath[MAX_PATH]; GetRootPath(rootPath, resolvedPath); BOOL remotePath = TRUE; - if (!IsUNCPath(rootPath) && GetDriveType(rootPath) == DRIVE_FIXED) // it only makes sense to look for reparse points on fixed disks + if (!IsUNCPath(rootPath) && GetDriveType(rootPath) == DRIVE_FIXED) // it only makes sense to look for reparse points on fixed drives { BOOL cutPathIsPossible = TRUE; char netPath[MAX_PATH]; @@ -515,7 +515,7 @@ BOOL GetResolvedPathMountPointAndGUID(const char* path, char* mountPoint, char* ResolveLocalPathWithReparsePoints(resolvedPath, path, &cutPathIsPossible, NULL, NULL, NULL, NULL, netPath); remotePath = netPath[0] != 0; - // GetVolumeNameForVolumeMountPoint requires the root + // GetVolumeNameForVolumeMountPoint requires the root path if (cutPathIsPossible) { GetRootPath(rootPath, resolvedPath); @@ -524,9 +524,9 @@ BOOL GetResolvedPathMountPointAndGUID(const char* path, char* mountPoint, char* } else strcpy(resolvedPath, rootPath); // for non-DRIVE_FIXED disks we take the root path, GetVolumeNameForVolumeMountPoint needs a mount point and searching for it by gradually shortening the path still seems too time-consuming (at least for network paths + for cards, mount points in subdirectories should not occur, right?) - // a GUID can also be obtained for non-DRIVE_FIXED disks, for example card readers - // according to https://msdn.microsoft.com/en-us/library/windows/desktop/aa364996%28v=vs.85%29.aspx there is currently no support for DRIVE_REMOTE, - // but that might potentially come as well + // A GUID can also be obtained for non-DRIVE_FIXED disks, for example card readers. + // According to https://msdn.microsoft.com/en-us/library/windows/desktop/aa364996%28v=vs.85%29.aspx, DRIVE_REMOTE is not currently supported, + // but that may potentially be added as well. char guidP[MAX_PATH]; SalPathAddBackslash(resolvedPath, MAX_PATH); // GetVolumeNameForVolumeMountPoint requires a trailing backslash if (GetVolumeNameForVolumeMountPoint(resolvedPath, guidP, sizeof(guidP))) @@ -542,7 +542,7 @@ BOOL GetResolvedPathMountPointAndGUID(const char* path, char* mountPoint, char* } else { - if (!remotePath) // for network paths, it still commonly returns errors = we will not report it, no need to nag + if (!remotePath) // For network paths, this still commonly returns errors, so we will not report it to avoid unnecessary noise. { DWORD err = GetLastError(); TRACE_E("GetResolvedPathMountPointAndGUID(): GetVolumeNameForVolumeMountPoint() failed: " << GetErrorText(err)); From bac4db98c629f47ccef033b49bc68326cb668a93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:45:39 +0200 Subject: [PATCH 469/710] [translation] Fix src/salshlib.h comments Refines translated comments in src/salshlib.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #928 for src/salshlib.h, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/salshlib.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/salshlib.h b/src/salshlib.h index b9bc4171d..9f1004845 100644 --- a/src/salshlib.h +++ b/src/salshlib.h @@ -44,7 +44,7 @@ BOOL IsFakeDataObject(IDataObject* pDataObject, int* fakeType, char* srcFSPathBu // CFakeDragDropDataObject // // data object used to detect the target of a drag & drop operation (used during -// extraction from an archive and when copying from a plug-in file system), +// extraction from an archive and when copying from a plugin file system), // it encapsulates the Windows data object obtained for the "fake" directory and adds // the SALCF_FAKE_REALPATH format (defines the path that should appear after the drop // in the directory line, command line + blocks dropping to the usermenu toolbar), @@ -89,7 +89,7 @@ class CFakeDragDropDataObject : public IDataObject } STDMETHOD(QueryInterface) - (REFIID, void FAR* FAR*); + (REFIID, void FAR * FAR*); STDMETHOD_(ULONG, AddRef) (void) { return ++RefCount; } STDMETHOD_(ULONG, Release) @@ -171,14 +171,14 @@ class CSalShExtPastedData protected: DWORD DataID; // version of data stored for Paste from the clipboard - BOOL Lock; // TRUE = it is locked against deletion, FALSE = not locked + BOOL Lock; // TRUE = locked against cancellation, FALSE = not locked char ArchiveFileName[MAX_PATH]; // full path to the archive char PathInArchive[MAX_PATH]; // path inside the archive where Copy to the clipboard happened CNames SelFilesAndDirs; // names of files and directories from PathInArchive that will be extracted CSalamanderDirectory* StoredArchiveDir; // stored archive structure (used if the archive is not open in the panel) - CPluginDataInterfaceEncapsulation StoredPluginData; // stored plug-in data interface of the archive (used if the archive is not open in the panel) + CPluginDataInterfaceEncapsulation StoredPluginData; // stored plugin data interface of the archive (used if the archive is not open in the panel) FILETIME StoredArchiveDate; // archive file`s date (for testing the validity of the archive listing) CQuadWord StoredArchiveSize; // archive file`s size (for testing the validity of the archive listing) @@ -215,7 +215,7 @@ class CSalShExtPastedData FILETIME archiveDate, CQuadWord archiveSize); // returns TRUE if it is possible to unload the plugin 'plugin'; if the object contains - // data for the plug-in 'plugin', it tries to get rid of them so it can return TRUE + // data for the plugin 'plugin', it tries to get rid of them so it can return TRUE BOOL CanUnloadPlugin(HWND parent, CPluginInterfaceAbstract* plugin); }; @@ -266,7 +266,7 @@ class CFakeCopyPasteDataObject : public IDataObject void SetCutOrCopyDone() { CutOrCopyDone = TRUE; } STDMETHOD(QueryInterface) - (REFIID, void FAR* FAR*); + (REFIID, void FAR * FAR*); STDMETHOD_(ULONG, AddRef) (void) { @@ -291,7 +291,7 @@ class CFakeCopyPasteDataObject : public IDataObject { // TRACE_I("QueryGetData"); if (formatEtc->cfFormat == CF_HDROP) - return DV_E_FORMATETC; // this enforces a "NO" drop in simpler softwares (BOSS, WinCmd, SpeedCommander, MSIE, Word, etc.) + return DV_E_FORMATETC; // this ensures a "NO" drop in simpler applications (BOSS, WinCmd, SpeedCommander, MSIE, Word, etc.) return WinDataObject->QueryGetData(formatEtc); } From df08d255239bbc16d65e54ccb89fa1a8508122a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:45:49 +0200 Subject: [PATCH 470/710] [translation] Fix src/shellib.h comments Refines translated comments in src/shellib.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #931 for src/shellib.h, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/shellib.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/shellib.h b/src/shellib.h index f5b96b294..cfdbd37f7 100644 --- a/src/shellib.h +++ b/src/shellib.h @@ -96,13 +96,13 @@ class CImpIDropSource : public IDropSource DWORD MouseButton; // -1 = uninitialized value, otherwise MK_LBUTTON or MK_RBUTTON public: - // Last effect returned by GiveFeedback method - introduced because + // Last effect returned by the GiveFeedback method. Introduced because // DoDragDrop does not return dwEffect == DROPEFFECT_MOVE; for MOVE it returns dwEffect == 0. - // For the reasons, see "Handling Shell Data Transfer Scenarios", section "Handling Optimized Move Operations": + // For details, see "Handling Shell Data Transfer Scenarios", section "Handling Optimized Move Operations": // http://msdn.microsoft.com/en-us/library/windows/desktop/bb776904%28v=vs.85%29.aspx - // (shortly: an optimized Move is done, which means that it does not create a copy to the destination followed by deleting - // the original, so that the source does not accidentally delete the original (it may not have been moved yet), and it receives - // the operation result DROPEFFECT_NONE or DROPEFFECT_COPY) + // (in short: an optimized Move is performed, which means no copy to the destination followed by deletion + // of the original is done; to prevent the source from accidentally deleting the original before it + // has actually been moved, the operation returns DROPEFFECT_NONE or DROPEFFECT_COPY) DWORD LastEffect; BOOL DragFromPluginFSWithCopyAndMove; // dragging from the plugin FS with possible Copy and Move, details above @@ -123,7 +123,7 @@ class CImpIDropSource : public IDropSource } STDMETHOD(QueryInterface) - (REFIID, void FAR* FAR*); + (REFIID, void FAR * FAR*); STDMETHOD_(ULONG, AddRef) (void) { return ++RefCount; } STDMETHOD_(ULONG, Release) @@ -132,7 +132,7 @@ class CImpIDropSource : public IDropSource if (--RefCount == 0) { delete this; - return 0; // we must not touch the object, it no longer exists + return 0; // Do not touch the object; it no longer exists. } return RefCount; } @@ -345,7 +345,7 @@ class CImpDropTarget : public IDropTarget const wchar_t* mapW); STDMETHOD(QueryInterface) - (REFIID, void FAR* FAR*); + (REFIID, void FAR * FAR*); STDMETHOD_(ULONG, AddRef) (void) { return ++RefCount; } STDMETHOD_(ULONG, Release) @@ -354,7 +354,7 @@ class CImpDropTarget : public IDropTarget if (--RefCount == 0) { delete this; - return 0; // we must not touch the object, it no longer exists + return 0; // The object must not be accessed; it no longer exists } return RefCount; } @@ -433,7 +433,7 @@ class CTextDataObject : public IDataObject } STDMETHOD(QueryInterface) - (REFIID, void FAR* FAR*); + (REFIID, void FAR * FAR*); STDMETHOD_(ULONG, AddRef) (void) { return ++RefCount; } STDMETHOD_(ULONG, Release) From 41aaa9d0d0a94256dc997b8ebd2b95271d825d64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:45:58 +0200 Subject: [PATCH 471/710] [translation] Fix src/stswnd.cpp comments Refines translated comments in src/stswnd.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #944 for src/stswnd.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/stswnd.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/stswnd.cpp b/src/stswnd.cpp index 7b03b299e..40055cf72 100644 --- a/src/stswnd.cpp +++ b/src/stswnd.cpp @@ -389,7 +389,7 @@ void CStatusWindow::SetThrobber(BOOL show, int delay, BOOL calledFromDestroyWind } else { - if (DelayedThrobber) // Waiting to be shown, but the throbber should be hidden, cancel the wait + if (DelayedThrobber) // The throbber is waiting to be shown, but it should be hidden; cancel the wait { if (HWindow == NULL) TRACE_E("Unexpected situation 2 in CStatusWindow::SetThrobber(): DelayedThrobber is TRUE but HWindow is NULL"); @@ -1002,7 +1002,7 @@ void CStatusWindow::Paint(HDC hdc, BOOL highlightText, BOOL highlightHotTrackOnl if (truncateEnd) { // Without truncation, or with the end trimmed ExtTextOut(dc, TextRect.left, textY, 0, NULL, Text, min(visibleChars, firstClipChar), NULL); - if (visibleChars < min(TextLen, firstClipChar)) // If the end was trimmed -> append "..." + if (visibleChars < min(TextLen, firstClipChar)) // If the end was trimmed, append "..." { int offset = (visibleChars > 0) ? AlpDX[visibleChars - 1] : 0; ExtTextOut(dc, TextRect.left + offset, textY, 0, NULL, "...", 3, NULL); @@ -1027,7 +1027,7 @@ void CStatusWindow::Paint(HDC hdc, BOOL highlightText, BOOL highlightHotTrackOnl // Without truncation or the trimmed end int visibleChars2 = visibleChars - lastClipChar; ExtTextOut(dc, TextRect.left + AlpDX[lastClipChar - 1], textY, 0, NULL, Text + lastClipChar, visibleChars2, NULL); - if (visibleChars < TextLen) // If the end was trimmed -> append "..." + if (visibleChars < TextLen) // If the end was truncated, append "..." { int offset = (visibleChars > 0) ? AlpDX[visibleChars - 1] : 0; ExtTextOut(dc, TextRect.left + offset, textY, 0, NULL, "...", 3, NULL); @@ -1339,7 +1339,7 @@ class CTextDropTarget : public IDropTarget } STDMETHOD(QueryInterface) - (REFIID refiid, void FAR* FAR* ppv) + (REFIID refiid, void FAR * FAR * ppv) { if (refiid == IID_IUnknown || refiid == IID_IDropTarget) { @@ -1362,7 +1362,7 @@ class CTextDropTarget : public IDropTarget if (--RefCount == 0) { delete this; - return 0; // Must not touch the object, it no longer exists + return 0; // Must not touch the object; it no longer exists } return RefCount; } @@ -1935,7 +1935,7 @@ CStatusWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) } if (isInSizeRect) { - // Drive info works only if it's not an FS that doesn't support drive info + // Drive info works only if the FS supports drive info if (FilesWindow->Is(ptDisk) || FilesWindow->Is(ptZIPArchive) || FilesWindow->Is(ptPluginFS) && FilesWindow->GetPluginFS()->NotEmpty() && FilesWindow->GetPluginFS()->IsServiceSupported(FS_SERVICE_SHOWINFO)) @@ -2074,7 +2074,7 @@ CStatusWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) CHotTrackItem* lastItem = NULL; if (HotTrackItems.Count > 0) lastItem = &HotTrackItems[HotTrackItems.Count - 1]; - //if (HotItem->Chars != (int)TextLen) // This condition failed when a filter was active + //if (HotItem->Chars != (int)TextLen) // This condition failed when a filter was attached if (HotItem != lastItem) { // Path shortening From 5346bcc0f852e45c9d66246449aa13547a24f1eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:46:08 +0200 Subject: [PATCH 472/710] [translation] Fix src/versinfo.h comments Refines translated comments in src/versinfo.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #945 for src/versinfo.h, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/versinfo.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/versinfo.h b/src/versinfo.h index b3e86503e..3d6ad9c9c 100644 --- a/src/versinfo.h +++ b/src/versinfo.h @@ -4,9 +4,9 @@ #pragma once -// Used to read (and optionally modify) the VERSIONINFO resource. Reading alone +// Used to read (and optionally modify) the VERSIONINFO resource. Reading alone // could be handled by the GetFileVersionInfo/VerQueryValue API, but that API does not support later modifications, -// so we solve the problem with our own module. Using the API would also mean +// so we solve the problem with our own module. Using the API would also mean // linking Version.LIB/DLL, which we do not use for anything else. // WARNING: the module exists both in Salamander and in Translator. @@ -48,7 +48,7 @@ class CVersionBlock WCHAR* Key; BOOL Text; // 1 if the version resource contains text data and 0 if the version resource contains binary data VOID* Value; // depends on Type - WORD ValueSize; // used only for Var blocks, otherwise we compute it + WORD ValueSize; // used only for Var blocks; otherwise computed TIndirectArray Children; public: @@ -117,14 +117,14 @@ class CVersionInfo }; // VS_VERSIONINFO: -// 2 bytes: Length in bytes (this block, and all child blocks. does _not_ include alignment padding between subsequent blocks) -// 2 bytes: Length in bytes of VS_FIXEDFILEINFO struct -// 2 bytes: Type (contains 1 if version resource contains text data and 0 if version resource contains binary data) -// Variable length unicode string (null terminated): Key (currently "VS_VERSION_INFO") -// Variable length padding to align VS_FIXEDFILEINFO on a 32-bit boundary -// VS_FIXEDFILEINFO struct -// Variable length padding to align Child struct on a 32-bit boundary -// Child struct (zero or one StringFileInfo structs, zero or one VarFileInfo structs) +// 2 bytes: Length in bytes (this block and all child blocks; does _not_ include alignment padding between subsequent blocks) +// 2 bytes: Length in bytes of the VS_FIXEDFILEINFO structure +// 2 bytes: Type (1 if the version resource contains text data, 0 if it contains binary data) +// Variable-length Unicode string (null-terminated): Key (currently "VS_VERSION_INFO") +// Variable-length padding to align VS_FIXEDFILEINFO on a 32-bit boundary +// VS_FIXEDFILEINFO structure +// Variable-length padding to align the child structure on a 32-bit boundary +// Child structure (zero or one StringFileInfo structures, zero or one VarFileInfo structures) // StringFileInfo: // 2 bytes: Length in bytes (includes this block, as well as all Child blocks) From e1aa72af1d1395265b26e4423b6105a5ea0e0cf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:46:17 +0200 Subject: [PATCH 473/710] [translation] Fix src/viewer.h comments Refines translated comments in src/viewer.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #946 for src/viewer.h, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/viewer.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/viewer.h b/src/viewer.h index 6df5638f2..231faea1e 100644 --- a/src/viewer.h +++ b/src/viewer.h @@ -169,12 +169,12 @@ class CViewerWindow : public CWindow void CodeCharacters(unsigned char* start, unsigned char* end); // if 'hFile' is NULL, Prepare/LoadBefore/LoadBehind open and close the file themselves - // if 'hFile' points to a variable (initialize its value to NULL at the start), - // the methods open the file and store the file handle into that variable (when opening succeeds). - // On the next call they do not open the file again and reuse the handle from that variable. - // They also do not close the handle when exiting; the caller must handle that. - // This is an optimization for network drives where repeatedly opening/closing the file - // slowed down searching terribly. + // if 'hFile' points to a variable (initialize it to NULL before the first call), + // the methods open the file and store the file handle in that variable if opening succeeds. + // On subsequent calls, they do not open the file again and reuse the handle from that variable. + // They do not close the handle on return; the caller must ensure that. + // This is an optimization for network drives, where repeatedly opening and closing the file + // caused severe delays during searching. BOOL LoadBefore(HANDLE* hFile); BOOL LoadBehind(HANDLE* hFile); @@ -380,8 +380,8 @@ class CViewerWindow : public CWindow DWORD RepeatCmdAfterRefresh; // command to repeat after refresh (-1 = no command) char* Caption; // if not NULL, contains the proposed viewer window caption - BOOL WholeCaption; // meaningful if Caption != NULL. TRUE -> only - // Caption is displayed in the viewer title; FALSE -> append + BOOL WholeCaption; // meaningful if Caption != NULL. TRUE -> only + // Caption is displayed in the viewer title; FALSE -> append // the standard " - Viewer" to Caption. BOOL CanSwitchToHex, // TRUE if switching to hex is possible when there are more than 10000 characters per line From 194eb5c9a67e0c0965d2a02cd76cd87de0b45a91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:46:27 +0200 Subject: [PATCH 474/710] [translation] Fix src/worker.h comments Refines translated comments in src/worker.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #949 for src/worker.h, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/worker.h | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/worker.h b/src/worker.h index 5588193e3..059069e7c 100644 --- a/src/worker.h +++ b/src/worker.h @@ -16,7 +16,7 @@ #define CHATTRS_FILE_SIZE CQuadWord(500, 0) #define MAX_OP_FILESIZE 6500 // WARNING: highest allowed value in this group -// 4/2012 - increased the buffer to ten times the old size; large files over the network now reach speeds +// 4/2012 - increased the buffer to ten times the old size; large files over the network now reach speeds // comparable to Total Commander and finish 2-3x faster than with the previous one-tenth buffer // verified on local disks and across the network; I see no downside to the larger buffer #define OPERATION_BUFFER (10 * 32768) // 320KB buffer for Copy and Move @@ -108,7 +108,7 @@ class CTransferSpeedMeter DWORD MaxPacketSize; // largest packet size we expect public: - BOOL ResetSpeed; // TRUE = the meter should be reset before the next speed measuring (call JustConnected) - the speed drop was so large we ended up displaying zero speed + BOOL ResetSpeed; // TRUE = the meter should probably be reset before the next speed measurement (call JustConnected); the speed drop was too large, so zero speed was displayed public: CTransferSpeedMeter(); @@ -131,9 +131,9 @@ class CTransferSpeedMeter void BytesReceived(DWORD count, DWORD time, DWORD maxPacketSize); // tunes 'progressBufferLimit' according to current received packets data; - // 'lastFileBlockCount' is the limit we must not cross (we consider only continuous + // 'lastFileBlockCount' is the limit we must not cross (we consider only continuous // copying of a single file; the counter 'lastFileBlockCount' is overflow-safe and - // values > 1000000 simply mean "a lot", the exact figure is irrelevant); 'lastFileStartTime' + // values > 1000000 simply mean "a lot", the exact figure is irrelevant); 'lastFileStartTime' // is the GetTickCount() captured when the most recent file copy started void AdjustProgressBufferLimit(DWORD* progressBufferLimit, DWORD lastFileBlockCount, DWORD lastFileStartTime); @@ -201,7 +201,7 @@ enum COperationCode ocCountSize, ocConvert, ocLabelForSkipOfCreateDir, // label to jump to when the script skips on ocCreateDirXXX; WARNING: SourceName and TargetName store the LO- and HI-DWORD of the total file sizes (including ADS) contained in the skipped directory; WARNING: Attr stores the ocCreateDirXXX index in the COperations array for that directory - ocCopyDirTime, // Move/Copy: when filterCriteria->PreserveDirTime==TRUE copy the directory timestamps; WARNING: lastWrite is stored in SourceName and Attr (applies to every type; just two DWORDs) + ocCopyDirTime, // Move/Copy: when filterCriteria->PreserveDirTime==TRUE, copy the directory timestamps; WARNING: lastWrite is stored in SourceName and Attr (used regardless of type; just two DWORDs) }; #define OPFL_OVERWROLDERALRTESTED 0x00000001 // the "overwrite older, skip other existing" test has already been performed @@ -250,7 +250,7 @@ class COperations : public TDirectArray BOOL RemovableTgtDisk; // is this writing to removable media? BOOL RemovableSrcDisk; // is this reading from removable media? - BOOL CanUseRecycleBin; // can we use the Recycle Bin? (only local fixed drives) + BOOL CanUseRecycleBin; // can the Recycle Bin be used? (only on local fixed drives) BOOL SameRootButDiffVolume; // TRUE if this is a Move between paths with the same root but different volumes (at least one path contains a junction point) BOOL TargetPathSupADS; // TRUE if the copy/move target supports ADS (delete the file's ADS (or the whole files) before overwriting) // BOOL TargetPathSupEFS; // TRUE if the copy/move target supports EFS (or less generally: it is NTFS rather than FAT) @@ -259,7 +259,7 @@ class COperations : public TDirectArray BOOL IsCopyOrMoveOperation; // TRUE = this is a Copy/Move operation (add it to the queue of disk Copy/Move operations) BOOL OverwriteOlder; // overwrite older items and skip newer ones without prompting BOOL CopySecurity; // preserve NTFS permissions; FALSE = don't care = perform no extra handling and accept any result - BOOL CopyAttrs; // preserve the Archive, Encrypt, and Compress attributes; FALSE = don't care = perform no extra handling and accept any result + BOOL CopyAttrs; // preserve the Archive, Encrypted, and Compressed attributes; FALSE = don't care = perform no extra handling and accept any result BOOL PreserveDirTime; // preserve directory timestamps (during Move we detect unintended changes and fix them manually; works e.g. on Samba) BOOL StartOnIdle; // should start only when nothing else is running BOOL SourcePathIsNetwork; // TRUE = the source path is a network path (UNC or mapped drive) @@ -302,7 +302,7 @@ class COperations : public TDirectArray DWORD ProgressBufferLimit; // copy buffer size limit to keep progress updates reasonably frequent DWORD LastProgBufLimTestTime; // GetTickCount() from the last ProgressBufferLimit size evaluation DWORD LastFileBlockCount; // blocks copied since the last file started (WARNING: overflow-protected; values > 1000000 mean "a lot", the exact amount doesn't matter) - DWORD LastFileStartTime; // GetTickCount() from when we started copying the last file + DWORD LastFileStartTime; // GetTickCount() value from when the last file started copying public: COperations(int base, int delta, char* waitInQueueSubject, char* waitInQueueFrom, char* waitInQueueTo); @@ -354,7 +354,7 @@ class COperationsQueue // queue of disk Copy/Move operations // OperDlgs and OperPaused arrays have the same number of elements and share indices (each operation uses the same index in both arrays) TDirectArray OperDlgs; // array of HWND handles: dialogs of operations in the queue - TDirectArray OperPaused; // int array describing queue operation state: 2/1/0 = "manually-paused"/"auto-paused"/"running" + TDirectArray OperPaused; // array of int values describing the operation state in the queue: 2/1/0 = "manually-paused"/"auto-paused"/"running" public: COperationsQueue() : OperDlgs(5, 10), OperPaused(5, 10) @@ -505,21 +505,21 @@ typedef struct } FILE_STREAM_INFORMATION, *PFILE_STREAM_INFORMATION; #pragma pack() -// enumerates alternate data streams (ADS) of a file/directory ('isDir' is FALSE/TRUE) -// 'fileName'; meaningful only on NTFS disks; if 'adsSize' is not NULL it returns the -// sum of the sizes of all ADS; if 'streamNames' is not NULL it returns an allocated array -// of Unicode names of all ADS (except the default ADS) - the elements of the array are allocated -// the caller must dealocate them and the array itself; the array of names is returned only -// if no error occurred (see 'lowMemory' and 'winError') and ADS were found (the function -// returns TRUE); if 'streamNamesCount' is not NULL it returns the number of elements -// in 'streamNames'; if 'lowMemory' is not NULL it returns TRUE when an out-of-memory -// error occurs (only possible when 'streamNames' is not NULL); if 'winError' is not NULL +// determines the alternate data streams (ADS) of a file/directory ('isDir' is FALSE/TRUE) +// for 'fileName'; meaningful only on NTFS volumes; if 'adsSize' is not NULL, it returns the +// sum of the sizes of all ADS; if 'streamNames' is not NULL, it returns an allocated array +// of Unicode names of all ADS (except the default ADS) - the elements of the array are allocated, +// and the caller must deallocate them and the array itself; the array of names is returned only +// if no error occurred (see 'lowMemory' and 'winError') and ADS were found (the function +// returns TRUE); if 'streamNamesCount' is not NULL, it returns the number of elements +// in 'streamNames'; if 'lowMemory' is not NULL, it returns TRUE when an out-of-memory +// error occurs (possible only when 'streamNames' is not NULL); if 'winError' is not NULL, // it returns the Windows error code (NO_ERROR if none occurred - if a Windows error occurs, -// the function always returns FALSE); the function returns TRUE if the file/directory -// contains ADS, otherwise FALSE; 'bytesPerCluster' is the cluster size -// used to compute disk space occupied by the ADS (0 = unknown size); -// in 'adsOccupiedSpace' (if not NULL) it returns the disk space occupied by the ADS; -// in 'onlyDiscardableStreams' (if not NULL) it returns TRUE if only ADS +// the function always returns FALSE); the function returns TRUE if the file/directory +// contains any ADS, otherwise FALSE; 'bytesPerCluster' is the cluster size +// used to compute the disk space occupied by the ADS (0 = unknown size); +// in 'adsOccupiedSpace' (if not NULL), it returns the disk space occupied by the ADS; +// in 'onlyDiscardableStreams' (if not NULL), it returns TRUE if only ADS // that can be discarded without prompting were found (currently only thumbnails from W2K) BOOL CheckFileOrDirADS(const char* fileName, BOOL isDir, CQuadWord* adsSize, wchar_t*** streamNames, int* streamNamesCount, BOOL* lowMemory, DWORD* winError, From b23e490294d667ef4f1a1dffc82aad5f013a85b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:46:36 +0200 Subject: [PATCH 475/710] [translation] Fix src/viewer3.cpp comments Refines translated comments in src/viewer3.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #950 for src/viewer3.cpp, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/viewer3.cpp | 66 ++++++++++++++++++++++++------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/src/viewer3.cpp b/src/viewer3.cpp index b2376574b..bc4993f29 100644 --- a/src/viewer3.cpp +++ b/src/viewer3.cpp @@ -31,7 +31,7 @@ void CViewerWindow::SetViewerCaption() caption[0] = 0; } else - lstrcpyn(caption, Caption, MAX_PATH); // caption according to the plug-in request + lstrcpyn(caption, Caption, MAX_PATH); // caption according to the plugin request if (Caption == NULL || !WholeCaption) { if (caption[0] != 0) @@ -243,7 +243,7 @@ CViewerWindow::GetMaxVisibleLineLen(__int64 newFirstLineLen, BOOL ignoreFirstLin case vtText: { int lineOffsetCount = LineOffset.Count; - if (newFirstLineLen != -1) // situation: scroll down by one line (there will be a new first line) + if (newFirstLineLen != -1) // scrolling down by one line (there will be a new first line) { max = newFirstLineLen; if (lineOffsetCount >= 3) @@ -298,7 +298,7 @@ void CViewerWindow::EnsureXVisibleInView(__int64 x, BOOL showPrevChar, BOOL& ful // terminated by EOL (not wrapping), the 'x' position is beyond the end of the view (the condition above is met), // but 'OriginX' can no longer be increased (it is already at 'maxOX'), so prevent needless redrawing // of the entire view - if (maxOX > OriginX) // only if it is still possible to move the view to the right + if (maxOX > OriginX) // only if the view can still be moved to the right { OriginX = x - columns + MAKEVIS_LEFTRIGHT; if (OriginX > maxOX) @@ -346,7 +346,7 @@ CViewerWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) BOOL fatalErr = FALSE; FileChanged(NULL, FALSE, fatalErr, FALSE); if (!fatalErr && ExitTextMode) - SeekY = LastSeekY; // in HEX we want to be roughly at the same position as before in Text mode + SeekY = LastSeekY; // in HEX mode, we want to be at roughly the same position as before in Text mode if (!fatalErr && !ExitTextMode) { SeekY = min(MaxSeekY, LastSeekY); // restore LastSeekY in the new version of the file @@ -357,7 +357,7 @@ CViewerWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (fatalErr) { FatalFileErrorOccured(); - // // I commented out this block because otherwise the "Retry" button in the message box with the error opened from LoadBehind() and LoadBefore() does not work + // // This block was commented out because otherwise the "Retry" button in the error message box opened from LoadBehind() and LoadBefore() does not work // if (Caption != NULL) // { // free(Caption); @@ -367,7 +367,7 @@ CViewerWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) // if (Lock != NULL) // { // SetEvent(Lock); - // Lock = NULL; // from now on it relies on the disk cache only + // Lock = NULL; // from now on, only the disk cache handles this // } // FileName = NULL; // Seek = 0; @@ -720,7 +720,7 @@ CViewerWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case SB_THUMBPOSITION: { - // drag finished; we must call OnVScroll() from here or the scrollbar briefly blinks at the old position + // dragging finished; we must call OnVScroll() from here, otherwise the scrollbar briefly flashes at the old position VScrollWParam = wParam; KillTimer(HWindow, IDT_THUMBSCROLL); MSG msg; // we do not want any additional timer; clear the queue @@ -733,9 +733,9 @@ CViewerWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case SB_THUMBTRACK: { - // the actual scrolling runs from a timer because USB mice and MS scrollbars - // misbehave otherwise: when the viewer is fullscreen, repainting the whole window - // takes long enough that the stubborn scrollbar waits, so dragging feels like + // the actual scrolling runs from a timer because USB mice and MS scrollbars + // misbehave otherwise: when the viewer is fullscreen, repainting the whole window + // takes long enough that the stubborn scrollbar waits, so dragging feels like // a chewing gum; posting the scroll message or deferring painting did not help; // a timer was the only reliable fix we found. if (VScrollWParam == -1) @@ -819,7 +819,7 @@ CViewerWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_COMMAND: { - if (!IsWindowEnabled(HWindow)) // workaround for brain-dead software that activates the main window while our modal dialog is open (e.g. ClipMate) + if (!IsWindowEnabled(HWindow)) // workaround for software that activates the main window while a modal dialog is open (e.g. ClipMate) return 0; BOOL ch = FALSE; switch (LOWORD(wParam)) @@ -914,7 +914,7 @@ CViewerWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) FileName, LOWORD(wParam) == CM_NEXTSELFILE, TRUE, fileName, &noMoreFiles, &srcBusy, NULL); - if (ok && LOWORD(wParam) == CM_NEXTSELFILE) // take only selected files + if (ok && LOWORD(wParam) == CM_NEXTSELFILE) // selected files only { BOOL isSrcFileSel = FALSE; ok = IsFileNameForViewerSelected(EnumFileNamesSourceUID, enumFileNamesLastFileIndex, @@ -933,7 +933,7 @@ CViewerWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) } OpenFile(fileName, NULL, FALSE); - // set the index even if it failed so the user can move to the next/previous file + // set the index even on failure so the user can move to the next/previous file EnumFileNamesLastFileIndex = enumFileNamesLastFileIndex; } else @@ -1116,7 +1116,7 @@ CViewerWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) StartSelection = lineBegin + found; FindOffset = EndSelection = StartSelection + foundLen; SelectionIsFindResult = TRUE; - break; // found! + break; // match found } } else // error - low memory @@ -1229,7 +1229,7 @@ CViewerWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) FindOffset = StartSelection = lineBegin + found; EndSelection = StartSelection + foundLen; SelectionIsFindResult = TRUE; - break; // found! + break; // match found } } else // error - low memory @@ -1502,7 +1502,7 @@ CViewerWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (h != NULL) { __int64 startSel = min(StartSelection, EndSelection); - // if (startSel == -1) startSel = 0; // cannot happen (-1 can only be both at once and we do not get here) + // if (startSel == -1) startSel = 0; // cannot happen (-1 can only occur when both are -1, and we do not get here) __int64 endSel = max(StartSelection, EndSelection); // if (endSel == -1) endSel = 0; // cannot happen (-1 can only be both at once and we do not get here) if (fatalErr || !CopyHTextToClipboard(h, (int)(endSel - startSel))) @@ -1590,7 +1590,7 @@ CViewerWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) char path[MAX_PATH]; if (endBackSlash != NULL) { - if (attr != 0xFFFFFFFF) // file overwrite -> do it via a temp file (because of self-overwrite) + if (attr != 0xFFFFFFFF) // file overwrite -> do it via a temp file (to avoid self-overwrite) { memcpy(path, fileName, endBackSlash - fileName + 1); path[endBackSlash - fileName + 1] = 0; @@ -1615,7 +1615,7 @@ CViewerWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (fatalErr) break; if (len == 0) - break; // read error + break; // write error if (!WriteFile(file, Buffer + (off - Seek), (int)len, &written, NULL) || written != len) { @@ -1828,7 +1828,7 @@ CViewerWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) { Configuration.AutoCopySelection = !Configuration.AutoCopySelection; - if (MainWindow != NULL && MainWindow->HWindow != NULL) // propagate the value to plug-ins as SALCFG_AUTOCOPYSELTOCLIPBOARD, i.e. notify them about the change + if (MainWindow != NULL && MainWindow->HWindow != NULL) // propagate the value to plugins as SALCFG_AUTOCOPYSELTOCLIPBOARD, i.e. notify them about the change PostMessage(MainWindow->HWindow, WM_USER_DISPACHCFGCHANGE, 0, 0); return 0; @@ -2114,12 +2114,12 @@ CViewerWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) while (1) { for (int i = 0; i + 3 < LineOffset.Count; i += 3) - { // search for the end of the selection in LineOffset without the last line (if it is only partially visible, - // that's fine; if it is fully visible we will find the end of the selection in it as well, see below) - // in wrap mode: if the block is forward (dragged from the beginning towards the end of the file) and ends at the end + { // search for the end of the selection in LineOffset except for the last line (if it is only partially visible, + // that is OK; if it is fully visible, we will find the end of the selection there as well, see below) + // in wrap mode: if the block is forward (dragged from the beginning toward the end of the file) and ends at the end // of a wrapped line, it is drawn at the end of the wrapped line and not at the beginning of the next line (both positions - // share the same offset); if the block is backward (dragged in the opposite direction) it is drawn for the same offset - // from the beginning of the line and not from the end of the previous line = the selection of 'endSelLineIndex' must respect this + // have the same offset); if the block is backward (dragged in the opposite direction), it is drawn for the same offset + // from the beginning of the line and not from the end of the previous line; the choice of 'endSelLineIndex' must respect this if ((EndSelection > LineOffset[i] || // wrap mode only: if the view starts with the continuation of a wrapped line and a forward block ends at the view's // starting offset, we need the previous line where the drawn block ends (the "cursor" is outside the view) @@ -2352,7 +2352,7 @@ CViewerWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) } } else - skipCmd = TRUE; // no next line exists = we are at the end of the file, cannot go further + skipCmd = TRUE; // there is no next line, so we are at the end of the file and cannot go any further } break; } @@ -2360,7 +2360,7 @@ CViewerWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case CM_EXTSEL_UP: case CM_EXTSEL_DOWN: { - if (EndSelectionPrefX == -1) // no preferred X coordinate yet; initialize it to the block end + if (EndSelectionPrefX == -1) // no preferred X coordinate yet; initialize it to the coordinate of the block end { if (!GetXFromOffsetInText(&EndSelectionPrefX, EndSelection, endSelLineIndex)) return 0; @@ -2762,12 +2762,12 @@ CViewerWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) { if (shiftPressed && StartSelection != -1 || GetOffset((short)LOWORD(lParam), (short)HIWORD(lParam), off, fatalErr) && !fatalErr) - { // we must determine the position of the drag start/end - leftMost must be FALSE + { // determine the drag start/end position; leftMost must be FALSE SetCapture(HWindow); MouseDrag = TRUE; SelectionIsFindResult = FALSE; ChangingSelWithShiftKey = FALSE; - if (shiftPressed && StartSelection != -1) // changing the block end (Shift+click) + if (shiftPressed && StartSelection != -1) // changing the end of the block (Shift+click) { EndSelectionRow = -1; // currently invalid; do not look for the end of the current block PostMouseMove(); @@ -2930,8 +2930,8 @@ CViewerWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) // but we do not care, precise detection would be unnecessarily complex) if (WrapText && StartSelection < EndSelection && off > EndSelection && minRow > 0) minRow--; - // when shortening the block after reaching the left edge of the view (start of the line after wrapping) - // repaint the end of the previous line (its black-end was erased) + // when shortening the block after reaching the left edge of the view (start of the line after line wrapping) + // repaint the end of the previous line to erase its black end if (WrapText && StartSelection < EndSelection && off < EndSelection && (x - BORDER_WIDTH + CharWidth / 2) / CharWidth <= Configuration.TabSize / 2 && minRow > 0) { @@ -3198,7 +3198,7 @@ MENU_TEMPLATE_ITEM ViewerCodingMenu[] = }; */ - // Recognize at the very top of the submenu and follow it with a separator + // Recognize at the very top, then a separator mi.fMask = MIIM_TYPE | MIIM_ID; mi.fType = MFT_STRING; mi.wID = CM_RECOGNIZE_CODEPAGE; @@ -3211,10 +3211,10 @@ MENU_TEMPLATE_ITEM ViewerCodingMenu[] = InsertMenuItem(subMenu, 1, TRUE, &mi); count++; - // append another separator at the end of the submenu + // separator at the bottom InsertMenuItem(subMenu, count++, TRUE, &mi); - // now append the rest of the commands + // and the commands mi.fMask = MIIM_TYPE | MIIM_ID; mi.fType = MFT_STRING; From 3d36a5525d5dfab88cc4c24dde4b9f62b7c55a5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 22:46:46 +0200 Subject: [PATCH 476/710] [translation] Fix src/zip.h comments Refines translated comments in src/zip.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #951 for src/zip.h, confirmed the CommentsTranslationProject translated header marker, reran clang-format on the PR head branch, and verified the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a final clang-format normalization commit. --- src/zip.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/zip.h b/src/zip.h index c9cc9ecb1..3b095a167 100644 --- a/src/zip.h +++ b/src/zip.h @@ -31,10 +31,10 @@ class CZIPUnpackProgress : public CCommonDialog void Set(const char* title, HWND parent, const CQuadWord& totalSize, BOOL fileProgress); void Set(const char* title, HWND parent, const CQuadWord& totalSize1, const CQuadWord& totalSize2); - void SetTotal(const CQuadWord& total1, const CQuadWord& total2); // CQuadWord(-1, -1) means do not set + void SetTotal(const CQuadWord& total1, const CQuadWord& total2); // CQuadWord(-1, -1) means do not update int AddSize(int size, BOOL delayedPaint); // returns "continue?" - int SetSize(const CQuadWord& size1, const CQuadWord& size2, BOOL delayedPaint); // returns "continue?"; size == CQuadWord(-1, -1) means "do not set" + int SetSize(const CQuadWord& size1, const CQuadWord& size2, BOOL delayedPaint); // returns "continue?"; passing CQuadWord(-1, -1) for a size means "do not set" void NewLine(const char* txt, BOOL delayedPaint); void EnableCancel(BOOL enable); @@ -97,9 +97,9 @@ class CSalamanderForOperations : public CSalamanderForOperationsAbstract CSalamanderForOperations(CFilesWindow* panel); ~CSalamanderForOperations(); - // PROGRESS DIALOG: the dialog contains one or two progress meters (depending on 'twoProgressBars' FALSE/TRUE) + // PROGRESS DIALOG: the dialog contains one or two progress bars ('twoProgressBars' is FALSE/TRUE) // opens the progress dialog with the title 'title'; 'parent' is the parent window of the progress dialog (if - // NULL, the main window is used); if it contains only one progress meter, it can be labeled + // NULL, the main window is used); if it contains only one progress bar, it can be labeled // as "File" ('fileProgress' is TRUE) or "Total" ('fileProgress' is FALSE) virtual void WINAPI OpenProgressDialog(const char* title, BOOL twoProgressBars, HWND parent, BOOL fileProgress); // prints the text 'txt' (even multiple lines - splits to lines) into the progress dialog @@ -110,7 +110,7 @@ class CSalamanderForOperations : public CSalamanderForOperationsAbstract virtual void WINAPI ProgressSetTotalSize(const CQuadWord& totalSize1, const CQuadWord& totalSize2); // if 'size1' is not CQuadWord(-1, -1), sets the value of 'size1' (size1/total1*100 percent) on the first progress meter, // if 'size2' is not CQuadWord(-1, -1), sets the value of 'size2' (size2/total2*100 percent) on the second progress meter - // (for a progress dialog with a single progress meter, 'size2' must be CQuadWord(-1, -1)); returns whether the action + // (for a progress dialog with a single progress meter, 'size2' must be CQuadWord(-1, -1)); returns whether the action // should continue (FALSE = end) virtual BOOL WINAPI ProgressSetSize(const CQuadWord& size1, const CQuadWord& size2, BOOL delayedPaint); // adds the size 'size' (optionally to both progress meters) (size/total*100 percent progress), @@ -189,7 +189,7 @@ class CSalamanderDirectory : public CSalamanderDirectoryAbstract int SalDirStrCmp(const char* s1, const char* s2); int SalDirStrCmpEx(const char* s1, int l1, const char* s2, int l2); - // calls 'pluginData'.ReleaseFilesOrDirs (releasing plug-in data) for all files (if 'releaseFiles' is TRUE) + // calls 'pluginData'.ReleaseFilesOrDirs (releasing plugin data) for all files (if 'releaseFiles' is TRUE) // and all directories (if 'releaseDirs' is TRUE) void ReleasePluginData(CPluginDataInterfaceEncapsulation& pluginData, BOOL releaseFiles, BOOL releaseDirs); @@ -207,10 +207,10 @@ class CSalamanderDirectory : public CSalamanderDirectoryAbstract // returns the directory size - sum of all files in it; note: counters must be reset beforehand CQuadWord GetDirSize(const char* path, const char* dirName, int* dirsCount = NULL, int* filesCount = NULL, TDirectArray* sizes = NULL); - // returns the salamander-dir for the specified directory; if 'readOnly' is TRUE, + // returns the salamander-dir for the specified directory; if 'readOnly' is TRUE, // the returned salamander-dir object must not be modified CSalamanderDirectory* GetSalamanderDir(const char* path, BOOL readOnly); - // returns the salamander-dir for the specified directory index; + // returns the salamander-dir for the specified directory index; // the returned salamander-dir object must not be modified CSalamanderDirectory* GetSalamanderDir(int i); // returns the index of the directory specified by name @@ -312,7 +312,7 @@ class CPackerConfigData BOOL SupportLongNames; BOOL NeedANSIListFile; - // helper flag to detect the data layout - TRUE = legacy -> 'Type' (0 ZIP, 1 external, 2 TAR, 3 PAK) + // Helper flag indicating the legacy data type format: TRUE -> 'Type' (0 ZIP, 1 external, 2 TAR, 3 PAK) BOOL OldType; public: @@ -526,7 +526,7 @@ class CUnpackerConfig { protected: int PreferedUnpacker; - TIndirectArray Unpackers; // array of packer information, elements of type (CUnpackerConfigData *) + TIndirectArray Unpackers; // array of unpacker information, elements of type (CUnpackerConfigData *) public: CUnpackerConfig(/*BOOL disableDefaultValues = FALSE*/); From eaa11f00b944bc68789d2c72498d1b368adbf441 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:04:56 +0200 Subject: [PATCH 477/710] [translation] Fix src/plugins/undelete/dialogs.cpp comments Refines translated comments in src/plugins/undelete/dialogs.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #754 for src/plugins/undelete/dialogs.cpp, restored the required CommentsTranslationProject translated marker on the head branch, reran clang-format, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/undelete/dialogs.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/plugins/undelete/dialogs.cpp b/src/plugins/undelete/dialogs.cpp index f153dbd7e..932c5943b 100644 --- a/src/plugins/undelete/dialogs.cpp +++ b/src/plugins/undelete/dialogs.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -220,7 +221,7 @@ INT_PTR CCopyProgressDlg::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) } if (Parent != NULL) SalamanderGeneral->MultiMonCenterWindow(HWindow, Parent, TRUE); - break; // request focus from DefDlgProc + break; // let DefDlgProc set the focus } case WM_COMMAND: @@ -389,13 +390,13 @@ void CConnectDialog::InitDrives() case PATH_TYPE_FS: { - // remove the "del:" prefix so correct path will be selected when opening this dialog box on Undelete path + // Remove the "del:" prefix so the correct path is selected when opening this dialog box from an Undelete path. if (archiveOrFS != NULL) memmove(sourcePanelPath, archiveOrFS + 1, strlen(archiveOrFS + 1) + 1); break; } - // can't do much about this + // not much can be done here default: break; } @@ -429,7 +430,7 @@ void CConnectDialog::InitDrives() int serial = 0; for (i = 0; i < volumeListing.Count; ++i) { - // for simple disks get the icon from system, for mount points or unmounted disks get just plain HDD icon + // for regular disks, get the icon from the system; for mount points or unmounted disks, use a plain HDD icon // (passing MountPoints instead of volumeName is much faster for some disks) HICON icn; if (volumeListing[i].MountPoint && (3 == strlen(volumeListing[i].MountPoint))) From f1061a051316b390529a4f33a7b2642c66755070 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:05:24 +0200 Subject: [PATCH 478/710] [translation] Fix src/plugins/undelete/fs1.cpp comments Refines translated comments in src/plugins/undelete/fs1.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #755 for src/plugins/undelete/fs1.cpp, restored the required CommentsTranslationProject translated marker on the head branch, reran clang-format, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/undelete/fs1.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/plugins/undelete/fs1.cpp b/src/plugins/undelete/fs1.cpp index 7dcaad163..66f26b6f3 100644 --- a/src/plugins/undelete/fs1.cpp +++ b/src/plugins/undelete/fs1.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -102,16 +103,16 @@ CPluginInterfaceForFS::ExecuteOnFS(int panel, CPluginFSInterfaceAbstract* plugin panel, pluginFSName, pluginFSNameIndex, isDir); CPluginFSInterface* fs = (CPluginFSInterface*)pluginFS; - if (isDir) // sub-dir or up-dir + if (isDir) // subdirectory or parent directory { char newPath[MAX_PATH]; strcpy(newPath, fs->Path); - if (isDir == 2) // up-dir + if (isDir == 2) // parent directory { char* cutDir = NULL; if (SalamanderGeneral->CutDirectory(newPath, &cutDir)) // cut last component from the path { - int topIndex; // next top-index, -1 -> invalid + int topIndex; // next top index; -1 means invalid if (!fs->TopIndexMem.FindAndPop(newPath, topIndex)) topIndex = -1; // change path in panel @@ -127,15 +128,15 @@ CPluginInterfaceForFS::ExecuteOnFS(int panel, CPluginFSInterfaceAbstract* plugin strcpy(backupPath, newPath); int topIndex = SalamanderGeneral->GetPanelTopIndex(panel); - if (SalamanderGeneral->SalPathAppend(newPath, file.Name, MAX_PATH)) // set path + if (SalamanderGeneral->SalPathAppend(newPath, file.Name, MAX_PATH)) // append the name to the path { // change path in panel fs = NULL; // after ChangePanelPathToXXX the pointer could be invalid if (SalamanderGeneral->ChangePanelPathToPluginFS(panel, pluginFSName, newPath)) { fs = (CPluginFSInterface*)SalamanderGeneral->GetPanelPluginFS(panel); // we need to get current object (in case FS changes) - if (fs != NULL && fs == pluginFS) // if it is original FS - fs->TopIndexMem.Push(backupPath, topIndex); // store top-index for return + if (fs != NULL && fs == pluginFS) // if this is the original FS + fs->TopIndexMem.Push(backupPath, topIndex); // store the top index for returning } } } From a70bcf5994bb0373035138d57d6d53e7234e4311 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:05:52 +0200 Subject: [PATCH 479/710] [translation] Fix src/plugins/undelete/fs2.cpp comments Refines translated comments in src/plugins/undelete/fs2.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #756 for src/plugins/undelete/fs2.cpp, restored the required CommentsTranslationProject translated marker on the head branch, reran clang-format, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/undelete/fs2.cpp | 51 ++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/src/plugins/undelete/fs2.cpp b/src/plugins/undelete/fs2.cpp index 722067f16..1e25af8fd 100644 --- a/src/plugins/undelete/fs2.cpp +++ b/src/plugins/undelete/fs2.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -152,9 +153,9 @@ BOOL WINAPI CPluginFSInterface::GetFullName(CFileData& file, int isDir, char* buf, int bufSize) { CALL_STACK_MESSAGE3("CPluginFSInterface::GetFullName(, %d, , %d)", isDir, bufSize); - lstrcpyn(buf, Path, bufSize); // if path doesn't fit, name doesn't fit too (report error) + lstrcpyn(buf, Path, bufSize); // If the path does not fit, the name will not fit either (report an error). if (isDir == 2) - return SalamanderGeneral->CutDirectory(buf, NULL); // up-dir + return SalamanderGeneral->CutDirectory(buf, NULL); // parent directory else return SalamanderGeneral->SalPathAppend(buf, file.Name, bufSize); } @@ -181,7 +182,7 @@ CPluginFSInterface::IsOurPath(int currentFSNameIndex, int fsNameIndex, const cha CALL_STACK_MESSAGE4("CPluginFSInterface::IsOurPath(%d, %d, %s)", currentFSNameIndex, fsNameIndex, userPart); if (WantReconnect) - return FALSE; // user wants new connection + return FALSE; // user requested a new connection char buffer[MAX_PATH]; if (!RootPathFromFull(userPart, buffer, MAX_PATH)) return FALSE; @@ -226,7 +227,7 @@ CPluginFSInterface::ChangePath(int currentFSNameIndex, char* fsName, int fsNameI if (forceRefresh) IsSnapshotValid = FALSE; - // tests and inits + // checks and initialization if (mode != 3 && (pathWasCut != NULL || cutFileName != NULL)) { TRACE_E("Incorrect value of 'mode' in CPluginFSInterface::ChangePath()."); @@ -322,7 +323,7 @@ CPluginFSInterface::ChangePath(int currentFSNameIndex, char* fsName, int fsNameI IsSnapshotValid = TRUE; } - // walk through all path components, also moving in directories structure + // Walk through all path components while traversing the directory structure CurrentDir = Snapshot->Root; // we will cut path to individual parts char temp[MAX_PATH]; @@ -341,12 +342,12 @@ CPluginFSInterface::ChangePath(int currentFSNameIndex, char* fsName, int fsNameI DIR_ITEM_I* di = &CurrentDir->DirItems[i]; if (!namecmp(di->FileName->FNName, component)) { - if (di->Record->IsDir) // yes, it is direcotry + if (di->Record->IsDir) // yes, it is a directory { SalamanderGeneral->SalPathAppend(Path, component, MAX_PATH); CurrentDir = di->Record; } - else // it is file + else // it is a file { if (cutFileName != NULL) lstrcpyn(cutFileName, di->FileName->FNName, MAX_PATH); @@ -361,8 +362,8 @@ CPluginFSInterface::ChangePath(int currentFSNameIndex, char* fsName, int fsNameI { if (pathWasCut != NULL) *pathWasCut = TRUE; - // originally here was mode > 1 but I received messages when connecting from directory - // where are no deleted files (so path doesn't point there) + // Originally this was `mode > 1`, but I received messages when connecting from a directory + // with no deleted files, so the path did not point there. if (mode == 3) String::Error(IDS_UNDELETE, IDS_PATHNOTFOUND); return mode != 3; @@ -390,7 +391,7 @@ CPluginFSInterface::ListCurrentPath(CSalamanderDirectoryAbstract* dir, return FALSE; } - // set valid 'fd' data members + // Set valid members of fd dir->SetValidData(VALID_DATA_EXTENSION | VALID_DATA_DOSNAME | VALID_DATA_SIZE | @@ -417,7 +418,7 @@ CPluginFSInterface::ListCurrentPath(CSalamanderDirectoryAbstract* dir, } dir->SetApproximateCount(filesCount, dirsCount); - // add up-dir if we are not in root + // add the up-directory entry if we are not at the root CFileData fd; memset(&fd, 0, sizeof(fd)); if (CurrentDir != Snapshot->Root) @@ -755,7 +756,7 @@ BOOL CPluginFSInterface::CopyFile(FILE_RECORD_I* record, char* filename, c } else { - // for view it is simple + // for viewing, this is simple lstrcpyn(path, targetPath, MAX_PATH); lstrcpyn(SourcePath, filename, MAX_PATH); oldlen = 0; @@ -852,7 +853,7 @@ BOOL CPluginFSInterface::CopyFile(FILE_RECORD_I* record, char* filename, c if (BackupEncryptedFiles) { - BYTE buffer2[5000]; // WriteEncryptedFileRaw is also using buffer with size 5000 + BYTE buffer2[5000]; // WriteEncryptedFileRaw also uses a 5000-byte buffer ULONG length; ULONG numw; do @@ -913,7 +914,7 @@ BOOL CPluginFSInterface::CopyFile(FILE_RECORD_I* record, char* filename, c { DWORD numw; CStreamReader reader; - reader.Init(&Volume, stream); // fixme: return value + reader.Init(&Volume, stream); // FIXME: check the return value QWORD bytesleft = stream->DSSize; QWORD clustersleft = (bytesleft - 1) / Volume.BytesPerCluster + 1; BOOL exitLoop = FALSE; @@ -979,13 +980,13 @@ BOOL CPluginFSInterface::CopyFile(FILE_RECORD_I* record, char* filename, c bytesleft -= nb; } } - if (ret && streamIndex == copyStreams.Count - 1) // set time + if (ret && streamIndex == copyStreams.Count - 1) // set file times SetFileTime(file.HFile, &record->TimeCreation, &record->TimeLastAccess, &record->TimeLastWrite); SalamanderSafeFile->SafeFileClose(&file); } if (encrypted) - break; // we don't walk through all streams for encrypted files + break; // do not iterate through all streams for encrypted files } // remove file on error @@ -1079,7 +1080,7 @@ QWORD CPluginFSInterface::GetDirSize(FILE_RECORD_I* record, int plus, BOOL if (r->IsDir) size += GetDirSize(r, plus, encrypted); else - size += GetFileSize(r, encrypted) + plus; // +1 for all-zero-size situation + size += GetFileSize(r, encrypted) + plus; // +1 for the all-zero-size case } return size + plus; } @@ -1158,7 +1159,7 @@ void UndeleteGetResolvedRootPath(const char* path, char* resolvedPath) { BOOL cutPathIsPossible = TRUE; SalamanderGeneral->ResolveLocalPathWithReparsePoints(resolvedPath, path, &cutPathIsPossible, NULL, NULL, NULL, NULL, NULL); - // we need root for GetVolumeInformation + // we need the root path for GetVolumeInformation if (cutPathIsPossible) { SalamanderGeneral->GetRootPath(rootPath, resolvedPath); @@ -1421,8 +1422,8 @@ CPluginFSInterface::ViewFile(const char* fsName, HWND parent, strcat(uniqueFileName, ":"); strcat(uniqueFileName, Path); SalamanderGeneral->SalPathAppend(uniqueFileName + strlen(fsName) + 1, file.Name, MAX_PATH); - // name on disk are case-insensitive, disk-cache is case-sensitive, we will convert - // to lowercase so disk-cache will behave as case-insensitive + // Names on disk are case-insensitive, but the disk cache is case-sensitive, so we convert + // to lowercase to make the disk cache behave case-insensitively SalamanderGeneral->ToLowerCase(uniqueFileName); // get name of file copy in disk-cache @@ -1431,7 +1432,7 @@ CPluginFSInterface::ViewFile(const char* fsName, HWND parent, if (tmpFileName == NULL) return; // fatal error - // find out if we need prepare file copy for disk-cache (download) + // Determine whether we need to prepare a file copy for the disk cache (download) BOOL newFileOK = FALSE; CQuadWord newFileSize(0, 0); if (!fileExists) // we need it @@ -1460,7 +1461,7 @@ CPluginFSInterface::ViewFile(const char* fsName, HWND parent, HANDLE hFile = HANDLES_Q(CreateFile(tmpFileName, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL)); if (hFile != INVALID_HANDLE_VALUE) - { // ignore error, file size doesn't matter so much + { // ignore errors; file size is not critical here DWORD err; SalamanderGeneral->SalGetFileSize(hFile, newFileSize, err); // ignore errors HANDLES(CloseHandle(hFile)); @@ -1471,7 +1472,7 @@ CPluginFSInterface::ViewFile(const char* fsName, HWND parent, // open viewer HANDLE fileLock; BOOL fileLockOwner; - if (!fileExists && !newFileOK || // open viewer only when file copy is OK + if (!fileExists && !newFileOK || // open the viewer only if the file copy succeeded !salamander->OpenViewer(parent, tmpFileName, &fileLock, &fileLockOwner)) { // clear "lock" on error fileLock = NULL; @@ -1771,7 +1772,7 @@ BOOL CPluginFSInterface::TestUndeleteOnExistingFile(FILE* file, FILE_RECORD_IDSNext; } delete[] buffer; From 1026e3dd1343daabd31418f8ee57846a7843b392 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:06:21 +0200 Subject: [PATCH 480/710] [translation] Fix src/plugins/undelete/restore.cpp comments Refines translated comments in src/plugins/undelete/restore.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #757 for src/plugins/undelete/restore.cpp, restored the required CommentsTranslationProject translated marker on the head branch, reran clang-format, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/undelete/restore.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/plugins/undelete/restore.cpp b/src/plugins/undelete/restore.cpp index d00f8a063..bf9dc9f01 100644 --- a/src/plugins/undelete/restore.cpp +++ b/src/plugins/undelete/restore.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -134,7 +135,7 @@ static BOOL RestoreFile(const char* fileName, const char* sourcePath, const char if (skipped) { SalamanderSafeFile->SafeFileClose(&srcfile); - // skip file in progress + // the file was skipped in the progress dialog FileProgress = 0; TotalProgress += size.Value; UpdateRestoreProgress(); @@ -146,8 +147,8 @@ static BOOL RestoreFile(const char* fileName, const char* sourcePath, const char // recover encrypted files from backup if (real) { - // OpenEncryptedFileRaw (and others) unfortunately has own write to output file, we will open file - // with SafeFileCreate anyway for error handling, but we need to close it + // OpenEncryptedFileRaw (and related APIs) unfortunately writes to the output file itself; we open the file + // with SafeFileCreate anyway for error handling, but then we need to close it SalamanderSafeFile->SafeFileClose(&dstfile); // restore @@ -157,7 +158,7 @@ static BOOL RestoreFile(const char* fileName, const char* sourcePath, const char if ((result = OpenEncryptedFileRaw(dstpath, CREATE_FOR_IMPORT, &context)) != ERROR_SUCCESS || (result = WriteEncryptedFileRaw(RestoreCallback, (PVOID)&ctx, context)) != ERROR_SUCCESS) { - if (result != ERROR_CANCELLED) // return on cancel from user + if (result != ERROR_CANCELLED) // return if the user cancelled { SetLastError(result); String::SysError(IDS_UNDELETE, IDS_ERRORENCRYPTED); @@ -166,7 +167,7 @@ static BOOL RestoreFile(const char* fileName, const char* sourcePath, const char } CloseEncryptedFileRaw(context); } - else // otherwise only copy + else // otherwise, just copy { BYTE* buffer = new BYTE[COPY_BUFFER_SIZE]; @@ -201,7 +202,7 @@ static BOOL RestoreFile(const char* fileName, const char* sourcePath, const char } SetFileAttributes(dstpath, attr | FILE_ATTRIBUTE_ENCRYPTED); } - // on cancel remove incomplete file + // On cancel, remove the incomplete file else if (Progress->GetWantCancel()) { DeleteFile(dstpath); @@ -363,7 +364,7 @@ BOOL RestoreEncryptedFiles(const char* targetPath, HWND parent) if (!SalamanderGeneral->TestFreeSpace(parent, targetPath, CQuadWord().SetUI64(GrandTotal), String::LoadStr(IDS_RESTORE))) return FALSE; - // todo: test if sourcePath == targetPath - it is error + // TODO: check whether sourcePath == targetPath; this is an error // open progress CRestoreProgressDlg dlg(parent, ooStatic); From 1c94be15b4bfa478220a46a2757b7c021d168b7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:06:49 +0200 Subject: [PATCH 481/710] [translation] Fix src/plugins/undelete/undelete.cpp comments Refines translated comments in src/plugins/undelete/undelete.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #758 for src/plugins/undelete/undelete.cpp, restored the required CommentsTranslationProject translated marker on the head branch, reran clang-format, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/undelete/undelete.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/plugins/undelete/undelete.cpp b/src/plugins/undelete/undelete.cpp index 2f7156358..0b8095b5f 100644 --- a/src/plugins/undelete/undelete.cpp +++ b/src/plugins/undelete/undelete.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED // **************************************************************************** // @@ -96,7 +97,7 @@ void CTopIndexMem::Push(const char* path, int topIndex) ok = s - path == l && SalamanderGeneral->StrNICmp(path, Path, l) == 0; } - if (ok) // it continues -> store next top-index + if (ok) // path continues: store the next top index { if (TopIndexesCount == TOP_INDEX_MEM_SIZE) // we need to release first top-index { @@ -108,7 +109,7 @@ void CTopIndexMem::Push(const char* path, int topIndex) strcpy(Path, path); TopIndexes[TopIndexesCount++] = topIndex; } - else // it doesn't continue -> first top-index v raw + else // path does not continue -> first top index in sequence { strcpy(Path, path); TopIndexesCount = 1; @@ -162,13 +163,13 @@ BOOL CTopIndexMem::FindAndPop(const char* path, int& topIndex) void InitIconOverlays() { - // 48x48 only from XP onward (will soon be obsolete; we'll run on XP+ only, then drop this) - // in fact large icons have been supported for a long time, they can be enabled - // Desktop/Properties/???/Large Icons; beware, the system image list will not exist then - // for 32x32 icons; additionally we should pull the actual icon sizes from the system - // for now we ignore it and enable 48x48 only from XP where they are commonly available + // 48x48 only on XP and later (this will soon be obsolete; support will be XP+ only, then this can be removed) + // in fact, large icons have been supported for a long time and can be enabled via + // Desktop/Properties/???/Large Icons; however, the system image list for 32x32 icons + // would not exist in that case; additionally, the actual icon sizes should be obtained from the system + // for now, this is ignored and 48x48 is enabled only on XP, where these icons are commonly available int iconSizes[3] = {16, 32, 48}; - if (!SalIsWindowsVersionOrGreater(5, 1, 0)) // not WindowsXPAndLater: this is not XP or later + if (!SalIsWindowsVersionOrGreater(5, 1, 0)) // not Windows XP or later iconSizes[2] = 32; HICON iconOverlays[3]; @@ -200,11 +201,11 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) if (!InitCommonControlsEx(&initCtrls)) { MessageBox(NULL, "InitCommonControlsEx failed!", "Error", MB_OK | MB_ICONERROR); - return FALSE; // DLL won't start + return FALSE; // DLL will not load } } - return TRUE; // DLL can be loaded + return TRUE; // Allow the DLL to load } void WINAPI HTMLHelpCallback(HWND hWindow, UINT helpID) @@ -220,7 +221,7 @@ CPluginInterfaceAbstract* WINAPI SalamanderPluginEntry(CSalamanderPluginEntryAbs HANDLES_CAN_USE_TRACE(); CALL_STACK_MESSAGE1("SalamanderPluginEntry()"); - // works with current and newer Salamander version - check it out + // Check that it works with the current and newer Salamander versions if (SalamanderVersion < LAST_VERSION_OF_SALAMANDER) { // deny old versions MessageBox(salamander->GetParentWindow(), REQUIRE_LAST_VERSION_OF_SALAMANDER, @@ -229,7 +230,7 @@ CPluginInterfaceAbstract* WINAPI SalamanderPluginEntry(CSalamanderPluginEntryAbs } // load language module (.slg) - HLanguage = salamander->LoadLanguageModule(salamander->GetParentWindow(), "Undelete" /* neprekladat! */); + HLanguage = salamander->LoadLanguageModule(salamander->GetParentWindow(), "Undelete" /* DO NOT TRANSLATE */); if (HLanguage == NULL) return NULL; @@ -339,7 +340,7 @@ MENU_TEMPLATE_ITEM PluginMenu[] = }; */ - // for better discoverability put plugin also to Plugins menu + // To improve discoverability, also put the plugin in the Plugins menu. salamander->AddMenuItem(-1, String::LoadStr(IDS_UNDELETECMD), SALHOTKEY('U', HOTKEYF_CONTROL | HOTKEYF_SHIFT), CMD_UNDELETE, FALSE, MENU_EVENT_TRUE, MENU_EVENT_TRUE, MENU_SKILLLEVEL_ALL); From 9a1b99f821a445aa3d3ed0a2288ab821b8e9fe5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:07:17 +0200 Subject: [PATCH 482/710] [translation] Fix src/plugins/undelete/undelete.h comments Refines translated comments in src/plugins/undelete/undelete.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #759 for src/plugins/undelete/undelete.h, restored the required CommentsTranslationProject translated marker on the head branch, reran clang-format, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/undelete/undelete.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/undelete/undelete.h b/src/plugins/undelete/undelete.h index defec288f..0b28f80c2 100644 --- a/src/plugins/undelete/undelete.h +++ b/src/plugins/undelete/undelete.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once @@ -141,7 +142,7 @@ class CPluginFSDataInterface : public CPluginDataInterfaceAbstract class CTopIndexMem { protected: - // path for last stored top-index + // path for the last stored top-index char Path[MAX_PATH]; int TopIndexes[TOP_INDEX_MEM_SIZE]; // stored top-index list int TopIndexesCount; // count of stored top-index @@ -154,7 +155,7 @@ class CTopIndexMem TopIndexesCount = 0; } // clear memory void Push(const char* path, int topIndex); // store top-index for given path - BOOL FindAndPop(const char* path, int& topIndex); // search top-index for given path, FALSE->not found + BOOL FindAndPop(const char* path, int& topIndex); // find the top index for the given path; FALSE if not found }; class CPluginInterfaceForFS : public CPluginInterfaceForFSAbstract From 2128754026feab1192e8e63507a410b0a79016f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:07:46 +0200 Subject: [PATCH 483/710] [translation] Fix src/plugins/undelete/library/arraylt.h comments Refines translated comments in src/plugins/undelete/library/arraylt.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #760 for src/plugins/undelete/library/arraylt.h, restored the required CommentsTranslationProject translated marker on the head branch, reran clang-format, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/undelete/library/arraylt.h | 37 +++++++++++++------------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/src/plugins/undelete/library/arraylt.h b/src/plugins/undelete/library/arraylt.h index 5f872e871..32f0ac3da 100644 --- a/src/plugins/undelete/library/arraylt.h +++ b/src/plugins/undelete/library/arraylt.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED //**************************************************************************** // @@ -40,9 +41,9 @@ enum CDeleteType enum CErrorType { etNone, // OK - etLowMemory, // new - NULL - etUnknownIndex, // index is out of array range - etBadInsert, // index of inserted item is out of array range + etLowMemory, // new returned NULL + etUnknownIndex, // index is out of range for the array + etBadInsert, // index of the inserted item is out of array range etDestructed, // array was already destructed using Destroy() method }; @@ -80,12 +81,12 @@ class TDirectArray } void Insert(int index, const DATA_TYPE& member); - int Add(const DATA_TYPE& member); // adds item to the end of array, returns item index + int Add(const DATA_TYPE& member); // adds an item to the end of the array; returns its index - void Insert(int index, const DATA_TYPE* members, int count); // insert 'count' of 'members' items - int Add(const DATA_TYPE* members, int count); // add 'count' of 'members' items + void Insert(int index, const DATA_TYPE* members, int count); // insert 'count' items from 'members' + int Add(const DATA_TYPE* members, int count); // adds 'count' items from 'members' - DATA_TYPE& At(int index) // returns pointer to item at 'index' possition + DATA_TYPE& At(int index) // returns a reference to the item at 'index' { #if defined(_DEBUG) || defined(__ARRAY_DEBUG) if (index >= 0 && index < Count) @@ -97,12 +98,12 @@ class TDirectArray TRACE_C("Index is out of range (index = " << index << ", Count = " << Count << ")."); Error(etUnknownIndex); - return Data[0]; // because of compiler we must return (invalid) item + return Data[0]; // because of the compiler, we must return an (invalid) item } #endif } - DATA_TYPE& operator[](int index) // returns pointer to item at 'index' possition + DATA_TYPE& operator[](int index) // returns a reference to the item at 'index' { #if defined(_DEBUG) || defined(__ARRAY_DEBUG) if (index >= 0 && index < Count) @@ -114,7 +115,7 @@ class TDirectArray TRACE_C("Index is out of range (index = " << index << ", Count = " << Count << ")."); Error(etUnknownIndex); - return Data[0]; // because of compiler we must return (invalid) item + return Data[0]; // because of the compiler, we must return an (invalid) item } #endif } @@ -131,12 +132,12 @@ class TDirectArray void DestroyMembers(); // release items from memory (calling destructors), keep array void DetachMembers(); // detach all items (destructors are NOT called), keep array void Destroy(); // complete array destruction (calling destructors) - void Delete(int index); // delete item at 'index' possition (calling destructor), move remaining items - void Delete(int index, int count); // delete 'count' of items at 'index' possition (calling destructors), move remaining items - void Detach(int index); // detach item at 'index' possition (destructor is NOT called), move remaining items - void Detach(int index, int count); // detach 'count' of items at 'index' possition (destructors are NOT called), move remaining items + void Delete(int index); // delete the item at 'index' (calling the destructor), move remaining items + void Delete(int index, int count); // delete 'count' items at 'index' position (calling destructors), move remaining items + void Detach(int index); // detach item at 'index' position (destructor is NOT called), move remaining items + void Detach(int index, int count); // detach 'count' items at 'index' position (destructors are NOT called), move remaining items - int SetDelta(int delta); // change 'Delta', return real used value; NOTE: can be used only for empty array + int SetDelta(int delta); // change 'Delta', return the actual value used; NOTE: can be used only for an empty array protected: DATA_TYPE* Data; // pointer to array @@ -144,7 +145,7 @@ class TDirectArray int Base; // smallest allocated size of array int Delta; // allocated array size is enlarged/reduced by this value - virtual void Error(CErrorType err) // array error handling + virtual void Error(CErrorType err) // handles array errors { if (State == etNone) State = err; @@ -154,7 +155,7 @@ class TDirectArray void EnlargeArray(); // enlarges array void ReduceArray(); // reduces array - void Move(CArrayDirection direction, int first, int count); // move selected items to next/previous index + void Move(CArrayDirection direction, int first, int count); // move selected items to the next/previous index void CallCopyConstructor(DATA_TYPE* placement, const DATA_TYPE& member) { @@ -295,7 +296,7 @@ TDirectArray::TDirectArray(int base, int delta) template void TDirectArray::Destroy() { - if (State == etNone) // it can be also etDestructed + if (State == etNone) // it can also be etDestructed { if (Data != NULL) { From 1821551729a9629f197de9047d7542844a44a7b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:08:14 +0200 Subject: [PATCH 484/710] [translation] Fix src/plugins/undelete/library/bitmap.h comments Refines translated comments in src/plugins/undelete/library/bitmap.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #761 for src/plugins/undelete/library/bitmap.h, restored the required CommentsTranslationProject translated marker on the head branch, reran clang-format, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/undelete/library/bitmap.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/undelete/library/bitmap.h b/src/plugins/undelete/library/bitmap.h index b4d2dc928..4a6d572fa 100644 --- a/src/plugins/undelete/library/bitmap.h +++ b/src/plugins/undelete/library/bitmap.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once @@ -12,7 +13,7 @@ // significant bit in BitmapPartsH. // -#define BITMAP_PART_SIZE (5 * 1000 * 1024) // keep this const DWORD aligned! +#define BITMAP_PART_SIZE (5 * 1000 * 1024) // keep this constant DWORD-aligned class CClusterBitmap { From c3ace72a413dabb21e1b89831aa08df5ad19267e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:08:42 +0200 Subject: [PATCH 485/710] [translation] Fix src/plugins/undelete/library/dataruns.h comments Refines translated comments in src/plugins/undelete/library/dataruns.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #762 for src/plugins/undelete/library/dataruns.h, restored the required CommentsTranslationProject translated marker on the head branch, reran clang-format, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/undelete/library/dataruns.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/undelete/library/dataruns.h b/src/plugins/undelete/library/dataruns.h index c20008c75..2b34016bc 100644 --- a/src/plugins/undelete/library/dataruns.h +++ b/src/plugins/undelete/library/dataruns.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once @@ -299,7 +300,7 @@ class CRunsWalker // switch to next data pointers CurrentPtrs = CurrentPtrs->DPNext; CurrentRun = CurrentPtrs->Runs; - CurrentLCN = 0; // each data pointers starting first offset from 0 + CurrentLCN = 0; // each data pointer starts with its first offset from 0 newPtrs = TRUE; } } while (runHeader == 0); // skip all 0x00 headers @@ -357,5 +358,5 @@ class CRunsWalker const DATA_POINTERS* StreamPtrs; // stream data pointers const DATA_POINTERS* CurrentPtrs; // iterator pointing to current data pointers const BYTE* CurrentRun; // iterator pointing to current data run - QWORD CurrentLCN; // logic cluster iterator + QWORD CurrentLCN; // logical cluster iterator }; From 56f02d660c5b9d2d648710f6b09c276b065e3bb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:09:10 +0200 Subject: [PATCH 486/710] [translation] Fix src/plugins/undelete/library/exfat.h comments Refines translated comments in src/plugins/undelete/library/exfat.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #763 for src/plugins/undelete/library/exfat.h, restored the required CommentsTranslationProject translated marker on the head branch, reran clang-format, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/undelete/library/exfat.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/plugins/undelete/library/exfat.h b/src/plugins/undelete/library/exfat.h index 0e5738c2d..1c7797b4e 100644 --- a/src/plugins/undelete/library/exfat.h +++ b/src/plugins/undelete/library/exfat.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once @@ -145,7 +146,7 @@ class CExFATSnapshot : public CSnapshot DWORD GetFATItem(DWORD index); QWORD GetFATItems() { return FATItems; } BOOL LoadDirectoryTree(FILE_RECORD_I* parent, DWORD dirFirstCluster, QWORD dirFileSize, BOOL dirClusterChainInFAT, BOOL isRootDirectory, CHAR* tracePath); - DWORD GetClusterChainLen(DWORD index); // return number of clusters in cluster chain starting at 'index' + DWORD GetClusterChainLen(DWORD index); // Returns the number of clusters in the cluster chain starting at 'index' BOOL LoadClusterChain(BYTE** buff, DWORD firstCluster, QWORD fileSize, BOOL chainInFAT, QWORD* clusters); // allocate 'buffer' and read clusters based on cluster chain starting at 'index', returns number of 'clusters' DWORD ConvertExFATAttr(DWORD exfatattr); void DosTimeToFileTime(DWORD dosTime, BYTE dosTime10ms, FILETIME* ft); @@ -166,8 +167,8 @@ class CExFATSnapshot : public CSnapshot BOOL EstimateFileDamage(const FILE_RECORD_I* deletedFiles, CLUSTER_MAP_I** clusterMap); BOOL GetLostClustersMap(CClusterBitmap* clusterBitmap, CLUSTER_MAP_I* clusterMap); - // exFAT FAT table could contain 2^32 items (cluster), - // it is not possible to allocate/read it whole as we do with FAT32 volumes + // The exFAT FAT table can contain 2^32 items (clusters), + // so it is not possible to allocate/read it as a whole as we do for FAT32 volumes DWORD FATItems; // total number of DWORD items in FAT DWORD* FATHead; // buffer with first clusters of FAT, up to MAX_FAT_HEAD_SIZE size DWORD FATHeadItems; // number of DWORD items in FATHead @@ -933,7 +934,7 @@ BOOL CExFATSnapshot::FilterExistingDirectories(FILE_RECORD_I* record } } record->NumDirItems = j; - return j == 0; // returns TRUE when directory was removed + return j == 0; // Returns TRUE when all directory items were removed } template @@ -1158,7 +1159,7 @@ void CExFATSnapshot::DrawDeletedFile(FILE_RECORD_I* record, CCluster QWORD lcn; QWORD length; if (!runsWalker.GetNextRun(&lcn, &length, NULL)) - break; // unlikely error, moreover it doesn't matter + break; // unlikely error; it does not matter here if (lcn != -1) { // if value in bitmap is smaller than 2, increase it @@ -1263,7 +1264,7 @@ BOOL CExFATSnapshot::EstimateFileDamage(const FILE_RECORD_I* deleted } } - if (this->UdFlags & UF_GETLOSTCLUSTERMAP) // is lost cluster map required? + if (this->UdFlags & UF_GETLOSTCLUSTERMAP) // is a lost cluster map required? { if (clusterMap != NULL) { @@ -1312,7 +1313,7 @@ BOOL CExFATSnapshot::GetLostClustersMap(CClusterBitmap* clusterBitmap, CLU // for cluster number 'i' find related two bits in bitmap BYTE c; clusterBitmap->GetValue(i - 2, &c); // exFAT bitmap is zero based - if (c == 0 || c == 2) // cluster is not used (or we don't know about it) || there is FC_FAIR or FC_POOR + if (c == 0 || c == 2) // cluster is not used (or we do not know about it), or it is FC_FAIR or FC_POOR { // if it is beginning of segment that we are interested in, store lcnFirst and set we are in segment if (!inside) From c27a3632a0099de946eec7bc9c482c9f9e68b3eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:09:39 +0200 Subject: [PATCH 487/710] [translation] Fix src/plugins/undelete/library/fat.cpp comments Refines translated comments in src/plugins/undelete/library/fat.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #764 for src/plugins/undelete/library/fat.cpp, restored the required CommentsTranslationProject translated marker on the head branch, reran clang-format, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/undelete/library/fat.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/undelete/library/fat.cpp b/src/plugins/undelete/library/fat.cpp index e357ed6ce..8a668e092 100644 --- a/src/plugins/undelete/library/fat.cpp +++ b/src/plugins/undelete/library/fat.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -53,7 +54,7 @@ // of FILE_RECORD structures // -BOOL ConvertFATName(const char* fatName, char* name) // convert name from format 83 to 8.3 +BOOL ConvertFATName(const char* fatName, char* name) // convert a name from FAT 8.3 format { CALL_STACK_MESSAGE_NONE //CALL_STACK_MESSAGE2("ConvertFATName(%s, )", fatName); @@ -65,7 +66,7 @@ BOOL ConvertFATName(const char* fatName, char* name) // convert name from format // of there is extension, insert dot if (fatName[i] != ' ') { - if (p == name) // wrong file name + if (p == name) // invalid file name return FALSE; *p = '.'; p++; @@ -77,7 +78,7 @@ BOOL ConvertFATName(const char* fatName, char* name) // convert name from format { *p = fatName[i]; if (i == 0 && *p == 0x05) - *p = (char)0xE5; // 0x05 is used instead of 0xE5 in the Japan/KANJI + *p = (char)0xE5; // 0x05 is used instead of 0xE5 in Japanese/KANJI p++; } } From 98c21acf42a6d3234dd813ea4d5391fbfc6bc104 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:10:08 +0200 Subject: [PATCH 488/710] [translation] Fix src/plugins/undelete/library/fat.h comments Refines translated comments in src/plugins/undelete/library/fat.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #765 for src/plugins/undelete/library/fat.h, restored the required CommentsTranslationProject translated marker on the head branch, reran clang-format, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/undelete/library/fat.h | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/plugins/undelete/library/fat.h b/src/plugins/undelete/library/fat.h index 5d6601b79..3f94d9e6a 100644 --- a/src/plugins/undelete/library/fat.h +++ b/src/plugins/undelete/library/fat.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once @@ -472,7 +473,7 @@ void CFATSnapshot::AddToProgress(DIR_ENTRY_SHORT* entry) if (islong(entry->Attr) || entry->Name[0] == 0xE5 || isupdir(entry)) return; int cluster = GetCluster(entry); - while (cluster && (DWORD)cluster < EOC && IsValidCluster(cluster)) // type cast (DWORD)cluster is OK + while (cluster && (DWORD)cluster < EOC && IsValidCluster(cluster)) // the (DWORD)cluster cast is OK { ClustersProcessed++; cluster = FAT[cluster] & ~MARK_MASK; @@ -751,7 +752,7 @@ BOOL CFATSnapshot::ScheduleDirectory(FILE_RECORD_I* dir, int cluster return FALSE; cluster = FAT[cluster] & ~MARK_MASK; - if ((DWORD)cluster < EOC && !IsValidCluster(cluster)) // type case (DWORD)cluster is OK + if ((DWORD)cluster < EOC && !IsValidCluster(cluster)) // the (DWORD)cluster cast is correct { TRACE_E("ScheduleDirectory: invalid directory cluster chain (cluster=" << cluster << ")"); break; @@ -786,7 +787,7 @@ BOOL CFATSnapshot::ScanDirectoryCluster(BYTE* buffer, DWORD len, BOOL forc DIR_ENTRY_SHORT* bufmax = (DIR_ENTRY_SHORT*)(buffer + len); while (entry < bufmax && entry->Name[0]) { - if ((entry->Attr & FAT_ATTR_DIRECTORY) && !IgnoreEntry(entry, FALSE /* deleteddir doesn't matter */)) + if ((entry->Attr & FAT_ATTR_DIRECTORY) && !IgnoreEntry(entry, FALSE /* deleteddir does not matter */)) { // already allocate record for directories FILE_RECORD_I* dir = new FILE_RECORD_I; @@ -1045,12 +1046,12 @@ DWORD CFATSnapshot::AnalyzeCluster(BYTE* buffer, DWORD len, DWORD* flags) if (nshort != 1) return 0; } - else if (nitems < 10) // up to ten records all must be OK + else if (nitems < 10) // for up to ten records, all must be valid { if (nshort + nlong != nitems) return 0; } - else // otherwise we give tolerance 10% + else // otherwise allow 10% tolerance { if (nshort + nlong < nitems * 9 / 10) return 0; @@ -1221,7 +1222,7 @@ BOOL CFATSnapshot::LoadDeletedDirectories() ret = AnalyzeCluster(p, this->Volume->BytesPerCluster, &flags); TRACE_X("cluster=" << cluster << " ret=" << ret << " flags=" << flags); if (!ret) - break; // it is not directory cluster + break; // not a directory cluster // it is directory cluster, accept it nclus++; @@ -1790,7 +1791,7 @@ BOOL CFATSnapshot::GetLostClustersMap(CLUSTER_MAP_I* clusterMap) { // for cluster number 'i' find in FAT related two bits int c = (FAT[i] >> 28) & 0x3; - if ((FAT[i] & ~MARK_MASK) == 0 || c == 2) // cluster is not used (or we don't know about it) || there is FC_FAIR or FC_POOR + if ((FAT[i] & ~MARK_MASK) == 0 || c == 2) // cluster is unused (or its state is unknown), or FC_FAIR/FC_POOR is set { // if it is beginning of segment that we are interested in, store lcnFirst and set we are in segment if (!inside) @@ -1844,7 +1845,7 @@ BOOL CFATSnapshot::GetLostClustersMap(CLUSTER_MAP_I* clusterMap) } else { - break; // we can stope here, there is nothing to store + break; // we can stop here; there is nothing to store } } } @@ -2058,7 +2059,7 @@ BOOL CFATSnapshot::FilterExistingDirectories(FILE_RECORD_I* record) } } record->NumDirItems = j; - return j == 0; // returns TRUE when directory was removed + return j == 0; // Returns TRUE when all directory items were removed } template @@ -2087,7 +2088,7 @@ void CFATSnapshot::CountClusters() UsedClusters = 0; FreeClusters = 0; - for (DWORD i = 2; i < this->Volume->FAT_CountOfClusters; i++) // what about first two items? + for (DWORD i = 2; i < this->Volume->FAT_CountOfClusters; i++) // skip the first two items { if (FAT[i]) UsedClusters++; @@ -2476,7 +2477,7 @@ BOOL CFATSnapshot::Update(CSnapshotProgressDlg* progress, DWORD udFlags, C EstimateFileDamage(this->Root, edtDraw); EstimateFileDamage(this->Root, edtGetCondition); } - if (this->UdFlags & UF_GETLOSTCLUSTERMAP) // is lost cluster map required? + if (this->UdFlags & UF_GETLOSTCLUSTERMAP) // is a lost cluster map requested? { if (clusterMap != NULL) { @@ -2540,7 +2541,7 @@ void CFATSnapshot::FreeRecord2(FILE_RECORD_I* record) break; // free what was allocated by ScanDirectoryCluster - if ((entry->Attr & FAT_ATTR_DIRECTORY) && !IgnoreEntry(entry, FALSE /* deleteddir doesn't matter */)) + if ((entry->Attr & FAT_ATTR_DIRECTORY) && !IgnoreEntry(entry, FALSE /* deleteddir does not matter */)) { #ifdef _WIN64 // pointer to FileSize doesn't fit on x64, so we store only index into FILE_RECORD_Pointers array From 6e33956aef26aed6bb036f71c703b66a11dc21df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:10:36 +0200 Subject: [PATCH 489/710] [translation] Fix src/plugins/undelete/library/miscstr.cpp comments Refines translated comments in src/plugins/undelete/library/miscstr.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #766 for src/plugins/undelete/library/miscstr.cpp, restored the required CommentsTranslationProject translated marker on the head branch, reran clang-format, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/undelete/library/miscstr.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/undelete/library/miscstr.cpp b/src/plugins/undelete/library/miscstr.cpp index 2f3b94e6d..6c0607a42 100644 --- a/src/plugins/undelete/library/miscstr.cpp +++ b/src/plugins/undelete/library/miscstr.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -66,7 +67,7 @@ char* String::LoadStr(int resID) RELOAD: int size = LoadStringA(hInstance, resID, StrAct, STRBUFSIZE - (int)(StrAct - StringBuffer)); - // size contains number of copied characters without terminator + // size contains the number of copied characters, excluding the terminator // DWORD error = GetLastError(); if (size != 0 /* || error == NO_ERROR*/) // error is NO_ERROR even if string doesn't exist, we cannot use it { From 9cf101792210b93d4983366336b84ce356b2b099 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:11:05 +0200 Subject: [PATCH 490/710] [translation] Fix src/plugins/undelete/library/ntfs.h comments Refines translated comments in src/plugins/undelete/library/ntfs.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #767 for src/plugins/undelete/library/ntfs.h, restored the required CommentsTranslationProject translated marker on the head branch, reran clang-format, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/undelete/library/ntfs.h | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/plugins/undelete/library/ntfs.h b/src/plugins/undelete/library/ntfs.h index 375b1d942..8e48e2490 100644 --- a/src/plugins/undelete/library/ntfs.h +++ b/src/plugins/undelete/library/ntfs.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once @@ -231,7 +232,7 @@ BOOL CMFTSnapshot::ParseRecord(BYTE* data, QWORD index) return Error(IDS_UNDELETE, IDS_ERRORMETADAMAGED); // metafiles must be OK else*/ // fixme // update: on NT4 are records 16-24 unused and doesn't have header, we can skip this check - return TRUE; // looks like one of 'BAAD' records, skip it + return TRUE; // looks like one of the 'BAAD' records; skip it } if (!meta && !(this->UdFlags & UF_SHOWEXISTING)) @@ -254,7 +255,7 @@ BOOL CMFTSnapshot::ParseRecord(BYTE* data, QWORD index) << "(i = " << i << ")"); DumpHexData(data, BytesPerMFTRecord); if (index == 0) - return String::Error(IDS_UNDELETE, IDS_MFTRECORDDAMAGED); // we cannot skip MFT + return String::Error(IDS_UNDELETE, IDS_MFTRECORDDAMAGED); // cannot skip the MFT itself else return TRUE; } @@ -307,7 +308,7 @@ BOOL CMFTSnapshot::ParseRecord(BYTE* data, QWORD index) if (aheader->NonResident) { TRACE_E("$STANDARD_INFORMATION is non-resident?! (index " << index << ")"); - break; // should be always resident + break; // should always be resident } ATTRIBUTE_STANDARD_INFORMATION* attr = (ATTRIBUTE_STANDARD_INFORMATION*)(data + offset + aheader->AttrOffset); record->Attr = attr->Attributes; @@ -331,7 +332,7 @@ BOOL CMFTSnapshot::ParseRecord(BYTE* data, QWORD index) if (aheader->NonResident) { TRACE_E("$FILE_NAME is non-resident?! (index " << index << ")"); - break; // should be always resident + break; // should always be resident } ATTRIBUTE_FILE_NAME* attr = (ATTRIBUTE_FILE_NAME*)(data + offset + aheader->AttrOffset); @@ -344,8 +345,8 @@ BOOL CMFTSnapshot::ParseRecord(BYTE* data, QWORD index) { if (attr->Namespace == 2) ignore = TRUE; // we can ignore DOS names if we have standard names - break; // ... otherwise overwrite existing - // todo: we can show DOS name too + break; // ... otherwise overwrite the existing entry + // TODO: we could show the DOS name too } fname = fname->FNNext; } @@ -598,7 +599,7 @@ BOOL CMFTSnapshot::Update(CSnapshotProgressDlg* progress, DWORD udFlags, C delete[] firstrec; // check - if (mft->Streams == NULL || mft->Streams->DSNext != NULL || // just one stream + if (mft->Streams == NULL || mft->Streams->DSNext != NULL || // only one stream mft->IsDir || // can not be directory mft->FileNames == NULL || mft->FileNames->FNNext != NULL || // just one hardlink String::StrICmp(mft->FileNames->FNName, STRING_MFT)) // name: $MFT @@ -838,7 +839,7 @@ void CMFTSnapshot::Mark(FILE_RECORD_I* r, DWORD depth) if (IsValidRef(fname->ParentRecord)) { FILE_RECORD_I* parent = MFT[LODWORD(fname->ParentRecord)]; - if (parent != r) // parent to himself is only root, in such case we will end + if (parent != r) // only the root is its own parent; recursion ends there Mark(parent, depth + 1); // todo: to speed up we can test if it is already marked from some level and end? } @@ -1283,7 +1284,7 @@ void CMFTSnapshot::DrawDeletedFile(FILE_RECORD_I* record, CClusterBi if (!runsWalker.GetNextRun(&lcn, &length, NULL)) { TRACE_IW(L"CMFTSnapshot::DrawDeletedFile() Ignoring: " << CWStr(record->FileNames->FNName).c_str()); - break; // unlikely error, moreover it doesn't matter + break; // unlikely error; it does not matter here } if (lcn != -1) { @@ -1387,7 +1388,7 @@ BOOL CMFTSnapshot::EstimateFileDamage(CLUSTER_MAP_I** clusterMap) } } - if (this->UdFlags & UF_GETLOSTCLUSTERMAP) // does user want to return map of lost clusters? + if (this->UdFlags & UF_GETLOSTCLUSTERMAP) // does the user want the map of lost clusters returned? { if (clusterMap != NULL) { @@ -1435,7 +1436,7 @@ BOOL CMFTSnapshot::GetLostClustersMap(CClusterBitmap* clusterBitmap, CLUST // for cluster number 'i' find related two bits in bitmap BYTE c; clusterBitmap->GetValue(i, &c); - if (c == 0 || c == 2) // cluster is not used (or we don't know about it) || there is FC_FAIR or FC_POOR + if (c == 0 || c == 2) // cluster is unused (or we do not know about it), or it is FC_FAIR or FC_POOR { // if it is beginning of segment that we are interested in, store lcnFirst and set we are in segment if (!inside) @@ -1488,7 +1489,7 @@ BOOL CMFTSnapshot::GetLostClustersMap(CClusterBitmap* clusterBitmap, CLUST } } else - break; // we can stop here, there is nothing to store + break; // stop here, nothing to store } } From 2117aadc425a712d5902a4ff142ac04059c0febc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:11:33 +0200 Subject: [PATCH 491/710] [translation] Fix src/plugins/undelete/library/snapshot.h comments Refines translated comments in src/plugins/undelete/library/snapshot.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #768 for src/plugins/undelete/library/snapshot.h, restored the required CommentsTranslationProject translated marker on the head branch, reran clang-format, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/undelete/library/snapshot.h | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/plugins/undelete/library/snapshot.h b/src/plugins/undelete/library/snapshot.h index ccad4221c..2b81f8ef6 100644 --- a/src/plugins/undelete/library/snapshot.h +++ b/src/plugins/undelete/library/snapshot.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once @@ -19,11 +20,11 @@ struct FILE_NAME_I FILE_NAME_I* FNNext; }; -// DATA_STREAM - contains info about one file data stream. Each stream -// could be resident data (ResidentData != NULL) or data elsewhere on disk, -// then Ptrs contains list of data runs blocks (DATA_POINTERS). Normal file has -// only one stream and one block of data runs. Heavily fragmented file whose list -// of data runs cannot fit inside one MFT stream has more DATA_POINTERS. +// DATA_STREAM - contains information about one file data stream. Each stream +// can contain resident data (ResidentData != NULL) or data stored elsewhere on disk; +// in that case, Ptrs contains a list of data-run blocks (DATA_POINTERS). A normal file has +// only one stream and one block of data runs. A heavily fragmented file whose list +// of data runs cannot fit inside one MFT stream has multiple DATA_POINTERS. struct DATA_POINTERS { @@ -74,12 +75,12 @@ struct DIR_ITEM_I FILE_RECORD_I* Record; }; -// FILE_RECORD - corresponds to one MFT record, we are storing only deleted files and -// directories. FileNames is list of names (hard-links), we prefer normal names instead of -// DOS names (if we find normal name and already have DOS name, we will overwrite it). -// Times are creation, last access, modification times of file. Streams is list of all -// file streams. Each stream could have data runs in several blocks (see above). -// DirItems is NULL for files, for directories it contains list of containing items. +// FILE_RECORD corresponds to one MFT record; we store only deleted files and +// directories. FileNames is a list of names (hard links); we prefer normal names over +// DOS names (if we find a normal name and already have a DOS name, we overwrite it). +// Times are the file creation, last access, and modification times. Streams is a list of all +// file streams. Each stream can have data runs in several blocks (see above). +// DirItems is NULL for files; for directories, it contains a list of contained items. template struct FILE_RECORD_I From 3fda0b5a7828e163bafc5f6d3dc35f0132422a79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:12:01 +0200 Subject: [PATCH 492/710] [translation] Fix src/plugins/undelete/library/stream.h comments Refines translated comments in src/plugins/undelete/library/stream.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #769 for src/plugins/undelete/library/stream.h, restored the required CommentsTranslationProject translated marker on the head branch, reran clang-format, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/undelete/library/stream.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/undelete/library/stream.h b/src/plugins/undelete/library/stream.h index be1ed2854..1ff8c2eed 100644 --- a/src/plugins/undelete/library/stream.h +++ b/src/plugins/undelete/library/stream.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once @@ -117,7 +118,7 @@ class CStreamReader ~CStreamReader() { Release(); } BOOL Init(CVolume* volume, DATA_STREAM_I* str); - // when 'numRead' is not NULL, it will return number of read clusters or -1 when special error occurred + // when 'numRead' is not NULL, it receives the number of clusters read or -1 when a special error occurs BOOL GetClusters(BYTE* buffer, QWORD num, QWORD* numRead = NULL); BOOL IsSafeChunk(QWORD n) { return RunLength >= n; } void Release(); From aaaafe33740424fb8aa31551bbaf788da6ed6d96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:12:29 +0200 Subject: [PATCH 493/710] [translation] Fix src/plugins/unfat/fat.cpp comments Refines translated comments in src/plugins/unfat/fat.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #770 for src/plugins/unfat/fat.cpp, restored the required CommentsTranslationProject translated marker on the head branch, reran clang-format, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/unfat/fat.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/plugins/unfat/fat.cpp b/src/plugins/unfat/fat.cpp index eeb5529e7..49a7e15df 100644 --- a/src/plugins/unfat/fat.cpp +++ b/src/plugins/unfat/fat.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED //**************************************************************************** // @@ -263,7 +264,7 @@ BOOL CFATImage::AddDirectory(char* root, TDirectArray* fat, return FALSE; } - int fatIndex = 0; // ignore the zeroth entry from the 'fat' array; we already received 'sector' + int fatIndex = 0; // ignore the zeroth entry in the 'fat' array; we already have 'sector' CDirEntry dirEnt; wchar_t longName[63 * 13 + 1]; @@ -363,7 +364,7 @@ BOOL CFATImage::AddDirectory(char* root, TDirectArray* fat, { if (dirEnt.Long.Chksum != longNameChksum) { - // invalid data; abort reading + // corrupt entry, stop reading the long name longNameOrd = 0; // do not read long_name TRACE_E("CFATImage::AddDirectory: Different checksum in the long name. offset=0x" << _i64toa(seek.Value, seekStr, 16)); continue; @@ -380,7 +381,7 @@ BOOL CFATImage::AddDirectory(char* root, TDirectArray* fat, continue; // move on to the next part of the long_name or to the short_name } - if (longNameOrd > 1) // are we stuck in the middle (neither 0 nor 1)? + if (longNameOrd > 1) // are we in the middle of reading the long name (neither 0 nor 1)? longNameOrd = 0; // the long_name was not fully read -> discard it CFileData file; @@ -389,7 +390,7 @@ BOOL CFATImage::AddDirectory(char* root, TDirectArray* fat, { longNameOrd = 0; TRACE_E("CFATImage::AddDirectory: Error converting to 8.3 name. offset=0x" << _i64toa(seek.Value, seekStr, 16)); - continue; // skip the nonsensical name + continue; // skip the invalid name } // skip . and .. @@ -586,7 +587,7 @@ BOOL CFATImage::AddDirectory(char* root, TDirectArray* fat, BOOL CFATImage::LoadFAT(DWORD cluster, TDirectArray* fat, HWND hParent, DWORD buttons, DWORD* pressedButton, DWORD* silentMask) { - if (pressedButton != NULL) // if we return FALSE and do not change this value + if (pressedButton != NULL) // If we return FALSE without changing this value, it means the entire operation was canceled. *pressedButton = DIALOG_CANCEL; // we meant cancellation of the entire operation fat->DetachMembers(); @@ -775,7 +776,7 @@ BOOL CFATImage::UnpackFile(CSalamanderForOperationsAbstract* salamander, const c CQuadWord allocFileSize = fileData->Size; BOOL allocateWholeFile = FALSE; if (*allocWholeFileOnStart != awfDisabled && // preallocating the whole file is not disabled - allocFileSize > minAllocFileSize && // fileSize validity condition + below the copy buffer size preallocation makes no sense (smaller files all use COPY_MIN_FILE_SIZE) (and there is no point below 1 byte) + allocFileSize > minAllocFileSize && // file size validity condition; below the copy buffer size, preallocation makes no sense (all smaller files use COPY_MIN_FILE_SIZE) (and it also makes no sense for files smaller than 1 byte) allocFileSize < CQuadWord(0, 0x80000000)) // the file size must be a positive number (otherwise seeking is impossible - these are numbers above 8EB, so this likely never happens) { allocateWholeFile = TRUE; @@ -856,7 +857,7 @@ BOOL CFATImage::UnpackFile(CSalamanderForOperationsAbstract* salamander, const c remains.Value -= read; } - if (fileData->Size < COPY_MIN_FILE_SIZE) // small file -- enlarge it for progress reporting + if (fileData->Size < COPY_MIN_FILE_SIZE) // small file -- count it as larger for progress reporting { remains = COPY_MIN_FILE_SIZE - fileData->Size; if (!salamander->ProgressAddSize((int)remains.Value, TRUE)) @@ -881,10 +882,10 @@ BOOL CFATImage::UnpackFile(CSalamanderForOperationsAbstract* salamander, const c } else { - // FIXME: (consult with Petr) I am not sure here - // if the source has no attribute, SafeCreateFile assigned it 'A' + // FIXME: (consult with Petr) this is unclear + // if the source has no attributes, SafeCreateFile assigned it 'A' // this guarantees an exact copy, but it is not compatible with Salamander's Copy command - // every plugin behaves differently; it is a mess + // each plugin behaves differently; the behavior is inconsistent if (!SetFileAttributes(targetName, fileData->Attr)) TRACE_E("SetFileAttributes failed"); From a9e0ed4b1beafa823c8381991050b5e16ccd24e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:12:57 +0200 Subject: [PATCH 494/710] [translation] Fix src/plugins/unfat/unfat.cpp comments Refines translated comments in src/plugins/unfat/unfat.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #771 for src/plugins/unfat/unfat.cpp, restored the required CommentsTranslationProject translated marker on the head branch, reran clang-format, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/unfat/unfat.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/plugins/unfat/unfat.cpp b/src/plugins/unfat/unfat.cpp index ea452e120..117a6e852 100644 --- a/src/plugins/unfat/unfat.cpp +++ b/src/plugins/unfat/unfat.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED //**************************************************************************** // @@ -68,7 +69,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) break; } } - return TRUE; // DLL can be loaded + return TRUE; // Allow the DLL to load } char* LoadStr(int resID) @@ -90,7 +91,7 @@ CPluginInterfaceAbstract* WINAPI SalamanderPluginEntry(CSalamanderPluginEntryAbs CALL_STACK_MESSAGE1("SalamanderPluginEntry()"); - // this plugin is made for the current version of Salamander or newer - perform a check + // this plugin is intended for the current version of Salamander and later, so check it if (SalamanderVersion < LAST_VERSION_OF_SALAMANDER) { // reject older versions MessageBox(salamander->GetParentWindow(), @@ -376,7 +377,7 @@ BOOL CPluginInterfaceForArchiver::UnpackArchive(CSalamanderForOperationsAbstract if (!salamander->ProgressAddSize((int)size2.Value, TRUE)) { ret = FALSE; - break; // the operation was cancelled + break; // Operation cancelled } } else @@ -529,7 +530,7 @@ BOOL ExtractArchive(CSalamanderDirectoryAbstract const* dir, CSalamanderMaskGrou unpack = FALSE; // the item lies under skipPath so it is ignored } else - skipPath[0] = 0; // the item does not belong under skipPath, discard skipPath + skipPath[0] = 0; // the item does not lie under skipPath, so discard skipPath } if (unpack) @@ -572,7 +573,7 @@ BOOL ExtractArchive(CSalamanderDirectoryAbstract const* dir, CSalamanderMaskGrou unpack = FALSE; // the item lies under skipPath so it is ignored } else - skipPath[0] = 0; // the item does not belong under skipPath, discard skipPath + skipPath[0] = 0; // the item is not under skipPath, so clear skipPath } if (unpack) From e2888ae4ee1efb5fab6e61984a56857b9f4dccb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:13:25 +0200 Subject: [PATCH 495/710] [translation] Fix src/plugins/unchm/chmfile.cpp comments Refines translated comments in src/plugins/unchm/chmfile.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #772 for src/plugins/unchm/chmfile.cpp, restored the required CommentsTranslationProject translated marker on the head branch, reran clang-format, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/unchm/chmfile.cpp | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/plugins/unchm/chmfile.cpp b/src/plugins/unchm/chmfile.cpp index 5cc876f7c..4869fc3ae 100644 --- a/src/plugins/unchm/chmfile.cpp +++ b/src/plugins/unchm/chmfile.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" #include "dbg.h" @@ -99,7 +100,7 @@ BOOL CCHMFile::Open(const char* fileName, BOOL quiet /* = FALSE*/) } else { - // can not obtain last write, use current time + // cannot obtain the last write time; use the current time SYSTEMTIME st; GetLocalTime(&st); SystemTimeToFileTime(&st, &FileTime); @@ -240,7 +241,7 @@ BOOL CCHMFile::EnumObjects(CSalamanderDirectoryAbstract* dir, CPluginDataInterfa SEnumObjHelper* helper = new SEnumObjHelper(this, dir, pluginData); ChmEnumerate(CHM, CHM_ENUMERATE_NORMAL, ChmEnumObjectsCallBack, (void*)helper); - // for DEBUG purposes + // For debugging // ChmEnumerate(CHM, CHM_ENUMERATE_ALL, ChmEnumObjectsCallBack, (void *) helper); delete helper; @@ -276,11 +277,11 @@ int CCHMFile::ExtractObject(CSalamanderForOperationsAbstract* salamander, const // set file time SetFileTime(file, &ft, &ft, &ft); - // the overall operation can continue; skip only + // the overall operation can continue; only skip this file if (toSkip) return UNPACK_ERROR; - // the overall operation cannot continue; cancel + // The overall operation cannot continue. Cancel. if (file == INVALID_HANDLE_VALUE) return UNPACK_CANCEL; @@ -336,14 +337,14 @@ int CCHMFile::ExtractObject(CSalamanderForOperationsAbstract* salamander, const break; } - if (!salamander->ProgressAddSize((int)len, TRUE)) // delayedPaint==TRUE so we do not slow down + if (!salamander->ProgressAddSize((int)len, TRUE)) // delayedPaint==TRUE so we do not slow the operation down { salamander->ProgressDialogAddText(LoadStr(IDS_CANCELOPER), FALSE); salamander->ProgressEnableCancel(FALSE); ret = UNPACK_CANCEL; whole = FALSE; - break; // interrupt the action + break; // interrupt the operation } } // while @@ -356,14 +357,14 @@ int CCHMFile::ExtractObject(CSalamanderForOperationsAbstract* salamander, const if (ret == UNPACK_OK) ret = UNPACK_CANCEL; - // because it is created with the read-only attribute, we must clear the R attribute - // to allow the file to be deleted + // because the file is created with the read-only attribute, we must clear that attribute + // so the file can be deleted attrs &= ~FILE_ATTRIBUTE_READONLY; if (!SetFileAttributes(name, attrs)) Error(LoadStr(IDS_CANT_SET_ATTRS), GetLastError()); // the user canceled the operation - // delete the incomplete file afterwards + // delete the incomplete file if (!DeleteFile(name)) Error(LoadStr(IDS_CANT_DELETE_TEMP_FILE), GetLastError()); } @@ -380,16 +381,16 @@ BOOL CCHMFile::UnpackDir(const char* dirName, const CFileData* fileData) return UNPACK_ERROR; /* - DWORD attrs = fileData->Attr; + DWORD attrs = fileData->Attr; - // set attrs to dir - if (Options.ClearReadOnly) - // set ReadOnly Attribute - attrs &= ~FILE_ATTRIBUTE_READONLY; + // set attributes for the directory + if (Options.ClearReadOnly) + // clear the ReadOnly attribute + attrs &= ~FILE_ATTRIBUTE_READONLY; - if (!SetFileAttributes(dirName, attrs)) - Error(LoadStr(IDS_CANT_SET_ATTRS), GetLastError()); -*/ + if (!SetFileAttributes(dirName, attrs)) + Error(LoadStr(IDS_CANT_SET_ATTRS), GetLastError()); + */ return UNPACK_OK; } From a266f96b07568d6c56792b1c342b7bffc8aea56e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:13:53 +0200 Subject: [PATCH 496/710] [translation] Fix src/plugins/unchm/chmlib/chm_lib.c comments Refines translated comments in src/plugins/unchm/chmlib/chm_lib.c. Model: OpenAI GPT-5.4 Verification: Reviewed PR #773 for src/plugins/unchm/chmlib/chm_lib.c, restored the required CommentsTranslationProject translated marker on the head branch, reran clang-format, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/unchm/chmlib/chm_lib.c | 40 +++++++++++++++--------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/plugins/unchm/chmlib/chm_lib.c b/src/plugins/unchm/chmlib/chm_lib.c index f7d285ce7..4c855ba4c 100644 --- a/src/plugins/unchm/chmlib/chm_lib.c +++ b/src/plugins/unchm/chmlib/chm_lib.c @@ -1,5 +1,6 @@ /* $Id$ */ /*************************************************************************** +// CommentsTranslationProject: TRANSLATED * chm_lib.c - CHM archive manipulation routines * * ------------------- * * * @@ -372,9 +373,9 @@ static int _unmarshal_itsf_header(unsigned char** pData, else return 0; - /* now, if we have a V3 structure, unmarshal the rest. - * otherwise, compute it - */ + /* if we have a V3 structure, unmarshal the remaining fields. + * otherwise, compute data_offset + */ if (dest->version == 3) { if (*pDataLen != 0) @@ -413,7 +414,7 @@ static int _unmarshal_itsp_header(unsigned char** pData, unsigned int* pDataLen, struct chmItspHeader* dest) { - /* we only know how to deal with a 0x54 byte structures */ + /* we only know how to deal with 0x54-byte structures */ if (*pDataLen != _CHM_ITSP_V1_LEN) return 0; @@ -434,7 +435,7 @@ static int _unmarshal_itsp_header(unsigned char** pData, _unmarshal_uuid(pData, pDataLen, dest->system_uuid); _unmarshal_uchar_array(pData, pDataLen, dest->unknown_0044, 16); - /* error check the data */ + /* Validate the data. */ if (memcmp(dest->signature, "ITSP", 4) != 0) return 0; if (dest->version != 1) @@ -676,7 +677,7 @@ struct chmFile* chm_open(const char* filename) struct chmUnitInfo uiLzxc; struct chmLzxcControlData ctlData; - /* allocate handle */ + /* allocate a handle */ newHandle = (struct chmFile*)malloc(sizeof(struct chmFile)); if (newHandle == NULL) return NULL; @@ -988,7 +989,7 @@ void chm_set_param(struct chmFile* h, free(h->cache_block_indices); } - /* now, set new values */ + /* set the new values */ h->cache_blocks = newBlocks; h->cache_block_indices = newIndices; h->cache_num_blocks = paramVal; @@ -1037,12 +1038,11 @@ static UInt64 _chm_parse_cword(UChar** pEntry) /* parse a utf-8 string into an ASCII char buffer */ static int _chm_parse_UTF8(UChar** pEntry, UInt64 count, char* path) { - /* XXX: implement UTF-8 support, including a real mapping onto - * ISO-8859-1? probably there is a library to do this? As is - * immediately apparent from the below code, I'm presently not doing - * any special handling for files in which none of the strings contain - * UTF-8 multi-byte characters. - */ + /* XXX: implement UTF-8 support, including proper mapping to + * ISO-8859-1. The code below does not perform any special handling + * for files in which the strings contain no UTF-8 multi-byte + * characters. + */ while (count != 0) { *path++ = (char)(*(*pEntry)++); @@ -1079,7 +1079,7 @@ static UChar* _chm_find_in_PMGL(UChar* page_buf, UInt32 block_len, const char* objPath) { - /* XXX: modify this to do a binary search using the nice index structure + /* XXX: modify this to do a binary search using the index structure * that is provided for us. */ struct chmPmglHeader header; @@ -1151,7 +1151,7 @@ static Int32 _chm_find_in_PMGI(UChar* page_buf, if (!_chm_parse_UTF8(&cur, strLen, buffer)) return -1; - /* check if it is the right name */ + /* check whether this is the correct name */ if (strcasecmp(buffer, objPath) > 0) return page; @@ -1173,7 +1173,7 @@ int chm_resolve_object(struct chmFile* h, Int32 curPage; - /* buffer to hold whatever page we're looking at */ + /* buffer for the current page */ /* RWE 6/12/2003 */ UChar* page_buf = malloc(h->block_len); if (page_buf == NULL) @@ -1226,7 +1226,7 @@ int chm_resolve_object(struct chmFile* h, } } - /* didn't find anything. fail. */ + /* nothing found; fail */ free(page_buf); return CHM_RESOLVE_FAILURE; } @@ -1304,7 +1304,7 @@ static Int64 _chm_decompress_block(struct chmFile* h, if (cbuffer == NULL) return -1; - /* let the caching system pull its weight! */ + /* use the cache when possible */ if (block - blockAlign <= h->lzx_last_block && block >= h->lzx_last_block) blockAlign = (UInt32)(block - h->lzx_last_block); @@ -1430,7 +1430,7 @@ static Int64 _chm_decompress_region(struct chmFile* h, if (nLen > (h->reset_table.block_len - nOffset)) nLen = h->reset_table.block_len - nOffset; - /* if block is cached, return data from it. */ + /* If the block is cached, return data from the cache. */ CHM_ACQUIRE_LOCK(h->lzx_mutex); CHM_ACQUIRE_LOCK(h->cache_mutex); if (h->cache_block_indices[nBlock % h->cache_num_blocks] == nBlock && @@ -1506,7 +1506,7 @@ LONGINT64 chm_retrieve_object(struct chmFile* h, /* swill another mouthful */ swath = _chm_decompress_region(h, buf, ui->start + addr, len); - /* if we didn't get any... */ + /* if no data was retrieved */ if (swath == 0) return total; From 699dadc68ad7ba32cd40ec0970a6c81d75225cfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:14:21 +0200 Subject: [PATCH 497/710] [translation] Fix src/plugins/unchm/chmlib/lzx.c comments Refines translated comments in src/plugins/unchm/chmlib/lzx.c. Model: OpenAI GPT-5.4 Verification: Reviewed PR #774 for src/plugins/unchm/chmlib/lzx.c, restored the required CommentsTranslationProject translated marker on the head branch, reran clang-format, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/unchm/chmlib/lzx.c | 44 +++++++++++++++++----------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/plugins/unchm/chmlib/lzx.c b/src/plugins/unchm/chmlib/lzx.c index 4a2610a59..02068ac8e 100644 --- a/src/plugins/unchm/chmlib/lzx.c +++ b/src/plugins/unchm/chmlib/lzx.c @@ -1,5 +1,6 @@ /* $Id$ */ /*************************************************************************** +// CommentsTranslationProject: TRANSLATED * lzx.c - LZX decompression routines * * ------------------- * * * @@ -54,9 +55,9 @@ typedef signed int LONG; /* 32 bits (or more) */ #define LZX_BLOCKTYPE_ALIGNED (2) #define LZX_BLOCKTYPE_UNCOMPRESSED (3) #define LZX_PRETREE_NUM_ELEMENTS (20) -#define LZX_ALIGNED_NUM_ELEMENTS (8) /* aligned offset tree #elements */ -#define LZX_NUM_PRIMARY_LENGTHS (7) /* this one missing from spec! */ -#define LZX_NUM_SECONDARY_LENGTHS (249) /* length tree #elements */ +#define LZX_ALIGNED_NUM_ELEMENTS (8) /* number of elements in the aligned offset tree */ +#define LZX_NUM_PRIMARY_LENGTHS (7) /* missing from the spec */ +#define LZX_NUM_SECONDARY_LENGTHS (249) /* number of elements in the length tree */ /* LZX huffman defines: tweak tablebits as desired */ #define LZX_PRETREE_MAXSYMBOLS (LZX_PRETREE_NUM_ELEMENTS) @@ -361,16 +362,16 @@ int LZXreset(struct LZXstate* pState) /* make_decode_table(nsyms, nbits, length[], table[]) * - * This function was coded by David Tritscher. It builds a fast huffman - * decoding table out of just a canonical huffman code lengths table. + * This function was coded by David Tritscher. It builds a fast Huffman + * decoding table from a canonical Huffman code-length table. * - * nsyms = total number of symbols in this huffman tree. + * nsyms = total number of symbols in this Huffman tree. * nbits = any symbols with a code length of nbits or less can be decoded * in one lookup of the table. - * length = A table to get code lengths from [0 to syms-1] - * table = The table to fill up with decoded symbols and pointers. + * length = table of code lengths for symbols [0 to nsyms-1] + * table = table to fill with decoded symbols and pointers. * - * Returns 0 for OK or 1 for error + * Returns 0 for OK or 1 for error. */ static int make_decode_table(ULONG nsyms, ULONG nbits, UBYTE* length, UWORD* table) @@ -381,7 +382,7 @@ static int make_decode_table(ULONG nsyms, ULONG nbits, UBYTE* length, UWORD* tab ULONG fill; ULONG pos = 0; /* the current position in the decode table */ ULONG table_mask = 1 << nbits; - ULONG bit_mask = table_mask >> 1; /* don't do 0 length codes */ + ULONG bit_mask = table_mask >> 1; /* do not process 0-length codes */ ULONG next_symbol = bit_mask; /* base of allocation for long codes */ /* fill entries for codes short enough for a direct mapping */ @@ -628,14 +629,13 @@ int LZXdecompress(struct LZXstate* pState, unsigned char* inpos, unsigned char* /* buffer exhaustion check */ if (inpos > endinp) { - /* it's possible to have a file where the next run is less than - * 16 bits in size. In this case, the READ_HUFFSYM() macro used - * in building the tables will exhaust the buffer, so we should - * allow for this, but not allow those accidentally read bits to - * be used (so we check that there are at least 16 bits - * remaining - in this boundary case they aren't really part of - * the compressed data) - */ + /* it is possible to have a file where the next run is less than + * 16 bits in size. In this case, the READ_HUFFSYM() macro used + * while building the tables will exhaust the buffer, so this must + * be allowed, but those extra bits must not be used + * (so we check that at least 16 bits remain; in this boundary case + * they are not really part of the compressed data) + */ if (inpos > (endinp + 2) || bitsleft < 16) return DECR_ILLEGALDATA; } @@ -649,7 +649,7 @@ int LZXdecompress(struct LZXstate* pState, unsigned char* inpos, unsigned char* /* apply 2^x-1 mask */ window_posn &= window_size - 1; - /* runs can't straddle the window wraparound */ + /* runs cannot cross the window wraparound */ if ((window_posn + this_run) > window_size) return DECR_DATAFORMAT; @@ -684,7 +684,7 @@ int LZXdecompress(struct LZXstate* pState, unsigned char* inpos, unsigned char* if (match_offset > 2) { - /* not repeated offset */ + /* non-repeated offset */ if (match_offset != 3) { extra = extra_bits[match_offset]; @@ -766,7 +766,7 @@ int LZXdecompress(struct LZXstate* pState, unsigned char* inpos, unsigned char* if (match_offset > 2) { - /* not repeated offset */ + /* non-repeated offset */ extra = extra_bits[match_offset]; match_offset = position_base[match_offset] - 2; if (extra > 3) @@ -847,7 +847,7 @@ int LZXdecompress(struct LZXstate* pState, unsigned char* inpos, unsigned char* break; default: - return DECR_ILLEGALDATA; /* might as well */ + return DECR_ILLEGALDATA; /* treat as illegal data */ } } } From 3c7f757ef1c18d2e07d995dc7c8290a25aef0a6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:14:49 +0200 Subject: [PATCH 498/710] [translation] Fix src/plugins/unchm/chmlib/main.c comments Refines translated comments in src/plugins/unchm/chmlib/main.c. Model: OpenAI GPT-5.4 Verification: Reviewed PR #775 for src/plugins/unchm/chmlib/main.c, restored the required CommentsTranslationProject translated marker on the head branch, reran clang-format, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/unchm/chmlib/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/unchm/chmlib/main.c b/src/plugins/unchm/chmlib/main.c index e9d54970e..fa864f747 100644 --- a/src/plugins/unchm/chmlib/main.c +++ b/src/plugins/unchm/chmlib/main.c @@ -1,5 +1,6 @@ // // +// CommentsTranslationProject: TRANSLATED // #include @@ -19,5 +20,5 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) break; } } - return TRUE; // DLL can be loaded + return TRUE; // Allow the DLL to load } From b694973bd7d380d1c9d1870d9e3b908c8df38442 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:15:17 +0200 Subject: [PATCH 499/710] [translation] Fix src/plugins/unchm/unchm.cpp comments Refines translated comments in src/plugins/unchm/unchm.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #776 for src/plugins/unchm/unchm.cpp, restored the required CommentsTranslationProject translated marker on the head branch, reran clang-format, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/unchm/unchm.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/unchm/unchm.cpp b/src/plugins/unchm/unchm.cpp index d4fd16785..5c97420b3 100644 --- a/src/plugins/unchm/unchm.cpp +++ b/src/plugins/unchm/unchm.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" #include "dbg.h" @@ -59,7 +60,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) break; } } - return TRUE; // DLL can be loaded + return TRUE; // Allow the DLL to load } char* LoadStr(int resID) @@ -154,7 +155,7 @@ BOOL Error(int resID, BOOL quiet, ...) BOOL Error(char* msg, DWORD err, BOOL quiet) { if (!quiet) - if (err != ERROR_FILE_NOT_FOUND && err != ERROR_NO_MORE_FILES) // this is an error + if (err != ERROR_FILE_NOT_FOUND && err != ERROR_NO_MORE_FILES) // actual error { char buf[1024]; sprintf(buf, "%s\n\n%s", msg, SalamanderGeneral->GetErrorText(err)); From bc0442bcc555e87b89c254e4f08c9d6473fcea0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:15:45 +0200 Subject: [PATCH 500/710] [translation] Fix src/plugins/uniso/BlockedFile.h comments Refines translated comments in src/plugins/uniso/BlockedFile.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #777 for src/plugins/uniso/BlockedFile.h, restored the required CommentsTranslationProject translated marker on the head branch, reran clang-format, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/uniso/BlockedFile.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/uniso/BlockedFile.h b/src/plugins/uniso/BlockedFile.h index e492b8ab4..c460c93fd 100644 --- a/src/plugins/uniso/BlockedFile.h +++ b/src/plugins/uniso/BlockedFile.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once @@ -105,7 +106,7 @@ class CBlockedFile : public CFile UInt64 FileSize; CCachedBlock* BlockCache[32]; // 32 MRU blocks - int MRUCachedBlock; // index into MRUCachedBlock + int MRUCachedBlock; // index of the MRU cached block CCachedBlock* pCurBlock; bool bUnknownBlockErrShown; From df63375920ebf6069e4c1d5a4006ab07cd13a722 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:16:13 +0200 Subject: [PATCH 501/710] [translation] Fix src/plugins/uniso/dmg.cpp comments Refines translated comments in src/plugins/uniso/dmg.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #778 for src/plugins/uniso/dmg.cpp, restored the required CommentsTranslationProject translated marker on the head branch, reran clang-format, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/uniso/dmg.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/plugins/uniso/dmg.cpp b/src/plugins/uniso/dmg.cpp index 64a3fc533..f278656c1 100644 --- a/src/plugins/uniso/dmg.cpp +++ b/src/plugins/uniso/dmg.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -67,7 +68,7 @@ static int UnBase64(char* s) *out++ = (b3 >> 2) | (b2 << 4); *out++ = b4 | (b3 << 6); } - // NOTE: we don't care about the last extra 1 or 2 or 3 bytes we added + // NOTE: Ignore the last extra 1, 2, or 3 bytes that were added return (int)(out - orig); } @@ -362,8 +363,8 @@ CDMGFile::CADCBlock::CADCBlock(BlockInfo* blockInfo, HANDLE hFile) } else { - // NOTE: memcpy & memmove cannot be used in general, they read by dwords - // NOTE: http://www.macdisk.com/dmgen.php says something about memset... but it doesn't work - see SymArt_Demo.dmg + // NOTE: memcpy and memmove cannot be used in general; they read in DWORDs + // NOTE: http://www.macdisk.com/dmgen.php mentions memset, but it does not work; see SymArt_Demo.dmg while (len-- > 0) *out++ = *src++; } @@ -382,8 +383,8 @@ CDMGFile::CADCBlock::CADCBlock(BlockInfo* blockInfo, HANDLE hFile) } else { - // NOTE: memcpy & memmove cannot be used in general, they read by dwords - // NOTE: http://www.macdisk.com/dmgen.php says something about memset... but it doesn't work - see SymArt_Demo.dmg + // NOTE: memcpy & memmove cannot generally be used; they read in DWORDs + // NOTE: http://www.macdisk.com/dmgen.php mentions memset... but it does not work - see SymArt_Demo.dmg while (len-- > 0) *out++ = *src++; } From 199789fe87f9ff02736c2a96cea91d2b423d144b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:16:42 +0200 Subject: [PATCH 502/710] [translation] Fix src/plugins/uniso/eltorito.cpp comments Refines translated comments in src/plugins/uniso/eltorito.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #779 for src/plugins/uniso/eltorito.cpp, restored the required CommentsTranslationProject translated marker on the head branch, reran clang-format, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/uniso/eltorito.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/plugins/uniso/eltorito.cpp b/src/plugins/uniso/eltorito.cpp index ae99ed91d..e59da9cc3 100644 --- a/src/plugins/uniso/eltorito.cpp +++ b/src/plugins/uniso/eltorito.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" #include "dbg.h" @@ -37,10 +38,10 @@ struct etDefaultEntry BYTE BootIndicator; // 88 - Bootable // 00 - Not bootable BYTE BootMedia; // 0 - No emulation - // 1 - 1.2 meg diskette - // 2 - 1.44 meg diskette - // 3 - 2.88 meg diskette - // 4 - Hard disk (drive 80) + // 1 - 1.2 MB diskette + // 2 - 1.44 MB diskette + // 3 - 2.88 MB diskette + // 4 - Hard disk (drive 80h) WORD LoadSegment; BYTE SystemType; BYTE Unused; @@ -63,7 +64,7 @@ struct etSectionHeaderEntry // section entry struct etSectionEntry { - BYTE BootIndicator; // 88 - Bootlable + BYTE BootIndicator; // 88 - Bootable // 00 - Not bootable BYTE BootMedia; // Bits 0-3 count as follows @@ -85,7 +86,7 @@ struct etSectionEntry DWORD LoadRBA; }; -// +// Fills boot record info from El Torito data. BOOL CISO9660::FillBootRecordInfoElTorito(CBootRecordInfo* bri, BYTE bootMedia, WORD sectorCount, DWORD loadRBA) { CALL_STACK_MESSAGE4("CISO9660::FillBootRecordInfoElTorito(, %u, %u, %u)", bootMedia, sectorCount, loadRBA); @@ -169,7 +170,7 @@ BOOL CISO9660::ReadElTorito(BYTE* catalog, DWORD size, BOOL quiet) memcpy(&ve, catalog + offset, sizeof(ve)); offset += ENTRY_LENGTH; - // check if it is validation entry + // check whether this is a validation entry if (ve.ID != 01 || ve.Reserved != 0x00 || ve.KeyByte[0] != 0x55 || ve.KeyByte[1] != 0xAA) return FALSE; @@ -180,7 +181,7 @@ BOOL CISO9660::ReadElTorito(BYTE* catalog, DWORD size, BOOL quiet) if (de.BootIndicator == 0x88) { - // it is bootable + // bootable BootRecordInfo = new CBootRecordInfo; if (BootRecordInfo == NULL) { @@ -192,7 +193,7 @@ BOOL CISO9660::ReadElTorito(BYTE* catalog, DWORD size, BOOL quiet) return TRUE; } - // it is valid entry, go on... + // valid entry, continue... // BYTE entryBuffer[ENTRY_LENGTH]; while (offset < size) From e145094867d4c1c89ec7a25a7583c1746481d7eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:17:10 +0200 Subject: [PATCH 503/710] [translation] Fix src/plugins/uniso/hfs.cpp comments Refines translated comments in src/plugins/uniso/hfs.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #780 for src/plugins/uniso/hfs.cpp, restored the required CommentsTranslationProject translated marker on the head branch, reran clang-format, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/uniso/hfs.cpp | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/plugins/uniso/hfs.cpp b/src/plugins/uniso/hfs.cpp index 842ab23b4..e907e37a1 100644 --- a/src/plugins/uniso/hfs.cpp +++ b/src/plugins/uniso/hfs.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" #include "dbg.h" @@ -77,7 +78,7 @@ static void FixIllegalFSChars(char* s) { s++; // Skip both the lead and following bytes if (!*s) - break; // Invalid string! Lead byte followed by terminating byte! + break; // Invalid string: lead byte followed by a terminating null byte. } else { @@ -162,7 +163,7 @@ BOOL CHFS::Open(BOOL quiet) } else { - return Error(IDS_ERR_HFS_UNRECOGNIZED, quiet); // Can this happen??? + return Error(IDS_ERR_HFS_UNRECOGNIZED, quiet); // Can this case occur? } // VolumeHeader is stored at sector 2 & second to last sector (starting 1024 bytes before the end) @@ -179,7 +180,7 @@ BOOL CHFS::Open(BOOL quiet) { MDBRecord mdb; - // It is a HFS, not HFS partition. Look for wrapped HFS+ partition + // It is HFS, not an HFS partition. Look for a wrapped HFS+ partition SeekRel(-(int)sizeof(VolHeader)); if (!Read(&mdb, sizeof(mdb), &dwBytesRead)) return FALSE; @@ -215,7 +216,7 @@ BOOL CHFS::Open(BOOL quiet) return TRUE; } -// Seeks on disk (sector is usually 512 or 2048 bytes) +// Seeks to the specified sector on disk (a sector is usually 512 or 2048 bytes) // Returns TRUE on success BOOL CHFS::SeekSector(int sector) { @@ -223,7 +224,7 @@ BOOL CHFS::SeekSector(int sector) return (newPos == Image->File->Seek(newPos, FILE_BEGIN)) ? TRUE : FALSE; } -// Seeks on HFS+ partition (block is usually 4096 bytes) +// Seeks to the specified block in the HFS+ partition (a block is usually 4096 bytes) // Returns TRUE on success BOOL CHFS::SeekBlock(int block) { @@ -289,7 +290,7 @@ BOOL CHFS::ListDirectory(char* rootPath, int session, int keyLen = FromM16(pKey->keyLength); int nameLen = FromM16(pKey->nodeName.length); wchar_t fileNameW[256]; - char fileName[256 * 2]; // twice the length for MBCS + char fileName[256 * 2]; // twice the length to allow for MBCS CFileData fd; char* path = rootPath; union @@ -301,7 +302,7 @@ BOOL CHFS::ListDirectory(char* rootPath, int session, if ((keyLen <= 6) || (nameLen == 0) || (bSkipRootParent && pKey->parentID == FromM32(kHFSRootParentID))) { - continue; // Skip threads with empty name and RootParent already used as volume label + continue; // Skip threads with an empty name and RootParent, which is already used as the volume label } for (int j = 0; j < nameLen; j++) fileNameW[j] = FromM16(pKey->nodeName.unicode[j]); @@ -394,7 +395,7 @@ BOOL CHFS::ListDirectory(char* rootPath, int session, pFolders[nFolders++] = fi; continue; } - // AddDir failed (too long path?) -> continue + // AddDir failed (path too long?) free(fi); Error(IDS_ERR_TOO_LONG_PATH, FALSE); } @@ -408,7 +409,7 @@ BOOL CHFS::ListDirectory(char* rootPath, int session, if ((rec.file->userInfo.fdCreator == kSymLinkCreator) && (rec.file->userInfo.fdType == kSymLinkFileType)) { - // Symbolic links. The data fork contains UTF8-encoded path to target + // Symbolic links. The data fork contains the UTF-8-encoded path to the target fd.IsLink = true; // SalamanderGeneral->Free(fd.Name); // delete filePos; @@ -495,7 +496,7 @@ int CHFS::UnpackFile(CSalamanderForOperationsAbstract* salamander, const char* s if (toSkip) return UNPACK_ERROR; - // Full Cancel + // Cancel the entire operation if (hFile == INVALID_HANDLE_VALUE) return UNPACK_CANCEL; @@ -566,13 +567,13 @@ int CHFS::UnpackFile(CSalamanderForOperationsAbstract* salamander, const char* s if (!bFileComplete) { // because it was created with the read-only attribute, we must clear - // the R attribute so the file can be deleted + // the read-only attribute so the file can be deleted attrs &= ~FILE_ATTRIBUTE_READONLY; if (!SetFileAttributes(name, attrs)) Error(LoadStr(IDS_CANT_SET_ATTRS), GetLastError()); // the user cancelled the operation - // delete the incomplete file afterwards + // delete the incomplete file if (!DeleteFile(name)) Error(LoadStr(IDS_CANT_DELETE_TEMP_FILE), GetLastError()); } @@ -640,7 +641,7 @@ CHFS::BTree::BTree(CHFS* hfs, CHFS::HFSPlusForkData* fork, BOOL quiet) BTNodeDescriptor* node = (BTNodeDescriptor*)pBTreeData; - // We require full tree with header node. + // We require the full tree, including the header node. if (node->kind != kBTHeaderNode) { Error(IDS_ERR_HFS_BTREE_NODETYPE, quiet); @@ -674,8 +675,8 @@ CHFS::BTree::BTree(CHFS* hfs, CHFS::HFSPlusForkData* fork, BOOL quiet) nRecordsCheck += nRecordsInNode; if (nRecordsCheck > nRecords) { - // In theory, should not be needed. - // But buggy MagicISO 5.2 stores # of nodes and not records in numRecords :-( + // In theory, this should not be needed. + // However, buggy MagicISO 5.2 stores the number of nodes, not records, in numRecords. int currInd = (int)(pRecord - pRecords); void** tmp = (void**)realloc(pRecords, sizeof(void*) * nRecordsCheck); if (!tmp) @@ -693,7 +694,7 @@ CHFS::BTree::BTree(CHFS* hfs, CHFS::HFSPlusForkData* fork, BOOL quiet) UInt16 ofs = *(UInt16*)(((char*)node) + nodeSize - (i + 1) * sizeof(UInt16)); *pRecord++ = (char*)node + FromM16(ofs); } - // Traverse till the forward link is empty + // Traverse until the forward link is empty if (!node->fLink) break; node = (BTNodeDescriptor*)(pBTreeData + FromM32(node->fLink) * nodeSize); @@ -710,7 +711,7 @@ CHFS::BTree::BTree(CHFS* hfs, CHFS::HFSPlusForkData* fork, BOOL quiet) } else if (!nRecords) { - // Either realloc failed or nRecord is 0 and thus pRecords was freed + // Either realloc failed, or nRecords is 0 and pRecords was therefore freed pRecords = NULL; } } From fd2755767a4dfef096ff0d53141e0f94f44d703f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:17:38 +0200 Subject: [PATCH 504/710] [translation] Fix src/plugins/uniso/hfs.h comments Refines translated comments in src/plugins/uniso/hfs.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #781 for src/plugins/uniso/hfs.h, restored the required CommentsTranslationProject translated marker on the head branch, reran clang-format, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/uniso/hfs.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/uniso/hfs.h b/src/plugins/uniso/hfs.h index 17caae3c0..aef71b20d 100644 --- a/src/plugins/uniso/hfs.h +++ b/src/plugins/uniso/hfs.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once @@ -73,7 +74,6 @@ class CHFS : public CUnISOFSAbstract UInt32 pmBootEntry2; // reserved UInt32 pmBootCksum; // boot code checksum char pmProcessor[16]; // processor type - // UInt16 pmPad[0..188]; // reserved }; struct HFSExtentDescriptor @@ -234,7 +234,7 @@ class CHFS : public CUnISOFSAbstract kHFSRootFolderID = 2, // Folder ID of the root folder kHFSExtentsFileID = 3, // File ID of the extents overflow file kHFSCatalogFileID = 4, // File ID of the catalog file - kHFSBadBlockFileID = 5, // File ID of the bad block file. The bad block file is not a file in the same sense as a special file and a user file + kHFSBadBlockFileID = 5, // File ID of the bad block file. The bad block file is not a file in the same sense as a special file or a user file kHFSAllocationFileID = 6, // File ID of the allocation file (introduced with HFS Plus) kHFSStartupFileID = 7, // File ID of the startup file (introduced with HFS Plus) kHFSAttributesFileID = 8, // File ID of the attributes file (introduced with HFS Plus) @@ -406,7 +406,7 @@ class CHFS : public CUnISOFSAbstract bool bSkipRootParent; BOOL SeekSector(int sector); // Seeks on disk (sector is usually 512 or 2048 bytes); TRUE on success - BOOL SeekBlock(int block); // Seeks on HFS+ partition (block is usually 4096 bytes); TRUE on success + BOOL SeekBlock(int block); // Seeks to the given block on the HFS+ partition (the block is usually 4096 bytes); returns TRUE on success __int64 SeekRel(int offset); // Seeks relatively; Returns new position BOOL Read(LPVOID buf, DWORD dwBytesToRead, DWORD* dwBytesRead); From d9f33e0ef15a18db81c77692579a7c4d85ce0ed4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:18:06 +0200 Subject: [PATCH 505/710] [translation] Fix src/plugins/uniso/iso9660.cpp comments Refines translated comments in src/plugins/uniso/iso9660.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #782 for src/plugins/uniso/iso9660.cpp, restored the required CommentsTranslationProject translated marker on the head branch, reran clang-format, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/uniso/iso9660.cpp | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/plugins/uniso/iso9660.cpp b/src/plugins/uniso/iso9660.cpp index e80a229e8..60083ce50 100644 --- a/src/plugins/uniso/iso9660.cpp +++ b/src/plugins/uniso/iso9660.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" #include "dbg.h" @@ -60,13 +61,13 @@ BOOL CISO9660::Open(BOOL quiet) // detecting CD-ROM Volume Descriptor Set BOOL isoDescriptors = FALSE; - // Read the VolumeDescriptor (2k) until we find it, but only up to to 1MB + // Read the Volume Descriptor (2 KB) until we find it, but only up to 1 MB while (!terminate) { // Try to read a block if (Image->ReadBlock(block, SECTOR_SIZE, sector) != SECTOR_SIZE) { - // Something went wrong, probably EOF? + // Read failed, possibly due to EOF. Error(IDS_ERROR_READING_SECTOR, quiet, block); ret = FALSE; break; @@ -90,8 +91,8 @@ BOOL CISO9660::Open(BOOL quiet) // Joliet has FileStructureVersion = 1 if (SVD.FileStructureVersion == 1) Ext = extJoliet; - // Patera 2009.02.03: The following check seems correct and not the above one... - // Raptor provided "Pantera Safari.ISO" with corruped FileStructureVersion + // Patera 2009-02-03: The following check seems correct, unlike the one above... + // Raptor provided "Pantera Safari.ISO" with a corrupted FileStructureVersion if ((SVD.EscapeSequences[0] == 0x25) && (SVD.EscapeSequences[1] == 0x2F) && ((SVD.EscapeSequences[2] == 0x40) || (SVD.EscapeSequences[2] == 0x43) || (SVD.EscapeSequences[2] == 0x45))) Ext = extJoliet; break; @@ -169,7 +170,7 @@ void CISO9660::ExtractExtFileName(char* fileName, const char* src, CDirectoryRec srcSU++; } - // check whether there is any extension in the 'system use area' + // check whether the 'system use area' contains any extension if (srcSU < srcEnd && (Ext != extJoliet)) { EExt ext = extNone; @@ -457,7 +458,7 @@ int CISO9660::ListDirectoryRe(char* path, CDirectoryRecord* root, { delete[] data; Error(IDS_ERROR_LISTING_IMAGE, FALSE, block); - // if reading the sector with the root fails + // if reading the root sector fails return (block == (DWORD)Root.LocationOfExtent - ExtentOffset) ? ERR_CONTINUE : ERR_TERMINATE; } @@ -497,11 +498,11 @@ int CISO9660::ListDirectoryRe(char* path, CDirectoryRecord* root, int pathLen = (int)strlen(path); strcat(path, "\\"); strcat(path, dirName); - // descend only when everything is OK + // recurse only when everything is OK if (ret == ERR_OK) { ret = ListDirectoryRe(path, &dirRecord, dir, pluginData); - // if we surface with a termination error, keep processing as much as possible + // if we return with a termination error, keep processing as much as possible if (ret == ERR_TERMINATE) ret = ERR_CONTINUE; } @@ -530,7 +531,7 @@ int CISO9660::ListDirectoryRe(char* path, CDirectoryRecord* root, if (ret == ERR_OK) { ret = ListDirectoryRe(path, &dirRecord, dir, pluginData); - // if we surface with a termination error, keep processing as much as possible + // if we return with a termination error, continue processing as much as possible if (ret == ERR_TERMINATE) ret = ERR_CONTINUE; } @@ -594,7 +595,7 @@ int CISO9660::UnpackFile(CSalamanderForOperationsAbstract* salamander, const cha // set file time file.SetFileTime(&ft, &ft, &ft); - // the overall operation can continue further: skip only + // the overall operation can continue; skip this file only if (toSkip) return UNPACK_ERROR; @@ -658,14 +659,14 @@ int CISO9660::UnpackFile(CSalamanderForOperationsAbstract* salamander, const cha block++; - if (!salamander->ProgressAddSize(nbytes, TRUE)) // delayedPaint==TRUE, so we do not slow things down + if (!salamander->ProgressAddSize(nbytes, TRUE)) // delayedPaint==TRUE so we do not slow the operation down { salamander->ProgressDialogAddText(LoadStr(IDS_CANCELING_OPERATION), FALSE); salamander->ProgressEnableCancel(FALSE); ret = UNPACK_CANCEL; bFileComplete = FALSE; - break; // action interrupted + break; // operation interrupted } ULONG written; @@ -700,7 +701,7 @@ int CISO9660::UnpackFile(CSalamanderForOperationsAbstract* salamander, const cha Error(LoadStr(IDS_CANT_SET_ATTRS), GetLastError()); // the user cancelled the operation - // delete the incomplete file afterwards + // delete the incomplete file if (!DeleteFile(name)) Error(LoadStr(IDS_CANT_DELETE_TEMP_FILE), GetLastError()); } @@ -778,7 +779,7 @@ BOOL CISO9660::ReadBootRecord(BYTE* data, BOOL quiet) if (!Options.BootImageAsFile) return FALSE; - // check for El Torito specification + // check for the El Torito specification if (memcmp(BR.BootSystemIdentifier + 0, "EL TORITO SPECIFICATION", 23) == 0) { DWORD sector = 0; @@ -802,6 +803,6 @@ BOOL CISO9660::ReadBootRecord(BYTE* data, BOOL quiet) delete[] catalog; } - // and finally + // Finally return result; } From ee37b3e9ac51efc9910246a7f3d0fef3f5ccdde5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:18:34 +0200 Subject: [PATCH 506/710] [translation] Fix src/plugins/uniso/isoimage.cpp comments Refines translated comments in src/plugins/uniso/isoimage.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #783 for src/plugins/uniso/isoimage.cpp, restored the required CommentsTranslationProject translated marker on the head branch, reran clang-format, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/uniso/isoimage.cpp | 37 +++++++++++++++++----------------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/src/plugins/uniso/isoimage.cpp b/src/plugins/uniso/isoimage.cpp index 4228b821f..efbe5478d 100644 --- a/src/plugins/uniso/isoimage.cpp +++ b/src/plugins/uniso/isoimage.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" #include "dbg.h" @@ -54,7 +55,7 @@ void ISODateTimeToFileTime(BYTE isodt[], FILETIME* ft) st.wMilliseconds = 0; SystemTimeToFileTime(&st, ft); - // idodt[6] Offset from Greenwich Mean Time in number of 15 minute intervals from -48(West) to +52(East) + // isodt[6] Offset from Greenwich Mean Time in 15-minute intervals, from -48 (West) to +52 (East) newtime = ft->dwLowDateTime + (((__int64)ft->dwHighDateTime) << 32); newtime -= ((__int64)(signed char)isodt[6]) * 15 * 60 * 1000 * 1000 * 10; // from 15min units to 100ns units ft->dwLowDateTime = (DWORD)(newtime & 0xffffffff); @@ -324,7 +325,7 @@ BOOL CISOImage::CheckForISO(BOOL quiet /* = FALSE*/) return FALSE; if (IsValidCDHeader(hdr) || IsValidUDFHeader(hdr)) - return TRUE; // ok, it's ISO + return TRUE; // ISO detected. return FALSE; } @@ -340,7 +341,7 @@ BOOL CISOImage::CheckForNRG(BOOL quiet /* = FALSE*/) if (IsValidCDHeader(hdr) || IsValidUDFHeader(hdr)) { - // ok, it's NRG + // NRG detected DataOffset = 0x4B000; return TRUE; } @@ -387,7 +388,7 @@ BOOL CISOImage::CheckForNCD(BOOL quiet /* = FALSE*/) if (IsValidCDHeader(hdr)) { - // ok, it's NCD + // NCD detected DataOffset = 0x16E4E; return TRUE; } @@ -405,7 +406,7 @@ BOOL CISOImage::CheckForPDI(BOOL quiet /* = FALSE*/) if (IsValidCDHeader(hdr)) { - // ok, it's PDI + // PDI detected DataOffset = 0x130; return TRUE; } @@ -425,7 +426,7 @@ BOOL CISOImage::CheckForECDC(BOOL quiet /* = FALSE*/) if (IsValidCDHeader(hdr)) { - // ok, it's Easy CD Creator + // Easy CD Creator detected DataOffset = 0x0; SetSectorFormat(stMode2Form1); return TRUE; @@ -444,7 +445,7 @@ BOOL CISOImage::CheckForC2D(BOOL quiet /* = FALSE*/) if (IsValidCDHeader(hdr)) { - // ok, it's WinOnCD + // WinOnCD detected DataOffset = 0x20000; return TRUE; } @@ -469,7 +470,7 @@ BOOL CISOImage::CheckForC2D(BOOL quiet /* = FALSE*/) if (IsValidCDHeader(hdr)) { - // ok, it's WinOnCD + // recognized as WinOnCD DataOffset = 0x000120; return TRUE; } @@ -516,7 +517,7 @@ BOOL CISOImage::CheckForCIF(BOOL quiet /* = FALSE*/) return FALSE; if (!isRIFFHeader(&riffHead) || !checkChunk(&riffHead, "imag")) return FALSE; - offset += riffHead.Size + 8; // skip this block, sizeof(RIFF signature + chunk size) == 8 + offset += riffHead.Size + 8; // Skip this block; the RIFF signature and chunk size take 8 bytes alignOffset(&offset); // disc chunk @@ -534,7 +535,7 @@ BOOL CISOImage::CheckForCIF(BOOL quiet /* = FALSE*/) return FALSE; offset += sizeof(riffHead) + 8; // sizeof(SectorHeader) == 8 - // it is highly probable that this is a CIF + // most likely a CIF image SetSectorFormat(stCIF); if (ReadDataByPos(offset + GetSectorOffset(16), sizeof(hdr), hdr) != sizeof(hdr)) @@ -542,7 +543,7 @@ BOOL CISOImage::CheckForCIF(BOOL quiet /* = FALSE*/) if (IsValidCDHeader(hdr)) { - // ok, it's CIF + // CIF detected DataOffset = offset; return TRUE; } @@ -720,7 +721,7 @@ BOOL CISOImage::ReadSessionInfo(BOOL quiet /* = FALSE*/) if (fn != NULL) { char* ext = strrchr(fn, '.'); - if (ext != NULL) // ".cvspass" is extension in Windows + if (ext != NULL) // ".cvspass" is considered an extension in Windows { ext++; if (SalamanderGeneral->StrICmp(ext, "nrg") == 0) @@ -877,7 +878,7 @@ BOOL CISOImage::Open(const char* fileName, BOOL quiet /* = FALSE*/) } else { - // If an error occured, CBufferedFile will complain soon... + // If an error occurred, CBufferedFile will report it soon... File = new CBufferedFile(hFile, GENERIC_READ); } } @@ -905,7 +906,7 @@ BOOL CISOImage::Open(const char* fileName, BOOL quiet /* = FALSE*/) if (ret == ERR_CONTINUE) { Tracks[trk]->FSType = fsData; - ret = ERR_OK; // we can handle raw data tracks, so we turn the error into OK (what rascals we are :-D) + ret = ERR_OK; // we can handle raw data tracks, so we change the error to OK } if (ret == ERR_TERMINATE) throw ERR_TERMINATE; @@ -948,7 +949,7 @@ BOOL CISOImage::Open(const char* fileName, BOOL quiet /* = FALSE*/) } else { - // if we don't know the CD info, set it up according to known information + // If the CD information is unknown, initialize it from the available information. DataOffset = 0x0; DetectSectorType(); @@ -1134,7 +1135,7 @@ int CISOImage::DetectTrackFS(int track) block++; - // Just to make sure we don't read in a too big file, stop after 128 sectors. + // To avoid reading too much data, stop after 128 sectors. if (block > 128) break; } @@ -1210,7 +1211,7 @@ BOOL CISOImage::OpenTrack(int track, BOOL quiet) if (track < 0 || track >= Tracks.Count) return FALSE; - // we want to open a track that is already open. We don't have to ;) + // The requested track is already open if (OpenedTrack == track) return TRUE; @@ -1476,7 +1477,7 @@ BOOL CISOImage::UnpackDir(const char* dirName, const CFileData* fileData) DWORD attrs = fileData->Attr; // set attrs to dir - if (Options.ClearReadOnly) // clear ReadOnly Attribute if needed + if (Options.ClearReadOnly) // Clear the read-only attribute if needed attrs &= ~FILE_ATTRIBUTE_READONLY; if (!SetFileAttributes(dirName, attrs)) From 6e7721e2654691502ed25df9bb2b7512ac00b247 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:22:37 +0200 Subject: [PATCH 507/710] [translation] Fix src/plugins/uniso/nrg.cpp comments Refines translated comments in src/plugins/uniso/nrg.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #784 for src/plugins/uniso/nrg.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/uniso/nrg.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/uniso/nrg.cpp b/src/plugins/uniso/nrg.cpp index 4b8666221..9bb45af80 100644 --- a/src/plugins/uniso/nrg.cpp +++ b/src/plugins/uniso/nrg.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" #include "dbg.h" @@ -269,7 +270,7 @@ readCDTX(CFile& file, NRGHeader* header, CISOImage* iso) dst = data; int i; for (i = header->Size; i > 0; i -= 12 + 6) - { // Remove some unknown data (there are blocks of 12 bytes of labels followed by unkown 6 bytes) + { // Remove some unknown data (there are blocks of 12 bytes of labels followed by unknown 6 bytes) memmove(dst, src, min(12, i)); dst += 12; src += 12 + 6; From 7150253c2772cd58afffb19e7bbca0972d76f3f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:22:57 +0200 Subject: [PATCH 508/710] [translation] Fix src/plugins/uniso/rawfs.cpp comments Refines translated comments in src/plugins/uniso/rawfs.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #785 for src/plugins/uniso/rawfs.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/uniso/rawfs.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/plugins/uniso/rawfs.cpp b/src/plugins/uniso/rawfs.cpp index a9cfbe86d..064189969 100644 --- a/src/plugins/uniso/rawfs.cpp +++ b/src/plugins/uniso/rawfs.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" #include "dbg.h" @@ -93,11 +94,11 @@ int CRawFS::UnpackFile(CSalamanderForOperationsAbstract* salamander, const char* // set file time file.SetFileTime(&ft, &ft, &ft); - // the overall operation can continue further: skip only + // the overall operation can continue; skip only this file if (toSkip) throw UNPACK_ERROR; - // the overall operation cannot continue any further: cancel + // the overall operation cannot continue; cancel if (hFile == INVALID_HANDLE_VALUE) throw UNPACK_CANCEL; @@ -111,8 +112,8 @@ int CRawFS::UnpackFile(CSalamanderForOperationsAbstract* salamander, const char* } */ - // it is possible that the extent does not need to be subtracted here; there is no data to test with, so I don't know :( - // but the more probable variant is that it should be subtracted + // it is possible that the extent does not need to be subtracted here; there is no data to test this, so it is unclear + // but it is more likely that it should be subtracted DWORD block = fp->Extent - ExtentOffset; CQuadWord remain = fileData->Size; @@ -163,7 +164,7 @@ int CRawFS::UnpackFile(CSalamanderForOperationsAbstract* salamander, const char* ULONG written; if (!file.Write(sector, nbytes, &written, name, NULL)) { - // Error message was already displayed by SafeWriteFile() + // The error message has already been displayed. ret = UNPACK_CANCEL; bFileComplete = FALSE; break; @@ -183,13 +184,13 @@ int CRawFS::UnpackFile(CSalamanderForOperationsAbstract* salamander, const char* if (!bFileComplete) { // because it was created with the read-only attribute, we must clear - // the R attribute so the file can be deleted + // the read-only attribute so the file can be deleted attrs &= ~FILE_ATTRIBUTE_READONLY; if (!SetFileAttributes(name, attrs)) Error(LoadStr(IDS_CANT_SET_ATTRS), GetLastError()); - // the user cancelled the operation - // delete the incomplete file afterwards + // user canceled the operation + // delete the incomplete file if (!DeleteFile(name)) Error(LoadStr(IDS_CANT_DELETE_TEMP_FILE), GetLastError()); } From 90ad85f0cca2d2ace9be12542976c9bfb36974aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:23:18 +0200 Subject: [PATCH 509/710] [translation] Fix src/plugins/uniso/udf.cpp comments Refines translated comments in src/plugins/uniso/udf.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #786 for src/plugins/uniso/udf.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/uniso/udf.cpp | 53 ++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/src/plugins/uniso/udf.cpp b/src/plugins/uniso/udf.cpp index 0ea0b1129..d772d95ee 100644 --- a/src/plugins/uniso/udf.cpp +++ b/src/plugins/uniso/udf.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" #include "dbg.h" @@ -17,9 +18,9 @@ typedef wchar_t unicode_t; #define SECTOR_SIZE 0x800 -#define INVALID_SECTOR_NUMBER -11111111 // reasonable negative number; Should not be -1 or so!! +#define INVALID_SECTOR_NUMBER -11111111 // A suitable negative number; should not be -1 or similar. -// Maximum length of filenames allowed in UDF. +// Maximum filename length allowed in UDF. #define MAX_UDF_FILE_NAME_LEN 2048 // Flags for testing the File Identifier Descriptor @@ -65,7 +66,7 @@ UDFTimeStampToFileTime(CUDF::CTimeStamp& stamp, FILETIME* ft) { // Valid timezone, offset in minutes __int64 newtime = ft->dwLowDateTime + (((__int64)ft->dwHighDateTime) << 32); - if (offset & 0x800) // negative 12-bit number -> extend to 32-bit negative number + if (offset & 0x800) // negative 12-bit number -> sign-extend to a 32-bit negative number offset |= 0xFFFFF000; newtime -= ((__int64)offset) * 60 * 1000 * 1000 * 10; // from min units to 100ns units ft->dwLowDateTime = (DWORD)(newtime & 0x00000000ffffffff); @@ -90,7 +91,7 @@ UnicodeUncompress(BYTE* compressed, int numberOfBytes, unicode_t* unicode) unsigned int compID; int returnValue, unicodeIndex, byteIndex; - // Use 'compressed' to store current byte being read. + // 'compressed' points to the compressed input bytes being read. compID = compressed[0]; // First check for valid compID. @@ -104,7 +105,7 @@ UnicodeUncompress(BYTE* compressed, int numberOfBytes, unicode_t* unicode) byteIndex = 1; if (16 == compID) { - // Make it odd number: length byte plus even number of text bytes + // Make it an odd number: a length byte plus an even number of text bytes numberOfBytes = ((numberOfBytes - 1) & 0xFFFE) + 1; } @@ -113,7 +114,7 @@ UnicodeUncompress(BYTE* compressed, int numberOfBytes, unicode_t* unicode) { if (compID == 16) { - // Move the first byte to the high bits of the unicode char. + // Move the first byte to the high bits of the Unicode character. unicode[unicodeIndex] = compressed[byteIndex++] << 8; } else @@ -122,7 +123,7 @@ UnicodeUncompress(BYTE* compressed, int numberOfBytes, unicode_t* unicode) } if (byteIndex < numberOfBytes) { - // Then the next byte to the low bits. + // Then put the next byte into the low bits. unicode[unicodeIndex] |= compressed[byteIndex++]; } unicodeIndex++; @@ -145,7 +146,7 @@ void DecodeOSTACompressed(BYTE* id, int len, char* result) return; } uncompressed[ucompChars] = 0; - int length = MIN(ucompChars, UnicodeLength(uncompressed)) + 1 /*terminating zero*/; + int length = MIN(ucompChars, UnicodeLength(uncompressed)) + 1 /*null terminator*/; char final[1024]; @@ -390,10 +391,10 @@ void CUDF::ReadDescriptorTag(BYTE sector[], CDescriptorTag* tag) // // in: -// data +// data, partition // // out: -// ad, partition +// ad int CUDF::ShortAD(Uint8* data, CUDF::CAD* ad, WORD partNumber) { ad->Length = GET_DWORD(data, 0); @@ -512,7 +513,7 @@ int CUDF::ReadFileEntry(Uint8* data, bool bEFE, Uint16 part, CICBTag* icbTag, CU ad->Length = l_ad; ad->Location = 0; // To be determined by the caller ad->Partition = part; - return -1; // -1 tells the caller the data is inlined, but Location is not set + return -1; // -1 tells the caller that Location is not set yet } } else @@ -521,11 +522,11 @@ int CUDF::ReadFileEntry(Uint8* data, bool bEFE, Uint16 part, CICBTag* icbTag, CU break; } } - cnt -= maxAds; // # of used ad entries + cnt -= maxAds; // Number of used AD entries if (maxAds > 0) { // Terminate the sequence - // And also init ad for an empty file (i.e. there isn't a AD, L_AD == 0 ) + // Also initialize ad for an empty file (i.e. there is no AD, L_AD == 0) ad->Length = 0; ad->Flags = 0; ad->Location = 0; // what should we put here? @@ -678,7 +679,7 @@ BOOL CUDF::Open(BOOL quiet) if (block > lastBlock) { - // Just to make sure we don't read in a too big file, stop after 128 sectors. + // Just to make sure we do not read too large a file, stop after 128 sectors. ret = FALSE; break; } @@ -909,7 +910,7 @@ int CUDF::ScanDir(CUDF::CAD dirICB, char* path, Uint8 fileChar; unsigned int p; - // Scan dir for ICB of file + // Scan the directory for the file ICB lbNum = LogSector(dirICB.Location, dirICB.Partition); if (!ReadBlockPhys(lbNum, 2, directory)) { @@ -985,10 +986,10 @@ int CUDF::UnpackFile(CSalamanderForOperationsAbstract* salamander, const char* s { CALL_STACK_MESSAGE7("CUDF::UnpackFile( , %s, %s, %s, %p, %u, %d)", srcPath, path, nameInArc, fileData, silent, toSkip); - // TODO: extraction according to allocation strategy 4096 - // if the file is a sequence of allocation descriptors, we cannot extract it because we would need to track - // where the allocation descriptors point and use the correct blocks (we have no image to test on, - // so it is not implemented, maybe someday) + // TODO: extraction for allocation strategy 4096 + // If the file is a sequence of allocation descriptors, we cannot extract it because we would need to track + // where the allocation descriptors point and use the correct blocks (we do not have an image to test this on, + // so this is not implemented yet). if (fileData == NULL) return UNPACK_ERROR; @@ -1032,7 +1033,7 @@ int CUDF::UnpackFile(CSalamanderForOperationsAbstract* salamander, const char* s CICBTag icbTag; CAD icbs[32]; // Each ICB can describe at most 1GB-1B - // -> 9 ICB's should be enough for a DVD9, but we are paranoic + // 9 ICBs should be enough for a DVD9, but be conservative int nicbs = ReadFileEntry(fileEntry, UDF_TAGID_EXTFENTRY == tag.ID, fp->Partition, &icbTag, icbs, sizeof(icbs) / sizeof(CAD)); @@ -1040,7 +1041,7 @@ int CUDF::UnpackFile(CSalamanderForOperationsAbstract* salamander, const char* s delete[] fileEntry; fileEntry = NULL; - // Verify that the icbs describe as many bytes as needed by the file + // Verify that the ICBs describe as many bytes as the file requires ULONGLONG acc = 0; if (-1 == nicbs) { @@ -1117,7 +1118,7 @@ int CUDF::UnpackFile(CSalamanderForOperationsAbstract* salamander, const char* s BYTE track = Image->GetTrackFromExtent(picb->Location); DWORD extentOfs = Image->GetTrack(track)->ExtentOffset; - // it is necessary to open the track we will read from (setting the track parameters) + // open the track to read from (sets the track parameters) if (!Image->OpenTrack(track)) { Error(IDS_CANT_OPEN_TRACK, silent == 1, track); @@ -1166,21 +1167,21 @@ int CUDF::UnpackFile(CSalamanderForOperationsAbstract* salamander, const char* s break; } - if (!salamander->ProgressAddSize(nbytes, TRUE)) // delayedPaint==TRUE, to make things faster + if (!salamander->ProgressAddSize(nbytes, TRUE)) // delayedPaint == TRUE to make this faster { salamander->ProgressDialogAddText(LoadStr(IDS_CANCELING_OPERATION), FALSE); salamander->ProgressEnableCancel(FALSE); ret = UNPACK_CANCEL; bFileComplete = FALSE; - break; // action interrupted + break; // operation interrupted } ULONG written; // picb->Offset is nonzero only for small (less than a sector) files inlined within File Entry if (!file.Write(sector + picb->Offset, nbytes, &written, name, NULL)) { - // Error message was already displayed by SafeWriteFile() + // The error message was already displayed. ret = UNPACK_CANCEL; bFileComplete = FALSE; break; @@ -1203,7 +1204,7 @@ int CUDF::UnpackFile(CSalamanderForOperationsAbstract* salamander, const char* s if (!bFileComplete) { // because it was created with the read-only attribute, we must clear - // the R attribute so the file can be deleted + // the read-only attribute so the file can be deleted attrs &= ~FILE_ATTRIBUTE_READONLY; if (!SetFileAttributes(name, attrs)) Error(LoadStr(IDS_CANT_SET_ATTRS), GetLastError(), silent == 1); From bdcf22fe34ce91b30c24178fac0260d823bbde3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:23:39 +0200 Subject: [PATCH 510/710] [translation] Fix src/plugins/uniso/udfiso.cpp comments Refines translated comments in src/plugins/uniso/udfiso.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #787 for src/plugins/uniso/udfiso.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/uniso/udfiso.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/plugins/uniso/udfiso.cpp b/src/plugins/uniso/udfiso.cpp index 704f07aba..d9f45b10f 100644 --- a/src/plugins/uniso/udfiso.cpp +++ b/src/plugins/uniso/udfiso.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" #include "dbg.h" @@ -70,7 +71,7 @@ BOOL CUDFISO::Open(BOOL quiet) return FALSE; } - // Scan HFS part but silently ignore any problem + // Scan the HFS part, but silently ignore any problems if (hfs->Open((udf || iso) ? TRUE : quiet)) HFS = hfs; else @@ -103,8 +104,8 @@ BOOL CUDFISO::ListDirectory(char* path, int session, CSalamanderDirectoryAbstrac strcat(path, partPath); - // avoid creating virtual session folder - // (we have created ISO virtual folder (for partition) and therefore virtual session folder is not needed) + // Avoid creating a virtual session folder + // (the ISO virtual folder for the partition has already been created, so a virtual session folder is not needed) if (ISO->BootRecordInfo != NULL && session == -1) session = 1; ISO->ListDirectory(path, session, dir, pluginData); @@ -124,7 +125,7 @@ BOOL CUDFISO::ListDirectory(char* path, int session, CSalamanderDirectoryAbstrac if (UDF->LVD.LogicalVolumeIdentifier[3] == 0 && UDF->LVD.LogicalVolumeIdentifier[5] == 0) { - // seems to be 16bit char + // seems to be 16-bit chars WideCharToMultiByte(CP_ACP, 0, (WCHAR*)(UDF->LVD.LogicalVolumeIdentifier + 2), 64, volId, sizeof(volId) - 1, 0, 0); volId[sizeof(volId) - 1] = 0; } From cc9e5e72aa516e97798fd7e1085908dd170b32f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:24:00 +0200 Subject: [PATCH 511/710] [translation] Fix src/plugins/uniso/uniso.cpp comments Refines translated comments in src/plugins/uniso/uniso.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #788 for src/plugins/uniso/uniso.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/uniso/uniso.cpp | 69 +++++++++++++++++++------------------ 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/src/plugins/uniso/uniso.cpp b/src/plugins/uniso/uniso.cpp index 6347c40c5..b48228a44 100644 --- a/src/plugins/uniso/uniso.cpp +++ b/src/plugins/uniso/uniso.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" #include "dbg.h" @@ -79,7 +80,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) break; } } - return TRUE; // DLL can be loaded + return TRUE; // Allow the DLL to load } char* LoadStr(int resID) @@ -102,7 +103,7 @@ CPluginInterfaceAbstract* WINAPI SalamanderPluginEntry(CSalamanderPluginEntryAbs CALL_STACK_MESSAGE1("SalamanderPluginEntry()"); - // this plugin is built for the current version of Salamander and newer - perform a check + // this plugin requires the current Salamander version or newer; check the version if (SalamanderVersion < LAST_VERSION_OF_SALAMANDER) { // we reject older versions MessageBox(salamander->GetParentWindow(), @@ -193,7 +194,7 @@ BOOL Error(int resID, BOOL quiet, ...) BOOL Error(char* msg, DWORD err, BOOL quiet) { if (!quiet) - if (err != ERROR_FILE_NOT_FOUND && err != ERROR_NO_MORE_FILES) // it is an error + if (err != ERROR_FILE_NOT_FOUND && err != ERROR_NO_MORE_FILES) // actual error { char buf[1024]; sprintf(buf, "%s\n\n%s", msg, SalamanderGeneral->GetErrorText(err)); @@ -298,33 +299,33 @@ void CPluginInterface::Connect(HWND parent, CSalamanderConnectAbstract* salamand { CALL_STACK_MESSAGE1("CPluginInterface::Connect(,)"); - /* GENERAL RULES FOR IMPLEMENTING CONNECT (for more complex plugins with a configuration version - the - ConfigVersion variable and the CURRENT_CONFIG_VERSION constant): - - with each change you need to increase the CURRENT_CONFIG_VERSION number - (in the first version CURRENT_CONFIG_VERSION = 1, not 0, so an upgrade can be distinguished from - an installation) - - in the base part (before the "if (ConfigVersion < YYY)" conditions): - - write the code for the first installation of the plugin (the state where the plugin does not yet have a record - in Salamander) - - for AddCustomPacker and AddCustomUnpacker calls provide the condition "ConfigVersion < XXX" in the 'update' - parameter, where XXX is the number of the last version in which the extensions for custom packers or - unpackers changed (XXX for packers may differ from unpackers) - - AddMenuItem, SetChangeDriveMenuItem, and SetThumbnailLoader work the same every time the plugin is loaded - (installation/upgrades make no difference - we always start on a clean slate) - - in the upgrade section (after the base part): - - add a condition "if (ConfigVersion < XXX)", where XXX is the new value of the - CURRENT_CONFIG_VERSION constant + add a comment from that version; - in the body of that condition call: - - if extensions were added for the "panel archiver", call - "AddPanelArchiver(PPP, EEE, TRUE)", where PPP are only the new extensions separated - by a semicolon and EEE is TRUE/FALSE ("panel view+edit"/"panel view only") - - if extensions were added for the "viewer", call "AddViewer(PPP, TRUE)", - where PPP are only the new extensions separated by a semicolon - - if some old extensions for the "viewer" need to be removed, call - "ForceRemoveViewer(PPP)" for each such extension PPP - - if extensions for the "panel archiver" need to be removed, let Petr know; nobody has - needed it yet, so it is not implemented - */ + /* GENERAL RULES FOR IMPLEMENTING Connect (for more complex plugins with a configuration version: the + ConfigVersion variable and the CURRENT_CONFIG_VERSION constant): + - with each change, increase the CURRENT_CONFIG_VERSION number + (in the first version, CURRENT_CONFIG_VERSION = 1, not 0, so an upgrade can be distinguished + from an installation) + - in the base part (before the "if (ConfigVersion < YYY)" conditions): + - write the code for the initial plugin installation (the state when the plugin does not yet + have a record in Salamander) + - for AddCustomPacker and AddCustomUnpacker, pass the condition "ConfigVersion < XXX" in the + 'update' parameter, where XXX is the number of the last version in which the extensions for + custom packers or unpackers changed (XXX for packers may differ from XXX for unpackers) + - AddMenuItem, SetChangeDriveMenuItem, and SetThumbnailLoader work the same on every plugin + load (installation and upgrades do not differ; they always start from a clean state) + - in the upgrade section (after the base part): + - add the condition "if (ConfigVersion < XXX)", where XXX is the new value of the + CURRENT_CONFIG_VERSION constant, and add a comment for that version; + in the body of that condition, call: + - if extensions were added for the "panel archiver", call + "AddPanelArchiver(PPP, EEE, TRUE)", where PPP are only the new extensions separated by + semicolons and EEE is TRUE/FALSE ("panel view+edit"/"panel view only") + - if extensions were added for the "viewer", call "AddViewer(PPP, TRUE)", where PPP are + only the new extensions separated by semicolons + - if some old extensions for the "viewer" need to be removed, call + "ForceRemoveViewer(PPP)" for each such extension PPP + - if some extensions for the "panel archiver" need to be removed, let Petr know; + nobody has needed this yet, so it is not implemented + */ // Davide, when you add more extensions you need to increase CURRENT_CONFIG_VERSION, see ^^^ @@ -359,7 +360,7 @@ void CPluginInterface::Connect(HWND parent, CSalamanderConnectAbstract* salamand salamander->AddPanelArchiver("c2d", FALSE, TRUE); } - if (ConfigVersion < 4) // addition of MDF/MDS + if (ConfigVersion < 4) // addition of MDF { salamander->AddViewer("*.mdf", TRUE); salamander->AddPanelArchiver("mdf", FALSE, TRUE); @@ -508,7 +509,7 @@ BOOL CPluginInterfaceForArchiver::UnpackArchive(CSalamanderForOperationsAbstract // unpack BOOL delTempDir = TRUE; - if (errorOccured != SALENUM_CANCEL && // test to see whether an error occurred and the user did not request to cancel the operation (Cancel button) + if (errorOccured != SALENUM_CANCEL && // test whether no error occurred and the user did not request to cancel the operation (Cancel button) SalamanderGeneral->TestFreeSpace(SalamanderGeneral->GetMsgBoxParent(), targetDir, totalSize, LoadStr(IDS_UNPACKING_ARCHIVE))) { @@ -782,8 +783,8 @@ BOOL CPluginInterfaceForViewer::ViewFile(const char* name, int left, int top, in name, left, top, width, height, showCmd, alwaysOnTop, returnLock, enumFilesSourceUID, enumFilesCurrentIndex); - // we do not set 'lock' or 'lockOwner'; we only need the validity of the file 'name' - // within this method + // We do not set 'lock' or 'lockOwner'; we only need 'name' to remain valid + // within this method. HCURSOR hOldCur = SetCursor(LoadCursor(NULL, IDC_WAIT)); From dd8f982840c6d02a43c0fe0a9b234c2a83632890 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:24:20 +0200 Subject: [PATCH 512/710] [translation] Fix src/plugins/uniso/uniso.h comments Refines translated comments in src/plugins/uniso/uniso.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #789 for src/plugins/uniso/uniso.h, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/uniso/uniso.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/uniso/uniso.h b/src/plugins/uniso/uniso.h index b5a8bb349..56e6a4b0d 100644 --- a/src/plugins/uniso/uniso.h +++ b/src/plugins/uniso/uniso.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once @@ -142,7 +143,7 @@ class CPluginDataInterface : public CPluginDataInterfaceAbstract extern HINSTANCE DLLInstance; // handle to the SPL - language-independent resources extern HINSTANCE HLanguage; // handle to the SLG - language-dependent resources -//extern DWORD Options;// configuration +//extern COptions Options; // configuration struct COptions { BOOL ClearReadOnly; // Clear read-only attribute when copying from archive From e10e4a081773836bc474321cbb51998d13fb9ccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:27:19 +0200 Subject: [PATCH 513/710] [translation] Fix src/plugins/uniso/viewer.cpp comments Refines translated comments in src/plugins/uniso/viewer.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #790 for src/plugins/uniso/viewer.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/uniso/viewer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/uniso/viewer.cpp b/src/plugins/uniso/viewer.cpp index 8ddeca7f5..472645c74 100644 --- a/src/plugins/uniso/viewer.cpp +++ b/src/plugins/uniso/viewer.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" #include "dbg.h" @@ -144,7 +145,7 @@ BOOL CISOImage::DumpInfo(FILE* outStream) { CALL_STACK_MESSAGE1("CISOImage::DumpInfo( )"); - // display information about sessions + // display session information fprintf(outStream, LoadStr(*GetLabel() ? IDS_INFO_LABEL_LABEL : IDS_INFO_LABEL), GetLabel()); fprintf(outStream, LoadStr(IDS_INFO_CNT_SESSIONS), Session.Count); From 1b7ed8dd04b94266dc1667538b7f45170cd41995 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:27:40 +0200 Subject: [PATCH 514/710] [translation] Fix src/plugins/uniso/xdvdfs.cpp comments Refines translated comments in src/plugins/uniso/xdvdfs.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #791 for src/plugins/uniso/xdvdfs.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/uniso/xdvdfs.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/plugins/uniso/xdvdfs.cpp b/src/plugins/uniso/xdvdfs.cpp index 5e862cf75..4223711be 100644 --- a/src/plugins/uniso/xdvdfs.cpp +++ b/src/plugins/uniso/xdvdfs.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" #include "dbg.h" @@ -186,12 +187,12 @@ int CXDVDFS::ScanDir(DWORD sector, DWORD size, char* path, CSalamanderDirectoryA return ERR_TERMINATE; } - // read root + // read directory data if (Image->ReadBlock(sector, size, data) != size) { delete[] data; Error(IDS_ERROR_LISTING_IMAGE, FALSE, sector); - // if reading the sector with the root fails + // if reading the root sector fails return (sector == VD.RootSector) ? ERR_CONTINUE : ERR_TERMINATE; } @@ -238,7 +239,7 @@ int CXDVDFS::ScanDir(DWORD sector, DWORD size, char* path, CSalamanderDirectoryA strcat(path, "\\"); strcat(path, fileName); - // descend only when everything is OK + // recurse only if everything is OK if (ret == ERR_OK) { ret = ScanDir(de.StartSector, de.FileSize, path, dir, pluginData); @@ -250,7 +251,7 @@ int CXDVDFS::ScanDir(DWORD sector, DWORD size, char* path, CSalamanderDirectoryA } offset += 0x000E + len; - // align the offset to a DWORD + // align the offset to a DWORD boundary offset = ((offset + 3) / 4) * 4; } @@ -358,14 +359,14 @@ int CXDVDFS::UnpackFile(CSalamanderForOperationsAbstract* salamander, const char break; } - if (!salamander->ProgressAddSize(nbytes, TRUE)) // delayedPaint==TRUE, so we do not slow things down + if (!salamander->ProgressAddSize(nbytes, TRUE)) // delayedPaint==TRUE, so we do not slow the operation down { salamander->ProgressDialogAddText(LoadStr(IDS_CANCELING_OPERATION), FALSE); salamander->ProgressEnableCancel(FALSE); ret = UNPACK_CANCEL; bFileComplete = FALSE; - break; // action interrupted + break; // operation interrupted } ULONG written; From 8fd65ebeedcbb44b410150c2d6d17d105f52f153 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:28:02 +0200 Subject: [PATCH 515/710] [translation] Fix src/plugins/unlha/unlha.cpp comments Refines translated comments in src/plugins/unlha/unlha.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #793 for src/plugins/unlha/unlha.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/unlha/unlha.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/plugins/unlha/unlha.cpp b/src/plugins/unlha/unlha.cpp index accb34bd7..6fe18d64b 100644 --- a/src/plugins/unlha/unlha.cpp +++ b/src/plugins/unlha/unlha.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -29,7 +30,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { if (fdwReason == DLL_PROCESS_ATTACH) DLLInstance = hinstDLL; - return TRUE; // DLL can be loaded + return TRUE; // Allow the DLL to load } char* LoadStr(int resID) @@ -58,12 +59,12 @@ CPluginInterfaceAbstract* WINAPI SalamanderPluginEntry(CSalamanderPluginEntryAbs { // reject older versions MessageBox(salamander->GetParentWindow(), REQUIRE_LAST_VERSION_OF_SALAMANDER, - "UnLHA" /* neprekladat! */, MB_OK | MB_ICONERROR); + "UnLHA" /* do not translate */, MB_OK | MB_ICONERROR); return NULL; } // load the language module (.slg) - HLanguage = salamander->LoadLanguageModule(salamander->GetParentWindow(), "UnLHA" /* neprekladat! */); + HLanguage = salamander->LoadLanguageModule(salamander->GetParentWindow(), "UnLHA" /* DO NOT TRANSLATE */); if (HLanguage == NULL) return NULL; @@ -163,7 +164,7 @@ BOOL CPluginInterfaceForArchiver::ListArchive(CSalamanderForOperationsAbstract* while ((gh = LHAGetHeader(f, &hdr)) == GH_SUCCESS) { - // if it ends with '\', remove it (because of directories) + // if it ends with '\\', remove it (for directories) int l = lstrlen(hdr.name) - 1; if (hdr.name[l] == '\\') { @@ -252,7 +253,7 @@ BOOL CPluginInterfaceForArchiver::ListArchive(CSalamanderForOperationsAbstract* ret = FALSE; } - // some files have already been listed, so do not pack and display them + // some files have already been listed, so do not discard them and display them if (!ret && count) ret = TRUE; @@ -301,8 +302,8 @@ BOOL CPluginInterfaceForArchiver::UnpackOneFile(CSalamanderForOperationsAbstract if (hdr.method == LHA_UNKNOWNMETHOD && hdr.original_size != 0 /* see below : */) { - // I do not know why, but LHA sometimes packs zero-length files with a nonsensical method name... - // If the file length is 0, I therefore ignore the method type. + // For unknown reasons, LHA sometimes packs zero-length files with a nonsensical method name... + // If the file length is 0, the method type is therefore ignored. SalamanderGeneral->ShowMessageBox(LoadStr(IDS_METHOD), LoadStr(IDS_PLUGINNAME), MSGBOX_ERROR); fclose(f); return FALSE; @@ -340,7 +341,7 @@ BOOL CPluginInterfaceForArchiver::UnpackOneFile(CSalamanderForOperationsAbstract if (!uf) { - if (iLHAErrorStrId != IDS_WRITEERROR) // because of SafeWriteFile + if (iLHAErrorStrId != IDS_WRITEERROR) // SafeWriteFile handles write errors SalamanderGeneral->ShowMessageBox(LoadStr(iLHAErrorStrId), LoadStr(IDS_PLUGINNAME), MSGBOX_ERROR); return FALSE; } @@ -601,7 +602,7 @@ void CPluginInterfaceForArchiver::UnpackInnerBody(FILE* f, const char* targetDir { if (!uf) { - if (iLHAErrorStrId != IDS_WRITEERROR) // because of SafeWriteFile + if (iLHAErrorStrId != IDS_WRITEERROR) // SafeWriteFile handles write errors SalamanderGeneral->ShowMessageBox(LoadStr(iLHAErrorStrId), LoadStr(IDS_PLUGINNAME), MSGBOX_ERROR); Abort = TRUE; Ret = FALSE; From 978bac01f35941ea2f84951328a55f840252e81e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:31:06 +0200 Subject: [PATCH 516/710] [translation] Fix src/plugins/unmime/decoder.cpp comments Refines translated comments in src/plugins/unmime/decoder.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #794 for src/plugins/unmime/decoder.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/unmime/decoder.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/unmime/decoder.cpp b/src/plugins/unmime/decoder.cpp index 29d0ddde2..b2115e190 100644 --- a/src/plugins/unmime/decoder.cpp +++ b/src/plugins/unmime/decoder.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED /****************************************************************************************\ ** ** @@ -446,7 +447,7 @@ BOOL CBinHexDecoder::DecodeChar(char c) default: return TRUE; } - // execution jumps here once the breaks above reach the end; a bit of a hack, sorry... + // Control jumps here when the breaks above are hit; a bit of a hack. bFinished = TRUE; eCharState = CS_END; return TRUE; @@ -535,7 +536,7 @@ void CBinHexDecoder::DecodeBinary(BYTE b) { if (!bCalcSize && iResourceLength) { - // We are gonna loose the resource fork + // The resource fork will be lost if (!(G.nDontShowAnymore & DSA_RESOURCE_FORK_LOST)) { BOOL checked = FALSE; From 82bd60b50284b2c4d60c4f512ffe81256764cb4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:31:28 +0200 Subject: [PATCH 517/710] [translation] Fix src/plugins/unmime/unmime.cpp comments Refines translated comments in src/plugins/unmime/unmime.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #796 for src/plugins/unmime/unmime.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/unmime/unmime.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/plugins/unmime/unmime.cpp b/src/plugins/unmime/unmime.cpp index 9af703e16..ccd604637 100644 --- a/src/plugins/unmime/unmime.cpp +++ b/src/plugins/unmime/unmime.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -40,10 +41,10 @@ LPCTSTR KEY_APPENDCHARSET = _T("Append Charset"); LPCTSTR KEY_LISTATTACHMENTS = _T("List Attachments"); LPCTSTR KEY_DONTSHOWANYMORE = _T("DontShowAnymore"); -// ConfigVersion: 0 - default (before any configuration is loaded), -// 1 - version with configuration in the registry (used before, only without a configuration number) +// ConfigVersion: 0 - default (without loading configuration), +// 1 - version with configuration in the registry (already used, but without a configuration number) // 2 - version after introducing the configuration number + yEnc -// 3 - Added support for CNM (Mercury + Pegasus Mail (PMail)) +// 3 - added support for CNM (Mercury + Pegasus Mail (PMail)) int ConfigVersion = 0; #define CURRENT_CONFIG_VERSION 3 @@ -55,7 +56,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { if (fdwReason == DLL_PROCESS_ATTACH) DLLInstance = hinstDLL; - return TRUE; // DLL can be loaded + return TRUE; // Allow the DLL to load } char* LoadStr(int resID) @@ -79,17 +80,17 @@ CPluginInterfaceAbstract* WINAPI SalamanderPluginEntry(CSalamanderPluginEntryAbs CALL_STACK_MESSAGE1("SalamanderPluginEntry()"); - // this plugin is built for the current version of Salamander and newer - perform a check + // this plugin is built for the current version of Salamander and later - check it if (salamander->GetVersion() < LAST_VERSION_OF_SALAMANDER) { // reject older versions MessageBox(salamander->GetParentWindow(), REQUIRE_LAST_VERSION_OF_SALAMANDER, - "UnMIME" /* neprekladat! */, MB_OK | MB_ICONERROR); + "UnMIME" /* DO NOT TRANSLATE */, MB_OK | MB_ICONERROR); return NULL; } // load the language module (.slg) - HLanguage = salamander->LoadLanguageModule(salamander->GetParentWindow(), "UnMIME" /* neprekladat! */); + HLanguage = salamander->LoadLanguageModule(salamander->GetParentWindow(), "UnMIME" /* do not translate */); if (HLanguage == NULL) return NULL; @@ -105,7 +106,7 @@ CPluginInterfaceAbstract* WINAPI SalamanderPluginEntry(CSalamanderPluginEntryAbs VERSINFO_VERSION_NO_PLATFORM, VERSINFO_COPYRIGHT, LoadStr(IDS_PLUGIN_DESCRIPTION), - "UnMIME" /* neprekladat! */, "eml;b64;uue;xxe;hqx;ntx;cnm"); + "UnMIME" /* DO NOT TRANSLATE */, "eml;b64;uue;xxe;hqx;ntx;cnm"); salamander->SetPluginHomePageURL("www.altap.cz"); @@ -213,11 +214,11 @@ void CPluginInterface::Connect(HWND parent, CSalamanderConnectAbstract* salamand salamander->AddPanelArchiver("eml;b64;uue;xxe;hqx;ntx;cnm", FALSE, FALSE); // upgrade section: - if (ConfigVersion < 2) // version after introducing the configuration number + yEnc + if (ConfigVersion < 2) // version after adding the configuration number + yEnc { salamander->AddPanelArchiver("ntx", FALSE, TRUE); // add the "ntx" extension } - if (ConfigVersion < 3) // cnm: file format used by Mercury & PMail emailing system + if (ConfigVersion < 3) // cnm: file format used by the Mercury & PMail email system { salamander->AddPanelArchiver("cnm", FALSE, TRUE); // add the "cnm" extension } @@ -254,7 +255,7 @@ BOOL CPluginInterfaceForArchiver::ListArchive(CSalamanderForOperationsAbstract* CALL_STACK_MESSAGE2("CPluginInterfaceForArchiver::ListArchive(, %s, ,)", fileName); pluginData = &PluginDataInterface; - // allocate ArchiveData - it will hold data about the contents of the "archive" + // Allocate ArchiveData; it will hold data about the contents of the "archive" CArchiveData* ArchiveData = new CArchiveData; ArchiveData->RefCount = 0; @@ -266,7 +267,7 @@ BOOL CPluginInterfaceForArchiver::ListArchive(CSalamanderForOperationsAbstract* CloseHandle(hFile); } - // analyze the file + // file analysis if (!ParseMailFile(fileName, &ArchiveData->ParserOutput, G.bAppendCharset)) { delete ArchiveData; From e08936fb251109ba2c7854f465899974d60f0247 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:31:50 +0200 Subject: [PATCH 518/710] [translation] Fix src/plugins/unole/unole2.cpp comments Refines translated comments in src/plugins/unole/unole2.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #797 for src/plugins/unole/unole2.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/unole/unole2.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/unole/unole2.cpp b/src/plugins/unole/unole2.cpp index 063e354b2..b892dacf0 100644 --- a/src/plugins/unole/unole2.cpp +++ b/src/plugins/unole/unole2.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -54,7 +55,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) break; } } - return TRUE; // DLL can be loaded + return TRUE; // Allow the DLL to load } char* LoadStr(int resID) @@ -269,7 +270,7 @@ BOOL ParseStorage(CSalamanderDirectoryAbstract* Dir, LPSTORAGE CF, LPMALLOC pIMa { LPSTORAGE pSubStorage; - // concatenate path + // append to path if (path != oldPath) { strcpy(oldPath, "\\"); From d2e179d58b34d3326b34b42d0ad1e40cbde76043 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:32:12 +0200 Subject: [PATCH 519/710] [translation] Fix src/plugins/unrar/unrar.cpp comments Refines translated comments in src/plugins/unrar/unrar.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #798 for src/plugins/unrar/unrar.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/unrar/unrar.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/plugins/unrar/unrar.cpp b/src/plugins/unrar/unrar.cpp index 064ecd582..0501fae0b 100644 --- a/src/plugins/unrar/unrar.cpp +++ b/src/plugins/unrar/unrar.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -61,7 +62,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) break; } } - return TRUE; // DLL can be loaded + return TRUE; // Allow the DLL to load } LPCTSTR LoadStr(int resID) @@ -83,17 +84,17 @@ CPluginInterfaceAbstract* WINAPI SalamanderPluginEntry(CSalamanderPluginEntryAbs CALL_STACK_MESSAGE1("SalamanderPluginEntry()"); - // this plugin is built for the current Salamander version and newer - perform a check + // this plugin is intended for the current Salamander version and later, so perform a check if (salamander->GetVersion() < LAST_VERSION_OF_SALAMANDER) { // reject older versions MessageBox(salamander->GetParentWindow(), REQUIRE_LAST_VERSION_OF_SALAMANDER, - "UnRAR" /* neprekladat! */, MB_OK | MB_ICONERROR); + "UnRAR" /* DO NOT TRANSLATE */, MB_OK | MB_ICONERROR); return NULL; } // load the language module (.slg) - HLanguage = salamander->LoadLanguageModule(salamander->GetParentWindow(), "UnRAR" /* neprekladat! */); + HLanguage = salamander->LoadLanguageModule(salamander->GetParentWindow(), "UnRAR" /* DO NOT TRANSLATE */); if (HLanguage == NULL) return NULL; @@ -111,7 +112,7 @@ CPluginInterfaceAbstract* WINAPI SalamanderPluginEntry(CSalamanderPluginEntryAbs VERSINFO_VERSION_NO_PLATFORM, VERSINFO_COPYRIGHT, LoadStr(IDS_PLUGIN_DESCRIPTION), - "UnRAR" /* neprekladat! */, "rar"); + "UnRAR" /* DO NOT TRANSLATE */, "rar"); salamander->SetPluginHomePageURL("www.altap.cz"); @@ -201,7 +202,7 @@ void CPluginInterface::LoadConfiguration(HWND parent, HKEY regKey, CSalamanderRe memset(&Config, 0, sizeof(Config)); Config.ListInfoPackedSize = TRUE; - if (regKey != NULL) // load z registry + if (regKey != NULL) // load from registry { registry->GetValue(regKey, CONFIG_OPTIONS, REG_DWORD, &Config.Options, sizeof(DWORD)); Config.Options &= OP_SAVED_IN_REGISTRY; @@ -367,7 +368,7 @@ BOOL CPluginInterfaceForArchiver::ListArchive(CSalamanderForOperationsAbstract* if (NotWholeArchListed && !(Config.Options & OP_NO_VOL_ATTENTION)) AttentionDialog(SalamanderGeneral->GetMainWindowHWND()); - // some files have already been listed, so do not pack and display them + // some files have already been listed, so do not discard them; display them if (!ret && count) ret = TRUE; @@ -1026,7 +1027,7 @@ BOOL CPluginInterfaceForArchiver::OpenArchive() // for RAR4 archives with encrypted file names we get here after the callback when an incorrect password is entered, // and because PasswordForOpenArchive == TRUE when calling RAROpenArchiveEx, SF_ALLENRYPT is set even after merely clicking OK in the password dialog, // which ensures we do not ask for the password again (instead an error message about the wrong password appears) - if ((oad.Flags & 0x0080) /* block headers encrypted */) + if ((oad.Flags & 0x0080) /* encrypted block headers */) { if (!(PluginData->Silent & SF_ALLENRYPT)) { @@ -1215,7 +1216,7 @@ int CPluginInterfaceForArchiver::ChangeVolProc(char* arcName, int mode) if (List) { NotWholeArchListed = TRUE; - return -1; // list only while it works without asking for additional volumes + return -1; // list only until asking for another volume is required } if (NextVolumeDialog(SalamanderGeneral->GetMsgBoxParent(), arcName) != IDOK) { @@ -1310,7 +1311,7 @@ int CPluginInterfaceForArchiver::ProcessDataProc(unsigned char* addr, int size) return -1; } Success = TRUE; - return 1; // sucess + return 1; // success } lstrcpy(buf, LoadStr(IDS_UNABLEWRITE)); FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, @@ -1516,7 +1517,7 @@ BOOL CPluginInterfaceForArchiver::MakeFilesList(TIndirectArray2 ProgressTotal += size; } } - return errorOccured != SALENUM_CANCEL && // test whether no error occurred and the user did not request to abort the operation (Cancel button) + return errorOccured != SALENUM_CANCEL && // check that no error occurred and the user did not cancel the operation (Cancel button) SalamanderGeneral->TestFreeSpace(SalamanderGeneral->GetMsgBoxParent(), targetDir, ProgressTotal, LoadStr(IDS_PLUGINNAME)); } @@ -1782,7 +1783,7 @@ LPTSTR PathFindExtension(LPTSTR pszPath) LPTSTR iterator = pszPath + len - 1; while (iterator >= pszPath) { - if (*iterator == '.') // ".cvspass" is considered an extension on Windows + if (*iterator == '.') // On Windows, ".cvspass" is treated as an extension. { return iterator; } @@ -1801,7 +1802,7 @@ LPTSTR PathFindExtension(LPTSTR pszPath) void CPluginDataInterface::ReleasePluginData(CFileData& file, BOOL isDir) { // file.PluginData is NULL for folders not having extra items in the archive - see GetFileDataForUpDir & GetFileDataForNewDir - delete (CRARFileData*)file.PluginData; // However, delete NULL is perfectly OK + delete (CRARFileData*)file.PluginData; // Deleting NULL is valid } // Callback called by Salamander to obtain custom column text - see spl_com.h / FColumnGetText From 7a124988aba41b332a1805ec6625d95d70cf7afa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:32:34 +0200 Subject: [PATCH 520/710] [translation] Fix src/plugins/wmobile/dialogs.cpp comments Refines translated comments in src/plugins/wmobile/dialogs.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #799 for src/plugins/wmobile/dialogs.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/wmobile/dialogs.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/plugins/wmobile/dialogs.cpp b/src/plugins/wmobile/dialogs.cpp index 1eb4de2a3..03bcd6c57 100644 --- a/src/plugins/wmobile/dialogs.cpp +++ b/src/plugins/wmobile/dialogs.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -28,7 +29,7 @@ CCommonDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) // horizontal and vertical centering of the dialog relative to the parent if (Parent != NULL) SalamanderGeneral->MultiMonCenterWindow(HWindow, Parent, TRUE); - break; // request focus from DefDlgProc + break; // let DefDlgProc set the focus } } return CDialog::DialogProc(uMsg, wParam, lParam); @@ -129,7 +130,7 @@ BOOL CProgressDlg::GetWantCancel() } MSG msg; - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) // give the user a moment ... + while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) // briefly process pending UI messages... { if (!IsWindow(HWindow) || !IsDialogMessage(HWindow, &msg)) { @@ -183,13 +184,13 @@ CProgressDlg::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (ProgressBar == NULL) { DestroyWindow(HWindow); // error -> do not open the dialog - return FALSE; // end of processing + return FALSE; // stop processing } ::SetWindowText(HWindow, Title); SetDlgItemText(HWindow, IDT_OPERATION, Operation); - break; // request focus from DefDlgProc + break; // let DefDlgProc set the focus } case WM_COMMAND: @@ -279,7 +280,7 @@ CProgress2Dlg::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) SetDlgItemText(HWindow, IDT_OPERATION2, Operation2); - break; // request focus from DefDlgProc + break; // let DefDlgProc set the focus } } return CProgressDlg::DialogProc(uMsg, wParam, lParam); @@ -372,11 +373,11 @@ void CChangeAttrDialog::Transfer(CTransferInfo& ti) DateTime_SetSystemtime(HModifiedDate, GDT_VALID, &TimeModified); DateTime_SetSystemtime(HCreatedDate, GDT_VALID, &TimeCreated); DateTime_SetSystemtime(HAccessedDate, GDT_VALID, &TimeAccessed); - // then set the state to disabled (cannot be done in a single operation) + // then disable it (cannot be done in a single operation) DateTime_SetSystemtime(HModifiedDate, GDT_NONE, &TimeModified); DateTime_SetSystemtime(HCreatedDate, GDT_NONE, &TimeCreated); DateTime_SetSystemtime(HAccessedDate, GDT_NONE, &TimeAccessed); - // populate the times + // populate the time fields DateTime_SetSystemtime(HModifiedTime, GDT_VALID, &TimeModified); DateTime_SetSystemtime(HCreatedTime, GDT_VALID, &TimeCreated); DateTime_SetSystemtime(HAccessedTime, GDT_VALID, &TimeAccessed); From 5ed236e43ead2b778e962882712831ac3c7ecbe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:32:56 +0200 Subject: [PATCH 521/710] [translation] Fix src/plugins/wmobile/dialogs.h comments Refines translated comments in src/plugins/wmobile/dialogs.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #800 for src/plugins/wmobile/dialogs.h, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/wmobile/dialogs.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/wmobile/dialogs.h b/src/plugins/wmobile/dialogs.h index 4d8d525b9..d77d2f426 100644 --- a/src/plugins/wmobile/dialogs.h +++ b/src/plugins/wmobile/dialogs.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once @@ -51,7 +52,7 @@ class CProgressDlg : public CCommonDialog void Set(const char* fileName, DWORD progressTotal, BOOL dalayedPaint); void SetProgress(DWORD progressTotal, DWORD progress, BOOL dalayedPaint); - // empties the message queue (call often enough) and allows repainting, pressing Cancel... + // processes the message queue (call often enough) and allows repainting, pressing Cancel, ... // returns TRUE if the user wants to interrupt the operation BOOL GetWantCancel(); From c94d98b65658fd3125a0677bd36e6533491bbbc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:33:18 +0200 Subject: [PATCH 522/710] [translation] Fix src/plugins/wmobile/fs1.cpp comments Refines translated comments in src/plugins/wmobile/fs1.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #801 for src/plugins/wmobile/fs1.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/wmobile/fs1.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/plugins/wmobile/fs1.cpp b/src/plugins/wmobile/fs1.cpp index 40a872ef1..292e0ba61 100644 --- a/src/plugins/wmobile/fs1.cpp +++ b/src/plugins/wmobile/fs1.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -97,15 +98,15 @@ CPluginInterfaceForFS::ExecuteOnFS(int panel, CPluginFSInterfaceAbstract* plugin char newPath[MAX_PATH]; strcpy(newPath, fs->Path); - if (isDir == 2) // up-dir + if (isDir == 2) // parent directory { char* cutDir = NULL; - if (SalamanderGeneral->CutDirectory(newPath, &cutDir)) // shorten the path by the last component + if (SalamanderGeneral->CutDirectory(newPath, &cutDir)) // remove the last component from the path { int topIndex; // next top index, -1 -> invalid if (!fs->TopIndexMem.FindAndPop(newPath, topIndex)) topIndex = -1; - // change the path in the panel + // change the panel path SalamanderGeneral->ChangePanelPathToPluginFS(panel, pluginFSName, newPath, NULL, topIndex, cutDir); } @@ -119,9 +120,9 @@ CPluginInterfaceForFS::ExecuteOnFS(int panel, CPluginFSInterfaceAbstract* plugin if (CRAPI::PathAppend(newPath, file.Name, MAX_PATH)) { - // change the path in the panel + // change the panel path if (SalamanderGeneral->ChangePanelPathToPluginFS(panel, pluginFSName, newPath)) - fs->TopIndexMem.Push(backupPath, topIndex); // remember the top index for the return + fs->TopIndexMem.Push(backupPath, topIndex); // remember the top index for returning } } } @@ -226,7 +227,7 @@ void CTopIndexMem::Push(const char* path, int topIndex) if (ok) // matches -> remember the next top index { - if (TopIndexesCount == TOP_INDEX_MEM_SIZE) // need to discard the first top index from memory + if (TopIndexesCount == TOP_INDEX_MEM_SIZE) // need to discard the oldest top index { int i; for (i = 0; i < TOP_INDEX_MEM_SIZE - 1; i++) @@ -236,7 +237,7 @@ void CTopIndexMem::Push(const char* path, int topIndex) strcpy(Path, path); TopIndexes[TopIndexesCount++] = topIndex; } - else // does not match -> first top index in the sequence + else // path does not match -> first top index in the sequence { strcpy(Path, path); TopIndexesCount = 1; From ebb0b7836622e8915630a2de31cd883d878ec601 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:33:40 +0200 Subject: [PATCH 523/710] [translation] Fix src/plugins/wmobile/fs2.cpp comments Refines translated comments in src/plugins/wmobile/fs2.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #802 for src/plugins/wmobile/fs2.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/wmobile/fs2.cpp | 155 ++++++++++++++++++------------------ 1 file changed, 78 insertions(+), 77 deletions(-) diff --git a/src/plugins/wmobile/fs2.cpp b/src/plugins/wmobile/fs2.cpp index 4b1b311f5..c7833144d 100644 --- a/src/plugins/wmobile/fs2.cpp +++ b/src/plugins/wmobile/fs2.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -45,7 +46,7 @@ CPluginFSInterface::GetFullName(CFileData& file, int isDir, char* buf, int bufSi { lstrcpyn(buf, Path, bufSize); // if the path does not fit, the name certainly will not either (an error will be reported) if (isDir == 2) - return SalamanderGeneral->CutDirectory(buf, NULL); // up-dir + return SalamanderGeneral->CutDirectory(buf, NULL); // parent directory else return CRAPI::PathAppend(buf, file.Name, bufSize); } @@ -62,7 +63,7 @@ CPluginFSInterface::GetFullFSPath(HWND parent, const char* fsName, char* path, i strcpy(root, Path); // paths such as "path" inherit the current FS path success = CRAPI::PathAppend(root, path, MAX_PATH); - if (success && (int)strlen(root) < 1) // shorter than the root is impossible (it would become a relative path again) + if (success && (int)strlen(root) < 1) // shorter than the root is not possible (it would be a relative path again) { success = SalamanderGeneral->SalPathAddBackslash(root, MAX_PATH); } @@ -107,7 +108,7 @@ CPluginFSInterface::ChangePath(int currentFSNameIndex, char* fsName, int fsNameI if (FatalError) { FatalError = FALSE; - return FALSE; // ListCurrentPath failed due to memory, fatal error + return FALSE; // ListCurrentPath failed due to insufficient memory; fatal error } if (forceRefresh) @@ -126,7 +127,7 @@ CPluginFSInterface::ChangePath(int currentFSNameIndex, char* fsName, int fsNameI { // try to trim the path PathError = FALSE; if (!SalamanderGeneral->CutDirectory(path, NULL)) - return FALSE; // nowhere to shorten, fatal error + return FALSE; // cannot shorten the path any further, fatal error fileNameAlreadyCut = TRUE; if (pathWasCut != NULL) *pathWasCut = TRUE; @@ -134,9 +135,9 @@ CPluginFSInterface::ChangePath(int currentFSNameIndex, char* fsName, int fsNameI while (1) { DWORD attr = CRAPI::GetFileAttributes(path, TRUE); - if (attr != 0xFFFFFFFF && (attr & FILE_ATTRIBUTE_DIRECTORY) != 0) // success, use the path as current + if (attr != 0xFFFFFFFF && (attr & FILE_ATTRIBUTE_DIRECTORY) != 0) // success, use the path as the current path { - if (errBuf[0] != 0) // if we have a message, print it here (it arose during trimming) + if (errBuf[0] != 0) // if we have a message, display it here (it was generated while shortening the path) { sprintf(buf, LoadStr(IDS_PATH_ERROR), userPart, errBuf); SalamanderGeneral->ShowMessageBox(buf, TitleWMobileError, MSGBOX_ERROR); @@ -144,7 +145,7 @@ CPluginFSInterface::ChangePath(int currentFSNameIndex, char* fsName, int fsNameI strcpy(Path, path); return TRUE; } - else // failure, try to shorten the path + else // failure, try shortening the path { err = CRAPI::GetLastError(); @@ -158,8 +159,8 @@ CPluginFSInterface::ChangePath(int currentFSNameIndex, char* fsName, int fsNameI else SalamanderGeneral->GetErrorText(err, errBuf, MAX_PATH); - // if opening the FS is time-consuming and we want to adjust Change Directory (Shift+F7) - // to behave like archives, comment out the following line with "break" for mode 3 + // if opening the FS is time-consuming and we want Change Directory (Shift+F7) + // to behave like it does for archives, just comment out the following line with "break" for mode 3 //JR try trimming only if RAPI reports that the path does not exist if (mode == 3 || err != ERROR_FILE_NOT_FOUND) @@ -167,7 +168,7 @@ CPluginFSInterface::ChangePath(int currentFSNameIndex, char* fsName, int fsNameI } char* cut; - if (!SalamanderGeneral->CutDirectory(path, &cut)) // nowhere to shorten, fatal error + if (!SalamanderGeneral->CutDirectory(path, &cut)) // cannot shorten it any further, fatal error { SalamanderGeneral->GetErrorText(err, errBuf, MAX_PATH); break; @@ -179,7 +180,7 @@ CPluginFSInterface::ChangePath(int currentFSNameIndex, char* fsName, int fsNameI if (!fileNameAlreadyCut) // it can be a file name only during the first trim { fileNameAlreadyCut = TRUE; - if (cutFileName != NULL && attr != 0xFFFFFFFF) // it is a file + if (cutFileName != NULL && attr != 0xFFFFFFFF) // file lstrcpyn(cutFileName, cut, MAX_PATH); } else @@ -514,7 +515,7 @@ CPluginFSInterface::QuickRename(const char* fsName, int mode, HWND parent, CFile { cancel = FALSE; if (mode == 1) - return FALSE; // request for the standard dialog + return FALSE; // request the standard dialog // Verify the provided name syntactically char* s = newName; @@ -543,7 +544,7 @@ CPluginFSInterface::QuickRename(const char* fsName, int mode, HWND parent, CFile { SalamanderGeneral->SalMessageBox(parent, LoadStr(IDS_ERR_NAMETOOLONG), TitleWMobileError, MB_OK | MB_ICONEXCLAMATION); - // 'newName' is already returned after the mask adjustment + // 'newName' is already returned after masking return FALSE; // error -> show the standard dialog again } @@ -555,7 +556,7 @@ CPluginFSInterface::QuickRename(const char* fsName, int mode, HWND parent, CFile DWORD err = CRAPI::GetLastError(); SalamanderGeneral->SalMessageBox(parent, SalamanderGeneral->GetErrorText(err), TitleWMobileError, MB_OK | MB_ICONEXCLAMATION); - // 'newName' is already returned after the mask adjustment + // 'newName' is already returned after masking return FALSE; // error -> show the standard dialog again } else // operation succeeded - report the change on the path (triggers refresh) and return success @@ -584,9 +585,9 @@ void WINAPI CPluginFSInterface::AcceptChangeOnPathNotification(const char* fsName, const char* path, BOOL includingSubdirs) { - // test whether the paths or at least their prefixes match (only paths on our FS have a chance; - // disk paths and other FS paths in 'path' are excluded automatically because they can never - // match 'fsName'+':' at the start of 'path2' below) + // test whether the paths or at least their prefixes match (only paths + // on our FS can match; disk paths and paths on other file systems in 'path' + // are excluded automatically because they can never match 'fsName'+':' at the start of 'path2' below) char path1[2 * MAX_PATH]; char path2[2 * MAX_PATH]; lstrcpyn(path1, path, 2 * MAX_PATH); @@ -661,7 +662,7 @@ CPluginFSInterface::CreateDir(const char* fsName, int mode, HWND parent, char* n { SalamanderGeneral->SalMessageBox(parent, LoadStr(IDS_SORRY_CREATEDIR1), TitleWMobile, MB_OK | MB_ICONEXCLAMATION); - // 'newName' is already returned after the path expansion + // 'newName' is already returned modified (after path expansion) return FALSE; // error -> show the standard dialog again } @@ -670,7 +671,7 @@ CPluginFSInterface::CreateDir(const char* fsName, int mode, HWND parent, char* n { // not a CEFS path SalamanderGeneral->SalMessageBox(parent, LoadStr(IDS_SORRY_CREATEDIR2), TitleWMobile, MB_OK | MB_ICONEXCLAMATION); - // 'newName' is already returned after the path expansion + // 'newName' is returned already modified (after path expansion) return FALSE; // error -> show the standard dialog again } @@ -678,7 +679,7 @@ CPluginFSInterface::CreateDir(const char* fsName, int mode, HWND parent, char* n { SalamanderGeneral->SalMessageBox(parent, LoadStr(IDS_SORRY_CREATEDIR3), TitleWMobile, MB_OK | MB_ICONEXCLAMATION); - // 'newName' is already returned after the path expansion + // 'newName' is already returned with the path expanded return FALSE; // error -> show the standard dialog again } @@ -687,7 +688,7 @@ CPluginFSInterface::CreateDir(const char* fsName, int mode, HWND parent, char* n { SalamanderGeneral->SalMessageBox(parent, LoadStr(IDS_ERR_INVALIDPATH), TitleWMobile, MB_OK | MB_ICONEXCLAMATION); - // 'newName' is returned after expanding the path and possibly adjusting ".." and "." + // 'newName' is returned modified: with the path expanded and some ".." and "." components possibly adjusted return FALSE; // error -> show the standard dialog again } @@ -701,7 +702,7 @@ CPluginFSInterface::CreateDir(const char* fsName, int mode, HWND parent, char* n DWORD err = CRAPI::GetLastError(); SalamanderGeneral->SalMessageBox(parent, SalamanderGeneral->GetErrorText(err), TitleWMobileError, MB_OK | MB_ICONEXCLAMATION); - // 'newName' is already returned after the path expansion + // 'newName' is already returned modified (with the path expanded) return FALSE; // error -> show the standard dialog again } @@ -742,7 +743,7 @@ CPluginFSInterface::ViewFile(const char* fsName, HWND parent, // determine whether a disk-cache copy of the file needs to be prepared (download) BOOL newFileOK = FALSE; CQuadWord newFileSize(0, 0); - if (!fileExists) // preparing a copy (download) is necessary + if (!fileExists) // preparing a file copy (download) is necessary { const char* name = uniqueFileName + strlen(AssignedFSName) + 1; @@ -790,7 +791,7 @@ CPluginFSInterface::ViewFile(const char* fsName, HWND parent, // open the viewer HANDLE fileLock; BOOL fileLockOwner; - if (!fileExists && !newFileOK || // open the viewer only if the file copy is ready + if (!fileExists && !newFileOK || // open the viewer only if the file copy is valid !salamander->OpenViewer(parent, tmpFileName, &fileLock, &fileLockOwner)) { // on error, reset "lock" fileLock = NULL; @@ -881,7 +882,7 @@ CPluginFSInterface::Delete(const char* fsName, int mode, HWND parent, int panel, delDlg.Create(); } - if (!showProgressDialog || delDlg.HWindow != NULL) // dialog opened successfully + if (!showProgressDialog || delDlg.HWindow != NULL) // no progress dialog, or the dialog opened successfully { if (showProgressDialog) SetForegroundWindow(delDlg.HWindow); @@ -904,7 +905,7 @@ CPluginFSInterface::Delete(const char* fsName, int mode, HWND parent, int panel, if (showProgressDialog) { float progress = ((float)i / (float)array.Count); - delDlg.Set(fileName, (DWORD)(progress * 1000), TRUE); // delayedPaint == TRUE so we don't slow things down + delDlg.Set(fileName, (DWORD)(progress * 1000), TRUE); // delayedPaint == TRUE so we do not slow things down } if (showProgressDialog && delDlg.GetWantCancel()) @@ -977,7 +978,7 @@ CPluginFSInterface::Delete(const char* fsName, int mode, HWND parent, int panel, } } - if (success && !skip) // neither canceled nor skipped + if (success && !skip) // not canceled or skipped { skip = FALSE; while (1) @@ -1104,7 +1105,7 @@ CPluginFSInterface::Delete(const char* fsName, int mode, HWND parent, int panel, SalamanderGeneral->ToLowerCase(dfsFileName); // remove the deleted file's cache copy if it exists SalamanderGeneral->RemoveOneFileFromCache(dfsFileName); - break; // successful delete + break; // delete succeeded } if (!success || skip) break; @@ -1216,14 +1217,14 @@ CPluginFSInterface::CopyOrMoveFromFS(BOOL copy, int mode, const char* fsName, HW SalamanderGeneral->SalPathAppend(targetPath, "*.*", 2 * MAX_PATH); SalamanderGeneral->SetUserWorkedOnPanelPath(PANEL_TARGET); // default action = work with the path in the target panel } - return FALSE; // request for the standard dialog + return FALSE; // request to show the standard dialog } if (mode == 4) // error during the standard Salamander processing of the target path { // 'targetPath' contains an invalid path, the user has already been informed, so we just // let them edit the destination path again - return FALSE; // request for the standard dialog + return FALSE; // request to show the standard dialog } char buf[3 * MAX_PATH + 100]; @@ -1244,10 +1245,10 @@ CPluginFSInterface::CopyOrMoveFromFS(BOOL copy, int mode, const char* fsName, HW if (userPart == NULL) // path does not contain an FS name, so it is relative { // a relative path with ':' is not allowed here (cannot be distinguished from an absolute path to some FS) - // For disk paths we could use SalGetFullName: - // SalamanderGeneral->SalGetFullName(targetPath, &errTextID, Path, nextFocus) + handle the errors - // After that it would be enough to prepend the FS name to the obtained path - // but instead we demonstrate our own implementation (using SalRemovePointsFromPath and others): + // For disk paths, it would be preferable to use SalGetFullName: + // SalamanderGeneral->SalGetFullName(targetPath, &errTextID, Path, nextFocus) + handle errors + // Then it would only be necessary to prepend the FS name to the resulting path + // But here we prefer to show our own implementation instead (using SalRemovePointsFromPath and others): char* s = strchr(targetPath, '\\'); if (s == NULL || *(s + 1) == 0) @@ -1270,7 +1271,7 @@ CPluginFSInterface::CopyOrMoveFromFS(BOOL copy, int mode, const char* fsName, HW BOOL tooLong = FALSE; int rootLen = 1; *s = '\\'; - if (targetPath[0] == '\\') // "\\path" -> compose root + newName + if (targetPath[0] == '\\') // "\\path" -> build root + newName { s += rootLen; int len = (int)strlen(targetPath + 1); // without the leading '\\' @@ -1296,7 +1297,7 @@ CPluginFSInterface::CopyOrMoveFromFS(BOOL copy, int mode, const char* fsName, HW SalamanderGeneral->SalMessageBox(parent, LoadStr(IDS_ERR_NAMETOOLONG), TitleWMobileError, MB_OK | MB_ICONEXCLAMATION); // 'targetPath' is returned unchanged (as entered by the user) - return FALSE; // error -> reopen the standard dialog + return FALSE; // on error, show the standard dialog again } strcpy(targetPath, path); @@ -1325,7 +1326,7 @@ CPluginFSInterface::CopyOrMoveFromFS(BOOL copy, int mode, const char* fsName, HW rootLen = userPartLen; } - // The full path to this FS may also contain "." and ".." entered by the user - remove them + // The user may also have used "." and ".." in the full path to this FS; remove them. if (invPath || !SalamanderGeneral->SalRemovePointsFromPath(userPart + rootLen)) { // Additionally we could display 'err' (when 'invPath' is TRUE); ignored here for simplicity @@ -1338,7 +1339,7 @@ CPluginFSInterface::CopyOrMoveFromFS(BOOL copy, int mode, const char* fsName, HW // Trim the unnecessary backslash int l = (int)strlen(userPart); BOOL backslashAtEnd = l > 0 && userPart[l - 1] == '\\'; - if (l > 1 && userPart[l - 1] == '\\') // path of the form "\path\" + if (l > 1 && userPart[l - 1] == '\\') // path of the form "\\path\\" userPart[l - 1] = 0; // remove the trailing backslash // Analyse the path - locate the existing part, the missing part, and the operation mask @@ -1363,8 +1364,8 @@ CPluginFSInterface::CopyOrMoveFromFS(BOOL copy, int mode, const char* fsName, HW BOOL pathIsDir = TRUE; BOOL pathError = FALSE; - // If the path contains a mask, cut it off without calling GetFileAttributes - if (end > afterRoot) // still more than just the root + // If the path contains a mask, trim it off without calling GetFileAttributes + if (end > afterRoot) // still not just the root { char* end2 = end; BOOL cut = FALSE; @@ -1373,7 +1374,7 @@ CPluginFSInterface::CopyOrMoveFromFS(BOOL copy, int mode, const char* fsName, HW if (*end2 == '*' || *end2 == '?') cut = TRUE; } - if (cut) // the name contains a mask -> trim it + if (cut) // the name contains a wildcard -> trim it { end = end2; lastChar = *end; @@ -1381,12 +1382,12 @@ CPluginFSInterface::CopyOrMoveFromFS(BOOL copy, int mode, const char* fsName, HW } } - while (end > afterRoot) // still more than just the root + while (end > afterRoot) // not yet at the root { DWORD attrs = CRAPI::GetFileAttributes(userPart); if (attrs != 0xFFFFFFFF) // this portion of the path exists { - if ((attrs & FILE_ATTRIBUTE_DIRECTORY) == 0) // it is a file + if ((attrs & FILE_ATTRIBUTE_DIRECTORY) == 0) // the existing part of the path is a file { // An existing path must not include a file name (see SalSplitGeneralPath); trim it... *end = lastChar; // restore 'targetPath' @@ -1422,7 +1423,7 @@ CPluginFSInterface::CopyOrMoveFromFS(BOOL copy, int mode, const char* fsName, HW *end = lastChar; // restore 'targetPath' SetCursor(oldCur); - if (!pathError) // the split finished without errors + if (!pathError) // the split completed without errors { if (*end == '\\') end++; @@ -1451,7 +1452,7 @@ CPluginFSInterface::CopyOrMoveFromFS(BOOL copy, int mode, const char* fsName, HW backslashAtEnd, dirName, curPath, mask, newDirs, CEFS_IsTheSamePath)) { - if (newDirs[0] != 0) // need to create some subdirectories on the target path + if (newDirs[0] != 0) // create any needed subdirectories in the target path { if (!CRAPI::CheckAndCreateDirectory(userPart, parent, true, NULL, 0, NULL)) { @@ -1479,7 +1480,7 @@ CPluginFSInterface::CopyOrMoveFromFS(BOOL copy, int mode, const char* fsName, HW if (pathError) { - // 'targetPath' is returned after the modification (path expansion) + the ".." and "." cleanup + the mask that may have been added + // 'targetPath' is returned after path expansion, resolution of ".." and ".", and with any added masks return FALSE; // error -> reopen the standard dialog } diskPath = FALSE; // path on this FS successfully analysed @@ -1496,19 +1497,19 @@ CPluginFSInterface::CopyOrMoveFromFS(BOOL copy, int mode, const char* fsName, HW } const char* opMask = NULL; // operation mask - if (mode == 5) // operation target specified via drag&drop + if (mode == 5) // operation target was specified via drag and drop { // If it is a disk path, just set the operation mask and continue (same as with 'mode'==3); - // if it is a path into an archive, throw a "not supported" error; for a CEFS path set - // 'diskPath'=FALSE and compute 'userPart' (points to the user portion of the CEFS path); for - // a path to another FS, throw a "not supported" error + // if it is a path into an archive, report a "not supported" error; for a CEFS path set + // 'diskPath'=FALSE and compute 'userPart' (points to the user part of the CEFS path); for + // a path into another FS, report a "not supported" error BOOL ok = FALSE; opMask = "*.*"; int type; char* secondPart; BOOL isDir; - if (targetPath[0] != 0 && targetPath[1] == ':' || // disk path (C:\path) + if (targetPath[0] != 0 && targetPath[1] == ':' || // drive-letter path (C:\path) targetPath[0] == '\\' && targetPath[1] == '\\') // UNC path (\\server\share\path) { // append a trailing backslash so it is always treated as a path (for 'mode'==5 it is always a path) SalamanderGeneral->SalPathAddBackslash(targetPath, MAX_PATH); @@ -1536,7 +1537,7 @@ CPluginFSInterface::CopyOrMoveFromFS(BOOL copy, int mode, const char* fsName, HW userPart = secondPart; if ((userPart - targetPath) - 1 == (int)strlen(fsName) && SalamanderGeneral->StrNICmp(targetPath, fsName, (int)(userPart - targetPath) - 1) == 0) - { // je to CEFS + { // different FS, report only "not supported" diskPath = FALSE; ok = TRUE; } @@ -1566,7 +1567,7 @@ CPluginFSInterface::CopyOrMoveFromFS(BOOL copy, int mode, const char* fsName, HW // 'mode' is 2, 3 or 5 - // Determine the operation mask (the target path is in 'targetPath') + // find the operation mask (the target path is in 'targetPath') if (opMask == NULL) { opMask = targetPath; @@ -1763,7 +1764,7 @@ CPluginFSInterface::CopyOrMoveFromFS(BOOL copy, int mode, const char* fsName, HW { targetPathChanged = TRUE; subdirsOfTargetPathChanged = TRUE; - break; // successfully created directory + break; // directory created successfully } } // end of while(1) } @@ -1772,7 +1773,7 @@ CPluginFSInterface::CopyOrMoveFromFS(BOOL copy, int mode, const char* fsName, HW { DWORD attr = 0xFFFFFFFF; - if (!rename || SalamanderGeneral->StrICmp(sourceName, targetName) != 0) // Not a simple change in letter case + if (!rename || SalamanderGeneral->StrICmp(sourceName, targetName) != 0) // Not just a change in letter case { if (diskPath) attr = SalamanderGeneral->SalGetFileAttributes(targetName); @@ -1852,7 +1853,7 @@ CPluginFSInterface::CopyOrMoveFromFS(BOOL copy, int mode, const char* fsName, HW { DWORD err = 0; LPCTSTR errFileName = ""; - if (diskPath) // JR Windows destination path + if (diskPath) // Windows destination path //JR { if (attr != 0xFFFFFFFF && (attr & (FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_READONLY))) @@ -1886,7 +1887,7 @@ CPluginFSInterface::CopyOrMoveFromFS(BOOL copy, int mode, const char* fsName, HW if (err != 0) { - if (err == -1) // JR cancelled by the user + if (err == -1) // JR interrupted by the user success = FALSE; else if (!skipAllErrors) { @@ -1925,7 +1926,7 @@ CPluginFSInterface::CopyOrMoveFromFS(BOOL copy, int mode, const char* fsName, HW } } - if (success && !copy && !skip && !fileMoved) // it is a "move" and the file was not skipped -> delete the source file + if (success && !copy && !skip && !fileMoved) // move and the file was not skipped -> delete the source file { while (1) { @@ -1969,7 +1970,7 @@ CPluginFSInterface::CopyOrMoveFromFS(BOOL copy, int mode, const char* fsName, HW sourcePathChanged = TRUE; subdirsOfSourcePathChanged = TRUE; - break; // successful RemoveDirectory + break; // RemoveDirectory succeeded } } else @@ -1977,7 +1978,7 @@ CPluginFSInterface::CopyOrMoveFromFS(BOOL copy, int mode, const char* fsName, HW } else { - // remove the file on CEFS + // delete the file on CEFS if (fi.dwFileAttributes & (FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_READONLY)) CRAPI::SetFileAttributes(sourceName, FILE_ATTRIBUTE_ARCHIVE); @@ -2029,7 +2030,7 @@ CPluginFSInterface::CopyOrMoveFromFS(BOOL copy, int mode, const char* fsName, HW dlg.SetProgress((DWORD)progress, 0, FALSE); } else - break; // Determine whether it makes sense to continue (when not cancelled) + break; // Determine whether to continue if not cancelled } EnableWindow(mainWnd, TRUE); @@ -2052,7 +2053,7 @@ CPluginFSInterface::CopyOrMoveFromFS(BOOL copy, int mode, const char* fsName, HW strcpy(targetPath, nextFocus); // success else cancelOrHandlePath = TRUE; // error/cancel - return TRUE; // success or error/cancel handled + return TRUE; // success or error/cancel } static BOOL FindAllFilesInTree(LPCTSTR rootPath, char (&path)[MAX_PATH], LPCTSTR fileName, CFileInfoArray& array, BOOL dirFirst, int block) @@ -2072,7 +2073,7 @@ static BOOL FindAllFilesInTree(LPCTSTR rootPath, char (&path)[MAX_PATH], LPCTSTR { DWORD err = GetLastError(); if (err == ERROR_NO_MORE_FILES || err == ERROR_FILE_NOT_FOUND) - return TRUE; // JR empty directory, stop + return TRUE; // JR: empty directory, done char buf[2 * MAX_PATH + 100]; sprintf(buf, LoadStr(IDS_PATH_ERROR), fullPath, SalamanderGeneral->GetErrorText(err)); @@ -2142,7 +2143,7 @@ static BOOL FindAllFilesInTree(LPCTSTR rootPath, char (&path)[MAX_PATH], LPCTSTR if (!FindNextFile(find, &data)) { if (GetLastError() == ERROR_NO_MORE_FILES) - break; // JR Everything is fine, stop + break; // JR Everything is fine, stop here DWORD err = GetLastError(); SalamanderGeneral->ShowMessageBox(SalamanderGeneral->GetErrorText(err), TitleWMobileError, MSGBOX_ERROR); @@ -2215,7 +2216,7 @@ CPluginFSInterface::CopyOrMoveFromDiskToFS(BOOL copy, int mode, const char* fsNa // Additionally we could display 'err' (when 'invPath' is TRUE); ignored here for simplicity SalamanderGeneral->SalMessageBox(parent, LoadStr(IDS_ERR_INVALIDPATH), TitleWMobileError, MB_OK | MB_ICONEXCLAMATION); - // 'targetPath' is returned after possibly adjusting some ".." and "." + // 'targetPath' is returned after possible adjustment of some ".." and "." segments if (invalidPathOrCancel != NULL) *invalidPathOrCancel = TRUE; return FALSE; // let the user correct the path @@ -2256,7 +2257,7 @@ CPluginFSInterface::CopyOrMoveFromDiskToFS(BOOL copy, int mode, const char* fsNa if (*end2 == '*' || *end2 == '?') cut = TRUE; } - if (cut) // the name contains a mask -> trim it + if (cut) // the name contains a wildcard -> trim it { end = end2; lastChar = *end; @@ -2269,7 +2270,7 @@ CPluginFSInterface::CopyOrMoveFromDiskToFS(BOOL copy, int mode, const char* fsNa DWORD attrs = CRAPI::GetFileAttributes(userPart); if (attrs != 0xFFFFFFFF) // this portion of the path exists { - if ((attrs & FILE_ATTRIBUTE_DIRECTORY) == 0) // it is a file + if ((attrs & FILE_ATTRIBUTE_DIRECTORY) == 0) // the existing part of the path is a file { // An existing path must not include a file name (see SalSplitGeneralPath); trim it... *end = lastChar; // restore 'targetPath' @@ -2317,7 +2318,7 @@ CPluginFSInterface::CopyOrMoveFromDiskToFS(BOOL copy, int mode, const char* fsNa backslashAtEnd, NULL, NULL, opMask, newDirs, NULL /* 'isTheSamePathF' not needed */)) { - if (newDirs[0] != 0) // need to create some subdirectories on the target path + if (newDirs[0] != 0) // create any needed subdirectories in the target path { if (!CRAPI::CheckAndCreateDirectory(userPart, parent, true, NULL, 0, NULL)) { @@ -2336,7 +2337,7 @@ CPluginFSInterface::CopyOrMoveFromDiskToFS(BOOL copy, int mode, const char* fsNa if (pathError) { - // 'targetPath' is returned after cleaning up ".." and "." + any mask that was added + // 'targetPath' is returned with ".." and "." cleaned up, plus any added masks if (invalidPathOrCancel != NULL) *invalidPathOrCancel = TRUE; return FALSE; // path error - let the user fix it @@ -2370,7 +2371,7 @@ CPluginFSInterface::CopyOrMoveFromDiskToFS(BOOL copy, int mode, const char* fsNa 500, FALSE, SalamanderGeneral->GetMainWindowHWND()); CFileInfoArray array(10, 10); - BOOL success = TRUE; // FALSE in case of an error or user cancellation + BOOL success = TRUE; // FALSE if an error occurs or the user cancels BOOL isDir; const char* name; @@ -2438,8 +2439,8 @@ CPluginFSInterface::CopyOrMoveFromDiskToFS(BOOL copy, int mode, const char* fsNa // Construct the full name; trimming to MAX_PATH is theoretically redundant, but unfortunately needed in practice lstrcpyn(endSource, fi.cFileName, endSourceSize); - // Compose the target name - simplified without the LoadStr(IDS_ERR_NAMETOOLONG) error check - // ('name' covers only the root of the source path - no subdirectories - adjust the entire 'name' with the mask) + // Build the target name - simplified, without checking the LoadStr(IDS_ERR_NAMETOOLONG) error + // ('name' is only from the root of the source path - no subdirectories - the mask modifies the entire 'name') lstrcpyn(endTarget, targetFile, endTargetSize); isDir = (fi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0; @@ -2492,7 +2493,7 @@ CPluginFSInterface::CopyOrMoveFromDiskToFS(BOOL copy, int mode, const char* fsNa { targetPathChanged = TRUE; subdirsOfTargetPathChanged = TRUE; - break; // successfully created directory + break; // directory created successfully } } // end of while(1) } @@ -2658,7 +2659,7 @@ CPluginFSInterface::CopyOrMoveFromDiskToFS(BOOL copy, int mode, const char* fsNa { sourcePathChanged = TRUE; subdirsOfSourcePathChanged = TRUE; - break; // successful RemoveDirectory + break; // RemoveDirectory succeeded } } else @@ -2697,7 +2698,7 @@ CPluginFSInterface::CopyOrMoveFromDiskToFS(BOOL copy, int mode, const char* fsNa else { sourcePathChanged = TRUE; - break; // successful delete + break; // delete succeeded } } if (!success || skip) @@ -2713,7 +2714,7 @@ CPluginFSInterface::CopyOrMoveFromDiskToFS(BOOL copy, int mode, const char* fsNa dlg.SetProgress((DWORD)progress, 0, FALSE); } else - break; // Determine whether it makes sense to continue (when not cancelled) + break; // determine whether to continue (if not cancelled) } EnableWindow(mainWnd, TRUE); @@ -2738,7 +2739,7 @@ CPluginFSInterface::CopyOrMoveFromDiskToFS(BOOL copy, int mode, const char* fsNa { if (invalidPathOrCancel != NULL) *invalidPathOrCancel = TRUE; - return TRUE; // cancel + return TRUE; // canceled } } From d2d85bdea7f71326dd3cf4b22d27388e4924a6a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:34:02 +0200 Subject: [PATCH 524/710] [translation] Fix src/plugins/wmobile/rapi.cpp comments Refines translated comments in src/plugins/wmobile/rapi.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #803 for src/plugins/wmobile/rapi.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/wmobile/rapi.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/plugins/wmobile/rapi.cpp b/src/plugins/wmobile/rapi.cpp index 35cd8c5c8..0312728e9 100644 --- a/src/plugins/wmobile/rapi.cpp +++ b/src/plugins/wmobile/rapi.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -112,7 +113,7 @@ class CDynRapi RAPI_FUNCTIONS #undef Func_Operator - if (!IsGood()) // And verify everything + if (!IsGood()) // Verify everything { Unload(); return FALSE; @@ -589,7 +590,7 @@ BOOL CRAPI::FindAllFilesInTree(LPCTSTR rootPath, char (&path)[MAX_PATH], LPCTSTR // JR Some storage implementations return ERROR_FILE_NOT_FOUND instead of ERROR_NO_MORE_FILES int nError = CDynRapi::CeGetLastError(); if (nError == ERROR_NO_MORE_FILES || nError == ERROR_FILE_NOT_FOUND) - return TRUE; // JR empty directory, stop + return TRUE; // JR: empty directory, returning char buf[2 * MAX_PATH + 100]; DWORD err = GetLastError(); @@ -664,7 +665,7 @@ BOOL CRAPI::FindAllFilesInTree(LPCTSTR rootPath, char (&path)[MAX_PATH], LPCTSTR if (!FindNextFile(find, &data)) { if (CDynRapi::CeGetLastError() == ERROR_NO_MORE_FILES) - break; // JR Everything is fine, stop + break; // JR everything is fine, stopping DWORD err = GetLastError(); SalamanderGeneral->ShowMessageBox(SalamanderGeneral->GetErrorText(err), TitleWMobileError, MSGBOX_ERROR); @@ -702,7 +703,7 @@ CRAPI::CopyFileToPC(LPCTSTR lpExistingFileName, LPCTSTR lpNewFileName, BOOL bFai if (srcHandle == INVALID_HANDLE_VALUE) goto ONERROR_SRC; - size = GetFileSize(srcHandle, NULL); // JR REVIEW: Files larger than 4 GB likely won't exist on Windows Mobile + size = GetFileSize(srcHandle, NULL); //JR REVIEW: Files larger than 4 GB probably do not exist on Windows Mobile if (size == 0xFFFFFFFF) goto ONERROR_SRC; @@ -748,7 +749,7 @@ CRAPI::CopyFileToPC(LPCTSTR lpExistingFileName, LPCTSTR lpNewFileName, BOOL bFai } } while (read >= sizeof(buffer)); - ::SetFileTime(dstHandle, &creationTime, &accessedTime, &writeTime); // JR REVIEW: should we ignore potential errors? + ::SetFileTime(dstHandle, &creationTime, &accessedTime, &writeTime); // JR REVIEW: ignore potential errors? ::SetFileAttributes(lpNewFileName, attr); RETURN: @@ -839,7 +840,7 @@ CRAPI::CopyFileToCE(LPCTSTR lpExistingFileName, LPCTSTR lpNewFileName, BOOL bFai } } while (read >= sizeof(buffer)); - SetFileTime(dstHandle, &creationTime, &accessedTime, &writeTime); // JR REVIEW: should we ignore potential errors? + SetFileTime(dstHandle, &creationTime, &accessedTime, &writeTime); // JR REVIEW: ignore potential errors? SetFileAttributes(lpNewFileName, attr); RETURN: @@ -933,7 +934,7 @@ CRAPI::CopyFile(LPCTSTR lpExistingFileName, LPCTSTR lpNewFileName, BOOL bFailIfE } } while (read >= sizeof(buffer)); - SetFileTime(dstHandle, &creationTime, &accessedTime, &writeTime); // JR REVIEW: should we ignore potential errors? + SetFileTime(dstHandle, &creationTime, &accessedTime, &writeTime); // JR REVIEW: ignore potential errors? SetFileAttributes(lpNewFileName, attr); RETURN: @@ -1088,7 +1089,7 @@ BOOL CRAPI::CheckAndCreateDirectory(const char* dir, HWND parent, BOOL quiet, ch if (attrs != 0xFFFFFFFF) // the name exists { if (attrs & FILE_ATTRIBUTE_DIRECTORY) - break; // we will build from this directory + break; // we will create directories starting from this directory else // it is a file, that would not work... { sprintf(buf, LoadStr(IDS_ERR_DIRNAMEISFILE), name); @@ -1154,7 +1155,7 @@ BOOL CRAPI::CheckAndCreateDirectory(const char* dir, HWND parent, BOOL quiet, ch } if (attrs & FILE_ATTRIBUTE_DIRECTORY) return TRUE; - else // file, that would not work... + else // a file; a directory cannot be created here { sprintf(buf, LoadStr(IDS_ERR_DIRNAMEISFILE), dir); if (errBuf != NULL) From c58d46e2d367beb9ccf947f0446e70afcdb19798 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:37:07 +0200 Subject: [PATCH 525/710] [translation] Fix src/plugins/wmobile/wmobile.cpp comments Refines translated comments in src/plugins/wmobile/wmobile.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #804 for src/plugins/wmobile/wmobile.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/wmobile/wmobile.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/plugins/wmobile/wmobile.cpp b/src/plugins/wmobile/wmobile.cpp index 33cbb057d..512c2e9a6 100644 --- a/src/plugins/wmobile/wmobile.cpp +++ b/src/plugins/wmobile/wmobile.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -8,7 +9,7 @@ CPluginInterface PluginInterface; // additional parts of the CPluginInterface interface CPluginInterfaceForFS InterfaceForFS; -// ConfigVersion: 0 - no configuration was read from the Registry (plugin installation or a version without configuration - up to and including 2.5 beta 7), +// ConfigVersion: 0 - no configuration was loaded from the Registry (plugin installation or a version without configuration - up to and including 2.5 beta 7), // 1 - first configuration version (since 2.5 beta 8; introduced to automatically disable the Alt+F1/F2 menu item when rapi.dll is not installed) int ConfigVersion = 0; // version of the configuration loaded from the registry (see description above) @@ -59,11 +60,11 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) if (!InitCommonControlsEx(&initCtrls)) { MessageBox(NULL, "InitCommonControlsEx failed!", "Error", MB_OK | MB_ICONERROR); - return FALSE; // DLL won't start + return FALSE; // DLL will not load } } - return TRUE; // DLL can be loaded + return TRUE; // Allow the DLL to load } void OnAbout(HWND hParent) @@ -209,7 +210,7 @@ CPluginInterface::LoadConfiguration(HWND parent, HKEY regKey, CSalamanderRegistr { CALL_STACK_MESSAGE1("CPluginInterface::LoadConfiguration(, ,)"); - if (regKey != NULL) // load from the registry + if (regKey != NULL) // load from registry { registry->GetValue(regKey, CONFIG_VERSION, REG_DWORD, &ConfigVersion, sizeof(DWORD)); } From e5d813d04f31eabac77aa36604376ba63910ccda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:37:30 +0200 Subject: [PATCH 526/710] [translation] Fix src/plugins/wmobile/wmobile.h comments Refines translated comments in src/plugins/wmobile/wmobile.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #805 for src/plugins/wmobile/wmobile.h, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/wmobile/wmobile.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/wmobile/wmobile.h b/src/plugins/wmobile/wmobile.h index 66e0e06fb..f86287d39 100644 --- a/src/plugins/wmobile/wmobile.h +++ b/src/plugins/wmobile/wmobile.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once @@ -149,8 +150,8 @@ class CTopIndexMem Path[0] = 0; TopIndexesCount = 0; } // clear the memory - void Push(const char* path, int topIndex); // store the top index for the given path - BOOL FindAndPop(const char* path, int& topIndex); // find the top index for the given path, FALSE -> not found + void Push(const char* path, int topIndex); // stores the top index for the given path + BOOL FindAndPop(const char* path, int& topIndex); // finds the top index for the given path; returns FALSE if not found }; // From 6d34bfc513b0ed17579f96732bf3a9514eab9899 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:37:51 +0200 Subject: [PATCH 527/710] [translation] Fix src/plugins/zip/sfxmake/crc32.cpp comments Refines translated comments in src/plugins/zip/sfxmake/crc32.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #806 for src/plugins/zip/sfxmake/crc32.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/zip/sfxmake/crc32.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/plugins/zip/sfxmake/crc32.cpp b/src/plugins/zip/sfxmake/crc32.cpp index 0c1375aa7..d083d3cbe 100644 --- a/src/plugins/zip/sfxmake/crc32.cpp +++ b/src/plugins/zip/sfxmake/crc32.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -8,7 +9,7 @@ #include "crc32.h" #ifdef STATIC_CRC_TAB -//table of CRC-32's of all single-byte values (made by MakeCrcTable) +// Table of CRC-32 values for all single-byte values (generated by MakeCrcTable) const __UINT32 StaticCrcTab[256] = { 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L, @@ -73,15 +74,15 @@ void MakeCrcTable(__UINT32* crcTab) const __UINT32 poly = 0xedb88320L; //polynomial exclusive-or pattern /* - //generate crc polonomial, using precomputed poly should be faster - // terms of polynomial defining this crc (except x^32): - static const Byte p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26}; + // Generate the CRC polynomial; using a precomputed poly should be faster + // Terms of the polynomial defining this CRC (except x^32): + static const Byte p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26}; - // make exclusive-or pattern from polynomial (0xedb88320L) - poly = 0L; - for (n = 0; n < sizeof(p)/sizeof(Byte); n++) - poly |= 1L << (31 - p[n]); -*/ + // Make the exclusive-or pattern from the polynomial (0xedb88320L) + poly = 0L; + for (n = 0; n < sizeof(p)/sizeof(Byte); n++) + poly |= 1L << (31 - p[n]); + */ for (n = 0; n < 256; n++) { c = (__UINT32)n; From 5f8514d8cff5da8892043d4139e75c20993fb0ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:38:14 +0200 Subject: [PATCH 528/710] [translation] Fix src/plugins/zip/sfxmake/sfxmake.cpp comments Refines translated comments in src/plugins/zip/sfxmake/sfxmake.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #807 for src/plugins/zip/sfxmake/sfxmake.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/zip/sfxmake/sfxmake.cpp | 35 +++++++++++++++-------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/plugins/zip/sfxmake/sfxmake.cpp b/src/plugins/zip/sfxmake/sfxmake.cpp index dcf4f7af6..0bae1ee0a 100644 --- a/src/plugins/zip/sfxmake/sfxmake.cpp +++ b/src/plugins/zip/sfxmake/sfxmake.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" #include @@ -70,26 +71,26 @@ BOOL GetChar(HANDLE file, char& c) return FALSE; } /* - switch (c) - { - case '\r': break; //dump all CRLF sequences - case '\n': - if (prev == '\r') break; - else return TRUE; + switch (c) + { + case '\r': break; //skip all CRLF sequences + case '\n': + if (prev == '\r') break; + else return TRUE; - case '\\': break; // read next (control) character + case '\\': break; //read the next control character - case 'n': //process all \n ad sequences - if (prev == '\\') c = '\n'; - return TRUE; + case 'n': //process all \n sequences + if (prev == '\\') c = '\n'; + return TRUE; - case 'r': //process all \r ad sequences - if (prev == '\\') c = '\r'; - return TRUE; + case 'r': //process all \r sequences + if (prev == '\\') c = '\r'; + return TRUE; - default: return TRUE; - } - */ + default: return TRUE; + } + */ return TRUE; // prev = c; // } @@ -265,7 +266,7 @@ int main(int argc, char* argv[]) if (SfxFile == INVALID_HANDLE_VALUE) return Error("Unable to create SFX package file."); - //open file with default texts + // open file with default text HANDLE textFile = CreateFile(argv[2], GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (textFile == INVALID_HANDLE_VALUE) return Error("Unable to open text file."); From c65ff4e5c9702f2ab11059c81e1503eb3d78742a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:38:36 +0200 Subject: [PATCH 529/710] [translation] Fix src/plugins/zip/zip2sfx/crc32.cpp comments Refines translated comments in src/plugins/zip/zip2sfx/crc32.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #808 for src/plugins/zip/zip2sfx/crc32.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/zip/zip2sfx/crc32.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/plugins/zip/zip2sfx/crc32.cpp b/src/plugins/zip/zip2sfx/crc32.cpp index 3794f8b40..3cf68fc51 100644 --- a/src/plugins/zip/zip2sfx/crc32.cpp +++ b/src/plugins/zip/zip2sfx/crc32.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -8,7 +9,7 @@ #include "crc32.h" #ifdef STATIC_CRC_TAB -//table of CRC-32's of all single-byte values (made by MakeCrcTable) +// CRC-32 table for all single-byte values (generated by MakeCrcTable) const __UINT32 StaticCrcTab[256] = { 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L, @@ -73,15 +74,15 @@ void MakeCrcTable(__UINT32* crcTab) const __UINT32 poly = 0xedb88320L; //polynomial exclusive-or pattern /* - //generate crc polonomial, using precomputed poly should be faster - // terms of polynomial defining this crc (except x^32): - static const Byte p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26}; + // Generate the CRC polynomial; using a precomputed poly should be faster + // Terms of the polynomial defining this CRC (except x^32): + static const Byte p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26}; - // make exclusive-or pattern from polynomial (0xedb88320L) - poly = 0L; - for (n = 0; n < sizeof(p)/sizeof(Byte); n++) - poly |= 1L << (31 - p[n]); -*/ + // Make the exclusive-or pattern from the polynomial (0xedb88320L) + poly = 0L; + for (n = 0; n < sizeof(p)/sizeof(Byte); n++) + poly |= 1L << (31 - p[n]); + */ for (n = 0; n < 256; n++) { c = (__UINT32)n; From ad4674896374d43cc9db8b7fe78ba784ecfd5e8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:38:58 +0200 Subject: [PATCH 530/710] [translation] Fix src/plugins/zip/zip2sfx/inflate.cpp comments Refines translated comments in src/plugins/zip/zip2sfx/inflate.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #809 for src/plugins/zip/zip2sfx/inflate.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/zip/zip2sfx/inflate.cpp | 145 ++++++++++++++-------------- 1 file changed, 73 insertions(+), 72 deletions(-) diff --git a/src/plugins/zip/zip2sfx/inflate.cpp b/src/plugins/zip/zip2sfx/inflate.cpp index f758b4b27..33f36b65d 100644 --- a/src/plugins/zip/zip2sfx/inflate.cpp +++ b/src/plugins/zip/zip2sfx/inflate.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" //#include @@ -20,7 +21,7 @@ unsigned WinPos; unsigned char* SlideWin = NULL; DWORD UCSize; DWORD Crc; -struct huft* fixed_tl = NULL; // !! must be NULL initialized +struct huft* fixed_tl = NULL; // must be initialized to NULL struct huft* fixed_td; //before calling inflate int fixed_bl, fixed_bd; @@ -155,8 +156,8 @@ int huft_build(const unsigned* b, /* code lengths in bits (all assumed <= stream to find repeated byte strings. This is implemented here as a circular buffer. The index is updated simply by incrementing and then and'ing with 0x7fff (32K-1) (window size - 1). */ -// sliding window is defined in CDecompressionObject and could be -// any size greater or equal 32K +// The sliding window is defined in CDecompressionObject and can be +// any size greater than or equal to 32K /* Tables for deflate from PKZIP's appnote.txt. */ static const unsigned border[] = {/* Order of the bit length code lengths */ @@ -177,7 +178,7 @@ static const unsigned short cpdext[] = {/* Extra bits for distance codes */ 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13}; -/* And'ing with mask_bits[n] masks the lower n bits */ +/* ANDing with mask_bits[n] masks the lower n bits */ const unsigned short mask_bits[] = { 0x0000, 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, @@ -193,7 +194,7 @@ const unsigned short mask_bits[] = { where NEEDBITS makes sure that b has at least j bits in it, and DUMPBITS removes the bits from b. The macros use the variable k for the number of bits in b. Normally, b and k are register - variables for speed and are initialized at the begining of a + variables for speed and are initialized at the beginning of a routine that uses these macros from a global bit buffer and count. In order to not ask for more bits than there are in the compressed @@ -275,15 +276,15 @@ unsigned long NextByte() the longer codes. The time it costs to decode the longer codes is then traded against the time it takes to make longer tables. - This results of this trade are in the variables lbits and dbits - below. lbits is the number of bits the first level table for literal/ - length codes can decode in one step, and dbits is the same thing for - the distance codes. Subsequent tables are also less than or equal to - those sizes. These values may be adjusted either when all of the - codes are shorter than that, in which case the longest code length in - bits is used, or when the shortest code is *longer* than the requested - table size, in which case the length of the shortest code in bits is - used. + The results of this trade are reflected in the variables lbits and + dbits below. lbits is the number of bits the first-level table for + literal/length codes can decode in one step, and dbits is the same + thing for the distance codes. Subsequent tables are also less than + or equal to those sizes. These values may be adjusted either when + all of the codes are shorter than that, in which case the longest + code length in bits is used, or when the shortest code is *longer* + than the requested table size, in which case the length of the + shortest code in bits is used. There are two different values for the two tables, since they code a different number of possibilities each. The literal/length table @@ -291,8 +292,8 @@ unsigned long NextByte() bits. The distance table codes 30 possible values, or a little less than five bits, flat. The optimum values for speed end up being about one bit more than those, so lbits is 8+1 and dbits is 5+1. - The optimum values may differ though from machine to machine, and - possibly even between compilers. Your mileage may vary. + The optimum values may differ from machine to machine, and possibly + even between compilers. */ static const int lbits = 9; /* bits in base literal/length lookup table */ @@ -302,7 +303,7 @@ static const int dbits = 6; /* bits in base distance lookup table */ /* inflate (decompress) the codes in a deflated (compressed) block. Return an error code or zero if it all goes ok. */ -int inflate_codes(struct huft* tl, //literal/length +int inflate_codes(struct huft* tl, // literal/length decoder tables struct huft* td, //distance decoder tables int bl, int bd) //number of bits decoded by tl[] and td[] { @@ -322,7 +323,7 @@ int inflate_codes(struct huft* tl, //literal/length /* inflate the coded data */ ml = mask_bits[bl]; /* precompute masks for speed */ md = mask_bits[bd]; - while (1) /* do until end of block */ + while (1) /* loop until the end of the block */ { NEEDBITS((unsigned)bl) if ((e = (t = tl + ((unsigned)b & ml))->e) > 16) @@ -337,7 +338,7 @@ int inflate_codes(struct huft* tl, //literal/length NEEDBITS(e) } while ((e = (t = t->v.t + ((unsigned)b & mask_bits[e]))->e) > 16); DUMPBITS(t->b) - if (e == 16) /* then it's a literal */ + if (e == 16) /* then it is a literal */ { SlideWin[w++] = (unsigned char)t->v.n; if (w == WSIZE) @@ -392,7 +393,7 @@ int inflate_codes(struct huft* tl, //literal/length d = w - t->v.n - ((unsigned)b & mask_bits[e]); DUMPBITS(e) - /* do the copy */ + /* copy the data */ do { n -= (e = (e = WSIZE - ((d &= WSIZE - 1) > w ? d : w)) > n ? n : e); @@ -459,7 +460,7 @@ int inflate_stored() k = BitCount; w = WinPos; - // go to byte boundary + // align to the next byte boundary n = k & 7; DUMPBITS(n); @@ -472,8 +473,8 @@ int inflate_stored() return 1; // error in compressed data DUMPBITS(16) - ///* old copy routine, the new should be faster (I hope so) - // read and output the compressed data + ///* old copy routine; the new one should be faster + // read and output the uncompressed data while (n--) { NEEDBITS(8) @@ -504,49 +505,49 @@ int inflate_stored() } /* - //copy bytes from intup to the output - while (n) - { - if(n <= decompress->Output->WinSize - decompress->Output->WinPos) - outBytes = n; - else - outBytes = decompress->Output->WinSize - decompress->Output->WinPos; - - n -= outBytes; - while (outBytes) - { - if (outBytes <= decompress->Input->BytesLeft) - inBytes = outBytes; - else - inBytes = decompress->Input->BytesLeft; - - memcpy(decompress->Output->SlideWin + decompress->Output->WinPos, - decompress->Input->NextByte, inBytes); - decompress->Input->NextByte += inBytes; - decompress->Input->BytesLeft -= inBytes; - decompress->Output->WinPos += inBytes; - outBytes -= inBytes; - if(!decompress->Input->BytesLeft && outBytes) + // copy bytes from input to the output + while (n) { - decompress->Input->Refill(decompress); - if (decompress->Input->Error) + if(n <= decompress->Output->WinSize - decompress->Output->WinPos) + outBytes = n; + else + outBytes = decompress->Output->WinSize - decompress->Output->WinPos; + + n -= outBytes; + while (outBytes) { - TRACE_E("inflate_stored: input error"); - return 4; + if (outBytes <= decompress->Input->BytesLeft) + inBytes = outBytes; + else + inBytes = decompress->Input->BytesLeft; + + memcpy(decompress->Output->SlideWin + decompress->Output->WinPos, + decompress->Input->NextByte, inBytes); + decompress->Input->NextByte += inBytes; + decompress->Input->BytesLeft -= inBytes; + decompress->Output->WinPos += inBytes; + outBytes -= inBytes; + if(!decompress->Input->BytesLeft && outBytes) + { + decompress->Input->Refill(decompress); + if (decompress->Input->Error) + { + TRACE_E("inflate_stored: input error"); + return 4; + } + } } - } - } - if(decompress->Output->WinPos == decompress->Output->WinSize) - { - if(decompress->Output->Flush(decompress->Output->WinPos, decompress)) - { - TRACE_E("inflate_stored: flush returned error"); - return 5; - } - decompress->Output->WinPos = 0; - } - }*/ + if(decompress->Output->WinPos == decompress->Output->WinSize) + { + if(decompress->Output->Flush(decompress->Output->WinPos, decompress)) + { + TRACE_E("inflate_stored: flush returned error"); + return 5; + } + decompress->Output->WinPos = 0; + } + }*/ // restore the globals from the locals BitBuf = b; // restore global bit buffer @@ -584,7 +585,7 @@ int inflate_fixed() } // distance table - for (i = 0; i < 30; i++) // make an incomplete code set + for (i = 0; i < 30; i++) // create an incomplete code set l[i] = 5; fixed_bd = 5; if ((i = huft_build(l, 30, 0, cpdist, cpdext, @@ -767,7 +768,7 @@ int inflate_dynamic() return i; } - /* free the decoding tables, return */ + /* free the decoding tables and return */ huft_free(tl); huft_free(td); return 0; @@ -818,15 +819,15 @@ int Inflate() int r; /* result code */ /* -#ifdef DEBUG - unsigned h = 0; // maximum struct huft's malloc'ed -#endif -*/ + #ifdef DEBUG + unsigned h = 0; // maximum number of allocated struct huft nodes + #endif + */ UCSize = 0; Crc = INIT_CRC; - /* initialize window, bit buffer */ + /* initialize the window and bit buffer */ WinPos = 0; BitCount = 0; BitBuf = 0; @@ -1034,7 +1035,7 @@ int huft_build(const unsigned* b, /* code lengths in bits (all assumed <= if ((unsigned)w + j > el && (unsigned)w < el) j = el - w; /* make EOB code end at table */ z = 1 << j; /* table entries for j-bit table */ - l[h] = j; /* set table size in stack */ + l[h] = j; /* save table size on the stack */ /* allocate and link in new table */ if ((q = (struct huft*)malloc((z + 1) * sizeof(struct huft))) == @@ -1088,11 +1089,11 @@ int huft_build(const unsigned* b, /* code lengths in bits (all assumed <= /* backup over finished tables */ while ((i & ((1 << w) - 1)) != x[h]) - w -= l[--h]; /* don't need to update q */ + w -= l[--h]; /* No need to update q. */ } } - /* return actual size of base table */ + /* Return the actual size of the base table */ *m = l[0]; /* Return true (1) if we were given an incomplete table */ From f702ab2a1a7a1b6f7c46f4304e2a5acc8fb929ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:39:20 +0200 Subject: [PATCH 531/710] [translation] Fix src/plugins/zip/zip2sfx/zip2sfx.cpp comments Refines translated comments in src/plugins/zip/zip2sfx/zip2sfx.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #810 for src/plugins/zip/zip2sfx/zip2sfx.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/zip/zip2sfx/zip2sfx.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/plugins/zip/zip2sfx/zip2sfx.cpp b/src/plugins/zip/zip2sfx/zip2sfx.cpp index 1ee8424d3..a5c10f9c6 100644 --- a/src/plugins/zip/zip2sfx/zip2sfx.cpp +++ b/src/plugins/zip/zip2sfx/zip2sfx.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" //#include @@ -188,10 +189,11 @@ DWORD SalGetFileAttributes(const char* fileName) { int fileNameLen = (int)strlen(fileName); char fileNameCopy[3 * MAX_PATH]; - // if the path ends with a trailing space or dot we must append '\\'; otherwise - // GetFileAttributes trims that character and works with a different path. - // The workaround still beats returning attributes of another file or directory - // (for "c:\\file.txt " it ends up working with "c:\\file.txt"). + // If the path ends with a space or dot, we must append '\\'; otherwise + // GetFileAttributes trims trailing spaces/dots and works with a different path. + // This does not work for files, but it is still better than getting attributes + // for a different file or directory (for "c:\\file.txt " it works with + // the name "c:\\file.txt"). if (fileNameLen > 0 && (fileName[fileNameLen - 1] <= ' ' || fileName[fileNameLen - 1] == '.') && fileNameLen + 1 < _countof(fileNameCopy)) { @@ -200,7 +202,7 @@ DWORD SalGetFileAttributes(const char* fileName) fileNameCopy[fileNameLen + 1] = 0; return GetFileAttributes(fileNameCopy); } - else // ordinary path, nothing special here, just call the Windows GetFileAttributes + else // ordinary path, nothing special to handle, just call Windows GetFileAttributes { return GetFileAttributes(fileName); } From b08bc537bebfadd19e1ef1c737c41263dd2d3fcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:42:15 +0200 Subject: [PATCH 532/710] [translation] Fix src/plugins/zip/zip2sfx/zip2sfx2.cpp comments Refines translated comments in src/plugins/zip/zip2sfx/zip2sfx2.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #811 for src/plugins/zip/zip2sfx/zip2sfx2.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/zip/zip2sfx/zip2sfx2.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/zip/zip2sfx/zip2sfx2.cpp b/src/plugins/zip/zip2sfx/zip2sfx2.cpp index aef27e397..8e6fd21a1 100644 --- a/src/plugins/zip/zip2sfx/zip2sfx2.cpp +++ b/src/plugins/zip/zip2sfx/zip2sfx2.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" //#include @@ -109,7 +110,7 @@ BOOL WriteSFXHeader() offs += ++l; header.ArchiveNameOffs = offs; //l = lstrlen(archName); - //ArchiveDataOffs += l; // we accounted for this earlier + //ArchiveDataOffs += l; // we did not account for this before //offs += ++l; offs++; header.TargetDirSpecOffs = offs; From 9bc9269f2ac83b52906ba71e3ee93c54e6ecd7da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:42:37 +0200 Subject: [PATCH 533/710] [translation] Fix src/plugins/zip/selfextr/comdefs.h comments Refines translated comments in src/plugins/zip/selfextr/comdefs.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #812 for src/plugins/zip/selfextr/comdefs.h, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/zip/selfextr/comdefs.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/zip/selfextr/comdefs.h b/src/plugins/zip/selfextr/comdefs.h index a2fa65d8b..4a3c419dc 100644 --- a/src/plugins/zip/selfextr/comdefs.h +++ b/src/plugins/zip/selfextr/comdefs.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED // WARNING: cannot be replaced by "#pragma once" because it is included from .rc file and it seems resource compiler does not support "#pragma once" #ifndef __COMDEFS_H @@ -17,7 +18,7 @@ typedef struct unsigned Flags; unsigned EOCentrDirOffs; unsigned ArchiveSize; //size of zip archive following this header - short CommandOffs; // length of the command line string following this structure, including the terminating '\0' + short CommandOffs; // offset of the command line string following this structure, including the terminating '\0' short TextOffs; short TitleOffs; short SubDirOffs; From bf234eda2b80b8d60ae35d0f3232d518c433f89f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:45:42 +0200 Subject: [PATCH 534/710] [translation] Fix src/plugins/zip/selfextr/dialog.cpp comments Refines translated comments in src/plugins/zip/selfextr/dialog.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #813 for src/plugins/zip/selfextr/dialog.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/zip/selfextr/dialog.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/zip/selfextr/dialog.cpp b/src/plugins/zip/selfextr/dialog.cpp index 35ea783d6..aa70150d3 100644 --- a/src/plugins/zip/selfextr/dialog.cpp +++ b/src/plugins/zip/selfextr/dialog.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include #include @@ -734,7 +735,7 @@ int CALLBACK DirectoryBrowse(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData) if (uMsg == BFFM_INITIALIZED) { SetWindowText(hwnd, StringTable[STR_BROWSEDIRTITLE]); - if (GetRootLen(TargetPath) < lstrlen(TargetPath)) // this is not a root directory + if (GetRootLen(TargetPath) < lstrlen(TargetPath)) // not the root directory PathRemoveBackslash(TargetPath); else PathAddBackslash(TargetPath); From f010d7a1963d9febb87ea1c9685dcdb54b449aa0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:48:26 +0200 Subject: [PATCH 535/710] [translation] Fix src/plugins/zip/selfextr/extended.cpp comments Refines translated comments in src/plugins/zip/selfextr/extended.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #814 for src/plugins/zip/selfextr/extended.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/zip/selfextr/extended.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/zip/selfextr/extended.cpp b/src/plugins/zip/selfextr/extended.cpp index a51f61a93..0fe7f7b04 100644 --- a/src/plugins/zip/selfextr/extended.cpp +++ b/src/plugins/zip/selfextr/extended.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include #include @@ -462,7 +463,7 @@ int decrypt_byte() #define CRC32(c, b) (CrcTab[((int)(c) ^ (b)) & 0xff] ^ ((c) >> 8)) -//Update the encryption keys with the next byte of plain text +// Update the encryption keys with the next byte of plaintext int update_keys(int c) { Keys[0] = CRC32(Keys[0], c); From 8f8cb8ff3e2ef3c6ce45459e7634071ee841901b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:49:05 +0200 Subject: [PATCH 536/710] [translation] Fix src/plugins/zip/selfextr/extract.cpp comments Refines translated comments in src/plugins/zip/selfextr/extract.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #815 for src/plugins/zip/selfextr/extract.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/zip/selfextr/extract.cpp | 33 ++++++++++++++-------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/src/plugins/zip/selfextr/extract.cpp b/src/plugins/zip/selfextr/extract.cpp index d91b9cf6c..495dab0db 100644 --- a/src/plugins/zip/selfextr/extract.cpp +++ b/src/plugins/zip/selfextr/extract.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include @@ -211,7 +212,7 @@ BOOL PathMerge(char* fullPath, const char* relativePath) const char* sour = relativePath; PathAddBackslash(fullPath); - if (relativePath[0] == '\\') //UNC or relative to root dir + if (relativePath[0] == '\\') // UNC or relative to the root directory { if (relativePath[1] == '\\') *fullPath = 0; //UNC @@ -280,8 +281,8 @@ void i64toa(__int64 val, char* buf) *p++ = (char)(digval + '0'); /* a digit */ } while (val > 0); - /* We now have the digit of the number in the buffer, but in reverse - order. Thus we reverse them now. */ + /* The digits of the number are now in the buffer, but in reverse order. + Thus we reverse them now. */ *p-- = '\0'; /* terminate string; p points to last digit */ @@ -383,7 +384,7 @@ int GetName(CFileHeader* header, char* name) else *dest++ = *sour++; } - if (*(dest - 1) == '\\') //remove last slash if name specifies a directory + if (*(dest - 1) == '\\') // Remove the trailing slash if the name specifies a directory dest--; *dest = 0; if (header->Version >> 8 == HS_FAT || @@ -532,7 +533,7 @@ DWORD SalGetFileAttributes(const char* fileName) fileNameCopy[fileNameLen + 1] = 0; return GetFileAttributes(fileNameCopy); } - else // ordinary path, nothing special here, just call the Windows GetFileAttributes + else // regular path; nothing special to handle, just call Windows GetFileAttributes { return GetFileAttributes(fileName); } @@ -647,7 +648,7 @@ HANDLE SafeCreateFile(char* name, DWORD attr, FILETIME* time, unsigned size) int SafeWrite(HANDLE file, const unsigned char* buffer, unsigned size) { - unsigned long bytesWritten; //number of butes read by ReadFile() + unsigned long bytesWritten; // number of bytes written by WriteFile() bool retry; unsigned filePos; LONG dummy; @@ -698,15 +699,15 @@ void MakeCrcTable() const __UINT32 poly = 0xedb88320L; //polynomial exclusive-or pattern /* - //generate crc polonomial, using precomputed poly should be faster - // terms of polynomial defining this crc (except x^32): - static const Byte p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26}; - - // make exclusive-or pattern from polynomial (0xedb88320L) - poly = 0L; - for (n = 0; n < sizeof(p)/sizeof(Byte); n++) - poly |= 1L << (31 - p[n]); -*/ + // generate CRC polynomial; using a precomputed poly should be faster + // terms of the polynomial defining this CRC (except x^32): + static const Byte p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26}; + + // make exclusive-or pattern from polynomial (0xedb88320L) + poly = 0L; + for (n = 0; n < sizeof(p)/sizeof(Byte); n++) + poly |= 1L << (31 - p[n]); + */ for (n = 0; n < 256; n++) { c = (__UINT32)n; @@ -988,7 +989,7 @@ int Extract() { //ExtractedFiles++; should we count directories as files in the result as well? OutFile = INVALID_HANDLE_VALUE; - ok = true; //don't erase the file + ok = true; // do not delete the file goto next; } if (OutFile == INVALID_HANDLE_VALUE) From 61eb24dd614d6a741b8eef5a6ac96b6a9da2e9cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:49:26 +0200 Subject: [PATCH 537/710] [translation] Fix src/plugins/zip/selfextr/inflate.cpp comments Refines translated comments in src/plugins/zip/selfextr/inflate.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #816 for src/plugins/zip/selfextr/inflate.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/zip/selfextr/inflate.cpp | 142 +++++++++++++-------------- 1 file changed, 71 insertions(+), 71 deletions(-) diff --git a/src/plugins/zip/selfextr/inflate.cpp b/src/plugins/zip/selfextr/inflate.cpp index f66d03f59..7857d8187 100644 --- a/src/plugins/zip/selfextr/inflate.cpp +++ b/src/plugins/zip/selfextr/inflate.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include @@ -15,7 +16,7 @@ unsigned long BitBuf; unsigned BitCount; unsigned WinPos; unsigned char SlideWin[WSIZE]; -struct huft* fixed_tl = NULL; // !! must be NULL initialized +struct huft* fixed_tl = NULL; // must be initialized to NULL struct huft* fixed_td; //before calling inflate int fixed_bl, fixed_bd; @@ -26,7 +27,7 @@ unsigned char* InEnd; version 1.0b, August 1999 based on file inflate.c distributed with infozip, - writen by Mark Adler + written by Mark Adler version c16b, 29 March 1998 */ /* @@ -94,7 +95,7 @@ unsigned char* InEnd; end-of-block. Note however that the static length tree defines 288 codes just to fill out the Huffman codes. Codes 286 and 287 cannot be used though, since there is no length base or extra bits - defined for them. Similarily, there are up to 30 distance codes. + defined for them. Similarly, there are up to 30 distance codes. However, static trees define 32 codes (all 5 bits) to fill out the Huffman codes, but the last two had better not show up in the data. 7. Unzip can check dynamic Huffman blocks for complete code sets. @@ -152,7 +153,7 @@ int huft_build(const unsigned* b, /* code lengths in bits (all assumed <= circular buffer. The index is updated simply by incrementing and then and'ing with 0x7fff (32K-1) (window size - 1). */ // sliding window is defined in CDecompressionObject and could be -// any size greater or equal 32K +// any size greater than or equal to 32K /* Tables for deflate from PKZIP's appnote.txt. */ static const unsigned border[] = {/* Order of the bit length code lengths */ @@ -189,7 +190,7 @@ const unsigned short mask_bits[] = { where NEEDBITS makes sure that b has at least j bits in it, and DUMPBITS removes the bits from b. The macros use the variable k for the number of bits in b. Normally, b and k are register - variables for speed and are initialized at the begining of a + variables for speed and are initialized at the beginning of a routine that uses these macros from a global bit buffer and count. In order to not ask for more bits than there are in the compressed @@ -271,7 +272,7 @@ unsigned long NextByte() the longer codes. The time it costs to decode the longer codes is then traded against the time it takes to make longer tables. - This results of this trade are in the variables lbits and dbits + The results of this tradeoff are reflected in the variables lbits and dbits below. lbits is the number of bits the first level table for literal/ length codes can decode in one step, and dbits is the same thing for the distance codes. Subsequent tables are also less than or equal to @@ -288,7 +289,7 @@ unsigned long NextByte() than five bits, flat. The optimum values for speed end up being about one bit more than those, so lbits is 8+1 and dbits is 5+1. The optimum values may differ though from machine to machine, and - possibly even between compilers. Your mileage may vary. + possibly even between compilers. */ static const int lbits = 9; /* bits in base literal/length lookup table */ @@ -296,10 +297,10 @@ static const int dbits = 6; /* bits in base distance lookup table */ #ifndef ASM_INFLATECODES -/* inflate (decompress) the codes in a deflated (compressed) block. - Return an error code or zero if it all goes ok. */ -int inflate_codes(struct huft* tl, //literal/length - struct huft* td, //distance decoder tables +/* Inflate (decompress) the codes in a deflated (compressed) block. + Returns an error code, or zero on success. */ +int inflate_codes(struct huft* tl, /* literal/length decoder table */ + struct huft* td, // distance decoder table int bl, int bd) //number of bits decoded by tl[] and td[] { register unsigned e; /* table entry flag/number of extra bits */ @@ -318,7 +319,7 @@ int inflate_codes(struct huft* tl, //literal/length /* inflate the coded data */ ml = mask_bits[bl]; /* precompute masks for speed */ md = mask_bits[bd]; - while (1) /* do until end of block */ + while (1) /* loop until end of block */ { NEEDBITS((unsigned)bl) if ((e = (t = tl + ((unsigned)b & ml))->e) > 16) @@ -388,7 +389,7 @@ int inflate_codes(struct huft* tl, //literal/length w += e; d += e; } - else /* do it slowly to avoid memcpy() overlap */ + else /* do it slowly to avoid MemCpy() overlap */ #endif /* !NOMEMCPY */ do { @@ -446,8 +447,8 @@ int inflate_stored() return 1; // error in compressed data DUMPBITS(16) - ///* old copy routine, the new should be faster (I hope so) - // read and output the compressed data + ///* old copy routine; the new one should be faster + // copy the stored data to the output while (n--) { NEEDBITS(8) @@ -467,49 +468,49 @@ int inflate_stored() } /* - //copy bytes from intup to the output - while (n) - { - if(n <= decompress->Output->WinSize - decompress->Output->WinPos) - outBytes = n; - else - outBytes = decompress->Output->WinSize - decompress->Output->WinPos; - - n -= outBytes; - while (outBytes) - { - if (outBytes <= decompress->Input->BytesLeft) - inBytes = outBytes; - else - inBytes = decompress->Input->BytesLeft; - - memcpy(decompress->Output->SlideWin + decompress->Output->WinPos, - decompress->Input->NextByte, inBytes); - decompress->Input->NextByte += inBytes; - decompress->Input->BytesLeft -= inBytes; - decompress->Output->WinPos += inBytes; - outBytes -= inBytes; - if(!decompress->Input->BytesLeft && outBytes) + // Copy bytes from input to the output + while (n) { - decompress->Input->Refill(decompress); - if (decompress->Input->Error) + if(n <= decompress->Output->WinSize - decompress->Output->WinPos) + outBytes = n; + else + outBytes = decompress->Output->WinSize - decompress->Output->WinPos; + + n -= outBytes; + while (outBytes) { - TRACE_E("inflate_stored: input error"); - return 4; + if (outBytes <= decompress->Input->BytesLeft) + inBytes = outBytes; + else + inBytes = decompress->Input->BytesLeft; + + memcpy(decompress->Output->SlideWin + decompress->Output->WinPos, + decompress->Input->NextByte, inBytes); + decompress->Input->NextByte += inBytes; + decompress->Input->BytesLeft -= inBytes; + decompress->Output->WinPos += inBytes; + outBytes -= inBytes; + if(!decompress->Input->BytesLeft && outBytes) + { + decompress->Input->Refill(decompress); + if (decompress->Input->Error) + { + TRACE_E("inflate_stored: input error"); + return 4; + } + } } - } - } - if(decompress->Output->WinPos == decompress->Output->WinSize) - { - if(decompress->Output->Flush(decompress->Output->WinPos, decompress)) - { - TRACE_E("inflate_stored: flush returned error"); - return 5; - } - decompress->Output->WinPos = 0; - } - }*/ + if(decompress->Output->WinPos == decompress->Output->WinSize) + { + if(decompress->Output->Flush(decompress->Output->WinPos, decompress)) + { + TRACE_E("inflate_stored: flush returned error"); + return 5; + } + decompress->Output->WinPos = 0; + } + }*/ // restore the globals from the locals BitBuf = b; // restore global bit buffer @@ -518,9 +519,8 @@ int inflate_stored() return 0; } -// decompress an inflated type 1 (fixed Huffman codes) block. We should -// either replace this with a custom decoder, or at least precompute the -// Huffman tables. +// decompress an inflated type 1 (fixed Huffman codes) block. Either replace +// this with a custom decoder or at least precompute the Huffman tables. int inflate_fixed() { // if first time, set up tables for fixed blocks @@ -618,7 +618,7 @@ int inflate_dynamic() for (; j < 19; j++) ll[border[j]] = 0; - /* build decoding table for trees--single level, 7 bit lookup */ + /* build a decoding table for the trees: single-level, 7-bit lookup */ bl = 7; i = huft_build(ll, 19, 19, NULL, NULL, &tl, &bl); if (bl == 0) /* no bit lengths */ @@ -781,10 +781,10 @@ int Inflate() int r; /* result code */ /* -#ifdef DEBUG - unsigned h = 0; // maximum struct huft's malloc'ed -#endif -*/ + #ifdef DEBUG + unsigned h = 0; // maximum number of allocated struct huft's + #endif + */ /* initialize window, bit buffer */ WinPos = 0; @@ -838,8 +838,8 @@ int FreeFixedHufman() } /* - * GRR: moved huft_build() and huft_free() down here; used by explode() - * and fUnZip regardless of whether USE_ZLIB defined or not + * moved huft_build() and huft_free() down here; used by explode() + * and fUnZip regardless of whether USE_ZLIB is defined */ /* If BMAX needs to be larger than 16, then h and x[] should be unsigned long. */ @@ -946,7 +946,7 @@ int huft_build(const unsigned* b, /* code lengths in bits (all assumed <= if ((j = *p++) != 0) v[x[j]++] = i; } while (++i < n); - n = x[g]; /* set n to length of v */ + n = x[g]; /* set n to the length of v */ /* Generate the Huffman codes and for each, make the table entries */ x[0] = i = 0; /* first Huffman code is zero */ @@ -979,15 +979,15 @@ int huft_build(const unsigned* b, /* code lengths in bits (all assumed <= { if ((f <<= 1) <= *++xp) break; /* enough codes to use up j bits */ - f -= *xp; /* else deduct codes from patterns */ + f -= *xp; /* otherwise deduct codes from the remaining patterns */ } } if ((unsigned)w + j > el && (unsigned)w < el) j = el - w; /* make EOB code end at table */ z = 1 << j; /* table entries for j-bit table */ - l[h] = j; /* set table size in stack */ + l[h] = j; /* store table size in stack */ - /* allocate and link in new table */ + /* allocate and link a new table */ if ((q = (struct huft*)HeapAlloc(Heap, 0, (z + 1) * sizeof(struct huft))) == (struct huft*)NULL) { @@ -1012,7 +1012,7 @@ int huft_build(const unsigned* b, /* code lengths in bits (all assumed <= } } - /* set up table entry in r */ + /* set up the table entry in r */ r.b = (unsigned char)(k - w); if (p >= v + n) r.e = 99; /* out of values--invalid code */ @@ -1050,8 +1050,8 @@ int huft_build(const unsigned* b, /* code lengths in bits (all assumed <= return y != 0 && g != 1; } -/* Free the malloc'ed tables built by huft_build(), which makes a linked - list of the tables it made, with the links in a dummy first entry of +/* Free the tables allocated by huft_build(), which makes a linked + list of the tables it created, with the links in a dummy first entry of each table. */ int huft_free(struct huft* t) // t /* table to free */ From 01f8c018a758e70723a7ab9b0071197ed8db3727 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:49:48 +0200 Subject: [PATCH 538/710] [translation] Fix src/plugins/zip/selfextr/language/czech/texts.h comments Refines translated comments in src/plugins/zip/selfextr/language/czech/texts.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #817 for src/plugins/zip/selfextr/language/czech/texts.h, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/zip/selfextr/language/czech/texts.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/zip/selfextr/language/czech/texts.h b/src/plugins/zip/selfextr/language/czech/texts.h index fd4dc96fb..0a993dc14 100644 --- a/src/plugins/zip/selfextr/language/czech/texts.h +++ b/src/plugins/zip/selfextr/language/czech/texts.h @@ -1,7 +1,8 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED -// text.h - english version +// text.h - Czech version STRING(STR_TITLE, "Samorozbalitelný ZIP archiv") STRING(STR_ERROR, "Chyba") From b91b751a8ed38017fecb1681783065bf493b11c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:50:11 +0200 Subject: [PATCH 539/710] [translation] Fix src/plugins/zip/selfextr/selfextr.cpp comments Refines translated comments in src/plugins/zip/selfextr/selfextr.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #818 for src/plugins/zip/selfextr/selfextr.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/zip/selfextr/selfextr.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/plugins/zip/selfextr/selfextr.cpp b/src/plugins/zip/selfextr/selfextr.cpp index e213496f3..b10178551 100644 --- a/src/plugins/zip/selfextr/selfextr.cpp +++ b/src/plugins/zip/selfextr/selfextr.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include @@ -228,7 +229,7 @@ LONG SalRegQueryValueEx(HKEY hKey, LPCSTR lpValueName, LPDWORD lpReserved, lpcbData != NULL && (ret == ERROR_MORE_DATA || lpData == NULL && ret == ERROR_SUCCESS)) { - (*lpcbData) += type == REG_MULTI_SZ ? 2 : 1; // request extra space for a possible null terminator + (*lpcbData) += type == REG_MULTI_SZ ? 2 : 1; // request extra space for a possible extra null terminator(s) return ret; } if (ret == ERROR_SUCCESS && lpData != NULL) @@ -242,7 +243,7 @@ LONG SalRegQueryValueEx(HKEY hKey, LPCSTR lpValueName, LPDWORD lpReserved, } else // not enough space for the null terminator in the buffer { - (*lpcbData) += type == REG_MULTI_SZ ? 2 : 1; // request the necessary null terminator + (*lpcbData) += type == REG_MULTI_SZ ? 2 : 1; // account for the required null terminator(s) return ERROR_MORE_DATA; } } @@ -255,7 +256,7 @@ LONG SalRegQueryValueEx(HKEY hKey, LPCSTR lpValueName, LPDWORD lpReserved, } else // not enough room for the second null terminator in the buffer { - (*lpcbData)++; // request the required null terminator + (*lpcbData)++; // request space for the required null terminator return ERROR_MORE_DATA; } } @@ -332,7 +333,7 @@ int InitExtraction(const char* name) direntries = *(unsigned long*)(ptr + 20 + 23 * 4); // number of dir entries for (section = *(unsigned short*)(ptr + 2) - 1; section >= 0; section--) { - offset += *(unsigned long*)(ptr + 20 + 24 * 4 + direntries * 8 + section * 10 * 4 + 4 * 4); // size of section + offset += *(unsigned long*)(ptr + 20 + 24 * 4 + direntries * 8 + section * 10 * 4 + 4 * 4); // section size } //test header consistence ArchiveStart = (CSelfExtrHeader*)(ArchiveBase + offset); @@ -373,7 +374,7 @@ int InitExtraction(const char* name) #ifdef EXT_VER bool b = TargetPath[0] == 0; - if (b) //temp path specified on commandline + if (b) // temp path specified on the command line #endif //EXT_VER if (GetTempPath(MAX_PATH, TargetPath) == 0) return HandleError(STR_ERROR_TEMPPATH, GetLastError()); @@ -667,7 +668,7 @@ int MyWinMain() } */ - // finally show the message box + // show the message box if (ArchiveStart->MBoxStyle != -1) { int r = (int)ArchiveStart->MBoxStyle < 0 ? DialogBox(HInstance, MAKEINTRESOURCE(IDD_LONGMESSAGE), NULL, LongMessageDlgProc) : MessageBox(NULL, (char*)ArchiveStart + ArchiveStart->MBoxTextOffs, (char*)ArchiveStart + ArchiveStart->MBoxTitleOffs, ArchiveStart->MBoxStyle); From ed7ae81fdb47c002d98ae2a5e47c6fe0c3b33c97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:50:32 +0200 Subject: [PATCH 540/710] [translation] Fix src/plugins/zip/add.cpp comments Refines translated comments in src/plugins/zip/add.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #819 for src/plugins/zip/add.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/zip/add.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/plugins/zip/add.cpp b/src/plugins/zip/add.cpp index 3fb169372..0174ae2aa 100644 --- a/src/plugins/zip/add.cpp +++ b/src/plugins/zip/add.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" #include @@ -130,7 +131,7 @@ int CZipPack::PackNormal(SalEnumSelection2 next, void* param) ProgressTotalSize += CQuadWord().SetUI64(DelFiles[0]->LocHeaderOffs); } else if (Config.BackupZip) - ProgressTotalSize = CQuadWord().SetUI64(CentrDirOffs); //size of backuped file + ProgressTotalSize = CQuadWord().SetUI64(CentrDirOffs); // size of the backed-up file else ProgressTotalSize = CQuadWord(0, 0); ProgressTotalSize += AddTotalSize + CQuadWord(addCount, 0); @@ -141,7 +142,7 @@ int CZipPack::PackNormal(SalEnumSelection2 next, void* param) if (ErrorID && !Config.BackupZip && !ZeroZip) Recover(); } - else //backup zip + else // back up ZIP if (Config.BackupZip) ErrorID = BackupZip(); if (!ErrorID && !UserBreak) @@ -651,14 +652,14 @@ int CZipPack::ExportLocalHeader(CFileInfo* fileInfo, char* buffer) else { localHeader->CompSize = 0xFFFFFFFF; - Zip64Size = 8 + 8; // In Local Header, both Size and CompSize must be present, if any + Zip64Size = 8 + 8; // In the local header, both Size and CompSize must be present if either is. } if (fileInfo->Size < 0xFFFFFFFF) localHeader->Size = (__UINT32)fileInfo->Size; else { localHeader->Size = 0xFFFFFFFF; - Zip64Size = 8 + 8; // In Local Header, both Size and CompSize must be present, if any + Zip64Size = 8 + 8; // In the local header, both Size and CompSize must be present, if either is present } localHeader->NameLen = ExportName(buffer + sizeof(CLocalFileHeader), fileInfo); localHeader->ExtraLen = 0; @@ -1129,7 +1130,7 @@ int CZipPack::MatchFiles(int& count) } lstrcpy(destName, next->Name + SourceLen + 1); destLen = RootLen + next->NameLen - SourceLen - (RootLen ? 0 : 1); - if (next->Action == AF_NOADD && next->IsDir) // this may already apply to directories; files are skipped above + if (next->Action == AF_NOADD && next->IsDir) // this can already apply to directories; files are skipped above if (Move) { if (inZipLen >= destLen && @@ -1342,9 +1343,9 @@ int WriteOutput(char* buffer, unsigned size, void* user) CZipPack* pack = (CZipPack*)user; int error = 0; - // Note: The compressed output slightly grows if buffer content is modified here anyhow (e.g. memset) - // I don't know why, looks like a bug in the compressor? - // NOTE: The file still gets successfully decompressed even then... + // Note: The compressed output grows slightly if the buffer content is modified here (e.g. by memset). + // The cause is unknown; this appears to be a compressor bug. + // NOTE: The file can still be decompressed successfully afterward. if (pack->Options.Encrypt) if (pack->AESContextValid) SalamanderCrypt->AESEncrypt(&pack->AESContext, buffer, size); @@ -1521,7 +1522,7 @@ int CZipPack::PackFiles() { ret = CreateCFile(&SourFile, next->Name, GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, 0, &SkipAllIOErrors, - // Do not allow files over 4GB in SFX files, the SFX module probably doesn't support them + // Do not allow files over 4 GB in SFX files; the SFX module probably does not support them (Options.Action & PA_SELFEXTRACT) ? false : true, false); if (ret) { @@ -1571,9 +1572,9 @@ int CZipPack::PackFiles() next->Flag |= GPF_ENCRYPTED | GPF_DATADESCR; // NOTE: Patera 2008.12.03: This FAST/SLOW flag is normally set in CDeflate::lm_init() - // in deflate.cpp. But in case of encrypted files LocalHeder is written before lm_init() gets called. - // IMHO it would be cleaner to do the same as with non-encrypted files. - // WinZIP 12.0 complains about different GPF flags in loc & central headers otherwise. + // in deflate.cpp. But for encrypted files, the local header is written before lm_init() is called. + // It would be cleaner to do the same as for non-encrypted files. + // Otherwise WinZIP 12.0 complains about different GPF flags in the local and central headers. if (Config.Level <= 2) { next->Flag |= FAST; @@ -1960,7 +1961,7 @@ int CZipPack::IsDirectoryEmpty(const char* name) if (search == INVALID_HANDLE_VALUE) { ProcessError(IDS_ERRACCESDIR, GetLastError(), name, PE_NORETRY | PE_NOSKIP, NULL); - return 1; //like an empty directory + return 1; // treat as an empty directory } ret = TRUE; do From b26e3a747240b12998af9b64ba90b31cf9dc64aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:50:54 +0200 Subject: [PATCH 541/710] [translation] Fix src/plugins/zip/bits.cpp comments Refines translated comments in src/plugins/zip/bits.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #820 for src/plugins/zip/bits.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/zip/bits.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/plugins/zip/bits.cpp b/src/plugins/zip/bits.cpp index 437a096f6..3ed8a81f1 100644 --- a/src/plugins/zip/bits.cpp +++ b/src/plugins/zip/bits.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" #include @@ -146,8 +147,8 @@ void CDeflate::bi_init() /* output zip file, NULL for in-memory compression */ void CDeflate::send_bits(int value, /* value to send */ int length) /* number of bits */ { - /* If not enough room in bi_buf, use (valid) bits from bi_buf and - * (16 - bi_valid) bits from value, leaving (width - (16-bi_valid)) + /* If there is not enough room in bi_buf, use the valid bits in bi_buf and + * (16 - bi_valid) bits from value, leaving (length - (16 - bi_valid)) * unused bits in value. */ if (bi_valid > (int)Buf_size - length) @@ -165,11 +166,11 @@ void CDeflate::send_bits(int value, /* value to send */ } /* =========================================================================== - * Reverse the first len bits of a code, using straightforward code (a faster - * method would use a table) - * IN assertion: 1 <= len <= 15 + * Reverse the first len bits of a code using straightforward code (a faster + * method would use a table). + * Assertion: 1 <= len <= 15 */ -unsigned CDeflate::bi_reverse(unsigned code, /* the value to invert */ +unsigned CDeflate::bi_reverse(unsigned code, /* value to reverse */ int len) /* its bit length */ { unsigned res = 0; From aecdf6208440671de628f8a190d0104d79cc973c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:51:16 +0200 Subject: [PATCH 542/710] [translation] Fix src/plugins/zip/chicon.cpp comments Refines translated comments in src/plugins/zip/chicon.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #821 for src/plugins/zip/chicon.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/zip/chicon.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/zip/chicon.cpp b/src/plugins/zip/chicon.cpp index ac4ac9253..920b522ff 100644 --- a/src/plugins/zip/chicon.cpp +++ b/src/plugins/zip/chicon.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" #include @@ -93,7 +94,7 @@ BOOL HasExtension(const char* filename, const char* extension) { CALL_STACK_MESSAGE_NONE const char* dot = strrchr(filename, '.'); - if (dot != NULL) // ".cvspass" is extension in Windows + if (dot != NULL) // ".cvspass" is an extension in Windows { if (lstrcmpi(++dot, extension) == 0) return TRUE; @@ -189,7 +190,7 @@ CIcon* LoadIconsFromDirectory(HINSTANCE module, LPICONDIR directory, BOOL isIco) if (isIco) icons[i].lpData = LoadIconDataFromICO((HANDLE)module, directory->idEntries[i].dwImageOffset, directory->idEntries[i].dwBytesInRes); else - icons[i].lpData = LoadIconDataFromEXE(module, directory->idEntries[i].dwImageOffset /*it is ID*/); + icons[i].lpData = LoadIconDataFromEXE(module, directory->idEntries[i].dwImageOffset /* ID */); if (!icons[i].lpData) { DestroyIcons(icons, i); From 7ec126bac294076e8379354808e18f8793efd5e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:51:38 +0200 Subject: [PATCH 543/710] [translation] Fix src/plugins/zip/common.cpp comments Refines translated comments in src/plugins/zip/common.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #822 for src/plugins/zip/common.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/zip/common.cpp | 53 +++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/src/plugins/zip/common.cpp b/src/plugins/zip/common.cpp index 4d2b44655..5e272014a 100644 --- a/src/plugins/zip/common.cpp +++ b/src/plugins/zip/common.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" #include @@ -41,13 +42,13 @@ const CConfiguration DefConfig = { 6, // Compression level EM_ZIP20, // Encryption Method - false, //don't add empty directories to zip + false, // Do not add empty directories to the ZIP archive. true, //create temporary backup of zip true, //display exteded pack options dialog false, //set zip file time to the newest file time {"1423", {0}, {0}, {0}, {0}}, //volume sizes {0, 0, 0, 0, 0}, //volume size units - true, //automatic volume size last used + true, // whether automatic volume size was used last time false, //automatically expand multi-volume archives on non-removable disks 0, //config version (0 - default; 1 - beta 3; 2 - beta 4) "english.sfx", //default sfx package @@ -57,8 +58,8 @@ const CConfiguration DefConfig = TRUE, // winzip compatible multi-volume archive names // Custom columns: TRUE, // Show custom column Packed Size - 0, // LO/HI-WORD: left/right panel: Width for Packed Size column - 0 // LO/HI-WORD: left/right panel: FixedWidth for Packed Size column + 0, // LOWORD/HIWORD: left/right panel width for the Packed Size column + 0 // LO/HI-WORD: fixed width of the Packed Size column in the left/right panel }; const CExtendedOptions DefOptions; @@ -76,7 +77,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { DLLInstance = hinstDLL; } - return TRUE; // DLL can be loaded + return TRUE; // Allow the DLL to load } #endif //SSZIP @@ -322,12 +323,12 @@ int CZipCommon::CheckZip() int CZipCommon::Read(CFile* file, void* buffer, unsigned bytesToRead, unsigned* bytesRead, bool* skipAll) { - CALL_STACK_MESSAGE_NONE // time-critical method + CALL_STACK_MESSAGE_NONE // performance-critical method // CALL_STACK_MESSAGE3("CZipCommon::Read(, , 0x%X, , ) file: %s", bytesToRead, file->FileName); unsigned long read; //number of butes read by ReadFile() unsigned long toRead; //number of butes read by ReadFile() int result; //temp variable - int errorID; //error string identifier + int errorID; // error message identifier int lastError; //value returned by GetLastError() if (file->Size > file->FilePointer) @@ -351,7 +352,7 @@ int CZipCommon::Read(CFile* file, void* buffer, unsigned bytesToRead, file->FilePointer + toRead <= file->RealFilePointer + file->BufferPosition) { int offset = int(file->FilePointer - file->RealFilePointer); - // if the requested data are entirely in the buffer, just copy them + // if the requested data are fully in the buffer, just copy them memcpy(buffer, file->InputBuffer + offset, toRead); file->FilePointer += toRead; if (bytesRead) @@ -667,7 +668,7 @@ int CZipCommon::ProcessError(int errorID, int lastError, const char* fileName, if (skipAll && *skipAll) exitCode = ERR_SKIP; else - { //process error and display proper dialog + { // Process the error and display the appropriate dialog if (lastError) { char lastErrorBuf[1024]; //temp variable @@ -692,7 +693,7 @@ int CZipCommon::ProcessError(int errorID, int lastError, const char* fileName, if (flags & PE_QUIET) result = DIALOG_CANCEL; - else //display dialog + else // display the dialog if (flags & PE_NORETRY) if (flags & PE_NOSKIP) { @@ -862,7 +863,7 @@ int CZipCommon::FindEOCentrDirSig(BOOL* success) break; } } - position -= bufSize - 3; //tree overlapping bytes + position -= bufSize - 3; //three overlapping bytes i--; } if (!error && !found && position + 64 * 1024 + 22 >= ZipFile->Size) @@ -908,8 +909,8 @@ int CZipCommon::FindEOCentrDirSig(BOOL* success) break; } ZipFile->FilePointer = EOCentrDirOffs + sizeof(CEOCentrDirRecord); - // skipAll=true prevents Read showing EOF error. We show a better - // error ourselves immediatelly + // skipAll=true prevents Read from showing an EOF error. We show a better + // error ourselves immediately bool skipAll = true; if (Read(ZipFile, Comment, EOCentrDir.CommentLen, NULL, &skipAll)) { @@ -1078,11 +1079,11 @@ int CZipCommon::FindZip64EOCentrDirLocator() Zip64 = true; if (zip64Record.DiskNum < 0xFFFF) { - // we keep this value unfixed so we can later recognize a weird ZIP file - // and refuse its modification, so far we have encountered a single file - // like this and we had trouble with deleting files inside the archive, - // which ended with the corrupted archive data) - // TODO save manison.zip to some repository for the weird ZIPs and put a correct reference here + // we keep this value unchanged so we can later recognize a weird ZIP file + // and refuse to modify it; so far we have encountered only one file + // like this, and deleting files inside the archive caused + // the archive data to become corrupted + // TODO: save manison.zip in a repository of weird ZIPs and add a correct reference here //EOCentrDir.DiskNum = __UINT16(zip64Record.DiskNum); } if (EOCentrDir.StartDisk == 0xFFFF) @@ -1130,7 +1131,7 @@ int CZipCommon::CheckForExtraBytes() ExtraBytes = 0; - // do not check for extra bytes - too much work for little benefit + // extra bytes are not checked: too much work for little benefit if (MultiVol) return 0; @@ -1473,7 +1474,7 @@ int CZipCommon::ProcessName(CFileHeader* fileHeader, char* outputName) *dest++ = *sour++; } } - if (dest > outputName && *(dest - 1) == '\\') //skip last slash if name specifies a directory + if (dest > outputName && *(dest - 1) == '\\') // Skip the trailing slash if the name specifies a directory { dest--; // set the directory attribute; some archivers do not set attributes @@ -1492,7 +1493,7 @@ int CZipCommon::ProcessName(CFileHeader* fileHeader, char* outputName) if (!(fileHeader->Flag & GPF_UTF8) && ((fileHeader->Version >> 8 == HS_FAT /*0*/) || (fileHeader->Version >> 8 == HS_HPFS /*6*/) || // ((fileHeader->Version >> 8 == HS_NTFS/*11*/) && ((fileHeader->Version & 0x0F) == 0x50)) // Patera 2010.03.30: This doesn't make sense -> disabled - // The following line got inspiration in MultiArc plugin of FAR + // The following line was inspired by the MultiArc plugin for FAR ((fileHeader->Version >> 8 == HS_NTFS /*11*/) && (((fileHeader->Version & 0xFF) <= 20) || ((fileHeader->Version & 0xFF) >= 25))))) // ZIP built-in to WinXP writes Version 0x0b14 and uses OEM // AS writes version 0x0016 and uses OEM @@ -1746,7 +1747,7 @@ void QuickSortNames(int left, int right, TIndirectArray2& names, bool } } while (i <= j); // do they have to match? - // the following "nice" code was replaced with code that saves a lot of stack (max. log(N) recursion depth) + // the following "nice" code was replaced with code that uses significantly less stack space (max. log(N) recursion depth) // if (left < j) QuickSortNames(left, j, names, unix); // if (i < right) QuickSortNames(i, right, names, unix); @@ -1792,7 +1793,7 @@ bool BSearchName(LPCTSTR name, int ItemNumber, int left, int right, TIndirectArr { mid = (left + right) >> 1; c = respectCase ? _tcscmp(name, names[mid]->Name) : SalamanderGeneral->StrICmp(name, names[mid]->Name); - // Files are matched only when the ItemNumber also matches + // Files match only when ItemNumber matches or either ItemNumber is -1 if (c == 0) { if ((ItemNumber == names[mid]->ItemNumber) || (-1 == names[mid]->ItemNumber) || (-1 == ItemNumber)) @@ -1849,7 +1850,7 @@ int CZipCommon::MatchFiles(TIndirectArray2& files, TIndirectArray2 CentrDirSize || @@ -1930,7 +1931,7 @@ int CZipCommon::MatchFiles(TIndirectArray2& files, TIndirectArray2CompSize); else MatchedTotalSize += CQuadWord().SetUI64(fileInfo->Size); @@ -2537,7 +2538,7 @@ BOOL PathAppend(LPTSTR pPath, LPCTSTR pMore) return TRUE; } int len = lstrlen(pPath); - // trim the trailing backslash before appending + // add a backslash before appending if (len > 1 && pPath[len - 1] != '\\' && pMore[0] != '\\') { pPath[len] = '\\'; From 012b5bd8bf8e57cfd9d0f6a7890d4551fc8a11f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:52:00 +0200 Subject: [PATCH 544/710] [translation] Fix src/plugins/zip/common.h comments Refines translated comments in src/plugins/zip/common.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #823 for src/plugins/zip/common.h, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/zip/common.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/zip/common.h b/src/plugins/zip/common.h index 62c1bffbd..976d93c39 100644 --- a/src/plugins/zip/common.h +++ b/src/plugins/zip/common.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once @@ -163,7 +164,7 @@ class CZipCommon int RootLen; //length of ZipRoot bool ZeroZip; QWORD EOCentrDirOffs; //offset of end of central directory record - QWORD Zip64EOCentrDirOffs; //offset of zip 64 end of central directory record + QWORD Zip64EOCentrDirOffs; //offset of Zip64 end of central directory record CEOCentrDirRecordEx EOCentrDir; //end of central directory record QWORD CentrDirSize; QWORD CentrDirOffs; @@ -173,7 +174,7 @@ class CZipCommon QWORD ExtraBytes; CSalamanderForOperationsAbstract* Salamander; int ErrorID; - CQuadWord MatchedTotalSize; //total uncopressed size of all files + CQuadWord MatchedTotalSize; //total uncompressed size of all files //that are about to be extracted CQuadWord ProgressTotalSize; bool Fatal; From 81bc65b9d61e2b9e5e16fe7b777df4b74cd08ee3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:52:21 +0200 Subject: [PATCH 545/710] [translation] Fix src/plugins/zip/crypt.cpp comments Refines translated comments in src/plugins/zip/crypt.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #824 for src/plugins/zip/crypt.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/zip/crypt.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/plugins/zip/crypt.cpp b/src/plugins/zip/crypt.cpp index 49f93d401..17066222a 100644 --- a/src/plugins/zip/crypt.cpp +++ b/src/plugins/zip/crypt.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" #include @@ -34,7 +35,7 @@ __forceinline int decrypt_byte(__UINT32* keys) extern CSalamanderGeneralAbstract* SalamanderGeneral; #define CRC32(c, b) (SalamanderGeneral->UpdateCrc32(&b, 1, c ^ 0xffffffffL) ^ 0xffffffffL) -//Update the encryption keys with the next byte of plain text +// Update the encryption keys with the next byte of plaintext __forceinline int update_keys(int c, __UINT32* keys) { CALL_STACK_MESSAGE_NONE @@ -48,8 +49,8 @@ __forceinline int update_keys(int c, __UINT32* keys) return c; } -//initialize the encryption keys and the random header according to -//the given password. +// Initialize the encryption keys from +// the given password. void init_keys(const char* password, __UINT32* keys) { CALL_STACK_MESSAGE2("init_keys(%s, )", password); @@ -69,7 +70,7 @@ int testkey(const char* password, const char* header, char check, CALL_STACK_MESSAGE4("testkey(%s, %s, %u, )", password, header, check); char buf[ENCRYPT_HEADER_SIZE]; //decrypted header - //set keys and save the encrypted header + //set keys and copy the encrypted header init_keys(password, keys); CopyMemory(buf, header, ENCRYPT_HEADER_SIZE); //decrypt header @@ -78,10 +79,10 @@ int testkey(const char* password, const char* header, char check, if (buf[ENCRYPT_HEADER_SIZE - 1] == check) return 0; else - return -1; // bad + return -1; // check failed } -//test password and set up keys +// Test the password and set up the keys int InitKeys(const char* password, const char* header, char check, __UINT32* keys) { @@ -103,7 +104,7 @@ int InitKeys(const char* password, const char* header, char check, return ret; } -//decrypt buffer +// decrypt the buffer void Decrypt(char* buffer, unsigned size, __UINT32* keys) { CALL_STACK_MESSAGE3("Decrypt(%p, %u, , )", buffer, size); @@ -126,7 +127,7 @@ void FillBufferWithRandomData(char* buf, int len) *buf++ = (rand() >> 7) & 0xff; } -//crypt encryption header +// Encrypt the ZIP encryption header void CryptHeader(const char* password, char* header, unsigned short check, __UINT32* keys) { @@ -151,7 +152,7 @@ void CryptHeader(const char* password, char* header, unsigned short check, Encrypt(header, ENCRYPT_HEADER_SIZE, keys); } -//encrypt buffer +// encrypts buffer void Encrypt(char* buffer, unsigned size, __UINT32* keys) { CALL_STACK_MESSAGE3("Encrypt(%p, %u, , )", buffer, size); From a7b83f9a5faa2a3ede1b42c7e3fce44f0fcbd36f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:55:16 +0200 Subject: [PATCH 546/710] [translation] Fix src/plugins/zip/deflate.cpp comments Refines translated comments in src/plugins/zip/deflate.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #825 for src/plugins/zip/deflate.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/zip/deflate.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/plugins/zip/deflate.cpp b/src/plugins/zip/deflate.cpp index 11d4ad7d2..4467e53ac 100644 --- a/src/plugins/zip/deflate.cpp +++ b/src/plugins/zip/deflate.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" #include @@ -307,15 +308,15 @@ void CDeflate::fill_window() */ if (more == (unsigned)EOF) { - /* Very unlikely, but possible on 16 bit machine if strstart == 0 - * and lookahead == 1 (input done one byte at time) - */ + /* Very unlikely, but possible on a 16-bit machine if strstart == 0 + * and lookahead == 1 (input done one byte at a time) + */ more--; /* For MMAP or BIG_MEM, the whole input file is already in memory - * so we must not perform sliding. We must however call file_read in - * order to compute the crc, update lookahead and possibly set eofile. - */ + * so we must not perform sliding. We must, however, call ReadData to + * compute the CRC, update lookahead, and possibly set eofile. + */ } else if (strstart >= WSIZE + MAX_DIST && sliding) { @@ -382,8 +383,8 @@ void CDeflate::fill_window() } /* =========================================================================== - * Processes a new input file and return its compressed length. This - * function does not perform lazy evaluationof matches and inserts + * Processes a new input file and returns its compressed length. This + * function does not perform lazy evaluation of matches and inserts * new strings in the dictionary only for unmatched strings or for short * matches. It is used only for the fast compression options. */ @@ -407,9 +408,9 @@ ullg CDeflate::deflate_fast() if (hash_head != NIL && strstart - hash_head <= MAX_DIST) { /* To simplify the code, we prevent matches with the string - * of window index 0 (in particular we have to avoid a match - * of the string with itself at the start of the input file). - */ + * at window index 0 (in particular we have to avoid a match + * of the string with itself at the start of the input file). + */ #ifndef HUFFMAN_ONLY match_length = longest_match(hash_head); #endif From c95ac574b7d861a0aca4c176091d568d3b45cd1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:58:20 +0200 Subject: [PATCH 547/710] [translation] Fix src/plugins/zip/deflate.h comments Refines translated comments in src/plugins/zip/deflate.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #826 for src/plugins/zip/deflate.h, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/zip/deflate.h | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/src/plugins/zip/deflate.h b/src/plugins/zip/deflate.h index 248ac5e42..74d94bf7b 100644 --- a/src/plugins/zip/deflate.h +++ b/src/plugins/zip/deflate.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once @@ -446,13 +447,11 @@ class CDeflate /* Output buffer for compression to file */ char *in_buf, *out_buf; - /* Current input and output buffers. in_buf is used only for in-memory - * compression. - */ + /* Current offsets in the input and output buffers. in_offset is used only for in-memory compression. On 16-bit machines, the buffer is limited to 64K. */ unsigned in_offset, out_offset; - /* Current offset in input and output buffers. in_offset is used only for - * in-memory compression. On 16 bit machines, the buffer is limited to 64K. + /* Current positions in the input and output buffers. in_offset is used only for + * in-memory compression. On 16-bit machines, the buffer is limited to 64K. */ unsigned in_size, out_size; @@ -496,11 +495,11 @@ class CDeflate void copy_block(char* block, unsigned len, int header); /* =========================================================================== - * Return true if the zip file can be seeked. This is used to check if - * the local header can be re-rewritten. This function always returns - * true for in-memory compression. - * IN assertion: the local header has already been written (ftell() > 0). - */ + * Return TRUE if the zip file can be seeked. This is used to check if + * the local header can be re-rewritten. This function always returns + * TRUE for in-memory compression. + * IN assertion: the local header has already been written (ftell() > 0). + */ int seekable() { return 1; @@ -587,9 +586,7 @@ class CDeflate */ ct_data static_dtree[D_CODES]; - /* The static distance tree. (Actually a trivial tree since all codes use - * 5 bits.) - */ + /* The bit-length tree. */ ct_data bl_tree[2 * BL_CODES + 1]; /* Huffman tree for the bit lengths */ @@ -599,7 +596,7 @@ class CDeflate tree_desc bl_desc; ush bl_count[MAX_BITS + 1]; - /* number of codes at each bit length for an optimal tree */ + /* order of bit length codes */ uch bl_order[BL_CODES]; /* The lengths of the bit length codes are sent in order of decreasing @@ -614,7 +611,7 @@ class CDeflate */ uch depth[2 * L_CODES + 1]; - /* Depth of each subtree used as tie breaker for trees of equal frequency */ + /* Length code for each match length */ uch length_code[MAX_MATCH - MIN_MATCH + 1]; /* length code for each normalized match length (0 == MIN_MATCH) */ @@ -661,7 +658,7 @@ class CDeflate ulg cmpr_len_bits; /* number of bits past 'cmpr_bytelen' */ ulg input_len; /* total byte length of input file */ - /* input_len is for debugging only since we can get it by other means. */ + /* file_type points to UNKNOWN, BINARY, or ASCII. */ ush* file_type; /* pointer to UNKNOWN, BINARY or ASCII */ int* file_method; /* pointer to DEFLATE or STORE */ @@ -894,7 +891,7 @@ class CDeflate unsigned max_chain_length; /* To speed up deflation, hash chains are never searched beyond this length. - * A higher limit improves compression ratio but degrades the speed. + * A higher limit improves the compression ratio but reduces speed. */ unsigned int max_lazy_match; From 0aa3c70a33c1d1987ee2b279fec7047422d00f23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:58:42 +0200 Subject: [PATCH 548/710] [translation] Fix src/plugins/zip/del.cpp comments Refines translated comments in src/plugins/zip/del.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #827 for src/plugins/zip/del.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/zip/del.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/zip/del.cpp b/src/plugins/zip/del.cpp index 712ba0026..574a82b83 100644 --- a/src/plugins/zip/del.cpp +++ b/src/plugins/zip/del.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" #include @@ -311,7 +312,7 @@ void CZipPack::UpdateCentrDir(CFileInfo* curFile, CFileInfo* nextFile, QWORD del } else { - // We leave Zip64 record here even when no longer needed, it is not a violation + // We leave the Zip64 record here even when it is no longer needed; this is not a violation *(QWORD*)locHeaderOffsOffs = locHeaderOffs; } } From 3ca6e530ba44785143ca23cbfaf59c2bb6add232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:59:04 +0200 Subject: [PATCH 549/710] [translation] Fix src/plugins/zip/dialogs2.cpp comments Refines translated comments in src/plugins/zip/dialogs2.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #828 for src/plugins/zip/dialogs2.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/zip/dialogs2.cpp | 39 ++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/src/plugins/zip/dialogs2.cpp b/src/plugins/zip/dialogs2.cpp index 1a2e65c57..9f2b298e9 100644 --- a/src/plugins/zip/dialogs2.cpp +++ b/src/plugins/zip/dialogs2.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" #include @@ -130,7 +131,7 @@ CAdvancedSEDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) SalamanderGeneral->OpenHtmlHelp(Dlg, HHCDisplayContext, IDD_ADVANCEDSE, FALSE); return TRUE; - //spec dir menu + //special directory menu case CM_TEMP: case CM_PROGFILES: case CM_WINDIR: @@ -814,23 +815,23 @@ int CompareMenuItems(char* name1, char* name2) return SalamanderGeneral->StrICmp(buf1, buf2); - /* this was case sensitive, otherwise OK - int ret = 0 ; + /* this was case-sensitive, but otherwise OK + int ret = 0 ; - while (!(ret = *(unsigned char *)(*name1 == '&' ? name1++ : name1) - - *(unsigned char *)(*name2 == '&' ? name2++ : name2)) && *name2) - ++name1, ++name2; + while (!(ret = *(unsigned char *)(*name1 == '&' ? name1++ : name1) - + *(unsigned char *)(*name2 == '&' ? name2++ : name2)) && *name2) + ++name1, ++name2; - if (ret < 0) - ret = -1; - else - { - if (ret > 0) - ret = 1; - } + if (ret < 0) + ret = -1; + else + { + if (ret > 0) + ret = 1; + } - return ret; -*/ + return ret; + */ } void SortFavoriteSettings(int left, int right) @@ -1092,7 +1093,7 @@ BOOL CAdvancedSEDialog::OnImport() GetModuleFileName(DLLInstance, settings.IconFile, MAX_PATH); settings.IconIndex = -IDI_SFXICON; // load them a second time to get the texts (these parameters are optional) - // if they are not provided, use the texts from the SFX package, either the specified + // if they are not specified, the texts from the SFX package are used, either the specified one // or the default one ImportSFXSettings(buffer, &settings, zip2sfxDir); @@ -1336,8 +1337,8 @@ BOOL CAdvancedSEDialog::OnResetValues() { CALL_STACK_MESSAGE1("CAdvancedSEDialog::OnResetValues()"); - // we cannot directly use TmpSfxSettings = DefOptions.SfxSetting, because it would overwrite - // the icon, which might then become invalid + // We cannot directly use TmpSfxSettings = DefOptions.SfxSettings, because it would overwrite + // the icon, which could then be invalid. TmpSfxSettings.Flags = DefOptions.SfxSettings.Flags; *TmpSfxSettings.Command = 0; lstrcpy(TmpSfxSettings.TargetDir, DefOptions.SfxSettings.TargetDir); @@ -1773,7 +1774,7 @@ BOOL CSfxTextsDialog::OnInit(WPARAM wParam, LPARAM lParam) { CALL_STACK_MESSAGE1("CSfxTextsDialog::OnInit"); - //!note: below we rely strictly on the order + //!below we rely strictly on the order int i = 0; SendDlgItemMessage(Dlg, IDC_MBOXBUTTONS, CB_ADDSTRING, 0, (LPARAM)LoadStr(IDS_MBOK)); SendDlgItemMessage(Dlg, IDC_MBOXBUTTONS, CB_SETITEMDATA, i++, (LPARAM)MB_OK); From 1941a9a24550338c796a8d0f8c8c9e1ef6d120be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:59:25 +0200 Subject: [PATCH 550/710] [translation] Fix src/plugins/zip/dialogs3.cpp comments Refines translated comments in src/plugins/zip/dialogs3.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #829 for src/plugins/zip/dialogs3.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/zip/dialogs3.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/zip/dialogs3.cpp b/src/plugins/zip/dialogs3.cpp index c38c7a097..2e80e1813 100644 --- a/src/plugins/zip/dialogs3.cpp +++ b/src/plugins/zip/dialogs3.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" #include @@ -130,7 +131,7 @@ CCommentDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_SHOWWINDOW: if (FirstShow) { - // clear the selection of the entire text + // clear the selection SendMessage(CommentHWnd, EM_SETSEL, 0, 0); FirstShow = FALSE; } From 6b7701025f636ea6cb037048305149afef430c14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Sun, 19 Apr 2026 23:59:45 +0200 Subject: [PATCH 551/710] [translation] Fix src/plugins/zip/explode.cpp comments Refines translated comments in src/plugins/zip/explode.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #830 for src/plugins/zip/explode.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/zip/explode.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/plugins/zip/explode.cpp b/src/plugins/zip/explode.cpp index df73f9935..6ef6a58e3 100644 --- a/src/plugins/zip/explode.cpp +++ b/src/plugins/zip/explode.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" #include @@ -317,10 +318,10 @@ int explode_lit(CDecompressionObject* decompress, mdl = mask_bits[bdl]; s = (ulg)decompress->ucsize; - while (s > 0) /* do until ucsize bytes uncompressed */ + while (s > 0) /* repeat until ucsize bytes have been uncompressed */ { NEEDBITS(decompress, 1) - if (b & 1) /* then literal--decode it */ + if (b & 1) /* then decode the literal */ { DUMPBITS(1) s--; @@ -383,7 +384,7 @@ int explode_lit(CDecompressionObject* decompress, w += e; d += e; } - else /* do it slow to avoid memcpy() overlap */ + else /* copy byte by byte to avoid overlap */ #endif /* !NOMEMCPY */ do { @@ -408,7 +409,7 @@ int explode_lit(CDecompressionObject* decompress, TRACE_E("flush returned error"); return 5; } - // this exposes the CRC + // this detects the CRC // // if (G.csize + G.incnt + (k >> 3)) /* should have read csize bytes, but */ // { /* sometimes read one too many: k>>3 compensates */ @@ -437,7 +438,7 @@ int explode_nolit(CDecompressionObject* decompress, ulg b; /* bit buffer */ unsigned k; /* number of bits in bit buffer */ unsigned u; /* true if unflushed */ - int retval = 0; /* error code returned: initialized to "no error" */ + int retval = 0; /* returned error code, initialized to "no error" */ uch* redirSlide; unsigned wsize; @@ -453,7 +454,7 @@ int explode_nolit(CDecompressionObject* decompress, mdl = mask_bits[bdl]; s = (ulg)decompress->ucsize; - while (s > 0) /* do until ucsize bytes uncompressed */ + while (s > 0) /* continue until ucsize bytes have been uncompressed */ { NEEDBITS(decompress, 1) if (b & 1) /* then literal--get eight bits */ @@ -480,7 +481,7 @@ int explode_nolit(CDecompressionObject* decompress, d = (unsigned)b & mdl; DUMPBITS(bdl) DECODEHUFT(decompress, td, bd, md) /* get coded distance high bits */ - d = w - d - t->v.n; /* construct offset */ + d = w - d - t->v.n; /* compute offset */ DECODEHUFT(decompress, tl, bl, ml) /* get coded length */ n = t->v.n; if (e) /* get length extra bits */ @@ -520,7 +521,7 @@ int explode_nolit(CDecompressionObject* decompress, w += e; d += e; } - else /* do it slow to avoid memcpy() overlap */ + else /* copy slowly to avoid memcpy() overlap */ #endif /* !NOMEMCPY */ do { @@ -545,7 +546,7 @@ int explode_nolit(CDecompressionObject* decompress, TRACE_E("flush returned error"); return 5; } - // this catches the CRC + // The CRC check catches this // if (G.csize + G.incnt + (k >> 3)) /* should have read csize bytes, but */ // { /* sometimes read one too many: k>>3 compensates */ // G.used_csize = G.lrec.csize - G.csize - G.incnt - (k >> 3); @@ -632,7 +633,7 @@ int Explode(CDecompressionObject* decompress) huft_free(decompress, tb); return (int)r; } - if (decompress->Flag & 2) /* true if 8K */ + if (decompress->Flag & 2) /* TRUE for 8K */ { bdl = 7; r = huft_build(decompress, l, 64, 0, cpdist8, extra, &td, &bd); From dbd3ecf29f8e3ebf520511f7e1d8b3b642c90374 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 00:00:07 +0200 Subject: [PATCH 552/710] [translation] Fix src/plugins/zip/extract.cpp comments Refines translated comments in src/plugins/zip/extract.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #831 for src/plugins/zip/extract.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/zip/extract.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/plugins/zip/extract.cpp b/src/plugins/zip/extract.cpp index f904610ab..08b8da1c1 100644 --- a/src/plugins/zip/extract.cpp +++ b/src/plugins/zip/extract.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" #include @@ -1136,7 +1137,7 @@ int CZipUnpack::UnBZIP2File(CFileInfo* fileInfo, int* errorID) break; } case 3: // Out of memory - case 4: // Error uncompressing BZIP2 stream + case 4: // Error decompressing the BZIP2 stream switch (ProcessError( ret == 3 ? IDS_LOWMEM : IDS_ERRBZIP2, 0, FileNameDisp, @@ -1324,7 +1325,7 @@ int CZipUnpack::ExtractSingleFile(char* targetDir, int targetDirLen, WORD pwdVerFile; bool repeat; - // AES v2 doesn't store CRC, seems to be created by TC + // AES v2 does not store a CRC; it seems to be created by TC if (AES_VERSION_2 == aesExtraField.Version) bCheckCRC = false; ZipFile->FilePointer = fileInfo->DataOffset; @@ -1440,7 +1441,7 @@ int CZipUnpack::ExtractSingleFile(char* targetDir, int targetDirLen, break; } // if (i >= Passwords.Count)// pwd not found in cache - if (!bFound) // pwd not found in cache + if (!bFound) // Password not found in cache do { repeat = false; @@ -1920,7 +1921,7 @@ int CZipUnpack::SafeCreateCFile(CFile** file, const char* fileName, const char* { if (q == CQuadWord(0, 0x80000000)) { - // allocation failed and we will not attempt it again + // allocation failed and we will not try again AllocateWholeFile = false; TestAllocateWholeFile = false; } @@ -2010,7 +2011,7 @@ void CZipUnpack::QuickSortHeaders2(int left, int right, TIndirectArray2 Date: Mon, 20 Apr 2026 00:00:45 +0200 Subject: [PATCH 553/710] [translation] Fix src/plugins/zip/inflate.cpp comments Refines translated comments in src/plugins/zip/inflate.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #832 for src/plugins/zip/inflate.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/zip/inflate.cpp | 105 ++++++++++++++++++------------------ 1 file changed, 53 insertions(+), 52 deletions(-) diff --git a/src/plugins/zip/inflate.cpp b/src/plugins/zip/inflate.cpp index 40810324c..f107a524f 100644 --- a/src/plugins/zip/inflate.cpp +++ b/src/plugins/zip/inflate.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" #include @@ -16,8 +17,8 @@ /* inflate.c -- modified by Lucas Cerman version 1.0b, August 1999 - based on file inflate.c distributed with infozip, - writen by Mark Adler + based on the inflate.c file distributed with Info-ZIP, + written by Mark Adler version c16b, 29 March 1998 */ /* @@ -165,12 +166,12 @@ int huft_build(CDecompressionObject* decompress, struct huft** t, /* result: starting table */ int* m); -/* The inflate algorithm uses a sliding 32K byte window on the uncompressed - stream to find repeated byte strings. This is implemented here as a - circular buffer. The index is updated simply by incrementing and then - and'ing with 0x7fff (32K-1) (window size - 1). */ +/* The inflate algorithm uses a sliding 32K-byte window on the uncompressed + stream to find repeated byte strings. This is implemented here as a + circular buffer. The index is updated simply by incrementing and then + bitwise-ANDing with 0x7fff (32K-1) (window size - 1). */ // sliding window is defined in CDecompressionObject and could be -// any size greater or equal 32K +// any size greater than or equal to 32K /* Tables for deflate from PKZIP's appnote.txt. */ /* Order of the bit length code lengths */ @@ -226,7 +227,7 @@ static const uch cpdext32[] = { #define MAXDISTS 30 #endif -/* And'ing with mask_bits[n] masks the lower n bits */ +/* ANDing with mask_bits[n] masks the lower n bits */ const ush mask_bits[] = { 0x0000, 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, @@ -240,16 +241,16 @@ const ush mask_bits[] = { DUMPBITS(j) where NEEDBITS makes sure that b has at least j bits in it, and - DUMPBITS removes the bits from b. The macros use the variable k - for the number of bits in b. Normally, b and k are register - variables for speed and are initialized at the begining of a + DUMPBITS removes the bits from b. The macros use the variable k + for the number of bits in b. Normally, b and k are register + variables for speed and are initialized at the beginning of a routine that uses these macros from a global bit buffer and count. - In order to not ask for more bits than there are in the compressed - stream, the Huffman tables are constructed to only ask for just - enough bits to make up the end-of-block code (value 256). Then no - bytes need to be "returned" to the buffer at the end of the last - block. See the huft_build() routine. + In order not to ask for more bits than there are in the compressed + stream, the Huffman tables are constructed to ask for just enough + bits to make up the end-of-block code (value 256). Then no bytes + need to be "returned" to the buffer at the end of the last block. + See the huft_build() routine. */ //this function should replace NEXTBYTE macro @@ -313,7 +314,7 @@ uch NextByte(CDecompressionObject* decompress) the longer codes. The time it costs to decode the longer codes is then traded against the time it takes to make longer tables. - This results of this trade are in the variables lbits and dbits + The results of this tradeoff are reflected in the variables lbits and dbits below. lbits is the number of bits the first level table for literal/ length codes can decode in one step, and dbits is the same thing for the distance codes. Subsequent tables are also less than or equal to @@ -338,8 +339,8 @@ static const int dbits = 6; /* bits in base distance lookup table */ #ifndef ASM_INFLATECODES -/* inflate (decompress) the codes in a deflated (compressed) block. - Return an error code or zero if it all goes ok. */ +/* Inflate (decompress) the codes in a deflated (compressed) block. + Returns an error code, or zero on success. */ int inflate_codes(CDecompressionObject* decompress, struct huft* tl, //literal/length struct huft* td, //distance decoder tables @@ -366,7 +367,7 @@ int inflate_codes(CDecompressionObject* decompress, /* inflate the coded data */ ml = mask_bits[bl]; /* precompute masks for speed */ md = mask_bits[bd]; - while (1) /* do until end of block */ + while (1) /* repeat until end of block */ { NEEDBITS((unsigned)bl, decompress) t = tl + ((unsigned)b & ml); @@ -451,7 +452,7 @@ int inflate_codes(CDecompressionObject* decompress, break; } - if (e == 31) /* it's the EOB signal */ + if (e == 31) /* end-of-block (EOB) code */ { /* sorry for this goto, but we have to exit two loops at once */ goto cleanup_decode; @@ -490,7 +491,7 @@ int inflate_stored(CDecompressionObject* decompress) unsigned outBytes, inBytes; //temporary variables - // make local copies of globals + // make local copies of the decompressor state b = decompress->Input->BitBuf; // initialize bit buffer k = decompress->Input->BitCount; @@ -507,22 +508,22 @@ int inflate_stored(CDecompressionObject* decompress) return 1; // error in compressed data DUMPBITS(16) - /* old copy routine, the new should be faster (I hope so) - // read and output the compressed data - while (n--) - { - NEEDBITS(8, decompress) - decompress->Output->SlideWin[w++] = (uch)b; - if (w == decompress->Output->WinSize) - { - decompress->Output->Flush(w, decompress); - w = 0; - } - DUMPBITS(8, decompress) - } -*/ + /* old copy routine; the new one should be faster + // read and output the stored block data + while (n--) + { + NEEDBITS(8, decompress) + decompress->Output->SlideWin[w++] = (uch)b; + if (w == decompress->Output->WinSize) + { + decompress->Output->Flush(w, decompress); + w = 0; + } + DUMPBITS(8, decompress) + } + */ - //copy bytes from intup to the output + // Copy bytes from input to the output while (n) { if (n <= decompress->Output->WinSize - decompress->Output->WinPos) @@ -621,7 +622,7 @@ int inflate_fixed(CDecompressionObject* decompress) decompress->fixed_bl, decompress->fixed_bd) != 0; } -/* decompress an inflated type 2 (dynamic Huffman codes) block. */ +/* Decompress a type 2 (dynamic Huffman codes) block. */ int inflate_dynamic(CDecompressionObject* decompress) { int i; /* temporary variables */ @@ -636,11 +637,11 @@ int inflate_dynamic(CDecompressionObject* decompress) unsigned nb; /* number of bit length codes */ unsigned nl; /* number of literal/length codes */ unsigned nd; /* number of distance codes */ - unsigned ll[MAXLITLENS + MAXDISTS]; /* lit./length and distance code lengths */ + unsigned ll[MAXLITLENS + MAXDISTS]; /* literal/length and distance code lengths */ ulg b; /* bit buffer */ unsigned k; /* number of bits in bit buffer */ - /* make local bit buffer */ + /* create a local bit buffer */ b = decompress->Input->BitBuf; k = decompress->Input->BitCount; @@ -667,7 +668,7 @@ int inflate_dynamic(CDecompressionObject* decompress) for (; j < 19; j++) ll[border[j]] = 0; - /* build decoding table for trees--single level, 7 bit lookup */ + /* build a decoding table for the trees -- single-level, 7-bit lookup */ bl = 7; i = huft_build(decompress, ll, 19, 19, NULL, NULL, &tl, &bl); if (bl == 0) /* no bit lengths */ @@ -691,7 +692,7 @@ int inflate_dynamic(CDecompressionObject* decompress) DUMPBITS(j) j = td->v.n; if (j < 16) /* length of code in bits (0..15) */ - ll[i++] = l = j; /* save last length in l */ + ll[i++] = l = j; /* save the last length in l */ else if (j == 16) /* repeat last length 3 to 6 times */ { NEEDBITS(2, decompress) @@ -787,7 +788,7 @@ int inflate_dynamic(CDecompressionObject* decompress) if ((i = inflate_codes(decompress, tl, td, bl, bd)) != 0) TRACE_I("inflate_dynamic: error in inflate_codes"); - /* free the decoding tables, return */ + /* Free the decoding tables and return. */ huft_free(decompress, tl); huft_free(decompress, td); return i; @@ -832,7 +833,7 @@ int inflate_block(CDecompressionObject* decompress, int* e) return 2; } -//decompress an inflated entry +// Decompress a deflated entry int Inflate(CDecompressionObject* decompress, int deflate64) { CALL_STACK_MESSAGE2("Inflate( , int %d)", deflate64); @@ -840,12 +841,12 @@ int Inflate(CDecompressionObject* decompress, int deflate64) int r; /* result code */ /* -#ifdef DEBUG - unsigned h = 0; // maximum struct huft's malloc'ed -#endif -*/ + #ifdef DEBUG + unsigned h = 0; // maximum number of allocated struct huft objects + #endif + */ - /* initialize window, bit buffer */ + /* initialize the window and bit buffer */ decompress->Output->WinPos = 0; decompress->Input->BitCount = 0; decompress->Input->BitBuf = 0; @@ -1053,7 +1054,7 @@ int huft_build(CDecompressionObject* decompress, if ((j = *p++) != 0) v[x[j]++] = i; } while (++i < n); - n = x[g]; /* set n to length of v */ + n = x[g]; /* set n to the length of v */ /* Generate the Huffman codes and for each, make the table entries */ x[0] = i = 0; /* first Huffman code is zero */ @@ -1090,9 +1091,9 @@ int huft_build(CDecompressionObject* decompress, } } if ((unsigned)w + j > el && (unsigned)w < el) - j = el - w; /* make EOB code end at table */ + j = el - w; /* make the EOB code end at this table */ z = 1 << j; /* table entries for j-bit table */ - l[h] = j; /* set table size in stack */ + l[h] = j; /* store table size on the stack */ /* allocate and link in new table */ if ((q = (struct huft*)MemAlloc((z + 1) * sizeof(struct huft), decompress->HeapInfo)) == From 123a3565598fce463b4bf47f5734689f109f33bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 00:01:05 +0200 Subject: [PATCH 554/710] [translation] Fix src/plugins/zip/inflate.h comments Refines translated comments in src/plugins/zip/inflate.h. Model: OpenAI GPT-5.4 Verification: Reviewed PR #833 for src/plugins/zip/inflate.h, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/zip/inflate.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/zip/inflate.h b/src/plugins/zip/inflate.h index 91115e429..d6c1f8283 100644 --- a/src/plugins/zip/inflate.h +++ b/src/plugins/zip/inflate.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once @@ -72,7 +73,7 @@ typedef struct //decopmression object typedef int (*FProgressMonitor)(CDecompressionObject*); -//if return zero value decompression is aborted +// If zero is returned, decompression is aborted. struct tagCDecompressionObject { @@ -99,7 +100,7 @@ struct tagCDecompressionObject unsigned Flag; //general purpose bit flag //unshrink + unreduce - unsigned __int64 CompBytesLeft; //bytes left to decompress + unsigned __int64 CompBytesLeft; //compressed bytes left to decompress //unreduce int Method; From efb3ba9c7bfe942ce8bbed3554c777b5067d2d60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 00:01:26 +0200 Subject: [PATCH 555/710] [translation] Fix src/plugins/zip/iosfxset.cpp comments Refines translated comments in src/plugins/zip/iosfxset.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #834 for src/plugins/zip/iosfxset.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/zip/iosfxset.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/plugins/zip/iosfxset.cpp b/src/plugins/zip/iosfxset.cpp index 0184a6d78..176c38cb2 100644 --- a/src/plugins/zip/iosfxset.cpp +++ b/src/plugins/zip/iosfxset.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" #include @@ -311,18 +312,18 @@ void HandlePathRelativeToZip2Sfx(char* path, const char* zip2sfxDir) } } -// return values +// Return values // // 0 OK -// invalid target_dir specified: -// 1 bad temp +// Invalid target_dir specified: +// 1 invalid temp // 2 missing right parenthesis // 3 unknown keyword in $() -// 4 bad key name +// 4 invalid key name // 5 missing settings version -// 6 incorrect settings version -// 7 incorrect data format -// 8 agree disagree buttons used for classical message box +// 6 invalid settings version +// 7 invalid data format +// 8 Agree/Disagree buttons used for a standard message box int ImportSFXSettings(const char* textData, CSfxSettings* settings, const char* zip2sfxDir) { @@ -621,7 +622,7 @@ int ImportSFXSettings(const char* textData, CSfxSettings* settings, const char* // 3 unknown keyword in $() // 4 bad key name // -// higher word contains index of where the syntax error occured in the target dir string +// higher word contains the index of where the syntax error occurred in the target dir string DWORD ParseTargetDir(const char* path, unsigned* targetDir, const char** subDir, @@ -682,7 +683,7 @@ ParseTargetDir(const char* path, unsigned* targetDir, const char** subDir, // also check that the string inside the brackets is valid if (iterator - path + 2 <= 0) { - return 3 + (2 << 16); // empty brackets + return 3 + (2 << 16); // empty parentheses } if (path[1] == '(') { @@ -690,7 +691,7 @@ ParseTargetDir(const char* path, unsigned* targetDir, const char** subDir, { if (iterator[1] != 0) { - return 1 + (DWORD)(((iterator - path) + 1) << 16); // nothing may follow after $(Temp) + return 1 + (DWORD)(((iterator - path) + 1) << 16); // nothing may follow $(Temp) } if (targetDir) *targetDir = SE_TEMPDIREX; @@ -723,7 +724,7 @@ ParseTargetDir(const char* path, unsigned* targetDir, const char** subDir, return 3 + (2 << 16); // invalid keyword } - else // otherwise fill dirSpec + else // optionally fill dirSpec { if (path[1] == '[') { From 80019521d73d9743bdb9ba03c8cccf5e32b1bacb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 00:01:47 +0200 Subject: [PATCH 556/710] [translation] Fix src/plugins/zip/main.cpp comments Refines translated comments in src/plugins/zip/main.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #835 for src/plugins/zip/main.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/zip/main.cpp | 45 ++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/src/plugins/zip/main.cpp b/src/plugins/zip/main.cpp index d92396b0f..05ebb171c 100644 --- a/src/plugins/zip/main.cpp +++ b/src/plugins/zip/main.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" #include @@ -133,12 +134,12 @@ CPluginInterfaceAbstract* WINAPI SalamanderPluginEntry(CSalamanderPluginEntryAbs { // reject older versions MessageBox(salamander->GetParentWindow(), REQUIRE_LAST_VERSION_OF_SALAMANDER, - "ZIP" /* neprekladat! */, MB_OK | MB_ICONERROR); + "ZIP" /* do not translate */, MB_OK | MB_ICONERROR); return NULL; } // load the language module (.slg) - HLanguage = salamander->LoadLanguageModule(salamander->GetParentWindow(), "ZIP" /* neprekladat! */); + HLanguage = salamander->LoadLanguageModule(salamander->GetParentWindow(), "ZIP" /* do not translate */); if (HLanguage == NULL) return NULL; @@ -154,15 +155,15 @@ CPluginInterfaceAbstract* WINAPI SalamanderPluginEntry(CSalamanderPluginEntryAbs SalamanderGeneral->SetHelpFileName("zip.chm"); /* - // beta valid until the end of February 2001 - SYSTEMTIME st; - GetLocalTime(&st); - if (st.wYear == 2001 && st.wMonth > 2 || st.wYear > 2001) - { - SalamanderGeneral->ShowMessageBox(LoadStr(IDS_EXPIRE), LoadStr(IDS_PLUGINNAME), MSGBOX_INFO); - return NULL; - } - */ + // beta is valid until the end of February 2001 + SYSTEMTIME st; + GetLocalTime(&st); + if (st.wYear == 2001 && st.wMonth > 2 || st.wYear > 2001) + { + SalamanderGeneral->ShowMessageBox(LoadStr(IDS_EXPIRE), LoadStr(IDS_PLUGINNAME), MSGBOX_INFO); + return NULL; + } + */ // provide the basic plugin information salamander->SetBasicPluginData(LoadStr(IDS_PLUGINNAME), @@ -172,7 +173,7 @@ CPluginInterfaceAbstract* WINAPI SalamanderPluginEntry(CSalamanderPluginEntryAbs VERSINFO_VERSION_NO_PLATFORM, VERSINFO_COPYRIGHT, LoadStr(IDS_PLUGIN_DESCRIPTION), - "ZIP" /* neprekladat! */, "zip;pk3;pk4;jar"); + "ZIP" /* DO NOT TRANSLATE */, "zip;pk3;pk4;jar"); // register the plugin home page URL salamander->SetPluginHomePageURL("www.altap.cz"); @@ -248,7 +249,7 @@ void CPluginInterface::LoadConfiguration(HWND parent, HKEY regKey, CSalamanderRe v = Config.CurSalamanderVersion; Config = DefConfig; Config.CurSalamanderVersion = v; - if (regKey != NULL) // load z registry + if (regKey != NULL) // load from registry { registry->GetValue(regKey, CONFIG_LEVEL, REG_DWORD, &Config.Level, sizeof(DWORD)); registry->GetValue(regKey, CONFIG_ENCRYPTMETHOD, REG_DWORD, &Config.EncryptMethod, sizeof(DWORD)); @@ -613,7 +614,7 @@ CPluginInterfaceForMenuExt::GetMenuItemState(int id, DWORD eventMask) file = SalamanderGeneral->GetPanelSelectedItem(PANEL_SOURCE, &index, &isDir); } - return (ret && count > 0) ? MENU_ITEM_STATE_ENABLED : 0; // all selected files are handled by us + return (ret && count > 0) ? MENU_ITEM_STATE_ENABLED : 0; // all selected files are handled by this plugin } BOOL CPluginInterfaceForMenuExt::ExecuteMenuItem(CSalamanderForOperationsAbstract* salamander, HWND parent, @@ -654,7 +655,7 @@ BOOL CPluginInterfaceForMenuExt::ExecuteMenuItem(CSalamanderForOperationsAbstrac else fileData = SalamanderGeneral->GetPanelFocusedItem(PANEL_SOURCE, NULL); if (!fileData) - break; // end of enumeration, or an error (for GetFocusedItem) + break; // end of enumeration, or an error in the case of GetFocusedItem lstrcpy(fileName, fileData->Name); DWORD attr = SalamanderGeneral->SalGetFileAttributes(zipFile); if (attr != 0xFFFFFFFF && attr & FILE_ATTRIBUTE_DIRECTORY) @@ -735,7 +736,7 @@ BOOL CPluginInterfaceForMenuExt::ExecuteMenuItem(CSalamanderForOperationsAbstrac if (id == MID_COMMENT || id == MID_CREATESFX || id == MID_REPAIR) // when the operation may have modified the path { - if (!changesReported) // path changed and has not been reported yet -> report it + if (!changesReported) // path changed and has not yet been reported -> report it { changesReported = TRUE; // notify the path containing the modified PAK files (notification happens after leaving @@ -779,7 +780,7 @@ BOOL CPluginInterfaceForMenuExt::HelpForMenuItem(HWND parent, int id) void CPluginDataInterface::ReleasePluginData(CFileData& file, BOOL isDir) { - // file.PluginData is NULL for folders not having extra items in the archive - see GetFileDataForUpDir & GetFileDataForNewDir + // file.PluginData is NULL for folders that do not have extra items in the archive - see GetFileDataForUpDir & GetFileDataForNewDir delete (CZIPFileData*)file.PluginData; // However, delete NULL is perfectly OK } @@ -1096,11 +1097,11 @@ BOOL CPluginInterfaceForArchiver::UnpackWholeArchive(CSalamanderForOperationsAbs if (unpack.ErrorID != IDS_NODISPLAY) SalamanderGeneral->ShowMessageBox(LoadStr(unpack.ErrorID), LoadStr(IDS_PLUGINNAME), MSGBOX_ERROR); - /* // Petr: I really do not know what this was for... I have to disable it now, otherwise a fatal error with 'delArchiveWhenDone'==TRUE would delete the archive, which is unacceptable - if (unpack.Fatal) - return TRUE; - else -*/ + /* // Original purpose unclear; disabled because with a fatal error and 'delArchiveWhenDone'==TRUE, the archive would be deleted, which is unacceptable. + if (unpack.Fatal) + return TRUE; + else + */ return FALSE; } if (unpack.UserBreak) From 097f204e29ffdba4b9c73e9a91d76b2439702b8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 00:02:08 +0200 Subject: [PATCH 557/710] [translation] Fix src/plugins/zip/prevsfx.cpp comments Refines translated comments in src/plugins/zip/prevsfx.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #836 for src/plugins/zip/prevsfx.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/zip/prevsfx.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/plugins/zip/prevsfx.cpp b/src/plugins/zip/prevsfx.cpp index 86209b7b6..e66cb340f 100644 --- a/src/plugins/zip/prevsfx.cpp +++ b/src/plugins/zip/prevsfx.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" #include @@ -145,12 +146,12 @@ INT_PTR WINAPI SfxPreviewDlgProc(HWND dlg, UINT uMsg, WPARAM wParam, LPARAM lPar dlgWinAboutHeigth = r.bottom - r.top; RECT r2; GetWindowRect(GetDlgItem(dlg, IDC_SEPARATOR), &r2); - // an application built with a newer platform toolset handles dialog sizes differently; see + // an application built with a newer Platform Toolset handles window sizes differently; see // https://social.msdn.microsoft.com/Forums/vstudio/en-US/7ca548b5-8931-41dc-ac1d-ed9aed223d7a/different-dialog-box-position-and-size-with-visual-c-2012 // https://connect.microsoft.com/VisualStudio/feedback/details/768135/different-dialog-box-size-and-position-when-compiled-in-visual-c-2012-vs-2010-2008 - // therefore the original logic no longer works (in VC2012+ the window is shorter than in VC2010-): dlgWinHeigth = r2.top - r.top + 1; - // fix: dlgWinHeigth = full window height minus the difference between the client area height and the separator position - // within the dialog's client area + // therefore the original solution does not work (in VC2012+ the window is shorter than in VC2010-): dlgWinHeigth = r2.top - r.top + 1; + // solution: dlgWinHeigth = full window height minus the difference between the dialog client area height and the separator position + // within the dialog client area POINT p; p.x = r2.left; p.y = r2.top; From 93f68a727b1e8004066d19968f8376fa49dbdada Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 00:02:29 +0200 Subject: [PATCH 558/710] [translation] Fix src/plugins/zip/trees.cpp comments Refines translated comments in src/plugins/zip/trees.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #837 for src/plugins/zip/trees.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/zip/trees.cpp | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/plugins/zip/trees.cpp b/src/plugins/zip/trees.cpp index 1d836209f..abbee7641 100644 --- a/src/plugins/zip/trees.cpp +++ b/src/plugins/zip/trees.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" #include @@ -139,8 +140,8 @@ void CDeflate::init_block() /* =========================================================================== * Restore the heap property by moving down the tree starting at node k, - * exchanging a node with the smallest of its two sons if necessary, stopping - * when the heap property is re-established (each father smaller than its + * exchanging a node with the smaller of its two sons if necessary, stopping + * when the heap property is re-established (each parent smaller than its * two sons). */ void CDeflate::pqdownheap(ct_data near* tree, /* the tree to restore */ @@ -165,7 +166,7 @@ void CDeflate::pqdownheap(ct_data near* tree, /* the tree to restore */ heap[k] = htemp; k = j; - /* And continue down the tree, setting j to the left son of k */ + /* Continue down the tree, setting j to the left son of k. */ j <<= 1; } heap[k] = v; @@ -278,7 +279,7 @@ void CDeflate::gen_bitlen(tree_desc near* desc) /* the tree descriptor */ * zero code length. */ void CDeflate::gen_codes(ct_data near* tree, /* the tree to decorate */ - int max_code) /* largest code with non zero frequency */ + int max_code) /* largest code with nonzero frequency */ { ush next_code[MAX_BITS + 1]; /* next code value for each bit length */ ush code = 0; /* running code value */ @@ -310,7 +311,7 @@ void CDeflate::gen_codes(ct_data near* tree, /* the tree to decorate */ } /* =========================================================================== - * Construct one Huffman tree and assigns the code bit strings and lengths. + * Construct one Huffman tree and assign the code bit strings and lengths. * Update the total bit length for the current block. * IN assertion: the field freq is set for all tree elements. * OUT assertions: the fields len and code are set to the optimal bit length @@ -358,7 +359,7 @@ void CDeflate::build_tree(tree_desc near* desc) /* the tree descriptor */ opt_len--; if (stree) static_len -= stree[_new].Len; - /* new is 0 or 1 so it does not have extra bits */ + /* new is 0 or 1, so it has no extra bits */ } desc->max_code = max_code; @@ -414,7 +415,7 @@ void CDeflate::build_tree(tree_desc near* desc) /* the tree descriptor */ * during the construction of bl_tree.) */ void CDeflate::scan_tree(ct_data near* tree, /* the tree to be scanned */ - int max_code) /* and its largest code of non zero frequency */ + int max_code) /* largest code with non-zero frequency */ { int n; /* iterates over all tree elements */ int prevlen = -1; /* last emitted length */ @@ -476,7 +477,7 @@ void CDeflate::scan_tree(ct_data near* tree, /* the tree to be scanned */ * bl_tree. */ void CDeflate::send_tree(ct_data near* tree, /* the tree to be scanned */ - int max_code) /* and its largest code of non zero frequency */ + int max_code) /* largest code with non-zero frequency */ { int n; /* iterates over all tree elements */ int prevlen = -1; /* last emitted length */ @@ -549,7 +550,7 @@ void CDeflate::send_tree(ct_data near* tree, /* the tree to be scanned */ */ int CDeflate::build_bl_tree() { - int max_blindex; /* index of last bit length code of non zero freq */ + int max_blindex; /* index of last bit-length code with non-zero frequency */ /* Determine the bit length frequencies for literal and distance trees */ scan_tree((ct_data near*)dyn_ltree, l_desc.max_code); @@ -558,7 +559,7 @@ int CDeflate::build_bl_tree() /* Build the bit length tree: */ build_tree((tree_desc near*)(&bl_desc)); /* opt_len now includes the length of the tree representations, except - * the lengths of the bit lengths codes and the 5+5+4 bits for the counts. + * the lengths of the bit length codes and the 5+5+4 bits for the counts. */ /* Determine the number of bit length codes to send. The pkzip format @@ -579,8 +580,8 @@ int CDeflate::build_bl_tree() /* =========================================================================== * Send the header for a block using dynamic Huffman trees: the counts, the - * lengths of the bit length codes, the literal tree and the distance tree. - * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4. + * lengths of the bit length codes, the literal tree, and the distance tree. + * Assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4. */ void CDeflate::send_all_trees(int lcodes, int dcodes, int blcodes) /* number of codes for each tree */ { @@ -613,7 +614,7 @@ ullg CDeflate::flush_block(char* buf, /* input block, or NULL if too old */ int eof) /* true if this is the last block for a file */ { ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */ - int max_blindex; /* index of last bit length code of non zero freq */ + int max_blindex; /* index of last bit-length code with non-zero frequency */ flag_buf[last_flags] = flags; /* Save the flags for the last 8 items */ @@ -673,7 +674,7 @@ ullg CDeflate::flush_block(char* buf, /* input block, or NULL if too old */ #else if (stored_len + 4 <= opt_lenb && buf != (char*)NULL) { - /* 4: two words for the lengths */ + /* 4: two words for the length fields */ #endif /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE. * Otherwise we can't have processed more than WSIZE input bytes since From 2ba43c7b0594cd255182ed97e48b547fb4072ec7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 00:02:50 +0200 Subject: [PATCH 559/710] [translation] Fix src/plugins/zip/unreduce.cpp comments Refines translated comments in src/plugins/zip/unreduce.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #838 for src/plugins/zip/unreduce.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/zip/unreduce.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/zip/unreduce.cpp b/src/plugins/zip/unreduce.cpp index c1594dde8..fa0e475d2 100644 --- a/src/plugins/zip/unreduce.cpp +++ b/src/plugins/zip/unreduce.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" #include @@ -128,7 +129,7 @@ int Unreduce(CDecompressionObject* decompress) /* expand probabilistically reduc short Len = 0; unsigned __int64 s = decompress->ucsize; /* number of bytes left to decompress */ unsigned w = 0; /* position in output window slide[] */ - unsigned u = 1; /* true if slide[] unflushed */ + unsigned u = 1; /* true if slide[] has not been flushed */ uch Slen[256]; uch* slide = decompress->Output->SlideWin; @@ -159,7 +160,7 @@ int Unreduce(CDecompressionObject* decompress) /* expand probabilistically reduc nchar = followers[lchar][follower]; } } - /* expand the resulting byte */ + /* decode the resulting byte */ switch (ExState) { From 0375240f9f3a1af233da0020cdb32debdb01b380 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 00:03:10 +0200 Subject: [PATCH 560/710] [translation] Fix src/plugins/zip/unshrink.cpp comments Refines translated comments in src/plugins/zip/unshrink.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed PR #839 for src/plugins/zip/unshrink.cpp, restored the required CommentsTranslationProject translated marker on the head branch when needed, reran clang-format, waited for the live GitHub checks to finish green, and confirmed the final branch diff remained comment-only before squash merge. Telemetry: No additional provider-backed review stages were required during final PR review; this merge uses the existing artifact-backed translation branch with a metadata repair commit for the translated-file marker when needed. --- src/plugins/zip/unshrink.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/zip/unshrink.cpp b/src/plugins/zip/unshrink.cpp index 9d94441c4..8b404faae 100644 --- a/src/plugins/zip/unshrink.cpp +++ b/src/plugins/zip/unshrink.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" #include @@ -268,7 +269,7 @@ int Unshrink(CDecompressionObject* decompress) /* search for freecode */ freecode = (short)(lastfreecode + 1); - /* add if-test before loop for speed? */ + /* Add an if-test before the loop for speed? */ while (parent[freecode] != FREE_CODE) ++freecode; lastfreecode = freecode; @@ -303,7 +304,7 @@ void partial_clear(short* parent) /* clear all nodes which have no children (i.e., leaf nodes only) */ - /* first loop: mark each parent as such */ + /* first loop: mark each parent as having a child */ for (code = BOGUSCODE + 1; code < HSIZE; ++code) { short cparent = (short)(parent[code] & CODE_MASK); From 412de3fabe38bc8791d7557c2438cc7ad735c329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 05:09:25 +0200 Subject: [PATCH 561/710] [translation] Fix src/shellib.cpp comments Refines translated comments in src/shellib.cpp. Model: OpenAI GPT-5.4 Verification: Ran node --experimental-strip-types src/sequential-review.ts --target-root /mnt/d/Source/OpenSal/salamander_upstream --translation-source /mnt/d/Source/OpenSal/salamander_upstream --baseline-source gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b --artifacts-dir /mnt/d/source/ostranslation/artifacts/src-shellib-cpp-20260419-run1 --cost-profile cheap-first for the corresponding source set, materialized the approved draft for src/shellib.cpp into the fork checkout, reran guard against the fork checkout with 0 violations, and ran git diff --check -- src/shellib.cpp. Before merge, manually re-reviewed the live PR branch diff and restored the broken two-line inline comment structure at OurClipDataObject while keeping the branch comment-only. Telemetry: Provider-backed stages for this artifact used 46 calls and 677180 total estimated tokens overall. The final manual fixup commit did not require a provider-backed rerun. --- src/shellib.cpp | 98 ++++++++++++++++++++++++------------------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/src/shellib.cpp b/src/shellib.cpp index 7c8da48f8..e7acc91b4 100644 --- a/src/shellib.cpp +++ b/src/shellib.cpp @@ -156,7 +156,7 @@ void CImpDropTarget::SetDirectory(const char* path, DWORD grfKeyState, POINTL pt strcpy(CurDir, path); } } - else // archives + filesystem + else // archives + file system { if (CurDirDropTarget != NULL) { @@ -190,15 +190,15 @@ BOOL CImpDropTarget::ProcessClipboardData(BOOL copy, const DROPFILES* data, CCopyMoveData* array = new CCopyMoveData(100, 50); if (array != NULL) { - // array->MakeCopyOfName will be TRUE if it is our own copy & paste from the clipboard - // (copying with the rule that if the destination already exists, "Copy of ..." will be created) - // array->MakeCopyOfName = copy && OurClipDataObject && mapA == NULL && mapW == NULL; // to make it work even through drag&drop + // array->MakeCopyOfName is TRUE for our own copy-and-paste from the clipboard + // (copying where, if the destination already exists, "Copy of ..." will be created) + // array->MakeCopyOfName = copy && OurClipDataObject && mapA == NULL && mapW == NULL; // so it also works via drag and drop array->MakeCopyOfName = copy && mapA == NULL && mapW == NULL; // only our data object arrives here if (data->fWide) { const wchar_t* fileW = (wchar_t*)(((char*)data) + data->pFiles); - while (1) // double null terminated, assumes no empty strings (start) + while (1) // double-null-terminated; does not handle empty strings at the start { if (*fileW == 0) { @@ -334,7 +334,7 @@ BOOL IsSimpleSelection(IDataObject* pDataObject, CDragDropOperData* namesList) { CALL_STACK_MESSAGE1("IsSimpleSelection()"); BOOL ret = FALSE; - if (pDataObject != NULL && !IsFakeDataObject(pDataObject, NULL, NULL, 0)) // data from an archive or plug-in filesystem are not accepted here + if (pDataObject != NULL && !IsFakeDataObject(pDataObject, NULL, NULL, 0)) // data from an archive or plugin filesystem are not accepted here { IEnumFORMATETC* enumFormat; if (pDataObject->EnumFormatEtc(DATADIR_GET, &enumFormat) == S_OK) @@ -345,12 +345,12 @@ BOOL IsSimpleSelection(IDataObject* pDataObject, CDragDropOperData* namesList) UINT CF_FileMapA = RegisterClipboardFormat(CFSTR_FILENAMEMAPA); UINT CF_FileMapW = RegisterClipboardFormat(CFSTR_FILENAMEMAPW); - // Windows XP Remote Desktop problem, viz https://forum.altap.cz/viewtopic.php?p=13176#13176 - // If we detect truncated versions of format names, it is almost certainly Remote Desktop + // Windows XP Remote Desktop problem, see https://forum.altap.cz/viewtopic.php?p=13176#13176 + // If we detect truncated versions of the format names, it is most likely Remote Desktop // and we must not call pDataObject->GetData(), because that would trigger copying the file on the remote machine - // to our temp directory and we would stay frozen during that time - // Since Windows Vista the problem has been fixed and the names are no longer truncated, so this patch - // concerns only XP. + // to our temp directory, and we would remain frozen for that entire time + // Starting with Windows Vista, the problem is fixed and the names are no longer truncated, so this patch + // affects only XP. BOOL cfRemoteDesktop1 = FALSE; BOOL cfRemoteDesktop2 = FALSE; BOOL cfRemoteDesktop3 = FALSE; @@ -520,7 +520,7 @@ BOOL IsSimpleSelection(IDataObject* pDataObject, CDragDropOperData* namesList) const char* fileA = ((char*)data) + data->pFiles; while (1) // double null terminated, assumes no empty strings (start) { - if (*fileA == 0) // no more names, success! + if (*fileA == 0) // no more names remain; success { if (namesList != NULL) // add the common path of all names to namesList { @@ -666,10 +666,10 @@ STDMETHODIMP CImpDropTarget::DragEnter(IDataObject* pDataObject, } } - if (CurDirDropTarget != NULL) // jen idtttWindows + if (CurDirDropTarget != NULL) // only idtttWindows { HRESULT res = CurDirDropTarget->DragEnter(pDataObject, grfKeyState, pt, pdwEffect); - if (res != S_OK) // drop-target error - report it as a "none" drop effect because + if (res != S_OK) // drop-target error - report it as a "none" drop effect because other drop targets in the panel may still work { // other drop targets in the panel may still work LastEffect = -1; *pdwEffect = DROPEFFECT_NONE; @@ -734,7 +734,7 @@ STDMETHODIMP CImpDropTarget::DragEnter(IDataObject* pDataObject, pdwEffect, GetFSToFSDropEffectParam); DragFromPluginFSEffectIsFromPlugin = TRUE; } - else // from disk to archive and from disk to FS: Copy has priority + else // from disk to archive and from disk to FS: Copy takes priority { if ((*pdwEffect & DROPEFFECT_COPY) != 0) *pdwEffect = DROPEFFECT_COPY; @@ -786,7 +786,7 @@ STDMETHODIMP CImpDropTarget::DragOver(DWORD grfKeyState, POINTL pt, SetDirectory(NULL, grfKeyState, pt, pdwEffect, OldDataObject, FALSE, idtttWindows); } } - if (CurDirDropTarget != NULL) // jen idtttWindows + if (CurDirDropTarget != NULL) // only idtttWindows { HRESULT res = CurDirDropTarget->DragOver(grfKeyState, pt, pdwEffect); if (res == S_OK && OldDataObjectIsFake) @@ -804,7 +804,7 @@ STDMETHODIMP CImpDropTarget::DragOver(DWORD grfKeyState, POINTL pt, { if ((origEffect & DROPEFFECT_MOVE) != 0) *pdwEffect = DROPEFFECT_MOVE; - else // drop-target error + else // drop target failure { *pdwEffect = DROPEFFECT_NONE; pdwEffect = NULL; @@ -974,7 +974,7 @@ STDMETHODIMP CImpDropTarget::Drop(IDataObject* pDataObject, DWORD grfKeyState, } else { - if (CurDirDropTarget != NULL) // obtain the default drop effect + if (CurDirDropTarget != NULL) // determine the default drop effect { CurDirDropTarget->DragOver(grfKeyState, pt, &defEffect); } @@ -1011,7 +1011,7 @@ STDMETHODIMP CImpDropTarget::Drop(IDataObject* pDataObject, DWORD grfKeyState, defEffect = 0; // drop-target error DragFromPluginFSEffectIsFromPlugin = TRUE; } - else // from disk to archive and from disk to FS: Copy has priority + else // from disk to archive and from disk to FS: copy takes priority { if ((defEffect & DROPEFFECT_COPY) != 0) defEffect = DROPEFFECT_COPY; @@ -1036,7 +1036,7 @@ STDMETHODIMP CImpDropTarget::Drop(IDataObject* pDataObject, DWORD grfKeyState, *pdwEffect = defEffect; origEffect = *pdwEffect; - if (CurDirDropTarget != NULL) // info about key changes (shift+control for other...), probably redundant since W2K + if (CurDirDropTarget != NULL) // information about modifier key changes (Shift+Control and others), probably redundant since Windows 2000 { CurDirDropTarget->DragOver(grfKeyState, pt, &defEffect); defEffect = *pdwEffect; @@ -1089,7 +1089,7 @@ STDMETHODIMP CImpDropTarget::Drop(IDataObject* pDataObject, DWORD grfKeyState, else { defEffect = *pdwEffect; - if (CurDirDropTarget != NULL) // obtain the default drop effect + if (CurDirDropTarget != NULL) // determine the default drop effect { CurDirDropTarget->DragOver(grfKeyState, pt, &defEffect); } @@ -1103,7 +1103,7 @@ STDMETHODIMP CImpDropTarget::Drop(IDataObject* pDataObject, DWORD grfKeyState, if (ownRutine && (defEffect == DROPEFFECT_COPY || defEffect == DROPEFFECT_MOVE) && pDataObject != NULL && DoCopyMove != NULL) - { // are we unable to perform the operation ourselves? + { // can we perform the operation ourselves? IEnumFORMATETC* enumFormat; if (pDataObject->EnumFormatEtc(DATADIR_GET, &enumFormat) == S_OK) { @@ -1200,7 +1200,7 @@ STDMETHODIMP CImpDropTarget::Drop(IDataObject* pDataObject, DWORD grfKeyState, CurDirDropTarget = NULL; } } - else // archives and filesystem + else // archives and file systems { if (TgtType == idtttArchive || TgtType == idtttPluginFS || TgtType == idtttArchiveOnWinPath || TgtType == idtttFullPluginFSPath) @@ -1227,7 +1227,7 @@ STDMETHODIMP CImpDropTarget::Drop(IDataObject* pDataObject, DWORD grfKeyState, origKeyState, pdwEffect, GetFSToFSDropEffectParam); DragFromPluginFSEffectIsFromPlugin = TRUE; } - else // from disk to archive and from disk to FS: Copy has priority + else // from disk to archive and from disk to FS: COPY takes priority { if ((*pdwEffect & DROPEFFECT_COPY) != 0) *pdwEffect = DROPEFFECT_COPY; @@ -1421,7 +1421,7 @@ LPITEMIDLIST GetItemIdListForFileName(LPSHELLFOLDER folder, const char* fileName enumNamePrefix == NULL && StrICmp(name, fileName) == 0) // we found the share we were looking for { foundPidl = idList; - break; // PIDL found (obtained) + break; // PIDL found } } } @@ -1522,9 +1522,9 @@ ITEMIDLIST** CreateItemIdList(LPSHELLFOLDER folder, int files, for (i = 0; i < files; i++) { const char* fileName = nextFile(i, param); - // for example, to obtain a working data object, the contained names must be valid, - // drag&drop of an invalid name results in an operation on a name with silently trimmed spaces/dots - // at the end (instead of "a " it uses "a"), which we definitely do not want + // for example, to obtain a working data object, the contained names must be valid. + // Drag and drop of an invalid name results in an operation on a name with silently trimmed trailing spaces/dots + // (instead of "a " it uses "a"), which we definitely do not want if (namesMustBeValid && FileNameIsInvalid(fileName, FALSE)) { TRACE_I("CreateItemIdList: unable to create IdList becuase of invalid name: \"" << fileName << "\""); @@ -1535,7 +1535,7 @@ ITEMIDLIST** CreateItemIdList(LPSHELLFOLDER folder, int files, if (pidl != NULL) list[i] = pidl; else - break; // some error + break; // error } if (pidl == NULL) @@ -1564,8 +1564,8 @@ BOOL GetShellFolder(const char* dir, IShellFolder*& shellFolderObj, LPITEMIDLIST HRESULT ret; LPSHELLFOLDER desktop; // if the path contains components ending with spaces or dots, the shell will not return - // the folder for the requested path, but only for the path created by trimming those - // spaces/dots, so we should give up on it early... + // the folder for the requested path, but for the path created by trimming those + // spaces/dots, so it is better to give up early if (PathContainsValidComponents((char*)dir, FALSE)) { if (SUCCEEDED((ret = SHGetDesktopFolder(&desktop)))) @@ -1665,10 +1665,10 @@ BOOL GetShellFolder(const char* dir, IShellFolder*& shellFolderObj, LPITEMIDLIST if (name != NULL) { - if (strlen(name) <= 3 && StrNICmp(name, root, 2) == 0) // name = "c:" nebo "c:\" + if (strlen(name) <= 3 && StrNICmp(name, root, 2) == 0) // name = "c:" or "c:\" { pidlFolder = idList; - break; // PIDL found (obtained) + break; // PIDL found } } } @@ -1775,7 +1775,7 @@ BOOL GetShellFolder(const char* dir, IShellFolder*& shellFolderObj, LPITEMIDLIST LPSHELLFOLDER swap = shellFolderObj; shellFolderObj = folder2; folder2 = swap; - break; // PIDL found (obtained) + break; // PIDL found } } } @@ -2173,15 +2173,15 @@ void OpenFolderAndFocusItem(HWND hOwnerWindow, const char* dir, const char* item { CALL_STACK_MESSAGE2("OpenFolder(, %s)", dir); // if the path contains components ending with spaces or dots, the shell will not return - // the PIDL for the requested path, but for the path created by trimming those - // spaces/dots, so it is better to give up on it early... + // a PIDL for the requested path, but for the path produced by trimming those + // spaces/dots, so it is better to give up early char mydir[2 * MAX_PATH]; strcpy(mydir, dir); if (item[0] != 0) SalPathAppend(mydir, item, 2 * MAX_PATH); if (PathContainsValidComponents((char*)mydir, FALSE)) { - BOOL useOldMethod = TRUE; // SHOpenFolderAndSelectItems is supported from XP onward, and we still run on W2K and XP without SPx + BOOL useOldMethod = TRUE; // SHOpenFolderAndSelectItems is supported on XP and later, and we still run on W2K and on XP without any service pack if (item[0] != 0) // if no item should be selected, avoid using SHOpenFolderAndSelectItems because it would display the parent directory (see MSDN) { HMODULE hShell32 = LoadLibrary("shell32.dll"); @@ -2330,12 +2330,12 @@ BOOL GetTargetDirectoryAux(HWND parent, HWND hCenterWindow, bi.pszDisplayName = display; bi.lpszTitle = comment; bi.ulFlags = BIF_RETURNONLYFSDIRS; - /* j.r.: under W2K, after opening, the focus is set to OK instead of the tree view (as it used to); - moreover, ensure_visible stops working; simply AWFUL, so we are returning to the old version of the dialog; - we may rewrite it later. - if (!onlyNet) // Petr: the Network dialog works only in the old version - the new one cannot ask the user for server login credentials (when the current login is not sufficient) - bi.ulFlags |= BIF_NEWDIALOGSTYLE; // larger and resizable dialog - */ + /* j.r.: under W2K, after opening, the focus is set to OK instead of the tree view (as it used to be); + moreover, ensure_visible does not work; the behavior is poor, so we are returning to the old version of the dialog; + we may rewrite it later. + if (!onlyNet) // Petr: the Network dialog works only in the old version - the new one cannot ask the user for server login credentials (when the current login is not sufficient) + bi.ulFlags |= BIF_NEWDIALOGSTYLE; // larger and resizable dialog + */ bi.lpfn = DirectoryBrowse; CBrowseData bd; bd.Title = title; @@ -2371,14 +2371,14 @@ BOOL GetTargetDirectoryAux(HWND parent, HWND hCenterWindow, void ResolveNetHoodPath(char* path) { if (path[0] == '\\') - return; // UNC path -> cannot be NetHood + return; // UNC path, so it cannot be NetHood char name[MAX_PATH]; GetRootPath(name, path); if (GetDriveType(name) != DRIVE_FIXED) return; // not a local fixed path -> cannot be NetHood - BOOL tryTarget = FALSE; // if TRUE, it is worth trying to find the "target.lnk" file + BOOL tryTarget = FALSE; // if TRUE, try to find the "target.lnk" file lstrcpyn(name, path, MAX_PATH); if (SalPathAppend(name, "desktop.ini", MAX_PATH)) { @@ -2397,7 +2397,7 @@ void ResolveNetHoodPath(char* path) { char* s = buf; char* end = buf + read; - while (s < end) // search the file for the CLSID "folder shortcut" + while (s < end) // Search the file for the "folder shortcut" CLSID { if (*s == '{') { @@ -2541,7 +2541,7 @@ void GetNewOrBackgroundMenu(HWND hOwnerWindow, const char* dir, CMenuNew* menu, GetMenuNewAux(contextMenu2, m, minCmd, maxCmd); RemoveUselessSeparatorsFromMenu(m); - if (backgoundMenu) // take the entire background menu + if (backgoundMenu) // use the entire background menu { menu->Set(contextMenu2, m); } @@ -2702,7 +2702,7 @@ STDMETHODIMP CTextDataObject::GetData(FORMATETC* formatEtc, STGMEDIUM* medium) dataDup = NULL; } } - if (dataDup != NULL) // we have the data, store them in the medium and return + if (dataDup != NULL) // we have the data, store it in the medium and return { medium->tymed = TYMED_HGLOBAL; medium->hGlobal = dataDup; @@ -2801,7 +2801,7 @@ BOOL GetSHObjectName(ITEMIDLIST* pidl, DWORD flags, char* name, int nameSize, IM } desktopFolder->Release(); } - else // empty list of IDs = the folder is the desktop itself + else // empty ID list = the folder is the desktop itself folder = desktopFolder; if (folder != NULL) From 19391783f1f01e5cdba680ee82a2e2a0738d4f45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 05:09:59 +0200 Subject: [PATCH 562/710] [translation] Fix src/shexreg.h comments Refines translated comments in src/shexreg.h. Model: OpenAI GPT-5.4 Verification: Ran node --experimental-strip-types src/sequential-review.ts --target-root /mnt/d/Source/OpenSal/salamander_upstream --translation-source /mnt/d/Source/OpenSal/salamander_upstream --baseline-source gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b --artifacts-dir /mnt/d/source/ostranslation/artifacts/src-shexreg-h-20260419-run1 --cost-profile cheap-first for the corresponding source set, materialized the approved draft for src/shexreg.h into the fork checkout, reran guard against the fork checkout with 0 violations, and ran git diff --check -- src/shexreg.h. Before merge, manually re-reviewed the live PR branch diff and corrected the API contract wording for SECGetItem and SECGetItemIndex while keeping the branch comment-only. Telemetry: Provider-backed stages for this artifact used 10 calls and 167988 total estimated tokens overall. The final manual fixup commit did not require a provider-backed rerun. --- src/shexreg.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/shexreg.h b/src/shexreg.h index b5c77f895..6d84ab295 100644 --- a/src/shexreg.h +++ b/src/shexreg.h @@ -17,8 +17,8 @@ // // -// included in Open Salamander for configuration and inter-process communication -// and simultaneously compiled into SHELLEXT.DLL for presentation and coordination +// part of Open Salamander for configuration and mutual communication +// and also part of SHELLEXT.DLL for presentation and mutual communication // // @@ -149,7 +149,7 @@ extern DWORD ShellExtConfigVersion; // returns the item at the specified index CShellExtConfigItem* SECGetItem(int index); -// if an item with matching Cmd is found, fills index and returns TRUE; otherwise returns FALSE +// if an item with a matching Cmd is found, stores the found item's index in index and returns TRUE; otherwise returns FALSE BOOL SECGetItemIndex(UINT cmd, int* index); BOOL SECLoadRegistry(); @@ -227,14 +227,13 @@ typedef struct CSalShExtSharedMem CSalShExtSharedMem; #ifdef INSIDE_SALAMANDER -// writes the registry entries required by the library -// parameters: path to the library, whether to skip loading the DLL when verifying its version, -// and the registry view (0, 32-bit, or 64-bit) that should be updated +// writes the registry entries needed for the library to work +// parameters: path to the library; FALSE/TRUE = test/do not test the DLL version by loading it; and 0 or the registry view (32-bit or 64-bit) to write to BOOL SECRegisterToRegistry(const char* shellExtensionPath, BOOL doNotLoadDLL, REGSAM regView); #ifdef ENABLE_SH_MENU_EXT -// saves the configuration to the registry +// saves data to the registry BOOL SECSaveRegistry(); // returns the number of items in the list From ed9c2e061eb77de12a914fa8a6b414792e9c1803 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 05:12:16 +0200 Subject: [PATCH 563/710] [translation] Fix src/salamand.h comments Refines translated comments in src/salamand.h. Model: OpenAI GPT-5.4 Verification: Ran node --experimental-strip-types src/sequential-review.ts --target-root /mnt/d/Source/OpenSal/salamander_upstream --translation-source /mnt/d/Source/OpenSal/salamander_upstream --baseline-source gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b --artifacts-dir /mnt/d/source/ostranslation/artifacts/src-salamand-h-20260419-run1 --cost-profile cheap-first for the corresponding source set, materialized the approved draft for src/salamand.h into the fork checkout, reran guard against the fork checkout with 0 violations, and ran git diff --check -- src/salamand.h. Before merge, manually re-reviewed the live PR branch against the implementation sites in salamdr3.cpp, salamdr4.cpp, and salamdr6.cpp and restored the API-accurate wording for Contains, Equal, CleanName, CDynamicStringImp::Add, and the CShares data field while keeping the branch comment-only. Telemetry: Provider-backed stages for this artifact used 18 calls and 324986 total estimated tokens overall. The final manual fixup commits did not require a provider-backed rerun. --- src/salamand.h | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/src/salamand.h b/src/salamand.h index 29029dd2f..7d8ee1a54 100644 --- a/src/salamand.h +++ b/src/salamand.h @@ -111,8 +111,7 @@ class CNames // sorts the Dirs and Files lists so that Contains() can be called; void Sort(); - // returns TRUE if the name specified through 'nameIsDir' and 'name' is present in one - // of the arrays; if 'foundOnIndex' is not NULL, it returns the index where the item was found + // returns TRUE if the name specified by 'nameIsDir' and 'name' is present in one of the arrays; if 'foundOnIndex' is not NULL, it receives the index at which the item was found BOOL Contains(BOOL nameIsDir, const char* name, int* foundOnIndex = NULL); // returns the total number of stored names @@ -259,7 +258,7 @@ class CFileHistoryItem BOOL IsGood() { return FileName != NULL; } - // returns TRUE if the object was constructed from the specified data + // returns TRUE if the object matches the specified data BOOL Equal(CFileHistoryItemTypeEnum type, DWORD handlerID, const char* fileName); BOOL Execute(); @@ -406,7 +405,7 @@ class CViewTemplates void Set(DWORD index, const char* name, DWORD flags, BOOL leftSmartMode, BOOL rightSmartMode); BOOL SwapItems(int index1, int index2); // swaps two items in the array - BOOL CleanName(char* name); // trims spaces and returns TRUE if name is ok + BOOL CleanName(char* name); // trims spaces and returns TRUE if name is not empty int SaveColumns(CColumnConfig* columns, char* buffer); // convert the array to a string void LoadColumns(CColumnConfig* columns, char* buffer); // and back again @@ -449,9 +448,9 @@ class CDynamicStringImp : public CDynamicString // detaches the data from the object (so the buffer is not deallocated in the object's destructor) void DetachData(); - // returns TRUE if the string 'str' of length 'len' was successfully appended; if 'len' is -1, - // 'len' is determined as "strlen(str)" (addition without the trailing zero); if 'len' is -2, - // 'len' is determined as "strlen(str)+1" (addition including the trailing zero) + // returns TRUE if the string 'str' of length 'len' was added successfully; if 'len' is -1, + // it is determined as "strlen(str)" (without the terminating null); if 'len' is -2, + // it is determined as "strlen(str)+1" (including the terminating null) virtual BOOL WINAPI Add(const char* str, int len = -1); }; @@ -523,7 +522,7 @@ class CShares { protected: CRITICAL_SECTION CS; // section used to synchronize object data - TIndirectArray Data; // list of shares + TIndirectArray Data; // list of shared resources TIndirectArray Wanted; // list of references into Data interesting for searching BOOL SubsetOnly; @@ -749,7 +748,7 @@ extern CSystemPolicies SystemPolicies; // ensures ArrangeHorizontalLines is called for all dialogs // // If 'HCenterAgains' is different from NULL, it is centered to it, otherwise to the parent. -// sets the message box parent for plug-ins to this dialog (only while it exists) +// sets the message box parent for plugins to this dialog (only while it exists) // class CCommonDialog : public CDialog @@ -840,10 +839,9 @@ class CMessagesKeeper // returns the number of valid messages int GetCount() { return Count; } - // inserts the item according to 'index' into 'buffer' (pass buffer size in 'buffMax') - // 'index': for value 0 it will be the oldest item, for value Count - // it will be the last added message - // if the index is out of the array, it inserts the text "error" + // inserts the item selected by 'index' into 'buffer' (pass the buffer size in 'buffMax') + // 'index': value 0 is the oldest item; value Count - 1 is the last added message + // if 'index' is out of range, inserts the text "error" void Print(char* buffer, int buffMax, int index); }; @@ -866,7 +864,7 @@ extern CMessagesKeeper MessagesKeeper; struct CWayPoint { DWORD WayPoint; // value defined in the code - WPARAM CustomData1; // user-defined value + WPARAM CustomData1; // user value LPARAM CustomData2; // user-defined value DWORD Time; // insertion time }; @@ -900,10 +898,9 @@ class CWayPointsKeeper return count; } - // inserts the item according to 'index' into 'buffer' (pass buffer size in 'buffMax') - // 'index': for value 0 it will be the oldest item, value Count - // it will be the last added waypoint - // if the index is out of the array, it inserts the text "error" + // inserts the item selected by 'index' into 'buffer' (pass the buffer size in 'buffMax') + // 'index': value 0 is the oldest item; value Count - 1 is the last added waypoint + // if 'index' is out of range, inserts the text "error" void Print(char* buffer, int buffMax, int index); }; From 1d68f8ee43c7854a84ccdf501ce70822125347b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 05:13:30 +0200 Subject: [PATCH 564/710] [translation] Fix src/shexreg.c comments Refines translated comments in src/shexreg.c. Model: OpenAI GPT-5.4 Verification: Ran node --experimental-strip-types src/sequential-review.ts --target-root /mnt/d/Source/OpenSal/salamander_upstream --translation-source /mnt/d/Source/OpenSal/salamander_upstream --baseline-source gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b --artifacts-dir /mnt/d/source/ostranslation/artifacts/src-shexreg-c-20260419-run1 --cost-profile cheap-first for the corresponding source set, materialized the approved draft for src/shexreg.c into the fork checkout, reran guard against the fork checkout with 0 violations, and ran git diff --check -- src/shexreg.c. Before merge, manually re-reviewed the live PR diff and confirmed that the open review comments describe stylistic tightening only, not a semantic or structural defect, so the branch was merged unchanged. Telemetry: Provider-backed stages for this artifact used 8 calls and 92576 total estimated tokens overall. No additional provider-backed rerun was needed before merge. --- src/shexreg.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/shexreg.c b/src/shexreg.c index 324ae7ea0..1af8ad9e0 100644 --- a/src/shexreg.c +++ b/src/shexreg.c @@ -401,10 +401,11 @@ BOOL MyCreateKey(HKEY hKey, const char* name, HKEY* createdKey, REGSAM regView) return res == ERROR_SUCCESS; } -// our version of the RegQueryValueEx function, unlike the API variant it ensures -// a null terminator is added for types REG_SZ, REG_MULTI_SZ, and REG_EXPAND_SZ -// NOTE: when determining the required buffer size it returns one or two extra characters -// (two only for REG_MULTI_SZ) in case the string needs to be terminated with null(s) +// our version of RegQueryValueEx, unlike the API version, ensures +// that a null terminator is added for REG_SZ, REG_MULTI_SZ, and REG_EXPAND_SZ +// NOTE: when determining the required buffer size, it returns one or two extra +// characters (two only for REG_MULTI_SZ) in case the string needs to be +// terminated with a null character or null characters LONG SalRegQueryValueEx(HKEY hKey, LPCSTR lpValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData); @@ -430,19 +431,19 @@ BOOL CheckVersionOfDLL(const char* name) return ok; } -// Info for UNINSTALL: (the uninstall routine is implemented in DllUnregisterServer()) -// - since version 2.5 RC2, this is no longer used: - delete files from TEMP (default value in HKEY_CLASSES_ROOT\CLSID\{C78B6131-F3EA-11D2-94A1-00E0292A01E3}\InProcServer32) -// (keep in mind that it may not be possible to delete it immediately - be able to schedule it after the machine reboots) -// - since version 3.0 B1: take into account that utils\salextx86.dll and salextx64.dll may not be possible to delete immediately - be able to schedule it after the machine reboots +// Notes for UNINSTALL: (the uninstall routine is implemented in DllUnregisterServer()) +// - since version 2.5 RC2, this is no longer used: delete the file from TEMP (the default value in HKEY_CLASSES_ROOT\CLSID\{C78B6131-F3EA-11D2-94A1-00E0292A01E3}\InProcServer32) +// (allow for the possibility that it cannot be deleted immediately; be able to schedule deletion after the next reboot) +// - since version 3.0 B1, allow for the possibility that utils\salextx86.dll and salextx64.dll cannot be deleted immediately; be able to schedule deletion after the next reboot // - delete HKEY_CLASSES_ROOT\CLSID\{C78B61??-F3EA-11D2-94A1-00E0292A01E3} (the current CLSID is in CLSID_ShellExtension) // - delete HKEY_CLASSES_ROOT\Directory\shellex\CopyHookHandlers\AltapSalamander?? (the current key name is in SHEXREG_OPENSALAMANDER) -// - delete value {C78B61??-F3EA-11D2-94A1-00E0292A01E3} in the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved +// - delete the value {C78B61??-F3EA-11D2-94A1-00E0292A01E3} from the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved // (the current CLSID is in CLSID_ShellExtension) // - if the macro ENABLE_SH_MENU_EXT is defined: // - delete HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\AltapSalamander?? (the current key name is in SHEXREG_OPENSALAMANDER) // - delete HKEY_CLASSES_ROOT\Directory\shellex\ContextMenuHandlers\AltapSalamander?? (the current key name is in SHEXREG_OPENSALAMANDER) -// - everything said above about HKEY_CLASSES_ROOT key must also be attempted to be deleted -// from HKEY_CURRENT_USER\Software\Classes key (used when the user does not have permission to write to +// - everything said above about the HKEY_CLASSES_ROOT key must also be attempted under the key +// HKEY_CURRENT_USER\Software\Classes (used when the user does not have permission to write to // HKEY_CLASSES_ROOT) BOOL SECRegisterToRegistry(const char* shellExtensionPath, BOOL doNotLoadDLL, REGSAM regView) { @@ -469,7 +470,7 @@ BOOL SECRegisterToRegistry(const char* shellExtensionPath, BOOL doNotLoadDLL, RE NULL); shellExtIID[MAX_PATH - 1] = 0; - // determine whether our shell extension is already registered, optionally where its DLL is and whether it is the correct version + // determine whether our shell extension is already registered and, if so, where its DLL is and whether it is the correct version registered = FALSE; lstrcpy(key, "CLSID\\"); lstrcat(key, shellExtIID); @@ -478,8 +479,8 @@ BOOL SECRegisterToRegistry(const char* shellExtensionPath, BOOL doNotLoadDLL, RE { if (MyGetValue(hKey, NULL /* default value */, REG_SZ, shellExtPath, MAX_PATH)) { - if (doNotLoadDLL && FileExists(shellExtPath) || // when I cannot load it, at least I verify that it exists - !doNotLoadDLL && CheckVersionOfDLL(shellExtPath)) // otherwise I load it and read back its version + if (doNotLoadDLL && FileExists(shellExtPath) || // if the DLL cannot be loaded, at least verify that it exists + !doNotLoadDLL && CheckVersionOfDLL(shellExtPath)) // otherwise load it and read its version { registered = TRUE; // the DLL is registered + it is the correct DLL version } From b15c90788c2c66d6b3d7177aebff4a71d8c5a105 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 05:36:36 +0200 Subject: [PATCH 565/710] [translation] Fix src/cache.cpp comments Refines translated comments in src/cache.cpp. Model: OpenAI GPT-5.4 Verification: Ran `node --experimental-strip-types src/sequential-review.ts --target-root /mnt/d/Source/OpenSal/salamander_upstream --translation-source /mnt/d/Source/OpenSal/salamander_upstream --baseline-source gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b --artifacts-dir /mnt/d/source/ostranslation/artifacts/src-cache-cpp-20260419-run1 --cost-profile cheap-first` for the corresponding source set, materialized the approved draft for `src/cache.cpp` into the fork checkout, reran `guard` against the fork checkout with 0 violations, and ran `git diff --check -- src/cache.cpp` before commit. The final diff updates 19 comment hunks in that file and leaves code untouched. Before merge, manually reviewed the live PR branch diff and confirmed the final branch head remains a comment-only change consistent with the inline review comments and green check results. Telemetry: Provider-backed stages for this artifact used 29 calls and 622474 total estimated tokens overall. The changed file `src/cache.cpp` accounted for 29 calls and 622474 estimated tokens. No additional provider-backed rerun was needed after the final manual pre-merge review. --- src/cache.cpp | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/src/cache.cpp b/src/cache.cpp index f060e2ca9..9fa7f991f 100644 --- a/src/cache.cpp +++ b/src/cache.cpp @@ -127,8 +127,7 @@ BOOL CCacheData::CleanFromDisk() else // deletion should be handled by the plugin { if (OwnDeletePlugin != NULL) // we can start deleting (the plugin cannot be unloaded); otherwise the file will not be deleted - { // won't be deleted (it's either already deleted or it's just - // disconnected - the plugin decides this during its unload + { // won't be deleted (it is either already deleted or just disconnected; the plugin decides this during unload) DeleteManager.AddFile(TmpName, OwnDeletePlugin); OwnDeletePlugin = NULL; // no more deleting will be done } @@ -647,7 +646,7 @@ void CCacheDirData::AddVictimsToArray(TDirectArray& victArr) BOOL CCacheDirData::DetachTmpFile(const char* tmpName) { - if (StrNICmp(tmpName, Path, PathLength) == 0) // if there's a chance that this is our tmp-file + if (StrNICmp(tmpName, Path, PathLength) == 0) // if there is a chance that this is our tmp file { int i; for (i = 0; i < Names.Count; i++) @@ -687,7 +686,7 @@ void CCacheDirData::FlushCache(const char* name) } } else - break; // there cannot be any more, stop here + break; // there can be no more; stop here } } @@ -866,7 +865,7 @@ CCacheHandles::CCacheHandles() : Handles(100, 50), Owners(100, 50) void CCacheHandles::Destroy() { CALL_STACK_MESSAGE1("CCacheHandles::Destroy()"); - if (Thread != NULL) // thread termination is required + if (Thread != NULL) // the thread needs to be terminated { SetEvent(Terminate); // "you should end now" if (WaitForSingleObject(Thread, 1000) == WAIT_TIMEOUT) // let's give it 1 second @@ -1044,7 +1043,7 @@ void CCacheHandles::WaitForIdle() { CALL_STACK_MESSAGE1("CCacheHandles::WaitForIdle()"); TRACE_I("CCacheHandles::WaitForIdle begin"); - Idle = 1; // we are asking + Idle = 1; // asking whether we're idle SetEvent(TestIdle); // if the watching thread is waiting, we will stop the wait (we will run the idle-state test) WaitForSingleObject(IsIdle, INFINITE); // we are waiting for idle TRACE_I("CCacheHandles::WaitForIdle end"); @@ -1270,7 +1269,7 @@ BOOL CDiskCache::ReleaseName(const char* name, BOOL storeInCache) if (Dirs[i]->ReleaseName(name, &ret, &lastCached, storeInCache)) // 'name' found { if (lastCached) // The tmp-file is orphaned and cached; we will see whether it already needs to be released. - { // to release it, or if we need to release space on disk + { // Check whether we need to free up disk space. CheckCachedFiles(); } Leave(); @@ -1325,7 +1324,7 @@ void CDiskCache::CheckCachedFiles() Dirs[i]->AddVictimsToArray(victArr); } if (!victArr.IsGood()) - return; // low memory, we won't perform optimization + return; // low memory, optimization will not be performed if (victArr.Count > 1) SortVictims(victArr, 0, victArr.Count - 1); int actVict = 0; @@ -1343,9 +1342,9 @@ void CDiskCache::CheckCachedFiles() } } else - break; // at least one cached file must remain in cache, it will be - // the one which was released last, it prevents discarding - // of the file which the user is currently looking at + break; // at least one cached file must remain in the cache; + // it will be the one most recently released, + // preventing the file the user is currently viewing from being discarded } } } @@ -1357,13 +1356,13 @@ void CDiskCache::WaitSatisfied(HANDLE lock, CCacheData* owner) BOOL last; if (owner->WaitSatisfied(lock, &last)) { - if (last) // the tmp-file has no more links; we can cancel it + if (last) // the tmp file is orphaned; we can delete it { if (owner->IsCached()) // see if we already need to free some space - { // and free up disk space if needed + { // free up disk space if needed CheckCachedFiles(); } - else // we should delete the file directly + else // delete the file directly { int i; for (i = 0; i < Dirs.Count; i++) @@ -1602,7 +1601,7 @@ void CDeleteManager::ProcessData() if (BlockDataProcessing) return; - // we will lower the priority of the thread - we are going to delete a file to a plugin + // lower the thread priority; we are going to delete the file via the plugin SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_NORMAL); if (MainWindow != NULL) @@ -1673,10 +1672,10 @@ void CDeleteManager::PluginMayBeUnloaded(HWND parent, CPluginData* plugin) WaitingForProcessing = TRUE; // Block sending WM_USER_PROCESSDELETEMAN: it is undesirable and unnecessary; data will be processed at the end of the method HANDLES(LeaveCriticalSection(&CS)); - BlockDataProcessing = TRUE; // in case we missed a WM_TIMER posted to the main window (we block it because it can be delivered by the first displayed message box and its message loop) + BlockDataProcessing = TRUE; // in case a WM_TIMER posted to the main window would otherwise be missed (we block it because it can be delivered by the first displayed message box and its message loop) int copiesCount = DiskCache.CountNamesDeletedByPlugin(plugin->GetPluginInterface()->GetInterface()); - if (copiesCount > 0) // plugin still has some tmp-files opened (and it should ensure their deletion) + if (copiesCount > 0) // The plugin still has some temporary files open (and should ensure they are deleted) { if (plugin->PrematureDeleteTmpCopy(parent, copiesCount)) { // user wants to delete tmp-files, even if they are still opened (they are in viewers, etc.) From 3c059af77420177d549b3c9a86c11dd2da4c5373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 05:36:44 +0200 Subject: [PATCH 566/710] [translation] Fix src/cfgdlg.h comments Refines translated comments in src/cfgdlg.h. Model: OpenAI GPT-5.4 Verification: Ran `node --experimental-strip-types src/sequential-review.ts --target-root /mnt/d/Source/OpenSal/salamander_upstream --translation-source /mnt/d/Source/OpenSal/salamander_upstream --baseline-source gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b --artifacts-dir /mnt/d/source/ostranslation/artifacts/src-cfgdlg-h-20260419-run1 --cost-profile cheap-first` for the corresponding source set, materialized the approved draft for `src/cfgdlg.h` into the fork checkout, reran `guard` against the fork checkout with 0 violations, and ran `git diff --check -- src/cfgdlg.h` before commit. The final diff updates 15 comment hunks in that file and leaves code untouched. Before merge, manually reviewed the live PR branch diff and confirmed the final branch head remains a comment-only change consistent with the inline review comments and green check results. Telemetry: Provider-backed stages for this artifact used 6 calls and 122872 total estimated tokens overall. The changed file `src/cfgdlg.h` accounted for 6 calls and 122872 estimated tokens. No additional provider-backed rerun was needed after the final manual pre-merge review. --- src/cfgdlg.h | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/cfgdlg.h b/src/cfgdlg.h index d5d7882d0..442fc22ab 100644 --- a/src/cfgdlg.h +++ b/src/cfgdlg.h @@ -198,7 +198,6 @@ struct CConfiguration SaveWorkDirs, // store the List of Working Directories? EnableCmdLineHistory, // keep history of the command line? SaveCmdLineHistory, // store the command line history? - // LantasticCheck, // Lantastic 7.0 paranoid check (compare sizes after Copy) OnlyOneInstance, // allow just a single instance ForceOnlyOneInstance, // set from cmdline: Salamander should behave as if the OnlyOneInstance option is enabled StatusArea, // Salamander lives in the tray and won't appear in the taskbar when minimized @@ -223,7 +222,6 @@ struct CConfiguration TileSpacingVert, // vertical spacing in points between Tiles in the panel ThumbnailSpacingHorz, // horizontal spacing in points between Thumbnails in the panel ThumbnailSize, // square dimensions of thumbnails in points - // PanelTooltip, // shortened texts in panels get tooltips KeepPluginsSorted, // plugins will be sorted alphabetically (plugins manager, menu) ShowSLGIncomplete, // TRUE = if IsSLGIncomplete is not empty, show message about incomplete translation (we are looking for a translator) @@ -254,7 +252,7 @@ struct CConfiguration CnfrmCopyMoveOptionsNS, // Copy/Move: some Options are set but the target is FS/archive (options are NotSupported) // Drive specific - DrvSpecFloppyMon, // Use automatic refresh + DrvSpecFloppyMon, // Use automatic monitoring DrvSpecFloppySimple, // Use simple icons DrvSpecRemovableMon, DrvSpecRemovableSimple, @@ -274,7 +272,7 @@ struct CConfiguration int CompareSubdirs; int CompareSubdirsAttr; int CompareOnePanelDirs; // mark names of directories that exist only in one panel - int CompareMoreOptions; // is the dialog displayed in extended mode? + int CompareMoreOptions; // is the dialog shown in expanded mode? int CompareIgnoreFiles; // should specified filenames be ignored? int CompareIgnoreDirs; // should specified names of directories be ignored? CMaskGroup CompareIgnoreFilesMasks; @@ -351,7 +349,7 @@ struct CConfiguration SavePosition; // store window position / place relative to the main window CMaskGroup TextModeMasks; // mask array for files always shown in text mode - CMaskGroup HexModeMasks; // mask array for files always shown in hex mode + CMaskGroup HexModeMasks; // mask group for files always shown in hex mode WINDOWPLACEMENT WindowPlacement; // invalid unless SavePosition != TRUE @@ -405,7 +403,7 @@ struct CConfiguration // int ShowTipOfTheDay; // display Tip of the Day at program startup // int LastTipOfTheDay; // index of the last displayed tip - // plug-ins + // plugins int LastPluginVer; // ACTUAL_VERSION from plugins.ver (detect newly installed plugins) int LastPluginVerOP; // ACTUAL_VERSION from plugins.ver for the other platform (x86/x64); must be saved, otherwise we won't know if the configuration was overwritten by the other version. // Example: start x64, auto-save x64 with added pictview, start x86, auto-save x86 with added winscp (x86 pictview not added because it was already in the x64 config), exit/save x86, WARNING: exit/save x64 would remove the record of winscp (x64 knows nothing about winscp and continues running) @@ -432,7 +430,7 @@ struct CConfiguration BOOL PrepareRecycleMasks(int& errorPos); // prepare recycle-bin masks for use BOOL AgreeRecycleMasks(const char* fileName, const char* fileExt); - DWORD LastFocusedPage; // last visited page in the dialog + DWORD LastFocusedPage; // last focused page in the dialog DWORD ConfigurationHeight; // height of the configuration dialog in points BOOL ViewersAndEditorsExpanded; // expanded items in the tree BOOL PackersAndUnpackersExpanded; @@ -447,13 +445,13 @@ struct CConfiguration char SLGName[MAX_PATH]; // xxxxx.slg to use next time Salamander starts int DoNotDispCantLoadPluginSLG; // TRUE = suppress warning that an SLG with the same name cannot be loaded into the plugin as in Salamander int DoNotDispCantLoadPluginSLG2; // TRUE = suppress warning that the SLG plugin used last time (either user-selected or auto-selected) cannot be loaded - int UseAsAltSLGInOtherPlugins; // TRUE = try to use AltSLGName for plugins + int UseAsAltSLGInOtherPlugins; // TRUE = try to use AltPluginSLGName for plugins char AltPluginSLGName[MAX_PATH]; // only if UseAsAltSLGInOtherPlugins is TRUE: fallback SLG module for plugins (if LoadedSLGName for plugin does not exist) // Directory name convert\\XXX\\convert.cfg from which convert.cfg is loaded char ConversionTable[MAX_PATH]; - int TitleBarShowPath; // will we display the path in the title bar? + int TitleBarShowPath; // display the path in the title bar? int TitleBarMode; // title bar display mode (TITLE_BAR_MODE_xxx) int UseTitleBarPrefix; // should prefix be shown in the title bar? char TitleBarPrefix[TITLE_PREFIX_MAX]; // prefix for the title bar @@ -671,7 +669,7 @@ class CCfgPageUserMenu : public CCommonPropSheetPage void EnableButtons(); virtual INT_PTR DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam); - void DeleteSubmenuEnd(int index); // for opening the selected submenu ('index') remove the closing item + void DeleteSubmenuEnd(int index); // deletes the closing item for the selected submenu ('index') void RefreshGroupIconInUMItems(); // after changing colors, HGroupIcon changes; we must update it in UserMenuItems as well @@ -697,7 +695,7 @@ class CCfgPageHotPath : public CCommonPropSheetPage BOOL DisableNotification; BOOL EditMode; int EditIndex; - BOOL LabelEdit; // we are editing a label + BOOL LabelEdit; // label edit mode public: CCfgPageHotPath(BOOL editMode, int editIndex); From 5348ec9449302c75fafacbe7f19a3bd03d55a1bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 05:36:52 +0200 Subject: [PATCH 567/710] [translation] Fix src/codetbl.cpp comments Refines translated comments in src/codetbl.cpp. Model: OpenAI GPT-5.4 Verification: Ran `node --experimental-strip-types src/sequential-review.ts --target-root /mnt/d/Source/OpenSal/salamander_upstream --translation-source /mnt/d/Source/OpenSal/salamander_upstream --baseline-source gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b --artifacts-dir /mnt/d/source/ostranslation/artifacts/src-codetbl-cpp-20260419-run1 --cost-profile cheap-first` for the corresponding source set, materialized the approved draft for `src/codetbl.cpp` into the fork checkout, reran `guard` against the fork checkout with 0 violations, and ran `git diff --check -- src/codetbl.cpp` before commit. The final diff updates 10 comment hunks in that file and leaves code untouched. Before merge, manually reviewed the live PR branch diff and confirmed the final branch head remains a comment-only change consistent with the inline review comments and green check results. Telemetry: Provider-backed stages for this artifact used 7 calls and 128378 total estimated tokens overall. The changed file `src/codetbl.cpp` accounted for 7 calls and 128378 estimated tokens. No additional provider-backed rerun was needed after the final manual pre-merge review. --- src/codetbl.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/codetbl.cpp b/src/codetbl.cpp index a08f25705..87ae34bfa 100644 --- a/src/codetbl.cpp +++ b/src/codetbl.cpp @@ -975,7 +975,7 @@ void CCodeTables::RecognizeFileType(const char* pattern, int patternLen, BOOL fo } if (*s >= 128) nonAscii++; - if (IsNotAlphaNorNum[*s]) // character is neither alpha nor numeric + if (IsNotAlphaNorNum[*s]) // character is not alphanumeric { if (*s == '?') { @@ -1066,11 +1066,12 @@ void CCodeTables::RecognizeFileType(const char* pattern, int patternLen, BOOL fo s++; } - if (s == end) // this is a text - // && penalty / patternLen <= 5) // and not a totally unreadable mess (Lukas' test: - // characters 0x04 -> only EBCDIC passed, but ratio was - // 10 -> unreadable) - WARNING: unusable because - // configuraiton files and .inf files also look like complete mess based on 'penalty' + if (s == end) // this is text + // && penalty / patternLen <= 5) // and it is not a completely unreadable mess (Lukas's test: + // characters 0x04 -> only EBCDIC passed, but the ratio was + // 10 -> unreadable) - WARNING: unusable, because + // configuration files and .inf files also look like a complete mess + // according to 'penalty' { if (isText != NULL) *isText = TRUE; @@ -1082,7 +1083,7 @@ void CCodeTables::RecognizeFileType(const char* pattern, int patternLen, BOOL fo strcpy(codePage, lastCodePage); if (i == -1 && nonAscii * 200 < patternLen) - break; // under 0.5% non-ASCII characters -> ASCII, stop searching + break; // fewer than 0.5% non-ASCII characters -> ASCII, stop searching } } } @@ -1140,4 +1141,4 @@ int CCodeTables::GetConversionToWinCodePage(const char* codePage) } } return -1; // not found -} \ No newline at end of file +} From f8919fd4d4119019f45393a42c40ae7e04259e9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 05:36:59 +0200 Subject: [PATCH 568/710] [translation] Fix src/dialogs.h comments Refines translated comments in src/dialogs.h. Model: OpenAI GPT-5.4 Verification: Ran `node --experimental-strip-types src/sequential-review.ts --target-root /mnt/d/Source/OpenSal/salamander_upstream --translation-source /mnt/d/Source/OpenSal/salamander_upstream --baseline-source gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b --artifacts-dir /mnt/d/source/ostranslation/artifacts/src-dialogs-h-20260419-run1 --cost-profile cheap-first` for the corresponding source set, materialized the approved draft for `src/dialogs.h` into the fork checkout, reran `guard` against the fork checkout with 0 violations, and ran `git diff --check -- src/dialogs.h` before commit. The final diff updates 18 comment hunks in that file and leaves code untouched. Before merge, manually reviewed the live PR branch diff and confirmed the final branch head remains a comment-only change consistent with the inline review comments and green check results. Telemetry: Provider-backed stages for this artifact used 4 calls and 110548 total estimated tokens overall. The changed file `src/dialogs.h` accounted for 4 calls and 110548 estimated tokens. No additional provider-backed rerun was needed after the final manual pre-merge review. --- src/dialogs.h | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/dialogs.h b/src/dialogs.h index db68009ad..ba6e2d491 100644 --- a/src/dialogs.h +++ b/src/dialogs.h @@ -277,7 +277,7 @@ class CProgressDlgArray HWND GetNextOpenedDlg(int* index); // ensures all open dialogs are closed - // call only from the main thread (otherwise another dialog might open and it won't + // call only from the main thread (otherwise another dialog might open and won't // know it should terminate) void PostCancelToAllDlgs(); @@ -635,7 +635,7 @@ class CConvertFilesDlg : public CCommonDialog char Mask[MAX_PATH]; // which files will be converted? int Change; // which conversion should be performed? BOOL SubDirs; // include subdirectories? - int CodeType; // selected encoding (0 = none) + int CodeType; // which encoding is selected (0 = none) int EOFType; // selected line endings (0 = none) // 1 = CRLF // 2 = LF @@ -831,7 +831,7 @@ class CSplashScreen : public CDialog protected: CBitmap* Bitmap; // includes the text - CBitmap* OriginalBitmap; // graphics only, without text + CBitmap* OriginalBitmap; // bitmap only, without text HFONT HNormalFont; HFONT HBoldFont; RECT OpenSalR; @@ -935,7 +935,7 @@ class CChangeIconDialog : public CCommonDialog char* IconFile; int* IconIndex; BOOL Dirty; - HICON* Icons; // array of enumerated icon handles + HICON* Icons; // array of icon handles DWORD IconsCount; // number of icons in the array public: @@ -988,8 +988,8 @@ class CPluginsDlg : public CCommonDialog void InitColumns(); // add columns to the listview void SetColumnWidths(); // set optimal column widths void RefreshListView(BOOL setOnly = TRUE, int selIndex = -1, const CPluginData* selectPlugin = NULL, BOOL setColumnWidths = FALSE); - void OnSelChanged(); // selected item in the listview changed - CPluginData* GetSelectedPlugin(int* index = NULL, int* lvIndex = NULL); // returns NULL if no item is selected; index returns index to the Plugins array; lvIndex returns index within listview, can be NULL + void OnSelChanged(); // the selected item in the list view changed + CPluginData* GetSelectedPlugin(int* index = NULL, int* lvIndex = NULL); // returns NULL if no item is selected; index returns the index into the Plugins array; lvIndex returns the index within the list view and can be NULL void EnableButtons(CPluginData* plugin); void OnContextMenu(int x, int y); // show the context menu for the selected item at coordinates x, y void OnMove(BOOL up); @@ -1025,7 +1025,7 @@ class CPluginKeys : public CCommonDialog void RefreshListView(BOOL setOnly = TRUE); WORD GetHotKey(BYTE* virtKey = NULL, BYTE* mods = NULL); - CPluginMenuItem* GetSelectedItem(int* orgIndex); // orgIndex returns index to Plugin array->MenuItems; may be NULL + CPluginMenuItem* GetSelectedItem(int* orgIndex); // orgIndex receives the index into the Plugin->MenuItems array; it may be NULL CPluginMenuItem* GetItem(int index); void EnableButtons(); void HandleConflictWarning(); @@ -1167,9 +1167,9 @@ struct CImportOldKey class CImportConfigDialog : public CCommonDialog { public: - // array corresponding to SalamanderConfigurationRoots array; TRUE:the configuration exists, FALSE:it doesn't + // array corresponding to the SalamanderConfigurationRoots array; TRUE: configuration exists, FALSE: does not exist BOOL ConfigurationExist[SALCFG_ROOTS_COUNT]; - // pointer to the same sized array where the dialog stores TRUE for configurations to delete + // pointer to an array of the same size where the dialog stores TRUE for configurations to be deleted BOOL* DeleteConfigurations; // dialog returns here which configuration the user wants to import; -1 -> none // index points into the SalamanderConfigurationRoots array @@ -1213,7 +1213,7 @@ class CLanguageSelectorDialog : public CCommonDialog BOOL Initialize(const char* slgSearchPath = NULL, HINSTANCE pluginDLL = NULL); int GetLanguagesCount() { return Items.Count; } - BOOL GetSLGName(char* path, int index = 0); // returns xxxx.slg of the item at index 'index' + BOOL GetSLGName(char* path, int index = 0); // returns the xxxx.slg for the item at index 'index' BOOL SLGNameExists(const char* slgName); // checks whether 'slgName' exists in 'Items' void FillControls(); @@ -1286,8 +1286,8 @@ class CSharesDialog : public CCommonDialog public: CSharesDialog(HWND hParent); - const char* GetFocusedPath(); // returns the path of the selected share; call only after the dialog returns - // returns NULL if "Focus" wasn't clicked and the dialog returned IDOK + const char* GetFocusedPath(); // returns the path of the selected share; call only after Execute() returns + // returns NULL if the "Focus" button was not pressed and the dialog returned IDOK // from Execute() protected: @@ -1299,7 +1299,7 @@ class CSharesDialog : public CCommonDialog void Refresh(); // loads shared folders and adds them to the listview static int CALLBACK SortFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort); void SortItems(); // sorts items based on the SortBy variable - int GetFocusedIndex(); // returns index to SharetDirs array or -1 if no item is selected + int GetFocusedIndex(); // returns the index into the SharetDirs array, or -1 if no item is selected void DeleteShare(const char* shareName); // request the system to remove the share void OnContextMenu(int x, int y); // shows the context menu for the selected item at coordinates x, y void EnableControls(); // button enabler @@ -1349,9 +1349,9 @@ class CDisconnectDialog : public CCommonDialog CDisconnectDialog(CFilesWindow* panel); ~CDisconnectDialog(); - const char* GetFocusedPath(); // returns the path of the selected share; call only after the dialog returns - // returns NULL if "Focus" wasn't clicked and the dialog returned IDOK - // from Execute() + const char* GetFocusedPath(); // returns the path of the selected share; call only after Execute() returns + // returns NULL if the "Focus" button was not pressed and the dialog returned IDOK + // from Execute() BOOL NoConnection() { return NoConncection; } // returns TRUE if the dialog wasn't opened because there was no connection protected: @@ -1446,7 +1446,7 @@ class CCompareDirsDialog : public CCommonDialog int OriginalHeight; // full dialog height int OriginalButtonsY; // Y position of the buttons in client coordinates int SpacerHeight; // spacer used when shrinking/expanding the dialog - BOOL Expanded; // are we currently expanded? + BOOL Expanded; // is the dialog currently expanded? public: CCompareDirsDialog(HWND hParent, BOOL enableByDateAndTime, BOOL enableBySize, @@ -1499,7 +1499,7 @@ class CCmpDirProgressDialog : public CCommonDialog CITaskBarList3* TaskBarList3; // pointer to the interface owned by the Salamander main window public: - CCmpDirProgressDialog(HWND hParent, BOOL hasProgress, CITaskBarList3* taskBarList3); // if 'hasProgress' is TRUE, the dialog shows a progress bar + CCmpDirProgressDialog(HWND hParent, BOOL hasProgress, CITaskBarList3* taskBarList3); // if 'hasProgress' is TRUE, the dialog with a progress bar is used // text setup void SetSource(const char* text); From 1324661b7b790484bfbdfcf72bd6441cd7c82c95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 05:37:21 +0200 Subject: [PATCH 569/710] [translation] Fix src/fileswn3.cpp comments Refines translated comments in src/fileswn3.cpp. Model: OpenAI GPT-5.4 Verification: Ran `node --experimental-strip-types src/sequential-review.ts --target-root /mnt/d/Source/OpenSal/salamander_upstream --translation-source /mnt/d/Source/OpenSal/salamander_upstream --baseline-source gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b --artifacts-dir /mnt/d/source/ostranslation/artifacts/src-fileswn3-cpp-20260419-run1 --cost-profile cheap-first` for the corresponding source set, materialized the approved draft for `src/fileswn3.cpp` into the fork checkout, reran `guard` against the fork checkout with 0 violations, and ran `git diff --check -- src/fileswn3.cpp` before commit. The final diff updates 32 comment hunks in that file and leaves code untouched. Before merge, manually reviewed the live PR branch diff and confirmed the final branch head remains a comment-only change consistent with the inline review comments and green check results. Telemetry: Provider-backed stages for this artifact used 86 calls and 1285436 total estimated tokens overall. The changed file `src/fileswn3.cpp` accounted for 86 calls and 1285436 estimated tokens. No additional provider-backed rerun was needed after the final manual pre-merge review. --- src/fileswn3.cpp | 66 ++++++++++++++++++++++++------------------------ 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/src/fileswn3.cpp b/src/fileswn3.cpp index a8cfce4ca..6afefb4ca 100644 --- a/src/fileswn3.cpp +++ b/src/fileswn3.cpp @@ -617,7 +617,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) } else { - if (s >= st) // an extension exists + if (s >= st) // extension exists { while (*++s != 0) *st++ = LowerCase[*s]; @@ -635,7 +635,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) : 0; } - if (PackerFormatConfig.PackIsArchive(file.Name, file.NameLen)) // is it an archive that we can process? + if (PackerFormatConfig.PackIsArchive(file.Name, file.NameLen)) // is this an archive format we can handle? { file.Association = 1; file.Archive = 1; @@ -701,7 +701,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) } // at the file, we will check if it's necessary to load its thumbnail - if (readThumbnails && // thumbnails should be loaded + if (readThumbnails && // load thumbnails (file.Attr & FILE_ATTRIBUTE_DIRECTORY) == 0 && // (it is ptDisk, so using FILE_ATTRIBUTE_DIRECTORY is o.k.) file.Archive == 0) // archive icon is preferred before thumbnail { @@ -713,7 +713,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) if (p->ThumbnailMasks.AgreeMasks(file.Name, file.Ext) && !p->ThumbnailMasksDisabled) // its unload/remove is not in progress { - if (!p->GetLoaded()) // the plugin must be loaded (the "thumbnail loader" mask may change) + if (!p->GetLoaded()) // plugin needs to be loaded (the "thumbnail loader" mask may change) { // RefreshListBox(0, -1, -1, FALSE, FALSE); // replaced with ListBox->SetItemsCound + WM_USER_UPDATEPANEL, because it was blinking e.g. when adding the first *.doc file to a directory with images (Eroiica is loaded (for thumbnail *.doc)) @@ -767,7 +767,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) size -= (size & 0x3); // size % 4 (4-byte alignment) int nameSize = size; size += sizeof(CQuadWord) + sizeof(FILETIME); - size += (foundThumbLoaderPlugins.Count + 1) * sizeof(void*); // space for pointers to plugin interfaces + NULL at the end + size += (foundThumbLoaderPlugins.Count + 1) * sizeof(void*); // space for pointers to plugin interfaces and NULL at the end iconData.NameAndData = (char*)malloc(size); if (iconData.NameAndData != NULL) { @@ -819,8 +819,8 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) { memmove(iconData.NameAndData, file.Name, len); memset(iconData.NameAndData + len, 0, size - len); // end of name is zeroed - iconData.SetFlag(0); // no not-loaded icon yet - // need to allocate space for bitmaps, can't be done in thread + iconData.SetFlag(0); // icon not loaded yet +// bitmap storage must be allocated here; it cannot be done in the worker thread iconData.SetIndex(IconCache->AllocIcon(NULL, NULL)); if (iconData.GetIndex() != -1) { @@ -841,7 +841,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) #ifndef _WIN64 isWin64RedirectedDir = FALSE; #endif // _WIN64 - break; // the second pass (adding ".." or the win64 redirected-dir) + break; // second pass (adding ".." or the Win64-redirected directory) } } while (FindNextFile(search, &fileData)); DWORD err = GetLastError(); @@ -1115,7 +1115,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) const char* iconLocation = NULL; CFileData* f = &Files->At(i); - if (*f->Ext != 0) // an extension exists + if (*f->Ext != 0) // file has an extension { /* if (PackerFormatConfig.PackIsArchive(f->Name)) // is it an archive that we can process? @@ -1165,8 +1165,8 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) memset(iconData.NameAndData + f->NameLen, 0, nameLen - f->NameLen); // zeroes alignment + memcpy(iconData.NameAndData + nameLen, s, len + 1); // icon-location + '\0' - iconData.SetFlag(3); // not-loaded icon given by icon-location only - // we need to allocate space for bitmaps, can't be done in thread + iconData.SetFlag(3); // icon not loaded yet; only the icon location is known +// we need to allocate space for the bitmaps, which cannot be done in this thread iconData.SetIndex(IconCache->AllocIcon(NULL, NULL)); if (iconData.GetIndex() != -1) { @@ -1196,7 +1196,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) { CFileData* f = &Files->At(i); - if (*f->Ext != 0) // an extension exists + if (*f->Ext != 0) // has an extension { /* if (PackerFormatConfig.PackIsArchive(f->Name)) // is it an archive that we can process? @@ -1329,7 +1329,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) { DirectoryLine->SetHidden(HiddenFilesCount, HiddenDirsCount); // TRACE_I("ReadDirectory: end"); - return FALSE; // the directory has ceased to exist ... + return FALSE; // the directory no longer exists ... } // if the panel is empty, we will set infoline to "No files found" @@ -1426,8 +1426,8 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) memset(iconData.NameAndData + f->NameLen, 0, nameLen - f->NameLen); // zeroes alignment + memcpy(iconData.NameAndData + nameLen, s, len + 1); // icon-location + '\0' - iconData.SetFlag(3); // not-loaded icon given by icon-location only - // we need to allocate space for bitmaps, can't be done in thread + iconData.SetFlag(3); // icon not yet loaded, specified only by icon-location +// we need to allocate space for the bitmaps; this cannot be done in the worker thread iconData.SetIndex(IconCache->AllocIcon(NULL, NULL)); if (iconData.GetIndex() != -1) { @@ -1564,8 +1564,8 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) memcpy(iconData.NameAndData, f->Name, f->NameLen); // name + memset(iconData.NameAndData + f->NameLen, 0, nameLen - f->NameLen); // zeroes alignment - iconData.SetFlag(0); // so far not loaded icon (plugin-icon) - // need to allocate space for bitmaps, can't be done in thread + iconData.SetFlag(0); // icon not loaded yet (plugin icon) + // bitmap storage must be allocated outside the thread iconData.SetIndex(IconCache->AllocIcon(NULL, NULL)); if (iconData.GetIndex() != -1) { @@ -1620,7 +1620,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) return TRUE; } -// sorts array Dirs and Files independently on global variables +// sorts the Dirs and Files arrays independently of global variables void SortFilesAndDirectories(CFilesArray* files, CFilesArray* dirs, CSortType sortType, BOOL reverseSort, BOOL sortDirsByName) { CALL_STACK_MESSAGE1("SortDirectoryAux()"); @@ -1717,7 +1717,7 @@ BOOL IsWin64RedirectedDirAux(const char* subDir, const char* redirectedDir, cons if (h != INVALID_HANDLE_VALUE) { HANDLES(FindClose(h)); - return FALSE; // this is not just a pseudo-directory, there is a directory with the same name, which means that e.g. the context menu will work more or less normally + return FALSE; // this is not just a pseudo-directory; a directory with the same name exists there, which means that, for example, the context menu will work almost normally } } @@ -1806,7 +1806,7 @@ BOOL AddWin64RedirectedDirAux(const char* path, const char* subDir, const char* if (StrICmp(dirs->At(i).Name, redirectedDirLastComp) == 0) { if (dirs->At(i).IsLink) - return FALSE; // this redirected-dir has already been added + return FALSE; // this redirected directory has already been added deleteIndex = i; break; } @@ -1838,7 +1838,7 @@ BOOL AddWin64RedirectedDirAux(const char* path, const char* subDir, const char* lstrcpyn(fileData->cFileName, redirectedDirLastComp, MAX_PATH); fileData->cAlternateFileName[0] = 0; - if (CutDirectory(findPath)) // find out if there's a directory with the same name as redirected-dir on the disk (it does not need to be in the 'dirs' array, e.g. because of the command "Hide Selected Names") + if (CutDirectory(findPath)) // Check whether a directory with the same name as redirected-dir exists on disk (it may not be in the 'dirs' array, e.g. due to the "Hide Selected Names" command) { WIN32_FIND_DATA fd; h = HANDLES_Q(FindFirstFile(findPath, &fd)); @@ -1963,7 +1963,7 @@ BOOL CFilesWindow::ChangeDir(const char* newDir, int suggestedTopIndex, const ch EndStopRefresh(); // snooper will be started again if (failReason != NULL) *failReason = CHPPFR_INVALIDPATH; - return FALSE; // cannot retry, stop here + return FALSE; // cannot retry, returning failure } goto CHANGE_AGAIN; } @@ -1996,7 +1996,7 @@ BOOL CFilesWindow::ChangeDir(const char* newDir, int suggestedTopIndex, const ch // which would be able to list the path (so that a new FS is not opened unnecessarily) int fsNameIndexDummy; BOOL convertPathToInternalDummy = FALSE; - if (!Is(ptPluginFS) || // FS interface in the panel cannot list the path (ChangePathToPluginFS opens a new FS) + if (!Is(ptPluginFS) || // the panel's FS interface cannot display this path (ChangePathToPluginFS opens a new FS) !IsPathFromActiveFS(fsName, fsUserPart, fsNameIndexDummy, convertPathToInternalDummy)) { CDetachedFSList* list = MainWindow->DetachedFSList; @@ -2059,7 +2059,7 @@ BOOL CFilesWindow::ChangeDir(const char* newDir, int suggestedTopIndex, const ch EndStopRefresh(); // snooper will be started again if (failReason != NULL) *failReason = CHPPFR_INVALIDPATH; - return FALSE; // Stop here; retry is not possible + return FALSE; // Cannot continue; retry is not possible } goto CHANGE_AGAIN; } @@ -2181,7 +2181,7 @@ BOOL CFilesWindow::ChangeDir(const char* newDir, int suggestedTopIndex, const ch EndStopRefresh(); // snooper will be started again if (failReason != NULL) *failReason = CHPPFR_INVALIDPATH; - return FALSE; // stopping here, cannot retry + return FALSE; // stop here, cannot retry } goto CHANGE_AGAIN; } @@ -2235,7 +2235,7 @@ BOOL CFilesWindow::ChangeDir(const char* newDir, int suggestedTopIndex, const ch err = GetLastError(); if (err != ERROR_FILE_NOT_FOUND && err != ERROR_PATH_NOT_FOUND && err != ERROR_BAD_PATHNAME && err != ERROR_INVALID_NAME) - { // if there is a chance that the path contains a directory we cannot access (try whether later path components are accessible) + { // If the path may contain a directory we cannot access (try whether later path components are accessible) DWORD firstErr = err; char* firstCopyEnd = st + strlen(st); while (*end != 0) @@ -2246,7 +2246,7 @@ BOOL CFilesWindow::ChangeDir(const char* newDir, int suggestedTopIndex, const ch memcpy(st, s, end - s); st[end - s] = 0; s = end; - if ((int)strlen(copy) >= MAX_PATH) // path is too long, stop + if ((int)strlen(copy) >= MAX_PATH) // Path is too long, abort. { h = INVALID_HANDLE_VALUE; break; @@ -2255,11 +2255,11 @@ BOOL CFilesWindow::ChangeDir(const char* newDir, int suggestedTopIndex, const ch { h = HANDLES_Q(FindFirstFile(copy, &find)); if (h != INVALID_HANDLE_VALUE) - break; // accessible component found, continue + break; // found an accessible component, continue err = GetLastError(); if (err == ERROR_FILE_NOT_FOUND || err == ERROR_PATH_NOT_FOUND || err == ERROR_BAD_PATHNAME || err == ERROR_INVALID_NAME) - break; // error in the path, stopping... + break; // path error, stopping... } } if (*end == 0 && h == INVALID_HANDLE_VALUE) // no other accessible component found; try listing the current path @@ -2361,7 +2361,7 @@ BOOL CFilesWindow::ChangeDir(const char* newDir, int suggestedTopIndex, const ch char* name; char shortenedPath[MAX_PATH]; strcpy(shortenedPath, copy); - if (*end == 0 && CutDirectory(shortenedPath, &name)) // if the path does not end with '\\' (path to a file) + if (*end == 0 && CutDirectory(shortenedPath, &name)) // if the path does not end with '\\' (it is a file path) { // change of the path to absolute windows path + focus to the file ChangePathToDisk(HWindow, shortenedPath, -1, name, NULL, TRUE, FALSE, FALSE, failReason); @@ -2369,7 +2369,7 @@ BOOL CFilesWindow::ChangeDir(const char* newDir, int suggestedTopIndex, const ch EndStopRefresh(); // snooper will be started again if (failReason != NULL && *failReason == CHPPFR_SUCCESS) *failReason = CHPPFR_FILENAMEFOCUSED; - return FALSE; // list a different path (without the file name) + return FALSE; // browse a different path (without the file name) } else { @@ -2458,7 +2458,7 @@ BOOL CFilesWindow::ChangeDir(const char* newDir, int suggestedTopIndex, const ch EndStopRefresh(); // snopper will be started again if (failReason != NULL) *failReason = textFailReason; - return FALSE; // stop here, cannot retry + return FALSE; // Stop here; cannot retry. } goto CHANGE_AGAIN; } @@ -2633,7 +2633,7 @@ void CFilesWindow::ChangeDrive(char drive) } } - if (ifaceForFS != NULL) // post-cmd from the context menu of the active/detached FS + if (ifaceForFS != NULL) // post-cmd from the context menu of the active or detached FS { ifaceForFS->ExecuteChangeDrivePostCommand(PANEL_SOURCE, postCmd, postCmdParam); } From bf324ba7ddd122a3929a354f5ba2cc0a9f13e1dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 05:37:29 +0200 Subject: [PATCH 570/710] [translation] Fix src/fileswn5.cpp comments Refines translated comments in src/fileswn5.cpp. Model: OpenAI GPT-5.4 Verification: Ran `node --experimental-strip-types src/sequential-review.ts --target-root /mnt/d/Source/OpenSal/salamander_upstream --translation-source /mnt/d/Source/OpenSal/salamander_upstream --baseline-source gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b --artifacts-dir /mnt/d/source/ostranslation/artifacts/src-fileswn5-cpp-20260419-run1 --cost-profile cheap-first` for the corresponding source set, materialized the approved draft for `src/fileswn5.cpp` into the fork checkout, reran `guard` against the fork checkout with 0 violations, and ran `git diff --check -- src/fileswn5.cpp` before commit. The final diff updates 31 comment hunks in that file and leaves code untouched. Before merge, manually reviewed the live PR branch diff and confirmed the final branch head remains a comment-only change consistent with the inline review comments and green check results. Telemetry: Provider-backed stages for this artifact used 57 calls and 891395 total estimated tokens overall. The changed file `src/fileswn5.cpp` accounted for 57 calls and 891395 estimated tokens. No additional provider-backed rerun was needed after the final manual pre-merge review. --- src/fileswn5.cpp | 70 ++++++++++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/src/fileswn5.cpp b/src/fileswn5.cpp index 56b996d85..03942fb01 100644 --- a/src/fileswn5.cpp +++ b/src/fileswn5.cpp @@ -636,7 +636,7 @@ void CFilesWindow::ChangeAttr(BOOL setCompress, BOOL compressed, BOOL setEncrypt { // count how many directories are selected (the rest of the selected items are files) int i; - for (i = 0; i < Dirs->Count; i++) // ".." cannot be selected, the check would be unnecessary + for (i = 0; i < Dirs->Count; i++) // ".." cannot be selected, so the check would be unnecessary { if (Dirs->At(i).Selected) selectedDirs++; @@ -651,7 +651,7 @@ void CFilesWindow::ChangeAttr(BOOL setCompress, BOOL compressed, BOOL setEncrypt // raise the thread priority again, the operation has finished SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL); - if (success) // success -> unselect + if (success) // On success, clear the selection { SetSel(FALSE, -1, TRUE); // explicit repaint PostMessage(HWindow, WM_USER_SELCHANGED, 0, 0); // selection change notify @@ -728,7 +728,7 @@ void CFilesWindow::ViewFile(char* name, BOOL altView, DWORD handlerID, int enumF BOOL addToHistory = name != NULL; // if viewing/editing from the panel, obtain the full long name - BOOL useDiskCache = FALSE; // TRUE only for ZIP - uses disk-cache + BOOL useDiskCache = FALSE; // TRUE only for ZIP; uses the disk cache BOOL arcCacheCacheCopies = TRUE; // cache copies in disk-cache unless the archiver plugin requests otherwise char dcFileName[3 * MAX_PATH + 50]; // ZIP: name for disk-cache if (name == NULL) @@ -768,7 +768,7 @@ void CFilesWindow::ViewFile(char* name, BOOL altView, DWORD handlerID, int enumF if (strlen(f->DosName) + (s - path) < MAX_PATH) { strcpy(s, f->DosName); - if (SalGetFileAttributes(path) == 0xffffffff) // still error -> revert to the long name + if (SalGetFileAttributes(path) == 0xffffffff) // still an error -> revert to the long name { if ((s - path) + f->NameLen < MAX_PATH) strcpy(s, f->Name); @@ -805,7 +805,7 @@ void CFilesWindow::ViewFile(char* name, BOOL altView, DWORD handlerID, int enumF { format--; int index = PackerFormatConfig.GetUnpackerIndex(format); - if (index < 0) // view: is the processing internal (plugin)? + if (index < 0) // view: is this handled internally by a plugin? { CPluginData* data = Plugins.Get(-index - 1); if (data != NULL) @@ -909,7 +909,7 @@ void CFilesWindow::ViewFile(char* name, BOOL altView, DWORD handlerID, int enumF { if (Is(ptPluginFS)) { - if (GetPluginFS()->NotEmpty() && // FS is fine and supports view-file + if (GetPluginFS()->NotEmpty() && // FS is valid and supports ViewFile GetPluginFS()->IsServiceSupported(FS_SERVICE_VIEWFILE)) { // lower the thread priority to "normal" (so the operations don't overload the machine) @@ -921,7 +921,7 @@ void CFilesWindow::ViewFile(char* name, BOOL altView, DWORD handlerID, int enumF // raise the thread priority again, the operation has finished SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL); } - return; // view on the FS is already done + return; // viewing on the FS is already handled } else { @@ -948,7 +948,7 @@ void CFilesWindow::ViewFile(char* name, BOOL altView, DWORD handlerID, int enumF { DiskCache.AssignName(dcFileName, lock, lockOwner, arcCacheCacheCopies ? crtCache : crtDirect); } - else // viewer didn't open or has no "lock" object - try leaving the file in disk-cache + else // viewer did not open or has no "lock" object; try to at least keep the file in the disk cache { DiskCache.ReleaseName(dcFileName, arcCacheCacheCopies); } @@ -1038,17 +1038,17 @@ BOOL ViewFileInt(HWND parent, const char* name, BOOL altView, DWORD handlerID, B if (viewer != NULL && viewer->ViewerType != VIEWER_EXTERNAL && viewer->ViewerType != VIEWER_INTERNAL) - { // plug-in viewers only + { // plugin viewers only CPluginData* plugin = Plugins.Get(-viewer->ViewerType - 1); if (plugin != NULL && plugin->SupportViewer) { if (!plugin->CanViewFile(name)) - continue; // try to find another viewer, this one won't do it + continue; // try to find another viewer; this one cannot view the file } else TRACE_E("Unexpected error (before CanViewFile) in (Alt)ViewerMasks (invalid ViewerType)."); } - break; // everything is fine, open the viewer + break; // Everything is OK, proceed to open the viewer } } else @@ -1186,7 +1186,7 @@ BOOL ViewFileInt(HWND parent, const char* name, BOOL altView, DWORD handlerID, B break; } - default: // plug-ins + default: // plugins { HANDLE lockAux = NULL; BOOL lockOwnerAux = FALSE; @@ -1292,7 +1292,7 @@ void CFilesWindow::EditFile(char* name, DWORD handlerID) if (strlen(f->DosName) + (s - path) < MAX_PATH) { strcpy(s, f->DosName); - if (SalGetFileAttributes(path) == 0xffffffff) // still error -> revert to the long name + if (SalGetFileAttributes(path) == 0xffffffff) // still an error -> revert to the long name { if ((s - path) + f->NameLen < MAX_PATH) strcpy(s, f->Name); @@ -1508,8 +1508,8 @@ void CFilesWindow::EditNewFile() if (first) { const char* dot = strrchr(path, '.'); - if (dot != NULL && dot > path) // although ".cvspass" is an extension in Windows, Explorer selects the entire name, so we do the same - // if (dot != NULL) + if (dot != NULL && dot > path) // although ".cvspass" counts as an extension in Windows, Explorer selects the whole name, so we do the same +// if (dot != NULL) selectionEnd = (int)(dot - path); dlg.SetSelectionEnd(selectionEnd); first = FALSE; // after an error we get the full file name, so we select it all @@ -1585,7 +1585,7 @@ void CFilesWindow::EditNewFile() else break; } - EndStopRefresh(); // snooper will start again now + EndStopRefresh(); // resume refresh monitoring } // fills the popup based on available viewers @@ -1706,7 +1706,7 @@ BOOL CFilesWindow::FillViewWithData(TDirectArray* items) void CFilesWindow::OnViewFileWith(int index) { - BeginStopRefresh(); // snooper takes a break + BeginStopRefresh(); // suspend refresh monitoring // get the list of viewer indexes TDirectArray items(50, 10); @@ -1869,7 +1869,7 @@ void CFilesWindow::EditFileWith(char* name, HWND hMenuParent, const POINT* menuP *handlerID = masks->At(index)->HandlerID; } - EndStopRefresh(); // snooper will start again now + EndStopRefresh(); // refresh watching resumes now } BOOL FileNameInvalidForManualCreate(const char* path) @@ -1956,7 +1956,7 @@ void CFilesWindow::CreateDir(CFilesWindow* target) // restore DefaultDir MainWindow->UpdateDefaultDir(MainWindow->GetActivePanel() == this); - if (Is(ptDisk)) // create directory on disk + if (Is(ptDisk)) // create a directory on disk { CTruncatedString subject; subject.Set(LoadStr(IDS_CREATEDIRECTORY_TEXT), NULL); @@ -1974,10 +1974,10 @@ void CFilesWindow::CreateDir(CFilesWindow* target) // for disk paths we flip '/' to '\\' and eliminate duplicate backslashes SlashesToBackslashesAndRemoveDups(path); - // clean the name from undesirable characters at the beginning and end - // we do this only for the last component; the previous ones already exist and it doesn't matter - // (the system handles it) or they are checked during creation and an error is shown - // (we don't clean them, we let the user do some work, it's easy enough) + // clean invalid characters from the beginning and end of the name + // only for the last component; the previous ones either already exist and are handled + // by the system, or they are checked during creation and an error is shown if needed + // (we do not sanitize them on our side, so the user still has to correct them) char* lastCompName = strrchr(path, '\\'); MakeValidFileName(lastCompName != NULL ? lastCompName + 1 : path); @@ -2061,7 +2061,7 @@ void CFilesWindow::CreateDir(CFilesWindow* target) newName[0] = 0; BOOL cancel = FALSE; BOOL ret = GetPluginFS()->CreateDir(GetPluginFS()->GetPluginFSName(), 1, HWindow, newName, cancel); - if (!cancel) // not a cancel of the operation + if (!cancel) // the operation was not canceled { if (!ret) { @@ -2186,7 +2186,7 @@ void CFilesWindow::RenameFileInternal(CFileData* f, const char* formatedFileName } else { - if (StrICmp(path, tgtPath) != 0 && // if it isn't just change-case + if (StrICmp(path, tgtPath) != 0 && // if this is not just a case change (err == ERROR_FILE_EXISTS || // check whether it's only rewriting the DOS name of the file err == ERROR_ALREADY_EXISTS)) { @@ -2196,7 +2196,7 @@ void CFilesWindow::RenameFileInternal(CFileData* f, const char* formatedFileName { HANDLES(FindClose(find)); const char* tgtName = SalPathFindFileName(tgtPath); - if (StrICmp(tgtName, data.cAlternateFileName) == 0 && // match only for DOS name + if (StrICmp(tgtName, data.cAlternateFileName) == 0 && // match only for the DOS name StrICmp(tgtName, data.cFileName) != 0) // (full name differs) { // rename ("clean up") the file/directory with the conflicting DOS name to a temporary 8.3 name (no extra DOS name needed) @@ -2362,7 +2362,7 @@ void CFilesWindow::RenameFile(int specialIndex) &subject, IDD_RENAMEDIALOG, Configuration.QuickRenameHistory, QUICKRENAME_HISTORY_SIZE, FALSE); - if (Is(ptDisk)) // rename on disk + if (Is(ptDisk)) // renaming on disk { #ifndef _WIN64 if (Windows64Bit && isDir) @@ -2454,7 +2454,7 @@ void CFilesWindow::RenameFile(int specialIndex) // if we selected an item, we deselect it again UnselectItemWithName(temporarySelected); - if (!cancel) // not a cancel of the operation + if (!cancel) // the operation was not canceled { if (!ret) { @@ -2625,7 +2625,7 @@ void CFilesWindow::QuickRenameBegin(int index, const RECT* labelRect) else subDir = FALSE; if (index == 0 && subDir) - return; // we do not work with ".." + return; // skip ".." CFileData* f = NULL; BOOL isDir = index < Dirs->Count; @@ -2762,18 +2762,18 @@ BOOL CFilesWindow::HandeQuickRenameWindowKey(WPARAM wParam) char newName[MAX_PATH]; GetWindowText(hWnd, newName, MAX_PATH); - // lower the thread priority to "normal" (so operations don't overload the machine) + // lower the current thread priority to "normal" (so the operation does not put too much load on the machine) SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_NORMAL); BOOL tryAgain = FALSE; BOOL mayChange = FALSE; if (Is(ptDisk)) { - // If this is an in-place rename and the user didn't change the name, we shouldn't - // attempt to rename it because the user might be on a CD-ROM or other read-only disk - // and we would display the "Access is denied" error. The user has no mouse option - // to cancel the operation, so they would have to press Escape. - // Explorer behaves this way now. + // If this is an in-place rename and the user did not change the name, we should not + // attempt to rename it because the user may be on a CD-ROM or another read-only disk, + // and we would then display an "Access is denied" error. The user cannot cancel the + // operation with the mouse, so they would have to press Escape. + // Explorer behaves this way as well. if (strcmp(f->Name, newName) != 0) RenameFileInternal(f, newName, &mayChange, &tryAgain); } From 8f3684763e329a185d17bfbb448a7717265a59dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 05:37:36 +0200 Subject: [PATCH 571/710] [translation] Fix src/fileswn7.cpp comments Refines translated comments in src/fileswn7.cpp. Model: OpenAI GPT-5.4 Verification: Ran `node --experimental-strip-types src/sequential-review.ts --target-root /mnt/d/Source/OpenSal/salamander_upstream --translation-source /mnt/d/Source/OpenSal/salamander_upstream --baseline-source gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b --artifacts-dir /mnt/d/source/ostranslation/artifacts/src-fileswn7-cpp-20260419-run1 --cost-profile cheap-first` for the corresponding source set, materialized the approved draft for `src/fileswn7.cpp` into the fork checkout, reran `guard` against the fork checkout with 0 violations, and ran `git diff --check -- src/fileswn7.cpp` before commit. The final diff updates 26 comment hunks in that file and leaves code untouched. Before merge, manually reviewed the live PR branch diff and confirmed the final branch head remains a comment-only change consistent with the inline review comments and green check results. Telemetry: Provider-backed stages for this artifact used 63 calls and 919147 total estimated tokens overall. The changed file `src/fileswn7.cpp` accounted for 63 calls and 919147 estimated tokens. No additional provider-backed rerun was needed after the final manual pre-merge review. --- src/fileswn7.cpp | 59 ++++++++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/src/fileswn7.cpp b/src/fileswn7.cpp index dc88ef3db..f5ae799a3 100644 --- a/src/fileswn7.cpp +++ b/src/fileswn7.cpp @@ -624,9 +624,9 @@ void CFilesWindow::UnpackZIPArchive(CFilesWindow* target, BOOL deleteOp, const c if (!ok) { - //--- refresh directories that are not automatically refreshed - // if directory creation failed, report immediately changes (the user may - // choose a completely different path next time); the new path is kept (almost dead code) + //--- refresh directories that are not refreshed automatically + // if directory creation failed, report the changes immediately (the user may + // choose a completely different path next time); the newly created path is not removed (almost dead code) MainWindow->PostChangeOnPathNotification(changesRoot, TRUE); SalPathAddBackslash(path, MAX_PATH + 200); @@ -668,7 +668,7 @@ void CFilesWindow::UnpackZIPArchive(CFilesWindow* target, BOOL deleteOp, const c if (PackUncompress(MainWindow->HWindow, this, GetZIPArchive(), PluginData.GetInterface(), path, GetZIPPath(), PanelSalEnumSelection, &data)) { // unpacking succeeded - if (tgtPath == NULL) // if it is not drag&drop (selection is not cleared there) + if (tgtPath == NULL) // Only if this is not drag&drop; selection is not cleared there. { SetSel(FALSE, -1, TRUE); // explicit redraw PostMessage(HWindow, WM_USER_SELCHANGED, 0, 0); // sel-change notify @@ -681,7 +681,7 @@ void CFilesWindow::UnpackZIPArchive(CFilesWindow* target, BOOL deleteOp, const c } SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL); - if (GetForegroundWindow() == MainWindow->HWindow) // for unknown reasons focus disappears from the panel when dragging to Explorer; return it + if (GetForegroundWindow() == MainWindow->HWindow) // for unknown reasons, focus disappears from the panel during drag and drop to Explorer; restore it to the panel RestoreFocusInSourcePanel(); } else @@ -722,7 +722,7 @@ void CFilesWindow::UnpackZIPArchive(CFilesWindow* target, BOOL deleteOp, const c MainWindow->PostChangeOnPathNotification(GetPath(), FALSE); } } - else // delete + else // Delete icon { //--- ask whether the user is sure they want to delete HICON hIcon = (HICON)HANDLES(LoadImage(Shell32DLL, MAKEINTRESOURCE(WindowsVistaAndLater ? 16777 : 161), // delete icon @@ -822,7 +822,7 @@ BOOL _ReadDirectoryTree(HWND parent, char (&path)[MAX_PATH], char* name, CSalama char* end = path + strlen(path); char text[2 * MAX_PATH + 100]; if ((end - path) + (*(end - 1) != '\\' ? 1 : 0) + strlen(name) + 2 >= _countof(path)) - return TRUE; // path too long: continue without reporting the error until enumeration is complete + return TRUE; // path too long: continue; report the error during enumeration if (*(end - 1) != '\\') { *end++ = '\\'; @@ -850,7 +850,7 @@ BOOL _ReadDirectoryTree(HWND parent, char (&path)[MAX_PATH], char* name, CSalama { if (errorOccured != NULL) *errorOccured = SALENUM_CANCEL; - return FALSE; // user wants to quit + return FALSE; // user wants to cancel } } return TRUE; // user wants to continue @@ -883,7 +883,7 @@ BOOL _ReadDirectoryTree(HWND parent, char (&path)[MAX_PATH], char* name, CSalama if (file.cFileName[0] == 0 || file.cFileName[0] == '.' && (file.cFileName[1] == 0 || (file.cFileName[1] == '.' && file.cFileName[2] == 0))) - continue; // "." a ".." + continue; // "." and ".." static DWORD lastBreakCheck = 0; if (containsDirLinks != NULL && GetTickCount() - lastBreakCheck > 200) @@ -962,7 +962,7 @@ BOOL _ReadDirectoryTree(HWND parent, char (&path)[MAX_PATH], char* name, CSalama newF.IsOffline = newF.Attr & FILE_ATTRIBUTE_OFFLINE ? 1 : 0; } - if (file.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) // directory, so it is certainly a disk + if (file.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) // directory, so it is definitely on disk { CSalamanderDirectory* salDir = NULL; if (dir != NULL) @@ -1042,7 +1042,7 @@ BOOL _ReadDirectoryTree(HWND parent, char (&path)[MAX_PATH], char* name, CSalama { if (errorOccured != NULL) *errorOccured = SALENUM_CANCEL; - return FALSE; // user wants to quit + return FALSE; // user canceled } } @@ -1149,7 +1149,7 @@ CSalamanderDirectory* ReadDirectoryTree(HWND parent, CPanelTmpEnumData* data, in } else { - if ((f->Attr & FILE_ATTRIBUTE_REPARSE_POINT) != 0) // directory link found, stop... + if ((f->Attr & FILE_ATTRIBUTE_REPARSE_POINT) != 0) // found a directory link, stop { *containsDirLinks = 1; strcpy(path, data->WorkPath); @@ -1236,7 +1236,7 @@ const char* WINAPI PanelEnumDiskSelection(HWND parent, int enumFiles, const char { data->DiskDirectoryTree = ReadDirectoryTree(parent, data, errorOccured, enumFiles == 3, NULL, NULL); if (data->DiskDirectoryTree == NULL) - return NULL; // error, stop + return NULL; // error, abort } const CFileData* f = NULL; const char* ret = _PanelSalEnumSelection(enumFiles, dosName, isDir, size, &f, data, parent, errorOccured); @@ -1487,7 +1487,7 @@ void CFilesWindow::Pack(CFilesWindow* target, int pluginIndex, const char* plugi if (delFilesAfterPacking == 1) PackerConfig.Move = TRUE; - if (delFilesAfterPacking == 0 || // Petr: changed default - user must always enable deletion, it is too risky + if (delFilesAfterPacking == 0 || // Petr: changed the default; the user must always enable deletion because it is too risky delFilesAfterPacking == 2) { PackerConfig.Move = FALSE; @@ -1545,12 +1545,13 @@ void CFilesWindow::Pack(CFilesWindow* target, int pluginIndex, const char* plugi SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL); SetCurrentDirectoryToSystem(); - // the directory contains a link and cannot be combined with "delete files after packing": - // I can't handle the situation where packing a single file from the directory fails - // (e.g., if the file is locked or access is denied), and I entered the directory via the link. - // Deleting the whole link is wrong because it won't show that packing failed, + // The directory contains a link and cannot be combined with "delete files after packing": + // this does not safely handle the case where packing a single file from the directory fails + // (for example, because the file is locked or access is denied) after entering it via the link. + // Deleting the whole link is wrong because it would hide that something failed to pack, // and deleting everything except one file after traversing the link is also wrong, - // because it alters the original directory content, which users report as a bug since it's unexpected. + // because it changes the contents of the original directory, which would be reported as a bug + // because that behavior is unexpected. if (containsDirLinks == 1) { _snprintf_s(text, _TRUNCATE, LoadStr(IDS_DELFILESAFTERPACKINGNOLINKS), linkName); @@ -1725,7 +1726,7 @@ void CFilesWindow::Unpack(CFilesWindow* target, int pluginIndex, const char* plu break; } } - if (i2 == UnpackerConfig.GetUnpackersCount()) // requested plugin not found + if (i2 == UnpackerConfig.GetUnpackersCount()) // the requested plugin was not found { sprintf(subject, LoadStr(IDS_PLUGINUNPACKERNOTFOUND), pluginName); SalMessageBox(HWindow, subject, LoadStr(IDS_ERRORUNPACK), MB_OK | MB_ICONEXCLAMATION); @@ -1803,7 +1804,7 @@ void CFilesWindow::Unpack(CFilesWindow* target, int pluginIndex, const char* plu if (newDir[0] != 0) RemoveEmptyDirs(newDir); } - else // unpacking succeeded (no Cancel, Skip may have occurred) + else // unpacking succeeded (no Cancel; Skip may have occurred) { if (delArchiveWhenDone && archiveVolumes.Length > 0) { @@ -1820,7 +1821,7 @@ void CFilesWindow::Unpack(CFilesWindow* target, int pluginIndex, const char* plu { DWORD err = GetLastError(); if (err == ERROR_FILE_NOT_FOUND) - break; // if the user already managed to delete the file, all is OK + break; // if the user has already deleted the file, everything is OK int res = (int)CFileErrorDlg(MainWindow->HWindow, LoadStr(IDS_ERRORDELETINGFILE), name, GetErrorText(err)).Execute(); if (res == IDB_SKIPALL) skipAll = TRUE; @@ -1871,9 +1872,9 @@ void CFilesWindow::Unpack(CFilesWindow* target, int pluginIndex, const char* plu { CutDirectory(newDir); // should always work (path to the first newly created directory) - //--- refresh directories that are not automatically refreshed - // if creating directories failed, report changes immediately (the user may - // choose a completely different path next time); the newly created path is kept (almost dead code) + //--- refresh directories that are not refreshed automatically + // if directory creation failed, report the changes immediately (the user may + // choose a completely different path next time); the newly created path is not removed (almost dead code) MainWindow->PostChangeOnPathNotification(newDir, TRUE); } goto DO_AGAIN; @@ -1955,7 +1956,7 @@ void CFilesWindow::CalculateOccupiedZIPSpace(int countSizeMode) } delete[] (indexes); } - else // take the selected file or directory + else // Use the selected file or directory { selIndex = GetCaretIndex(); if (upDir && selIndex == 0) @@ -2032,7 +2033,7 @@ void CFilesWindow::AcceptChangeOnPathNotification(const char* path, BOOL includi refresh = !includingSubdirs && StrICmp(path1, path2) == 0 || // exact match includingSubdirs && StrNICmp(path1, path2, len1) == 0 && // prefix match (path2[len1] == 0 || path2[len1] == '\\'); - if (Is(ptDisk) && !refresh && CutDirectory(path1)) // pointless for archives + if (Is(ptDisk) && !refresh && CutDirectory(path1)) // not applicable to archives { SalPathRemoveBackslash(path1); // on NTFS the last subdirectory timestamp also changes (unfortunately visible only after entering @@ -2049,7 +2050,7 @@ void CFilesWindow::AcceptChangeOnPathNotification(const char* path, BOOL includi } else { - if (Is(ptPluginFS) && GetPluginFS()->NotEmpty()) // send notification to the FS + if (Is(ptPluginFS) && GetPluginFS()->NotEmpty()) // send a notification to the FS { // the EnterPlugin+LeavePlugin section must be exposed up to here (not wrapped inside the interface) EnterPlugin(); @@ -2091,7 +2092,7 @@ void CFilesWindow::IconOverlaysChangedOnPath(const char* path) // if the timer fails, attempt an immediate refresh... } // try to refresh immediately (as long as it didn't come too soon after the previous one) - if (!IconCacheValid) // perform after icons finish loading (they may or may not load correctly) + if (!IconCacheValid) // refresh after icon loading completes (icons may or may not load correctly) { // TRACE_I("CFilesWindow::IconOverlaysChangedOnPath: delaying refresh till end of reading of icons"); NeedIconOvrRefreshAfterIconsReading = TRUE; From 11346358d196c6da5f89de19df02315896744858 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 05:37:42 +0200 Subject: [PATCH 572/710] [translation] Fix src/fileswnd.h comments Refines translated comments in src/fileswnd.h. Model: OpenAI GPT-5.4 Verification: Ran `node --experimental-strip-types src/sequential-review.ts --target-root /mnt/d/Source/OpenSal/salamander_upstream --translation-source /mnt/d/Source/OpenSal/salamander_upstream --baseline-source gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b --artifacts-dir /mnt/d/source/ostranslation/artifacts/src-fileswnd-h-20260419-run1 --cost-profile cheap-first` for the corresponding source set, materialized the approved draft for `src/fileswnd.h` into the fork checkout, reran `guard` against the fork checkout with 0 violations, and ran `git diff --check -- src/fileswnd.h` before commit. The final diff updates 49 comment hunks in that file and leaves code untouched. Before merge, manually reviewed the live PR branch diff and confirmed the final branch head remains a comment-only change consistent with the inline review comments and green check results. Telemetry: Provider-backed stages for this artifact used 65 calls and 1105753 total estimated tokens overall. The changed file `src/fileswnd.h` accounted for 65 calls and 1105753 estimated tokens. No additional provider-backed rerun was needed after the final manual pre-merge review. --- src/fileswnd.h | 304 +++++++++++++++++++++++++------------------------ 1 file changed, 157 insertions(+), 147 deletions(-) diff --git a/src/fileswnd.h b/src/fileswnd.h index 79e605b94..48db91d1b 100644 --- a/src/fileswnd.h +++ b/src/fileswnd.h @@ -70,7 +70,7 @@ struct CTmpDragDropOperData CDragDropOperData* Data; }; -class CCriteriaData // data pro atCopy/atMove +class CCriteriaData // data for atCopy/atMove { public: BOOL OverwriteOlder; // overwrite older, skip newer ones @@ -371,7 +371,7 @@ class CTopIndexMem TopIndexesCount = 0; } // clears memory void Push(const char* path, int topIndex); // stores the top index for the given path - BOOL FindAndPop(const char* path, int& topIndex); // looks for the top index of the path, FALSE -> not found + BOOL FindAndPop(const char* path, int& topIndex); // finds the top index for the given path; returns FALSE if not found }; //****************************************************************************** @@ -483,7 +483,7 @@ class CFilesWindowAncestor : public CWindow // the real object core - everything BOOL MonitorChanges; // should changes be monitored (auto refresh)? UINT DriveType; // disk+archive: drive type of Path (see MyGetDriveType()) - // when we are inside an archive: + // when browsing an archive: CSalamanderDirectory* ArchiveDir; // content of the open archive; basic data - array of CFileData char ZIPArchive[MAX_PATH]; // path to the open archive char ZIPPath[MAX_PATH]; // path inside the open archive @@ -491,31 +491,31 @@ class CFilesWindowAncestor : public CWindow // the real object core - everything CQuadWord ZIPArchiveSize; // archive size - used to detect archive changes // when browsing a plugin file system: - CPluginFSInterfaceEncapsulation PluginFS; // pointer to the open FS + CPluginFSInterfaceEncapsulation PluginFS; // encapsulation of the open FS CSalamanderDirectory* PluginFSDir; // content of the open FS; basic data - array of CFileData - int PluginIconsType; // icon type in the panel when listing a FS + int PluginIconsType; // icon type in the panel when browsing a plugin FS // when viewing an archive listed by a plugin or within a plugin FS CPluginInterfaceAbstract* PluginIface; // use exclusively for locating the plugin in Plugins (not for invoking methods) int PluginIfaceLastIndex; // index of PluginIface in Plugins during the last search, use only to locate the plugin public: - // contents of all columns shown in the panel (both basic data and plug-in data for archives and FS) + // contents of all columns shown in the panel (both basic data and plugin data for archives and FS) CFilesArray* Files; // filtered list of files (shallow copy; basic data - CFileData structure) CFilesArray* Dirs; // filtered list of directories (shallow copy; basic data - CFileData structure) - // interface used to obtain plug-in specific data; data for plug-in columns; defines how - // to use CFileData::PluginData; for FS plug-ins with pitFromPlugin icons, it is also used to + // interface used to obtain plugin specific data; data for plugin columns; defines how + // to use CFileData::PluginData; for FS plugins with pitFromPlugin icons, it is also used to // retrieving icons "in the background" in the icon reader thread - before making any changes, call SleepIconCacheThread() CPluginDataInterfaceEncapsulation PluginData; - CIconList* SimplePluginIcons; // FS + pitFromPlugin only: image list with simple plug-in icons + CIconList* SimplePluginIcons; // FS + pitFromPlugin only: image list with simple plugin icons // current number of selected items; must be updated everywhere the variable // CFileData::Selected is modified int SelectedCount; // helper variables used for smoother refresh (without "the panel contains no items") - // for plug-in file systems: + // for plugin file systems: // TRUE = the listing should not be released in a standard way but only detached (objects from NewFSXXX will continue // to be used) BOOL OnlyDetachFSListing; @@ -529,7 +529,7 @@ class CFilesWindowAncestor : public CWindow // the real object core - everything ~CFilesWindowAncestor(); // NULL -> Path; echo && err != ERROR_SUCCESS -> only report the error - // 'parent' is the parent of the message box (NULL == HWindow) + // 'parent' is the parent window of the message box (NULL == HWindow) DWORD CheckPath(BOOL echo, const char* path = NULL, DWORD err = ERROR_SUCCESS, BOOL postRefresh = TRUE, HWND parent = NULL); @@ -640,7 +640,7 @@ enum CCopyFocusedNameModeEnum class CVisibleItemsArray { protected: - CRITICAL_SECTION Monitor; // section used to synchronize this object (monitor behavior) + CRITICAL_SECTION Monitor; // critical section used to synchronize this object (monitor behavior) BOOL SurroundArr; // TRUE/FALSE = array of items around the visible area / array ofitems only from the visible area @@ -678,8 +678,9 @@ class CVisibleItemsArray // called only by the icon reader BOOL ArrContains(const char* name, BOOL* isArrValid, int* versionNum); - // If the array is filled and valid and contains the given index 'index', it returns - // TRUE; moreover, in 'isArrValid', it returns TRUE if the array is filled and valid and in 'versionNum' the number of the array version + // Returns TRUE if the array is populated, valid, and contains index 'index'; + // additionally, stores in 'isArrValid' whether the array is valid and in 'versionNum' + // the array version number // Called only by the icon reader BOOL ArrContainsIndex(int index, BOOL* isArrValid, int* versionNum); }; @@ -715,12 +716,12 @@ class CFilesWindow : public CFilesWindowAncestor // If a filesystem is attached, it may modify these columns: new // columns can appear and some of the visible ones may be temporarily removed TDirectArray ColumnsTemplate; // template for the Columns variable - // Firstly, this template is built from the current 'ViewTemplate' - // and panel content type (disk / archive + FS). Then the template is - // copied into Columns. Added for performance so we do not build the - // array repeatedly. + // This template is first built from the current 'ViewTemplate' + // and panel content type (disk / archive + FS). It is then + // copied into Columns. Introduced for performance so the + // array does not have to be rebuilt repeatedly. BOOL ColumnsTemplateIsForDisk; // TRUE = if ColumnsTemplate was built for a disk, otherwise for archive or FS - FGetPluginIconIndex GetPluginIconIndex; // callback for retrieving a simple icon index for plug-ins + FGetPluginIconIndex GetPluginIconIndex; // callback for retrieving a simple icon index for plugins // with their own icons (FS, pitFromPlugin) CFilesMap FilesMap; // used for selecting items by dragging a selection box @@ -728,7 +729,7 @@ class CFilesWindow : public CFilesWindowAncestor CIconCache* IconCache; // cache containing icons directly from files BOOL IconCacheValid; // is the cache already loaded? - BOOL InactWinOptimizedReading; // TRUE = only icons/thumbnails/overlays from the visible part of the panel are being read (used when the main window is inactive and a refresh is triggered – we try to minimize system load as we're "in the background") + BOOL InactWinOptimizedReading; // TRUE = read only icons/thumbnails/overlays from the visible part of the panel (used when the main window is inactive and a refresh is triggered to minimize system load because the application is "in the background") DWORD WaitBeforeReadingIcons; // how many milliseconds to wait before the icon reader starts reading icons (used on refresh; while waiting old icons can be pushed into the cache to avoid repeated reading and endless refreshes on network drives) DWORD WaitOneTimeBeforeReadingIcons; // how many milliseconds to wait before starting to read icons, then this value resets (used to catch batches of changes from Tortoise SVN, see IconOverlaysChangedOnPath()) DWORD EndOfIconReadingTime; // GetTickCount() from the moment all icons were loaded in the panel @@ -785,10 +786,10 @@ class CFilesWindow : public CFilesWindowAncestor // as a recipient of device event notifications (used to detect the media before // it is disconnected from the computer) - // should icons be retrieved from files on this disk?? - // For ptDisk: TRUE if icons are retrieved from files; for ptZIPArchive: TRUE - // if icons are retrieved from the registry; for ptPluginFs: TRUE if icons are retrieved from the registry (pitFromRegistry) or - // directly from the plug-in (pitFromPlugin) + // should icons be retrieved from files on this disk? + // for ptDisk, TRUE if icons are retrieved from files; for ptZIPArchive, TRUE if + // icons are retrieved from the registry; for ptPluginFS, TRUE if icons are retrieved + // from the registry (pitFromRegistry) or directly from the plugin (pitFromPlugin) BOOL UseSystemIcons; BOOL UseThumbnails; // TRUE when thumbnails are displayed in the panel and loaded in the icon reader @@ -800,7 +801,7 @@ class CFilesWindow : public CFilesWindowAncestor BOOL NeedRefreshAfterEndOfSM; // will a refresh be needed after exiting suspend mode? int RefreshAfterEndOfSMTime; // "time" of the latest refresh that arrived after suspend mode started - BOOL PluginFSNeedRefreshAfterEndOfSM; // will the plug-in FS need a refresh after leaving suspend mode? + BOOL PluginFSNeedRefreshAfterEndOfSM; // will the plugin FS need a refresh after leaving suspend mode? BOOL SmEndNotifyTimerSet; // TRUE when the timer for sending WM_USER_SM_END_NOTIFY_DELAYED is running BOOL RefreshDirExTimerSet; // TRUE when the timer for sending WM_USER_REFRESH_DIR_EX_DELAYED is running @@ -814,7 +815,7 @@ class CFilesWindow : public CFilesWindowAncestor BOOL NeedRefreshAfterIconsReading; // is a refresh needed after icon reading finishes? int RefreshAfterIconsReadingTime; // "time" of the latest refresh that arrived while icons were being read - CPathHistory* PathHistory; // browsing history for this panel (for the panel) + CPathHistory* PathHistory; // browsing history for this panel DWORD HiddenDirsFilesReason; // bit field indicating the reason why files/directories are hidden (HIDDEN_REASON_xxx) int HiddenDirsCount, // number of hidden directories in the panel (number of skipped ones) @@ -860,9 +861,9 @@ class CFilesWindow : public CFilesWindowAncestor BOOL DragSelect; // mode for marking/unmarking by mouse drag BOOL BeginDragDrop; // are we dragging the file? BOOL DragDropLeftMouseBtn; // TRUE = drag&drop with left mouse button, FALSE = with the right one - BOOL BeginBoxSelect; // are we "opening" the selection box? + BOOL BeginBoxSelect; // start of selection box BOOL PersistentTracking; // during WM_CAPTURECHANGED, tracking mode will not be disabled - BOOL SelectItems; // during Drag Select, do we mark items? + BOOL SelectItems; // mark items during Drag Select? BOOL FocusedSinceClick; // the item already had focus when we clicked it BOOL CutToClipChanged; // is at least one CutToClip flag set on files/directories? @@ -930,26 +931,31 @@ class CFilesWindow : public CFilesWindowAncestor // returns TRUE if the path is accessible BOOL CheckAndRestorePath(const char* path); - // recognizes the path type (FS/Windows/archive) and splits it into components: - // for FS paths it's fs-name and fs-user-part; for archives it's path-to-archive and - // path-in-archive; for Windows paths it's an existing part and the remaining path. for FS paths, nothing is checked, - // for Windows (normal/UNC) paths, it checks how far the path exists (possibly restore network paths), - // for archives, it checks whether the archive file exists (determined by extension); - // 'path' is a full or relative path (for relative paths, the path in the active panel is used as the base for evaluating the full path). The resulting full path is - // stored back into 'path' (buffer must be at least 'pathBufSize' characters). Returns TRUE - // when recognized successfully, setting 'type' to PATH_TYPE_XXX and 'pathPart' as follows: - // - for Windows paths, pointer just after the existing path (after '\\' or at the end of string); - // if a file exists in the path, it points after the path to this file, WARNING: the returned part length is not - // checked and may exceed MAX_PATH. - // - for archive paths, pointer past the archive file; WARNING: again the length inside the archive is not checked and can - // exceed MAX_PATH. - // - for FS paths, pointer after ':' following the file-system name (user - part of the path); - // WARNING: length of user - part path isn't checked and may exceed MAX_PATH. - // On success, 'isDir' is TRUE if the first part of the path up to 'pathPart' is a directory, - // FALSE if it's a file (Windows paths). For archive and FS paths, 'isDir' is FALSE. - // If it returns FALSE, an error that occurred during recognition was already displayed to the user, 'errorTitle' is the message box title with the error. - // If 'nextFocus' is not NULL and the Windows/archive path doesn't contain '\\' or ends with - // it, the path is copied to 'nextFocus' (see SalGetFullName) + // Recognizes the path type (FS/Windows/archive) and splits it into its parts: + // for FS paths, into fs-name and fs-user-part; for archive paths, into path-to-archive and + // path-in-archive; for Windows paths, into the existing part and the rest of the path. FS paths + // are not checked; for Windows (normal/UNC) paths, it checks how much of the path exists + // (and may restore the network connection); for archive paths, it checks whether the archive file + // exists (archive type is determined by the extension); + // 'path' is a full or relative path (for relative paths, the path in the active panel is used + // as the base for resolving the full path); the resulting full path is stored back into 'path' + // (the buffer must be at least 'pathBufSize' characters). Returns TRUE on successful recognition; + // then 'type' is the path type (see PATH_TYPE_XXX) and 'secondPart' is set: + // - in 'path' to the position after the existing path (after '\\' or at the end of the string; + // if the path contains a file, it points past the path to that file) (Windows path type), WARNING: + // the length of the returned part of the path is not checked (the whole path may be longer than MAX_PATH) + // - after the archive file (archive path type), WARNING: the length of the path inside the archive is not checked + // (it may be longer than MAX_PATH) + // - after ':' following the file system name, to the user part of the file system path (FS path type), WARNING: + // the length of the user part is not checked (it may be longer than MAX_PATH); + // if TRUE is returned, 'isDir' is also set to: + // - TRUE if the first part of the path (from the beginning up to 'secondPart') is a directory, FALSE if it is a file + // (Windows path type) + // - FALSE for archive and FS paths; + // if FALSE is returned, an error that occurred during recognition has already been reported to the user; + // 'errorTitle' is the title of the error message box; if 'nextFocus' != NULL and the Windows/archive + // path does not contain '\\' or only ends with '\\', the path is copied to 'nextFocus' (see + // SalGetFullName) BOOL ParsePath(char* path, int& type, BOOL& isDir, char*& secondPart, const char* errorTitle, char* nextFocus, int* error, int pathBufSize); @@ -965,12 +971,12 @@ class CFilesWindow : public CFilesWindowAncestor // when 0, a dialog is shown, the change is applied immediately void ChangeDrive(char drive = 0); - // it finds the first fixed drive and switches to it; - // 'parent' is the parent of message boxes; - // if 'noChange' is not NULL it returns TRUE if the panel listing data (Files + Dirs) - // were not recreated again; + // finds the first fixed drive and switches to it; + // 'parent' is the parent window for message boxes; + // if 'noChange' is not NULL, it returns TRUE if the panel listing data (Files + Dirs) + // were not recreated; // if 'refreshListBox' is FALSE, RefreshListBox is not called; - // if 'canForce' is TRUE, the user can forcibly close even a path the plug-in refuses to close; + // if 'canForce' is TRUE, the user gets a chance to forcibly close even a path the plugin refuses to close; // if 'failReason' != NULL, it is set to one of the CHPPFR_XXX constants; // only for FS in panel: 'tryCloseReason' is the reason passed to CPluginFSInterfaceAbstract::TryCloseOrDetach(); // returns TRUE on success @@ -985,34 +991,36 @@ class CFilesWindow : public CFilesWindowAncestor int* failReason = NULL); // helper method: - // serves as preparation for CloseCurrentPath, prepares closing/detached the current path (updates - // edited files and calls CanCloseArchive for archives; TryCloseOrDetach for FS); - // returns TRUE if the path can be closed/detached by the upcoming CloseCurrentPath call, - // returns FALSE if it cannot close/defer(the current path won't change or close); - // when 'canForce' is TRUE, the user may forcibly close even a path the plug-in doesn't want - // to close (necessary when closing Salamander – if there is a bug in the plug-in, Salamander would otherwise not close); - // when 'canForce' is FALSE and 'canDetach' is TRUE and it's an FS path, the path may be - // closed (returns 'detachFS' FALSE) or detached (returns 'detachFS' TRUE). In other cases the - // path can only be closed (returns 'detachFS' FALSE). For FS in the panel only, 'tryCloseReason' - // is the reason passed to CPluginFSInterfaceAbstract::TryCloseOrDetach() - // 'parent' is the parent message box + // prepares for CloseCurrentPath; prepares closing/detaching the current path (updates + // edited files and calls CanCloseArchive for archives; calls TryCloseOrDetach for FS); + // returns TRUE if the path can be closed/detached by the following CloseCurrentPath call, + // returns FALSE if the path cannot be closed/detached (the current path will neither change nor close); + // if 'canForce' is TRUE, the user gets a chance to force-close even a path that the plugin + // does not want to close (necessary when closing Salamander; if there is a bug in the plugin, + // Salamander could not be closed otherwise); if 'canForce' is FALSE and 'canDetach' is TRUE + // and this is an FS path, the path may be closed (returns 'detachFS' FALSE) or detached + // (returns 'detachFS' TRUE); in other cases, the path can only be closed (returns 'detachFS' + // FALSE); for FS in the panel only, 'tryCloseReason' is the reason for calling + // CPluginFSInterfaceAbstract::TryCloseOrDetach() + // 'parent' is the parent of the message box BOOL PrepareCloseCurrentPath(HWND parent, BOOL canForce, BOOL canDetach, BOOL& detachFS, int tryCloseReason); - // helper method: - // finishes closing/detaching the current path started by PrepareCloseCurrentPath; if 'cancel' - // is TRUE the current path is restored (it is neither closed nor changed; triggers - // Event(FSE_CLOSEORDETACHCANCELED) for FS). If 'cancel' is FALSE all no-longer-needed - // resources of the current path are released (depending on path type: Files, Dirs, PluginData, - // ArchiveDir, PluginFS and PluginFSDir). 'detachFS' is the value returned from + // Helper method: + // completes closing/detaching the current path started by PrepareCloseCurrentPath; if 'cancel' + // is TRUE, the current path is restored (it is neither closed nor changed; this ensures + // Event(FSE_CLOSEORDETACHCANCELED) is called for FS). If 'cancel' is FALSE, all resources of the + // current path that are no longer needed are released (depending on the path type: Files, Dirs, + // PluginData, ArchiveDir, PluginFS, and PluginFSDir). 'detachFS' is the value returned by // PrepareCloseCurrentPath (meaningful only for FS; if TRUE, PluginFS is added to DetachedFSList - // instead of being freed). When closing an FS with pitFromPlugin icons you must first call - // SleepIconCacheThread() so PluginData isn't released while its method loads icons. - // 'parent' is the message box parent; 'newPathIsTheSame' is TRUE (meaningful only if 'cancel' - // is FALSE) if the same path ends up in the panel again after closing the path (for example a successful path refresh); - // 'isRefresh' is TRUE for a hard refresh (Ctrl+R or change notification); - // if 'canChangeSourceUID' is TRUE you may change EnumFileNamesSourceUID and with that cancel enumeration - // of files from the panel (e.g. for the viewer). FALSE is used when changing to the same path - // that was already in the panel (similar to refresh via hot-path, focus-name, etc.) + // instead of being released). When closing an FS with pitFromPlugin icons, SleepIconCacheThread() + // must be called first so that PluginData is not released while its method is loading icons. + // 'parent' is the parent of the message box; 'newPathIsTheSame' is TRUE (meaningful only if + // 'cancel' is FALSE) if the same path appears in the panel again after the path is closed + // (for example, after a successful path refresh); 'isRefresh' is TRUE for a hard refresh + // (Ctrl+R or a change notification); if 'canChangeSourceUID' is TRUE, EnumFileNamesSourceUID may + // be changed, which cancels file enumeration from the panel (e.g. for the viewer). FALSE is used + // when changing to the same path that was already in the panel (similar to a refresh, but via + // hot-path, focus-name, etc.) void CloseCurrentPath(HWND parent, BOOL cancel, BOOL detachFS, BOOL newPathIsTheSame, BOOL isRefresh, BOOL canChangeSourceUID); @@ -1044,21 +1052,21 @@ class CFilesWindow : public CFilesWindowAncestor int currentPathFSNameIndex, BOOL forceUpdate, char* cutFileName, BOOL* keepOldListing); - // path change-handles both relative and absolute paths to Windows form (UNC and C:\path); - // shortens the path if needed. When changing within the same drive (including archives) + // changes the path, handling both relative and absolute paths in Windows form (UNC and C:\path), + // and shortens the path if needed. When changing within the same drive (including archives), // it finds a valid directory even if that means switching to a fixed drive (when the current drive is inaccessible); // 'parent' is the parent of the message box; // if suggestedTopIndex != -1 the top index will be set; // if suggestedFocusName != NULL and present in the new list it will be focused; - // if noChange (if not NULL) it returns TRUE when the listing data in the panel were not recreated + // in noChange (if not NULL) it returns TRUE if the listing data in the panel were not recreated // (Files + Dirs); // if refreshListBox is FALSE RefreshListBox is not called; - // if canForce is TRUE, the user can forcibly close even a path the plug-in refuses to close; - // if isRefresh is TRUE, this call comes from RefreshDirectory (no error leading to shortening is shown, + // if canForce is TRUE, the user gets a chance to forcibly close even a path the plugin refuses to close; + // if isRefresh is TRUE, this call comes from RefreshDirectory (no error leading to path shortening is shown, // quick search is not canceled); // if failReason != NULL, it is set to one of the CHPPFR_XXX constants; - // if shorterPathWarning is TRUE, a message box with an error is opened when the path is shortened - // (only when it is not a refresh); + // if shorterPathWarning is TRUE, a message box with an error is opened when the path is shortened, + // but only if this is not a refresh; // only for FS in the panel: 'tryCloseReason' is the reason passed to CPluginFSInterfaceAbstract::TryCloseOrDetach() // returns TRUE if the requested path was listed successfully BOOL ChangePathToDisk(HWND parent, const char* path, int suggestedTopIndex = -1, @@ -1066,52 +1074,55 @@ class CFilesWindow : public CFilesWindowAncestor BOOL refreshListBox = TRUE, BOOL canForce = FALSE, BOOL isRefresh = FALSE, int* failReason = NULL, BOOL shorterPathWarning = TRUE, int tryCloseReason = FSTRYCLOSE_CHANGEPATH); - // changes to an archive path; only absolute Windows paths are allowed (archive is UNC or C:\path\archive) + // changes the path to an archive; only absolute Windows paths are allowed (archive is UNC or C:\path\archive); // if suggestedTopIndex != -1, the top index will be set; - // if suggestedFocusName != NULL, and present in the new list, it will be focused; + // if suggestedFocusName != NULL and is present in the new list, it will be selected; // if forceUpdate is TRUE, the case where the new path equals the current one is not optimized; // if noChange is not NULL, it returns TRUE if the listing data in the panel were not recreated // (ArchiveDir + PluginData); // if refreshListBox is FALSE, RefreshListBox is not called; - // if failReason != NULL it is set to one of the CHPPFR_XXX constants; + // if failReason != NULL, it is set to one of the CHPPFR_XXX constants; // if isRefresh is TRUE, this call comes from RefreshDirectory (quick search is not canceled); // if archivePath contains a file name and canFocusFileName is TRUE, that file is focused // (returns FALSE because the path was shortened); - // if isHistory is TRUE (used when selecting a path from a path history) and the archive cannot + // if isHistory is TRUE (used when selecting a path from the panel path history) and the archive cannot // be opened (or does not exist), the panel opens at least the path to the archive - // (optionally shortened, on path error it does not switch to a fixed drive); - // returns TRUE if the requested path was uccessfully listed + // (optionally shortened; on path error it does not switch to a fixed drive); + // returns TRUE if the requested path was successfully listed BOOL ChangePathToArchive(const char* archive, const char* archivePath, int suggestedTopIndex = -1, const char* suggestedFocusName = NULL, BOOL forceUpdate = FALSE, BOOL* noChange = NULL, BOOL refreshListBox = TRUE, int* failReason = NULL, BOOL isRefresh = FALSE, BOOL canFocusFileName = FALSE, BOOL isHistory = FALSE); - // change path to the plug-in FS; - // if suggestedTopIndex != -1 the top index will be set; - // if suggestedFocusName != NULL and present in the new list, it will be focused; - // if forceUpdate is TRUE, the case where the new path equals the current one is not optimized; - // 'mode' is the path change mode: - // 1 (refresh path) - shortens the path, if needed; do not report path not found (just shorten them), - // report a file instead of path, inaccessibility of path and other errors - // 2 (called via ChangePanelPathToPluginFS from plugin, back/forward in history, etc.) - shortens the path, if needed; - // report all path errors (file instead of path, not found, not accessible, ...) + // Changes the path to the plugin FS. + // If suggestedTopIndex != -1, the top index is set. + // If suggestedFocusName != NULL and it is present in the new list, it is selected. + // If forceUpdate is TRUE, the case where the current path matches the new path is not optimized away. + // 'mode' is the path-change mode: + // 1 (refresh path) - shortens the path if needed; do not report a non-existing path + // (shorten it silently), report file-instead-of-path, path inaccessibility, + // and other errors + // 2 (called from a plugin via ChangePanelPathToPluginFS, back/forward in history, etc.) - shortens the path + // if needed; report all path errors (file instead of path, + // non-existence, inaccessibility, and others) // 3 (change-dir command) - shortens the path only if it is a file or the path cannot be listed - // (ListCurrentPath returns FALSE); do not report file instead of path - // (silent shorten and return the file name), report all other path errors (not found, not accessible, ...) - // if noChange is not NULL, it returns TRUE when the listing data in the panel were not recreated - // (PluginFSDir + PluginData); - // if refreshListBox is FALSE, RefreshListBox is not called; - // if failReason != NULL, it is set to one of the CHPPFR_XXX constants; - // if isRefresh is TRUE, this call comes from RefreshDirectory (quick search is not canceled); - // if fsUserPart contains a file name and canFocusFileName is TRUE, the file is focused - // (returns FALSE because the path was shortened); - // if 'convertPathToInternal' is TRUE, CPluginInterfaceForFSAbstract::ConvertPathToInternal() is called; - // returns TRUE if the requested path was listed successfully + // (ListCurrentPath returns FALSE for it); do not report file instead of path + // (shorten it silently and return the file name), report all other + // path errors (non-existence, inaccessibility, and others) + // In noChange (if not NULL), returns TRUE if the listing data in the panel were not recreated + // (PluginFSDir + PluginData). + // If refreshListBox is FALSE, RefreshListBox is not called. + // If failReason != NULL, it is set to one of the CHPPFR_XXX constants. + // If isRefresh is TRUE, this is a call from RefreshDirectory (quick search is not canceled). + // If fsUserPart contains a file name and canFocusFileName is TRUE, that file is focused + // (returns FALSE because the path was shortened). + // If 'convertPathToInternal' is TRUE, CPluginInterfaceForFSAbstract::ConvertPathToInternal() is called. + // Returns TRUE if the requested path was listed successfully. BOOL ChangePathToPluginFS(const char* fsName, const char* fsUserPart, int suggestedTopIndex = -1, const char* suggestedFocusName = NULL, BOOL forceUpdate = FALSE, int mode = 2, BOOL* noChange = NULL, BOOL refreshListBox = TRUE, int* failReason = NULL, BOOL isRefresh = FALSE, BOOL canFocusFileName = FALSE, BOOL convertPathToInternal = FALSE); - // change path to a detached plug-in FS (in MainWindow->DetachedFSList at index 'fsIndex'); + // change path to a detached plugin FS (in MainWindow->DetachedFSList at index 'fsIndex'); // if suggestedTopIndex != -1, the top index will be set; // if suggestedFocusName != NULL and present in the new list, it will be selected; // if refreshListBox is FALSE, RefreshListBox is not called; @@ -1128,19 +1139,20 @@ class CFilesWindow : public CFilesWindowAncestor int* failReason = NULL, const char* newFSName = NULL, const char* newUserPart = NULL, int mode = -1, BOOL canFocusFileName = FALSE); - // changes the panel path; the input may be an absolute or relative Windows path or an archive path - // or an FS path (absolute/relative is handled directly by the plug-in). If the input path points to a file, + // changes the path in the panel; the input may be an absolute or relative Windows path or an archive path + // or an FS path (absolute/relative is handled directly by the plugin); if the input is a path to a file, // that file is focused; // if suggestedTopIndex != -1, the top index will be set; - // if suggestedFocusName != NULL and present in the new list, it will be selected; - // 'mode' specifies the change mode for FS paths-see ChangePathToPluginFS(); it has no meaning + // if suggestedFocusName != NULL and it is present in the new list, it will be selected; + // 'mode' specifies the path-change mode for FS paths, see ChangePathToPluginFS(); it has no meaning // for archives or disks; // if failReason != NULL, it is set to one of the CHPPFR_XXX constants; - // if 'convertFSPathToInternal' is TRUE or 'newDir' is NULL and it is an FS path, + // if 'convertFSPathToInternal' is TRUE or 'newDir' is NULL and this is an FS path, // CPluginInterfaceForFSAbstract::ConvertPathToInternal() is called; - // 'showNewDirPathInErrBoxes' exists only for paths taken from links (disk paths only) - // the entire path from the link should be shown, not just the part where the error was detected (otherwise the user won’t get the full path from the link); - // returns TRUE if the requested path was successfully listed + // 'showNewDirPathInErrBoxes' was added only for paths extracted from links (disk paths only); + // the full path from the link should be shown, not only the part where the error was detected (otherwise the user + // will not get the full path from the link); + // returns TRUE if the requested path was listed successfully BOOL ChangeDir(const char* newDir = NULL, int suggestedTopIndex = -1, const char* suggestedFocusName = NULL, int mode = 3 /*change-dir*/, int* failReason = NULL, BOOL convertFSPathToInternal = TRUE, @@ -1185,7 +1197,7 @@ class CFilesWindow : public CFilesWindowAncestor // // removes the current path in the panel from the path history of this panel void RemoveCurrentPathFromHistory(); - // returns TRUE, if the plug-in is no longer used by the panel + // returns TRUE, if the plugin is no longer used by the panel BOOL CanUnloadPlugin(HWND parent, CPluginInterfaceAbstract* plugin); void ItemFocused(int index); // called when focus changes @@ -1265,9 +1277,8 @@ class CFilesWindow : public CFilesWindowAncestor BOOL FillViewWithData(TDirectArray* items); // displays the focused file using the viewer identified by 'index' void OnViewFileWith(int index); - // view-file-with: opens a menu to choose a viewer; name == NULL -> item under the cursor in the panel; - // if handlerID != NULL, only the selected handler ID is returned (the viewer is not opened); - // on error returns 0xFFFFFFFF + // view-file-with: opens a menu for selecting a viewer; name == NULL -> item under the cursor in the panel; + // handlerID != NULL -> returns only the selected handler ID (does not open the viewer); on failure returns 0xFFFFFFFF void ViewFileWith(char* name, HWND hMenuParent, const POINT* menuPos, DWORD* handlerID, int enumFileNamesSourceUID, int enumFileNamesLastFileIndex); @@ -1275,9 +1286,8 @@ class CFilesWindow : public CFilesWindowAncestor void FillEditWithMenu(CMenuPopup* popup); // edits the focused file using the editor identified by the variable 'index' void OnEditFileWith(int index); - // edit-file-with: opens a menu to choose an editor; name == NULL -> item under the cursor in the panel; - // if handlerID != NULL, only the selected handler ID is returned (the editor is not opened), - // on error returns 0xFFFFFFFF + // edit-file-with: opens a menu for selecting an editor; name == NULL -> item under the cursor in the panel; + // handlerID != NULL -> returns only the selected handler ID (does not open the viewer); on failure returns 0xFFFFFFFF void EditFileWith(char* name, HWND hMenuParent, const POINT* menuPos, DWORD* handlerID = NULL); void FindFile(); void DriveInfo(); @@ -1323,11 +1333,11 @@ class CFilesWindow : public CFilesWindowAncestor virtual LRESULT WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam); // loads Files and Dirs according to panel type from disk, ArchiveDir or PluginFSDir; - // for ptDisk it returns TRUE if the directory was successfully read from disk (FALSE on read - // error or out of memory). For ptZIPArchive and ptPluginFS it returns FALSE only when memory - // runs out or if the path does not exist (checked before calling ReadDirectory, should not happen); - // 'parent' is the parent of message boxes; - // if TRUE is returned, SortDirectory() is also called + // for ptDisk it returns TRUE if the directory was successfully read from disk (FALSE on failure + // to read or out of memory); for ptZIPArchive and ptPluginFS it returns FALSE only if memory + // runs out or if the path does not exist (that is checked before calling ReadDirectory, so it + // should not happen); 'parent' is the parent of message boxes + // if it returns TRUE, it also calls SortDirectory() BOOL ReadDirectory(HWND parent, BOOL isRefresh); // sorts Files and Dirs using the current ordering method; because it reorders them, @@ -1348,14 +1358,14 @@ class CFilesWindow : public CFilesWindowAncestor void RefreshDirectory(BOOL probablyUselessRefresh = FALSE, BOOL forceReloadThumbnails = FALSE, BOOL isInactiveRefresh = FALSE); - // read-dir (archives, FS, disk), sort - // parent is the parent message box - // if suggestedTopIndex != -1, the top index will be set - // if suggestedFocusName != NULL and present in the new list, it will be selected + // reads the directory (archives, FS, disk), sorts + // parent is the parent of the message box + // if suggestedTopIndex != -1, the top index is set + // if suggestedFocusName != NULL and it is present in the new list, it is selected // if refreshListBox is FALSE, RefreshListBox is not called // if readDirectory is FALSE, ReadDirectory is not called - // if isRefresh is TRUE, the path in the panel is refreshed by this - // returns TRUE if ReadDirectory succeeded + // if isRefresh is TRUE, this refreshes the path in the panel + // returns TRUE if ReadDirectory succeeds BOOL CommonRefresh(HWND parent, int suggestedTopIndex = -1, const char* suggestedFocusName = NULL, BOOL refreshListBox = TRUE, BOOL readDirectory = TRUE, BOOL isRefresh = FALSE); @@ -1434,8 +1444,8 @@ class CFilesWindow : public CFilesWindowAncestor BOOL IsTextOnClipboard(); void ClipboardPastePath(); // for changing the current directory - // postprocesses of the user provided path: trims surrounding white spaces and quotes, removes file:// and - // expands environment variables; returns FALSE on error (processing should stop); 'parent' is + // postprocesses the user-provided path: trims surrounding white spaces and quotes, removes file:// and + // expands ENV variables; returns FALSE on failure (processing should stop); 'parent' is // the parent for error message boxes BOOL PostProcessPathFromUser(HWND parent, char (&buff)[2 * MAX_PATH]); @@ -1446,7 +1456,7 @@ class CFilesWindow : public CFilesWindowAncestor void EndQuickSearch(); // ends Quick Search mode // QuickRenameWindow - void AdjustQuickRenameRect(const char* text, RECT* r); // adjusts 'r' so it doesn't exceed the panel and is large enough at the same time + void AdjustQuickRenameRect(const char* text, RECT* r); // adjusts 'r' so it does not exceed the panel and is large enough void AdjustQuickRenameWindow(); // void QuickRenameOnIndex(int index); // calls QuickRenameBegin for the given index void QuickRenameBegin(int index, const RECT* labelRect); // opens QuickRenameWindow @@ -1487,7 +1497,7 @@ class CFilesWindow : public CFilesWindowAncestor int GetCaretIndex(); void SetDropTarget(int index); // marks where files will be dropped - void SetSingleClickIndex(int index); // highlights the item and clears the old one + void SetSingleClickIndex(int index); // highlights the item and unhighlights the old one void SelectFocusedIndex(); void DrawDragBox(POINT p); @@ -1498,13 +1508,13 @@ class CFilesWindow : public CFilesWindowAncestor // RepaintListBox(DRAWFLAG_DIRTY_ONLY | DRAWFLAG_SKIP_VISTEST); // only the first method SetSel can repaint items on explicit request // the first two methods (SetSel and SetSelRange) do not mark the ".." directory item - void SetSel(BOOL select, int index, BOOL repaintDirtyItems = FALSE); // If index is -1 the selection is added to or removed from all strings + void SetSel(BOOL select, int index, BOOL repaintDirtyItems = FALSE); // If index is -1, the selection is added to or removed from all items // returns TRUE if the state of at least one item has changed, otherwise returns FALSE BOOL SetSelRange(BOOL select, int firstIndex, int lastIndex); void SetSel(BOOL select, CFileData* data); // data must be held by the corresponding list BOOL GetSel(int index); - int GetSelItems(int itemsCountMax, int* items, BOOL focusedItemFirst = FALSE); // if 'focusedItemFirst' is TRUE (not used anymore; see GetSelItems body): for context menus, we start we start from the focused item and end with the item before the focus (there is intermediate wrapping back to the beginning of the name list) (the system does it in the same way, see Add To Windows Media Player List on MP3 files) + int GetSelItems(int itemsCountMax, int* items, BOOL focusedItemFirst = FALSE); // if 'focusedItemFirst' is TRUE (no longer used; see the GetSelItems implementation): for context menus, start at the focused item and end with the item before it (wrapping back to the start of the name list in between). The system does the same; see Add To Windows Media Player List on MP3 files // if GetSelCount > 0 returns TRUE, if at least one directory is selected (".." not counted); otherwise it returns FALSE // if GetSelCount == 0 returns TRUE, if a directory is focused (".." not counted); otherwise it returns FALSE @@ -1535,7 +1545,7 @@ class CFilesWindow : public CFilesWindowAncestor void GotoSelectedItem(BOOL next); // if 'next' is TRUE, it moves caret to the next selected item, otherwise to the previous one - void OnSetFocus(BOOL focusVisible = TRUE); // 'focusVisible'==FALSE when switching from the command line to the panel while the user is in a modeless dialog (main window is inactive) - required by the FTP plugin Welcome Message dialog + void OnSetFocus(BOOL focusVisible = TRUE); // 'focusVisible'==FALSE when switching from the command line to the panel while the user is in a modeless dialog (the main window is not active) - needed for the FTP plugin Welcome Message dialog void OnKillFocus(HWND hwndGetFocus); BOOL OnLButtonDown(WPARAM wParam, LPARAM lParam, LRESULT* lResult); @@ -1545,7 +1555,7 @@ class CFilesWindow : public CFilesWindowAncestor BOOL OnRButtonUp(WPARAM wParam, LPARAM lParam, LRESULT* lResult); BOOL OnMouseMove(WPARAM wParam, LPARAM lParam, LRESULT* lResult); - BOOL IsDragDropSafe(int x, int y); // safer drag&drop: returns TRUE if the drag was long enough; x,y are coordinates relative to the panel origin + BOOL IsDragDropSafe(int x, int y); // safer drag-and-drop: returns TRUE if dragging lasted long enough; x and y are coordinates relative to the panel origin BOOL OnTimer(WPARAM wParam, LPARAM lParam, LRESULT* lResult); BOOL OnCaptureChanged(WPARAM wParam, LPARAM lParam, LRESULT* lResult); @@ -1553,7 +1563,7 @@ class CFilesWindow : public CFilesWindowAncestor void LayoutListBoxChilds(); // after a font change layout must be updated void RepaintListBox(DWORD drawFlags); - void RepaintIconOnly(int index); // for index == -1 redraws icons of all items + void RepaintIconOnly(int index); // for index == -1, redraws the icons of all items void EnsureItemVisible(int index); // ensures the item is visible void SetQuickSearchCaretPos(); // sets caret position within FocusedIndex From 684d54419d437ed3e15cf09d30bcf4b81eb90c27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 05:37:49 +0200 Subject: [PATCH 573/710] [translation] Fix src/filter.h comments Refines translated comments in src/filter.h. Model: OpenAI GPT-5.4 Verification: Ran `node --experimental-strip-types src/sequential-review.ts --target-root /mnt/d/Source/OpenSal/salamander_upstream --translation-source /mnt/d/Source/OpenSal/salamander_upstream --baseline-source gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b --artifacts-dir /mnt/d/source/ostranslation/artifacts/src-filter-h-20260419-run1 --cost-profile cheap-first` for the corresponding source set, materialized the approved draft for `src/filter.h` into the fork checkout, reran `guard` against the fork checkout with 0 violations, and ran `git diff --check -- src/filter.h` before commit. The final diff updates 1 comment hunks in that file and leaves code untouched. Before merge, manually reviewed the live PR branch diff and confirmed the final branch head remains a comment-only change consistent with the inline review comments and green check results. Telemetry: Provider-backed stages for this artifact used 3 calls and 72499 total estimated tokens overall. The changed file `src/filter.h` accounted for 3 calls and 72499 estimated tokens. No additional provider-backed rerun was needed after the final manual pre-merge review. From 3853271e62828c57165b306ddedd655155a6b10b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 05:38:11 +0200 Subject: [PATCH 574/710] [translation] Fix src/menu2.cpp comments Refines translated comments in src/menu2.cpp. Model: OpenAI GPT-5.4 Verification: Ran `node --experimental-strip-types src/sequential-review.ts --target-root /mnt/d/Source/OpenSal/salamander_upstream --translation-source /mnt/d/Source/OpenSal/salamander_upstream --baseline-source gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b --artifacts-dir /mnt/d/source/ostranslation/artifacts/src-menu2-cpp-20260419-run1 --cost-profile cheap-first` for the corresponding source set, materialized the approved draft for `src/menu2.cpp` into the fork checkout, reran `guard` against the fork checkout with 0 violations, and ran `git diff --check -- src/menu2.cpp` before commit. The final diff updates 23 comment hunks in that file and leaves code untouched. Before merge, manually reviewed the live PR branch diff and confirmed the final branch head remains a comment-only change consistent with the inline review comments and green check results. Telemetry: Provider-backed stages for this artifact used 35 calls and 664008 total estimated tokens overall. The changed file `src/menu2.cpp` accounted for 35 calls and 664008 estimated tokens. No additional provider-backed rerun was needed after the final manual pre-merge review. --- src/menu2.cpp | 64 +++++++++++++++++++++++++-------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/src/menu2.cpp b/src/menu2.cpp index 40e60b209..bdbb77e01 100644 --- a/src/menu2.cpp +++ b/src/menu2.cpp @@ -281,11 +281,11 @@ BOOL CMenuPopup::EndModifyMode() UpdateWindow(HWindow); /* // update the current item - POINT cursorPos; - GetCursorPos(&cursorPos); - ScreenToClient(HWindow, &cursorPos); - SharedRes->LastMouseMove.x = cursorPos.x - 1; // disable the condition - SendMessage(HWindow, WM_MOUSEMOVE, 0, MAKELPARAM(cursorPos.x, cursorPos.y)); + POINT cursorPos; + GetCursorPos(&cursorPos); + ScreenToClient(HWindow, &cursorPos); + SharedRes->LastMouseMove.x = cursorPos.x - 1; // disable the condition + SendMessage(HWindow, WM_MOUSEMOVE, 0, MAKELPARAM(cursorPos.x, cursorPos.y)); */ } ModifyMode = FALSE; @@ -1131,7 +1131,7 @@ BOOL CMenuPopup::LoadFromHandle() // convert the mii.fState variable if (mii.fState & MFS_CHECKED) { - if (mii.hbmpChecked == NULL) // quick hack because of ICQ which uses checked && mii.hbmpChecked + if (mii.hbmpChecked == NULL) // workaround for ICQ, which uses checked && mii.hbmpChecked item->State |= MENU_STATE_CHECKED; else mii.hbmpUnchecked = mii.hbmpChecked; @@ -1636,8 +1636,8 @@ void CMenuPopup::OnChar(char key, BOOL* leaveMenu, DWORD* retValue) // x64 7zip returns 0xcccccccccccccccc when right-clicking a .7z file, // expanding the 7Zip menu and pressing 'h', which is inconsistent with // http://msdn.microsoft.com/en-us/library/windows/desktop/ms646349%28v=vs.85%29.aspx - // (it should return 0 because nothing in the menu starts with H) - // in any case, we were getting RTCs, so we mask to the lower DWORD + // (it should return 0 because nothing in the menu starts with H). + // In any case, RTCs were firing, so we mask to the lower DWORD. DWORD ret = (DWORD)(SendMessage(SharedRes->HParent, WM_MENUCHAR, MF_POPUP, (LPARAM)hMenu) & 0xffffffff); if (HIWORD(ret) == MNC_SELECT) SelectNewItemIndex(LOWORD(ret), FALSE); @@ -1952,7 +1952,7 @@ void CMenuPopup::OnMouseWheel(WPARAM wParam, LPARAM lParam) if (firstVisibleItem == NULL || lastVisibleItem == NULL) return; if (TopItemY == 0 && lastVisibleItem->YOffset + lastVisibleItem->Height <= Height) - return; // all items are visible; there’s no point in scrolling in this popup + return; // all items are visible; there is no point in scrolling in this popup // check the upper bound (so the top item is not pulled below the top edge of the menu) if (TopItemY + delta >= 0) @@ -1972,7 +1972,7 @@ void CMenuPopup::OnMouseWheel(WPARAM wParam, LPARAM lParam) else downArrow = TRUE; - // if something changed, we will paint (forget scrolling; if it flickers, we can add code later) + // if anything changed, repaint it (ignoring scrolling for now; if it flickers, we can add it later) if (delta != 0 || UpArrowVisible != upArrow || DownArrowVisible != downArrow) { TopItemY += delta; @@ -2051,10 +2051,10 @@ void CMenuPopup::DoDispatchMessage(MSG* msg, BOOL* leaveMenu, DWORD* retValue, B case WM_SYSKEYUP: { - // if the sys key up with VK_F10 was delivered to a modal dialog, a - // WM_SYSCOMMAND message with uCmdType=SC_KEYMENU was sent which activates the window menu - // this happened in Plugins/Encrypt/Create Key/Shift+F10 in one of the edit lines - // with passwords where our menu expands + // If the system key-up for VK_F10 was delivered to a modal dialog, a + // WM_SYSCOMMAND message with uCmdType=SC_KEYMENU was sent, which activated the window menu. + // This occurred in Plugins/Encrypt/Create Key/Shift+F10 in one of the password + // edit boxes, where our menu opens. if (msg->wParam == VK_F10) return; break; @@ -2078,7 +2078,7 @@ void CMenuPopup::DoDispatchMessage(MSG* msg, BOOL* leaveMenu, DWORD* retValue, B } return; } - if (msg->wParam == VK_MENU && (msg->lParam & 0x40000000) == 0 || // Alt down, ale ne autorepeat + if (msg->wParam == VK_MENU && (msg->lParam & 0x40000000) == 0 || // Alt pressed, but not auto-repeat (!shiftPressed && msg->wParam == VK_F10)) { *leaveMenu = TRUE; @@ -2210,7 +2210,7 @@ void CMenuPopup::DoDispatchMessage(MSG* msg, BOOL* leaveMenu, DWORD* retValue, B case VK_RETURN: { popup->OnKeyReturn(leaveMenu, retValue); // open sub menu or produce a command - return; // must not let TranslateMessage handle Return + return; // must not let TranslateMessage translate Return } } msg->hwnd = HWindow; // redirect to us (to prevent keystrokes from leaking out) @@ -2261,15 +2261,15 @@ void CMenuPopup::DoDispatchMessage(MSG* msg, BOOL* leaveMenu, DWORD* retValue, B CMenuItem* item = popup->Items[popup->SelectedItemIndex]; if (!(item->State & MENU_STATE_GRAYED) || SharedRes->MenuBar != NULL && SharedRes->MenuBar->HelpMode && // Petr: we are opened from the menubar and in HelpMode (Shift+F1) + - (item->SubMenu == NULL || item->ID != 0)) // Petr: plus we have a command ID or submenu (a "grayed" submenu cannot be opened) + (item->SubMenu == NULL || item->ID != 0)) // Petr: and we have a command ID or submenu (a "grayed" submenu cannot be opened) { - if (!(item->State & MENU_STATE_GRAYED) && // Petr: opening "grayed" submenus is not possible + if (!(item->State & MENU_STATE_GRAYED) && // Petr: a "grayed" submenu cannot be opened item->SubMenu != NULL && item->SubMenu != popup->OpenedSubMenu) { // if a sub-menu is open, close it if (popup->OpenedSubMenu != NULL) popup->CloseOpenedSubmenu(); - // now I can open a new one + // now a new one can be opened RECT itemRect; popup->GetItemRect(popup->SelectedItemIndex, &itemRect); item->SubMenu->SharedRes = SharedRes; @@ -2290,7 +2290,7 @@ void CMenuPopup::DoDispatchMessage(MSG* msg, BOOL* leaveMenu, DWORD* retValue, B { *leaveMenu = TRUE; *retValue = item->ID; - if (SharedRes->MenuBar != NULL) // we were opened from the menubar + if (SharedRes->MenuBar != NULL) // opened from the menu bar SharedRes->MenuBar->ExitMenuLoop = TRUE; // so we exit it } } @@ -2585,7 +2585,7 @@ BOOL CMenuPopup::CreatePopupWindow(CMenuPopup* firstPopup, int x, int y, int sub else if (TrackFlags & MENU_TRACK_BOTTOMALIGN) newY -= height; - // handle the menu crossing the right or left edge of the visible area + // handle overflow past the right and left edges of the visible area if (newX + width > clipRect.right) newX = clipRect.right - width; if (newX < clipRect.left) @@ -2924,14 +2924,14 @@ CMenuPopup::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) PAINTSTRUCT ps; HANDLES(BeginPaint(HWindow, &ps)); PaintAllItems(NULL); - HANDLES(EndPaint(HWindow, &ps)); // only turns off the caret that we do not have anyway + HANDLES(EndPaint(HWindow, &ps)); // only hides the caret, which we do not have anyway return 0; } /* - // support for animation + // animation support case WM_PRINTCLIENT: { - HDC hDC = (HDC) wParam; + HDC hDC = (HDC) wParam; if (lParam & PRF_CLIENT) { int y = 0; @@ -2963,17 +2963,17 @@ CMenuPopup::Track(DWORD trackFlags, int x, int y, HWND hwnd, const RECT* exclude if (!(trackFlags & MENU_TRACK_NONOTIFY)) SendMessage(hwnd, WM_USER_ENTERMENULOOP, 0, 0); - SelectedByMouse = FALSE; // in 2.5b9 the variable was not initialized and ChangeDeriveMenu Alt+F1/2 - // behaved unpredictably -- moving the cursor outside the menu sometimes + SelectedByMouse = FALSE; // in 2.5b9 the variable was not initialized, and ChangeDeriveMenu Alt+F1/2 + // behaved unpredictably: moving the cursor outside the menu sometimes // caused the selection to be lost - // if this behaviour is not suitable for CMenuPopup::Track(), - // it might be time to introduce a control flag in trackFlags + // if this behavior is not suitable for CMenuPopup::Track(), + // a control flag in trackFlags should probably be introduced DWORD retValue = TrackInternal(trackFlags, x, y, hwnd, exclude, NULL, msg, dispatchMsg); if (!(trackFlags & MENU_TRACK_NONOTIFY)) SendMessage(hwnd, WM_USER_LEAVEMENULOOP, 0, 0); - // if we installed a hook, we will also unhook it + // if we installed a hook, unhook it as well if (hOldHookProc != NULL) OldMenuHookTlsAllocator.UnhookThread(hOldHookProc); @@ -3059,7 +3059,7 @@ CMenuPopup::TrackInternal(DWORD trackFlags, int x, int y, HWND hwnd, const RECT* BeginStopRefresh(); // we do not want any refreshes BeginStopIconRepaint(); // we do not want any icon repaints - // open the father window + // open the parent window // TRACE_I("MENU: creating window"); if (CreatePopupWindow(this, x, y, 0, exclude)) { @@ -3097,7 +3097,7 @@ CMenuPopup::TrackInternal(DWORD trackFlags, int x, int y, HWND hwnd, const RECT* if (msg.message == WM_LBUTTONDOWN) skipFirstLBtnDblclk = FALSE; if (msg.message == WM_LBUTTONDBLCLK) - continue; // skip the message because it is a typo after lbuttondown + continue; // skip the message because it is a spurious double-click after WM_LBUTTONDOWN } if (skipFirstLBtnUp) { @@ -3107,7 +3107,7 @@ CMenuPopup::TrackInternal(DWORD trackFlags, int x, int y, HWND hwnd, const RECT* { skipFirstLBtnUp = FALSE; if (FindPopup(PopupWindowFromPoint(msg.pt)) == NULL) - continue; // skip the message to avoid immediate window closing + continue; // skip the message to prevent the window from closing immediately } } DoDispatchMessage(&msg, &leaveMenu, &retValue, &dispatchLater); From 3d078b7161580bd2188bbbd588f9d82d17a1d81a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 05:38:18 +0200 Subject: [PATCH 575/710] [translation] Fix src/menu3.cpp comments Refines translated comments in src/menu3.cpp. Model: OpenAI GPT-5.4 Verification: Ran `node --experimental-strip-types src/sequential-review.ts --target-root /mnt/d/Source/OpenSal/salamander_upstream --translation-source /mnt/d/Source/OpenSal/salamander_upstream --baseline-source gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b --artifacts-dir /mnt/d/source/ostranslation/artifacts/src-menu3-cpp-20260419-run1 --cost-profile cheap-first` for the corresponding source set, materialized the approved draft for `src/menu3.cpp` into the fork checkout, reran `guard` against the fork checkout with 0 violations, and ran `git diff --check -- src/menu3.cpp` before commit. The final diff updates 2 comment hunks in that file and leaves code untouched. Before merge, manually reviewed the live PR branch diff and confirmed the final branch head remains a comment-only change consistent with the inline review comments and green check results. Telemetry: Provider-backed stages for this artifact used 10 calls and 196748 total estimated tokens overall. The changed file `src/menu3.cpp` accounted for 10 calls and 196748 estimated tokens. No additional provider-backed rerun was needed after the final manual pre-merge review. From 01d63e88483707b79cdfe3ff80d08f22404a0340 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 05:38:25 +0200 Subject: [PATCH 576/710] [translation] Fix src/packac.cpp comments Refines translated comments in src/packac.cpp. Model: OpenAI GPT-5.4 Verification: Ran `node --experimental-strip-types src/sequential-review.ts --target-root /mnt/d/Source/OpenSal/salamander_upstream --translation-source /mnt/d/Source/OpenSal/salamander_upstream --baseline-source gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b --artifacts-dir /mnt/d/source/ostranslation/artifacts/src-packac-cpp-20260419-run1 --cost-profile cheap-first` for the corresponding source set, materialized the approved draft for `src/packac.cpp` into the fork checkout, reran `guard` against the fork checkout with 0 violations, and ran `git diff --check -- src/packac.cpp` before commit. The final diff updates 15 comment hunks in that file and leaves code untouched. Before merge, manually reviewed the live PR branch diff and confirmed the final branch head remains a comment-only change consistent with the inline review comments and green check results. Telemetry: Provider-backed stages for this artifact used 32 calls and 673437 total estimated tokens overall. The changed file `src/packac.cpp` accounted for 32 calls and 673437 estimated tokens. No additional provider-backed rerun was needed after the final manual pre-merge review. --- src/packac.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/packac.cpp b/src/packac.cpp index 172d32e91..262c15a9f 100644 --- a/src/packac.cpp +++ b/src/packac.cpp @@ -400,7 +400,7 @@ void CPackACDialog::LayoutControls() // block finished HANDLES(EndDeferWindowPos(hdwp)); } - // and adjust the column width in the list view + // adjust the list view column widths ListView->SetColumnWidth(); } @@ -753,7 +753,7 @@ void CPackACDialog::AddToExtensions(int foundIndex, int packerIndex, CPackACPack int found; do { - // look for who is using us + // find who uses us buffer[0] = '.'; int j = 1; while (*ptr != ';' && *ptr != '\0') @@ -773,10 +773,10 @@ void CPackACDialog::AddToExtensions(int foundIndex, int packerIndex, CPackACPack { int pos; CPackACPacker* p = NULL; - // if we are working with a packer adjust the record for the packer + // If we are working with a packer, update the packer entry if (foundPacker->GetPackerType() == Packer_Packer || foundPacker->GetPackerType() == Packer_Standalone) { - // if we used a packer, find out whether we found it + // if we used a packer, check whether we found it if (PackerFormatConfig.GetUsePacker(found - 1)) { pos = PackerFormatConfig.GetPackerIndex(found - 1); @@ -818,7 +818,7 @@ void CPackACDialog::AddToExtensions(int foundIndex, int packerIndex, CPackACPack if (p->GetArchiverIndex() == pos && p->GetPackerType() != Packer_Packer) break; } - // if the existing packer is not a plugin, was not found, or is different and we have a 32-bit one + // if the current packer is not a plugin, was not found, or is different and we have a 32-bit one if (pos >= 0 && pos != packerIndex && (p == NULL || p->GetSelectedFullName() == NULL || foundPacker->GetExeType() == EXE_32BIT)) { @@ -987,8 +987,8 @@ void CPackACDialog::RemoveFromCustom(int foundIndex, int packerIndex) CALL_STACK_MESSAGE3("CPackACDialog::RemoveFromCustom(%d, %d)", foundIndex, packerIndex); // a custom packer/unpacker is removed if: - // 1) the packer wasn't found or was found but not selected (fullName == NULL) - // 2) the invoked program is a variable corresponding to this packer + // 1) the packer was not found, or it was found but not selected (fullName == NULL) + // 2) the invoked program is the variable corresponding to this packer CPackACPacker* p = NULL; char variable[50]; @@ -1218,8 +1218,8 @@ int CPackACPacker::CheckAndInsert(const char* path, const char* fileName, FILETI ref++; act++; } - // the extension has been checked already; now verify if we are at the end of the string - // and whether other requirements are met (currently only the type, we will see in the future...) + // the extension has already been checked; now just verify that we are at the end of the string + // and that the other requirements are met (currently only the type; more may be added in the future) if (*ref == '\0' && act == &fileName[lstrlen(fileName) - 4] && exeType == Type) { @@ -1311,7 +1311,7 @@ int CPackACArray::AddAndCheck(CPackACFound* member) void CPackACArray::InvertSelect(int index) { CALL_STACK_MESSAGE2("CPackACArray::InvertSelect(%d)", index); - // the user must be allowed to select nothing + // the user must be allowed to leave nothing selected if (At(index)->Selected) At(index)->Selected = FALSE; else @@ -1401,7 +1401,7 @@ CPackACListView::GetPacker(int item, int* index) return PackersTable->At(archiver); } -// find an archiver by the index in the list view +// finds an archiver by its index in the list view BOOL CPackACListView::FindArchiver(unsigned int listViewIndex, unsigned int* archiver, unsigned int* arcIndex) { @@ -1492,7 +1492,7 @@ void CPackACListView::SetColumnWidth() { CALL_STACK_MESSAGE1("CPackACListView::SetColumnWidth()"); RECT r; - // find out the size we must fit into + // determine the size we must fit into GetClientRect(HWindow, &r); // total width DWORD cx = r.right - r.left - 1; @@ -1519,7 +1519,7 @@ BOOL CPackACListView::ConsiderItem(const char* path, const char* fileName, FILET // initialization BOOL stop = FALSE; int totalCount = 0; - // go through all packers to see if it is the one we are looking for + // go through all packers to see whether any of them is one of the ones we are looking for int i; for (i = 0; i < PackersTable->Count; i++) { From 5af74bd6673f2bd4e667f8269c03dbc06b7d2e3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 05:38:32 +0200 Subject: [PATCH 577/710] [translation] Fix src/pwdmngr.cpp comments Refines translated comments in src/pwdmngr.cpp. Model: OpenAI GPT-5.4 Verification: Ran `node --experimental-strip-types src/sequential-review.ts --target-root /mnt/d/Source/OpenSal/salamander_upstream --translation-source /mnt/d/Source/OpenSal/salamander_upstream --baseline-source gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b --artifacts-dir /mnt/d/source/ostranslation/artifacts/src-pwdmngr-cpp-20260419-run1 --cost-profile cheap-first` for the corresponding source set, materialized the approved draft for `src/pwdmngr.cpp` into the fork checkout, reran `guard` against the fork checkout with 0 violations, and ran `git diff --check -- src/pwdmngr.cpp` before commit. The final diff updates 6 comment hunks in that file and leaves code untouched. Before merge, manually reviewed the live PR branch diff and confirmed the final branch head remains a comment-only change consistent with the inline review comments and green check results. Telemetry: Provider-backed stages for this artifact used 11 calls and 222321 total estimated tokens overall. The changed file `src/pwdmngr.cpp` accounted for 11 calls and 222321 estimated tokens. No additional provider-backed rerun was needed after the final manual pre-merge review. --- src/pwdmngr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pwdmngr.cpp b/src/pwdmngr.cpp index 8de820290..3416ba1f0 100644 --- a/src/pwdmngr.cpp +++ b/src/pwdmngr.cpp @@ -158,7 +158,7 @@ BOOL UnscramblePassword(char* password) } if (!ok) { - password[0] = 0; // some error occured; clear the password + password[0] = 0; // some error occurred; clear the password TRACE_E("Unable to unscramble password! scrambled=" << backup); } memset(backup, 0, lstrlen(backup)); // wipe the memory that contained the password @@ -618,7 +618,7 @@ BOOL CPasswordManager::DecryptPassword(const BYTE* encryptedPassword, int encryp TRY_DECRYPT_AGAIN: - BYTE* tmpBuff = (BYTE*)malloc(encryptedPasswordSize + 1); // +1 for the terminator so we can call unscramble after AES + BYTE* tmpBuff = (BYTE*)malloc(encryptedPasswordSize + 1); // +1 for the terminator so we can call unscramble after AES memcpy(tmpBuff, encryptedPassword, encryptedPasswordSize); tmpBuff[encryptedPasswordSize] = 0; // terminator required by UnscramblePassword From 8c376f5380c18c92bfe0a9f7696cddd090acf42e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 05:50:40 +0200 Subject: [PATCH 578/710] [translation] Fix src/mainwnd2.cpp comments Refines translated comments in src/mainwnd2.cpp. Model: OpenAI GPT-5.4 Verification: Ran `node --experimental-strip-types src/sequential-review.ts --target-root /mnt/d/Source/OpenSal/salamander_upstream --translation-source /mnt/d/Source/OpenSal/salamander_upstream --baseline-source gh:OpenSalamander/salamander/a28afcb958578dd219311a7b500320b162de812b --artifacts-dir /mnt/d/source/ostranslation/artifacts/src-mainwnd2-cpp-20260419-run1 --cost-profile cheap-first` for the corresponding source set, materialized the approved draft for `src/mainwnd2.cpp` into the fork checkout, reran `guard` against the fork checkout with 0 violations, and ran `git diff --check -- src/mainwnd2.cpp` before commit. The final diff updates 32 comment hunks in that file and leaves code untouched. Telemetry: Provider-backed stages for this artifact used 43 calls and 841459 total estimated tokens overall. The changed file `src/mainwnd2.cpp` accounted for 43 calls and 841459 estimated tokens. --- src/mainwnd2.cpp | 251 ++++++++++++++++++++++++----------------------- 1 file changed, 126 insertions(+), 125 deletions(-) diff --git a/src/mainwnd2.cpp b/src/mainwnd2.cpp index 76fe3d8ee..7b46afb92 100644 --- a/src/mainwnd2.cpp +++ b/src/mainwnd2.cpp @@ -51,102 +51,102 @@ // 21 = 2.5b6 only to transfer plug-in configuration from version 2.5b5(a) // 22 = 2.5b6 panel filters - unified into one history // 23 = 2.5b6 new panel view (Tiles) -// 24 = 2.5b7 only to transfer plug-in configuration from version 2.5b6 -// 25 = 2.5b7 plugins: show in plugin bar -> transfer variable into CPluginData -// 26 = 2.5b8 only to transfer plug-in configuration from version 2.5b7 -// 27 = 2.5b9 only to transfer plug-in configuration from version 2.5b8 -// 28 = 2.5b9 new color scheme from old DOS Navigator -> convert 'scheme' -// 29 = 2.5b10 only to transfer plug-in configuration from version 2.5b9 -// 30 = 2.5b11 only to transfer plug-in configuration from version 2.5b10 -// 31 = 2.5b11 introduced Floppy section in Drives configuration - need to force reading icons for Removable +// 24 = 2.5b7 only to transfer plugin configuration from version 2.5b6 +// 25 = 2.5b7 plugins: show in plugin bar -> transfer the variable to CPluginData +// 26 = 2.5b8 only to transfer plugin configuration from version 2.5b7 +// 27 = 2.5b9 only to transfer plugin configuration from version 2.5b8 +// 28 = 2.5b9 new color scheme based on the old DOS Navigator -> convert 'scheme' +// 29 = 2.5b10 only to transfer plugin configuration from version 2.5b9 +// 30 = 2.5b11 only to transfer plugin configuration from version 2.5b10 +// 31 = 2.5b11 introduced the Floppy section in the Drives configuration - need to force icon loading for Removable // 32 = 2.5b11 Find: "Local Settings\\Temporary Internet Files" is searched by default -// 33 = 2.5b12 only to transfer plug-in configuration from version 2.5b11 -// 34 = 2.5b12 modification of external packer/unpacker PKZIP25 (external Win32 version) -// 35 = 2.5RC1 only to transfer plug-in configuration from version 2.5b12 (internal only, we shipped RC1 instead) -// 36 = 2.5RC2 only to transfer plug-in configuration from version 2.5RC1 -// 37 = 2.5RC3 only to transfer plug-in configuration from version 2.5RC2 +// 33 = 2.5b12 only to transfer plugin configuration from version 2.5b11 +// 34 = 2.5b12 modification of the external PKZIP25 packer/unpacker (external Win32 version) +// 35 = 2.5RC1 only to transfer plugin configuration from version 2.5b12 (internal only, RC1 was released instead) +// 36 = 2.5RC2 only to transfer plugin configuration from version 2.5RC1 +// 37 = 2.5RC3 only to transfer plugin configuration from version 2.5RC2 // 38 = 2.5RC3 renamed Servant Salamander to Altap Salamander -// 39 = 2.5 only to transfer plug-in configuration from version 2.5RC3 -// 40 = 2.51 only to transfer plug-in configuration from version 2.5 +// 39 = 2.5 only to transfer plugin configuration from version 2.5RC3 +// 40 = 2.51 only to transfer plugin configuration from version 2.5 // 41 = 2.51 configuration version containing a list of disabled icon overlay handlers (see CONFIG_DISABLEDCUSTICOVRLS_REG) -// 42 = 2.52b1 only to transfer plug-in configuration from version 2.51 -// 43 = 2.52b2 only to transfer plug-in configuration from version 2.52 beta 1 -// 44 = 2.52b2 changed viewer, editor and archiver extensions to lowercase (uppercase extensions are obsolete in Windows) -// 45 = 2.52b2 introduced password manager, forced FTP client load so it registers to use the Password Manager, see SetPluginUsesPasswordManager -// 46 = 2.52 (DB30) only to transfer plug-in configuration from version 2.52 beta 2 -// 47 = 2.52 (IB31) support for Sal/Env variables like $(SalDir) or $[USERPROFILE] in hot paths; need to escape old hot paths -// 48 = 2.52 only to transfer plug-in configuration from version 2.52 (DB30) -// 49 = 2.53b1 (DB33) only to transfer plug-in configuration from version 2.52 -// 50 = 2.53b1 (DB36) only to transfer plug-in configuration from version 2.53b1 (DB33) -// 51 = 2.53b1 (PB38) only to transfer plug-in configuration from version 2.53b1 (DB36) -// 52 = 2.53b1 (DB39) only to transfer plug-in configuration from version 2.53b1 (PB38) -// 53 = 2.53b1 (DB41) only to transfer plug-in configuration from version 2.53b1 (DB39) -// 54 = 2.53b1 (PB44) only to transfer plug-in configuration from version 2.53b1 (DB41) -// 55 = 2.53b1 (DB46) only to transfer plug-in configuration from version 2.53b1 (PB44) -// 56 = 2.53b1 only to transfer plug-in configuration from version 2.53b1 (DB46) -// 57 = 2.53 (DB52) only to transfer plug-in configuration from version 2.53b1 -// 58 = 2.53b2 (IB55) only to transfer plug-in configuration from version 2.53 (DB52) -// 59 = 2.53b2 only to transfer plug-in configuration from version 2.53b2 (IB55) -// 60 = 2.53 (DB60) only to transfer plug-in configuration from version 2.53b2 -// 61 = 2.53 only to transfer plug-in configuration from version 2.53 (DB60) -// 62 = 2.54b1 (DB66) only to transfer plug-in configuration from version 2.53 -// 63 = 2.54 only to transfer plug-in configuration from version 2.54b1 (DB66) -// 64 = 2.55b1 (DB72) only to transfer plug-in configuration from version 2.54 -// 65 = 2.55b1 (DB72) external archivers: identify by UID instead of Title (translated according to language version, so cannot be used for identification) - switching language caused external archiver paths to be lost -// 66 = 3.00b1 (PB75) only to transfer plug-in configuration from version 2.55b1 (DB72) -// 67 = 3.00b1 (DB76) only to transfer plug-in configuration from version 3.00b1 (PB75) -// 68 = 3.00b1 (PB79) only to transfer plug-in configuration from version 3.00b1 (DB76) -// 69 = 3.00b1 (DB80) only to transfer plug-in configuration from version 3.00b1 (PB79) -// 70 = 3.00b1 (DB83) only to transfer plug-in configuration from version 3.00b1 (DB80) -// 71 = 3.00b1 (PB87) only to transfer plug-in configuration from version 3.00b1 (DB83) -// 72 = 3.00b1 (DB88) only to transfer plug-in configuration from version 3.00b1 (PB87) -// 73 = 3.00b1 only to transfer plug-in configuration from version 3.00b1 (DB88) -// 74 = 3.00b2 (DB94) only to transfer plug-in configuration from version 3.00b1 -// 75 = 3.00b2 only to transfer plug-in configuration from version 3.00b2 (DB94) -// 76 = 3.00b3 (DB100) only to transfer plug-in configuration from version 3.00b2 -// 77 = 3.00b3 (PB103) only to transfer plug-in configuration from version 3.00b3 (DB100) -// 78 = 3.00b3 (DB105) only to transfer plug-in configuration from version 3.00b3 (PB103) -// 79 = 3.00b3 only to transfer plug-in configuration from version 3.00b3 (DB105) -// 80 = 3.00b4 (DB111) only to transfer plug-in configuration from version 3.00b3 -// 81 = 3.00b4 (DB111) RAR 5.0 needs a new switch on the command line because of file list encoding -// 82 = 3.00b4 only to transfer plug-in configuration from version 3.00b4 (DB111) -// 83 = 3.00b5 (DB117) only to transfer plug-in configuration from version 3.00b4 -// 84 = 3.0 only to transfer plug-in configuration from version 3.00b5 (DB117) -// 85 = 3.10b1 (DB123) only to transfer plug-in configuration from version 3.0 -// 86 = 3.01 only to transfer plug-in configuration from version 3.10b1 (DB123) -// 87 = 3.10b1 (DB129) only to transfer plug-in configuration from version 3.01 -// 88 = 3.02 only to transfer plug-in configuration from version 3.10b1 (DB129) -// 89 = 3.10b1 (DB135) only to transfer plug-in configuration from version 3.02 -// 90 = 3.03 only to transfer plug-in configuration from version 3.10b1 (DB135) -// 91 = 3.10b1 (DB141) only to transfer plug-in configuration from version 3.03 -// 92 = 3.04 only to transfer plug-in configuration from version 3.10b1 (DB141) -// 93 = 3.10b1 (DB147) only to transfer plug-in configuration from version 3.04 -// 94 = 3.05 only to transfer plug-in configuration from version 3.10b1 (DB147) -// 95 = 3.10b1 (DB153) only to transfer plug-in configuration from version 3.05 -// 96 = 3.06 only to transfer plug-in configuration from version 3.10b1 (DB153) -// 97 = 3.10b1 (DB159) only to transfer plug-in configuration from version 3.06 -// 98 = 3.10b1 (DB162) only to transfer plug-in configuration from version 3.10b1 (DB159) -// 99 = 3.07 only to transfer plug-in configuration from version 3.10b1 (DB162) -// 100 = 4.00b1 (DB168) only to transfer plug-in configuration from version 3.07 -// 101 = 3.08 only to transfer plug-in configuration from version 4.00b1 (DB168) - by mistake 3.08 and DB171 share the same version number 101, sorry, I will be more careful next time -// 101 = 4.00b1 (DB171) only to transfer plug-in configuration from version 4.00b1 (DB168); this is the last VC2008 build, later versions are VC2019 -// 102 = 4.00b1 (DB177) only to transfer plug-in configuration from version 4.00b1 (DB171) -// 103 = 4.00 only to transfer plug-in configuration from version 4.00b1 (DB177) -// 104 = 5.00 only to transfer plug-in configuration from version 4.00, first Open Salamander release +// 42 = 2.52b1 only to transfer plugin configuration from version 2.51 +// 43 = 2.52b2 only to transfer plugin configuration from version 2.52 beta 1 +// 44 = 2.52b2 changed viewer, editor, and archiver extensions to lowercase (uppercase extensions are obsolete in Windows) +// 45 = 2.52b2 introduced the password manager, forced the FTP client to load so it registers to use the Password Manager; see SetPluginUsesPasswordManager +// 46 = 2.52 (DB30) only to transfer plugin configuration from version 2.52 beta 2 +// 47 = 2.52 (IB31) support for Sal/Env variables such as $(SalDir) or $[USERPROFILE] in hot paths; old hot paths need to be escaped +// 48 = 2.52 only to transfer plugin configuration from version 2.52 (DB30) +// 49 = 2.53b1 (DB33) only to transfer plugin configuration from version 2.52 +// 50 = 2.53b1 (DB36) only to transfer plugin configuration from version 2.53b1 (DB33) +// 51 = 2.53b1 (PB38) only to transfer plugin configuration from version 2.53b1 (DB36) +// 52 = 2.53b1 (DB39) only to transfer plugin configuration from version 2.53b1 (PB38) +// 53 = 2.53b1 (DB41) only to transfer plugin configuration from version 2.53b1 (DB39) +// 54 = 2.53b1 (PB44) only to transfer plugin configuration from version 2.53b1 (DB41) +// 55 = 2.53b1 (DB46) only to transfer plugin configuration from version 2.53b1 (PB44) +// 56 = 2.53b1 only to transfer plugin configuration from version 2.53b1 (DB46) +// 57 = 2.53 (DB52) only to transfer plugin configuration from version 2.53b1 +// 58 = 2.53b2 (IB55) only to transfer plugin configuration from version 2.53 (DB52) +// 59 = 2.53b2 only to transfer plugin configuration from version 2.53b2 (IB55) +// 60 = 2.53 (DB60) only to transfer plugin configuration from version 2.53b2 +// 61 = 2.53 only to transfer plugin configuration from version 2.53 (DB60) +// 62 = 2.54b1 (DB66) only to transfer plugin configuration from version 2.53 +// 63 = 2.54 only to transfer plugin configuration from version 2.54b1 (DB66) +// 64 = 2.55b1 (DB72) only to transfer plugin configuration from version 2.54 +// 65 = 2.55b1 (DB72) external archivers: identify by UID instead of Title (translated by language version, so it cannot be used for identification) - switching languages caused the external archiver paths to be lost +// 66 = 3.00b1 (PB75) only to transfer plugin configuration from version 2.55b1 (DB72) +// 67 = 3.00b1 (DB76) only to transfer plugin configuration from version 3.00b1 (PB75) +// 68 = 3.00b1 (PB79) only to transfer plugin configuration from version 3.00b1 (DB76) +// 69 = 3.00b1 (DB80) only to transfer plugin configuration from version 3.00b1 (PB79) +// 70 = 3.00b1 (DB83) only to transfer plugin configuration from version 3.00b1 (DB80) +// 71 = 3.00b1 (PB87) only to transfer plugin configuration from version 3.00b1 (DB83) +// 72 = 3.00b1 (DB88) only to transfer plugin configuration from version 3.00b1 (PB87) +// 73 = 3.00b1 only to transfer plugin configuration from version 3.00b1 (DB88) +// 74 = 3.00b2 (DB94) only to transfer plugin configuration from version 3.00b1 +// 75 = 3.00b2 only to transfer plugin configuration from version 3.00b2 (DB94) +// 76 = 3.00b3 (DB100) only to transfer plugin configuration from version 3.00b2 +// 77 = 3.00b3 (PB103) only to transfer plugin configuration from version 3.00b3 (DB100) +// 78 = 3.00b3 (DB105) only to transfer plugin configuration from version 3.00b3 (PB103) +// 79 = 3.00b3 only to transfer plugin configuration from version 3.00b3 (DB105) +// 80 = 3.00b4 (DB111) only to transfer plugin configuration from version 3.00b3 +// 81 = 3.00b4 (DB111) RAR 5.0 needs a new command-line switch because of file list encoding +// 82 = 3.00b4 only to transfer plugin configuration from version 3.00b4 (DB111) +// 83 = 3.00b5 (DB117) only to transfer plugin configuration from version 3.00b4 +// 84 = 3.0 only to transfer plugin configuration from version 3.00b5 (DB117) +// 85 = 3.10b1 (DB123) only to transfer plugin configuration from version 3.0 +// 86 = 3.01 only to transfer plugin configuration from version 3.10b1 (DB123) +// 87 = 3.10b1 (DB129) only to transfer plugin configuration from version 3.01 +// 88 = 3.02 only to transfer plugin configuration from version 3.10b1 (DB129) +// 89 = 3.10b1 (DB135) only to transfer plugin configuration from version 3.02 +// 90 = 3.03 only to transfer plugin configuration from version 3.10b1 (DB135) +// 91 = 3.10b1 (DB141) only to transfer plugin configuration from version 3.03 +// 92 = 3.04 only to transfer plugin configuration from version 3.10b1 (DB141) +// 93 = 3.10b1 (DB147) only to transfer plugin configuration from version 3.04 +// 94 = 3.05 only to transfer plugin configuration from version 3.10b1 (DB147) +// 95 = 3.10b1 (DB153) only to transfer plugin configuration from version 3.05 +// 96 = 3.06 only to transfer plugin configuration from version 3.10b1 (DB153) +// 97 = 3.10b1 (DB159) only to transfer plugin configuration from version 3.06 +// 98 = 3.10b1 (DB162) only to transfer plugin configuration from version 3.10b1 (DB159) +// 99 = 3.07 only to transfer plugin configuration from version 3.10b1 (DB162) +// 100 = 4.00b1 (DB168) only to transfer plugin configuration from version 3.07 +// 101 = 3.08 only to transfer plugin configuration from version 4.00b1 (DB168) - 3.08 and DB171 accidentally share version number 101; hopefully harmless, but avoid this next time +// 101 = 4.00b1 (DB171) only to transfer plugin configuration from version 4.00b1 (DB168); this is the last VC2008 build, later versions are built with VC2019 +// 102 = 4.00b1 (DB177) only to transfer plugin configuration from version 4.00b1 (DB171) +// 103 = 4.00 only to transfer plugin configuration from version 4.00b1 (DB177) +// 104 = 5.00 only to transfer plugin configuration from version 4.00, first Open Salamander release // -// When increasing configuration version, add one to THIS_CONFIG_VERSION +// When increasing the configuration version, add 1 to THIS_CONFIG_VERSION // // When upgrading to a new program version, THIS_CONFIG_VERSION must be incremented by 1 -// so that new plug-ins are auto-installed and the plugins.ver counter resets. +// so that new plugins are auto-installed and the plugins.ver counter is reset. // const DWORD THIS_CONFIG_VERSION = 104; // Configuration roots for individual Open Salamander versions. -// The root of the current (youngest) configuration is at index 0. -// Then follow other roots towards older versions of the program. -// The last index contains NULL and serves as a terminator when working with the array. -// When creating a new configuration version (should be stored separately in the registry from the previous one) +// The root of the current (latest) configuration is at index 0. +// It is followed by the other roots, in order toward older program versions. +// The last index contains NULL, which serves as a terminator when working with the array. +// When creating a new configuration version (which should be stored separately in the registry from the previous one), // simply insert the path at index 0. // !!! Keep the corresponding lines in SalamanderConfigurationVersions up to date @@ -325,11 +325,11 @@ const char* SalamanderConfigurationVersions[SALCFG_ROOTS_COUNT] = const char* SALAMANDER_ROOT_REG = NULL; // will be set in salamdr1.cpp const char* SALAMANDER_SAVE_IN_PROGRESS = "Save In Progress"; // value exists only during configuration save (detects interrupted saves -> corrupted configuration) -BOOL IsSetSALAMANDER_SAVE_IN_PROGRESS = FALSE; // TRUE = the registry contains SALAMANDER_SAVE_IN_PROGRESS (detect interrupted configuration saving) +BOOL IsSetSALAMANDER_SAVE_IN_PROGRESS = FALSE; // TRUE = the registry contains SALAMANDER_SAVE_IN_PROGRESS (detects interrupted configuration saving) const char* SALAMANDER_COPY_IS_OK = "Copy Is OK"; // backup key only: value exists only if the key was copied completely -const char* SALAMANDER_AUTO_IMPORT_CONFIG = "AutoImportConfig"; // value exists only during upgrade: installer overwrites the old version with the new and stores this value pointing to the old configuration key from which the configuration should be imported +const char* SALAMANDER_AUTO_IMPORT_CONFIG = "AutoImportConfig"; // value exists only during upgrade: the installer overwrites the old version with the new one and stores this value in the new version's key, pointing to the old configuration key from which the configuration should be imported const char* FINDDIALOG_WINDOW_REG = "Find Dialog Window"; const char* SALAMANDER_WINDOW_REG = "Window"; @@ -921,7 +921,7 @@ BOOL GetUpgradeInfo(BOOL* autoImportConfig, char* autoImportConfigFromKey, int a if (!*autoImportConfig && // this version's key lacks "AutoImportConfig" or does not point to a valid old configuration HANDLES_Q(RegOpenKeyEx(HKEY_CURRENT_USER, SalamanderConfigurationRoots[0], 0, KEY_READ | KEY_WRITE, &rootKey)) == ERROR_SUCCESS) - { // remove "AutoImportConfig" from this version's key (if it exists it makes no sense here) + { // remove "AutoImportConfig" from this version's key if it exists; it serves no purpose here RegDeleteValue(rootKey, SALAMANDER_AUTO_IMPORT_CONFIG); HANDLES(RegCloseKey(rootKey)); } @@ -976,7 +976,7 @@ BOOL FindLanguageFromPrevVerOfSal(char* slgName) if (cfgFound) { BOOL found = FALSE; - if (rootIndex != 0 && // only for one of the older keys + if (rootIndex != 0 && // only if this is one of the older keys configVersion >= 59 /* 2.53 beta 2 */) // before 2.53 beta 2 there was only English, so reading makes no sense; offer system default language or manual selection of the language { GetValue(hCfgKey, CONFIG_LANGUAGE_REG, REG_SZ, slgName, MAX_PATH); @@ -993,8 +993,8 @@ BOOL FindLanguageFromPrevVerOfSal(char* slgName) return FALSE; } -// obtains a number from a string (unsigned decimal format); returns TRUE, if a number was found -// ignores white spaces before and after the number +// Gets a number from a string (decimal format without a sign); returns TRUE if a number was found +// Ignores whitespace before and after the number BOOL GetNumFromStr(const char* s, DWORD* retNum) { DWORD n = 0; @@ -1013,7 +1013,7 @@ void CheckShutdownParams() { // HKEY_CURRENT_USER\Control Panel\Desktop\WaitToKillAppTimeout=20000,REG_SZ ... warn if less than 20000 // HKEY_CURRENT_USER\Control Panel\Desktop\AutoEndTasks=0,REG_SZ ... warn if not 0 - // W2K and XP have it; I could not find it on Vista but supposedly it is there (info from the internet) + // W2K and XP have these settings; they were not found on Vista, but they are reportedly present there as well (per internet sources) BOOL showWarning = FALSE; HKEY key; @@ -1043,10 +1043,11 @@ void CheckShutdownParams() BOOL MyRegRenameKey(HKEY key, const char* name, const char* newName) { BOOL ret = FALSE; - // There is also NtRenameKey but I could not get it working (requires UNICODE_STRING - // and probably the key opened via NtOpenKey with the key passed via OBJECT_ATTRIBUTES initialized through - // InitializeObjectAttributes). It's overly complicated and not frequently used code, - // so we'll do it the slow but simple way... copy the key to a new one and then delete the original + // NtRenameKey also exists, but it proved impractical here (it requires UNICODE_STRING + // and probably also a key opened via NtOpenKey, with the key passed through OBJECT_ATTRIBUTES + // initialized by InitializeObjectAttributes). That is unnecessarily complicated for + // infrequently used code, so use the slow but simple approach: copy the key to a new one, + // then delete the original. HKEY newKey; if (!OpenKeyAux(NULL, key, newName, newKey)) // verify if the target key does not already exist { @@ -1087,7 +1088,7 @@ BOOL MyRegRenameKey(HKEY key, const char* name, const char* newName) BOOL FindLatestConfiguration(BOOL* deleteConfigurations, const char*& loadConfiguration) { HKEY hRootKey; - loadConfiguration = NULL; // we don't want to load any configuration - default values will be used + loadConfiguration = NULL; // do not load any configuration; default values will be used int rootIndex = 0; const char* root; DWORD saveInProgress; // dummy @@ -1114,7 +1115,7 @@ BOOL FindLatestConfiguration(BOOL* deleteConfigurations, const char*& loadConfig else copyIsOK = 0; // backup is corrupted HANDLES(RegCloseKey(backupKey)); - if (!copyIsOK) // delete the corrupted backup and pretend it never existed (it probably wasn't fully created) + if (!copyIsOK) // delete the corrupted backup and treat it as if it never existed (it probably was not fully created) { TRACE_I("Configuration backup is incomplete, removing... " << backup); SHDeleteKey(HKEY_CURRENT_USER, backup); @@ -1151,13 +1152,13 @@ BOOL FindLatestConfiguration(BOOL* deleteConfigurations, const char*& loadConfig } TRACE_I("Corrupted configuration was moved to: " << corrupted); TRACE_I("Using configuration backup instead ..."); - continue; // in the second pass load configuration from the backup created during "critical shutdown" + continue; // in the second pass, load the configuration from the backup created during "critical shutdown" } else TRACE_E("Unable to move corrupted configuration or configuration backup."); } - if (rootIndex == 0) // for the active version inform the user about the corrupted configuration and let them back up the key, then try to delete it (older versions - simply ignore the corrupted configuration) + if (rootIndex == 0) // For the current program version, inform the user about the corrupted configuration and let them back up the key, then try to delete it (for older versions, simply ignore the corrupted configuration) { char buf[1500]; _snprintf_s(buf, _TRUNCATE, LoadStr(IDS_CORRUPTEDCONFIGFOUND), root); @@ -1204,7 +1205,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = if (rootFound) CloseKeyAux(hRootKey); - if (rootIndex == 0 && backupFound) // backup not needed, remove it + if (rootIndex == 0 && backupFound) // backup is not needed, remove it { TRACE_I("Removing unnecessary configuration backup: " << backup); SHDeleteKey(HKEY_CURRENT_USER, backup); @@ -1301,7 +1302,7 @@ void CMainWindow::DeleteOldConfigurations(BOOL* deleteConfigurations, BOOL autoI } } } - if (autoImportConfig) // clean old configuration (already stored in the new key) and remove "AutoImportConfig" from the new key + if (autoImportConfig) // clean the old configuration (already stored in the new key) and remove "AutoImportConfig" from the new key { BOOL ok = FALSE; HKEY cfgKey; @@ -1312,13 +1313,13 @@ void CMainWindow::DeleteOldConfigurations(BOOL* deleteConfigurations, BOOL autoI ok = TRUE; HANDLES(RegCloseKey(cfgKey)); } - if (!ok) // if this happens it's probably fine because we likely didn't - // write Salamander's configuration either (it goes to the - // same key) and the whole upgrade will need to be run again + if (!ok) // if this happens, it is probably not a problem because we likely did not +// write Salamander's configuration either (it goes to the same key), and +// the whole upgrade will need to be run again { TRACE_E("CMainWindow::DeleteOldConfigurations(): unable to delete " << SALAMANDER_AUTO_IMPORT_CONFIG << " value from HKCU\\" << SalamanderConfigurationRoots[0]); } - else // clean the old configuration (already saved to the new key) + else // clear the old configuration (it is already stored in the new key) { if (!doNotDeleteImportedCfg) { @@ -1380,7 +1381,7 @@ void CMainWindow::SaveConfig(HWND parent) if (SALAMANDER_ROOT_REG == NULL) { - TRACE_E("SALAMANDER_ROOT_REG == NULL"); // not necessarily an error: during UPGRADE we may exit Salamander without saving the configuration (if not all plug-ins are installed and the user chooses Exit) + TRACE_E("SALAMANDER_ROOT_REG == NULL"); // not necessarily an error: during UPGRADE we may exit Salamander without saving the configuration (if not all plugins are installed and the user chooses Exit) return; } @@ -1397,7 +1398,7 @@ void CMainWindow::SaveConfig(HWND parent) analysing.Create(); EnableWindow(parent, FALSE); - // SaveConfiguration plug-ins will be invoked as well -> set the parent for their message boxes + // SaveConfiguration plugins will be invoked as well -> set the parent for their message boxes PluginMsgBoxParent = analysing.HWindow; } @@ -2400,7 +2401,7 @@ void CMainWindow::LoadPanelConfig(char* panelPath, CFilesWindow* panel, HKEY hSa panel->HeaderLineVisible = value; if (GetValue(actKey, PANEL_VIEW_REG, REG_DWORD, &value, sizeof(DWORD))) { - if (Configuration.ConfigVersion < 13 && !value) // conversion: the Detailed view was stored as FALSE + if (Configuration.ConfigVersion < 13 && !value) // conversion: the Detailed view was saved as FALSE value = 2; panel->SelectViewTemplate(value, FALSE, FALSE, VALID_DATA_ALL, FALSE, TRUE); } @@ -2506,7 +2507,7 @@ void LoadIconOvrlsInfo(const char* root) } else { - if (configVersion >= 41) // if this value is missing in newer configurations, disable overlays (older versions didn't have these variables, so it's not an error-leave overlays enabled) + if (configVersion >= 41) // If this value is missing in newer configurations, disable overlays (older versions did not have these variables, so it is not an error; leave overlays enabled) Configuration.EnableCustomIconOverlays = FALSE; } @@ -2870,7 +2871,7 @@ BOOL CMainWindow::LoadConfig(BOOL importingOldConfig, const CCommandLineParams* } //--- Plugins - if (OpenKey(salamander, SALAMANDER_PLUGINS, actKey)) // otherwise default values + if (OpenKey(salamander, SALAMANDER_PLUGINS, actKey)) // otherwise use default values { Plugins.Load(HWindow, actKey); CloseKey(actKey); @@ -3301,7 +3302,7 @@ BOOL CMainWindow::LoadConfig(BOOL importingOldConfig, const CCommandLineParams* { char path[MAX_PATH]; GetIfPathIsInaccessibleGoTo(path, TRUE); - if (IsTheSamePath(path, Configuration.IfPathIsInaccessibleGoTo)) // user wants to go to My Documents + if (IsTheSamePath(path, Configuration.IfPathIsInaccessibleGoTo)) // the user prefers My Documents { Configuration.IfPathIsInaccessibleGoToIsMyDocs = TRUE; Configuration.IfPathIsInaccessibleGoTo[0] = 0; @@ -3340,7 +3341,7 @@ BOOL CMainWindow::LoadConfig(BOOL importingOldConfig, const CCommandLineParams* } else { - if (Configuration.ConfigVersion == 11) // in 1.6 beta 7 it was enabled ... turn it off + if (Configuration.ConfigVersion == 11) // In 1.6 beta 7 this was enabled ... disable it { Configuration.UseSalOpen = FALSE; // default is not to use it } @@ -3406,7 +3407,7 @@ BOOL CMainWindow::LoadConfig(BOOL importingOldConfig, const CCommandLineParams* &Configuration.CompareIgnoreFiles, sizeof(DWORD)); GetValue(actKey, CONFIG_COMPAREIGNOREDIRS_REG, REG_DWORD, &Configuration.CompareIgnoreDirs, sizeof(DWORD)); - // a bit ugly: we provide MasksString, but the range is checked so it's fine + // a bit of a hack: we provide MasksString; the range is checked, so it is harmless GetValue(actKey, CONFIG_CONFIGTIGNOREFILESMASKS_REG, REG_SZ, Configuration.CompareIgnoreFilesMasks.GetWritableMasksString(), MAX_PATH); GetValue(actKey, CONFIG_CONFIGTIGNOREDIRSMASKS_REG, REG_SZ, @@ -3760,7 +3761,7 @@ BOOL CMainWindow::LoadConfig(BOOL importingOldConfig, const CCommandLineParams* &Configuration.TabSize, sizeof(DWORD)); GetValue(actKey, VIEWER_CONFIGDEFMODE_REG, REG_DWORD, &Configuration.DefViewMode, sizeof(DWORD)); - // a bit ugly: we provide MasksString, but the range is checked so it's fine + // a bit ugly, but we pass MasksString; the range is checked, so it is safe GetValue(actKey, VIEWER_CONFIGTEXTMASK_REG, REG_SZ, Configuration.TextModeMasks.GetWritableMasksString(), MAX_PATH); if (Configuration.ConfigVersion < 17 && @@ -3770,7 +3771,7 @@ BOOL CMainWindow::LoadConfig(BOOL importingOldConfig, const CCommandLineParams* } int errPos; Configuration.TextModeMasks.PrepareMasks(errPos); - // a bit ugly: we provide MasksString, but the range is checked so it's fine + // a bit ugly, but we pass MasksString; the range is checked, so it is safe GetValue(actKey, VIEWER_CONFIGHEXMASK_REG, REG_SZ, Configuration.HexModeMasks.GetWritableMasksString(), MAX_PATH); Configuration.HexModeMasks.PrepareMasks(errPos); @@ -3850,7 +3851,7 @@ BOOL CMainWindow::LoadConfig(BOOL importingOldConfig, const CCommandLineParams* if (cmdLineFocus) SendMessage(HWindow, WM_COMMAND, CM_EDITLINE, 0); - // this caused trouble: + // this caused problems here: // when a panel pointed to an unavailable UNC path, // it would wait here for several seconds // LeftPanel->UpdateDriveIcon(TRUE); @@ -3890,7 +3891,7 @@ BOOL CMainWindow::LoadConfig(BOOL importingOldConfig, const CCommandLineParams* Configuration.AlwaysOnTop ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); - // show the window in full + // show the window normally if (useWinPlacement) { // from MSDN: @@ -3898,8 +3899,8 @@ BOOL CMainWindow::LoadConfig(BOOL importingOldConfig, const CCommandLineParams* // 3 = SW_SHOWMAXIMIZED // 7 = SW_SHOWMINNOACTIVE - // we don't want the application minimized on startup unless the user - // defined it in a shortcut + // we do not want the application minimized at startup unless the user + // specified it in the shortcut if (!Configuration.StatusArea) { switch (CmdShow) @@ -3968,7 +3969,7 @@ BOOL CMainWindow::LoadConfig(BOOL importingOldConfig, const CCommandLineParams* { if (cmdLineParams->LeftPath[0] == 0 && cmdLineParams->RightPath[0] == 0 && cmdLineParams->ActivePath[0] != 0) { - if (GetActivePanel()->ChangeDirLite(cmdLineParams->ActivePath)) // no point in combining this with left/right panel settings + if (GetActivePanel()->ChangeDirLite(cmdLineParams->ActivePath)) // no point in combining this with the left/right panel paths { if (rightPanelFocused) rightPanelPathSet = TRUE; @@ -3997,10 +3998,10 @@ BOOL CMainWindow::LoadConfig(BOOL importingOldConfig, const CCommandLineParams* } } - // save the array of visible items; normally this is done in idle time, but if it - // should be ready so that icon reading for user menu entries has priority over icons - // outside the visible part of the panel, we must handle it manually (icon loading - // is already running, but sooner is better than later, this minimal delay should not hurt) + // save the array of visible items; normally this is done during idle time, but if it + // is to be ready so that icon loading for user menu items has priority over icons + // outside the visible part of the panel, we must handle it manually (icon loading is + // already running, but better now than even later; this minimal delay should not matter much) if (rightPanelPathSet) RightPanel->RefreshVisibleItemsArray(); From 92dfbe54ffa4b1cdbd9ba793c11fe0772b4e2093 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 09:48:27 +0200 Subject: [PATCH 579/710] [translation] Initial src/consts.h comments translation (#955) --- src/consts.h | 2336 +++++++++++++++++++++++++------------------------- 1 file changed, 1175 insertions(+), 1161 deletions(-) diff --git a/src/consts.h b/src/consts.h index 1f7e5c63b..f54821bf9 100644 --- a/src/consts.h +++ b/src/consts.h @@ -1,64 +1,63 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once -// aktualni verze konfigurace (popis viz. mainwnd2.cpp) +// current configuration version (see mainwnd2.cpp for details) extern const DWORD THIS_CONFIG_VERSION; -// Expirace verze: pro beta a PB verze odkomentovat, pro ostre verze zakomentovat: +// Version expiration: uncomment for beta and PB builds, comment out for release builds: //#define USE_BETA_EXPIRATION_DATE -// pro PB (EAP) verze odkomentovat, pro ostatni verze zakomentovat: +// For PB (EAP) builds uncomment, for other builds comment out: //#define THIS_IS_EAP_VERSION #ifdef USE_BETA_EXPIRATION_DATE -// urcuje prvni den, kdy uz tato beta verze nepobezi +// specifies the first day when this beta build will no longer run extern SYSTEMTIME BETA_EXPIRATION_DATE; #endif // USE_BETA_EXPIRATION_DATE -// jen pro DEBUG verzi Salama: umozni debugovat tvorbu bugreportu (defaultne se nedela, -// exceptiona se jen preda MSVC debuggeru) +// DEBUG build only: allows debugging bug report creation (normally no report is built, +// the exception is simply passed to the MSVC debugger) //#define ENABLE_BUGREPORT_DEBUGGING 1 -// slouzi pro detekci, zda wheel message prisla pres hook nebo primo -extern BOOL MouseWheelMSGThroughHook; // TRUE: zprava sla skrz hook v case MouseWheelMSGTime; FALSE: zprava sla skrz panel v case MouseWheelMSGTime -extern DWORD MouseWheelMSGTime; // casove razitko pri posledni zprave -#define MOUSEWHEELMSG_VALID 100 // [ms] pocet milisekund, po ktere je validni jeden kanal (hook vs okno) +// used to detect whether a wheel message came through the hook or directly +extern BOOL MouseWheelMSGThroughHook; // TRUE: the message went through the hook at the time stored in MouseWheelMSGTime; FALSE: the message went through the panel at the time stored in MouseWheelMSGTime +extern DWORD MouseWheelMSGTime; // timestamp of the last wheel message +#define MOUSEWHEELMSG_VALID 100 // [ms] number of milliseconds for which one channel (hook vs. window) remains valid enum { otViewerWindow = 10, }; -// podpora pro horizontalni scroll (funguje jiz na W2K/XP s Intellipoint ovladacema, oficialne podporeno od Visty) +// horizontal scroll support (works on W2K/XP with Intellipoint drivers, officially supported since Vista) #define WM_MOUSEHWHEEL 0x020E BOOL PostMouseWheelMessage(MSG* pMSG); -// zjisti jestli je velka sance (jiste se to urcit neda), ze Salamander v pristich par -// okamzicich nebude "busy" (nebude otevreny zadny modalni dialog a nebude se zpracovavat -// zadna zprava) - v tomto pripade vraci TRUE (jinak FALSE); neni-li 'lastIdleTime' NULL, -// vraci se v nem GetTickCount() z okamziku posledniho prechodu z "idle" do "busy" stavu -// je mozne volat z libovolneho threadu +// checks if it is very likely (though not guaranteed) that Salamander will not be "busy" in the next +// few moments (no modal dialog open and no message being processed). Returns TRUE in that case, otherwise FALSE. +// If 'lastIdleTime' is not NULL, it receives GetTickCount() from the last idle->busy transition. +// Can be called from any thread. BOOL SalamanderIsNotBusy(DWORD* lastIdleTime); -// otevre HTML help Salamandera nebo pluginu, jazyk helpu (adresar s .chm soubory) vybira takto: -// -adresar ziskany z aktualniho .slg souboru Salamandera (viz SLGHelpDir v shared\versinfo.rc) -// -HELP\ENGLISH\*.chm -// -prvni nalezeny podadresar v podadresari HELP -// 'helpFileName' je jmeno .chm souboru, se kterym se ma pracovat (jmeno je bez cesty), je-li NULL, -// jde o "salamand.chm"; 'parent' je parent messageboxu s chybou; 'command' je prikaz HTML helpu, -// viz HHCDisplayXXX; 'dwData' je parametr prikazu HTML helpu, viz HHCDisplayXXX -// je mozne volat z libovolneho threadu -// Pokud je 'quiet' TRUE, nezobrazi se chybova hlaska. -// Vraci TRUE, pokud se help podarilo otevrite, jinak vraci FALSE; +// opens Salamander or plugin HTML help. The help language (directory with .chm files) is selected as follows: +// - directory from the current Salamander .slg file (see SLGHelpDir in shared\versinfo.rc) +// - HELP\ENGLISH\*.chm +// - first subdirectory found in HELP +// 'helpFileName' is the .chm file name to use (without path); if NULL, "salamand.chm" is used. +// 'parent' is the parent of the error message box; 'command' is the HTML Help command (HHCDisplayXXX); +// 'dwData' is the parameter of the HTML Help command. Can be called from any thread. +// If 'quiet' is TRUE, no error message is shown. +// Returns TRUE if the help was opened successfully, otherwise FALSE. BOOL OpenHtmlHelp(char* helpFileName, HWND parent, CHtmlHelpCommand command, DWORD_PTR dwData, BOOL quiet); -extern CRITICAL_SECTION OpenHtmlHelpCS; // kriticka sekce pro OpenHtmlHelp() +extern CRITICAL_SECTION OpenHtmlHelpCS; // critical section used by OpenHtmlHelp() -/* jednoduche zajisteni behu v kriticke sekci, priklad pouziti: +/* simple way to run inside a critical section, example usage: static CCriticalSection cs; CEnterCriticalSection enterCS(cs); */ @@ -93,610 +92,613 @@ class CEnterCriticalSection } }; -// protoze windowsova GetTempFileName nefunguje, napsali jsme si vlastniho klona: -// vytvori soubor/adresar (podle 'file') na ceste 'path' (NULL -> Window TEMP dir), -// s prefixem 'prefix', vraci jmeno vytvoreneho souboru v 'tmpName' (min. velikost MAX_PATH), -// vraci "uspech?" (pri neuspechu vraci pres SetLastError kod Windows chyby - pro kompatib.) +// Windows GetTempFileName does not work for us, so we wrote our own clone: +// creates a file/directory (depending on 'file') at 'path' (NULL -> Windows TEMP dir), +// with prefix 'prefix', returns the created name in 'tmpName' (at least MAX_PATH in size). +// Returns success status; on failure SetLastError contains the Windows error code for compatibility. BOOL SalGetTempFileName(const char* path, const char* prefix, char* tmpName, BOOL file); -// protoze windowsova verze MoveFile nezvlada prejmenovani souboru s read-only atributem na Novellu, -// napsali jsme si vlastni (nastane-li chyba pri MoveFile, zkusi shodit read-only, provest operaci, -// a pak ho zase nahodit) +// Windows MoveFile cannot rename a file with the read-only attribute on Novell volumes, +// so we have our own version (on failure we drop the read-only flag, perform the operation, +// then restore it) BOOL SalMoveFile(const char* srcName, const char* destName); -// varianta k windowsove verzi GetFileSize (ma jednodussi osetreni chyb); 'file' je otevreny -// soubor pro volani GetFileSize(); v 'size' vraci ziskanou velikost souboru; vraci uspech, -// pri FALSE (chyba) je v 'err' windowsovy kod chyby a v 'size' nula +// replacement for Windows GetFileSize with simpler error handling; 'file' is an open +// handle for GetFileSize(); the result is stored in 'size'. Returns success, otherwise +// 'err' receives the Windows error code and 'size' is zero BOOL SalGetFileSize(HANDLE file, CQuadWord& size, DWORD& err); -BOOL SalGetFileSize2(const char* fileName, CQuadWord& size, DWORD* err); // 'err' muze byt NULL pokud nas nezajima +BOOL SalGetFileSize2(const char* fileName, CQuadWord& size, DWORD* err); // 'err' may be NULL if the error code is not needed struct COperation; -// zjisti velikost souboru, na ktery vede symlink 'fileName'; je-li 'op' ruzne od NULL, -// pri cancelu se vnitrek 'op' uvolni; je-li 'fileName' NULL, bere se 'op->SourceName'; -// velikost vraci v 'size'; 'ignoreAll' je in + out, je-li TRUE vsechny chyby se ignoruji -// (pred akci je treba priradit FALSE, jinak se okno s chybou vubec nezobrazi, pak uz -// nemenit); pri chybe zobrazi standardni okno s dotazem Retry / Ignore / Ignore All / Cancel -// s parentem 'parent'; pokud velikost uspesne zjisti, vraci TRUE; pri chybe a stisku -// tlacitka Ignore / Igore All v okne s chybou, vraci FALSE a v 'cancel' vraci FALSE; -// je-li 'ignoreAll' TRUE, okno se neukaze, na tlacitko se neceka, chova se jako by -// uzivatel stiskl Ignore; pri chybe a stisku Cancel v okne s chybou vraci FALSE a -// v 'cancel' vraci TRUE +// Finds the size of the file pointed to by the symlink 'fileName'. If 'op' is not NULL +// and the operation is canceled the structure is released. If 'fileName' is NULL, +// 'op->SourceName' is used instead. The size is returned in 'size'. 'ignoreAll' works as +// both input and output; set it to FALSE before the call or the error dialog will never +// appear. On error the standard Retry/Ignore/Ignore All/Cancel dialog with the parent +// window 'parent' is shown. When Ignore or Ignore All is pressed the function returns +// FALSE and 'cancel' receives FALSE. +// If 'ignoreAll' is TRUE the dialog is skipped and behaves as if the user had clicked +// Ignore; when Cancel is pressed the function returns FALSE and 'cancel' receives TRUE BOOL GetLinkTgtFileSize(HWND parent, const char* fileName, COperation* op, CQuadWord* size, BOOL* cancel, BOOL* ignoreAll); -// protoze windowsova verze GetFileAttributes neumi pracovat se jmeny koncicimi mezerou/teckou, -// napsali jsme si vlastni (u techto jmen pridava backslash na konec, cimz uz pak -// GetFileAttributes funguje spravne, ovsem jen pro adresare, pro soubory s mezerou/teckou na -// konci reseni nemame, ale aspon se to nezjistuje od jineho souboru - windowsova verze -// orizne mezery/tecky a pracuje tak s jinym souborem/adresarem) +// Windows GetFileAttributes cannot handle names ending with a space or dot, so we created +// our own version. For such names it appends a backslash which fixes GetFileAttributes for directories; +// files with trailing spaces/dots remain problematic, but at least we avoid reading attributes of another file +// because the Windows version trims spaces/dots and operates on a different name. DWORD SalGetFileAttributes(const char* fileName); -// pokud ma soubor/adresar 'name' read-only atribut, pokusime se ho vypnout -// (duvod: napr. aby sel smazat pres DeleteFile); pokud uz mame atributy 'name' -// nactene, predame je v 'attr', je-li 'attr' -1, ctou se atributy 'name' z disku; -// vraci TRUE pokud se provede pokus o zmenu atributu (uspech se nekontroluje) -// POZNAMKA: vypina jen read-only atribut, aby v pripade vice hardlinku nedoslo -// k zbytecne velke zmene atributu na zbyvajicich hardlinkach souboru (atributy -// vsechny hardlinky sdili) +// If the file or directory 'name' has the read-only attribute we try to clear it +// (so DeleteFile can succeed). If the attributes have already been read we pass them in 'attr'; +// when 'attr' is -1 the attributes are read from disk. Returns TRUE if the change was attempted +// (the success is not checked). NOTE: only the read-only attribute is cleared to avoid unnecessary +// attribute changes on other hard links which all share the same attributes. BOOL ClearReadOnlyAttr(const char* name, DWORD attr = -1); -// smaze link na adresar (junction point, symbolic link, mount point); pri uspechu -// vraci TRUE; pri chybe vraci FALSE a neni-li 'err' NULL, vraci kod chyby v 'err' +// Deletes a directory link (junction point, symbolic link, mount point). Returns TRUE on success; +// on failure returns FALSE and if 'err' is not NULL, the error code is stored there. BOOL DeleteDirLink(const char* name, DWORD* err); -// vraci TRUE, pokud je cesta 'path' na NOVELLskem svazku (slouzi k detekci toho, -// jestli lze pouzit fast-directory-move) +// Returns TRUE if 'path' resides on a NOVELL volume (used to detect whether fast-directory-move can be used) BOOL IsNOVELLDrive(const char* path); -// vraci TRUE, pokud je cesta 'path' na LANTASTICskem svazku (slouzi k detekci toho, -// jestli je nutne po kopirovani kontrolovat velikost souboru); pro optimalizacni -// ucely se vyuzivaji 'lastLantasticCheckRoot' (pro prvni volani "", pak nemenit) -// a 'lastIsLantasticPath' (vysledek pro 'lastLantasticCheckRoot') +// Returns TRUE if 'path' is located on a LANTASTIC volume (used to decide +// whether the file size must be verified after copying). For performance the +// parameters 'lastLantasticCheckRoot' (empty for the first call, then unchanged) +// and 'lastIsLantasticPath' (result for 'lastLantasticCheckRoot') are used BOOL IsLantasticDrive(const char* path, char* lastLantasticCheckRoot, BOOL& lastIsLantasticPath); -// vraci TRUE pro sitove cesty +// returns TRUE for network paths BOOL IsNetworkPath(const char* path); -// vraci TRUE pokud 'path' lezi na svazku, ktery podporuje ADS (nebo nastala chyba pri -// zjistovani o jaky file-system jde) a jsme pod NT/W2K/XP; neni-li 'isFAT32' NULL, -// vraci v nem TRUE pokud 'path' vede na FAT32 svazek; vraci FALSE jen pokud je -// jiste, ze FS nepodporuje ADS +// returns TRUE if 'path' lies on a volume supporting ADS (or an error occurred while +// detecting the file system) and we are on NT/W2K/XP; if 'isFAT32' is not NULL, +// it receives TRUE if 'path' points to a FAT32 volume; returns FALSE only when it is +// certain the FS does not support ADS BOOL IsPathOnVolumeSupADS(const char* path, BOOL* isFAT32); -// test jestli jde o Sambu (Linuxova podpora sdileni disku s Windows) +// test whether this is a Samba share (Linux sharing with Windows) BOOL IsSambaDrivePath(const char* path); -// test jestli jde o UNC cestu (detekuje oba formaty: \\server\share i \\?\UNC\server\share) +// test whether the path is UNC (detects both \\server\share and \\?\UNC\server\share formats) BOOL IsUNCPath(const char* path); -// test jestli jde o UNC root (detekuje jen format: \\server\share) +// test whether the path is UNC root (only detects the \\server\share format) BOOL IsUNCRootPath(const char* path); -// vytvoreni souboru se jmenem 'fileName' pres klasicke volani Win32 API -// CreateFile (lpSecurityAttributes==NULL, dwCreationDisposition==CREATE_NEW, -// hTemplateFile==NULL); tato metoda resi kolizi 'fileName' s dosovym nazvem -// jiz existujiciho souboru/adresare (jen pokud nejde i o kolizi s dlouhym -// jmenem souboru/adresare) - zajisti zmenu dosoveho jmena tak, aby se soubor se -// jmenem 'fileName' mohl vytvorit (zpusob: docasne prejmenuje konfliktni -// soubor/adresar na jine jmeno a po vytvoreni 'fileName' ho prejmenuje zpet); -// vraci handle souboru nebo pri chybe INVALID_HANDLE_VALUE (chyba je v GetLastError()); -// neni-li 'encryptionNotSupported' NULL a soubor nejde otevrit s Encrypted -// atributem, zkusi ho otevrit jeste bez Encrypted atributu, pokud se to povede, -// soubor je smazan a do 'encryptionNotSupported' se zapise TRUE - navratova hodnota -// funkce a GetLastError() obsahuji "puvodni" chybu (otevirani s Encrypted atributem) +// creates a file named 'fileName' using the standard Win32 API CreateFile +// (lpSecurityAttributes==NULL, dwCreationDisposition==CREATE_NEW, hTemplateFile==NULL). +// This method handles collisions between 'fileName' and an existing DOS name +// (only when it is not also a long-name collision) by temporarily renaming the +// conflicting file/directory and renaming it back after creating 'fileName'. +// Returns a file handle or INVALID_HANDLE_VALUE on error (GetLastError()). +// If 'encryptionNotSupported' is not NULL and the file cannot be opened with the +// Encrypted attribute, it tries again without encryption support, +// the file is deleted and 'encryptionNotSupported' is set to TRUE - the function's +// return value and GetLastError() contain the original error from opening with the Encrypted attribute HANDLE SalCreateFileEx(const char* fileName, DWORD desiredAccess, DWORD shareMode, DWORD flagsAndAttributes, BOOL* encryptionNotSupported); -// zkontroluje posledni komponentu jmena v ceste 'path', pokud obsahuje na -// zacatku nebo na konci mezeru nebo na konci tecku, vraci TRUE, jinak FALSE +// Checks the last component of the name in 'path'. If it starts or ends with a +// space or ends with a dot the function returns TRUE; otherwise FALSE BOOL FileNameInvalidForManualCreate(const char* path); -// oriznuti mezer na zacatku a na konci jmena (CutWS nebo StripWS nebo CutWhiteSpace nebo StripWhiteSpace) -// vraci TRUE pokud doslo k orezu +// Trims spaces from the beginning and end of the name (CutWS or StripWS or CutWhiteSpace or StripWhiteSpace) +// Returns TRUE if trimming occurred BOOL CutSpacesFromBothSides(char* path); -// oriznuti mezer na zacatku a mezer a tecek na konci jmena, dela to tak Explorer -// a lidi tlacili, ze to tak taky chteji, viz https://forum.altap.cz/viewtopic.php?f=16&t=5891 -// a https://forum.altap.cz/viewtopic.php?f=2&t=4210 -// vraci TRUE pokud se zmeni obsah 'path' +// Trims leading spaces and trailing spaces or dots in the same way Explorer does +// because users requested this behavior, see https://forum.altap.cz/viewtopic.php?f=16&t=5891 +// and https://forum.altap.cz/viewtopic.php?f=2&t=4210. Returns TRUE if 'path' was modified BOOL MakeValidFileName(char* path); -// pokud 'name' konci na mezeru/tecku, udela se kopie 'name' do 'nameCopy' a doplni -// se na konec '\\', pak se 'name' nasmeruje do 'nameCopy'; bezne API funkce -// orezavaji tise mezery/tecky z konce cesty a pracuji pak s jinymi soubory/adresari -// nez chceme, pridany '\\' na konci to resi +// If 'name' ends with a space or dot a copy of 'name' is made to 'nameCopy' and +// a '\\' is appended. 'name' is then redirected to 'nameCopy'. Standard API +// functions silently trim trailing spaces or dots and operate on other +// files/directories than intended; adding '\\' at the end fixes that void MakeCopyWithBackslashIfNeeded(const char*& name, char (&nameCopy)[3 * MAX_PATH]); -// vraci TRUE pokud jmeno konci na backslash ('\\' pridany na konci resi invalidni jmena) +// Returns TRUE if the name ends with a backslash (the added '\\' fixes invalid names) BOOL NameEndsWithBackslash(const char* name); -// pokud 'name' konci na mezeru/tecku nebo obsahuje ':' (kolize s ADS), vraci TRUE, jinak FALSE, -// je-li 'ignInvalidName' TRUE, vraci TRUE jen pokud 'name' obsahuje ':' (kolize s ADS) +// Returns TRUE if 'name' ends with a space/dot or contains ':' (ADS conflict), otherwise FALSE. +// When 'ignInvalidName' is TRUE, returns TRUE only if 'name' contains ':' (ADS conflict) BOOL FileNameIsInvalid(const char* name, BOOL isFullName, BOOL ignInvalidName = FALSE); -// vraci FALSE, pokud obsazene komponenty cesty konci na mezeru/tecku -// a je-li 'cutPath' TRUE, zaroven cestu zkrati k prvni invalidni komponente -// (pro chybove hlaseni), jinak vraci TRUE +// Returns FALSE if any component of the path ends with a space or dot. When +// 'cutPath' is TRUE the path is shortened to the first invalid component (for an +// error message). Otherwise returns TRUE BOOL PathContainsValidComponents(char* path, BOOL cutPath); -// vytvoreni adresare se jmenem 'name' pres klasicke volani Win32 API -// CreateDirectory(lpSecurityAttributes==NULL); tato metoda resi kolizi 'name' -// s dosovym nazvem jiz existujiciho souboru/adresare (jen pokud nejde i o -// kolizi s dlouhym jmenem souboru/adresare) - zajisti zmenu dosoveho jmena -// tak, aby se adresar se jmenem 'name' mohl vytvorit (zpusob: docasne prejmenuje -// konfliktni soubor/adresar na jine jmeno a po vytvoreni 'name' ho -// prejmenuje zpet); dale resi jmena koncici na mezery (umi je vytvorit, narozdil -// od CreateDirectory, ktera mezery bez varovani orizne a vytvori tak vlastne -// jiny adresar); vraci TRUE pri uspechu, pri chybe FALSE (vraci v 'err' -// (neni-li NULL) kod Windows chyby) +// creates a directory called 'name' using the standard CreateDirectory API +// (lpSecurityAttributes==NULL). The function resolves collisions with an +// existing DOS name (provided the long name itself does not collide) by +// temporarily renaming the conflicting item so the directory can be created and +// then restoring the original name. It also supports names ending with spaces, +// which CreateDirectory would otherwise trim. Returns TRUE on success or FALSE +// on failure. If 'err' is not NULL it receives the Windows error code. BOOL SalCreateDirectoryEx(const char* name, DWORD* err); -void InitLocales(); // nutne volat pres pouzitim NumberToStr a PrintDiskSize -char* NumberToStr(char* buffer, const CQuadWord& number); // prevod int -> prehlednejsi string, !char buffer[50]! -int NumberToStr2(char* buffer, const CQuadWord& number); // prevod int -> prehlednejsi string, !char buffer[50]!, vraci pocet znaku nakopirovanych do bufferu -char* GetErrorText(DWORD error); // prevadi cislo chyby na string -WCHAR* GetErrorTextW(DWORD error); // prevadi cislo chyby na string -BOOL IsDirError(DWORD err); // tyka se chyba prace s adresari ? +void InitLocales(); // must be called before NumberToStr and PrintDiskSize +char* NumberToStr(char* buffer, const CQuadWord& number); // converts integer to a more readable string, !char buffer[50]! +int NumberToStr2(char* buffer, const CQuadWord& number); // converts integer to a readable string, !char buffer[50]!, returns number of characters copied to the buffer +char* GetErrorText(DWORD error); // converts error code to a string +WCHAR* GetErrorTextW(DWORD error); // converts error code to a wide string +BOOL IsDirError(DWORD err); // does the error relate to directories? -// normal i UNC cesty: maji stejny root? +// regular and UNC paths: do they share the same root? BOOL HasTheSameRootPath(const char* path1, const char* path2); -// zjisti, jestli maji obe cesty stejny root a jsou z jednoho svazku (resi -// cesty obsahujici reparse pointy a substy) -// POZOR: jde o dost POMALOU funkci (az 200ms) +// checks whether both paths have the same root and lie on the same volume +// (handles paths containing reparse points and SUBST drives) +// WARNING: this function can be quite slow (up to 200 ms) BOOL HasTheSameRootPathAndVolume(const char* p1, const char* p2); -// vraci TRUE, pokud jsou cesty 'path1' a 'path2' ze stejneho svazku; v 'resIsOnlyEstimation' -// (neni-li NULL) vraci TRUE, pokud neni vysledek jisty (jisty je jen v pripade, ze se -// podarilo ziskat "volume name" (GUID) u obou cest, coz pripada v uvahu jen pro lokalni -// cesty pod W2K nebo novejsimi z rady NT) -// POZOR: jde o dost POMALOU funkci (az 200ms) +// returns TRUE if 'path1' and 'path2' are on the same volume; if 'resIsOnlyEstimation' +// is not NULL it is set to TRUE when the result is only an estimation (certain only +// when the "volume name" GUID could be obtained for both paths, which is possible +// only for local paths under Windows 2000 or newer) +// WARNING: this function can be quite slow (up to 200 ms) BOOL PathsAreOnTheSameVolume(const char* path1, const char* path2, BOOL* resIsOnlyEstimation); -// porovna dve cesty: ignore-case, ignoruje take jeden backslash na zacatku a konci cest +// compares two paths: case-insensitive and ignoring a single backslash at the start and end BOOL IsTheSamePath(const char* path1, const char* path2); -// zjisti, jestli je cesta typu plugin FS, 'path' je zjistovana cesta, 'fsName' je -// buffer MAX_PATH znaku pro jmeno FS (nebo NULL), vraci 'userPart' (je-li != NULL) - ukazatel -// do 'path' na prvni znak pluginem definovane cesty (za prvni ':') +// determines whether 'path' is a plugin FS path; 'path' is the path to check, +// 'fsName' is a MAX_PATH buffer for the FS name (or NULL); stores in 'userPart' +// (if not NULL) a pointer into 'path' to the first character of the plugin-defined path (after the first ':') BOOL IsPluginFSPath(const char* path, char* fsName = NULL, const char** userPart = NULL); BOOL IsPluginFSPath(char* path, char* fsName = NULL, char** userPart = NULL); -// test, jestli jde o cestu s URL, napr. "file:///c|/WINDOWS/clock.avi" = "c:\\WINDOWS\\clock.avi" +// test whether the path is a URL, e.g. "file:///c|/WINDOWS/clock.avi" becomes "c:\\WINDOWS\\clock.avi" BOOL IsFileURLPath(const char* path); -// zjisti podle pripony souboru, jestli jde o link (.lnk, .pif nebo .url); je-li, vraci 1, -// jinak vraci 0 +// determines from a file extension whether it is a shortcut (.lnk, .pif or .url); +// returns 1 for shortcuts or 0 otherwise int IsFileLink(const char* fileExtension); -// ziska UNC i normalni root cestu z 'path', v 'root' vraci cestu ve formatu 'C:\' nebo '\\SERVER\SHARE\', -// vraci pocet znaku root cesty (bez null-terminatoru); 'root' je buffer aspon MAX_PATH znaku, pri delsi -// UNC root ceste dojde k orezu na MAX_PATH-2 znaku a doplneni backslashe (stejne to na 100% neni root cesta) +// obtains the UNC or drive root from 'path'; 'root' receives it in the form +// "C:\\" or "\\SERVER\\SHARE\\". The function returns the number of characters +// in the root (without the null terminator). If the UNC root is longer it is +// truncated to MAX_PATH-2 characters and a trailing backslash is added because +// such a string cannot be a real root int GetRootPath(char* root, const char* path); -// vraci ukazatel za root (presneji na backslash hned za rootem) UNC i normalni cesty 'path' +// returns a pointer just after the root (specifically to the backslash) of a +// UNC or standard path const char* SkipRoot(const char* path); -// vraci TRUE pokud se podari 'path' (UNC i normal cesta) zkratit o posledni adresar -// (zariznuti na poslednim backslashi - v oriznute ceste zustava na konci backslash jen u 'c:\'), -// v 'cutDir' se vraci ukazatel na posledni adresar (odriznutou cast) -// nahrazka za PathRemoveFileSpec +// returns TRUE if 'path' (UNC or standard) can be shortened by removing the last +// directory. The last backslash remains only for paths like "c:\". If 'cutDir' is +// not NULL it receives a pointer to the removed directory +// replacement for PathRemoveFileSpec BOOL CutDirectory(char* path, char** cutDir = NULL); -// spoji 'path' a 'name' do 'path', zajisti spojeni backslashem, 'path' je buffer alespon 'pathSize' znaku -// vraci TRUE pokud se 'name' veslo za 'path'; je-li 'path' nebo 'name' prazdne, -// spojovaci (pocatecni/ukoncovaci) backslash nebude (napr. "c:\" + "" -> "c:") +// concatenates 'name' to 'path' ensuring a single backslash separator. 'path' +// must hold at least 'pathSize' characters. Returns TRUE if 'name' fits; if +// either parameter is empty no separator is added (e.g. "c:\" + "" -> "c:") BOOL SalPathAppend(char* path, const char* name, int pathSize); -// pokud jeste 'path' nekonci na backslash, prida ho na konec 'path'; 'path' je buffer alespon 'pathSize' -// znaku; vraci TRUE pokud se backslash vesel za 'path'; je-li 'path' prazdne, backslash se neprida +// if 'path' does not already end with a backslash, appends one to the end of 'path'; 'path' is a buffer of at least 'pathSize' +// characters; returns TRUE if the backslash fits after 'path'; if 'path' is empty, no backslash is added BOOL SalPathAddBackslash(char* path, int pathSize); -// pokud je v 'path' na konci backslash, odstrani ho +// removes a trailing backslash from 'path' if present void SalPathRemoveBackslash(char* path); -// prevede vsechny '/' na '\\' a zaroven pokud jsou za sebou dva nebo vice '\\', -// necha jen jeden (krome dvou '\\' na zacatku stringu, coz oznacuje UNC cestu) +// converts all '/' characters to '\\' and collapses repeated '\\' to a single one +// except for the two leading characters that denote a UNC path void SlashesToBackslashesAndRemoveDups(char* path); -// z plneho jmena udela jmeno ("c:\path\file" -> "file") +// extracts the file name from a full path ("c:\\path\\file" -> "file") void SalPathStripPath(char* path); -// pokud je ve jmene pripona, odstrani ji +// removes the file extension if one is present void SalPathRemoveExtension(char* path); -// pokud ve jmenu 'path' jeste neni pripona, prida priponu 'extension' (napr. ".txt"), 'path' je buffer -// alespon 'pathSize' znaku, vraci FALSE pokud buffer 'path' nestaci pro vyslednou cestu +// if 'path' has no extension yet, append 'extension' (for example ".txt"). +// 'path' must hold at least 'pathSize' characters; returns FALSE when the buffer +// is not large enough for the resulting string BOOL SalPathAddExtension(char* path, const char* extension, int pathSize); -// zmeni/prida priponu 'extension' (napr. ".txt") ve jmenu 'path', 'path' je buffer -// alespon 'pathSize' znaku, vraci FALSE pokud buffer 'path' nestaci pro vyslednou cestu +// changes or adds the extension 'extension' (for example ".txt") in 'path'. +// 'path' must hold at least 'pathSize' characters; returns FALSE if the buffer +// is not large enough for the resulting string BOOL SalPathRenameExtension(char* path, const char* extension, int pathSize); -// vraci ukazatel do 'path' na jmeno souboru/adresare (backslash na konci 'path' ignoruje), -// pokud jmeno neobsahuje jine backslashe nez na konci retezce, vraci 'path' +// returns a pointer into 'path' pointing to the file or directory name. A +// trailing backslash is ignored. If there are no other backslashes the function +// simply returns 'path' const char* SalPathFindFileName(const char* path); -// Pracuje pro normalni i UNC cesty. -// Vrati pocet znaku spolecne cesty. Na normalni ceste musi byt root ukonceny zpetnym -// lomitkem, jinak funkce vrati 0. ("C:\"+"C:"->0, "C:\A\B"+"C:\"->3, "C:\A\B\"+"C:\A"->4, -// "C:\AA\BB"+"C:\AA\CC"->5) +// Works for both regular and UNC paths. +// Returns the number of characters common to both paths. For a regular path the +// root must end with a backslash, otherwise the function returns 0. Examples: +// "C:\"+"C:"->0, "C:\A\B"+"C:\"->3, "C:\A\B\"+"C:\A"->4, +// "C:\AA\BB"+"C:\AA\CC"->5 int CommonPrefixLength(const char* path1, const char* path2); -// Vraci TRUE, pokud je cesta 'prefix' zakladem cesty 'path'. Jinak vraci FALSE. +// Returns TRUE if the path 'prefix' is a prefix of the path 'path'. Otherwise returns FALSE. // "C:\aa","C:\Aa\BB"->TRUE // "C:\aa","C:\aaa"->FALSE // "C:\aa\","C:\Aa"->TRUE // "\\server\share","\\server\share\aaa"->TRUE -// Pracuje pro normalni i UNC cesty. +// Works with both regular and UNC paths. BOOL SalPathIsPrefix(const char* prefix, const char* path); -// odstrani ".." (vynecha ".." spolu s jednim podadresarem vlevo) a "." (vynecha jen ".") -// z cesty; podminkou je backslash jako oddelovac podadresaru; 'afterRoot' ukazuje za root -// zpracovavane cesty (zmeny cesty se deji jen za 'afterRoot'); vraci TRUE pokud se upravy -// podarily, FALSE pokud se nedaji odstranit ".." (vlevo uz je root) +// Removes ".." (together with one directory to the left) and "." (only the "." itself) +// from a path; backslashes must be used as directory separators; 'afterRoot' points past the +// root of the processed path (the path is modified only after 'afterRoot'); returns TRUE if the +// adjustments succeed, or FALSE if ".." cannot be removed because the root has already been reached BOOL SalRemovePointsFromPath(char* afterRoot); BOOL SalRemovePointsFromPath(WCHAR* afterRoot); -// upravuje relativni nebo absolutni cestu na absolutni bez '.', '..' a koncoveho backslashe (krom -// "X:\"); je-li 'curDir' NULL, relativni cesty typu "\path" a "path" vraci chybu (neurcitelne), jinak je -// 'curDir' platna upravena aktualni cesta (UNC i normal); aktualni cesty ostatnich disku (mimo -// 'curDir'; jen normal, ne UNC) jsou v DefaultDir (pred pouzitim je dobre zavolat -// CMainWindow::UpdateDefaultDir); 'name' - in/out buffer alespon MAX_PATH znaku (jeho velikost je v 'nameBufSize'); -// neni-li 'nextFocus' NULL a zadana relativni cesta neobsahuje backslash - strcpy(nextFocus, name) -// vraci TRUE - jmeno 'name' je pripraveno k pouziti, jinak neni-li 'errTextID' NULL obsahuje -// chybu (konstanty pro LoadStr - IDS_SERVERNAMEMISSING, IDS_SHARENAMEMISSING, IDS_TOOLONGPATH, -// IDS_INVALIDDRIVE, IDS_INCOMLETEFILENAME, IDS_EMPTYNAMENOTALLOWED a IDS_PATHISINVALID); -// v 'callNethood' (neni-li NULL) se vraci TRUE ma-li se volat Nethood plugin pri chybach -// IDS_SERVERNAMEMISSING a IDS_SHARENAMEMISSING, je-li 'allowRelPathWithSpaces' TRUE, neoreze -// mezery ze zacatku relativni cesty (bezne dela, aby si lidi nevytvareli omylem nazvy s mezerami -// na zacatku, mezery a tecky na konci orezou wokna) -// vraci TRUE pokud v ceste neni chyba, jinak se vraci FALSE (napr. "\\\" nebo "\\server\\") +// Converts a relative or absolute path to an absolute one without '.', '..', or a trailing +// backslash (except "X:\"); if 'curDir' is NULL, relative paths such as "\\path" and "path" +// are reported as errors (they are indeterminate); otherwise 'curDir' must be a valid adjusted +// current path (UNC or regular); current paths of other drives (except 'curDir'; regular only, +// not UNC) are in DefaultDir (it is advisable to call CMainWindow::UpdateDefaultDir before use); +// 'name' is an in/out buffer of at least MAX_PATH characters (its size is in 'nameBufSize'); +// if 'nextFocus' is not NULL and the specified relative path contains no backslash, +// strcpy(nextFocus, name) is called +// Returns TRUE - the name in 'name' is ready for use; otherwise, if 'errTextID' is not NULL it +// contains the error (constants for LoadStr - IDS_SERVERNAMEMISSING, IDS_SHARENAMEMISSING, +// IDS_TOOLONGPATH, IDS_INVALIDDRIVE, IDS_INCOMLETEFILENAME, IDS_EMPTYNAMENOTALLOWED, and +// IDS_PATHISINVALID); TRUE is returned in 'callNethood' (if not NULL) if the Nethood plugin should +// be called for IDS_SERVERNAMEMISSING and IDS_SHARENAMEMISSING; if 'allowRelPathWithSpaces' is +// TRUE, leading spaces are not trimmed from a relative path (normally they are, to prevent users +// from accidentally creating names with leading spaces; Windows trims trailing spaces and dots) +// Returns TRUE if the path contains no error, otherwise FALSE (e.g. "\\\" or "\\server\\") BOOL SalGetFullName(char* name, int* errTextID = NULL, const char* curDir = NULL, char* nextFocus = NULL, BOOL* callNethood = NULL, int nameBufSize = MAX_PATH, BOOL allowRelPathWithSpaces = FALSE); -// zkusi pristup na cestu 'path' (normal nebo UNC), probiha ve vedlejsim threadu, takze -// umoznuje prerusit zkousku klavesou ESC (po jiste dobe vybali okenko s hlasenim o ESC) -// 'echo' TRUE znamena povoleny vypis chybove hlasky (pokud cesta nebude pristupna); -// 'err' ruzne od ERROR_SUCCESS v kombinaci s 'echo' TRUE pouze zobrazi chybu (na cestu -// se jiz nepristupuje); 'postRefresh' je parametr do volani EndStopRefresh (normalne TRUE); -// 'parent' je parent messageboxu; vraci ERROR_SUCCESS v pripade, ze je cesta v poradku, -// jinak vraci standardni Windowsovy kod chyby nebo ERROR_USER_TERMINATED v pripade, ze -// user pouzil klavesu ESC k preruseni testu +// tries to access the 'path' (regular or UNC) in a worker thread so +// the attempt can be interrupted with the ESC key (after a while a +// message about the pressed ESC is shown) +// When 'echo' is TRUE an error message is displayed if the path is not +// accessible. If 'err' differs from ERROR_SUCCESS together with 'echo' TRUE, the +// error is shown and no additional check is performed. 'postRefresh' is passed +// to EndStopRefresh (normally TRUE). 'parent' is the parent message box. The +// function returns ERROR_SUCCESS when the path is valid or a standard Windows +// error code (or ERROR_USER_TERMINATED when ESC was pressed) otherwise. DWORD SalCheckPath(BOOL echo, const char* path, DWORD err, BOOL postRefresh, HWND parent); -// zkusi jestli je cesta 'path' pristupna, prip. obnovi sitova spojeni pomoci funkci -// CheckAndRestoreNetworkConnection a CheckAndConnectUNCNetworkPath; vraci TRUE pokud -// je cesta pristupna; 'parent' je parent messageboxu; 'tryNet' je TRUE pokud ma smysl -// zkouset obnovit sitova spojeni +// Tries to access 'path' and optionally restores network connections via +// CheckAndRestoreNetworkConnection and CheckAndConnectUNCNetworkPath. +// Returns TRUE when the path is accessible. 'parent' is the parent message box; +// 'tryNet' specifies whether attempting to restore the connection makes sense. BOOL SalCheckAndRestorePath(HWND parent, const char* path, BOOL tryNet); -// zkusi jestli je cesta 'path' pristupna, prip. ji zkrati; je-li 'tryNet' TRUE, prip. obnovi -// sitova spojeni pomoci funkci CheckAndRestoreNetworkConnection a CheckAndConnectUNCNetworkPath -// (je-li 'donotReconnect' TRUE, zjisti se pouze chyba, obnova spojeni uz se neprovede) a nastavi -// 'tryNet' na FALSE; vraci 'err' (kod chyby aktualni cesty), 'lastErr' (kod chyby vedouci ke -// zkraceni cesty), 'pathInvalid' (TRUE pokud se zkusila obnova sit. spojeni bez uspechu), -// 'cut' (TRUE pokud je vysledna cesta zkracena); 'parent' je parent messageboxu; vraci TRUE -// pokud je vysledna cesta 'path' pristupna +// Checks if 'path' is accessible and optionally shortens it. When 'tryNet' is +// TRUE, network connections can be restored using +// CheckAndRestoreNetworkConnection and CheckAndConnectUNCNetworkPath (unless +// 'donotReconnect' is TRUE, in which case the error is only reported). The +// function updates 'tryNet' to FALSE and returns 'err' (current path error), +// 'lastErr' (error that caused path shortening), 'pathInvalid' (TRUE when a +// network reconnection failed), and 'cut' (TRUE when the final path is shorter). +// 'parent' is the parent window. Returns TRUE if the resulting path is +// accessible. BOOL SalCheckAndRestorePathWithCut(HWND parent, char* path, BOOL& tryNet, DWORD& err, DWORD& lastErr, BOOL& pathInvalid, BOOL& cut, BOOL donotReconnect); -// rozpozna o jaky typ cesty (FS/windowsova/archiv) jde a postara se o rozdeleni na -// jeji casti (u FS jde o fs-name a fs-user-part, u archivu jde o path-to-archive a -// path-in-archive, u windowsovych cest jde o existujici cast a zbytek cesty), u FS cest -// se nic nekontroluje, u windowsovych (normal + UNC) cest se kontroluje kam az cesta existuje -// (prip. obnovi sitove spojeni), u archivu se kontroluje existence souboru archivu -// (rozliseni archivu dle pripony); pouziva SalGetFullName, proto je dobre napred zavolat -// CMainWindow::UpdateDefaultDir) -// 'path' je plna nebo relativni cesta (buffer min. 'pathBufSize' znaku; u relativnich cest se -// uvazuje aktualni cesta 'curPath' (neni-li NULL) jako zaklad pro vyhodnoceni plne cesty; -// 'curPathIsDiskOrArchive' je TRUE pokud je 'curPath' windowsova nebo archivova cesta; -// pokud je aktualni cesta archivova, obsahuje 'curArchivePath' jmeno archivu, jinak je NULL), -// do 'path' se ulozi vysledna plna cesta (musi byt min. 'pathBufSize' znaku); vraci TRUE pri -// uspesnem rozpoznani, pak 'type' je typ cesty (viz PATH_TYPE_XXX) a 'secondPart' je nastavene: -// - do 'path' na pozici za existujici cestu (za '\\' nebo na konci retezce; existuje-li -// v ceste soubor, ukazuje za cestu k tomuto souboru) (typ cesty windows), POZOR: neresi -// se delka vracene casti cesty (cela cesta muze byt delsi nez MAX_PATH) -// - za soubor archivu (typ cesty archiv), POZOR: neresi se delka cesty v archivu (muze byt -// delsi nez MAX_PATH) -// - za ':' za nazvem file-systemu - user-part cesty file-systemu (typ cesty FS), POZOR: neresi -// se delka user-part cesty (muze byt delsi nez MAX_PATH); -// pokud vraci TRUE je jeste 'isDir' nastavena na: -// - TRUE pokud existujici cast cesty je adresar, FALSE == soubor (typ cesty windows) -// - FALSE pro cesty typu archiv a FS; -// pokud vrati FALSE, userovi byla vypsana chyba (az na jednu vyjimku - viz popis SPP_INCOMLETEPATH), -// ktera pri rozpoznavani nastala (neni-li 'error' NULL, vraci se v nem jedna z konstant SPP_XXX); -// 'errorTitle' je titulek messageboxu s chybou; pokud je 'nextFocus' != NULL a windowsova/archivova -// cesta neobsahuje '\\' nebo na '\\' jen konci, nakopiruje se cesta do 'nextFocus' (viz SalGetFullName) +// Detects the path type (FS, Windows, or archive) and splits it into parts. +// For FS paths this means fs-name and user part, for archives the path to the +// archive file and the path inside it, and for Windows paths the existing part +// and the remainder. FS paths are not validated; Windows paths are checked for +// how far they exist (and network connections are restored if needed). Archive +// paths check for file existence based on extension. Because SalGetFullName is +// used, CMainWindow::UpdateDefaultDir should be called beforehand. +// 'path' is a full or relative path (buffer of at least 'pathBufSize' chars; for +// relative paths the current directory 'curPath' is used as the base). If the +// current path is an archive, 'curArchivePath' holds its file name. The resolved +// full path is stored back to 'path'. On success TRUE is returned, 'type' holds +// the path type (PATH_TYPE_XXX) and 'secondPart' points to: +// - in Windows paths: the location after the existing portion (after '\\' or at +// end; if a file is present it points after the file name). Length is not +// checked (may exceed MAX_PATH). +// - in archive paths: after the archive file name (length may exceed MAX_PATH). +// - in FS paths: after ':' following the file-system name; length of the user +// part is not checked. +// When TRUE is returned, 'isDir' is additionally set to: +// - TRUE if the existing portion is a directory, FALSE if it is a file (Windows +// path type) +// - FALSE for archive and FS paths. +// If FALSE is returned, an error message has already been shown to the user +// (except for SPP_INCOMLETEPATH). If 'error' is not NULL, one of the SPP_XXX +// constants is stored there. 'errorTitle' is the title of the error message box. +// When 'nextFocus' is not NULL and the path does not contain '\\' or ends with +// '\\', the path is copied into 'nextFocus' (see SalGetFullName). BOOL SalParsePath(HWND parent, char* path, int& type, BOOL& isDir, char*& secondPart, const char* errorTitle, char* nextFocus, BOOL curPathIsDiskOrArchive, const char* curPath, const char* curArchivePath, int* error, int pathBufSize); -// ziska z windowsove cilove cesty existujici cast a operacni masku; pripadnou neexistujici cast -// umozni vytvorit; pri uspechu vraci TRUE a existujici windowsovou cilovou cestu (v 'path') -// a nalezenou operacni masku (v 'mask' - ukazuje do bufferu 'path', ale cesta a maska jsou oddelene -// nulou; pokud v ceste neni maska, automaticky vytvori masku "*.*"); 'parent' - parent pripadnych -// messageboxu; 'title' + 'errorTitle' jsou titulky messageboxu s informaci + chybou; 'selCount' je -// pocet oznacenych souboru a adresaru; 'path' je na vstupu cilova cesta ke zpracovani, na vystupu -// (alespon 2 * MAX_PATH znaku) existujici cilova cesta; 'secondPart' ukazuje do 'path' na pozici -// za existujici cestu (za '\\' nebo na konec retezce; existuje-li v ceste soubor, ukazuje za cestu -// k tomuto souboru); 'pathIsDir' je TRUE/FALSE pokud existujici cast cesty je adresar/soubor; -// 'backslashAtEnd' je TRUE pokud byl pred provedenim "parse" na konci 'path' backslash (napr. -// SalParsePath takovy backslash rusi); 'dirName' + 'curDiskPath' nejsou NULL pokud je oznaceny -// max. jeden soubor/adresar (jeho jmeno bez cesty je v 'dirName'; pokud neni nic oznacene, bere -// se focus) a aktualni cesta je windowsova (cesta je v 'curDiskPath'); 'mask' je na vystupu -// ukazatel na operacni masku do bufferu 'path'; pokud je v ceste chyba, vraci metoda FALSE, -// problem uz byl uzivateli ohlasen +// obtains the existing part and operation mask from a Windows target path; allows any non-existent part +// to be created; on success returns TRUE, the existing Windows target path (in 'path') +// and the found operation mask (in 'mask' - it points into the 'path' buffer, but the path and mask are separated +// by a null character; if the path contains no mask, it automatically creates the mask "*.*"); 'parent' is the parent of any +// message boxes; 'title' + 'errorTitle' are the captions of the information + error message boxes; 'selCount' is +// the number of selected files and directories; 'path' is the input target path to process, on output +// (at least 2 * MAX_PATH characters) the existing target path; 'secondPart' points into 'path' to the position +// after the existing path (after '\\' or at the end of the string; if the path contains a file, it points after the path +// to that file); 'pathIsDir' is TRUE/FALSE if the existing part of the path is a directory/file; +// 'backslashAtEnd' is TRUE if there was a backslash at the end of 'path' before "parse" was performed (for example, +// SalParsePath removes such a backslash); 'dirName' + 'curDiskPath' are not NULL if at most one file/directory is selected +// (its name without the path is in 'dirName'; if nothing is selected, the focused item is used) +// and the current path is a Windows path (the path is in 'curDiskPath'); 'mask' is on output +// a pointer to the operation mask in the 'path' buffer; if the path contains an error, the method returns FALSE, +// the problem has already been reported to the user BOOL SalSplitWindowsPath(HWND parent, const char* title, const char* errorTitle, int selCount, char* path, char* secondPart, BOOL pathIsDir, BOOL backslashAtEnd, const char* dirName, const char* curDiskPath, char*& mask); -// ziska z cilove cesty existujici cast a operacni masku; pripadnou neexistujici cast rozpozna; pri -// uspechu vraci TRUE, relativni cestu k vytvoreni (v 'newDirs'), existujici cilovou cestu (v 'path'; -// existujici jen za predpokladu vytvoreni relativni cesty 'newDirs') a nalezenou operacni masku -// (v 'mask' - ukazuje do bufferu 'path', ale cesta a maska jsou oddelene nulou; pokud v ceste neni -// maska, automaticky vytvori masku "*.*"); 'parent' - parent pripadnych messageboxu; -// 'title' + 'errorTitle' jsou titulky messageboxu s informaci + chybou; 'selCount' je pocet oznacenych -// souboru a adresaru; 'path' je na vstupu cilova cesta ke zpracovani, na vystupu (alespon 2 * MAX_PATH -// znaku) existujici cilova cesta (vzdy konci backslashem); 'afterRoot' ukazuje do 'path' za root cesty -// (za '\\' nebo na konec retezce); 'secondPart' ukazuje do 'path' na pozici za existujici cestu (za -// '\\' nebo na konec retezce; existuje-li v ceste soubor, ukazuje za cestu k tomuto souboru); -// 'pathIsDir' je TRUE/FALSE pokud existujici cast cesty je adresar/soubor; 'backslashAtEnd' je -// TRUE pokud byl pred provedenim "parse" na konci 'path' backslash (napr. SalParsePath takovy -// backslash rusi); 'dirName' + 'curPath' nejsou NULL pokud je oznaceny max. jeden soubor/adresar -// (jeho jmeno bez cesty je v 'dirName'; jeho cesta je v 'curPath'; pokud neni nic oznacene, bere -// se focus); 'mask' je na vystupu ukazatel na operacni masku do bufferu 'path'; neni-li 'newDirs' NULL, -// pak jde o buffer (o velikosti alespon MAX_PATH) pro relativni cestu (vzhledem k existujici ceste -// v 'path'), kterou je nutne vytvorit (uzivatel s vytvorenim souhlasi, byl pouzit stejny dotaz jako -// u kopirovani z disku na disk; prazdny retezec = nic nevytvaret); je-li 'newDirs' NULL a je-li -// potreba vytvorit nejakou relativni cestu, je jen vypsana chyba; 'isTheSamePathF' je funkce pro -// porovnani dvou cest (potrebna jen pokud 'curPath' neni NULL), je-li NULL pouzije se IsTheSamePath; -// pokud je v ceste chyba, vraci metoda FALSE, problem uz byl uzivateli ohlasen +// Retrieves the existing portion and the operation mask from the target path; +// recognizes any non-existent part. On success returns TRUE, the relative path +// to create (in 'newDirs'), the existing target path (in 'path'; valid only if +// the relative path will be created) and the found operation mask (in 'mask' +// pointing into the 'path' buffer; the path and mask are separated by a zero. If +// the path contains no mask, "*.*" is generated automatically). 'parent' is the +// parent of message boxes; 'title' + 'errorTitle' are their captions; +// 'selCount' is the number of selected files and directories. 'path' is the +// input target path and on output (at least 2 * MAX_PATH characters) it holds +// the existing target path (always ending with a backslash). 'afterRoot' points +// inside 'path' just after the root (after '\\' or at the end). 'secondPart' +// points inside 'path' just after the existing portion (after '\\' or at the +// end; if a file is present it points after that file). 'pathIsDir' is TRUE or +// FALSE depending on whether the existing part is a directory or a file. +// 'backslashAtEnd' is TRUE if there was a backslash at the end of 'path' before +// parsing (SalParsePath removes such a backslash). 'dirName' and 'curPath' are +// non-NULL when at most one file/directory is selected-its name without the path +// is stored in 'dirName' and its path in 'curPath'; if nothing is selected the +// focused item is used. 'mask' receives the operation mask pointer inside +// 'path'. When 'newDirs' is not NULL it is a buffer (at least MAX_PATH) for the +// relative path (with respect to the existing path in 'path') that must be +// created (the user agreed to create it using the same prompt as for disk to +// disk copy; empty string means create nothing). If 'newDirs' is NULL and a +// relative path needs to be created but cannot be, only an error is shown. +// 'isTheSamePathF' is a comparison function for two paths (used only when +// 'curPath' is not NULL; otherwise IsTheSamePath is used). The method returns +// FALSE on error and the user has already been notified BOOL SalSplitGeneralPath(HWND parent, const char* title, const char* errorTitle, int selCount, char* path, char* afterRoot, char* secondPart, BOOL pathIsDir, BOOL backslashAtEnd, const char* dirName, const char* curPath, char*& mask, char* newDirs, SGP_IsTheSamePathF isTheSamePathF); -// zjisti jestli je mozne retezec 'fileNameComponent' pouzit jako komponentu -// jmena na Windows filesystemu (resi retezce delsi nez MAX_PATH-4 (4 = "C:\" -// + null-terminator), prazdny retezec, retezce znaku '.', retezce white-spaces, -// znaky "*?\\/<>|\":" a jednoducha jmena typu "prn" a "prn .txt") +// tests whether the string 'fileNameComponent' can be used as a name component +// on a Windows filesystem (handles strings longer than MAX_PATH-4 (4 = "C:\\" +// + null terminator), an empty string, strings of '.' characters, strings of white-space, +// the characters "*?\\/<>|\":" and simple names such as "prn" and "prn .txt") BOOL SalIsValidFileNameComponent(const char* fileNameComponent); -// pretvori retezec 'fileNameComponent' tak, aby mohl byt pouzity jako komponenta -// jmena na Windows filesystemu (resi retezce delsi nez MAX_PATH-4 (4 = "C:\" -// + null-terminator), resi prazdny retezec, retezce znaku '.', retezce -// white-spaces, znaky "*?\\/<>|\":" nahradi '_' + jednoducha jmena typu "prn" -// a "prn .txt" doplni o '_' na konci nazvu); 'fileNameComponent' musi jit -// rozsirit alespon o jeden znak (maximalne se vsak z 'fileNameComponent' -// pouzije MAX_PATH bytu) +// transforms 'fileNameComponent' so it can be used as a Windows file name +// component (handles strings longer than MAX_PATH-4 (4 = "C:\" + null terminator), +// empty strings, strings of '.', whitespace-only strings; characters "*?\\/<>|:" +// are replaced with '_'; simple names like "prn" and "prn .txt" get an '_' +// appended at the end of the name); 'fileNameComponent' must be extendable by at +// least one character (but at most MAX_PATH bytes of 'fileNameComponent' are used) void SalMakeValidFileNameComponent(char* fileNameComponent); -// tisk velikosti mista na disku, mode==0 "1.23 MB", mode==1 "1 230 000 bytes, 1.23 MB", -// mode==2 "1 230 000 bytes", mode==3 (vzdy v celych KB), mode==4 (jako mode==0, ale vzdy -// aspon 3 platne cislice, napr. "2.00 MB") +// prints disk space size; mode==0 "1.23 MB", mode==1 "1 230 000 bytes, 1.23 MB", +// mode==2 "1 230 000 bytes", mode==3 (always whole KBs), mode==4 (like mode==0 but +// always at least 3 significant digits, e.g. "2.00 MB") char* PrintDiskSize(char* buf, const CQuadWord& size, int mode); -// prevadi pocet sekund na retezec ("5 sec", "1 hr 34 min", atp.); 'buf' je -// buffer pro vysledny text, musi byt velky aspon 100 znaku; 'secs' je pocet sekund; -// vraci 'buf' +// converts the number of seconds to a string ("5 sec", "1 hr 34 min", etc.); +// 'buf' is the output buffer (at least 100 chars); 'secs' is the number of seconds. +// returns 'buf' char* PrintTimeLeft(char* buf, CQuadWord const& secs); -// zdvojuje '&' - hodi se pro cesty zobrazovane v menu ('&&' se zobrazi jako '&'); -// 'buffer' je vstupne/vystupni retezec, 'bufferSize' je velikost 'buffer' v bytech; -// vraci TRUE pokud zdvojenim nedoslo ke ztrate znaku z konce retezce (buffer byl dost -// veliky) +// duplicates '&' - useful for paths shown in menus ('&&' displays as '&'); +// 'buffer' is an in/out string, 'bufferSize' its size in bytes. +// returns TRUE if doubling did not truncate the string (buffer was large enough) BOOL DuplicateAmpersands(char* buffer, int bufferSize, BOOL skipFirstAmpersand = FALSE); -// likviduje '&' - hodi se pro prikazy z menu, ktere potrebujeme zobrazit ocistene -// od horkych klaves; najde-li dvojici "&&", nahradi ji jednim znakem '&' -// 'text' je vstupne/vystupni retezec +// Removes '&' characters. Useful for menu commands that should be displayed +// without hot-key markers; if a double "&&" is found it is replaced with a +// single '&'. 'text' is an input/output string. void RemoveAmpersands(char* text); -// zdvojuje '\\' - hodi se pro texty, ktere posilame do LookForSubTexts, ktera '\\\\' -// zase zredukuje na '\\'; 'buffer' je vstupne/vystupni retezec, 'bufferSize' je velikost -// 'buffer' v bytech; vraci TRUE pokud zdvojenim nedoslo ke ztrate znaku z konce retezce -// (buffer byl dost veliky) +// Duplicates '\\'. Useful for strings passed to LookForSubTexts, which reduces +// "\\\\" back to "\\". 'buffer' is both input and output; 'bufferSize' is its +// size in bytes. Returns TRUE if doubling did not truncate the string (buffer +// was large enough). BOOL DuplicateBackslashes(char* buffer, int bufferSize); -// zdvojuje '$' - slouzi pro import starych cest (hotpaths), ktere mohou obsahovat $(SalDir) -// a nove na nich podporuje Sal/Env promenne jako napriklad $(SalDir) nebo $(WinDir) -// behem zavadeni jsem narazil na to, ze 2.5RC1, kde jsme podporili tyto promenne pro editory, -// viewery, archivery se tato expanze nedelala; dodatecne to neresim, zavedu konverzi pouze -// pro HotPaths -// 'buffer' je vstupne/vystupni retezec, 'bufferSize' je velikost 'buffer' v bytech; -// vraci TRUE pokud zdvojenim nedoslo ke ztrate znaku z konce retezce (buffer byl dost -// veliky) +// Duplicates '$'. Used when importing old paths (HotPaths), which may +// contain $(SalDir) and now support Sal/Env variables such as $(SalDir) or +// $(WinDir). In 2.5RC1 this expansion was not done for editors, viewers, or +// archivers; this conversion is added only for HotPaths. +// 'buffer' is the input/output string, 'bufferSize' is the size of 'buffer' in +// bytes. Returns TRUE if doubling did not truncate the string (the buffer was +// large enough). BOOL DuplicateDollars(char* buffer, int bufferSize); -// najde si v 'buf' jmeno (preskoci mezery na zacatku i konci) a pokud existuje ('buf' -// neobsahuje jen mezery), neni v uvozovkach a obsahuje aspon jednu mezeru, da ho do -// uvozovek; vraci FALSE pokud neni dost mista na pridani uvozovek ('bufSize' je -// velikost 'buf') +// Searches 'buf' for a name (trimming spaces at both ends). If the name exists, +// is not quoted and contains at least one space, it is wrapped in quotes. The +// function returns FALSE when there is not enough room to add the quotes +// ('bufSize' specifies the buffer size). BOOL AddDoubleQuotesIfNeeded(char* buf, int bufSize); -// oriznuti '"' na zacatku a na konci 'path' (CutDoubleQuotes nebo StripDoubleQuotes nebo CutQuotes nebo StripQuotes) -// vraci TRUE pokud doslo k orezu +// trims '"' at the beginning and end of 'path' (CutDoubleQuotes or StripDoubleQuotes or +// CutQuotes or StripQuotes). Returns TRUE if trimming occurred BOOL CutDoubleQuotesFromBothSides(char* path); -// do 1/5 sekundy pockame na pusteni ESC (aby se po ESC v dialogu hned neprerusilo -// napr. cteni listingu v panelu) +// wait up to 1/5 second for ESC to be released so that the dialog does not +// immediately abort operations such as reading a panel listing void WaitForESCRelease(); -// zkontroluje jestli je root-parent okna 'parent' foreground window, pokud ne, -// udela se FlashWindow(root-parent, TRUE) a vrati se root-parent, jinak se vraci NULL +// checks whether the root parent of 'parent' is the foreground window; if not +// FlashWindow(root-parent, TRUE) is called and root-parent is returned, +// otherwise NULL is returned HWND GetWndToFlash(HWND parent); -// projde v threadu 'tid' (0=aktualni) vsechna okna (EnumThreadWindows) a vsem enablovanym a -// viditelnym dialogum (class name "#32770") vlastnenym oknem 'parent' postne WM_CLOSE; -// pouziva se pri critical shutdown k odblokovani okna/dialogu, nad kterym jsou otevrene -// modalni dialogy, hrozi-li vice vrstev, je nutne volat opakovane +// walks through all windows of thread 'tid' (0 means current) with +// EnumThreadWindows and posts WM_CLOSE to every enabled visible dialog +// (class name "#32770") owned by 'parent'. Used during critical shutdown to +// unblock windows when multiple layers of modal dialogs are open; call +// repeatedly if more layers appear void CloseAllOwnedEnabledDialogs(HWND parent, DWORD tid = 0); -// vraci zobrazitelnou podobu atributu souboru/adresare; 'text' je buffer aspon 10 znaku; -// 'attrs' jsou atributy souboru/adresare +// returns a displayable form of file or directory attributes; 'text' must be a +// buffer of at least 10 characters; 'attrs' are the attributes to format void GetAttrsString(char* text, DWORD attrs); -// nakopiruje retezec 'srcStr' za retezec 'dstStr' (za jeho koncovou nulu); -// 'dstStr' je buffer o velikosti 'dstBufSize' (musi byt nejmene rovno 2); -// pokud se do bufferu oba retezce nevejdou, jsou zkraceny (vzdy tak, aby se -// veslo co nejvice znaku z obou retezu) +// Copies 'srcStr' after the terminating zero of 'dstStr'. +// 'dstStr' is a buffer of size 'dstBufSize' (must be at least 2). +// If both strings do not fit, they are truncated so that as many characters as +// possible from both strings are kept. void AddStrToStr(char* dstStr, int dstBufSize, const char* srcStr); -// vytvori plne jmeno souboru (alokovane); pokud neni 'dosName' NULL a 'path'+'name' je prilis -// dlouhe jmeno, zkusi se spojit 'path'+'dosName'; pokud 'skip', 'skipAll' a 'sourcePath' nejsou -// NULL a dojde k chybe "prilis dlouhe jmeno", umozni uzivateli toto jmeno preskocit (v tomto pripade -// vraci NULL a ve 'skip' TRUE), pokud user da "Skip All", nastavi 'skipAll' na TRUE -// 'sourcePath' je pouzita pro Focus tlacitko (v panelu zobrazime prilis dlouhou komponentu ve zdrojove -// ceste, ktera by v cilove ceste zpusobila problem). +// Creates an allocated full file name. If 'dosName' is not NULL and +// 'path'+'name' is too long, it tries 'path'+'dosName'. If 'skip', 'skipAll', +// and 'sourcePath' are not NULL and a "name too long" error occurs, the user +// can skip this name (the function then returns NULL and sets 'skip' to TRUE). +// If the user selects "Skip All", 'skipAll' is set to TRUE. 'sourcePath' is +// used for the Focus button (the panel shows the too-long component in the +// source path that would cause the problem in the target path). char* BuildName(char* path, char* name, char* dosName = NULL, BOOL* skip = NULL, BOOL* skipAll = NULL, const char* sourcePath = NULL); -// vraci z panelu datum+cas pro soubor/adresar 'f' (resi i datumy+casy dodavane pluginy - nemusi -// byt platne) +// retrieves the date and time for file/directory 'f' from the panel (also handles +// values supplied by plugins-they may be invalid) void GetFileDateAndTimeFromPanel(DWORD validFileData, CPluginDataInterfaceEncapsulation* pluginData, const CFileData* f, BOOL isDir, SYSTEMTIME* st, BOOL* validDate, BOOL* validTime); -// vraci z panelu velikost pro soubor/adresar 'f' (resi i velikosti dodavane pluginy - nemusi -// byt platne) +// retrieves the size for file/directory 'f' from the panel (also handles sizes +// supplied by plugins-they may be invalid) void GetFileSizeFromPanel(DWORD validFileData, CPluginDataInterfaceEncapsulation* pluginData, const CFileData* f, BOOL isDir, CQuadWord* size, BOOL* validSize); void DrawSplitLine(HWND HWindow, int newDragSplitX, int oldDragSplitX, RECT client); -BOOL InitializeCheckThread(); // inicializace threadu pro CFilesWindow::CheckPath() -void ReleaseCheckThreads(); // uvolneni threadu pro CFilesWindow::CheckPath() -void InitDefaultDir(); // inicializace pole DefaultDir (posledni navstivene cesty na vsech drivech) - -// zobrazi/schova zpravu ve vlastnim threadu (neodcerpa message-queue), zobrazi najednou jen -// jednu zpravu, opakovane volani ohlasi chybu do TRACE (neni fatalni), 'delay' je zpozdeni -// pred otevrenim okenka (od okamziku volani CreateSafeWaitWindow) -// 'message' muze byt vicerakova; jednotlive radky se oddeluji znakem '\n' -// 'caption' muze byt NULL: pouzije se pak "Open Salamander" -// 'showCloseButton' udava, zda bude okenko obsahovat tlacitko Close -// 'hForegroundWnd' urcuje okno, ktere musi byt aktivni, aby bylo okenko zobrazeno -// a zaroven urcuje okno, ktere bude aktivovana pri kliknuti do wait okenka +BOOL InitializeCheckThread(); // initializes the thread used by CFilesWindow::CheckPath() +void ReleaseCheckThreads(); // releases the thread used by CFilesWindow::CheckPath() +void InitDefaultDir(); // initializes the DefaultDir array (last visited paths for all drives) + +// shows or hides a message window in its own thread without draining the +// message queue; only one message can be displayed at a time. Repeated calls +// report an error in TRACE (non-fatal). 'delay' is the wait time before the +// window is opened (counted from the call to CreateSafeWaitWindow). +// 'message' may span multiple lines separated by '\n'. If 'caption' is NULL the +// default caption "Open Salamander" is used. +// 'showCloseButton' determines whether the window has a Close button. +// 'hForegroundWnd' designates the window that must stay active for the wait window +// to be shown and which is activated when clicking the wait window void CreateSafeWaitWindow(const char* message, const char* caption, int delay, BOOL showCloseButton, HWND hForegroundWnd); void DestroySafeWaitWindow(BOOL killThread = FALSE); -// zhasne 'show'==FALSE a pak zobrazi 'show'==TRUE vytvorene okenko -// volat jako reakci na WM_ACTIVATE z okna hForegroundWnd: +// hides the created window when 'show'==FALSE and shows it when 'show'==TRUE. +// Call in response to WM_ACTIVATE from the hForegroundWnd window: // case WM_ACTIVATE: // { // ShowSafeWaitWindow(LOWORD(wParam) != WA_INACTIVE); // break; // } -// Pokud je thread (ze ktereho bylo okenko vytvoreno) zamestnan, nedochazi -// k distribuci zprav, takze nedojde ani k doruceni WM_ACTIVATE pri kliknuti -// na jinou aplikaci. Zpravy se doruci az ve chvili zobrazeni messageboxu, -// coz presne potrebujeme: docasne se nechame schovat a pozdeji (po zavreni -// messageboxu a aktivaci okna hForegroundWnd) zase zobrazit. +// If the thread that created the window is busy, messages are not dispatched, +// so WM_ACTIVATE is not delivered when the user clicks another application. The +// messages are delivered only when the message box is shown, which is what we +// need: hide temporarily and show again later (after the message box is closed +// and the hForegroundWnd window is activated). void ShowSafeWaitWindow(BOOL show); -// po zavolani CreateSafeWaitWindow nebo ShowSafeWaitWindow vraci funkce FALSE az do doby, -// kdy user kliknul mysi na Close tlacitko (pokud je zobrazeno); pak vraci TRUE +// after calling CreateSafeWaitWindow or ShowSafeWaitWindow the function returns +// FALSE until the user clicks the Close button (if shown); then it returns TRUE BOOL GetSafeWaitWindowClosePressed(); -// vraci TRUE pokud uzivatel macka ESC nebo kliknul mysi na Close tlacitko +// returns TRUE if the user presses ESC or clicks the Close button BOOL UserWantsToCancelSafeWaitWindow(); -// slouzi pro dodatecnou zmenu textu v okenku -// POZOR: nedochazi k novemu layoutovani okna a pokud dojde k vetsimu natazeni -// textu, bude orezan; pouzivat napriklad pro countdown: 60s, 55s, 50s, ... +// Used to change the message text later. NOTE: the window layout is not +// recomputed; if the text grows it will be truncated. Useful for countdowns +// like 60s, 55s, 50s, ... void SetSafeWaitWindowText(const char* message); -// vraci TRUE pokud je Salamander aktivni (foreground window PID == current PID) +// returns TRUE when Salamander is active (foreground window PID == current PID) BOOL SalamanderActive(); -// odstraneni adresare vcetne jeho obsahu (SHFileOperation je priserne pomaly) +// removes a directory along with its contents (SHFileOperation is terribly slow) void RemoveTemporaryDir(const char* dir); -// pomocna funkce pro pridani jmena do seznamu jmen (oddelenych mezerou), vraci uspech +// helper for adding a name to a space-separated list; returns success BOOL AddToListOfNames(char** list, char* listEnd, const char* name, int nameLen); -// pokud adresar neexistuje, umozni jej vytvorit, -// pokud adresar existuje nebo je uspesne vytvoren vraci TRUE -// parent je parent messageboxu s chybami, NULL = hlavni okno Salamandera -// quiet = TRUE - neptat se jestli chce vytvaret, ale pozor, chyby ukazuje pokud errBuf == NULL -// pokud errBuf != NULL, je errBufSize velikost bufferu pro popis chyby, -// pokud newDir != NULL, je v newDir vracen prvni vytvoreny podadresar (plnou cestou), -// pokud cesta komplet existuje, je newDir=="", newDir ukazuje na buffer o velikosti MAX_PATH -// noRetryButton = TRUE - chybove dialogy nemaji obsahovat Retry/Cancel buttony, ale jen OK button -// manualCrDir = TRUE - nedovolime vytvorit adresar s mezerou na zacatku (pri rucnim vytvareni -// adresare, jinak Windowsum mezery na zacatku nevadi) +// if the directory does not exist, the user can create it; +// returns TRUE if the directory exists or is created successfully +// 'parent' is the parent window for error message boxes; NULL = Salamander's main window +// quiet = TRUE - do not ask whether to create it, but note that errors are shown if errBuf == NULL +// if errBuf != NULL, errBufSize is the size of the error-description buffer +// if newDir != NULL, the first created subdirectory (full path) is returned in 'newDir' +// if the full path already exists, newDir==""; newDir points to a buffer of size MAX_PATH +// noRetryButton = TRUE - error dialogs contain only an OK button, not Retry/Cancel +// manualCrDir = TRUE - do not allow creating a directory with a leading space (during manual +// directory creation; otherwise Windows allows leading spaces) BOOL CheckAndCreateDirectory(const char* dir, HWND parent = NULL, BOOL quiet = FALSE, char* errBuf = NULL, int errBufSize = 0, char* newDir = NULL, BOOL noRetryButton = FALSE, BOOL manualCrDir = FALSE); -// smaze z disku prazdne podadresare v 'dir' a je-li 'dir' po vymazu podadresaru prazdny, -// je smazan take +// removes empty subdirectories under 'dir' and deletes 'dir' itself when it becomes empty void RemoveEmptyDirs(const char* dir); -// vykona rutina pro otevirani vieweru - pouziva se v CFilesWindow::ViewFile a -// CSalamanderForViewFileOnFS::OpenViewer; dalsi vyuziti se neocekava, proto nejsou -// popsany parametry a navratove hodnoty +// routine used to open the viewer-used in CFilesWindow::ViewFile and +// CSalamanderForViewFileOnFS::OpenViewer; no other use is expected, therefore +// parameters and return values are not documented BOOL ViewFileInt(HWND parent, const char* name, BOOL altView, DWORD handlerID, BOOL returnLock, HANDLE& lock, BOOL& lockOwner, BOOL addToHistory, int enumFileNamesSourceUID, int enumFileNamesLastFileIndex); -// prevede string ('str' o delce 'len') na unsigned __int64 (muze predchazet -// znamenko '+'; ignoruje white-spaces na zacatku a konci retezce); -// neni-li 'isNum' NULL, vraci se v nem TRUE, pokud cely retezec -// 'str' reprezentuje cislo +// converts the string ('str' of length 'len') to unsigned __int64 (a leading +// '+' sign is allowed; leading and trailing white-space is ignored); +// if 'isNum' is not NULL it receives TRUE when the entire string represents +// a number unsigned __int64 StrToUInt64(const char* str, int len, BOOL* isNum = NULL); -// spousti handler exceptiony "in-page-error" a "access violation - read/write on XXX" (testuje se -// jestli se exceptiona vztahuje k souboru - 'fileMem' je pocatecni adresa, 'fileMemSize' je velikost -// aktualniho view mapovaneho souboru), pouzito pri mapovani souboru do pameti (chyba -// cteni/zapisu vyvola tuto exceptionu) +// handles the "in-page-error" and "access violation - read/write on XXX" exceptions +// (checks whether the exception is related to the file: 'fileMem' is the base address, +// 'fileMemSize' is the size of the current mapped file view); used when mapping files +// into memory (a read/write error raises one of these exceptions) int HandleFileException(EXCEPTION_POINTERS* e, char* fileMem, DWORD fileMemSize); struct CSalamanderVarStrEntry; -// ValidateVarString a ExpandVarString: -// metody pro overovani a expanzi retezcu s promennymi ve tvaru "$(var_name)", "$(var_name:num)" -// (num je sirka promenne, jde o ciselnou hodnotu od 1 do 9999), "$(var_name:max)" ("max" je -// symbol, ktery oznacuje, ze sirka promenne se ridi hodnotou v poli 'maxVarWidths', podrobnosti -// u ExpandVarString) a "$[env_var]" (expanduje hodnotu promenne prostredi); pouziva se pokud si -// uzivatel muze zadat format retezce (jako napr. v info-line) priklad retezce s promennymi: -// "$(files) files and $(dirs) directories" - promenne 'files' a 'dirs' - -// kontroluje syntaxi 'varText' (retezce s promennymi), vraci FALSE pokud najde chybu, jeji -// pozici umisti do 'errorPos1' (offset zacatku chybne casti) a 'errorPos2' (offset konce chybne -// casti); 'variables' je pole struktur CSalamanderVarStrEntry, ktere je ukonceno strukturou s -// Name==NULL; 'msgParent' je parent message-boxu s chybami, je-li NULL, chyby se nevypisuji +// ValidateVarString and ExpandVarString: +// methods for validating and expanding strings with variables like "$(var_name)", +// "$(var_name:num)" (num is the field width, numeric 1..9999), "$(var_name:max)" +// ("max" means the width follows the value in 'maxVarWidths'; details with +// ExpandVarString) and "$[env_var]" for environment variables. +// Used where the user can define a format string (e.g. in the info line). Example +// string with variables: "$(files) files and $(dirs) directories" where +// the variables are 'files' and 'dirs'. + +// checks the syntax of 'varText' (string with variables); returns FALSE on error and +// provides the error position in 'errorPos1' (start offset) and 'errorPos2' (end offset). +// 'variables' is an array of CSalamanderVarStrEntry terminated with Name==NULL. +// 'msgParent' is the parent of error message boxes; if NULL, errors are not displayed BOOL ValidateVarString(HWND msgParent, const char* varText, int& errorPos1, int& errorPos2, const CSalamanderVarStrEntry* variables); -// naplni 'buffer' vysledkem expanze 'varText' (retezce s promennymi), vraci FALSE pokud je -// 'buffer' maly (predpoklada overeni retezce s promennymi pres ValidateVarString, jinak -// vraci FALSE i pri chybe syntaxe) nebo uzivatel kliknul na Cancel pri chybe environment-variable -// (nenalezena nebo prilis velka); 'bufferLen' je velikost bufferu 'buffer'; -// 'variables' je pole struktur CSalamanderVarStrEntry, ktere je ukonceno strukturou -// s Name==NULL; 'param' je ukazatel, ktery se predava do CSalamanderVarStrEntry::Execute -// pri expanzi nalezene promenne; 'msgParent' je parent message-boxu s chybami, je-li NULL, -// chyby se nevypisuji; je-li 'ignoreEnvVarNotFoundOrTooLong' TRUE, ignoruji se chyby -// environment-variable (nenalezena nebo prilis velka), je-li FALSE, zobrazi se messagebox -// s chybou; neni-li 'varPlacements' NULL, ukazuje na pole DWORDu o '*varPlacementsCount' polozkach, -// ktere bude naplneno DWORDy slozenymi vzdy z pozice promenne ve vystupnim bufferu (spodni WORD) -// a poctu znaku promenne (horni WORD); neni-li 'varPlacementsCount' NULL, vraci se v nem pocet -// naplnenych polozek v poli 'varPlacements' (jde vlastne o pocet promennych ve vstupnim -// retezci); -// pokud se tato metoda pouziva jen k expanzi retezce pro jednu hodnotu 'param', meli by -// byt nastaveny 'detectMaxVarWidths' na FALSE, 'maxVarWidths' na NULL a 'maxVarWidthsCount' -// na 0; pokud se ovsem pouziva tato metoda pro expanzi retezce opakovane pro urcitou -// mnozinu hodnot 'param' (napr. u Make File List je to expanze radky postupne pro vsechny -// oznacene soubory a adresare), ma smysl pouzivat i promenne ve tvaru "$(varname:max)", -// u techto promennych se sirka urci jako nejvetsi sirka expandovane promenne v ramci cele -// mnoziny hodnot; omereni nejvetsi sirky expandovane promenne se provadi v prvnim cyklu -// (pro vsechny hodnoty mnoziny) volani ExpandVarString, v prvnim cyklu ma parametr -// 'detectMaxVarWidths' hodnotu TRUE a pole 'maxVarWidths' o 'maxVarWidthsCount' polozkach -// je predem nulovane (slouzi pro ulozeni maxim mezi jednotlivymi volanimi ExpandVarString); -// samotna expanze pak probiha v druhem cyklu (pro vsechny hodnoty mnoziny) volani -// ExpandVarString, v druhem cyklu ma parametr 'detectMaxVarWidths' hodnotu FALSE a pole -// 'maxVarWidths' o 'maxVarWidthsCount' polozkach obsahuje predpocitane nejvetsi sirky -// (z prvniho cyklu) +// fills 'buffer' with the result of expanding 'varText'; returns FALSE if the +// buffer is too small (the variable string should be validated first via +// ValidateVarString, otherwise FALSE is also returned for syntax errors) or when +// the user clicked Cancel for an environment-variable error (not found or too +// long). 'bufferLen' is the size of 'buffer'. 'variables' is an array of +// CSalamanderVarStrEntry structures terminated by Name==NULL. 'param' is passed +// to CSalamanderVarStrEntry::Execute when expanding a variable. 'msgParent' is +// the parent for error message boxes; if NULL, errors are not shown. When +// 'ignoreEnvVarNotFoundOrTooLong' is TRUE, environment-variable errors are +// ignored; otherwise a message box is shown. If 'varPlacements' is not NULL it +// points to an array of DWORDs of '*varPlacementsCount' items that receives the +// variable positions in the output buffer (low WORD) and their lengths (high +// WORD). If 'varPlacementsCount' is not NULL it receives the number of filled +// entries. +// When this method is used just once for a single 'param', set +// 'detectMaxVarWidths' to FALSE, 'maxVarWidths' to NULL and 'maxVarWidthsCount' +// to 0. When expanding repeatedly for a set of values (e.g. Make File List), it +// makes sense to use variables like "$(varname:max)"; their width is measured as +// the maximum width of the expanded variable across the whole set. Measuring is +// done during the first cycle (for all values) with 'detectMaxVarWidths' TRUE +// and 'maxVarWidths' zeroed. The actual expansion then happens in the second +// cycle with 'detectMaxVarWidths' FALSE and 'maxVarWidths' containing the +// precomputed widths from the first cycle. BOOL ExpandVarString(HWND msgParent, const char* varText, char* buffer, int bufferLen, const CSalamanderVarStrEntry* variables, void* param, BOOL ignoreEnvVarNotFoundOrTooLong = FALSE, @@ -704,40 +706,40 @@ BOOL ExpandVarString(HWND msgParent, const char* varText, char* buffer, int buff BOOL detectMaxVarWidths = FALSE, int* maxVarWidths = NULL, int maxVarWidthsCount = 0); -// ulozi na clipboard Unicode verzi textu str o delce len znaku -// vraci ERROR_SUCCESS nebo GetLastError +// stores the Unicode version of 'str' of length 'len' on the clipboard +// returns ERROR_SUCCESS or GetLastError DWORD AddUnicodeToClipboard(const char* str, int len); -// vrzne text na clipboard; pokud showEcho, zobrazi message box, ze jako OK -// pokud je textLen==-1, napocita si delku sam +// puts text on the clipboard; if showEcho is TRUE a message box confirming success is shown +// when textLen==-1 the length is calculated automatically BOOL CopyTextToClipboard(const char* text, int textLen = -1, BOOL showEcho = FALSE, HWND hEchoParent = NULL); BOOL CopyTextToClipboardW(const wchar_t* text, int textLen = -1, BOOL showEcho = FALSE, HWND hEchoParent = NULL); BOOL CopyHTextToClipboard(HGLOBAL hGlobalText, int textLen = -1, BOOL showEcho = FALSE, HWND hEchoParent = NULL); -// zjisti z bufferu 'pattern' o delce 'patternLen' jestli jde o text (existuje kodova stranka, -// ve ktere obsahuje jen povolene znaky - zobrazitelne a ridici) a pokud jde o text, zjisti take -// jeho kodovou stranku (nejpravdepodobnejsi); 'parent' je parent messageboxu; je-li 'forceText' -// TRUE, neprovadi se kontrola na nepovolene znaky (pouziva se, pokud 'pattern' obsahuje text); -// neni-li 'isText' NULL, vraci se v nem TRUE pokud jde o text; neni-li 'codePage' NULL, jde -// o buffer (min. 101 znaku) pro jmeno kodove stranky (nejpravdepodobnejsi) +// examines buffer 'pattern' of length 'patternLen' to determine whether it is text (that is, +// whether there is a code page in which it contains only allowed characters - printable and control). +// If it is text, it also determines its most probable code page. 'parent' is the parent of the +// message box. When 'forceText' is TRUE, forbidden characters are not checked (used when 'pattern' +// contains text). If 'isText' is not NULL it receives TRUE if the buffer is text. If 'codePage' +// is not NULL, it is a buffer (at least 101 chars) for the code page name void RecognizeFileType(HWND parent, const char* pattern, int patternLen, BOOL forceText, BOOL* isText, char* codePage); -// nastavi jmeno volajicimu threadu ve VC debuggeru +// sets the calling thread name in the VC debugger void SetThreadNameInVC(LPCSTR szThreadName); -// nastavi jmeno volajicimu threadu ve VC debuggeru a Trace Serveru +// sets the calling thread name in both the VC debugger and the Trace Server void SetThreadNameInVCAndTrace(const char* name); -// nacitani konfigurace +// configuration loading class CEditorMasks; class CViewerMasks; -// funkce spojene s drag&dropem a dalsimi shellovymi vecmi +// functions related to drag&drop and other shell tasks class CFilesWindow; -// operace shellu +// shell operations enum CShellAction { saLeftDragFiles, @@ -746,7 +748,7 @@ enum CShellAction saCopyToClipboard, saCutToClipboard, saProperties, - saPermissions, // stejne jako saProperties, jen se pokusi vybrat "security tab" + saPermissions, // same as saProperties but tries to activate the "security" tab }; class CCopyMoveData; @@ -767,7 +769,7 @@ BOOL MouseConfirmDrop(DWORD& effect, DWORD& defEffect, DWORD& grfKeyState); void DropEnd(BOOL drop, BOOL shortcuts, void* param, BOOL ownRutine, BOOL isFakeDataObject, int tgtType); void EnterLeaveDrop(BOOL enter, void* param); -// uklada na clipboard prefered drop effect a informaci o puvodu ze Salamandera +// stores the preferred drop effect on the clipboard and marks that it originated from Salamander void SetClipCutCopyInfo(HWND hwnd, BOOL copy, BOOL salObject); void ShellAction(CFilesWindow* panel, CShellAction action, BOOL useSelection = TRUE, @@ -776,194 +778,204 @@ void ExecuteAssociation(HWND hWindow, const char* path, const char* name); BOOL CanUseShellExecuteWndAsParent(const char* cmdName); -// zjisti jestli je soubor placeholder (online soubor ve OneDrive slozce), -// viz http://msdn.microsoft.com/en-us/library/windows/desktop/dn323738%28v=vs.85%29.aspx +// checks whether the file is a placeholder (an online file in a OneDrive folder), +// see http://msdn.microsoft.com/en-us/library/windows/desktop/dn323738%28v=vs.85%29.aspx BOOL IsFilePlaceholder(WIN32_FIND_DATA const* findData); -// pred otevrenim editoru nebo vieweru se placeholder prevadi na offline file, -// aby s nim umel viewer/editor pracovat +// before opening an editor or viewer the placeholder is converted to an offline file +// so that the viewer/editor can handle it //BOOL MakeFileAvailOfflineIfOneDriveOnWin81(HWND parent, const char *name); -// nastavi prioritu threadu na normal a vyvola v try-except bloku menu->InvokeCommand() -// pred ukoncenim zase nastavi prioritu threadu na puvodni hodnotu +// sets the thread priority to normal and calls menu->InvokeCommand() in a try-except block; +// before exiting it restores the thread priority to its original value BOOL SafeInvokeCommand(IContextMenu2* menu, CMINVOKECOMMANDINFO& ici); -// pokud je 'hInstance' NULL, bude se cist z HLanguage; jinak z 'hInstance' -char* LoadStr(int resID, HINSTANCE hInstance = NULL); // taha string z resourcu -WCHAR* LoadStrW(int resID, HINSTANCE hInstance = NULL); // taha wide-string z resourcu +// if 'hInstance' is NULL strings are loaded from HLanguage; otherwise from 'hInstance' +char* LoadStr(int resID, HINSTANCE hInstance = NULL); // loads string from resources +WCHAR* LoadStrW(int resID, HINSTANCE hInstance = NULL); // loads wide-string from resources -// podpora pro tvorbu parametrizovanych textu (reseni jednotnych a mnoznych cisel -// v textech); 'lpFmt' je formatovaci retezec pro vysledny text - popis jeho formatu -// nasleduje; vysledny text se vraci v bufferu 'lpOut' o velikosti 'nOutMax' bytu; -// 'lpParArray' je pole parametru textu, 'nParCount' je pocet techto parametru; -// vraci delku vysledneho textu +// support for creating parameterized texts (handling singular and plural forms +// in text); 'lpFmt' is the format string for the resulting text - its format +// is described below; the resulting text is returned in the 'lpOut' buffer of +// size 'nOutMax' bytes; 'lpParArray' is the array of text parameters and +// 'nParCount' is the number of these parameters; returns the length of the +// resulting text // -// popis formatovaciho retezce: -// - na zacatku kazdeho formatovaciho retezce je signatura "{!}" -// - uznavaji se nasledujici escape sekvence pro potlaceni vyznamu specialnich -// znaku ve formatovacim retezci (znak backslashe v tomto popisu -// neni zdvojen): "\\" = "\", "\{" = "{", "\}" = "}", "\:" = ":" a "\|" = "|" -// - text, ktery neni ve slozenych zavorkach se do vysledneho retezce -// prenasi beze zmen (az na escape sekvence) -// - parametrizovany text je ve slozenych zavorkach -// - kazdy parametrizovany text pouziva jeden parametr z 'lpParArray' - jde -// o 64-bitovy unsigned int -// - parametrizovany text obsahuje ruzne vysledne texty pro ruzne intervaly -// hodnot parametru -// - jednotlive vysledne texty a meze intervalu se oddeluji znakem "|" -// - parametrizovany text "{}" se pouziva pro preskoceni jednoho parametru -// z pole 'lpParArray' (nevytvari zadny vystupni text) -// - pokud je na zacatku parametrizovaneho textu cislo nasledovane dvojteckou, -// jde o index parametru (od jedne az do poctu parametru), ktery se ma pouzit, -// pokud neni index uveden, prideli se automaticky (postupne od jedne az do -// poctu parametru) -// - pri zadani indexu parametru nedochazi ke zmene postupne prirazovaneho -// indexu, napr. v "{!}%d file{2:s|0||1|s} and %d director{y|1|ies}" se pro -// prvni parametrizovany text pouzije parametr s indexem 2 a pro druhy -// s indexem 1 -// - parametrizovanych textu se zadanym indexem je mozne pouzit libovolny pocet +// description of the format string: +// - every format string starts with the signature "{!}" +// - the following escape sequences are recognized to suppress the special +// meaning of characters in the format string (the backslash character in +// this description is not doubled): "\\" = "\", "\{" = "{", "\}" = "}", "\:" = ":" and "\|" = "|" +// - text outside curly braces is copied to the resulting string unchanged +// (except for escape sequences) +// - parameterized text is enclosed in curly braces +// - each parameterized text uses one parameter from 'lpParArray' - it is a +// 64-bit unsigned int +// - parameterized text contains different resulting texts for different +// parameter value ranges +// - individual resulting texts and range boundaries are separated by "|" +// - parameterized text "{}" is used to skip one parameter from 'lpParArray' +// (it produces no output text) +// - if a parameterized text starts with a number followed by a colon, it is +// the index of the parameter to use (from one up to the number of +// parameters); if no index is specified, it is assigned automatically +// (sequentially from one up to the number of parameters) +// - specifying a parameter index does not change the sequentially assigned +// index; for example, in "{!}%d file{2:s|0||1|s} and %d director{y|1|ies}" +// the first parameterized text uses parameter 2 and the second uses +// parameter 1 +// - any number of parameterized texts with an explicitly specified index may +// be used // -// priklady formatovacich retezcu: -// - "{!}director{y|1|ies}" pro hodnotu parametru od 0 do 1 (vcetne) bude -// "directory" a pro hodnotu od 2 do "nekonecna" (2^64-1) bude "directories" -// - "{!}soubo{rů|0|r|1|ry|4|rů}" pro hodnotu parametru 0 bude "souborů", -// pro 1 bude "soubor", pro 2 az 4 (vcetne) bude "soubory" a od 5 -// do "nekonecna" bude "souborů" +// examples of format strings: +// - "{!}director{y|1|ies}" for parameter values from 0 to 1 (inclusive) will +// be "directory", and for values from 2 to "infinity" (2^64-1) will be +// "directories" +// - "{!}soubo{rů|0|r|1|ry|4|rů}" for parameter value 0 will be "souborů", for +// 1 will be "soubor", for 2 to 4 (inclusive) will be "soubory", and from 5 +// to "infinity" will be "souborů" int ExpandPluralString(char* lpOut, int nOutMax, const char* lpFmt, int nParCount, const CQuadWord* lpParArray); // -// Do lpOut zapise retezec v zavislosti na promennych files a dirs: +// Writes the text to 'lpOut' depending on the 'files' and 'dirs' variables: // files > 0 && dirs == 0 -> XXX (selected/hidden) files // files == 0 && dirs > 0 -> YYY (selected/hidden) directories // files > 0 && dirs > 0 -> XXX (selected/hidden) files and YYY directories // -// kde XXX a YYY odpovidaji hodnotam promennych files a dirs. -// Promenna selectedForm ridi vlozeni slova selected +// where XXX and YYY correspond to the values of 'files' and 'dirs'. +// The variable 'selectedForm' controls insertion of the word "selected". // -// V forDlgCaption je TRUE/FALSE pokud text je/neni urceny pro titulek dialogu -// (v anglictine jsou nutna velka pocatecni pismena). +// 'forDlgCaption' is TRUE/FALSE if the text is meant for a dialog caption +// (capitalization is required in English). // -// Vrati pocet nakopirovanych znaku bez terminatoru. +// Returns the number of copied characters excluding the terminator. // -// popis konstant epfdmXXX viz spl_gen.h +// description of epfdmXXX constants is in spl_gen.h int ExpandPluralFilesDirs(char* lpOut, int nOutMax, int files, int dirs, int mode, BOOL forDlgCaption); int ExpandPluralBytesFilesDirs(char* lpOut, int nOutMax, const CQuadWord& selectedBytes, int files, int dirs, BOOL useSubTexts); -// V textu nalezne pary '<' '>', vyradi je z bufferu a prida odkazy na -// jejich obsah do 'varPlacements'. 'varPlacements' je pole DWORDu o '*varPlacementsCount' -// polozkach, DWORDy jsou slozene vzdy z pozice odkazu ve vystupnim bufferu (spodni WORD) -// a poctu znaku odkazu (horni WORD). Retezce "\<", "\>", "\\" jsou chapany -// jako escape sekvence a budou nahrazeny znaky '<', '>' a '\\'. -// Vraci TRUE v pripade uspechu, jinak FALSE; vzdy nastavi 'varPlacementsCount' na -// pocet zpracovanych promennych. +// Searches the text for '<' '>' pairs, removes them from the buffer, and stores +// references to their contents in 'varPlacements'. 'varPlacements' is an array of +// DWORDs with '*varPlacementsCount' items; each DWORD is composed of the position +// of the reference in the output buffer (low WORD) and the number of characters +// in the reference (high WORD). The strings "\<", "\>", "\\" are treated as +// escape sequences and are replaced with '<', '>' and '\\'. +// Returns TRUE on success, otherwise FALSE; always sets 'varPlacementsCount' to +// the number of processed variables. BOOL LookForSubTexts(char* text, DWORD* varPlacements, int* varPlacementsCount); -void MinimizeApp(HWND mainWnd); // minimalizace app. -void RestoreApp(HWND mainWnd, HWND dlgWnd); // obnova z minimized stavu app. - // meni format jmena (velikost pismen), filename musi byt vzdy terminovan znakem nula5 +void MinimizeApp(HWND mainWnd); // minimize the application +void RestoreApp(HWND mainWnd, HWND dlgWnd); // restore from minimized state + // adjusts the name format (letter case), filename must be null-terminated void AlterFileName(char* tgtName, char* filename, int filenameLen, int format, int change, BOOL dir); -// vraci string s velikosti a casy souboru; Ve 'fileTime' vraci cas, promenna muze byt NULL; -// neni-li 'getTimeFailed' NULL, zapise se do nej TRUE pri chybe ziskavani casu souboru +// returns a string with size and times of the file; 'fileTime' receives the time (may be NULL); +// if 'getTimeFailed' is not NULL it is set to TRUE on failure to obtain the file time void GetFileOverwriteInfo(char* buff, int buffLen, HANDLE file, const char* fileName, FILETIME* fileTime = NULL, BOOL* getTimeFailed = NULL); -void ColorsChanged(BOOL refresh, BOOL colorsOnly, BOOL reloadUMIcons); // volat po zmene barev -HICON GetDriveIcon(const char* root, UINT type, BOOL accessible, BOOL large = FALSE); // ikona drivu +void ColorsChanged(BOOL refresh, BOOL colorsOnly, BOOL reloadUMIcons); // call after color change +HICON GetDriveIcon(const char* root, UINT type, BOOL accessible, BOOL large = FALSE); // drive icon HICON SalLoadIcon(HINSTANCE hDLL, int id, int iconSize); -// SetCurrentDirectory(systemovy adresar) - odpojeni od adresare v panelu +// SetCurrentDirectory(system directory) - detach from panel directory void SetCurrentDirectoryToSystem(); -// nahradi substy v ceste 'resPath' jejich cilovymi cestami (prevod na cestu bez SUBST drive-letters); -// vraci FALSE pri chybe +// replaces SUBST drives in 'resPath' with their targets (converts to a path without SUBST drive letters); +// returns FALSE on error BOOL ResolveSubsts(char* resPath); -// Provede resolve substu a reparse pointu pro cestu 'path', nasledne se pro mount-point cesty -// (pokud chybi tak pro root cesty) pokusi ziskat GUID path. Pri neuspechu vrati FALSE. Pri -// uspechu, vrati TRUE a nastavi 'mountPoint' a 'guidPath' (pokud jsou ruzne od NULL, musi -// odkazovat na buffery o velikosti minimalne MAX_PATH; retezce budou zakonceny zpetnym lomitkem). +// Resolves SUBSTs and reparse points for 'path' and then tries to obtain the GUID path for +// the mount point (or for the root if missing). On failure returns FALSE. On success returns +// TRUE and sets 'mountPoint' and 'guidPath' (if not NULL, they must be buffers at least +// MAX_PATH in size; strings will end with a backslash). BOOL GetResolvedPathMountPointAndGUID(const char* path, char* mountPoint, char* guidPath); -// pokus o vraceni korektnich hodnot (umi i reparse pointy - zadava se komplet cesta misto rootu) +// attempts to return correct values (handles reparse points - specify the full path instead of the root) CQuadWord MyGetDiskFreeSpace(const char* path, CQuadWord* total = NULL); -// POZOR: nepouzivat navratovky 'lpNumberOfFreeClusters' a 'lpTotalNumberOfClusters', protoze u vetsich -// disku jsou v nich nesmysly (DWORD nemusi stacit pro celkovy pocet clusteru), resit pres -// MyGetDiskFreeSpace(path, total), ktera vraci 64-bitova cisla +// NOTE: do not use the return values 'lpNumberOfFreeClusters' and 'lpTotalNumberOfClusters' +// for large disks they may overflow. Use MyGetDiskFreeSpace(path, total) which returns 64-bit numbers. BOOL MyGetDiskFreeSpace(const char* path, LPDWORD lpSectorsPerCluster, LPDWORD lpBytesPerSector, LPDWORD lpNumberOfFreeClusters, LPDWORD lpTotalNumberOfClusters); -// vylepsena GetVolumeInformation: pracuje s cestou (prochazi reparse pointy a substy); -// v 'rootOrCurReparsePoint' (neni-li NULL, musi byt aspon MAX_PATH znaku) vraci bud -// root nebo cestu k aktualnimu (poslednimu) lokalnimu reparse pointu na ceste 'path' -// (POZOR: nefunguje pokud neni medium v drivu, GetCurrentLocalReparsePoint() timto netrpi); -// v 'junctionOrSymlinkTgt' (neni-li NULL, musi byt aspon MAX_PATH znaku) vraci -// cil aktualniho reparse pointu nebo prazdny retezec (pokud zadny reparse point neexistuje nebo -// je neznameho typu nebo jde o volume mount point); v 'linkType' (neni-li NULL) vraci typ aktualniho -// reparse pointu: 0 (neznamy nebo neexistuje), 1 (MOUNT POINT), 2 (JUNCTION POINT), 3 (SYMBOLIC LINK) +// enhanced GetVolumeInformation: works with the path (walks reparse points and SUBST drives) +// 'rootOrCurReparsePoint' (if not NULL and at least MAX_PATH chars) receives the +// root or the path to the current (last) local reparse point on 'path' +// (WARNING: this does not work if no medium is present in the drive; GetCurrentLocalReparsePoint() is not affected by this) +// 'junctionOrSymlinkTgt' (if not NULL and at least MAX_PATH chars) receives the +// target of the current reparse point or an empty string when none exists or it +// is of unknown type or a volume mount point. 'linkType' (if not NULL) receives +// the type of the current reparse point: 0 (unknown or none), 1 (MOUNT POINT), +// 2 (JUNCTION POINT), 3 (SYMBOLIC LINK) BOOL MyGetVolumeInformation(const char* path, char* rootOrCurReparsePoint, char* junctionOrSymlinkTgt, int* linkType, LPTSTR lpVolumeNameBuffer, DWORD nVolumeNameSize, LPDWORD lpVolumeSerialNumber, LPDWORD lpMaximumComponentLength, LPDWORD lpFileSystemFlags, LPTSTR lpFileSystemNameBuffer, DWORD nFileSystemNameSize); -// vraci cilovou cestu reparse pointu 'repPointDir' v bufferu 'repPointDstBuf' (neni-li NULL) -// o velikosti 'repPointDstBufSize'; 'repPointDir' a 'repPointDstBuf' muzou ukazovat -// do jednoho bufferu (IN/OUT buffer); je-li 'makeRelPathAbs' TRUE a jde o relativni -// symbolicky link, prevede cilovou cestu linku na absolutni; -// vraci TRUE pri uspechu + v 'repPointType' (neni-li NULL) vraci typ reparse pointu: -// 1 (MOUNT POINT), 2 (JUNCTION POINT), 3 (SYMBOLIC LINK) +// returns the target path of the reparse point 'repPointDir' in 'repPointDstBuf' +// (if not NULL) of size 'repPointDstBufSize'. 'repPointDir' and 'repPointDstBuf' +// may point into the same buffer (IN/OUT). If 'makeRelPathAbs' is TRUE and it is a +// relative symbolic link, the target path is converted to an absolute path. +// Returns TRUE on success and when 'repPointType' is not NULL it receives the +// reparse point type: 1 (MOUNT POINT), 2 (JUNCTION POINT), 3 (SYMBOLIC LINK) BOOL GetReparsePointDestination(const char* repPointDir, char* repPointDstBuf, DWORD repPointDstBufSize, int* repPointType, BOOL makeRelPathAbs); -// v 'currentReparsePoint' (aspon MAX_PATH znaku) vraci aktualni (posledni) lokalni -// reparse point, pri neuspechu vraci klasicky root; pri neuspechu vraci FALSE; neni-li -// 'error' NULL, zapise se do nej pri chybe TRUE +// 'currentReparsePoint' (at least MAX_PATH chars) receives the current (last) +// local reparse point; on failure the standard root is returned and the result +// is FALSE. If 'error' is not NULL it is set to TRUE when an error occurs. BOOL GetCurrentLocalReparsePoint(const char* path, char* currentReparsePoint, BOOL* error = NULL); -// volat jen pro cesty 'path', jejichz root (po odstraneni substu) je DRIVE_FIXED (jinde nema smysl hledat -// reparse pointy); hledame cestu bez reparse pointu, vedouci na stejny svazek jako 'path'; pro cestu -// obsahujici symlink vedouci na sitovou cestu (UNC nebo mapovanou) vracime jen root teto sitove cesty -// (ani Vista neumi delat s reparse pointy na sitovych cestach, takze to je nejspis zbytecne drazdit); -// pokud takova cesta neexistuje z duvodu, ze aktualni (posledni) lokalni reparse point je volume mount -// point (nebo neznamy typ reparse pointu), vracime cestu k tomuto volume mount pointu (nebo reparse -// pointu neznameho typu); pokud cesta obsahuje vice nez 50 reparse pointu (nejspis nekonecny cyklus), -// vracime puvodni cestu; +// call only for paths whose root (after removing SUBSTs) is DRIVE_FIXED (there is +// no point searching for reparse points elsewhere); we look for a path without +// reparse points that leads to the same volume as 'path'; for a path containing +// a symlink that leads to a network path (UNC or mapped), we return only the +// root of that network path (even Vista cannot work with reparse points on +// network paths, so this is probably unnecessary); if no such path exists +// because the current (last) local reparse point is a volume mount point (or an +// unknown type of reparse point), we return the path to this volume mount point +// (or reparse point of an unknown type); if the path contains more than 50 +// reparse points (most likely an infinite loop), we return the original path; // -// 'resPath' je buffer pro vysledek o velikosti MAX_PATH; 'path' je puvodni cesta; v 'cutResPathIsPossible' -// (nesmi byt NULL) vracime FALSE pokud vysledna cesta v 'resPath' obsahuje na konci reparse point (volume -// mount point nebo neznamy typ reparse pointu) a tudiz ji nesmime zkracovat (dostali bysme se tim nejspis -// na jiny svazek); je-li 'rootOrCurReparsePointSet' neNULLove a obsahuje-li FALSE a na puvodni ceste je -// aspon jeden lokalni reparse point (reparse pointy na sitove casti cesty ignorujeme), vracime v teto -// promenne TRUE + v 'rootOrCurReparsePoint' (neni-li NULL) vracime plnou cestu k aktualnimu (poslednimu -// lokalnimu) reparse pointu (pozor, ne kam vede); cilovou cestu aktualniho reparse pointu (jen je-li to -// junction nebo symlink) vracime v 'junctionOrSymlinkTgt' (neni-li NULL) + typ vracime v 'linkType': -// 2 (JUNCTION POINT), 3 (SYMBOLIC LINK); v 'netPath' (neni-li NULL) vracime sitovou cestu, na kterou -// vede aktualni (posledni) lokalni symlink v ceste - v teto situaci se root sitove cesty vraci v 'resPath' +// 'resPath' is a MAX_PATH-sized output buffer; 'path' is the original path; in +// 'cutResPathIsPossible' (must not be NULL) we return FALSE if the resulting +// path in 'resPath' ends with a reparse point (volume mount point or an unknown +// type of reparse point) and therefore must not be shortened (that would most +// likely take us to a different volume); if 'rootOrCurReparsePointSet' is not +// NULL and contains FALSE, and the original path contains at least one local +// reparse point (reparse points on the network part of the path are ignored), +// we return TRUE in this variable and in 'rootOrCurReparsePoint' (if not NULL) +// we return the full path to the current (last local) reparse point (note: not +// where it leads); the target path of the current reparse point (only if it is +// a junction or symlink) is returned in 'junctionOrSymlinkTgt' (if not NULL) +// and its type is returned in 'linkType': 2 (JUNCTION POINT), 3 (SYMBOLIC +// LINK); in 'netPath' (if not NULL) we return the network path to which the +// current (last) local symlink in the path leads - in this situation, the root +// of the network path is returned in 'resPath' void ResolveLocalPathWithReparsePoints(char* resPath, const char* path, BOOL* cutResPathIsPossible, BOOL* rootOrCurReparsePointSet, char* rootOrCurReparsePoint, char* junctionOrSymlinkTgt, int* linkType, char* netPath); -// vylepsena GetDriveType: pracuje s cestou (prochazi reparse pointy a substy) +// improved GetDriveType: works with a path and resolves reparse points and SUBSTs UINT MyGetDriveType(const char* path); -// nase vlastni QueryDosDevice -// 'driveNum' je 0-based (0=A: 2=C: ...) +// our own QueryDosDevice +// 'driveNum' is 0-based (0=A: 2=C: ...) BOOL MyQueryDosDevice(BYTE driveNum, char* target, int maxTarget); -// detekuje zda 'driveNum' (0=A: 2=C: ...) je substed a pokud ano, kam je pripojeny -// pokud drive neni substed, vraci FALSE -// pokud je substed, vraci TRUE a do promenne 'path' (o maximalni delce 'pathMax') -// ulozi cestu, kam je subst pripojeny -// pokud je 'path' NULL, cesta nebude vracena -// muze vratit cestu v UNC tvaru +// detects whether 'driveNum' (0=A: 2=C: ...) is SUBSTed and if so where it is mounted +// returns FALSE when the drive is not SUBSTed +// when SUBSTed, returns TRUE and stores the target path into 'path' +// (up to 'pathMax' characters). If 'path' is NULL the path is not returned. +// The returned path may be in UNC form. BOOL GetSubstInformation(BYTE driveNum, char* path, int pathMax); -// nahradi v retezci posledni znak '.' decimalnim separatorem ziskanym ze systemu LOCALE_SDECIMAL -// delka retezce muze narust, protoze separator muze mit podle MSDN az 4 znaky -// vraci TRUE, pokud byl buffer dostatecne veliky a operaci se povedlo dokoncit, jinak vraci FALSE +// replaces the last '.' in the string with the decimal separator from LOCALE_SDECIMAL +// the string may grow because the separator can have up to 4 characters according to MSDN +// returns TRUE if the buffer was large enough and the operation succeeded, otherwise FALSE BOOL PointToLocalDecimalSeparator(char* buffer, int bufferSize); typedef WINBASEAPI LONG(WINAPI* MY_FMExtensionProc)(HWND hwnd, @@ -971,52 +983,52 @@ typedef WINBASEAPI LONG(WINAPI* MY_FMExtensionProc)(HWND hwnd, LONG lParam); void GetMessagePos(POINT& p); -// Vrati handle ikony ziskany pomoci SHGetFileInfo nebo NULL v pripade neuspechu. -// Volajici je zodpovedny za destrukci ikony. Ikona je prirazena do HANDLES. +// Returns an icon handle obtained via SHGetFileInfo or NULL on failure. +// The caller is responsible for destroying the icon. The icon is assigned to HANDLES. HICON GetFileOrPathIconAux(const char* path, BOOL large, BOOL isDir); -// pokud je root UNCPath nepristupny (pro listing), zkusi navazat sitove spojeni, -// o jmeno a heslo uzivatele si rekne samo, vraci TRUE pokud bylo spojeni navazano, -// vraci FALSE pokud UNCPath neni UNC cesta nebo je root UNCPath pristupny nebo -// pokud se spojeni nepodarilo navazat, v 'pathInvalid' vraci TRUE pokud user prerusil -// dialog zadani jmena+hesla nebo jsme neuspesne zkusili navazat spojeni (napr. -// "credentials conflict"); je-li 'donotReconnect' TRUE, nezkousi se navazat sitove -// spojeni, vrati se rovnou, ze to nevyslo +// If the UNC root is inaccessible (for listing), tries to establish a network +// connection, asking the user for credentials if needed. Returns TRUE when the +// connection succeeded. Returns FALSE if the path is not UNC, the root is +// accessible, or the connection attempt failed. In 'pathInvalid' returns TRUE +// when the user cancelled the credentials dialog or the attempt failed (e.g. +// "credentials conflict"). When 'donotReconnect' is TRUE no connection attempt +// is made and FALSE is returned immediately. BOOL CheckAndConnectUNCNetworkPath(HWND parent, const char* UNCPath, BOOL& pathInvalid, BOOL donotReconnect); -// pokusi se obnovit sitove spojeni (existovalo-li) na 'drive:', parent - predek dialogu, -// vraci TRUE pokud se obnova spojeni podarila (sit. disk je jiz opet namapovan) -// v 'pathInvalid' vraci TRUE pokud user prerusil dialog zadani jmena+hesla nebo -// jsme neuspesne zkusili navazat spojeni (napr. "credentials conflict") +// Attempts to restore a network connection (if it previously existed) on +// 'drive:'. 'parent' is the parent dialog. Returns TRUE if the connection was +// restored successfully (the network drive is mapped again). +// 'pathInvalid' returns TRUE if the user cancelled the username/password dialog +// or an attempt to establish the connection failed (e.g. "credentials conflict") BOOL CheckAndRestoreNetworkConnection(HWND parent, const char drive, BOOL& pathInvalid); -// funkce pro spravu threadu, pri ukoncovani procesu se tyto thready maji uzavrit, -// pokud to neudelaji sami, musi se terminovat +// thread management helpers-these threads should exit when the process ends; if +// they do not, they must be terminated void AddAuxThread(HANDLE view, BOOL testIfFinished = FALSE); void TerminateAuxThreads(); -// vrati TRUE, pokud specifikovany soubor existuje; jinak vrati FALSE +// returns TRUE if the specified file exists; otherwise FALSE extern "C" BOOL FileExists(const char* fileName); -// vrati TRUE, pokud specifikovany adresar existuje; jinak vrati FALSE +// returns TRUE if the specified directory exists; otherwise FALSE BOOL DirExists(const char* dirName); // tool tip -void SetCurrentToolTip(HWND hNotifyWindow, DWORD id, int showDelay = 0); // popis v tooltip.h -void SuppressToolTipOnCurrentMousePos(); // popis v tooltip.h +void SetCurrentToolTip(HWND hNotifyWindow, DWORD id, int showDelay = 0); // see tooltip.h +void SuppressToolTipOnCurrentMousePos(); // see tooltip.h -// zajisti skoky kurzoru pri Ctrl+Left/Right po zpetnych lomitkach a mezerach -// k editline nebo comboboxu priradi EditWordBreakProc -// je mozne zavolat napriklad v WM_INITDIALOG -// neni nutne odinstalovavat +// Makes Ctrl+Left/Right skip over backslashes and spaces. Assigns +// EditWordBreakProc to an edit line or combo box. Can be called from +// WM_INITDIALOG. Uninstalling is not required. BOOL InstallWordBreakProc(HWND hWindow); -// vymaze vsechny polozky z dropdown listboxu od comboboxu -// pouzivame pri promazavani historii +// removes all items from a combo box drop-down list +// used when clearing history void ClearComboboxListbox(HWND hCombo); -// struktura pro WM_USER_VIEWFILE a WM_USER_VIEWFILEWITH +// structure for WM_USER_VIEWFILE and WM_USER_VIEWFILEWITH struct COpenViewerData { char* FileName; @@ -1031,88 +1043,87 @@ struct COpenViewerData #define WM_USER_S_REFRESH_DIR WM_APP + 101 // [BOOL setRefreshEvent, time] #define WM_USER_SETDIALOG WM_APP + 103 // [CProgressData *data, 0] \ - // nebo [0, 0] - setprogress + // or [0, 0] - setprogress #define WM_USER_DIALOG WM_APP + 104 // [int dlgID, void *data] -// icon reader prave nacetl ikonu, vlozil ji do iconcache a rika to panelu -// bezicimu v hlavnim threadu, aby se mohl prekreslit a ikonku zazalohovat do asociaci -// index je dohledana pozice polozky v CFilesWindow::Files/Dirs +// the icon reader has loaded an icon and stored it in the icon cache; it notifies +// the panel running in the main thread so it can repaint and back up the icon in the associations +// 'index' is the located position of the item in CFilesWindow::Files/Dirs #define WM_USER_REFRESHINDEX WM_APP + 105 // [int index, 0] -#define WM_USER_END_SUSPMODE WM_APP + 106 // [0, 0] - rychlejsi aktivace okna +#define WM_USER_END_SUSPMODE WM_APP + 106 // [0, 0] - faster window activation #define WM_USER_DRIVES_CHANGE WM_APP + 107 // [0, 0] -#define WM_USER_ICON_NOTIFY WM_APP + 108 // [0, 0] - mysak je nad ikonkou v taskbare -#define WM_USER_EDIT WM_APP + 110 // [begin, end] oznac tento interval -#define WM_USER_SM_END_NOTIFY WM_APP + 111 // [0, 0] za 200ms naplanuje WM_USER_SM_END_NOTIFY_DELAYED -#define WM_USER_DISPLAYPOPUP WM_APP + 112 // [0, commandID] je treba vybali popupmenu -//#define WM_USER_SETPATHS WM_APP + 113 // nepouzivat, stara zprava, kterou nam teoreticky mohou stare aplikace zasilat +#define WM_USER_ICON_NOTIFY WM_APP + 108 // [0, 0] - the mouse pointer is over the icon in the taskbar +#define WM_USER_EDIT WM_APP + 110 // [begin, end] select this interval +#define WM_USER_SM_END_NOTIFY WM_APP + 111 // [0, 0] schedules WM_USER_SM_END_NOTIFY_DELAYED after 200ms +#define WM_USER_DISPLAYPOPUP WM_APP + 112 // [0, commandID] a popup menu should be displayed +//#define WM_USER_SETPATHS WM_APP + 113 // do not use, legacy message that old applications may theoretically send us -#define WM_USER_CHAR WM_APP + 114 // notifikace z listview +#define WM_USER_CHAR WM_APP + 114 // notification from list view // [command, index] -// command = 0 pro normalni konfiguraci, -// command = 1 pro otevreni stranky Hot Paths; index pak vyjadruje polozku -// command = 2 pro otevreni stranky User Menu -// command = 3 pro otevreni stranky Internal Viewer -// command = 4 pro otevreni stranky Views, index vyjadruje pohled -// command = 5 pro otevreni stranky Panels +// command = 0 for normal configuration +// command = 1 to open the Hot Paths page; 'index' specifies the item +// command = 2 to open the User Menu page +// command = 3 to open the Internal Viewer page +// command = 4 to open the Views page; 'index' specifies the view +// command = 5 to open the Panels page #define WM_USER_CONFIGURATION WM_APP + 115 #define WM_USER_MOUSEWHEEL WM_APP + 116 // [wParam, lParam] z WM_MOUSEWHEEL #define WM_USER_SKIPONEREFRESH WM_APP + 117 // [0, 0] za 500 ms SkipOneActivateRefresh = FALSE -#define WM_USER_FLASHWINDOW WM_APP + 118 // [0, 0] zablika oknem -#define WM_USER_SHOWWINDOW WM_APP + 119 // [0, 0] vytahne dopopredi okno (restorne, je-li treba) +#define WM_USER_FLASHWINDOW WM_APP + 118 // [0, 0] flashes the window +#define WM_USER_SHOWWINDOW WM_APP + 119 // [0, 0] brings the window to the foreground (restores if needed) #define WM_USER_DROPCOPYMOVE WM_APP + 120 // [CTmpDropData *, 0] -#define WM_USER_CHANGEDIR WM_APP + 121 // [convertFSPathToInternal, newDir] - panel zmeni svou cestu (vola ChangeDir) -#define WM_USER_FOCUSFILE WM_APP + 122 // [fileName, newPath] - panel zmeni svou cestu a vybere prislusny soubor -#define WM_USER_CLOSEFIND WM_APP + 123 // [0, 0] - zavola DestroyWindow z threadu find okna -#define WM_USER_SELCHANGED WM_APP + 124 // [0, 0] - notifikaci o zmene selectu +#define WM_USER_CHANGEDIR WM_APP + 121 // [convertFSPathToInternal, newDir] - the panel changes its path (calls ChangeDir) +#define WM_USER_FOCUSFILE WM_APP + 122 // [fileName, newPath] - the panel changes its path and selects the given file +#define WM_USER_CLOSEFIND WM_APP + 123 // [0, 0] - calls DestroyWindow from the find window thread +#define WM_USER_SELCHANGED WM_APP + 124 // [0, 0] - notification about selection change #define WM_USER_MOUSEHWHEEL WM_APP + 126 // [wParam, lParam] z WM_MOUSEHWHEEL -#define WM_USER_CLOSEMENU WM_APP + 130 // [0, 0] - interni pro menu - je treba se zavrit +#define WM_USER_CLOSEMENU WM_APP + 130 // [0, 0] - internal for menus - they must close -#define WM_USER_REFRESH_PLUGINFS WM_APP + 133 // [0, 0] - volat u FS Event(FSE_ACTIVATEREFRESH) -#define WM_USER_REFRESH_SHARES WM_APP + 134 // [0, 0] - snooper.cpp hlasi zmenu sharu v registry -#define WM_USER_PROCESSDELETEMAN WM_APP + 135 // [0, 0] - cache.cpp: DeleteManager - spusteni zpracovani novych dat v hl. threadu +#define WM_USER_REFRESH_PLUGINFS WM_APP + 133 // [0, 0] - call for FS Event(FSE_ACTIVATEREFRESH) +#define WM_USER_REFRESH_SHARES WM_APP + 134 // [0, 0] - snooper.cpp reports a change in shares in the registry +#define WM_USER_PROCESSDELETEMAN WM_APP + 135 // [0, 0] - cache.cpp: DeleteManager - start processing new data in the main thread -#define WM_USER_CANCELPROGRDLG WM_APP + 136 // [0, 0] - CProgressDlgArray: po doruceni teto zpravy do CProgressDialog dojde k cancelu operace (bez dotazu; zavre se dialog operace) -#define WM_USER_FOCUSPROGRDLG WM_APP + 137 // [0, 0] - CProgressDlgArray: po doruceni teto zpravy do CProgressDialog dojde aktivaci dialogu (nebo jeho popupu) -#define WM_USER_ICONREADING_END WM_APP + 138 // [0, 0] - notifikace o ukonceni nacitani ikonek v panelu +#define WM_USER_CANCELPROGRDLG WM_APP + 136 // [0, 0] - CProgressDlgArray: when this message arrives the operation is canceled (no prompt; the dialog closes) +#define WM_USER_FOCUSPROGRDLG WM_APP + 137 // [0, 0] - CProgressDlgArray: activates the dialog (or its popup) when received +#define WM_USER_ICONREADING_END WM_APP + 138 // [0, 0] - notification that icon reading in the panel has finished -//presunuto do shexreg.h (konstanta se nesmi zmenit): #define WM_USER_SALSHEXT_PASTE WM_APP + 139 // [postMsgIndex, 0] - SalamExt zada o provedeni prikazu Paste +// moved to shexreg.h (constant must not change): #define WM_USER_SALSHEXT_PASTE WM_APP + 139 // [postMsgIndex, 0] - SalamExt requests execution of the Paste command -#define WM_USER_DROPUNPACK WM_APP + 140 // [allocatedTgtPath, operation] - drag&drop z archivu: cilova cesta + operace zjistena, nechame provest unpack -#define WM_USER_PROGRDLGEND WM_APP + 141 // [cmd, 0] - CProgressDialog: pod W2K+ asi zbytecne: bypass bugy (zavrene dialogy zustavaly v taskbare) - zpozdene zavreni dialogu -#define WM_USER_PROGRDLGSTART WM_APP + 142 // [0, 0] - CProgressDialog: pod W2K+ asi zbytecne: bypass bugy (na obrazovce zustaval bordel po dialogu) - zpozdeny start worker threadu +#define WM_USER_DROPUNPACK WM_APP + 140 // [allocatedTgtPath, operation] - drag&drop from archive: target path and operation determined, perform unpack +#define WM_USER_PROGRDLGEND WM_APP + 141 // [cmd, 0] - CProgressDialog: workaround for bugs on W2K+ (closed dialogs remained in the taskbar) - delayed close of the dialog +#define WM_USER_PROGRDLGSTART WM_APP + 142 // [0, 0] - CProgressDialog: workaround for bugs on W2K+ (garbage left on screen) - delayed start of the worker thread -//presunuto do shexreg.h (konstanta se nesmi zmenit): #define WM_USER_SALSHEXT_TRYRELDATA WM_APP + 143 // [0, 0] - SalamExt hlasi odblokovani paste-dat (viz CSalShExtSharedMem::BlockPasteDataRelease), nejsou-li data dale chranena, nechame je zrusit +// moved to shexreg.h (constant must not change): #define WM_USER_SALSHEXT_TRYRELDATA WM_APP + 143 // [0, 0] - SalamExt reports release of the paste data lock (see CSalShExtSharedMem::BlockPasteDataRelease); if the data is no longer protected, let it be released -#define WM_USER_DROPFROMFS WM_APP + 144 // [allocatedTgtPath, operation] - drag&drop z FS: cilova cesta + operace zjistena, nechame provest copy/move z FS +#define WM_USER_DROPFROMFS WM_APP + 144 // [allocatedTgtPath, operation] - drag&drop from FS: target path and operation determined, perform copy/move from FS #define WM_USER_DROPTOARCORFS WM_APP + 145 // [CTmpDragDropOperData *, 0] #define WM_USER_SHCHANGENOTIFY WM_APP + 146 // message for SHChangeNotifyRegister [pidlList, SHCNE_xxx (event that occured)] -#define WM_USER_REFRESH_DIR_EX WM_APP + 147 // [long_wait, time] - za (long_wait?5000:200) ms posle WM_USER_REFRESH_DIR_EX_DELAYED +#define WM_USER_REFRESH_DIR_EX WM_APP + 147 // [long_wait, time] - after (long_wait ? 5000 : 200) ms sends WM_USER_REFRESH_DIR_EX_DELAYED -#define WM_USER_SETPROGRESS WM_APP + 148 // [progress, text] slouzi pro prekroceni threadu +#define WM_USER_SETPROGRESS WM_APP + 148 // [progress, text] used to cross thread boundaries -// icon reader prave nacetl icon-overlay a rika to panelu bezicimu v hlavnim threadu, aby -// se mohl prekreslit -// index je pozice polozky v CFilesWindow::Files/Dirs +// icon reader has just loaded an icon overlay and informs the panel running in the main thread so it can repaint +// index is the position of the item in CFilesWindow::Files/Dirs #define WM_USER_REFRESHINDEX2 WM_APP + 149 // [int index, 0] -#define WM_USER_DONEXTFOCUS WM_APP + 150 // [0, 0] - notifikace o zmene NextFocusName -#define WM_USER_CREATEWAITWND WM_APP + 151 // [parent or NULL, delay] - zprava pro thread safe-wait-message: "create && show" -#define WM_USER_DESTROYWAITWND WM_APP + 152 // [killThread, 0] - zprava pro thread safe-wait-message: "hide && destery" -#define WM_USER_SHOWWAITWND WM_APP + 153 // [show, 0] - zprava pro thread safe-wait-message: "show || hide" -#define WM_USER_SETWAITMSG WM_APP + 154 // [0, 0] - zprava pro thread safe-wait-message: byl zmenen text--prekresli se -#define WM_USER_REPAINTALLICONS WM_APP + 155 // [0, 0] - refresh ikon v obou panelech -#define WM_USER_REPAINTSTATUSBARS WM_APP + 156 // [0, 0] - refresh throbberu (dirline) v obou panelech +#define WM_USER_DONEXTFOCUS WM_APP + 150 // [0, 0] - notification that NextFocusName changed +#define WM_USER_CREATEWAITWND WM_APP + 151 // [parent or NULL, delay] - message for the safe wait message thread: "create && show" +#define WM_USER_DESTROYWAITWND WM_APP + 152 // [killThread, 0] - message for the safe wait message thread: "hide && destroy" +#define WM_USER_SHOWWAITWND WM_APP + 153 // [show, 0] - message for the safe wait message thread: "show || hide" +#define WM_USER_SETWAITMSG WM_APP + 154 // [0, 0] - message for the safe wait message thread: text changed-repaint +#define WM_USER_REPAINTALLICONS WM_APP + 155 // [0, 0] - refresh icons in both panels +#define WM_USER_REPAINTSTATUSBARS WM_APP + 156 // [0, 0] - refresh the throbber (dirline) in both panels -#define WM_USER_VIEWERCONFIG WM_APP + 158 // [hWnd, 0] - hWnd urcuje viewer, ktery bude po dokonfigurovani zkusen vytahnout nahoru +#define WM_USER_VIEWERCONFIG WM_APP + 158 // [hWnd, 0] - hWnd indicates the viewer to bring to front after configuration -#define WM_USER_UPDATEPANEL WM_APP + 159 // [0, 0] - pokud je dorucena \ - // (doruci ji messageloopa pri otevreni messageboxu), \ - // bude invalidatnut panel a bude nastavena scrollbara \ - // (pouze pro interni pouziti !!!) +#define WM_USER_UPDATEPANEL WM_APP + 159 // [0, 0] - when delivered \ + // (the message loop sends it after opening a message box), \ + // the panel will be invalidated and the scrollbar updated \ + // (for internal use only) #define WM_USER_AUTOCONFIG WM_APP + 160 // KICKER - autoconfig #define WM_USER_ACFINDFINISHED WM_APP + 161 // KICKER - autoconfig @@ -1120,139 +1131,156 @@ struct COpenViewerData #define WM_USER_ACADDFILE WM_APP + 163 // KICKER - autoconfig #define WM_USER_ACERROR WM_APP + 164 // KICKER - autoconfig -#define WM_USER_QUERYCLOSEFIND WM_APP + 170 // [0, quiet] - zepta se v threadu find okna, jestli ho muzeme zavrit + na dotaz zastavi pripadne probihajici hledani -#define WM_USER_COLORCHANGEFIND WM_APP + 171 // [0, 0] - informuje find okna o zmene barev +#define WM_USER_QUERYCLOSEFIND WM_APP + 170 // [0, quiet] - ask the Find window thread whether it can be closed and stop any ongoing search if requested +#define WM_USER_COLORCHANGEFIND WM_APP + 171 // [0, 0] - notifies Find windows about color changes #define WM_USER_HELPHITTEST WM_APP + 172 // lResult = dwContext, lParam = MAKELONG(x,y) #define WM_USER_EXITHELPMODE WM_APP + 173 // [0, 0] -#define WM_USER_POSTCMDORUNLOADPLUGIN WM_APP + 180 // [plug-in iface, 0, 1 nebo salCmd+2 nebo menuCmd+502] - nastavi ShouldUnload nebo ShouldRebuildMenu nebo prida salCmd/menuCmd do dat plug-inu -#define WM_USER_POSTMENUEXTCMD WM_APP + 181 // [plug-in iface, cmdID] - post menu-ext-cmd z plug-inu +#define WM_USER_POSTCMDORUNLOADPLUGIN WM_APP + 180 // [plug-in iface, 0, 1 or salCmd+2 or menuCmd+502] - sets ShouldUnload or ShouldRebuildMenu or adds salCmd/menuCmd to plugin data +#define WM_USER_POSTMENUEXTCMD WM_APP + 181 // [plug-in iface, cmdID] - post a menu-ext command from a plugin -#define WM_USER_SHOWPLUGINMSGBOX WM_APP + 185 // [0, 0] - otevreni msg-boxu o plug-inu nad Bug Report dialogem +#define WM_USER_SHOWPLUGINMSGBOX WM_APP + 185 // [0, 0] - open the plug-in message box above the Bug Report dialog -// prikazy pro hlavni thread (v jinem threadu je nelze spoustet) - vyuziva Find dialog (bezi ve svem threadu) -#define WM_USER_VIEWFILE WM_APP + 190 // [COpenViewerData *, altView] - otevreni souboru v (alternate) vieweru -#define WM_USER_EDITFILE WM_APP + 191 // [name, 0] - otevreni souboru v editoru -#define WM_USER_VIEWFILEWITH WM_APP + 192 // [COpenViewerData *, handlerID] - otevreni souboru ve vybranem vieweru -#define WM_USER_EDITFILEWITH WM_APP + 193 // [name, handlerID] - otevreni souboru ve vybranem editoru +// commands for the main thread (cannot be run from another thread) - uses the +// Find dialog (running in its own thread) +#define WM_USER_VIEWFILE WM_APP + 190 // [COpenViewerData *, altView] - open a file in the (alternate) viewer +#define WM_USER_EDITFILE WM_APP + 191 // [name, 0] - open a file in the editor +#define WM_USER_VIEWFILEWITH WM_APP + 192 // [COpenViewerData *, handlerID] - open a file in the selected viewer +#define WM_USER_EDITFILEWITH WM_APP + 193 // [name, handlerID] - open a file in the selected editor -#define WM_USER_DISPACHCHANGENOTIF WM_APP + 194 // [0, time] - zadost o rozeslani zprav o zmenach na cestach +#define WM_USER_DISPACHCHANGENOTIF WM_APP + 194 // [0, time] - request to distribute notifications about path changes -#define WM_USER_DISPACHCFGCHANGE WM_APP + 195 // [0, 0] - zadost o rozeslani zprav o zmenach v konfiguraci mezi plug-iny +#define WM_USER_DISPACHCFGCHANGE WM_APP + 195 // [0, 0] - request to distribute configuration change notifications among plugins -#define WM_USER_CFGCHANGED WM_APP + 196 // [0, 0] - zasilano internim viewerum a find oknum po zmene konfigurace +#define WM_USER_CFGCHANGED WM_APP + 196 // [0, 0] - sent to internal viewers and Find windows after configuration changes -#define WM_USER_CLEARHISTORY WM_APP + 197 // [0, 0] - informuje okno, ze ma promazat vsechny comboboxy obsahujici historie +#define WM_USER_CLEARHISTORY WM_APP + 197 // [0, 0] - instructs the window to clear all combo boxes containing histories -#define WM_USER_REFRESHTOOLTIP WM_APP + 198 // posti se do tooltip okna: dojde k novemu vytazeni textu, resize okna a prekresleni -#define WM_USER_HIDETOOLTIP WM_APP + 199 // zprava pro prekroceni hranic threadu; zhasne tooltip +#define WM_USER_REFRESHTOOLTIP WM_APP + 198 // sent to the tooltip window: fetch text again, resize the window, and repaint +#define WM_USER_HIDETOOLTIP WM_APP + 199 // cross-thread message; hides the tooltip //////////////////////////////////////////////////////// // // -// Prostor WM_APP + 200 az WM_APP + 399 je urcen // -// pro zpravy chodici take do oken pluginu. // -// Definice je v plugins\shared\spl_*.h // +// The range WM_APP + 200 to WM_APP + 399 is reserved // +// for messages also sent to plugin windows. // +// Definitions are in plugins\shared\spl_*.h // // // //////////////////////////////////////////////////////// -#define WM_USER_ENUMFILENAMES WM_APP + 400 // [requestUID, 0] - informuje zdroj (panely a Findy), ze maji resit pozadavek na enumeraci souboru pro viewer +#define WM_USER_ENUMFILENAMES WM_APP + 400 // [requestUID, 0] - tells the source (panels and Find windows) to \ + // handle a request for file enumeration for the viewer -#define WM_USER_SM_END_NOTIFY_DELAYED WM_APP + 401 // [0, 0] notifikace o ukonceni suspend modu (zpozdena o 200ms, aby nedochazelo ke kolizi s WM_QUERYENDSESSION pri Shutdown / Log Off) -#define WM_USER_REFRESH_DIR_EX_DELAYED WM_APP + 402 // [FALSE, time] - lisi se od WM_USER_REFRESH_DIR tim, ze jde pravdepodobne o zbytecny refresh (duvod: aktivace okna, zadost o lock-volume (dela se obdoba "hands-off"), atp.) (zpozdena o 200ms nebo 5s, aby nedochazelo ke kolizi s WM_QUERYENDSESSION pri Shutdown / Log Off nebo aby si proces zadajici o lock-volume stihl volume zamknout) +#define WM_USER_SM_END_NOTIFY_DELAYED WM_APP + 401 // [0, 0] notification that suspend mode ended \ + // delayed by 200 ms to avoid conflicts with \ + // WM_QUERYENDSESSION during Shutdown/Log Off +#define WM_USER_REFRESH_DIR_EX_DELAYED WM_APP + 402 // [FALSE, time] - unlike WM_USER_REFRESH_DIR this is \ + // probably an unnecessary refresh (window activation, \ + // request for a lock volume similar to "hands-off", etc.) \ + // delayed by 200 ms or 5 s so it does not collide with \ + // WM_QUERYENDSESSION during Shutdown/Log Off or so the \ + // process requesting the lock can lock the volume -#define WM_USER_CLOSE_MAINWND WM_APP + 403 // [0, 0] - pouziva se misto WM_CLOSE pro zavreni hlavniho okna Salamandera (vyhoda: je mozne zjistit, jestli se nedistribuuje z jine nez hlavni message-loopy) +#define WM_USER_CLOSE_MAINWND WM_APP + 403 // [0, 0] - used instead of WM_CLOSE for closing the main \ + // Salamander window (advantage: we can detect whether it \ + // is dispatched from a non-main message loop) -#define WM_USER_HELP_MOUSEMOVE WM_APP + 405 // [0, mousePos] - zasilano behem Shift+F1 (ctx help) mode vsem child oknum; po obdrzeni jedne nebo vice WM_USER_MOUSEMOVE prijde WM_USER_MOUSELEAVE; slouzi k trackovani kurzoru mysi bez, aniz bychom nahazaovali capture -#define WM_USER_HELP_MOUSELEAVE WM_APP + 406 // [0, 0] - prichazi po WM_USER_MOUSEMOVE, kdyz kurzor opousti childa +#define WM_USER_HELP_MOUSEMOVE WM_APP + 405 // [0, mousePos] - sent during Shift+F1 (context help) mode \ + // to all child windows; after one or more WM_USER_MOUSEMOVE \ + // messages WM_USER_MOUSELEAVE follows; used to track the \ + // mouse cursor without capture +#define WM_USER_HELP_MOUSELEAVE WM_APP + 406 // [0, 0] - sent after WM_USER_MOUSEMOVE when the cursor leaves a child window -//#define WM_USER_RENAME_NEXT_ITEM WM_APP + 407 // [next, 0] - postne se po zmacknuti (Shift)Tab v inplace QuickRename pro prechod na (predchozi) dalsi polozku; inspired by Vista; 'next' je TRUE pro dalsi a FALSE pro predchozi +//#define WM_USER_RENAME_NEXT_ITEM WM_APP + 407 // [next, 0] - posted after pressing (Shift)Tab in inplace QuickRename to move to the (previous) next item; inspired by Vista; 'next' is TRUE for next and FALSE for previous -#define WM_USER_PROGRDLG_UPDATEICON WM_APP + 408 // [0, 0] - CProgressDlgArray: po doruceni teto zpravy do CProgressDialog dojde k novemu nastaveni ikonky dialogu +#define WM_USER_PROGRDLG_UPDATEICON WM_APP + 408 // [0, 0] - CProgressDlgArray: when this message arrives the \ + // icon of the CProgressDialog is updated -#define WM_USER_FORCECLOSE_MAINWND WM_APP + 409 // [0, 0] - vynucene zavreni hlavniho okna Salamandera +#define WM_USER_FORCECLOSE_MAINWND WM_APP + 409 // [0, 0] - forced closing of the main Salamander window -#define WM_USER_INACTREFRESH_DIR WM_APP + 410 // [0, time] - zpozdeny refresh pri neaktivnim hl. okne Salamandera +#define WM_USER_INACTREFRESH_DIR WM_APP + 410 // [0, time] - delayed refresh when the main Salamander window is inactive -#define WM_USER_WAKEUP_FROM_IDLE WM_APP + 411 // [0, 0] - pokud je hlavni thread v IDLE, probere se +#define WM_USER_WAKEUP_FROM_IDLE WM_APP + 411 // [0, 0] - wakes up the main thread when it is IDLE -#define WM_USER_FINDFULLROWSEL WM_APP + 412 // [0, 0] - find okna maji nastavit sve list view, aby odpovidalo promenne Configuration.FindFullRowSelect +#define WM_USER_FINDFULLROWSEL WM_APP + 412 // [0, 0] - Find windows must set their list view to match Configuration.FindFullRowSelect -#define WM_USER_SLGINCOMPLETE WM_APP + 414 // [0, 0] - upozorneni, ze SLG neni kompletne prelozene, motivacni text aby se zapojili +#define WM_USER_SLGINCOMPLETE WM_APP + 414 // [0, 0] - notification that SLG is not fully translated; encourages contributions -#define WM_USER_USERMENUICONS_READY WM_APP + 415 // [bkgndReaderData, threadID] - notifikace pro hl. okno, ze se dokoncilo cteni ikon pro User Menu v threadu s ID 'threadID' +#define WM_USER_USERMENUICONS_READY WM_APP + 415 // [bkgndReaderData, threadID] - notification for the main window \ + // that reading icons for the User Menu has finished in the \ + // thread with ID 'threadID' // states for Shift+F1 help mode #define HELP_INACTIVE 0 // not in Shift+F1 help mode (must be 0) #define HELP_ACTIVE 1 // in Shift+F1 help mode (non-zero) #define HELP_ENTERING 2 // entering Shift+F1 help mode (non-zero) -#define STACK_CALLS_BUF_SIZE 5000 // kazdy thread bude mit 5KB prostor pro textovy call-stack -#define STACK_CALLS_MAX_MESSAGE_LEN 500 // nejdelsi zpravu uvazujeme 500 znaku +#define STACK_CALLS_BUF_SIZE 5000 // each thread will have 5KB space for the text call stack +#define STACK_CALLS_MAX_MESSAGE_LEN 500 // the longest message is assumed to be 500 characters -#define MENU_MARK_CX 9 // rozmery check mark pro menu +#define MENU_MARK_CX 9 // check mark dimensions for menus #define MENU_MARK_CY 9 -#define BOTTOMBAR_CX 17 // rozmer tlacitka v souboru bottomtb.bmp (v bodech) +#define BOTTOMBAR_CX 17 // button dimension in bottomtb.bmp (points) #define BOTTOMBAR_CY 13 -// barvy v CurrentColors[x] -#define FOCUS_ACTIVE_NORMAL 0 // barvy pera pro ramecek kolem polozky +// colors in CurrentColors[x] +#define FOCUS_ACTIVE_NORMAL 0 // pen colors for the item frame #define FOCUS_ACTIVE_SELECTED 1 #define FOCUS_FG_INACTIVE_NORMAL 2 #define FOCUS_FG_INACTIVE_SELECTED 3 #define FOCUS_BK_INACTIVE_NORMAL 4 #define FOCUS_BK_INACTIVE_SELECTED 5 -#define ITEM_FG_NORMAL 6 // barvy textu polozek v panelu +#define ITEM_FG_NORMAL 6 // text colors of items in the panel #define ITEM_FG_SELECTED 7 #define ITEM_FG_FOCUSED 8 #define ITEM_FG_FOCSEL 9 #define ITEM_FG_HIGHLIGHT 10 -#define ITEM_BK_NORMAL 11 // barvy pozadi polozek v panelu +#define ITEM_BK_NORMAL 11 // background color of panel items #define ITEM_BK_SELECTED 12 #define ITEM_BK_FOCUSED 13 #define ITEM_BK_FOCSEL 14 #define ITEM_BK_HIGHLIGHT 15 -#define ICON_BLEND_SELECTED 16 // barvy pro blend ikonek +#define ICON_BLEND_SELECTED 16 // colors for icon blending #define ICON_BLEND_FOCUSED 17 #define ICON_BLEND_FOCSEL 18 -#define PROGRESS_FG_NORMAL 19 // barvy progress bary +#define PROGRESS_FG_NORMAL 19 // progress bar colors #define PROGRESS_FG_SELECTED 20 #define PROGRESS_BK_NORMAL 21 #define PROGRESS_BK_SELECTED 22 -#define HOT_PANEL 23 // barva hot polozky v panelu -#define HOT_ACTIVE 24 // v aktivnim titulku panelu -#define HOT_INACTIVE 25 // v neaktivni tiulku panelu, statusbar,... +#define HOT_PANEL 23 // color of the hot item in the panel +#define HOT_ACTIVE 24 // in the active panel title +#define HOT_INACTIVE 25 // in the inactive panel caption, status bar, ... -#define ACTIVE_CAPTION_FG 26 // barva textu v aktivnim titulku panelu -#define ACTIVE_CAPTION_BK 27 // barva pozadi v aktivnim titulku panelu -#define INACTIVE_CAPTION_FG 28 // barva textu v neaktivnim titulku panelu -#define INACTIVE_CAPTION_BK 29 // barva pozadi v neaktivnim titulku panelu +#define ACTIVE_CAPTION_FG 26 // text color in the active panel title +#define ACTIVE_CAPTION_BK 27 // background color in the active panel title +#define INACTIVE_CAPTION_FG 28 // text color in the inactive panel title +#define INACTIVE_CAPTION_BK 29 // background color in the inactive panel caption -#define THUMBNAIL_FRAME_NORMAL 30 // barvy pera pro ramecek kolem thumbnails +#define THUMBNAIL_FRAME_NORMAL 30 // pen colors for the frame around thumbnails #define THUMBNAIL_FRAME_FOCUSED 31 #define THUMBNAIL_FRAME_SELECTED 32 #define THUMBNAIL_FRAME_FOCSEL 33 -#define VIEWER_FG_NORMAL 0 // normalni barvy viewru +#define VIEWER_FG_NORMAL 0 // normal viewer colors #define VIEWER_BK_NORMAL 1 #define VIEWER_FG_SELECTED 2 // selected text #define VIEWER_BK_SELECTED 3 -#define NUMBER_OF_COLORS 34 // pocet barev ve schematu -#define NUMBER_OF_VIEWERCOLORS 4 // pocet barev pro viewer -#define NUMBER_OF_CUSTOMCOLORS 16 // uzivatelelm definovane barvy v barevnem dialogu +#define NUMBER_OF_COLORS 34 // number of colors in the scheme +#define NUMBER_OF_VIEWERCOLORS 4 // number of colors for the viewer +#define NUMBER_OF_CUSTOMCOLORS 16 // user-defined colors in the color dialog -// interni drzak barvy, ktery navic obsahuje flag +// internal color holder with an extra flag typedef DWORD SALCOLOR; // SALCOLOR flags -#define SCF_DEFAULT 0x01 // barevna slozka se ignoruje a pouzije se default hodnota +#define SCF_DEFAULT 0x01 // the color component is ignored and the default value is used #define GetCOLORREF(rgbf) ((COLORREF)rgbf & 0x00ffffff) #define RGBF(r, g, b, f) ((COLORREF)(((BYTE)(r) | ((WORD)((BYTE)(g)) << 8)) | (((DWORD)(BYTE)(b)) << 16) | (((DWORD)(BYTE)(f)) << 24))) @@ -1263,34 +1291,34 @@ inline void SetRGBPart(SALCOLOR* salColor, COLORREF rgb) *salColor = rgb & 0x00ffffff | (((DWORD)(BYTE)((BYTE)((*salColor) >> 24))) << 24); } -extern SALCOLOR* CurrentColors; // aktualni barvy -extern SALCOLOR UserColors[NUMBER_OF_COLORS]; // zmenene barvy +extern SALCOLOR* CurrentColors; // current colors +extern SALCOLOR UserColors[NUMBER_OF_COLORS]; // modified colors -extern SALCOLOR SalamanderColors[NUMBER_OF_COLORS]; // standardni barvy -extern SALCOLOR ExplorerColors[NUMBER_OF_COLORS]; // standardni barvy -extern SALCOLOR NortonColors[NUMBER_OF_COLORS]; // standardni barvy -extern SALCOLOR NavigatorColors[NUMBER_OF_COLORS]; // standardni barvy +extern SALCOLOR SalamanderColors[NUMBER_OF_COLORS]; // standard colors +extern SALCOLOR ExplorerColors[NUMBER_OF_COLORS]; // standard colors +extern SALCOLOR NortonColors[NUMBER_OF_COLORS]; // standard colors +extern SALCOLOR NavigatorColors[NUMBER_OF_COLORS]; // standard colors -extern SALCOLOR ViewerColors[NUMBER_OF_VIEWERCOLORS]; // barvy vieweru +extern SALCOLOR ViewerColors[NUMBER_OF_VIEWERCOLORS]; // viewer colors -extern COLORREF CustomColors[NUMBER_OF_CUSTOMCOLORS]; // pro standardni color dialog +extern COLORREF CustomColors[NUMBER_OF_CUSTOMCOLORS]; // for the standard color dialog #define CARET_WIDTH 2 -#define MIN_PANELWIDTH 5 // uzsi panel nedostava focus +#define MIN_PANELWIDTH 5 // a narrower panel does not receive focus -#define REFRESH_PAUSE 200 // pauza mezi dvema nejblizsimi refreshi +#define REFRESH_PAUSE 200 // pause between the two nearest refreshes -extern int SPACE_WIDTH; // mezera mezi sloupcema v detailed view +extern int SPACE_WIDTH; // spacing between columns in detailed view -#define MENU_CHECK_WIDTH 8 // rozmery check bitmap pro menu +#define MENU_CHECK_WIDTH 8 // dimensions of the check bitmap for menus #define MENU_CHECK_HEIGHT 8 -// pocty pamatovanych stringu +// numbers of remembered strings #define SELECT_HISTORY_SIZE 20 // select / unselect #define COPY_HISTORY_SIZE 20 // copy / move #define EDIT_HISTORY_SIZE 30 // command line #define CHANGEDIR_HISTORY_SIZE 20 // Shift+F7 -#define PATH_HISTORY_SIZE 30 // forward/backward historie cest + historie navstivenych cest (Alt+F12) +#define PATH_HISTORY_SIZE 30 // forward/backward path history + visited paths history (Alt+F12) #define FILTER_HISTORY_SIZE 15 // filter #define FILELIST_HISTORY_SIZE 15 #define CREATEDIR_HISTORY_SIZE 20 // create directory @@ -1302,10 +1330,10 @@ extern int SPACE_WIDTH; // mezera mezi sloupcema v detailed view #define VK_BACKSLASH 220 #define VK_RBRACKET 221 -// kdy testovat pokus o preruseni stavby scriptu -#define BS_TIMEOUT 200 // milisekund od posledniho testu +// when to test for an attempt to interrupt script building +#define BS_TIMEOUT 200 // milliseconds since the last test -// identifikace bandu v rebaru +// band identifiers in the rebar #define BANDID_MENU 1 #define BANDID_TOPTOOLBAR 2 #define BANDID_UMTOOLBAR 3 @@ -1318,33 +1346,33 @@ extern int SPACE_WIDTH; // mezera mezi sloupcema v detailed view #define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp)) #define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp)) -// urcuji duvod, proc jsou v panelu neobsazeny nektere soubory/adresare -#define HIDDEN_REASON_ATTRIBUTE 0x00000001 // maji atribut hidden nebo system a v konfiguraci je potlaceni zobrazovani takovych souboru/adresaru -#define HIDDEN_REASON_FILTER 0x00000002 // soubor je odfiltrovan na zaklade filtru v panelu -#define HIDDEN_REASON_HIDECMD 0x00000004 // jmeno bylo skryto prikazem Hide Selected/Unselected Names +// reasons why some files/directories are not shown in the panel +#define HIDDEN_REASON_ATTRIBUTE 0x00000001 // have the hidden or system attribute and configuration suppresses such files/directories +#define HIDDEN_REASON_FILTER 0x00000002 // file is filtered out based on the panel filter +#define HIDDEN_REASON_HIDECMD 0x00000004 // name was hidden using Hide Selected/Unselected Names -// bitove pole drivu 'a' .. 'z' +// bit field of drive letters 'a' .. 'z' #define DRIVES_MASK 0x03FFFFFF // // **************************************************************************** // Windows XP, Windows 2003.NET, Vista, Windows 7, Windows 8, Windows 8.1, Windows 10 -extern BOOL WindowsXP64AndLater; // Windows XP64 nebo pozdejsi -extern BOOL WindowsVistaAndLater; // Windows Vista nebo pozdejsi -extern BOOL Windows7AndLater; // Windows 7 nebo pozdejsi -extern BOOL Windows8AndLater; // Windows 8 nebo pozdejsi -extern BOOL Windows8_1AndLater; // Windows 8.1 nebo pozdejsi -extern BOOL Windows10AndLater; // Windows 10 nebo pozdejsi +extern BOOL WindowsXP64AndLater; // Windows XP64 or later +extern BOOL WindowsVistaAndLater; // Windows Vista or later +extern BOOL Windows7AndLater; // Windows 7 or later +extern BOOL Windows8AndLater; // Windows 8 or later +extern BOOL Windows8_1AndLater; // Windows 8.1 or later +extern BOOL Windows10AndLater; // Windows 10 or later -extern BOOL Windows64Bit; // x64 verze Windows +extern BOOL Windows64Bit; // x64 version of Windows -extern BOOL RunningAsAdmin; // TRUE pokud Salamander bezi "As Administrator" +extern BOOL RunningAsAdmin; // TRUE when Salamander runs "As Administrator" -extern DWORD CCVerMajor; // verze DLL common controls +extern DWORD CCVerMajor; // version of the common controls DLL extern DWORD CCVerMinor; -extern const char* SALAMANDER_TEXT_VERSION; // textove oznaceni aplikace vcetne verze +extern const char* SALAMANDER_TEXT_VERSION; // textual application label including the version extern const char *LOW_MEMORY, *MAINWINDOW_NAME, @@ -1353,56 +1381,56 @@ extern const char *LOW_MEMORY, *SAVEBITS_CLASSNAME, *SHELLEXECUTE_CLASSNAME; -extern const char* STR_NONE; // "(none)" - plug-iny: pro DLLName a Version pokud jsou nezjistitelne +extern const char* STR_NONE; // "(none)" - plugins: used for DLLName and Version when they cannot be determined -extern char DefaultDir['z' - 'a' + 1][MAX_PATH]; // kam jit pri zmene disku +extern char DefaultDir['z' - 'a' + 1][MAX_PATH]; // target path when changing drives -extern int MyTimeCounter; // po kazdem pouziti inkrementovat ! -extern CRITICAL_SECTION TimeCounterSection; // pro synchronizaci pristupu k ^ +extern int MyTimeCounter; // increment after each use! +extern CRITICAL_SECTION TimeCounterSection; // used to synchronize access to the above -extern HINSTANCE NtDLL; // handle k ntdll.dll -extern HINSTANCE Shell32DLL; // handle k shell32.dll (ikonky) -extern HINSTANCE ImageResDLL; // handle k imageres.dll (ikonky - Vista+) -extern HINSTANCE User32DLL; // handle k user32.dll (DisableProcessWindowsGhosting) -extern HINSTANCE HLanguage; // handle k jazykove zavislym resourcum (cesta: Configuration.LoadedSLGName) -extern char CurrentHelpDir[MAX_PATH]; // po prvnim pouziti helpu je zde cesta do adresare helpu (umisteni vsech .chm souboru) -extern WORD LanguageID; // language-id jazykove zavislych resourcu (.SLG souboru) +extern HINSTANCE NtDLL; // handle to ntdll.dll +extern HINSTANCE Shell32DLL; // handle to shell32.dll (icons) +extern HINSTANCE ImageResDLL; // handle to imageres.dll (icons - Vista+) +extern HINSTANCE User32DLL; // handle to user32.dll (DisableProcessWindowsGhosting) +extern HINSTANCE HLanguage; // handle to language-specific resources (path: Configuration.LoadedSLGName) +extern char CurrentHelpDir[MAX_PATH]; // after the first use of help this holds the path to the help directory (location of all .chm files) +extern WORD LanguageID; // language ID of the language-specific resources (.SLG file) -extern BOOL UseCustomPanelFont; // pokud je TRUE, vychazi Font a FontUL ze struktury LogFont; jinak ze systemoveho fontu (default) +extern BOOL UseCustomPanelFont; // if TRUE, Font and FontUL are based on LogFont; otherwise on the system font (default) extern HFONT Font; // panel font -extern HFONT FontUL; // podtrzena verze -extern int FontCharHeight; // vyska fontu -extern LOGFONT LogFont; // struktura popisujici panel font +extern HFONT FontUL; // underlined version +extern int FontCharHeight; // font height +extern LOGFONT LogFont; // structure describing the panel font -BOOL CreatePanelFont(); // naplni Font, FontULa FontCharHeight na zaklade LogFont +BOOL CreatePanelFont(); // fills Font, FontUL and FontCharHeight based on LogFont -extern HFONT EnvFont; // font prostredi (edit, toolbar, header, status) -extern HFONT EnvFontUL; // font listboxu podtrzeny -extern int EnvFontCharHeight; // vyska fontu -extern HFONT TooltipFont; // font pro tooltips (a statusbars, ale tam ho nepouzivame) +extern HFONT EnvFont; // environment font (edit, toolbar, header, status) +extern HFONT EnvFontUL; // underlined list box font +extern int EnvFontCharHeight; // font height +extern HFONT TooltipFont; // font for tooltips (and status bars, although we don't use it there) -BOOL GetSystemGUIFont(LOGFONT* lf); // vrati font pouzivany pro hlavni okno Salamandera -BOOL CreateEnvFonts(); // naplni EnvFont, EnvFontUL, EnvFontCharHeight, TooltipFont na zaklade metrics +BOOL GetSystemGUIFont(LOGFONT* lf); // returns the font used for the main Salamander window +BOOL CreateEnvFonts(); // fills EnvFont, EnvFontUL, EnvFontCharHeight and TooltipFont based on system metrics -extern DWORD MouseHoverTime; // po jake dobe ma dojit k vysviceni +extern DWORD MouseHoverTime; // how long before highlighting occurs -extern HBRUSH HNormalBkBrush; // pozadi obycejne polozky v panelu -extern HBRUSH HFocusedBkBrush; // pozadi focusle polozky v panelu -extern HBRUSH HSelectedBkBrush; // pozadi selected polozky v panelu -extern HBRUSH HFocSelBkBrush; // pozadi focused & selected polozky v panelu -extern HBRUSH HDialogBrush; // vypln pozadi dialogu -extern HBRUSH HButtonTextBrush; // text tlacitek -extern HBRUSH HDitherBrush; // sachovnice o barevne hloubce 1 bit; pri kresleni lze barvu nastavit pres SetTextColor/SetBkColor -extern HBRUSH HActiveCaptionBrush; // pozadi aktivniho tiutlku panelu -extern HBRUSH HInactiveCaptionBrush; // pozadi neaktivniho tiutlku panelu +extern HBRUSH HNormalBkBrush; // background of a regular panel item +extern HBRUSH HFocusedBkBrush; // background of the focused panel item +extern HBRUSH HSelectedBkBrush; // background of the selected panel item +extern HBRUSH HFocSelBkBrush; // background of a focused and selected item +extern HBRUSH HDialogBrush; // dialog background fill +extern HBRUSH HButtonTextBrush; // button text +extern HBRUSH HDitherBrush; // 1-bit checkerboard; the color can be set via SetTextColor/SetBkColor +extern HBRUSH HActiveCaptionBrush; // background of the active panel title +extern HBRUSH HInactiveCaptionBrush; // background of the inactive panel title extern HBRUSH HMenuSelectedBkBrush; extern HBRUSH HMenuSelectedTextBrush; extern HBRUSH HMenuHilightBrush; extern HBRUSH HMenuGrayTextBrush; -extern HACCEL AccelTable1; // akceleratory v panelech a cmdline -extern HACCEL AccelTable2; // akceleratory v cmdline +extern HACCEL AccelTable1; // accelerators in panels and the command line +extern HACCEL AccelTable2; // accelerators in the command line extern int SystemDPI; @@ -1411,61 +1439,61 @@ enum CIconSizeEnum ICONSIZE_16, // 16x16 @ 100%DPI, 20x20 @ 125%DPI, 24x24 @ 150%DPI, ... ICONSIZE_32, // 32x32 @ 100%DPI, ... ICONSIZE_48, // 48x48 @ 100%DPI, ... - ICONSIZE_COUNT // items count + ICONSIZE_COUNT // item count }; -extern int IconSizes[ICONSIZE_COUNT]; // velikosti ikonek: 16, 32, 48 -extern int IconLRFlags; // ridi barevnou hloubku nacitanych ikon +extern int IconSizes[ICONSIZE_COUNT]; // icon sizes: 16, 32, 48 +extern int IconLRFlags; // controls the color depth of loaded icons -// POZOR: na Viste se pouziva pro ikony 48x48 overlay ICONSIZE_32 a pro thumbnaily overlay ICONSIZE_48 -extern HICON HSharedOverlays[ICONSIZE_COUNT]; // shared (ruka) ve vsech velikostech -extern HICON HShortcutOverlays[ICONSIZE_COUNT]; // shortcut (levy dolni roh) ve vsech velikostech -extern HICON HSlowFileOverlays[ICONSIZE_COUNT]; // slow files +// NOTE: on Vista a 48x48 icon uses overlay ICONSIZE_32 and thumbnails use overlay ICONSIZE_48 +extern HICON HSharedOverlays[ICONSIZE_COUNT]; // shared (hand) overlay in all sizes +extern HICON HShortcutOverlays[ICONSIZE_COUNT]; // shortcut (lower left corner) overlay in all sizes +extern HICON HSlowFileOverlays[ICONSIZE_COUNT]; // slow file overlays -extern CIconList* SimpleIconLists[ICONSIZE_COUNT]; // simple icons ve vsech velikostech +extern CIconList* SimpleIconLists[ICONSIZE_COUNT]; // simple icons in all sizes -#define THROBBER_WIDTH 12 // rozmery jednoho policka +#define THROBBER_WIDTH 12 // dimensions of one frame #define THROBBER_HEIGHT 12 -#define THROBBER_COUNT 36 // celkovy pocet policek -#define IDT_THROBBER_DELAY 30 // delay [ms] v animaci jednoho policka +#define THROBBER_COUNT 36 // total number of frames +#define IDT_THROBBER_DELAY 30 // delay [ms] for one frame of the animation extern CIconList* ThrobberFrames; -#define LOCK_WIDTH 8 // rozmery jednoho policka +#define LOCK_WIDTH 8 // size of one frame #define LOCK_HEIGHT 13 extern CIconList* LockFrames; -extern HICON HGroupIcon; // skupina pro UserMenu popupy -extern HICON HFavoritIcon; // hot path +extern HICON HGroupIcon; // group icon for UserMenu pop-ups +extern HICON HFavoritIcon; // hot path icon -#define TILE_LEFT_MARGIN 4 // pocet bodu vlevo pred ikonkou +#define TILE_LEFT_MARGIN 4 // number of pixels to the left of the icon -extern RGBQUAD ColorTable[256]; // paleta pouzivana pro vsechny toolbary (vcetne pluginu) +extern RGBQUAD ColorTable[256]; // palette used for all toolbars (including plugins) -// jednotlive pozice imagelistu SymbolsImageList a LargeSymbolsImageList +// individual indices in the SymbolsImageList and LargeSymbolsImageList image lists enum CSymbolsImageListIndexes { symbolsExecutable, // 0: exe/bat/pif/com symbolsDirectory, // 1: dir - symbolsNonAssociated, // 2: neasociovany soubor - symbolsAssociated, // 3: asociovany soubor + symbolsNonAssociated, // 2: unassociated file + symbolsAssociated, // 3: associated file symbolsUpDir, // 4: up-dir ".." - symbolsArchive, // 5: archiv + symbolsArchive, // 5: archive symbolsCount // TERMINATOR }; -extern HIMAGELIST HFindSymbolsImageList; // symboly pro find -extern HIMAGELIST HMenuMarkImageList; // check marky pro menu -extern HIMAGELIST HGrayToolBarImageList; // toolbar a menu v sedivem provedeni (pocitano z barevneho) -extern HIMAGELIST HHotToolBarImageList; // toolbar a menu v barevnem provedeni +extern HIMAGELIST HFindSymbolsImageList; // symbols for Find +extern HIMAGELIST HMenuMarkImageList; // check marks for menus +extern HIMAGELIST HGrayToolBarImageList; // toolbar and menu in a gray variant (generated from the colored one) +extern HIMAGELIST HHotToolBarImageList; // toolbar and menu in color extern HIMAGELIST HBottomTBImageList; // bottom toolbar (F1 - F12) extern HIMAGELIST HHotBottomTBImageList; // bottom toolbar (F1 - F12) -extern HPEN HActiveNormalPen; // pera pro ramecek kolem polozky +extern HPEN HActiveNormalPen; // pens for the rectangle around an item extern HPEN HActiveSelectedPen; extern HPEN HInactiveNormalPen; extern HPEN HInactiveSelectedPen; -extern HPEN HThumbnailNormalPen; // pera pro ramecek kolem thumbnail +extern HPEN HThumbnailNormalPen; // pens for the rectangle around a thumbnail extern HPEN HThumbnailFucsedPen; extern HPEN HThumbnailSelectedPen; extern HPEN HThumbnailFocSelPen; @@ -1477,32 +1505,32 @@ extern HPEN BtnFacePen; extern HPEN WndFramePen; extern HPEN WndPen; -extern HBITMAP HFilter; // bitmapa - panel skryva nejake soubory nebo adresare +extern HBITMAP HFilter; // bitmap - the panel hides some files or directories -extern HBITMAP HHeaderSort; // sipky pro HeaderLine +extern HBITMAP HHeaderSort; // arrows for HeaderLine -extern CBitmap ItemBitmap; // devecka pro vsechno mozne: kresleni polozek v panelu, header line, ... +extern CBitmap ItemBitmap; // helper for various things: drawing items in the panel, header line, etc. -extern HBITMAP HUpDownBitmap; // Sipky pro rolovani uvnitr kratkych popup menu. -extern HBITMAP HZoomBitmap; // Zoom panelu +extern HBITMAP HUpDownBitmap; // arrows for scrolling inside short popup menus +extern HBITMAP HZoomBitmap; // panel zoom bitmap //extern HBITMAP HWorkerBitmap; -extern HCURSOR HHelpCursor; // Context Help cursor - loadi se az kdyz je potreba +extern HCURSOR HHelpCursor; // context help cursor - loaded only when needed -#define THUMBNAIL_SIZE_DEFAULT 94 // podle XP -#define THUMBNAIL_SIZE_MIN 48 // pokud budeme chtit podpori mensi nez 48, je potreba zobrazovat mensi ikony +#define THUMBNAIL_SIZE_DEFAULT 94 // according to Windows XP +#define THUMBNAIL_SIZE_MIN 48 // to support less than 48 we would need to show smaller icons #define THUMBNAIL_SIZE_MAX 1000 -extern BOOL DragFullWindows; // pokud je TRUE, mame menit velikost panelu realtime, jinak az po releasu (optimalizace pro remote desktop) +extern BOOL DragFullWindows; // if TRUE the panel is resized in real time, otherwise only after release (optimization for remote desktop) -// CConfiguration::SizeFormat (format sloupce Size v panelech) -// !POZOR! nemenit konstanty, jsou vyvezene do pluginu pres SALCFG_SIZEFORMAT -#define SIZE_FORMAT_BYTES 0 // v bajtech (Open Salamander) -#define SIZE_FORMAT_KB 1 // v KB (Windows Explorer) -#define SIZE_FORMAT_MIXED 2 // bajty, KB, MB, GB, ... +// CConfiguration::SizeFormat (the Size column format in panels) +// WARNING! Do not change the constants; they are exported to plugins via SALCFG_SIZEFORMAT +#define SIZE_FORMAT_BYTES 0 // in bytes (Open Salamander) +#define SIZE_FORMAT_KB 1 // in KB (Windows Explorer) +#define SIZE_FORMAT_MIXED 2 // bytes, KB, MB, GB, ... -// jmena klicu v registry +// names of registry keys extern const char* SALAMANDER_ROOT_REG; extern const char* SALAMANDER_SAVE_IN_PROGRESS; extern const char* SALAMANDER_COPY_IS_OK; @@ -1562,8 +1590,9 @@ extern const char* SALAMANDER_PLUGINSORDER_SHOW; extern const char* SALAMANDER_PLUGINS_ISNETHOOD; extern const char* SALAMANDER_PLUGINS_USESPASSWDMAN; -// nasledujicich 8 retezcu je jen pro load konfigu verze 6 a nizsi, novejsi verze -// jiz pouzivaji SALAMANDER_PLUGINS_FUNCTIONS (ulozeni v bitech DWORDove masky funkci) +// the following eight strings are only for loading configuration version 6 and +// older; newer versions already use SALAMANDER_PLUGINS_FUNCTIONS (stored in bits +// of a DWORD mask of functions) extern const char* SALAMANDER_PLUGINS_PANELVIEW; extern const char* SALAMANDER_PLUGINS_PANELEDIT; extern const char* SALAMANDER_PLUGINS_CUSTPACK; @@ -1573,62 +1602,68 @@ extern const char* SALAMANDER_PLUGINS_LOADSAVE; extern const char* SALAMANDER_PLUGINS_VIEWER; extern const char* SALAMANDER_PLUGINS_FS; -// clipboard format pro SalIDataObject (znacka naseho IDataObjectu na clipboardu) +// clipboard format for SalIDataObject (marks our IDataObject on the clipboard) extern const char* SALCF_IDATAOBJECT; -// clipboard format pro CFakeDragDropDataObject (urcuje cestu, ktera se ma po dropu objevit -// v directory-line, command-line + blokuje drop do usermenu-toolbar); pokud je tazeno -// vic adresaru/souboru, je cesta prazdny retezec (drop do directory/command-line neni mozny) +// clipboard format for CFakeDragDropDataObject specifying the path that should +// appear after drop in the directory line or command line and blocking drop to +// the user menu toolbar; if multiple folders/files are dragged the path is an +// empty string (drop to directory/command line is not possible) extern const char* SALCF_FAKE_REALPATH; -// clipboard format pro CFakeDragDropDataObject (urcuje typ zdroje - 1=archiv, 2=FS) +// clipboard format for CFakeDragDropDataObject specifying the source type +// (1=archive, 2=FS) extern const char* SALCF_FAKE_SRCTYPE; -// clipboard format pro CFakeDragDropDataObject (jen je-li zdroj FS: zdrojova FS cesta) +// clipboard format for CFakeDragDropDataObject (only when the source is FS: +// source FS path) extern const char* SALCF_FAKE_SRCFSPATH; -// promenne pro CanChangeDirectory() a AllowChangeDirectory() -extern int ChangeDirectoryAllowed; // 0 znamena, ze je mozne menit adresar +// variables for CanChangeDirectory() and AllowChangeDirectory() +extern int ChangeDirectoryAllowed; // 0 means the directory can be changed extern BOOL ChangeDirectoryRequest; -// funkce obsluhujici automatickou zmenu aktualniho adresare na systemovy -// - kvuli odmapovavani z jinych softu a mazani adresaru zobrazenych Salamandrem +// function handling the automatic switch of the current directory to the system +// one-used when other software unmaps drives or deletes directories shown by +// Salamander BOOL CanChangeDirectory(); void AllowChangeDirectory(BOOL allow); -// promenna pro BeginStopRefresh() a EndStopRefresh() +// variable for BeginStopRefresh() and EndStopRefresh() extern int StopRefresh; -// po volani se neprovede zadny refresh adresare +// after calling no directory refresh will occur void BeginStopRefresh(BOOL debugSkipOneCaller = FALSE, BOOL debugDoNotTestCaller = FALSE); -// uvolni refreshovani -> pripadne posle WM_USER_SM_END_NOTIFY hlavnimu oknu (probehnou promeskane refreshe) +// releases refreshing -> possibly posts WM_USER_SM_END_NOTIFY to the main window +// so missed refreshes are processed void EndStopRefresh(BOOL postRefresh = TRUE, BOOL debugSkipOneCaller = FALSE, BOOL debugDoNotTestCaller = FALSE); -// promenna kontrolovana v hl. message-loope v "idle" casti, je-li TRUE, vyhleda a unloadne -// plug-iny s ShouldUnload==TRUE, rebuildne menu pluginum s ShouldRebuildMenu==TRUE + spusti -// prikazy postnute z pluginu + pozadovane prikazy Salamandera +// variable checked in the main message loop during the "idle" part; if TRUE, it unloads +// plugins with ShouldUnload==TRUE, rebuilds menus for plugins with ShouldRebuildMenu==TRUE, +// and runs commands posted from plugins plus requested Salamander commands extern BOOL ExecCmdsOrUnloadMarkedPlugins; -// promenna kontrolovana v hl. message-loope v "idle" casti, je-li TRUE, otevre Pack/Unpack -// dialog pro pluginy s OpenPackDlg==TRUE nebo OpenUnpackDlg==TRUE +// variable checked in the main message loop during the "idle" part; if TRUE, it opens the Pack/Unpack +// dialog for plugins with OpenPackDlg==TRUE or OpenUnpackDlg==TRUE extern BOOL OpenPackOrUnpackDlgForMarkedPlugins; -// promenna pro BeginStopIconRepaint() a EndStopIconRepaint() +// variable for BeginStopIconRepaint() and EndStopIconRepaint() extern int StopIconRepaint; extern BOOL PostAllIconsRepaint; -// po volani se neprovede zadny refresh ikony v panelech +// after calling no icon refresh in the panels takes place void BeginStopIconRepaint(); -// uvolni repaint -> pripadne posle WM_USER_REPAINTALLICONS hlavnimu oknu (obnova vsech ikon) +// releases repaint -> optionally posts WM_USER_REPAINTALLICONS to the main +// window (refresh of all icons) void EndStopIconRepaint(BOOL postRepaint = TRUE); -// promenna pro BeginStopStatusbarRepaint() a EndStopStatusbarRepaint() +// variable for BeginStopStatusbarRepaint() and EndStopStatusbarRepaint() extern int StopStatusbarRepaint; extern BOOL PostStatusbarRepaint; -// po volani se prestane prekreslovat throbber +// after calling the throbber stops repainting void BeginStopStatusbarRepaint(); -// uvolni repaint +// resumes repainting void EndStopStatusbarRepaint(); -// v modulu msgbox.cpp - centrovany messagebox podle pra parenta od hParent +// in module msgbox.cpp - center the message box according to the parent specified by hParent int SalMessageBox(HWND hParent, LPCTSTR lpText, LPCTSTR lpCaption, UINT uType); int SalMessageBoxEx(const MSGBOXEX_PARAMS* params); -// vykresli ikonky z imagelistu s nastavenyma stylama +// draws icons from the image list with the specified styles #define IMAGE_STATE_FOCUSED 0x00000001 #define IMAGE_STATE_SELECTED 0x00000002 #define IMAGE_STATE_HIDDEN 0x00000004 @@ -1640,79 +1675,81 @@ BOOL StateImageList_Draw(CIconList* iconList, int imageIndex, HDC hDC, int xDst, DWORD state, CIconSizeEnum iconSize, DWORD iconOverlayIndex, const RECT* overlayRect, BOOL overlayOnly, BOOL iconOverlayFromPlugin, int pluginIconOverlaysCount, HICON* pluginIconOverlays); -DWORD GetImageListColorFlags(); // vrati ILC_COLOR??? podle verzi Windows - odladene pro pouziti imagelistu v listviewech +DWORD GetImageListColorFlags(); // returns the ILC_COLOR flag suitable for the current Windows version when using image lists in list views -// API GetOpenFileName/GetSaveFileName v pripade ze cesta k souboru (OPENFILENAME::lpstrFile) -// neexistuje (nebo obsahuje napriklad C:\) vrati FALSE a CommDlgExtendedError() == FNERR_INVALIDFILENAME. -// Proto zavadime jejich "bezpecnou" variantu, ktera tento pripad detekuje a pokusi se otevrit -// dialog pro Documents nebo Desktop. +// The GetOpenFileName/GetSaveFileName APIs return FALSE and set +// CommDlgExtendedError() to FNERR_INVALIDFILENAME when the file path in +// OPENFILENAME::lpstrFile does not exist (or contains e.g. C:\). To handle this +// case we introduce "safe" versions that detect the problem and try to open the +// dialog for Documents or Desktop instead. BOOL SafeGetOpenFileName(LPOPENFILENAME lpofn); BOOL SafeGetSaveFileName(LPOPENFILENAME lpofn); -extern char DecimalSeparator[5]; // "znaky" (max. 4 znaky) vytazene ze systemu -extern int DecimalSeparatorLen; // delka ve znacich bez nuly na konci +extern char DecimalSeparator[5]; // characters (max. 4) obtained from the system +extern int DecimalSeparatorLen; // length in characters without the terminating zero extern char ThousandsSeparator[5]; extern int ThousandsSeparatorLen; -extern DWORD SalamanderStartTime; // cas startu Salamandera (GetTickCount) -extern DWORD SalamanderExceptionTime; // cas exceptiony v Salamanderu (GetTickCount) nebo cas posledniho vyvolani Bug Report dialogu +extern DWORD SalamanderStartTime; // Salamander start time (GetTickCount) +extern DWORD SalamanderExceptionTime; // time of the exception in Salamander (GetTickCount) or the last Bug Report dialog time -extern BOOL SkipOneActivateRefresh; // ma se preskocit refresh pri aktivaci hl. okna? (pro interni viewry) +extern BOOL SkipOneActivateRefresh; // should refresh be skipped when the main window is activated? (for internal viewers) -extern int MenuNewExceptionHasOccured; // spadlo uz menu New? (mozna prepsalo nekde pamet) -extern int FGIExceptionHasOccured; // spadlo uz SHGetFileInfo? -extern int ICExceptionHasOccured; // spadlo uz InvokeCommand? -extern int QCMExceptionHasOccured; // spadlo uz QueryContextMenu? -extern int OCUExceptionHasOccured; // spadlo uz OleUninitialize nebo CoUninitialize? -extern int GTDExceptionHasOccured; // spadlo uz GetTargetDirectory? -extern int SHLExceptionHasOccured; // spadlo uz neco z ShellLib? -extern int RelExceptionHasOccured; // spadlo uz nejaky volani IUnknown metody Release()? +extern int MenuNewExceptionHasOccured; // has the New menu crashed already? (maybe overwrote memory somewhere) +extern int FGIExceptionHasOccured; // has SHGetFileInfo crashed? +extern int ICExceptionHasOccured; // has InvokeCommand crashed? +extern int QCMExceptionHasOccured; // has QueryContextMenu crashed? +extern int OCUExceptionHasOccured; // has OleUninitialize or CoUninitialize crashed? +extern int GTDExceptionHasOccured; // has GetTargetDirectory crashed? +extern int SHLExceptionHasOccured; // has something from ShellLib crashed? +extern int RelExceptionHasOccured; // has any IUnknown::Release() call crashed? -extern BOOL SalamanderBusy; // je Salamander busy? -extern DWORD LastSalamanderIdleTime; // GetTickCount() z okamziku, kdy SalamanderBusy naposledy presel na TRUE +extern BOOL SalamanderBusy; // is Salamander busy? +extern DWORD LastSalamanderIdleTime; // GetTickCount() from the moment SalamanderBusy last changed to TRUE -extern int PasteLinkIsRunning; // pokud je vetsi nez nula, probiha prave Past Shortcuts prikaz v jednom z panelu +extern int PasteLinkIsRunning; // when greater than zero a Paste Shortcuts command is in progress in one of the panels -extern BOOL CannotCloseSalMainWnd; // TRUE = nesmi dojit k zavreni hlavniho okna +extern BOOL CannotCloseSalMainWnd; // TRUE = the main window must not be closed -extern const char* DirColumnStr; // LoadStr(IDS_DIRCOLUMN) - pouziva se prilis casto, cachujeme -extern int DirColumnStrLen; // delka retezce -extern const char* ColExtStr; // LoadStr(IDS_COLUMN_NAME_EXT) - pouziva se prilis casto, cachujeme -extern int ColExtStrLen; // delka retezce -extern int TextEllipsisWidth; // sirka retezce "..." zobrazenho fontem 'Font' -extern int TextEllipsisWidthEnv; // sirka retezce "..." zobrazenho fontem 'FontEnv' -extern const char* ProgDlgHoursStr; // LoadStr(IDS_PROGDLGHOURS) - pouziva se prilis casto, cachujeme -extern const char* ProgDlgMinutesStr; // LoadStr(IDS_PROGDLGMINUTES) - pouziva se prilis casto, cachujeme -extern const char* ProgDlgSecsStr; // LoadStr(IDS_PROGDLGSECS) - pouziva se prilis casto, cachujeme +extern const char* DirColumnStr; // LoadStr(IDS_DIRCOLUMN) - used very often, cached +extern int DirColumnStrLen; // string length +extern const char* ColExtStr; // LoadStr(IDS_COLUMN_NAME_EXT) - used very often, cached +extern int ColExtStrLen; // string length +extern int TextEllipsisWidth; // width of "..." drawn with font 'Font' +extern int TextEllipsisWidthEnv; // width of "..." drawn with font 'FontEnv' +extern const char* ProgDlgHoursStr; // LoadStr(IDS_PROGDLGHOURS) - used very often, cached +extern const char* ProgDlgMinutesStr; // LoadStr(IDS_PROGDLGMINUTES) - used very often, cached +extern const char* ProgDlgSecsStr; // LoadStr(IDS_PROGDLGSECS) - used very often, cached -extern char FolderTypeName[80]; // file-type pro vsechny adresare (ziskany ze systemoveho adresare) -extern int FolderTypeNameLen; // delka retezce FolderTypeName -extern const char* UpDirTypeName; // LoadStr(IDS_UPDIRTYPENAME) - pouziva se prilis casto, cachujeme -extern int UpDirTypeNameLen; // delka retezce -extern const char* CommonFileTypeName; // LoadStr(IDS_COMMONFILETYPE) - pouziva se prilis casto, cachujeme -extern int CommonFileTypeNameLen; // delka retezce CommonFileTypeName -extern const char* CommonFileTypeName2; // LoadStr(IDS_COMMONFILETYPE2) - pouziva se prilis casto, cachujeme +extern char FolderTypeName[80]; // file type for all directories (obtained from the system directory) +extern int FolderTypeNameLen; // length of FolderTypeName +extern const char* UpDirTypeName; // LoadStr(IDS_UPDIRTYPENAME) - used very often, cached +extern int UpDirTypeNameLen; // string length +extern const char* CommonFileTypeName; // LoadStr(IDS_COMMONFILETYPE) - used very often, cached +extern int CommonFileTypeNameLen; // length of CommonFileTypeName +extern const char* CommonFileTypeName2; // LoadStr(IDS_COMMONFILETYPE2) - used very often, cached -extern char WindowsDirectory[MAX_PATH]; // cachovany vysledek GetWindowsDirectory +extern char WindowsDirectory[MAX_PATH]; // cached result of GetWindowsDirectory //#ifdef MSVC_RUNTIME_CHECKS -#define RTC_ERROR_DESCRIPTION_SIZE 2000 // buffer pro popis run-time check chyby +#define RTC_ERROR_DESCRIPTION_SIZE 2000 // buffer for the run-time check error description extern char RTCErrorDescription[RTC_ERROR_DESCRIPTION_SIZE]; //#endif // MSVC_RUNTIME_CHECKS -// cesta, kde vytvorime bug report a minidump, umisteni: do Visty u salamand.exe, ve Viste (a dale) v CSIDL_APPDATA + "\\Open Salamander" +// path where we create the bug report and minidump: before Vista next to +// salamand.exe, in Vista and later in CSIDL_APPDATA + "\\Open Salamander" extern char BugReportPath[MAX_PATH]; -// nazev souboru, ktery bude importovan (pokud existuje) do registry +// name of the file that will be imported into the registry if it exists extern char ConfigurationName[MAX_PATH]; extern BOOL ConfigurationNameIgnoreIfNotExists; -extern HWND PluginProgressDialog; // pokud si plug-in otevre progress dialog, je zde jeho HWND, jinak NULL -extern HWND PluginMsgBoxParent; // parent pro messageboxy plug-inu (hlavni okno, Plugins dialog, atd.) +extern HWND PluginProgressDialog; // if a plugin opens a progress dialog this is its HWND, otherwise NULL +extern HWND PluginMsgBoxParent; // parent for plugin message boxes (main window, Plugins dialog, etc.) -extern BOOL CriticalShutdown; // TRUE = probiha "critical shutdown", neni cas se ptat, rychle koncime, 5s do zabiti +extern BOOL CriticalShutdown; // TRUE = "critical shutdown" in progress; no time to ask, exiting quickly, 5s until kill -// "preklad" POSIX jmena na MS +// "translation" of POSIX names to MS #define itoa _itoa #define stricmp _stricmp #define strnicmp _strnicmp @@ -1722,11 +1759,11 @@ extern BOOL CriticalShutdown; // TRUE = probiha "critical shutdown", neni cas se #define SKILL_LEVEL_INTERMEDIATE 1 #define SKILL_LEVEL_ADVANCED 2 -// konvertuje promennou CConfiguration::SkillLevel do SkillLevel pro menu. +// converts the CConfiguration::SkillLevel variable to the menu SkillLevel DWORD CfgSkillLevelToMenu(BYTE cfgSkillLevel); -// atributy, ktere ukazujeme v panelu a kteryma je treba maskovat napriklad pri porovnani adresaru -// POZOR: FILE_ATTRIBUTE_DIRECTORY nezobrazujeme jako atribut, takze v masce nema co delat +// Attributes shown in the panel which must also be masked when comparing directories. +// NOTE: FILE_ATTRIBUTE_DIRECTORY is not displayed as an attribute so it has no place in the mask. #define DISPLAYED_ATTRIBUTES (FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN | \ FILE_ATTRIBUTE_SYSTEM | \ FILE_ATTRIBUTE_ARCHIVE | FILE_ATTRIBUTE_ENCRYPTED | \ @@ -1757,16 +1794,17 @@ DWORD CfgSkillLevelToMenu(BYTE cfgSkillLevel); #define IDT_DELAYEDTHROBBER 950 #define IDT_UPDATETASKLIST 951 -// POZOR: skoro vsechny funkce v teto sekci pri chybe zobrazuji hlaseni o LOAD / SAVE -// konfigurace, coz z nich dela nevhodne pro bezny pristup do Registry, -// reseni viz funkce na zacatku regwork.h: OpenKeyAux, CreateKeyAux, atd. +// NOTE: nearly all functions in this section display LOAD/SAVE configuration +// error messages on failure, which makes them unsuitable for general +// registry access. See the functions at the beginning of regwork.h: +// OpenKeyAux, CreateKeyAux, etc. BOOL ClearKey(HKEY key); BOOL CreateKey(HKEY hKey, const char* name, HKEY& createdKey); BOOL OpenKey(HKEY hKey, const char* name, HKEY& openedKey); void CloseKey(HKEY key); BOOL DeleteKey(HKEY hKey, const char* name); BOOL DeleteValue(HKEY hKey, const char* name); -// pro dataSize = -1 si funkce napocita delku stringu pres strlen +// when dataSize is -1 the function calculates the string length using strlen BOOL SetValue(HKEY hKey, const char* name, DWORD type, const void* data, DWORD dataSize); BOOL GetValue(HKEY hKey, const char* name, DWORD type, void* buffer, DWORD bufferSize); @@ -1791,30 +1829,30 @@ BOOL ImportConfiguration(HWND hParent, const char* fileName, BOOL ignoreIfNotExi class CHighlightMasks; void UpdateDefaultColors(SALCOLOR* colors, CHighlightMasks* highlightMasks, BOOL processColors, BOOL processMasks); -extern BOOL ImageDragging; // prave se tahne image -extern BOOL ImageDraggingVisible; // je prave image zobrazeny? -void ImageDragBegin(int width, int height, int dxHotspot, int dyHotspot); // velikost tazeneho obrazku -void ImageDragEnd(); // ukonceni tazeni -BOOL ImageDragInterfereRect(const RECT* rect); // rect je v obrazovkovych souradnicich, zjistit, jestli tazena polozka zasahuje do rect -void ImageDragEnter(int x, int y); // x a y jsou obrazovkove souradnice -void ImageDragMove(int x, int y); // x a y jsou obrazovkove souradnice +extern BOOL ImageDragging; // an image is being dragged +extern BOOL ImageDraggingVisible; // is the image currently visible? +void ImageDragBegin(int width, int height, int dxHotspot, int dyHotspot); // size of the dragged image +void ImageDragEnd(); // end dragging +BOOL ImageDragInterfereRect(const RECT* rect); // rect is in screen coordinates, check whether the dragged item intersects it +void ImageDragEnter(int x, int y); // x and y are screen coordinates +void ImageDragMove(int x, int y); // x and y are screen coordinates void ImageDragLeave(); -void ImageDragShow(BOOL show); // zhasne / rozsviti, neovlivni ImageDragging, pouze ImageDraggingVisible +void ImageDragShow(BOOL show); // hides/shows; does not affect ImageDragging, only ImageDraggingVisible -// nastavuje kurzor ve tvaru ruky +// sets the cursor to a hand shape HCURSOR SetHandCursor(); //****************************************************************************** // // CreateToolbarBitmaps // -// IN: hInstance - instance, ve ktere lezi bitmapa s resID -// resID - identifikator vstupni bitmapy -// transparent - tato barva bude pruhledna -// bkColorForAlpha - barva, ktera bude prosvitat pod alpha castma ikonek (WinXP) -// OUT: hMaskBitmap - maska (b&w) -// hGrayBitmap - sedive provedeni -// hColorBitmap - barevne provedeni +// IN: hInstance - instance containing the bitmap with resID +// resID - identifier of the input bitmap +// transparent - this color will be transparent +// bkColorForAlpha - color showing through the alpha parts of icons (WinXP) +// OUT: hMaskBitmap - mask (b&w) +// hGrayBitmap - grayscale variant +// hColorBitmap - color variant // struct CSVGIcon @@ -1831,9 +1869,8 @@ BOOL CreateToolbarBitmaps(HINSTANCE hInstance, int resID, COLORREF transparent, // // CreateGrayscaleAndMaskBitmaps // -// Vytvori novou bitmapu o hloubce 24 bitu, nakopiruje do ni zdrojovou -// bitmapu a prevede ji na stupne sedi. Zaroven pripravi druhou bitmapu -// s maskou dle transparentni barvy. +// Creates a new 24-bit bitmap, copies the source bitmap into it and converts it to grayscale. +// At the same time prepares another bitmap with a mask based on the transparent color. // BOOL CreateGrayscaleAndMaskBitmaps(HBITMAP hSource, COLORREF transparent, @@ -1862,83 +1899,82 @@ DWORD UpdateCrc32(const void* buffer, DWORD count, DWORD crcVal); //****************************************************************************** // -// Rizeni Idle procesingu (CMainWindow::OnEnterIdle) +// Idle processing control (CMainWindow::OnEnterIdle) // -// promenne jsou pro snadnou dostupnost globalni -// a ne jako atributy tridy CMainWindow +// variables are global for easy access and not attributes of CMainWindow // -extern BOOL IdleRefreshStates; // pokud je nastavena, budou pri nejblizim CMainWindow::OnEnterIdle vytazeny stavove promenne pro commandy (toolbar, menu) -extern BOOL IdleForceRefresh; // je-li nastavena IdleRefreshStates, nastaveni promenne IdleForceRefresh vyradi cache na urovni Salamandera -extern BOOL IdleCheckClipboard; // pokud je IdleRefreshStates==TRUE a zaroven je nastavena tato promenna, bude se kontrolovat tak clipboard (casove narocne) - -// ".." neni pocitano mezi soubory|adresare -extern DWORD EnablerUpDir; // existuje parent directory? -extern DWORD EnablerRootDir; // nejsme jeste v rootu? (pozor: UNC root ma updir, ale je to root) -extern DWORD EnablerForward; // je v historii dostupny forward? -extern DWORD EnablerBackward; // je v historii dostupny backward? -extern DWORD EnablerFileOnDisk; // focus je na souboru && panel je disk -extern DWORD EnablerFileOnDiskOrArchive; // focus je na souboru && panel je disk nebo archiv -extern DWORD EnablerFileOrDirLinkOnDisk; // focus je na souboru nebo adresari linku && panel je disk -extern DWORD EnablerFiles; // focus|select je na souborech|adresarich -extern DWORD EnablerFilesOnDisk; // focus|select je na souborech|adresarich && panel je disk -extern DWORD EnablerFilesOnDiskCompress; // focus|select je na souborech|adresarich && panel je disk && je podporovana komprese -extern DWORD EnablerFilesOnDiskEncrypt; // focus|select je na souborech|adresarich && panel je disk && je podporovano sifrovani -extern DWORD EnablerFilesOnDiskOrArchive; // focus|select je na souborech|adresarich && panel je disk nebo archiv -extern DWORD EnablerOccupiedSpace; // panel je disk nebo archiv s VALID_DATA_SIZE a zaroven plati EnablerFilesOnDiskOrArchive -extern DWORD EnablerFilesCopy; // focus|select je na souborech|adresarich && panel je disk, archiv nebo FS s podporou "copy from fs" -extern DWORD EnablerFilesMove; // focus|select je na souborech|adresarich && panel je disk nebo FS s podporou "move from fs" -extern DWORD EnablerFilesDelete; // focus|select je na souborech|adresarich && (panel je disk, editovatelny archiv nebo FS s podporou "delete") -extern DWORD EnablerFileDir; // focus je na souboru|adresari -extern DWORD EnablerFileDirANDSelected; // focus je na souboru|adresari && jsou oznaceny nejake soubory|adresare -extern DWORD EnablerQuickRename; // focus je na souboru|adresari && panel je disk nebo FS (s podporou quick-rename) -extern DWORD EnablerOnDisk; // panel je disk -extern DWORD EnablerCalcDirSizes; // panel je disk nebo archiv s VALID_DATA_SIZE -extern DWORD EnablerPasteFiles; // je mozne provest Paste? (soubory na clipboardu) (vyuzite jako pamet posledniho stavu clipboardu pro 'pasteFiles' v CMainWindow::RefreshCommandStates()) -extern DWORD EnablerPastePath; // je mozne provest Paste? (text cesty na clipboardu) (vyuzite jako pamet posledniho stavu clipboardu pro 'pastePath' v CMainWindow::RefreshCommandStates()) -extern DWORD EnablerPasteLinks; // je mozne provest Paste Links? (soubory pres "copy" na clipboardu) (vyuzite jako pamet posledniho stavu clipboardu pro 'pasteLinks' v CMainWindow::RefreshCommandStates()) -extern DWORD EnablerPasteSimpleFiles; // jsou na clipboardu soubory/adresare z jedine cesty? (aneb: je sance na Paste do archivu nebo FS?) -extern DWORD EnablerPasteDefEffect; // jaky je defaultni paste-effect, muze byt i kombinace DROPEFFECT_COPY+DROPEFFECT_MOVE (aneb: slo o Copy nebo Cut?) -extern DWORD EnablerPasteFilesToArcOrFS; // je mozny Paste souboru do archivu/FS v aktualnim panelu? (v panelu je archiv/FS && EnablerPasteSimpleFiles && operace podle EnablerPasteDefEffect je mozna) -extern DWORD EnablerPaste; // je mozne provest Paste? (soubory na clipboardu && panel je disk || je mozne provest paste do archivu nebo FS || text cesty na clipboardu) -extern DWORD EnablerPasteLinksOnDisk; // je mozne provest Paste Links a panel je disk? -extern DWORD EnablerSelected; // jsou oznaceny nejake soubory|adresare -extern DWORD EnablerUnselected; // existuje alespon jeden neoznaceny soubor|adresar (UpDir ".." se neuvazuje) -extern DWORD EnablerHiddenNames; // pole HiddenNames obsahuje nejake nazvy -extern DWORD EnablerSelectionStored; // je ulozena selection v OldSelection aktivniho panelu? -extern DWORD EnablerGlobalSelStored; // je ulozena selection v GlobalSelection? -extern DWORD EnablerSelGotoPrev; // existuje pred focusem vybrana polozka? -extern DWORD EnablerSelGotoNext; // existuje za focusem vybrana polozka? -extern DWORD EnablerLeftUpDir; // existuje v levem panelu parent directory? -extern DWORD EnablerRightUpDir; // existuje v pravem panelu parent directory? -extern DWORD EnablerLeftRootDir; // nejsme jeste v levem panelu v rootu? (pozor: UNC root ma updir, ale je to root) -extern DWORD EnablerRightRootDir; // nejsme jeste v pravem panelu v rootu? (pozor: UNC root ma updir, ale je to root) -extern DWORD EnablerLeftForward; // je v historii leveho panelu dostupny forward? -extern DWORD EnablerRightForward; // je v historii praveho panelu dostupny forward? -extern DWORD EnablerLeftBackward; // je v historii leveho panelu dostupny backward? -extern DWORD EnablerRightBackward; // je v historii praveho panelu dostupny backward? -extern DWORD EnablerFileHistory; // je v view/edit historii dostupny soubor? -extern DWORD EnablerDirHistory; // je v directory historii dostupny adresar? -extern DWORD EnablerCustomizeLeftView; // je mozne konfigurovat sloupce pro levy pohled? -extern DWORD EnablerCustomizeRightView; // je mozne konfigurovat sloupce pro pravy pohled? -extern DWORD EnablerDriveInfo; // je mozne zobrazit Drive Info? -extern DWORD EnablerCreateDir; // panel je disk nebo FS (s podporou create-dir) -extern DWORD EnablerViewFile; // focus je na souboru && panel je disk, archiv nebo FS (s podporou view-file) -extern DWORD EnablerChangeAttrs; // focus|select je na souborech|adresarich && panel je disk nebo FS (s podporou change-attributes) -extern DWORD EnablerShowProperties; // focus|select je na souborech|adresarich && panel je disk nebo FS (s podporou show-properties) -extern DWORD EnablerItemsContextMenu; // focus|select je na souborech|adresarich && panel je disk nebo FS (s podporou context-menu) -extern DWORD EnablerOpenActiveFolder; // panel je disk nebo FS (s podporou open-active-folder) -extern DWORD EnablerPermissions; // focus|select je na souborech|adresarich && panel je disk, bezime nejmene na W2K, disk umi ACL (NTFS) +extern BOOL IdleRefreshStates; // when set, the next CMainWindow::OnEnterIdle will update command states (toolbar, menu) +extern BOOL IdleForceRefresh; // if IdleRefreshStates is set, setting IdleForceRefresh bypasses Salamander's cache +extern BOOL IdleCheckClipboard; // when IdleRefreshStates is TRUE and this flag is set, the clipboard is checked as well (time consuming) + +// ".." is not counted among files/directories +extern DWORD EnablerUpDir; // is a parent directory available? +extern DWORD EnablerRootDir; // are we already at the root? (note: UNC roots have an updir but are still roots) +extern DWORD EnablerForward; // is forward available in history? +extern DWORD EnablerBackward; // is backward available in history? +extern DWORD EnablerFileOnDisk; // focus is on a file and the panel is disk-based +extern DWORD EnablerFileOnDiskOrArchive; // focus is on a file and the panel is disk or archive +extern DWORD EnablerFileOrDirLinkOnDisk; // focus is on a file or directory link and the panel is disk +extern DWORD EnablerFiles; // focus/selection is on files/directories +extern DWORD EnablerFilesOnDisk; // focus/selection is on files/directories and the panel is a disk +extern DWORD EnablerFilesOnDiskCompress; // focus/selection is on files/directories and the panel is a disk that supports compression +extern DWORD EnablerFilesOnDiskEncrypt; // focus/selection is on files/directories and the panel is a disk that supports encryption +extern DWORD EnablerFilesOnDiskOrArchive; // focus/selection is on files/directories and the panel is disk or archive +extern DWORD EnablerOccupiedSpace; // panel is disk or archive with VALID_DATA_SIZE and EnablerFilesOnDiskOrArchive holds +extern DWORD EnablerFilesCopy; // focus/selection is on files/directories and the panel is disk, archive or FS supporting "copy from fs" +extern DWORD EnablerFilesMove; // focus/selection is on files/directories and the panel is disk or FS supporting "move from fs" +extern DWORD EnablerFilesDelete; // focus/selection is on files/directories and the panel is a disk, an editable archive, or an FS supporting "delete" +extern DWORD EnablerFileDir; // focus is on a file/directory +extern DWORD EnablerFileDirANDSelected; // focus is on a file/directory and some files/directories are selected +extern DWORD EnablerQuickRename; // focus is on a file/directory and the panel is disk or FS (with quick-rename support) +extern DWORD EnablerOnDisk; // panel is a disk +extern DWORD EnablerCalcDirSizes; // panel is a disk or archive with VALID_DATA_SIZE +extern DWORD EnablerPasteFiles; // can Paste be performed? (files on the clipboard) used as memory of the last clipboard state for 'pasteFiles' in CMainWindow::RefreshCommandStates() +extern DWORD EnablerPastePath; // can Paste be performed? (path text on the clipboard) used as memory of the last clipboard state for 'pastePath' in CMainWindow::RefreshCommandStates() +extern DWORD EnablerPasteLinks; // can Paste Links be performed? (files copied to the clipboard) used as memory of the last clipboard state for 'pasteLinks' in CMainWindow::RefreshCommandStates() +extern DWORD EnablerPasteSimpleFiles; // are there files/directories from a single path on the clipboard? (chance to Paste into an archive or FS) +extern DWORD EnablerPasteDefEffect; // what is the default paste effect; may be a combination of DROPEFFECT_COPY+DROPEFFECT_MOVE (Copy or Cut?) +extern DWORD EnablerPasteFilesToArcOrFS; // can files be pasted into the archive/FS in the current panel? (the panel is archive/FS && EnablerPasteSimpleFiles && the operation according to EnablerPasteDefEffect is allowed) +extern DWORD EnablerPaste; // can Paste be performed? (files on clipboard && panel is disk || paste into archive/FS is possible || path text on clipboard) +extern DWORD EnablerPasteLinksOnDisk; // can Paste Links be performed and the panel is a disk? +extern DWORD EnablerSelected; // are any files/directories selected +extern DWORD EnablerUnselected; // is there at least one unselected file/directory (UpDir ".." not considered) +extern DWORD EnablerHiddenNames; // the HiddenNames array contains some names +extern DWORD EnablerSelectionStored; // is a selection stored in OldSelection of the active panel? +extern DWORD EnablerGlobalSelStored; // is a selection stored in GlobalSelection? +extern DWORD EnablerSelGotoPrev; // is there a selected item before the focus? +extern DWORD EnablerSelGotoNext; // is there a selected item after the focus? +extern DWORD EnablerLeftUpDir; // does the left panel have a parent directory? +extern DWORD EnablerRightUpDir; // does the right panel have a parent directory? +extern DWORD EnablerLeftRootDir; // are we not yet at the root in the left panel? (UNC roots have an updir but are still roots) +extern DWORD EnablerRightRootDir; // are we not yet at the root in the right panel? (UNC roots have an updir but are still roots) +extern DWORD EnablerLeftForward; // is forward available in the left panel history? +extern DWORD EnablerRightForward; // is forward available in the right panel history? +extern DWORD EnablerLeftBackward; // is backward available in the left panel history? +extern DWORD EnablerRightBackward; // is backward available in the right panel history? +extern DWORD EnablerFileHistory; // is a file available in the view/edit history? +extern DWORD EnablerDirHistory; // is a directory available in the directory history? +extern DWORD EnablerCustomizeLeftView; // can columns be configured for the left view? +extern DWORD EnablerCustomizeRightView; // can columns be configured for the right view? +extern DWORD EnablerDriveInfo; // can Drive Info be displayed? +extern DWORD EnablerCreateDir; // panel is disk or FS (supports create-dir) +extern DWORD EnablerViewFile; // focus is on a file and the panel is disk, archive or FS (supports view-file) +extern DWORD EnablerChangeAttrs; // focus/selection is on files/directories and the panel is disk or FS (supports change-attributes) +extern DWORD EnablerShowProperties; // focus/selection is on files/directories and the panel is disk or FS (supports show-properties) +extern DWORD EnablerItemsContextMenu; // focus/selection is on files/directories and the panel is disk or FS (supports context menu) +extern DWORD EnablerOpenActiveFolder; // panel is a disk or an FS (with open-active-folder support) +extern DWORD EnablerPermissions; // focus/selection is on files/directories and the panel is a disk; running at least on W2K with NTFS supporting ACLs //****************************************************************************** // // ToolBar Bitmap indexes // -// Polozky lze pridavat do pole. -// Pole je rozdeleno na dve casti. V Prnim jsou indexy, ke kterym se v bitmape -// opravdu nachazeji obrazky. -// Pak nasleduji indexy, na ktere jsou vytazeny ikonky z shell32.dll. -// Tyto dve skupiny musi byt vzdy celistve a neni mozne indexy stridat. +// Items can be added to the array. +// The array is divided into two parts. The first contains indexes with real +// images in the bitmap. After that come indexes with icons pulled from +// shell32.dll. These two groups must always be contiguous and the indexes cannot +// be mixed. // #define IDX_TB_CONNECTNET 0 // Connect Network Drive @@ -1996,8 +2032,8 @@ extern DWORD EnablerPermissions; // focus|select je na souborech|adresa #define IDX_TB_UNSELECTALL 52 // Unselect all #define IDX_TB_VIEW_MODE 53 // View Mode #define IDX_TB_HOTPATHS 54 // Hot Paths -#define IDX_TB_FOCUS 55 // Focus (zelena sipka) -#define IDX_TB_STOP 56 // Stop (cervene kolecko s krizkem) +#define IDX_TB_FOCUS 55 // Focus (green arrow) +#define IDX_TB_STOP 56 // Stop (red circle with a cross) #define IDX_TB_EMAIL 57 // Email Files #define IDX_TB_EDITNEW 58 // Edit New #define IDX_TB_PASTESHORTCUT 59 // Paste Shortcut @@ -2020,9 +2056,9 @@ extern DWORD EnablerPermissions; // focus|select je na souborech|adresa #define IDX_TB_SHOW_ALL 76 // Show All Names #define IDX_TB_SMART_COLUMN_MODE 77 // Smart Column Mode -#define IDX_TB_FD 78 // first "dynamic added" index -// nasledujici ikony budou pridany k bitmape dynamicky -// a nektere budou nacteny z shell32.dll +#define IDX_TB_FD 78 // first "dynamically added" index +// the following icons will be added to the bitmap dynamically +// and some will be loaded from shell32.dll #define IDX_TB_CHANGEDRIVEL IDX_TB_FD + 0 // Change Drive Left #define IDX_TB_CHANGEDRIVER IDX_TB_FD + 1 // Change Drive Right @@ -2036,242 +2072,220 @@ extern DWORD EnablerPermissions; // focus|select je na souborech|adresa #define IDX_TB_OPENFONTS IDX_TB_FD + 9 // Open Fonts #define IDX_TB_OPENMYDOC IDX_TB_FD + 10 // Open Documents -#define IDX_TB_COUNT IDX_TB_FD + 11 // pocet bitmap vcetne tahanych z shell32.dll +#define IDX_TB_COUNT IDX_TB_FD + 11 // number of bitmaps including those pulled from shell32.dll //****************************************************************************** // // Custom Exceptions // -#define OPENSAL_EXCEPTION_RTC 0xE0EA4321 // vyvolame v rtc callbacku -#define OPENSAL_EXCEPTION_BREAK 0xE0EA4322 // vyvolame v pripade breaku (z jineho salama nebo promoci salbreak) +#define OPENSAL_EXCEPTION_RTC 0xE0EA4321 // raised in the RTC callback +#define OPENSAL_EXCEPTION_BREAK 0xE0EA4322 // raised when breaking from another Salamander or via salbreak //****************************************************************************** // -// Sada promennych a funkci pro otevirani asociaci pomoci SalOpen.exe +// Set of variables and functions for opening associations via SalOpen.exe // -// sdilena pamet +// shared memory extern HANDLE SalOpenFileMapping; extern void* SalOpenSharedMem; -// uvolneni sluzby +// release the service void ReleaseSalOpen(); -// spusteni salopen.exe a predani 'fileName' pres sdilenou pamet -// vraci TRUE pokud se to povedlo, jinak FALSE (asociace by se mela spustit jinak) +// launch salopen.exe and pass 'fileName' via shared memory +// returns TRUE on success, otherwise FALSE (the association should be launched another way) BOOL SalOpenExecute(HWND hWindow, const char* fileName); //****************************************************************************** -// mapovani salCmd (cislo prikazu Salamandera spousteneho z plug-inu, viz SALCMD_XXX) -// na cislo prikazu pro WM_COMMAND +// mapping salCmd (the Salamander command number from a plugin, see SALCMD_XXX) +// to the command number for WM_COMMAND int GetWMCommandFromSalCmd(int salCmd); //****************************************************************************** -// pocet polozek v poli SalamanderConfigurationRoots +// number of items in the SalamanderConfigurationRoots array #define SALCFG_ROOTS_COUNT 83 -// id hlavniho threadu (platne az po vstupu do WinMain()) +// ID of the main thread (valid only after entering WinMain()) extern DWORD MainThreadID; -extern BOOL IsNotAlphaNorNum[256]; // pole TRUE/FALSE pro znaky (TRUE = neni pismeno ani cislice) -extern BOOL IsAlpha[256]; // pole TRUE/FALSE pro znaky (TRUE = pismeno) +extern BOOL IsNotAlphaNorNum[256]; // TRUE/FALSE array for characters (TRUE = not a letter or digit) +extern BOOL IsAlpha[256]; // TRUE/FALSE array for characters (TRUE = letter) -extern int UserCharset; // defaultni useruv charset pro fonty +extern int UserCharset; // user's default charset for fonts -// granularita alokaci (potreba pro pouzivani souboru mapovanych do pameti) +// allocation granularity (needed when using memory-mapped files) extern DWORD AllocationGranularity; -// ma se cekat na pusteni ESC pred zacatkem listovani cesty v panelu? +// should we wait for ESC to be released before starting to list the path in the panel? extern BOOL WaitForESCReleaseBeforeTestingESC; -// vrati pozici v screen coord., kde se ma vybalit context menu -// pouziva se pri vybalovani contextoveho menu pomoci klavesnice (Shift+F10 nebo VK_APP) +// returns the screen coordinates where the context menu should appear +// used when invoking the context menu via keyboard (Shift+F10 or VK_APP) void GetListViewContextMenuPos(HWND hListView, POINT* p); -// na zaklade barevne hloubky displeje urci, jestli pouzivat 256 barevne -// nebo 16 barevne bitmapy. +// based on the display color depth decides whether to use 256-color +// or 16-color bitmaps BOOL Use256ColorsBitmap(); -// obnovi focus ve zdrojovem panelu (pouziva se pokud mizi focus - po disablovani hl. okna, atp.) +// restores focus in the source panel (used when focus disappears after disabling the main window, etc.) void RestoreFocusInSourcePanel(); #define ISSLGINCOMPLETE_SIZE 200 extern char IsSLGIncomplete[ISSLGINCOMPLETE_SIZE]; //****************************************************************************** -// enumerace jmen souboru z panelu/Findu pro viewery +// enumeration of file names from panels/Find for viewers -// init+release dat spojenych s enumeraci +// initialization and release of data associated with enumeration void InitFileNamesEnumForViewers(); void ReleaseFileNamesEnumForViewers(); enum CFileNamesEnumRequestType { - fnertFindNext, // hledame dalsi soubor ve zdroji - fnertFindPrevious, // hledame predchozi soubor ve zdroji - fnertIsSelected, // zjistujeme oznaceni souboru ve zdroji - fnertSetSelection, // nastavujeme oznaceni souboru ve zdroji + fnertFindNext, // look for the next file in the source + fnertFindPrevious, // look for the previous file in the source + fnertIsSelected, // query whether the file is selected in the source + fnertSetSelection, // set the selection state of the file in the source }; struct CFileNamesEnumData { - // pozadavek: - int RequestUID; // cislo pozadavku - CFileNamesEnumRequestType RequestType; // typ pozadavku + // request: + int RequestUID; // request ID + CFileNamesEnumRequestType RequestType; // type of request int SrcUID; int LastFileIndex; char LastFileName[MAX_PATH]; BOOL PreferSelected; BOOL OnlyAssociatedExtensions; - CPluginInterfaceAbstract* Plugin; // pouziva se pri 'OnlyAssociatedExtensions'==TRUE, oznacuje pro jaky plugin filtrovat jmena souboru ('Plugin'==NULL = interni viewer) + CPluginInterfaceAbstract* Plugin; // used when 'OnlyAssociatedExtensions'==TRUE; designates which plugin to filter file names for ('Plugin'==NULL = internal viewer) char FileName[MAX_PATH]; BOOL Select; - BOOL TimedOut; // TRUE pokud uz na vysledek nikdo neceka (zbytecne provadet hledani jmena) + BOOL TimedOut; // TRUE when nobody is waiting for the result anymore (searching the name would be pointless) - // vysledek: - BOOL Found; // TRUE pokud bylo nalezeno pozadovane jmeno souboru + // result: + BOOL Found; // TRUE when the desired file name was found BOOL NoMoreFiles; BOOL SrcBusy; BOOL IsFileSelected; }; -// sekce pro praci s daty spojenymi s enumeraci (FileNamesEnumSources, FileNamesEnumData, -// FileNamesEnumDone, NextRequestUID a NextSourceUID) +// section for handling enumeration data (FileNamesEnumSources, FileNamesEnumData, +// FileNamesEnumDone, NextRequestUID and NextSourceUID) extern CRITICAL_SECTION FileNamesEnumDataSect; -// struktura s pozadavkem+vysledky enumerace +// structure containing the enumeration request and results extern CFileNamesEnumData FileNamesEnumData; -// event je "signaled" jakmile zdroj naplni vysledek do FileNamesEnumData +// the event is signaled once the source fills FileNamesEnumData with the result extern HANDLE FileNamesEnumDone; -#define FILENAMESENUM_TIMEOUT 1000 // timeout pro doruceni zpravy WM_USER_ENUMFILENAMES oknu zdroje +#define FILENAMESENUM_TIMEOUT 1000 // timeout for delivering WM_USER_ENUMFILENAMES to the source window -// vraci TRUE pokud je zdroj enumerace panel, v 'panel' pak vraci PANEL_LEFT nebo -// PANEL_RIGHT; pokud nebyl zdroj enumerace nalezen nebo jde o Find okno, vraci FALSE +// returns TRUE when the enumeration source is a panel and 'panel' receives +// PANEL_LEFT or PANEL_RIGHT; returns FALSE if the source cannot be found or it +// is a Find window BOOL IsFileEnumSourcePanel(int srcUID, int* panel); -// vraci dalsi jmeno souboru pro viewer ze zdroje (levy/pravy panel nebo Findy); -// 'srcUID' je unikatni identifikator zdroje (predava se jako parametr pri otevirani -// vieweru); 'lastFileIndex' (nesmi byt NULL) je IN/OUT parametr, ktery by plugin mel -// menit jen pokud chce vratit jmeno prvniho souboru, v tomto pripade nastavit 'lastFileIndex' -// na -1; pocatecni hodnota 'lastFileIndex' se predava jako parametr pri otevirani -// vieweru; 'lastFileName' je plne jmeno aktualniho souboru (prazdny retezec pokud neni -// zname, napr. je-li 'lastFileIndex' -1); je-li 'preferSelected' TRUE a aspon jedno -// jmeno oznacene, budou se vracet oznacena jmena; je-li 'onlyAssociatedExtensions' -// TRUE, vraci jen soubory s priponou asociovanou s viewerem tohoto pluginu (F3 na tomto -// souboru by se pokusilo otevrit viewer tohoto pluginu + ignoruje pripadne zastineni -// viewerem jineho pluginu); 'fileName' je buffer pro ziskane jmeno (velikost alespon -// MAX_PATH); vraci TRUE pokud se podari jmeno ziskat; vraci FALSE pri chybe: zadne -// dalsi jmeno souboru ve zdroji neni (neni-li 'noMoreFiles' NULL, vraci se v nem TRUE), -// zdroj je zaneprazdnen (nezpracovava zpravy; neni-li 'srcBusy' NULL, vraci se v nem -// TRUE), jinak zdroj prestal existovat (zmena cesty v panelu, zmena razeni, atp.) +// Retrieves the next file name for the viewer from the given source +// (left/right panel or Find window). 'srcUID' uniquely identifies the source. +// 'lastFileIndex' is an IN/OUT value used to track the current file and should +// be set to -1 when requesting the first file. 'lastFileName' contains the full +// name of the current file (empty if unknown). When 'preferSelected' is TRUE and +// at least one name is selected, only selected names are returned. If +// 'onlyAssociatedExtensions' is TRUE, only files associated with this plugin's +// viewer are returned (ignoring other plugins). 'fileName' receives the next file +// name (buffer size at least MAX_PATH). The function returns TRUE on success or +// FALSE on error: no more names (if 'noMoreFiles' is not NULL it becomes TRUE), +// the source is busy (if 'srcBusy' is not NULL it becomes TRUE), or the source no +// longer exists (path or sorting changed). BOOL GetNextFileNameForViewer(int srcUID, int* lastFileIndex, const char* lastFileName, BOOL preferSelected, BOOL onlyAssociatedExtensions, char* fileName, BOOL* noMoreFiles, BOOL* srcBusy, CPluginInterfaceAbstract* plugin); -// vraci predchozi jmeno souboru pro viewer ze zdroje (levy/pravy panel nebo Findy); -// 'srcUID' je unikatni identifikator zdroje (predava se jako parametr pri otevirani -// vieweru); 'lastFileIndex' (nesmi byt NULL) je IN/OUT parametr, ktery by plugin mel -// menit jen pokud chce vratit jmeno posledniho souboru, v tomto pripade nastavit 'lastFileIndex' -// na -1; pocatecni hodnota 'lastFileIndex' se predava jako parametr pri otevirani -// vieweru; 'lastFileName' je plne jmeno aktualniho souboru (prazdny retezec pokud neni -// zname, napr. je-li 'lastFileIndex' -1); je-li 'preferSelected' TRUE a aspon jedno -// jmeno oznacene, budou se vracet oznacena jmena; je-li 'onlyAssociatedExtensions' TRUE, -// vraci jen soubory s priponou asociovanou s viewerem tohoto pluginu (F3 na tomto -// souboru by se pokusilo otevrit viewer tohoto pluginu + ignoruje pripadne zastineni -// viewerem jineho pluginu); 'fileName' je buffer pro ziskane jmeno (velikost alespon -// MAX_PATH); vraci TRUE pokud se podari jmeno ziskat; vraci FALSE pri chybe: zadne -// predchozi jmeno souboru ve zdroji neni (neni-li 'noMoreFiles' NULL, vraci se v nem -// TRUE), zdroj je zaneprazdnen (nezpracovava zpravy; neni-li 'srcBusy' NULL, vraci -// se v nem TRUE), jinak zdroj prestal existovat (zmena cesty v panelu, zmena -// razeni, atp.) +// Retrieves the previous file name for the viewer from the given source. +// Usage and return values are equivalent to GetNextFileNameForViewer but walk +// backwards through the list of files. BOOL GetPreviousFileNameForViewer(int srcUID, int* lastFileIndex, const char* lastFileName, BOOL preferSelected, BOOL onlyAssociatedExtensions, char* fileName, BOOL* noMoreFiles, BOOL* srcBusy, CPluginInterfaceAbstract* plugin); -// zjisti, jestli je aktualni soubor z vieweru oznaceny (selected) ve zdroji (levy/pravy -// panel nebo Findy); 'srcUID' je unikatni identifikator zdroje (predava se jako parametr -// pri otevirani vieweru); 'lastFileIndex' je parametr, ktery by plugin nemel menit, -// pocatecni hodnota 'lastFileIndex' se predava jako parametr pri otevirani vieweru; -// 'lastFileName' je plne jmeno aktualniho souboru; vraci TRUE pokud se podarilo zjistit, -// jestli je aktialni soubor oznaceny, vysledek je v 'isFileSelected' (nesmi byt NULL); -// vraci FALSE pri chybe: zdroj prestal existovat (zmena cesty v panelu, atp.) nebo soubor -// 'lastFileName' uz ve zdroji neni (pri techto dvou chybach, neni-li 'srcBusy' NULL, -// vraci se v nem FALSE), zdroj je zaneprazdnen (nezpracovava zpravy; pri teto chybe, -// neni-li 'srcBusy' NULL, vraci se v nem TRUE) +// Checks whether the current viewer file is selected in the source (left/right +// panel or Find window). 'srcUID' uniquely identifies the source. 'lastFileIndex' +// should not be modified by the plugin except when requesting the last file +// (set it to -1). 'lastFileName' is the full name of the current file. Returns +// TRUE on success and stores the result in 'isFileSelected' (must not be NULL). +// Returns FALSE if the source no longer exists or the file is missing (and sets +// 'srcBusy' to FALSE if provided) or if the source is busy processing messages +// (sets 'srcBusy' to TRUE). BOOL IsFileNameForViewerSelected(int srcUID, int lastFileIndex, const char* lastFileName, BOOL* isFileSelected, BOOL* srcBusy); -// nastavi oznaceni (selectionu) na aktualnim souboru z vieweru ve zdroji (levy/pravy -// panel nebo Findy); 'srcUID' je unikatni identifikator zdroje (predava se jako parametr -// pri otevirani vieweru); 'lastFileIndex' je parametr, ktery by plugin nemel menit, -// pocatecni hodnota 'lastFileIndex' se predava jako parametr pri otevirani vieweru; -// 'lastFileName' je plne jmeno aktualniho souboru; 'select' je TRUE/FALSE pokud se ma -// aktualni soubor oznacit/odznacit; vraci TRUE pri uspechu; vraci FALSE pri chybe: -// zdroj prestal existovat (zmena cesty v panelu, atp.) nebo soubor 'lastFileName' uz -// ve zdroji neni (pri techto dvou chybach, neni-li 'srcBusy' NULL, vraci se v nem FALSE), -// zdroj je zaneprazdnen (nezpracovava zpravy; pri teto chybe, neni-li 'srcBusy' NULL, -// vraci se v nem TRUE) +// Sets or clears the selection state of the current viewer file in the source +// (left/right panel or Find window). Parameters match +// IsFileNameForViewerSelected. Returns TRUE on success or FALSE if the source no +// longer exists, the file is missing, or the source is busy. When FALSE is +// returned 'srcBusy' indicates whether the source was busy. BOOL SetSelectionOnFileNameForViewer(int srcUID, int lastFileIndex, const char* lastFileName, BOOL select, BOOL* srcBusy); -// zmeni zdroji (panelu nebo Findu) UID (negeneruje nove, aktualizuje pole -// FileNamesEnumSources a vrati nove UID v 'srcUID') +// Changes the UID assigned to a source panel or Find window without generating +// a new one. The FileNamesEnumSources array is updated and the new UID is +// returned in 'srcUID'. void EnumFileNamesChangeSourceUID(HWND hWnd, int* srcUID); -// prida zdroji (panelu nebo Findu) UID (negeneruje nove, prida dvojici -// hWnd+UID do pole FileNamesEnumSources a vrati nove UID v 'srcUID') +// Adds a source to FileNamesEnumSources without creating a new UID. The pair +// hWnd+UID is stored and the new UID is returned in 'srcUID'. void EnumFileNamesAddSourceUID(HWND hWnd, int* srcUID); -// vyradi zdroj (panelu nebo Findu) z pole FileNamesEnumSources +// Removes the specified source from FileNamesEnumSources void EnumFileNamesRemoveSourceUID(HWND hWnd); //****************************************************************************** -// neblokujici cteni volume-name CD drivu +// non-blocking reading of the volume name of a CD drive -extern CRITICAL_SECTION ReadCDVolNameCS; // kriticka sekce pro pristup k datum -extern UINT_PTR ReadCDVolNameReqUID; // UID pozadavku (pro rozpoznani jestli na vysledek jeste nekdo ceka) +extern CRITICAL_SECTION ReadCDVolNameCS; // critical section for access to data +extern UINT_PTR ReadCDVolNameReqUID; // request UID (to detect if someone still waits for the result) extern char ReadCDVolNameBuffer[MAX_PATH]; // IN/OUT buffer (root/volume_name) //****************************************************************************** -// funkce pro praci s historiemi posledne pouzitych hodnot v comboboxech +// functions for handling histories of recently used values in combo boxes -// prida do sdilene historie ('historyArr'+'historyItemsCount') naalokovanou kopii -// nove hodnoty 'value'; je-li 'caseSensitiveValue' TRUE, hleda se hodnota (retezec) -// v poli historie pomoci case-sensitive porovnani (FALSE = case-insensitive porovnani), -// nalezena hodnota se pouze presouva na prvni misto v poli historie +// adds an allocated copy of the new value 'value' to the shared history ('historyArr'+'historyItemsCount'); +// if 'caseSensitiveValue' is TRUE the value is looked up in the history using a case-sensitive comparison +// (FALSE = case-insensitive); when found, the existing value is just moved to the first position void AddValueToStdHistoryValues(char** historyArr, int historyItemsCount, const char* value, BOOL caseSensitiveValue); -// prida do comboboxu ('combo') texty ze sdilene historie ('historyArr'+'historyItemsCount'); -// pred pridavanim provede reset obsahu comboboxu (viz CB_RESETCONTENT) +// adds the texts from the shared history ('historyArr'+'historyItemsCount') to the combo box 'combo'; +// before adding it resets the combo box content (see CB_RESETCONTENT) void LoadComboFromStdHistoryValues(HWND combo, char** historyArr, int historyItemsCount); //****************************************************************************** -// funkce pro pridani vsech dosud neznamych aktivnich (naloadenych) modulu procesu +// function for adding all yet unknown loaded modules of the process void AddNewlyLoadedModulesToGlobalModulesStore(); //****************************************************************************** -// quicksort s porovnavanim pres StrICmp +// quicksort using StrICmp for comparisons void SortNames(char* files[], int left, int right); -// hleda retezec 'name' v poli 'usedNames' (pole je serazene pomoci StrICmp); -// vraci TRUE pri nalezeni + nalezeny index v 'index' (neni-li NULL); vraci -// FALSE pokud prvek nebyl nalezen + index pro vlozeni v 'index' (neni-li NULL) +// searches for the string 'name' in the 'usedNames' array (sorted via StrICmp); +// returns TRUE when found and the found index in 'index' (if not NULL); returns +// FALSE when the item is missing and provides the insertion index in 'index' (if not NULL) BOOL ContainsString(TIndirectArray* usedNames, const char* name, int* index = NULL); //****************************************************************************** -// v pripade uspechu vrati TRUE a cestu na "Documents", pripadne na "Desktop" -// v pripade neuspechu vrati FALSE -// 'pathLen' udava velikost bufferu 'path'; funkce zajisti terminovani retezce i v -// pripade zkraceni +// returns TRUE on success and stores the path to "Documents" or "Desktop" +// returns FALSE on failure +// 'pathLen' specifies the size of the 'path' buffer; the function ensures the +// string is null-terminated even if truncated BOOL GetMyDocumentsOrDesktopPath(char* path, int pathLen); // To optimize performance, it is good practice for applications to detect whether they @@ -2285,30 +2299,30 @@ BOOL GetMyDocumentsOrDesktopPath(char* path, int pathLen); // application is running on the console. BOOL IsRemoteSession(void); -// vraci TRUE, pokud je uzivatel mezi Administratory -// v pripade chyby vraci FALSE +// returns TRUE if the user is a member of the Administrators group +// returns FALSE on error BOOL IsUserAdmin(); //****************************************************************************** -// pro zajisteni uniku z odstranenych drivu na fixed drive (po vysunuti device - USB flash disk, atd.) -extern BOOL ChangeLeftPanelToFixedWhenIdleInProgress; // TRUE = prave se meni cesta, nastaveni ChangeLeftPanelToFixedWhenIdle na TRUE je zbytecne +// ensures we escape from removed drives to a fixed drive (after ejecting a device such as a USB flash disk) +extern BOOL ChangeLeftPanelToFixedWhenIdleInProgress; // TRUE when the path is currently being changed; setting ChangeLeftPanelToFixedWhenIdle to TRUE is unnecessary extern BOOL ChangeLeftPanelToFixedWhenIdle; -extern BOOL ChangeRightPanelToFixedWhenIdleInProgress; // TRUE = prave se meni cesta, nastaveni ChangeRightPanelToFixedWhenIdle na TRUE je zbytecne +extern BOOL ChangeRightPanelToFixedWhenIdleInProgress; // TRUE when the path is currently being changed; setting ChangeRightPanelToFixedWhenIdle to TRUE is unnecessary extern BOOL ChangeRightPanelToFixedWhenIdle; -extern BOOL OpenCfgToChangeIfPathIsInaccessibleGoTo; // TRUE = v idle otevre konfiguraci na Drives a focusne "If path in panel is inaccessible, go to:" +extern BOOL OpenCfgToChangeIfPathIsInaccessibleGoTo; // TRUE = open configuration on Drives during idle and focus "If path in panel is inaccessible, go to:" -// root drivu (i UNC), pro ktery je zobrazen messagebox "drive not ready" s Retry+Cancel -// tlacitky (pouziva se pro automaticke Retry po vlozeni media do drivu) +// drive root (including UNC) for which the "drive not ready" message box with Retry+Cancel buttons is shown +// used for automatic Retry after inserting media into the drive extern char CheckPathRootWithRetryMsgBox[MAX_PATH]; -// dialog "drive not ready" s Retry+Cancel tlacitky (pouziva se pro automaticke Retry po -// vlozeni media do drivu) +// dialog "drive not ready" with Retry+Cancel buttons (used for automatic Retry after +// inserting media into the drive) extern HWND LastDriveSelectErrDlgHWnd; // GetDriveFormFactor returns the drive form factor. // It returns 350 if the drive is a 3.5" floppy drive. // It returns 525 if the drive is a 5.25" floppy drive. -// It returns 800 if the drive is a 8" floppy drive. +// It returns 800 if the drive is an 8" floppy drive. // It returns 1 if the drive supports removable media other than 3.5", 5.25", and 8" floppies. // It returns 0 on error. // iDrive is 1 for drive A:, 2 for drive B:, etc. @@ -2316,44 +2330,43 @@ DWORD GetDriveFormFactor(int iDrive); //****************************************************************************** -// seradi pole pluginu podle PluginFSCreateTime (pro zobrazeni v Alt+F1/F2 a Disconnect dialogu) +// sorts the array of plugins by PluginFSCreateTime (for display in Alt+F1/F2 and the Disconnect dialog) void SortPluginFSTimes(CPluginFSInterfaceEncapsulation** list, int left, int right); -// vraci poradove cislo pro text polozky do change drive menu a Disconnect dialog; -// viz CPluginFSInterfaceEncapsulation::ChngDrvDuplicateItemIndex +// returns the index for the item text in the Change Drive menu and Disconnect dialog; +// see CPluginFSInterfaceEncapsulation::ChngDrvDuplicateItemIndex int GetIndexForDrvText(CPluginFSInterfaceEncapsulation** fsList, int count, CPluginFSInterfaceAbstract* fsIface, int currentIndex); //****************************************************************************** -// pomoci TweakUI si mohou uzivatele menit ikonku shortcuty (default, custom, zadna) -// tato funkce vytahne HShortcutOverlayXX -// existujici zahodi +// using TweakUI users can change the shortcut icon (default, custom or none) +// this function obtains HShortcutOverlayXX and discards any existing one BOOL GetShortcutOverlay(); -// vraci textovou podobou 'hotKey' (LOBYTE=vk, HIBYTE=mods), 'buff' musi mit nejmene 50 znaku +// returns a textual representation of 'hotKey' (LOBYTE=vk, HIBYTE=mods); 'buff' must have at least 50 characters void GetHotKeyText(WORD hotKey, char* buff); -// vraci bits per pixel displeje +// returns the display bits per pixel int GetCurrentBPP(HDC hDC = NULL); -// iteruje pres parenty smerem k tomu nejparentovanejsimu +// iterates through parents up to the topmost one HWND GetTopLevelParent(HWND hWindow); //****************************************************************************** -// promenne pouzite behem ukladani konfigurace pri shutdownu, log-offu nebo restartu (musime -// pumpovat zpravy, aby nas system nesestrelil jako "not responding" softik) +// variables used while saving the configuration during shutdown, logoff, or restart +// we must pump messages so the system does not kill us as a "not responding" application class CWaitWindow; -extern CWaitWindow* GlobalSaveWaitWindow; // pokud existuje globalni wait okenko pro Save, je zde (jinak je zde NULL) -extern int GlobalSaveWaitWindowProgress; // aktualni hodnota progresu globalniho wait okenka pro Save +extern CWaitWindow* GlobalSaveWaitWindow; // if a global wait window for Save exists, it is stored here (otherwise NULL) +extern int GlobalSaveWaitWindowProgress; // current progress value of the global wait window for Save -extern BOOL IsSetSALAMANDER_SAVE_IN_PROGRESS; // TRUE = v registry je vytvorena hodnota SALAMANDER_SAVE_IN_PROGRESS (detekce preruseni ukladani konfigurace) +extern BOOL IsSetSALAMANDER_SAVE_IN_PROGRESS; // TRUE if the SALAMANDER_SAVE_IN_PROGRESS value exists in the registry (used to detect interrupted configuration saving) //****************************************************************************** -// podpurna struktura a funkce pro otevreni kontextoveho menu + spousteni jeho polozek -// v CSalamanderGeneral::OpenNetworkContextMenu() +// helper structure and functions for opening a context menu and executing its items +// in CSalamanderGeneral::OpenNetworkContextMenu() struct CTmpEnumData { @@ -2369,70 +2382,70 @@ void ShellActionAux6(CFilesWindow* panel); //****************************************************************************** -// vraci v 'path' (buffer aspon MAX_PATH znaku) cestu Configuration.IfPathIsInaccessibleGoTo; -// zohlednuje nastaveni Configuration.IfPathIsInaccessibleGoToIsMyDocs +// returns in 'path' (buffer at least MAX_PATH characters) the path Configuration.IfPathIsInaccessibleGoTo; +// respects the setting Configuration.IfPathIsInaccessibleGoToIsMyDocs void GetIfPathIsInaccessibleGoTo(char* path, BOOL forceIsMyDocs = FALSE); -// nacte z konfigurace v registry konfiguraci icon overlay handleru +// loads icon overlay handler configuration from the registry void LoadIconOvrlsInfo(const char* root); -// vraci TRUE pokud je icon overlay handler zakazany (nebo jsou zakazane vsechny) +// returns TRUE if the icon overlay handler is disabled (or if all icon overlay handlers are disabled) BOOL IsDisabledCustomIconOverlays(const char* name); -// vraci TRUE pokud je icon overlay handler v seznamu zakazanych icon overlay handleru +// returns TRUE if the icon overlay handler is in the list of disabled icon overlay handlers BOOL IsNameInListOfDisabledCustomIconOverlays(const char* name); -// vycisti seznam zakazanych icon overlay handleru +// clears the list of disabled icon overlay handlers void ClearListOfDisabledCustomIconOverlays(); -// prida 'name' do seznamu zakazanych icon overlay handleru +// adds 'name' to the list of disabled icon overlay handlers BOOL AddToListOfDisabledCustomIconOverlays(const char* name); -// nacte ikonu z ImageResDLL +// loads an icon from ImageResDLL HICON SalLoadImage(int vistaResID, int otherResID, int cx, int cy, UINT flags); -// nacte ikonu pro archivy +// loads an icon for archives HICON LoadArchiveIcon(int cx, int cy, UINT flags); -// ziska login pro zadanou sitovou cestu, pripadne obnovi jeji mapovani +// obtains login credentials for the given network path and optionally restores its mapping BOOL RestoreNetworkConnection(HWND parent, const char* name, const char* remoteName, DWORD* retErr = NULL, LPNETRESOURCE lpNetResource = NULL); -// sestavi text do sloupce Type v panelu pro neasociovany soubor (napr. "AAA File" nebo "File") +// builds the text for the Type column in the panel for an unassociated file (e.g. "AAA File" or "File") void GetCommonFileTypeStr(char* buf, int* resLen, const char* ext); -// najde zdvojene separatory a vymaze ty nadbytecne (na Viste se mi objevily zdvojene -// separatory v kontextovem menu na .bar souborech) +// finds duplicate separators and removes the redundant ones (on Vista duplicate +// separators appeared in the context menu on .bar files) void RemoveUselessSeparatorsFromMenu(HMENU h); -// vraci adresar "Open Salamander" na ceste CSIDL_APPDATA do 'buf' (buffer o velikosti MAX_PATH) +// returns the "Open Salamander" directory in the CSIDL_APPDATA path in 'buf' (buffer of size MAX_PATH) BOOL GetOurPathInRoamingAPPDATA(char* buf); -// vytvori adresar "Open Salamander" na ceste CSIDL_APPDATA; vraci TRUE pokud se cesta -// vejde do MAX_PATH (jeji existence neni zarucena, vysledek CreateDirectory se nekontroluje); -// neni-li 'buf' NULL, jde o buffer o velikosti MAX_PATH, ve kterem se vraci tato cesta -// POZOR: pouziti jen Vista+ +// creates the "Open Salamander" directory in the CSIDL_APPDATA path; returns TRUE if the path +// fits into MAX_PATH (its existence is not guaranteed and the result of CreateDirectory is not checked); +// if 'buf' is not NULL it is a buffer of size MAX_PATH that receives this path +// NOTE: Vista+ only BOOL CreateOurPathInRoamingAPPDATA(char* buf); #ifndef _WIN64 -// jen 32-bitova verze pod jen Win64: zjistuje jestli jde o cestu, kterou redirector presmeruje do -// SysWOW64 nebo naopak zpet do System32 +// 32-bit version on Win64 only: checks whether the path is redirected by the +// file system redirector to SysWOW64 or back to System32 BOOL IsWin64RedirectedDir(const char* path, char** lastSubDir, BOOL failIfDirWithSameNameExists); -// jen 32-bitova verze pod Win64: zjistuje jestli selectiona obsahuje pseudo-adresar, ktery redirector -// presmeruje do SysWOW64 nebo naopak zpet do System32 a zaroven na disku neexistuje stejne pojmenovany -// adresar (pseudo-adresar pridany jen na zaklade AddWin64RedirectedDir) +// 32-bit build on Win64 only: tests whether the selection contains a pseudo +// directory that the redirector sends to SysWOW64 or back to System32 while no +// real directory with the same name exists on disk (pseudo-directories are +// added only via AddWin64RedirectedDir) BOOL ContainsWin64RedirectedDir(CFilesWindow* panel, int* indexes, int count, char* redirectedDir, BOOL onlyAdded); #endif // _WIN64 -// nase varianty funkci RegQueryValue a RegQueryValueEx, narozdil od API variant -// zajistuji pridani null-terminatoru pro typy REG_SZ, REG_MULTI_SZ a REG_EXPAND_SZ -// POZOR: pri zjistovani potrebne velikosti bufferu vraci o jeden nebo dva (dva -// jen u REG_MULTI_SZ) znaky vic pro pripad, ze by string bylo potreba -// zakoncit nulou/nulami +// our variants of RegQueryValue and RegQueryValueEx add a null terminator for +// REG_SZ, REG_MULTI_SZ and REG_EXPAND_SZ values unlike their API counterparts. +// WARNING: when calculating the required buffer size they return one extra +// character (two for REG_MULTI_SZ) in case the string needs terminating nulls extern "C" { LONG SalRegQueryValue(HKEY hKey, LPCSTR lpSubKey, LPSTR lpData, PLONG lpcbData); @@ -2440,16 +2453,17 @@ extern "C" LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData); } -// Win7 a novejsi OS - notifikace od taskbar, ze doslo k vytvoreni tlacitka pro okno -// nastavuje se pri startu Salamandera, testovat zda je nenulova +// Notification from the taskbar on Win7 and newer that a button was created for +// our window. Set at startup, check that it is non-zero extern UINT TaskbarBtnCreatedMsg; -// vrati rozmer ikony s ohledem na promennou SystemDPI -// pokud je 'large' TRUE, vraci rozmer pro velkou ikonu, jinak pro malou +// returns the icon size with respect to SystemDPI +// if 'large' is TRUE returns the size for a large icon, otherwise for a small one int GetIconSizeForSystemDPI(CIconSizeEnum iconSize); -// vraci aktualni systemove DPI (96, 120, 144, ...) +// returns the current system DPI (96, 120, 144, ...) int GetSystemDPI(); -// vraci scale odpovidajici aktualnimu DPI; misto 1.0 vraci 100, pro 1.25 vraci 125, atd +// returns the scale corresponding to the current DPI; instead of 1.0 returns +// 100, for 1.25 returns 125, etc. int GetScaleForSystemDPI(); From 2ff0f57a221864997c41ffa4a432867178aecae2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 09:48:30 +0200 Subject: [PATCH 580/710] [translation] Initial src/fileswnb.cpp comments translation (#956) --- src/fileswnb.cpp | 343 ++++++++++++++++++++++++----------------------- 1 file changed, 172 insertions(+), 171 deletions(-) diff --git a/src/fileswnb.cpp b/src/fileswnb.cpp index bb9328661..3a74698c3 100644 --- a/src/fileswnb.cpp +++ b/src/fileswnb.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -22,10 +23,10 @@ extern "C" //**************************************************************************** -// definujeme GUID udalosti "Lock Volume" (napr. "chkdsk /f E:", kde E: je USB stick): {50708874-C9AF-11D1-8FEF-00A0C9A06D32} +// define the "Lock Volume" event GUID (e.g., "chkdsk /f E:" where E: is a USB stick): {50708874-C9AF-11D1-8FEF-00A0C9A06D32} GUID GUID_IO_LockVolume = {0x50708874, 0xC9AF, 0x11D1, 0x8F, 0xEF, 0x00, 0xA0, 0xC9, 0xA0, 0x6D, 0x32}; // -// v Ioevent.h z DDK je definice teto konstanty (a mnoha dalsich): +// in Ioevent.h from the DDK, this constant (and many others) is defined: // // Volume lock event. This event is signalled when an attempt is made to // lock a volume. There is no additional data. @@ -68,7 +69,7 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) HCURSOR oldCur; switch (uMsg) { - //--- roztahovani listboxu po celem okne + //--- expanding the listbox over the entire window case WM_SIZE: { if (ListBox != NULL && ListBox->HWindow != NULL && StatusLine != NULL && DirectoryLine != NULL) @@ -143,16 +144,16 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) // TRACE_I("WM_DEVICECHANGE: DBT_CUSTOMEVENT"); if (IsCustomEventGUID(lParam, GUID_IO_LockVolume)) - { // chodi na XPckach, kdyz se spusti "chkdsk /f e:" ("e:" je removable USB stick) a bohuzel taky pri otevirani .ifo a .vob souboru (DVD) a pri spousteni Ashampoo Burning Studio 6 -- zadost "lock volume" + { // occurs on XP when "chkdsk /f e:" ("e:" is a removable USB stick) is run, and unfortunately also when opening .ifo and .vob files (DVD) and when starting Ashampoo Burning Studio 6 -- "lock volume" request if (UseSystemIcons || UseThumbnails) - SleepIconCacheThread(); // pozastavime cteni ikonek/thumbnailu - DetachDirectory((CFilesWindow*)this, TRUE); // zavreme change-notifikace + DeviceNotification + SleepIconCacheThread(); // pause reading icons/thumbnails + DetachDirectory((CFilesWindow*)this, TRUE); // close change notifications and DeviceNotification HANDLES(EnterCriticalSection(&TimeCounterSection)); int t1 = MyTimeCounter++; HANDLES(LeaveCriticalSection(&TimeCounterSection)); BOOL salIsActive = GetForegroundWindow() == MainWindow->HWindow; - PostMessage(HWindow, WM_USER_REFRESH_DIR_EX, salIsActive, t1); // refresh obnovi cteni ikon/thumbnailu + otevre opet change-notifikace + DeviceNotification; vime, ze jde pravdepodobne o zbytecny refresh + PostMessage(HWindow, WM_USER_REFRESH_DIR_EX, salIsActive, t1); // refresh resumes icon/thumbnail reading and reopens change notifications and DeviceNotification; we know this is probably an unnecessary refresh } break; } @@ -160,8 +161,8 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case DBT_DEVICEQUERYREMOVE: { // TRACE_I("WM_DEVICECHANGE: DBT_DEVICEQUERYREMOVE"); - DetachDirectory((CFilesWindow*)this, TRUE, FALSE); // bez zavreni DeviceNotification - return TRUE; // povolime odstraneni tohoto device + DetachDirectory((CFilesWindow*)this, TRUE, FALSE); // without closing DeviceNotification + return TRUE; // allow removal of this device } case DBT_DEVICEQUERYREMOVEFAILED: @@ -176,7 +177,7 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) { // if (wParam == DBT_DEVICEREMOVEPENDING) TRACE_I("WM_DEVICECHANGE: DBT_DEVICEREMOVEPENDING"); // else TRACE_I("WM_DEVICECHANGE: DBT_DEVICEREMOVECOMPLETE"); - DetachDirectory((CFilesWindow*)this, TRUE); // zavreme DeviceNotification + DetachDirectory((CFilesWindow*)this, TRUE); // close DeviceNotification if (MainWindow->LeftPanel == this) { if (!ChangeLeftPanelToFixedWhenIdleInProgress) @@ -204,7 +205,7 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) { ProgressDialogActivateDrop = LastWndFromGetData; UnpackZIPArchive(NULL, FALSE, tgtPath); - ProgressDialogActivateDrop = NULL; // pro dalsi pouziti progress dialogu musime globalku vycistit + ProgressDialogActivateDrop = NULL; // clear global variable for further use of progress dialog SHChangeNotify(SHCNE_UPDATEDIR, SHCNF_PATH, tgtPath, NULL); } free(tgtPath); @@ -223,22 +224,22 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) { int count = GetSelCount(); if (count > 0 || GetCaretIndex() != 0 || - Dirs->Count == 0 || strcmp(Dirs->At(0).Name, "..") != 0) // test jestli se nepracuje jen s ".." + Dirs->Count == 0 || strcmp(Dirs->At(0).Name, "..") != 0) // check whether we are working only with ".." { - BeginSuspendMode(); // cmuchal si da pohov - BeginStopRefresh(); // jen aby se nedistribuovaly zpravy o zmenach na cestach + BeginSuspendMode(); // snooper takes a break + BeginStopRefresh(); // just to avoid distributing notifications about path changes UserWorkedOnThisPath = TRUE; - StoreSelection(); // ulozime selection pro prikaz Restore Selection + StoreSelection(); // save the selection for the Restore Selection command ProgressDialogActivateDrop = LastWndFromGetData; int selectedDirs = 0; if (count > 0) { - // spocitame kolik adresaru je oznaceno (zbytek oznacenych polozek jsou soubory) + // count how many directories are selected (the rest of the marked items are files) int i; - for (i = 0; i < Dirs->Count; i++) // ".." nemuzou byt oznaceny, test by byl zbytecny + for (i = 0; i < Dirs->Count; i++) // ".." cannot be selected, so the test would be pointless { if (Dirs->At(i).Selected) selectedDirs++; @@ -253,16 +254,16 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) BOOL cancelOrHandlePath = FALSE; char targetPath[2 * MAX_PATH]; lstrcpyn(targetPath, tgtPath, 2 * MAX_PATH - 1); - if (tgtPath[0] == '\\' && tgtPath[1] == '\\' || // UNC cesta - tgtPath[0] != 0 && tgtPath[1] == ':') // klasicka diskova cesta (C:\path) + if (tgtPath[0] == '\\' && tgtPath[1] == '\\' || // UNC path + tgtPath[0] != 0 && tgtPath[1] == ':') // regular disk path (C:\path) { int l = (int)strlen(targetPath); if (l > 3 && targetPath[l - 1] == '\\') - targetPath[l - 1] = 0; // krom "c:\" zrusime koncovy backslash + targetPath[l - 1] = 0; // except for "c:\" remove the trailing backslash } - targetPath[strlen(targetPath) + 1] = 0; // zajistime dve nuly na konci retezce + targetPath[strlen(targetPath) + 1] = 0; // ensure two nulls at the end of the string - // snizime prioritu threadu na "normal" (aby operace prilis nezatezovaly stroj) + // lower thread priority to "normal" so the operation does not put too much load on the system SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_NORMAL); BOOL ret = GetPluginFS()->CopyOrMoveFromFS(copy, 5, GetPluginFS()->GetPluginFSName(), @@ -272,33 +273,33 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) cancelOrHandlePath, ProgressDialogActivateDrop); - // opet zvysime prioritu threadu, operace dobehla + // increase thread priority again; the operation has finished SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL); if (ret && !cancelOrHandlePath) { - if (targetPath[0] != 0) // zmena fokusu na 'targetPath' + if (targetPath[0] != 0) // change the focus to 'targetPath' { lstrcpyn(NextFocusName, targetPath, MAX_PATH); - // RefreshDirectory nemusi probehnout - zdroj se nemusel zmenit - pro sichr postneme message + // RefreshDirectory may not run; the source may be unchanged, so post a message just in case PostMessage(HWindow, WM_USER_DONEXTFOCUS, 0, 0); } - // uspesna operace, ale zdroj neodznacime, protoze jde o drag&drop - // SetSel(FALSE, -1, TRUE); // explicitni prekresleni + // successful operation, but do not deselect the source because this is drag&drop + // SetSel(FALSE, -1, TRUE); // explicit redraw // PostMessage(HWindow, WM_USER_SELCHANGED, 0, 0); // sel-change notify UpdateWindow(MainWindow->HWindow); } - ProgressDialogActivateDrop = NULL; // pro dalsi pouziti progress dialogu musime globalku vycistit - if (tgtPath[0] == '\\' && tgtPath[1] == '\\' || // UNC cesta - tgtPath[0] != 0 && tgtPath[1] == ':') // klasicka diskova cesta (C:\path) + ProgressDialogActivateDrop = NULL; // clear the global variable for further use of the progress dialog + if (tgtPath[0] == '\\' && tgtPath[1] == '\\' || // UNC path + tgtPath[0] != 0 && tgtPath[1] == ':') // regular disk path (C:\path) { SHChangeNotify(SHCNE_UPDATEDIR, SHCNF_PATH, tgtPath, NULL); } EndStopRefresh(); - EndSuspendMode(); // ted uz zase cmuchal nastartuje + EndSuspendMode(); // the snooper will start again now } } free(tgtPath); @@ -307,8 +308,8 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_USER_UPDATEPANEL: { - // nekdo rozdistribuoval zpravy (otevrel se messagebox) a je treba updatnou - // obsah panelu + // someone dispatched messages (a message box opened) and the panel + // content must be updated RefreshListBox(0, -1, -1, FALSE, FALSE); return 0; } @@ -316,20 +317,20 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_USER_ENTERMENULOOP: case WM_USER_LEAVEMENULOOP: { - // pouze predame hlavnimu oknu + // just pass it to the main window return SendMessage(MainWindow->HWindow, uMsg, wParam, lParam); } case WM_USER_CONTEXTMENU: { CMenuPopup* popup = (CMenuPopup*)(CGUIMenuPopupAbstract*)wParam; - // pokud je nad timto panelem otevrene Alt+F1(2) menu a RClick patri jemu, - // predame mu notifikaci + // if the Alt+F1(2) menu is open above this panel and the RClick belongs to it, + // pass the notification to it if (OpenedDrivesList != NULL && OpenedDrivesList->GetMenuPopup() == popup) { return OpenedDrivesList->OnContextMenu((BOOL)lParam, -1, PANEL_SOURCE, NULL); } - return FALSE; //p.s. nespoustet prikaz, neotevirat submenu + return FALSE; //p.s. do not run the command, do not open the submenu } case WM_TIMER: @@ -337,7 +338,7 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (wParam == IDT_SM_END_NOTIFY) { KillTimer(HWindow, IDT_SM_END_NOTIFY); - if (SmEndNotifyTimerSet) // nejde jen o "zatoulany" WM_TIMER + if (SmEndNotifyTimerSet) // not just a stray WM_TIMER PostMessage(HWindow, WM_USER_SM_END_NOTIFY_DELAYED, 0, 0); SmEndNotifyTimerSet = FALSE; return 0; @@ -347,7 +348,7 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (wParam == IDT_REFRESH_DIR_EX) { KillTimer(HWindow, IDT_REFRESH_DIR_EX); - if (RefreshDirExTimerSet) // nejde jen o "zatoulany" WM_TIMER + if (RefreshDirExTimerSet) // not just a stray WM_TIMER PostMessage(HWindow, WM_USER_REFRESH_DIR_EX_DELAYED, FALSE, RefreshDirExLParam); RefreshDirExTimerSet = FALSE; return 0; @@ -357,7 +358,7 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (wParam == IDT_ICONOVRREFRESH) { KillTimer(HWindow, IDT_ICONOVRREFRESH); - if (IconOvrRefreshTimerSet && // nejde jen o "zatoulany" WM_TIMER + if (IconOvrRefreshTimerSet && // not just a stray WM_TIMER Configuration.EnableCustomIconOverlays && Is(ptDisk) && (UseSystemIcons || UseThumbnails) && IconCache != NULL) { @@ -374,7 +375,7 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (wParam == IDT_INACTIVEREFRESH) { KillTimer(HWindow, IDT_INACTIVEREFRESH); - if (InactiveRefreshTimerSet) // nejde jen o "zatoulany" WM_TIMER + if (InactiveRefreshTimerSet) // not just a stray WM_TIMER { // TRACE_I("Timer IDT_INACTIVEREFRESH: posting refresh!"); PostMessage(HWindow, WM_USER_INACTREFRESH_DIR, FALSE, InactRefreshLParam); @@ -400,12 +401,12 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) else PostMessage(HWindow, WM_USER_REFRESH_DIR_EX_DELAYED, FALSE, lParam); } - else // cekame na poslani WM_USER_REFRESH_DIR_EX_DELAYED + else // waiting for WM_USER_REFRESH_DIR_EX_DELAYED to be sent { - if (RefreshDirExLParam < lParam) // vezmeme "novejsi" cas + if (RefreshDirExLParam < lParam) // take the "newer" time RefreshDirExLParam = lParam; - KillTimer(HWindow, IDT_REFRESH_DIR_EX); // timer nahodime znovu, aby pomaly byl pomaly (5000ms) a rychly byl rychly (200ms) - zkratka nesmi zalezet na typu predchoziho refreshe + KillTimer(HWindow, IDT_REFRESH_DIR_EX); // restart timer so slow remains slow (5000ms) and fast remains fast (200ms) - the previous refresh type must not matter if (!SetTimer(HWindow, IDT_REFRESH_DIR_EX, wParam ? 5000 : 200, NULL)) { RefreshDirExTimerSet = FALSE; @@ -429,52 +430,52 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) } else return 0; - // tady break nechybi -- pokud se nepovede zalozit timer, provede se WM_USER_SM_END_NOTIFY_DELAYED hned + // the break is not missing -- if the timer cannot be started, WM_USER_SM_END_NOTIFY_DELAYED runs immediately } - //--- byl ukoncen suspend mode, podivame se, jestli nepotrebujeme refresh + //--- suspend mode ended; check if a refresh is needed case WM_USER_SM_END_NOTIFY_DELAYED: { if (SnooperSuspended || StopRefresh) - return 0; // pockame na dalsi WM_USER_SM_END_NOTIFY_DELAYED - if (PluginFSNeedRefreshAfterEndOfSM) // ma dojit k refreshi plug-in FS? + return 0; // wait for the next WM_USER_SM_END_NOTIFY_DELAYED + if (PluginFSNeedRefreshAfterEndOfSM) // should the plugin FS be refreshed? { PluginFSNeedRefreshAfterEndOfSM = FALSE; - PostMessage(HWindow, WM_USER_REFRESH_PLUGINFS, 0, 0); // zkusime ho provest ted + PostMessage(HWindow, WM_USER_REFRESH_PLUGINFS, 0, 0); // attempt it now } - if (NeedRefreshAfterEndOfSM) // ma dojit k refreshi? + if (NeedRefreshAfterEndOfSM) // should a refresh occur? { NeedRefreshAfterEndOfSM = FALSE; lParam = RefreshAfterEndOfSMTime; - wParam = FALSE; // nebudeme nahazovat RefreshFinishedEvent + wParam = FALSE; // do not trigger RefreshFinishedEvent } else return 0; } - //--- v adresari byla zaznamenana zmena obsahu pri suspend modu + //--- a directory content change was recorded during suspend mode case WM_USER_S_REFRESH_DIR: { - if (uMsg == WM_USER_S_REFRESH_DIR && // zmena obsahu zaznamenana behem suspend modu + if (uMsg == WM_USER_S_REFRESH_DIR && // content change recorded during suspend mode !IconCacheValid && UseSystemIcons && Is(ptDisk) && GetNetworkDrive()) { // TRACE_I("Delaying refresh from suspend mode until all icons are read."); NeedRefreshAfterIconsReading = TRUE; RefreshAfterIconsReadingTime = max(RefreshAfterIconsReadingTime, (int)lParam); if (wParam) - SetEvent(RefreshFinishedEvent); // nejspis zbytecne, ale je to v popisu WM_USER_S_REFRESH_DIR - return 0; // hlaseni o zmene jsme poznamenali (refresh se postne az se dokonci cteni ikonek), koncime zpracovani + SetEvent(RefreshFinishedEvent); // probably unnecessary but mentioned in WM_USER_S_REFRESH_DIR docs + return 0; // we noted the change (refresh will be posted once icon reading ends); stop processing } setWait = FALSE; if (lParam >= LastRefreshTime) - { // nejde o zbytecny stary refresh - setWait = (GetCursor() != LoadCursor(NULL, IDC_WAIT)); // ceka uz ? + { // not an unnecessary old refresh + setWait = (GetCursor() != LoadCursor(NULL, IDC_WAIT)); // already waiting? if (setWait) oldCur = SetCursor(LoadCursor(NULL, IDC_WAIT)); DWORD err = CheckPath(FALSE, NULL, ERROR_SUCCESS, !SnooperSuspended && !StopRefresh); if (err == ERROR_SUCCESS) { - if (GetMonitorChanges()) // snooper ho mozna vykopnul ze seznamu + if (GetMonitorChanges()) // the snooper might have removed it from the list ChangeDirectory(this, GetPath(), MyGetDriveType(GetPath()) == DRIVE_REMOVABLE); } else @@ -487,7 +488,7 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) } } } - //--- bylo ukonceno cteni ikonek, podivame se, jestli nepotrebujeme refresh + //--- icon reading has finished; check whether a refresh is needed case WM_USER_ICONREADING_END: { // TRACE_I("WM_USER_ICONREADING_END"); @@ -496,19 +497,19 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) { IconCacheValid = TRUE; EndOfIconReadingTime = GetTickCount(); - if (NeedRefreshAfterIconsReading) // ma dojit k refreshi? + if (NeedRefreshAfterIconsReading) // should we refresh? { // TRACE_I("Doing delayed refresh (all icons are read)."); NeedRefreshAfterIconsReading = FALSE; lParam = RefreshAfterIconsReadingTime; - wParam = FALSE; // nebudeme nahazovat RefreshFinishedEvent + wParam = FALSE; // do not trigger RefreshFinishedEvent setWait = FALSE; - probablyUselessRefresh = TRUE; // nejspis jen refresh vyvolany chybne systemem po nacitani ikonek ze sitoveho drivu + probablyUselessRefresh = TRUE; // probably just a refresh wrongly triggered by the system after loading icons from a network drive // TRACE_I("delayed refresh (after reading of all icons): probablyUselessRefresh=TRUE"); } else { - if (NeedIconOvrRefreshAfterIconsReading) // refreshneme icon-overlays + if (NeedIconOvrRefreshAfterIconsReading) // refresh icon overlays { NeedIconOvrRefreshAfterIconsReading = FALSE; @@ -525,7 +526,7 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) } } } - //--- v adresari byla zaznamenana zmena obsahu + //--- a directory content change was recorded case WM_USER_REFRESH_DIR: case WM_USER_REFRESH_DIR_EX_DELAYED: case WM_USER_INACTREFRESH_DIR: @@ -535,30 +536,30 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) { if (GetTickCount() - EndOfIconReadingTime < 1000) { - probablyUselessRefresh = TRUE; // do 1 sekundy po dokonceni cteni ikon jeste ocekavame zbytecny refresh zpusobeny ctenim ikonek + probablyUselessRefresh = TRUE; // for one second after icon reading finishes, we still expect a redundant refresh caused by reading icons // TRACE_I("less than second after reading of icons was finished: probablyUselessRefresh=TRUE"); } else { - probablyUselessRefresh = (uMsg == WM_USER_REFRESH_DIR_EX_DELAYED || uMsg == WM_USER_INACTREFRESH_DIR); // jde o odlozeny refresh, ktery muze byt take zbytecny (takhle se zamezi nekonecnemu cyklu pri cteni ikon na sitovem disku, ktere vyvolava dalsi refresh) + probablyUselessRefresh = (uMsg == WM_USER_REFRESH_DIR_EX_DELAYED || uMsg == WM_USER_INACTREFRESH_DIR); // deferred refresh that may also be useless (prevents an endless loop when reading icons on network drives triggers more refreshes) // TRACE_I("WM_USER_REFRESH_DIR_EX_DELAYED or WM_USER_INACTREFRESH_DIR: probablyUselessRefresh=" << probablyUselessRefresh); } } - if ((uMsg == WM_USER_REFRESH_DIR && wParam || // zmena obsahu hlasena snooperem - uMsg == WM_USER_ICONREADING_END || // nebo hlaseni konce cteni ikonek (muze prijit pozde, uz se zase muzou cist ikonky) - uMsg == WM_USER_INACTREFRESH_DIR) && // nebo odlozeny refresh v neaktivnim okne (jde o refresh vyzadany snooperem nebo pri ukonceni suspend modu) + if ((uMsg == WM_USER_REFRESH_DIR && wParam || // content change reported by the snooper + uMsg == WM_USER_ICONREADING_END || // or a notification that icon reading finished (it may arrive later, and icon reading may already have restarted) + uMsg == WM_USER_INACTREFRESH_DIR) && // or deferred refresh in an inactive window (refresh requested by the snooper or when ending suspend mode) !IconCacheValid && UseSystemIcons && Is(ptDisk) && GetNetworkDrive()) { // TRACE_I("Delaying refresh until all icons are read."); NeedRefreshAfterIconsReading = TRUE; RefreshAfterIconsReadingTime = max(RefreshAfterIconsReadingTime, (int)lParam); - // hlaseni o zmene jsme poznamenali (refresh se postne az se dokonci cteni ikonek), koncime zpracovani + // the change notification was recorded (refresh will be posted once icon reading finishes), stopping processing } else { if (SnooperSuspended || StopRefresh) - { // uz je zapnuty suspend mode (pracuje se nad vnitrnimi daty -> nelze je refreshnout) + { // suspend mode is already on (working with internal data -> cannot refresh) NeedRefreshAfterEndOfSM = TRUE; RefreshAfterEndOfSMTime = max(RefreshAfterEndOfSMTime, (int)lParam); if ((uMsg == WM_USER_S_REFRESH_DIR || uMsg == WM_USER_SM_END_NOTIFY_DELAYED) && setWait) @@ -566,20 +567,20 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) SetCursor(oldCur); } } - else // nejde o refresh v suspend modu + else // not a refresh during suspend mode { - if (lParam >= LastRefreshTime) // nejde o zbytecny stary refresh + if (lParam >= LastRefreshTime) // not an unnecessary old refresh { BOOL isInactiveRefresh = FALSE; BOOL skipRefresh = FALSE; - if ((uMsg == WM_USER_REFRESH_DIR && wParam || // zmena obsahu hlasena snooperem - uMsg == WM_USER_ICONREADING_END || // nebo hlaseni konce cteni ikonek (odlozeny refresh vyzadany snooperem + po ukonceni suspend modu) - uMsg == WM_USER_INACTREFRESH_DIR) && // nebo odlozeny refresh v neaktivnim okne (jde o refresh vyzadany snooperem nebo pri ukonceni suspend modu) - GetForegroundWindow() != MainWindow->HWindow) // neaktivni hlavni okno Salamandera: pribrzdime refreshe, je-li treba + if ((uMsg == WM_USER_REFRESH_DIR && wParam || // content change reported by the snooper + uMsg == WM_USER_ICONREADING_END || // or notification that icon reading finished (deferred refresh requested by the snooper + after ending suspend mode) + uMsg == WM_USER_INACTREFRESH_DIR) && // or deferred refresh in an inactive window (refresh requested by the snooper or when ending suspend mode) + GetForegroundWindow() != MainWindow->HWindow) // inactive Salamander main window: slow down refreshes if needed { // TRACE_I("Refresh from snooper in inactive window"); isInactiveRefresh = TRUE; - if (LastInactiveRefreshStart != LastInactiveRefreshEnd) // nejaky refresh uz probehl od posledni deaktivace + if (LastInactiveRefreshStart != LastInactiveRefreshEnd) // some refresh already happened since the last deactivation { DWORD delay = 20 * (LastInactiveRefreshEnd - LastInactiveRefreshStart); // TRACE_I("Calculated delay between refreshes is " << delay); @@ -590,11 +591,11 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) // TRACE_I("Delay between refreshes is " << delay); DWORD ti = GetTickCount(); // TRACE_I("Last refresh was before " << ti - LastInactiveRefreshEnd); - if (InactiveRefreshTimerSet || // timer uz bezi, jen na nej pockame - ti - LastInactiveRefreshEnd + 100 < delay) // +100 aby se timer nenahazoval "zbytecne" (at je odklad refreshe aspon o 100ms) + if (InactiveRefreshTimerSet || // timer already running, just wait for it + ti - LastInactiveRefreshEnd + 100 < delay) // +100 so the timer isn't needlessly set (ensures at least a 100ms refresh delay) { // TRACE_I("Delaying refresh"); - if (!InactiveRefreshTimerSet) // timer jeste nebezi, zalozime ho + if (!InactiveRefreshTimerSet) // timer not running yet, create it { // TRACE_I("Setting timer"); if (SetTimer(HWindow, IDT_INACTIVEREFRESH, max(200, delay - (ti - LastInactiveRefreshEnd)), NULL)) @@ -604,11 +605,11 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) skipRefresh = TRUE; } } - else // timer uz bezi, jen na nej pockame + else // timer is already running; just wait for it { // TRACE_I("Timer already set"); if (lParam > InactRefreshLParam) - InactRefreshLParam = lParam; // prevezmeme novejsi cas do InactRefreshLParam + InactRefreshLParam = lParam; // use the newer time for InactRefreshLParam skipRefresh = TRUE; } } @@ -619,7 +620,7 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (uMsg == WM_USER_REFRESH_DIR || uMsg == WM_USER_REFRESH_DIR_EX_DELAYED || uMsg == WM_USER_ICONREADING_END || uMsg == WM_USER_INACTREFRESH_DIR) { - setWait = (GetCursor() != LoadCursor(NULL, IDC_WAIT)); // ceka uz ? + setWait = (GetCursor() != LoadCursor(NULL, IDC_WAIT)); // already waiting? if (setWait) oldCur = SetCursor(LoadCursor(NULL, IDC_WAIT)); } @@ -627,7 +628,7 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) CPanelType typeBackup; if (isInactiveRefresh) { - lstrcpyn(pathBackup, GetPath(), MAX_PATH); // zajimaji nas jen diskove cesty a cesty do archivu (u plugin-FS nas snooper o zmenach neinformuje) + lstrcpyn(pathBackup, GetPath(), MAX_PATH); // we care only about disk paths and archive paths (the snooper does not report changes for plugin FS) typeBackup = GetPanelType(); LastInactiveRefreshStart = GetTickCount(); } @@ -641,17 +642,17 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (isInactiveRefresh) { if (typeBackup != GetPanelType() || StrICmp(pathBackup, GetPath()) != 0) - { // pokud doslo ke zmene cesty (nejspis nekdo prave smazal adresar zobrazeny v panelu), provedeme pripadny dalsi refresh bez cekani (da se ocekavat, ze smazou i adresar nove zobrazeny v panelu, tak abysme z nej umeli rychle "vycouvat") + { // if the path changed (someone likely deleted the directory shown in the panel), perform any further refresh immediately (the newly shown directory might be deleted as well, so we can quickly "back out" from it) LastInactiveRefreshEnd = LastInactiveRefreshStart; } else { LastInactiveRefreshEnd = GetTickCount(); if ((int)(LastInactiveRefreshEnd - LastInactiveRefreshStart) <= 0) - LastInactiveRefreshEnd = LastInactiveRefreshStart + 1; // nesmi byt shodne (to je stav "zatim zadny refresh") + LastInactiveRefreshEnd = LastInactiveRefreshStart + 1; // must not be equal (this means "no refresh yet") } } - /* // Petr: nevim proc bylo nastaveni LastRefreshTime az zde - logicky pokud dojde ke zmene behem refreshe, je nutne udelat dalsi refresh - sralo se to v Nethoodu, protoze enumeracni thread stihl postnout refresh jeste pred dokoncenim RefreshDirectory, tedy doslo k jeho vyignorovani (je to refresh behem refreshe) + /* // Petr: I do not know why LastRefreshTime was set only here - logically if a change occurs during a refresh, another refresh is necessary - it failed in Nethood because the enumeration thread posted a refresh before RefreshDirectory finished, so it was ignored (a refresh during a refresh) HANDLES(EnterCriticalSection(&TimeCounterSection)); LastRefreshTime = MyTimeCounter++; HANDLES(LeaveCriticalSection(&TimeCounterSection)); @@ -671,12 +672,12 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_USER_REFRESH_PLUGINFS: { if (SnooperSuspended || StopRefresh) - { // uz je zapnuty suspend mode (pracuje se nad vnitrnimi daty -> nelze je refreshnout) - // navic muzeme byt i uvnitr plug-inu -> vicenasobne volani metod plug-inu nepodporujeme + { // suspend mode is already on (working with internal data -> cannot refresh) + // moreover we might be inside a plugin -> multiple calls to plugin methods are not supported PluginFSNeedRefreshAfterEndOfSM = TRUE; } else - { // nejsme uvnitr plug-inu + { // we are not inside a plugin if (Is(ptPluginFS)) { if (GetPluginFS()->NotEmpty()) @@ -694,20 +695,20 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (uMsg == WM_USER_REFRESHINDEX) { - // pokud slo o nacteni "staticke" ikony asociace, ulozime ji do Associations (pocita - // i s thumbnaily - nedopadne podminka na Flag==1 nebo 2) - if (file != NULL && !isDir && // jde o soubor - (!Is(ptPluginFS) || GetPluginIconsType() != pitFromPlugin)) // nejde o ikonu z plug-inu + // if a "static" association icon was loaded, store it in Associations + // also covers thumbnails - the Flag==1 or 2 condition does not apply + if (file != NULL && !isDir && // this is a file + (!Is(ptPluginFS) || GetPluginIconsType() != pitFromPlugin)) // not an icon from a plugin { - char buf[MAX_PATH + 4]; // pripona malymi pismeny + char buf[MAX_PATH + 4]; // extension in lowercase char *s1 = buf, *s2 = file->Ext; while (*s2 != 0) *s1++ = LowerCase[*s2++]; *((DWORD*)s1) = 0; int index; CIconSizeEnum iconSize = IconCache->GetIconSize(); - if (Associations.GetIndex(buf, index) && // pripona ma ikonku (asociaci) - (Associations[index].GetIndex(iconSize) == -1 || // jde o ikonku, ktera se nacita + if (Associations.GetIndex(buf, index) && // the extension has an icon (association) + (Associations[index].GetIndex(iconSize) == -1 || // this icon is being loaded Associations[index].GetIndex(iconSize) == -3)) { int icon; @@ -715,16 +716,16 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) int srcIconListIndex; memmove(buf, file->Name, file->NameLen); *(DWORD*)(buf + file->NameLen) = 0; - if (IconCache->GetIndex(buf, icon, NULL, NULL) && // icon-thread ji nacita - (IconCache->At(icon).GetFlag() == 1 || IconCache->At(icon).GetFlag() == 2) && // ikona je nactena nova nebo stara + if (IconCache->GetIndex(buf, icon, NULL, NULL) && // the icon thread is loading it + (IconCache->At(icon).GetFlag() == 1 || IconCache->At(icon).GetFlag() == 2) && // icon is loaded new or old IconCache->GetIcon(IconCache->At(icon).GetIndex(), - &srcIconList, &srcIconListIndex)) // povede se ziskat nactenou ikonku - { // ikonka pro priponu -> icon-thread uz ji nacetl + &srcIconList, &srcIconListIndex)) // able to obtain the loaded icon + { // icon for the extension -> icon thread has already loaded it CIconList* dstIconList; int dstIconListIndex; int i = Associations.AllocIcon(&dstIconList, &dstIconListIndex, iconSize); - if (i != -1) // ziskali jsme misto pro novou ikonku - { // nakopirujeme si ji z IconCache do Associations + if (i != -1) // we obtained space for a new icon + { // copy it from IconCache to Associations Associations[index].SetIndex(i, iconSize); BOOL leaveSection; @@ -745,13 +746,13 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (!StopIconRepaint) { - // panely prekreslime pouze pokud odpovidaji velikosti ikon + // repaint panels only if the icon sizes match if (iconSize == GetIconSizeForCurrentViewMode()) - RepaintIconOnly(-1); // u nas vsechny + RepaintIconOnly(-1); // all of ours CFilesWindow* otherPanel = MainWindow->GetOtherPanel(this); if (iconSize == otherPanel->GetIconSizeForCurrentViewMode()) - otherPanel->RepaintIconOnly(-1); // a u sousedu vsechny + otherPanel->RepaintIconOnly(-1); // and all in the other panel } else PostAllIconsRepaint = TRUE; @@ -761,10 +762,10 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) } } - // provedeme prekresleni postizeneho indexu - if (file != NULL) // file se zde pouziva jen pro test na NULL + // redraw the affected index + if (file != NULL) // file is used here only as a NULL check { - if (!StopIconRepaint) // pokud je povoleno prekreslovani ikon + if (!StopIconRepaint) // if icon repainting is allowed RepaintIconOnly((int)wParam); else PostAllIconsRepaint = TRUE; @@ -800,7 +801,7 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_USER_CHANGEDIR: { - // postprocessing provedeme jen u cest, ktere jsme ziskali jako text (a ne primo dropnutim adresare) + // postprocess only paths obtained as text (not directly from a dropped directory) char buff[2 * MAX_PATH]; strcpy_s(buff, (char*)lParam); if (!(BOOL)wParam || PostProcessPathFromUser(HWindow, buff)) @@ -810,8 +811,8 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_USER_FOCUSFILE: { - // Musime okno vytahnout uz tady, protoze behem volani ChangeDir muze dojit - // k vyskoceni messageboxu (cesta neexistuje) a ten by zustal pod Findem. + // We must bring the window to the front here because calling ChangeDir can + // pop up a message box (the path does not exist) which would otherwise remain under Find. SetForegroundWindow(MainWindow->HWindow); if (IsIconic(MainWindow->HWindow)) { @@ -822,7 +823,7 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) { strcpy(NextFocusName, (char*)wParam); SendMessage(HWindow, WM_USER_DONEXTFOCUS, 0, 0); - // SetForegroundWindow(MainWindow->HWindow); // tady uz je pozde - presunuto nahoru + // SetForegroundWindow(MainWindow->HWindow); // it's too late here - moved above UpdateWindow(MainWindow->HWindow); } return 0; @@ -845,14 +846,14 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_USER_VIEWFILEWITH: { COpenViewerData* data = (COpenViewerData*)wParam; - ViewFile(data->FileName, FALSE, (DWORD)lParam, data->EnumFileNamesSourceUID, // FIXME_X64 - overit pretypovani na (DWORD) + ViewFile(data->FileName, FALSE, (DWORD)lParam, data->EnumFileNamesSourceUID, // FIXME_X64 - verify cast to (DWORD) data->EnumFileNamesLastFileIndex); return 0; } case WM_USER_EDITFILEWITH: { - EditFile((char*)wParam, (DWORD)lParam); // FIXME_X64 - overit pretypovani na (DWORD) + EditFile((char*)wParam, (DWORD)lParam); // FIXME_X64 - verify cast to (DWORD) return 0; } @@ -863,10 +864,10 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) // return 0; // } - case WM_USER_DONEXTFOCUS: // pokud to jiz nestihl RefreshDirectory, udelame to tady + case WM_USER_DONEXTFOCUS: // if RefreshDirectory did not manage it already, do it here { DontClearNextFocusName = FALSE; - if (NextFocusName[0] != 0) // je-li co fokusit + if (NextFocusName[0] != 0) // if there is anything to focus { int total = Files->Count + Dirs->Count; int found = -1; @@ -876,14 +877,14 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) CFileData* f = (i < Dirs->Count) ? &Dirs->At(i) : &Files->At(i - Dirs->Count); if (StrICmp(f->Name, NextFocusName) == 0) { - if (strcmp(f->Name, NextFocusName) == 0) // soubor nalezen presne + if (strcmp(f->Name, NextFocusName) == 0) // file found with exact case match { NextFocusName[0] = 0; SetCaretIndex(i, FALSE); break; } if (found == -1) - found = i; // soubor nalezen (ignore-case) + found = i; // file found (case-insensitive) } } if (i == total && found != -1) @@ -927,7 +928,7 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (plSizeValid || sizeValid && (!isDir || f->SizeValid)) selectedSize += plSizeValid ? plSize : f->Size; else - displaySize = FALSE; // soubor nezname velikosti nebo adresar bez zname/vypocitane velikosti + displaySize = FALSE; // file of unknown size or directory without known/calculated size } } if (files > 0 || dirs > 0) @@ -950,7 +951,7 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) StatusLine->SetSubTexts(varPlacements, varPlacementsCount); } else - varPlacementsCount = 100; // mohlo se poskodit + varPlacementsCount = 100; // might have been corrupted } } if (!done) @@ -965,7 +966,7 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) ExpandPluralFilesDirs(text, 200, files, dirs, epfdmSelected, FALSE); if (StatusLine->SetText(text) && displaySize) StatusLine->SetSubTexts(varPlacements, varPlacementsCount); - varPlacementsCount = 100; // mohlo se poskodit + varPlacementsCount = 100; // might have been corrupted } } else @@ -976,25 +977,25 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) { LastFocus = INT_MAX; int index = GetCaretIndex(); - ItemFocused(index); // pri odznaceni + ItemFocused(index); // when deselecting } - IdleRefreshStates = TRUE; // pri pristim Idle vynutime kontrolu stavovych promennych + IdleRefreshStates = TRUE; // at the next Idle enforce checking of state variables return 0; } case WM_CREATE: { - //--- pridani tohoto panelu do pole zdroju pro enumeraci souboru ve viewerech + //--- add this panel to the array of sources for file enumeration in viewers EnumFileNamesAddSourceUID(HWindow, &EnumFileNamesSourceUID); - //--- vytvoreni listboxu se soubory a adresari + //--- create listbox with files and directories ListBox = new CFilesBox(this); if (ListBox == NULL) { TRACE_E(LOW_MEMORY); return -1; } - //--- vytvoreni statusliny s informacemi o akt. souboru + //--- create status line with information about the current file StatusLine = new CStatusWindow(this, blBottom, ooStatic); if (StatusLine == NULL) { @@ -1002,7 +1003,7 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) return -1; } ToggleStatusLine(); - //--- vytvoreni statusliny s informacemi o akt. adresari + //--- create status line with information about the current directory DirectoryLine = new CStatusWindow(this, blTop, ooStatic); if (DirectoryLine == NULL) { @@ -1011,8 +1012,8 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) } DirectoryLine->SetLeftPanel(MainWindow->LeftPanel == this); ToggleDirectoryLine(); - //--- nahozeni typu viewu + nacteni obsahu adresare - SetThumbnailSize(Configuration.ThumbnailSize); // musi existovat ListBox + //--- apply view type and load directory contents + SetThumbnailSize(Configuration.ThumbnailSize); // ListBox must exist if (!ListBox->CreateEx(WS_EX_WINDOWEDGE, CFILESBOX_CLASSNAME, "", @@ -1045,7 +1046,7 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) SelectViewTemplate(index, FALSE, FALSE); ShowWindow(ListBox->HWindow, SW_SHOW); - // srovname nastaveni promenne AutomaticRefresh a directory-liny + // align AutomaticRefresh variable with the directory line SetAutomaticRefresh(AutomaticRefresh, TRUE); return 0; @@ -1053,18 +1054,18 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_DESTROY: { - //--- zruseni tohoto panelu z pole zdroju pro enumeraci souboru ve viewerech + //--- remove this panel from the array of sources for file enumeration in viewers EnumFileNamesRemoveSourceUID(HWindow); CancelUI(); // cancel QuickSearch and QuickEdit LastRefreshTime = INT_MAX; BeginStopRefresh(); DetachDirectory(this); - //--- uvolneni child-oken + //--- release child windows RevokeDragDrop(); ListBox->DetachWindow(); delete ListBox; - ListBox = NULL; // pro jistotu, at se chyby ukazou... + ListBox = NULL; // just to be sure so errors show up... StatusLine->DestroyWindow(); delete StatusLine; @@ -1072,16 +1073,16 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) DirectoryLine->DestroyWindow(); delete DirectoryLine; - DirectoryLine = NULL; // oprava padacky + DirectoryLine = NULL; // fix for crash //--- return 0; } - case WM_USER_ENUMFILENAMES: // hledani dalsiho/predchoziho jmena pro viewer + case WM_USER_ENUMFILENAMES: // searching for next/previous name for the viewer { HANDLES(EnterCriticalSection(&FileNamesEnumDataSect)); - if (InactiveRefreshTimerSet) // pokud je zde odlozeny refresh, musime jej provest ihned, jinak budeme enumerovat nad neaktualnim listingem; pokud bude dele trvat nevadi, GetFileNameForViewer si na vysledek pocka... + if (InactiveRefreshTimerSet) // if a refresh is delayed here, execute it now, otherwise enumeration would use outdated listing; a longer delay is fine, GetFileNameForViewer waits for the result... { // TRACE_I("Refreshing during enumeration (refresh in inactive window was delayed)"); KillTimer(HWindow, IDT_INACTIVEREFRESH); @@ -1090,14 +1091,14 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) SendMessage(HWindow, WM_USER_INACTREFRESH_DIR, FALSE, InactRefreshLParam); } - if ((int)wParam /* reqUID */ == FileNamesEnumData.RequestUID && // nedoslo k zadani dalsiho pozadaku (tento by pak byl k nicemu) - EnumFileNamesSourceUID == FileNamesEnumData.SrcUID && // nedoslo ke zmene zdroje - !FileNamesEnumData.TimedOut) // na vysledek jeste nekdo ceka + if ((int)wParam /* reqUID */ == FileNamesEnumData.RequestUID && // no new request was made (otherwise this one would be useless) + EnumFileNamesSourceUID == FileNamesEnumData.SrcUID && // the source hasn't changed + !FileNamesEnumData.TimedOut) // someone is still waiting for the result { if (Files != NULL && Is(ptDisk)) { BOOL selExists = FALSE; - if (FileNamesEnumData.PreferSelected) // je-li to treba, zjistime jestli existuje selectiona + if (FileNamesEnumData.PreferSelected) // if needed, check whether a selection exists { int i; for (i = 0; i < Files->Count; i++) @@ -1113,19 +1114,19 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) int index = FileNamesEnumData.LastFileIndex; int count = Files->Count; BOOL indexNotFound = TRUE; - if (index == -1) // hledame od prvniho nebo od posledniho + if (index == -1) // search from the first or the last item { if (FileNamesEnumData.RequestType == fnertFindPrevious) - index = count; // hledame predchozi + mame zacit na poslednim - // else // hledame nasledujici + mame zacit na prvnim + index = count; // searching for the previous item + start at the last item + // else // searching for the next item + start at the first item } else { - if (FileNamesEnumData.LastFileName[0] != 0) // zname plne jmeno souboru na 'index', zkontrolujeme jestli nedoslo k rozesunuti/sesunuti pole + pripadne dohledame novy index + if (FileNamesEnumData.LastFileName[0] != 0) // we know the full file name at 'index', so check whether the array shifted and, if needed, find the new index { int pathLen = (int)strlen(GetPath()); if (StrNICmp(GetPath(), FileNamesEnumData.LastFileName, pathLen) == 0) - { // cesta k souboru se musi shodovat s cestou v panelu ("always true") + { // file path must match the path in the panel ("always true") const char* name = FileNamesEnumData.LastFileName + pathLen; if (*name == '\\' || *name == '/') name++; @@ -1135,11 +1136,11 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (nameIsSame) indexNotFound = FALSE; if (f == NULL || !nameIsSame) - { // jmeno na indexu 'index' neni FileNamesEnumData.LastFileName, zkusime najit novy index tohoto jmena + { // the name at index 'index' is not FileNamesEnumData.LastFileName, try to find a new index for this name int i; for (i = 0; i < count && StrICmp(name, Files->At(i).Name) != 0; i++) ; - if (i != count) // novy index nalezen + if (i != count) // new index found { indexNotFound = FALSE; index = i; @@ -1162,9 +1163,9 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) int wantedViewerType = 0; BOOL onlyAssociatedExtensions = FALSE; - if (FileNamesEnumData.OnlyAssociatedExtensions) // preje si viewer filtrovani podle asociovanych pripon? + if (FileNamesEnumData.OnlyAssociatedExtensions) // does the viewer request filtering by associated extensions? { - if (FileNamesEnumData.Plugin != NULL) // viewer z pluginu + if (FileNamesEnumData.Plugin != NULL) // viewer from plugin { int pluginIndex = Plugins.GetIndex(FileNamesEnumData.Plugin); if (pluginIndex != -1) // "always true" @@ -1173,7 +1174,7 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) onlyAssociatedExtensions = TRUE; } } - else // interni viewer + else // internal viewer { wantedViewerType = VIEWER_INTERNAL; onlyAssociatedExtensions = TRUE; @@ -1183,7 +1184,7 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) BOOL preferSelected = selExists && FileNamesEnumData.PreferSelected; switch (FileNamesEnumData.RequestType) { - case fnertFindNext: // dalsi + case fnertFindNext: // next { CDynString strViewerMasks; if (!onlyAssociatedExtensions || MainWindow->GetViewersAssoc(wantedViewerType, &strViewerMasks)) @@ -1212,7 +1213,7 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) break; } - case fnertFindPrevious: // predchozi + case fnertFindPrevious: // previous { CDynString strViewerMasks; if (!onlyAssociatedExtensions || MainWindow->GetViewersAssoc(wantedViewerType, &strViewerMasks)) @@ -1241,7 +1242,7 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) break; } - case fnertIsSelected: // zjisteni oznaceni + case fnertIsSelected: // query selection { if (!indexNotFound && index >= 0 && index < Files->Count) { @@ -1251,7 +1252,7 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) break; } - case fnertSetSelection: // nastaveni oznaceni + case fnertSetSelection: // set selection { if (!indexNotFound && index >= 0 && index < Files->Count) { @@ -1324,7 +1325,7 @@ void CFilesWindow::OpenDirHistory() if (!MainWindow->DirHistory->HasPaths()) return; - BeginStopRefresh(); // cmuchal si da pohov + BeginStopRefresh(); // snooper takes a break CMenuPopup menu; @@ -1347,14 +1348,14 @@ void CFilesWindow::OpenDirHistory() if (cmd != 0) MainWindow->DirHistory->Execute(cmd, FALSE, this, TRUE, FALSE); - EndStopRefresh(); // ted uz zase cmuchal nastartuje + EndStopRefresh(); // the snooper will start again now } void CFilesWindow::OpenStopFilterMenu() { CALL_STACK_MESSAGE1("CFilesWindow::OpenStopFilterMenu()"); - BeginStopRefresh(); // cmuchal si da pohov + BeginStopRefresh(); // snooper takes a break CMenuPopup menu; @@ -1371,8 +1372,8 @@ void CFilesWindow::OpenStopFilterMenu() } } - /* slouzi pro skript export_mnu.py, ktery generuje salmenu.mnu pro Translator - udrzovat synchronizovane s volanim InsertItem() dole... + /* used by the export_mnu.py script which generates salmenu.mnu for the Translator + keep synchronized with the InsertItem() calls below... MENU_TEMPLATE_ITEM StopFilterMenu[] = { {MNTT_PB, 0 @@ -1423,19 +1424,19 @@ MENU_TEMPLATE_ITEM StopFilterMenu[] = } } - EndStopRefresh(); // ted uz zase cmuchal nastartuje + EndStopRefresh(); // the snooper will start again now } -// na zaklade dostupnych sloupcu naplni popup +// fills the popup based on available columns BOOL CFilesWindow::FillSortByMenu(CMenuPopup* popup) { CALL_STACK_MESSAGE1("CFilesWindow::FillSortByMenu()"); - // sestrelime existujici polozky + // remove existing items popup->RemoveAllItems(); - /* slouzi pro skript export_mnu.py, ktery generuje salmenu.mnu pro Translator - udrzovat synchronizovane s volanim InsertItem() dole... + /* used by the export_mnu.py script which generates salmenu.mnu for the Translator + keep synchronized with the InsertItem() calls below... MENU_TEMPLATE_ITEM SortByMenu[] = { {MNTT_PB, 0 @@ -1449,9 +1450,9 @@ MENU_TEMPLATE_ITEM SortByMenu[] = }; */ - // docasne reseni pro 1.6 beta 6: naleju vzdy (bez ohledu na ValidFileData) - // polozky Name, Ext, Date, Size - // poradi musi korespondovat s CSortType enumem + // temporary solution for 1.6 beta 6: always populate (regardless of ValidFileData) + // the Name, Ext, Date, and Size items + // the order must correspond to the CSortType enum int textResID[5] = {IDS_COLUMN_MENU_NAME, IDS_COLUMN_MENU_EXT, IDS_COLUMN_MENU_TIME, IDS_COLUMN_MENU_SIZE, IDS_COLUMN_MENU_ATTR}; int leftCmdID[5] = {CM_LEFTNAME, CM_LEFTEXT, CM_LEFTTIME, CM_LEFTSIZE, CM_LEFTATTR}; int rightCmdID[5] = {CM_RIGHTNAME, CM_RIGHTEXT, CM_RIGHTTIME, CM_RIGHTSIZE, CM_RIGHTATTR}; @@ -1500,7 +1501,7 @@ void CFilesWindow::SetThumbnailSize(int size) { if (size != ListBox->ThumbnailWidth || size != ListBox->ThumbnailHeight) { - // vycisteni icon-cache + // clear the icon cache SleepIconCacheThread(); IconCache->Release(); EndOfIconReadingTime = GetTickCount() - 10000; @@ -1530,7 +1531,7 @@ void CFilesWindow::SetFont() { if (DirectoryLine != NULL) DirectoryLine->SetFont(); - //if (ListBox != NULL) // toto se nastavi z volani SetFont() + //if (ListBox != NULL) // this is set by the SetFont() call // ListBox->SetFont(); if (StatusLine != NULL) StatusLine->SetFont(); From 395f0902cc04f3a3ab17953ddaa04ee201795a6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 09:48:33 +0200 Subject: [PATCH 581/710] [translation] Initial src/keyboard.cpp comments translation (#957) --- src/keyboard.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/keyboard.cpp b/src/keyboard.cpp index 6a5a8d340..46386b40d 100644 --- a/src/keyboard.cpp +++ b/src/keyboard.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -986,12 +987,12 @@ BOOL IsSalHotKey(WORD hotKey) break; } - case 0xDC: // '\' + case 0xDC: // '\\' { switch (mods) { case NONE: // quick search/type in command line - case CONTROL: // root dir + case CONTROL: // go to the root directory found = TRUE; } break; From fe543780c3ba1ba43995a192b8c89db7b109dc86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 09:48:36 +0200 Subject: [PATCH 582/710] [translation] Initial src/md5.cpp comments translation (#958) --- src/md5.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/md5.cpp b/src/md5.cpp index fd56c2674..cf30b7d72 100644 --- a/src/md5.cpp +++ b/src/md5.cpp @@ -1,7 +1,8 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED -#include "precomp.h" // include slouzi pouze k prelozitelnosti v Salamanderu +#include "precomp.h" // include serves only for compilability in Salamander //#include //#include @@ -27,7 +28,7 @@ void MD5::update(uint1* input, uint4 input_length) uint4 buffer_space; // how much space is left in buffer if (finalized) - { // so we can't update! + { // cannot update after finalization TRACE_E("MD5::update: Can't update a finalized digest!"); return; } @@ -45,7 +46,7 @@ void MD5::update(uint1* input, uint4 input_length) // Transform as many times as possible. if (input_length >= buffer_space) - { // ie. we have enough to fill the buffer + { // i.e. we have enough data to fill the buffer // fill the rest of the buffer and transform memcpy(buffer + buffer_index, input, buffer_space); transform(buffer); @@ -118,9 +119,9 @@ void MD5::init() state[3] = 0x10325476; } -// Constants for MD5Transform routine. -// Although we could use C++ style constants, defines are actually better, -// since they let us easily evade scope clashes. +// Constants for the MD5Transform routine. +// Although we could use C++-style constants, `#define`s are actually better, +// since they let us easily avoid scope clashes. #define S11 7 #define S12 12 From 6a0e5387e336d271ffdd3ddc11b47526755ff27d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 09:48:40 +0200 Subject: [PATCH 583/710] [translation] Initial src/md5.h comments translation (#959) --- src/md5.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/md5.h b/src/md5.h index c42868ff6..ef30b1d9c 100644 --- a/src/md5.h +++ b/src/md5.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once @@ -8,15 +9,15 @@ class MD5 public: // methods for controlled operation: - MD5(); // simple initializer + MD5(); // default constructor void update(unsigned char* input, unsigned int input_length); void finalize(); public: // first, some types: - typedef unsigned int uint4; // assumes integer is 4 words long - typedef unsigned short int uint2; // assumes short integer is 2 words long - typedef unsigned char uint1; // assumes char is 1 word long + typedef unsigned int uint4; // assumes integer is 4 bytes long + typedef unsigned short int uint2; // assumes short integer is 2 bytes long + typedef unsigned char uint1; // assumes char is 1 byte long // next, the private data: uint4 state[4]; From 17769c4a71ac74e1c7df9f58d3dc8bfd4aedb66e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 09:48:43 +0200 Subject: [PATCH 584/710] [translation] Initial src/menu.h comments translation (#960) --- src/menu.h | 314 ++++++++++++++++++++++++++--------------------------- 1 file changed, 157 insertions(+), 157 deletions(-) diff --git a/src/menu.h b/src/menu.h index f4a755835..e27f90887 100644 --- a/src/menu.h +++ b/src/menu.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once @@ -15,22 +16,22 @@ class CMenuBar; class CBitmap; /* -Posilane zpravy: +Sent messages: WM_INITMENUPOPUP hmenuPopup = (HMENU) wParam; // handle to submenu uPos = (UINT) LOWORD(lParam); // submenu item position fSystemMenu = (BOOL) HIWORD(lParam); // window menu flag - Tato zprava je posilana pouze v pripade windows menu popupu. + This message is sent only for Windows menu popups. WM_USER_INITMENUPOPUP WM_USER_UNINITMENUPOPUP - menuPopup = (CGUIMenuPopupAbstract*) wParam; // ukazatel na submenu + menuPopup = (CGUIMenuPopupAbstract*) wParam; // pointer to submenu uPos = LOWORD(lParam); // submenu item position uID = HIWORD(lParam); // submenu ID - Tyto dve zpravy jsou posilane vzdy - i pro menu postavene nad windows - menu popup. + These two messages are always sent, even for menus implemented + on top of a Windows popup. */ //***************************************************************************** @@ -42,16 +43,16 @@ class CMenuWindowQueue { private: TDirectArray Data; - CRITICAL_SECTION DataCriticalSection; // kriticka sekce pro pristup k datum + CRITICAL_SECTION DataCriticalSection; // critical section for data access BOOL UsingData; public: CMenuWindowQueue(); ~CMenuWindowQueue(); - BOOL Add(HWND hWindow); // prida polozku do fronty, vraci uspech - void Remove(HWND hWindow); // odstrani polozku z fronty - void DispatchCloseMenu(); // posle vsem otevrenym oknum menu zpravu WM_USER_CLOSEMENU + BOOL Add(HWND hWindow); // adds an item to the queue, returns success + void Remove(HWND hWindow); // removes an item from the queue + void DispatchCloseMenu(); // sends WM_USER_CLOSEMENU to all open menu windows }; extern CMenuWindowQueue MenuWindowQueue; @@ -77,15 +78,15 @@ extern COldMenuHookTlsAllocator OldMenuHookTlsAllocator; // // CMenuSharedResources // -// Pro jeden strom sub menu existuje pouze jedna instance techto prostredku. -// Jsou zalozeny napriklad ve funkci Track. -// Vsechny sub menu pak pouze dostavaji ukazatel na tyto sdilene prostredky. +// Only one instance of these resources exists for a given submenu tree. +// They are created for example in the Track function. +// All submenus then simply receive a pointer to these shared resources. // class CMenuSharedResources { public: - // barvy + // colors COLORREF NormalBkColor; COLORREF SelectedBkColor; COLORREF NormalTextColor; @@ -98,30 +99,30 @@ class CMenuSharedResources CBitmap* MonoBitmap; // temp DC - HDC HTempMemDC; // memory dc pro docasne presuny - HDC HTemp2MemDC; // memory dc pro docasne presuny + HDC HTempMemDC; // memory DC for temporary transfers + HDC HTemp2MemDC; // memory DC for temporary transfers // fonts - HFONT HNormalFont; // prubezne je vybran v HCacheMemoryDC - HFONT HBoldFont; // je vybiran pouze docasne + HFONT HNormalFont; // continuously selected in HCacheMemoryDC + HFONT HBoldFont; // selected only temporarily // menu bitmaps - HBITMAP HMenuBitmaps; // vytazeno ze systemu: poradi dle CMenuBitmapEnum + HBITMAP HMenuBitmaps; // retrieved from the system: order according to CMenuBitmapEnum int MenuBitmapWidth; // other - HWND HParent; // okno, ze ktereho bylo menu vyvolano - int TextItemHeight; // vyska polozky z textu - BOOL BitmapsZoom; // nasobek puvodni velikost bitmap - DWORD ChangeTickCount; // hodnota GetTickCount z doby, kdy doslo ke zmene vybrane polozky + HWND HParent; // window from which the menu was invoked + int TextItemHeight; // item height based on text + BOOL BitmapsZoom; // bitmap scaling relative to the original size + DWORD ChangeTickCount; // GetTickCount value from the time the selected item changed POINT LastMouseMove; - CMenuBar* MenuBar; // okno je aktivovano z MenuBar; jinak je rovno NULL - DWORD SkillLevel; // honodta pro retezec popupu -- urcuje, kerer itemy budou zobrazeny - BOOL HideAccel; // maji se skryt akceleratory + CMenuBar* MenuBar; // MenuBar from which the window was activated; otherwise NULL + DWORD SkillLevel; // value determining which items will be displayed + BOOL HideAccel; // should accelerators be hidden - const RECT* ExcludeRect; // tento obdelnik nesmime prekryt + const RECT* ExcludeRect; // this rectangle must not be covered - HANDLE HCloseEvent; // slouzi pro rozbehnuti message queue + HANDLE HCloseEvent; // used to start the message queue public: CMenuSharedResources(); @@ -151,28 +152,28 @@ class CMenuItem HICON HOverlay; ULONG_PTR CustomData; DWORD SkillLevel; // MENU_LEVEL_BEGINNER, MENU_LEVEL_INTERMEDIATE, MENU_LEVEL_ADVANCED - // tyto hodnoty se pouzivaji pro optimalizovany pristup je stavum polozek - DWORD* Enabler; // Ukazuje na promennou, ktera ridi stav polozky. - // Hodnote ruzne od nuly odpovida nulovany bit MENU_STATE_GRAYED. - // Nule odpovida nastaveny bit MENU_STATE_GRAYED. + // these values are used for optimized access to item states + DWORD* Enabler; // Points to a variable controlling the state of the item. + // A nonzero value corresponds to the MENU_STATE_GRAYED bit cleared. + // Zero corresponds to the MENU_STATE_GRAYED bit set. DWORD Flags; // MENU_FLAG_xxx - DWORD Temp; // pomocna promenna pro nektere metody + DWORD Temp; // helper variable for some methods - // vypocitane hodnoty + // calculated values int Height; int MinWidth; int YOffset; - const char* ColumnL1; // text prvniho sloupce - int ColumnL1Len; // pocet znaku + const char* ColumnL1; // text of the first column + int ColumnL1Len; // number of characters int ColumnL1Width; int ColumnL1X; - const char* ColumnL2; // text druheho sloupce (muze byt rovno NULL) - int ColumnL2Len; // pocet znaku + const char* ColumnL2; // text of the second column (can be NULL) + int ColumnL2Len; // number of characters int ColumnL2Width; int ColumnL2X; - const char* ColumnR; // text praveho sloupce (muze byt rovno NULL) - int ColumnRLen; // pocet znaku + const char* ColumnR; // text of the right column (can be NULL) + int ColumnRLen; // number of characters int ColumnRWidth; int ColumnRX; @@ -182,8 +183,8 @@ class CMenuItem BOOL SetText(const char* text, int len = -1); - // projede retezec TypeData a podle oddelovacu a promenne threeCol - // nastavi promenne ColumnL1 - ColumnR, ColumnL1Len - ColumnRLen, + // walks through the TypeData string and according to separators and the threeCol variable + // sets the variables ColumnL1 - ColumnR, ColumnL1Len - ColumnRLen, // ColumnL1Width - ColumnRWidth void DecodeSubTextLenghtsAndWidths(CMenuSharedResources* sharedRes, BOOL threeCol); @@ -206,30 +207,28 @@ enum CMenuBitmapEnum enum CMenuPopupHittestEnum { - mphItem, // na polozce, userData = index polozky - mphUpArrow, // na sipce Up - mphDownArrow, // na sipce Down - mphBorderOrOutside, // na ramecku nebo mimo - // mphOutside, // mimo okno + mphItem, // on an item, userData = item index + mphUpArrow, // on the Up arrow + mphDownArrow, // on the Down arrow + mphBorderOrOutside, // on the border or outside + // mphOutside, // outside the window }; /* Items - Seznam polozek obsazenych v pop-up menu. + List of items contained in the pop-up menu. HParent - Okno, kteremu se budou dorucovat notifikacni message. + Window that receives notification messages. HImageList - Ikonky zobrazovane pred polozkama. Ikona je urcovana promennou - CMenuItem::ImageIndex. + Icons displayed before items. The icon is chosen by CMenuItem::ImageIndex. HWindowsMenu - Handle windowsackeho popup menu. Pred otevrenim tohoto submenu - se provede enumerace jeho polozek. Ty jsou pak transformovany do docasneho - objetku CMenuPopup. Po zavreni tohoto submenu je docasny objekt zrusen. - Pro takove menu jsou posilany notifikacni message WM_INITPOPUP, WM_DRAWITEM - a WM_MEASUREITEM. + Handle of the Windows popup menu. Before opening this submenu its items are + enumerated and transformed into a temporary CMenuPopup object. After the + submenu is closed the temporary object is destroyed. Notifications + WM_INITPOPUP, WM_DRAWITEM and WM_MEASUREITEM are sent for such menus. */ class CMenuPopup : public CWindow, public CGUIMenuPopupAbstract @@ -239,46 +238,46 @@ class CMenuPopup : public CWindow, public CGUIMenuPopupAbstract HMENU HWindowsMenu; RECT WindowRect; - int TotalHeight; // celkova vyska menu; nemusi byt cela zobrazena - int Width; // rozmery client area + int TotalHeight; // total menu height; it may not be fully visible + int Width; // dimensions of the client area int Height; - int TopItemY; // y souradnice prvni polozky - BOOL UpArrowVisible; // je zobrazena sipka nahoru? - BOOL UpDownTimerRunnig; // bezi nam timer? - BOOL DownArrowVisible; // je zobrazena sipka dolu? + int TopItemY; // y-coordinate of the first item + BOOL UpArrowVisible; // is the Up arrow displayed? + BOOL UpDownTimerRunnig; // is our timer running? + BOOL DownArrowVisible; // is the Down arrow displayed? DWORD Style; // MENU_POPUP_xxxx DWORD TrackFlags; // MENU_TRACK_xxxx CMenuSharedResources* SharedRes; - CMenuPopup* OpenedSubMenu; // je-li otevreny nejaky submenu, ukazuje na nej - CMenuPopup* FirstPopup; // pokud nejde o prvni okno, ukazuje na nej; v pripade prvniho okna ukazuje na sebe samo - int SelectedItemIndex; // -1 == zadna + CMenuPopup* OpenedSubMenu; // if a submenu is open, points to it + CMenuPopup* FirstPopup; // if this is not the first window, points to it; otherwise points to itself + int SelectedItemIndex; // -1 == none BOOL SelectedByMouse; // TRUE->ByMouse FALSE->ByKeyboard HIMAGELIST HImageList; HIMAGELIST HHotImageList; - int ImageWidth; // rozmery jednoho obrazku z HImageList + int ImageWidth; // dimensions of one image from HImageList int ImageHeight; - DWORD ID; // kopie ID z CMenuItem - BOOL Closing; // bylo zavolano HideAll a hned jak bude mozne, koncime - int MinWidth; // pri rozvrhovani sirky nebude sirka mensi, nez tato hodnota - BOOL ModifyMode; // pokud je menu zobrazeno, neni mozne nad nim provadet zmeny, neni-li v ModifyMode - DWORD SkillLevel; // urcuje, ktere polozky budou v tomto popupu zobrazeny + DWORD ID; // copy of ID from CMenuItem + BOOL Closing; // HideAll was called and we finish as soon as possible + int MinWidth; // during layout the width will not be smaller than this value + BOOL ModifyMode; // if the menu is visible, changes are allowed only in ModifyMode + DWORD SkillLevel; // determines which items will be shown in this popup int MouseWheelAccumulator; // vertical public: // - // Vlastni metody + // custom methods // CMenuPopup(DWORD id = 0); BOOL LoadFromTemplate2(HINSTANCE hInstance, const MENU_TEMPLATE_ITEM* menuTemplate, DWORD* enablersOffset, HIMAGELIST hImageList, HIMAGELIST hHotImageList, int* addedRows); // - // Implementace metod CGUIMenuPopupAbstract + // implementation of CGUIMenuPopupAbstract methods // virtual BOOL WINAPI LoadFromTemplate(HINSTANCE hInstance, const MENU_TEMPLATE_ITEM* menuTemplate, DWORD* enablersOffset, HIMAGELIST hImageList = NULL, HIMAGELIST hHotImageList = NULL); - virtual void WINAPI SetSelectedItemIndex(int index); // slouzi k prednastaveni vybrane polozky (musi byt nastaven flag MENU_TRACK_SELECT, jinak se nepouzije) + virtual void WINAPI SetSelectedItemIndex(int index); // used to preset the selected item (MENU_TRACK_SELECT must be set or it is ignored) virtual int WINAPI GetSelectedItemIndex() { return SelectedItemIndex; } virtual void WINAPI SetTemplateMenu(HMENU hWindowsMenu) { HWindowsMenu = hWindowsMenu; } @@ -316,12 +315,12 @@ class CMenuPopup : public CWindow, public CGUIMenuPopupAbstract virtual void WINAPI RemoveAllItems(); virtual BOOL WINAPI RemoveItemsRange(int firstIndex, int lastIndex); - // umoznuje provadet zmeny nad otevrenym menu popupem - virtual BOOL WINAPI BeginModifyMode(); // zahajeni editacniho rezimu - virtual BOOL WINAPI EndModifyMode(); // ukonceni rezimu - menu se prekresli + // allows making changes while the menu popup is open + virtual BOOL WINAPI BeginModifyMode(); // begins edit mode + virtual BOOL WINAPI EndModifyMode(); // ends the mode - the menu is redrawn - // urci polozky, kter budou v menu zobrazeny - // 'skillLevel' muze byt jedna z hodnot MENU_LEVEL_BEGINNER, MENU_LEVEL_INTERMEDIATE a MENU_LEVEL_ADVANCED + // determines which items will be displayed in the menu + // 'skillLevel' can be MENU_LEVEL_BEGINNER, MENU_LEVEL_INTERMEDIATE or MENU_LEVEL_ADVANCED virtual void WINAPI SetSkillLevel(DWORD skillLevel); // The FindItemPosition method finds a menu item position. @@ -339,7 +338,7 @@ class CMenuPopup : public CWindow, public CGUIMenuPopupAbstract virtual BOOL WINAPI FillMenuHandle(HMENU hMenu); virtual BOOL WINAPI GetStatesFromHWindowsMenu(HMENU hMenu); - virtual void WINAPI SetImageList(HIMAGELIST hImageList, BOOL subMenu = FALSE); // pokud je subMenu==TRUE, nastavi se hadle i do submenu + virtual void WINAPI SetImageList(HIMAGELIST hImageList, BOOL subMenu = FALSE); // if subMenu==TRUE, the image list handle is also set for submenus virtual HIMAGELIST WINAPI GetImageList(); virtual void WINAPI SetHotImageList(HIMAGELIST hHotImageList, BOOL subMenu = FALSE); virtual HIMAGELIST WINAPI GetHotImageList(); @@ -378,11 +377,11 @@ class CMenuPopup : public CWindow, public CGUIMenuPopupAbstract // is nonzero if the function succeeds and zero if it fails. virtual DWORD WINAPI Track(DWORD trackFlags, int x, int y, HWND hwnd, const RECT* exclude); - virtual BOOL WINAPI GetItemRect(int index, RECT* rect); // vrati obsany obdelnik kolem polozky v screen souradnicich + virtual BOOL WINAPI GetItemRect(int index, RECT* rect); // returns bounding rectangle of the item in screen coordinates - // obehne vsechny polozky a pokud maji nastaveny ukazatel 'EnablerData' - // porovnaja hodnotu (na kterou ukazuji) se skutecnym stavem polozky. - // Pokud se stav lisi, zmeni ho. + // iterates through all items and if they have the 'EnablerData' pointer set + // compares the pointed value with the actual item state. + // If the state differs, it is updated. virtual void WINAPI UpdateItemsState(); virtual void WINAPI SetMinWidth(int minWidth); @@ -392,28 +391,28 @@ class CMenuPopup : public CWindow, public CGUIMenuPopupAbstract virtual void WINAPI AssignHotKeys(); protected: - void Cleanup(); // inicializuje objekt + void Cleanup(); // initializes the object BOOL LoadFromHandle(); - void LayoutColumns(); // probehne polozky a podle jejich rozmeru nastavi hodnoty + void LayoutColumns(); // iterates over items and sets values according to their size DWORD GetOwnerDrawItemState(const CMenuItem* item, BOOL selected); - void DrawCheckBitmapVista(HDC hDC, CMenuItem* item, int yOffset, BOOL selected); // veze s alpha blendem - void DrawCheckBitmap(HDC hDC, CMenuItem* item, int yOffset, BOOL selected); // check marky dodane uzivatelem (HBmpChecked a HBmpUnchecked) - void DrawCheckImage(HDC hDC, CMenuItem* item, int yOffset, BOOL selected); // standardni checkmarky, ImageIndex, HIcon - void DrawCheckMark(HDC hDC, CMenuItem* item, int yOffset, BOOL selected); // vola odpovidajici funkci - void DrawItem(HDC hDC, CMenuItem* item, int yOffset, BOOL selected); // vykresli jednu polozku - void DrawUpDownItem(HDC hDC, BOOL up); // vykresli polozku obsahujici sipku nahoru nebo dolu + void DrawCheckBitmapVista(HDC hDC, CMenuItem* item, int yOffset, BOOL selected); // Vista version with alpha blend + void DrawCheckBitmap(HDC hDC, CMenuItem* item, int yOffset, BOOL selected); // user-supplied check marks (HBmpChecked and HBmpUnchecked) + void DrawCheckImage(HDC hDC, CMenuItem* item, int yOffset, BOOL selected); // standard check marks, ImageIndex, HIcon + void DrawCheckMark(HDC hDC, CMenuItem* item, int yOffset, BOOL selected); // calls the appropriate function + void DrawItem(HDC hDC, CMenuItem* item, int yOffset, BOOL selected); // draws a single item + void DrawUpDownItem(HDC hDC, BOOL up); // draws the item containing the up or down arrow CMenuPopupHittestEnum HitTest(const POINT* point, int* userData); BOOL FindNextItemIndex(int fromIndex, BOOL topToDown, int* index); - inline CMenuPopup* FindActivePopup(); // najde posledni otevreny popup; vrati ukazatel na objekt - inline CMenuPopup* FindPopup(HWND hWindow); // hleda od nas az po posledniho childa; vrati ukazatel na objekt nnebo NULL + inline CMenuPopup* FindActivePopup(); // finds the last opened popup; returns a pointer to the object + inline CMenuPopup* FindPopup(HWND hWindow); // searches from this popup down to the last child; returns a pointer to the object or NULL inline void DoDispatchMessage(MSG* msg, BOOL* leaveMenu, DWORD* retValue, BOOL* dispatchLater); void OnTimerTimeout(); - void CheckSelectedPath(CMenuPopup* terminator); // probehne celou vetev a nastavi SelectedItemy tak, aby vedly k poslednimu popupu + void CheckSelectedPath(CMenuPopup* terminator); // traverses the whole branch and sets SelectedItems so they lead to the last popup - // k Track pridava [in] menuBar - // [in] delayedMsg - // [in] dispatchDelayedMsg: Ma se delayedMsg dorucit po navratu z teto metodu? + // Compared to Track, adds [in] menuBar + // [in] delayedMsg + // [in] dispatchDelayedMsg: should delayedMsg be delivered after this method returns? // DWORD TrackInternal(DWORD trackFlags, int x, int y, HWND hwnd, const RECT* exclude, CMenuBar* menuBar, MSG& delayedMsg, BOOL& dispatchDelayedMsg); @@ -428,32 +427,32 @@ class CMenuPopup : public CWindow, public CGUIMenuPopupAbstract void OnChar(char key, BOOL* leaveMenu, DWORD* retValue); int FindNextItemIndex(int firstIndex, char key); - // pro navigaci pomoci PgDn/PgUp, hleda index prvni polozky - // za separatorem; pokud je 'down' TRUE, hleda smerem dolu - // od polozky 'firstIndex', jinak smerem nahoru + // for navigation using PgDn/PgUp, searches for the index of the first item + // after a separator; if 'down' is TRUE it searches downward from 'firstIndex', + // otherwise upward int FindGroupIndex(int firstIndex, BOOL down); - // pokud je 'byMouse' TRUE, jde o zmenu pomoci mysi, jinak jde o zmenu z klavesnice - // select nastaveny z klavesnice "drzi", pokud uzivatel pohybuje mysi mimo popupy + // if 'byMouse' is TRUE, it is a mouse change, otherwise a keyboard change + // selection set by keyboard "sticks" while the user moves the mouse outside popups void SelectNewItemIndex(int newItemIndex, BOOL byMouse); - void EnsureItemVisible(int index); // pokud polozka lezi mimo zobrazenou oblast, zajisti - // odrolovani a vykresleni polozek tak, aby byla cela - // viditelna + void EnsureItemVisible(int index); // if the item lies outside the visible area, + // scroll and repaint so the item becomes + // fully visible void OnMouseWheel(WPARAM wParam, LPARAM lParam); - // x, y jsou souradnice leveho horniho rohu okna - // submenuItemPos slouzi k zaslani notifikace aplikaci + // x, y are coordinates of the upper left corner of the window + // submenuItemPos is used to send a notification to the application BOOL CreatePopupWindow(CMenuPopup* firstPopup, int x, int y, int submenuItemPos, const RECT* exclude); - // Vrati handle popup window pod kurzorem; pokud je pod kurzorem child window, - // bude dohledan jeho parent. + // Returns the handle of the popup window under the cursor; if a child window + // is under the cursor, its parent is found. // - // Zavedeno kvuli PicaView, ktere vklada do kontextoveho menu child window, - // do ktereho renderuje se spozdenim obrazek. V Salamu 2.0 pri najeti na takovy - // obrazek doslo k odvybrani polozky v menu, protoze WindowFromPoint vratilo - // jine okno nez popup. + // Introduced because of PicaView, which inserts a child window into the context + // menu and renders an image there with a delay. In Salamander 2.0 moving the + // cursor over such an image deselected the item because WindowFromPoint returned + // a window other than the popup. HWND PopupWindowFromPoint(POINT point); void ResetMouseWheelAccumulator() { MouseWheelAccumulator = 0; } @@ -473,56 +472,57 @@ class CMenuBar : public CWindow, public CGUIMenuBarAbstract { protected: CMenuPopup* Menu; - int Width; // rozmery celeho okna + int Width; // dimensions of the entire window int Height; HFONT HFont; int FontHeight; - int HotIndex; // polozka, ktera je bud vysunuta nebo zamackla (zadna = -1) - HWND HNotifyWindow; // kam budeme dorucovat notifikace - BOOL MenuLoop; // jsou rozbalovana submenu - DWORD RetValue; // ktery command mame poslat do okna aplikace + int HotIndex; // item that is either expanded or pressed (-1 = none) + HWND HNotifyWindow; // where notifications will be delivered + BOOL MenuLoop; // are submenus expanded + DWORD RetValue; // which command should be sent to the application window MSG DelayedMsg; BOOL DispatchDelayedMsg; - BOOL HotIndexIsTracked; // je otevren popup pod HotIndex? + BOOL HotIndexIsTracked; // is a popup open under HotIndex? BOOL HandlingVK_MENU; BOOL WheelDuringMenu; POINT LastMouseMove; - BOOL Closing; // bylo zavolano WM_USER_CLOSEMENU hned jak bude mozne, koncime - HANDLE HCloseEvent; // slouzi pro rozbehnuti message queue - BOOL MouseIsTracked; // je mys sledovana pomoci TrackMouseEvent? - BOOL HelpMode; // jsme v rezimu Context Help (Shift+F1)? - - // tyto dve promenne slouzi pro kooperaci MenuBar a MenuPopup - // jsou nastavovany v CMenuPopup::TrackInternal a urcuji dalsi chovani - // MenuBar po zavreni Popupu - int IndexToOpen; // pokud bude nastavena na -1, nema se otevrit dalsi Popup, - // jinak obsahuje index popupu, ktery se ma otevrit - BOOL OpenWithSelect; // ma se v otevrenem menu vybrat prvni polozka? - BOOL OpenByMouse; // otevirano pomoci mysi nebo klavesnice? - BOOL ExitMenuLoop; // Pokud je TRUE, ukoncime MenuLoop - BOOL HelpMode2; // obdrzeli jmse WM_USER_HELP_MOUSEMOVE a cekame na WM_USER_HELP_MOUSELEAVE? (musime vysvecovat polozku pod kurzorem) - WORD UIState; // zobrazovani akceleratoru + BOOL Closing; // WM_USER_CLOSEMENU was called and we exit as soon as possible + HANDLE HCloseEvent; // used to start the message queue + BOOL MouseIsTracked; // is the mouse tracked using TrackMouseEvent? + BOOL HelpMode; // are we in Context Help mode (Shift+F1)? + + // these two variables are used for cooperation between MenuBar and MenuPopup + // they are set in CMenuPopup::TrackInternal and determine further behavior + // of MenuBar after the popup is closed + int IndexToOpen; // -1 means no additional popup should be opened, + // otherwise the index of the popup to open + BOOL OpenWithSelect; // should the first item be selected when the menu opens? + BOOL OpenByMouse; // opened via mouse or keyboard? + BOOL ExitMenuLoop; // TRUE to exit MenuLoop + BOOL HelpMode2; // did we receive WM_USER_HELP_MOUSEMOVE and wait for + // WM_USER_HELP_MOUSELEAVE? (we must highlight the item under the cursor) + WORD UIState; // accelerator display state BOOL ForceAccelVisible; public: // - // Vlastni metody + // custom methods // CMenuBar(CMenuPopup* menu, HWND hNotifyWindow, CObjectOrigin origin = ooStatic); ~CMenuBar(); // - // Implementace metod CGUIMenuBarAbstract + // implementation of CGUIMenuBarAbstract methods // virtual BOOL WINAPI CreateWnd(HWND hParent); virtual HWND WINAPI GetHWND() { return HWindow; } - virtual int WINAPI GetNeededWidth(); // vrati sirku, ktera bude pro okno potreba - virtual int WINAPI GetNeededHeight(); // vrati vysku, ktera bude pro okno potreba - virtual void WINAPI SetFont(); // vytahne font pro menu bar ze systemu - virtual BOOL WINAPI GetItemRect(int index, RECT& r); // vrati umisteni polozky ve screen souradnicich - virtual void WINAPI EnterMenu(); // user stisknul VK_MENU + virtual int WINAPI GetNeededWidth(); // returns the width needed for the window + virtual int WINAPI GetNeededHeight(); // returns the height needed for the window + virtual void WINAPI SetFont(); // obtains the menu bar font from the system + virtual BOOL WINAPI GetItemRect(int index, RECT& r); // Returns the item's rectangle in screen coordinates. + virtual void WINAPI EnterMenu(); // user pressed VK_MENU virtual BOOL WINAPI IsInMenuLoop() { return MenuLoop; } virtual void WINAPI SetHelpMode(BOOL helpMode) { HelpMode = helpMode; } @@ -535,17 +535,17 @@ class CMenuBar : public CWindow, public CGUIMenuBarAbstract void DrawItem(int index); void DrawItem(HDC hDC, int index, int x); void DrawAllItems(HDC hDC); - void RefreshMinWidths(); // obehne vsechny polozky a napocit si k nim 'MinWidth' + void RefreshMinWidths(); // iterates all items and computes the 'MinWidth' of each - void TrackHotIndex(); // zamackne HotIndex a zavola TrackPopup; vrati se po jeho zavreni - void EnterMenuInternal(int index, BOOL openWidthSelect, BOOL byMouse); // byMouse rika, zda jde o otevreni pres mys nebo klavesnici + void TrackHotIndex(); // presses HotIndex and calls TrackPopup; returns once it closes + void EnterMenuInternal(int index, BOOL openWidthSelect, BOOL byMouse); // byMouse indicates whether the menu was opened by mouse or keyboard - // vraci TRUE, pokud je na pozici polozka; pak take nastavi 'index' - // jinak vraci FALSE + // returns TRUE if there is an item at the position and sets 'index'; + // otherwise returns FALSE BOOL HitTest(int xPos, int yPos, int& index); - // prohleda vlozene submenu a vrati TRUE, pokud mezi nima najde nejaky s horkou - // klavesou 'hotKey'; zaroven vrati jeho index + // searches inserted submenus and returns TRUE if one with the hot key 'hotKey' is found; + // the index of the item is returned as well BOOL HotKeyIndexLookup(char hotKey, int& itemIndex); friend class CMenuPopup; @@ -558,14 +558,14 @@ extern CMenuPopup MainMenu; extern CMenuPopup ArchiveMenu; extern CMenuPopup ArchivePanelMenu; -BOOL BuildSalamanderMenus(); // sestavi globalni menu pro Salamandera -BOOL BuildFindMenu(CMenuPopup* popup); // sestavi instanci menu pro find +BOOL BuildSalamanderMenus(); // builds the global menu for Salamander +BOOL BuildFindMenu(CMenuPopup* popup); // builds an instance of the find menu -// Prida do 'popup' polozky vytvorene na zaklade pole 'buttonsID'. -// 'hWindow' je parent tlacitek, na ktere odkazuji konstanty pole 'buttonsID'. -// Pole 'buttonsID' muze obsahovat libovolne mnozstvi cisel zakoncene 0. -// Cislo -1 je vyhrazene pro separator a cislo -2 pro default polozku (nasledujici -// polozka bude mit nastaven default state). Ostatni cisla jsou povazovana -// za id tlacitek. Jejich text je vytazen a pridan do menu. Zaroven je -// vytazen jejich Enabled stav, ktery je take promitnut do polozky v menu. +// Adds to 'popup' items created from the 'buttonsID' array. +// 'hWindow' is the parent of the buttons referenced by the 'buttonsID' array. +// The 'buttonsID' array may contain any number of IDs terminated by 0. +// ID -1 denotes a separator and -2 marks the default item (the next item will +// have the default state set). Other numbers are treated as button IDs; their +// text is extracted and added to the menu and their enabled state is mirrored in +// the menu item. void FillContextMenuFromButtons(CMenuPopup* popup, HWND hWindow, int* buttonsID); From cba58425c85955c46bcd0935a8e7ca16ac8cce9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 09:48:46 +0200 Subject: [PATCH 585/710] [translation] Initial src/tasklist.cpp comments translation (#961) --- src/tasklist.cpp | 277 ++++++++++++++++++++++++----------------------- 1 file changed, 139 insertions(+), 138 deletions(-) diff --git a/src/tasklist.cpp b/src/tasklist.cpp index 104a49ad9..4fe93b4da 100644 --- a/src/tasklist.cpp +++ b/src/tasklist.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -13,36 +14,36 @@ extern "C" #include "salshlib.h" #pragma warning(disable : 4074) -#pragma init_seg(compiler) // inicializaci provedeme co nejdrive +#pragma init_seg(compiler) // perform initialization as early as possible -#define NOHANDLES(function) function // obrana proti zanaseni maker HANDLES do zdrojaku pomoci CheckHnd +#define NOHANDLES(function) function // guard against the CheckHnd macros inserting HANDLES into the source CTaskList TaskList; BOOL FirstInstance_3_or_later = FALSE; -// process list je sdileny skrz vsechny salamander v lokani session -// od AS 3.0 menime pojeti "Break" udalosti - vyvola v cili exception, takze mame "plnotucny" bug report, ale zaroven tim cil konci -// proto menim nasledujici konstanty "AltapSalamander*" -> "AltapSalamander3*", abychom byli oddeleni od starsich verzi +// the process list is shared by all Salamanders in the local session +// starting with AS 3.0, the "Break" event behavior changes: it raises an exception in the target, giving us a full bug report, but it also terminates the target +// therefore the following constants are changed from "AltapSalamander*" to "AltapSalamander3*" so that they remain separate from older versions -// POZOR: pri zmene je potreba upravit salbreak.exe, proste posli mi prosim info ... dik, Petr +// WARNING: if you change this, adjust salbreak.exe as well; just send me the info ... thanks, Petr -const char* AS_PROCESSLIST_NAME = "AltapSalamander3bProcessList"; // sdilena pamet CProcessList -const char* AS_PROCESSLIST_MUTEX_NAME = "AltapSalamander3bProcessListMutex"; // synchronizace pro pristup do sdilene pameti -const char* AS_PROCESSLIST_EVENT_NAME = "AltapSalamander3bProcessListEvent"; // odpaleni udalosti (co se ma delat je ulozeno ve sdilene pameti) -const char* AS_PROCESSLIST_EVENT_PROCESSED_NAME = "AltapSalamander3bProcessListEventProcessed"; // odpalena udalost byla zpracovana +const char* AS_PROCESSLIST_NAME = "AltapSalamander3bProcessList"; // shared memory CProcessList +const char* AS_PROCESSLIST_MUTEX_NAME = "AltapSalamander3bProcessListMutex"; // synchronization for accessing shared memory +const char* AS_PROCESSLIST_EVENT_NAME = "AltapSalamander3bProcessListEvent"; // firing the event (what should happen is stored in shared memory) +const char* AS_PROCESSLIST_EVENT_PROCESSED_NAME = "AltapSalamander3bProcessListEventProcessed"; // the fired event has been processed -const char* FIRST_SALAMANDER_MUTEX_NAME = "AltapSalamanderFirstInstance"; // zavedeno od AS 2.52 beta 1 -const char* LOADSAVE_REGISTRY_MUTEX_NAME = "AltapSalamanderLoadSaveRegistry"; // zavedeno od AS 2.52 beta 1 +const char* FIRST_SALAMANDER_MUTEX_NAME = "AltapSalamanderFirstInstance"; // introduced in AS 2.52 beta 1 +const char* LOADSAVE_REGISTRY_MUTEX_NAME = "AltapSalamanderLoadSaveRegistry"; // introduced in AS 2.52 beta 1 -// cesta, kam ulozimi bug report a minidump; pozdeji je salmon zabali do 7z a uploadne na server +// path used to save the bug report and minidump; later Salmon packs them into 7z and uploads them to the server char BugReportPath[MAX_PATH] = ""; CRITICAL_SECTION CommandLineParamsCS; CCommandLineParams CommandLineParams; HANDLE CommandLineParamsProcessed; -// handle hlavniho okna (neni dobre z control threadu pristupovat na MainWindow, ktere se nam muze pod rukama nastavit na NULL) +// handle of the main window (the control thread should not access MainWindow because it may become NULL while we are using it) HWND HSafeMainWindow = NULL; void RaiseBreakException() @@ -50,8 +51,8 @@ void RaiseBreakException() #ifndef CALLSTK_DISABLE CCallStack stack; #endif // CALLSTK_DISABLE - RaiseException(OPENSAL_EXCEPTION_BREAK, 0, 0, NULL); // nase vlastni "break" exception - // sem uz se kod nedostane + RaiseException(OPENSAL_EXCEPTION_BREAK, 0, 0, NULL); // our own "break" exception + // the code never gets here } // @@ -61,8 +62,8 @@ void RaiseBreakException() DWORD WINAPI FControlThread(void* param) { - // toto vlakno neni volane s nasim CCallStack - narazil jsem pri leaknutem handlu, ze mi pri pokusu o jeho - // vypis (pri ukonceni Salamandera) padal Salam + // this thread does not run with our CCallStack; when I investigated + // a leaked handle, Salamander crashed while trying to dump it during shutdown CTaskList* tasklist = (CTaskList*)param; @@ -91,61 +92,61 @@ DWORD WINAPI FControlThread(void* param) case WAIT_OBJECT_0 + 1: // tasklist->Event { - // zabereme ProcessList + // lock ProcessList waitRet = WaitForSingleObject(tasklist->FMOMutex, TASKLIST_TODO_TIMEOUT); if (waitRet == WAIT_FAILED) - Sleep(50); // abychom nezrali CPU + Sleep(50); // so we do not hog the CPU if (waitRet == WAIT_FAILED || waitRet == WAIT_TIMEOUT) break; - // ochrana proti cykleni po provedeni commandu + // guard against looping after executing the command if (tasklist->ProcessList->TodoUID <= lastTodoUID) { - // uvolnime ProcessList + // release ProcessList ReleaseMutex(tasklist->FMOMutex); - Sleep(50); // dame prilezitost dalsim procesum + Sleep(50); // give other processes a chance break; } else lastTodoUID = tasklist->ProcessList->TodoUID; - // mame zabrany ProcessList + // ProcessList is now locked by us DWORD pid = tasklist->ProcessList->PID; - if (pid != ourPID) // pokud se udalost netyka nas + if (pid != ourPID) // if the event is not meant for us { - // uvolnime ProcessList + // release ProcessList ReleaseMutex(tasklist->FMOMutex); - Sleep(50); // dame prilezitost dalsim procesum + Sleep(50); // give other processes a chance break; } - // nyni jiz bezime v procesu, ktery mel zpravu obdrzet; zaroven jsme ve vedlejsim vlakne, takze - // pripadnou komunikaci s hlavnim vlaknem je treba resit dalsi synchronizaci + // now we are already running in the process that was supposed to receive the message; at the same time we are in a side thread, + // so any communication with the main thread has to be synchronized separately - // resetneme Event, protoze ted uz vime, ze patril nam a je zbytecne nechat bezet control thready ostatnich procesu + // reset the Event, because we now know it belonged to us and it is pointless to keep the control threads of other processes running ResetEvent(tasklist->Event); - // overime z timestampu, zda jsme jiz neprosvihli dobu, kterou jsme meli k dispozici pro odbaveni prikazu + // check the timestamp to see whether we already missed the window for handling the command DWORD tickCount = GetTickCount(); if (tickCount - tasklist->ProcessList->TodoTimestamp >= TASKLIST_TODO_TIMEOUT) { // TIMEOUT - // uvolnime ProcessList + // release ProcessList ReleaseMutex(tasklist->FMOMutex); break; } - // poridime si kopii zabraneho ProcessList + // make a copy of the locked ProcessList CProcessList processList; memcpy(&processList, tasklist->ProcessList, sizeof(CProcessList)); - // a uvolnime sdilenou pamet + // and release the shared memory ReleaseMutex(tasklist->FMOMutex); switch (processList.Todo) { case TASKLIST_TODO_HIGHLIGHT: { - SetEvent(tasklist->EventProcessed); // zprava pro proces-zadavatele: mame hotovo + SetEvent(tasklist->EventProcessed); // notification to the requesting process: we're done if (HSafeMainWindow != NULL) PostMessage(HSafeMainWindow, WM_USER_FLASHWINDOW, 0, 0); break; @@ -153,17 +154,17 @@ DWORD WINAPI FControlThread(void* param) case TASKLIST_TODO_BREAK: { - SetEvent(tasklist->EventProcessed); // zprava pro proces-zadavatele: mame hotovo + SetEvent(tasklist->EventProcessed); // notification to the requesting process: we're done RaiseBreakException(); - // sem uz se kod nedostane + // the code never gets here break; } case TASKLIST_TODO_TERMINATE: { - SetEvent(tasklist->EventProcessed); // zprava pro proces-zadavatele: mame hotovo + SetEvent(tasklist->EventProcessed); // notification to the requesting process: we're done HANDLE h = OpenProcess(PROCESS_TERMINATE, FALSE, pid); if (h != NULL) @@ -176,27 +177,27 @@ DWORD WINAPI FControlThread(void* param) case TASKLIST_TODO_ACTIVATE: { - // nakopirujeme ProcessList do globalni promenne CommandLineParams, - // kterou monitoruje hlavni thread pri vstupu od idle; + // copy ProcessList into the global CommandLineParams variable, + // which the main thread monitors when returning from idle; NOHANDLES(EnterCriticalSection(&CommandLineParamsCS)); memcpy(&CommandLineParams, &processList.CommandLineParams, sizeof(CCommandLineParams)); ResetEvent(CommandLineParamsProcessed); NOHANDLES(LeaveCriticalSection(&CommandLineParamsCS)); - // pro pripad, ze je hlavni thread v IDLE do nej strcime a vnutime mu kontrolu CommandLineParams::RequestUID - // pokud v IDLE neni, neco prave resi a zpravu odbavi ve chvili, kdy do IDLE vstoupi (pokud se dockame) + // if the main thread is IDLE, we poke it and force it to check CommandLineParams::RequestUID + // if it is not IDLE, it is already handling something and will process the message when it next enters IDLE if (HSafeMainWindow != NULL) PostMessage(HSafeMainWindow, WM_USER_WAKEUP_FROM_IDLE, 0, 0); - // pockame 5 vterin, zda se hlavni thread ozve (zatim nevstoupime do kriticke sekce, aby tam mohl on) + // wait 5 seconds to see whether the main thread responds (we do not enter the critical section yet so it can do so) WaitForSingleObject(CommandLineParamsProcessed, TASKLIST_TODO_TIMEOUT); - // nyni jiz do kriticke sekce muzeme vstoupit + // now we can enter the critical section NOHANDLES(EnterCriticalSection(&CommandLineParamsCS)); - CommandLineParams.RequestUID = 0; // zakazeme hlavnimu threadu pripadne dalsi akce - waitRet = WaitForSingleObject(CommandLineParamsProcessed, 0); // preptame se, jak vypada aktualni stav eventu + CommandLineParams.RequestUID = 0; // prevent the main thread from taking further actions + waitRet = WaitForSingleObject(CommandLineParamsProcessed, 0); // check the current state of the event if (waitRet == WAIT_OBJECT_0) - SetEvent(tasklist->EventProcessed); // zprava pro proces-zadavatele: mame hotovo + SetEvent(tasklist->EventProcessed); // notification to the requesting process: we're done NOHANDLES(LeaveCriticalSection(&CommandLineParamsCS)); break; } @@ -219,20 +220,20 @@ DWORD WINAPI FControlThread(void* param) if (HSafeMainWindow != NULL && SalShExtSharedMemView != NULL && SalShExtSharedMemView->SalamanderMainWnd == (UINT64)(DWORD_PTR)HSafeMainWindow) { - ResetEvent(SalShExtDoPasteEvent); // "zdrojovy" Salamander uz se nasel, dalsi hledani je zbytecne + ResetEvent(SalShExtDoPasteEvent); // the "source" Salamander has been found, further searching is pointless sleep = FALSE; PostMessage(HSafeMainWindow, WM_USER_SALSHEXT_PASTE, SalShExtSharedMemView->PostMsgIndex, 0); } ReleaseMutex(SalShExtSharedMemMutex); } if (sleep) - Sleep(50); // dame sanci dalsim Salamanderum + Sleep(50); // let other Salamanders have a chance break; } - default: // toto by nemelo nastat + default: // this should not happen { - Sleep(50); // abychom nezrali CPU + Sleep(50); // so we do not hog the CPU break; } } @@ -243,7 +244,7 @@ DWORD WINAPI FControlThread(void* param) CTaskList::CTaskList() { - // bezime ve skupine 'compiler', tedy pred ms_init + // we run in the 'compiler' segment, so this happens before ms_init OK = FALSE; FMO = NULL; ProcessList = NULL; @@ -252,7 +253,7 @@ CTaskList::CTaskList() EventProcessed = NULL; TerminateEvent = NULL; ControlThread = NULL; - // vnitrni synchronizace mezi ControlThread a hlavnim vlaknem + // internal synchronization between the control thread and the main thread NOHANDLES(InitializeCriticalSection(&CommandLineParamsCS)); CommandLineParamsProcessed = NULL; } @@ -267,7 +268,7 @@ BOOL CTaskList::Init() SECURITY_DESCRIPTOR sd; SECURITY_ATTRIBUTES* saPtr = CreateAccessableSecurityAttributes(&sa, &sd, GENERIC_ALL, &psidEveryone, &paclNewDacl); - //--- nejdrive takova bokovka: pod Vista+ vytvorime event pro komunikaci s copy-hookem (ceka se na nej v control-threadu) + //--- first a short detour: on Vista+ create an event used for communication with the copy hook (the control thread waits for it) if (WindowsVistaAndLater) { SalShExtDoPasteEvent = NOHANDLES(CreateEvent(saPtr, TRUE, FALSE, SALSHEXT_DOPASTEEVENTNAME)); @@ -277,12 +278,12 @@ BOOL CTaskList::Init() TRACE_E("CTaskList::Init(): unable to create event object for communicating with copy-hook shell extension!"); } - //--- pokusime se pripojit na FMO-mutex - zaroven test jestli uz nejaky Salamander bezi + //--- try to attach to the FMO mutex - also serves as a test whether any Salamander is already running FMOMutex = NOHANDLES(OpenMutex(SYNCHRONIZE, FALSE, AS_PROCESSLIST_MUTEX_NAME)); - if (FMOMutex == NULL) // jsme prvni Salamander 3.0 nebo novejsi v lokalni sessione + if (FMOMutex == NULL) // we are the first Salamander 3.0 or newer in the local session { - //--- vytvoreni systemovych objektu pro komunikaci, zabereme FMO - FMOMutex = NOHANDLES(CreateMutex(saPtr, TRUE, AS_PROCESSLIST_MUTEX_NAME)); // task list je platny pouze pro danou session, mutex patri do local namespace + //--- create system objects for communication, claim the FMO + FMOMutex = NOHANDLES(CreateMutex(saPtr, TRUE, AS_PROCESSLIST_MUTEX_NAME)); // the task list is valid only for the given session; the mutex lives in the local namespace if (FMOMutex == NULL) return FALSE; // fail FMO = NOHANDLES(CreateFileMapping(INVALID_HANDLE_VALUE, saPtr, PAGE_READWRITE | SEC_COMMIT, @@ -299,7 +300,7 @@ BOOL CTaskList::Init() if (EventProcessed == NULL) return FALSE; // fail - //--- inicializace sdilene pameti + //--- initialize the shared memory ZeroMemory(ProcessList, sizeof(CProcessList)); ProcessList->Version = 1; // 3.0 beta 4 @@ -307,36 +308,36 @@ BOOL CTaskList::Init() ProcessList->ItemsStateUID++; ProcessList->Items[0] = CProcessListItem(); - //--- uvolnime FMO + //--- release the FMO ReleaseMutex(FMOMutex); } - else // dalsi instance, jen se pripojime ... + else // another instance, just attach ... { - //--- zabereme FMO + //--- claim the FMO DWORD waitRet = WaitForSingleObject(FMOMutex, TASKLIST_TODO_TIMEOUT); if (waitRet == WAIT_TIMEOUT) - return FALSE; // fail + return FALSE; // failed - //--- pripojime se na ostatni systemove objekty pro komunikaci + //--- attach to the other system objects for communication FMO = NOHANDLES(OpenFileMapping(FILE_MAP_WRITE, FALSE, AS_PROCESSLIST_NAME)); if (FMO == NULL) - return FALSE; // fail + return FALSE; // failed ProcessList = (CProcessList*)NOHANDLES(MapViewOfFile(FMO, FILE_MAP_WRITE, 0, 0, 0)); if (ProcessList == NULL) - return FALSE; // fail - // aby na event bylo mozne volat SetEvent(), musi mit nahozeny EVENT_MODIFY_STATE, pro Wait* potrebuje SYNCHRONIZE + return FALSE; // failed + // to be able to call SetEvent() on the event, it must have EVENT_MODIFY_STATE set, Wait* requires SYNCHRONIZE Event = NOHANDLES(OpenEvent(SYNCHRONIZE | EVENT_MODIFY_STATE, FALSE, AS_PROCESSLIST_EVENT_NAME)); if (Event == NULL) - return FALSE; // fail + return FALSE; // failed EventProcessed = NOHANDLES(OpenEvent(SYNCHRONIZE | EVENT_MODIFY_STATE, FALSE, AS_PROCESSLIST_EVENT_PROCESSED_NAME)); if (EventProcessed == NULL) - return FALSE; // fail + return FALSE; // failed - //--- pridame zaznam do sdilene pameti + //--- add a record to shared memory BOOL attempt = 0; AGAIN: int c = ProcessList->ItemsCount; - if (c < MAX_TL_ITEMS) // pokud jich neni prilis, pridame tento proces + if (c < MAX_TL_ITEMS) // if there are not too many, add this process { ProcessList->ItemsCount++; ProcessList->ItemsStateUID++; @@ -346,25 +347,25 @@ BOOL CTaskList::Init() { if (attempt == 0) { - // pole je plne, zkusime ho setrast (nektery z procesu mohl chcipnout a nedat nam vedet) + // the array is full, try to shake it down (one of the processes might have died without informing us) RemoveKilledItems(NULL); attempt++; goto AGAIN; } } - //--- uvolnime FMO + //--- release the FMO ReleaseMutex(FMOMutex); } - // detekce ostatnich instanci Salamandera + // detect other Salamander instances LPTSTR sid = NULL; if (!GetStringSid(&sid)) sid = NULL; char mutexName[1000]; if (sid == NULL) { - // chyba v ziskani SID -- lokalni name space, bez pripojeneho SID + // failed to obtain SID -- local namespace without an attached SID _snprintf_s(mutexName, _TRUNCATE, "%s", FIRST_SALAMANDER_MUTEX_NAME); } else @@ -393,19 +394,19 @@ BOOL CTaskList::Init() TerminateEvent = NOHANDLES(CreateEvent(NULL, TRUE, FALSE, NULL)); if (TerminateEvent == NULL) - return FALSE; // fail + return FALSE; // failed - // vnitrni synchronizace mezi ControlThread a hlavnim vlaknem + // internal synchronization between the control thread and the main thread CommandLineParamsProcessed = CreateEvent(NULL, TRUE, FALSE, NULL); // manual, nonsignaled if (CommandLineParamsProcessed == NULL) return FALSE; // failed - // nelze pouzit _beginthreadex, protoze jeste nemusi byt inicializovana knihovna + // cannot use _beginthreadex because the library might not be initialized yet DWORD id; ControlThread = NOHANDLES(CreateThread(NULL, 0, FControlThread, this, 0, &id)); if (ControlThread == NULL) - return FALSE; // fail - // tenhle thread se musi dostat k lizu i kdyby na chleba nebylo ... + return FALSE; // failed + // this thread must still receive CPU time even if resources are scarce ... SetThreadPriority(ControlThread, THREAD_PRIORITY_TIME_CRITICAL); OK = TRUE; @@ -416,30 +417,30 @@ CTaskList::~CTaskList() { if (ControlThread != NULL) { - SetEvent(TerminateEvent); // terminuj se! - WaitForSingleObject(ControlThread, INFINITE); // pockame nez se thread dokonci + SetEvent(TerminateEvent); // terminate! + WaitForSingleObject(ControlThread, INFINITE); // wait until the thread finishes NOHANDLES(CloseHandle(ControlThread)); } if (TerminateEvent != NULL) NOHANDLES(CloseHandle(TerminateEvent)); - // vyradime se ze seznamu + // remove ourselves from the list if (OK) { - //--- zabereme FMO + //--- claim the FMO if (WaitForSingleObject(FMOMutex, TASKLIST_TODO_TIMEOUT) != WAIT_TIMEOUT) { CProcessListItem* ptr = ProcessList->Items; int c = ProcessList->ItemsCount; - //--- vyhodime aktualni proces, ukoncuje se ... + //--- remove the current process, it is shutting down ... DWORD PID = GetCurrentProcessId(); int i; for (i = 0; i < c; i++) { if (PID == ptr[i].PID) { - //--- vykopneme proces ze seznamu + //--- delete the process from the list memmove(ptr + i, ptr + i + 1, (c - i - 1) * sizeof(CProcessListItem)); c--; i--; @@ -448,7 +449,7 @@ CTaskList::~CTaskList() ProcessList->ItemsCount = c; ProcessList->ItemsStateUID++; - //--- uvolnime FMO + //--- release the FMO ReleaseMutex(FMOMutex); } } @@ -484,7 +485,7 @@ BOOL CTaskList::SetProcessState(DWORD processState, HWND hMainWindow, BOOL* time DWORD ret = WaitForSingleObject(FMOMutex, TASKLIST_TODO_TIMEOUT); if (ret != WAIT_FAILED && ret != WAIT_TIMEOUT) { - // dohledame se v seznamu procesu a nastavime processState a hMainWindow + // find ourselves in the process list and set processState and hMainWindow CProcessListItem* ptr = ProcessList->Items; int c = ProcessList->ItemsCount; DWORD PID = GetCurrentProcessId(); @@ -494,7 +495,7 @@ BOOL CTaskList::SetProcessState(DWORD processState, HWND hMainWindow, BOOL* time if (PID == ptr[i].PID) { ptr[i].ProcessState = processState; - ptr[i].HMainWindow = (UINT64)(DWORD_PTR)hMainWindow; // 64b pro x64/x86 kompatibilitu + ptr[i].HMainWindow = (UINT64)(DWORD_PTR)hMainWindow; // 64b for x64/x86 compatibility break; } } @@ -518,7 +519,7 @@ int CTaskList::GetItems(CProcessListItem* items, DWORD* itemsStateUID, BOOL* tim if (OK) { BOOL changed = FALSE; - //--- zabereme FMO + //--- claim the FMO if (WaitForSingleObject(FMOMutex, TASKLIST_TODO_TIMEOUT) == WAIT_TIMEOUT) { if (timeouted != NULL) @@ -528,10 +529,10 @@ int CTaskList::GetItems(CProcessListItem* items, DWORD* itemsStateUID, BOOL* tim CProcessListItem* ptr = ProcessList->Items; - //--- vyhodime killnute procesy + //--- remove killed processes RemoveKilledItems(&changed); - //--- navratove hodnoty + //--- return values if (items != NULL) memcpy(items, ptr, ProcessList->ItemsCount * sizeof(CProcessListItem)); if (changed) @@ -540,7 +541,7 @@ int CTaskList::GetItems(CProcessListItem* items, DWORD* itemsStateUID, BOOL* tim *itemsStateUID = ProcessList->ItemsStateUID; int count = ProcessList->ItemsCount; - //--- uvolnime FMO + //--- release the FMO ReleaseMutex(FMOMutex); return count; } @@ -554,7 +555,7 @@ BOOL CTaskList::FireEvent(DWORD todo, DWORD pid, BOOL* timeouted) *timeouted = FALSE; if (OK) { - // zabereme ProcessList + // claim ProcessList DWORD waitRet = WaitForSingleObject(FMOMutex, 2000); if (waitRet == WAIT_FAILED) return FALSE; @@ -565,44 +566,44 @@ BOOL CTaskList::FireEvent(DWORD todo, DWORD pid, BOOL* timeouted) return FALSE; // fail } - // nastavime predavane parametry + // set the passed parameters ProcessList->Todo = todo; ProcessList->TodoUID++; ProcessList->TodoTimestamp = GetTickCount(); ProcessList->PID = pid; - // pri breaknuti jine instance Salamandera pustime jeho Salmon nad nas + // when breaking another Salamander instance, allow its Salmon to come to the foreground in front of us if (todo == TASKLIST_TODO_BREAK) { for (DWORD i = 0; i < ProcessList->ItemsCount; i++) { if (ProcessList->Items[i].PID == pid) { - AllowSetForegroundWindow(ProcessList->Items[i].PID); // radeji povolime i vlastniho Salamandera, i kdyz to je asi zbytecne... - AllowSetForegroundWindow(ProcessList->Items[i].SalmonPID); // rozhodne musime pustit nad nas jeho Salmon + AllowSetForegroundWindow(ProcessList->Items[i].PID); // better allow our own Salamander too, even if it is probably unnecessary... + AllowSetForegroundWindow(ProcessList->Items[i].SalmonPID); // we definitely must allow its Salmon to come to the foreground before us break; } } } - // uvolnime ProcessList + // release ProcessList ReleaseMutex(FMOMutex); - // spustime kontrolu ve vsech Salamanderech + // trigger the check in all Salamanders ResetEvent(EventProcessed); SetEvent(Event); - //--- dame chvilku na reakci (behem teto doby by se nekdo mel "chytnout" a ukol splnit) + //--- give it a moment to react (during this time someone should "grab" it and complete the task) BOOL ret = (WaitForSingleObject(EventProcessed, 1000) == WAIT_OBJECT_0); - //--- rekneme vsem Salamanderum, at se pripravi na dalsi command + //--- tell all Salamanders to prepare for the next command ResetEvent(Event); - //--- nastavime zpatky break-PID + //--- restore the break PID // ProcessList->Todo = 0; // ProcessList->PID = 0; - //--- uvolnime FMO + //--- release the FMO return ret; } @@ -619,9 +620,9 @@ BOOL CTaskList::ActivateRunningInstance(const CCommandLineParams* cmdLineParams, CProcessListItem ourProcessInfo; - // dohledame bezici proces v nasi tride, pripadne startujici (na ktery chvili pockame jestli se rozebehne) - int firstStarting = -1; // index procesu, ktery je z nasi tridy (shodny Integrity Level a SID) ale nema jeste hlavni okno - int firstRunnig = -1; // index procesu, ktery je z nasi tridy (shodny Integrity Level a SID) a jiz bezi (ma hlavni okno) + // find a running process in our class, or possibly a starting one (wait a moment to see if it takes off) + int firstStarting = -1; // index of a process from our class (matching Integrity Level and SID) that does not yet have a main window + int firstRunnig = -1; // index of a process from our class (matching Integrity Level and SID) that is already running (has a main window) DWORD timeStamp = GetTickCount(); do { @@ -630,13 +631,13 @@ BOOL CTaskList::ActivateRunningInstance(const CCommandLineParams* cmdLineParams, DWORD ret = WaitForSingleObject(FMOMutex, 200); if (ret == WAIT_FAILED) return FALSE; - if (ret != WAIT_TIMEOUT) // obdrzeli jsme mutex + if (ret != WAIT_TIMEOUT) // we obtained the mutex { int i; for (i = 0; i < (int)ProcessList->ItemsCount; i++) { CProcessListItem* item = &ProcessList->Items[i]; - // hledam pouze procesy v nasi tride (shodny IntegrityLevel a SID) + // search only for processes in our class (matching IntegrityLevel and SID) if (item->PID != ourProcessInfo.PID && item->IntegrityLevel == ourProcessInfo.IntegrityLevel && memcmp(item->SID_MD5, ourProcessInfo.SID_MD5, 16) == 0) @@ -644,62 +645,62 @@ BOOL CTaskList::ActivateRunningInstance(const CCommandLineParams* cmdLineParams, if (item->ProcessState == PROCESS_STATE_RUNNING) { firstRunnig = i; - break; // pokud jsme nasli bezici instanci, nemusime uz startujici hledat + break; // if we found a running instance, no need to look for a starting one } if (item->ProcessState == PROCESS_STATE_STARTING && firstStarting == -1) firstStarting = i; } } - if (firstRunnig == -1) // zadny proces z nasi tridy zatim nema hlavni okno + if (firstRunnig == -1) // no process from our class has a main window yet { - ReleaseMutex(FMOMutex); // takze uvolnime pamet ostatnim + ReleaseMutex(FMOMutex); // so release the memory to others if (firstStarting == -1) - return FALSE; // nenasli jsme zadneho startujiciho kandidata, vypadneme + return FALSE; // no starting candidate found else - Sleep(200); // nasli jsme startujiciho kandidata, na 200ms se odmlcime, aby mel sanci zavolat SetProcessState() + Sleep(200); // found a starting candidate, pause for 200 ms to give it a chance to call SetProcessState() } } - } while (firstRunnig == -1 && (GetTickCount() - timeStamp < TASKLIST_TODO_TIMEOUT)); // na bezici instanci cekame maximalne 5s + } while (firstRunnig == -1 && (GetTickCount() - timeStamp < TASKLIST_TODO_TIMEOUT)); // wait for a running instance for at most 5 s - // pokud jsme nenasli zadnou instanci z nasi tridy, co by mela hlavni okno, pripadne pokud nam cekani zabralo 5s, zabalime to + // if we did not find any instance of our class with a main window, or if waiting took 5 s, stop waiting if (firstRunnig == -1) return FALSE; CProcessListItem* item = &ProcessList->Items[firstRunnig]; - // nastavime Todo, PID a parametry + // set Todo, PID, and parameters ProcessList->Todo = TASKLIST_TODO_ACTIVATE; - ProcessList->TodoUID++; // rekneme procesum, ze se bude zpracovavat novy command + ProcessList->TodoUID++; // tell processes that a new command will be processed ProcessList->TodoTimestamp = GetTickCount(); ProcessList->PID = item->PID; - // prebereme parametry z command-line + // take parameters from the command line memcpy(&ProcessList->CommandLineParams, cmdLineParams, sizeof(CCommandLineParams)); - // a nastavime nase vnitrni promenne + // and set our internal variables ProcessList->CommandLineParams.Version = 1; ProcessList->CommandLineParams.RequestUID = ProcessList->TodoUID; ProcessList->CommandLineParams.RequestTimestamp = ProcessList->TodoTimestamp; - // povolime aktivovanemu procesu volani SetForegroundWindow, jinak se nebude schopny vytahnout nahoru + // allow the activated process to call SetForegroundWindow, otherwise it will not be able to come to the front AllowSetForegroundWindow(item->PID); - // spustime kontrolu ve vsech Salamanderech - // uvolnime sdilenou pamet + // trigger the check in all Salamanders + // release shared memory ReleaseMutex(FMOMutex); ResetEvent(EventProcessed); SetEvent(Event); - // dame chvilku na reakci (behem teto doby by se nekdo mel "chytnout" a ukol splnit) - // 500ms je nase rezerva, abychom bezpecne prekryli podrizena vlakna + // give it a moment to react (during this period someone should "grab" it and finish the task) + // 500 ms is our cushion so we safely cover subordinate threads BOOL ret = (WaitForSingleObject(EventProcessed, TASKLIST_TODO_TIMEOUT + 500) == WAIT_OBJECT_0); - // rekneme vsem Salamanderum, at se pripravi na dalsi command (reseti se i v control threadu, pokud nektery proces provadi todo) + // tell all Salamanders to prepare for the next command (it also resets in the control thread if a process is performing the todo) ResetEvent(Event); - // vynulujeme todo - // ProcessList->Todo = 0; // meli bychom si napred zabrat FMOMutex, ale v tomto pripade neni co pokazit a muzeme hodnoty vynulovat + // reset todo + // ProcessList->Todo = 0; // we should lock FMOMutex first, but in this case there is nothing to corrupt and we can zero the values // ProcessList->PID = 0; return ret; @@ -721,22 +722,22 @@ BOOL CTaskList::RemoveKilledItems(BOOL* changed) HANDLE h = NOHANDLES(OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, ptr[i].PID)); if (h != NULL) { - // na starsich Windows ziskame handle i pro ukonceny proces - // je proto potreba se jeste doptat na exitcode; od W2K zrejme zbytecne + // on older Windows we obtain a handle even for a terminated process + // therefore it is still necessary to query the exit code; probably unnecessary since W2K BOOL cont = FALSE; DWORD exitcode; if (!GetExitCodeProcess(h, &exitcode) || exitcode == STILL_ACTIVE) cont = TRUE; NOHANDLES(CloseHandle(h)); if (cont) - continue; // nechame proces v seznamu + continue; // keep the process in the list } else { DWORD lastError = GetLastError(); if (lastError == ERROR_ACCESS_DENIED) { - continue; // nechame proces v seznamu + continue; // keep the process in the list } } memmove(ptr + i, ptr + i + 1, (c - i - 1) * sizeof(CProcessListItem)); @@ -748,9 +749,9 @@ BOOL CTaskList::RemoveKilledItems(BOOL* changed) ProcessList->ItemsCount = c; /* -// neslape pod XP pokud jsou procesy v ramci jedne session spusteny pod ruznymi uzivateli -// nemame pravo otevrit hande jineho procesu -//--- vyhodime killnuty procesy +// does not work on XP if processes within one session run under different users +// we do not have permission to open a handle to another process +//--- remove killed processes int i; for (i = 0; i < c; i++) { @@ -761,9 +762,9 @@ int i; DWORD exitcode; if (!GetExitCodeProcess(h, &exitcode) || exitcode == STILL_ACTIVE) cont = TRUE; NOHANDLES(CloseHandle(h)); - if (cont) continue; // nechame proces v seznamu + if (cont) continue; // keep the process in the list } -//--- vykopneme proces ze seznamu +//--- remove the process from the list memmove(ptr + i, ptr + i + 1, (c - i - 1) * sizeof(CTLItem)); c--; i--; @@ -773,4 +774,4 @@ int i; */ return TRUE; -} \ No newline at end of file +} From 77df1f4f96a6604cf255f2cd062983f92cf7e9cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 09:48:50 +0200 Subject: [PATCH 586/710] [translation] Initial src/tasklist.h comments translation (#962) --- src/tasklist.h | 164 +++++++++++++++++++++++++------------------------ 1 file changed, 84 insertions(+), 80 deletions(-) diff --git a/src/tasklist.h b/src/tasklist.h index 0b1319a7b..178328d02 100644 --- a/src/tasklist.h +++ b/src/tasklist.h @@ -1,49 +1,52 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once // // **************************************************************************** -// TRUE = prvni bezici instance verze 3.0 nebo novejsi -// urcuje se na zaklade mutexu v globalnim namespace, takze se vidi s mutexty -// z ostatnich sessions (remote desktop, fast user switching) +// TRUE = first running instance of version 3.0 or later +// Determined using a mutex in the global namespace, so it is visible across sessions +// (remote desktop, fast user switching) extern BOOL FirstInstance_3_or_later; -// sdilena pamet obsahuje: -// DWORD - PID procesu, ktery se ma breaknout -// DWORD - pocet polozek v listu -// MAX_TL_ITEMS * CTLItem - list polozek +// Shared memory contains: +// DWORD - PID of the process that should be broken into +// DWORD - number of items in the list +// MAX_TL_ITEMS * CTLItem - list of items -#define MAX_TL_ITEMS 500 // maximalni pocet polozek ve sdilene pameti, nelze menit! +#define MAX_TL_ITEMS 500 // maximum number of items in shared memory, cannot be changed! -#define TASKLIST_TODO_HIGHLIGHT 1 // okno procesu daneho v 'PID' se ma vysvitit -#define TASKLIST_TODO_BREAK 2 // proces dany v 'PID' se ma breaknout -#define TASKLIST_TODO_TERMINATE 3 // proces dany v 'PID' se ma terminovat -#define TASKLIST_TODO_ACTIVATE 4 // proces dany v 'PID' se ma aktivovat +#define TASKLIST_TODO_HIGHLIGHT 1 // window of the process in 'PID' is to be highlighted +#define TASKLIST_TODO_BREAK 2 // the process specified by 'PID' is to be broken into +#define TASKLIST_TODO_TERMINATE 3 // process given in 'PID' is to be terminated +#define TASKLIST_TODO_ACTIVATE 4 // process given in 'PID' is to be activated -#define TASKLIST_TODO_TIMEOUT 5000 // 5 vterin, ktere maji procesy pro zpracovani todo +#define TASKLIST_TODO_TIMEOUT 5000 // 5 seconds that processes have to process the todo entry -#define PROCESS_STATE_STARTING 1 // nas proces startuje, jeste neexistuje hlavni okno -#define PROCESS_STATE_RUNNING 2 // nas proces bezi, mame hlavni okno -#define PROCESS_STATE_ENDING 3 // nas proces konci, nemame uz hlavni okno +#define PROCESS_STATE_STARTING 1 // our process is starting, the main window does not exist yet +#define PROCESS_STATE_RUNNING 2 // our process is running, we have the main window +#define PROCESS_STATE_ENDING 3 // our process is ending, we no longer have the main window -#pragma pack(push, enter_include_tasklist) // aby byly struktury nezavisle na nastavenem zarovnavani +#pragma pack(push, enter_include_tasklist) // make the structures independent of the current alignment setting #pragma pack(4) extern HANDLE HSalmonProcess; -// POZOR, pomoci struktury komunikuji x64 a x86 procesy, pozor na typy (napr. HANDLE), ktere maji ruzne sirky +// WARNING, x64 and x86 processes communicate through the structure; mind the types +// (e.g. HANDLE) that have different widths struct CProcessListItem { - DWORD PID; // ProcessID, unikatni po dobu behu procesu, pak muze byt znovu pouzito - SYSTEMTIME StartTime; // Kdy byl proces nastartovan - DWORD IntegrityLevel; // Integrity Level procesu, slouzi k rozliseni procesu spustenych na ruzne urovni opravneni - BYTE SID_MD5[16]; // MD5 napocitana ze SID procesu, slouzi nam k rozliseni procesu bezicich pod ruznymi uzivateli; SID ma neznamou delku, proto tato obezlicka - DWORD ProcessState; // Stav v jakem se Salamander nachazi, viz PROCESS_STATE_xxx - UINT64 HMainWindow; // (x64 friendly) Handle hlavniho okna, pokud jiz/jeste existuje (nastavuje se pri jeho vytvareni/destrukci) - DWORD SalmonPID; // ProcessID salmonu, aby mu brakujici proces mohl garantovat pravo pro SetForegroundWindow + DWORD PID; // ProcessID, unique for the lifetime of the process, after which it can be reused + SYSTEMTIME StartTime; // When the process was started + DWORD IntegrityLevel; // Integrity Level of the process, distinguishes processes running at different privilege levels + BYTE SID_MD5[16]; // MD5 calculated from the process SID, distinguishes processes running under different users; SID has an unknown length, hence this workaround + DWORD ProcessState; // State Salamander is currently in; see PROCESS_STATE_xxx + UINT64 HMainWindow; // (x64 friendly) Handle of the main window, if it already/still exists (set during creation/destruction) + DWORD SalmonPID; // Salmon ProcessID, so the process that breaks in can guarantee it has + // permission to call SetForegroundWindow CProcessListItem() { @@ -55,31 +58,32 @@ struct CProcessListItem HMainWindow = NULL; SalmonPID = 0; if (HSalmonProcess != NULL) - SalmonPID = SalGetProcessId(HSalmonProcess); // v tuto dobu jiz Salmon bezi + SalmonPID = SalGetProcessId(HSalmonProcess); // at this moment Salmon is already running } }; -// POZOR, ke strukture lze pouze pridavat polozky, protoze na ni chodi i starsi verze Salamandera -// POZOR, pomoci struktury komunikuji x64 a x86 procesy, pozor na typy (napr. HANDLE), ktere maji ruzne sirky -// POZOR, nejspis nema smysl zvedat verzi a rozsirovat strukturu, protoze pridana data v tom pripade -// nebudou vzdy k dispozici (stara verze Salama nahozena jako prvni = ve sdilene pameti nove -// polozky vubec nebudou) => spravne reseni je nejspis zmena AS_PROCESSLIST_NAME a spol. + -// uprava dat dle libosti (klidne zvetsovani, promazavani, zmena poradi, atd.) +// WARNING, only new items can be added to the structure because older Salamander versions use it +// WARNING, x64 and x86 processes communicate using the structure; mind the types (e.g. HANDLE) that have different widths +// WARNING, increasing the version and expanding the structure probably makes no sense because +// the added data would not always be available (if an older Salamander version is +// launched first, the new items will not exist in shared memory) +// => the proper solution is likely to change AS_PROCESSLIST_NAME and similar constants +// and then adjust the data as desired (feel free to enlarge, prune, reorder, etc.) struct CCommandLineParams { - DWORD Version; // novejsi verze Salamandera mohou zvysovat 'Version' a zacit vyuzivat promenne ReservedX - DWORD RequestUID; // unikatni (zvysujici se) ID pozadavku o aktivaci - DWORD RequestTimestamp; // GetTickCount() hodnota ze chvile, kdy byl zakladan pozadavek pro aktivaci - char LeftPath[2 * MAX_PATH]; // cesty do panelu (levy, pravy, pripadne aktivni); pokud jsou prazdne, nemaji se nastavit + DWORD Version; // newer Salamander versions can increase 'Version' and start using ReservedX variables + DWORD RequestUID; // unique (monotonically increasing) ID of the activation request + DWORD RequestTimestamp; // GetTickCount() value from the moment the activation request was created + char LeftPath[2 * MAX_PATH]; // panel paths (left, right, possibly active); if empty, leave them unset char RightPath[2 * MAX_PATH]; char ActivePath[2 * MAX_PATH]; - DWORD ActivatePanel; // ktery panel se ma aktivovat 0-zadny, 1-levy, 2-pravy - BOOL SetTitlePrefix; // pokud je TRUE, nastavi se prefix titulku podle TitlePrefix - char TitlePrefix[MAX_PATH]; // prefix titulku, pokud je prazdny, nemenit; delku radeji deklaruji na MAX_PATH, misto TITLE_PREFIX_MAX, ktery by se mohl pod rukama zmenit - BOOL SetMainWindowIconIndex; // pokud je TRUE, nastavi se ikona hlavniho okna podle MainWindowIconIndex - DWORD MainWindowIconIndex; // 0: prvni ikona, 1: druha ikona, ... - // POZOR, strukturu lze rozsirovat pouze v pripade, ze je stale zadeklarovana jako posledni v CProcessList, - // jinak uz je pozde a nesmi se ji dotknout + DWORD ActivatePanel; // which panel to activate: 0-none, 1-left, 2-right + BOOL SetTitlePrefix; // if TRUE, set the title prefix according to TitlePrefix + char TitlePrefix[MAX_PATH]; // title prefix; if empty, leave unchanged; I prefer to declare the length as MAX_PATH instead of TITLE_PREFIX_MAX, which might change unexpectedly + BOOL SetMainWindowIconIndex; // if TRUE, set the main window icon according to MainWindowIconIndex + DWORD MainWindowIconIndex; // 0: first icon, 1: second icon, ... + // WARNING, the structure can only be expanded if it is still declared as the last one in CProcessList; + // otherwise it is already too late and it must not be touched CCommandLineParams() { @@ -88,22 +92,22 @@ struct CCommandLineParams }; // Open Salamander Process List -// !!! POZOR, ke strukture lze pouze pridavat polozky, protoze na ni chodi i starsi verze Salamandera +// !!! WARNING, only new items can be added to the structure because older Salamander versions use it struct CProcessList { - DWORD Version; // novejsi verze Salamandera mohou zvysovat 'Version' a zacit vyuzivat promenne ReservedX + DWORD Version; // newer Salamander versions can increase 'Version' and start using ReservedX variables - DWORD ItemsCount; // pocet validnich polozek v poli Items - DWORD ItemsStateUID; // "verze" Items seznamu; zvysuje se s kazdou zmenou; slouzi pro Tasks dialog jako signal, ze se ma refreshnout + DWORD ItemsCount; // number of valid items in the Items array + DWORD ItemsStateUID; // "version" of the Items list; increases with every change; used by the Tasks dialog as a signal to refresh CProcessListItem Items[MAX_TL_ITEMS]; - DWORD Todo; // urcuje co se ma delat po odpaleni eventu pomoci FireEvent, obsahuje jednu z hodnot TASKLIST_TODO_* - DWORD TodoUID; // poradi zaslaneho pozadavku, pro kazdy dalsi pozadavek ze zvysuje - DWORD TodoTimestamp; // GetTickCount() hodnota ze chvile, kdy byl zakladan Todo pozadavek - DWORD PID; // PID, pro ktery se ma provest cinnost z Todo - CCommandLineParams CommandLineParams; // cesty pro panely a dalsi parametry pro aktivaci - // POZOR, pokud bude potreba rozsirovat tuto strukturu, bylo by rozumne napred rozsirit CCommandLineParams, napriklad - // reservovat nejake MAX_PATH buffery a par DWORDu, pokud bychom chteli predavat nove command line parametry + DWORD Todo; // specifies what to do after FireEvent signals the event; contains one of the TASKLIST_TODO_* values + DWORD TodoUID; // sequence number of the submitted request; increases with every subsequent request + DWORD TodoTimestamp; // GetTickCount() value from the moment the Todo request was created + DWORD PID; // PID for which the Todo action should be performed + CCommandLineParams CommandLineParams; // panel paths and other parameters for activation + // WARNING, if this structure needs to be extended, it makes sense to extend CCommandLineParams first, for example + // reserve a few MAX_PATH buffers and some DWORDs if we want to pass new command-line parameters }; #pragma pack(pop, enter_include_tasklist) @@ -111,16 +115,16 @@ struct CProcessList class CTaskList { protected: - HANDLE FMO; // file-mapping-object, sdilena pamet - CProcessList* ProcessList; // ukazatel do sdilene pameti - HANDLE FMOMutex; // mutex pro reseni pristupu k FMO - HANDLE Event; // event, je-li signaled, mely by se ostatni procesy podivat, - // jestli se nemaji provest cinnost danou v Todo - HANDLE EventProcessed; // pokud jeden z procesu provede cinnost v Todo, nastavi tento - // event na signaled na znameni ridicimu procesu, ze je hotovo - HANDLE TerminateEvent; // event pro ukonceni break-threadu - HANDLE ControlThread; // control-thread (ceka na eventy, ktere obratem odbavi) - BOOL OK; // probehla konstrukce o.k.? + HANDLE FMO; // file-mapping-object, shared memory + CProcessList* ProcessList; // pointer into shared memory + HANDLE FMOMutex; // mutex used to control access to the FMO + HANDLE Event; // event; when it becomes signaled, other processes should check + // whether they should perform the activity specified in Todo + HANDLE EventProcessed; // if one of the processes performs the Todo activity, it sets this + // event to signaled to let the controlling process know it is finished + HANDLE TerminateEvent; // event for terminating the break thread + HANDLE ControlThread; // control thread (waits for events and services them immediately) + BOOL OK; // did construction finish OK? public: CTaskList(); @@ -128,28 +132,28 @@ class CTaskList BOOL Init(); - // naplni polozky task-listu, items - pole alespon MAX_TL_ITEMS struktur CTLItem, vraci pocet polozek - // 'items' muze byt NULL, pokud nas zajima pouze 'itemsStateUID' - // vrati "verzi" sestavy procesu; verze se zvysuje s kazdou zmenou v seznamu (pokud je pridana nebo odebrana polozka) - // slouzi pro dialog jako informace, ze ma refreshnout seznam; 'itemsStateUID' muze byt NULL - // pokud je 'timeouted' ruzny od NULL, nastavi zda k neuspechu vedl timeout pri cekani na sdilenou pamet + // Fills the task-list items; 'items' is an array of at least MAX_TL_ITEMS CProcessListItem structures; returns the number of items + // 'items' can be NULL if only 'itemsStateUID' is needed + // Returns the "version" of the process list; the version increases with every change to the list (when an item is added or removed) + // Used by the dialog to know when to refresh the list; 'itemsStateUID' can be NULL + // If 'timeouted' is not NULL, it is set to indicate whether the failure was caused by a timeout while waiting for shared memory int GetItems(CProcessListItem* items, DWORD* itemsStateUID, BOOL* timeouted = NULL); - // pozada proces 'pid' o provedeni akce dle 'todo' (mimo TASKLIST_TODO_ACTIVATE) - // pokud je 'timeouted' ruzny od NULL, nastavi zda k neuspechu vedl timeout pri cekani na sdilenou pamet + // Requests process 'pid' to perform the action defined by 'todo' (except TASKLIST_TODO_ACTIVATE) + // if 'timeouted' is not NULL, it sets whether the failure was caused by a timeout when waiting for shared memory BOOL FireEvent(DWORD todo, DWORD pid, BOOL* timeouted = NULL); - // pokud je 'timeouted' ruzny od NULL, nastavi zda k neuspechu vedl timeout pri cekani na sdilenou pamet + // If 'timeouted' is not NULL, it is set to indicate whether the failure was caused by a timeout while waiting for shared memory BOOL ActivateRunningInstance(const CCommandLineParams* cmdLineParams, BOOL* timeouted = NULL); - // v seznamu procesu dohleda nas a nastavi 'ProcessState' a 'HMainWindow'; vraci TRUE v pripade uspechu, jinak FALSE - // pokud je 'timeouted' ruzny od NULL, nastavi zda k neuspechu vedl timeout pri cekani na sdilenou pamet + // Searches the process list for our entry and sets 'ProcessState' and 'HMainWindow'; returns TRUE on success, otherwise FALSE + // if 'timeouted' is not NULL, it sets whether the failure was caused by a timeout when waiting for shared memory BOOL SetProcessState(DWORD processState, HWND hMainWindow, BOOL* timeouted = NULL); protected: - // projde seznam procesu a vytridi neexistujici polozky - // nutne volat po uspesnem vstupu kriticke sekce 'FMOMutex'! - // nastavi 'changed' na TRUE, pokud byla nejaka polozka zahozena, jinak na FALSE + // Walks the process list and removes entries whose processes no longer exist + // Call only after successfully entering the 'FMOMutex' critical section! + // Sets 'changed' to TRUE if it discarded any item, otherwise to FALSE BOOL RemoveKilledItems(BOOL* changed); friend DWORD WINAPI FControlThread(void* param); @@ -157,9 +161,9 @@ class CTaskList extern CTaskList TaskList; -// ochrana pristupu do CommandLineParams +// protection for access to CommandLineParams extern CRITICAL_SECTION CommandLineParamsCS; -// slouzi k predani parametru pro aktivaci Salamander z Control threadu do hlavniho thradu +// used to hand off activation parameters from the Control thread to the main thread extern CCommandLineParams CommandLineParams; -// event je "signaled" jakmile hlavni thread prevezme paramtery +// event becomes "signaled" as soon as the main thread takes over the parameters extern HANDLE CommandLineParamsProcessed; From 7c772ae31d22174b510a8b5e679749d00369b25f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 09:48:54 +0200 Subject: [PATCH 587/710] [translation] Initial src/thumbnl.cpp comments translation (#963) --- src/thumbnl.cpp | 201 ++++++++++++++++++++++++------------------------ 1 file changed, 101 insertions(+), 100 deletions(-) diff --git a/src/thumbnl.cpp b/src/thumbnl.cpp index 1ed031220..650973a21 100644 --- a/src/thumbnl.cpp +++ b/src/thumbnl.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -53,10 +54,10 @@ BOOL CShrinkImage::Alloc(DWORD origWidth, DWORD origHeight, TRACE_E("origWidth == 0 || origHeight == 0 || newWidth == 0 || newHeight == 0"); return FALSE; } - // alokujeme a inicializujeme koeficienty + // allocate and initialize the coefficients RowCoeff = CreateCoeff(origWidth, newWidth, NormCoeffX); ColCoeff = CreateCoeff(origHeight, newHeight, NormCoeffY); - // alokujeme a vycistime buffer + // allocate and clear the accumulation buffer Buff = (DWORD*)malloc(3 * newWidth * sizeof(DWORD)); if (RowCoeff == NULL || ColCoeff == NULL || Buff == NULL) { @@ -72,14 +73,14 @@ BOOL CShrinkImage::Alloc(DWORD origWidth, DWORD origHeight, ProcessTopDown = processTopDown; YCoeff = ColCoeff; - // koeficienty pro stredove a pravy pixel pro pripadne dalsi kolo + // coefficients for the center and right pixel for a possible additional round NormCoeff = NormCoeffY * NormCoeffX; - // y-ova hranice sekce + // Y boundary of this section YBndr = *YCoeff++; - // preskocime koeficient pro prvni radek + // skip the coefficient for the first row YCoeff++; - // pokud jedem odspodu, musime zacit poslednim radkem + // if we process from the bottom, we must start from the last row if (!ProcessTopDown) OutLine = outBuff + newWidth * (newHeight - 1); else @@ -115,25 +116,25 @@ CShrinkImage::CreateCoeff(DWORD origLen, WORD newLen, DWORD& norm) for (i = 0; i < newLen; i++) { sum += origLen; - // vypocet pixelu, kterym prochazi nova hranice + // compute the pixel the new boundary crosses boundary = sum / newLen; - // kolik z predesle hranice bude v leve casti teto sekce + // how much of the previous boundary belongs to the left part of this section lCoeff = norm - rCoeff; - // a nakonec vaha pixelu u praveho okraje sekce + // and finally the weight of the pixel at the section's right edge modulo = sum % newLen; if (modulo == 0) { - // pokud nam hranice prochazi mezi pixely, uprednostnime levy pixel + // if the boundary falls between pixels, prefer the left one boundary--; rCoeff = norm; } else rCoeff = (modulo << 12) / origLen; - // a ulozime do pole - prvni je souradnice hranice + // and store the data in the array: first the boundary coordinate *coeff++ = boundary; - // dalsi je vaha pixelu u leveho okraje + // next the weight of the pixel at the left edge *coeff++ = lCoeff; - // a vaha u praveho okraje + // and the weight at the right edge *coeff++ = rCoeff; } return res; @@ -148,207 +149,207 @@ void CShrinkImage::ProcessRows(DWORD* inBuff, DWORD rowCount) BYTE r, g, b; DWORD rgb; - // jedem pres vsechny radky + // iterate over every row DWORD y; for (y = Y; y < Y + rowCount; y++) { - // nainicializujeme pointery do bufferu + // initialize the buffer pointers currPix = Buff; - // nainicializujem pointer do pole koeficientu + // initialize the pointer into the coefficient array ptrXCoeff = RowCoeff; - // maximalni x-ova souradnice + // maximum X coordinate for the current output pixel xBndr = *ptrXCoeff++; - // levej koeficient je na zacatku radku stejnej jako stredni + // at the start of the row the left coefficient equals the middle coefficient ptrXCoeff++; - // pravej koeficient + // right coefficient xCoeff = *ptrXCoeff++; x2 = 0; - // rozdeleni podle polohy radku v sekci (stredni nebo posledni) + // branch depending on whether this row is in the middle of the section or the last one if (y == YBndr) { - // vytahneme koeficient pro posledni radek + // take the coefficient for the last row DWORD yLastCoeff = *YCoeff++; - // vytahneme koeficient pro prvni radek dalsi sekce (je-li nejaka) + // take the coefficient for the first row of the next section (if any) if (y + 1 < OrigHeight) { - YBndr = *YCoeff++; // nova y-ova hranice sekce + YBndr = *YCoeff++; // new Y boundary of the segment yCoeff = *YCoeff++; } else { - YBndr = 0; // nova y-ova hranice sekce + YBndr = 0; // new Y boundary of the segment yCoeff = 0; } - // koeficienty pro stredove a pravy pixel + // coefficients for the center and right pixel xNewCoeff = yCoeff * xCoeff; xCoeff *= yLastCoeff; - // koeficienty pro dalsi radek + // coefficients for the next row DWORD midNewCoeff = yCoeff * NormCoeffX; DWORD midCoeff = yLastCoeff * NormCoeffX; - // pomocne promenne pro pixel dalsiho radku + // temporary sums for the next row's pixel DWORD nextR = 0; DWORD nextG = 0; DWORD nextB = 0; - // a predpocitavame dalsi + // and precompute the remaining contributions for (x1 = 0; x1 + 1 < NewWidth; x1++) { - // jsme-li na poslednim radku, aktualni ukladame do vysledku - // projedem stredni cast + // since this is the last row, store the current pixel into the result + // process the middle portion for (; x2 < xBndr; x2++) { - // vytahneme pixel + // fetch the pixel rgb = *inBuff++; r = GetRValue(rgb); g = GetGValue(rgb); b = GetBValue(rgb); - // pripocitame ho do bufferu + // accumulate it into the buffer currPix[0] += midCoeff * r; currPix[1] += midCoeff * g; currPix[2] += midCoeff * b; - // a pripravime i pixel z pristiho radku + // and accumulate the contributions for the next row's pixel nextR += midNewCoeff * r; nextG += midNewCoeff * g; nextB += midNewCoeff * b; } - // vytahneme nejpravejsi pixel + // fetch the rightmost pixel rgb = *inBuff++; r = GetRValue(rgb); g = GetGValue(rgb); b = GetBValue(rgb); - // napocitany pixel uz muzem poslat na vystup + // the computed pixel can now be written to the output *OutLine++ = RGB((currPix[0] + xCoeff * r) >> 24, (currPix[1] + xCoeff * g) >> 24, (currPix[2] + xCoeff * b) >> 24); - // pripravime pixel pro dalsi radek + // prepare the buffer for the next row currPix[0] = nextR + xNewCoeff * r; currPix[1] = nextG + xNewCoeff * g; currPix[2] = nextB + xNewCoeff * b; - // zvetsime souradnici + // advance the coordinate x2++; - // soupnem se ve vystupu na dalsi pixel + // move to the next output pixel currPix += 3; - // nova maximalni x-ova souradnice + // fetch the next X boundary xBndr = *ptrXCoeff++; - // novej levej koeficient pro oba radky + // new left coefficient for both rows xNewCoeff = yCoeff * *ptrXCoeff; xCoeff = yLastCoeff * *ptrXCoeff++; - // a taky ho pripocitame do bufferu pro dalsi pixel + // and accumulate it into the buffer for the next pixel currPix[0] += xCoeff * r; currPix[1] += xCoeff * g; currPix[2] += xCoeff * b; - // a pripravime i pixel z pristiho radku + // and accumulate the next row's pixel contributions nextR = xNewCoeff * r; nextG = xNewCoeff * g; nextB = xNewCoeff * b; - // a novej pravej koeficient + // and the new right coefficient xNewCoeff = yCoeff * *ptrXCoeff; xCoeff = yLastCoeff * *ptrXCoeff++; } - // pro posledni pixel musime vynechat vypocet leve casti - // dalsiho pixelu (zadnej neni) + // for the last pixel we must skip computing the left part + // of the next pixel (there isn't one) for (; x2 < xBndr; x2++) { - // vytahneme pixel + // fetch the pixel rgb = *inBuff++; r = GetRValue(rgb); g = GetGValue(rgb); b = GetBValue(rgb); - // pripocitame ho do bufferu + // accumulate it into the buffer currPix[0] += midCoeff * r; currPix[1] += midCoeff * g; currPix[2] += midCoeff * b; - // a pripravime i pixel z pristiho radku + // and accumulate the contributions for the next row's pixel nextR += midNewCoeff * r; nextG += midNewCoeff * g; nextB += midNewCoeff * b; } - // vytahneme nejpravejsi pixel + // fetch the rightmost pixel rgb = *inBuff++; r = GetRValue(rgb); g = GetGValue(rgb); b = GetBValue(rgb); - // napocitany pixel uz muzem poslat na vystup + // the computed pixel can now be written to the output *OutLine++ = RGB((currPix[0] + xCoeff * r) >> 24, (currPix[1] + xCoeff * g) >> 24, (currPix[2] + xCoeff * b) >> 24); - // pripravime pixel pro dalsi radek + // prepare the buffer for the next row currPix[0] = nextR + xNewCoeff * r; currPix[1] = nextG + xNewCoeff * g; currPix[2] = nextB + xNewCoeff * b; - // mame hotovej celej radek + // the entire row is finished - // pokud jedem odspodu, pokracujem o radek vys + // if we process from the bottom, move one row up if (!ProcessTopDown) OutLine -= NewWidth * 2; } else { - // pravej koeficient + // right coefficient xCoeff *= NormCoeffY; - // jsme-li na stredovych pixelech, pocitame normalne + // for rows in the middle of a section, compute normally for (x1 = 0; x1 + 1 < NewWidth; x1++) { - // projedem stredni cast + // process the middle portion for (; x2 < xBndr; x2++) { - // vytahneme pixel + // fetch the pixel rgb = *inBuff++; r = GetRValue(rgb); g = GetGValue(rgb); b = GetBValue(rgb); - // pripocitame ho do bufferu + // accumulate it into the buffer currPix[0] += NormCoeff * r; currPix[1] += NormCoeff * g; currPix[2] += NormCoeff * b; } - // vytahneme nejpravejsi pixel + // fetch the rightmost pixel rgb = *inBuff++; r = GetRValue(rgb); g = GetGValue(rgb); b = GetBValue(rgb); - // a taky ho pripocitame do bufferu + // also accumulate it into the buffer currPix[0] += xCoeff * r; currPix[1] += xCoeff * g; currPix[2] += xCoeff * b; - // zvetsime souradnici + // advance the coordinate x2++; - // soupnem se ve vystupu na dalsi pixel + // move to the next output pixel currPix += 3; - // nova maximalni x-ova souradnice + // fetch the next X boundary xBndr = *ptrXCoeff++; - // novej levej koeficient + // new left coefficient xCoeff = NormCoeffY * *ptrXCoeff++; - // a taky ho pripocitame do bufferu pro dalsi pixel + // accumulate it into the buffer for the next pixel currPix[0] += xCoeff * r; currPix[1] += xCoeff * g; currPix[2] += xCoeff * b; - // a novej pravej koeficient + // and the new right coefficient xCoeff = NormCoeffY * *ptrXCoeff++; } - // pro posledni pixel musime vynechat vypocet leve casti + // for the last pixel we must skip computing the left-side contribution for (; x2 < xBndr; x2++) { - // vytahneme pixel + // fetch the pixel rgb = *inBuff++; r = GetRValue(rgb); g = GetGValue(rgb); b = GetBValue(rgb); - // pripocitame ho do bufferu + // accumulate it into the buffer currPix[0] += NormCoeff * r; currPix[1] += NormCoeff * g; currPix[2] += NormCoeff * b; } - // vytahneme nejpravejsi pixel + // fetch the rightmost pixel rgb = *inBuff++; r = GetRValue(rgb); g = GetGValue(rgb); b = GetBValue(rgb); - // a taky ho pripocitame do bufferu + // also accumulate it into the buffer currPix[0] += xCoeff * r; currPix[1] += xCoeff * g; currPix[2] += xCoeff * b; - // mame hotovej celej radek + // the entire row is finished } } Y += rowCount; @@ -367,7 +368,7 @@ CSalamanderThumbnailMaker::CSalamanderThumbnailMaker(CFilesWindow* window) ThumbnailBuffer = NULL; AuxTransformBuffer = NULL; - ThumbnailMaxWidth = 0; // musime inicializovat, Clear() volame s -1 + ThumbnailMaxWidth = 0; // must initialize, Clear() is called with -1 ThumbnailMaxHeight = 0; Clear(-1); @@ -383,8 +384,8 @@ CSalamanderThumbnailMaker::~CSalamanderThumbnailMaker() free(AuxTransformBuffer); } -// vycisteni objektu - vola se pred zpracovanim dalsiho thumbnailu nebo kdyz uz -// neni potreba thumbnail (at uz hotovy nebo ne) z tohoto objektu +// Object cleanup—called before processing another thumbnail or when +// this object no longer needs a thumbnail (finished or not) void CSalamanderThumbnailMaker::Clear(int thumbnailMaxSize) { Error = FALSE; @@ -402,8 +403,8 @@ void CSalamanderThumbnailMaker::Clear(int thumbnailMaxSize) { if (thumbnailMaxSize != ThumbnailMaxWidth || thumbnailMaxSize != ThumbnailMaxHeight) { - // pokud uzivatel zmenil velikost thumbnailu (v konfiguraci), musime nechat znovu - // naalokovat ThumbnailBuffer a AuxTransformBuffer + // if the user changed the thumbnail size in configuration, we must + // allocate ThumbnailBuffer and AuxTransformBuffer again if (ThumbnailBuffer != NULL) { free(ThumbnailBuffer); @@ -423,8 +424,8 @@ void CSalamanderThumbnailMaker::Clear(int thumbnailMaxSize) Shrinker.Destroy(); } -// vraci TRUE pokud je v tomto objektu pripraveny cely thumbnail (povedlo se -// jeho ziskani od pluginu) +// returns TRUE when the entire thumbnail is ready in this object (obtained +// successfully from the plugin) BOOL CSalamanderThumbnailMaker::ThumbnailReady() { return OriginalHeight != 0 && NextLine >= OriginalHeight && !Error; @@ -432,12 +433,12 @@ BOOL CSalamanderThumbnailMaker::ThumbnailReady() void CSalamanderThumbnailMaker::TransformThumbnail() { - // SSTHUMB_MIRROR_VERT uz je hotova, zbyva provest SSTHUMB_MIRROR_HOR a SSTHUMB_ROTATE_90CW + // SSTHUMB_MIRROR_VERT is already done; we still need to perform SSTHUMB_MIRROR_HOR and SSTHUMB_ROTATE_90CW int transformation = (PictureFlags & (SSTHUMB_MIRROR_HOR | SSTHUMB_ROTATE_90CW)); switch (transformation) { case 0: - break; // neni to delat + break; // nothing to do case SSTHUMB_MIRROR_HOR: { @@ -518,16 +519,16 @@ void CSalamanderThumbnailMaker::TransformThumbnail() } } -// nama drzeny thumbnail prevedeme na DDB a jeji data ulozime do CThumbnailData +// convert the thumbnail we hold into a DDB and store its data into CThumbnailData BOOL CSalamanderThumbnailMaker::RenderToThumbnailData(CThumbnailData* data) { - // vytvorime DDB a nechame ji inicializovat RGB datama thumbnailu + // create a DDB and let it initialize with the thumbnail's RGB data HDC hDC = HANDLES(GetDC(NULL)); BITMAPINFO srcBI; memset(&srcBI, 0, sizeof(BITMAPINFO)); srcBI.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); srcBI.bmiHeader.biWidth = ThumbnailRealWidth; - srcBI.bmiHeader.biHeight = -ThumbnailRealHeight; // mam top-down reprezentaci + srcBI.bmiHeader.biHeight = -ThumbnailRealHeight; // we have a top-down representation srcBI.bmiHeader.biPlanes = 1; srcBI.bmiHeader.biBitCount = 32; srcBI.bmiHeader.biCompression = BI_RGB; @@ -541,7 +542,7 @@ BOOL CSalamanderThumbnailMaker::RenderToThumbnailData(CThumbnailData* data) return FALSE; } - // ziskame "geometrii" prave vytvorene bitmapy + // obtain the "geometry" of the newly created bitmap BITMAP bitmap; if (GetObject(hBmp, sizeof(BITMAP), &bitmap) == NULL) { @@ -550,9 +551,9 @@ BOOL CSalamanderThumbnailMaker::RenderToThumbnailData(CThumbnailData* data) return FALSE; } - // alokujeme buffer pro raw data bitmpay - // destrukce probehne v CIconCache::Destroy() nebo o par radku niz - // v pripade refreshe + // allocate a buffer for the raw bitmap data + // destruction happens in CIconCache::Destroy() or a few lines below + // in case of a refresh DWORD rawSize = bitmap.bmWidthBytes * bitmap.bmPlanes * bitmap.bmHeight; @@ -564,7 +565,7 @@ BOOL CSalamanderThumbnailMaker::RenderToThumbnailData(CThumbnailData* data) return FALSE; } - // vytahneme raw data do alokovaneho pole + // pull the raw data into the allocated array if (GetBitmapBits(hBmp, rawSize, bits) == NULL) { TRACE_E("GetBitmapBits failed!"); @@ -573,14 +574,14 @@ BOOL CSalamanderThumbnailMaker::RenderToThumbnailData(CThumbnailData* data) return FALSE; } - // zahodime bitmapu + // discard the bitmap HANDLES(DeleteObject(hBmp)); - // pokud uz nejaka data drzime, musime je uvolnit pro nova + // if we already hold some data, free it before storing the new data if (data->Bits != NULL) free(data->Bits); - // ulozime vysledek + // store the result data->Width = (WORD)bitmap.bmWidth; data->Height = (WORD)bitmap.bmHeight; data->Planes = bitmap.bmPlanes; @@ -615,7 +616,7 @@ void CSalamanderThumbnailMaker::HandleIncompleteImages() } // ********************************************************************************* -// metody rozhrani CSalamanderThumbnailMakerAbstract +// methods of the CSalamanderThumbnailMakerAbstract interface // ********************************************************************************* BOOL CSalamanderThumbnailMaker::SetParameters(int picWidth, int picHeight, DWORD flags) @@ -636,7 +637,7 @@ BOOL CSalamanderThumbnailMaker::SetParameters(int picWidth, int picHeight, DWORD PictureFlags = flags; ProcessTopDown = (flags & SSTHUMB_MIRROR_VERT) == 0; - int maxWidth = ThumbnailMaxWidth; // maximalni velikost thumbnailu + int maxWidth = ThumbnailMaxWidth; // maximum thumbnail size int maxHeight = ThumbnailMaxHeight; if (maxWidth < 1 || maxHeight < 1) @@ -648,14 +649,14 @@ BOOL CSalamanderThumbnailMaker::SetParameters(int picWidth, int picHeight, DWORD if (OriginalWidth <= maxWidth && OriginalHeight <= maxHeight) { - // okopirujeme data + // copy the data ThumbnailRealWidth = OriginalWidth; ThumbnailRealHeight = OriginalHeight; ShrinkImage = FALSE; } else { - // zachovame pomer stran + // keep the aspect ratio if ((double)maxWidth / (double)maxHeight < (double)OriginalWidth / (double)OriginalHeight) { ThumbnailRealWidth = maxWidth; @@ -666,7 +667,7 @@ BOOL CSalamanderThumbnailMaker::SetParameters(int picWidth, int picHeight, DWORD ThumbnailRealHeight = maxHeight; ThumbnailRealWidth = (int)((double)maxHeight / ((double)OriginalHeight / (double)OriginalWidth)); } - // do algoritmu nesmi vstoupit zadny z rozmeru nulovy; radeji porusime proporce + // no dimension entering the algorithm may be zero; better to break proportions if (ThumbnailRealWidth < 1) ThumbnailRealWidth = 1; if (ThumbnailRealHeight < 1) @@ -721,7 +722,7 @@ BOOL CSalamanderThumbnailMaker::ProcessBuffer(void* buffer, int rowsCount) { if (!Window->ICStopWork) TRACE_E("CSalamanderThumbnailMaker::ProcessBuffer failed. Error=" << Error << " NextLine=" << NextLine << " OriginalHeight=" << OriginalHeight); - return FALSE; // budeme koncit (chyba, presah nebo sleep-icon-cache) + return FALSE; // we are going to stop (error, overflow, or sleep-icon-cache) } if (NextLine == -1) { @@ -753,12 +754,12 @@ BOOL CSalamanderThumbnailMaker::ProcessBuffer(void* buffer, int rowsCount) { if (ShrinkImage) { - // zmensime na thumbnail + // shrink to the thumbnail size Shrinker.ProcessRows((DWORD*)buffer, rowsCount); } else { - // preneseme 1:1 + // copy 1:1 if (ProcessTopDown) { memcpy(ThumbnailBuffer + NextLine * ThumbnailRealWidth, buffer, rowsCount * ThumbnailRealWidth * sizeof(DWORD)); From e99aa752735f144e2912590d73984c05139c617c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 09:48:57 +0200 Subject: [PATCH 588/710] [translation] Initial src/thumbnl.h comments translation (#964) --- src/thumbnl.h | 70 ++++++++++++++++++++++++++------------------------- 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/src/thumbnl.h b/src/thumbnl.h index 68c21c731..382e96fbc 100644 --- a/src/thumbnl.h +++ b/src/thumbnl.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once @@ -27,13 +28,13 @@ class CShrinkImage CShrinkImage(); ~CShrinkImage(); - // alokuje interni data pro zmensovani a vraci TRUE v pripade upsechu - // pokud se alokace nepovedou, vrati FALSE + // Allocates internal data for shrinking and returns TRUE on success. + // Returns FALSE if the allocation fails. BOOL Alloc(DWORD origWidth, DWORD origHeight, WORD newWidth, WORD newHeight, DWORD* outBuff, BOOL processTopDown); - // destukce alokovanych bufferu a inicializace promennych + // Destroys allocated buffers and reinitializes member variables. void Destroy(); void ProcessRows(DWORD* inBuff, DWORD rowCount); @@ -47,66 +48,67 @@ class CShrinkImage // // CSalamanderThumbnailMaker // -// Slouzi pro zmensovani puvodniho obrazku do thumbnailu. +// Used to shrink the original image into a thumbnail. // class CSalamanderThumbnailMaker : public CSalamanderThumbnailMakerAbstract { protected: - CFilesWindow* Window; // okno panelu, v jehoz icon-readeru fungujeme - - DWORD* Buffer; // vlastni buffer pro data radek od pluginu - int BufferSize; // velikost bufferu 'Buffer' - BOOL Error; // je-li TRUE, nastala pri zpracovani thumbnailu chyba (vysledek neni pouzitelny) - int NextLine; // cislo pristi zpracovavane radky - - DWORD* ThumbnailBuffer; // zmenseny obrazek - DWORD* AuxTransformBuffer; // pomocny buffer o stejne velikosti jako ThumbnailBuffer (slouzi pro prenos dat pri transformaci + po transformaci se buffery prohodi) - int ThumbnailMaxWidth; // maximalni teoreticke rozmery thumbnailu (v bodech) - int ThumbnailMaxHeight; - int ThumbnailRealWidth; // realne rozmery zmenseneho obrazku (v bodech) - int ThumbnailRealHeight; // - - // parametry zpracovavaneho obrazku + CFilesWindow* Window; // Panel window whose icon reader we operate within. + + DWORD* Buffer; // Dedicated buffer for image rows supplied by the plugin. + int BufferSize; // Size of the 'Buffer' buffer. + BOOL Error; // If TRUE, an error occurred while processing the thumbnail, so the result is unusable. + int NextLine; // Index of the next row to process. + + DWORD* ThumbnailBuffer; // Buffer that holds the reduced image. + DWORD* AuxTransformBuffer; // Auxiliary buffer of the same size as ThumbnailBuffer. + // Used to hand off data during transformations; afterwards the buffers swap roles. + int ThumbnailMaxWidth; // Maximum theoretical thumbnail width (in points). + int ThumbnailMaxHeight; // Maximum theoretical thumbnail height (in points). + int ThumbnailRealWidth; // Actual width of the reduced image (in points). + int ThumbnailRealHeight; // Actual height of the reduced image (in points). + + // Parameters of the image being processed. int OriginalWidth; int OriginalHeight; DWORD PictureFlags; BOOL ProcessTopDown; - CShrinkImage Shrinker; // zajistuje zmensovani obrazku + CShrinkImage Shrinker; // Handles the actual image shrinking. BOOL ShrinkImage; public: CSalamanderThumbnailMaker(CFilesWindow* window); ~CSalamanderThumbnailMaker(); - // vycisteni objektu - vola se pred zpracovanim dalsiho thumbnailu nebo kdyz uz - // neni potreba thumbnail (at uz hotovy nebo ne) z tohoto objektu - // parametr 'thumbnailMaxSize' udava maximalni moznou sirku a vysku - // thumbnailu v bodech; pokud je roven -1, ignoruje se + // Cleans up the object—call before processing another thumbnail or + // whenever the object no longer needs one (finished or not). + // The 'thumbnailMaxSize' parameter specifies the maximum thumbnail width + // and height in points; if it equals -1, the limit is ignored. void Clear(int thumbnailMaxSize = -1); - // vraci TRUE pokud je v tomto objektu pripraveny cely thumbnail (povedlo se - // jeho ziskani od pluginu) + // Returns TRUE if the complete thumbnail is already available in this object + // (successfully obtained from the plugin). BOOL ThumbnailReady(); - // provede transformaci thumbnailu podle PictureFlags (SSTHUMB_MIRROR_VERT uz je hotova, - // zbyva provest SSTHUMB_MIRROR_HOR a SSTHUMB_ROTATE_90CW) + // Performs thumbnail transformations according to PictureFlags. + // SSTHUMB_MIRROR_VERT is already handled; SSTHUMB_MIRROR_HOR and SSTHUMB_ROTATE_90CW remain. void TransformThumbnail(); - // konvertuje hotovy thumbnail na DDB a jeji rozmery a raw data ulozi do 'data' + // Converts the finished thumbnail to a DDB and stores its dimensions and raw data in 'data'. BOOL RenderToThumbnailData(CThumbnailData* data); - // pokud se nevytvoril cely thumbnail a nenastala chyba (viz 'Error'), doplni - // zbytek thumbnailu bilou barvou (aby se v nedefinovane casti thumbnailu - // nezobrazovaly zbytky predchoziho thumbnailu); pokud se nevytvorily ani - // tri radky thumbnailu, nic se nedoplnuje (thumbnail by byl stejne k nicemu) + // If the full thumbnail was not created and no error occurred (see 'Error'), + // fill the remainder of the thumbnail with white so undefined parts do not + // show leftovers from the previous thumbnail. If fewer than three rows + // were produced, leave it empty (the thumbnail would be useless anyway). void HandleIncompleteImages(); BOOL IsOnlyPreview() { return (PictureFlags & SSTHUMB_ONLY_PREVIEW) != 0; } // ********************************************************************************* - // metody rozhrani CSalamanderThumbnailMakerAbstract + // Methods of the CSalamanderThumbnailMakerAbstract interface. // ********************************************************************************* virtual BOOL WINAPI SetParameters(int picWidth, int picHeight, DWORD flags); From 097c2f8aaacd3623964df5ccab7835d37196715c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 09:49:00 +0200 Subject: [PATCH 589/710] [translation] Initial src/toolbar.h comments translation (#965) --- src/toolbar.h | 193 +++++++++++++++++++++++++------------------------- 1 file changed, 96 insertions(+), 97 deletions(-) diff --git a/src/toolbar.h b/src/toolbar.h index ff1e9cf55..52e02e502 100644 --- a/src/toolbar.h +++ b/src/toolbar.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once @@ -25,21 +26,21 @@ class CToolBarItem // a bitmap, only text. HICON HIcon; HICON HOverlay; - DWORD CustomData; // FIXME_X64 - male pro ukazatel, neni nekdy potreba? - int Width; // width of item (computed if TLBI_STYLE_AUTOSIZE is set) + DWORD CustomData; // FIXME_X64 - too small for a pointer; do we ever need it? + int Width; // Width of the item (computed if TLBI_STYLE_AUTOSIZE is set) - char* Name; // name in customize dialog (valid during custimize session) + char* Name; // Name shown in the Customize dialog (valid only during the customization session). - // tyto hodnoty se pouzivaji pro optimalizovany pristup ke stavum polozek - DWORD* Enabler; // Ukazuje na promennou, ktera ridi stav polozky. - // Hodnote ruzne od nuly odpovida nulovany bit TLBI_STATE_GRAYED. - // Nule odpovida nastaveny bit TLBI_STATE_GRAYED. + // These values are used for optimized access to item states. + DWORD* Enabler; // Points to the variable that controls the item state. + // A non-zero value keeps TLBI_STATE_GRAYED cleared. + // Zero means TLBI_STATE_GRAYED is set. // internal data - int Height; // height of item - int Offset; // position of item in whole toolbar + int Height; // Item height. + int Offset; // Item offset within the entire toolbar. - WORD IconX; // umisteni jednotlivych prvku + WORD IconX; // Horizontal offsets for the individual elements. WORD TextX; WORD InnerX; WORD OutterX; @@ -66,62 +67,61 @@ class CToolBar : public CWindow, public CGUIToolBarAbstract protected: TIndirectArray Items; - int Width; // rozmery celeho okna + int Width; // Width of the entire window. int Height; HFONT HFont; int FontHeight; - HWND HNotifyWindow; // kam budeme dorucovat notifikace + HWND HNotifyWindow; // Target window for notifications. HIMAGELIST HImageList; HIMAGELIST HHotImageList; - int ImageWidth; // rozmery jednoho obrazku z imagelistu + int ImageWidth; // Dimensions of a single image from the image list. int ImageHeight; DWORD Style; // TLB_STYLE_xxx - BOOL DirtyItems; // nastala operace, ktera ovlivnuje rozlozeni polozek - // a je treba provest prepocet - CBitmap* CacheBitmap; // pres tuto bitmapu kreslime ven - CBitmap* MonoBitmap; // pro grayed ikonky - int CacheWidth; // rozmery bitmapy - int CacheHeight; - int HotIndex; // -1 = zadny + BOOL DirtyItems; // TRUE when an operation affects item layout and a recalculation is required. + CBitmap* CacheBitmap; // Off-screen bitmap we render into. + CBitmap* MonoBitmap; // Used to render grayed icons. + int CacheWidth; // Width of the cache bitmap. + int CacheHeight; // Height of the cache bitmap. + int HotIndex; // -1 = none. int DownIndex; BOOL DropPressed; BOOL MonitorCapture; BOOL RelayToolTip; TOOLBAR_PADDING Padding; - BOOL HasIcon; // pokud drzi nejakou ikonu, bude funkce GetNeededSpace() pocitat s jeji vyskou - BOOL HasIconDirty; // je potreba detekovat pritomnost ikony pro GetNeededSpace()? - BOOL Customizing; // je prave toolbara konfigurovana - int InserMarkIndex; // -1 = zadny + BOOL HasIcon; // TRUE when an icon is stored, so GetNeededSpace() must account for its height. + BOOL HasIconDirty; // TRUE when icon presence must be re-detected for GetNeededSpace(). + BOOL Customizing; // Is the toolbar currently being customized? + int InserMarkIndex; // -1 = none. BOOL InserMarkAfter; - BOOL MouseIsTracked; // je mys sledovana pomoci TrackMouseEvent? - DWORD DropDownUpTime; // cas v [ms], kdy byl odmackunt drop down, pro ochranu pred novym zamacknutim - BOOL HelpMode; // Salamander je Shift+F1 (ctx help) rezimu a toolbar by mel vysvitit i disabled polozky pod kurzorem + BOOL MouseIsTracked; // Is the mouse being tracked via TrackMouseEvent? + DWORD DropDownUpTime; // Timestamp in milliseconds when the drop-down was released to avoid immediate re-pressing. + BOOL HelpMode; // Salamander is in Shift+F1 (context help) mode; highlight disabled items under the cursor. public: // - // Vlastni metody + // Custom methods // CToolBar(HWND hNotifyWindow, CObjectOrigin origin = ooAllocated); ~CToolBar(); // - // Implementace metod CGUIToolBarAbstract + // Implementation of CGUIToolBarAbstract methods // virtual BOOL WINAPI CreateWnd(HWND hParent); virtual HWND WINAPI GetHWND() { return HWindow; } - virtual int WINAPI GetNeededWidth(); // vrati rozmery, ktere budou pro okno potreba + virtual int WINAPI GetNeededWidth(); // Returns the width the window requires. virtual int WINAPI GetNeededHeight(); virtual void WINAPI SetFont(); - virtual BOOL WINAPI GetItemRect(int index, RECT& r); // vrati umisteni polozky ve screen souradnicich + virtual BOOL WINAPI GetItemRect(int index, RECT& r); // Returns the item's rectangle in screen coordinates. virtual BOOL WINAPI CheckItem(DWORD position, BOOL byPosition, BOOL checked); virtual BOOL WINAPI EnableItem(DWORD position, BOOL byPosition, BOOL enabled); - // pokud je prirazen image list, vlozi do nej na odpovidajici misto ikonu - // promenne normal a hot urcuji, ktere imagelisty budou ovlivneny + // If an image list is assigned, inserts the icon at the corresponding position. + // The 'normal' and 'hot' flags determine which image lists are affected. virtual BOOL WINAPI ReplaceImage(DWORD position, BOOL byPosition, HICON hIcon, BOOL normal = TRUE, BOOL hot = FALSE); virtual int WINAPI FindItemPosition(DWORD id); @@ -132,7 +132,7 @@ class CToolBar : public CWindow, public CGUIToolBarAbstract virtual void WINAPI SetHotImageList(HIMAGELIST hImageList); virtual HIMAGELIST WINAPI GetHotImageList(); - // styl toolbary + // Toolbar style accessors. virtual void WINAPI SetStyle(DWORD style); virtual DWORD WINAPI GetStyle(); @@ -141,35 +141,34 @@ class CToolBar : public CWindow, public CGUIToolBarAbstract virtual int WINAPI GetItemCount() { return Items.Count; } - // vyvola konfiguracni dialog + // Opens the configuration dialog. virtual void WINAPI Customize(); virtual void WINAPI SetPadding(const TOOLBAR_PADDING* padding); virtual void WINAPI GetPadding(TOOLBAR_PADDING* padding); - // obehne vsechny polozky a pokud maji nastaveny ukazatel 'EnablerData' - // porovna hodnoty (na kterou ukazuje) se skutecnym stavem polozky. - // Pokud se stav lisi, zmeni ho. + // Walks all items and, when 'EnablerData' is set, compares the referenced value + // with the actual item state; updates the state when they differ. virtual void WINAPI UpdateItemsState(); - // pokud je bod nad nekterou z polozek (ne nad separatororem), vrati jeji index. - // jinak vrati zaporne cislo + // If the point is above an item (not a separator), returns its index; + // otherwise returns a negative value. virtual int WINAPI HitTest(int xPos, int yPos); - // vraci TRUE, pokud je na pozice na rozhrani polozky; pak take nastavi 'index' - // na tuto polozku a promennout 'after', ktera udava, jestli jde o levou nebo - // pravou stranu polozky. Pokud je pod nad nejakou polozkou, vrati FALSE. - // Pokud bod nelezi nad zadnou plozkou, vrati TRUE a 'index' nastavi na -1. + // Returns TRUE if the point lies on an item boundary; in that case it sets 'index' + // to that item and the 'after' flag to indicate whether it is the left or right side. + // Returns FALSE if the point lies over an item. If the point does not lie over any item, + // it returns TRUE and sets 'index' to -1. virtual BOOL WINAPI InsertMarkHitTest(int xPos, int yPos, int& index, BOOL& after); - // nastavi InsertMark na pozici index (pred nebo za) - // pokud je index == -1, odstrani InsertMark + // Sets the insert mark to the given index (before or after). + // If index == -1, removes the insert mark. virtual void WINAPI SetInsertMark(int index, BOOL after); // Sets the hot item in a toolbar. Returns the index of the previous hot item, or -1 if there was no hot item. virtual int WINAPI SetHotItem(int index); - // mohlo dojit ke zmene barevne hloubky obrazovky; je treba prebuildit CacheBitmap + // Rebuild CacheBitmap when the display color depth changes. virtual void WINAPI OnColorsChanged(); virtual BOOL WINAPI InsertItem2(DWORD position, BOOL byPosition, const TLBI_ITEM_INFO2* tii); @@ -186,14 +185,14 @@ class CToolBar : public CWindow, public CGUIToolBarAbstract void DrawInsertMark(HDC hDC); - // vraci TRUE, pokud je na pozici polozka; pak take nastavi 'index' - // jinak vraci FALSE - // pokud uzivatel kliknul na drop down, nastavi 'dropDown' na TRUE + // Returns TRUE if an item is at the position; in that case it also sets 'index'. + // Otherwise it returns FALSE. + // If the user clicked the drop-down, it sets 'dropDown' to TRUE. BOOL HitTest(int xPos, int yPos, int& index, BOOL& dropDown); - // obehne vsechny polozky a napocit si k nim 'MinWidth' a 'XOffset' - // ridi se (a nastavuje) DirtyItems - // vrati TRUE, pokud doslo k prekresleni vsech polozek + // Iterates through every item and calculates 'MinWidth' and 'XOffset'. + // Controlled by (and updates) DirtyItems. + // Returns TRUE if all items were redrawn. BOOL Refresh(); friend class CTBCustomizeDialog; @@ -214,7 +213,7 @@ class CTBCustomizeDialog : public CCommonDialog }; protected: - TDirectArray AllItems; // vsechny dostupne polozky + TDirectArray AllItems; // All available items. CToolBar* ToolBar; HWND HAvailableLB; HWND HCurrentLB; @@ -231,11 +230,11 @@ class CTBCustomizeDialog : public CCommonDialog virtual INT_PTR DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam); void DestroyItems(); - BOOL EnumButtons(); // pomoci notifikace WM_USER_TBENUMBUTTON2 naplni pole Items vsema tlacitkama, ktere muze toolbar drzet + BOOL EnumButtons(); // Uses the WM_USER_TBENUMBUTTON2 notification to list every button the toolbar can host. - BOOL PresentInToolBar(DWORD id); // je tento command v toolbare ? - BOOL FindIndex(DWORD id, int* index); // vyhleda command v AllItems - void FillLists(); // naplni oba listboxy + BOOL PresentInToolBar(DWORD id); // Is this command present in the toolbar? + BOOL FindIndex(DWORD id, int* index); // Finds the command in AllItems. + void FillLists(); // Populates both list boxes. void EnableControls(); void MoveItem(int srcIndex, int tgtIndex); @@ -250,8 +249,8 @@ class CTBCustomizeDialog : public CCommonDialog // // CMainToolBar // -// Toolbar, ktery jde konfigurovat, nese tlacitka s commandy. Lezi na vrsku -// Salama a nad kazdym panelem. +// Configurable toolbar that holds command buttons. It sits at the top of Salamander, +// above each panel. // enum CMainToolBarType @@ -273,27 +272,27 @@ class CMainToolBar : public CToolBar BOOL Load(const char* data); BOOL Save(char* data); - // je treba vratit tooltip + // Must return a tooltip. void OnGetToolTip(LPARAM lParam); - // pri konfiguraci plni konfiguracni dialog polozkama + // Supplies the customization dialog with items while customizing. BOOL OnEnumButton(LPARAM lParam); - // uzivatel stisknul reset v konfiguracnim dialogu - nalejeme default sestavu + // The user pressed Reset in the configuration dialog—load the default layout. void OnReset(); void SetType(CMainToolBarType type); protected: - // do 'tii' naplni data pro poozku 'tbbeIndex' a vrati TRUE - // pokud polozka neni uplna (zruseny prikaz), vrati FALSE - BOOL FillTII(int tbbeIndex, TLBI_ITEM_INFO2* tii, BOOL fillName); // 'buttonIndex' je z rodiny TBBE_xxxx; -1 = separator + // Fills 'tii' with data for the 'tbbeIndex' item and returns TRUE. + // Returns FALSE when the item is incomplete (command removed). + BOOL FillTII(int tbbeIndex, TLBI_ITEM_INFO2* tii, BOOL fillName); // 'buttonIndex' belongs to the TBBE_xxxx family; -1 = separator. }; //***************************************************************************** // // CBottomToolBar // -// toolbar ve spodni casti Salamandera - obsahuje napovedu pro F1-F12 v -// kombinaci s Ctrl, Alt a Shift +// Toolbar at the bottom of Salamander—shows help for F1-F12 in +// combination with Ctrl, Alt, and Shift. // enum CBottomTBStateEnum @@ -317,11 +316,11 @@ class CBottomToolBar : public CToolBar virtual BOOL WINAPI CreateWnd(HWND hParent); - // vola se pri kazde zmene modifikatoru (Ctrl,Alt,Shift) - obehne naplnenou - // toolbaru a nastavi ji texty a ID + // Called whenever modifier keys (Ctrl, Alt, Shift) change—iterates the populated + // toolbar and updates its texts and IDs. BOOL SetState(CBottomTBStateEnum state); - // inicializuje staticke pole, ze ktereho pak budeme toolbaru krmit + // Initializes the static array used to feed the toolbar. static BOOL InitDataFromResources(); void OnGetToolTip(LPARAM lParam); @@ -331,10 +330,10 @@ class CBottomToolBar : public CToolBar protected: CBottomTBStateEnum State; - // interni funkce volana z InitDataFromResources + // Internal helper called from InitDataFromResources. static BOOL InitDataResRow(CBottomTBStateEnum state, int textResID); - // pro kazde tlacitko najde nedelsi text a podle nej nastavi tlacitku sirku + // Finds the longest text for each button and sets the button width accordingly. BOOL SetMaxItemWidths(); }; @@ -348,7 +347,7 @@ class CUserMenuBar : public CToolBar public: CUserMenuBar(HWND hNotifyWindow, CObjectOrigin origin = ooStatic); - // vytahne z UserMenu polozky a naleje buttony do toolbary + // Retrieves items from the UserMenu and populates the toolbar with buttons. BOOL CreateButtons(); void ToggleLabels(); @@ -375,7 +374,7 @@ class CHotPathsBar : public CToolBar public: CHotPathsBar(HWND hNotifyWindow, CObjectOrigin origin = ooStatic); - // vytahne z HotPaths polozky a naleje buttony do toolbary + // Retrieves items from HotPaths and populates the toolbar with buttons. BOOL CreateButtons(); void ToggleLabels(); @@ -402,7 +401,7 @@ class CDrivesList; class CDriveBar : public CToolBar { protected: - // navratove hodnoty pro List + // Return values for List. DWORD DriveType; DWORD_PTR DriveTypeParam; int PostCmd; @@ -410,11 +409,11 @@ class CDriveBar : public CToolBar BOOL FromContextMenu; CDrivesList* List; - // cache: obsahuje ?: nebo \\ pro UNC nebo prazdny retezec + // Cache: stores ?:, \\ for UNC, or an empty string. char CheckedDrive[3]; public: - // ikony pluginu chceme zobrazovat cernobile, takze je musime drzet v image listech + // Plugin icons are kept in image lists so we can display them in grayscale. HIMAGELIST HDrivesIcons; HIMAGELIST HDrivesIconsGray; @@ -424,39 +423,39 @@ class CDriveBar : public CToolBar void DestroyImageLists(); - // vyhaze existujici a naleje nova tlacitka; - // neni-li 'copyDrivesListFrom' NULL, maji se data o discich kopirovat misto znovu ziskavat - // 'copyDrivesListFrom' muze odkazovat i na volany objekt + // Removes existing buttons and loads new ones. + // If 'copyDrivesListFrom' is not NULL, copy its drive data instead of querying again. + // 'copyDrivesListFrom' may even point to the called object itself. BOOL CreateDriveButtons(CDriveBar* copyDrivesListFrom); virtual int WINAPI GetNeededHeight(); void OnGetToolTip(LPARAM lParam); - // user clicknul na tlacitku s commandem id + // The user clicked the button with the given command id. void Execute(DWORD id); - // zamackne ikonku odpovidajici ceste; pokud takovou nenalezne, nebude - // zamackla zadna; promenna force vyradi cache + // Depresses the icon that corresponds to the path; if none matches, all buttons are released. + // The 'force' argument invalidates the cache. void SetCheckedDrive(CFilesWindow* panel, BOOL force = FALSE); - // pokud prijde notifikace o pridani/odstraneni disku, je treba znovu naplnit seznam; - // neni-li 'copyDrivesListFrom' NULL, maji se data o discich kopirovat misto znovu ziskavat - // 'copyDrivesListFrom' muze odkazovat i na volany objekt + // Rebuilds the list after a drive-add or drive-remove notification. + // If 'copyDrivesListFrom' is not NULL, copy its drive data instead of querying again. + // 'copyDrivesListFrom' may even point to the called object itself. void RebuildDrives(CDriveBar* copyDrivesListFrom = NULL); - // je treba vybalit context menu; poozka se urci z GetMessagePos; vrati TRUE, - // pokud bylo trefeno tlacitko a vybalilo se menu; jinak vrati FALSE + // Displays the context menu; the item is determined by GetMessagePos. + // Returns TRUE if a button was hit and the menu was shown; otherwise returns FALSE. BOOL OnContextMenu(); - // vraci bitove pole disku, jak bylo ziskano pri poslednim List->BuildData() - // pokud BuildData() jeste neprobehlo, vraci 0 - // lze pouzit pro rychlou detekci, zda nedoslo k nejake zmene disku + // Returns the bit mask of drives obtained by the last List->BuildData(). + // Returns 0 if BuildData() has not run yet. + // Can be used to quickly detect whether any drive changed. DWORD GetCachedDrivesMask(); - // vraci bitove pole dostupnych cloud storages, jak bylo ziskano pri poslednim List->BuildData() - // pokud BuildData() jeste neprobehlo, vraci 0 - // lze pouzit pro rychlou detekci, zda nedoslo k nejake zmene dostupnosti cloud storages + // Returns the bit mask of available cloud storages obtained by the last List->BuildData(). + // Returns 0 if BuildData() has not run yet. + // Can be used to quickly detect whether cloud storage availability changed. DWORD GetCachedCloudStoragesMask(); protected: @@ -471,7 +470,7 @@ class CDriveBar : public CToolBar class CPluginsBar : public CToolBar { protected: - // ikonky reprezentujici pluginy, vyvorene pomoci CPlugins::CreateIconsList + // Icons representing plugins, created by CPlugins::CreateIconsList. HIMAGELIST HPluginsIcons; HIMAGELIST HPluginsIconsGray; @@ -481,7 +480,7 @@ class CPluginsBar : public CToolBar void DestroyImageLists(); - // vyhaze existujici a naleje nova tlacitka + // Removes existing buttons and loads new ones. BOOL CreatePluginButtons(); virtual int WINAPI GetNeededHeight(); From e46a9a5ac96a32d3e829c4d928cdc0e1c81cd0e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 09:49:04 +0200 Subject: [PATCH 590/710] [translation] Initial src/toolbar1.cpp comments translation (#966) --- src/toolbar1.cpp | 57 ++++++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/src/toolbar1.cpp b/src/toolbar1.cpp index d6bba2edd..605f18f01 100644 --- a/src/toolbar1.cpp +++ b/src/toolbar1.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -115,7 +116,7 @@ CToolBar::CToolBar(HWND hNotifyWindow, CObjectOrigin origin) CToolBar::~CToolBar() { CALL_STACK_MESSAGE1("CToolBar::~CToolBar()"); - // destrukce je jeste v WM_DESTROY + // Destruction also runs in WM_DESTROY. if (CacheBitmap != NULL) { delete CacheBitmap; @@ -229,7 +230,7 @@ int CToolBar::GetNeededHeight() { if (HasIconDirty) { - // koukneme, jestli drzime nejakou ikonu + // Check whether we still hold any icon. HasIcon = FALSE; HasIconDirty = FALSE; int i; @@ -361,7 +362,7 @@ BOOL CToolBar::InsertItem2(DWORD position, BOOL byPosition, const TLBI_ITEM_INFO { CALL_STACK_MESSAGE3("CToolBar::InsertItem2(0x%X, %d, )", position, byPosition); int newPos; - // vyhledame pozici, kam prijde nova polozka + // Find the position where the new item will go. if (byPosition) { if (position == -1 || position > (DWORD)Items.Count) @@ -379,7 +380,7 @@ BOOL CToolBar::InsertItem2(DWORD position, BOOL byPosition, const TLBI_ITEM_INFO } } - // naalokujeme polozku + // Allocate the item. CToolBarItem* item = new CToolBarItem(); if (item == NULL) { @@ -387,7 +388,7 @@ BOOL CToolBar::InsertItem2(DWORD position, BOOL byPosition, const TLBI_ITEM_INFO return FALSE; } - // vlozime polozku do pole + // Insert the item into the array. Items.Insert(newPos, item); if (!Items.IsGood()) { @@ -396,7 +397,7 @@ BOOL CToolBar::InsertItem2(DWORD position, BOOL byPosition, const TLBI_ITEM_INFO return FALSE; } - // nastavime data + // Set the data. if (!SetItemInfo2(newPos, TRUE, tii)) { Items.Delete(newPos); @@ -459,7 +460,7 @@ BOOL CToolBar::SetItemInfo2(DWORD position, BOOL byPosition, const TLBI_ITEM_INF } else if (hadIcon) { - HasIconDirty = TRUE; // nevime, jestli jeste nejaka ikona zbyla - bude treba to zjistit + HasIconDirty = TRUE; // We do not know whether any icon remains; it must be checked. } } @@ -487,14 +488,14 @@ BOOL CToolBar::SetItemInfo2(DWORD position, BOOL byPosition, const TLBI_ITEM_INF tii->Mask & TLBI_MASK_IMAGEINDEX || tii->Mask & TLBI_MASK_ICON || (tii->Mask & TLBI_MASK_WIDTH && item->Style & TLBI_STYLE_FIXEDWIDTH)) { - // tato zmena muze mit dopad na celou toolbaru + // This change can affect the entire toolbar. DirtyItems = TRUE; if (HWindow != NULL) InvalidateRect(HWindow, NULL, FALSE); } else { - // nechame prekreslit pouze jedno tlacitko, ktere se menilo + // Redraw only the button that changed. if ((tii->Mask & TLBI_MASK_STATE) && HWindow != NULL) { RECT r; @@ -752,7 +753,7 @@ void CToolBar::SetStyle(DWORD style) } DWORD oldStyle = Style; Style = style; - // pokud se zmenilo zobrazovani textu, prealokuju si + // If text display changed, update the font settings. if ((oldStyle & TLB_STYLE_TEXT) != (Style & TLB_STYLE_TEXT)) SetFont(); DirtyItems = TRUE; @@ -800,7 +801,7 @@ void CToolBar::UpdateItemsState() if (item->Enabler != NULL) { - // bit TLBI_STATE_GRAYED je rizen + // TLBI_STATE_GRAYED is controlled externally. BOOL enabled = (item->State & TLBI_STATE_GRAYED) == 0; BOOL enabledSrc = *item->Enabler != 0; if (enabled != enabledSrc) @@ -822,7 +823,7 @@ void CToolBar::UpdateItemsState() void CToolBar::OnColorsChanged() { - // pokud existuje barevna bitmapa, nechame ji prebuildit pro aktualni barevnou hloubku + // If a color bitmap exists, rebuild it for the current color depth. if (CacheBitmap != NULL) CacheBitmap->ReCreateForScreenDC(); } @@ -835,7 +836,7 @@ CToolBar::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) { case WM_DESTROY: { - // destrukce je jeste v destruktoru + // Destruction is also handled in the destructor. if (CacheBitmap != NULL) { delete CacheBitmap; @@ -870,7 +871,7 @@ CToolBar::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_ERASEBKGND: { - if (WindowsVistaAndLater) // pod vistou blika rebar + if (WindowsVistaAndLater) // Rebar flickers under Vista. return TRUE; RECT r; GetClientRect(HWindow, &r); @@ -896,7 +897,7 @@ CToolBar::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_CANCELMODE: { MouseIsTracked = FALSE; - SetCurrentToolTip(NULL, 0); // vykopneme tooltip + SetCurrentToolTip(NULL, 0); // Dismiss the tooltip. if (!MonitorCapture) break; if (HotIndex != -1) @@ -969,7 +970,7 @@ CToolBar::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (newHotIndex != HotIndex) { - // vykreslime zmeny + // Draw the changes. int oldHotIndex = HotIndex; HotIndex = newHotIndex; if (oldHotIndex != -1) @@ -989,19 +990,19 @@ CToolBar::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_LBUTTONDOWN: case WM_LBUTTONDBLCLK: { - // pokud kliknuti prislo do 25ms po odmacknuti drop downu, zahodime ho, aby nedoslo - // ke zbytecnemu novemu zamacknuti + // If the click arrives within 25 ms of releasing the drop-down, ignore it + // to avoid an unnecessary new press. if (GetTickCount() - DropDownUpTime <= 25) break; - SetCurrentToolTip(NULL, 0); // vykopneme tooltip + SetCurrentToolTip(NULL, 0); // Dismiss the tooltip. int xPos = (short)LOWORD(lParam); int yPos = (short)HIWORD(lParam); int index; BOOL dropDown; - // Pokud je otevrene windows popup menu a klikneme do toolbary, prijde rovnou - // WM_LBUTTONDOWN takze HotIndex == -1, proto vyrazuji podminku index == HotIndex. + // If a Windows pop-up menu is open and we click the toolbar, WM_LBUTTONDOWN + // arrives immediately, so HotIndex == -1 and we ignore the index == HotIndex condition. if (HitTest(xPos, yPos, index, dropDown) /*&& index == HotIndex*/) { CToolBarItem* item = Items[index]; @@ -1040,7 +1041,7 @@ CToolBar::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) DownIndex = -1; SendMessage(HWindow, WM_MOUSEMOVE, 0, MAKELPARAM(p.x, p.y)); if (HotIndex == index) - DrawItem(HotIndex); // pokud nedoslo ke zmene, musim prekreslit stav + DrawItem(HotIndex); // If nothing changed, force a redraw of the state. RelayToolTip = TRUE; DropDownUpTime = GetTickCount(); } @@ -1056,7 +1057,7 @@ CToolBar::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_LBUTTONUP: { - SetCurrentToolTip(NULL, 0); // vykopneme tooltip + SetCurrentToolTip(NULL, 0); // Dismiss the tooltip. if (DownIndex != -1) { int xPos = (short)LOWORD(lParam); @@ -1087,8 +1088,8 @@ CToolBar::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) DrawItem(DownIndex); DownIndex = -1; } - // musim uvolnit capture, aby chodily WM_SYSCOMMAND generovane na - // zaklade kliknuti na tlacitko v toolbare + // We must release capture so WM_SYSCOMMAND generated by clicking + // toolbar buttons can be delivered. if (GetCapture() == HWindow) ReleaseCapture(); break; @@ -1096,7 +1097,7 @@ CToolBar::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_RBUTTONUP: { - SetCurrentToolTip(NULL, 0); // vykopneme tooltip + SetCurrentToolTip(NULL, 0); // Dismiss the tooltip. NMHDR nmhdr; nmhdr.hwndFrom = HWindow; nmhdr.idFrom = (UINT_PTR)GetMenu(HWindow); @@ -1108,13 +1109,13 @@ CToolBar::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_USER_TTGETTEXT: { - DWORD index = (DWORD)wParam; // FIXME_X64 - overit pretypovani na (DWORD) + DWORD index = (DWORD)wParam; // FIXME_X64 - verify the cast to (DWORD). char* text = (char*)lParam; if (index >= 0 && index < (DWORD)Items.Count) { CToolBarItem* item = Items[index]; if (item->Style & TLBI_STYLE_SEPARATOR) - return 0; // separator nema tooltip + return 0; // Separators have no tooltip. TOOLBAR_TOOLTIP tt; tt.HToolBar = HWindow; tt.ID = item->ID; From 8e60950acc40a632ed6d90692ceebae10f7f9532 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 09:49:08 +0200 Subject: [PATCH 591/710] [translation] Initial src/toolbar2.cpp comments translation (#967) --- src/toolbar2.cpp | 67 ++++++++++++++++++++++++------------------------ 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/src/toolbar2.cpp b/src/toolbar2.cpp index e0e30b741..ee5df89d2 100644 --- a/src/toolbar2.cpp +++ b/src/toolbar2.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -12,9 +13,9 @@ // CToolBar // -#define TB_SP_WIDTH 6 // sirka separatoru +#define TB_SP_WIDTH 6 // Separator width. -#define TB_ICON_TB 3 // pocet bodu nad a pod ikonou, vcetne ramecku +#define TB_ICON_TB 3 // Number of points above and below the icon, including the border. #define TB_TEXT_TB 3 void CToolBar::SetFont() @@ -147,7 +148,7 @@ BOOL CToolBar::HitTest(int xPos, int yPos, int& index, BOOL& dropDown) else { if (item->Style & TLBI_STYLE_SEPARATOR) - item->Height = Height - 2 * Padding.ToolBarVertical; // separator nema nastavenou vysku - udelam to ted + item->Height = Height - 2 * Padding.ToolBarVertical; // A separator lacks height—set it now. int yOffset = (Height - item->Height) / 2; if (xPos >= item->Offset && xPos < item->Offset + item->Width && yPos >= yOffset && yPos < yOffset + item->Height) @@ -183,7 +184,7 @@ BOOL CToolBar::InsertMarkHitTest(int xPos, int yPos, int& index, BOOL& after) { item = Items[i]; if (item->Style & TLBI_STYLE_SEPARATOR) - item->Height = Height - 2 * Padding.ToolBarVertical; // separator nema nastavenou vysku - udelam to ted + item->Height = Height - 2 * Padding.ToolBarVertical; // A separator lacks height—set it now. int yOffset = (Height - item->Height) / 2; if (xPos >= item->Offset && xPos < item->Offset + item->Width && yPos >= yOffset && yPos < yOffset + item->Height) @@ -197,7 +198,7 @@ BOOL CToolBar::InsertMarkHitTest(int xPos, int yPos, int& index, BOOL& after) { if (index > 0) { - // prednostne vratime, ze jsem za minulou polozkou (eliminace blikani) + // Prefer reporting that we are after the previous item (reduces flicker). index--; after = TRUE; } @@ -210,20 +211,20 @@ BOOL CToolBar::InsertMarkHitTest(int xPos, int yPos, int& index, BOOL& after) after = TRUE; return TRUE; } - // bod lezi nad tlacitkem, ale ne dost u jeho okraje + // The point is over the button but not close enough to its edge. return FALSE; } } if (item == NULL) { - // zadna polozka + // No item. index = -1; after = FALSE; return TRUE; } if (xPos >= item->Offset + item->Width) { - // za posledni polozkou + // After the last item. index = Items.Count - 1; after = TRUE; return TRUE; @@ -275,7 +276,7 @@ BOOL CToolBar::Refresh() } else { - // musime urcit sirku podle obsahu + // We must determine the width from the content. int textWidth = 0; @@ -289,7 +290,7 @@ BOOL CToolBar::Refresh() if (!vertical && (Style & TLB_STYLE_TEXT) && (item->Style & TLBI_STYLE_SHOWTEXT) && item->Text != NULL && *item->Text != 0) { - // pokud polozka obsahuje text, omerime ho + // If the item contains text, measure it. RECT r; r.left = 0; r.top = 0; @@ -308,7 +309,7 @@ BOOL CToolBar::Refresh() if (!vertical && (item->Style & TLBI_STYLE_SEPARATEDROPDOWN)) outterDropPresent = TRUE; - int width = 1; // levy okraj + int width = 1; // Left margin. int height = 0; if (iconPresent) @@ -348,7 +349,7 @@ BOOL CToolBar::Refresh() item->InnerX = width; width += SVGArrowDropDown.GetWidth() + Padding.TextRight; } - width++; // pravy okraj + width++; // Right margin. if (outterDropPresent) { @@ -358,7 +359,7 @@ BOOL CToolBar::Refresh() width += 2 + SVGArrowDropDown.GetWidth() + 2; } else - item->OutterX = width - (2 + SVGArrowDropDown.GetWidth() + 2); // ukousneme s sirky polozky + item->OutterX = width - (2 + SVGArrowDropDown.GetWidth() + 2); // Steal the space from the item width. } if (!(item->Style & TLBI_STYLE_FIXEDWIDTH)) @@ -373,7 +374,7 @@ BOOL CToolBar::Refresh() if (hOldFont != NULL) SelectObject(CacheBitmap->HMemDC, hOldFont); CacheBitmap->Enlarge(maxWidth, maxHeight); - DirtyItems = FALSE; // musim nastavit pred paintem, aby nedoslo k rekurzi + DirtyItems = FALSE; // Must be cleared before painting to avoid recursion. if (HWindow != NULL) { @@ -404,7 +405,7 @@ void CToolBar::DrawItem(int index) return; } if (Refresh()) - return; // pokud bylo prekresleno vse, nemusime uz nic delat + return; // If everything has already been redrawn, there is nothing more to do. HDC hDC = HANDLES(GetDC(HWindow)); DrawItem(hDC, index); @@ -421,7 +422,7 @@ void CToolBar::DrawItem(HDC hDC, int index) } if (index < 0 || index >= Items.Count) { - // meli jsme nekolik padacek v CToolBar::DrawItem + // We have had several crashes in CToolBar::DrawItem. TRACE_E("index=" << index << " Items.Count=" << Items.Count); return; } @@ -438,7 +439,7 @@ void CToolBar::DrawItem(HDC hDC, int index) // TRACE_I("TB DrawItem index:"<Offset); - // podmazu plochu podkladovou barvou + // Cover the area with the background color first. RECT r1; r1.left = 0; r1.top = 0; @@ -518,14 +519,14 @@ void CToolBar::DrawItem(HDC hDC, int index) r.right = width; r.bottom = r.top + height; - BOOL bodyDown = FALSE; // je telo zamackle ? - BOOL dropDown = FALSE; // je drop down zamackly? + BOOL bodyDown = FALSE; // Is the button body pressed? + BOOL dropDown = FALSE; // Is the drop-down pressed? BOOL checked = FALSE; BOOL grayed = !Customizing && (item->State & TLBI_STATE_GRAYED); if (HelpMode && HotIndex == index) - grayed = FALSE; // v helpmode jsou i disabled polozky vysviceny + grayed = FALSE; // Help mode highlights disabled items as well. - // vykreslim ramecek + // Draw the frame. if (!grayed && ((HotIndex == index || item->State & TLBI_STATE_CHECKED) || (item->State & TLBI_STATE_PRESSED))) { if (outterDropPresent) @@ -538,7 +539,7 @@ void CToolBar::DrawItem(HDC hDC, int index) { if (HotIndex != index) { - // ditherovane zamackle pozadi + // Dithered pressed background. SetBrushOrgEx(CacheBitmap->HMemDC, 0, r.top, NULL); HBRUSH hOldBrush = (HBRUSH)SelectObject(CacheBitmap->HMemDC, HDitherBrush); int oldTextColor = SetTextColor(CacheBitmap->HMemDC, GetSysColor(COLOR_BTNFACE)); @@ -552,13 +553,13 @@ void CToolBar::DrawItem(HDC hDC, int index) checked = TRUE; } - // ramecek kolem tela + // Frame around the button body. DWORD mode = bodyDown ? BDR_SUNKENOUTER : BDR_RAISEDINNER; DrawEdge(CacheBitmap->HMemDC, &r, mode, BF_RECT); if (HotIndex == index && outterDropPresent) { - // ramecek kolem drop down + // Frame around the drop-down portion. r.left = r.right; r.right = width; mode = dropDown ? BDR_SUNKENOUTER : BDR_RAISEDINNER; @@ -570,7 +571,7 @@ void CToolBar::DrawItem(HDC hDC, int index) { if (grayed) { - // kreslime bud s pozadim (rychlejsi) nebo v priade checked transparentne + // Draw either with a background (faster) or transparently when checked. int offset = bodyDown ? 1 : 0; int x = item->IconX + offset; int y = centerOffset + (item->Height - imgH) / 2 + offset; @@ -588,7 +589,7 @@ void CToolBar::DrawItem(HDC hDC, int index) } else { - // kreslime bud s pozadim (rychlejsi) nebo v priade checked transparentne + // Draw either with a background (faster) or transparently when checked. int offset = bodyDown ? 1 : 0; int x = item->IconX + offset; int y = centerOffset + (item->Height - imgH) / 2 + offset; @@ -657,7 +658,7 @@ void CToolBar::DrawItem(HDC hDC, int index) int offset = 0; if (!grayed && dropDown) offset = 1; - // zde budeme posouvat pouze dolu - mame malo mista + // Only shift downward here—we have limited space. DrawDropDown(CacheBitmap->HMemDC, item->OutterX, y + offset, grayed); } } @@ -677,7 +678,7 @@ void CToolBar::DrawAllItems(HDC hDC) return; } if (Refresh()) - return; // pokud bylo prekresleno vse, nemusime uz nic delat + return; // If everything was redrawn, nothing more to do. BOOL vertical = (Style & TLB_STYLE_VERTICAL) != 0; @@ -723,7 +724,7 @@ void CToolBar::DrawAllItems(HDC hDC) } offset += length; } - // domazu zbytek na konci + // Clear any remaining space at the end. if (vertical) { if (offset < Height) @@ -771,7 +772,7 @@ void CToolBar::DrawInsertMark(HDC hDC) if (InserMarkIndex == -1) return; int x = 0; - // urcime posizici + // Determine the position. if (InserMarkIndex >= 0 && InserMarkIndex < Items.Count) { CToolBarItem* item = Items[InserMarkIndex]; @@ -782,17 +783,17 @@ void CToolBar::DrawInsertMark(HDC hDC) x -= 1; HPEN hPen = HANDLES(CreatePen(PS_SOLID, 0, RGB(0, 0, 0))); HPEN hOldPen = (HPEN)SelectObject(hDC, hPen); - // vrchni dve vodorovne cary + // Top two horizontal lines. MoveToEx(hDC, x - 2, 0, NULL); LineTo(hDC, x + 4, 0); MoveToEx(hDC, x - 1, 1, NULL); LineTo(hDC, x + 3, 1); - // dve svisle cary + // Two vertical lines. MoveToEx(hDC, x, 2, NULL); LineTo(hDC, x, Height - 2); MoveToEx(hDC, x + 1, 2, NULL); LineTo(hDC, x + 1, Height - 2); - // spodni dve vodorovne cary + // Bottom two horizontal lines. MoveToEx(hDC, x - 1, Height - 2, NULL); LineTo(hDC, x + 3, Height - 2); MoveToEx(hDC, x - 2, Height - 1, NULL); From 393b19a6c22650df6425b955c3e69ee63852b78c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 09:49:11 +0200 Subject: [PATCH 592/710] [translation] Initial src/toolbar3.cpp comments translation (#968) --- src/toolbar3.cpp | 59 ++++++++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/src/toolbar3.cpp b/src/toolbar3.cpp index dd1442f07..626652590 100644 --- a/src/toolbar3.cpp +++ b/src/toolbar3.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -49,19 +50,19 @@ void CTBCustomizeDialog::DestroyItems() } } -// naplni Items pole vsema tlacitkama, ktere muze toolbar obsahovat +// Populate the Items array with every button the toolbar can contain. BOOL CTBCustomizeDialog::EnumButtons() { CALL_STACK_MESSAGE1("CTBCustomizeDialog::EnumButtons()"); - // vycistime pole + // Clear the array. DestroyItems(); - char textBuffer[1024]; // docasne buffery pro prijem retezcu + char textBuffer[1024]; // temporary buffers used to receive strings char nameBuffer[1024]; HWND hNotifyWnd = ToolBar->HNotifyWindow; TLBI_ITEM_INFO2 tii; - tii.Mask = TLBI_MASK_STYLE; // na prvni misto seznamu zaradime separator + tii.Mask = TLBI_MASK_STYLE; // place a separator at the first position of the list tii.Style = TLBI_STYLE_SEPARATOR; tii.Index = -1; BOOL sent = TRUE; @@ -81,7 +82,7 @@ BOOL CTBCustomizeDialog::EnumButtons() } if (sent) { - // naalokujeme kopie retezcu text a name + // Allocate copies of the text and name strings. tii.TextLen = lstrlen(tii.Text); tii.NameLen = lstrlen(tii.Name); char* text = (char*)malloc(tii.TextLen + 1); @@ -94,7 +95,7 @@ BOOL CTBCustomizeDialog::EnumButtons() name[tii.NameLen] = 0; tii.Text = text; tii.Name = name; - // vlozime polozku do pole + // insert the item into the array AllItems.Add(tii); tii.Index++; } @@ -117,7 +118,7 @@ BOOL CTBCustomizeDialog::PresentInToolBar(DWORD id) BOOL CTBCustomizeDialog::FindIndex(DWORD id, int* index) { CALL_STACK_MESSAGE_NONE - // preskocime virtualni separator + // skip the virtual separator int i; for (i = 1; i < AllItems.Count; i++) { @@ -140,9 +141,9 @@ void CTBCustomizeDialog::FillLists() SendMessage(HCurrentLB, LB_RESETCONTENT, 0, 0); int i; for (i = 0; i < AllItems.Count; i++) - if (i == 0 || !PresentInToolBar(AllItems[i].ID)) // pokud se nejedna o virtualni separator, kontrolujeme pritomnost v toolbare + if (i == 0 || !PresentInToolBar(AllItems[i].ID)) // Include the virtual separator and every button that is not currently on the toolbar. { - int ret = (int)SendMessage(HAvailableLB, LB_ADDSTRING, 0, 1); // 1 je dumy hodnota, obchazime chybu WinXP + int ret = (int)SendMessage(HAvailableLB, LB_ADDSTRING, 0, 1); // 1 is a dummy value used to work around a WinXP bug if (ret != LB_ERR) SendMessage(HAvailableLB, LB_SETITEMDATA, ret, (LPARAM)i); } @@ -150,7 +151,7 @@ void CTBCustomizeDialog::FillLists() { int index; if (ToolBar->Items[i]->Style == TLBI_STYLE_SEPARATOR) - index = 0; // virtualni separator + index = 0; // virtual separator else { if (!FindIndex(ToolBar->Items[i]->ID, &index)) @@ -159,14 +160,14 @@ void CTBCustomizeDialog::FillLists() continue; } } - int ret = (int)SendMessage(HCurrentLB, LB_ADDSTRING, 0, 1); // 1 je dumy hodnota, obchazime chybu WinXP + int ret = (int)SendMessage(HCurrentLB, LB_ADDSTRING, 0, 1); // 1 is a dummy value used to work around a WinXP bug if (ret != LB_ERR) SendMessage(HCurrentLB, LB_SETITEMDATA, ret, (LPARAM)index); } - // virtualni separator + // Virtual separator. SendMessage(HCurrentLB, LB_ADDSTRING, 0, (LPARAM)-1); - // nastavime selected polozky + // Select the default entries. SendMessage(HAvailableLB, LB_SETCURSEL, 0, 0); SendMessage(HCurrentLB, LB_SETCURSEL, 0, 0); @@ -203,12 +204,12 @@ void CTBCustomizeDialog::OnAdd() if (aIndex >= aCount - 1) aIndex = aCount - 2; } - // fix: pokud byl seznam odrolovan dolu a odebiraly se polozky zespodu, - // zmensoval se scrollbar, ale neupravoval se topindex + // Fix: when the list was scrolled down and items were removed from the bottom, + // the scrollbar shrank but the top index was not adjusted. SendMessage(HAvailableLB, LB_SETCURSEL, 0, 0); SendMessage(HAvailableLB, LB_SETCURSEL, aIndex, 0); SendMessage(HAvailableLB, WM_SETREDRAW, TRUE, 0); - int ret = (int)SendMessage(HCurrentLB, LB_INSERTSTRING, cIndex, 1); // 1 je dumy hodnota, obchazime chybu WinXP + int ret = (int)SendMessage(HCurrentLB, LB_INSERTSTRING, cIndex, 1); // 1 is a dummy value used to work around a WinXP bug if (ret != LB_ERR) SendMessage(HCurrentLB, LB_SETITEMDATA, ret, data); SendMessage(HCurrentLB, LB_SETCURSEL, cIndex + 1, 0); @@ -229,8 +230,8 @@ void CTBCustomizeDialog::OnRemove() int data = (int)SendMessage(HCurrentLB, LB_GETITEMDATA, cIndex, 0); SendMessage(HCurrentLB, WM_SETREDRAW, FALSE, 0); SendMessage(HCurrentLB, LB_DELETESTRING, cIndex, 0); - // fix: pokud byl seznam odrolovan dolu a odebiraly se polozky zespodu, - // zmensoval se scrollbar, ale neupravoval se topindex + // Fix: when the list was scrolled down and items were removed from the bottom, + // the scrollbar shrank but the top index was not adjusted. SendMessage(HCurrentLB, LB_SETCURSEL, 0, 0); SendMessage(HCurrentLB, LB_SETCURSEL, cIndex, 0); SendMessage(HCurrentLB, WM_SETREDRAW, TRUE, 0); @@ -244,7 +245,7 @@ void CTBCustomizeDialog::OnRemove() if (tmp > data) break; } - int ret = (int)SendMessage(HAvailableLB, LB_INSERTSTRING, index, 1); // 1 je dumy hodnota, obchazime chybu WinXP + int ret = (int)SendMessage(HAvailableLB, LB_INSERTSTRING, index, 1); // 1 is a dummy value used to work around a WinXP bug if (ret != LB_ERR) SendMessage(HAvailableLB, LB_SETITEMDATA, ret, data); } @@ -265,7 +266,7 @@ void CTBCustomizeDialog::MoveItem(int srcIndex, int tgtIndex) ToolBar->InsertItem2(tgtIndex - delta, TRUE, &AllItems[data]); SendMessage(HCurrentLB, LB_DELETESTRING, srcIndex, 0); - int ret = (int)SendMessage(HCurrentLB, LB_INSERTSTRING, tgtIndex - delta, 1); // 1 je dumy hodnota, obchazime chybu WinXP + int ret = (int)SendMessage(HCurrentLB, LB_INSERTSTRING, tgtIndex - delta, 1); // 1 is a dummy value, working around a WinXP bug if (ret != LB_ERR) SendMessage(HCurrentLB, LB_SETITEMDATA, ret, data); SendMessage(HCurrentLB, LB_SETCURSEL, tgtIndex - delta, 0); @@ -320,7 +321,7 @@ CTBCustomizeDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) DragIndex = LBItemFromPt(dli->hWnd, dli->ptCursor, FALSE); if (DragMode == tbcdDragCurrent && DragIndex >= ToolBar->Items.Count) { - // virtualni separator nenechame tahnout + // do not allow the virtual separator to be dragged DragMode = tbcdDragNone; SetWindowLongPtr(HWindow, DWLP_MSGRESULT, FALSE); } @@ -398,12 +399,12 @@ CTBCustomizeDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) MakeDragList(HCurrentLB); DragNotify = RegisterWindowMessage(DRAGLISTMSGSTRING); - // vytahneme tlacitka + // retrieve the buttons EnumButtons(); FillLists(); EnableControls(); - // napocitame vysku radku + // compute the row height int iconSize = GetIconSizeForSystemDPI(ICONSIZE_16); int minHeight = max(iconSize, ToolBar->ImageHeight); HFONT hFont = (HFONT)SendMessage(HAvailableLB, WM_GETFONT, 0, 0); @@ -416,7 +417,7 @@ CTBCustomizeDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam) SelectObject(hDC, hOldFont); HANDLES(ReleaseDC(HWindow, hDC)); minHeight += 2; - // nastavime oba listboxy + // set both list boxes SendMessage(HAvailableLB, LB_SETITEMHEIGHT, 0, minHeight); SendMessage(HCurrentLB, LB_SETITEMHEIGHT, 0, minHeight); break; @@ -526,22 +527,22 @@ void CToolBar::Customize() if (!(Style & TLB_STYLE_ADJUSTABLE)) return; - // posleme notifikaci o zacatku konfigurace + // send a notification about the start of customization SendMessage(HNotifyWindow, WM_USER_TBBEGINADJUST, (WPARAM)HWindow, 0); - // behem konfigurace jsou vsechna tlacitka enabled + // all buttons are enabled during customization Customizing = TRUE; InvalidateRect(HWindow, NULL, FALSE); UpdateWindow(HWindow); - // provedeme konfiguraci + // perform the customization CTBCustomizeDialog dialog(this); dialog.Execute(); - // vratime se k puvodnimu nastaveni tlacitek + // return to the original button setup Customizing = FALSE; InvalidateRect(HWindow, NULL, FALSE); - // posleme notifikaci o ukonceni konfigurace + // send a notification about the end of customization SendMessage(HNotifyWindow, WM_USER_TBENDADJUST, (WPARAM)HWindow, 0); } From f5c058e4b0ecf063ccd340e9859f2cd95fd2b755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 09:49:15 +0200 Subject: [PATCH 593/710] [translation] Initial src/toolbar4.cpp comments translation (#969) --- src/toolbar4.cpp | 187 +++++++++++++++++++++++------------------------ 1 file changed, 92 insertions(+), 95 deletions(-) diff --git a/src/toolbar4.cpp b/src/toolbar4.cpp index 0b0e6a0ad..dad578250 100644 --- a/src/toolbar4.cpp +++ b/src/toolbar4.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -17,40 +18,40 @@ struct CButtonData { - unsigned int ImageIndex : 16; // zero base index - unsigned int Shell32ResID : 8; // 0: ikona z image listu; 1..254: resID ikony z shell32.dll; 255: pouze alokovat volny prostor - unsigned int ToolTipResID : 16; // resID se stringem pro tooltip - unsigned int ID : 16; // univerzalni Command - unsigned int LeftID : 16; // Command pro levy panel - unsigned int RightID : 16; // Command pro pravy panel - unsigned int DropDown : 1; // bude mit drop down? - unsigned int WholeDropDown : 1; // bude mit whole drop down? - unsigned int Check : 1; // jedna se o checkbox? - DWORD* Enabler; // ridici promenna pro enablovani tlacitka - DWORD* LeftEnabler; // ridici promenna pro enablovani tlacitka - DWORD* RightEnabler; // ridici promenna pro enablovani tlacitka - const char* SVGName; // NULL pokud tlacitko nema SVG reprezentaci + unsigned int ImageIndex : 16; // zero-based index + unsigned int Shell32ResID : 8; // 0: icon from the image list; 1..254: icon resID from shell32.dll; 255: reserve an empty slot + unsigned int ToolTipResID : 16; // resID with the string for the tooltip + unsigned int ID : 16; // universal command + unsigned int LeftID : 16; // command for the left panel + unsigned int RightID : 16; // command for the right panel + unsigned int DropDown : 1; // should this button show a drop-down? + unsigned int WholeDropDown : 1; // should the entire button act as a drop-down? + unsigned int Check : 1; // is this a checkbox? + DWORD* Enabler; // control flag used when enabling the button + DWORD* LeftEnabler; // control flag used when enabling the button + DWORD* RightEnabler; // control flag used when enabling the button + const char* SVGName; // NULL if the button has no SVG representation }; //**************************************************************************** // // TBButtonEnum // -// Unikatni indexy do pole ToolBarButton - slouzi k adresaci tohoto pole. -// Do tohoto pole lze pouze pridavat na konec. +// Unique indexes into the ToolBarButtons array; used to address entries here. +// Items can only be appended to this array. // #define TBBE_CONNECT_NET 0 #define TBBE_DISCONNECT_NET 1 #define TBBE_CREATE_DIR 2 #define TBBE_FIND_FILE 3 -#define TBBE_VIEW_MODE 4 // drive brief -//#define TBBE_DETAILED 5 // vyrazeno +#define TBBE_VIEW_MODE 4 // formerly brief +//#define TBBE_DETAILED 5 // removed #define TBBE_SORT_NAME 6 #define TBBE_SORT_EXT 7 #define TBBE_SORT_SIZE 8 #define TBBE_SORT_DATE 9 -//#define TBBE_SORT_ATTR 10 // vyrazeno +//#define TBBE_SORT_ATTR 10 // removed #define TBBE_PARENT_DIR 11 #define TBBE_ROOT_DIR 12 #define TBBE_FILTER 13 @@ -97,7 +98,7 @@ struct CButtonData #define TBBE_PERMISSIONS 54 #define TBBE_CONVERT 55 #define TBBE_UNSELECT_ALL 56 -#define TBBE_MENU 57 // vstup do menu +#define TBBE_MENU 57 // enter the menu #define TBBE_ALTVIEW 58 #define TBBE_EXIT 59 #define TBBE_OCCUPIEDSPACE 60 @@ -254,9 +255,8 @@ CButtonData ToolBarButtons[TBBE_TERMINATOR] = // // TopToolbar // -// Vyjadruje vsechna mozna tlacitka, ktera muze obsahovat TopToolbar. -// Poradi udava poradi tlacitek v konfiguracnim dialogu toolbary a muze -// byt libovolne meneno. +// Represents all buttons that TopToolbar can contain. +// The order defines how buttons appear in the toolbar configuration dialog and can be changed freely. // DWORD TopToolBarButtons[] = @@ -357,7 +357,7 @@ DWORD TopToolBarButtons[] = NIB2(TBBE_HELP_CONTENTS) NIB2(TBBE_HELP_CONTEXT) - TBBE_TERMINATOR // terminator - musi zde byt ! + TBBE_TERMINATOR // terminator - must remain here! }; DWORD LeftToolBarButtons[] = @@ -378,7 +378,7 @@ DWORD LeftToolBarButtons[] = TBBE_REFRESH, TBBE_SMART_COLUMN_MODE, - TBBE_TERMINATOR // terminator - musi zde byt ! + TBBE_TERMINATOR // terminator - must remain here! }; DWORD RightToolBarButtons[] = @@ -399,7 +399,7 @@ DWORD RightToolBarButtons[] = TBBE_REFRESH, TBBE_SMART_COLUMN_MODE, - TBBE_TERMINATOR // terminator - musi zde byt ! + TBBE_TERMINATOR // terminator - must remain here! }; void GetSVGIconsMainToolbar(CSVGIcon** svgIcons, int* svgIconsCount) @@ -418,9 +418,8 @@ void GetSVGIconsMainToolbar(CSVGIcon** svgIcons, int* svgIconsCount) // // CreateGrayscaleAndMaskBitmaps // -// Vytvori novou bitmapu o hloubce 24 bitu, nakopiruje do ni zdrojovou -// bitmapu a prevede ji na stupne sedi. Zaroven pripravi druhou bitmapu -// s maskou dle transparentni barvy. +// Creates a new 24-bit bitmap, copies the source bitmap into it, and converts it to grayscale. +// At the same time, it prepares a second bitmap with a mask based on the transparent color. // BOOL CreateGrayscaleAndMaskBitmaps(HBITMAP hSource, COLORREF transparent, @@ -434,11 +433,11 @@ BOOL CreateGrayscaleAndMaskBitmaps(HBITMAP hSource, COLORREF transparent, hMask = NULL; HDC hDC = HANDLES(GetDC(NULL)); - // vytahnu rozmery bitmapy + // get the bitmap dimensions BITMAPINFO bi; memset(&bi, 0, sizeof(bi)); bi.bmiHeader.biSize = sizeof(bi.bmiHeader); - bi.bmiHeader.biBitCount = 0; // nechceme paletu + bi.bmiHeader.biBitCount = 0; // we do not want a palette if (!GetDIBits(hDC, hSource, @@ -457,9 +456,9 @@ BOOL CreateGrayscaleAndMaskBitmaps(HBITMAP hSource, COLORREF transparent, goto exitus; } - // pozadovana barevna hloubka je 24 bitu + // Force a 24-bit color depth. bi.bmiHeader.biSizeImage = ((((bi.bmiHeader.biWidth * 24) + 31) & ~31) >> 3) * bi.bmiHeader.biHeight; - // naalokuju potrebny prostor + // Allocate the required storage. lpvBits = malloc(bi.bmiHeader.biSizeImage); if (lpvBits == NULL) { @@ -477,7 +476,7 @@ BOOL CreateGrayscaleAndMaskBitmaps(HBITMAP hSource, COLORREF transparent, bi.bmiHeader.biBitCount = 24; bi.bmiHeader.biCompression = BI_RGB; - // vytahnu vlastni data + // Retrieve the bitmap data. if (!GetDIBits(hDC, hSource, 0, bi.bmiHeader.biHeight, @@ -489,7 +488,7 @@ BOOL CreateGrayscaleAndMaskBitmaps(HBITMAP hSource, COLORREF transparent, goto exitus; } - // vytahnu vlastni data pro mask + // Retrieve the mask data. if (!GetDIBits(hDC, hSource, 0, bi.bmiHeader.biHeight, @@ -501,7 +500,7 @@ BOOL CreateGrayscaleAndMaskBitmaps(HBITMAP hSource, COLORREF transparent, goto exitus; } - // prevedu na grayscale + // Convert the bitmap to grayscale. BYTE* rgb; BYTE* rgbMask; rgb = (BYTE*)lpvBits; @@ -524,7 +523,7 @@ BOOL CreateGrayscaleAndMaskBitmaps(HBITMAP hSource, COLORREF transparent, rgbMask += 3; } - // vytvorim novou bitmapu nad grayscale datama + // Create a bitmap from the grayscale data. hGrayscale = HANDLES(CreateDIBitmap(hDC, &bi.bmiHeader, (LONG)CBM_INIT, @@ -537,7 +536,7 @@ BOOL CreateGrayscaleAndMaskBitmaps(HBITMAP hSource, COLORREF transparent, goto exitus; } - // vytvorim novou bitmapu nad mask datama + // Create a bitmap from the mask data. hMask = HANDLES(CreateDIBitmap(hDC, &bi.bmiHeader, (LONG)CBM_INIT, @@ -563,7 +562,7 @@ BOOL CreateGrayscaleAndMaskBitmaps(HBITMAP hSource, COLORREF transparent, return ret; } -// JRYFIXME - docasne pro prechod na SVG +// JRYFIXME - temporary helper while transitioning to SVG. BOOL CreateGrayscaleAndMaskBitmaps_tmp(HBITMAP hSource, COLORREF transparent, COLORREF bkColorForAlpha, HBITMAP& hGrayscale, HBITMAP& hMask) { @@ -575,11 +574,11 @@ BOOL CreateGrayscaleAndMaskBitmaps_tmp(HBITMAP hSource, COLORREF transparent, CO hMask = NULL; HDC hDC = HANDLES(GetDC(NULL)); - // vytahnu rozmery bitmapy + // get the bitmap dimensions BITMAPINFO bi; memset(&bi, 0, sizeof(bi)); bi.bmiHeader.biSize = sizeof(bi.bmiHeader); - bi.bmiHeader.biBitCount = 0; // nechceme paletu + bi.bmiHeader.biBitCount = 0; // we do not want a palette if (!GetDIBits(hDC, hSource, @@ -598,9 +597,9 @@ BOOL CreateGrayscaleAndMaskBitmaps_tmp(HBITMAP hSource, COLORREF transparent, CO goto exitus; } - // pozadovana barevna hloubka je 24 bitu + // Force a 24-bit color depth. bi.bmiHeader.biSizeImage = ((((bi.bmiHeader.biWidth * 24) + 31) & ~31) >> 3) * bi.bmiHeader.biHeight; - // naalokuju potrebny prostor + // Allocate the required storage. lpvBits = malloc(bi.bmiHeader.biSizeImage); if (lpvBits == NULL) { @@ -618,7 +617,7 @@ BOOL CreateGrayscaleAndMaskBitmaps_tmp(HBITMAP hSource, COLORREF transparent, CO bi.bmiHeader.biBitCount = 24; bi.bmiHeader.biCompression = BI_RGB; - // vytahnu vlastni data + // Retrieve the bitmap data. if (!GetDIBits(hDC, hSource, 0, bi.bmiHeader.biHeight, @@ -630,7 +629,7 @@ BOOL CreateGrayscaleAndMaskBitmaps_tmp(HBITMAP hSource, COLORREF transparent, CO goto exitus; } - // vytahnu vlastni data pro mask + // Retrieve the mask data. if (!GetDIBits(hDC, hSource, 0, bi.bmiHeader.biHeight, @@ -642,7 +641,7 @@ BOOL CreateGrayscaleAndMaskBitmaps_tmp(HBITMAP hSource, COLORREF transparent, CO goto exitus; } - // prevedu na grayscale + // Convert the bitmap to grayscale. BYTE* rgb; BYTE* rgbMask; rgb = (BYTE*)lpvBits; @@ -667,7 +666,7 @@ BOOL CreateGrayscaleAndMaskBitmaps_tmp(HBITMAP hSource, COLORREF transparent, CO rgbMask += 3; } - // vytvorim novou bitmapu nad grayscale datama + // Create a bitmap from the grayscale data. hGrayscale = HANDLES(CreateDIBitmap(hDC, &bi.bmiHeader, (LONG)CBM_INIT, @@ -680,7 +679,7 @@ BOOL CreateGrayscaleAndMaskBitmaps_tmp(HBITMAP hSource, COLORREF transparent, CO goto exitus; } - // vytvorim novou bitmapu nad mask datama + // Create a bitmap from the mask data. hMask = HANDLES(CreateDIBitmap(hDC, &bi.bmiHeader, (LONG)CBM_INIT, @@ -709,7 +708,7 @@ BOOL CreateGrayscaleAndMaskBitmaps_tmp(HBITMAP hSource, COLORREF transparent, CO void RenderSVGImages(HDC hDC, int iconSize, COLORREF bkColor, const CSVGIcon* svgIcons, int svgIconsCount) { NSVGrasterizer* rast = nsvgCreateRasterizer(); - // JRYFIXME: docasne cteme ze souboru, prejit na spolecne uloziste s toolbars + // JRYFIXME: temporarily reads from a file; switch to the shared toolbar storage. for (int i = 0; i < svgIconsCount; i++) if (svgIcons[i].SVGName != NULL) RenderSVGImage(rast, hDC, svgIcons[i].ImageIndex * iconSize, 0, svgIcons[i].SVGName, iconSize, bkColor, TRUE); @@ -721,10 +720,9 @@ void RenderSVGImages(HDC hDC, int iconSize, COLORREF bkColor, const CSVGIcon* sv // // CreateToolbarBitmaps // -// Vytahne z resID bitmapu, nakopiruje ji do nove bitmapy, ktera je -// barevne kompatibilni s obrazovkou. Potom k teto bitmape pripoji -// ikonky z shell32.dll. Cti transparentni barvu. -// bkColorForAlpha udava barvu, ktera bude prosvitat pod pruhlednou casti ikon (WinXP) +// Load a bitmap identified by resID and copy it into a new screen-compatible bitmap. +// Then append icons from shell32.dll while honoring the transparent color. +// bkColorForAlpha specifies the color that shows through transparent icon regions (WinXP). // BOOL CreateToolbarBitmaps(HINSTANCE hInstance, int resID, COLORREF transparent, COLORREF bkColorForAlpha, @@ -745,16 +743,15 @@ BOOL CreateToolbarBitmaps(HINSTANCE hInstance, int resID, COLORREF transparent, int iconSize = GetIconSizeForSystemDPI(ICONSIZE_16); // small icon size int iconCount = 0; - // Windows XP a novejsi pouzivaji transparentni ikony; protoze je pomoci masky - // zobrazime do teto docasne bitmapy a zajistime, aby pod pruhlednou casti byla - // sediva barva z toolbary a ne nase fialova maskovaci + // Windows XP and newer use transparent icons. Render them into this temporary bitmap + // so the area beneath their transparent parts uses the toolbar gray instead of our purple mask color. HBITMAP hTmpBitmap = NULL; HDC hTmpMemDC = NULL; HBITMAP hOldTmpBitmap = NULL; - // nactu zdrojovou bitmapu + // Load the source bitmap. HBITMAP hSource; - if (resID == IDB_TOOLBAR_256) // dirty hack, chtelo by to detekci podle typu resourcu (RCDATA), pripadne podle PNG signatury + if (resID == IDB_TOOLBAR_256) // temporary hack; this should really detect the resource type (RCDATA) or the PNG signature hSource = LoadPNGBitmap(hInstance, MAKEINTRESOURCE(resID), 0); else hSource = HANDLES(LoadBitmap(hInstance, MAKEINTRESOURCE(resID))); @@ -765,11 +762,11 @@ BOOL CreateToolbarBitmaps(HINSTANCE hInstance, int resID, COLORREF transparent, } hDC = HANDLES(GetDC(NULL)); - // vytahnu rozmery bitmapy + // get the bitmap dimensions BITMAPINFO bi; memset(&bi, 0, sizeof(bi)); bi.bmiHeader.biSize = sizeof(bi.bmiHeader); - bi.bmiHeader.biBitCount = 0; // nechceme paletu + bi.bmiHeader.biBitCount = 0; // we do not want a palette if (!GetDIBits(hDC, hSource, 0, 0, @@ -791,13 +788,13 @@ BOOL CreateToolbarBitmaps(HINSTANCE hInstance, int resID, COLORREF transparent, tbbe_BMPCOUNT++; } - // pripravim novou bitmapu, do ktere se vejde hSource a ikonky z DLLka - // prodlouzim delku o ikonky z DLL + // prepare a new bitmap that fits hSource and the icons from the DLL + // extend the width by the icons pulled from the DLL iconCount = bi.bmiHeader.biWidth / 16 + tbbe_BMPCOUNT; // hColorBitmap = HANDLES(CreateBitmap(width, height, bh.bV4Planes, bh.bV4BitCount, NULL)); - //protoze je CreateBitmap() vhodne pouze pro vytvareni B&W bitmap (viz MSDN) - //prechazime od sal 2.5b7 na rychlou CreateCompatibleBitmap() + // because CreateBitmap() is suitable only for creating B&W bitmaps (see MSDN) + // since Salamander 2.5b7 we switched to the faster CreateCompatibleBitmap() hColorBitmap = HANDLES(CreateCompatibleBitmap(hDC, iconSize * iconCount, iconSize)); hTgtMemDC = HANDLES(CreateCompatibleDC(NULL)); @@ -805,12 +802,12 @@ BOOL CreateToolbarBitmaps(HINSTANCE hInstance, int resID, COLORREF transparent, hOldTgtBitmap = (HBITMAP)SelectObject(hTgtMemDC, hColorBitmap); hOldSrcBitmap = (HBITMAP)SelectObject(hSrcMemDC, hSource); - // pro prenaseni icon (vcetne transparentnich) + // for transferring icons (including transparent ones) hTmpBitmap = HANDLES(CreateBitmap(iconSize, iconSize, 1, 1, NULL)); hTmpMemDC = HANDLES(CreateCompatibleDC(NULL)); hOldTmpBitmap = (HBITMAP)SelectObject(hTmpMemDC, hTmpBitmap); - // prenesu do nove bitmapy bitmapu puvodni + // copy the original bitmap into the new bitmap if (!StretchBlt(hTgtMemDC, 0, 0, (iconCount - tbbe_BMPCOUNT) * iconSize, iconSize, hSrcMemDC, 0, 0, bi.bmiHeader.biWidth, bi.bmiHeader.biHeight, SRCCOPY)) @@ -819,23 +816,23 @@ BOOL CreateToolbarBitmaps(HINSTANCE hInstance, int resID, COLORREF transparent, goto exitus; } - // zahodime zdrojovou bitmapu + // discard the source bitmap SelectObject(hSrcMemDC, hOldSrcBitmap); hOldSrcBitmap = NULL; - // pokud mame SVG verzi, pouzijeme ji + // if we have an SVG version, use it if (svgIcons != NULL) { RenderSVGImages(hTgtMemDC, iconSize, bkColorForAlpha, svgIcons, svgIconsCount); } - // pouzijeme pri BitBlt hTmpMemDC->hTgtMemDC + // used when BitBlt-ing from hTmpMemDC to hTgtMemDC //SetBkColor(hTgtMemDC, transparent); //SetTextColor(hTgtMemDC, bkColorForAlpha); if (appendIcons) { - // podojime shell32.dll + // fetch icons from shell32.dll HICON hIcon; for (i = 0; i < TBBE_TERMINATOR; i++) { @@ -853,7 +850,7 @@ BOOL CreateToolbarBitmaps(HINSTANCE hInstance, int resID, COLORREF transparent, } else { - // Documents jsou od WinXP jinde + // Documents moved elsewhere starting with WinXP if (resID2 == 21) resID2 = 235; @@ -865,10 +862,10 @@ BOOL CreateToolbarBitmaps(HINSTANCE hInstance, int resID, COLORREF transparent, continue; } - // pripravime pozadi pro ikonky s alfa kanalem pod WinXP + // prepare the background for icons with an alpha channel on WinXP DrawIconEx(hTmpMemDC, 0, 0, hIcon, iconSize, iconSize, 0, 0, DI_MASK); - // pouzijeme pri BitBlt hTmpMemDC->hTgtMemDC + // used when BitBlt-ing from hTmpMemDC to hTgtMemDC SetBkColor(hTgtMemDC, transparent); SetTextColor(hTgtMemDC, bkColorForAlpha); BitBlt(hTgtMemDC, iconSize * ToolBarButtons[i].ImageIndex, 0, iconSize, iconSize, @@ -885,9 +882,9 @@ BOOL CreateToolbarBitmaps(HINSTANCE hInstance, int resID, COLORREF transparent, else { /* - // --- sileny patch BEGIN - // John: pod W2K mi neslapalo pro ikonku 21 (Documents) DrawIconEx s parametrem DI_NORMAL - // z neznameho duvodu saturovalo pruhledny prostor a tim zmenilo barvu 'transparent' + // --- workaround BEGIN + // John: under W2K, DrawIconEx with DI_NORMAL did not work with icon 21 (Documents) + // for an unknown reason, it filled the transparent area and thus changed the 'transparent' color SetBkColor(hTgtMemDC, RGB(0, 0, 0)); SetTextColor(hTgtMemDC, RGB(255, 255, 255)); BitBlt(hTgtMemDC, ICON16_CX * ToolBarButtons[i].ImageIndex, 0, ICON16_CX, ICON16_CX, @@ -898,7 +895,7 @@ BOOL CreateToolbarBitmaps(HINSTANCE hInstance, int resID, COLORREF transparent, BitBlt(hTgtMemDC, ICON16_CX * ToolBarButtons[i].ImageIndex, 0, ICON16_CX, ICON16_CX, hTmpMemDC, 0, 0, SRCPAINT); - // --- sileny patch END + // --- workaround END */ HANDLES(DestroyIcon(hIcon)); } @@ -944,9 +941,9 @@ BOOL CreateToolbarBitmaps(HINSTANCE hInstance, int resID, COLORREF transparent, // // PrepareToolTipText // -// Prohleda buff na prvni vyskyt znaku '\t'. Pokud je nastavena promenna -// stripHotKey, vlozi na jeho misto terminator a vrati se. Jinak na jeho -// misto vlozi mezeru, zbytek posunu o znak vpravo a ozavorkuje. +// Searches the buffer for the first occurrence of the '\t' character. If the stripHotKey variable is set, +// it inserts a terminator in its place and returns. Otherwise it inserts a space there, shifts the rest one +// character to the right, and wraps it in parentheses. // void PrepareToolTipText(char* buff, BOOL stripHotKey) @@ -992,7 +989,7 @@ BOOL CMainToolBar::FillTII(int tbbeIndex, TLBI_ITEM_INFO2* tii, BOOL fillName) } if (ToolBarButtons[tbbeIndex].ImageIndex == 0xFFFF) { - // stara polozka, ktera v teto verzi byla zrusena + // old item that was removed in this version return FALSE; } @@ -1047,7 +1044,7 @@ BOOL CMainToolBar::FillTII(int tbbeIndex, TLBI_ITEM_INFO2* tii, BOOL fillName) if (fillName) { tii->Name = LoadStr(ToolBarButtons[tbbeIndex].ToolTipResID); - // retezec bude orezan, proto muzeme operaci provest nad bufferem z LoadStr + // the string will be truncated, so we can perform the operation on the buffer from LoadStr PrepareToolTipText(tii->Name, TRUE); } } @@ -1128,8 +1125,8 @@ void CMainToolBar::OnGetToolTip(LPARAM lParam) CFilesWindow* activePanel = MainWindow != NULL ? MainWindow->GetActivePanel() : NULL; BOOL activePanelIsDisk = (activePanel != NULL && activePanel->Is(ptDisk)); if (EnablerPastePath && - (!activePanelIsDisk || !EnablerPasteFiles) && // PasteFiles je prioritni - !EnablerPasteFilesToArcOrFS) // PasteFilesToArcOrFS je prioritni + (!activePanelIsDisk || !EnablerPasteFiles) && // PasteFiles has priority + !EnablerPasteFilesToArcOrFS) // PasteFilesToArcOrFS has priority { char tail[50]; tail[0] = 0; @@ -1164,7 +1161,7 @@ BOOL CMainToolBar::OnEnumButton(LPARAM lParam) break; } if (tbbeIndex == TBBE_TERMINATOR) - return FALSE; // vsechna tlacitka uz byla natlacena + return FALSE; // all buttons have already been added FillTII(tbbeIndex, tii, TRUE); return TRUE; } @@ -1203,12 +1200,12 @@ void CMainToolBar::SetType(CMainToolBarType type) // CBottomToolBar // -#define BOTTOMTB_TEXT_MAX 15 // maximalni delka retezce pro jednu klavesu +#define BOTTOMTB_TEXT_MAX 15 // maximum string length for a single key struct CBottomTBData { DWORD Index; - BYTE TextLen; // pocet zanaku v promenne 'Text' - char Text[BOTTOMTB_TEXT_MAX]; // text bez terminatoru + BYTE TextLen; // number of characters in the 'Text' variable + char Text[BOTTOMTB_TEXT_MAX]; // text without the terminator }; CBottomTBData BottomTBData[btbsCount][12] = @@ -1325,14 +1322,14 @@ CBottomToolBar::CBottomToolBar(HWND hNotifyWindow, CObjectOrigin origin) { CALL_STACK_MESSAGE_NONE State = btbsCount; - Padding.ButtonIconText = 1; // pritahneme text k ikonce - Padding.IconLeft = 2; // prostor pred ikonou - Padding.TextRight = 2; // prostor za textem + Padding.ButtonIconText = 1; // pull the text toward the icon + Padding.IconLeft = 2; // space before the icon + Padding.TextRight = 2; // space after the text } -// naplni v poli BottomTBData promennou 'Text', kterou vycte z resourcu -// 'state' udava radek v poli BottomTBData a 'BottomTBData' oznacuje retezec s textama -// texty pro jednotlive klavesy jsou oddeleny znakem ';' +// fills the 'Text' field in the BottomTBData array with strings read from resources +// 'state' specifies the row in the BottomTBData array and 'textResID' identifies the string containing the texts +// the texts for individual keys are separated by the ';' character BOOL CBottomToolBar::InitDataResRow(CBottomTBStateEnum state, int textResID) { CALL_STACK_MESSAGE2("CBottomToolBar::InitDataResRow(, %d)", textResID); @@ -1479,7 +1476,7 @@ BOOL CBottomToolBar::SetState(CBottomTBStateEnum state) TLBI_ITEM_INFO2 tii; tii.Mask = TLBI_MASK_TEXT | TLBI_MASK_TEXTLEN | TLBI_MASK_ID | TLBI_MASK_ENABLER | TLBI_MASK_STATE | TLBI_MASK_CUSTOMDATA; - tii.State = 0; // povolime command - bude volano UpdateItemsState(), ktere zakaze co je treba + tii.State = 0; // enable the command - UpdateItemsState() will disable whatever is necessary char emptyBuff[] = ""; tii.Text = empty ? emptyBuff : BottomTBData[state][i].Text; tii.TextLen = empty ? 0 : BottomTBData[state][i].TextLen; @@ -1501,7 +1498,7 @@ BOOL CBottomToolBar::SetState(CBottomTBStateEnum state) GetCursorPos(&p); if (WindowFromPoint(p) == HWindow) { - // zajistime obnovu pripadneho tooltipu + // ensure that any tooltip is refreshed ScreenToClient(HWindow, &p); SetCurrentToolTip(NULL, 0); PostMessage(HWindow, WM_MOUSEMOVE, 0, MAKELPARAM(p.x, p.y)); From aedd62fa011f975104bb76d4ecc7c7b81626d290 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 09:49:18 +0200 Subject: [PATCH 594/710] [translation] Initial src/toolbar5.cpp comments translation (#970) --- src/toolbar5.cpp | 53 ++++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/src/toolbar5.cpp b/src/toolbar5.cpp index 70553bd71..b5157c0e9 100644 --- a/src/toolbar5.cpp +++ b/src/toolbar5.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -24,9 +25,9 @@ extern "C" class CUMDropTarget : public IDropTarget { private: - long RefCount; // zivotnost objektu - IDataObject* DataObject; // IDataObject, ktery vstoupil do dragu - CUserMenuBar* UserMenuBar; // bar, ke kteremu jsme asociovani + long RefCount; // object lifetime + IDataObject* DataObject; // IDataObject that entered the drag + CUserMenuBar* UserMenuBar; // bar we are associated with IDropTarget* DropTarget; char DropTargetFileName[MAX_PATH]; @@ -70,12 +71,12 @@ class CUMDropTarget : public IDropTarget if (--RefCount == 0) { delete this; - return 0; // nesmime sahnout do objektu, uz neexistuje + return 0; // we must not touch the object, it no longer exists } return RefCount; } - void HitTest(POINTL pt, int& insertIndex, BOOL& after, int& pasteIndex, char* fileName, BOOL insert) // fileName buffer ma delku MAX_PATH + void HitTest(POINTL pt, int& insertIndex, BOOL& after, int& pasteIndex, char* fileName, BOOL insert) // fileName buffer has length MAX_PATH { POINT p; p.x = pt.x; @@ -116,7 +117,7 @@ class CUMDropTarget : public IDropTarget if (pasteIndex != -1) { insertIndex = -1; - // overim, ze jde o target + // Verify that the drop target is valid. TLBI_ITEM_INFO2 tii; tii.Mask = TLBI_MASK_ID; if (UserMenuBar->GetItemInfo2(pasteIndex, TRUE, &tii)) @@ -204,7 +205,7 @@ class CUMDropTarget : public IDropTarget if (DataObject != NULL) { - // provedeme hittest + // Perform a hit test to locate the drop position. int insertIndex = -1; BOOL after; int pasteIndex = -1; @@ -257,7 +258,7 @@ class CUMDropTarget : public IDropTarget ImageDragMove(pt.x, pt.y); if (DataObject != NULL) { - // provedeme hittest + // Perform a hit test. int insertIndex = -1; BOOL after; int pasteIndex = -1; @@ -324,9 +325,9 @@ class CUMDropTarget : public IDropTarget DataObject = NULL; } - // sestrelim insert mark + // Clear the insert mark. UserMenuBar->SetInsertMark(-1, FALSE); - // sestrelim hot item + // Clear the hot item. UserMenuBar->SetHotItem(-1); return E_UNEXPECTED; @@ -342,7 +343,7 @@ class CUMDropTarget : public IDropTarget ImageDragLeave(); if (DataObject != NULL) { - // provedeme hittest + // Perform a hit test. int insertIndex = -1; BOOL after; int pasteIndex = -1; @@ -355,7 +356,7 @@ class CUMDropTarget : public IDropTarget if (insertIndex != -1) { - // sestrelim insert mark + // Clear the insert mark. UserMenuBar->SetInsertMark(-1, FALSE); if (insert) @@ -372,11 +373,11 @@ class CUMDropTarget : public IDropTarget char tmp[MAX_PATH]; BOOL shell = FALSE; - // zmenil jsem metodu CMainWindow::UserMenu tak, ze pokud nespousti pres Shell, - // vola ShellExecuteEx misto CreateProcess; proto uz nejsou potreba uvozovky + // CMainWindow::UserMenu was changed so that if it does not launch through the Shell, + // it calls ShellExecuteEx instead of CreateProcess; therefore quotes are no longer needed /* - // pokud se nejedna o spustitelny soubor (.exe, .com, .bat, .pif), - // soupnu nazev do uvozovek a spustim ho pres shell + // if it is not an executable file (.exe, .com, .bat, .pif), + // wrap the name in quotes and launch it through the shell char *dot = strrchr(buff, '.'); if (dot != NULL && *(dot + 1) != 0) { @@ -397,7 +398,7 @@ class CUMDropTarget : public IDropTarget } */ - // pokud je v ceste znak $, musim ho nahradit $$ + // if the path contains the character $, replace it with $$ strcpy(tmp, buff); char* iterS = tmp; char* iterT = buff; @@ -419,7 +420,7 @@ class CUMDropTarget : public IDropTarget CUserMenuItem* item = new CUserMenuItem(name, buff, emptyBuffer, fullPathBuffer, emptyBuffer, shell, FALSE, FALSE, TRUE, umitItem, NULL); - // vyhledame misto, kam je treba polozku vlozit + // find the place where the item needs to be inserted int count = 0; int i; for (i = 0; i < MainWindow->UserMenuItems->Count; i++) @@ -440,12 +441,12 @@ class CUMDropTarget : public IDropTarget } MainWindow->UserMenuItems->Insert(i, item); - if (UserMenuIconBkgndReader.IsReadingIcons()) // probiha nacitani ikon = musime ho nahodit znovu, zmenil se pocet polozek v user menu (jako side-efekt to zahodi prave nactenou ikonu dropleho souboru, ale na to proste kaslu) + if (UserMenuIconBkgndReader.IsReadingIcons()) // icon loading is in progress, so restart it because the user menu item count changed (as a side effect this drops the icon just read for the dropped file, but that's acceptable) { CUserMenuIconDataArr* bkgndReaderData = new CUserMenuIconDataArr(); for (int i2 = 0; i2 < MainWindow->UserMenuItems->Count; i2++) MainWindow->UserMenuItems->At(i2)->GetIconHandle(bkgndReaderData, FALSE); - UserMenuIconBkgndReader.StartBkgndReadingIcons(bkgndReaderData); // POZOR: uvolni 'bkgndReaderData' + UserMenuIconBkgndReader.StartBkgndReadingIcons(bkgndReaderData); // WARNING: releases 'bkgndReaderData' } MainWindow->UMToolBar->CreateButtons(); @@ -513,8 +514,8 @@ CUserMenuBar::CUserMenuBar(HWND hNotifyWindow, CObjectOrigin origin) RemoveAllItems(); SetStyle(TLB_STYLE_IMAGE | (Configuration.UserMenuToolbarLabels ? TLB_STYLE_TEXT : 0)); - // naleju ikonky do vlastni toolbary - // vlozim pouze itemy a submenu z nejvyssi urovne; ostatni se bude rozbalovat jako submenu + // load icons into the toolbar + // insert only items and submenus from the top level; the rest will expand as submenus int level = 0; TLBI_ITEM_INFO2 tii; int i; @@ -574,7 +575,7 @@ CUserMenuBar::CUserMenuBar(HWND hNotifyWindow, CObjectOrigin origin) void CUserMenuBar::ToggleLabels() { CALL_STACK_MESSAGE1("CUserMenuBar::ToggleLabels()"); - // nastvim styl + // update the style DWORD style = GetStyle(); if (Configuration.UserMenuToolbarLabels) style &= ~TLB_STYLE_TEXT; @@ -587,7 +588,7 @@ void CUserMenuBar::ToggleLabels() int CUserMenuBar::GetNeededHeight() { CALL_STACK_MESSAGE_NONE - // i v pripade, ze nedrzime zadnou ikonu budeem vracet spravnou vysku + // return the correct height even when no icon is loaded int height = CToolBar::GetNeededHeight(); int iconSize = GetIconSizeForSystemDPI(ICONSIZE_16); int minH = 3 + iconSize + 3; @@ -599,7 +600,7 @@ int CUserMenuBar::GetNeededHeight() void CUserMenuBar::Customize() { CALL_STACK_MESSAGE_NONE - // nechame vybalit stranku UserMenu a rozeditovat polozku index + // open the UserMenu page and start editing the item at the given index PostMessage(MainWindow->HWindow, WM_USER_CONFIGURATION, 2, 0); } @@ -662,7 +663,7 @@ CUserMenuBar::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) { TRACE_E("RegisterDragDrop error."); } - dropTarget->Release(); // RegisterDragDrop volala AddRef() + dropTarget->Release(); // RegisterDragDrop called AddRef() } break; } From 4538370c1ac06206dd5b8bc7c21d976cd4cded4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 09:49:22 +0200 Subject: [PATCH 595/710] [translation] Initial src/toolbar6.cpp comments translation (#971) --- src/toolbar6.cpp | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/toolbar6.cpp b/src/toolbar6.cpp index 66048f77b..9b7de34c2 100644 --- a/src/toolbar6.cpp +++ b/src/toolbar6.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -24,7 +25,7 @@ CDriveBar::CDriveBar(HWND hNotifyWindow, CObjectOrigin origin) { CALL_STACK_MESSAGE_NONE List = NULL; - // tato inicializace je take ve WM_DESTROY, protoze okno se pouze zhasina a rozsveci + // Repeat this initialization in WM_DESTROY because the window only dims and lights up again. CheckedDrive[0] = 0; HDrivesIcons = NULL; HDrivesIconsGray = NULL; @@ -55,8 +56,8 @@ BOOL CDriveBar::CreateDriveButtons(CDriveBar* copyDrivesListFrom) if (HWindow == NULL) return FALSE; - // potlacime kresleni, abychom predesli mrkani checked polozky (staci otevrit a zavrit plugins manager a mrkalo by to) - // take jsme mrkali pri spusteni salamandera + // Suppress painting to avoid the checked item blinking (opening and closing the plugins manager would make it flicker). + // This also prevented flicker during Salamander startup. SendMessage(HWindow, WM_SETREDRAW, FALSE, 0); RemoveAllItems(); SetStyle(TLB_STYLE_IMAGE | TLB_STYLE_TEXT); @@ -111,7 +112,7 @@ BOOL CDriveBar::CreateDriveButtons(CDriveBar* copyDrivesListFrom) int CDriveBar::GetNeededHeight() { CALL_STACK_MESSAGE_NONE - // i v pripade, ze nedrzime zadnou ikonu budeem vracet spravnou vysku + // Return the correct height even when no icon is loaded. int height = CToolBar::GetNeededHeight(); int iconSize = GetIconSizeForSystemDPI(ICONSIZE_16); int minH = 3 + iconSize + 3; @@ -139,7 +140,7 @@ void CDriveBar::Execute(DWORD id) panel = MainWindow->GetActivePanel(); if (DriveType != drvtPluginCmd) - panel->TopIndexMem.Clear(); // dlouhy skok + panel->TopIndexMem.Clear(); // long jump char path[MAX_PATH]; switch (DriveType) @@ -147,15 +148,15 @@ void CDriveBar::Execute(DWORD id) case drvtMyDocuments: case drvtGoogleDrive: case drvtDropbox: - case drvtOneDrive: // bud primo tlacitko nebo vybrane z drop down menu - case drvtOneDriveBus: // bud primo tlacitko nebo vybrane z drop down menu + case drvtOneDrive: // either a direct button or selected from the drop-down menu + case drvtOneDriveBus: // either a direct button or selected from the drop-down menu { panel->ChangePathToDrvType(HWindow, DriveType, DriveType == drvtOneDriveBus ? (const char*)DriveTypeParam : NULL); if (DriveType == drvtOneDriveBus) free((char*)DriveTypeParam); if ((DriveType == drvtOneDrive || DriveType == drvtOneDriveBus) && !fromDropDown && GetOneDriveStorages() > 1) - { // OneDrive by zase mel byt drop down, provedeme refresh obou Drive bar, at se updatne tlacitko + { // OneDrive should once again be a drop-down; refresh both drive bars so the button is updated if (MainWindow != NULL && MainWindow->HWindow != NULL) PostMessage(MainWindow->HWindow, WM_USER_DRIVES_CHANGE, 0, 0); } @@ -166,7 +167,7 @@ void CDriveBar::Execute(DWORD id) TRACE_E("CDriveBar::Execute(): unexpected drive type: drvtOneDriveMenu"); return; - // jde o Network? + // is this Network? case drvtNeighborhood: { if (GetTargetDirectory(panel->HWindow, panel->HWindow, LoadStr(IDS_CHANGEDRIVE), @@ -192,10 +193,10 @@ void CDriveBar::Execute(DWORD id) case drvtPluginCmd: { - // kod prevzaty z fileswn3.cpp, CFilesWindow::ChangeDrive() + // code taken from fileswn3.cpp, CFilesWindow::ChangeDrive() const char* dllName = (const char*)DriveTypeParam; CPluginData* data = Plugins.GetPluginData(dllName); - if (data != NULL) // plug-in existuje, jdeme spustit prikaz + if (data != NULL) // the plugin exists, so run the command data->ExecuteChangeDriveMenuItem(panel == MainWindow->LeftPanel ? PANEL_LEFT : PANEL_RIGHT); return; } @@ -212,7 +213,7 @@ void CDriveBar::SetCheckedDrive(CFilesWindow* panel, BOOL force) if (isDiskOrArchive) lstrcpyn(CheckedDrive, panel->GetPath(), 3); else - CheckedDrive[0] = 0; // pro FS tato cache nefunguje + CheckedDrive[0] = 0; // this cache does not work for file systems DWORD index; if (List == NULL || !List->FindPanelPathIndex(panel, &index)) index = -1; @@ -231,7 +232,7 @@ void CDriveBar::SetCheckedDrive(CFilesWindow* panel, BOOL force) if (indexInList >= CM_DRIVEBAR2_MIN && indexInList <= CM_DRIVEBAR2_MAX) indexInList -= CM_DRIVEBAR2_MIN; else - indexInList = -2; // nemelo by se stat + indexInList = -2; // should not happen } CheckItem(i, TRUE, index == indexInList); } @@ -280,7 +281,7 @@ BOOL CDriveBar::OnContextMenu() if (indexInList >= CM_DRIVEBAR2_MIN && indexInList <= CM_DRIVEBAR2_MAX) indexInList -= CM_DRIVEBAR2_MIN; else - return FALSE; // nemelo by se stat + return FALSE; // should not happen } CFilesWindow* panel; BOOL bar2 = this == MainWindow->DriveBar2; @@ -294,13 +295,13 @@ BOOL CDriveBar::OnContextMenu() FromContextMenu = FALSE; const char* dllName = NULL; List->OnContextMenu(TRUE, indexInList, panel == MainWindow->LeftPanel ? PANEL_LEFT : PANEL_RIGHT, &dllName); - if (PostCmd != 0) // nastavuje se jen na drvtPluginFS a drvtPluginCmd, pricemz drvtPluginFS nemuze byt na Drive bare + if (PostCmd != 0) // set only for drvtPluginFS and drvtPluginCmd, and drvtPluginFS cannot be on the Drive bar { UpdateWindow(MainWindow->HWindow); CPluginData* data = Plugins.GetPluginData(dllName); - if (data != NULL) // plug-in existuje, jdeme spustit prikaz - { // post-cmd z kontextoveho menu polozky FS + if (data != NULL) // the plugin exists, so run the command + { // post-command from the context menu of an FS item data->GetPluginInterfaceForFS()->ExecuteChangeDrivePostCommand(panel == MainWindow->LeftPanel ? PANEL_LEFT : PANEL_RIGHT, PostCmd, PostCmdParam); } From db4f37ab6efe66cb13ff5970ffaa2647bb59d56a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 09:49:26 +0200 Subject: [PATCH 596/710] [translation] Initial src/toolbar7.cpp comments translation (#972) --- src/toolbar7.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/toolbar7.cpp b/src/toolbar7.cpp index a8cd29067..ad155d0a8 100644 --- a/src/toolbar7.cpp +++ b/src/toolbar7.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -35,8 +36,8 @@ CHotPathsBar::CHotPathsBar(HWND hNotifyWindow, CObjectOrigin origin) SetStyle(TLB_STYLE_IMAGE | TLB_STYLE_TEXT); - // naleju ikonky do vlastni toolbary - // vlozim pouze itemy a submenu z nejvyssi urovne; ostatni se bude rozbalovat jako submenu + // Load icons into the toolbar. + // Insert only top-level items and submenus; the rest expand as nested submenus. int level = 0; TLBI_ITEM_INFO2 tii; int i; @@ -106,7 +107,7 @@ CHotPathsBar::CHotPathsBar(HWND hNotifyWindow, CObjectOrigin origin) int CHotPathsBar::GetNeededHeight() { CALL_STACK_MESSAGE_NONE - // i v pripade, ze nedrzime zadnou ikonu budeem vracet spravnou vysku + // Return the correct height even when no icon is loaded. int height = CToolBar::GetNeededHeight(); int iconSize = GetIconSizeForSystemDPI(ICONSIZE_16); int minH = 3 + iconSize + 3; @@ -118,7 +119,7 @@ int CHotPathsBar::GetNeededHeight() void CHotPathsBar::Customize() { CALL_STACK_MESSAGE_NONE - // nechame vybalit stranku HotPaths + // Open the HotPaths page. PostMessage(MainWindow->HWindow, WM_USER_CONFIGURATION, 1, -1); } @@ -153,7 +154,7 @@ CHotPathsBar::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) { TRACE_E("RegisterDragDrop error."); } - dropTarget->Release(); // RegisterDragDrop volala AddRef() + dropTarget->Release(); // RegisterDragDrop called AddRef(). } break; } From c219b2c8491dc6d0f4554008bb3ceb865fe44068 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 09:49:29 +0200 Subject: [PATCH 597/710] [translation] Initial src/toolbar8.cpp comments translation (#973) --- src/toolbar8.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/toolbar8.cpp b/src/toolbar8.cpp index 30bddb54f..04b0614dd 100644 --- a/src/toolbar8.cpp +++ b/src/toolbar8.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -70,7 +71,7 @@ BOOL CPluginsBar::CreatePluginButtons() tii.Mask = TLBI_MASK_STYLE | TLBI_MASK_IMAGEINDEX | TLBI_MASK_ID; tii.Style = TLBI_STYLE_WHOLEDROPDOWN | TLBI_STYLE_DROPDOWN; tii.ImageIndex = i; - tii.ID = CM_PLUGINCMD_MIN + i; // do mainwnd3 prijde jako WM_USER_TBDROPDOWN + tii.ID = CM_PLUGINCMD_MIN + i; // mainwnd3 receives it as WM_USER_TBDROPDOWN. InsertItem2(0xFFFFFFFF, TRUE, &tii); } */ @@ -81,7 +82,7 @@ BOOL CPluginsBar::CreatePluginButtons() int CPluginsBar::GetNeededHeight() { CALL_STACK_MESSAGE_NONE - // i v pripade, ze nedrzime zadnou ikonu budeem vracet spravnou vysku + // Return the correct height even when no icon is loaded. int height = CToolBar::GetNeededHeight(); int iconSize = GetIconSizeForSystemDPI(ICONSIZE_16); int minH = 3 + iconSize + 3; @@ -93,7 +94,7 @@ int CPluginsBar::GetNeededHeight() void CPluginsBar::Customize() { CALL_STACK_MESSAGE_NONE - // zobrazim okno Plugins + // Open the Plugins window. PostMessage(MainWindow->HWindow, WM_COMMAND, CM_CUSTOMIZEPLUGINS, 0); } From 9209f1c21263f1c3e4542c324cee2a9707d9f502 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 09:49:33 +0200 Subject: [PATCH 598/710] [translation] Initial src/tooltip.cpp comments translation (#974) --- src/tooltip.cpp | 93 +++++++++++++++++++++++++------------------------ 1 file changed, 47 insertions(+), 46 deletions(-) diff --git a/src/tooltip.cpp b/src/tooltip.cpp index 9132cc6a0..7102343ba 100644 --- a/src/tooltip.cpp +++ b/src/tooltip.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -13,10 +14,10 @@ // CToolTip // -//nahrazeno metodou GetTime() -//#define TOOLTIP_SHOWDELAY 1000 // [ms] doba pred otevrenim tool tipu pri kurzoru nad jenim ID z jendnoho okna -//#define TOOLTIP_HIDEDELAY 80 // [ms] (krat 100) doba pred zhasnutim tool tipu, pokud ho nesejme neco jineho -#define TOOLTIP_KILLDELAY 300 // [ms] jak dlouho vydrzime, nez prejdeme do Killed rezimu (pro prechod pres separatory) +// Replaced by the GetTime() method. +//#define TOOLTIP_SHOWDELAY 1000 // [ms] delay before opening the tooltip when the cursor is over a single ID in one window +//#define TOOLTIP_HIDEDELAY 80 // [ms] (times 100) delay before hiding the tooltip if nothing else dismisses it +#define TOOLTIP_KILLDELAY 300 // [ms] how long we wait before switching to the Killed state (when crossing separators) CToolTip* ToolTip = NULL; @@ -48,7 +49,7 @@ CToolTip::~CToolTip() CALL_STACK_MESSAGE_NONE if (HWindow != NULL) { - // prekrocime hranici threadu a zhazneme tooltip v threadu, ve kterem byl otevren + // Cross the thread boundary and shut down the tooltip in the thread where it was opened. SendMessage(HWindow, WM_USER_HIDETOOLTIP, 0, 0); } } @@ -86,9 +87,9 @@ BOOL CToolTip::Create(HWND hParent) if (HWindow != NULL) { - if (IsWindowVisible(HWindow)) // pokud uz je okno skryte, nebudeme varovat, protoze jde o doruceni odlozene zpravy a nasledne by bylo okno destruovano, viz CToolTip::MessageLoop() + if (IsWindowVisible(HWindow)) // if the window is already hidden, do not warn because a deferred message is being delivered and the window would be destroyed afterward; see CToolTip::MessageLoop() TRACE_E("CToolTip::Create() Tooltip window already exists!"); - // prekrocime hranici threadu a zhasneme tooltip v threadu, ve kterem byl otevren + // Cross the thread boundary and shut down the tooltip in the thread where it was opened. SendMessage(HWindow, WM_USER_HIDETOOLTIP, 0, 0); } @@ -116,15 +117,15 @@ BOOL CToolTip::Create(HWND hParent) DWORD CToolTip::GetTime(BOOL init) { - // casy viz MSDN/TTM_SETDELAYTIME + // timings per MSDN/TTM_SETDELAYTIME if (init) return GetDoubleClickTime(); else return (GetDoubleClickTime() * 10) / 100; } -// jediny zpusob, ktery jsem vykoumal pro detekci vysky kurzoru -// je nakresleni masky kurzoru do DIBu a nasledne prohledani bitoveho pole +// The only method I devised for detecting cursor height +// is drawing the cursor mask into a DIB and then scanning the bit field. BOOL GetCursorHeight(HCURSOR hCursor) { if (hCursor == 0) @@ -137,7 +138,7 @@ BOOL GetCursorHeight(HCURSOR hCursor) bi.bmiHeader.biWidth = 32; bi.bmiHeader.biHeight = 32; bi.bmiHeader.biPlanes = 1; - bi.bmiHeader.biBitCount = 1; // kazdy radek bude reprezentovan 32 bity + bi.bmiHeader.biBitCount = 1; // each row is represented by 32 bits. bi.bmiHeader.biCompression = BI_RGB; bi.bmiHeader.biClrUsed = 0; bi.bmiHeader.biClrImportant = 0; @@ -148,9 +149,9 @@ BOOL GetCursorHeight(HCURSOR hCursor) DrawIconEx(hMemDC, 0, 0, hCursor, 0, 0, 0, NULL, DI_MASK | DI_DEFAULTSIZE); SelectObject(hMemDC, hOldBitmap); - GdiFlush(); // Flush the GDI batch, so we can play with the bits + GdiFlush(); // Flush the GDI batch so we can work with the bits. - // bitmapa ulozena od poslendi scanline smerem k nulte + // The bitmap is stored from the last scanline toward the first. int i; for (i = 0; i < 32; i++) { @@ -223,14 +224,14 @@ void CToolTip::MessageLoop() ShowWindow(HWindow, SW_HIDE); IsModal = FALSE; - // nase okno bylo captured, vsechny zpravy jsme dostali my - // ted bychom potreboali dorucit posledni zpravu adresatovi + // our window captured the input; we received all messages + // now we need to deliver the last message to the recipient if (msg.message == WM_LBUTTONDOWN || msg.message == WM_RBUTTONDOWN || msg.message == WM_MBUTTONDOWN) { HWND hWindow = WindowFromPoint(msg.pt); if (hWindow != NULL && hWindow != HWindow && - GetWindowThreadProcessId(hWindow, NULL) == GetCurrentThreadId()) // SendMessage(hWindow, WM_NCHITTEST do jineho threadu zpusoboval deadlock + GetWindowThreadProcessId(hWindow, NULL) == GetCurrentThreadId()) // SendMessage(hWindow, WM_NCHITTEST to another thread caused a deadlock { POINT p; p.x = GET_X_LPARAM(msg.lParam); @@ -258,15 +259,15 @@ void CToolTip::MessageLoop() msg.lParam = MAKELPARAM(p.x, p.y); msg.hwnd = hWindow; - // dame prilezitost dialogu, aby si nastavil default push button + // give the dialog a chance to set its default push button HWND hDialog = GetTopVisibleParent(hWindow); if (hDialog != NULL) { DWORD pid; GetWindowThreadProcessId(hDialog, &pid); - // zpravu nesmime dorucit do jineho procesu, - // jinak nam padal Salamander v USER32.DLL + // we must not deliver the message to another process, + // otherwise Salamander crashed in USER32.DLL if (pid == GetCurrentProcessId()) { if (hDialog == NULL || !IsDialogMessage(hDialog, &msg)) @@ -278,10 +279,10 @@ void CToolTip::MessageLoop() } } } - //IsModal = FALSE; // zde uz je pozde, nefunguje potom preklikavani mezi dvema tooltipama, napr Config > Change Drive Menu dialog + //IsModal = FALSE; // too late here; switching between two tooltips stops working, e.g. Config > Change Drive Menu dialog HNotifyWindow = NULL; LastID = 0; - Hide(); // IsModal uze je FALSE, muzeme zavolat Hide() + Hide(); // IsModal is already FALSE, we can call Hide() if (msg.message == WM_KEYDOWN && msg.wParam == VK_TAB) { HWND hDialog = GetForegroundWindow(); @@ -303,7 +304,7 @@ BOOL CToolTip::GetText() } if (TextLen == 0) { - // neobdrzeli jsme text - zhasneme minuly tooltip a vypadneme + // we did not receive text - hide the previous tooltip and exit if (HWindow != NULL) Hide(); return FALSE; @@ -332,12 +333,12 @@ BOOL CToolTip::Show(int x, int y, BOOL considerCursor, BOOL modal, HWND hParent) { CALL_STACK_MESSAGE1("CToolTip::Show()"); - // vytahneme text z okna + // pull the text from the window TextLen = 0; if (GetText()) { - // merime text + // measure the text SIZE sz; GetNeededWindowSize(&sz); @@ -345,9 +346,9 @@ BOOL CToolTip::Show(int x, int y, BOOL considerCursor, BOOL modal, HWND hParent) if (considerCursor) y += GetCursorHeight(GetCursor()); if (HWindow != NULL) - Hide(); // zhasneme predchozi tooltip + Hide(); // hide the previous tooltip - // zajistime viditelnost tooltipu na obrazovce + // ensure the tooltip remains visible on the screen RECT r, clipRect; r.left = x; r.right = x + 1; @@ -359,7 +360,7 @@ BOOL CToolTip::Show(int x, int y, BOOL considerCursor, BOOL modal, HWND hParent) if (x + sz.cx > clipRect.right) x = clipRect.right - sz.cx; if (y + sz.cy > clipRect.bottom) - y = oldY - sz.cy; // tooltip umistime nad kurzor + y = oldY - sz.cy; // place the tooltip above the cursor if (x < clipRect.left) x = 0; if (y < clipRect.top) @@ -388,7 +389,7 @@ void CToolTip::Hide() } else if (HWindow != NULL) { - // prekrocime hranici threadu a zhazneme tooltip v threadu, ve kterem byl otevren + // Cross the thread boundary and shut down the tooltip in the thread where it was opened. SendMessage(HWindow, WM_USER_HIDETOOLTIP, 0, 0); } } @@ -423,14 +424,14 @@ void CToolTip::SetCurrentToolTip(HWND hNotifyWindow, DWORD id, int showDelay) { CALL_STACK_MESSAGE2("CToolTip::SetCurrentToolTip(, 0x%X)", id); if (IsModal) - return; // behem modalniho tooltipu nebereme toto volani + return; // ignore this call during a modal tooltip HWND hOldNotifyWindow = HNotifyWindow; HNotifyWindow = hNotifyWindow; DWORD oldLastID = LastID; LastID = id; - // zabranime nechtenemu zobrazeni tooltipu pri prepnuti do okna + // prevent unwanted tooltip display when switching into a window POINT currentPos; GetCursorPos(¤tPos); BOOL sameCursorPos = (currentPos.x == LastCursorPos.x && currentPos.y == LastCursorPos.y); @@ -448,7 +449,7 @@ void CToolTip::SetCurrentToolTip(HWND hNotifyWindow, DWORD id, int showDelay) } if (hOldNotifyWindow != HNotifyWindow) { - // zmenilo se okno - sestrelim casovac a zhasnu + // the window changed - kill the timer and hide it if (WaitingMode != ttmNone) { WaitingMode = ttmNone; @@ -467,7 +468,7 @@ void CToolTip::SetCurrentToolTip(HWND hNotifyWindow, DWORD id, int showDelay) DWORD pos = GetMessagePos(); if (Show(GET_X_LPARAM(pos), GET_Y_LPARAM(pos), TRUE, FALSE, HNotifyWindow)) { - // pokud se podarilo text zobrazit, zacneme cekat na jeho zhasnuti + // if the text was displayed, start waiting for it to fade WaitingMode = ttmWaitingClose; MySetTimer(GetTime(FALSE)); HideCounter = 0; @@ -476,7 +477,7 @@ void CToolTip::SetCurrentToolTip(HWND hNotifyWindow, DWORD id, int showDelay) { if (WaitingMode != ttmWaitingKill) { - // text nebyl dodan - nahodime cekani na KILL + // text was not delivered - start the wait for KILL WaitingMode = ttmWaitingKill; MySetTimer(TOOLTIP_KILLDELAY); } @@ -486,7 +487,7 @@ void CToolTip::SetCurrentToolTip(HWND hNotifyWindow, DWORD id, int showDelay) { if (HNotifyWindow == hOldNotifyWindow && LastID == oldLastID && WaitingMode == ttmNone) return; - // jinak nahodim (pripadne znovu nastavime) casovac + // otherwise start (or restart) the timer if (showDelay >= 0) { if (showDelay == 0) @@ -521,7 +522,7 @@ void CToolTip::OnTimer() { case ttmNone: { - // jak je mozne, ze nam prisel timer, kdyz podle stavove promenne nema zadny bezet + // how could we get a timer when the state variable says none should run TRACE_E("WaitingMode == ttmNone"); break; } @@ -532,20 +533,20 @@ void CToolTip::OnTimer() POINT p; GetCursorPos(&p); HWND hWnd = WindowFromPoint(p); - if (hWnd == HNotifyWindow) // musime stale byt na notify oknem + if (hWnd == HNotifyWindow) // we must still be on the notify window { - if (HasActiveParent(hWnd)) // a jeho root musi byt aktivni + if (HasActiveParent(hWnd)) // the root window must also be active { if (Show(p.x, p.y, TRUE, FALSE, HNotifyWindow)) { - // pokud se podarilo text zobrazit, zacneme cekat na jeho zhasnuti + // if the text was displayed, start waiting for it to fade WaitingMode = ttmWaitingClose; MySetTimer(GetTime(FALSE)); HideCounter = 0; } else { - // text nebyl dodan - nahodime cekani na KILL + // text was not delivered - start the wait for KILL WaitingMode = ttmWaitingKill; MySetTimer(TOOLTIP_KILLDELAY); } @@ -561,7 +562,7 @@ void CToolTip::OnTimer() case ttmWaitingClose: { - // zkontroluju, jestli neni treba zhasnout tooltip + // check whether it is time to hide the tooltip POINT p; GetCursorPos(&p); HWND hWnd = WindowFromPoint(p); @@ -570,8 +571,8 @@ void CToolTip::OnTimer() if (hWnd != HNotifyWindow || HideCounter == HideCounterMax) { Hide(); - // pokud slo o zhasnuti diky time-outu, necham timer jeste bezet - // po dobu, nez mys opusti okno nebo dojde k voalni SetCurrentToolTip + // if it was hidden due to a timeout, keep the timer running + // until the mouse leaves the window or SetCurrentToolTip is called if (hWnd != HNotifyWindow) { WaitingMode = ttmNone; @@ -613,11 +614,11 @@ CToolTip::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) { case WM_USER_REFRESHTOOLTIP: { - // musime zachovat stavajici okenko -- pouze ho natahnem pro novy text + // we must keep the existing window—just stretch it for the new text if (GetText()) { SIZE sz; - GetNeededWindowSize(&sz); // kaslem na osetreni vylezeni z obrazovky + GetNeededWindowSize(&sz); // ignore handling for climbing off the screen SetWindowPos(HWindow, NULL, 0, 0, sz.cx, sz.cy, SWP_NOACTIVATE | SWP_NOMOVE); InvalidateRect(HWindow, NULL, TRUE); UpdateWindow(HWindow); @@ -627,7 +628,7 @@ CToolTip::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_ERASEBKGND: { - // podmazeme a soucasne vykreslime text + // fill the background and draw the text at the same time HDC hDC = (HDC)wParam; RECT r; GetClientRect(HWindow, &r); @@ -646,7 +647,7 @@ CToolTip::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_PAINT: { - // nedelame nic - vse je zarizeno v WM_ERASEBKGND + // do nothing - everything is handled in WM_ERASEBKGND PAINTSTRUCT ps; HANDLES(BeginPaint(HWindow, &ps)); HANDLES(EndPaint(HWindow, &ps)); From b133e77860d37eeb9f91a6bdf0ffe2f86b8232c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 09:49:36 +0200 Subject: [PATCH 599/710] [translation] Initial src/tooltip.h comments translation (#975) --- src/tooltip.h | 103 +++++++++++++++++++++++++------------------------- 1 file changed, 51 insertions(+), 52 deletions(-) diff --git a/src/tooltip.h b/src/tooltip.h index 8d1bf6262..9907fec88 100644 --- a/src/tooltip.h +++ b/src/tooltip.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once @@ -7,41 +8,40 @@ // // CToolTip // -// Tento tooltip ma odstranit zakladni nevyhodu puvodni koncepce tooltipu. -// Kazde okno melo vytvoreny vlastni tooltip objekt. Druha nevyhoda byla, -// ze bylo nutne tomuto objektu predavat seznam oblasti, nad kteryma se -// maji tooltipy vybalit. +// This tooltip is supposed to eliminate the basic drawback of the original tooltip concept. +// Each window had its own tooltip object created. The second drawback was that we had +// to pass this object a list of regions over which the tooltips were supposed to pop up. // -// Nova koncepce: CMainWindow bude vlastnit pouze jeden tooltip (instanci objektu). -// Okno tooltipu se vytvari az ve chvili kdy je potreba a to v threadu, ktery -// o zobrazeni pozadal. Duvod: potrebujeme, aby okno tooltipu v tomto threadu bezelo, -// do 2.6b6 vcetne bezelo okenko tooltipu v hlavnim threadu Salamandera a pokud -// ten stal, tooltipy se nezobrazovaly. -// Pri pohybu mysi nad controlem, ktery bude pouzivat tento tooltip, bude control -// pri vstupu do nove oblasti volat metodu SetCurrentID. +// New concept: CMainWindow owns only one tooltip (a single object instance). +// The tooltip window is created only at the moment when it is needed and in the thread +// that requested the display. Reason: we need the tooltip window to run in this thread. +// Up to version 2.6b6 inclusive the tooltip window ran in Salamander's main thread, and if that +// thread stopped, the tooltips were not displayed. When the mouse moves over a control +// that will use this tooltip, the control calls the SetCurrentID method whenever it enters +// a new region. // -// Rozhrani pro praci s tooltipem bude v const.h, aby bylo dostupnem vsem -// controlum bez nutnosti includit mainwnd.h a tooltip.h. +// The interface for working with the tooltip is declared in const.h so that all controls +// can use it without having to include mainwnd.h and tooltip.h. // -// Pouzivane zpravy: -// WM_USER_TTGETTEXT - slouzi k dotazu na text s urcitym ID -// wParam = ID predany pri SetCurrentToolTip -// lParam = buffer (ukazuje do bufferu tooltipu) maxilmani pocet znaku je TOOLTIP_TEXT_MAX -// pred volanim teto message je na nulty znak vlozen terminator -// text muze obsahovat \n pro prechod na novy radek a \t pro vlozeni tabem -// pokud okno zapise do bufferu retezec terminovany nulou, bude zobrazen v tooltipu -// jinak nebude tooltip zobrazen +// Messages used: +// WM_USER_TTGETTEXT - used to request the text with a specific ID +// wParam = ID passed to SetCurrentToolTip +// lParam = buffer (points to the tooltip buffer); the maximum number of characters is TOOLTIP_TEXT_MAX +// before calling this message, the zeroth character is filled with the terminator +// the text can contain \n to move to a new line and \t to insert a tab +// If the window writes a null-terminated string into the buffer, the tooltip will show it; +// otherwise the tooltip will not be shown. // class CToolTip : public CWindow { enum TipTimerModeEnum { - ttmNone, // nebezi zadny casovac - ttmWaitingOpen, // ceka se na otevreni tool tipu - ttmWaitingClose, // ceka se na zavreni tool tipu - ttmWaitingKill, // ceka se na vystup z rezimu zobrazovani + ttmNone, // no timer is running + ttmWaitingOpen, // waiting for the tooltip to open + ttmWaitingClose, // waiting for the tooltip to close + ttmWaitingKill, // waiting to exit the display mode }; protected: @@ -53,9 +53,9 @@ class CToolTip : public CWindow DWORD HideCounter; DWORD HideCounterMax; POINT LastCursorPos; - BOOL IsModal; // je prave vykonvana nase message loop? - BOOL ExitASAP; // zavri se co nejdriv a prestan byt modalni - UINT_PTR TimerID; // vracene ze SetTimer, potrebujeme pro KillTimer + BOOL IsModal; // is our message loop running right now? + BOOL ExitASAP; // close as soon as possible and stop being modal + UINT_PTR TimerID; // returned from SetTimer, we need it for KillTimer public: CToolTip(CObjectOrigin origin = ooStatic); @@ -63,37 +63,36 @@ class CToolTip : public CWindow BOOL RegisterClass(); - // hParent je nezbytny, aby se pri jeho zavreni zavrel take tooltip - // bez nej se nam delo, ze skoncil thread parenta, ale okno tooltipu zustalo - // otevrene, ale uz neslo zavrit (neexistoval jeho thread) -> pady pri - // ukonceni Salamandera (nastesti to bylo pred release 2.5b7) + // hParent is necessary so that the tooltip closes together with it. + // Without it we had cases where the parent's thread finished, but the tooltip window stayed + // open and could no longer be closed (its thread no longer existed) -> crashes when + // Salamander exited (fortunately before release 2.5b7). BOOL Create(HWND hParent); - // Tato metoda spusti casovac a pokud do jeho vyprseni neni zavolana znovu - // pozada okno 'hNotifyWindow' o text pomoci zpravy WM_USER_TTGETTEXT, - // ktery pak zobrazi pod kurzor na jeho aktualnich souradnicich. - // Promenna 'id' slouzi k rozliseni oblasti pri komunikaci s oknem 'hNotifyWindow'. - // Pokud bude tato metoda zavolana vicekrat se stejnym parametrem 'id', budou - // se tyto dalsi volani ignorovat. - // Hodnota 0 parametru 'hNotifyWindow' je vyhrazena pro zhasnuti okna a preruseni - // beziciho casovace. - // parametr 'showDelay' ma vyznam pokud je 'hNotifyWindow' != NULL - // pokud je vetsi nebo roven 1, urcuje za jak dlouho dojde ke zobrazeni tooltipu v [ms] - // pokud je roven 0, pouzije se implicitni prodleva - // pokud je -1, casovac se vubec nenastartuje + // This method starts a timer and, unless it is called again before the timer expires, + // asks the 'hNotifyWindow' window for the text through the WM_USER_TTGETTEXT message and then + // shows it under the cursor at its current coordinates. + // The 'id' parameter identifies the region when communicating with the 'hNotifyWindow' window. + // If the method is called more than once with the same 'id' parameter, the additional calls are ignored. + // The value 0 for the 'hNotifyWindow' parameter is reserved for hiding the window and stopping + // the running timer. + // The 'showDelay' parameter matters if 'hNotifyWindow' != NULL: + // if it is greater than or equal to 1, it specifies the delay before the tooltip is shown [ms] + // if it equals 0, the default delay is used + // if it is -1, the timer is not started at all void SetCurrentToolTip(HWND hNotifyWindow, DWORD id, int showDelay); - // potlaci zobrazeni tooltipu na aktualnich souradnicich mysi - // uzitecne volat pri aktivaci okna, ve kterem se tooltipy pouzivaji - // nebude tak dochazet k nechtenemu zobrazeni tooltipu + // Suppresses showing the tooltip at the current mouse coordinates. + // Useful to call when activating a window in which tooltips are used, + // so there will not be unintended tooltip displays. void SuppressToolTipOnCurrentMousePos(); - // pokud se podari text zobrazit, vrati TRUE; pokud neni dodan novy text, vrati FALSE - // pokud je considerCursor==TRUE, omeri kurzor a posune tooltip pod nej - // pokud je modal==TRUE, spusti messageloop, ktera hlida zpravy pro zavreni tooltipu a vrati se az po jeho zhasnuti + // Returns TRUE if the text is shown; returns FALSE if no new text was supplied. + // If considerCursor==TRUE, it checks the cursor and moves the tooltip below it. + // If modal==TRUE, it starts a message loop that watches for messages to close the tooltip and returns only after it is hidden. BOOL Show(int x, int y, BOOL considerCursor, BOOL modal, HWND hParent); - // zhasne tooltip + // extinguishes the tooltip void Hide(); void OnTimer(); @@ -104,7 +103,7 @@ class CToolTip : public CWindow BOOL GetText(); void GetNeededWindowSize(SIZE* sz); - void MessageLoop(); // pro modalni variantu tooltipu + void MessageLoop(); // for the modal tooltip variant void MySetTimer(DWORD elapse); void MyKillTimer(); From a2731e6b9cf3e99da3428789bef3ec6467d7146b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 09:49:40 +0200 Subject: [PATCH 600/710] [translation] Initial src/usermenu.h comments translation (#976) --- src/usermenu.h | 83 +++++++++++++++++++++++++------------------------- 1 file changed, 42 insertions(+), 41 deletions(-) diff --git a/src/usermenu.h b/src/usermenu.h index 586b6f465..30beeb66f 100644 --- a/src/usermenu.h +++ b/src/usermenu.h @@ -1,10 +1,11 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once -#define USRMNUARGS_MAXLEN 32772 // velikost bufferu (+1 proti maximalni delce stringu) (=32776 (Vista/Win7 pres .bat) - 5 ("C:\\a ") + 1) -#define USRMNUCMDLINE_MAXLEN 32777 // velikost bufferu (+1 proti maximalni delce stringu) +#define USRMNUARGS_MAXLEN 32772 // buffer size (+1 compared to the maximum string length) (=32776 (Vista/Win7 via .bat) - 5 ("C:\\a ") + 1) +#define USRMNUCMDLINE_MAXLEN 32777 // buffer size (+1 compared to the maximum string length) //**************************************************************************** // @@ -13,11 +14,11 @@ struct CUserMenuIconData { - char FileName[MAX_PATH]; // jmeno souboru, ze ktereho mame cist ikonu z indexu IconIndex (pres ExtractIconEx()) - DWORD IconIndex; // viz komentar k FileName - char UMCommand[MAX_PATH]; // jmeno souboru, ze ktereho mame cist ikonu (pres GetFileOrPathIconAux()) + char FileName[MAX_PATH]; // name of the file from which we should read the icon at IconIndex (via ExtractIconEx()) + DWORD IconIndex; // see the comment for FileName + char UMCommand[MAX_PATH]; // name of the file from which we should read the icon (via GetFileOrPathIconAux()) - HICON LoadedIcon; // NULL = nenactena ikona, jinak handle nactene ikony + HICON LoadedIcon; // NULL = icon not loaded, otherwise handle of the loaded icon CUserMenuIconData(const char* fileName, DWORD iconIndex, const char* umCommand); ~CUserMenuIconData(); @@ -28,7 +29,7 @@ struct CUserMenuIconData class CUserMenuIconDataArr : public TIndirectArray { protected: - DWORD IRThreadID; // unikatni ID threadu pro nacitani techto ikon + DWORD IRThreadID; // unique thread ID for loading these icons public: CUserMenuIconDataArr() : TIndirectArray(50, 50) { IRThreadID = 0; } @@ -42,45 +43,45 @@ class CUserMenuIconDataArr : public TIndirectArray class CUserMenuIconBkgndReader { protected: - BOOL SysColorsChanged; // pomocna promenna pro zjisteni zmeny systemovych barev od okamziku otevreni cfg dialogu + BOOL SysColorsChanged; // helper variable to detect changes in system colors since the config dialog opened - CRITICAL_SECTION CS; // sekce pro pristup k datum objektu - DWORD IconReaderThreadUID; // generator unikatnich ID threadu pro cteni ikon - BOOL CurIRThreadIDIsValid; // TRUE = thread bezi a CurIRThreadID je platne - DWORD CurIRThreadID; // unikatni ID threadu (viz IconReaderThreadUID), ve kterem se ctou ikony pro aktualni verzi user-menu - BOOL AlreadyStopped; // TRUE = uz zadne cteni ikon, hlavni okno se zavrelo/zavira + CRITICAL_SECTION CS; // critical section protecting the object's data + DWORD IconReaderThreadUID; // generator of unique thread IDs for reading icons + BOOL CurIRThreadIDIsValid; // TRUE = the thread is running and CurIRThreadID is valid + DWORD CurIRThreadID; // unique thread ID (see IconReaderThreadUID) that loads icons for the current user menu version + BOOL AlreadyStopped; // TRUE = no more icon reading; the main window has closed/is closing - int UserMenuIconsInUse; // > 0: ikony z user menu jsou prave v otevrenem menu, nemuzeme je hned updatnout na nove ikony; muze byt nejvys 2 (cfg Salama + Find: user menu) - CUserMenuIconDataArr* UserMenuIIU_BkgndReaderData; // uschovna novych ikon pri UserMenuIconsInUse > 0 - DWORD UserMenuIIU_ThreadID; // uschovna ID threadu (pro zjisteni aktualnosti dat) pri UserMenuIconsInUse > 0 + int UserMenuIconsInUse; // > 0: user menu icons are currently in an open menu, so we cannot update them immediately; at most 2 (Salamander cfg + Find: user menu) + CUserMenuIconDataArr* UserMenuIIU_BkgndReaderData; // storage for new icons when UserMenuIconsInUse > 0 + DWORD UserMenuIIU_ThreadID; // storage for thread IDs (to determine data freshness) when UserMenuIconsInUse > 0 public: CUserMenuIconBkgndReader(); ~CUserMenuIconBkgndReader(); - // hlavni okno se zavira = uz nechceme prijimat zadna data o ikonach v user menu + // The main window is closing -> we no longer want to receive any user menu icon data. void EndProcessing(); - // POZOR: uvnitr se dealokuje 'bkgndReaderData' + // WARNING: 'bkgndReaderData' is deallocated inside. void StartBkgndReadingIcons(CUserMenuIconDataArr* bkgndReaderData); BOOL IsCurrentIRThreadID(DWORD threadID); BOOL IsReadingIcons(); - // POZOR: po volani teto funkce je za uvolneni 'bkgndReaderData' zodpovedny tento objekt + // WARNING: after calling this function this object is responsible for freeing 'bkgndReaderData'. void ReadingFinished(DWORD threadID, CUserMenuIconDataArr* bkgndReaderData); - // vstup/vystup do sekce, kde se pouzivaji ikony z user menu a tedy neni je mozne - // behem provadeni teto sekce updatit (hlavne jde o otevreni user menu) + // Enter/leave the section where user menu icons are being used and therefore cannot + // be updated while the section is executing (mainly when opening the user menu). void BeginUserMenuIconsInUse(); void EndUserMenuIconsInUse(); - // pokud se nacetly ikony pro jiz neaktualni user menu, vraci FALSE, jinak: - // pokud jsou ikony prave v otevrenem menu (viz UserMenuIconsInUse), vraci FALSE; - // pokud nejsou ikony prave v otevrenem menu, vraci TRUE a POZOR: neopusti CS, - // aby byl blokovany pristup z ostatnich threadu (hlavne pristup k user menu z threadu - // Findu), pro vystup z CS po updatu ikon se pouziva LeaveCSAfterUMIconsUpdate() + // If icons for an already outdated user menu were loaded, returns FALSE. Otherwise: + // if the icons are currently in an open menu (see UserMenuIconsInUse), returns FALSE; + // if the icons are not in an open menu, returns TRUE and WARNING: keeps the CS locked, + // so access from other threads is blocked (mainly access to the user menu from the Find thread). + // After updating the icons, use LeaveCSAfterUMIconsUpdate() to exit the CS. BOOL EnterCSIfCanUpdateUMIcons(CUserMenuIconDataArr** bkgndReaderData, DWORD threadID); void LeaveCSAfterUMIconsUpdate(); @@ -98,10 +99,10 @@ extern CUserMenuIconBkgndReader UserMenuIconBkgndReader; enum CUserMenuItemType { - umitItem, // klasicka polozka - umitSubmenuBegin, // oznacuje zacatek popupu - umitSubmenuEnd, // oznacuje konec popupu - umitSeparator // oznacuje konec popupu + umitItem, // standard item + umitSubmenuBegin, // marks the start of a submenu + umitSubmenuEnd, // marks the end of a submenu + umitSeparator // separator item }; struct CUserMenuItem @@ -131,17 +132,17 @@ struct CUserMenuItem ~CUserMenuItem(); - // pokusi se vytahnout handle ikony v tomto poradi - // a) promenne Icon + // Tries to retrieve the icon handle in this order + // a) the Icon variable // b) SHGetFileInfo - // c) veme default ze systemu - // cteni ikon na pozadi: je-li 'bkgndReaderData' NULL, cteme hned, jinak se ikony - // ctou na pozadi - je-li 'getIconsFromReader' FALSE, sbirame do 'bkgndReaderData', - // co nacist, je-li TRUE, ikony uz jsou nactene a jen prevezmeme handly nactenych - // ikon z 'bkgndReaderData' + // c) takes the system default + // Reading icons in the background: if 'bkgndReaderData' is NULL, we read immediately; otherwise the icons + // are read in the background. If 'getIconsFromReader' is FALSE, we collect what to load into 'bkgndReaderData'. + // If it is TRUE, the icons are already loaded and we simply take over the handles of the loaded icons + // from 'bkgndReaderData'. BOOL GetIconHandle(CUserMenuIconDataArr* bkgndReaderData, BOOL getIconsFromReader); - // prohleda ItemName na & a vrati HotKey a TRUE kdyz ji najde + // Searches ItemName for '&' and returns HotKey; returns TRUE if one is found. BOOL GetHotKey(char* key); BOOL Set(char* name, char* umCommand, char* arguments, char* initDir, char* icon); @@ -161,10 +162,10 @@ class CUserMenuItems : public TIndirectArray CUserMenuItems(DWORD base, DWORD delta, CDeleteType dt = dtDelete) : TIndirectArray(base, delta, dt) {} - // nakopci seznam ze 'source' + // Copies the list from 'source'. BOOL LoadUMI(CUserMenuItems& source, BOOL readNewIconsOnBkgnd); - // hleda posledni (zaviraci) polozku submenu adresovaneho promennou 'index' - // pokud ukonecni nenajde, vrati -1 + // Searches for the closing submenu item referenced by the 'index' variable. + // Returns -1 if no closing item is found. int GetSubmenuEndIndex(int index); }; From cff1767466c64a1c73f1e5fc18d39bab9b178c3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 11:33:30 +0200 Subject: [PATCH 601/710] [translation] Fix src/tooltip.cpp comments Refines translated comments in src/tooltip.cpp. Model: OpenAI GPT-5.4 Verification: Full OSTranslation sequential review pipeline with requested review mode `codex`, actual review providers `codex`, `--prompt-log-mode summary`, `--copilot-event-log summary`, AST grounding through clang, Codex model `gpt-5.4` with `--codex-reasoning medium`, Copilot model `gpt-5.4`, and `--copilot-reasoning high`. 50 comment units, 50 review results, 50 resolved results, and 50 apply results. Branch-target comment guard passed for `src/tooltip.cpp` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. `git diff --check -- src/tooltip.cpp` completed without diff integrity failures. Telemetry: Cumulative across all provider stages: 7 provider calls, 23208 estimated tokens, and 0 billing units. Review stage actual providers: Codex-family 4 calls, 19091 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. Non-review stages: Codex-family 3 calls, 4117 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. --- src/tooltip.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/tooltip.cpp b/src/tooltip.cpp index 7102343ba..d0a48cad4 100644 --- a/src/tooltip.cpp +++ b/src/tooltip.cpp @@ -124,8 +124,8 @@ CToolTip::GetTime(BOOL init) return (GetDoubleClickTime() * 10) / 100; } -// The only method I devised for detecting cursor height -// is drawing the cursor mask into a DIB and then scanning the bit field. +// The only method found for detecting the cursor height +// is to draw the cursor mask into a DIB and then scan the bit array. BOOL GetCursorHeight(HCURSOR hCursor) { if (hCursor == 0) @@ -224,8 +224,8 @@ void CToolTip::MessageLoop() ShowWindow(HWindow, SW_HIDE); IsModal = FALSE; - // our window captured the input; we received all messages - // now we need to deliver the last message to the recipient + // our window had captured the input, so all messages were delivered to us + // now we need to deliver the last message to its target if (msg.message == WM_LBUTTONDOWN || msg.message == WM_RBUTTONDOWN || msg.message == WM_MBUTTONDOWN) { @@ -533,9 +533,9 @@ void CToolTip::OnTimer() POINT p; GetCursorPos(&p); HWND hWnd = WindowFromPoint(p); - if (hWnd == HNotifyWindow) // we must still be on the notify window + if (hWnd == HNotifyWindow) // the cursor must still be over the notify window { - if (HasActiveParent(hWnd)) // the root window must also be active + if (HasActiveParent(hWnd)) // its root window must also be active { if (Show(p.x, p.y, TRUE, FALSE, HNotifyWindow)) { From 4859f1a798f7264bb91c68eab845689aa4862d00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 11:34:07 +0200 Subject: [PATCH 602/710] [translation] Fix src/usermenu.h comments Refines translated comments in src/usermenu.h. Model: OpenAI GPT-5.4 Verification: Full OSTranslation sequential review pipeline with requested review mode `codex`, actual review providers `codex`, `--prompt-log-mode summary`, `--copilot-event-log summary`, AST grounding through clang, Codex model `gpt-5.4` with `--codex-reasoning medium`, Copilot model `gpt-5.4`, and `--copilot-reasoning high`. 33 comment units, 33 review results, 33 resolved results, and 33 apply results. Branch-target comment guard passed for `src/usermenu.h` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. `git diff --check -- src/usermenu.h` completed without diff integrity failures. Telemetry: Cumulative across all provider stages: 4 provider calls, 34243 estimated tokens, and 0 billing units. Review stage actual providers: Codex-family 4 calls, 34243 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. Non-review stages: Codex-family 0 calls, 0 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. --- src/usermenu.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/usermenu.h b/src/usermenu.h index 30beeb66f..43370279f 100644 --- a/src/usermenu.h +++ b/src/usermenu.h @@ -132,17 +132,17 @@ struct CUserMenuItem ~CUserMenuItem(); - // Tries to retrieve the icon handle in this order + // Tries to retrieve the icon handle in this order: // a) the Icon variable // b) SHGetFileInfo - // c) takes the system default - // Reading icons in the background: if 'bkgndReaderData' is NULL, we read immediately; otherwise the icons - // are read in the background. If 'getIconsFromReader' is FALSE, we collect what to load into 'bkgndReaderData'. - // If it is TRUE, the icons are already loaded and we simply take over the handles of the loaded icons - // from 'bkgndReaderData'. + // c) the system default icon + // Background icon loading: if 'bkgndReaderData' is NULL, read immediately; otherwise the icons + // are read in the background. If 'getIconsFromReader' is FALSE, collect what should be loaded into + // 'bkgndReaderData'. If it is TRUE, the icons are already loaded and we only take the loaded icon + // handles from 'bkgndReaderData'. BOOL GetIconHandle(CUserMenuIconDataArr* bkgndReaderData, BOOL getIconsFromReader); - // Searches ItemName for '&' and returns HotKey; returns TRUE if one is found. + // Searches ItemName for '&' and returns the hot key in key; returns TRUE if one is found. BOOL GetHotKey(char* key); BOOL Set(char* name, char* umCommand, char* arguments, char* initDir, char* icon); From 741c5d506d7c5648fb6f416f2397f278c6ec622d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 11:34:12 +0200 Subject: [PATCH 603/710] [translation] Fix src/tooltip.h comments Refines translated comments in src/tooltip.h. Model: OpenAI GPT-5.4 Verification: Full OSTranslation sequential review pipeline with requested review mode `codex`, actual review providers `codex`, `--prompt-log-mode summary`, `--copilot-event-log summary`, AST grounding through clang, Codex model `gpt-5.4` with `--codex-reasoning medium`, Copilot model `gpt-5.4`, and `--copilot-reasoning high`. 16 comment units, 16 review results, 16 resolved results, and 16 apply results. Branch-target comment guard passed for `src/tooltip.h` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. `git diff --check -- src/tooltip.h` completed without diff integrity failures. Telemetry: Cumulative across all provider stages: 2 provider calls, 28137 estimated tokens, and 0 billing units. Review stage actual providers: Codex-family 2 calls, 28137 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. Non-review stages: Codex-family 0 calls, 0 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. --- src/tooltip.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tooltip.h b/src/tooltip.h index 9907fec88..b7adac2dd 100644 --- a/src/tooltip.h +++ b/src/tooltip.h @@ -55,7 +55,7 @@ class CToolTip : public CWindow POINT LastCursorPos; BOOL IsModal; // is our message loop running right now? BOOL ExitASAP; // close as soon as possible and stop being modal - UINT_PTR TimerID; // returned from SetTimer, we need it for KillTimer + UINT_PTR TimerID; // returned by SetTimer; needed for KillTimer public: CToolTip(CObjectOrigin origin = ooStatic); From e4cb4ef9521621839011500e23d02077295fed4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 11:34:18 +0200 Subject: [PATCH 604/710] [translation] Fix src/toolbar6.cpp comments Refines translated comments in src/toolbar6.cpp. Model: OpenAI GPT-5.4 Verification: Full OSTranslation sequential review pipeline with requested review mode `codex`, actual review providers `codex`, `--prompt-log-mode summary`, `--copilot-event-log summary`, AST grounding through clang, Codex model `gpt-5.4` with `--codex-reasoning medium`, Copilot model `gpt-5.4`, and `--copilot-reasoning high`. 19 comment units, 19 review results, 19 resolved results, and 19 apply results. Branch-target comment guard passed for `src/toolbar6.cpp` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. `git diff --check -- src/toolbar6.cpp` completed without diff integrity failures. Telemetry: Cumulative across all provider stages: 4 provider calls, 53129 estimated tokens, and 0 billing units. Review stage actual providers: Codex-family 3 calls, 50617 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. Non-review stages: Codex-family 1 call, 2512 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. --- src/toolbar6.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/toolbar6.cpp b/src/toolbar6.cpp index 9b7de34c2..7db0941ed 100644 --- a/src/toolbar6.cpp +++ b/src/toolbar6.cpp @@ -56,8 +56,8 @@ BOOL CDriveBar::CreateDriveButtons(CDriveBar* copyDrivesListFrom) if (HWindow == NULL) return FALSE; - // Suppress painting to avoid the checked item blinking (opening and closing the plugins manager would make it flicker). - // This also prevented flicker during Salamander startup. + // Suppress painting to prevent the checked item from flickering (for example, when opening and closing the Plugins Manager). + // It also flickered during Salamander startup. SendMessage(HWindow, WM_SETREDRAW, FALSE, 0); RemoveAllItems(); SetStyle(TLB_STYLE_IMAGE | TLB_STYLE_TEXT); @@ -295,7 +295,7 @@ BOOL CDriveBar::OnContextMenu() FromContextMenu = FALSE; const char* dllName = NULL; List->OnContextMenu(TRUE, indexInList, panel == MainWindow->LeftPanel ? PANEL_LEFT : PANEL_RIGHT, &dllName); - if (PostCmd != 0) // set only for drvtPluginFS and drvtPluginCmd, and drvtPluginFS cannot be on the Drive bar + if (PostCmd != 0) // PostCmd is set only for drvtPluginFS and drvtPluginCmd, and drvtPluginFS cannot be on the Drive bar { UpdateWindow(MainWindow->HWindow); From ba28e18192096b5fdc865005e4b491fb58610b2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 11:34:23 +0200 Subject: [PATCH 605/710] [translation] Fix src/toolbar5.cpp comments Refines translated comments in src/toolbar5.cpp. Model: OpenAI GPT-5.4 Verification: Full OSTranslation sequential review pipeline with requested review mode `codex`, actual review providers `codex`, `--prompt-log-mode summary`, `--copilot-event-log summary`, AST grounding through clang, Codex model `gpt-5.4` with `--codex-reasoning medium`, Copilot model `gpt-5.4`, and `--copilot-reasoning high`. 26 comment units, 26 review results, 26 resolved results, and 26 apply results. Branch-target comment guard passed for `src/toolbar5.cpp` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. `git diff --check -- src/toolbar5.cpp` completed without diff integrity failures. Telemetry: Cumulative across all provider stages: 5 provider calls, 93611 estimated tokens, and 0 billing units. Review stage actual providers: Codex-family 3 calls, 68656 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. Non-review stages: Codex-family 2 calls, 24955 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. --- src/toolbar5.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/toolbar5.cpp b/src/toolbar5.cpp index b5157c0e9..68018019c 100644 --- a/src/toolbar5.cpp +++ b/src/toolbar5.cpp @@ -48,7 +48,7 @@ class CUMDropTarget : public IDropTarget } STDMETHOD(QueryInterface) - (REFIID refiid, void FAR* FAR* ppv) + (REFIID refiid, void FAR * FAR * ppv) { if (refiid == IID_IUnknown || refiid == IID_IDropTarget) { @@ -441,7 +441,7 @@ class CUMDropTarget : public IDropTarget } MainWindow->UserMenuItems->Insert(i, item); - if (UserMenuIconBkgndReader.IsReadingIcons()) // icon loading is in progress, so restart it because the user menu item count changed (as a side effect this drops the icon just read for the dropped file, but that's acceptable) + if (UserMenuIconBkgndReader.IsReadingIcons()) // icon loading is in progress, so restart it because the number of items in the user menu has changed (as a side effect, this drops the icon just loaded for the dropped file, but that is acceptable) { CUserMenuIconDataArr* bkgndReaderData = new CUserMenuIconDataArr(); for (int i2 = 0; i2 < MainWindow->UserMenuItems->Count; i2++) From c1eb5b25f595fe6e9e31ad6de205a0a972465229 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 11:34:48 +0200 Subject: [PATCH 606/710] [translation] Fix src/toolbar4.cpp comments Refines translated comments in src/toolbar4.cpp. Model: OpenAI GPT-5.4 Verification: Full OSTranslation sequential review pipeline with requested review mode `codex`, actual review providers `codex`, `--prompt-log-mode summary`, `--copilot-event-log summary`, AST grounding through clang, Codex model `gpt-5.4` with `--codex-reasoning medium`, Copilot model `gpt-5.4`, and `--copilot-reasoning high`. 278 comment units, 278 review results, 278 resolved results, and 278 apply results. Branch-target comment guard passed for `src/toolbar4.cpp` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. `git diff --check -- src/toolbar4.cpp` completed without diff integrity failures. Telemetry: Cumulative across all provider stages: 11 provider calls, 199868 estimated tokens, and 0 billing units. Review stage actual providers: Codex-family 7 calls, 153275 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. Non-review stages: Codex-family 4 calls, 46593 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. --- src/toolbar4.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/toolbar4.cpp b/src/toolbar4.cpp index dad578250..d1447bb2d 100644 --- a/src/toolbar4.cpp +++ b/src/toolbar4.cpp @@ -255,8 +255,9 @@ CButtonData ToolBarButtons[TBBE_TERMINATOR] = // // TopToolbar // -// Represents all buttons that TopToolbar can contain. -// The order defines how buttons appear in the toolbar configuration dialog and can be changed freely. +// Represents all possible buttons that TopToolbar can contain. +// The order determines the order of buttons in the toolbar configuration dialog and can +// be changed freely. // DWORD TopToolBarButtons[] = @@ -357,7 +358,7 @@ DWORD TopToolBarButtons[] = NIB2(TBBE_HELP_CONTENTS) NIB2(TBBE_HELP_CONTEXT) - TBBE_TERMINATOR // terminator - must remain here! + TBBE_TERMINATOR // terminator - must be here }; DWORD LeftToolBarButtons[] = @@ -399,7 +400,7 @@ DWORD RightToolBarButtons[] = TBBE_REFRESH, TBBE_SMART_COLUMN_MODE, - TBBE_TERMINATOR // terminator - must remain here! + TBBE_TERMINATOR // terminator - must be here }; void GetSVGIconsMainToolbar(CSVGIcon** svgIcons, int* svgIconsCount) @@ -743,8 +744,8 @@ BOOL CreateToolbarBitmaps(HINSTANCE hInstance, int resID, COLORREF transparent, int iconSize = GetIconSizeForSystemDPI(ICONSIZE_16); // small icon size int iconCount = 0; - // Windows XP and newer use transparent icons. Render them into this temporary bitmap - // so the area beneath their transparent parts uses the toolbar gray instead of our purple mask color. + // Windows XP and newer use transparent icons; render them into this temporary bitmap + // so that the area under the transparent parts uses the toolbar gray instead of our purple mask color. HBITMAP hTmpBitmap = NULL; HDC hTmpMemDC = NULL; HBITMAP hOldTmpBitmap = NULL; From 2f09d351e078b9b26b0e3cd10e71c604e141ea93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 11:34:54 +0200 Subject: [PATCH 607/710] [translation] Fix src/toolbar3.cpp comments Refines translated comments in src/toolbar3.cpp. Model: OpenAI GPT-5.4 Verification: Full OSTranslation sequential review pipeline with requested review mode `codex`, actual review providers `codex`, `--prompt-log-mode summary`, `--copilot-event-log summary`, AST grounding through clang, Codex model `gpt-5.4` with `--codex-reasoning medium`, Copilot model `gpt-5.4`, and `--copilot-reasoning high`. 32 comment units, 32 review results, 32 resolved results, and 32 apply results. Branch-target comment guard passed for `src/toolbar3.cpp` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. `git diff --check -- src/toolbar3.cpp` completed without diff integrity failures. Telemetry: Cumulative across all provider stages: 5 provider calls, 91709 estimated tokens, and 0 billing units. Review stage actual providers: Codex-family 2 calls, 49299 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. Non-review stages: Codex-family 3 calls, 42410 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. --- src/toolbar3.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/toolbar3.cpp b/src/toolbar3.cpp index 626652590..f34f7e6e7 100644 --- a/src/toolbar3.cpp +++ b/src/toolbar3.cpp @@ -535,11 +535,11 @@ void CToolBar::Customize() InvalidateRect(HWindow, NULL, FALSE); UpdateWindow(HWindow); - // perform the customization + // set up the customization dialog CTBCustomizeDialog dialog(this); dialog.Execute(); - // return to the original button setup + // restore the original button state Customizing = FALSE; InvalidateRect(HWindow, NULL, FALSE); From 701f4e6e3217b422f92c0f85d6eaa74fd03126ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 11:34:59 +0200 Subject: [PATCH 608/710] [translation] Fix src/toolbar2.cpp comments Refines translated comments in src/toolbar2.cpp. Model: OpenAI GPT-5.4 Verification: Full OSTranslation sequential review pipeline with requested review mode `codex`, actual review providers `codex`, `--prompt-log-mode summary`, `--copilot-event-log summary`, AST grounding through clang, Codex model `gpt-5.4` with `--codex-reasoning medium`, Copilot model `gpt-5.4`, and `--copilot-reasoning high`. 38 comment units, 38 review results, 38 resolved results, and 38 apply results. Branch-target comment guard passed for `src/toolbar2.cpp` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. `git diff --check -- src/toolbar2.cpp` completed without diff integrity failures. Telemetry: Cumulative across all provider stages: 5 provider calls, 31670 estimated tokens, and 0 billing units. Review stage actual providers: Codex-family 2 calls, 27529 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. Non-review stages: Codex-family 3 calls, 4141 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. --- src/toolbar2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/toolbar2.cpp b/src/toolbar2.cpp index ee5df89d2..7f577c15f 100644 --- a/src/toolbar2.cpp +++ b/src/toolbar2.cpp @@ -678,7 +678,7 @@ void CToolBar::DrawAllItems(HDC hDC) return; } if (Refresh()) - return; // If everything was redrawn, nothing more to do. + return; // If everything was redrawn, nothing more needs to be done. BOOL vertical = (Style & TLB_STYLE_VERTICAL) != 0; From acae4f8dcc6a41c70dce1e515356b3d58b000b8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 11:35:05 +0200 Subject: [PATCH 609/710] [translation] Fix src/toolbar1.cpp comments Refines translated comments in src/toolbar1.cpp. Model: OpenAI GPT-5.4 Verification: Full OSTranslation sequential review pipeline with requested review mode `codex`, actual review providers `codex`, `--prompt-log-mode summary`, `--copilot-event-log summary`, AST grounding through clang, Codex model `gpt-5.4` with `--codex-reasoning medium`, Copilot model `gpt-5.4`, and `--copilot-reasoning high`. 36 comment units, 36 review results, 36 resolved results, and 36 apply results. Branch-target comment guard passed for `src/toolbar1.cpp` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. `git diff --check -- src/toolbar1.cpp` completed without diff integrity failures. Telemetry: Cumulative across all provider stages: 5 provider calls, 14367 estimated tokens, and 0 billing units. Review stage actual providers: Codex-family 3 calls, 12235 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. Non-review stages: Codex-family 2 calls, 2132 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. --- src/toolbar1.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/toolbar1.cpp b/src/toolbar1.cpp index 605f18f01..f7eec1e2b 100644 --- a/src/toolbar1.cpp +++ b/src/toolbar1.cpp @@ -871,7 +871,7 @@ CToolBar::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_ERASEBKGND: { - if (WindowsVistaAndLater) // Rebar flickers under Vista. + if (WindowsVistaAndLater) // On Vista, the rebar flickers. return TRUE; RECT r; GetClientRect(HWindow, &r); From 34e9083277731710bd6e6b8776ae0e23c63ec0b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 11:35:36 +0200 Subject: [PATCH 610/710] [translation] Fix src/toolbar.h comments Refines translated comments in src/toolbar.h. Model: OpenAI GPT-5.4 Verification: Full OSTranslation sequential review pipeline with requested review mode `codex`, actual review providers `codex`, `--prompt-log-mode summary`, `--copilot-event-log summary`, AST grounding through clang, Codex model `gpt-5.4` with `--codex-reasoning medium`, Copilot model `gpt-5.4`, and `--copilot-reasoning high`. 89 comment units, 89 review results, 89 resolved results, and 89 apply results. Branch-target comment guard passed for `src/toolbar.h` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. `git diff --check -- src/toolbar.h` completed without diff integrity failures. Telemetry: Cumulative across all provider stages: 10 provider calls, 116301 estimated tokens, and 0 billing units. Review stage actual providers: Codex-family 8 calls, 74141 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. Non-review stages: Codex-family 2 calls, 42160 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. --- src/toolbar.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/toolbar.h b/src/toolbar.h index 52e02e502..cda3ff43e 100644 --- a/src/toolbar.h +++ b/src/toolbar.h @@ -132,7 +132,7 @@ class CToolBar : public CWindow, public CGUIToolBarAbstract virtual void WINAPI SetHotImageList(HIMAGELIST hImageList); virtual HIMAGELIST WINAPI GetHotImageList(); - // Toolbar style accessors. + // Toolbar style virtual void WINAPI SetStyle(DWORD style); virtual DWORD WINAPI GetStyle(); @@ -141,7 +141,7 @@ class CToolBar : public CWindow, public CGUIToolBarAbstract virtual int WINAPI GetItemCount() { return Items.Count; } - // Opens the configuration dialog. + // Opens the Customize dialog. virtual void WINAPI Customize(); virtual void WINAPI SetPadding(const TOOLBAR_PADDING* padding); @@ -155,10 +155,10 @@ class CToolBar : public CWindow, public CGUIToolBarAbstract // otherwise returns a negative value. virtual int WINAPI HitTest(int xPos, int yPos); - // Returns TRUE if the point lies on an item boundary; in that case it sets 'index' - // to that item and the 'after' flag to indicate whether it is the left or right side. - // Returns FALSE if the point lies over an item. If the point does not lie over any item, - // it returns TRUE and sets 'index' to -1. + // Returns TRUE if the point lies on an item boundary; in that case, it sets 'index' + // to that item and the 'after' flag to indicate whether the insertion mark is before or + // after it. Returns FALSE if the point lies over an item. If the point does not lie over + // any item, it returns TRUE and sets 'index' to -1. virtual BOOL WINAPI InsertMarkHitTest(int xPos, int yPos, int& index, BOOL& after); // Sets the insert mark to the given index (before or after). From 96ed7c6d02bf9497aa0c780da306fc8d4cb1eb3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 11:35:41 +0200 Subject: [PATCH 611/710] [translation] Fix src/thumbnl.h comments Refines translated comments in src/thumbnl.h. Model: OpenAI GPT-5.4 Verification: Full OSTranslation sequential review pipeline with requested review mode `codex`, actual review providers `codex`, `--prompt-log-mode summary`, `--copilot-event-log summary`, AST grounding through clang, Codex model `gpt-5.4` with `--codex-reasoning medium`, Copilot model `gpt-5.4`, and `--copilot-reasoning high`. 24 comment units, 24 review results, 24 resolved results, and 24 apply results. Branch-target comment guard passed for `src/thumbnl.h` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. `git diff --check -- src/thumbnl.h` completed without diff integrity failures. Telemetry: Cumulative across all provider stages: 2 provider calls, 7792 estimated tokens, and 0 billing units. Review stage actual providers: Codex-family 2 calls, 7792 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. Non-review stages: Codex-family 0 calls, 0 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. --- src/thumbnl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/thumbnl.h b/src/thumbnl.h index 382e96fbc..bf8336ece 100644 --- a/src/thumbnl.h +++ b/src/thumbnl.h @@ -75,7 +75,7 @@ class CSalamanderThumbnailMaker : public CSalamanderThumbnailMakerAbstract DWORD PictureFlags; BOOL ProcessTopDown; - CShrinkImage Shrinker; // Handles the actual image shrinking. + CShrinkImage Shrinker; // Handles image shrinking. BOOL ShrinkImage; public: From 4f00237066d3d53d7f2da44124f10c19efb9b5ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 11:35:47 +0200 Subject: [PATCH 612/710] [translation] Fix src/consts.h comments Refines translated comments in src/consts.h. Model: OpenAI GPT-5.4 Verification: Full OSTranslation sequential review pipeline with requested review mode `codex`, actual review providers `codex`, `--prompt-log-mode summary`, `--copilot-event-log summary`, AST grounding through clang, Codex model `gpt-5.4` with `--codex-reasoning medium`, Copilot model `gpt-5.4`, and `--copilot-reasoning high`. 756 comment units, 756 review results, 756 resolved results, and 756 apply results. Branch-target comment guard passed for `src/consts.h` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. `git diff --check -- src/consts.h` completed without diff integrity failures. Telemetry: Cumulative across all provider stages: 73 provider calls, 574719 estimated tokens, and 0 billing units. Review stage actual providers: Codex-family 55 calls, 413648 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. Non-review stages: Codex-family 18 calls, 161071 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. --- src/consts.h | 300 +++++++++++++++++++++++++++------------------------ 1 file changed, 158 insertions(+), 142 deletions(-) diff --git a/src/consts.h b/src/consts.h index f54821bf9..0cca62f5f 100644 --- a/src/consts.h +++ b/src/consts.h @@ -44,15 +44,16 @@ BOOL PostMouseWheelMessage(MSG* pMSG); // Can be called from any thread. BOOL SalamanderIsNotBusy(DWORD* lastIdleTime); -// opens Salamander or plugin HTML help. The help language (directory with .chm files) is selected as follows: +// Opens Salamander or plugin HTML Help. The help language (the directory with .chm files) is selected as follows: // - directory from the current Salamander .slg file (see SLGHelpDir in shared\versinfo.rc) // - HELP\ENGLISH\*.chm // - first subdirectory found in HELP -// 'helpFileName' is the .chm file name to use (without path); if NULL, "salamand.chm" is used. -// 'parent' is the parent of the error message box; 'command' is the HTML Help command (HHCDisplayXXX); -// 'dwData' is the parameter of the HTML Help command. Can be called from any thread. +// 'helpFileName' is the .chm file name to use (without a path); if NULL, "salamand.chm" is used. +// 'parent' is the parent window for the error message box; 'command' is the HTML Help command, +// see HHCDisplayXXX; 'dwData' is the HTML Help command parameter, see HHCDisplayXXX +// Can be called from any thread. // If 'quiet' is TRUE, no error message is shown. -// Returns TRUE if the help was opened successfully, otherwise FALSE. +// Returns TRUE if the help was opened successfully; otherwise returns FALSE. BOOL OpenHtmlHelp(char* helpFileName, HWND parent, CHtmlHelpCommand command, DWORD_PTR dwData, BOOL quiet); extern CRITICAL_SECTION OpenHtmlHelpCS; // critical section used by OpenHtmlHelp() @@ -92,10 +93,10 @@ class CEnterCriticalSection } }; -// Windows GetTempFileName does not work for us, so we wrote our own clone: +// Because Windows GetTempFileName does not work correctly, this function is our own clone: // creates a file/directory (depending on 'file') at 'path' (NULL -> Windows TEMP dir), -// with prefix 'prefix', returns the created name in 'tmpName' (at least MAX_PATH in size). -// Returns success status; on failure SetLastError contains the Windows error code for compatibility. +// with prefix 'prefix', returns the created name in 'tmpName' (minimum buffer size MAX_PATH), +// and returns success status; on failure, SetLastError contains the Windows error code for compatibility. BOOL SalGetTempFileName(const char* path, const char* prefix, char* tmpName, BOOL file); // Windows MoveFile cannot rename a file with the read-only attribute on Novell volumes, @@ -111,15 +112,17 @@ BOOL SalGetFileSize2(const char* fileName, CQuadWord& size, DWORD* err); // 'err struct COperation; -// Finds the size of the file pointed to by the symlink 'fileName'. If 'op' is not NULL -// and the operation is canceled the structure is released. If 'fileName' is NULL, -// 'op->SourceName' is used instead. The size is returned in 'size'. 'ignoreAll' works as -// both input and output; set it to FALSE before the call or the error dialog will never -// appear. On error the standard Retry/Ignore/Ignore All/Cancel dialog with the parent -// window 'parent' is shown. When Ignore or Ignore All is pressed the function returns -// FALSE and 'cancel' receives FALSE. -// If 'ignoreAll' is TRUE the dialog is skipped and behaves as if the user had clicked -// Ignore; when Cancel is pressed the function returns FALSE and 'cancel' receives TRUE +// Determines the size of the file pointed to by the symlink 'fileName'. If 'op' is not +// NULL, the contents of 'op' are released on Cancel. If 'fileName' is NULL, +// 'op->SourceName' is used. The size is returned in 'size'. 'ignoreAll' is both input +// and output; if it is TRUE, all errors are ignored. Set it to FALSE before the +// operation, otherwise the error dialog is not shown at all, and do not change it +// afterwards. On error, the standard Retry / Ignore / Ignore All / Cancel dialog with +// parent 'parent' is shown. Returns TRUE if the size is determined successfully. On +// error, if Ignore or Ignore All is chosen, returns FALSE and stores FALSE in 'cancel'. +// If 'ignoreAll' is TRUE, the dialog is not shown and the function behaves as if the +// user had pressed Ignore. On error, if Cancel is chosen, returns FALSE and stores TRUE +// in 'cancel'. BOOL GetLinkTgtFileSize(HWND parent, const char* fileName, COperation* op, CQuadWord* size, BOOL* cancel, BOOL* ignoreAll); @@ -185,8 +188,8 @@ HANDLE SalCreateFileEx(const char* fileName, DWORD desiredAccess, // space or ends with a dot the function returns TRUE; otherwise FALSE BOOL FileNameInvalidForManualCreate(const char* path); -// Trims spaces from the beginning and end of the name (CutWS or StripWS or CutWhiteSpace or StripWhiteSpace) -// Returns TRUE if trimming occurred +// Trims spaces from the beginning and end of the path (CutWS or StripWS or CutWhiteSpace or StripWhiteSpace) +// Returns TRUE if any trimming occurred BOOL CutSpacesFromBothSides(char* path); // Trims leading spaces and trailing spaces or dots in the same way Explorer does @@ -223,7 +226,7 @@ BOOL SalCreateDirectoryEx(const char* name, DWORD* err); void InitLocales(); // must be called before NumberToStr and PrintDiskSize char* NumberToStr(char* buffer, const CQuadWord& number); // converts integer to a more readable string, !char buffer[50]! -int NumberToStr2(char* buffer, const CQuadWord& number); // converts integer to a readable string, !char buffer[50]!, returns number of characters copied to the buffer +int NumberToStr2(char* buffer, const CQuadWord& number); // converts an integer to a more readable string, !char buffer[50]!, returns the number of characters written to the buffer char* GetErrorText(DWORD error); // converts error code to a string WCHAR* GetErrorTextW(DWORD error); // converts error code to a wide string BOOL IsDirError(DWORD err); // does the error relate to directories? @@ -246,8 +249,8 @@ BOOL PathsAreOnTheSameVolume(const char* path1, const char* path2, BOOL* resIsOn // compares two paths: case-insensitive and ignoring a single backslash at the start and end BOOL IsTheSamePath(const char* path1, const char* path2); -// determines whether 'path' is a plugin FS path; 'path' is the path to check, -// 'fsName' is a MAX_PATH buffer for the FS name (or NULL); stores in 'userPart' +// Determines whether 'path' is a plugin FS path; 'path' is the path to check, +// 'fsName' is a MAX_PATH buffer for the FS name (or NULL); returns in 'userPart' // (if not NULL) a pointer into 'path' to the first character of the plugin-defined path (after the first ':') BOOL IsPluginFSPath(const char* path, char* fsName = NULL, const char** userPart = NULL); BOOL IsPluginFSPath(char* path, char* fsName = NULL, char** userPart = NULL); @@ -270,9 +273,10 @@ int GetRootPath(char* root, const char* path); // UNC or standard path const char* SkipRoot(const char* path); -// returns TRUE if 'path' (UNC or standard) can be shortened by removing the last -// directory. The last backslash remains only for paths like "c:\". If 'cutDir' is -// not NULL it receives a pointer to the removed directory +// returns TRUE if `path` (UNC or regular path) can be shortened by removing the last +// directory (cut at the last backslash; the shortened path retains a trailing backslash +// only for paths like "c:\"), `cutDir` returns a pointer to the last directory +// (the removed part) // replacement for PathRemoveFileSpec BOOL CutDirectory(char* path, char** cutDir = NULL); @@ -335,16 +339,16 @@ BOOL SalPathIsPrefix(const char* prefix, const char* path); BOOL SalRemovePointsFromPath(char* afterRoot); BOOL SalRemovePointsFromPath(WCHAR* afterRoot); -// Converts a relative or absolute path to an absolute one without '.', '..', or a trailing -// backslash (except "X:\"); if 'curDir' is NULL, relative paths such as "\\path" and "path" -// are reported as errors (they are indeterminate); otherwise 'curDir' must be a valid adjusted +// Converts a relative or absolute path to an absolute path without '.', '..', or a trailing +// backslash (except for "X:\"); if 'curDir' is NULL, relative paths such as "\\path" and "path" +// return an error (they cannot be resolved); otherwise, 'curDir' must be a valid normalized // current path (UNC or regular); current paths of other drives (except 'curDir'; regular only, // not UNC) are in DefaultDir (it is advisable to call CMainWindow::UpdateDefaultDir before use); // 'name' is an in/out buffer of at least MAX_PATH characters (its size is in 'nameBufSize'); // if 'nextFocus' is not NULL and the specified relative path contains no backslash, // strcpy(nextFocus, name) is called -// Returns TRUE - the name in 'name' is ready for use; otherwise, if 'errTextID' is not NULL it -// contains the error (constants for LoadStr - IDS_SERVERNAMEMISSING, IDS_SHARENAMEMISSING, +// Returns TRUE: the name in 'name' is ready for use; otherwise, if 'errTextID' is not NULL, it +// contains the error (constants for LoadStr: IDS_SERVERNAMEMISSING, IDS_SHARENAMEMISSING, // IDS_TOOLONGPATH, IDS_INVALIDDRIVE, IDS_INCOMLETEFILENAME, IDS_EMPTYNAMENOTALLOWED, and // IDS_PATHISINVALID); TRUE is returned in 'callNethood' (if not NULL) if the Nethood plugin should // be called for IDS_SERVERNAMEMISSING and IDS_SHARENAMEMISSING; if 'allowRelPathWithSpaces' is @@ -384,33 +388,43 @@ BOOL SalCheckAndRestorePath(HWND parent, const char* path, BOOL tryNet); BOOL SalCheckAndRestorePathWithCut(HWND parent, char* path, BOOL& tryNet, DWORD& err, DWORD& lastErr, BOOL& pathInvalid, BOOL& cut, BOOL donotReconnect); -// Detects the path type (FS, Windows, or archive) and splits it into parts. -// For FS paths this means fs-name and user part, for archives the path to the -// archive file and the path inside it, and for Windows paths the existing part -// and the remainder. FS paths are not validated; Windows paths are checked for -// how far they exist (and network connections are restored if needed). Archive -// paths check for file existence based on extension. Because SalGetFullName is -// used, CMainWindow::UpdateDefaultDir should be called beforehand. +// Detects the path type (FS/Windows/archive) and splits it into parts. +// For FS paths, this means the file-system name and user part; for archive +// paths, the path to the archive file and the path inside the archive; for +// Windows paths, the existing part and the remainder of the path. FS paths are +// not checked; Windows paths (normal and UNC) are checked for how far the path +// exists, and the network connection is restored if needed. For archive paths, +// the existence of the archive file is checked (archives are distinguished by +// extension). This function uses SalGetFullName, so it is advisable to call +// CMainWindow::UpdateDefaultDir first. // 'path' is a full or relative path (buffer of at least 'pathBufSize' chars; for -// relative paths the current directory 'curPath' is used as the base). If the -// current path is an archive, 'curArchivePath' holds its file name. The resolved -// full path is stored back to 'path'. On success TRUE is returned, 'type' holds -// the path type (PATH_TYPE_XXX) and 'secondPart' points to: -// - in Windows paths: the location after the existing portion (after '\\' or at -// end; if a file is present it points after the file name). Length is not -// checked (may exceed MAX_PATH). -// - in archive paths: after the archive file name (length may exceed MAX_PATH). -// - in FS paths: after ':' following the file-system name; length of the user -// part is not checked. -// When TRUE is returned, 'isDir' is additionally set to: -// - TRUE if the existing portion is a directory, FALSE if it is a file (Windows -// path type) -// - FALSE for archive and FS paths. -// If FALSE is returned, an error message has already been shown to the user -// (except for SPP_INCOMLETEPATH). If 'error' is not NULL, one of the SPP_XXX -// constants is stored there. 'errorTitle' is the title of the error message box. -// When 'nextFocus' is not NULL and the path does not contain '\\' or ends with -// '\\', the path is copied into 'nextFocus' (see SalGetFullName). +// relative paths, the current path 'curPath' is used as the base for resolving +// the full path, if it is not NULL; 'curPathIsDiskOrArchive' is TRUE if +// 'curPath' is a Windows or archive path; if the current path is an archive +// path, 'curArchivePath' contains the archive file name, otherwise it is NULL). +// The resulting full path is stored in 'path' (which must be at least +// 'pathBufSize' chars long). Returns TRUE on successful recognition; then +// 'type' is the path type (see PATH_TYPE_XXX) and 'secondPart' is set to: +// - in 'path', at the position after the existing path (after '\\' or at the +// end of the string; if the path contains a file, it points past the path to +// that file) (Windows path type); WARNING: the length of the returned part of +// the path is not handled (the whole path may be longer than MAX_PATH) +// - after the archive file (archive path type); WARNING: the length of the path +// inside the archive is not handled (it may be longer than MAX_PATH) +// - after ':' following the file-system name, i.e. to the user part of the +// file-system path (FS path type); WARNING: the length of the user part is +// not handled (it may be longer than MAX_PATH); +// if TRUE is returned, 'isDir' is also set to: +// - TRUE if the existing part of the path is a directory, FALSE if it is a file +// (Windows path type) +// - FALSE for archive and FS paths; +// if FALSE is returned, an error that occurred during recognition has already +// been shown to the user (with one exception; see the description of +// SPP_INCOMLETEPATH); if 'error' is not NULL, one of the SPP_XXX constants is +// returned in it. 'errorTitle' is the title of the error message box; if +// 'nextFocus' != NULL and the Windows/archive path does not contain '\\' or +// only ends with '\\', the path is copied to 'nextFocus' (see +// SalGetFullName). BOOL SalParsePath(HWND parent, char* path, int& type, BOOL& isDir, char*& secondPart, const char* errorTitle, char* nextFocus, BOOL curPathIsDiskOrArchive, const char* curPath, const char* curArchivePath, int* error, @@ -435,33 +449,26 @@ BOOL SalSplitWindowsPath(HWND parent, const char* title, const char* errorTitle, char* path, char* secondPart, BOOL pathIsDir, BOOL backslashAtEnd, const char* dirName, const char* curDiskPath, char*& mask); -// Retrieves the existing portion and the operation mask from the target path; -// recognizes any non-existent part. On success returns TRUE, the relative path -// to create (in 'newDirs'), the existing target path (in 'path'; valid only if -// the relative path will be created) and the found operation mask (in 'mask' -// pointing into the 'path' buffer; the path and mask are separated by a zero. If -// the path contains no mask, "*.*" is generated automatically). 'parent' is the -// parent of message boxes; 'title' + 'errorTitle' are their captions; -// 'selCount' is the number of selected files and directories. 'path' is the -// input target path and on output (at least 2 * MAX_PATH characters) it holds -// the existing target path (always ending with a backslash). 'afterRoot' points -// inside 'path' just after the root (after '\\' or at the end). 'secondPart' -// points inside 'path' just after the existing portion (after '\\' or at the -// end; if a file is present it points after that file). 'pathIsDir' is TRUE or -// FALSE depending on whether the existing part is a directory or a file. -// 'backslashAtEnd' is TRUE if there was a backslash at the end of 'path' before -// parsing (SalParsePath removes such a backslash). 'dirName' and 'curPath' are -// non-NULL when at most one file/directory is selected-its name without the path -// is stored in 'dirName' and its path in 'curPath'; if nothing is selected the -// focused item is used. 'mask' receives the operation mask pointer inside -// 'path'. When 'newDirs' is not NULL it is a buffer (at least MAX_PATH) for the -// relative path (with respect to the existing path in 'path') that must be -// created (the user agreed to create it using the same prompt as for disk to -// disk copy; empty string means create nothing). If 'newDirs' is NULL and a -// relative path needs to be created but cannot be, only an error is shown. -// 'isTheSamePathF' is a comparison function for two paths (used only when -// 'curPath' is not NULL; otherwise IsTheSamePath is used). The method returns -// FALSE on error and the user has already been notified +// Retrieves the existing part of the target path and the operation mask; also recognizes any non-existent part. On +// success, returns TRUE, the relative path to create (in 'newDirs'), the existing target path (in 'path'; valid only +// if the relative path 'newDirs' is created), and the found operation mask (in 'mask', which points into the 'path' +// buffer, with the path and mask separated by a zero; if the path contains no mask, the mask "*.*" is created +// automatically). 'parent' is the parent of any message boxes; 'title' and 'errorTitle' are the captions of the +// information and error message boxes; 'selCount' is the number of selected files and directories; 'path' is the +// target path to process on input and, on output (at least 2 * MAX_PATH characters), the existing target path (always +// ending with a backslash); 'afterRoot' points into 'path' past the path root (past '\\' or to the end of the +// string); 'secondPart' points into 'path' to the position after the existing path (past '\\' or to the end of the +// string; if the path contains a file, it points past the path to that file); 'pathIsDir' is TRUE/FALSE if the +// existing part of the path is a directory/file; 'backslashAtEnd' is TRUE if 'path' ended with a backslash before +// parsing (for example, SalParsePath removes such a backslash); 'dirName' and 'curPath' are non-NULL if at most one +// file/directory is selected (its name without the path is in 'dirName'; its path is in 'curPath'; if nothing is +// selected, the focused item is used); 'mask' receives a pointer to the operation mask in the 'path' buffer; if +// 'newDirs' is not NULL, it is a buffer (of size at least MAX_PATH) for the relative path (with respect to the +// existing path in 'path') that must be created (the user agrees to create it; the same prompt is used as when copying +// from disk to disk; an empty string means create nothing); if 'newDirs' is NULL and some relative path needs to be +// created, only an error is reported; 'isTheSamePathF' is a function for comparing two paths (needed only if 'curPath' +// is not NULL); if it is NULL, IsTheSamePath is used; if the path contains an error, the method returns FALSE and the +// problem has already been reported to the user BOOL SalSplitGeneralPath(HWND parent, const char* title, const char* errorTitle, int selCount, char* path, char* afterRoot, char* secondPart, BOOL pathIsDir, BOOL backslashAtEnd, const char* dirName, const char* curPath, char*& mask, char* newDirs, @@ -474,8 +481,8 @@ BOOL SalSplitGeneralPath(HWND parent, const char* title, const char* errorTitle, BOOL SalIsValidFileNameComponent(const char* fileNameComponent); // transforms 'fileNameComponent' so it can be used as a Windows file name -// component (handles strings longer than MAX_PATH-4 (4 = "C:\" + null terminator), -// empty strings, strings of '.', whitespace-only strings; characters "*?\\/<>|:" +// component (handles strings longer than MAX_PATH-4 (4 = "C:\\" + null terminator), +// empty strings, strings of '.', whitespace-only strings; characters "*?\\/<>|\":" // are replaced with '_'; simple names like "prn" and "prn .txt" get an '_' // appended at the end of the name); 'fileNameComponent' must be extendable by at // least one character (but at most MAX_PATH bytes of 'fileNameComponent' are used) @@ -552,7 +559,7 @@ void GetAttrsString(char* text, DWORD attrs); // possible from both strings are kept. void AddStrToStr(char* dstStr, int dstBufSize, const char* srcStr); -// Creates an allocated full file name. If 'dosName' is not NULL and +// Creates and returns an allocated full file name. If 'dosName' is not NULL and // 'path'+'name' is too long, it tries 'path'+'dosName'. If 'skip', 'skipAll', // and 'sourcePath' are not NULL and a "name too long" error occurs, the user // can skip this name (the function then returns NULL and sets 'skip' to TRUE). @@ -578,15 +585,15 @@ BOOL InitializeCheckThread(); // initializes the thread used by CFilesWindow::Ch void ReleaseCheckThreads(); // releases the thread used by CFilesWindow::CheckPath() void InitDefaultDir(); // initializes the DefaultDir array (last visited paths for all drives) -// shows or hides a message window in its own thread without draining the -// message queue; only one message can be displayed at a time. Repeated calls -// report an error in TRACE (non-fatal). 'delay' is the wait time before the -// window is opened (counted from the call to CreateSafeWaitWindow). -// 'message' may span multiple lines separated by '\n'. If 'caption' is NULL the -// default caption "Open Salamander" is used. -// 'showCloseButton' determines whether the window has a Close button. -// 'hForegroundWnd' designates the window that must stay active for the wait window -// to be shown and which is activated when clicking the wait window +// shows or hides a message in its own thread without draining the message +// queue; only one message can be displayed at a time. Repeated calls report +// an error to TRACE (non-fatal). 'delay' is the delay before the window is +// opened (counted from the call to CreateSafeWaitWindow). +// 'message' may span multiple lines; individual lines are separated by '\n'. +// 'caption' may be NULL; in that case, the caption "Open Salamander" is used. +// 'showCloseButton' specifies whether the window contains a Close button. +// 'hForegroundWnd' specifies the window that must be active for the wait window +// to be shown and the window that will be activated when the wait window is clicked. void CreateSafeWaitWindow(const char* message, const char* caption, int delay, BOOL showCloseButton, HWND hForegroundWnd); void DestroySafeWaitWindow(BOOL killThread = FALSE); @@ -606,7 +613,7 @@ void ShowSafeWaitWindow(BOOL show); // after calling CreateSafeWaitWindow or ShowSafeWaitWindow the function returns // FALSE until the user clicks the Close button (if shown); then it returns TRUE BOOL GetSafeWaitWindowClosePressed(); -// returns TRUE if the user presses ESC or clicks the Close button +// returns TRUE if the user is pressing ESC or clicked the Close button BOOL UserWantsToCancelSafeWaitWindow(); // Used to change the message text later. NOTE: the window layout is not // recomputed; if the text grows it will be truncated. Useful for countdowns @@ -782,8 +789,8 @@ BOOL CanUseShellExecuteWndAsParent(const char* cmdName); // see http://msdn.microsoft.com/en-us/library/windows/desktop/dn323738%28v=vs.85%29.aspx BOOL IsFilePlaceholder(WIN32_FIND_DATA const* findData); -// before opening an editor or viewer the placeholder is converted to an offline file -// so that the viewer/editor can handle it +// before opening the editor or viewer, the placeholder is converted to an offline file +// so that the viewer/editor can work with it //BOOL MakeFileAvailOfflineIfOneDriveOnWin81(HWND parent, const char *name); // sets the thread priority to normal and calls menu->InvokeCommand() in a try-except block; @@ -872,8 +879,8 @@ void RestoreApp(HWND mainWnd, HWND dlgWnd); // restore from minimized state // adjusts the name format (letter case), filename must be null-terminated void AlterFileName(char* tgtName, char* filename, int filenameLen, int format, int change, BOOL dir); -// returns a string with size and times of the file; 'fileTime' receives the time (may be NULL); -// if 'getTimeFailed' is not NULL it is set to TRUE on failure to obtain the file time +// returns a string with the file size and times; 'fileTime' receives the time (may be NULL); +// if 'getTimeFailed' is not NULL, it is set to TRUE on failure to obtain the file time void GetFileOverwriteInfo(char* buff, int buffLen, HANDLE file, const char* fileName, FILETIME* fileTime = NULL, BOOL* getTimeFailed = NULL); void ColorsChanged(BOOL refresh, BOOL colorsOnly, BOOL reloadUMIcons); // call after color change @@ -987,13 +994,14 @@ void GetMessagePos(POINT& p); // The caller is responsible for destroying the icon. The icon is assigned to HANDLES. HICON GetFileOrPathIconAux(const char* path, BOOL large, BOOL isDir); -// If the UNC root is inaccessible (for listing), tries to establish a network -// connection, asking the user for credentials if needed. Returns TRUE when the -// connection succeeded. Returns FALSE if the path is not UNC, the root is -// accessible, or the connection attempt failed. In 'pathInvalid' returns TRUE -// when the user cancelled the credentials dialog or the attempt failed (e.g. -// "credentials conflict"). When 'donotReconnect' is TRUE no connection attempt -// is made and FALSE is returned immediately. +// If the UNC root of `UNCPath` is inaccessible (for listing), tries to establish a +// network connection and prompts the user for credentials if needed. Returns TRUE +// if the connection is established. Returns FALSE if `UNCPath` is not a UNC path, +// if the UNC root is accessible, or if the connection could not be established. In +// `pathInvalid`, returns TRUE if the user cancelled the credentials dialog or if +// establishing the connection failed (e.g. "credentials conflict"). If +// `donotReconnect` is TRUE, no network connection is attempted and FALSE is +// returned immediately. BOOL CheckAndConnectUNCNetworkPath(HWND parent, const char* UNCPath, BOOL& pathInvalid, BOOL donotReconnect); @@ -1137,10 +1145,10 @@ struct COpenViewerData #define WM_USER_HELPHITTEST WM_APP + 172 // lResult = dwContext, lParam = MAKELONG(x,y) #define WM_USER_EXITHELPMODE WM_APP + 173 // [0, 0] -#define WM_USER_POSTCMDORUNLOADPLUGIN WM_APP + 180 // [plug-in iface, 0, 1 or salCmd+2 or menuCmd+502] - sets ShouldUnload or ShouldRebuildMenu or adds salCmd/menuCmd to plugin data -#define WM_USER_POSTMENUEXTCMD WM_APP + 181 // [plug-in iface, cmdID] - post a menu-ext command from a plugin +#define WM_USER_POSTCMDORUNLOADPLUGIN WM_APP + 180 // [plugin iface, 0, 1 or salCmd+2 or menuCmd+502] - sets ShouldUnload or ShouldRebuildMenu or adds salCmd/menuCmd to plugin data +#define WM_USER_POSTMENUEXTCMD WM_APP + 181 // [plugin iface, cmdID] - post a menu-ext command from a plugin -#define WM_USER_SHOWPLUGINMSGBOX WM_APP + 185 // [0, 0] - open the plug-in message box above the Bug Report dialog +#define WM_USER_SHOWPLUGINMSGBOX WM_APP + 185 // [0, 0] - open the plugin message box above the Bug Report dialog // commands for the main thread (cannot be run from another thread) - uses the // Find dialog (running in its own thread) @@ -1409,7 +1417,7 @@ extern HFONT EnvFontUL; // underlined list box font extern int EnvFontCharHeight; // font height extern HFONT TooltipFont; // font for tooltips (and status bars, although we don't use it there) -BOOL GetSystemGUIFont(LOGFONT* lf); // returns the font used for the main Salamander window +BOOL GetSystemGUIFont(LOGFONT* lf); // retrieves the font used for the main Salamander window BOOL CreateEnvFonts(); // fills EnvFont, EnvFontUL, EnvFontCharHeight and TooltipFont based on system metrics extern DWORD MouseHoverTime; // how long before highlighting occurs @@ -1420,7 +1428,7 @@ extern HBRUSH HSelectedBkBrush; // background of the selected panel item extern HBRUSH HFocSelBkBrush; // background of a focused and selected item extern HBRUSH HDialogBrush; // dialog background fill extern HBRUSH HButtonTextBrush; // button text -extern HBRUSH HDitherBrush; // 1-bit checkerboard; the color can be set via SetTextColor/SetBkColor +extern HBRUSH HDitherBrush; // 1-bit checkerboard pattern; the color can be set via SetTextColor/SetBkColor extern HBRUSH HActiveCaptionBrush; // background of the active panel title extern HBRUSH HInactiveCaptionBrush; // background of the inactive panel title @@ -1474,9 +1482,9 @@ enum CSymbolsImageListIndexes { symbolsExecutable, // 0: exe/bat/pif/com symbolsDirectory, // 1: dir - symbolsNonAssociated, // 2: unassociated file + symbolsNonAssociated, // 2: non-associated file symbolsAssociated, // 3: associated file - symbolsUpDir, // 4: up-dir ".." + symbolsUpDir, // 4: parent directory ".." symbolsArchive, // 5: archive symbolsCount // TERMINATOR }; @@ -1675,7 +1683,7 @@ BOOL StateImageList_Draw(CIconList* iconList, int imageIndex, HDC hDC, int xDst, DWORD state, CIconSizeEnum iconSize, DWORD iconOverlayIndex, const RECT* overlayRect, BOOL overlayOnly, BOOL iconOverlayFromPlugin, int pluginIconOverlaysCount, HICON* pluginIconOverlays); -DWORD GetImageListColorFlags(); // returns the ILC_COLOR flag suitable for the current Windows version when using image lists in list views +DWORD GetImageListColorFlags(); // returns the ILC_COLOR* flag for the current Windows version; tuned for using image lists in list views // The GetOpenFileName/GetSaveFileName APIs return FALSE and set // CommDlgExtendedError() to FNERR_INVALIDFILENAME when the file path in @@ -1686,7 +1694,7 @@ BOOL SafeGetOpenFileName(LPOPENFILENAME lpofn); BOOL SafeGetSaveFileName(LPOPENFILENAME lpofn); extern char DecimalSeparator[5]; // characters (max. 4) obtained from the system -extern int DecimalSeparatorLen; // length in characters without the terminating zero +extern int DecimalSeparatorLen; // length in characters without the terminating null extern char ThousandsSeparator[5]; extern int ThousandsSeparatorLen; @@ -1699,7 +1707,7 @@ extern int MenuNewExceptionHasOccured; // has the New menu crashed already? (may extern int FGIExceptionHasOccured; // has SHGetFileInfo crashed? extern int ICExceptionHasOccured; // has InvokeCommand crashed? extern int QCMExceptionHasOccured; // has QueryContextMenu crashed? -extern int OCUExceptionHasOccured; // has OleUninitialize or CoUninitialize crashed? +extern int OCUExceptionHasOccured; // has OleUninitialize or CoUninitialize failed? extern int GTDExceptionHasOccured; // has GetTargetDirectory crashed? extern int SHLExceptionHasOccured; // has something from ShellLib crashed? extern int RelExceptionHasOccured; // has any IUnknown::Release() call crashed? @@ -1736,8 +1744,8 @@ extern char WindowsDirectory[MAX_PATH]; // cached result of GetWindowsDirectory extern char RTCErrorDescription[RTC_ERROR_DESCRIPTION_SIZE]; //#endif // MSVC_RUNTIME_CHECKS -// path where we create the bug report and minidump: before Vista next to -// salamand.exe, in Vista and later in CSIDL_APPDATA + "\\Open Salamander" +// path where the bug report and minidump are created: before Vista, next to +// salamand.exe; in Vista and later, in CSIDL_APPDATA + "\\Open Salamander" extern char BugReportPath[MAX_PATH]; // name of the file that will be imported into the registry if it exists @@ -1749,7 +1757,7 @@ extern HWND PluginMsgBoxParent; // parent for plugin message boxes (main windo extern BOOL CriticalShutdown; // TRUE = "critical shutdown" in progress; no time to ask, exiting quickly, 5s until kill -// "translation" of POSIX names to MS +// "translation" of POSIX names to MS equivalents #define itoa _itoa #define stricmp _stricmp #define strnicmp _strnicmp @@ -2184,23 +2192,26 @@ extern HANDLE FileNamesEnumDone; #define FILENAMESENUM_TIMEOUT 1000 // timeout for delivering WM_USER_ENUMFILENAMES to the source window -// returns TRUE when the enumeration source is a panel and 'panel' receives -// PANEL_LEFT or PANEL_RIGHT; returns FALSE if the source cannot be found or it -// is a Find window +// returns TRUE if the enumeration source is a panel; 'panel' then receives +// PANEL_LEFT or PANEL_RIGHT. Returns FALSE if the enumeration source was not +// found or if it is a Find window BOOL IsFileEnumSourcePanel(int srcUID, int* panel); -// Retrieves the next file name for the viewer from the given source -// (left/right panel or Find window). 'srcUID' uniquely identifies the source. -// 'lastFileIndex' is an IN/OUT value used to track the current file and should -// be set to -1 when requesting the first file. 'lastFileName' contains the full -// name of the current file (empty if unknown). When 'preferSelected' is TRUE and -// at least one name is selected, only selected names are returned. If -// 'onlyAssociatedExtensions' is TRUE, only files associated with this plugin's -// viewer are returned (ignoring other plugins). 'fileName' receives the next file -// name (buffer size at least MAX_PATH). The function returns TRUE on success or -// FALSE on error: no more names (if 'noMoreFiles' is not NULL it becomes TRUE), -// the source is busy (if 'srcBusy' is not NULL it becomes TRUE), or the source no -// longer exists (path or sorting changed). +// Returns the next file name for the viewer from the source (left/right panel or Find window). +// 'srcUID' is the unique identifier of the source (it is passed as a parameter when opening +// the viewer). 'lastFileIndex' (must not be NULL) is an IN/OUT parameter that the plugin should +// change only if it wants to return the first file name; in that case, set 'lastFileIndex' +// to -1. The initial value of 'lastFileIndex' is passed as a parameter when opening the +// viewer. 'lastFileName' is the full name of the current file (an empty string if it is not +// known, for example if 'lastFileIndex' is -1). If 'preferSelected' is TRUE and at least one +// name is selected, selected names are returned. If 'onlyAssociatedExtensions' is TRUE, only +// files with an extension associated with this plugin's viewer are returned (pressing F3 on that +// file would attempt to open this plugin's viewer, and possible shadowing by another plugin's +// viewer is ignored). 'fileName' is the buffer for the retrieved name (size at least +// MAX_PATH). Returns TRUE if the name is retrieved successfully. Returns FALSE on error: there +// is no next file name in the source (if 'noMoreFiles' is not NULL, TRUE is returned in it), +// the source is busy (it is not processing messages; if 'srcBusy' is not NULL, TRUE is returned +// in it), or the source no longer exists (panel path changed, sorting changed, etc.). BOOL GetNextFileNameForViewer(int srcUID, int* lastFileIndex, const char* lastFileName, BOOL preferSelected, BOOL onlyAssociatedExtensions, char* fileName, BOOL* noMoreFiles, BOOL* srcBusy, @@ -2225,11 +2236,16 @@ BOOL GetPreviousFileNameForViewer(int srcUID, int* lastFileIndex, const char* la BOOL IsFileNameForViewerSelected(int srcUID, int lastFileIndex, const char* lastFileName, BOOL* isFileSelected, BOOL* srcBusy); -// Sets or clears the selection state of the current viewer file in the source -// (left/right panel or Find window). Parameters match -// IsFileNameForViewerSelected. Returns TRUE on success or FALSE if the source no -// longer exists, the file is missing, or the source is busy. When FALSE is -// returned 'srcBusy' indicates whether the source was busy. +// Sets or clears the selection of the current file from the viewer in the source +// (left/right panel or Find window); 'srcUID' is the unique identifier of the source +// (passed as a parameter when opening the viewer); 'lastFileIndex' is a parameter that +// the plugin should not modify, its initial value is passed as a parameter when opening +// the viewer; 'lastFileName' is the full name of the current file; 'select' is TRUE/FALSE +// depending on whether the current file should be selected/deselected; returns TRUE on +// success; returns FALSE on error: the source no longer exists (panel path changed, etc.) +// or the file 'lastFileName' is no longer in the source (for these two errors, if +// 'srcBusy' is not NULL, FALSE is returned in it), or the source is busy (not processing +// messages; for this error, if 'srcBusy' is not NULL, TRUE is returned in it). BOOL SetSelectionOnFileNameForViewer(int srcUID, int lastFileIndex, const char* lastFileName, BOOL select, BOOL* srcBusy); @@ -2356,7 +2372,7 @@ HWND GetTopLevelParent(HWND hWindow); //****************************************************************************** // variables used while saving the configuration during shutdown, logoff, or restart -// we must pump messages so the system does not kill us as a "not responding" application +// we must pump messages so the system does not terminate us as a "not responding" application class CWaitWindow; extern CWaitWindow* GlobalSaveWaitWindow; // if a global wait window for Save exists, it is stored here (otherwise NULL) extern int GlobalSaveWaitWindowProgress; // current progress value of the global wait window for Save @@ -2389,7 +2405,7 @@ void GetIfPathIsInaccessibleGoTo(char* path, BOOL forceIsMyDocs = FALSE); // loads icon overlay handler configuration from the registry void LoadIconOvrlsInfo(const char* root); -// returns TRUE if the icon overlay handler is disabled (or if all icon overlay handlers are disabled) +// returns TRUE if the icon overlay handler is disabled, or if custom icon overlays are disabled globally BOOL IsDisabledCustomIconOverlays(const char* name); // returns TRUE if the icon overlay handler is in the list of disabled icon overlay handlers From ee741cc70144a6b16e7557a52e5fc7ec3d547dcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 11:35:53 +0200 Subject: [PATCH 613/710] [translation] Fix src/thumbnl.cpp comments Refines translated comments in src/thumbnl.cpp. Model: OpenAI GPT-5.4 Verification: Full OSTranslation sequential review pipeline with requested review mode `codex`, actual review providers `codex`, `--prompt-log-mode summary`, `--copilot-event-log summary`, AST grounding through clang, Codex model `gpt-5.4` with `--codex-reasoning medium`, Copilot model `gpt-5.4`, and `--copilot-reasoning high`. 99 comment units, 99 review results, 99 resolved results, and 99 apply results. Branch-target comment guard passed for `src/thumbnl.cpp` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. `git diff --check -- src/thumbnl.cpp` completed without diff integrity failures. Telemetry: Cumulative across all provider stages: 11 provider calls, 26929 estimated tokens, and 0 billing units. Review stage actual providers: Codex-family 5 calls, 16681 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. Non-review stages: Codex-family 6 calls, 10248 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. --- src/thumbnl.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/thumbnl.cpp b/src/thumbnl.cpp index 650973a21..6d635b064 100644 --- a/src/thumbnl.cpp +++ b/src/thumbnl.cpp @@ -57,7 +57,7 @@ BOOL CShrinkImage::Alloc(DWORD origWidth, DWORD origHeight, // allocate and initialize the coefficients RowCoeff = CreateCoeff(origWidth, newWidth, NormCoeffX); ColCoeff = CreateCoeff(origHeight, newHeight, NormCoeffY); - // allocate and clear the accumulation buffer + // allocate and clear the buffer Buff = (DWORD*)malloc(3 * newWidth * sizeof(DWORD)); if (RowCoeff == NULL || ColCoeff == NULL || Buff == NULL) { @@ -120,7 +120,7 @@ CShrinkImage::CreateCoeff(DWORD origLen, WORD newLen, DWORD& norm) boundary = sum / newLen; // how much of the previous boundary belongs to the left part of this section lCoeff = norm - rCoeff; - // and finally the weight of the pixel at the section's right edge + // Weight of the pixel at the right edge of the section modulo = sum % newLen; if (modulo == 0) { @@ -424,8 +424,8 @@ void CSalamanderThumbnailMaker::Clear(int thumbnailMaxSize) Shrinker.Destroy(); } -// returns TRUE when the entire thumbnail is ready in this object (obtained -// successfully from the plugin) +// returns TRUE if the entire thumbnail is ready in this object (it was +// successfully obtained from the plugin) BOOL CSalamanderThumbnailMaker::ThumbnailReady() { return OriginalHeight != 0 && NextLine >= OriginalHeight && !Error; @@ -519,7 +519,7 @@ void CSalamanderThumbnailMaker::TransformThumbnail() } } -// convert the thumbnail we hold into a DDB and store its data into CThumbnailData +// Convert the held thumbnail to a DDB and store its data in CThumbnailData BOOL CSalamanderThumbnailMaker::RenderToThumbnailData(CThumbnailData* data) { // create a DDB and let it initialize with the thumbnail's RGB data From 01feb7ec7dac49d53a6c7b4fa86489771bb6d58d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 11:36:22 +0200 Subject: [PATCH 614/710] [translation] Fix src/tasklist.cpp comments Refines translated comments in src/tasklist.cpp. Model: OpenAI GPT-5.4 Verification: Full OSTranslation sequential review pipeline with requested review mode `codex`, actual review providers `codex`, `--prompt-log-mode summary`, `--copilot-event-log summary`, AST grounding through clang, Codex model `gpt-5.4` with `--codex-reasoning medium`, Copilot model `gpt-5.4`, and `--copilot-reasoning high`. 138 comment units, 138 review results, 138 resolved results, and 138 apply results. Branch-target comment guard passed for `src/tasklist.cpp` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. `git diff --check -- src/tasklist.cpp` completed without diff integrity failures. Telemetry: Cumulative across all provider stages: 31 provider calls, 112500 estimated tokens, and 0 billing units. Review stage actual providers: Codex-family 12 calls, 74652 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. Non-review stages: Codex-family 19 calls, 37848 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. --- src/tasklist.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/tasklist.cpp b/src/tasklist.cpp index 4fe93b4da..b54fc6a4b 100644 --- a/src/tasklist.cpp +++ b/src/tasklist.cpp @@ -62,7 +62,7 @@ void RaiseBreakException() DWORD WINAPI FControlThread(void* param) { - // this thread does not run with our CCallStack; when I investigated + // this thread does not run with our CCallStack; when investigating // a leaked handle, Salamander crashed while trying to dump it during shutdown CTaskList* tasklist = (CTaskList*)param; @@ -99,7 +99,7 @@ DWORD WINAPI FControlThread(void* param) if (waitRet == WAIT_FAILED || waitRet == WAIT_TIMEOUT) break; - // guard against looping after executing the command + // prevent looping after executing the command if (tasklist->ProcessList->TodoUID <= lastTodoUID) { // release ProcessList @@ -131,7 +131,7 @@ DWORD WINAPI FControlThread(void* param) if (tickCount - tasklist->ProcessList->TodoTimestamp >= TASKLIST_TODO_TIMEOUT) { // TIMEOUT - // release ProcessList + // release the ProcessList mutex ReleaseMutex(tasklist->FMOMutex); break; } @@ -154,7 +154,7 @@ DWORD WINAPI FControlThread(void* param) case TASKLIST_TODO_BREAK: { - SetEvent(tasklist->EventProcessed); // notification to the requesting process: we're done + SetEvent(tasklist->EventProcessed); // notification to the requesting process: done RaiseBreakException(); // the code never gets here @@ -164,7 +164,7 @@ DWORD WINAPI FControlThread(void* param) case TASKLIST_TODO_TERMINATE: { - SetEvent(tasklist->EventProcessed); // notification to the requesting process: we're done + SetEvent(tasklist->EventProcessed); // notify the requesting process that processing is complete HANDLE h = OpenProcess(PROCESS_TERMINATE, FALSE, pid); if (h != NULL) @@ -184,8 +184,8 @@ DWORD WINAPI FControlThread(void* param) ResetEvent(CommandLineParamsProcessed); NOHANDLES(LeaveCriticalSection(&CommandLineParamsCS)); - // if the main thread is IDLE, we poke it and force it to check CommandLineParams::RequestUID - // if it is not IDLE, it is already handling something and will process the message when it next enters IDLE + // if the main thread is idle, wake it up and force it to check CommandLineParams::RequestUID + // if it is not idle, it is handling something else and will process the message when it next enters idle if (HSafeMainWindow != NULL) PostMessage(HSafeMainWindow, WM_USER_WAKEUP_FROM_IDLE, 0, 0); @@ -268,7 +268,7 @@ BOOL CTaskList::Init() SECURITY_DESCRIPTOR sd; SECURITY_ATTRIBUTES* saPtr = CreateAccessableSecurityAttributes(&sa, &sd, GENERIC_ALL, &psidEveryone, &paclNewDacl); - //--- first a short detour: on Vista+ create an event used for communication with the copy hook (the control thread waits for it) + //--- first, a side note: on Vista and later, create an event for communication with the copy hook (the control thread waits for it) if (WindowsVistaAndLater) { SalShExtDoPasteEvent = NOHANDLES(CreateEvent(saPtr, TRUE, FALSE, SALSHEXT_DOPASTEEVENTNAME)); @@ -280,7 +280,7 @@ BOOL CTaskList::Init() //--- try to attach to the FMO mutex - also serves as a test whether any Salamander is already running FMOMutex = NOHANDLES(OpenMutex(SYNCHRONIZE, FALSE, AS_PROCESSLIST_MUTEX_NAME)); - if (FMOMutex == NULL) // we are the first Salamander 3.0 or newer in the local session + if (FMOMutex == NULL) // we are the first instance of Salamander 3.0 or newer in the local session { //--- create system objects for communication, claim the FMO FMOMutex = NOHANDLES(CreateMutex(saPtr, TRUE, AS_PROCESSLIST_MUTEX_NAME)); // the task list is valid only for the given session; the mutex lives in the local namespace @@ -295,7 +295,7 @@ BOOL CTaskList::Init() return FALSE; // fail Event = NOHANDLES(CreateEvent(saPtr, TRUE, FALSE, AS_PROCESSLIST_EVENT_NAME)); if (Event == NULL) - return FALSE; // fail + return FALSE; // failure EventProcessed = NOHANDLES(CreateEvent(saPtr, TRUE, FALSE, AS_PROCESSLIST_EVENT_PROCESSED_NAME)); if (EventProcessed == NULL) return FALSE; // fail @@ -311,7 +311,7 @@ BOOL CTaskList::Init() //--- release the FMO ReleaseMutex(FMOMutex); } - else // another instance, just attach ... + else // another instance, just connect ... { //--- claim the FMO DWORD waitRet = WaitForSingleObject(FMOMutex, TASKLIST_TODO_TIMEOUT); @@ -365,7 +365,7 @@ BOOL CTaskList::Init() char mutexName[1000]; if (sid == NULL) { - // failed to obtain SID -- local namespace without an attached SID + // failed to obtain the SID -- local namespace, without the SID appended _snprintf_s(mutexName, _TRUNCATE, "%s", FIRST_SALAMANDER_MUTEX_NAME); } else @@ -566,7 +566,7 @@ BOOL CTaskList::FireEvent(DWORD todo, DWORD pid, BOOL* timeouted) return FALSE; // fail } - // set the passed parameters + // set the parameters to pass ProcessList->Todo = todo; ProcessList->TodoUID++; ProcessList->TodoTimestamp = GetTickCount(); @@ -656,7 +656,7 @@ BOOL CTaskList::ActivateRunningInstance(const CCommandLineParams* cmdLineParams, { ReleaseMutex(FMOMutex); // so release the memory to others if (firstStarting == -1) - return FALSE; // no starting candidate found + return FALSE; // no starting candidate found, give up else Sleep(200); // found a starting candidate, pause for 200 ms to give it a chance to call SetProcessState() } @@ -675,7 +675,7 @@ BOOL CTaskList::ActivateRunningInstance(const CCommandLineParams* cmdLineParams, ProcessList->TodoTimestamp = GetTickCount(); ProcessList->PID = item->PID; - // take parameters from the command line + // copy parameters from the command line memcpy(&ProcessList->CommandLineParams, cmdLineParams, sizeof(CCommandLineParams)); // and set our internal variables ProcessList->CommandLineParams.Version = 1; From de1af6eb94c1517418cb9bade7eba24477c478aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 11:36:28 +0200 Subject: [PATCH 615/710] [translation] Fix src/menu.h comments Refines translated comments in src/menu.h. Model: OpenAI GPT-5.4 Verification: Full OSTranslation sequential review pipeline with requested review mode `codex`, actual review providers `codex`, `--prompt-log-mode summary`, `--copilot-event-log summary`, AST grounding through clang, Codex model `gpt-5.4` with `--codex-reasoning medium`, Copilot model `gpt-5.4`, and `--copilot-reasoning high`. 135 comment units, 135 review results, 135 resolved results, and 135 apply results. Branch-target comment guard passed for `src/menu.h` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. `git diff --check -- src/menu.h` completed without diff integrity failures. Telemetry: Cumulative across all provider stages: 14 provider calls, 130053 estimated tokens, and 0 billing units. Review stage actual providers: Codex-family 14 calls, 130053 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. Non-review stages: Codex-family 0 calls, 0 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. --- src/menu.h | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/menu.h b/src/menu.h index e27f90887..3df42ecf8 100644 --- a/src/menu.h +++ b/src/menu.h @@ -94,7 +94,7 @@ class CMenuSharedResources COLORREF HilightColor; COLORREF GrayTextColor; - // cache DC + // cache bitmap CBitmap* CacheBitmap; CBitmap* MonoBitmap; @@ -254,7 +254,7 @@ class CMenuPopup : public CWindow, public CGUIMenuPopupAbstract BOOL SelectedByMouse; // TRUE->ByMouse FALSE->ByKeyboard HIMAGELIST HImageList; HIMAGELIST HHotImageList; - int ImageWidth; // dimensions of one image from HImageList + int ImageWidth; // width of one image from HImageList int ImageHeight; DWORD ID; // copy of ID from CMenuItem BOOL Closing; // HideAll was called and we finish as soon as possible @@ -359,22 +359,22 @@ class CMenuPopup : public CWindow, public CGUIMenuPopupAbstract // 'hwnd' [in] Handle to the window that owns the shortcut menu. This window // receives all messages from the menu. The window does not receive a // WM_COMMAND message from the menu until the function returns. - // If you specify TPM_NONOTIFY in the fuFlags parameter, the function - // does not send messages to the window identified by hwnd. However, - // you still have to pass a window handle in hwnd. It can be any window - // handle from your application. + // If you specify MENU_TRACK_NONOTIFY in the 'trackFlags' parameter, the + // function does not send messages to the window identified by hwnd. + // However, you still have to pass a window handle in hwnd. It can be + // any window handle from your application. // // 'exclude' [in] Rectangle to exclude when positioning the menu, in screen // coordinates. This parameter can be NULL. // // Return Values: - // If you specify TPM_RETURNCMD in the 'flags' parameter, the return value is the - // menu-item identifier of the item that the user selected. If the user cancels - // the menu without making a selection, or if an error occurs, then the return - // value is zero. + // If you specify MENU_TRACK_RETURNCMD in the 'trackFlags' parameter, the return + // value is the menu-item identifier of the item that the user selected. If the + // user cancels the menu without making a selection, or if an error occurs, then + // the return value is zero. // - // If you do not specify TPM_RETURNCMD in the 'flags' parameter, the return value - // is nonzero if the function succeeds and zero if it fails. + // If you do not specify MENU_TRACK_RETURNCMD in the 'trackFlags' parameter, the + // return value is nonzero if the function succeeds and zero if it fails. virtual DWORD WINAPI Track(DWORD trackFlags, int x, int y, HWND hwnd, const RECT* exclude); virtual BOOL WINAPI GetItemRect(int index, RECT* rect); // returns bounding rectangle of the item in screen coordinates @@ -405,7 +405,7 @@ class CMenuPopup : public CWindow, public CGUIMenuPopupAbstract BOOL FindNextItemIndex(int fromIndex, BOOL topToDown, int* index); inline CMenuPopup* FindActivePopup(); // finds the last opened popup; returns a pointer to the object - inline CMenuPopup* FindPopup(HWND hWindow); // searches from this popup down to the last child; returns a pointer to the object or NULL + inline CMenuPopup* FindPopup(HWND hWindow); // searches from this popup down to the last child; returns a pointer to the popup object or NULL inline void DoDispatchMessage(MSG* msg, BOOL* leaveMenu, DWORD* retValue, BOOL* dispatchLater); void OnTimerTimeout(); void CheckSelectedPath(CMenuPopup* terminator); // traverses the whole branch and sets SelectedItems so they lead to the last popup @@ -489,7 +489,7 @@ class CMenuBar : public CWindow, public CGUIMenuBarAbstract BOOL Closing; // WM_USER_CLOSEMENU was called and we exit as soon as possible HANDLE HCloseEvent; // used to start the message queue BOOL MouseIsTracked; // is the mouse tracked using TrackMouseEvent? - BOOL HelpMode; // are we in Context Help mode (Shift+F1)? + BOOL HelpMode; // Context Help mode (Shift+F1)? // these two variables are used for cooperation between MenuBar and MenuPopup // they are set in CMenuPopup::TrackInternal and determine further behavior @@ -501,7 +501,7 @@ class CMenuBar : public CWindow, public CGUIMenuBarAbstract BOOL ExitMenuLoop; // TRUE to exit MenuLoop BOOL HelpMode2; // did we receive WM_USER_HELP_MOUSEMOVE and wait for // WM_USER_HELP_MOUSELEAVE? (we must highlight the item under the cursor) - WORD UIState; // accelerator display state + WORD UIState; // accelerator display BOOL ForceAccelVisible; public: From a31ff512498f3119c86d379cc9dba649d6b85d49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 11:36:33 +0200 Subject: [PATCH 616/710] [translation] Fix src/tasklist.h comments Refines translated comments in src/tasklist.h. Model: OpenAI GPT-5.4 Verification: Full OSTranslation sequential review pipeline with requested review mode `codex`, actual review providers `codex`, `--prompt-log-mode summary`, `--copilot-event-log summary`, AST grounding through clang, Codex model `gpt-5.4` with `--codex-reasoning medium`, Copilot model `gpt-5.4`, and `--copilot-reasoning high`. 59 comment units, 59 review results, 59 resolved results, and 59 apply results. Branch-target comment guard passed for `src/tasklist.h` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. `git diff --check -- src/tasklist.h` completed without diff integrity failures. Telemetry: Cumulative across all provider stages: 4 provider calls, 20287 estimated tokens, and 0 billing units. Review stage actual providers: Codex-family 4 calls, 20287 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. Non-review stages: Codex-family 0 calls, 0 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. --- src/tasklist.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tasklist.h b/src/tasklist.h index 178328d02..1073a3786 100644 --- a/src/tasklist.h +++ b/src/tasklist.h @@ -134,7 +134,7 @@ class CTaskList // Fills the task-list items; 'items' is an array of at least MAX_TL_ITEMS CProcessListItem structures; returns the number of items // 'items' can be NULL if only 'itemsStateUID' is needed - // Returns the "version" of the process list; the version increases with every change to the list (when an item is added or removed) + // 'itemsStateUID' returns the "version" of the process list; the version increases with every change to the list (when an item is added or removed) // Used by the dialog to know when to refresh the list; 'itemsStateUID' can be NULL // If 'timeouted' is not NULL, it is set to indicate whether the failure was caused by a timeout while waiting for shared memory int GetItems(CProcessListItem* items, DWORD* itemsStateUID, BOOL* timeouted = NULL); From 7e15f94c9b857610905a4c2dab9f2ac358871447 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 11:36:39 +0200 Subject: [PATCH 617/710] [translation] Fix src/fileswnb.cpp comments Refines translated comments in src/fileswnb.cpp. Model: OpenAI GPT-5.4 Verification: Full OSTranslation sequential review pipeline with requested review mode `codex`, actual review providers `codex`, `--prompt-log-mode summary`, `--copilot-event-log summary`, AST grounding through clang, Codex model `gpt-5.4` with `--codex-reasoning medium`, Copilot model `gpt-5.4`, and `--copilot-reasoning high`. 197 comment units, 197 review results, 197 resolved results, and 197 apply results. Branch-target comment guard passed for `src/fileswnb.cpp` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. `git diff --check -- src/fileswnb.cpp` completed without diff integrity failures. Telemetry: Cumulative across all provider stages: 38 provider calls, 332223 estimated tokens, and 0 billing units. Review stage actual providers: Codex-family 23 calls, 216035 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. Non-review stages: Codex-family 15 calls, 116188 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. --- src/fileswnb.cpp | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/fileswnb.cpp b/src/fileswnb.cpp index 3a74698c3..873114f0f 100644 --- a/src/fileswnb.cpp +++ b/src/fileswnb.cpp @@ -26,7 +26,7 @@ extern "C" // define the "Lock Volume" event GUID (e.g., "chkdsk /f E:" where E: is a USB stick): {50708874-C9AF-11D1-8FEF-00A0C9A06D32} GUID GUID_IO_LockVolume = {0x50708874, 0xC9AF, 0x11D1, 0x8F, 0xEF, 0x00, 0xA0, 0xC9, 0xA0, 0x6D, 0x32}; // -// in Ioevent.h from the DDK, this constant (and many others) is defined: +// Ioevent.h from the DDK defines this constant (and many others): // // Volume lock event. This event is signalled when an attempt is made to // lock a volume. There is no additional data. @@ -239,7 +239,7 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) { // count how many directories are selected (the rest of the marked items are files) int i; - for (i = 0; i < Dirs->Count; i++) // ".." cannot be selected, so the test would be pointless + for (i = 0; i < Dirs->Count; i++) // ".." cannot be selected, so the test would be unnecessary { if (Dirs->At(i).Selected) selectedDirs++; @@ -278,16 +278,16 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (ret && !cancelOrHandlePath) { - if (targetPath[0] != 0) // change the focus to 'targetPath' + if (targetPath[0] != 0) // change focus to 'targetPath' { lstrcpyn(NextFocusName, targetPath, MAX_PATH); // RefreshDirectory may not run; the source may be unchanged, so post a message just in case PostMessage(HWindow, WM_USER_DONEXTFOCUS, 0, 0); } - // successful operation, but do not deselect the source because this is drag&drop + // successful operation, but do not clear the source selection because this is drag and drop // SetSel(FALSE, -1, TRUE); // explicit redraw - // PostMessage(HWindow, WM_USER_SELCHANGED, 0, 0); // sel-change notify + // PostMessage(HWindow, WM_USER_SELCHANGED, 0, 0); // selection-change notification UpdateWindow(MainWindow->HWindow); } @@ -401,7 +401,7 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) else PostMessage(HWindow, WM_USER_REFRESH_DIR_EX_DELAYED, FALSE, lParam); } - else // waiting for WM_USER_REFRESH_DIR_EX_DELAYED to be sent + else // waiting for WM_USER_REFRESH_DIR_EX_DELAYED to be posted { if (RefreshDirExLParam < lParam) // take the "newer" time RefreshDirExLParam = lParam; @@ -504,7 +504,7 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) lParam = RefreshAfterIconsReadingTime; wParam = FALSE; // do not trigger RefreshFinishedEvent setWait = FALSE; - probablyUselessRefresh = TRUE; // probably just a refresh wrongly triggered by the system after loading icons from a network drive + probablyUselessRefresh = TRUE; // probably just a refresh incorrectly triggered by the system after loading icons from a network drive // TRACE_I("delayed refresh (after reading of all icons): probablyUselessRefresh=TRUE"); } else @@ -536,12 +536,12 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) { if (GetTickCount() - EndOfIconReadingTime < 1000) { - probablyUselessRefresh = TRUE; // for one second after icon reading finishes, we still expect a redundant refresh caused by reading icons + probablyUselessRefresh = TRUE; // for one second after icon reading finishes, we still expect a redundant refresh caused by icon reading // TRACE_I("less than second after reading of icons was finished: probablyUselessRefresh=TRUE"); } else { - probablyUselessRefresh = (uMsg == WM_USER_REFRESH_DIR_EX_DELAYED || uMsg == WM_USER_INACTREFRESH_DIR); // deferred refresh that may also be useless (prevents an endless loop when reading icons on network drives triggers more refreshes) + probablyUselessRefresh = (uMsg == WM_USER_REFRESH_DIR_EX_DELAYED || uMsg == WM_USER_INACTREFRESH_DIR); // deferred refresh that may also be unnecessary (this prevents an infinite loop when reading icons on network drives triggers additional refreshes) // TRACE_I("WM_USER_REFRESH_DIR_EX_DELAYED or WM_USER_INACTREFRESH_DIR: probablyUselessRefresh=" << probablyUselessRefresh); } } @@ -569,7 +569,7 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) } else // not a refresh during suspend mode { - if (lParam >= LastRefreshTime) // not an unnecessary old refresh + if (lParam >= LastRefreshTime) // not a stale refresh { BOOL isInactiveRefresh = FALSE; BOOL skipRefresh = FALSE; @@ -580,7 +580,7 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) { // TRACE_I("Refresh from snooper in inactive window"); isInactiveRefresh = TRUE; - if (LastInactiveRefreshStart != LastInactiveRefreshEnd) // some refresh already happened since the last deactivation + if (LastInactiveRefreshStart != LastInactiveRefreshEnd) // a refresh has already occurred since the last deactivation { DWORD delay = 20 * (LastInactiveRefreshEnd - LastInactiveRefreshStart); // TRACE_I("Calculated delay between refreshes is " << delay); @@ -642,7 +642,7 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (isInactiveRefresh) { if (typeBackup != GetPanelType() || StrICmp(pathBackup, GetPath()) != 0) - { // if the path changed (someone likely deleted the directory shown in the panel), perform any further refresh immediately (the newly shown directory might be deleted as well, so we can quickly "back out" from it) + { // if the path changed (most likely because someone just deleted the directory shown in the panel), perform any further refresh immediately (the newly displayed directory may be deleted as well, so we can back out of it quickly) LastInactiveRefreshEnd = LastInactiveRefreshStart; } else @@ -652,7 +652,7 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) LastInactiveRefreshEnd = LastInactiveRefreshStart + 1; // must not be equal (this means "no refresh yet") } } - /* // Petr: I do not know why LastRefreshTime was set only here - logically if a change occurs during a refresh, another refresh is necessary - it failed in Nethood because the enumeration thread posted a refresh before RefreshDirectory finished, so it was ignored (a refresh during a refresh) + /* // Petr: It is unclear why LastRefreshTime was set only here. If a change occurs during a refresh, another refresh is required. This caused problems in Nethood because the enumeration thread posted a refresh before RefreshDirectory finished, so it was ignored as a refresh during a refresh. HANDLES(EnterCriticalSection(&TimeCounterSection)); LastRefreshTime = MyTimeCounter++; HANDLES(LeaveCriticalSection(&TimeCounterSection)); @@ -672,8 +672,8 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_USER_REFRESH_PLUGINFS: { if (SnooperSuspended || StopRefresh) - { // suspend mode is already on (working with internal data -> cannot refresh) - // moreover we might be inside a plugin -> multiple calls to plugin methods are not supported + { // suspend mode is already active (working with internal data -> cannot refresh) + // moreover, we might also be inside a plugin -> multiple calls to plugin methods are not supported PluginFSNeedRefreshAfterEndOfSM = TRUE; } else @@ -763,7 +763,7 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) } // redraw the affected index - if (file != NULL) // file is used here only as a NULL check + if (file != NULL) // file is used here only to test for NULL { if (!StopIconRepaint) // if icon repainting is allowed RepaintIconOnly((int)wParam); @@ -867,7 +867,7 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_USER_DONEXTFOCUS: // if RefreshDirectory did not manage it already, do it here { DontClearNextFocusName = FALSE; - if (NextFocusName[0] != 0) // if there is anything to focus + if (NextFocusName[0] != 0) // if there is something to focus { int total = Files->Count + Dirs->Count; int found = -1; @@ -1082,7 +1082,7 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) { HANDLES(EnterCriticalSection(&FileNamesEnumDataSect)); - if (InactiveRefreshTimerSet) // if a refresh is delayed here, execute it now, otherwise enumeration would use outdated listing; a longer delay is fine, GetFileNameForViewer waits for the result... + if (InactiveRefreshTimerSet) // if a refresh is pending here, execute it now; otherwise enumeration would use an outdated listing; a longer delay is fine, GetFileNameForViewer waits for the result... { // TRACE_I("Refreshing during enumeration (refresh in inactive window was delayed)"); KillTimer(HWindow, IDT_INACTIVEREFRESH); @@ -1098,7 +1098,7 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (Files != NULL && Is(ptDisk)) { BOOL selExists = FALSE; - if (FileNamesEnumData.PreferSelected) // if needed, check whether a selection exists + if (FileNamesEnumData.PreferSelected) // if needed, check whether anything is selected { int i; for (i = 0; i < Files->Count; i++) @@ -1114,7 +1114,7 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) int index = FileNamesEnumData.LastFileIndex; int count = Files->Count; BOOL indexNotFound = TRUE; - if (index == -1) // search from the first or the last item + if (index == -1) // searching from the first or last item { if (FileNamesEnumData.RequestType == fnertFindPrevious) index = count; // searching for the previous item + start at the last item @@ -1165,7 +1165,7 @@ CFilesWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) BOOL onlyAssociatedExtensions = FALSE; if (FileNamesEnumData.OnlyAssociatedExtensions) // does the viewer request filtering by associated extensions? { - if (FileNamesEnumData.Plugin != NULL) // viewer from plugin + if (FileNamesEnumData.Plugin != NULL) // viewer from a plugin { int pluginIndex = Plugins.GetIndex(FileNamesEnumData.Plugin); if (pluginIndex != -1) // "always true" @@ -1450,8 +1450,8 @@ MENU_TEMPLATE_ITEM SortByMenu[] = }; */ - // temporary solution for 1.6 beta 6: always populate (regardless of ValidFileData) - // the Name, Ext, Date, and Size items + // temporary solution for 1.6 beta 6: always populate the + // Name, Ext, Date, and Size entries (regardless of ValidFileData) // the order must correspond to the CSortType enum int textResID[5] = {IDS_COLUMN_MENU_NAME, IDS_COLUMN_MENU_EXT, IDS_COLUMN_MENU_TIME, IDS_COLUMN_MENU_SIZE, IDS_COLUMN_MENU_ATTR}; int leftCmdID[5] = {CM_LEFTNAME, CM_LEFTEXT, CM_LEFTTIME, CM_LEFTSIZE, CM_LEFTATTR}; From 7d5c168c2fc05e9b229607cd255d685e2d986699 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 11:37:02 +0200 Subject: [PATCH 618/710] [translation] Fix src/keyboard.cpp comments Refines translated comments in src/keyboard.cpp. Model: OpenAI GPT-5.4 Verification: Full OSTranslation sequential review pipeline with requested review mode `codex`, actual review providers `codex`, `--prompt-log-mode summary`, `--copilot-event-log summary`, AST grounding through clang, Codex model `gpt-5.4` with `--codex-reasoning medium`, Copilot model `gpt-5.4`, and `--copilot-reasoning high`. 340 comment units, 340 review results, 340 resolved results, and 340 apply results. Branch-target comment guard passed for `src/keyboard.cpp` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. `git diff --check -- src/keyboard.cpp` completed without diff integrity failures. Telemetry: Cumulative across all provider stages: 23 provider calls, 355511 estimated tokens, and 0 billing units. Review stage actual providers: Codex-family 14 calls, 158060 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. Non-review stages: Codex-family 9 calls, 197451 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. --- src/keyboard.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/keyboard.cpp b/src/keyboard.cpp index 46386b40d..189a6346d 100644 --- a/src/keyboard.cpp +++ b/src/keyboard.cpp @@ -149,7 +149,7 @@ BOOL IsSalHotKey(WORD hotKey) { case NONE: // up case CONTROL: // scroll up, keep cursor - case ALT: // up to selected item + case ALT: // move to the selected item case SHIFT: // select + up found = TRUE; } @@ -176,7 +176,7 @@ BOOL IsSalHotKey(WORD hotKey) { case NONE: // down case CONTROL: // scroll down, keep cursor - case ALT: // down to selected item + case ALT: // move down to the selected item case SHIFT: // select + down found = TRUE; } @@ -513,7 +513,7 @@ BOOL IsSalHotKey(WORD hotKey) switch (mods) { case NONE: // quick search/type in command line - case CONTROL: // files list + case CONTROL: // file list case ALT: // enter menu case SHIFT: // change drive found = TRUE; @@ -786,8 +786,8 @@ BOOL IsSalHotKey(WORD hotKey) case NONE: // edit case CONTROL: // sort by extension case ALT: // exit - case SHIFT: // edit new - case CONTROL_SHIFT: // edit width + case SHIFT: // edit new file + case CONTROL_SHIFT: // edit in wide mode found = TRUE; } break; From 87d8e3ffd1bca87f2eb6ca41789e773c78581a7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Mon, 20 Apr 2026 11:37:07 +0200 Subject: [PATCH 619/710] [translation] Fix src/md5.cpp comments Refines translated comments in src/md5.cpp. Model: OpenAI GPT-5.4 Verification: Full OSTranslation sequential review pipeline with requested review mode `codex`, actual review providers `codex`, `--prompt-log-mode summary`, `--copilot-event-log summary`, AST grounding through clang, Codex model `gpt-5.4` with `--codex-reasoning medium`, Copilot model `gpt-5.4`, and `--copilot-reasoning high`. 104 comment units, 104 review results, 104 resolved results, and 104 apply results. Branch-target comment guard passed for `src/md5.cpp` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. `git diff --check -- src/md5.cpp` completed without diff integrity failures. Telemetry: Cumulative across all provider stages: 10 provider calls, 164814 estimated tokens, and 0 billing units. Review stage actual providers: Codex-family 5 calls, 98133 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. Non-review stages: Codex-family 5 calls, 66681 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. --- src/md5.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/md5.cpp b/src/md5.cpp index cf30b7d72..9dd8e766d 100644 --- a/src/md5.cpp +++ b/src/md5.cpp @@ -56,12 +56,12 @@ void MD5::update(uint1* input, uint4 input_length) input_index += 64) transform(input + input_index); - buffer_index = 0; // so we can buffer remaining + buffer_index = 0; // so we can buffer the remaining input } else input_index = 0; // so we can buffer the whole input - // and here we do the buffering: + // Buffer the input here: memcpy(buffer + buffer_index, input + input_index, input_length - input_index); } From c31e49f8ba1b8d37899899f10b163877028ced49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 02:33:57 +0200 Subject: [PATCH 620/710] [translation] Fix src/plugins/shared/lukas/killdbg.h comments (#999) --- src/plugins/shared/lukas/killdbg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/shared/lukas/killdbg.h b/src/plugins/shared/lukas/killdbg.h index 008a43952..ac5d9bd4f 100644 --- a/src/plugins/shared/lukas/killdbg.h +++ b/src/plugins/shared/lukas/killdbg.h @@ -6,7 +6,7 @@ // **************************************************************************** // -// Eliminace TRACE a CALL-STACK pro projekty, ktere to nepodporuji +// Eliminate TRACE and CALL-STACK for projects that do not support them // **************************************************************************** // From 45294c7b16d58dc51ded810240ed7f7bdf37104d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 02:34:01 +0200 Subject: [PATCH 621/710] [translation] Fix src/plugins/shared/spl_view.h comments (#1000) --- src/plugins/shared/spl_view.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/shared/spl_view.h b/src/plugins/shared/spl_view.h index 809bbcb93..f4788afe9 100644 --- a/src/plugins/shared/spl_view.h +++ b/src/plugins/shared/spl_view.h @@ -39,14 +39,14 @@ class CPluginInterfaceForViewerAbstract // Called when the viewer is requested to open and load file // 'name'; 'left'+'top'+'width'+'height'+'showCmd'+'alwaysOnTop' is the recommended window placement; // window; if 'returnLock' is FALSE, 'lock'+'lockOwner' have no meaning; if 'returnLock' is - // TRUE, mel by viewer vratit system-event 'lock' v nonsignaled stavu, do signaled stavu 'lock' + // TRUE, the viewer should return system event 'lock' in the nonsignaled state; 'lock' // becomes signaled when viewing file 'name' ends (the file is removed from the temporary // directory at that moment); it should also return TRUE in 'lockOwner' if the 'lock' object is to be closed // by the caller (FALSE means the viewer closes 'lock' itself - in that case the viewer must use // CSalamanderGeneralAbstract::UnlockFileInCache to make 'lock' signaled); // if the viewer does not set 'lock' (it remains NULL), file 'name' is valid only until this // ViewFile call ends; if 'viewerData' is not NULL, it passes extended viewer parameters (see - // CSalamanderGeneralAbstract::ViewFileInPluginViewer); 'enumFilesSourceUID' je UID zdroje (panelu + // CSalamanderGeneralAbstract::ViewFileInPluginViewer); 'enumFilesSourceUID' is the source UID (panel // or Find window) from which the viewer is opened; if it is -1, the source is unknown (archives // or file systems, or Alt+F11, etc.) - see e.g. CSalamanderGeneralAbstract::GetNextFileNameForViewer; // 'enumFilesCurrentIndex' is the index of the opened file in the source (panel or Find window); if it is -1, From 6a9bdd14bde55297b66e2a510ef36edd26e00429 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 02:34:04 +0200 Subject: [PATCH 622/710] [translation] Fix src/plugins/shared/mhandles.h comments (#1001) --- src/plugins/shared/mhandles.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/shared/mhandles.h b/src/plugins/shared/mhandles.h index 40b5aca5a..3a7b2d2f5 100644 --- a/src/plugins/shared/mhandles.h +++ b/src/plugins/shared/mhandles.h @@ -13,12 +13,12 @@ #pragma once // MHANDLES_ENABLE macro - enables handle monitoring -// POZOR: volat HANDLES_CAN_USE_TRACE() tesne po inicializaci "dbg.h" modulu +// WARNING: call HANDLES_CAN_USE_TRACE() immediately after initializing the "dbg.h" module // (after SalamanderDebug and SalamanderVersion have been initialized) // WARNING: MHANDLES are initialized/destroyed at the "lib" level; if a plugin // uses the "lib" (or "compiler") level, it must ensure that MHANDLES are not // used at those levels (see #pragma init_seg (lib)) -// POZNAMKA: pro snazsi rozmisteni maker HANDLES() a HANDLES_Q() pouzijte program CheckHnd.exe +// NOTE: use CheckHnd.exe to simplify the placement of HANDLES() and HANDLES_Q() macros #define NOHANDLES(function) function From 460f852be980ec84f866a1a570b4ede0cfe25af7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 02:34:08 +0200 Subject: [PATCH 623/710] [translation] Fix src/plugins/shared/lukas/utilaux.cpp comments (#1002) --- src/plugins/shared/lukas/utilaux.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/shared/lukas/utilaux.cpp b/src/plugins/shared/lukas/utilaux.cpp index 92caf474b..46a5e74e9 100644 --- a/src/plugins/shared/lukas/utilaux.cpp +++ b/src/plugins/shared/lukas/utilaux.cpp @@ -286,16 +286,16 @@ BOOL SalGetFullName(char* name, int* errTextID, const char* curDir) else // "c:path..." { /* - int l1 = strlen(s + 2); // delka zbytku ("path...") + int l1 = strlen(s + 2); // length of the remainder ("path...") if (SalamanderGeneral->CharToLowerCase(*s) >= 'a' && SalamanderGeneral->CharToLowerCase(*s) <= 'z') { const char *head; if (curDir != NULL && SalamanderGeneral->CharToLowerCase(curDir[0]) == SalamanderGeneral->CharToLowerCase(*s)) head = curDir; else head = DefaultDir[LowerCase[*s] - 'a']; int l2 = strlen(head); - if (head[l2 - 1] != '\\') l2++; // misto pro '\\' + if (head[l2 - 1] != '\\') l2++; // room for '\\' if (l1 + l2 >= MAX_PATH) err = GFN_TOOLONGPATH; - else // sestaveni full path + else // build the full path { memmove(name + l2, s + 2, l1 + 1); *(name + l2 - 1) = '\\'; From bb22178a12b82c899bac2db38e75759d27555822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 02:34:12 +0200 Subject: [PATCH 624/710] [translation] Fix src/salamdr1.cpp comments (#1010) --- src/salamdr1.cpp | 1237 +++++++++++++++++++++++----------------------- 1 file changed, 622 insertions(+), 615 deletions(-) diff --git a/src/salamdr1.cpp b/src/salamdr1.cpp index 7a7e8af2a..f08059c0a 100644 --- a/src/salamdr1.cpp +++ b/src/salamdr1.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" #include @@ -46,11 +47,11 @@ extern "C" #include "execute.h" #include "drivelst.h" -#pragma comment(linker, "/ENTRY:MyEntryPoint") // chceme vlastni vstupni bod do aplikace +#pragma comment(linker, "/ENTRY:MyEntryPoint") // we want a custom entry point for the application #pragma comment(lib, "UxTheme.lib") -// zpristupnime si puvodni vstupni bod aplikace +// Make the application's original entry point available. extern "C" int WinMainCRTStartup(); #ifdef X64_STRESS_TEST @@ -61,64 +62,65 @@ LPVOID X64StressTestPointers[X64_STRESS_TEST_ALLOC_COUNT]; void X64StressTestAlloc() { - // v teto chvili jiz loader nacetl EXE a RTL a v inicializaci RTL doslo k vytvoreni a alokaci heapu, - // ktery lezi na adresach pod 4GB; abychom dalsi alokace vystrcili nahoru nad 4GB, muysime zabrat spodek - // virtualni pameti a pak nasledne donutit RTL pomoci alokaci k rozsireni jeho heapu + // At this point the loader has already loaded the EXE and the RTL, and RTL initialization + // has already created and allocated a heap that lives below 4 GB. To push subsequent + // allocations above 4 GB, we have to reserve the lower part of the virtual address space + // and then force the RTL to expand its heap by making allocations. // - // zabereme prostor ve virtualni pameti + // Reserve space in the virtual address space. UINT64 vaAllocated = 0; _int64 allocSize[] = {10000000, 1000000, 100000, 10000, 1000, 100, 10, 1, 0}; for (int i = 0; allocSize[i] != 0; i++) - while (VirtualAlloc(0, allocSize[i], MEM_RESERVE, PAGE_NOACCESS) <= (LPVOID)(UINT_PTR)0x00000000ffffffff) // pri pristupu chceme exception a nechceme MEM_COMMIT, at zbytecne nezerem + while (VirtualAlloc(0, allocSize[i], MEM_RESERVE, PAGE_NOACCESS) <= (LPVOID)(UINT_PTR)0x00000000ffffffff) // If this memory is accessed, we want an exception, and we do not want MEM_COMMIT so we do not waste memory unnecessarily. vaAllocated += allocSize[i]; - // nyni nafoukneme RTL heap + // Now fill up the RTL heap. UINT64 rtlAllocated = 0; _int64 rtlAllocSize[] = {10000000, 1000000, 100000, 10000, 1000, 100, 10, 1, 0}; for (int i = 0; rtlAllocSize[i] != 0; i++) while (_malloc_dbg(rtlAllocSize[i], _CRT_BLOCK, __FILE__, __LINE__) <= (LPVOID)(UINT_PTR)0x00000000ffffffff) rtlAllocated += rtlAllocSize[i]; - // kontrola uspechu - void* testNew = new char; // new jede pres alloc, ale radeji take overime + // check for success + void* testNew = new char; // new uses alloc too, but let's verify that as well if (testNew <= (LPVOID)(UINT_PTR)0x00000000ffffffff) MessageBox(NULL, "new address <= 0x00000000ffffffff!\nPlease contact jan.rysavy@altap.cz with this information.", "X64_STRESS_TEST", MB_OK | MB_ICONEXCLAMATION); delete testNew; } #endif //X64_STRESS_TEST -// nas vlastni vstupni bod, o ktery jsme si pozadali linker pomoci pragmy +// our own entry point, which we told the linker to use via pragma int MyEntryPoint() { #ifdef X64_STRESS_TEST - // alokacema vyzereme spodni 4GB pameti, aby dalsi alokace mely ukazatele vetsi nez DWORD + // Consume the lower 4 GB of address space so later allocations get pointers larger than a DWORD. X64StressTestAlloc(); #endif //X64_STRESS_TEST int ret = 1; // error - // spustime Salmon, chceme aby pochytal maximum nasich padu + // Start Salmon so it can catch as many of our crashes as possible if (SalmonInit()) { - // zavolame puvodni entry point aplikace a spustime tim program + // call the application's original entry point to start the program ret = WinMainCRTStartup(); } else MessageBox(NULL, "Open Salamander Bug Reporter (salmon.exe) initialization has failed. Please reinstall Open Salamander.", SALAMANDER_TEXT_VERSION, MB_OK | MB_ICONSTOP); - // sem uz mi debugger nechodi, sestreli nas v RTL (testovano pod VC 2008 s nasim RTL) + // the debugger no longer gets this far; we crash in the RTL (tested with VC 2008 and our RTL) - // koncime + // done return ret; } -BOOL SalamanderBusy = TRUE; // je Salamander busy? -DWORD LastSalamanderIdleTime = 0; // GetTickCount() z okamziku, kdy SalamanderBusy naposledy presel na TRUE +BOOL SalamanderBusy = TRUE; // Is Salamander busy? +DWORD LastSalamanderIdleTime = 0; // GetTickCount() value from when SalamanderBusy last changed to TRUE -int PasteLinkIsRunning = 0; // pokud je vetsi nez nula, probiha prave Past Shortcuts prikaz v jednom z panelu +int PasteLinkIsRunning = 0; // if greater than zero, the Paste Shortcuts command is currently running in one of the panels -BOOL CannotCloseSalMainWnd = FALSE; // TRUE = nesmi dojit k zavreni hlavniho okna +BOOL CannotCloseSalMainWnd = FALSE; // TRUE = the main window must not be closed DWORD MainThreadID = -1; @@ -131,14 +133,14 @@ int GTDExceptionHasOccured = 0; int SHLExceptionHasOccured = 0; int RelExceptionHasOccured = 0; -char DecimalSeparator[5] = "."; // "znaky" (max. 4 znaky) vytazene ze systemu -int DecimalSeparatorLen = 1; // delka ve znacich bez nuly na konci +char DecimalSeparator[5] = "."; // characters retrieved from the system (max. 4 characters) +int DecimalSeparatorLen = 1; // length in characters, excluding the terminating null char ThousandsSeparator[5] = " "; int ThousandsSeparatorLen = 1; -BOOL WindowsXP64AndLater = FALSE; // JRYFIXME - zrusit -BOOL WindowsVistaAndLater = FALSE; // JRYFIXME - zrusit -BOOL Windows7AndLater = FALSE; // JRYFIXME - zrusit +BOOL WindowsXP64AndLater = FALSE; // JRYFIXME - remove +BOOL WindowsVistaAndLater = FALSE; // JRYFIXME - remove this +BOOL Windows7AndLater = FALSE; // JRYFIXME - remove BOOL Windows8AndLater = FALSE; BOOL Windows8_1AndLater = FALSE; BOOL Windows10AndLater = FALSE; @@ -189,14 +191,14 @@ const char* CommonFileTypeName2 = NULL; char WindowsDirectory[MAX_PATH] = ""; -// pro zajisteni uniku z odstranenych drivu na fixed drive (po vysunuti device - USB flash disk, atd.) -BOOL ChangeLeftPanelToFixedWhenIdleInProgress = FALSE; // TRUE = prave se meni cesta, nastaveni ChangeLeftPanelToFixedWhenIdle na TRUE je zbytecne +// Ensures escape from removed drives to a fixed drive after a device is ejected (USB flash drive, etc.). +BOOL ChangeLeftPanelToFixedWhenIdleInProgress = FALSE; // TRUE = the path is currently being changed; setting ChangeLeftPanelToFixedWhenIdle to TRUE is unnecessary BOOL ChangeLeftPanelToFixedWhenIdle = FALSE; -BOOL ChangeRightPanelToFixedWhenIdleInProgress = FALSE; // TRUE = prave se meni cesta, nastaveni ChangeRightPanelToFixedWhenIdle na TRUE je zbytecne +BOOL ChangeRightPanelToFixedWhenIdleInProgress = FALSE; // TRUE = the path is currently being changed; setting ChangeRightPanelToFixedWhenIdle to TRUE is unnecessary BOOL ChangeRightPanelToFixedWhenIdle = FALSE; -BOOL OpenCfgToChangeIfPathIsInaccessibleGoTo = FALSE; // TRUE = v idle otevre konfiguraci na Drives a focusne "If path in panel is inaccessible, go to:" +BOOL OpenCfgToChangeIfPathIsInaccessibleGoTo = FALSE; // TRUE = when idle, opens the configuration on Drives and focuses "If path in panel is inaccessible, go to:" -char IsSLGIncomplete[ISSLGINCOMPLETE_SIZE]; // pokud je retezec prazdny, SLG je kompletne prelozene; jinak obsahuje URL na forum do sekce daneho jazyka +char IsSLGIncomplete[ISSLGINCOMPLETE_SIZE]; // If the string is empty, the SLG is fully translated; otherwise it contains the URL of the forum section for that language. UINT TaskbarBtnCreatedMsg = 0; @@ -217,7 +219,7 @@ const char* CMAINWINDOW_CLASSNAME = "SalamanderMainWindowVer25"; const char* SAVEBITS_CLASSNAME = "SalamanderSaveBits"; const char* SHELLEXECUTE_CLASSNAME = "SalamanderShellExecute"; -CAssociations Associations; // asociace nactene z registry +CAssociations Associations; // associations loaded from the registry CShares Shares; char DefaultDir['Z' - 'A' + 1][MAX_PATH]; @@ -225,15 +227,15 @@ char DefaultDir['Z' - 'A' + 1][MAX_PATH]; HACCEL AccelTable1 = NULL; HACCEL AccelTable2 = NULL; -HINSTANCE NtDLL = NULL; // handle k ntdll.dll -HINSTANCE Shell32DLL = NULL; // handle k shell32.dll (ikonky) -HINSTANCE ImageResDLL = NULL; // handle k imageres.dll (ikonky - Vista) -HINSTANCE User32DLL = NULL; // handle k user32.dll (DisableProcessWindowsGhosting) -HINSTANCE HLanguage = NULL; // handle k jazykove zavislym resourcum (.SPL souboru) -char CurrentHelpDir[MAX_PATH] = ""; // po prvnim pouziti helpu je zde cesta do adresare helpu (umisteni vsech .chm souboru) -WORD LanguageID = 0; // language-id .SPL souboru +HINSTANCE NtDLL = NULL; // handle to ntdll.dll +HINSTANCE Shell32DLL = NULL; // handle to shell32.dll (icons) +HINSTANCE ImageResDLL = NULL; // handle to imageres.dll (Vista icons) +HINSTANCE User32DLL = NULL; // handle to user32.dll (DisableProcessWindowsGhosting) +HINSTANCE HLanguage = NULL; // handle to language-specific resources (.SPL file) +char CurrentHelpDir[MAX_PATH] = ""; // after Help is used for the first time, this stores the path to the help directory (where all .chm files are located) +WORD LanguageID = 0; // language ID of the .SPL file -char OpenReadmeInNotepad[MAX_PATH]; // pouziva se jen pri spusteni z instalaku: jmeno souboru, ktere mame v IDLE otevrit v notepadu (spustit notepad) +char OpenReadmeInNotepad[MAX_PATH]; // used only when launched from the installer: the name of the file to open in Notepad when idle BOOL UseCustomPanelFont = FALSE; HFONT Font = NULL; @@ -262,12 +264,12 @@ HBRUSH HMenuSelectedTextBrush = NULL; HBRUSH HMenuHilightBrush = NULL; HBRUSH HMenuGrayTextBrush = NULL; -HPEN HActiveNormalPen = NULL; // pera pro ramecek kolem polozky +HPEN HActiveNormalPen = NULL; // pens for the rectangle around an item HPEN HActiveSelectedPen = NULL; HPEN HInactiveNormalPen = NULL; HPEN HInactiveSelectedPen = NULL; -HPEN HThumbnailNormalPen = NULL; // pera pro ramecek kolem thumbnail +HPEN HThumbnailNormalPen = NULL; // Pens for the thumbnail border HPEN HThumbnailFucsedPen = NULL; HPEN HThumbnailSelectedPen = NULL; HPEN HThumbnailFocSelPen = NULL; @@ -297,7 +299,7 @@ HBITMAP HZoomBitmap = NULL; HCURSOR HHelpCursor = NULL; -int SystemDPI = 0; // Globalni DPI pres vsechny monitory. Salamander nepodporuje Per-Monitor DPI, viz https://msdn.microsoft.com/library/windows/desktop/dn469266.aspx +int SystemDPI = 0; // Global DPI across all monitors. Salamander does not support per-monitor DPI; see https://msdn.microsoft.com/library/windows/desktop/dn469266.aspx int IconSizes[] = {16, 32, 48}; int IconLRFlags = 0; HICON HSharedOverlays[] = {0}; @@ -305,7 +307,7 @@ HICON HShortcutOverlays[] = {0}; HICON HSlowFileOverlays[] = {0}; CIconList* SimpleIconLists[] = {0}; CIconList* ThrobberFrames = NULL; -CIconList* LockFrames = NULL; // pro jednoduchost deklaruji a nacitam jako throbber +CIconList* LockFrames = NULL; // for simplicity, declare and load it like the throbber HICON HGroupIcon = NULL; HICON HFavoritIcon = NULL; @@ -315,9 +317,9 @@ RGBQUAD ColorTable[256] = {0}; DWORD MouseHoverTime = 0; -SYSTEMTIME SalamanderStartSystemTime = {0}; // cas startu Salamandera (GetSystemTime) +SYSTEMTIME SalamanderStartSystemTime = {0}; // Salamander start time (GetSystemTime) -BOOL WaitForESCReleaseBeforeTestingESC = FALSE; // ma se cekat na pusteni ESC pred zacatkem listovani cesty v panelu? +BOOL WaitForESCReleaseBeforeTestingESC = FALSE; // should we wait for ESC to be released before starting to list the path in the panel? int SPACE_WIDTH = 10; @@ -340,40 +342,40 @@ BOOL CriticalShutdown = FALSE; HANDLE SalOpenFileMapping = NULL; void* SalOpenSharedMem = NULL; -// mutex pro synchronizaci load/save do Registry (dva procesy najednou nemuzou, ma to neblahe vysledky) +// mutex for synchronizing load/save to the Registry (two processes at once cause problems) CLoadSaveToRegistryMutex LoadSaveToRegistryMutex; -BOOL IsNotAlphaNorNum[256]; // pole TRUE/FALSE pro znaky (TRUE = neni pismeno ani cislice) -BOOL IsAlpha[256]; // pole TRUE/FALSE pro znaky (TRUE = pismeno) +BOOL IsNotAlphaNorNum[256]; // TRUE/FALSE array for characters (TRUE = not a letter or digit) +BOOL IsAlpha[256]; // TRUE/FALSE array for characters (TRUE = letter) -// defaultni useruv charset pro fonty; pod W2K+ uz by stacilo DEFAULT_CHARSET +// the default user charset for fonts; on W2K+ DEFAULT_CHARSET alone would already be enough // -// Pod WinXP lze v regionalnim nastaveni zvolit jako default napriklad cestinu, -// ale na zalozce Advanced nenainstalovat ceske fotny. Potom pri konstrukci -// fontu s kodovanim UserCharset operacni system vrati font s uplne -// jinym nazvem (face name), hlavne aby mel pozadovane kodovani. Proto je DULEZITE pri -// specifikaci parametru fontu spravne zvolit promennou lfPitchAndFamily, -// kde si lze volit mezi FF_SWISS a FF_ROMAN fonty (bezpatkove/patkove). +// Under WinXP, Czech can be selected as the default in the regional settings, +// but Czech fonts may still be missing on the Advanced tab. Then, when creating +// a font with UserCharset encoding, the operating system returns a font with a completely +// different name (face name), mainly to satisfy the requested encoding. Therefore, it is IMPORTANT to +// choose the lfPitchAndFamily variable correctly when specifying font parameters, +// because it lets you select between FF_SWISS and FF_ROMAN fonts (sans serif/serif). int UserCharset = DEFAULT_CHARSET; -DWORD AllocationGranularity = 1; // granularita alokaci (potreba pro pouzivani souboru mapovanych do pameti) +DWORD AllocationGranularity = 1; // Allocation granularity (needed when using memory-mapped files) #ifdef USE_BETA_EXPIRATION_DATE -// urcuje prvni den, kdy uz tato beta/PB verze nepobezi -// beta/PB verze 4.0 beta 1 pojede pouze do 1. unora 2020 +// specifies the first day on which this beta/PB version will no longer run +// beta/PB version 4.0 beta 1 will run only until February 1, 2020 // YEAR MONTH DAY SYSTEMTIME BETA_EXPIRATION_DATE = {2020, 2, 0, 1, 0, 0, 0, 0}; #endif // USE_BETA_EXPIRATION_DATE //****************************************************************************** // -// Rizeni Idle processingu (CMainWindow::OnEnterIdle) +// Idle processing control (CMainWindow::OnEnterIdle) // -BOOL IdleRefreshStates = TRUE; // na uvod nechame nastavit promenne -BOOL IdleForceRefresh = FALSE; // vyradi cache Enabler* -BOOL IdleCheckClipboard = TRUE; // koukneme taky na clipboard +BOOL IdleRefreshStates = TRUE; // initialize the state variables on the first idle pass +BOOL IdleForceRefresh = FALSE; // bypasses the Enabler* cache +BOOL IdleCheckClipboard = TRUE; // also check the clipboard DWORD EnablerUpDir = FALSE; DWORD EnablerRootDir = FALSE; @@ -448,7 +450,7 @@ SALCOLOR ViewerColors[NUMBER_OF_VIEWERCOLORS] = COLORREF SalamanderColors[NUMBER_OF_COLORS] = { - // barvy pera pro ramecek kolem polozky + // pen colors for the frame around the item RGBF(0, 0, 0, SCF_DEFAULT), // FOCUS_ACTIVE_NORMAL RGBF(0, 0, 0, SCF_DEFAULT), // FOCUS_ACTIVE_SELECTED RGBF(128, 128, 128, 0), // FOCUS_FG_INACTIVE_NORMAL @@ -456,43 +458,43 @@ COLORREF SalamanderColors[NUMBER_OF_COLORS] = RGBF(255, 255, 255, SCF_DEFAULT), // FOCUS_BK_INACTIVE_NORMAL RGBF(255, 255, 255, SCF_DEFAULT), // FOCUS_BK_INACTIVE_SELECTED - // barvy textu polozek v panelu + // item text colors in the panel RGBF(0, 0, 0, SCF_DEFAULT), // ITEM_FG_NORMAL RGBF(255, 0, 0, 0), // ITEM_FG_SELECTED RGBF(0, 0, 0, SCF_DEFAULT), // ITEM_FG_FOCUSED RGBF(255, 0, 0, 0), // ITEM_FG_FOCSEL RGBF(0, 0, 0, SCF_DEFAULT), // ITEM_FG_HIGHLIGHT - // barvy pozadi polozek v panelu + // background colors of items in the panel RGBF(255, 255, 255, SCF_DEFAULT), // ITEM_BK_NORMAL RGBF(255, 255, 255, SCF_DEFAULT), // ITEM_BK_SELECTED RGBF(232, 232, 232, 0), // ITEM_BK_FOCUSED RGBF(232, 232, 232, 0), // ITEM_BK_FOCSEL RGBF(0, 0, 0, SCF_DEFAULT), // ITEM_BK_HIGHLIGHT - // barvy pro blend ikonek + // icon blend colors RGBF(255, 128, 128, SCF_DEFAULT), // ICON_BLEND_SELECTED RGBF(128, 128, 128, 0), // ICON_BLEND_FOCUSED RGBF(255, 0, 0, 0), // ICON_BLEND_FOCSEL - // barvy progress bary + // progress bar colors RGBF(0, 0, 192, SCF_DEFAULT), // PROGRESS_FG_NORMAL RGBF(255, 255, 255, SCF_DEFAULT), // PROGRESS_FG_SELECTED RGBF(255, 255, 255, SCF_DEFAULT), // PROGRESS_BK_NORMAL RGBF(0, 0, 192, SCF_DEFAULT), // PROGRESS_BK_SELECTED - // barvy hot polozek + // colors of hot items RGBF(0, 0, 255, SCF_DEFAULT), // HOT_PANEL RGBF(128, 128, 128, SCF_DEFAULT), // HOT_ACTIVE RGBF(128, 128, 128, SCF_DEFAULT), // HOT_INACTIVE - // barvy titulku panelu + // panel title colors RGBF(255, 255, 255, SCF_DEFAULT), // ACTIVE_CAPTION_FG RGBF(0, 0, 128, SCF_DEFAULT), // ACTIVE_CAPTION_BK RGBF(255, 255, 255, SCF_DEFAULT), // INACTIVE_CAPTION_FG RGBF(128, 128, 128, SCF_DEFAULT), // INACTIVE_CAPTION_BK - // barvy pera pro ramecek kolem thumbnails + // Pen colors for the frame around thumbnails RGBF(192, 192, 192, 0), // THUMBNAIL_FRAME_NORMAL RGBF(0, 0, 0, 0), // THUMBNAIL_FRAME_FOCUSED RGBF(255, 0, 0, 0), // THUMBNAIL_FRAME_SELECTED @@ -501,7 +503,7 @@ COLORREF SalamanderColors[NUMBER_OF_COLORS] = COLORREF ExplorerColors[NUMBER_OF_COLORS] = { - // barvy pera pro ramecek kolem polozky + // Pen colors for the frame around the item RGBF(0, 0, 0, SCF_DEFAULT), // FOCUS_ACTIVE_NORMAL RGBF(255, 255, 0, 0), // FOCUS_ACTIVE_SELECTED RGBF(128, 128, 128, 0), // FOCUS_FG_INACTIVE_NORMAL @@ -509,43 +511,43 @@ COLORREF ExplorerColors[NUMBER_OF_COLORS] = RGBF(255, 255, 255, SCF_DEFAULT), // FOCUS_BK_INACTIVE_NORMAL RGBF(255, 255, 0, 0), // FOCUS_BK_INACTIVE_SELECTED - // barvy textu polozek v panelu + // item text colors in the panel RGBF(0, 0, 0, SCF_DEFAULT), // ITEM_FG_NORMAL RGBF(255, 255, 255, 0), // ITEM_FG_SELECTED RGBF(0, 0, 0, SCF_DEFAULT), // ITEM_FG_FOCUSED RGBF(255, 255, 255, 0), // ITEM_FG_FOCSEL RGBF(0, 0, 0, SCF_DEFAULT), // ITEM_FG_HIGHLIGHT - // barvy pozadi polozek v panelu + // Background colors of items in the panel RGBF(255, 255, 255, SCF_DEFAULT), // ITEM_BK_NORMAL RGBF(0, 0, 128, 0), // ITEM_BK_SELECTED RGBF(232, 232, 232, 0), // ITEM_BK_FOCUSED RGBF(0, 0, 128, 0), // ITEM_BK_FOCSEL RGBF(0, 0, 0, SCF_DEFAULT), // ITEM_BK_HIGHLIGHT - // barvy pro blend ikonek + // colors for icon blending RGBF(0, 0, 128, SCF_DEFAULT), // ICON_BLEND_SELECTED RGBF(128, 128, 128, 0), // ICON_BLEND_FOCUSED RGBF(0, 0, 128, 0), // ICON_BLEND_FOCSEL - // barvy progress bary + // progress bar colors RGBF(0, 0, 192, SCF_DEFAULT), // PROGRESS_FG_NORMAL RGBF(255, 255, 255, SCF_DEFAULT), // PROGRESS_FG_SELECTED RGBF(255, 255, 255, SCF_DEFAULT), // PROGRESS_BK_NORMAL RGBF(0, 0, 192, SCF_DEFAULT), // PROGRESS_BK_SELECTED - // barvy hot polozek + // hot item colors RGBF(0, 0, 255, SCF_DEFAULT), // HOT_PANEL RGBF(128, 128, 128, SCF_DEFAULT), // HOT_ACTIVE RGBF(128, 128, 128, SCF_DEFAULT), // HOT_INACTIVE - // barvy titulku panelu + // panel title colors RGBF(255, 255, 255, SCF_DEFAULT), // ACTIVE_CAPTION_FG RGBF(0, 0, 128, SCF_DEFAULT), // ACTIVE_CAPTION_BK RGBF(255, 255, 255, SCF_DEFAULT), // INACTIVE_CAPTION_FG RGBF(128, 128, 128, SCF_DEFAULT), // INACTIVE_CAPTION_BK - // barvy pera pro ramecek kolem thumbnails + // pen colors for the frame around thumbnails RGBF(192, 192, 192, 0), // THUMBNAIL_FRAME_NORMAL RGBF(0, 0, 128, 0), // THUMBNAIL_FRAME_FOCUSED RGBF(0, 0, 128, 0), // THUMBNAIL_FRAME_SELECTED @@ -554,7 +556,7 @@ COLORREF ExplorerColors[NUMBER_OF_COLORS] = COLORREF NortonColors[NUMBER_OF_COLORS] = { - // barvy pera pro ramecek kolem polozky + // pen colors for the frame around the item RGBF(0, 128, 128, 0), // FOCUS_ACTIVE_NORMAL RGBF(0, 128, 128, 0), // FOCUS_ACTIVE_SELECTED RGBF(0, 128, 128, 0), // FOCUS_FG_INACTIVE_NORMAL @@ -562,43 +564,43 @@ COLORREF NortonColors[NUMBER_OF_COLORS] = RGBF(0, 0, 128, 0), // FOCUS_BK_INACTIVE_NORMAL RGBF(0, 0, 128, 0), // FOCUS_BK_INACTIVE_SELECTED - // barvy textu polozek v panelu + // panel item text colors RGBF(0, 255, 255, 0), // ITEM_FG_NORMAL RGBF(255, 255, 0, 0), // ITEM_FG_SELECTED RGBF(0, 0, 0, SCF_DEFAULT), // ITEM_FG_FOCUSED RGBF(255, 255, 0, 0), // ITEM_FG_FOCSEL RGBF(0, 0, 0, SCF_DEFAULT), // ITEM_FG_HIGHLIGHT - // barvy pozadi polozek v panelu + // background colors of items in the panel RGBF(0, 0, 128, 0), // ITEM_BK_NORMAL RGBF(0, 0, 128, 0), // ITEM_BK_SELECTED RGBF(0, 128, 128, 0), // ITEM_BK_FOCUSED RGBF(0, 128, 128, 0), // ITEM_BK_FOCSEL RGBF(0, 0, 0, SCF_DEFAULT), // ITEM_BK_HIGHLIGHT - // barvy pro blend ikonek + // colors for icon blending RGBF(255, 255, 0, SCF_DEFAULT), // ICON_BLEND_SELECTED RGBF(128, 128, 128, 0), // ICON_BLEND_FOCUSED RGBF(255, 255, 0, 0), // ICON_BLEND_FOCSEL - // barvy progress bary + // progress bar colors RGBF(0, 0, 192, SCF_DEFAULT), // PROGRESS_FG_NORMAL RGBF(255, 255, 255, SCF_DEFAULT), // PROGRESS_FG_SELECTED RGBF(255, 255, 255, SCF_DEFAULT), // PROGRESS_BK_NORMAL RGBF(0, 0, 192, SCF_DEFAULT), // PROGRESS_BK_SELECTED - // barvy hot polozek + // colors of hot items RGBF(0, 0, 255, SCF_DEFAULT), // HOT_PANEL RGBF(128, 128, 128, SCF_DEFAULT), // HOT_ACTIVE RGBF(128, 128, 128, SCF_DEFAULT), // HOT_INACTIVE - // barvy titulku panelu + // panel title colors RGBF(255, 255, 255, SCF_DEFAULT), // ACTIVE_CAPTION_FG RGBF(0, 0, 128, SCF_DEFAULT), // ACTIVE_CAPTION_BK RGBF(255, 255, 255, SCF_DEFAULT), // INACTIVE_CAPTION_FG RGBF(128, 128, 128, SCF_DEFAULT), // INACTIVE_CAPTION_BK - // barvy pera pro ramecek kolem thumbnails + // Pen colors for the frame around thumbnails RGBF(192, 192, 192, 0), // THUMBNAIL_FRAME_NORMAL RGBF(0, 128, 128, 0), // THUMBNAIL_FRAME_FOCUSED RGBF(255, 255, 0, 0), // THUMBNAIL_FRAME_SELECTED @@ -607,7 +609,7 @@ COLORREF NortonColors[NUMBER_OF_COLORS] = COLORREF NavigatorColors[NUMBER_OF_COLORS] = { - // barvy pera pro ramecek kolem polozky + // Pen colors for the frame around the item RGBF(0, 128, 128, 0), // FOCUS_ACTIVE_NORMAL RGBF(0, 128, 128, 0), // FOCUS_ACTIVE_SELECTED RGBF(0, 128, 128, 0), // FOCUS_FG_INACTIVE_NORMAL @@ -615,43 +617,43 @@ COLORREF NavigatorColors[NUMBER_OF_COLORS] = RGBF(0, 0, 128, 0), // FOCUS_BK_INACTIVE_NORMAL RGBF(0, 0, 128, 0), // FOCUS_BK_INACTIVE_SELECTED - // barvy textu polozek v panelu + // panel item text colors RGBF(255, 255, 255, 0), // ITEM_FG_NORMAL RGBF(255, 255, 0, 0), // ITEM_FG_SELECTED RGBF(0, 0, 0, SCF_DEFAULT), // ITEM_FG_FOCUSED RGBF(255, 255, 0, 0), // ITEM_FG_FOCSEL RGBF(0, 0, 0, SCF_DEFAULT), // ITEM_FG_HIGHLIGHT - // barvy pozadi polozek v panelu + // item background colors in the panel RGBF(80, 80, 80, 0), // ITEM_BK_NORMAL RGBF(80, 80, 80, 0), // ITEM_BK_SELECTED RGBF(0, 128, 128, 0), // ITEM_BK_FOCUSED RGBF(0, 128, 128, 0), // ITEM_BK_FOCSEL RGBF(0, 0, 0, SCF_DEFAULT), // ITEM_BK_HIGHLIGHT - // barvy pro blend ikonek + // colors for icon blending RGBF(255, 255, 0, SCF_DEFAULT), // ICON_BLEND_SELECTED RGBF(128, 128, 128, 0), // ICON_BLEND_FOCUSED RGBF(255, 255, 0, 0), // ICON_BLEND_FOCSEL - // barvy progress bary + // progress bar colors RGBF(0, 0, 192, SCF_DEFAULT), // PROGRESS_FG_NORMAL RGBF(255, 255, 255, SCF_DEFAULT), // PROGRESS_FG_SELECTED RGBF(255, 255, 255, SCF_DEFAULT), // PROGRESS_BK_NORMAL RGBF(0, 0, 192, SCF_DEFAULT), // PROGRESS_BK_SELECTED - // barvy hot polozek + // hot item colors RGBF(0, 0, 255, SCF_DEFAULT), // HOT_PANEL RGBF(173, 182, 205, SCF_DEFAULT), // HOT_ACTIVE RGBF(212, 212, 212, SCF_DEFAULT), // HOT_INACTIVE - // barvy titulku panelu + // panel title colors RGBF(255, 255, 255, SCF_DEFAULT), // ACTIVE_CAPTION_FG RGBF(0, 0, 128, SCF_DEFAULT), // ACTIVE_CAPTION_BK RGBF(255, 255, 255, SCF_DEFAULT), // INACTIVE_CAPTION_FG RGBF(128, 128, 128, SCF_DEFAULT), // INACTIVE_CAPTION_BK - // barvy pera pro ramecek kolem thumbnails + // Pen colors for the frame around thumbnails RGBF(192, 192, 192, 0), // THUMBNAIL_FRAME_NORMAL RGBF(0, 128, 128, 0), // THUMBNAIL_FRAME_FOCUSED RGBF(255, 255, 0, 0), // THUMBNAIL_FRAME_SELECTED @@ -692,15 +694,15 @@ void MakeCrc32Table(DWORD* crcTab) DWORD poly = 0xedb88320L; //polynomial exclusive-or pattern /* - // generate crc polonomial, using precomputed poly should be faster - // terms of polynomial defining this crc (except x^32): - static const Byte p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26}; - - // make exclusive-or pattern from polynomial (0xedb88320L) - poly = 0L; - for (n = 0; n < sizeof(p)/sizeof(Byte); n++) - poly |= 1L << (31 - p[n]); -*/ + // generate CRC polynomial; using a precomputed polynomial should be faster + // terms of the polynomial defining this CRC (except x^32): + static const Byte p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26}; + + // make exclusive-or pattern from the polynomial (0xedb88320L) + poly = 0L; + for (n = 0; n < sizeof(p)/sizeof(Byte); n++) + poly |= 1L << (31 - p[n]); + */ int n; for (n = 0; n < 256; n++) { @@ -736,11 +738,11 @@ DWORD UpdateCrc32(const void* buffer, DWORD count, DWORD crcVal) c = Crc32Tab[((int)c ^ (*p++)) & 0xff] ^ (c >> 8); } while (--count); - // Honza: meril jsem nasledujici optimalizace a nemaji zadny vyznam; - // jedina sance by bylo prepsani do ASM a cteni pameti po DWORDech, - // ze kterych by pak bylo mozne vyzobavat jednotlive bajty; - // pri soucasnem nastaveni release verze neni prekladac schopen tuto - // optimalizaci provest za nas. + // The following optimizations were benchmarked and have no practical benefit; + // the only remaining option would be to rewrite this in ASM and read memory in DWORDs, + // from which individual bytes could then be extracted; + // with the current release-build settings, the compiler cannot perform this + // optimization for us. /* int remain = count % 8; count -= remain; @@ -796,17 +798,17 @@ BOOL IsRemoteSession(void) BOOL SalamanderIsNotBusy(DWORD* lastIdleTime) { - // k SalamanderBusy a k LastSalamanderIdleTime se chodi bez kritickych sekci, nevadi, - // protoze jsou to DWORDy a tudiz nemuzou byt "rozpracovane" pri switchnuti kontextu - // (vzdy je tam stara nebo nova hodnota, nic jineho nehrozi) + // SalamanderBusy and LastSalamanderIdleTime are accessed without critical sections, which is fine, + // because they are DWORDs and therefore cannot be left in a "partially updated" state during a context switch + // (the value is always either the old one or the new one, and nothing else can occur) if (lastIdleTime != NULL) *lastIdleTime = LastSalamanderIdleTime; if (!SalamanderBusy) return TRUE; DWORD oldLastIdleTime = LastSalamanderIdleTime; - if (GetTickCount() - oldLastIdleTime <= 100) // pokud neni SalamanderBusy uz prilis dlouho (napr. otevreny modalni dialog) - Sleep(100); // pockame jestli se SalamanderBusy nezmeni - return !SalamanderBusy || (int)(LastSalamanderIdleTime - oldLastIdleTime) > 0; // neni "busy" nebo aspon osciluje + if (GetTickCount() - oldLastIdleTime <= 100) // if SalamanderBusy has not changed for too long already (for example, because a modal dialog is open) + Sleep(100); // wait to see if SalamanderBusy changes + return !SalamanderBusy || (int)(LastSalamanderIdleTime - oldLastIdleTime) > 0; // not busy, or at least changing state } BOOL InitPreloadedStrings() @@ -886,7 +888,7 @@ void InitLocales() else { DecimalSeparatorLen--; - DecimalSeparator[DecimalSeparatorLen] = 0; // posychrujeme nulu na konci + DecimalSeparator[DecimalSeparatorLen] = 0; // make sure the string is null-terminated } if ((ThousandsSeparatorLen = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_STHOUSAND, ThousandsSeparator, 5)) == 0 || @@ -898,7 +900,7 @@ void InitLocales() else { ThousandsSeparatorLen--; - ThousandsSeparator[ThousandsSeparatorLen] = 0; // posychrujeme nulu na konci + ThousandsSeparator[ThousandsSeparatorLen] = 0; // ensure the null terminator stays at the end } } @@ -911,11 +913,11 @@ HICON GetFileOrPathIconAux(const char* path, BOOL large, BOOL isDir) SHFILEINFO shi; if (!GetFileIcon(path, FALSE, &shi.hIcon, large ? ICONSIZE_32 : ICONSIZE_16, TRUE, isDir)) shi.hIcon = NULL; - //Presli jsme na vlastni implementaci (mensi pametova narocnost, fungujici XOR ikonky) + // We switched to our own implementation (lower memory use, and XOR icons work correctly) //shi.hIcon = NULL; //SHGetFileInfo(path, 0, &shi, sizeof(shi), // SHGFI_ICON | SHGFI_SHELLICONSIZE | (large ? 0 : SHGFI_SMALLICON)); - // pridame handle na 'shi.hIcon' do HANDLES + // add the handle for 'shi.hIcon' to HANDLES if (shi.hIcon != NULL) HANDLES_ADD(__htIcon, __hoLoadImage, shi.hIcon); return shi.hIcon; @@ -933,12 +935,12 @@ HICON GetDriveIcon(const char* root, UINT type, BOOL accessible, BOOL large) int id; switch (type) { - case DRIVE_REMOVABLE: // ikonky 3.5, 5.25 + case DRIVE_REMOVABLE: // 3.5" and 5.25" drive icons { HICON i = GetFileOrPathIconAux(root, large, TRUE); if (i != NULL) return i; - id = 28; // 3 1/2 " mechanika + id = 28; // 3.5" drive break; } @@ -967,14 +969,14 @@ HICON GetDriveIcon(const char* root, UINT type, BOOL accessible, BOOL large) int iconSize = IconSizes[large ? ICONSIZE_32 : ICONSIZE_16]; return SalLoadIcon(ImageResDLL, id, iconSize); - // JRYFIXME - prozkoumat jestli neni IconLRFlags na zruseni? (W7+) + // JRYFIXME - investigate whether IconLRFlags should be removed. (W7+) - /* JRYFIXME - grepnout plosne zdrojaky na LoadImage / IMAGE_ICON - return (HICON)HANDLES(LoadImage(ImageResDLL, MAKEINTRESOURCE(id), IMAGE_ICON, - large ? ICON32_CX : ICON16_CX, - large ? ICON32_CX : ICON16_CX, - IconLRFlags)); - */ + /* JRYFIXME - grep the source tree for LoadImage / IMAGE_ICON + return (HICON)HANDLES(LoadImage(ImageResDLL, MAKEINTRESOURCE(id), IMAGE_ICON, + large ? ICON32_CX : ICON16_CX, + large ? ICON32_CX : ICON16_CX, + IconLRFlags)); + */ } HICON SalLoadIcon(HINSTANCE hDLL, int id, int iconSize) @@ -992,7 +994,7 @@ char* BuildName(char* path, char* name, char* dosName, BOOL* skip, BOOL* skipAll { if (skip != NULL) *skip = FALSE; - int l1 = (int)strlen(path); // je vzdy na stacku ... + int l1 = (int)strlen(path); // Always on the stack... int l2, len = l1; if (name != NULL) { @@ -1027,17 +1029,17 @@ char* BuildName(char* path, char* name, char* dosName, BOOL* skip, BOOL* skipAll params.Caption = LoadStr(IDS_ERRORTITLE); params.Text = text; char aliasBtnNames[200]; - /* slouzi pro skript export_mnu.py, ktery generuje salmenu.mnu pro Translator - nechame pro tlacitka msgboxu resit kolize hotkeys tim, ze simulujeme, ze jde o menu -MENU_TEMPLATE_ITEM MsgBoxButtons[] = -{ - {MNTT_PB, 0 - {MNTT_IT, IDS_MSGBOXBTN_SKIP - {MNTT_IT, IDS_MSGBOXBTN_SKIPALL - {MNTT_IT, IDS_MSGBOXBTN_FOCUS - {MNTT_PE, 0 -}; -*/ + /* used by the export_mnu.py script, which generates salmenu.mnu for Translator + for message box buttons, let hotkey collisions be handled by pretending they are a menu + MENU_TEMPLATE_ITEM MsgBoxButtons[] = + { + {MNTT_PB, 0 + {MNTT_IT, IDS_MSGBOXBTN_SKIP + {MNTT_IT, IDS_MSGBOXBTN_SKIPALL + {MNTT_IT, IDS_MSGBOXBTN_FOCUS + {MNTT_PE, 0 + }; + */ sprintf(aliasBtnNames, "%d\t%s\t%d\t%s\t%d\t%s", DIALOG_YES, LoadStr(IDS_MSGBOXBTN_SKIP), DIALOG_NO, LoadStr(IDS_MSGBOXBTN_SKIPALL), @@ -1086,10 +1088,10 @@ BOOL HasTheSameRootPath(const char* path1, const char* path2) if (LowerCase[path1[0]] == LowerCase[path2[0]] && path1[1] == path2[1]) { if (path1[1] == ':') - return TRUE; // stejny root normal ("c:\path") cesty + return TRUE; // same root for regular ("c:\path") paths else { - if (path1[0] == '\\' && path1[1] == '\\') // oboji UNC + if (path1[0] == '\\' && path1[1] == '\\') // both UNC paths { const char* s1 = path1 + 2; const char* s2 = path2 + 2; @@ -1101,9 +1103,9 @@ BOOL HasTheSameRootPath(const char* path1, const char* path2) s2++; } else - break; // ruzne masiny + break; // different machines } - if (*s1 != 0 && *s1++ == *s2++) // preskok '\\' + if (*s1 != 0 && *s1++ == *s2++) // skip '\\' { while (*s1 != 0 && *s1 != '\\') { @@ -1113,7 +1115,7 @@ BOOL HasTheSameRootPath(const char* path1, const char* path2) s2++; } else - break; // ruzne disky + break; // different shares } return (*s1 == 0 && (*s2 == 0 || *s2 == '\\')) || *s1 == *s2 || (*s2 == 0 && (*s1 == 0 || *s1 == '\\')); @@ -1142,44 +1144,44 @@ BOOL HasTheSameRootPathAndVolume(const char* p1, const char* p2) lstrcpyn(resPath, p1, MAX_PATH); ResolveSubsts(resPath); GetRootPath(root, resPath); - if (!IsUNCPath(root) && GetDriveType(root) == DRIVE_FIXED) // reparse pointy ma smysl hledat jen na fixed discich + if (!IsUNCPath(root) && GetDriveType(root) == DRIVE_FIXED) // only look for reparse points on fixed drives { - // pokud nejde o root cestu, zkusime jeste traverzovat po reparse pointech + // if this is not a root path, also try traversing through reparse points BOOL cutPathIsPossible = TRUE; char p1NetPath[MAX_PATH]; p1NetPath[0] = 0; ResolveLocalPathWithReparsePoints(ourPath, p1, &cutPathIsPossible, NULL, NULL, NULL, NULL, p1NetPath); - if (p1NetPath[0] == 0) // ze sitove cesty volume ziskat nelze, nebudeme se ani snazit + if (p1NetPath[0] == 0) // The volume cannot be obtained from a network path, so do not even try { while (!GetVolumeNameForVolumeMountPoint(ourPath, p1Volume, 100)) { if (!cutPathIsPossible || !CutDirectory(ourPath)) { - strcpy(p1Volume, "fail"); // ani root nevratil uspech, neocekavane (bohuzel se deje na substenych discich pod W2K - ladeno u Bachaalany - pri selhani na obou cestach vracime SHODU, protoze je pravdepodobnejsi) + strcpy(p1Volume, "fail"); // Even the root path failed, unexpectedly (unfortunately this happens on SUBST drives under W2K, debugged at Bachaalany; if both paths fail, we treat them as matching because that is more likely) break; } SalPathAddBackslash(ourPath, MAX_PATH); } } - // pokud jsme pod W2K a nejde o root cestu, zkusime jeste traverzovat po reparse pointech + // if it is not a root path, try traversing the reparse points as well cutPathIsPossible = TRUE; char p2NetPath[MAX_PATH]; p2NetPath[0] = 0; ResolveLocalPathWithReparsePoints(ourPath, p2, &cutPathIsPossible, NULL, NULL, NULL, NULL, p2NetPath); - if ((p1NetPath[0] == 0) != (p2NetPath[0] == 0) || // pokud je jen jedna z cest sitova nebo + if ((p1NetPath[0] == 0) != (p2NetPath[0] == 0) || // if only one of the paths is a network path, or p1NetPath[0] != 0 && !HasTheSameRootPath(p1NetPath, p2NetPath)) - ret = FALSE; // nemaji stejny root, ohlasime ruzne volumy (na sitovych cestach nelze overit volumy) + ret = FALSE; // Different root path, so treat them as different volumes (volumes cannot be checked on network paths) - if (p2NetPath[0] == 0 && ret) // ze sitove cesty volume ziskat nelze, nebudeme se ani snazit + pokud uz je rozhodnuto, tez se nebudeme snazit + if (p2NetPath[0] == 0 && ret) // A volume cannot be obtained from a network path, so do not even try; also skip it if the result is already decided { while (!GetVolumeNameForVolumeMountPoint(ourPath, p2Volume, 100)) { if (!cutPathIsPossible || !CutDirectory(ourPath)) { - strcpy(p2Volume, "fail"); // ani root nevratil uspech, neocekavane (bohuzel se deje na substenych discich pod W2K - ladeno u Bachaalany - pri selhani na obou cestach vracime SHODU, protoze je pravdepodobnejsi) + strcpy(p2Volume, "fail"); // Even the root path failed, unexpectedly (unfortunately this happens on SUBST drives under W2K, debugged at Bachaalany; if both paths fail, we treat them as matching because that is more likely) break; } SalPathAddBackslash(ourPath, MAX_PATH); @@ -1211,30 +1213,30 @@ BOOL PathsAreOnTheSameVolume(const char* path1, const char* path2, BOOL* resIsOn BOOL trySimpleTest = TRUE; if (resIsOnlyEstimation != NULL) *resIsOnlyEstimation = TRUE; - if (!IsUNCPath(path1) && !IsUNCPath(path2)) // svazky na UNC cestach nema smysl resit + if (!IsUNCPath(path1) && !IsUNCPath(path2)) // No point checking volumes for UNC paths { char p1Volume[100] = "1"; char p2Volume[100] = "2"; UINT drvType1 = GetDriveType(root1); UINT drvType2 = GetDriveType(root2); - if (drvType1 != DRIVE_REMOTE && drvType2 != DRIVE_REMOTE) // krome site je sance zjistit "volume name" + if (drvType1 != DRIVE_REMOTE && drvType2 != DRIVE_REMOTE) // except on network paths, the "volume name" can be determined { BOOL cutPathIsPossible = TRUE; - path1NetPath[0] = 0; // sitova cesta, na kterou vede aktualni (posledni) lokalni symlink v ceste - if (drvType1 == DRIVE_FIXED) // reparse pointy ma smysl hledat jen na fixed discich + path1NetPath[0] = 0; // network path that the current (last) local symlink in the path points to + if (drvType1 == DRIVE_FIXED) // only look for reparse points on fixed drives { - // pokud jsme pod W2K a nejde o root cestu, zkusime jeste traverzovat po reparse pointech + // if it is not a root path, try traversing the reparse points as well ResolveLocalPathWithReparsePoints(ourPath, path1, &cutPathIsPossible, NULL, NULL, NULL, NULL, path1NetPath); } else lstrcpyn(ourPath, root1, MAX_PATH); int numOfGetVolNamesFailed = 0; - if (path1NetPath[0] == 0) // ze sitove cesty "volume name" ziskat nelze, nebudeme se ani snazit + if (path1NetPath[0] == 0) // Volume names cannot be obtained for network paths, so do not even try. { while (!GetVolumeNameForVolumeMountPoint(ourPath, p1Volume, 100)) { if (!cutPathIsPossible || !CutDirectory(ourPath)) - { // ani root nevratil uspech, neocekavane (bohuzel se deje na substenych discich pod W2K - ladeno u Bachaalany - pri selhani na obou cestach se stejnymi rooty vracime SHODU, protoze je pravdepodobnejsi) + { // Even the root path failed, which is unexpected (unfortunately this happens on SUBST drives under W2K, debugged at Bachaalany; if both paths with the same root fail, treat them as the same volume because that is more likely) numOfGetVolNamesFailed++; break; } @@ -1243,22 +1245,22 @@ BOOL PathsAreOnTheSameVolume(const char* path1, const char* path2, BOOL* resIsOn } cutPathIsPossible = TRUE; - path2NetPath[0] = 0; // sitova cesta, na kterou vede aktualni (posledni) lokalni symlink v ceste - if (drvType2 == DRIVE_FIXED) // reparse pointy ma smysl hledat jen na fixed discich + path2NetPath[0] = 0; // network path the current (last) local symlink in the path leads to + if (drvType2 == DRIVE_FIXED) // only look for reparse points on fixed drives { - // pokud jsme pod W2K a nejde o root cestu, zkusime jeste traverzovat po reparse pointech + // if it is not a root path, try traversing the reparse points as well ResolveLocalPathWithReparsePoints(ourPath, path2, &cutPathIsPossible, NULL, NULL, NULL, NULL, path2NetPath); } else lstrcpyn(ourPath, root2, MAX_PATH); - if (path2NetPath[0] == 0) // ze sitove cesty "volume name" ziskat nelze, nebudeme se ani snazit + if (path2NetPath[0] == 0) // Volume names cannot be obtained for network paths, so do not even try. { if (path1NetPath[0] == 0) { while (!GetVolumeNameForVolumeMountPoint(ourPath, p2Volume, 100)) { if (!cutPathIsPossible || !CutDirectory(ourPath)) - { // ani root nevratil uspech, neocekavane (bohuzel se deje na substenych discich pod W2K - ladeno u Bachaalany - pri selhani na obou cestach se stejnymi rooty vracime SHODU, protoze je pravdepodobnejsi) + { // Even the root path failed, which is unexpected (unfortunately this happens on SUBST drives under W2K, debugged at Bachaalany; if both paths with the same root fail, treat them as the same volume because that is more likely) numOfGetVolNamesFailed++; break; } @@ -1267,13 +1269,13 @@ BOOL PathsAreOnTheSameVolume(const char* path1, const char* path2, BOOL* resIsOn if (numOfGetVolNamesFailed != 2) { if (numOfGetVolNamesFailed == 0 && resIsOnlyEstimation != NULL) - *resIsOnlyEstimation = FALSE; // jediny pripad, kdy jsme si jisty vysledkem je, kdyz se podarilo ziskat "volume name" z obou cest (zaroven tak nemohly byt sitove) + *resIsOnlyEstimation = FALSE; // The only time we know the result for sure is when we managed to get the "volume name" for both paths (which also means neither path could have been a network path). if (numOfGetVolNamesFailed == 1 || strcmp(p1Volume, p2Volume) != 0) - ret = FALSE; // povedl se ziskat jen jeden "volume name", takze nejde o stejne svazky (a pokud ano, nejsme schopny to zjistit - mozna pokud slo o selhani kvuli SUBSTu, dalo by se to resit resolvnutim cilove cesty ze SUBSTu) + ret = FALSE; // Only one volume name was obtained, so we must treat them as different volumes (and if they are actually the same, we cannot detect it; if the failure was caused by SUBST, this might be fixable by resolving the SUBST target path) trySimpleTest = FALSE; } } - else // sitova je jen jedna cesta, nejde o stejne svazky (a pokud ano, nejsme schopny to zjistit) + else // Only one of the paths is a network path, so they are not on the same volume (and if they are, we cannot determine that). { ret = FALSE; trySimpleTest = FALSE; @@ -1281,12 +1283,12 @@ BOOL PathsAreOnTheSameVolume(const char* path1, const char* path2, BOOL* resIsOn } else { - if (path1NetPath[0] != 0) // srovname rooty sitovych cest + if (path1NetPath[0] != 0) // compare the roots of the network paths { GetRootPath(root1, path1NetPath); GetRootPath(root2, path2NetPath); } - else // sitova je jen jedna cesta, nejde o stejne svazky (a pokud ano, nejsme schopny to zjistit) + else // Only one of the paths is a network path, so they are not on the same volume (and if they are, we cannot determine that). { ret = FALSE; trySimpleTest = FALSE; @@ -1295,7 +1297,7 @@ BOOL PathsAreOnTheSameVolume(const char* path1, const char* path2, BOOL* resIsOn } } - if (trySimpleTest) // zkusime jen jestli se shoduji root-cesty (sitove cesty + vse na NT) + if (trySimpleTest) // Only test whether the root paths match (network paths and everything on NT) { ret = _stricmp(root1, root2) == 0; @@ -1306,7 +1308,7 @@ BOOL PathsAreOnTheSameVolume(const char* path1, const char* path2, BOOL* resIsOn if (ResolveSubsts(path1NetPath) && ResolveSubsts(path2NetPath)) { if (IsTheSamePath(path1NetPath, path2NetPath)) - *resIsOnlyEstimation = FALSE; // stejne cesty = urcite i stejne svazky + *resIsOnlyEstimation = FALSE; // same paths definitely mean the same volumes } } } @@ -1359,17 +1361,17 @@ int CommonPrefixLength(const char* path1, const char* path2) if (*s1 == 0 && *s2 == '\\' || *s1 == '\\' && *s2 == 0 || *s1 == 0 && *s2 == 0 && *(s1 - 1) != '\\') { - lastBackslash = s1; // tento terminator nebude v lastBackslash + lastBackslash = s1; // points at the terminator, but the terminator itself is not included backslashCount++; } if (path1[1] == ':') { - // klasicka cesta + // drive-letter path if (path1[2] != '\\') return 0; - // osetrim specialni pripad: u root cesty musime vratit delku i s posledni zpetnym lomitkem + // Handle a special case: for a root path, we must return the length including the trailing backslash. if (lastBackslash - path1 < 3) return 3; @@ -1377,10 +1379,10 @@ int CommonPrefixLength(const char* path1, const char* path2) } else { - // UNC cesta + // UNC path if (path1[0] != '\\' || path1[1] != '\\') return 0; - if (backslashCount < 4) // cesta musi mit tvar "\\masina\share" + if (backslashCount < 4) // the path must have the form "\\machine\share" return 0; return (int)(lastBackslash - path1); @@ -1399,8 +1401,8 @@ BOOL SalPathIsPrefix(const char* prefix, const char* path) if (prefixLen < 3) return FALSE; - // CommonPrefixLength nam vratila delku bez posledniho zpetneho lomitka (pokud neslo o root path) - // pokud nas prefix ma koncove zpetne lomitko, musim ho zahodit + // CommonPrefixLength returned the length without the trailing backslash (unless this was a root path) + // if our prefix ends with a backslash, we have to drop it if (prefixLen > 3 && prefix[prefixLen - 1] == '\\') prefixLen--; @@ -1418,8 +1420,8 @@ BOOL IsDirError(DWORD err) err == ERROR_BAD_PATHNAME || err == ERROR_FILE_NOT_FOUND || err == ERROR_PATH_NOT_FOUND || - err == ERROR_INVALID_NAME || // je-li hacek v ceste na anglickych Windows, hlasi se tato chyba misto ERROR_PATH_NOT_FOUND - err == ERROR_INVALID_FUNCTION; // hlasilo jednomu chlapikovi na WinXP na sitovem disku Y: v okamziku, kdy Salam pristupoval na cestu, ktera jiz neexistovala (nedoslo tak ke zkraceni a chlapik byl dobre v riti ;-) Shift+F7 na Y:\ to vyresila) + err == ERROR_INVALID_NAME || // On English Windows, if the path contains characters with diacritics, this error is reported instead of ERROR_PATH_NOT_FOUND + err == ERROR_INVALID_FUNCTION; // Reported by one user on WinXP on network drive Y: Salamander hit this when accessing a path that no longer existed (so the path was not shortened, which caused serious trouble; Shift+F7 on Y:\ fixed it) } // **************************************************************************** @@ -1445,7 +1447,7 @@ BOOL CutDirectory(char* path, char** cutDir) if (cutDir != NULL) { if (*(path + l - 1) == '\\') - *(path + --l) = 0; // zruseni '\\' na konci + *(path + --l) = 0; // Remove trailing '\\' memmove(lastBackslash + 2, lastBackslash + 1, l - (lastBackslash - path)); *cutDir = lastBackslash + 2; // "somedir" or "seconddir" } @@ -1454,13 +1456,13 @@ BOOL CutDirectory(char* path, char** cutDir) else // "c:\firstdir\seconddir" or "c:\firstdir\seconddir\" { // UNC: "\\server\share\path" if (path[0] == '\\' && path[1] == '\\' && nextBackslash <= path + 2) - { // "\\server\share" - neda se zkratit + { // "\\server\share" - cannot be shortened further if (cutDir != NULL) *cutDir = path + l; return FALSE; } *lastBackslash = 0; - if (cutDir != NULL) // odriznuti '\' na konci + if (cutDir != NULL) // remove trailing '\\' { if (*(path + l - 1) == '\\') *(path + l - 1) = 0; @@ -1473,7 +1475,7 @@ BOOL CutDirectory(char* path, char** cutDir) // **************************************************************************** int GetRootPath(char* root, const char* path) -{ // POZOR: netypicke pouziti z GetShellFolder(): pro "\\\\" vraci "\\\\\\", pro "\\\\server" vraci "\\\\server\\" +{ // WARNING: special-case behavior for GetShellFolder(): for "\\\\" it returns "\\\\\\", and for "\\\\server" it returns "\\\\server\\" if (path[0] == '\\' && path[1] == '\\') // UNC { const char* s = path + 2; @@ -1485,7 +1487,7 @@ int GetRootPath(char* root, const char* path) s++; int len = (int)(s - path); if (len > MAX_PATH - 2) - len = MAX_PATH - 2; // aby se to veslo i s '\\' do MAX_PATH bufferu (ocekavana velikost), orez neva, 100% je to beztak chyba + len = MAX_PATH - 2; // so it fits into the MAX_PATH buffer even with '\\' (expected size); truncation is fine, this is almost certainly an error anyway memcpy(root, path, len); root[len] = '\\'; root[len + 1] = 0; @@ -1503,8 +1505,8 @@ int GetRootPath(char* root, const char* path) // **************************************************************************** -// projede vsechny barvy z konfigurace a pokud maji nastavenu default hodnotu, -// nastavi jim prislusne barevne hodnoty +// Walks through all configured colors and assigns appropriate values +// to any entries still set to their default value. COLORREF GetHilightColor(COLORREF clr1, COLORREF clr2) { @@ -1559,15 +1561,15 @@ COLORREF GetHilightColor(COLORREF clr1, COLORREF clr2) return res; } -COLORREF GetFullRowHighlight(COLORREF bkHighlightColor) // vraci "heuristicky" highlight pro full row mode +COLORREF GetFullRowHighlight(COLORREF bkHighlightColor) // Returns a heuristic highlight color for full-row mode. { - // trochu heuristiky: zsvetle pozadi budeme "trochu" ztmavovat a tmave pozadi "trochu" zesvetlovat + // A bit of heuristic tweaking: slightly darken light backgrounds and slightly brighten dark ones WORD h, l, s; ColorRGBToHLS(bkHighlightColor, &h, &l, &s); - if (l < 121) // [TMAVA] 0-120 -> zesvetlime Luminance progresivne 0..120 -> +40..+20 + if (l < 121) // [DARK] 0-120 -> progressively brighten luminance: 0..120 -> +40..+20 l += 20 + 20 * (120 - l) / 120; - else // [SVETLA] 121-240 -> ztmavime Luminance o konstatnich 20 + else // [LIGHT] 121-240 -> reduce luminance by a constant 20 l -= 20; return ColorHLSToRGB(h, l, s); @@ -1579,7 +1581,7 @@ void UpdateDefaultColors(SALCOLOR* colors, CHighlightMasks* highlightMasks, BOOL { int bitsPerPixel = GetCurrentBPP(); - // barvy pera pro ramecek kolem polozky prebereme ze systemove barvy textu okna + // Take the pen colors for the frame around the item from the system window text color. if (GetFValue(colors[FOCUS_ACTIVE_NORMAL]) & SCF_DEFAULT) SetRGBPart(&colors[FOCUS_ACTIVE_NORMAL], GetSysColor(COLOR_WINDOWTEXT)); if (GetFValue(colors[FOCUS_ACTIVE_SELECTED]) & SCF_DEFAULT) @@ -1589,23 +1591,23 @@ void UpdateDefaultColors(SALCOLOR* colors, CHighlightMasks* highlightMasks, BOOL if (GetFValue(colors[FOCUS_BK_INACTIVE_SELECTED]) & SCF_DEFAULT) SetRGBPart(&colors[FOCUS_BK_INACTIVE_SELECTED], GetSysColor(COLOR_WINDOW)); - // texty polozek v panelu prebereme ze systemove barvy textu okna + // Use the system window text color for panel item text if (GetFValue(colors[ITEM_FG_NORMAL]) & SCF_DEFAULT) SetRGBPart(&colors[ITEM_FG_NORMAL], GetSysColor(COLOR_WINDOWTEXT)); if (GetFValue(colors[ITEM_FG_FOCUSED]) & SCF_DEFAULT) SetRGBPart(&colors[ITEM_FG_FOCUSED], GetSysColor(COLOR_WINDOWTEXT)); - if (GetFValue(colors[ITEM_FG_HIGHLIGHT]) & SCF_DEFAULT) // FULL ROW HIGHLIGHT vychazi z _NORMAL + if (GetFValue(colors[ITEM_FG_HIGHLIGHT]) & SCF_DEFAULT) // FULL ROW HIGHLIGHT is derived from _NORMAL SetRGBPart(&colors[ITEM_FG_HIGHLIGHT], GetCOLORREF(colors[ITEM_FG_NORMAL])); - // pozadi polozek v panelu prebereme ze systemove barvy pozadi okna + // use the system window background color for panel item backgrounds if (GetFValue(colors[ITEM_BK_NORMAL]) & SCF_DEFAULT) SetRGBPart(&colors[ITEM_BK_NORMAL], GetSysColor(COLOR_WINDOW)); if (GetFValue(colors[ITEM_BK_SELECTED]) & SCF_DEFAULT) SetRGBPart(&colors[ITEM_BK_SELECTED], GetSysColor(COLOR_WINDOW)); - if (GetFValue(colors[ITEM_BK_HIGHLIGHT]) & SCF_DEFAULT) // HIGHLIGHT kopirujeme z NORMAL (aby fungovaly i custom/norton mody) + if (GetFValue(colors[ITEM_BK_HIGHLIGHT]) & SCF_DEFAULT) // Derive HIGHLIGHT from NORMAL (so custom/Norton modes also work) SetRGBPart(&colors[ITEM_BK_HIGHLIGHT], GetFullRowHighlight(GetCOLORREF(colors[ITEM_BK_NORMAL]))); - // barvy progress bary + // progress bar colors if (GetFValue(colors[PROGRESS_FG_NORMAL]) & SCF_DEFAULT) SetRGBPart(&colors[PROGRESS_FG_NORMAL], GetSysColor(COLOR_WINDOWTEXT)); if (GetFValue(colors[PROGRESS_FG_SELECTED]) & SCF_DEFAULT) @@ -1615,35 +1617,35 @@ void UpdateDefaultColors(SALCOLOR* colors, CHighlightMasks* highlightMasks, BOOL if (GetFValue(colors[PROGRESS_BK_SELECTED]) & SCF_DEFAULT) SetRGBPart(&colors[PROGRESS_BK_SELECTED], GetSysColor(COLOR_HIGHLIGHT)); - // barva selected odstinu ikonky + // selected icon tint color if (GetFValue(colors[ICON_BLEND_SELECTED]) & SCF_DEFAULT) { - // normalne kopirujeme do selected barvu z focused+selected + // By default, copy the selected color from the focused+selected state SetRGBPart(&colors[ICON_BLEND_SELECTED], GetCOLORREF(colors[ICON_BLEND_FOCSEL])); - // pokud jde o cervenou (salamandrovskej profil a muzeme si to diky barevne hloubce - // dovolit) pouzijeme pro selected svetlejsi odstin + // If the color is red (the Salamander profile, and the color depth allows it), + // use a lighter shade for the selected state. if (bitsPerPixel > 8 && GetCOLORREF(colors[ICON_BLEND_FOCSEL]) == RGB(255, 0, 0)) SetRGBPart(&colors[ICON_BLEND_SELECTED], RGB(255, 128, 128)); } #define COLOR_HOTLIGHT 26 // winuser.h - // titulky panelu (aktivni/neaktivni) + // panel captions (active/inactive) - // aktivni titulek panelu: POZADI + // active panel caption: BACKGROUND if (GetFValue(colors[ACTIVE_CAPTION_BK]) & SCF_DEFAULT) SetRGBPart(&colors[ACTIVE_CAPTION_BK], GetSysColor(COLOR_ACTIVECAPTION)); - // aktivni titulek panelu: TEXT + // active panel caption: TEXT if (GetFValue(colors[ACTIVE_CAPTION_FG]) & SCF_DEFAULT) SetRGBPart(&colors[ACTIVE_CAPTION_FG], GetSysColor(COLOR_CAPTIONTEXT)); - // neaktivni titulek panelu: POZADI + // inactive panel caption background if (GetFValue(colors[INACTIVE_CAPTION_BK]) & SCF_DEFAULT) SetRGBPart(&colors[INACTIVE_CAPTION_BK], GetSysColor(COLOR_INACTIVECAPTION)); - // neaktivni titulek panelu: TEXT + // inactive panel caption: TEXT if (GetFValue(colors[INACTIVE_CAPTION_FG]) & SCF_DEFAULT) { - // preferujeme stejnou barvu textu jako pro aktivni titulek, ale nekdy je tato barva priliz - // blizka barve pozadi, potom zkusime barvu pro textu pro neaktivni titulek + // We prefer the same text color as for the active caption, but sometimes that color is too + // close to the background color, so we try the inactive caption text color instead COLORREF clrBk = GetCOLORREF(colors[INACTIVE_CAPTION_BK]); COLORREF clrFgAc = GetSysColor(COLOR_CAPTIONTEXT); COLORREF clrFgIn = GetSysColor(COLOR_INACTIVECAPTIONTEXT); @@ -1653,12 +1655,12 @@ void UpdateDefaultColors(SALCOLOR* colors, CHighlightMasks* highlightMasks, BOOL SetRGBPart(&colors[INACTIVE_CAPTION_FG], (abs(grayFgAc - grayBk) >= abs(grayFgIn - grayBk)) ? clrFgAc : clrFgIn); } - // barvy hot polozek + // hot item colors COLORREF hotColor = GetSysColor(COLOR_HOTLIGHT); if (GetFValue(colors[HOT_PANEL]) & SCF_DEFAULT) SetRGBPart(&colors[HOT_PANEL], hotColor); - // hilight pro active panel caption + // highlight for the active panel caption if (GetFValue(colors[HOT_ACTIVE]) & SCF_DEFAULT) { COLORREF clr = GetCOLORREF(colors[ACTIVE_CAPTION_FG]); @@ -1666,7 +1668,7 @@ void UpdateDefaultColors(SALCOLOR* colors, CHighlightMasks* highlightMasks, BOOL clr = GetHilightColor(clr, GetCOLORREF(colors[ACTIVE_CAPTION_BK])); SetRGBPart(&colors[HOT_ACTIVE], clr); } - // hilight pro inactive panel caption + // highlight color for inactive panel caption if (GetFValue(colors[HOT_INACTIVE]) & SCF_DEFAULT) { COLORREF clr = GetCOLORREF(colors[INACTIVE_CAPTION_FG]); @@ -1678,7 +1680,7 @@ void UpdateDefaultColors(SALCOLOR* colors, CHighlightMasks* highlightMasks, BOOL if (processMasks) { - // barvy zavisle na jmenu+atributech souboru + // colors based on the file name and attributes int i; for (i = 0; i < highlightMasks->Count; i++) { @@ -1701,7 +1703,7 @@ void UpdateDefaultColors(SALCOLOR* colors, CHighlightMasks* highlightMasks, BOOL SetRGBPart(&item->FocSelBk, GetCOLORREF(colors[ITEM_BK_FOCSEL])); if (GetFValue(item->HighlightFg) & SCF_DEFAULT) SetRGBPart(&item->HighlightFg, GetCOLORREF(item->NormalFg)); - if (GetFValue(item->HighlightBk) & SCF_DEFAULT) // FULL ROW HIGHLIGHT vychazi z _NORMAL + if (GetFValue(item->HighlightBk) & SCF_DEFAULT) // FULL ROW HIGHLIGHT is derived from _NORMAL SetRGBPart(&item->HighlightBk, GetFullRowHighlight(GetCOLORREF(item->NormalBk))); } } @@ -1709,20 +1711,20 @@ void UpdateDefaultColors(SALCOLOR* colors, CHighlightMasks* highlightMasks, BOOL //**************************************************************************** // -// Na zaklade barevne hloubky displeje urci, jestli pouzivat 256 barevne -// nebo 16 barevne bitmapy. +// Determine whether to use 256-color or 16-color bitmaps based on the +// display color depth. // BOOL Use256ColorsBitmap() { int bitsPerPixel = GetCurrentBPP(); - return (bitsPerPixel > 8); // vice nez 256 barev + return (bitsPerPixel > 8); // more than 256 colors } DWORD GetImageListColorFlags() { - // pokud ma image list 16bitu barevnou hloubku, zlobi alfa kanal novych ikonek pod WinXP 32-bit barevny display (32-bitova hloubka slape) - // pokud ma image list 32bitu barevnou hloubku, zlobi blend pri kresleni selectene polozky pod Win2K 32-bit barevny display (16-bitova hloubka slape) + // If the image list uses 16-bit color depth, the alpha channel of new icons misbehaves on a 32-bit color display under WinXP (32-bit depth works correctly). + // If the image list uses 32-bit color depth, blending when drawing a selected item misbehaves on a 32-bit color display under Win2K (16-bit depth works correctly). return ILC_COLOR32; } @@ -1759,9 +1761,9 @@ int LoadColorTable(int id, RGBQUAD* rgb, int rgbCount) BOOL InitializeConstGraphics() { - // zajistime si hladky graficky vystup - // 20 volani GDI API by melo bohate stacit - // je to implicitni hodnota z NT 4.0 WS + // Ensure smooth graphics output. + // Batching up to 20 GDI API calls should be more than enough. + // This is the default value in Windows NT 4.0 Workstation. if (GdiGetBatchLimit() < 20) { TRACE_I("Increasing GdiBatchLimit"); @@ -1777,7 +1779,7 @@ BOOL InitializeConstGraphics() if (SystemParametersInfo(SPI_GETDRAGFULLWINDOWS, 0, &DragFullWindows, FALSE) == 0) DragFullWindows = TRUE; - // inicializace LogFont struktury + // Initialize the LOGFONT structure NONCLIENTMETRICS ncm; ncm.cbSize = sizeof(ncm); SystemParametersInfo(SPI_GETNONCLIENTMETRICS, ncm.cbSize, &ncm, 0); @@ -1799,7 +1801,7 @@ BOOL InitializeConstGraphics() strcpy(LogFont.lfFaceName, "MS Shell Dlg 2"); */ - // tyto brushe jsou alokovane systemem a automaticky se meni pri zmene barev + // These brushes are allocated by the system and update automatically when the colors change. HDialogBrush = GetSysColorBrush(COLOR_BTNFACE); HButtonTextBrush = GetSysColorBrush(COLOR_BTNTEXT); HMenuSelectedBkBrush = GetSysColorBrush(COLOR_HIGHLIGHT); @@ -1813,18 +1815,18 @@ BOOL InitializeConstGraphics() TRACE_E("Unable to create brush."); return FALSE; } - ItemBitmap.CreateBmp(NULL, 1, 1); // zajisteni existence bitmapy + ItemBitmap.CreateBmp(NULL, 1, 1); // ensure the bitmap exists - // bitmapu nacitame pouze jednou (neoprasujeme ji pri zmene rozliseni) - // a pokud by user prepnul barvy z 256 vejs, pri LoadBitmap (tedy bitmape - // kompatibilni s display DC) by bitmapa zustala v degradovanych barvach; - // proto ji nacteme jako DIB + // Load the bitmap only once; it is not reloaded when the resolution changes. + // If the user switched from 256 colors to a higher color depth, LoadBitmap + // would create a bitmap compatible with the display DC, and the bitmap would + // remain in degraded colors. Therefore, load it as a DIB. // HWorkerBitmap = HANDLES(LoadBitmap(HInstance, MAKEINTRESOURCE(IDB_WORKER))); //HWorkerBitmap = (HBITMAP)HANDLES(LoadImage(HInstance, MAKEINTRESOURCE(IDB_WORKER), IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION)); //if (HWorkerBitmap == NULL) // return FALSE; - // pri zmene fontu se volaji explicitne CreatePanelFont a CreateEnvFont, prvni inicializaci provedeme zde + // When the font changes, CreatePanelFont and CreateEnvFonts are called explicitly; do the initial setup here. CreatePanelFont(); CreateEnvFonts(); @@ -1907,8 +1909,8 @@ BOOL AuxAllocateImageLists() return TRUE; } -// pomoci TweakUI si mohou uzivatele menit ikonku shortcuty (default, custom, zadna) -// pokusime se ji ctit +// Using TweakUI, users can change the shortcut icon (default, custom, or none). +// We'll try to honor that setting. BOOL GetShortcutOverlay() { int i; @@ -1921,57 +1923,58 @@ BOOL GetShortcutOverlay() } } - /* - //#include - - // cteni ikon overlayu ze systemoveho image-listu, zbytecne pomale, nacteme je primo z imageres.dll - // tenhle kod tu nechavam jen pro pripad, ze bysme zase potrebovali zjistit kde ty ikony jsou - typedef DECLSPEC_IMPORT HRESULT (WINAPI *F__SHGetImageList)(int iImageList, REFIID riid, void **ppvObj); - - F__SHGetImageList MySHGetImageList = (F__SHGetImageList)GetProcAddress(Shell32DLL, "SHGetImageList"); // Min: XP - if (MySHGetImageList != NULL) - { - int shareIndex = SHGetIconOverlayIndex(NULL, IDO_SHGIOI_SHARE); - int linkIndex = SHGetIconOverlayIndex(NULL, IDO_SHGIOI_LINK); - int offlineIndex = SHGetIconOverlayIndex(NULL, IDO_SHGIOI_SLOWFILE); - shareIndex = SHGetIconOverlayIndex(NULL, IDO_SHGIOI_SHARE); - - IImageList *imageList; - if (MySHGetImageList(1 /* SHIL_SMALL * /, IID_IImageList, (void **)&imageList) == S_OK && - imageList != NULL) - { - int i; - imageList->GetOverlayImage(linkIndex, &i); - HICON icon; - if (imageList->GetIcon(i, 0, &icon) != S_OK) - icon = NULL; - HShortcutOverlays[ICONSIZE_16] = icon; - imageList->Release(); - } - if (MySHGetImageList(0 /* SHIL_LARGE * /, IID_IImageList, (void **)&imageList) == S_OK && - imageList != NULL) - { - int i; - imageList->GetOverlayImage(linkIndex, &i); - HICON icon; - if (imageList->GetIcon(i, 0, &icon) != S_OK) - icon = NULL; - HShortcutOverlays[ICONSIZE_32] = icon; - imageList->Release(); - } - if (MySHGetImageList(2 /* SHIL_EXTRALARGE * /, IID_IImageList, (void **)&imageList) == S_OK && - imageList != NULL) - { - int i; - imageList->GetOverlayImage(linkIndex, &i); - HICON icon; - if (imageList->GetIcon(i, 0, &icon) != S_OK) - icon = NULL; - HShortcutOverlays[ICONSIZE_48] = icon; - imageList->Release(); - } - } -*/ + /* + * //#include + * + * // Loading overlay icons from the system image list is unnecessarily slow, so we load them directly from imageres.dll instead. + * // This code is kept here in case we need to determine where those icons are again. + * typedef DECLSPEC_IMPORT HRESULT (WINAPI *F__SHGetImageList)(int iImageList, REFIID riid, void **ppvObj); + * + * F__SHGetImageList MySHGetImageList = (F__SHGetImageList)GetProcAddress(Shell32DLL, "SHGetImageList"); // Min: XP + * if (MySHGetImageList != NULL) + * { + * int shareIndex = SHGetIconOverlayIndex(NULL, IDO_SHGIOI_SHARE); + * int linkIndex = SHGetIconOverlayIndex(NULL, IDO_SHGIOI_LINK); + * int offlineIndex = SHGetIconOverlayIndex(NULL, IDO_SHGIOI_SLOWFILE); + * shareIndex = SHGetIconOverlayIndex(NULL, IDO_SHGIOI_SHARE); + * + * IImageList *imageList; + * if (MySHGetImageList(1 /* SHIL_SMALL * /, IID_IImageList, (void **)&imageList) == S_OK && + * imageList != NULL) + * { + * int i; + * imageList->GetOverlayImage(linkIndex, &i); + * HICON icon; + * if (imageList->GetIcon(i, 0, &icon) != S_OK) + * icon = NULL; + * HShortcutOverlays[ICONSIZE_16] = icon; + * imageList->Release(); + * } + * if (MySHGetImageList(0 /* SHIL_LARGE * /, IID_IImageList, (void **)&imageList) == S_OK && + * imageList != NULL) + * { + * int i; + * imageList->GetOverlayImage(linkIndex, &i); + * HICON icon; + * if (imageList->GetIcon(i, 0, &icon) != S_OK) + * icon = NULL; + * HShortcutOverlays[ICONSIZE_32] = icon; + * imageList->Release(); + * } + * if (MySHGetImageList(2 /* SHIL_EXTRALARGE * /, IID_IImageList, (void **)&imageList) == S_OK && + * imageList != NULL) + * { + * int i; + * imageList->GetOverlayImage(linkIndex, &i); + * HICON icon; + * if (imageList->GetIcon(i, 0, &icon) != S_OK) + * icon = NULL; + * HShortcutOverlays[ICONSIZE_48] = icon; + * imageList->Release(); + * } + * } + * / + */ HKEY hKey; if (NOHANDLES(RegOpenKeyEx(HKEY_LOCAL_MACHINE, @@ -1984,7 +1987,7 @@ BOOL GetShortcutOverlay() SalRegQueryValueEx(hKey, "29", NULL, NULL, (LPBYTE)buff, &buffLen); if (buff[0] != 0) { - char* num = strrchr(buff, ','); // cislo ikony je za posledni carkou + char* num = strrchr(buff, ','); // The icon number comes after the last comma. if (num != NULL) { int index = atoi(num + 1); @@ -2105,7 +2108,7 @@ int GetIconSizeForSystemDPI(CIconSizeEnum iconSize) int scale = GetScaleForSystemDPI(); - int baseIconSize[ICONSIZE_COUNT] = {16, 32, 48}; // musi odpovidat CIconSizeEnum + int baseIconSize[ICONSIZE_COUNT] = {16, 32, 48}; // must match CIconSizeEnum return (baseIconSize[iconSize] * scale) / 100; } @@ -2128,14 +2131,14 @@ void GetSystemDPI(HDC hDC) BOOL InitializeGraphics(BOOL colorsOnly) { - // 48x48 az od XP - // ve skutecnosti jsou velke ikonky podporeny uz davno, lze je nahodit - // Desktop/Properties/???/Large Icons; pozor, nebude pak existovat system image list - // pro ikonky 32x32; navic bychom meli ze systemu vytahnout realne velikosti ikonek - // zatim na to kasleme a 48x48 povolime az od XP, kde jsou bezne dostupne + // 48x48 only on XP and later + // Large icons have actually been supported for a long time; they can be enabled via + // Desktop/Properties/???/Large Icons. Note that there will then be no system image list + // for 32x32 icons; also, we should get the real icon sizes from the system. + // For now we ignore that and enable 48x48 only on XP, where they are commonly available. // - // Vytahneme z Registry pozadovanou barevnou hloubku ikonek + // Retrieve the requested icon color depth from the Registry // int iconColorsCount = 0; HDC hDesktopDC = GetDC(NULL); @@ -2150,7 +2153,7 @@ BOOL InitializeGraphics(BOOL colorsOnly) HKEY hKey; if (OpenKeyAux(NULL, HKEY_CURRENT_USER, "Control Panel\\Desktop\\WindowMetrics", hKey)) { - // dalsi zajimave hodnoty: "Shell Icon Size", "Shell Small Icon Size" + // other interesting values: "Shell Icon Size", "Shell Small Icon Size" char buff[100]; if (GetValueAux(NULL, hKey, "Shell Icon Bpp", REG_SZ, buff, 100)) { @@ -2160,8 +2163,8 @@ BOOL InitializeGraphics(BOOL colorsOnly) { if (WindowsVistaAndLater) { - // ve viste tento klic proste neni a zatim netusim, cim je nahrazen, - // takze se budeme tvarit, ze ikonky jedou v plnych barvach (jinak jsme zobrazovali 16 barevne hnusy) + // In Vista this key simply does not exist, and I still do not know what replaced it, + // so we will assume the icons use full color (otherwise we were showing ugly 16-color icons) iconColorsCount = 32; } } @@ -2193,7 +2196,7 @@ BOOL InitializeGraphics(BOOL colorsOnly) } Shell32DLL = HANDLES(LoadLibraryEx("shell32.dll", NULL, LOAD_LIBRARY_AS_DATAFILE)); - if (Shell32DLL == NULL) // to se snad vubec nemuze stat (zaklad win 4.0) + if (Shell32DLL == NULL) // This should never happen; shell32.dll is part of the Windows 4.0 base. { TRACE_E("Unable to load library shell32.dll."); return FALSE; @@ -2233,8 +2236,8 @@ BOOL InitializeGraphics(BOOL colorsOnly) return FALSE; } - // prekladac hlasil chybu: error C2712: Cannot use __try in functions that require object unwinding - // obchazim to vlozenim alokace do funkce + // The compiler reported error C2712: Cannot use __try in functions that require object unwinding + // Work around it by moving the allocation into a function // SymbolsIconList = new CIconList(); // LargeSymbolsIconList = new CIconList(); if (!AuxAllocateImageLists()) @@ -2268,8 +2271,8 @@ BOOL InitializeGraphics(BOOL colorsOnly) TRACE_E("Unable to create image list."); return FALSE; } - ImageList_SetImageCount(HFindSymbolsImageList, 2); // inicializace - // ImageList_SetBkColor(HFindSymbolsImageList, GetSysColor(COLOR_WINDOW)); // aby pod XP chodily pruhledne ikonky + ImageList_SetImageCount(HFindSymbolsImageList, 2); // initialization + // ImageList_SetBkColor(HFindSymbolsImageList, GetSysColor(COLOR_WINDOW)); // so transparent icons work on XP int iconSize = IconSizes[ICONSIZE_16]; HBITMAP hTmpMaskBitmap; @@ -2318,7 +2321,7 @@ BOOL InitializeGraphics(BOOL colorsOnly) return FALSE; } - // vytahnu z shell 32 ikony: + // Load icons from shell32: int indexes[] = {symbolsExecutable, symbolsDirectory, symbolsNonAssociated, symbolsAssociated, -1}; int resID[] = {3, 4, 1, 2, -1}; int vistaResID[] = {15, 4, 2, 90, -1}; @@ -2351,7 +2354,7 @@ BOOL InitializeGraphics(BOOL colorsOnly) int sizeIndex; for (sizeIndex = ICONSIZE_16; sizeIndex < ICONSIZE_COUNT; sizeIndex++) { - // ikonka adresare + // folder icon hIcon = NULL; __try { @@ -2363,20 +2366,20 @@ BOOL InitializeGraphics(BOOL colorsOnly) FGIExceptionHasOccured++; hIcon = NULL; } - if (hIcon != NULL) // pokud ikonku neziskame, je tam porad jeste 4-rka z shell32.dll + if (hIcon != NULL) // if we do not obtain the icon, the #4 one from shell32.dll remains { SimpleIconLists[sizeIndex]->ReplaceIcon(symbolsDirectory, hIcon); NOHANDLES(DestroyIcon(hIcon)); } - // ikonka ".." + // ".." icon hIcon = (HICON)HANDLES(LoadImage(HInstance, MAKEINTRESOURCE(IDI_UPPERDIR), IMAGE_ICON, IconSizes[sizeIndex], IconSizes[sizeIndex], IconLRFlags)); SimpleIconLists[sizeIndex]->ReplaceIcon(symbolsUpDir, hIcon); HANDLES(DestroyIcon(hIcon)); - // ikonka archiv + // archive icon hIcon = LoadArchiveIcon(IconSizes[sizeIndex], IconSizes[sizeIndex], IconLRFlags); SimpleIconLists[sizeIndex]->ReplaceIcon(symbolsArchive, hIcon); HANDLES(DestroyIcon(hIcon)); @@ -2483,17 +2486,17 @@ BOOL InitializeGraphics(BOOL colorsOnly) return FALSE; } - clrMap[0].from = RGB(128, 128, 128); // seda -> COLOR_BTNSHADOW + clrMap[0].from = RGB(128, 128, 128); // gray -> COLOR_BTNSHADOW clrMap[0].to = GetSysColor(COLOR_BTNSHADOW); - clrMap[1].from = RGB(0, 0, 0); // cerna -> COLOR_BTNTEXT + clrMap[1].from = RGB(0, 0, 0); // black -> COLOR_BTNTEXT clrMap[1].to = GetSysColor(COLOR_BTNTEXT); - clrMap[2].from = RGB(255, 255, 255); // bila -> pruhledna + clrMap[2].from = RGB(255, 255, 255); // white -> transparent clrMap[2].to = RGB(255, 0, 255); HBITMAP hBottomTB = HANDLES(CreateMappedBitmap(HInstance, IDB_BOTTOMTOOLBAR, 0, clrMap, 3)); BOOL remapWhite = FALSE; if (GetCurrentBPP() > 8) { - clrMap[2].from = RGB(255, 255, 255); // bila -> svetle sedivou (at to tak nerve) + clrMap[2].from = RGB(255, 255, 255); // white -> light gray (so it's not so harsh) clrMap[2].to = RGB(235, 235, 235); remapWhite = TRUE; } @@ -2799,12 +2802,12 @@ BOOL PointToLocalDecimalSeparator(char* buffer, int bufferSize) // **************************************************************************** // -// GetCmdLine - ziskani parametru z prikazove radky +// GetCmdLine - get arguments from the command line // -// buf + size - buffer pro parametry -// argv - pole ukazatelu, ktere se naplni parametry -// argCount - na vstupu je to pocet prvku v argv, na vystupu obsahuje pocet parametru -// cmdLine - parametry prikazove radky (bez jmena .exe souboru - z WinMain) +// buf + size - buffer for the arguments +// argv - array of pointers to be filled with the arguments +// argCount - on input, the number of elements in argv; on output, contains the number of arguments +// cmdLine - command-line arguments (without the .exe file name - from WinMain) BOOL GetCmdLine(char* buf, int size, char* argv[], int& argCount, char* cmdLine) { @@ -2817,7 +2820,7 @@ BOOL GetCmdLine(char* buf, int size, char* argv[], int& argCount, char* cmdLine) char term; while (*s != 0) { - if (*s == '"') // pocatecni '"' + if (*s == '"') // leading '"' { if (*++s == 0) break; @@ -2829,13 +2832,13 @@ BOOL GetCmdLine(char* buf, int size, char* argv[], int& argCount, char* cmdLine) if (argCount < space && c < end) argv[argCount++] = c; else - return c < end; // chyba jen pokud je maly buffer + return c < end; // Error only if the buffer is too small while (1) { if (*s == term || *s == 0) { - if (*s == 0 || term != '"' || *++s != '"') // neni-li to nahrada "" -> " + if (*s == 0 || term != '"' || *++s != '"') // unless this is the "" -> " substitution { if (*s != 0) s++; @@ -2878,18 +2881,18 @@ typedef HRESULT(CALLBACK* DLLGETVERSIONPROC)(DLLVERSIONINFO*); HRESULT GetComCtlVersion(LPDWORD pdwMajor, LPDWORD pdwMinor) { HINSTANCE hComCtl; - //load the DLL + // Load the DLL hComCtl = HANDLES(LoadLibrary(TEXT("comctl32.dll"))); if (hComCtl) { HRESULT hr = S_OK; DLLGETVERSIONPROC pDllGetVersion; /* - You must get this function explicitly because earlier versions of the DLL - don't implement this function. That makes the lack of implementation of the - function a version marker in itself. - */ - pDllGetVersion = (DLLGETVERSIONPROC)GetProcAddress(hComCtl, TEXT("DllGetVersion")); // nema header + This function must be obtained explicitly because earlier versions of the DLL + do not implement it. The absence of this function therefore serves as a + version marker. + */ + pDllGetVersion = (DLLGETVERSIONPROC)GetProcAddress(hComCtl, TEXT("DllGetVersion")); // no header available if (pDllGetVersion) { DLLVERSIONINFO dvi; @@ -2963,8 +2966,8 @@ BOOL PackErrorHandler(HWND parent, const WORD err, ...) void ColorsChanged(BOOL refresh, BOOL colorsOnly, BOOL reloadUMIcons) { CALL_STACK_MESSAGE2("ColorsChanged(%d)", refresh); - // POZOR! fonts musi byt FALSE, aby nedoslo k zmene handlu fontu, o ktere - // se museji dozvedet toolbary, ktere jej pouzivaji + // WARNING! fonts must be FALSE to avoid changing the font handle, + // and the toolbars that use it would have to be notified of that change ReleaseGraphics(colorsOnly); InitializeGraphics(colorsOnly); ItemBitmap.ReCreateForScreenDC(); @@ -2982,10 +2985,10 @@ void ColorsChanged(BOOL refresh, BOOL colorsOnly, BOOL reloadUMIcons) MainWindow->OnColorsChanged(reloadUMIcons); } - // dame vedet findum o zmene barev + // notify the Find dialogs about the color change FindDialogQueue.BroadcastMessage(WM_USER_COLORCHANGEFIND, 0, 0); - // rozesleme tuto novinku i mezi plug-iny + // Notify the plugins of this change as well. Plugins.Event(PLUGINEVENT_COLORSCHANGED, 0); if (MainWindow != NULL && MainWindow->HTopRebar != NULL) @@ -2995,7 +2998,7 @@ void ColorsChanged(BOOL refresh, BOOL colorsOnly, BOOL reloadUMIcons) { InvalidateRect(MainWindow->HWindow, NULL, TRUE); } - // Internal Viewer a Find: obnova vsech oken + // Internal Viewer and Find: refresh all windows BroadcastConfigChanged(); } @@ -3097,7 +3100,7 @@ CMessagesKeeper MessagesKeeper; typedef VOID(WINAPI* FDisableProcessWindowsGhosting)(VOID); -void TurnOFFWindowGhosting() // kdyz se "ghosting" nevypne, schovavaji se safe-wait-okenka po peti sekundach "not responding" stavu aplikace (kdyz aplikace nezpracovava zpravy) +void TurnOFFWindowGhosting() // If "ghosting" is not disabled, the safe-wait windows are hidden after the application has been in a "not responding" state for five seconds (when it is not processing messages) { if (User32DLL != NULL) { @@ -3143,12 +3146,12 @@ void CleanUID(char* uid) //#ifdef MSVC_RUNTIME_CHECKS char RTCErrorDescription[RTC_ERROR_DESCRIPTION_SIZE] = {0}; -// custom reporting funkce opsana z MSDN - http://msdn.microsoft.com/en-us/library/cb00sk7k(v=VS.90).aspx +// custom reporting function copied from MSDN - http://msdn.microsoft.com/en-us/library/cb00sk7k(v=VS.90).aspx #pragma runtime_checks("", off) int MyRTCErrorFunc(int errType, const wchar_t* file, int line, const wchar_t* module, const wchar_t* format, ...) { - // Prevent re-entrance. + // Prevent reentrancy. static long running = 0; while (InterlockedExchange(&running, 1)) Sleep(0); @@ -3158,7 +3161,7 @@ int MyRTCErrorFunc(int errType, const wchar_t* file, int line, for (int i = 0; i < numErrors; i++) errors[i] = _RTC_SetErrorType((_RTC_ErrorNumber)i, _RTC_ERRTYPE_IGNORE); - // First, get the rtc error number from the var-arg list. + // First, retrieve the RTC error number from the variadic argument list. va_list vl; va_start(vl, format); _RTC_ErrorNumber rtc_errnum = va_arg(vl, _RTC_ErrorNumber); @@ -3178,13 +3181,13 @@ int MyRTCErrorFunc(int errType, const wchar_t* file, int line, bufA[RTC_ERROR_DESCRIPTION_SIZE - 1] = 0; lstrcpyn(RTCErrorDescription, bufA, RTC_ERROR_DESCRIPTION_SIZE); - // radeji to tady zalomime s exception, bude snad jasnejsi callstack - pokud by nebyl, muzeme tady tu exception odstranit - // viz popis chovani _CrtDbgReportW - http://msdn.microsoft.com/en-us/library/8hyw4sy7(v=VS.90).aspx - RaiseException(OPENSAL_EXCEPTION_RTC, 0, 0, NULL); // nase vlastni "rtc" exception + // Prefer raising an exception here so the call stack is hopefully clearer; if it is not, we can remove this exception. + // See the description of _CrtDbgReportW behavior: http://msdn.microsoft.com/en-us/library/8hyw4sy7(v=VS.90).aspx + RaiseException(OPENSAL_EXCEPTION_RTC, 0, 0, NULL); // our custom "RTC" exception - // sem uz se nedostaneme, proces byl ukoncen; pokracuji jen z formalnich duvodu, kdybychom neco menili + // We should never get here because the process has been terminated; continuing only for form's sake in case this ever changes. - // Now, restore the RTC errortypes. + // Now, restore the RTC error types. for (int i = 0; i < numErrors; i++) _RTC_SetErrorType((_RTC_ErrorNumber)i, errors[i]); running = 0; @@ -3199,7 +3202,7 @@ int MyRTCErrorFunc(int errType, const wchar_t* file, int line, #ifdef _DEBUG -DWORD LastCrtCheckMemoryTime; // kdy jsme posledne kontrolovali pamet v IDLE +DWORD LastCrtCheckMemoryTime; // Time of the last memory check in IDLE #endif //_DEBUG @@ -3226,16 +3229,16 @@ BOOL FindPluginsWithoutImportedCfg(BOOL* doNotDeleteImportedCfg) sprintf(msg, LoadStr(IDS_NOTALLPLUGINSCFGIMPORTED), names, skippedNames); params.Text = msg; char aliasBtnNames[200]; - /* slouzi pro skript export_mnu.py, ktery generuje salmenu.mnu pro Translator - nechame pro tlacitka msgboxu resit kolize hotkeys tim, ze simulujeme, ze jde o menu -MENU_TEMPLATE_ITEM MsgBoxButtons[] = -{ - {MNTT_PB, 0 - {MNTT_IT, IDS_STARTWITHOUTMISSINGPLUGINS - {MNTT_IT, IDS_SELLANGEXITBUTTON - {MNTT_PE, 0 -}; -*/ + /* used by the export_mnu.py script, which generates salmenu.mnu for Translator + for message-box buttons, let hotkey collisions be resolved by pretending they are a menu + MENU_TEMPLATE_ITEM MsgBoxButtons[] = + { + {MNTT_PB, 0 + {MNTT_IT, IDS_STARTWITHOUTMISSINGPLUGINS + {MNTT_IT, IDS_SELLANGEXITBUTTON + {MNTT_PE, 0 + }; + */ sprintf(aliasBtnNames, "%d\t%s\t%d\t%s", DIALOG_OK, LoadStr(IDS_STARTWITHOUTMISSINGPLUGINS), DIALOG_CANCEL, LoadStr(IDS_SELLANGEXITBUTTON)); @@ -3255,7 +3258,7 @@ void StartNotepad(const char* file) if (lstrlen(file) >= MAX_PATH) return; - GetSystemDirectory(buf, MAX_PATH); // dame mu systemovy adresar, at neblokuje mazani soucasneho pracovniho adresare + GetSystemDirectory(buf, MAX_PATH); // Use the system directory so it does not prevent deletion of the current working directory. wsprintf(buf2, "notepad.exe \"%s\"", file); si.cb = sizeof(STARTUPINFO); if (HANDLES(CreateProcess(NULL, buf2, NULL, NULL, TRUE, CREATE_DEFAULT_ERROR_MODE | NORMAL_PRIORITY_CLASS, @@ -3268,20 +3271,20 @@ void StartNotepad(const char* file) BOOL RunningInCompatibilityMode() { - // Pokud bezime pod XP nebo nasledujicim OS, hrozi ze snazivy uzivatel zapnul - // Compatibility Mode. Pokud tomu tak je, zobrazime varovani. - // POZOR: Application Verifier nastavuje verzi Windows na novejsi nez skutecne je, - // dela to pri testovani aplikace pri ziskavani "Windows 7 Software Logo". + // If running on Windows XP or a later OS, there is a risk that an overhelpful user enabled + // Compatibility Mode. If so, display a warning. + // WARNING: Application Verifier reports the Windows version as newer than it really is. + // It does this while testing the application for the "Windows 7 Software Logo". WORD kernel32major, kernel32minor; if (GetModuleVersion(GetModuleHandle("kernel32.dll"), &kernel32major, &kernel32minor)) { TRACE_I("kernel32.dll: " << kernel32major << ":" << kernel32minor); - // musime zavolat GetVersionEx, protoze vraci hodnoty podle nastaveneho Compatibility Mode - // (SalIsWindowsVersionOrGreater nastaveny Compatibility Mode ignoruje) + // GetVersionEx must be called because it returns values based on the active Compatibility Mode + // (SalIsWindowsVersionOrGreater ignores the active Compatibility Mode) OSVERSIONINFO os; os.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - // jen se vyhybame deprecated warningu, GetVersionEx snad bude vzdy a vsude + // just avoiding the deprecation warning; GetVersionEx will hopefully always be available everywhere typedef BOOL(WINAPI * FDynGetVersionExA)(LPOSVERSIONINFOA lpVersionInformation); FDynGetVersionExA DynGetVersionExA = (FDynGetVersionExA)GetProcAddress(GetModuleHandle("kernel32.dll"), "GetVersionExA"); @@ -3294,16 +3297,18 @@ BOOL RunningInCompatibilityMode() DynGetVersionExA(&os); TRACE_I("GetVersionEx(): " << os.dwMajorVersion << ":" << os.dwMinorVersion); - // aktualni verze Salamandera je manifestovana pro Windows 10 + // the current version of Salamander is manifested for Windows 10 const DWORD SAL_MANIFESTED_FOR_MAJOR = 10; const DWORD SAL_MANIFESTED_FOR_MINOR = 0; - // GetVersionEx nikdy nevrati vic nez os.dwMajorVersion == SAL_MANIFESTED_FOR_MAJOR - // a os.dwMinorVersion == SAL_MANIFESTED_FOR_MINOR, je-li tedy kernel32.dll vyssi - // verze, nejsme schopni 100% detekovat Compatibility Mode, je potreba mafinestovat - // Salamandera pro nove Windows a posunout konstanty SAL_MANIFESTED_FOR_MAJOR a - // SAL_MANIFESTED_FOR_MINOR, detekujeme aspon nastaveni Compatibility Mode na - // starsi Windows, nez pro ktera je Salamander manifestovan + // GetVersionEx never returns a version higher than + // os.dwMajorVersion == SAL_MANIFESTED_FOR_MAJOR and + // os.dwMinorVersion == SAL_MANIFESTED_FOR_MINOR. If kernel32.dll is newer, + // we cannot detect Compatibility Mode with 100% certainty; Salamander must be + // manifested for the newer Windows version and the constants + // SAL_MANIFESTED_FOR_MAJOR and SAL_MANIFESTED_FOR_MINOR must be updated. + // We can at least detect Compatibility Mode set to an older Windows version + // than the one Salamander is manifested for if (kernel32major > SAL_MANIFESTED_FOR_MAJOR || kernel32major == SAL_MANIFESTED_FOR_MAJOR && kernel32minor > SAL_MANIFESTED_FOR_MINOR) { @@ -3322,21 +3327,21 @@ void GetCommandLineParamExpandEnvVars(const char* argv, char* target, DWORD targ char curDir[MAX_PATH]; if (hotpathForJumplist) { - BOOL ret = ExpandHotPath(NULL, argv, target, targetSize, FALSE); // pokud neni syntax cesty OK, vyskoci TRACE_E, coz nas netrapi + BOOL ret = ExpandHotPath(NULL, argv, target, targetSize, FALSE); // If the path syntax is invalid, TRACE_E will fire, which is fine here. if (!ret) { TRACE_E("ExpandHotPath failed."); - // pokud expanze selze, pouzijeme retezec bez expanze + // If expansion fails, use the original unexpanded string. lstrcpyn(target, argv, targetSize); } } else { - DWORD auxRes = ExpandEnvironmentStrings(argv, target, targetSize); // uzivatele si prali moznost predavat jako parametr env promenne + DWORD auxRes = ExpandEnvironmentStrings(argv, target, targetSize); // Users wanted to be able to pass environment variables as parameters. if (auxRes == 0 || auxRes > targetSize) { TRACE_E("ExpandEnvironmentStrings failed."); - // pokud expanze selze, pouzijeme retezec bez expanze + // If expansion fails, use the original string unchanged. lstrcpyn(target, argv, targetSize); } } @@ -3346,15 +3351,15 @@ void GetCommandLineParamExpandEnvVars(const char* argv, char* target, DWORD targ } } -// pokud jsou parametry OK, vraci TRUE, jinak vraci FALSE +// Returns TRUE if the parameters are valid; otherwise returns FALSE BOOL ParseCommandLineParameters(LPSTR cmdLine, CCommandLineParams* cmdLineParams) { - // nechceme menit cesty, menit ikonu, menit prefix -- vse je potreba vynulovat + // We do not want to change the paths, icon, or prefix, so everything has to be zeroed out. ZeroMemory(cmdLineParams, sizeof(CCommandLineParams)); char buf[4096]; char* argv[20]; - int p = 20; // pocet prvku pole argv + int p = 20; // number of elements in the argv array char curDir[MAX_PATH]; GetModuleFileName(HInstance, ConfigurationName, MAX_PATH); @@ -3363,7 +3368,7 @@ BOOL ParseCommandLineParameters(LPSTR cmdLine, CCommandLineParams* cmdLineParams strcat(ConfigurationName, configReg); if (!FileExists(ConfigurationName) && GetOurPathInRoamingAPPDATA(curDir) && SalPathAppend(curDir, configReg, MAX_PATH) && FileExists(curDir)) - { // pokud neexistuje soubor config.reg u .exe, hledame ho jeste v APPDATA + { // If config.reg is not found next to the .exe, also look for it in APPDATA. lstrcpyn(ConfigurationName, curDir, MAX_PATH); ConfigurationNameIgnoreIfNotExists = FALSE; } @@ -3403,7 +3408,7 @@ BOOL ParseCommandLineParameters(LPSTR cmdLine, CCommandLineParams* cmdLineParams } } - if (StrICmp(argv[i], "-aj") == 0) // active panel path (hot paths syntax for jumplist) - interni, nedokumentovane + if (StrICmp(argv[i], "-aj") == 0) // active panel path (Hot Paths syntax for Jump List) - internal, undocumented { if (i + 1 < p) { @@ -3419,18 +3424,18 @@ BOOL ParseCommandLineParameters(LPSTR cmdLine, CCommandLineParams* cmdLineParams { char* s = argv[i + 1]; if (*s == '\\' && *(s + 1) == '\\' || // UNC full path - *s != 0 && *(s + 1) == ':') // "c:\" full path - { // plne jmeno + *s != 0 && *(s + 1) == ':') // full path + { // full path lstrcpyn(ConfigurationName, argv[i + 1], MAX_PATH); } - else // relativni jmeno + else // relative path { GetModuleFileName(HInstance, ConfigurationName, MAX_PATH); *(strrchr(ConfigurationName, '\\') + 1) = 0; SalPathAppend(ConfigurationName, s, MAX_PATH); if (!FileExists(ConfigurationName) && GetOurPathInRoamingAPPDATA(curDir) && SalPathAppend(curDir, s, MAX_PATH) && FileExists(curDir)) - { // pokud neexistuje relativne zadany soubor za -C u .exe, hledame ho jeste v APPDATA + { // If the file specified after -C relative to the .exe does not exist, also look for it in APPDATA. lstrcpyn(ConfigurationName, curDir, MAX_PATH); } } @@ -3457,7 +3462,7 @@ BOOL ParseCommandLineParameters(LPSTR cmdLine, CCommandLineParams* cmdLineParams } } - if (StrICmp(argv[i], "-t") == 0) // title prefix + if (StrICmp(argv[i], "-t") == 0) // title bar prefix { if (i + 1 < p) { @@ -3475,7 +3480,7 @@ BOOL ParseCommandLineParameters(LPSTR cmdLine, CCommandLineParams* cmdLineParams } } - if (StrICmp(argv[i], "-o") == 0) // tvarime se, jako by bylo nahozene OnlyOneIstance + if (StrICmp(argv[i], "-o") == 0) // behave as if OnlyOneInstance were enabled { Configuration.ForceOnlyOneInstance = TRUE; continue; @@ -3496,13 +3501,13 @@ BOOL ParseCommandLineParameters(LPSTR cmdLine, CCommandLineParams* cmdLineParams } if (StrICmp(argv[i], "-run_notepad") == 0 && i + 1 < p) - { // Vista+: after installation: installer (SFX7ZIP) executes Salamander and asks for execution of notepad with readme file + { // Vista+: after installation, the installer (SFX7ZIP) runs Salamander and asks it to launch Notepad with the readme file lstrcpyn(OpenReadmeInNotepad, argv[i + 1], MAX_PATH); i++; continue; } - return FALSE; // wrong parameters + return FALSE; // invalid parameters } } return TRUE; @@ -3512,10 +3517,10 @@ int WinMainBody(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR cmdLine, { int myExitCode = 1; - //--- nechci zadne kriticke chyby jako "no disk in drive A:" + //--- I do not want any critical errors such as "no disk in drive A:" SetErrorMode(SetErrorMode(0) | SEM_FAILCRITICALERRORS); - // seed generatoru nahodnych cisel + // seed the random number generator srand((unsigned)time(NULL) ^ (unsigned)_getpid()); #ifdef _DEBUG @@ -3526,49 +3531,49 @@ int WinMainBody(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR cmdLine, // #define _CRTDBG_CHECK_CRT_DF 0x10 /* Leak check/diff CRT blocks */ // #define _CRTDBG_LEAK_CHECK_DF 0x20 /* Leak check at program exit */ - // pri podezreni na prepis alokovane pameti lze odkomentovat nasledujici dva radky - // dojde ke zpomaleni Salamandera a pri kazdem free alloc se provede test konzistence heapu + // If you suspect overwriting allocated memory, uncomment the following two lines. + // Salamander will slow down and each free/alloc will run a heap consistency check. // int crtDbg = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); // Get the current bits // _CrtSetDbgFlag(crtDbg | _CRTDBG_CHECK_ALWAYS_DF); // _CrtSetDbgFlag(crtDbg | _CRTDBG_LEAK_CHECK_DF); - // dalsi zajimava funkce pro ladeni: pokud dojde k memory leaku, v zavorce je zobrazeno - // dekadicke cislo, ktere udava poradi alokovaneho bloku, napriklad _CRT_WARN: {104200}; - // funkci _CrtSetBreakAlloc umoznuje breaknou na tomto bloku + // Another useful debugging function: if a memory leak occurs, the number in braces + // is the decimal order of the allocated block, for example _CRT_WARN: {104200}; + // _CrtSetBreakAlloc lets you break on this block. // _CrtSetBreakAlloc(33521); LastCrtCheckMemoryTime = GetTickCount(); - // na tomto pripade prepisu konce pameti zabere ochrana -- v IDLE se zobrazi messagebox - // a do TraceServeru se nalejou debug hlasky + // In this end-of-buffer overwrite case, the protection kicks in: in IDLE a message box is shown + // and debug messages are sent to TraceServer. // // char *p1 = (char*)malloc( 4 ); // strcpy( p1 , "Oops" ); #endif //_DEBUG /* - // test "Heap Block Corruptions: Full-page heap", viz http://support.microsoft.com/kb/286470 - // alokuje vsechny bloky (musi mit aspon 16 bytu) tak, ze za nimi je nepristupna stranka, takze - // jakykoliv prepis konce bloku vede k exceptione - // instalovat Debugging Tools for Windows, v gflags.exe pro "salamand.exe" vybrat "Enable page heap", - // fungovalo mi to pod W2K i pod XP (pod Vistou by melo taky) - // NEBO: pouzit pripravene sal-pageheap-register.reg a sal-pageheap-unregister.reg (to pak neni - // potreba instalovat Debugging Tools for Windows) - // - // prosinec/2011: testoval jsem pod VS2008 + page heap + Win7x64 a nasledujici prepis nevyvolava exception - // nasel jsem popis alokace v tomto rezimu: http://msdn.microsoft.com/en-us/library/ms220938(v=VS.90).aspx - - char *test = (char *)malloc(16); -// char *test = (char *)HeapAlloc(GetProcessHeap(), 0, 16); - char bufff[100]; - sprintf(bufff, "test=%p", test); - MessageBox(NULL, bufff, "a", MB_OK); - test[16] = 0; -*/ + // test "Heap Block Corruptions: Full-page heap", see http://support.microsoft.com/kb/286470 + // allocates all blocks (they must be at least 16 bytes) so that there is an inaccessible page after them, so + // any overwrite past the end of a block leads to an exception + // install Debugging Tools for Windows, in gflags.exe select "Enable page heap" for "salamand.exe", + // it worked for me on W2K and XP (it should work on Vista too) + // OR: use the prepared sal-pageheap-register.reg and sal-pageheap-unregister.reg files (then there is no + // need to install Debugging Tools for Windows) + // + // December 2011: I tested this under VS2008 + page heap + Win7x64 and the overwrite below does not raise an exception + // I found a description of allocation in this mode here: http://msdn.microsoft.com/en-us/library/ms220938(v=VS.90).aspx + + char *test = (char *)malloc(16); + // char *test = (char *)HeapAlloc(GetProcessHeap(), 0, 16); + char bufff[100]; + sprintf(bufff, "test=%p", test); + MessageBox(NULL, bufff, "a", MB_OK); + test[16] = 0; + */ char testCharValue = 129; int testChar = testCharValue; - if (testChar != 129) // pokud bude testChar zaporne, mame problem: LowerCase[testCharValue] saha mimo pole... + if (testChar != 129) // If testChar is negative, we have a problem: LowerCase[testCharValue] indexes outside the array bounds... { MessageBox(NULL, "Default type 'char' is not 'unsigned char', but 'signed char'. See '/J' compiler switch in MSVC.", "Compilation Error", MB_OK | MB_ICONSTOP); @@ -3578,9 +3583,9 @@ int WinMainBody(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR cmdLine, HInstance = hInstance; CALL_STACK_MESSAGE4("WinMainBody(0x%p, , %s, %d)", hInstance, cmdLine, cmdShow); - // Tak za tohle ja nemuzu ... co delat, kdyz to dela konkurence, musime - // taky - inspirovano v Exploreru. - // A ja se divil, ze jim tak pekne chodi paint. + // I cannot help this one... if the competition does it, we have to do it too + // - inspired by Explorer. + // I used to wonder why their painting worked so nicely. SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL); SetTraceProcessName("Salamander"); @@ -3588,28 +3593,28 @@ int WinMainBody(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR cmdLine, SetMessagesTitle(MAINWINDOW_NAME); TRACE_I("Begin"); - // inicializace OLE + // OLE initialization if (FAILED(OleInitialize(NULL))) { TRACE_E("Error in CoInitialize."); return 1; } - // HOldWPHookProc = SetWindowsHookEx(WH_CALLWNDPROC, // HANDLES neumi! + // HOldWPHookProc = SetWindowsHookEx(WH_CALLWNDPROC, // HANDLES cannot do this! // WPMessageHookProc, // NULL, GetCurrentThreadId()); User32DLL = NOHANDLES(LoadLibrary("user32.dll")); if (User32DLL == NULL) - TRACE_E("Unable to load library user32.dll."); // neni fatalni chyba + TRACE_E("Unable to load library user32.dll."); // Not a fatal error. TurnOFFWindowGhosting(); NtDLL = HANDLES(LoadLibrary("NTDLL.DLL")); if (NtDLL == NULL) - TRACE_E("Unable to load library ntdll.dll."); // neni fatalni chyba + TRACE_E("Unable to load library ntdll.dll."); // not a fatal error - // detekce defaultniho userova charsetu pro fonty + // detect the user's default charset for fonts CHARSETINFO ci; memset(&ci, 0, sizeof(ci)); char bufANSI[10]; @@ -3621,7 +3626,7 @@ int WinMainBody(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR cmdLine, } } - // kvuli pouzivani souboru mapovanych do pameti je nutne ziskat granularitu alokaci + // Get the allocation granularity needed for memory-mapped files. SYSTEM_INFO si; GetSystemInfo(&si); AllocationGranularity = si.dwAllocationGranularity; @@ -3636,13 +3641,13 @@ int WinMainBody(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR cmdLine, // Windows 7 6 1 // Windows 8 6 2 // Windows 8.1 6 3 - // Windows 10 10 0 (poznamka: preview verze W10 z 2014 vracely verzi 6.4) + // Windows 10 10 0 (note: preview builds of W10 from 2014 reported version 6.4) if (!SalIsWindowsVersionOrGreater(6, 1, 0)) { - // sem se to pravdepodobne nedostane, na starsich systemech budou chybet exporty staticky linkovanych - // knihoven a uzivatele serve nejaka nepochopitelna hlaska na urovni PE loaderu ve Windows - // nevolat SalMessageBox + // We will probably never get here; on older systems, exports from statically linked + // libraries will be missing and the user will get some incomprehensible PE-loader-level error in Windows. + // Do not call SalMessageBox. MessageBox(NULL, "You need at least Windows 7 to run this program.", SALAMANDER_TEXT_VERSION, MB_OK | MB_ICONEXCLAMATION); EXIT_1: @@ -3670,7 +3675,7 @@ int WinMainBody(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR cmdLine, if (GetProcessIntegrityLevel(&integrityLevel) && integrityLevel >= SECURITY_MANDATORY_HIGH_RID) RunningAsAdmin = TRUE; - // pokud je to mozne, pouzijeme GetNativeSystemInfo, jinak si nechame vysledek GetSystemInfo + // If possible, use GetNativeSystemInfo; otherwise keep the result from GetSystemInfo. typedef void(WINAPI * PGNSI)(LPSYSTEM_INFO); PGNSI pGNSI = (PGNSI)GetProcAddress(GetModuleHandle("kernel32.dll"), "GetNativeSystemInfo"); // Min: XP if (pGNSI != NULL) @@ -3680,7 +3685,7 @@ int WinMainBody(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR cmdLine, if (!GetWindowsDirectory(WindowsDirectory, MAX_PATH)) WindowsDirectory[0] = 0; - // zajima nas iface ITaskbarList3, ktery MS zavedli od Windows 7 - napriklad progress v taskbar buttons + // We care about the ITaskbarList3 interface, introduced by Microsoft in Windows 7, for example taskbar button progress. if (Windows7AndLater) { TaskbarBtnCreatedMsg = RegisterWindowMessage("TaskbarButtonCreated"); @@ -3691,22 +3696,22 @@ int WinMainBody(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR cmdLine, } } - // mame nastavene globalni promenne, muzeme inicializovat tento mutex + // The global variables are set, so we can initialize this mutex. if (!TaskList.Init()) TRACE_E("TaskList.Init() failed!"); if (!InitializeWinLib()) - goto EXIT_1; // musime inicializovat WinLib pred prvnim zobrazenim - // wait dialogu (musi byt registrovany tridy oken) - // ImportConfiguration uz muze otevrit tento dialog + goto EXIT_1; // We must initialize WinLib before the wait dialog is shown for the first time + // because its window classes must already be registered. + // ImportConfiguration may already open this dialog. LoadSaveToRegistryMutex.Init(); - // zkusime z aktualni konfigurace vytahnout hodnotu "AutoImportConfig" -> existuje v pripade, ze provadime UPGRADE + // Try to read the "AutoImportConfig" value from the current configuration; it exists when we are doing an upgrade. BOOL autoImportConfig = FALSE; char autoImportConfigFromKey[200]; autoImportConfigFromKey[0] = 0; - if (!GetUpgradeInfo(&autoImportConfig, autoImportConfigFromKey, 200)) // user si preje exit softu + if (!GetUpgradeInfo(&autoImportConfig, autoImportConfigFromKey, 200)) // the user requested that the application exit { myExitCode = 0; EXIT_1a: @@ -3715,22 +3720,22 @@ int WinMainBody(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR cmdLine, } const char* configKey = autoImportConfig ? autoImportConfigFromKey : SalamanderConfigurationRoots[0]; - // zkusime z aktualni konfigurace vytahnout klic urcujici jazyk + // Try to get the key that specifies the language from the current configuration. LoadSaveToRegistryMutex.Enter(); HKEY hSalamander; - DWORD langChanged = FALSE; // TRUE = startujeme Salama poprve s jinym jazykem (naloadime vsechny pluginy, at se overi ze mame tuto jazykovou verzi i pro ne, pripadne at user vyresi jake nahradni verze chce pouzivat) + DWORD langChanged = FALSE; // TRUE = Salamander is being started for the first time in a different language (load all plugins to verify that this language version is available for them as well, or let the user choose which fallback versions to use) if (OpenKey(HKEY_CURRENT_USER, configKey, hSalamander)) { HKEY actKey; - DWORD configVersion = 1; // toto je konfig od 1.52 a starsi + DWORD configVersion = 1; // config from 1.52 and earlier if (OpenKey(hSalamander, SALAMANDER_VERSION_REG, actKey)) { - configVersion = 2; // toto je konfig od 1.6b1 + configVersion = 2; // config from 1.6b1 or later GetValue(actKey, SALAMANDER_VERSIONREG_REG, REG_DWORD, &configVersion, sizeof(DWORD)); CloseKey(actKey); } - if (configVersion >= 59 /* 2.53 beta 2 */ && // pred 2.53 beta 2 byla jen anglictina, tedy cteni nema smysl, nabidneme userovi defaultni jazyk systemu nebo rucni vyber jazyku + if (configVersion >= 59 /* Before 2.53 beta 2, only English was available, so reading this setting is pointless; offer the user the system default language or a manual language selection. */ && OpenKey(hSalamander, SALAMANDER_CONFIG_REG, actKey)) { GetValue(actKey, CONFIG_LANGUAGE_REG, REG_SZ, @@ -3748,8 +3753,8 @@ int WinMainBody(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR cmdLine, FIND_NEW_SLG_FILE: - // pokud klic neexistuje, zobrazime vyberovy dialog - BOOL newSLGFile = FALSE; // TRUE pokud byl .SLG vybran pri tomto spusteni Salamandera + // If the key does not exist, show the selection dialog. + BOOL newSLGFile = FALSE; // TRUE if the .SLG file was selected during this run of Salamander if (Configuration.SLGName[0] == 0) { CLanguageSelectorDialog slgDialog(NULL, Configuration.SLGName, NULL); @@ -3765,8 +3770,8 @@ int WinMainBody(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR cmdLine, Configuration.AltPluginSLGName[0] = 0; char prevVerSLGName[MAX_PATH]; - if (!autoImportConfig && // pri UPGRADE toto nema smysl (jazyk se cte o par radek vyse, tahle rutina by ho jen precetla znovu) - FindLanguageFromPrevVerOfSal(prevVerSLGName) && // importneme jazyk z predchozi verze, je dost pravdepodobne, ze ho user opet chce pouzit (jde o import stare konfigurace Salama) + if (!autoImportConfig && // This is pointless during an upgrade (the language is read a few lines above, and this routine would only read it again) + FindLanguageFromPrevVerOfSal(prevVerSLGName) && // Import the language from the previous version; it will likely still be preferred when importing an old Salamander configuration. slgDialog.SLGNameExists(prevVerSLGName)) { lstrcpy(Configuration.SLGName, prevVerSLGName); @@ -3774,22 +3779,22 @@ int WinMainBody(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR cmdLine, else { int langIndex = slgDialog.GetPreferredLanguageIndex(NULL, TRUE); - if (langIndex == -1) // tato instalace neobsahuje jazyk souhlasici s aktualnim user-locale ve Windows + if (langIndex == -1) // this installation does not contain a language matching the current Windows user locale { -// kdyz se tohle zakomentuje, nebudeme posilat lidi tahat jazykove verze z webu (napr. kdyz tam zadne nejsou) -// JRY: pro AS 2.53, kery jde s cestinou, nemcinou a anglictinou je pro ostatni jazyky posleme na forum do sekce -// "Translations" https://forum.altap.cz/viewforum.php?f=23 - treba to nekoho namotivuje a pujde svuj preklad vytvorit +// If this is commented out, users will not be sent to download language versions from the web, for example when none are available. +// JRY: For Altap Salamander 2.53, which ships with Czech, German, and English, send users looking for other languages to the forum section +// "Translations" https://forum.altap.cz/viewforum.php?f=23 - perhaps this will motivate someone to create their own translation. #define OFFER_OTHERLANGUAGE_VERSIONS #ifndef OFFER_OTHERLANGUAGE_VERSIONS if (slgDialog.GetLanguagesCount() == 1) - slgDialog.GetSLGName(Configuration.SLGName); // pokud existuje jen jeden jazyk, pouzijeme ho + slgDialog.GetSLGName(Configuration.SLGName); // if there is only one language available, use it else { #endif // OFFER_OTHERLANGUAGE_VERSIONS - // otevreme dialog vyberu jazyku, aby mohl user downloadnout a nainstalovat dalsi jazyky + // Open the language selection dialog so the user can download and install additional languages. if (slgDialog.Execute() == IDCANCEL) goto EXIT_1a; @@ -3799,7 +3804,7 @@ int WinMainBody(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR cmdLine, } else { - slgDialog.GetSLGName(Configuration.SLGName, langIndex); // pokud existuje jazyk odpovidajici aktualnim user-locale ve Windows, pouzijeme ho + slgDialog.GetSLGName(Configuration.SLGName, langIndex); // If a language matching the current Windows user locale is available, use it. } } newSLGFile = TRUE; @@ -3816,7 +3821,7 @@ int WinMainBody(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR cmdLine, { if (HLanguage != NULL) HANDLES(FreeLibrary(HLanguage)); - if (!newSLGFile) // zapamatovany .SLG soubor prestal nejspis existovat, zkusime najit jiny + if (!newSLGFile) // The saved .SLG file probably no longer exists; try to find another one. { sprintf(errorText, "File %s was not found or is not valid language file.\nOpen Salamander " "will try to search for some other language file (.SLG).", @@ -3825,7 +3830,7 @@ int WinMainBody(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR cmdLine, Configuration.SLGName[0] = 0; goto FIND_NEW_SLG_FILE; } - else // nemelo by vubec nastat - .SLG soubor jiz byl otestovan + else // This should not happen at all - the .SLG file has already been validated { sprintf(errorText, "File %s was not found or is not valid language file.\n" "Please run Open Salamander again and try to choose some other language file.", @@ -3837,10 +3842,11 @@ int WinMainBody(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR cmdLine, strcpy(Configuration.LoadedSLGName, Configuration.SLGName); - // nechame jiz bezici salmon nacist zvolene SLG (zatim pouzival nejake provizorni) + // Let the already running Salmon load the selected SLG (so far it used a provisional one). SalmonSetSLG(Configuration.SLGName); - // nastavime lokalizovane hlasky do modulu ALLOCHAN (zajistuje pri nedostatku pameti hlaseni uzivateli + Retry button + kdyz vse selze tak i Cancel pro terminate softu) + // Set localized messages in the ALLOCHAN module (it provides out-of-memory messages for the user, a Retry button, + // and if everything fails, even Cancel to terminate the application). SetAllocHandlerMessage(LoadStr(IDS_ALLOCHANDLER_MSG), SALAMANDER_TEXT_VERSION, LoadStr(IDS_ALLOCHANDLER_WRNIGNORE), LoadStr(IDS_ALLOCHANDLER_WRNABORT)); @@ -3863,8 +3869,8 @@ int WinMainBody(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR cmdLine, } #ifdef USE_BETA_EXPIRATION_DATE - // beta verze je casove limitovana, viz BETA_EXPIRATION_DATE - // pokud je dnes den urceny touto promennou nebo nejaky dalsi, zobrazime okenko a koncime + // Beta versions are time-limited; see BETA_EXPIRATION_DATE. + // If today is the date specified by this variable or any later date, show a dialog and exit. SYSTEMTIME st; GetLocalTime(&st); SYSTEMTIME* expire = &BETA_EXPIRATION_DATE; @@ -3877,12 +3883,12 @@ int WinMainBody(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR cmdLine, } #endif // USE_BETA_EXPIRATION_DATE - // otevreme splash screen + // Open the splash screen. GetSystemDPI(NULL); - // pokud konfigurace neexistuje nebo bude nasledne pri importu ze souboru zmenena, ma uzivatel - // smulu a splash screen se bude ridit implicitni nebo starou hodnotou + // If the configuration does not exist yet or is later changed when importing from a file, the user + // is out of luck and the splash screen will use the implicit or old value. LoadSaveToRegistryMutex.Enter(); if (OpenKey(HKEY_CURRENT_USER, configKey, hSalamander)) { @@ -3900,7 +3906,7 @@ int WinMainBody(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR cmdLine, if (Configuration.ShowSplashScreen) SplashScreenOpen(); - // okno pro import konfigurace obsahuje listview s checkboxama, musime inicializovat COMMON CONTROLS + // The configuration import window contains a list view with checkboxes, so we must initialize common controls. INITCOMMONCONTROLSEX initCtrls; initCtrls.dwSize = sizeof(INITCOMMONCONTROLSEX); initCtrls.dwICC = ICC_BAR_CLASSES | ICC_LISTVIEW_CLASSES | @@ -3913,42 +3919,43 @@ int WinMainBody(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR cmdLine, goto EXIT_2; } - SetWinLibStrings(LoadStr(IDS_INVALIDNUMBER), MAINWINDOW_NAME); // j.r. - posunout na spravne misto + SetWinLibStrings(LoadStr(IDS_INVALIDNUMBER), MAINWINDOW_NAME); // j.r. - move this to the proper place - // inicializace pakovacu; drive provadeno v konstruktorech; ted presunuto sem, - // kdy uz je rozhodnuto o jazykovem DLL + // Initialize packers; previously done in constructors; now moved here, + // after the language DLL has been chosen. PackerFormatConfig.InitializeDefaultValues(); ArchiverConfig.InitializeDefaultValues(); PackerConfig.InitializeDefaultValues(); UnpackerConfig.InitializeDefaultValues(); - // pokud soubor existuje, bude importovan do registry + // If the file exists, it will be imported into the registry. BOOL importCfgFromFileWasSkipped = FALSE; ImportConfiguration(NULL, ConfigurationName, ConfigurationNameIgnoreIfNotExists, autoImportConfig, &importCfgFromFileWasSkipped); - // obslouzime prechod ze stareho configu na novy + // handle the transition from the old config to the new one - // Zavolame funkci, ktera se pokusi najit konfiguraci odpovidajici nasi verzi programu. - // Pokud se ji podari najit, bude nastavena promenna 'loadConfiguration' a funkce vrati - // TRUE. Pokud konfigurace jeste nebude existovat, funkce postupne prohleda stare - // konfigurace z pole 'SalamanderConfigurationRoots' (od nejmladsich k nejstrasim). - // Pokud nalezne nekterou z konfiguraci, zobrazi dialog a nabidne jeji konverzi do - // konfigurace soucasne a smazani z registry. Po zobrazeni posledniho dialogu vrati - // TRUE a nastavi promenne 'deleteConfigurations' a 'loadConfiguration' dle voleb - // uzivatele. Pokud uzivatel zvoli ukonceni aplikace, vrati funkce FALSE. + // Call a function that attempts to find a configuration matching our program version. + // If it succeeds, the 'loadConfiguration' variable is set and the function returns + // TRUE. If such a configuration does not exist yet, the function gradually searches older + // configurations in the 'SalamanderConfigurationRoots' array (from newest to oldest). + // If it finds any of these configurations, it displays a dialog and offers to convert it to + // the current configuration and delete it from the registry. After the last dialog is shown, + // the function returns TRUE and sets the 'deleteConfigurations' and 'loadConfiguration' + // variables according to the user's choices. If the user chooses to exit the application, + // the function returns FALSE. - // pole urcujici indexy konfiguraci v poli 'SalamanderConfigurationRoots', - // ktere maji byt smazany (0 -> zadna) + // Array specifying indexes of configurations in the 'SalamanderConfigurationRoots' array + // that should be deleted (0 -> none). BOOL deleteConfigurations[SALCFG_ROOTS_COUNT]; ZeroMemory(deleteConfigurations, sizeof(deleteConfigurations)); CALL_STACK_MESSAGE1("WinMainBody::FindLatestConfiguration"); - // ukazatel do pole 'SalamanderConfigurationRoots' na konfiguraci, ktera ma byt - // nactena (NULL -> zadna; pouziji se default hodnoty) + // Pointer into the 'SalamanderConfigurationRoots' array to the configuration that should be + // loaded (NULL -> none; default values will be used). if (autoImportConfig) - SALAMANDER_ROOT_REG = autoImportConfigFromKey; // pri UPGRADE nema hledani konfigurace smysl + SALAMANDER_ROOT_REG = autoImportConfigFromKey; // When upgrading, searching for a configuration is pointless. else { if (!FindLatestConfiguration(deleteConfigurations, SALAMANDER_ROOT_REG)) @@ -3958,14 +3965,14 @@ int WinMainBody(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR cmdLine, } } - InitializeShellib(); // OLE je treba inicializovat pred otevrenim HTML helpu - CSalamanderEvaluation + InitializeShellib(); // OLE must be initialized before opening HTML Help - CSalamanderEvaluation - // pokud jeste neexistuje novy klic konfigurace, vytvorime ho pred pripadnym smazanim - // starych klicu + // If the new configuration key does not exist yet, create it before possibly deleting + // the old keys. BOOL currentCfgDoesNotExist = autoImportConfig || SALAMANDER_ROOT_REG != SalamanderConfigurationRoots[0]; BOOL saveNewConfig = currentCfgDoesNotExist; - // pokud uzivatel nechce vic instanci, pouze aktivujeme predchozi + // If the user does not want multiple instances, only activate the previous one. if (!currentCfgDoesNotExist && CheckOnlyOneInstance(&cmdLineParams)) { @@ -3976,10 +3983,10 @@ int WinMainBody(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR cmdLine, goto EXIT_2; } - // overim verzi CommonControlu - if (GetComCtlVersion(&CCVerMajor, &CCVerMinor) != S_OK) // JRYFIXME - testy kolem common controls posunout na W7+ + // Check the Common Controls version. + if (GetComCtlVersion(&CCVerMajor, &CCVerMinor) != S_OK) // JRYFIXME - move common controls tests to W7+ { - CCVerMajor = 0; // tohle asi nikdy nenastane - nemaji comctl32.dll + CCVerMajor = 0; // this probably never happens; comctl32.dll is missing CCVerMinor = 0; } @@ -3991,7 +3998,7 @@ int WinMainBody(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR cmdLine, for (i = 0; i < NUMBER_OF_COLORS; i++) UserColors[i] = SalamanderColors[i]; - //--- inicializacni cast + //--- initialization section CALL_STACK_MESSAGE1("WinMainBody::inicialization"); IfExistSetSplashScreenText(LoadStr(IDS_STARTUP_DATA)); @@ -4055,25 +4062,25 @@ int WinMainBody(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR cmdLine, goto EXIT_9; } - // pripojeni OLE SPYe - // posunuto pod InitializeGraphics, ktere pod WinXP vyhazovala leaky (asi zase neajake cache) - // OleSpyRegister(); // odpojeno, protoze po updatu Windows 2000 z 02/2005 zacal pri spusteni+zavreni Salama z MSVC vylitavat debug-breakpoint: Invalid Address specified to RtlFreeHeap( 130000, 14bc74 ) - asi MS nekde zacali volat primo RtlFreeHeap misto OLE free a diky bloku informaci spye na zacatku alokovaneho bloku se to podelalo (malloc vraci pointer posunuty za blok informaci spye) - //OleSpySetBreak(2754); // brakne na [n-te] alokaci z dumpu + // OLE Spy attachment + // moved below InitializeGraphics, which leaked under WinXP (probably some cache again) + // OleSpyRegister(); // disabled because after the Windows 2000 update from 02/2005, a debug breakpoint started appearing in MSVC when Salam was started and closed: Invalid Address specified to RtlFreeHeap( 130000, 14bc74 ) - MS probably started calling RtlFreeHeap directly somewhere instead of OLE free, and the spy info block at the start of the allocated block broke it (malloc returns a pointer shifted past the spy info block) + //OleSpySetBreak(2754); // breaks on the nth allocation from the dump - // inicializace workera (diskove operace) + // Initialize the worker (disk operations). InitWorker(); - // inicializace knihovny pro komunikaci s SalShExt/SalamExt/SalExtX86/SalExtX64.DLL (shell copy hook + shell context menu) + // initialize the library for communicating with SalShExt/SalamExt/SalExtX86/SalExtX64.DLL (shell copy hook + shell context menu) InitSalShLib(); - // inicializace knihovny pro praci s shell icon overlays (Tortoise SVN + CVS) + // initialize the library for working with shell icon overlays (Tortoise SVN + CVS) LoadIconOvrlsInfo(SALAMANDER_ROOT_REG); InitShellIconOverlays(); - // inicializace funkci pro prochazeni pres next/prev soubor v panelu/Findu z vieweru + // initialize support for moving to the next/previous file in the panel or Find from the viewer InitFileNamesEnumForViewers(); - // nacteme seznam sharovanych adresaru + // Load the list of shared directories IfExistSetSplashScreenText(LoadStr(IDS_STARTUP_SHARES)); Shares.Refresh(); @@ -4096,10 +4103,10 @@ int WinMainBody(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR cmdLine, SHELLEXECUTE_CLASSNAME, NULL); - Associations.ReadAssociations(FALSE); // nacteni asociaci z Registry + Associations.ReadAssociations(FALSE); // read associations from the Registry - // registrace shell extensions - // pokud najdeme v podadresari "utils" knihovnu, overime jeji registraci a pripadne ji zaregistrujeme + // Shell extension registration. + // If we find the library in the "utils" subdirectory, check whether it is registered and register it if needed. char shellExtPath[MAX_PATH]; GetModuleFileName(HInstance, shellExtPath, MAX_PATH); char* shellExtPathSlash = strrchr(shellExtPath, '\\'); @@ -4128,7 +4135,7 @@ int WinMainBody(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR cmdLine, #endif // _WIN64 } - //--- vytvoreni hlavniho okna + //--- create the main window if (CMainWindow::RegisterUniversalClass(CS_DBLCLKS | CS_OWNDC, 0, 0, @@ -4165,12 +4172,12 @@ int WinMainBody(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR cmdLine, SetMessagesParent(MainWindow->HWindow); PluginMsgBoxParent = MainWindow->HWindow; - // vytahneme z registry Group Policy + // read Group Policy from the registry IfExistSetSplashScreenText(LoadStr(IDS_STARTUP_POLICY)); SystemPolicies.LoadFromRegistry(); CALL_STACK_MESSAGE1("WinMainBody::load_config"); - BOOL setActivePanelAndPanelPaths = FALSE; // aktivni panel + cesty v panelech se nastavuji v MainWindow->LoadConfig() + BOOL setActivePanelAndPanelPaths = FALSE; // The active panel and the panel paths are set in MainWindow->LoadConfig(). if (!MainWindow->LoadConfig(currentCfgDoesNotExist, !importCfgFromFileWasSkipped ? &cmdLineParams : NULL)) { setActivePanelAndPanelPaths = TRUE; @@ -4187,7 +4194,7 @@ int WinMainBody(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR cmdLine, MainWindow->ToggleMiddleToolBar(); if (Configuration.BottomToolBarVisible) MainWindow->ToggleBottomToolBar(); - MainWindow->CreateAndInsertWorkerBand(); // na zaver vlozime workera + MainWindow->CreateAndInsertWorkerBand(); // finally, insert the worker band MainWindow->LeftPanel->UpdateDriveIcon(TRUE); MainWindow->RightPanel->UpdateDriveIcon(TRUE); MainWindow->LeftPanel->UpdateFilterSymbol(); @@ -4208,7 +4215,7 @@ int WinMainBody(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR cmdLine, if (newSLGFile) { - Plugins.ClearLastSLGNames(); // aby pripadne doslo k nove volbe nahradniho jazyka u vsech pluginu + Plugins.ClearLastSLGNames(); // so that a new fallback language will be selected for all plugins if needed Configuration.ShowSLGIncomplete = TRUE; } @@ -4222,27 +4229,27 @@ int WinMainBody(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR cmdLine, } else { - if (!importCfgFromFileWasSkipped) // jen pokud hned nedojde k exitu softu (to pak nema smysl) + if (!importCfgFromFileWasSkipped) // Only if the application does not exit immediately; otherwise this is pointless. MainWindow->ApplyCommandLineParams(&cmdLineParams, setActivePanelAndPanelPaths); if (Windows7AndLater) CreateJumpList(); - IdleRefreshStates = TRUE; // pri pristim Idle vynutime kontrolu stavovych promennych - IdleCheckClipboard = TRUE; // nechame kontrolovat take clipboard + IdleRefreshStates = TRUE; // Force a check of the state variables on the next idle cycle. + IdleCheckClipboard = TRUE; // also request checking the clipboard AccelTable1 = HANDLES(LoadAccelerators(HInstance, MAKEINTRESOURCE(IDA_MAINACCELS1))); AccelTable2 = HANDLES(LoadAccelerators(HInstance, MAKEINTRESOURCE(IDA_MAINACCELS2))); - MainWindow->CanClose = TRUE; // ted teprve povolime zavreni hl. okna - // aby soubory nevyskakovali postupne (jak se nacitaji jejich ikony) + MainWindow->CanClose = TRUE; // Only now do we allow the main window to be closed. + // so files do not pop up one by one as their icons load UpdateWindow(MainWindow->HWindow); BOOL doNotDeleteImportedCfg = FALSE; - if (autoImportConfig && // zjistime jestli nova verze nema mene pluginu nez stara a diky tomu se cast stare konfigurace neprenese + if (autoImportConfig && // Check whether the new version has fewer plugins than the old one, so part of the old configuration would not be imported. FindPluginsWithoutImportedCfg(&doNotDeleteImportedCfg)) - { // je potreba exit softu bez ulozeni konfigurace - SALAMANDER_ROOT_REG = NULL; // tohle by melo spolehlive zamezit zapisu do konfigurace v registry + { // The app needs to exit without saving the configuration + SALAMANDER_ROOT_REG = NULL; // This should reliably prevent the configuration from being written to the registry. PostMessage(MainWindow->HWindow, WM_USER_FORCECLOSE_MAINWND, 0, 0); } else @@ -4252,57 +4259,57 @@ int WinMainBody(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR cmdLine, || Configuration.AddX86OnlyPlugins #endif // _WIN64 ) - { // auto-install plug-inu ze standardniho plug-in-podadresare "plugins" + { // auto-install plug-ins from the standard "plugins" plug-in subdirectory #ifndef _WIN64 // FIXME_X64_WINSCP - Configuration.AddX86OnlyPlugins = FALSE; // jednou staci + Configuration.AddX86OnlyPlugins = FALSE; // only need to do this once #endif // _WIN64 Plugins.AutoInstallStdPluginsDir(MainWindow->HWindow); - Configuration.LastPluginVer = 0; // pri prechodu na novou verzi bude zrusen soubor plugins.ver - Configuration.LastPluginVerOP = 0; // pri prechodu na novou verzi bude zrusen soubor plugins.ver i pro druhou platformu - saveNewConfig = TRUE; // nova konfigurace se musi ulozit (aby se tohle pri pristim spusteni neopakovalo) + Configuration.LastPluginVer = 0; // when upgrading to a new version, the plugins.ver file will also be removed for the other platform + Configuration.LastPluginVerOP = 0; // when upgrading to a new version, the plugins.ver file will also be removed for the other platform + saveNewConfig = TRUE; // The new configuration must be saved so this does not happen again on the next startup. } - // nacteni souboru plugins.ver ((re)instalace plug-inu), nutne i poprve (pro pripad - // instalace plug-inu pred prvnim spustenim Salamandera) + // Load the plugins.ver file ((re)installing plug-ins), needed even on the first run (in case + // plug-ins were installed before Salamander was started for the first time). if (Plugins.ReadPluginsVer(MainWindow->HWindow, Configuration.ConfigVersion < THIS_CONFIG_VERSION)) - saveNewConfig = TRUE; // nova konfigurace se musi ulozit (aby se tohle pri pristim spusteni neopakovalo) - // load plug-inu, ktere maji nastaveny flag load-on-start + saveNewConfig = TRUE; // the new configuration must be saved (so this does not happen again on the next startup) + // load plugins that have the load-on-start flag set Plugins.HandleLoadOnStartFlag(MainWindow->HWindow); - // pokud startujeme poprve se zmenenym jazykem, naloadime vsechny pluginy, aby se ukazalo, - // jestli maji tuto jazykovou verzi + pripadne aby si user vybrat nahradni jazyky + // If we are starting for the first time with a changed language, load all plug-ins so it becomes clear + // whether they have this language version, and if needed let the user choose replacement languages. if (langChanged) Plugins.LoadAll(MainWindow->HWindow); - // pluginy FTP a WinSCP nove volaji SalamanderGeneral->SetPluginUsesPasswordManager() aby se prihlasily k odberu eventu z password managera - // zavedeno s verzi kofigurace 45 -- dame vsem pluginum moznost se prihlasit - if (Configuration.ConfigVersion < 45) // zavedeni password manageru + // The FTP and WinSCP plugins now call SalamanderGeneral->SetPluginUsesPasswordManager() to subscribe to password manager events. + // Introduced in configuration version 45; give all plugins a chance to register. + if (Configuration.ConfigVersion < 45) // introduce the password manager Plugins.LoadAll(MainWindow->HWindow); - // save uz pujde do nejnovejsiho klice + // Saving will now go to the newest key. SALAMANDER_ROOT_REG = SalamanderConfigurationRoots[0]; - // konfiguraci ulozime hned, dokud je to cista konverze stare verze -- user muze - // mit vypnuty "Save Cfg on Exit" a pokud behem chodu Salamandera neco zmeni, nechce to na zaver ulozit + // Save the configuration immediately while this is still a clean conversion of the old version; the user may + // have "Save Cfg on Exit" disabled and may not want later changes made during the Salamander session to be saved at exit if (saveNewConfig) { MainWindow->SaveConfig(); } - // prohleda pole a pokud je nektery z rootu oznaceny pro smazani, smaze ho + smaze starou konfiguraci - // po UPGRADE a tez smazne hodnotu "AutoImportConfig" v klici konfigurace teto verze Salama + // scan the array and, if any root is marked for deletion, delete it; also delete the old configuration + // after an UPGRADE and also remove the "AutoImportConfig" value from the configuration key for this Salamander version MainWindow->DeleteOldConfigurations(deleteConfigurations, autoImportConfig, autoImportConfigFromKey, doNotDeleteImportedCfg); - // jen prvni instance Salamandera: podivame se, jestli neni potreba vycistit - // TEMP od zbytecnych souboru disk-cache (pri padu nebo zamknuti jinou aplikaci - // muzou soubory v TEMPu zustat) - // musime testoval na globalni (skrz vsechny sessions) promennou, aby se videly dve - // instance Salamanderu spustene pod FastUserSwitching - // Problem nahlasen na foru: https://forum.altap.cz/viewtopic.php?t=2643 + // only the first Salamander instance: check whether TEMP needs to be cleaned up + // of unnecessary disk cache files (after a crash or when locked by another application, + // files may remain in TEMP) + // we must test a global variable (shared across all sessions) so that two + // Salamander instances started under Fast User Switching can see each other + // Problem reported on the forum: https://forum.altap.cz/viewtopic.php?t=2643 if (FirstInstance_3_or_later) { DiskCache.ClearTEMPIfNeeded(MainWindow->HWindow, MainWindow->GetActivePanelHWND()); } - if (importCfgFromFileWasSkipped) // pokud jsme preskocili import config.reg nebo jineho .reg souboru (parametr -C) - { // informujeme usera o nutnosti noveho startu Salama a nechame ho exitnout soft + if (importCfgFromFileWasSkipped) // if importing config.reg or another .reg file was skipped (-C parameter) + { // notify the user that Salamander needs to be restarted, then let them exit the application MSGBOXEX_PARAMS params; memset(¶ms, 0, sizeof(params)); params.HParent = MainWindow->HWindow; @@ -4310,57 +4317,57 @@ int WinMainBody(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR cmdLine, params.Caption = SALAMANDER_TEXT_VERSION; params.Text = LoadStr(IDS_IMPORTCFGFROMFILESKIPPED); char aliasBtnNames[200]; - /* slouzi pro skript export_mnu.py, ktery generuje salmenu.mnu pro Translator - nechame pro tlacitka msgboxu resit kolize hotkeys tim, ze simulujeme, ze jde o menu -MENU_TEMPLATE_ITEM MsgBoxButtons[] = -{ - {MNTT_PB, 0 - {MNTT_IT, IDS_SELLANGEXITBUTTON - {MNTT_PE, 0 -}; -*/ + /* used by the export_mnu.py script, which generates salmenu.mnu for Translator + for message box buttons, handle hotkey collisions by simulating a menu + MENU_TEMPLATE_ITEM MsgBoxButtons[] = + { + {MNTT_PB, 0 + {MNTT_IT, IDS_SELLANGEXITBUTTON + {MNTT_PE, 0 + }; + */ sprintf(aliasBtnNames, "%d\t%s", DIALOG_OK, LoadStr(IDS_SELLANGEXITBUTTON)); params.AliasBtnNames = aliasBtnNames; SalMessageBoxEx(¶ms); PostMessage(MainWindow->HWindow, WM_USER_FORCECLOSE_MAINWND, 0, 0); } /* - // je-li treba, vyvolame zobrazeni dialogu Tip of the Day - // 0xffffffff = open quiet - pokud to nedopadne, neserveme usera - if (Configuration.ShowTipOfTheDay) - PostMessage(MainWindow->HWindow, WM_COMMAND, CM_HELP_TIP, 0xffffffff); - */ + // If needed, show the Tip of the Day dialog + // 0xffffffff = quiet open; if it fails, do not disturb the user + if (Configuration.ShowTipOfTheDay) + PostMessage(MainWindow->HWindow, WM_COMMAND, CM_HELP_TIP, 0xffffffff); + */ } - // odted se uz budou pamatovat zavirane cesty + // paths being closed will now be remembered MainWindow->CanAddToDirHistory = TRUE; - // uzivatele chteji mit start-up cestu v historii i v pripade, ze ji neuspinili + // Users want the startup path kept in the history even if they have not worked with it yet MainWindow->LeftPanel->UserWorkedOnThisPath = TRUE; MainWindow->RightPanel->UserWorkedOnThisPath = TRUE; - // dame seznamu procesu vedet, ze bezime a mame hlavni okno (je mozne nas aktivovat pri OnlyOneInstance) + // Tell the process list that we are running and have a main window (so it can activate us in OnlyOneInstance mode) TaskList.SetProcessState(PROCESS_STATE_RUNNING, MainWindow->HWindow); - // pozadame Salmon o kontrolu, zda na disku nejsou stare bug reporty, ktere by bylo potreba odeslat + // Ask Salmon to check whether there are any old bug reports on disk that need to be sent. SalmonCheckBugs(); if (IsSLGIncomplete[0] != 0 && Configuration.ShowSLGIncomplete) PostMessage(MainWindow->HWindow, WM_USER_SLGINCOMPLETE, 0, 0); - //--- aplikacni smycka + //--- message loop CALL_STACK_MESSAGE1("WinMainBody::message_loop"); DWORD activateParamsRequestUID = 0; BOOL skipMenuBar; MSG msg; - BOOL haveMSG = FALSE; // FALSE pokud se ma volat GetMessage() v podmince cyklu + BOOL haveMSG = FALSE; // FALSE if GetMessage() should be called in the loop condition while (haveMSG || GetMessage(&msg, NULL, 0, 0)) { haveMSG = FALSE; if (msg.message != WM_USER_SHOWWINDOW && msg.message != WM_USER_WAKEUP_FROM_IDLE && /*msg.message != WM_USER_SETPATHS &&*/ msg.message != WM_QUERYENDSESSION && msg.message != WM_USER_SALSHEXT_PASTE && msg.message != WM_USER_CLOSE_MAINWND && msg.message != WM_USER_FORCECLOSE_MAINWND) - { // krom "connect", "shutdown", "do-paste" a "close-main-wnd" messages jsou vsechny zacatkem BUSY rezimu + { // All messages except "connect", "shutdown", "do-paste", and "close-main-wnd" put Salamander into BUSY mode. SalamanderBusy = TRUE; LastSalamanderIdleTime = GetTickCount(); } @@ -4368,22 +4375,22 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = if ((msg.message == WM_SYSKEYDOWN || msg.message == WM_KEYDOWN) && msg.wParam != VK_MENU && msg.wParam != VK_CONTROL && msg.wParam != VK_SHIFT) { - SetCurrentToolTip(NULL, 0); // zhasneme tooltip + SetCurrentToolTip(NULL, 0); // Hide the tooltip. } skipMenuBar = FALSE; if (Configuration.QuickSearchEnterAlt && msg.message == WM_SYSCHAR) skipMenuBar = TRUE; - // zajistime zaslani zprav do naseho menu (obchazime tim potrebu hooku pro klavesnici) + // Ensure messages are sent to our menu (this avoids the need for a keyboard hook). if (MainWindow == NULL || MainWindow->MenuBar == NULL || !MainWindow->CaptionIsActive || MainWindow->QuickRenameWindowActive() || - skipMenuBar || GetCapture() != NULL || // je-li captured mouse - mohli bychom zpusobit vizualni problemy + skipMenuBar || GetCapture() != NULL || // if the mouse is captured, we could cause visual glitches !MainWindow->MenuBar->IsMenuBarMessage(&msg)) { CWindowsObject* wnd = WindowsManager.GetWindowPtr(GetActiveWindow()); - // Bottom Toolbar - zmena textu podle VK_CTRL, VK_MENU a VK_SHIFT + // Bottom toolbar: update text based on VK_CTRL, VK_MENU, and VK_SHIFT if ((msg.message == WM_SYSKEYDOWN || msg.message == WM_KEYDOWN || msg.message == WM_SYSKEYUP || msg.message == WM_KEYUP) && MainWindow != NULL) @@ -4391,7 +4398,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = if ((wnd == NULL || !wnd->Is(otDialog) || !IsDialogMessage(wnd->HWindow, &msg)) && - (MainWindow == NULL || !MainWindow->CaptionIsActive || // pridano "!MainWindow->CaptionIsActive", aby se v nemodalnich oknech pluginu neprekladaly akceleratory (F7 v "FTP Logs" neni nic moc) + (MainWindow == NULL || !MainWindow->CaptionIsActive || // Added "!MainWindow->CaptionIsActive" so accelerators are not processed in non-modal plugin windows (F7 in "FTP Logs" is not a great idea). MainWindow->QuickRenameWindowActive() || !TranslateAccelerator(MainWindow->HWindow, AccelTable1, &msg) && (MainWindow->EditMode || !TranslateAccelerator(MainWindow->HWindow, AccelTable2, &msg)))) @@ -4402,7 +4409,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = } if (MainWindow != NULL && MainWindow->CanClose) - { // je-li Salamander nastartovany, muzeme ho prohlasit za NE BUSY + { // if Salamander has started, it can be marked as not busy SalamanderBusy = FALSE; } @@ -4410,16 +4417,16 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { if (msg.message == WM_QUIT) - break; // ekvivalent situace, kdy GetMessage() vraci FALSE - haveMSG = TRUE; // mame zpravu, jdeme ji zpracovat (bez volani GetMessage()) + break; // equivalent to when GetMessage() returns FALSE + haveMSG = TRUE; // We have a message, so process it without calling GetMessage(). } - else // pokud ve fronte neni zadna message, provedeme Idle processing + else // If there is no message in the queue, perform idle processing { #ifdef _DEBUG - // jednou za tri vteriny osetrime konzistenci heapu + // Check heap consistency every three seconds. if (_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) & _CRTDBG_ALLOC_MEM_DF) { - if (GetTickCount() - LastCrtCheckMemoryTime > 3000) // kazde tri vteriny + if (GetTickCount() - LastCrtCheckMemoryTime > 3000) // every three seconds { if (!_CrtCheckMemory()) { @@ -4435,40 +4442,40 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = if (MainWindow != NULL) { - CannotCloseSalMainWnd = TRUE; // musime zamezit zavreni hlavniho okna Salamandera behem provadeni nasledujicich rutin + CannotCloseSalMainWnd = TRUE; // Prevent the Salamander main window from closing while the following routines run. MainWindow->OnEnterIdle(); - // na pusteni ESC cekame jen pokud refresh listingu v panelu primo - // navazuje (coz pres IDLE nehrozi) + // Wait for ESC to be released only if a panel listing refresh follows immediately + // which cannot happen via IDLE. if (WaitForESCReleaseBeforeTestingESC) WaitForESCReleaseBeforeTestingESC = FALSE; - // zjistime, zda nas nezada cizi "OnlyOneInstance" Salamander o aktivaci a nastaveni cest v panelech? - // FControlThread by v takovem pripade nastavil parametry do globalni CommandLineParams a zvysil RequestUID - // pokud byl hlavni thread v IDLE, probral se diky postnute WM_USER_WAKEUP_FROM_IDLE + // check whether another "OnlyOneInstance" Salamander is requesting activation and panel path setup? + // In that case, FControlThread would store the parameters in the global CommandLineParams and increment RequestUID. + // If the main thread was idle, it woke up because WM_USER_WAKEUP_FROM_IDLE was posted. if (!SalamanderBusy && CommandLineParams.RequestUID > activateParamsRequestUID) { CCommandLineParams paramsCopy; BOOL applyParams = FALSE; NOHANDLES(EnterCriticalSection(&CommandLineParamsCS)); - // tesne pred vstupem do kriticke sekce mohlo dojit k timeoutu v control threadu, overime ze jeste stoji o vysledek - // zaroven overime, ze pozadavak neexpiroval (volajici vlakno ceka pouze do TASKLIST_TODO_TIMEOUT a potom cekani - // vzda a spusti novou instanci Salamander; nechceme v takovem pripade pozadavek vyplnit) + // A timeout may have occurred in the control thread just before entering the critical section; verify that it still wants the result. + // Also verify that the request has not expired (the calling thread waits only until TASKLIST_TODO_TIMEOUT, then + // gives up and starts a new Salamander instance; in that case we do not want to fulfill the request). DWORD tickCount = GetTickCount(); if (CommandLineParams.RequestUID != 0 && tickCount - CommandLineParams.RequestTimestamp < TASKLIST_TODO_TIMEOUT) { memcpy(¶msCopy, &CommandLineParams, sizeof(CCommandLineParams)); applyParams = TRUE; - // ulozime UID, ktere jsme jiz odbavili, abychom necyklili + // Remember the UID that has already been handled so we do not loop. activateParamsRequestUID = CommandLineParams.RequestUID; - // dame control threadu zpravu, ze jsme cesty prijali + // signal to the control thread that the paths have been accepted SetEvent(CommandLineParamsProcessed); } NOHANDLES(LeaveCriticalSection(&CommandLineParamsCS)); - // uvolnili jsme sdilene prostredky, muzeme se jit parat s cestama + // the shared resources have been released; the paths can now be handled if (applyParams && MainWindow != NULL) { SendMessage(MainWindow->HWindow, WM_USER_SHOWWINDOW, 0, 0); @@ -4476,7 +4483,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = } } - // zajistime unik z odstranenych drivu na fixed drive (po vysunuti device - USB flash disk, atd.) + // Ensure we switch away from removed drives to a fixed drive (after device ejection - USB flash drive, etc.). if (!SalamanderBusy && ChangeLeftPanelToFixedWhenIdle) { ChangeLeftPanelToFixedWhenIdle = FALSE; @@ -4500,35 +4507,35 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = PostMessage(MainWindow->HWindow, WM_USER_CONFIGURATION, 6, 0); } - // pokud nejaky plug-in chtel unload nebo rebuild menu, provedeme ho... (jen neni-li "busy") + // If any plugin requested an unload or a menu rebuild, handle it... (but only when we're not "busy") if (!SalamanderBusy && ExecCmdsOrUnloadMarkedPlugins) { int cmd; CPluginData* data; Plugins.GetCmdAndUnloadMarkedPlugins(MainWindow->HWindow, &cmd, &data); ExecCmdsOrUnloadMarkedPlugins = (cmd != -1); - if (cmd >= 0 && cmd < 500) // spusteni prikazu Salamandera na zadost plug-inu + if (cmd >= 0 && cmd < 500) // Execute a Salamander command at the request of a plugin { int wmCmd = GetWMCommandFromSalCmd(cmd); if (wmCmd != -1) { - // vygenerujeme WM_COMMAND a nechame ho hned zpracovat + // Generate a WM_COMMAND and process it immediately msg.hwnd = MainWindow->HWindow; msg.message = WM_COMMAND; - msg.wParam = (DWORD)LOWORD(wmCmd); // radsi orizneme horni WORD (0 - cmd z menu) + msg.wParam = (DWORD)LOWORD(wmCmd); // better strip off the high WORD (0 for menu commands) msg.lParam = 0; msg.time = GetTickCount(); GetCursorPos(&msg.pt); - haveMSG = TRUE; // mame zpravu, jdeme ji zpracovat (bez volani GetMessage()) + haveMSG = TRUE; // We already have a message, so process it without calling GetMessage(). } } else { - if (cmd >= 500 && cmd < 1000500) // spusteni prikazu menuExt na zadost plug-inu + if (cmd >= 500 && cmd < 1000500) // Execute the menuExt command at the plugin's request { int id = cmd - 500; - SalamanderBusy = TRUE; // jdeme provest prikaz menu - uz jsme zase "busy" + SalamanderBusy = TRUE; // We are about to execute the menu command, so we are busy again. LastSalamanderIdleTime = GetTickCount(); if (data != NULL && data->GetLoaded()) { @@ -4537,13 +4544,13 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = CALL_STACK_MESSAGE4("CPluginInterfaceForMenuExt::ExecuteMenuItem(, , %d,) (%s v. %s)", id, data->DLLName, data->Version); - // snizime prioritu threadu na "normal" (aby operace prilis nezatezovaly stroj) + // lower the thread priority to "normal" so operations do not put too much load on the machine SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_NORMAL); CSalamanderForOperations sm(MainWindow->GetActivePanel()); data->GetPluginInterfaceForMenuExt()->ExecuteMenuItem(&sm, MainWindow->HWindow, id, 0); - // opet zvysime prioritu threadu, operace dobehla + // raise the thread priority back to above normal; the operation has finished SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL); } else @@ -4554,16 +4561,16 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = } else { - // nemusi byt naloaden, staci aby se PostMenuExtCommand zavolal z Release pluginu, - // ktery je vyvolany postnutym unloadem + // It does not have to be loaded; it is enough for PostMenuExtCommand to be called from the Release plug-in, + // which is triggered by the posted unload. // TRACE_E("Unexpected situation during call of menu command in \"sal-idle\"."); } - if (MainWindow != NULL && MainWindow->CanClose) // konec provadeni prikazu menu - { // je-li Salamander nastartovany, muzeme ho prohlasit za NE BUSY + if (MainWindow != NULL && MainWindow->CanClose) // end of menu command processing + { // if Salamander has started up, we can mark it as not busy SalamanderBusy = FALSE; } CannotCloseSalMainWnd = FALSE; - goto TEST_IDLE; // zkusime znovu "idle" (napr. aby se mohl zpracovat dalsi postnuty prikaz/unload) + goto TEST_IDLE; // try "idle" again (e.g. so another posted command/unload can be processed) } } } @@ -4573,18 +4580,18 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = int pluginIndex; Plugins.OpenPackOrUnpackDlgForMarkedPlugins(&data, &pluginIndex); OpenPackOrUnpackDlgForMarkedPlugins = (data != NULL); - if (data != NULL) // otevreni Pack/Unpack dialogu na zadost plug-inu + if (data != NULL) // Open the Pack/Unpack dialog at the plugin's request { - SalamanderBusy = TRUE; // jdeme provest prikaz menu - uz jsme zase "busy" + SalamanderBusy = TRUE; // We're about to execute the menu command, so we're busy again LastSalamanderIdleTime = GetTickCount(); if (data->OpenPackDlg) { CFilesWindow* activePanel = MainWindow->GetActivePanel(); if (activePanel != NULL && activePanel->Is(ptDisk)) - { // otevreni Pack dialogu + { // open the Pack dialog MainWindow->CancelPanelsUI(); activePanel->UserWorkedOnThisPath = TRUE; - activePanel->StoreSelection(); // ulozime selection pro prikaz Restore Selection + activePanel->StoreSelection(); // Store the selection for the Restore Selection command. activePanel->Pack(MainWindow->GetNonActivePanel(), pluginIndex, data->Name, data->PackDlgDelFilesAfterPacking); } @@ -4599,10 +4606,10 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = { CFilesWindow* activePanel = MainWindow->GetActivePanel(); if (activePanel != NULL && activePanel->Is(ptDisk)) - { // otevreni Unpack dialogu + { // opening the Unpack dialog MainWindow->CancelPanelsUI(); activePanel->UserWorkedOnThisPath = TRUE; - activePanel->StoreSelection(); // ulozime selection pro prikaz Restore Selection + activePanel->StoreSelection(); // Save the selection for the Restore Selection command activePanel->Unpack(MainWindow->GetNonActivePanel(), pluginIndex, data->Name, data->UnpackDlgUnpackMask); } @@ -4614,16 +4621,16 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = data->UnpackDlgUnpackMask = NULL; } } - if (MainWindow != NULL && MainWindow->CanClose) // konec otevirani Pack/Unpack dialogu - { // je-li Salamander nastartovany, muzeme ho prohlasit za NE BUSY + if (MainWindow != NULL && MainWindow->CanClose) // Pack/Unpack dialog opening has finished. + { // if Salamander has started up, we can mark it as not busy SalamanderBusy = FALSE; } CannotCloseSalMainWnd = FALSE; - goto TEST_IDLE; // zkusime znovu "idle" (napr. aby se mohl zpracovat dalsi postnuty prikaz/unload/Pack/Unpack) + goto TEST_IDLE; // try idle again (e.g. so another posted command, unload, or Pack/Unpack request can be processed) } } if (!SalamanderBusy && OpenReadmeInNotepad[0] != 0) - { // spustime notepad se souborem 'OpenReadmeInNotepad' pro instalak pod Vista+ + { // Vista+: for the installer, launch Notepad with the file path stored in OpenReadmeInNotepad StartNotepad(OpenReadmeInNotepad); OpenReadmeInNotepad[0] = 0; } @@ -4643,35 +4650,35 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = else TRACE_E("Unable to register main window class."); - // pro pripad chyby zkusim zavrit dialog + // try to close the dialog if an error occurs SplashScreenCloseIfExist(); - // vratime prioritu do puvodniho stavu + // restore the thread priority to its original setting SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_NORMAL); - //--- vsem oknum dame 1 sekundu na to, aby se uzavreli, pak je nechame odpojit + //--- give all windows 1 second to close, then let them detach int timeOut = 10; int winsCount = WindowsManager.GetCount(); while (timeOut-- && winsCount > 0) { Sleep(100); int c = WindowsManager.GetCount(); - if (winsCount > c) // zatim jeste ubyvaji okna, budeme cekat dale aspon 1 sekundu + if (winsCount > c) // Window count is still decreasing, so wait at least 1 more second. { winsCount = c; timeOut = 10; } } -//--- informace +//--- information #ifdef __DEBUG_WINLIB TRACE_I("WindowsManager: " << WindowsManager.maxWndCount << " windows, " << WindowsManager.search << " searches, " << WindowsManager.cache << " cached searches."); #endif //--- - DestroySafeWaitWindow(TRUE); // povel "terminate" safe-wait-message threadu - Sleep(1000); // nechame vsem threadum viewru cas, aby se ukoncili - NBWNetAC3Thread.Close(TRUE); // bezici thread nechame zabit (presun do AuxThreads), dalsi akce zablokujeme - TerminateAuxThreads(); // zbytek nasilne terminujeme + DestroySafeWaitWindow(TRUE); // send the "terminate" command to the safe-wait-message thread + Sleep(1000); // give all viewer threads time to shut down + NBWNetAC3Thread.Close(TRUE); // Let shutdown kill any still-running thread by moving it to AuxThreads, and block further actions. + TerminateAuxThreads(); // forcibly terminate the rest //--- TerminateThread(); ReleaseFileNamesEnumForViewers(); @@ -4691,7 +4698,7 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = HANDLES(FreeLibrary(HLanguage)); HLanguage = NULL; - // pro jistotu zavreme az jako posledni, ale asi zbytecne obavy + // just to be safe, close it last, though that's probably unnecessary caution ReleaseSalOpen(); if (NtDLL != NULL) @@ -4706,9 +4713,9 @@ MENU_TEMPLATE_ITEM MsgBoxButtons[] = } //OleSpyStressTest(); // multi-threaded stress test - // OleSpyRevoke(); // odpojime OLESPY - OleUninitialize(); // deinicializace OLE - // OleSpyDump(); // vypiseme leaky + // OleSpyRevoke(); // detach OLESPY + OleUninitialize(); // Uninitialize OLE + // OleSpyDump(); // dump leaks TRACE_I("End"); return 0; @@ -4735,7 +4742,7 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR cmdLine, int cmdShow { TRACE_I("Thread Main: calling ExitProcess(1)."); // ExitProcess(1); - TerminateProcess(GetCurrentProcess(), 1); // tvrdsi exit (tenhle jeste neco vola) + TerminateProcess(GetCurrentProcess(), 1); // more forceful exit return 1; } #endif // CALLSTK_DISABLE From b8f2ad4d204d383776d0dd161899bf408809bac5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 02:36:01 +0200 Subject: [PATCH 625/710] [translation] Fix src/fileswn3.cpp comments (#998) --- src/fileswn3.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/fileswn3.cpp b/src/fileswn3.cpp index 6afefb4ca..4e8387c64 100644 --- a/src/fileswn3.cpp +++ b/src/fileswn3.cpp @@ -820,7 +820,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) memmove(iconData.NameAndData, file.Name, len); memset(iconData.NameAndData + len, 0, size - len); // end of name is zeroed iconData.SetFlag(0); // icon not loaded yet -// bitmap storage must be allocated here; it cannot be done in the worker thread + // bitmap storage must be allocated here; it cannot be done in the worker thread iconData.SetIndex(IconCache->AllocIcon(NULL, NULL)); if (iconData.GetIndex() != -1) { @@ -1166,7 +1166,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) memcpy(iconData.NameAndData + nameLen, s, len + 1); // icon-location + '\0' iconData.SetFlag(3); // icon not loaded yet; only the icon location is known -// we need to allocate space for the bitmaps, which cannot be done in this thread + // we need to allocate space for the bitmaps, which cannot be done in this thread iconData.SetIndex(IconCache->AllocIcon(NULL, NULL)); if (iconData.GetIndex() != -1) { @@ -1427,7 +1427,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) memcpy(iconData.NameAndData + nameLen, s, len + 1); // icon-location + '\0' iconData.SetFlag(3); // icon not yet loaded, specified only by icon-location -// we need to allocate space for the bitmaps; this cannot be done in the worker thread + // we need to allocate space for the bitmaps; this cannot be done in the worker thread iconData.SetIndex(IconCache->AllocIcon(NULL, NULL)); if (iconData.GetIndex() != -1) { @@ -1535,7 +1535,7 @@ BOOL CFilesWindow::ReadDirectory(HWND parent, BOOL isRefresh) // a pointer to CFileData is needed for PluginFSDir, because items in Files and Dirs can move // for example when sorting (Files and Dirs are arrays of CFileData, not `CFileData*`, which causes these problems) if (Configuration.NotHiddenSystemFiles && - (f->Hidden || //both Hidden a Attr jsou nulovane pokud jsou neplatne -> testy failnou + (f->Hidden || // both Hidden and Attr are zeroed when invalid -> tests fail (f->Attr & (FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM)))) { // skip hidden file/directory continue; From b8348a9fbb1a6bd2fddc43686a016e53397ad183 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 05:47:51 +0200 Subject: [PATCH 626/710] [translation] Fix src/salspawn/salspawn.cpp comments (#1003) --- src/salspawn/salspawn.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/salspawn/salspawn.cpp b/src/salspawn/salspawn.cpp index 0be5f2bb2..2379cced2 100644 --- a/src/salspawn/salspawn.cpp +++ b/src/salspawn/salspawn.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include @@ -21,9 +22,9 @@ BOOL CtrlHandler(DWORD fdwCtrlType) { switch (fdwCtrlType) { - // vyignorujeme CTRL+C, Ctrl+Break a dalsi dobre duvody pro ukonceni... protoze ukoncit - // se musi nejdrive spousteny externi archivator (jinak archivator pokracuje ve spousteni, - // i kdyz uz Salamander pise, ze komprimace/dekomprimace skoncila) + // Ignore CTRL+C, Ctrl+Break, and other valid termination reasons, because the + // launched external archiver must terminate first. Otherwise it keeps running + // even after Salamander reports that compression or decompression has finished. case CTRL_C_EVENT: case CTRL_BREAK_EVENT: case CTRL_CLOSE_EVENT: @@ -40,7 +41,7 @@ BOOL CtrlHandler(DWORD fdwCtrlType) // EnableExceptionsOn64 // -// Chceme se dozvedet o SEH Exceptions i na x64 Windows 7 SP1 a dal +// We want to receive SEH exceptions even on x64 Windows 7 SP1 and later. // http://blog.paulbetts.org/index.php/2010/07/20/the-case-of-the-disappearing-onload-exception-user-mode-callback-exceptions-in-x64/ // http://connect.microsoft.com/VisualStudio/feedback/details/550944/hardware-exceptions-on-x64-machines-are-silently-caught-in-wndproc-messages // http://support.microsoft.com/kb/976038 @@ -84,7 +85,7 @@ void mainCRTStartup() exeName[0] = '\0'; - // nechceme zadne kriticke chyby jako "no disk in drive A:" + // Do not show critical errors such as "no disk in drive A:". SetErrorMode(SetErrorMode(0) | SEM_FAILCRITICALERRORS); cmdline = GetCommandLine(); From 839e538a301829596121e3a29712206cd3b079e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 05:47:54 +0200 Subject: [PATCH 627/710] [translation] Fix src/salopen/salopen.cpp comments (#1004) --- src/salopen/salopen.cpp | 45 +++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/src/salopen/salopen.cpp b/src/salopen/salopen.cpp index 772b59a36..20e411756 100644 --- a/src/salopen/salopen.cpp +++ b/src/salopen/salopen.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include #include @@ -14,7 +15,7 @@ HANDLE Heap = NULL; #define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp)) #define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp)) -// callback, ktery vraci jmena oznacenych souboru pro vytvareni nasl. interfacu +// callback that returns the names of selected files for creating the following interfaces typedef const char* (*CEnumFileNamesFunction)(int index, void* param); void my_memcpy(void* dst, const void* src, int len) @@ -26,7 +27,7 @@ void my_memcpy(void* dst, const void* src, int len) } // for VS2019 -#pragma intrinsic(memcpy) // abych mohli prekladat s optimalizaci na rychlost a prekladac nerval +#pragma intrinsic(memcpy) // so we can build with speed optimization without compiler complaints #pragma function(memcpy) // error C2169: 'memcpy': intrinsic function, cannot be defined void* memcpy(void* dst, const void* src, size_t len) { @@ -53,7 +54,7 @@ int StrNICmp(const char* s1, const char* s2, int n) { res = (unsigned)LowerCase[*s1++] - (unsigned)LowerCase[*s2++]; if (res != 0) - return (res < 0) ? -1 : 1; // < a > + return (res < 0) ? -1 : 1; // < or > } return 0; } @@ -65,7 +66,7 @@ int StrICmp(const char* s1, const char* s2) { res = (unsigned)LowerCase[*s1] - (unsigned)LowerCase[*s2++]; if (res != 0) - return (res < 0) ? -1 : 1; // < a > + return (res < 0) ? -1 : 1; // < or > if (*s1++ == 0) return 0; // == } @@ -160,7 +161,7 @@ LPITEMIDLIST* CreateItemIdList(LPSHELLFOLDER folder, int files, if (pidl != NULL) list[i] = pidl; else - break; // nejaka chyba + break; // some error } if (pidl == NULL) @@ -186,9 +187,9 @@ BOOL GetShellFolder(const char* dir, IShellFolder*& shellFolderObj, LPITEMIDLIST { int rootFolder; if (dir[0] != '\\') - rootFolder = CSIDL_DRIVES; // normalni cesta + rootFolder = CSIDL_DRIVES; // normal path else - rootFolder = CSIDL_NETWORK; // UNC - sitove zdroje + rootFolder = CSIDL_NETWORK; // UNC - network resources LPITEMIDLIST rootFolderID; if (SUCCEEDED((ret = SHGetSpecialFolderLocation(NULL, rootFolder, &rootFolderID)))) { @@ -197,7 +198,7 @@ BOOL GetShellFolder(const char* dir, IShellFolder*& shellFolderObj, LPITEMIDLIST { char root[MAX_PATH]; GetRootPath(root, dir); - if (lstrlen(root) < lstrlen(dir)) // neni to root cesta + if (lstrlen(root) < lstrlen(dir)) // not a root path { lstrcpy(root, dir); char* name = root + lstrlen(root); @@ -220,7 +221,7 @@ BOOL GetShellFolder(const char* dir, IShellFolder*& shellFolderObj, LPITEMIDLIST *name = c; dir = name; } - // else TRACE_E("BindToObject error: " << hex << ret); // dir zustava + // else TRACE_E("BindToObject error: " << hex << ret); // dir remains IMalloc* alloc; if (pidlUpperDir != NULL && SUCCEEDED(CoGetMalloc(1, &alloc))) { @@ -278,10 +279,10 @@ BOOL GetShellFolder(const char* dir, IShellFolder*& shellFolderObj, LPITEMIDLIST if (name != NULL) { - if (lstrlen(name) <= 3 && StrNICmp(name, root, 2) == 0) // name = "c:" nebo "c:\" + if (lstrlen(name) <= 3 && StrNICmp(name, root, 2) == 0) // name = "c:" or "c:\" { pidlFolder = idList; - break; // pidl nalezen (ziskan) + break; // PIDL found } } } @@ -298,9 +299,9 @@ BOOL GetShellFolder(const char* dir, IShellFolder*& shellFolderObj, LPITEMIDLIST } else { - if (rootFolder == CSIDL_NETWORK) // musime ziskat slozite pidl, jinak nechodi mapovani + if (rootFolder == CSIDL_NETWORK) // we must obtain a complex PIDL; otherwise mapping does not work { - BOOL setWait = (GetCursor() != LoadCursor(NULL, IDC_WAIT)); // ceka uz ? + BOOL setWait = (GetCursor() != LoadCursor(NULL, IDC_WAIT)); // already waiting? HCURSOR oldCur; if (setWait) oldCur = SetCursor(LoadCursor(NULL, IDC_WAIT)); @@ -371,7 +372,7 @@ BOOL GetShellFolder(const char* dir, IShellFolder*& shellFolderObj, LPITEMIDLIST LPSHELLFOLDER swap = shellFolderObj; shellFolderObj = folder2; folder2 = swap; - break; // pidl nalezen (ziskan) + break; // PIDL found } } } @@ -402,7 +403,7 @@ BOOL GetShellFolder(const char* dir, IShellFolder*& shellFolderObj, LPITEMIDLIST if (pidlFolder == NULL) pidlFolder = GetItemIdListForFileName(shellFolderObj, dir); - // shellFolderObj + pidlFolder -> dohromady "dir" folder + // shellFolderObj + pidlFolder together represent the "dir" folder } // else TRACE_E("BindToObject error: " << hex << ret); IMalloc* alloc; @@ -504,7 +505,7 @@ void DoExecuteAssociation(HWND hWindow, const char* path, const char* name) menu->QueryContextMenu(h, 0, 0, -1, CMF_NORMAL | CMF_EXPLORE); UINT cmd = GetMenuDefaultItem(h, FALSE, GMDI_GOINTOPOPUPS); - if (cmd == -1) // nenasli jsme default item -> zkusime hledat jen mezi verby + if (cmd == -1) // default item not found -> try searching only among verbs { DestroyMenu(h); h = CreatePopupMenu(); @@ -514,7 +515,7 @@ void DoExecuteAssociation(HWND hWindow, const char* path, const char* name) cmd = GetMenuDefaultItem(h, FALSE, GMDI_GOINTOPOPUPS); if (cmd == -1) - cmd = 0; // zkusime "default verb" (index 0) + cmd = 0; // try the "default verb" (index 0) } } if (cmd != -1) @@ -570,7 +571,7 @@ LONG __stdcall MyUnhandledExceptionFilter(EXCEPTION_POINTERS* ExceptionInfo) // "SALOPEN: An exception has occured!\n", // 34, &written, NULL); // ExitProcess(666); - TerminateProcess(GetCurrentProcess(), 666); // tvrdsi exit (tenhle jeste neco vola) + TerminateProcess(GetCurrentProcess(), 666); // more forceful exit; this still makes one call return EXCEPTION_EXECUTE_HANDLER; } @@ -616,7 +617,7 @@ LRESULT CALLBACK MyWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam // EnableExceptionsOn64 // -// Chceme se dozvedet o SEH Exceptions i na x64 Windows 7 SP1 a dal +// We want to receive SEH exceptions even on x64 Windows 7 SP1 and later. // http://blog.paulbetts.org/index.php/2010/07/20/the-case-of-the-disappearing-onload-exception-user-mode-callback-exceptions-in-x64/ // http://connect.microsoft.com/VisualStudio/feedback/details/550944/hardware-exceptions-on-x64-machines-are-silently-caught-in-wndproc-messages // http://support.microsoft.com/kb/976038 @@ -748,7 +749,7 @@ void WinMainCRTStartup() GetCurrentProcess(), &fm, // this process file-mapping 0, FALSE, DUPLICATE_SAME_ACCESS)) { - void* ptr = MapViewOfFile(fm, FILE_MAP_READ, 0, 0, 0); // FIXME_X64 nepredavame x86/x64 nekompatibilni data? + void* ptr = MapViewOfFile(fm, FILE_MAP_READ, 0, 0, 0); // FIXME_X64 we do not pass x86/x64-incompatible data, do we? if (ptr != NULL) { // lets copy file name from file-mapping (shared memory) @@ -769,8 +770,8 @@ void WinMainCRTStartup() ExitProcess(1); } - // vytvorime skryte okno a z nej spustime menu - // pod W2K+ uz asi neni potreba + // Create a hidden window and launch the menu from it. + // On W2K+ this is probably no longer necessary. HINSTANCE hInstance = GetModuleHandle(NULL); WNDCLASS CWindowClass; CWindowClass.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW; From a67db68d8a12be39fbff9f146eb08df43b4974fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 05:47:58 +0200 Subject: [PATCH 628/710] [translation] Fix src/icncache.h comments (#1005) --- src/icncache.h | 163 +++++++++++++++++++++++++------------------------ 1 file changed, 82 insertions(+), 81 deletions(-) diff --git a/src/icncache.h b/src/icncache.h index 3ecb1848b..3eec99ef2 100644 --- a/src/icncache.h +++ b/src/icncache.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once @@ -11,29 +12,29 @@ class CIconData { public: - char* NameAndData; // alokovano po DWORDech, konce nulovane (kvuli porovnavani); - // pro Flag==3 (i pro ==1, nasleduje-li po ==3) navic pripojen string s icon-location; - // pro Flag==4,5,6 navic pripojena znamka souboru (CQuadWord Size + FILETIME LastWrite) - // a seznam rozhrani CPluginInterfaceForThumbLoaderEncapsulation - // vsech pluginu, ktere umi vytvorit thumbnail pro soubor 'NameAndData', seznam je ukoncen - // NULLem) - const CFileData* FSFileData; // ukazatel na CFileData souboru (jen u FS s typem ikon pitFromPlugin), jinak NULL + char* NameAndData; // allocated on DWORD boundaries, null-terminated at the end (for comparison); + // for Flag==3 (and for ==1 if it follows ==3), a string with icon-location is also appended; + // for Flag==4,5,6, the file stamp (CQuadWord Size + FILETIME LastWrite) is also appended, + // along with the list of CPluginInterfaceForThumbLoaderEncapsulation interfaces for all + // plugins that can create a thumbnail for file 'NameAndData'; the list is terminated + // with NULL) + const CFileData* FSFileData; // pointer to CFileData for the file (only for FS with icon type pitFromPlugin), otherwise NULL private: - DWORD Index : 28; // >= 0 index do cache ikon nebo thumbnailu (index musi byt < 134217728); -1 -> nenactene; - // pri Flag==0,1,2,3 jde o index do cache ikon; - // pri Flag==4,5,6 jde o index do cache thumbnailu - DWORD ReadingDone : 1; // 1 = uz jsme se pokouseli nacist (i neuspesne), 0 = jeste jsme nenacitali - DWORD Flag : 3; // flag k danemu typu, v CIconCache: - // ikony: 0 - nenactene, 1 - o.k., 2 - stara verze, 3 - ikona zadana pomoci icon-location - // thumbnaily: 4 - nenactene, 5 - o.k., 6 - stara verze (nebo nekvalitni/mensi) + DWORD Index : 28; // >= 0 index into the icon or thumbnail cache (must be < 134217728); -1 -> not loaded; + // for Flag==0,1,2,3 this is an index into the icon cache; + // for Flag==4,5,6 this is an index into the thumbnail cache + DWORD ReadingDone : 1; // 1 = we already tried to load it (even unsuccessfully), 0 = we have not tried yet + DWORD Flag : 3; // flag for the given type, in CIconCache: + // icons: 0 - not loaded, 1 - OK, 2 - old version, 3 - icon specified via icon-location + // thumbnails: 4 - not loaded, 5 - OK, 6 - old version (or poor-quality/smaller) public: int GetIndex() { int index = Index; if (index & 0x08000000) - index |= 0xF0000000; // neumi 28-bit int na 32-bit int ... + index |= 0xF0000000; // sign-extend 28-bit int to 32-bit int ... return index; } @@ -57,17 +58,17 @@ class CIconData // // -// reprezentuje jeden thumbnail v CIconCache::ThumbnailsCache -// protoze pri vetsim mnozstvi handlu bitmap dochazi k tuhnuti procesu, -// je lepsi drzet bitmapy jako RAW data +// Represents one thumbnail in CIconCache::ThumbnailsCache. +// Because a larger number of bitmap handles can make the process stall, +// it is better to keep the bitmaps as RAW data. // struct CThumbnailData { - WORD Width; // rozmery thumbnailu + WORD Width; // thumbnail dimensions WORD Height; - WORD Planes; // urcuji "geometrii" dat (tyto dva parametry bychom mohli vypustit, - WORD BitsPerPixel; // ale vzniklo by riziko pri prepnuti barevne hloubky) - DWORD* Bits; // raw data device dependent bitmapy; format neznamy + WORD Planes; // define the data "geometry" (we could omit these two parameters, + WORD BitsPerPixel; // but that would introduce a risk when switching color depth) + DWORD* Bits; // raw data of a device-dependent bitmap; format unknown }; // @@ -81,47 +82,47 @@ class CIconCache : public TDirectArray // // Icons // - TIndirectArray IconsCache; // pole bitmap slouzici jako cache na ikonky - int IconsCount; // pocet zaplnenych mist v bitmapach (ikon) - CIconSizeEnum IconSize; // jakou velikost ikonek drzime? + TIndirectArray IconsCache; // array of bitmaps used as the icon cache + int IconsCount; // number of occupied slots in the icon bitmaps + CIconSizeEnum IconSize; // which icon size do we keep? // // Thumbnails // - TDirectArray ThumbnailsCache; // pole bitmap slouzici jako cache na thumbnaily + TDirectArray ThumbnailsCache; // array of bitmaps used as the thumbnail cache - CPluginDataInterfaceEncapsulation* DataIfaceForFS; // jen pro interni pouziti v SortArray() + CPluginDataInterfaceEncapsulation* DataIfaceForFS; // for internal use in SortArray() only public: - // 'forAssociations' slouzi k dimenzovani velikosti (base/delta) pole; u asociaci se predpoklada vetsi + // 'forAssociations' is used to size the array (base/delta); associations are expected to be larger CIconCache(); ~CIconCache(); - void Release(); // uvolneni celeho pole + invalidate cache - void Destroy(); // uvolneni celeho pole + cache + void Release(); // release the entire array + invalidate cache + void Destroy(); // release the entire array + cache - // seradi pole pro rychle vyhledavani; 'dataIface' je NULL krome pripadu, kdy jde - // o ptPluginFS s ikonami typu pitFromPlugin + // Sorts the array for fast lookup; 'dataIface' is NULL except when this is + // ptPluginFS with icons of type pitFromPlugin. void SortArray(int left, int right, CPluginDataInterfaceEncapsulation* dataIface); - // vraci "nalezeno ?" a index polozky nebo kam se ma vlozit (razene pole); - // 'name' musi byt zarovnane po DWORDech (pouziva se jen pokud je 'dataIface' NULL); - // 'file' jsou file-data souboru/adresare 'name' (pouziva se jen pokud neni 'dataIface' - // NULL); 'dataIface' je NULL krome pripadu, kdy jde o ptPluginFS s ikonami typu + // Returns "found?" and the item index, or the insertion position (sorted array); + // 'name' must be DWORD-aligned (used only if 'dataIface' is NULL); + // 'file' is the file-data for file/directory 'name' (used only if 'dataIface' is + // not NULL); 'dataIface' is NULL except when this is ptPluginFS with icons of type // pitFromPlugin BOOL GetIndex(const char* name, int& index, CPluginDataInterfaceEncapsulation* dataIface, const CFileData* file); - // nakopiruje si zname ikonky a thumbnaily (stara a nova cache musi byt serazene !) - // v pripade thumbnailu preda geometrii a raw data obrazku (CThumbnailData::Bits) - // do nove cache; ve stare nastavi Bits=NULL, aby pri destrukci nedoslo k dealokaci; - // 'dataIface' je NULL krome pripadu, kdy jde u stare i nove cache o ptPluginFS - // s ikonami typu pitFromPlugin + // Copies known icons and thumbnails (the old and new caches must be sorted!) + // In the thumbnail case, passes the image geometry and raw image data + // (CThumbnailData::Bits) to the new cache; sets Bits=NULL in the old cache to avoid + // deallocation during destruction; 'dataIface' is NULL except when both old and new + // caches are ptPluginFS with icons of type pitFromPlugin void GetIconsAndThumbsFrom(CIconCache* icons, CPluginDataInterfaceEncapsulation* dataIface, BOOL transferIconsAndThumbnailsAsNew = FALSE, BOOL forceReloadThumbnails = FALSE); - // musi prekreslit zakladni sadu ikon s novym pozadim + // Must redraw the base icon set with the new background. void ColorsChanged(); //////////////// @@ -129,14 +130,14 @@ class CIconCache : public TDirectArray // Icons methods // - // allokuje misto pro ikonku; vraci jeji index nebo -1 pri chybe - // promenne 'iconList' a 'iconListIndex' mohou byt NULL (pak nejsou nastavovany) - // jinak 'iconList' vraci ukazatel na CIconList, ktery nese ikonu a 'iconListIndex' - // je index v ramci tohoto imagelistu. + // Allocates space for an icon; returns its index or -1 on error. + // Variables 'iconList' and 'iconListIndex' may be NULL (then they are not set). + // Otherwise, 'iconList' returns a pointer to the CIconList carrying the icon and + // 'iconListIndex' is the index within that image list. int AllocIcon(CIconList** iconList, int* imageIconIndex); - // vrati v 'iconList' ukazatel na IconList a v 'iconListIndex' pozici ikonky - // 'iconIndex' (vracene z AllocIcon); + // Returns in 'iconList' a pointer to IconList and in 'iconListIndex' the icon position + // for 'iconIndex' (returned by AllocIcon); BOOL GetIcon(int iconIndex, CIconList** iconList, int* iconListIndex); //////////////// @@ -144,22 +145,22 @@ class CIconCache : public TDirectArray // Thumbnails methods // - // alokuje misto pro thumbnail na konci pole ThumbnailsCache - // pokud je vse OK, vraci index, ktery thumbnailu odpovida - // pri chybe vrati -1 + // Allocates space for a thumbnail at the end of the ThumbnailsCache array. + // If everything is OK, returns the index corresponding to that thumbnail. + // On error, returns -1. int AllocThumbnail(); - // vrati v 'thumbnailData' ukazatel na polozku - // 'index' (vracena z AllocThumbnail); + // Returns in 'thumbnailData' a pointer to the item + // 'index' (returned by AllocThumbnail); BOOL GetThumbnail(int index, CThumbnailData** thumbnailData); void SetIconSize(CIconSizeEnum iconSize); CIconSizeEnum GetIconSize() { return IconSize; } protected: - // jen pro interni pouziti + // For internal use only. void SortArrayInt(int left, int right); - // jen pro interni pouziti + // For internal use only. void SortArrayForFSInt(int left, int right); }; @@ -170,19 +171,19 @@ class CIconCache : public TDirectArray struct CAssociationIndexAndFlag { - DWORD Index : 31; // >= 0 index; -1 nenactene; -2 dynamicke (ikona v souboru); -3 nacitane (-1 -> -3) - DWORD Flag : 1; // jde *.ExtensionAndData otevrit ? + DWORD Index : 31; // >= 0 index; -1 not loaded; -2 dynamic (icon in file); -3 loading (-1 -> -3) + DWORD Flag : 1; // can *.ExtensionAndData be opened? }; class CAssociationData { public: - char* ExtensionAndData; // alokovano po DWORDech, konce nulovane (kvuli porovnavani); - // extension + navic pripojen string s icon-location; - char* Type; // retezec file-type; misto "" je NULL (setrime pamet) + char* ExtensionAndData; // allocated on DWORD boundaries, null-terminated at the end (for comparison); + // extension + additionally appended string with icon-location; + char* Type; // file-type string; NULL is used instead of "" (to save memory) private: - // pro kazdy rozmer ikon potrebujeme par Index+Flag + // We need an Index+Flag pair for each icon size. CAssociationIndexAndFlag IndexAndFlag[ICONSIZE_COUNT]; public: @@ -195,7 +196,7 @@ class CAssociationData } DWORD index = IndexAndFlag[iconSize].Index; if (index & 0x40000000) - index |= 0x80000000; // neumi 31-bit int na 32-bit int ... + index |= 0x80000000; // sign-extend 31-bit int to 32-bit int ... return index; } @@ -226,7 +227,7 @@ class CAssociationData // CAssociations // -#define ASSOC_ICON_NO_ASSOC 0 // pevne ikonky v cache-bitmape CAssociations +#define ASSOC_ICON_NO_ASSOC 0 // fixed icons in the CAssociations cache bitmap #define ASSOC_ICON_SOME_FILE 1 #define ASSOC_ICON_SOME_EXE 2 #define ASSOC_ICON_SOME_DIR 3 @@ -235,8 +236,8 @@ class CAssociationData struct CAssociationsIcons { public: - TIndirectArray IconsCache; // pole bitmap slouzici jako cache na ikonky - int IconsCount; // pocet zaplnenych mist v bitmapach (ikon) + TIndirectArray IconsCache; // array of bitmaps used as the icon cache + int IconsCount; // number of occupied slots in the icon bitmaps public: CAssociationsIcons() : IconsCache(10, 5) @@ -254,43 +255,43 @@ class CAssociations : public TDirectArray CAssociations(); ~CAssociations(); - void Release(); // uvolneni celeho pole + invalidate cache - void Destroy(); // uvolneni celeho pole + cache + void Release(); // release the entire array + invalidate cache + void Destroy(); // release the entire array + cache - // vsechny -3 -> -1 + // all -3 -> -1 // void SetAllReadingToUnread(); - // seradi pole pro rychle vyhledavani + // Sorts the array for fast lookup. void SortArray(int left, int right); - // vraci "nalezeno ?" a index polozky nebo kam se ma vlozit (razene pole); - // 'name' musi byt zarovnane po DWORDech ; + // Returns "found?" and the item index, or the insertion position (sorted array); + // 'name' must be DWORD-aligned; BOOL GetIndex(const char* name, int& index); - // allokuje misto pro ikonku; vraci jeji index nebo -1 pri chybe - // promenne 'iconList' a 'iconListIndex' mohou byt NULL (pak nejsou nastavovany) - // jinak 'iconList' vraci ukazatel na CIconList, ktery nese ikonu a 'iconListIndex' - // je index v ramci tohoto imagelistu. + // Allocates space for an icon; returns its index or -1 on error. + // Variables 'iconList' and 'iconListIndex' may be NULL (then they are not set). + // Otherwise, 'iconList' returns a pointer to the CIconList carrying the icon and + // 'iconListIndex' is the index within that image list. int AllocIcon(CIconList** iconList, int* imageIconIndex, CIconSizeEnum iconSize); - // vrati v 'iconList' ukazatel na IconList a v 'iconListIndex' pozici ikonky - // 'iconIndex' (vracene z AllocIcon); + // Returns in 'iconList' a pointer to IconList and in 'iconListIndex' the icon position + // for 'iconIndex' (returned by AllocIcon); BOOL GetIcon(int iconIndex, CIconList** iconList, int* iconListIndex, CIconSizeEnum iconSize); - // musi prekreslit zakladni sadu ikon s novym pozadim + // Must redraw the base icon set with the new background. void ColorsChanged(); void ReadAssociations(BOOL showWaitWnd); - // ext musi byt zarovnan po DWORDech + // ext must be DWORD-aligned BOOL IsAssociated(char* ext, BOOL& addtoIconCache, CIconSizeEnum iconSize); BOOL IsAssociatedStatic(char* ext, const char*& iconLocation, CIconSizeEnum iconSize); BOOL IsAssociated(char* ext); protected: - // pomocna metoda + // Helper method. void InsertData(const char* origin, int index, BOOL overwriteItem, char* e, char* s, CAssociationData& data, LONG& size, const char* iconLocation, const char* type); }; -extern CAssociations Associations; // zde jsou zalozeny nactene asociace +extern CAssociations Associations; // loaded associations are stored here From 9c2eba83f916a3da68d99a430ce18af1693a6765 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 05:48:02 +0200 Subject: [PATCH 629/710] [translation] Fix src/icncache.cpp comments (#1006) --- src/icncache.cpp | 341 ++++++++++++++++++++++++----------------------- 1 file changed, 172 insertions(+), 169 deletions(-) diff --git a/src/icncache.cpp b/src/icncache.cpp index c30b69a86..3130647cc 100644 --- a/src/icncache.cpp +++ b/src/icncache.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -10,8 +11,8 @@ #include "geticon.h" #include "logo.h" -// melo by byt nasobkem hodnoty IL_ITEMS_IN_ROW -// aby se plne vyuzil prostor v bitmape +// should be a multiple of IL_ITEMS_IN_ROW +// to fully use the space in the bitmap #define ICONS_IN_LIST 100 // @@ -21,11 +22,11 @@ CIconCache::CIconCache() : TDirectArray(50, 30), - IconsCache(10, 5), // jedna polozka je CIconList drzici ICONS_IN_LIST ikonek - ThumbnailsCache(1, 20) // ziskavani thumbnailu je pomale, relokace je v tom hracka + IconsCache(10, 5), // one item is a CIconList holding ICONS_IN_LIST icons + ThumbnailsCache(1, 20) // obtaining thumbnails is slow, relocation is trivial by comparison { IconsCount = 0; - IconSize = ICONSIZE_COUNT; // zatim nenastaveno; pokus o pridani ikonky bez predchoziho volani SetIconSize() zpusobi TRACE_E + IconSize = ICONSIZE_COUNT; // not set yet; trying to add an icon without calling SetIconSize() first triggers TRACE_E DataIfaceForFS = NULL; } @@ -35,12 +36,12 @@ CIconCache::~CIconCache() } inline int CompareDWORDS(const char* s1, const char* s2, int length) -{ // porovna nejvyse 'length' DWORDu +{ // compares at most 'length' DWORDs // int res; const char* end = s1 + length; while (s1 <= end) { - // if ((res = *(DWORD *)s1 - *(DWORD *)s2) != 0) return res; // takhle to nejde (zkus si 0x8 a 0x0 ve 4-bitovych cislech) + // if ((res = *(DWORD *)s1 - *(DWORD *)s2) != 0) return res; // this does not work (try 0x8 and 0x0 as 4-bit numbers) if (*(DWORD*)s1 > *(DWORD*)s2) return 1; else @@ -56,12 +57,12 @@ inline int CompareDWORDS(const char* s1, const char* s2, int length) void CIconCache::SortArray(int left, int right, CPluginDataInterfaceEncapsulation* dataIface) { - if (dataIface != NULL) // jde o pitFromPlugin: nechame plugin, aby polozky porovnal sam (musi jit o porovnani - { // beze shod zadnych dvou polozek listingu) + if (dataIface != NULL) // this is pitFromPlugin: let the plugin compare the items itself (the comparison must not treat any two listing items as equal) + { // with no two identical listing items) DataIfaceForFS = dataIface; BOOL ok = TRUE; int i; - for (i = left; i <= right; i++) // jeden paranoicky testik + for (i = left; i <= right; i++) // one paranoid check { if (Data[i].GetFSFileData() == NULL) { @@ -74,7 +75,7 @@ void CIconCache::SortArray(int left, int right, CPluginDataInterfaceEncapsulatio SortArrayForFSInt(left, right); DataIfaceForFS = NULL; } - else // klasicke razeni podle jmen + else // standard sorting by name { SortArrayInt(left, right); } @@ -106,7 +107,8 @@ void CIconCache::SortArrayInt(int left, int right) } } while (i <= j); - // nasledujici "hezky" kod jsme nahradili kodem podstatne setricim stack (max. log(N) zanoreni rekurze) + // The following "nice" code was replaced with code that saves substantially more stack + // space (maximum recursion depth log(N)). // if (left < j) SortArrayInt(left, j); // if (i < right) SortArrayInt(i, right); @@ -114,7 +116,7 @@ void CIconCache::SortArrayInt(int left, int right) { if (i < right) { - if (j - left < right - i) // je potreba seradit obe "poloviny", tedy do rekurze posleme tu mensi, tu druhou zpracujeme pres "goto" + if (j - left < right - i) // Both halves need to be sorted: recurse into the smaller one and process the other via goto. { SortArrayInt(left, j); left = i; @@ -168,7 +170,7 @@ void CIconCache::SortArrayForFSInt(int left, int right) } } while (i <= j); - // nasledujici "hezky" kod jsme nahradili kodem podstatne setricim stack (max. log(N) zanoreni rekurze) + // The following "nice" code was replaced with code that uses significantly less stack (maximum recursion depth log(N)). // if (left < j) SortArrayForFSInt(left, j); // if (i < right) SortArrayForFSInt(i, right); @@ -176,7 +178,7 @@ void CIconCache::SortArrayForFSInt(int left, int right) { if (i < right) { - if (j - left < right - i) // je potreba seradit obe "poloviny", tedy do rekurze posleme tu mensi, tu druhou zpracujeme pres "goto" + if (j - left < right - i) // Both halves need to be sorted, so recurse into the smaller one and process the other using goto. { SortArrayForFSInt(left, j); left = i; @@ -208,7 +210,7 @@ void CIconCache::SortArrayForFSInt(int left, int right) BOOL CIconCache::GetIndex(const char* name, int& index, CPluginDataInterfaceEncapsulation* dataIface, const CFileData* file) { - if (Count == 0 || dataIface != NULL && file == NULL) // overime platnost 'file' + if (Count == 0 || dataIface != NULL && file == NULL) // verify that 'file' is valid { if (dataIface != NULL && file == NULL) TRACE_E("CIconCache::GetIndex(): 'file' may not be NULL when 'dataIface' is not NULL! item=" << name); @@ -216,8 +218,8 @@ BOOL CIconCache::GetIndex(const char* name, int& index, CPluginDataInterfaceEnca return FALSE; } - if (dataIface != NULL) // jde o pitFromPlugin: nechame plugin, aby polozky porovnal sam (musi jit o porovnani - { // beze shod zadnych dvou polozek listingu) + if (dataIface != NULL) // this is pitFromPlugin: let the plugin compare the items itself (the comparison must not treat any two listing items as equal) + { // with no two identical listing items) int l = 0, r = Count - 1, m; int res; while (1) @@ -232,34 +234,34 @@ BOOL CIconCache::GetIndex(const char* name, int& index, CPluginDataInterfaceEnca "for item: " << At(m).NameAndData); index = 0; - return FALSE; // chyba -> vratime treba: nenalezeno, vlozit na zacatek pole + return FALSE; // error -> return as if not found: insert at the beginning of the array } - if (res == 0) // nalezeno + if (res == 0) // found { index = m; return TRUE; } else if (res > 0) { - if (l == r || l > m - 1) // nenalezeno + if (l == r || l > m - 1) // not found { - index = m; // mel by byt na teto pozici + index = m; // it should be at this position return FALSE; } r = m - 1; } else { - if (l == r) // nenalezeno + if (l == r) // not found { - index = m + 1; // mel by byt az za touto pozici + index = m + 1; // it should be just after this position return FALSE; } l = m + 1; } } } - else // klasicke hledani podle jmena + else // classic search by name { int length = (int)strlen(name); int l = 0, r = Count - 1, m; @@ -268,25 +270,25 @@ BOOL CIconCache::GetIndex(const char* name, int& index, CPluginDataInterfaceEnca { m = (l + r) / 2; res = CompareDWORDS(At(m).NameAndData, name, length); - if (res == 0) // nalezeno + if (res == 0) // found { index = m; return TRUE; } else if (res > 0) { - if (l == r || l > m - 1) // nenalezeno + if (l == r || l > m - 1) // not found { - index = m; // mel by byt na teto pozici + index = m; // it should be at this position return FALSE; } r = m - 1; } else { - if (l == r) // nenalezeno + if (l == r) // not found { - index = m + 1; // mel by byt az za touto pozici + index = m + 1; // it should be just after this position return FALSE; } l = m + 1; @@ -307,31 +309,31 @@ void CIconCache::Release() DestroyMembers(); IconsCount = 0; - // destrukce raw dat z ThumbnailsCache + // destroy the raw data from ThumbnailsCache for (i = 0; i < ThumbnailsCache.Count; i++) { CThumbnailData* data = &ThumbnailsCache[i]; if (data->Bits != NULL) - free(data->Bits); // alokovano v CSalamanderThumbnailMaker::RenderToThumbnailData() + free(data->Bits); // allocated in CSalamanderThumbnailMaker::RenderToThumbnailData() } ThumbnailsCache.DestroyMembers(); } void CIconCache::Destroy() { - // uvonime alokovana data a pole samotne + // free the allocated data and the array itself Release(); - // destrukce imagelistu z IconsCache + // destroy the image lists from IconsCache IconsCache.DestroyMembers(); } void CIconCache::ColorsChanged() { CALL_STACK_MESSAGE1("CIconCache::ColorsChanged()"); - // tato funkce je volana pri zmene barev nebo barevne hloubky obrazovky - // druhy pripad neni reseny -- bylo by treba znovu konstruovat bitmapy - // v imagelistech pro aktualni barevnou hloubku + // this function is called when the screen colors or color depth change + // the second case is not handled; it would be necessary to reconstruct the bitmaps + // in the image lists for the current color depth COLORREF bkColor = GetCOLORREF(CurrentColors[ITEM_BK_NORMAL]); int i; for (i = 0; i < IconsCache.Count; i++) @@ -341,13 +343,13 @@ void CIconCache::ColorsChanged() il->SetBkColor(bkColor); } - // thumbnaily je potreba prekreslit, pokud se zmenila barva pozadi, budou se ikonky s pruhlednymi - // castmi kreslit do nove barvy pozadi + // thumbnails need to be redrawn if the background color changed; icons with transparent + // parts will be drawn onto the new background color for (i = 0; i < Count; i++) { CIconData* icon = &At(i); - if (icon->GetFlag() == 5 /* o.k. thumbnail */) - icon->SetFlag(6 /* stara verze thumbnailu */); + if (icon->GetFlag() == 5 /* valid thumbnail */) + icon->SetFlag(6 /* old thumbnail version */); } } @@ -355,7 +357,7 @@ int CIconCache::AllocIcon(CIconList** iconList, int* iconListIndex) { SLOW_CALL_STACK_MESSAGE1("CIconCache::AllocIcon()"); int cache = IconsCount / ICONS_IN_LIST; // cache - int index = IconsCount % ICONS_IN_LIST; // index v ramci teto cache + int index = IconsCount % ICONS_IN_LIST; // index within this cache if (cache >= IconsCache.Count) { if (cache > IconsCache.Count) @@ -408,11 +410,11 @@ int CIconCache::AllocThumbnail() { CALL_STACK_MESSAGE1("CIconCache::AllocThumbnail()"); - // stuktura pro drzeni thumbnailu + // structure for holding thumbnails CThumbnailData data; memset(&data, 0, sizeof(CThumbnailData)); - // zaradime jej do seznamu + // add it to the list int index = ThumbnailsCache.Add(data); if (!ThumbnailsCache.IsGood()) { @@ -420,7 +422,7 @@ int CIconCache::AllocThumbnail() return -1; } - // vratime index pridaneho prvku + // returns the index of the added item return index; } @@ -446,7 +448,7 @@ BOOL CIconCache::GetIcon(int iconIndex, CIconList** iconList, int* iconListIndex if (iconIndex >= 0 && iconIndex < IconsCount) { int cache = iconIndex / ICONS_IN_LIST; // cache - int index = iconIndex % ICONS_IN_LIST; // index v ramci cache + int index = iconIndex % ICONS_IN_LIST; // index within the cache if (cache < IconsCache.Count) { *iconList = IconsCache[cache]; @@ -473,8 +475,8 @@ void CIconCache::GetIconsAndThumbsFrom(CIconCache* icons, CPluginDataInterfaceEn int index1 = 0; int index2 = 0; - if (dataIface != NULL) // jde o pitFromPlugin: nechame plugin, aby polozky porovnal sam (musi jit o porovnani - { // beze shod zadnych dvou polozek listingu) + if (dataIface != NULL) // This is pitFromPlugin: let the plugin compare the items itself. + { // with no two identical listing items) const CFileData *file1, *file2; if (index1 < Count) @@ -489,7 +491,7 @@ void CIconCache::GetIconsAndThumbsFrom(CIconCache* icons, CPluginDataInterfaceEn } } else - return; // neni co spojovat + return; // nothing to merge if (index2 < icons->Count) { @@ -503,12 +505,12 @@ void CIconCache::GetIconsAndThumbsFrom(CIconCache* icons, CPluginDataInterfaceEn } } else - return; // neni co spojovat + return; // nothing to merge int res; while (1) { res = dataIface->CompareFilesFromFS(file1, file2); - if (res == 0) // shodne -> provedeme kopii (ikony a masky) + if (res == 0) // identical -> copy them (icons and masks) { CIconList* srcIconList; int srcIconListIndex; @@ -518,13 +520,13 @@ void CIconCache::GetIconsAndThumbsFrom(CIconCache* icons, CPluginDataInterfaceEn DWORD flag = icons->At(index2).GetFlag(); - if ((flag == 1 || flag == 2) && // platna nebo stara ikona - At(index1).GetFlag() == 0 && // zajima nas ikona (pokud doslo k prepnuti na thumbnail, starou ikonu nepotrebujeme) + if ((flag == 1 || flag == 2) && // valid or old icon + At(index1).GetFlag() == 0 && // we care about the icon (if it switched to a thumbnail, the old icon is no longer needed) GetIcon(At(index1).GetIndex(), &dstIconList, &dstIconListIndex) && icons->GetIcon(icons->At(index2).GetIndex(), &srcIconList, &srcIconListIndex)) { dstIconList->Copy(dstIconListIndex, srcIconList, srcIconListIndex); - At(index1).SetFlag((flag == 1 && transferIconsAndThumbnailsAsNew) ? 1 : 2); // ted uz je to stara (nebo platna/nova) verze ikony + At(index1).SetFlag((flag == 1 && transferIconsAndThumbnailsAsNew) ? 1 : 2); // now it is the old (or valid/new) icon version } } @@ -542,7 +544,7 @@ void CIconCache::GetIconsAndThumbsFrom(CIconCache* icons, CPluginDataInterfaceEn } } else - break; // uz neni co spojovat + break; // nothing left to merge } if (res == 0 || res > 0) // index2++ @@ -559,7 +561,7 @@ void CIconCache::GetIconsAndThumbsFrom(CIconCache* icons, CPluginDataInterfaceEn } } else - break; // uz neni co spojovat + break; // nothing left to merge } } } @@ -574,17 +576,17 @@ void CIconCache::GetIconsAndThumbsFrom(CIconCache* icons, CPluginDataInterfaceEn length = (int)strlen(name1); } else - return; // neni co spojovat + return; // nothing to merge if (index2 < icons->Count) name2 = icons->At(index2).NameAndData; else - return; // neni co spojovat + return; // nothing to merge int res; while (1) { res = CompareDWORDS(name1, name2, length); - if (res == 0) // shodne -> provedeme kopii (ikony a masky) || thumbnailu + if (res == 0) // match -> copy the icons and masks, or the thumbnail { CIconList* srcIconList; int srcIconListIndex; @@ -594,33 +596,33 @@ void CIconCache::GetIconsAndThumbsFrom(CIconCache* icons, CPluginDataInterfaceEn DWORD flag = icons->At(index2).GetFlag(); - if ((flag == 1 || flag == 2) && // platna nebo stara ikona - At(index1).GetFlag() == 0 && // zajima nas ikona (pokud doslo k prepnuti na thumbnail, starou ikonu nepotrebujeme) + if ((flag == 1 || flag == 2) && // valid or old icon + At(index1).GetFlag() == 0 && // we care about the icon (if it switched to a thumbnail, the old icon is no longer needed) GetIcon(At(index1).GetIndex(), &dstIconList, &dstIconListIndex) && icons->GetIcon(icons->At(index2).GetIndex(), &srcIconList, &srcIconListIndex)) { dstIconList->Copy(dstIconListIndex, srcIconList, srcIconListIndex); - At(index1).SetFlag((flag == 1 && transferIconsAndThumbnailsAsNew) ? 1 : 2); // ted uz je to stara (nebo platna/nova) verze ikony + At(index1).SetFlag((flag == 1 && transferIconsAndThumbnailsAsNew) ? 1 : 2); // now it is the old (or valid/new) icon version } else { CThumbnailData* srcThumbnailData; CThumbnailData* tgtThumbnailData; - if ((flag == 5 || flag == 6) && // platny nebo stary thumbnail - At(index1).GetFlag() == 4 && // zajima nas thumbnail (pokud doslo k prepnuti na ikonu, stary thumbnail nepotrebujeme) + if ((flag == 5 || flag == 6) && // valid or old thumbnail + At(index1).GetFlag() == 4 && // we care about the thumbnail (if it switched to an icon, the old thumbnail is no longer needed) GetThumbnail(At(index1).GetIndex(), &tgtThumbnailData) && icons->GetThumbnail(icons->At(index2).GetIndex(), &srcThumbnailData)) { - // stary thumbnail neni treba kopirovat -- staci predat jeho - // geometrii a raw data do ciloveho thumbnailu - *tgtThumbnailData = *srcThumbnailData; // predame stara data do nove cache - srcThumbnailData->Bits = NULL; // stara cache zanika a nesmi se dealokovat data + // the old thumbnail does not need to be copied; it is enough to pass its + // geometry and raw data to the target thumbnail + *tgtThumbnailData = *srcThumbnailData; // pass the old data to the new cache + srcThumbnailData->Bits = NULL; // the old cache is going away and must not deallocate the data int newFlag = 6; - // pokud kopirujeme platny thumbnail, zkontrolujeme znamku souboru (size+date), pripadne - // zkopirovany thumbnail oznacime rovnou jako platny (hrozba zmeny souboru beze zmeny - // size+date je miziva a rychlostni zisk je obrovsky) + // if we are copying a valid thumbnail, check the file stamp (size+date); if appropriate, + // mark the copied thumbnail as valid immediately (the risk of the file changing without + // changing size+date is negligible, while the speed gain is huge) if (flag == 5 && !forceReloadThumbnails) { if (transferIconsAndThumbnailsAsNew) @@ -628,7 +630,7 @@ void CIconCache::GetIconsAndThumbsFrom(CIconCache* icons, CPluginDataInterfaceEn else { int offset = length + 4; - offset -= (offset & 0x3); // offset % 4 (zarovnani po ctyrech bytech) + offset -= (offset & 0x3); // offset % 4 (4-byte alignment) if (*(CQuadWord*)(name1 + offset) == *(CQuadWord*)(name2 + offset) && CompareFileTime((FILETIME*)(name1 + offset + sizeof(CQuadWord)), (FILETIME*)(name2 + offset + sizeof(CQuadWord))) == 0) @@ -637,7 +639,7 @@ void CIconCache::GetIconsAndThumbsFrom(CIconCache* icons, CPluginDataInterfaceEn } } } - At(index1).SetFlag(newFlag); // ted uz je to stara (nebo platna/nova) verze thumbnailu + At(index1).SetFlag(newFlag); // now it is the old (or valid/new) thumbnail version } } } @@ -650,7 +652,7 @@ void CIconCache::GetIconsAndThumbsFrom(CIconCache* icons, CPluginDataInterfaceEn length = (int)strlen(name1); } else - break; // uz neni co spojovat + break; // nothing left to merge } if (res == 0 || res > 0) // index2++ @@ -658,7 +660,7 @@ void CIconCache::GetIconsAndThumbsFrom(CIconCache* icons, CPluginDataInterfaceEn if (++index2 < icons->Count) name2 = icons->At(index2).NameAndData; else - break; // uz neni co spojovat + break; // nothing left to merge } } } @@ -671,10 +673,10 @@ void CIconCache::SetIconSize(CIconSizeEnum iconSize) TRACE_E("CIconCache::SetIconSize() unexpected iconSize==ICONSIZE_COUNT"); return; } - if (iconSize == IconSize) // pokud se nemeni velikost, neni co resit + if (iconSize == IconSize) // if the size is not changing, there is nothing to do return; - // zahodime soucasne ikonky + // discard the current icons int i; for (i = 0; i < Count; i++) { @@ -738,7 +740,7 @@ BOOL GetIconFromAssocAux(BOOL initFlagAndIndexes, HKEY root, const char* keyName { type[0] = 0; - // file-type retezec ziskame jako value "" podklice keyName + // get the file-type string as the value "" of the keyName subkey if (HANDLES_Q(RegOpenKey(root, keyNameBuf, &openKey)) == ERROR_SUCCESS) { LONG typeSize = MAX_PATH; @@ -748,11 +750,11 @@ BOOL GetIconFromAssocAux(BOOL initFlagAndIndexes, HKEY root, const char* keyName } } - if (size - 1 + 7 <= MAX_PATH) // test na moznost otevirani pres asociace + if (size - 1 + 7 <= MAX_PATH) // test whether opening via associations is possible { memmove(keyNameBuf + size - 1, "\\Shell", 7); if (HANDLES_Q(RegOpenKey(root, keyNameBuf, &openKey)) == ERROR_SUCCESS) - { // obsahuje-li "\\shell" nejaky podklic, da se otvirat (asociace na Enter) + { // if "\\shell" contains any subkey, it can be opened (association for Enter) DWORD keys; if (RegQueryInfoKey(openKey, NULL, NULL, NULL, &keys, NULL, NULL, NULL, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) @@ -767,7 +769,7 @@ BOOL GetIconFromAssocAux(BOOL initFlagAndIndexes, HKEY root, const char* keyName if (size - 1 + 21 <= MAX_PATH) { memmove(keyNameBuf + size - 1, "\\ShellEx\\IconHandler", 21); - // obsahuje-li "\\ShellEx\\IconHandler", musi se tahat ze souboru + // if "\\ShellEx\\IconHandler" is present, the icon must be loaded from the file if (HANDLES_Q(RegOpenKey(root, keyNameBuf, &openKey)) == ERROR_SUCCESS) { found = TRUE; @@ -783,7 +785,7 @@ BOOL GetIconFromAssocAux(BOOL initFlagAndIndexes, HKEY root, const char* keyName if (HANDLES_Q(RegOpenKey(root, keyNameBuf, &openKey)) == ERROR_SUCCESS) { char buf[MAX_PATH]; - size = MAX_PATH; // ziskani cesty k ikone + size = MAX_PATH; // get the path to the icon DWORD type2 = REG_SZ; DWORD err = SalRegQueryValueEx(openKey, "", 0, &type2, (LPBYTE)buf, (LPDWORD)&size); @@ -803,7 +805,7 @@ BOOL GetIconFromAssocAux(BOOL initFlagAndIndexes, HKEY root, const char* keyName else strcpy(iconLocation, buf); - // odstranime uvozovky v pripade "\"jmeno_souboru\",cislo_ikony" (napr. "\"C:\\Program Files\\VideoLAN\\VLC\\vlc.exe\",0") + // remove quotes in the case "\"file_name\",icon_number" (for example "\"C:\\Program Files\\VideoLAN\\VLC\\vlc.exe\",0") char* num = strrchr(iconLocation, ','); if (num != NULL) { @@ -817,15 +819,15 @@ BOOL GetIconFromAssocAux(BOOL initFlagAndIndexes, HKEY root, const char* keyName char* numBeg = numEnd + 1; while (*++numEnd >= '0' && *numEnd <= '9') ; - if (numBeg < numEnd && *numEnd == 0 && // cislo ikony je za posledni carkou - *iconLocation == '"' && num - 1 > iconLocation && *(num - 1) == '"') // na zacatku a pred carkou jsou uvozovky - { // odstranime uvozovky + if (numBeg < numEnd && *numEnd == 0 && // the icon number is after the last comma + *iconLocation == '"' && num - 1 > iconLocation && *(num - 1) == '"') // there are quotes at the beginning and before the comma + { // remove the quotes memmove(iconLocation, iconLocation + 1, (num - 1) - (iconLocation + 1)); memmove(num - 2, num, numEnd - num + 1); } } - char* s = buf; // rozliseni typu "%1" od "...%promenna%..." + char* s = buf; // distinguish "%1" from "...%variable%..." while (*s != 0) { if (*s == '%') @@ -835,7 +837,7 @@ BOOL GetIconFromAssocAux(BOOL initFlagAndIndexes, HKEY root, const char* keyName { while (*s != 0 && *s != ' ' && *s != '%') s++; - if (*s != '%') // neni to env. promenna -> dynamicky typ + if (*s != '%') // not an environment variable -> dynamic type { data.SetIndexAll(-2); break; @@ -879,10 +881,10 @@ void CAssociations::Release() void CAssociations::Destroy() { - // uvonime alokovana data a pole samotne + // free the allocated data and the array itself Release(); - // destrukce imagelistu z IconsCache + // destroy the image lists from IconsCache int i; for (i = 0; i < ICONSIZE_COUNT; i++) Icons[i].IconsCache.DestroyMembers(); @@ -891,9 +893,9 @@ void CAssociations::Destroy() void CAssociations::ColorsChanged() { CALL_STACK_MESSAGE1("CAssociations::ColorsChanged()"); - // tato funkce je volana pri zmene barev nebo barevne hloubky obrazovky - // druhy pripad neni reseny -- bylo by treba znovu konstruovat bitmapy - // v imagelistech pro aktualni barevnou hloubku + // this function is called when the screen colors or color depth change + // the second case is not handled; it would be necessary to reconstruct the bitmaps + // in the image lists for the current color depth COLORREF bkColor = GetCOLORREF(CurrentColors[ITEM_BK_NORMAL]); int j; for (j = 0; j < ICONSIZE_COUNT; j++) @@ -906,7 +908,7 @@ void CAssociations::ColorsChanged() il->SetBkColor(bkColor); } } - // FIXME: stacilo by nastavovat pozadi pouze pro patricny iconlist + // FIXME: it would be enough to set the background only for the relevant icon list int i; for (i = 0; i < ICONSIZE_COUNT; i++) SimpleIconLists[i]->SetBkColor(bkColor); @@ -927,25 +929,25 @@ BOOL CAssociations::GetIndex(const char* name, int& index) { m = (l + r) / 2; res = CompareDWORDS(At(m).ExtensionAndData, name, length); - if (res == 0) // nalezeno + if (res == 0) // found { index = m; return TRUE; } else if (res > 0) { - if (l == r || l > m - 1) // nenalezeno + if (l == r || l > m - 1) // not found { - index = m; // mel by byt na teto pozici + index = m; // it should be at this position return FALSE; } r = m - 1; } else { - if (l == r) // nenalezeno + if (l == r) // not found { - index = m + 1; // mel by byt az za touto pozici + index = m + 1; // it should be just after this position return FALSE; } l = m + 1; @@ -957,7 +959,7 @@ int CAssociations::AllocIcon(CIconList** iconList, int* iconListIndex, CIconSize { CALL_STACK_MESSAGE1("CAssociations::AllocIcon()"); int cache = Icons[iconSize].IconsCount / ICONS_IN_LIST; // cache - int index = Icons[iconSize].IconsCount % ICONS_IN_LIST; // index v ramci teto cache + int index = Icons[iconSize].IconsCount % ICONS_IN_LIST; // index within this cache if (cache >= Icons[iconSize].IconsCache.Count) { if (cache > Icons[iconSize].IconsCache.Count) @@ -1008,7 +1010,7 @@ BOOL CAssociations::GetIcon(int iconIndex, CIconList** iconList, int* iconListIn if (iconIndex >= 0 && iconIndex < Icons[iconSize].IconsCount) { int cache = iconIndex / ICONS_IN_LIST; // cache - int index = iconIndex % ICONS_IN_LIST; // index v ramci cache + int index = iconIndex % ICONS_IN_LIST; // index within the cache if (cache < Icons[iconSize].IconsCache.Count) { *iconList = Icons[iconSize].IconsCache[cache]; @@ -1054,7 +1056,8 @@ void CAssociations::SortArray(int left, int right) } } while (i <= j); - // nasledujici "hezky" kod jsme nahradili kodem podstatne setricim stack (max. log(N) zanoreni rekurze) + // We replaced the following "nice" code with code that uses substantially less stack space + // // (maximum recursion depth of log(N)). // if (left < j) SortArray(left, j); // if (i < right) SortArray(i, right); @@ -1062,7 +1065,7 @@ void CAssociations::SortArray(int left, int right) { if (i < right) { - if (j - left < right - i) // je potreba seradit obe "poloviny", tedy do rekurze posleme tu mensi, tu druhou zpracujeme pres "goto" + if (j - left < right - i) // Both "halves" must be sorted, so recurse into the smaller one and process the other via "goto" { SortArray(left, j); left = i; @@ -1099,13 +1102,13 @@ void CAssociations::InsertData(const char* /*origin*/, int index, BOOL overwrite // ": type=" << (type == NULL ? "" : type)); size = (LONG)(s - e) + 4; - size -= (size & 0x3); // size % 4 (zarovnani po ctyrech bytech) + size -= (size & 0x3); // size % 4 (alignment to four bytes) int iLen = (int)strlen(iconLocation) + 1; data.ExtensionAndData = (char*)malloc(size + iLen); - memcpy(data.ExtensionAndData, e, size); // pripona + zarovnani nul + + memcpy(data.ExtensionAndData, e, size); // extension + null padding + memcpy(data.ExtensionAndData + size, iconLocation, iLen); // icon-location if (type[0] != 0) - data.Type = DupStr(type); // chyba -> jen se neukaze file-type + data.Type = DupStr(type); // error -> only the file type stays hidden else data.Type = NULL; if (overwriteItem) @@ -1122,28 +1125,28 @@ void CAssociations::InsertData(const char* /*origin*/, int index, BOOL overwrite void CAssociations::ReadAssociations(BOOL showWaitWnd) { - //--- nahozeni dialogu cekani + hodin + //--- bring up the wait dialog and hourglass HCURSOR oldCur; HWND parent = (MainWindow != NULL) ? MainWindow->HWindow : NULL; - // wait okenko zlobilo: - // pokud dam nad souborem Open With a zvolim napriklad NOTEPAD, ten se otevre - // potom se rozesle notifikace o zmene asociaci SHCNE_ASSOCCHANGED - // v dusledku se zavola tato fce, ktera zobrazi okenko a vytahne ho nahoru - // s nim vytahne celeho Salamandera, proto ho docasne zakazuji + // The wait window was problematic: + // if I use Open With on a file and choose, for example, NOTEPAD, it opens, + // then SHCNE_ASSOCCHANGED notifications are broadcast for the association change, + // which calls this function, shows the wait window, and pulls it to the front, + // taking the whole Salamander window with it, so I disable it temporarily CWaitWindow waitWnd(parent, IDS_READINGASSOCIATIONS, FALSE, ooStatic); BOOL closeDialog = FALSE; if (!ExistSplashScreen()) { if (showWaitWnd) - waitWnd.Create(); //j.r. pro ladeni shortcuty z desktopu + waitWnd.Create(); // j.r. for debugging desktop shortcuts oldCur = SetCursor(LoadCursor(NULL, IDC_WAIT)); closeDialog = TRUE; } else IfExistSetSplashScreenText(LoadStr(IDS_STARTUP_ASSOCIATIONS)); - //--- vycisteni pole + cache + //--- clear the array and cache Release(); - //--- projiti registry zaznamu o classech (extenzich) + //--- iterate through the registry records for classes (extensions) char ext[MAX_PATH + 4]; char extType[MAX_PATH]; char *s, *e; @@ -1162,8 +1165,8 @@ void CAssociations::ReadAssociations(BOOL showWaitWnd) systemFileAssoc = NULL; } - // Windows 2000 a novejsi maji jeste "Open With..." asociace ulozeny pro kazdeho usera zvlast - // v klici HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts + // Windows 2000 and later also store "Open With..." associations separately for each user + // in HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts HKEY explorerFileExts; if (HANDLES_Q(RegOpenKey(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts", &explorerFileExts)) != ERROR_SUCCESS) @@ -1175,13 +1178,13 @@ void CAssociations::ReadAssociations(BOOL showWaitWnd) LONG enumRet; FILETIME ft; while (1) - { // postupne enumnuti vsech pripon + { // enumerate all extensions one by one DWORD extS = MAX_PATH; if ((enumRet = RegEnumKeyEx(HKEY_CLASSES_ROOT, i, ext, &extS, NULL, NULL, NULL, &ft)) == ERROR_SUCCESS) - { // otevreni klice pripony + { // open the extension key if (ext[0] == '.' && HANDLES_Q(RegOpenKey(HKEY_CLASSES_ROOT, ext, &extKey)) == ERROR_SUCCESS) { - size = MAX_PATH; // ziskani typu asociace + size = MAX_PATH; // get the association type iconLocation[0] = 0; data.SetFlag(0); data.SetIndexAll(-1); @@ -1190,37 +1193,37 @@ void CAssociations::ReadAssociations(BOOL showWaitWnd) BOOL addExt = (SalRegQueryValue(extKey, "", extType, &size) == ERROR_SUCCESS && size > 1); if (addExt) { - // test na typ ikony (staticka/dynamicka viz .h) + // test the icon type (static/dynamic, see .h) tryPerceivedType = !GetIconFromAssocAux(FALSE, HKEY_CLASSES_ROOT, extType, size, data, iconLocation, type); } else tryPerceivedType = TRUE; if (tryPerceivedType && systemFileAssoc != NULL) { - // nejdrive zkusime najit 'ext' pod klicem SystemFileAssociations + // first try to find 'ext' under the SystemFileAssociations key if (GetIconFromAssocAux(FALSE, systemFileAssoc, ext, (LONG)strlen(ext) + 1, data, iconLocation, NULL)) addExt = TRUE; else - { // zkusime jeste klic z hodnoty PerceivedType (je-li definovana) + { // also try the key from the PerceivedType value, if it is defined size = MAX_PATH; if (SalRegQueryValueEx(extKey, "PerceivedType", NULL, NULL, (BYTE*)extType, (DWORD*)&size) == ERROR_SUCCESS && size > 1) { - extType[MAX_PATH - 1] = 0; // pro jistotu (hodnota nemusi byt typu string, pak muze chybet null-terminator) + extType[MAX_PATH - 1] = 0; // just in case (the value may not be a string, so the null terminator may be missing) if (GetIconFromAssocAux(FALSE, systemFileAssoc, extType, (LONG)strlen(extType) + 1, data, iconLocation, NULL)) addExt = TRUE; } } } if (addExt) - { // prevod ext. na mala pismena + pridani do pole - e = ext + 1; // preskok '.' + { // convert the extension to lowercase and add it to the array + e = ext + 1; // skip '.' s = e; while (*s != 0) { *s = LowerCase[*s]; s++; } - *(DWORD*)s = 0; // nulovani konce stringu + *(DWORD*)s = 0; // zero the end of the string InsertData("", Count, FALSE, e, s, data, size, iconLocation, type); } @@ -1231,41 +1234,41 @@ void CAssociations::ReadAssociations(BOOL showWaitWnd) { if (enumRet != ERROR_NO_MORE_ITEMS) { - // u jednoho usera (Bernard Vander Beken ) sem prijde - // jedna chyba ERROR_MORE_DATA, a pak spousta ERROR_OUTOFMEMORY, ma Microsoft Windows Server 2003, - // Standard Edition Service Pack 2 (Build 3790), zvetseni bufferu na 10000 nepomaha, nutne - // ukoncit enumeraci uz pri prvni chybe, jinak zacne cyklit a zarat pamet (zrejme jde - // o interni chybu Windowsu), nikdo dalsi to nehlasil, takze to dal neresime + // For one reported user, this returns + // one ERROR_MORE_DATA and then many ERROR_OUTOFMEMORY errors on Microsoft Windows Server 2003, + // Standard Edition Service Pack 2 (Build 3790). Increasing the buffer to 10000 does not help; + // enumeration must be stopped at the first error, otherwise it starts looping and eating memory + // (apparently an internal Windows bug). Nobody else reported it, so we do not investigate further. _snprintf_s(errBuf, _TRUNCATE, LoadStr(IDS_UNABLETOGETASSOC), GetErrorText(enumRet)); SalMessageBox(parent, errBuf, LoadStr(IDS_UNABLETOGETASSOCTITLE), MB_OK | MB_ICONEXCLAMATION); } - break; // konec enumerace + break; // end of enumeration } i++; } if (Count > 1) SortArray(0, Count - 1); - // Windows XP maji asociace (viz PerceivedType) ulozeny jeste v klici HKEY_CLASSES_ROOT\SystemFileAssociations, - // nacteme dosud nezname pripony jeste z tohoto klice + // Windows XP also stores associations (see PerceivedType) under HKEY_CLASSES_ROOT\SystemFileAssociations, + // so load any extensions that are still unknown from this key as well if (systemFileAssoc != NULL) { i = 0; while (1) - { // postupne enumnuti vsech pripon + { // enumerate all extensions one by one DWORD extS = MAX_PATH; if ((enumRet = RegEnumKeyEx(systemFileAssoc, i, ext, &extS, NULL, NULL, NULL, &ft)) == ERROR_SUCCESS) - { // otevreni klice pripony + { // open the extension key if (ext[0] == '.') { - e = ext + 1; // preskok '.' + e = ext + 1; // skip '.' s = ext; while (*++s != 0) *s = LowerCase[*s]; - *(DWORD*)s = 0; // nulovani konce stringu + *(DWORD*)s = 0; // zero the end of the string int index; - if (!GetIndex(e, index)) // nenalezeno, ma smysl zkoumat + pripadne pridat + if (!GetIndex(e, index)) // not found; it makes sense to check and add it if needed { if (GetIconFromAssocAux(TRUE, systemFileAssoc, ext, (LONG)strlen(ext) + 1, data, iconLocation, NULL)) { @@ -1278,15 +1281,15 @@ void CAssociations::ReadAssociations(BOOL showWaitWnd) { if (enumRet != ERROR_NO_MORE_ITEMS) { - // u jednoho usera (Bernard Vander Beken ) sem prijde - // jedna chyba ERROR_MORE_DATA, a pak spousta ERROR_OUTOFMEMORY, ma Microsoft Windows Server 2003, - // Standard Edition Service Pack 2 (Build 3790), zvetseni bufferu na 10000 nepomaha, nutne - // ukoncit enumeraci uz pri prvni chybe, jinak zacne cyklit a zrat pamet (zrejme jde - // o interni chybu Windowsu), nikdo dalsi to nehlasil, takze to dal neresime + // For one reported user, this returns + // one ERROR_MORE_DATA and then many ERROR_OUTOFMEMORY errors on Microsoft Windows Server 2003, + // Standard Edition Service Pack 2 (Build 3790). Increasing the buffer to 10000 does not help; + // enumeration must be stopped at the first error, otherwise it starts looping and eating memory + // (apparently an internal Windows bug). Nobody else reported it, so we do not investigate further. _snprintf_s(errBuf, _TRUNCATE, LoadStr(IDS_UNABLETOGETASSOC), GetErrorText(enumRet)); SalMessageBox(parent, errBuf, LoadStr(IDS_UNABLETOGETASSOCTITLE), MB_OK | MB_ICONEXCLAMATION); } - break; // konec enumerace + break; // end of enumeration } i++; } @@ -1296,46 +1299,46 @@ void CAssociations::ReadAssociations(BOOL showWaitWnd) { i = 0; while (1) - { // postupne enumnuti vsech pripon + { // enumerate all extensions one by one DWORD extS = MAX_PATH; if (RegEnumKeyEx(explorerFileExts, i, ext, &extS, NULL, NULL, NULL, &ft) == ERROR_SUCCESS) - { // otevreni klice pripony + { // open the extension key if (ext[0] == '.' && HANDLES_Q(RegOpenKey(explorerFileExts, ext, &extKey)) == ERROR_SUCCESS) { - e = ext + 1; // preskok '.' + e = ext + 1; // skip '.' s = ext; while (*++s != 0) *s = LowerCase[*s]; - *(DWORD*)s = 0; // nulovani konce stringu + *(DWORD*)s = 0; // zero the end of the string int index; BOOL found = GetIndex(e, index); if (WindowsVistaAndLater && HANDLES_Q(RegOpenKey(extKey, "UserChoice", &openKey)) == ERROR_SUCCESS) - { // zkusime, jestli neni asociovana pres klic UserChoice, pokud ano, je to neprioritnejsi zaznam, pripadne tedy prepiseme jiz existujici asociaci - size = MAX_PATH; // ziskani typu asociace + { // try whether it is associated through the UserChoice key; if so, it is the highest-priority record, so overwrite any association already found + size = MAX_PATH; // get the association type if (SalRegQueryValueEx(openKey, "Progid", NULL, NULL, (BYTE*)extType, (DWORD*)&size) == ERROR_SUCCESS && size > 1) { - extType[MAX_PATH - 1] = 0; // pro jistotu (hodnota nemusi byt typu string, pak muze chybet null-terminator) + extType[MAX_PATH - 1] = 0; // just in case (the value may not be a string, so the null terminator may be missing) if (GetIconFromAssocAux(TRUE, HKEY_CLASSES_ROOT, extType, (LONG)strlen(extType) + 1, data, iconLocation, type)) { - InsertData("UserChoice: ", index, found, e, s, data, size, iconLocation, type); // found==TRUE znamena prepis jiz nalezene asociace tou z UserChoice + InsertData("UserChoice: ", index, found, e, s, data, size, iconLocation, type); // found==TRUE means overwriting the association already found with the one from UserChoice found = TRUE; } } HANDLES(RegCloseKey(openKey)); } - if (!found) // zkusime jeste, jestli neni asociovana pres klic OpenWithProgids + if (!found) // Check whether it is associated through the OpenWithProgids key { if (WindowsVistaAndLater && HANDLES_Q(RegOpenKey(extKey, "OpenWithProgids", &openKey)) == ERROR_SUCCESS) { DWORD j = 0; - size = MAX_PATH; // ziskani typu asociace + size = MAX_PATH; // get the association type while (RegEnumValue(openKey, j++, extType, (DWORD*)&size, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) - { // postupne enumnuti vsech typu asociaci + { // enumerate all association types one by one if (extType[0] != 0) { - extType[MAX_PATH - 1] = 0; // pro jistotu (hodnota nemusi byt typu string, pak muze chybet null-terminator) + extType[MAX_PATH - 1] = 0; // just in case (the value may not be a string, so the null terminator may be missing) if (GetIconFromAssocAux(TRUE, HKEY_CLASSES_ROOT, extType, (LONG)strlen(extType) + 1, data, iconLocation, type)) { @@ -1344,7 +1347,7 @@ void CAssociations::ReadAssociations(BOOL showWaitWnd) break; } } - size = MAX_PATH; // ziskani typu asociace + size = MAX_PATH; // get the association type } HANDLES(RegCloseKey(openKey)); } @@ -1352,15 +1355,15 @@ void CAssociations::ReadAssociations(BOOL showWaitWnd) if (SalRegQueryValueEx(extKey, "Application", NULL, NULL, NULL, NULL) == ERROR_SUCCESS) { - if (found) // nalezeno, nastavime, ze ma asociaci + if (found) // found, mark that it has an association { CAssociationData* iconData = &(At(index)); - iconData->SetFlag(1); // soubory s touto priponou jdou otevirat - // iconData->SetIndexAll(-1); // prepnuti na statickou ikonu zlobi s CDR a CPT Corelackymi soubory s nahledy v ikonach, radsi nechame ikonu v nastaveni z HKEY_CLASSES_ROOT + iconData->SetFlag(1); // files with this extension can be opened + // iconData->SetIndexAll(-1); // switching to a static icon causes problems for CDR and CPT Corel files with thumbnails in their icons, so leave the icon configured in HKEY_CLASSES_ROOT } - else // nenalezeno, vlozime jako statickou ikonu + else // not found, insert it as a static icon { - data.SetFlag(1); // soubory s touto priponou jdou otevirat + data.SetFlag(1); // files with this extension can be opened data.SetIndexAll(-1); InsertData("FileExts: Application: ", index, FALSE, e, s, data, size, "", ""); @@ -1370,13 +1373,13 @@ void CAssociations::ReadAssociations(BOOL showWaitWnd) } } else - break; // konec enumerace + break; // end of enumeration i++; } HANDLES(RegCloseKey(explorerFileExts)); } - // pridani pevnych ikonek vsech velikosti do cache-bitmap CAssociations + // add fixed icons of all sizes to the CAssociations cache bitmap int iconSize; for (iconSize = 0; iconSize < ICONSIZE_COUNT; iconSize++) { @@ -1440,8 +1443,8 @@ BOOL CAssociations::IsAssociated(char* ext, BOOL& addtoIconCache, CIconSizeEnum { int i = At(index).GetIndex(iconSize); if (i == -1) - At(index).SetIndex(-3, iconSize); // nenactena -> nacitana - addtoIconCache = (i == -1 || i == -2); // dynamicka nebo nenactena/nenacitana staticka + At(index).SetIndex(-3, iconSize); // not loaded -> loading + addtoIconCache = (i == -1 || i == -2); // dynamic or static not loaded/not loading return At(index).GetFlag() != 0; } else @@ -1460,7 +1463,7 @@ BOOL CAssociations::IsAssociatedStatic(char* ext, const char*& iconLocation, CIc if (i == -1) { At(index).SetIndex(-3, iconSize); // nenactena -> nacitana - iconLocation = At(index).ExtensionAndData; // nenactena/nenacitana staticka + iconLocation = At(index).ExtensionAndData; // unloaded static item } else iconLocation = NULL; From d9e6884e09d52bf0621acaa5e71eec2433d6601e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 05:48:05 +0200 Subject: [PATCH 630/710] [translation] Fix src/gui.h comments (#1007) --- src/gui.h | 244 +++++++++++++++++++++++++++--------------------------- 1 file changed, 123 insertions(+), 121 deletions(-) diff --git a/src/gui.h b/src/gui.h index 206ffb89b..a6ae0b77b 100644 --- a/src/gui.h +++ b/src/gui.h @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once @@ -7,18 +8,18 @@ // // CProgressBar // -// Trida je vzdy alokovana (CObjectOrigin origin = ooAllocated) +// The class is always allocated (CObjectOrigin origin = ooAllocated) class CProgressBar : public CWindow { public: - // hDlg je parent window (dialog nebo okno) - // ctrlID je ID child okna + // hDlg is the parent window (dialog or window) + // ctrlID is the child window ID CProgressBar(HWND hDlg, int ctrlID); ~CProgressBar(); - // SetProgress lze volat z libovolneho threadu, vnitrne se zasila WM_USER_SETPROGRESS - // thread progress bary vsak musi bezet + // SetProgress can be called from any thread; internally it posts WM_USER_SETPROGRESS + // the thread progress bars themselves must, however, be running void SetProgress(DWORD progress, const char* text = NULL); void SetProgress2(const CQuadWord& progressCurrent, const CQuadWord& progressTotal, const char* text = NULL); @@ -37,59 +38,59 @@ class CProgressBar : public CWindow protected: int Width, Height; DWORD Progress; - CBitmap* Bitmap; // bitmapa pro memDC -> cache paintu - int BarX; // Xova souradnice obdelniku pro neznamy progress (pro Progress==-1) - BOOL MoveBarRight; // jede obdelnik vpravo? - DWORD SelfMoveTime; // 0: po zavolani SetProgress(-1) se obdelnicek pohne pouze o jeden dilek (0 je implicitni hodnota) - // vic jak 0: cas v [ms], po ktery se jeste budeme hybat po zavolani SetProgress(-1) - DWORD SelfMoveTicks; // ulozena hodnota GetTickCount() behem posledniho zavolani SetSelfMoveTime() - DWORD SelfMoveSpeed; // rychlost pohybu obdelnicku: hodnota je v [ms] a udava cas, po kterem se obdelnicek pohne - // minimum je 10ms, default hodnota je 50ms -- tedy 20 posunu za vterinu - // pozor na nizke hodnoty, samotna animace pak dokaze znatelne vytizit procesor - BOOL TimerIsRunning; // bezi timer? - char* Text; // pokud je ruzny od NULL, bude zobrazen misto cisla - HFONT HFont; // font pro progress bar + CBitmap* Bitmap; // bitmap for memDC -> paint cache + int BarX; // X coordinate of the rectangle for unknown progress (for Progress == -1) + BOOL MoveBarRight; // is the rectangle moving to the right? + DWORD SelfMoveTime; // 0: after calling SetProgress(-1), the rectangle moves by only one step (0 is the default value) + // >0: time in [ms] for which it continues moving after SetProgress(-1) is called + DWORD SelfMoveTicks; // stored GetTickCount() value from the last call to SetSelfMoveTime() + DWORD SelfMoveSpeed; // rectangle movement speed: the value is in [ms] and specifies after what time the rectangle moves + // the minimum is 10 ms, the default value is 50 ms, i.e. 20 moves per second + // beware of low values, the animation itself can then noticeably load the CPU + BOOL TimerIsRunning; // is the timer running? + char* Text; // if not NULL, it is displayed instead of the number + HFONT HFont; // font for the progress bar }; //**************************************************************************** // // CStaticText // -// Trida je vzdy alokovana (CObjectOrigin origin = ooAllocated) +// The class is always allocated (CObjectOrigin origin = ooAllocated) class CStaticText : public CWindow { public: - // hDlg je parent window (dialog nebo okno) - // ctrlID je ID child okna - // flags je kombinaci hodnot z rodiny STF_* (shared\spl_gui.h) + // hDlg is the parent window (dialog or window) + // ctrlID is the child window ID + // flags is a combination of values from the STF_* family (shared\spl_gui.h) CStaticText(HWND hDlg, int ctrlID, DWORD flags); ~CStaticText(); - // nastavi Text, vraci TRUE pri uspechu a FALSE pri nedostatku pameti + // sets Text; returns TRUE on success and FALSE if memory is insufficient BOOL SetText(const char* text); - // pozor, vraceny Text muze byt NULL + // note: the returned Text may be NULL const char* GetText() { return Text; } - // nastavi Text (pokud zacina nebo konci na mezeru, da do dvojitych uvozovek), - // vraci TRUE pri uspechu a FALSE pri nedostatku pameti + // sets Text (if it starts or ends with a space, it is wrapped in double quotes), + // returns TRUE on success and FALSE if memory is insufficient BOOL SetTextToDblQuotesIfNeeded(const char* text); - // na nekterych filesystemech muze byt jiny oddelovac casti cesty - // musi byt ruzny od '\0'; + // some filesystems may use a different path-component separator + // it must be different from '\0' void SetPathSeparator(char separator); - // priradi text, ktery bude zobrazen jako tooltip + // assigns the text that will be shown as the tooltip BOOL SetToolTipText(const char* text); - // priradi okno a id, kteremu se pri zobrazeni tooltipu zasle WM_USER_TTGETTEXT + // assigns the window and ID to which WM_USER_TTGETTEXT is sent when the tooltip is shown void SetToolTip(HWND hNotifyWindow, DWORD id); - // pokud je nastaveno na TRUE, tooltip lze vyvolat kliknutim na text nebo - // stisknutim klaves Up/Down/Space, ma-li control focus - // tootltip se pak zobrazi tesne pod textem a zustane zobrazen - // implicitne je nastaveno na FALSE + // if set to TRUE, the tooltip can be triggered by clicking the text or + // pressing Up/Down/Space when the control has focus + // the tooltip is then shown just below the text and remains visible + // by default it is set to FALSE void EnableHintToolTip(BOOL enable); // void UpdateControl(); @@ -100,37 +101,37 @@ class CStaticText : public CWindow void PrepareForPaint(); BOOL TextHitTest(POINT* screenCursorPos); - int GetTextXOffset(); // na zaklade promennych Alignment, Width a TextWidth vraci X posunuti textu + int GetTextXOffset(); // returns the X text offset based on Alignment, Width, and TextWidth void DrawFocus(HDC hDC); BOOL ToolTipAssigned(); BOOL ShowHint(); - DWORD Flags; // flagy pro chovani controlu - char* Text; // alokovany text - int TextLen; // delka retezce - char* Text2; // alokovany text obshujici vypustku; pouziva se se pouze s STF_END_ELLIPSIS nebo STF_PATH_ELLIPSIS - int Text2Len; // delka Text2 - int* AlpDX; // pole delek substringu; pouziva se se pouze s STF_END_ELLIPSIS nebo STF_PATH_ELLIPSIS - int TextWidth; // sirka textu v bodech - int TextHeight; // vyska textu v bodech - int Allocated; // velikost alokovaneho bufferu 'Text' a 'AlpDX' - int Width, Height; // rozmery staticu - CBitmap* Bitmap; // cache pro kresleni; pouziva se pouze s STF_CACHED_PAINT - HFONT HFont; // handlu fontu pouzivany ro kresleni textu - BOOL DestroyFont; // pokud je HFont alokovany, je TRUE, jinak je FALSE - BOOL ClipDraw; // je treba clipnout kresleni, protoze bychom vylezli ven - BOOL Text2Draw; // budeme kreslit z bufferu obsahujici vypustku + DWORD Flags; // flags controlling the control behavior + char* Text; // allocated text + int TextLen; // string length + char* Text2; // allocated text containing the ellipsis; used only with STF_END_ELLIPSIS or STF_PATH_ELLIPSIS + int Text2Len; // length of Text2 + int* AlpDX; // array of substring lengths; used only with STF_END_ELLIPSIS or STF_PATH_ELLIPSIS + int TextWidth; // text width in pixels + int TextHeight; // text height in pixels + int Allocated; // size of the allocated buffer for 'Text' and 'AlpDX' + int Width, Height; // dimensions of the static control + CBitmap* Bitmap; // drawing cache; used only with STF_CACHED_PAINT + HFONT HFont; // font handle used for drawing the text + BOOL DestroyFont; // if HFont is allocated, it is TRUE; otherwise it is FALSE + BOOL ClipDraw; // drawing must be clipped because it would go outside otherwise + BOOL Text2Draw; // the buffer containing the ellipsis will be drawn int Alignment; // 0=left, 1=center, 2=right - char PathSeparator; // oddelovac casti cesty; implicitne '\\' - BOOL MouseIsTracked; // instalovali jsme hlidani opusteni mysi - // podpora pro tooltips - char* ToolTipText; // retezec, ktery bude zobrazen jako nas tooltip - HWND HToolTipNW; // notifikacni okno - DWORD ToolTipID; // a ID pod kterym se ma tool tip dotazat na text - BOOL HintMode; // mame tooltip zobrazovat jako Hint? - WORD UIState; // zobrazovani akceleratoru + char PathSeparator; // path-component separator; '\\' by default + BOOL MouseIsTracked; // we enabled mouse-leave tracking + // tooltip support + char* ToolTipText; // string that will be shown as our tooltip + HWND HToolTipNW; // notification window + DWORD ToolTipID; // and the ID under which the tooltip should ask for the text + BOOL HintMode; // should the tooltip be shown as a Hint? + WORD UIState; // accelerator display state }; //**************************************************************************** @@ -141,9 +142,9 @@ class CStaticText : public CWindow class CHyperLink : public CStaticText { public: - // hDlg je parent window (dialog nebo okno) - // ctrlID je ID child okna - // flags je kombinaci hodnot z rodiny STF_* (shared\spl_gui.h) + // hDlg is the parent window (dialog or window) + // ctrlID is the child window ID + // flags is a combination of values from the STF_* family (shared\spl_gui.h) CHyperLink(HWND hDlg, int ctrlID, DWORD flags = STF_UNDERLINE | STF_HYPERLINK_COLOR); void SetActionOpen(const char* file); @@ -156,8 +157,8 @@ class CHyperLink : public CStaticText BOOL ExecuteIt(); protected: - char File[MAX_PATH]; // pokud je ruzny od 0, predava se do ShellExecute - WORD Command; // pokud je ruzny od 0, posti se pri akci + char File[MAX_PATH]; // if not zero, it is passed to ShellExecute + WORD Command; // if not zero, it is posted on action HWND HDialog; // parent dialog }; @@ -165,8 +166,8 @@ class CHyperLink : public CStaticText // // CColorRectangle // -// vykresli celou plochu objektu barvou Color -// kombinovat s WS_EX_CLIENTEDGE +// paints the entire object area with Color +// combine with WS_EX_CLIENTEDGE // class CColorRectangle : public CWindow @@ -231,24 +232,24 @@ class CButton : public CWindow BOOL Captured; BOOL Space; RECT ClientRect; - // podpora pro tooltips - BOOL MouseIsTracked; // instalovali jsme hlidani opusteni mysi - char* ToolTipText; // retezec, ktery bude zobrazen jako nas tooltip - HWND HToolTipNW; // notifikacni okno - DWORD ToolTipID; // a ID pod kterym se ma tool tip dotazat na text - DWORD DropDownUpTime; // cas v [ms], kdy byl odmackunt drop down, pro ochranu pred novym zamacknutim - // podpora pro XP Theme + // tooltip support + BOOL MouseIsTracked; // we enabled mouse-leave tracking + char* ToolTipText; // string that will be shown as our tooltip + HWND HToolTipNW; // notification window + DWORD ToolTipID; // and the ID under which the tooltip should ask for the text + DWORD DropDownUpTime; // time in [ms] when the drop-down was released, to guard against a new press + // XP Theme support BOOL Hot; - WORD UIState; // zobrazovani akceleratoru + WORD UIState; // accelerator display state public: CButton(HWND hDlg, int ctrlID, DWORD flags, CObjectOrigin origin = ooAllocated); ~CButton(); - // priradi text, ktery bude zobrazen jako tooltip + // assigns the text that will be shown as the tooltip BOOL SetToolTipText(const char* text); - // priradi okno a id, kteremu se pri zobrazeni tooltipu zasle WM_USER_TTGETTEXT + // assigns the window and ID to which WM_USER_TTGETTEXT is sent when the tooltip is shown void SetToolTip(HWND hNotifyWindow, DWORD id); DWORD GetFlags(); @@ -259,7 +260,7 @@ class CButton : public CWindow virtual void PaintFace(HDC hdc, const RECT* rect, BOOL enabled); - int HitTest(LPARAM lParam); // vraci 0: nikde; 1: tlacitko; 2: drop down + int HitTest(LPARAM lParam); // returns 0: nowhere; 1: button; 2: drop-down void PaintFrame(HDC hDC, const RECT* r, BOOL down); void PaintDrop(HDC hDC, const RECT* r, BOOL enabled); int GetDropPartWidth(); @@ -274,7 +275,7 @@ class CButton : public CWindow // // CColorArrowButton // -// pozadi s textem, za kterym je jeste sipka - slouzi pro rozbaleni menu +// background with text followed by an arrow; used to expand the menu // class CColorArrowButton : public CButton @@ -320,9 +321,9 @@ class CToolbarHeader : public CWindow HIMAGELIST HHotImageList; HIMAGELIST HGrayImageList; #endif - DWORD ButtonMask; // pouzita tlacitka - HWND HNotifyWindow; // kam posilam comandy - WORD UIState; // zobrazovani akceleratoru + DWORD ButtonMask; // buttons in use + HWND HNotifyWindow; // where commands are sent + WORD UIState; // accelerator display state public: CToolbarHeader(HWND hDlg, int ctrlID, HWND hAlignWindow, DWORD buttonMask); @@ -350,50 +351,50 @@ class CToolbarHeader : public CWindow class CAnimate: public CWindow { protected: - HBITMAP HBitmap; // bitmapa ze ktere tahame jednotliva policka animace - int FramesCount; // pocet policek v bitmape - int FirstLoopFrame; // pokud jedeme ve smycce, z konce prechazime na toto policko - SIZE FrameSize; // rozmer policka v bodech - CRITICAL_SECTION GDICriticalSection; // kriticka sekce pro pristup ke GDI prostredkum - CRITICAL_SECTION DataCriticalSection; // kriticka sekce pro pristup k datum + HBITMAP HBitmap; // bitmap from which we take the individual animation frames + int FramesCount; // number of frames in the bitmap + int FirstLoopFrame; // when looping, we jump from the end back to this frame + SIZE FrameSize; // frame size in pixels + CRITICAL_SECTION GDICriticalSection; // critical section for access to GDI resources + CRITICAL_SECTION DataCriticalSection; // critical section for data access HANDLE HThread; - HANDLE HRunEvent; // pokud je signed, animacni thread bezi - HANDLE HTerminateEvent; // pokud je signed, thread se ukonci + HANDLE HRunEvent; // if signed, the animation thread is running + HANDLE HTerminateEvent; // if signed, the thread terminates COLORREF BkColor; - // ridici promenne, prijdou ke slovu kdyz HRunEvent signed - BOOL SleepThread; // thread se ma uspat, HRunEvent bude resetnut + // control variables used when HRunEvent is signed + BOOL SleepThread; // the thread should sleep, HRunEvent will be reset - int CurrentFrame; // zero-based index prave zobrazeneho policka + int CurrentFrame; // zero-based index of the currently displayed frame int NestedCount; - BOOL MouseIsTracked; // instalovali jsme hlidani opusteni mysi + BOOL MouseIsTracked; // we enabled mouse-leave tracking public: - // 'hBitmap' je bitmapa ze ktere vykreslujeme policka pri animaci; - // policka musi byt pod sebou a musi mit konstantni vysku - // 'framesCount' udava celkovy pocet policek v bitmape - // 'firstLoopFrame' zero-based index policka, kam se pri cyklicke - // animaci vracime po dosazeni konce + // 'hBitmap' is the bitmap from which we draw the frames during animation; + // the frames must be stacked vertically and must have constant height + // 'framesCount' specifies the total number of frames in the bitmap + // 'firstLoopFrame' zero-based frame index to which we return after reaching + // the end during cyclic animation CAnimate(HBITMAP hBitmap, int framesCount, int firstLoopFrame, COLORREF bkColor, CObjectOrigin origin = ooAllocated); - BOOL IsGood(); // dopadnul dobre konstruktor? + BOOL IsGood(); // did the constructor complete successfully? - void Start(); // pokud neanimujeme, zacneme - void Stop(); // zastavi animaci a zobrazi uvodni policko - void GetFrameSize(SIZE *sz); // vraci rozmer v bodech potrebny pro zobrazeni policka + void Start(); // if not animating, start it + void Stop(); // stops the animation and shows the initial frame + void GetFrameSize(SIZE *sz); // returns the size in pixels needed to display a frame protected: virtual LRESULT WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam); - void Paint(HDC hdc = NULL); // zobraz soucasne policko; pokud je hdc NULL, vytahni si DC okna - void FirstFrame(); // nastav Frame na uvodni policko - void NextFrame(); // nastav Frame na dalsi policko; preskakuj uvodni sekvenci + void Paint(HDC hdc = NULL); // displays the current frame; if hdc is NULL, obtain the window DC + void FirstFrame(); // sets Frame to the initial frame + void NextFrame(); // sets Frame to the next frame; skip the initial sequence - // tela threadu + // thread bodies static unsigned ThreadF(void *param); static unsigned AuxThreadEH(void *param); static DWORD WINAPI AuxThreadF(void *param); - // ThreadF bude friend, aby mohl pristupovat na nase data + // ThreadF is a friend so it can access our data friend static unsigned ThreadF(void *param); }; */ @@ -416,51 +417,52 @@ BOOL ChangeToIconButton(HWND hParent, int ctrlID, int iconID); // **************************************************************************** // VerticalAlignChildToChild // -// slouzi k zarovnani "browse" tlacitka za editline / combobox (v resource workshopu je problem se trefit s tlacitkem za combobox) -// upravi velikost a pozici child okna 'alignID' tak, aby sedelo ve stejne vysce (a bylo stejne vysoke) jako child 'toID' +// used to align the "browse" button next to an edit line / combobox +// (in Resource Workshop it is hard to place the button correctly next to a combobox) +// adjusts the size and position of child window 'alignID' so that it sits at the same height +// (and has the same height) as child 'toID' void VerticalAlignChildToChild(HWND hParent, int alignID, int toID); // // **************************************************************************** // CondenseStaticTexts // -// sesune static texty tak, ze budou tesne navazovat - vzdalenost mezi nimi bude -// sire mezery dialog fontu; 'staticsArr' je pole IDcek staticu ukoncene nulou +// moves static texts so that they follow each other closely; the distance between them +// will equal the width of a space in the dialog font; 'staticsArr' is an array of static IDs terminated by zero void CondenseStaticTexts(HWND hWindow, int* staticsArr); // // **************************************************************************** // ArrangeHorizontalLines // -// najde horizontalni cary a dorazi je zprava na text, na ktery navazuji -// navic najde checkboxy a radioboxy, ktere tvori labely groupboxum a zkrati -// je podle jejich textu a aktualniho pisma v dialogu (eliminuje zbytecne -// mezery vznikle kvuli ruznym DPI obrazovky) +// finds horizontal lines and extends them from the right up to the text they follow +// it also finds checkboxes and radio buttons that serve as groupbox labels and shortens +// them according to their text and the current dialog font (eliminating unnecessary +// gaps caused by different display DPI settings) void ArrangeHorizontalLines(HWND hWindow); // // **************************************************************************** // GetWindowFontHeight // -// pro hWindow ziska aktualni font a vrati jeho vysku +// gets the current font for hWindow and returns its height int GetWindowFontHeight(HWND hWindow); // // **************************************************************************** // GetWindowFontHeight // -// vytvori imagelist obsahujici dva stavy checkboxu (unchecked a checked) -// a vrati jeho handle; 'itemSize' je sirka a vyska jedne polozky v bodech +// creates an imagelist containing the two checkbox states (unchecked and checked) +// and returns its handle; 'itemSize' is the width and height of one item in pixels HIMAGELIST CreateCheckboxImagelist(int itemSize); // // **************************************************************************** // SalLoadIcon // -// nacte ikonu urcenou 'hInst' a 'iconName', vrati jeji handle nebo NULL v pripade -// chyby; 'iconSize' udava pozadovanou velikost ikony; funkce je High DPI ready -// a vrati jeho handle; 'itemSize' je sirka a vyska jedne polozky v bodech +// loads the icon specified by 'hInst' and 'iconName' and returns its handle, or NULL on error; +// 'iconSize' specifies the requested icon size; the function is High DPI ready // -// Poznamka: stare API LoadIcon() neumi ikony vetsich velikosti, proto zavadime tuto -// funkci, ktera cte ikony pomoci noveho LoadIconWithScaleDown() +// Note: the old LoadIcon() API cannot handle larger icon sizes, so we introduce this +// function, which loads icons using the newer LoadIconWithScaleDown() HICON SalLoadIcon(HINSTANCE hInst, LPCTSTR iconName, CIconSizeEnum iconSize); From 2ec73371051db0338dd89dd90842ae9c5ca4a0ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 05:48:09 +0200 Subject: [PATCH 631/710] [translation] Fix src/iconlist.h comments (#1008) --- src/iconlist.h | 206 +++++++++++++++++++++++++------------------------ 1 file changed, 105 insertions(+), 101 deletions(-) diff --git a/src/iconlist.h b/src/iconlist.h index 26e170e87..04e14f112 100644 --- a/src/iconlist.h +++ b/src/iconlist.h @@ -1,24 +1,28 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once /************************************************************************************ -Co lze vytahnout z HICON, ktere nam dodava OS? +What can we extract from the HICON handles provided by the OS? - Pomoci GetIconInfo() nam OS vrati kopie bitmap MASK a COLOR. Ty lze dale - zkoumat volanim GetObject(), pomoci ktere vytahneme geometrii a bervne usporadani. - Jedna se o kopie bitmap, nikoliv o bitmapy originalni, drzene uvnitr OS. MASK je - vzdy 1bitova bitmapa. COLOR je bitmapa kompatibilni s DC obrazovky. Neexistuje tedy - zpusob, jak z techto dat ziskat informace o realne barevne hloubce bitmapy COLOR. + Using GetIconInfo(), the OS returns copies of the MASK and COLOR bitmaps. We can + inspect them further with GetObject(), which lets us obtain their geometry and + color layout. These are bitmap copies, not the original bitmaps held inside the OS. + MASK is always a 1-bit bitmap. COLOR is a bitmap compatible with the screen DC. + There is therefore no way to determine the real color depth of the COLOR bitmap + from this data. - Specialni pripad jsou ikony ciste cernobile. Ty jsou predany cele v MASK, ktera - je pak 2x vyssi. COLOR je pak NULL. Horni polovina MASK bitmapy AND cast a spodni - polovina je XOR cast. Tento pripad lze snadno detekovat pomoci testu COLOR == NULL. + A special case is fully monochrome icons. They are passed entirely in MASK, which + is then twice as tall. COLOR is NULL in that case. The upper half of the MASK + bitmap is the AND part and the lower half is the XOR part. This case can be + detected easily by testing COLOR == NULL. - Od Windows XP existuje dalsi specialni pripad: ikony obsahujici ALFA kanal. Jedna - s o DIBy s barevnou hloubkou 32bitu, kde je kazdy bod slozen z ARGB slozek. + Since Windows XP there has been another special case: icons containing an alpha + channel. These are DIBs with 32-bit color depth, where each pixel consists of + ARGB components. @@ -28,52 +32,52 @@ Co lze vytahnout z HICON, ktere nam dodava OS? ************************************************************************************/ // -// Existuje potencialni prostor pro optimalizaci nasi implementace ImageListu. -// DIB bychom mohli drzet ve stejnem formatu, ve kterem jede obrazovka. BitBlt -// je potom udajne rychlejsi (neoveroval jsem) podle MSDN: +// There is potential room to optimize our ImageList implementation. +// We could keep the DIB in the same format as the display. According to MSDN, +// BitBlt is then reportedly faster, although I did not verify that: // http://support.microsoft.com/default.aspx?scid=kb;EN-US;230492 // (HOWTO: Retrieving an Optimal DIB Format for a Device) // -// Proti teto optimalizaci mluvi nekolik faktoru: -// - museli bychom v kodu podporit ruzne formaty dat (15, 16, 24, 32 bitu) -// - protoze vykreslujeme soucasne maximalne desitky ikonek, neni pro -// nas rychlost kresleni kriticka; nameril jsem tyto rychlosti kresleni: -// (100 000 krat se do obrazovky kreslil pres BitBlt DIB 16x16, 32bpp) -// rozliseni obrazovky celkova doba (W2K, Matrox G450) -// 32 bpp 0.40 s -// 24 bpp 0.80 s -// 16 bpp 0.65 s -// 8 bpp 1.16 s -// - Nejak bychom stejne museli drzet ikonky s ALFA kanalem, ktere jsou 32 bpp +// Several factors argue against that optimization: +// - we would have to support different data formats in the code (15, 16, 24, 32 bits) +// - because we draw at most a few dozen icons at once, drawing speed is not critical +// for us; I measured the following drawing speeds: +// (a 16x16, 32bpp DIB was drawn to the screen via BitBlt 100,000 times) +// screen resolution total time (W2K, Matrox G450) +// 32 bpp 0.40 s +// 24 bpp 0.80 s +// 16 bpp 0.65 s +// 8 bpp 1.16 s +// - we would still somehow need to keep icons with an ALPHA channel, which are 32 bpp // // -// Proc potrebujeme vlastni obdobu ImageList: +// Why do we need our own ImageList equivalent: // -// ImageList z CommonControls ma jeden zasadni problem: pokud jej pozadame, -// aby drzel DeviceDependentBitmapy, neumi zobrazit blendenou polozku. Misto -// toho ji sjede paternem. +// The CommonControls ImageList has one major problem: if we ask it to keep +// DeviceDependentBitmaps, it cannot display a blended item. Instead, it fills +// it with a pattern. // -// Pokud je drzena bitmapa DIB, blendeni slape skvele, ale vykresleni -// klasicke polozky je radove pomalejsi (konverze DIB->obrazovka). +// If a DIB bitmap is stored, blending works great, but drawing a normal item +// is orders of magnitude slower (DIB -> screen conversion). // -// Dale existuje riziko, ze v nekterych implementacich volani ImageList_SetBkColor -// fyzicky nezmeni drzenou bitmapu na zaklade masky, ale pouze nastavi vnitrni -// promennou. Samozrejme je pak kresleni pomalejsi, protoze je treba provadet -// maskovani. Testoval jsem pod W2K a funkce chodi spravne. +// There is also a risk that in some implementations, calling ImageList_SetBkColor +// does not physically modify the stored bitmap using the mask, but only updates an +// internal variable. Drawing is then naturally slower because masking has to be +// performed. I tested this under W2K and the function behaves correctly there. // -// Jedina moznost by byla v zachovani ImageListu pro drzeni dat a pouze blend -// preprogramovat. Problem ale nastava ve funkci ImageList_GetImageInfo, ktera -// umoznuje pristup k vnitrnim bitmapam Image/Mask. ImageList je ma neustale -// vybrane v MemDC, takze podle MSDN (Q131279: SelectObject() Fails After -// ImageList_GetImageInfo()) je jedinou moznosti napred volat CopyImage a teprve -// potom nad bitmapou pracovat. To by vedlo ne neskutecne pomale kresleni -// blendenych polozek. +// The only option would be to keep ImageList for data storage and reimplement only +// blending. The problem appears in ImageList_GetImageInfo, which provides access +// to the internal Image/Mask bitmaps. ImageList keeps them permanently selected in +// MemDC, so according to MSDN (Q131279: SelectObject() Fails After +// ImageList_GetImageInfo()) the only option is to call CopyImage first and only +// then work with the bitmap. That would lead to unbearably slow drawing of blended +// items. // -// Dalsim oriskem jsou pro ImageList ikony invert body. Ikona se sklada ze -// dvou bitmap: MASKA a COLORS. Maska se ANDuje do cile a pres ni se XORuji barvy. -// Diky XORovani tak muzou ikonky invertovat nektere sve casti. Vyuzivaji toho -// predevsim kurzory, viz WINDOWS\Cursors. +// Another difficulty for ImageList is icons with inverted pixels. An icon consists +// of two bitmaps: MASK and COLORS. The mask is AND-ed into the target and then the +// colors are XOR-ed through it. Thanks to XOR, icons can invert some of their +// parts. This is used mainly by cursors, see WINDOWS\\Cursors. // //****************************************************************************** @@ -81,79 +85,79 @@ Co lze vytahnout z HICON, ktere nam dodava OS? // CIconList // // -// Po vzoru W2K drzime polozky v bitmape siroke 4 polozky. Pravdepodobne -// budou operace nad takto orientovanou bitmapu rychlejsi. +// Following the W2K model, we keep items in a bitmap four items wide. Operations +// on a bitmap arranged like this will probably be faster. -#define IL_DRAW_BLEND 0x00000001 // z 50% bude pouzita barva blendClr -#define IL_DRAW_TRANSPARENT 0x00000002 // pri kresleni se zachova puvodni pozadi (pokud neni specifikovano, pouzije vyplni se pozadi definovanou barvou) -#define IL_DRAW_ASALPHA 0x00000004 // pouzije (invertovanou) barvu v BLUE kanalu jako alpha, pomoci ktere k pozadi primicha specifikovanou barvu popredi; zatim slouzi pro throbber -#define IL_DRAW_MASK 0x00000010 // vykreslit masku +#define IL_DRAW_BLEND 0x00000001 // blendClr will be used at 50% +#define IL_DRAW_TRANSPARENT 0x00000002 // drawing preserves the original background (unless specified otherwise, the background is filled with the defined color) +#define IL_DRAW_ASALPHA 0x00000004 // uses the (inverted) color in the BLUE channel as alpha, with which it mixes the specified foreground color into the background; currently used for the throbber +#define IL_DRAW_MASK 0x00000010 // draw the mask class CIconList : public CGUIIconListAbstract { private: - int ImageWidth; // rozmery jednoho obrazku + int ImageWidth; // dimensions of one image int ImageHeight; - int ImageCount; // pocet obrazku v bitmape - int BitmapWidth; // rozmery drzenych bitmap + int ImageCount; // number of images in the bitmap + int BitmapWidth; // dimensions of the stored bitmaps int BitmapHeight; - // obrazky jsou usporadany zleva doprava a shora dolu - HBITMAP HImage; // DIB, jeho raw data jsou v promenne ImageRaw - DWORD* ImageRaw; // ARGB hodnoty; Alfa: 0x00=pruhledna, 0xFF=nepruhledna, ostatni=castecna_pruhlednost(puze u IL_TYPE_ALPHA) - BYTE* ImageFlags; // pole o poctu prvku 'imageCount'; (IL_TYPE_xxx) + // images are laid out from left to right and top to bottom + HBITMAP HImage; // DIB; its raw data is in the ImageRaw variable + DWORD* ImageRaw; // ARGB values; Alpha: 0x00 = transparent, 0xFF = opaque, others = partial transparency (only for IL_TYPE_ALPHA) + BYTE* ImageFlags; // array with 'imageCount' elements; (IL_TYPE_xxx) - COLORREF BkColor; // aktualni barva pozadi (body kde je Alfa==0x00) + COLORREF BkColor; // current background color (pixels where Alpha == 0x00) - // sdilene promenne pres vsechny imagelisty -- setrime pameti - static HDC HMemDC; // sdilene mem dc - static HBITMAP HOldBitmap; // puvodni bitmapa - static HBITMAP HTmpImage; // cache pro paint + docasne uloziste masky - static DWORD* TmpImageRaw; // raw data od HTmpImage - static int TmpImageWidth; // rozmery HTmpImage v bodech - static int TmpImageHeight; // rozmery HTmpImage v bodech - static int MemDCLocks; // pro destrukci mem dc - static CRITICAL_SECTION CriticalSection; // synchronizace pristupu - static int CriticalSectionLocks; // pro konstrukci/destrukci CriticalSection + // shared variables across all image lists -- saves memory + static HDC HMemDC; // shared memory DC + static HBITMAP HOldBitmap; // original bitmap + static HBITMAP HTmpImage; // paint cache + temporary mask storage + static DWORD* TmpImageRaw; // raw data from HTmpImage + static int TmpImageWidth; // dimensions of HTmpImage in pixels + static int TmpImageHeight; // dimensions of HTmpImage in pixels + static int MemDCLocks; // for destroying the memory DC + static CRITICAL_SECTION CriticalSection; // access synchronization + static int CriticalSectionLocks; // for constructing/destroying CriticalSection public: - // BOOL Dump; // pokud je TRUE, dumpuji se raw data do TRACE + // BOOL Dump; // if TRUE, raw data is dumped to TRACE public: CIconList(); ~CIconList(); virtual BOOL WINAPI Create(int imageWidth, int imageHeight, int imageCount); - virtual BOOL WINAPI CreateFromImageList(HIMAGELIST hIL, int requiredImageSize = -1); // pokud je 'requiredImageSize' -1, pouzije se geometrie z hIL - virtual BOOL WINAPI CreateFromPNG(HINSTANCE hInstance, LPCTSTR lpBitmapName, int imageWidth); // nacte z resourcu PNG, musi jit o dlouhy prouzek jeden radek vysoky + virtual BOOL WINAPI CreateFromImageList(HIMAGELIST hIL, int requiredImageSize = -1); // if 'requiredImageSize' is -1, the geometry from hIL is used + virtual BOOL WINAPI CreateFromPNG(HINSTANCE hInstance, LPCTSTR lpBitmapName, int imageWidth); // loads PNG from resources; it must be a long strip one row high virtual BOOL WINAPI CreateFromRawPNG(const void* rawPNG, DWORD rawPNGSize, int imageWidth); - virtual BOOL WINAPI CreateFromBitmap(HBITMAP hBitmap, int imageCount, COLORREF transparentClr); // nasosne bitmapu (maximalne 256 barev), musi jit o dlouhy prouzek jeden radek vysoky + virtual BOOL WINAPI CreateFromBitmap(HBITMAP hBitmap, int imageCount, COLORREF transparentClr); // accepts a bitmap (up to 256 colors); it must be a long strip one row high virtual BOOL WINAPI CreateAsCopy(const CIconList* iconList, BOOL grayscale); virtual BOOL WINAPI CreateAsCopy(const CGUIIconListAbstract* iconList, BOOL grayscale); - // prevede icon list na cernobilou verzi + // converts the icon list to a grayscale version virtual BOOL WINAPI ConvertToGrayscale(BOOL forceAlphaForBW); - // zakomprimuje bitmapu do 32bitoveho PNG a alfa kanalem (jeden dlouhy radek) - // pokud se vse podari, vraci TRUE a ukazatel na alokovanou pamet, kterou je nutne potom dealokovat - // pri chybe vraci FALSE + // compresses the bitmap into a 32-bit PNG with an alpha channel (one long row) + // on success, returns TRUE and a pointer to allocated memory that must later be freed + // on error, returns FALSE virtual BOOL WINAPI SaveToPNG(BYTE** rawPNG, DWORD* rawPNGSize); virtual BOOL WINAPI ReplaceIcon(int index, HICON hIcon); - // vytvori ikonku z pozice 'index'; vraci jeji handle nebo NULL v pripade neuspechu - // vracenou ikonu je po pouziti treba destruovat pomoci API DestroyIcon + // creates an icon from position 'index'; returns its handle or NULL on failure + // the returned icon must be destroyed after use with the DestroyIcon API virtual HICON WINAPI GetIcon(int index); HICON GetIcon(int index, BOOL useHandles); - // vytvori imagelist (jeden radek, pocet sloupcu dle poctu polozek); vraci jeho handle nebo NULL v pripade neuspechu - // vraceny imagelist je po pouziti treba destruovat pomoci API ImageList_Destroy() + // creates an image list (one row, with the number of columns based on the number of items); returns its handle or NULL on failure + // the returned image list must be destroyed with the ImageList_Destroy() API after use virtual HIMAGELIST WINAPI GetImageList(); - // kopiruje jednu polozku ze 'srcIL' a pozice 'srcIndex' na pozici 'dstIndex' + // copies one item from 'srcIL' at position 'srcIndex' to position 'dstIndex' virtual BOOL WINAPI Copy(int dstIndex, CIconList* srcIL, int srcIndex); - // kopiruje jednu polozku z pozice 'srcIndex' do 'hDstImageList' na pozici 'dstIndex' + // copies one item from position 'srcIndex' into 'hDstImageList' at position 'dstIndex' // BOOL CopyToImageList(HIMAGELIST hDstImageList, int dstIndex, int srcIndex); virtual BOOL WINAPI Draw(int index, HDC hDC, int x, int y, COLORREF blendClr, DWORD flags); @@ -162,24 +166,24 @@ class CIconList : public CGUIIconListAbstract virtual COLORREF WINAPI GetBkColor(); private: - // pokud neexistuje, vytvori HTmpImage - // pokud HTmpImage existuje a je mensi nez 'width' x 'height', vytvori novy - // vraci TRUE v pripade uspechu, jinak vraci FALSE a zachovava minuly HTmpImage + // creates HTmpImage if it does not exist + // if HTmpImage exists and is smaller than 'width' x 'height', creates a new one + // returns TRUE on success; otherwise returns FALSE and keeps the previous HTmpImage BOOL CreateOrEnlargeTmpImage(int width, int height); - // vraci handle bitmapy prave vybrane v HMemDC - // pokud HMemDC neexistuje, vraci NULL + // returns the handle of the bitmap currently selected in HMemDC + // if HMemDC does not exist, returns NULL HBITMAP GetCurrentBitmap(); - // 'index' urcuje pozici ikonky v HImage - // vraci TRUE, pokud v obrazek 'index' v HImage obsahoval alfa kanal + // 'index' specifies the icon position in HImage + // returns TRUE if image 'index' in HImage contained an alpha channel BYTE ApplyMaskToImage(int index, BYTE forceXOR); - // pro ladici ucely -- zobrazi dump ARGB hodnot barevne bitmapy i masky + // for debugging purposes -- shows a dump of the ARGB values of both the color bitmap and the mask // void DumpToTrace(int index, BOOL dumpMask); - // renderovani bod po bodu a nasledny BitBlt je v RELEASE verzi - // pouze o 30% pomalejsi proti cistemu BitBlt + // point-by-point rendering followed by BitBlt is in the RELEASE build + // only about 30% slower than a plain BitBlt BOOL DrawALPHA(HDC hDC, int x, int y, int index, COLORREF bkColor); BOOL DrawXOR(HDC hDC, int x, int y, int index, COLORREF bkColor); @@ -190,13 +194,13 @@ class CIconList : public CGUIIconListAbstract void StoreMonoIcon(int index, WORD* mask); - // specialni podpurna funkce pro CreateFromBitmap(); nakopiruj z 'hSrcBitmap' - // zvoleny pocet polozek do 'dstIndex'; predpoklada, ze 'hSrcBitmap' bude dlouhy - // prouzek ikon, jeden radek vysoky - // transparentClr udava barvu, ktera se ma povazovat za pruhlednou - // predpoklada se, ze zdrojova bitmapa ma stejny rozmer ikonek jako ma cilova (ImageWidth, ImageHeight) - // jednim kopirovanim lze pracovat maximalne s jednim radkem cilove bitmapy, - // nelze napriklad nakopirovat data do dvou radku v cilove bitmape + // special helper for CreateFromBitmap(); copies the selected number of items + // from 'hSrcBitmap' into 'dstIndex'; assumes 'hSrcBitmap' is a long strip of + // icons one row high + // transparentClr specifies the color to be considered transparent + // assumes the source bitmap has the same icon dimensions as the target one (ImageWidth, ImageHeight) + // a single copy operation can work with at most one row of the target bitmap; + // for example, it cannot copy data into two rows in the target bitmap BOOL CopyFromBitmapIternal(int dstIndex, HBITMAP hSrcBitmap, int srcIndex, int imageCount, COLORREF transparentClr); }; From c97f969cfd68c903027a4abdca9f3ac9b898a98d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 05:48:13 +0200 Subject: [PATCH 632/710] [translation] Fix src/iconlist.cpp comments (#1009) --- src/iconlist.cpp | 301 ++++++++++++++++++++++++----------------------- 1 file changed, 151 insertions(+), 150 deletions(-) diff --git a/src/iconlist.cpp b/src/iconlist.cpp index ddfa7c2fb..f731f574e 100644 --- a/src/iconlist.cpp +++ b/src/iconlist.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" @@ -10,13 +11,13 @@ // CIconList // -// udava pocet polozek v jedne radce; po vzoru W2K davame 4; -// asi pro vetsi rychlost provadenych operaci? +// Specifies the number of items in one row; following the W2K model, we use 4; +// probably for better performance of the operations performed. const int IL_ITEMS_IN_ROW = 4; -#define IL_TYPE_NORMAL 0 // bezna ikona, kterou lze vykreslit pres BitBlt -#define IL_TYPE_XOR 1 // ikona obsahujici oblasti, ktere je treba XORovat -#define IL_TYPE_ALPHA 2 // ikona obsahujici alfa kanal +#define IL_TYPE_NORMAL 0 // regular icon that can be drawn with BitBlt +#define IL_TYPE_XOR 1 // icon containing areas that must be XOR-ed +#define IL_TYPE_ALPHA 2 // icon containing an alpha channel HDC CIconList::HMemDC = NULL; HBITMAP CIconList::HOldBitmap = NULL; @@ -101,8 +102,8 @@ BOOL CIconList::CreateOrEnlargeTmpImage(int width, int height) { if (HTmpImage == NULL || TmpImageWidth < width || TmpImageHeight < height) { - // !!! Pozor, pri pouzivani BITMAPV4HEADER u Petra padal Salamander v ICM32.DLL, - // stary BITMAPINFOHEADER zjevne staci + // !!! Warning: when Petr used BITMAPV4HEADER, Salamander crashed in ICM32.DLL; + // the older BITMAPINFOHEADER is evidently sufficient BITMAPINFOHEADER bmhdr; memset(&bmhdr, 0, sizeof(bmhdr)); bmhdr.biSize = sizeof(bmhdr); @@ -121,7 +122,7 @@ BOOL CIconList::CreateOrEnlargeTmpImage(int width, int height) } if (HTmpImage != NULL) - HANDLES(DeleteObject(HTmpImage)); // pokud existuje stara bitmapa, zrusime ji + HANDLES(DeleteObject(HTmpImage)); // if an old bitmap exists, delete it HTmpImage = hBmp; TmpImageRaw = (DWORD*)lpBits; @@ -153,12 +154,12 @@ BOOL CIconList::Create(int imageWidth, int imageHeight, int imageCount) HANDLES(LeaveCriticalSection(&CriticalSection)); return FALSE; } - ZeroMemory(ImageFlags, sizeof(BYTE) * imageCount); // bez alfa kanalu + ZeroMemory(ImageFlags, sizeof(BYTE) * imageCount); // no alpha channel int bmpWidth = imageWidth * min(imageCount, IL_ITEMS_IN_ROW); int bmpHeight = imageHeight * ((imageCount + IL_ITEMS_IN_ROW - 1) / IL_ITEMS_IN_ROW); - // pomocne DC, abychom mohli vytvorit kompatibilni bitmapu + // helper DC so that we can create a compatible bitmap HDC hDC = HANDLES(GetDC(NULL)); if (hDC == NULL) { @@ -185,7 +186,7 @@ BOOL CIconList::Create(int imageWidth, int imageHeight, int imageCount) } MemDCLocks++; - // pokud jeste neexistuje cache/mask bitmapa nebo je mala, vytvorime ji + // If the cache/mask bitmap does not exist yet or is too small, create it if (!CreateOrEnlargeTmpImage(imageWidth, imageHeight)) { HANDLES(ReleaseDC(NULL, hDC)); @@ -194,8 +195,8 @@ BOOL CIconList::Create(int imageWidth, int imageHeight, int imageCount) return FALSE; } - // !!! Pozor, pri pouzivani BITMAPV4HEADER u Petra padal Salamander v ICM32.DLL, - // stary BITMAPINFOHEADER zjevne staci + // !!! Warning: when Petr used BITMAPV4HEADER, Salamander crashed in ICM32.DLL; + // the older BITMAPINFOHEADER is evidently sufficient BITMAPINFOHEADER bmhdr; memset(&bmhdr, 0, sizeof(bmhdr)); bmhdr.biSize = sizeof(bmhdr); @@ -239,7 +240,7 @@ BOOL CIconList::CreateFromImageList(HIMAGELIST hIL, int requiredImageSize) return FALSE; } - // vytahneme geometrii image listu + // get the image list geometry int count = ImageList_GetImageCount(hIL); if (count == 0) { @@ -265,7 +266,7 @@ BOOL CIconList::CreateFromImageList(HIMAGELIST hIL, int requiredImageSize) if (!Create(cx, cy, count)) return FALSE; - // j.r. tady by se dalo optimalizovat: misto predavani po ikonach predat pres ImageList_Draw + // j.r. This could be optimized here: instead of passing icons one by one, pass them via ImageList_Draw if (count > 20) { TRACE_E("CIconList::CreateFromImageList(): Let me know that you need so many icons, it would deserve some optimizations here. Jan."); @@ -288,20 +289,20 @@ BOOL CIconList::CreateFromImageList(HIMAGELIST hIL, int requiredImageSize) return TRUE; } -// Pokud mam pod W2K desktop 32bpp, dostavam XP ikonky s alfa kanalem neorezane, -// tedy vcetne alfa kanalu. Pokud prepnu desktop na 16bpp, je alfa kanal orezany (nulovany). -// Pokud tedy ApplyMaskToImage dostane ikonku vcetne alfa kanalu, vrati typ -// IL_TYPE_ALPHA a Salamander bude korektne zobrazovat tyto ikony i pod OS < XP +// If the desktop is running at 32 bpp under W2K, XP icons are obtained with the alpha channel intact, +// including the alpha channel itself. If the desktop is switched to 16 bpp, the alpha channel is clipped (zeroed). +// If `ApplyMaskToImage` therefore receives an icon including the alpha channel, it returns +// `IL_TYPE_ALPHA` and Salamander will display these icons correctly even on OS versions older than XP BYTE CIconList::ApplyMaskToImage(int index, BYTE forceXOR) { HANDLES(EnterCriticalSection(&CriticalSection)); - // souradnice v bodech v HImage + // coordinates in pixels in HImage int iX = ImageWidth * (index % IL_ITEMS_IN_ROW); int iY = ImageHeight * (index / IL_ITEMS_IN_ROW); - // prohledneme celou ikonku a urcime o jaky typ se jedna (NORMAL, XOR, ALPHA) + // scan the entire icon and determine which type it is (NORMAL, XOR, ALPHA) BYTE type = IL_TYPE_NORMAL; if (forceXOR) type = IL_TYPE_XOR; @@ -323,8 +324,8 @@ BYTE CIconList::ApplyMaskToImage(int index, BYTE forceXOR) if ((*maskPtr != 0) && (*ptr != 0)) { type = IL_TYPE_XOR; - // to ze je ikonka kandidat na XOR jeste neznamena, - // ze nebude ALPHA, takze nemuzeme vypadnout + // The fact that the icon is a candidate for XOR does not yet mean + // that it will not be ALPHA, so we cannot exit early } ptr++; maskPtr++; @@ -337,9 +338,9 @@ BYTE CIconList::ApplyMaskToImage(int index, BYTE forceXOR) SKIP: if (type == IL_TYPE_NORMAL) { - // pripravime si barvu pozadi ve spravnem formatu + // prepare the background color in the correct format DWORD bkClr = GetRValue(BkColor) << 16 | GetGValue(BkColor) << 8 | GetBValue(BkColor); - // pruhledne oblasti masky preneseme do alfa kanalu + // transfer the transparent mask areas into the alpha channel int row; for (row = 0; row < ImageHeight; row++) { @@ -350,13 +351,13 @@ BYTE CIconList::ApplyMaskToImage(int index, BYTE forceXOR) { if (*maskPtr != 0) { - // zcela pruhledna oblast - // alfa kanal je v nejvyssim bytu, nastavime na 00, zbytek bude barva pozadi + // fully transparent area + // the alpha channel is in the highest byte; set it to 00, the rest will be the background color *ptr = bkClr; } else { - *ptr |= 0xFF000000; // oblast nastavime jako nepruhlednou + *ptr |= 0xFF000000; // mark the area as opaque } ptr++; maskPtr++; @@ -374,7 +375,7 @@ BYTE CIconList::ApplyMaskToImage(int index, BYTE forceXOR) for (col = 0; col < ImageWidth; col++) { if (*maskPtr == 0) - *ptr |= 0xFF000000; // nepruhledna oblast + *ptr |= 0xFF000000; // opaque area ptr++; maskPtr++; @@ -392,7 +393,7 @@ CIconList::DumpToTrace(int index, BOOL dumpMask) { HANDLES(EnterCriticalSection(&CriticalSection)); - // souradnice v bodech v HImage + // coordinates in points in HImage int iX = ImageWidth * (index % IL_ITEMS_IN_ROW); int iY = ImageHeight * (index / IL_ITEMS_IN_ROW); @@ -458,19 +459,19 @@ BOOL CIconList::ReplaceIcon(int index, HICON hIcon) int iX = ImageWidth * (index % IL_ITEMS_IN_ROW); int iY = ImageHeight * (index / IL_ITEMS_IN_ROW); - // kontrola parametru + // Parameter validation if (index < 0 || index >= ImageCount) { TRACE_E("CIconList::ReplaceIcon(): Index is out of range! index=" << index); goto BAIL; } - // pokud je treba, provedeme resize ikonky - // Honza: pod W10 mi zacalo volani CopyImage padat v debug x64 verzi, pokud byl povolen LR_COPYFROMRESOURCE flag - // FIXME: provest audit, zda je tento downscale jeste potreba, kdyz SalLoadIcon() nove vola LoadIconWithScaleDown() + // Resize the icon if needed. + // Honza: On Windows 10, CopyImage() started crashing for me in the debug x64 build when the LR_COPYFROMRESOURCE flag was enabled. + // FIXME: Audit whether this downscale is still needed now that SalLoadIcon() calls LoadIconWithScaleDown(). hIcon = (HICON)CopyImage(hIconOrig, IMAGE_ICON, ImageWidth, ImageHeight, /*LR_COPYFROMRESOURCE | */ LR_COPYRETURNORG); - // vytahneme z handlu ikony jeji MASK a COLOR bitmapy + // Extract the MASK and COLOR bitmaps from the icon handle if (!GetIconInfo(hIcon, &ii)) { TRACE_E("GetIconInfo() failed!"); @@ -485,36 +486,36 @@ BOOL CIconList::ReplaceIcon(int index, HICON hIcon) goto BAIL; } - // pokud se jedna o b&w ikonu, mela by mit sudou vysku + // if this is a b&w icon, it should have an even height if (ii.hbmColor == NULL && (bm.bmHeight & 1) == 1) { TRACE_E("CIconList::ReplaceIcon() Icon has wrong MASK height"); goto BAIL; } - // ikonka by mela mit stejne rozmery, jako ma nase polozka + // the icon should have the same dimensions as our item if (bm.bmWidth != ImageWidth || (ii.hbmColor == NULL && bm.bmHeight != ImageHeight * 2) || (ii.hbmColor != NULL && bm.bmHeight != ImageHeight)) TRACE_E("CIconList::ReplaceIcon() Icon has wrong size: bmWidth=" << bm.bmWidth << " bmHeight=" << bm.bmHeight); - // potrebujeme dostatecny prostor pro masku + // enough space for the mask if (!CreateOrEnlargeTmpImage(bm.bmWidth, bm.bmHeight)) goto BAIL; - hSrcDC = HANDLES(CreateCompatibleDC(NULL)); // pomocne dc pro bitblt + hSrcDC = HANDLES(CreateCompatibleDC(NULL)); // helper DC for BitBlt hOldSrcBmp = (HBITMAP)SelectObject(hSrcDC, ii.hbmMask); // ii.hbmMask -> HTmpImage SelectObject(HMemDC, HTmpImage); BitBlt(HMemDC, 0, 0, ImageWidth, ImageHeight, hSrcDC, 0, 0, SRCCOPY); - // ii.hbmColor -> HImage (pokud je hbmColor==NULL, lezi XOR cast ve spodni polovine hbmMask + // ii.hbmColor -> HImage (if hbmColor == NULL, the XOR part is in the lower half of hbmMask) if (ii.hbmColor != NULL) SelectObject(hSrcDC, ii.hbmColor); SelectObject(HMemDC, HImage); BitBlt(HMemDC, iX, iY, ImageWidth, ImageHeight, hSrcDC, 0, (ii.hbmColor != NULL) ? 0 : ImageHeight, SRCCOPY); - GdiFlush(); // podle MSDN je treba zavolat nez zacneme pristupovat na raw data + GdiFlush(); // according to MSDN, this must be called before we start accessing raw data // TRACE_I("counter: "<= ImageCount) { TRACE_E("CIconList::GetIcon: index is out of range!"); return NULL; } - // vytvorime B&W masku + barevnou bitmapu dle obrazovky + // create a B&W mask plus a screen-format color bitmap HDC hDC = HANDLES(GetDC(NULL)); HBITMAP hMask = HANDLES(CreateBitmap(ImageWidth, ImageHeight, 1, 1, NULL)); HBITMAP hColor = HANDLES(CreateCompatibleBitmap(hDC, ImageWidth, ImageHeight)); @@ -581,7 +582,7 @@ CIconList::GetIcon(int index) BYTE type = ImageFlags[index]; - // do HTmpImage pripravime COLOR cast ikonky + // prepare the COLOR part of the icon in HTmpImage int row; for (row = 0; row < ImageHeight; row++) { @@ -593,14 +594,14 @@ CIconList::GetIcon(int index) DWORD argb = *imagePtr; BYTE alpha = (BYTE)((argb & 0xFF000000) >> 24); - if (type == IL_TYPE_ALPHA) // az na XP a novejsich systemech vracime ikony s alphou + if (type == IL_TYPE_ALPHA) // on Windows XP and later, return icons with alpha { *tmpPtr = argb; } else { - // v pruhledne oblasti je barva pozadi image listu, ale my tam - // musime dodat cernou barvu, aby fungoval XOR mechanismus kresleni + // the transparent area contains the image list background color, but we + // must put black there so that the XOR drawing mechanism works if (alpha != 0) *tmpPtr = argb; else @@ -612,7 +613,7 @@ CIconList::GetIcon(int index) } } - // preneseme HTmpImage do hColor + // copy HTmpImage into hColor SelectObject(HMemDC, HTmpImage); hDC = HANDLES(CreateCompatibleDC(NULL)); HBITMAP hOldBmp = (HBITMAP)SelectObject(hDC, hColor); @@ -620,7 +621,7 @@ CIconList::GetIcon(int index) SelectObject(hDC, hMask); - // do HTmpImage pripravime MASK cast ikonky + // Prepare the icon mask in HTmpImage for (row = 0; row < ImageHeight; row++) { DWORD* imagePtr = ImageRaw + iX + (iY + row) * BitmapWidth; @@ -638,7 +639,7 @@ CIconList::GetIcon(int index) } } - // preneseme HTmpImage do hMask + // Copy HTmpImage to hMask BitBlt(hDC, 0, 0, ImageWidth, ImageHeight, HMemDC, 0, 0, SRCCOPY); // if (Dump) @@ -647,13 +648,13 @@ CIconList::GetIcon(int index) // DumpToTrace(index, TRUE); // } - // zameteme + // clean up SelectObject(hDC, hOldBmp); HANDLES(DeleteDC(hDC)); HANDLES(LeaveCriticalSection(&CriticalSection)); - // z hColor + hMask vytvorime ikonku + // create an icon from hColor + hMask ICONINFO ii; ii.fIcon = TRUE; ii.xHotspot = 0; @@ -661,7 +662,7 @@ CIconList::GetIcon(int index) ii.hbmColor = hColor; ii.hbmMask = hMask; HICON hIcon; - hIcon = CreateIconIndirect(&ii); // nesmi byt v handles, vyvazi ikonku ven ze Salamandera + hIcon = CreateIconIndirect(&ii); // must not be in handles; transfers the icon out of Salamander HANDLES(DeleteObject(hColor)); HANDLES(DeleteObject(hMask)); @@ -671,14 +672,14 @@ CIconList::GetIcon(int index) BOOL CIconList::Draw(int index, HDC hDC, int x, int y, COLORREF blendClr, DWORD flags) { - // kontrola parametru + // parameter validation if (index < 0 || index >= ImageCount) { TRACE_E("CIconList::Draw() Index is out of range! index=" << index << " ImageCount=" << ImageCount); return FALSE; } - if (flags & IL_DRAW_MASK) // maska se pouziva pri drag&dropu, napriklad u shared adesaru, viz StateImageList_Draw() + if (flags & IL_DRAW_MASK) // The mask is used during drag and drop, for example for shared folders; see StateImageList_Draw(). return DrawMask(hDC, x, y, index, RGB(0, 0, 0), RGB(255, 255, 255)); if (flags & IL_DRAW_BLEND) return AlphaBlend(hDC, x, y, index, BkColor, blendClr); @@ -712,21 +713,21 @@ BOOL CIconList::DrawMask(HDC hDC, int x, int y, int index, COLORREF fgColor, COL { HANDLES(EnterCriticalSection(&CriticalSection)); - // souradnice v bodech v HImage + // coordinates in pixels in HImage int iX = ImageWidth * (index % IL_ITEMS_IN_ROW); int iY = ImageHeight * (index / IL_ITEMS_IN_ROW); //DumpToTrace(index); - // sosneme data z obrazovky do HTmpImage - // nase DrawMask pouze nastavuje cerne body v miste masky, abychom mohli snadno mergovat s overlayem - // pri volani z StateImageList_Draw(); pokud bude casem treba zobrazovat dalsi overlay, bude to chtit - // udelat v StateImageList_Draw() merger na zaklade boolovskych bitblt operaci a tato metoda by pak - // mohla nastavovat take fgColor; odpadla by podminka *** dole + // Copy the screen data into HTmpImage + // Our `DrawMask` only sets black pixels at the mask locations so that it can be merged easily with the overlay + // when called from `StateImageList_Draw()`; if support for another overlay is ever needed, it will be necessary + // to implement the merge in `StateImageList_Draw()` using boolean `BitBlt` operations, and this method could then + // also set `fgColor`; the `***` condition below would no longer be needed SelectObject(HMemDC, HTmpImage); BitBlt(HMemDC, 0, 0, ImageWidth, ImageHeight, hDC, x, y, SRCCOPY); - // budeme kreslit do HTmpImage + // draw into HTmpImage int row; for (row = 0; row < ImageHeight; row++) { @@ -739,7 +740,7 @@ BOOL CIconList::DrawMask(HDC hDC, int x, int y, int index, COLORREF fgColor, COL BYTE alpha = (BYTE)((argb & 0xFF000000) >> 24); DWORD clr = (alpha == 0) ? bkColor : fgColor; - if (alpha != 0) // *** viz komentar nahore + if (alpha != 0) // *** see comment above *tmpPtr = clr; imagePtr++; @@ -747,7 +748,7 @@ BOOL CIconList::DrawMask(HDC hDC, int x, int y, int index, COLORREF fgColor, COL } } - // vykreslime HTmpImage do obrazovky + // draw HTmpImage to the screen // SelectObject(HMemDC, HTmpImage); BitBlt(hDC, x, y, ImageWidth, ImageHeight, HMemDC, 0, 0, SRCCOPY); @@ -759,11 +760,11 @@ BOOL CIconList::DrawXOR(HDC hDC, int x, int y, int index, COLORREF bkColor) { HANDLES(EnterCriticalSection(&CriticalSection)); - // souradnice v bodech v HImage + // coordinates in pixels in HImage int iX = ImageWidth * (index % IL_ITEMS_IN_ROW); int iY = ImageHeight * (index / IL_ITEMS_IN_ROW); - // budeme kreslit do HTmpImage + // draw into HTmpImage BYTE bkR = GetRValue(bkColor); BYTE bkG = GetGValue(bkColor); BYTE bkB = GetBValue(bkColor); @@ -789,7 +790,7 @@ BOOL CIconList::DrawXOR(HDC hDC, int x, int y, int index, COLORREF bkColor) } } - // vykreslime HTmpImage do obrazovky + // draw HTmpImage to the screen SelectObject(HMemDC, HTmpImage); BitBlt(hDC, x, y, ImageWidth, ImageHeight, HMemDC, 0, 0, SRCCOPY); @@ -801,11 +802,11 @@ BOOL CIconList::DrawALPHA(HDC hDC, int x, int y, int index, COLORREF bkColor) { HANDLES(EnterCriticalSection(&CriticalSection)); - // souradnice v bodech v HImage + // coordinates in pixels in HImage int iX = ImageWidth * (index % IL_ITEMS_IN_ROW); int iY = ImageHeight * (index / IL_ITEMS_IN_ROW); - // v prvni fazi preneseme data do HMask + // in the first phase, transfer the data into HMask SelectObject(HMemDC, HTmpImage); BYTE bkR = GetRValue(bkColor); @@ -844,7 +845,7 @@ BOOL CIconList::DrawALPHA(HDC hDC, int x, int y, int index, COLORREF bkColor) } } - // vykreslime HTmpImage do obrazovky + // draw HTmpImage to the screen BitBlt(hDC, x, y, ImageWidth, ImageHeight, HMemDC, 0, 0, SRCCOPY); HANDLES(LeaveCriticalSection(&CriticalSection)); @@ -856,14 +857,14 @@ BOOL CIconList::DrawALPHALeaveBackground(HDC hDC, int x, int y, int index) { HANDLES(EnterCriticalSection(&CriticalSection)); - // souradnice v bodech v HImage + // coordinates in pixels in HImage int iX = ImageWidth * (index % IL_ITEMS_IN_ROW); int iY = ImageHeight * (index / IL_ITEMS_IN_ROW); - // v prvni fazi preneseme z ciloveho DC data do HMask + // in the first phase, transfer data from the target DC into HMask SelectObject(HMemDC, HTmpImage); BitBlt(HMemDC, 0, 0, ImageWidth, ImageHeight, hDC, x, y, SRCCOPY); - GdiFlush(); // podle MSDN je treba zavolat nez zacneme pristupovat na raw data + GdiFlush(); // according to MSDN, this must be called before we start accessing raw data /* BYTE bkR = GetRValue(bkColor); @@ -905,7 +906,7 @@ BOOL CIconList::DrawALPHALeaveBackground(HDC hDC, int x, int y, int index) } } - // vykreslime HTmpImage do obrazovky + // draw HTmpImage to the screen BitBlt(hDC, x, y, ImageWidth, ImageHeight, HMemDC, 0, 0, SRCCOPY); HANDLES(LeaveCriticalSection(&CriticalSection)); @@ -917,14 +918,14 @@ BOOL CIconList::DrawAsAlphaLeaveBackground(HDC hDC, int x, int y, int index, COL { HANDLES(EnterCriticalSection(&CriticalSection)); - // souradnice v bodech v HImage + // coordinates in pixels in HImage int iX = ImageWidth * (index % IL_ITEMS_IN_ROW); int iY = ImageHeight * (index / IL_ITEMS_IN_ROW); - // v prvni fazi preneseme z ciloveho DC data do HMask + // in the first phase, transfer data from the target DC into HMask SelectObject(HMemDC, HTmpImage); BitBlt(HMemDC, 0, 0, ImageWidth, ImageHeight, hDC, x, y, SRCCOPY); - GdiFlush(); // podle MSDN je treba zavolat nez zacneme pristupovat na raw data + GdiFlush(); // according to MSDN, this must be called before we start accessing raw data BYTE fgR = GetRValue(fgColor); BYTE fgG = GetGValue(fgColor); @@ -939,7 +940,7 @@ BOOL CIconList::DrawAsAlphaLeaveBackground(HDC hDC, int x, int y, int index, COL for (col = 0; col < ImageWidth; col++) { DWORD argb = *imagePtr; - BYTE alpha = 255 - (BYTE)(argb & 0x000000FF); // vsechny kanaly nesou stejnou hodnotu, kterou mame povazovat za alpha kanal + BYTE alpha = 255 - (BYTE)(argb & 0x000000FF); // all channels carry the same value, which should be treated as the alpha channel if (alpha != 0) { BYTE bkR = (BYTE)((*tmpPtr & 0x00FF0000) >> 16); @@ -956,7 +957,7 @@ BOOL CIconList::DrawAsAlphaLeaveBackground(HDC hDC, int x, int y, int index, COL } } - // vykreslime HTmpImage do obrazovky + // draw HTmpImage to the screen BitBlt(hDC, x, y, ImageWidth, ImageHeight, HMemDC, 0, 0, SRCCOPY); HANDLES(LeaveCriticalSection(&CriticalSection)); @@ -968,18 +969,18 @@ BOOL CIconList::AlphaBlend(HDC hDC, int x, int y, int index, COLORREF bkColor, C { HANDLES(EnterCriticalSection(&CriticalSection)); - // souradnice v bodech v HImage + // coordinates in pixels in HImage int iX = ImageWidth * (index % IL_ITEMS_IN_ROW); int iY = ImageHeight * (index / IL_ITEMS_IN_ROW); - // jde o variantu, kde je treba XORovat? + // Is this the variant that needs XORing? BOOL xorType = ImageFlags[index] == IL_TYPE_XOR; - // v prvni pripravime raw data pro HTmpImage + // in the first phase, prepare raw data for HTmpImage int bitsPerPixel = GetCurrentBPP(hDC); if (bitsPerPixel <= 8) { - // 256 barev nebo mene: misto blendeni prekryvame sachovnici + // 256 colors or less: overlay a checkerboard instead of blending DWORD bkClrOpaque = GetRValue(bkColor) << 16 | GetGValue(bkColor) << 8 | GetBValue(bkColor); DWORD bkClr; if (fgColor != CLR_NONE) @@ -999,7 +1000,7 @@ BOOL CIconList::AlphaBlend(HDC hDC, int x, int y, int index, COLORREF bkColor, C if (xorType && alpha == 0) { - // XOR && pruhledna oblast + // XOR && transparent area BYTE bkR = GetRValue(bkColor); BYTE bkG = GetGValue(bkColor); BYTE bkB = GetBValue(bkColor); @@ -1010,7 +1011,7 @@ BOOL CIconList::AlphaBlend(HDC hDC, int x, int y, int index, COLORREF bkColor, C { if (alpha == 0) { - // pruhledna oblast + // transparent area argb = bkClrOpaque; } else @@ -1032,7 +1033,7 @@ BOOL CIconList::AlphaBlend(HDC hDC, int x, int y, int index, COLORREF bkColor, C } else { - // vice nez 256 barev: blednime pomoci alfa kanalu + // more than 256 colors: fade using the alpha channel BYTE bkR = GetRValue(bkColor); BYTE bkG = GetGValue(bkColor); BYTE bkB = GetBValue(bkColor); @@ -1051,7 +1052,7 @@ BOOL CIconList::AlphaBlend(HDC hDC, int x, int y, int index, COLORREF bkColor, C if (xorType && alpha == 0) { - // XOR && pruhledna oblast + // XOR && transparent area *tmpPtr = (DWORD)bkR << 16 | (DWORD)bkG << 8 | (DWORD)bkB; *tmpPtr ^= (argb & 0x00FFFFFF); } @@ -1086,7 +1087,7 @@ BOOL CIconList::AlphaBlend(HDC hDC, int x, int y, int index, COLORREF bkColor, C } } - // vykreslime HTmpImage do obrazovky + // draw HTmpImage to the screen SelectObject(HMemDC, HTmpImage); BitBlt(hDC, x, y, ImageWidth, ImageHeight, HMemDC, 0, 0, SRCCOPY); @@ -1112,7 +1113,7 @@ BOOL CIconList::SetBkColor(COLORREF bkColor) int index; for (index = 0; index < ImageCount; index++) { - if (ImageFlags[index] != IL_TYPE_NORMAL) // pouze u normalnich ikon ma smysl nastavovat barvu pozadi + if (ImageFlags[index] != IL_TYPE_NORMAL) // setting the background color only makes sense for normal icons continue; int iX = ImageWidth * (index % IL_ITEMS_IN_ROW); @@ -1145,7 +1146,7 @@ CIconList::GetBkColor() BOOL CIconList::Copy(int dstIndex, CIconList* srcIL, int srcIndex) { - // kontrola parametru + // Check parameters if (dstIndex < 0 || dstIndex >= ImageCount) { TRACE_E("CIconList::Copy: dstIndex is out of range!"); @@ -1167,9 +1168,9 @@ BOOL CIconList::Copy(int dstIndex, CIconList* srcIL, int srcIndex) return FALSE; } - // verze kopirovani pomoci primeho pristupu k datum, vyhodou by mela byt - // vyssi rychlost a naprosto identicka kopie (fce BitBlt by mohla zahazovat - // alpha kanal) + // copy variant using direct access to the data; the advantage should be + // higher speed and a completely identical copy (the BitBlt function could drop + // the alpha channel) HANDLES(EnterCriticalSection(&CriticalSection)); int srcX = ImageWidth * (srcIndex % IL_ITEMS_IN_ROW); int srcY = ImageHeight * (srcIndex / IL_ITEMS_IN_ROW); @@ -1192,7 +1193,7 @@ BOOL CIconList::Copy(int dstIndex, CIconList* srcIL, int srcIndex) ImageFlags[dstIndex] = srcIL->ImageFlags[srcIndex]; HANDLES(LeaveCriticalSection(&CriticalSection)); - // verze kopirovani pomoci BitBlt + // BitBlt-based copy variant // HDC hSrcMemDC = HANDLES(CreateCompatibleDC(NULL)); // if (hSrcMemDC == NULL) // { @@ -1223,11 +1224,11 @@ BOOL CIconList::CreateFromBitmap(HBITMAP hBitmap, int imageCount, COLORREF trans int cx = bmp.bmWidth / imageCount; int cy = bmp.bmHeight; - // naalokujeme bitmapu + // allocate the bitmap if (!Create(cx, cy, imageCount)) return FALSE; - // po radcich do ni pridame prouzky ze zdrojove bitmapy + // add strips from the source bitmap row by row int index = 0; while (index < imageCount) { @@ -1303,9 +1304,9 @@ BOOL CIconList::CopyFromBitmapIternal(int dstIndex, HBITMAP hSrcBitmap, int srcI BitBlt(HMemDC, dstX, dstY, ImageWidth * imageCount, ImageHeight, hSrcMemDC, srcX, srcY, SRCCOPY); ImageFlags[dstIndex] = IL_TYPE_NORMAL; - GdiFlush(); // podle MSDN je treba zavolat nez zacneme pristupovat na raw data + GdiFlush(); // according to MSDN, this must be called before we start accessing raw data - // podle transparentni barvy nastavime alpha kanal + // set the alpha channel according to the transparent color int row; for (row = dstY; row < dstY + ImageHeight; row++) { @@ -1400,7 +1401,7 @@ BOOL CIconList::ConvertToGrayscale(BOOL forceAlphaForBW) BYTE brightness = GetGrayscaleFromRGB(r, g, b); if (forceAlphaForBW) { - // pokud jde vystup do BW bitmapy, nastavime prah mezi bilou a cernou (odladeno na Vista ikonkach v user menu) + // if the output goes to a B&W bitmap, set the threshold between white and black (tuned on Vista icons in the user menu) if (alpha < 200) alpha = 0; if (brightness > 240) @@ -1430,49 +1431,49 @@ CIconList::GetImageList() return hIL; /* - // vytahnu rozmery bitmapy - HDC hDC = HANDLES(GetDC(NULL)); - BITMAPINFO bi; - memset(&bi, 0, sizeof(bi)); - bi.bmiHeader.biSize = sizeof(bi.bmiHeader); - bi.bmiHeader.biBitCount = 0; // nechceme paletu + // get the bitmap dimensions + HDC hDC = HANDLES(GetDC(NULL)); + BITMAPINFO bi; + memset(&bi, 0, sizeof(bi)); + bi.bmiHeader.biSize = sizeof(bi.bmiHeader); + bi.bmiHeader.biBitCount = 0; // palette not needed - if (!GetDIBits(hDC, - hSrc, - 0, 0, - NULL, - &bi, - DIB_RGB_COLORS)) - { - TRACE_E("GetDIBits failed"); - if (hDC != NULL) HANDLES(ReleaseDC(NULL, hDC)); - return NULL; - } + if (!GetDIBits(hDC, + hSrc, + 0, 0, + NULL, + &bi, + DIB_RGB_COLORS)) + { + TRACE_E("GetDIBits failed"); + if (hDC != NULL) HANDLES(ReleaseDC(NULL, hDC)); + return NULL; + } - if (bi.bmiHeader.biSizeImage == 0) - { - TRACE_E("bi.bmiHeader.biSizeImage == 0"); - if (hDC != NULL) HANDLES(ReleaseDC(NULL, hDC)); - return NULL; - } - if (hDC != NULL) HANDLES(ReleaseDC(NULL, hDC)); + if (bi.bmiHeader.biSizeImage == 0) + { + TRACE_E("bi.bmiHeader.biSizeImage == 0"); + if (hDC != NULL) HANDLES(ReleaseDC(NULL, hDC)); + return NULL; + } + if (hDC != NULL) HANDLES(ReleaseDC(NULL, hDC)); - HIMAGELIST hIL = ImageList_Create(16, 16, GetImageListColorFlags() | ILC_MASK, 0, 1); - if (hIL != NULL) - { - // funkce ImageList_AddMasked nici pruhlednou barvu v hSrc, proto - // pridame ikonky postupne a pomalu - int count = bi.bmiHeader.biWidth / 16; - int i; - for (i = 0; i < count; i++) - { - HICON hIcon = GetIconFromDIB(hSrc, i); - ImageList_AddIcon(hIL, hIcon); - HANDLES(DestroyIcon(hIcon)); - } - } - return hIL; -*/ + HIMAGELIST hIL = ImageList_Create(16, 16, GetImageListColorFlags() | ILC_MASK, 0, 1); + if (hIL != NULL) + { + // the ImageList_AddMasked function destroys the transparent color in hSrc, so + // add the icons one by one, slowly + int count = bi.bmiHeader.biWidth / 16; + int i; + for (i = 0; i < count; i++) + { + HICON hIcon = GetIconFromDIB(hSrc, i); + ImageList_AddIcon(hIL, hIcon); + HANDLES(DestroyIcon(hIcon)); + } + } + return hIL; + */ } //**************************************************************************** @@ -1750,7 +1751,7 @@ HBITMAP LoadRawPNGBitmap(const void* rawPNG, DWORD rawPNGSize, DWORD flags) if (result >= 0) { HBITMAP hBitmap = LoadPNGBitmapCreateDIB(&png, buff, buffSize, flags); - png_free_data(&png); // release palette, etc allocated in png_get_data + png_free_data(&png); // release the palette, etc. allocated by png_get_data if (buff[buffSize] != 0xfe) { TRACE_E("Memory corrupted!!!"); @@ -1851,7 +1852,7 @@ BOOL CIconList::CreateFromRawPNG(const void* rawPNG, DWORD rawPNGSize, int image int row; for (row = 0; row < ImageHeight; row++) { - // souradnice v bodech v HImage + // coordinates in pixels in HImage int iX = ImageWidth * (index % IL_ITEMS_IN_ROW); int iY = ImageHeight * (index / IL_ITEMS_IN_ROW); @@ -1886,7 +1887,7 @@ BOOL CIconList::CreateFromRawPNG(const void* rawPNG, DWORD rawPNGSize, int image int row; for (row = 0; row < ImageHeight; row++) { - // souradnice v bodech v HImage + // coordinates in pixels in HImage int iX = ImageWidth * (index % IL_ITEMS_IN_ROW); int iY = ImageHeight * (index / IL_ITEMS_IN_ROW); @@ -1922,7 +1923,7 @@ BOOL CIconList::CreateFromRawPNG(const void* rawPNG, DWORD rawPNGSize, int image int row; for (row = 0; row < ImageHeight; row++) { - // souradnice v bodech v HImage + // coordinates in pixels in HImage int iX = ImageWidth * (index % IL_ITEMS_IN_ROW); int iY = ImageHeight * (index / IL_ITEMS_IN_ROW); @@ -1959,7 +1960,7 @@ BOOL CIconList::CreateFromRawPNG(const void* rawPNG, DWORD rawPNGSize, int image int row; for (row = 0; row < ImageHeight; row++) { - // souradnice v bodech v HImage + // coordinates in pixels in HImage int iX = ImageWidth * (index % IL_ITEMS_IN_ROW); int iY = ImageHeight * (index / IL_ITEMS_IN_ROW); @@ -1998,7 +1999,7 @@ BOOL CIconList::CreateFromRawPNG(const void* rawPNG, DWORD rawPNGSize, int image int row; for (row = 0; row < ImageHeight; row++) { - // souradnice v bodech v HImage + // coordinates in pixels in HImage int iX = ImageWidth * (index % IL_ITEMS_IN_ROW); int iY = ImageHeight * (index / IL_ITEMS_IN_ROW); @@ -2062,7 +2063,7 @@ struct CPNGBitmapWriteCallbackData { BYTE* RawPNGIterator; DWORD FreeSpace; - // navratove hodnoty + // return values BOOL NotEnoughSpace; DWORD Size; }; @@ -2090,7 +2091,7 @@ unsigned PNGBitmapWriteCallback(void* input, size_t size, size_t numel, void* us BOOL CIconList::SaveToPNG(BYTE** rawPNG, DWORD* rawPNGSize) { - // pripravime ikony do jednoho dlouheho radku + // prepare the icons in one long row DWORD* buff = (DWORD*)malloc(ImageWidth * ImageCount * ImageHeight * 4); int index; for (index = 0; index < ImageCount; index++) @@ -2098,7 +2099,7 @@ BOOL CIconList::SaveToPNG(BYTE** rawPNG, DWORD* rawPNGSize) int row; for (row = 0; row < ImageHeight; row++) { - // souradnice v bodech ve zdroji + // coordinates in pixels in the source int iX = ImageWidth * (index % IL_ITEMS_IN_ROW); int iY = ImageHeight * (index / IL_ITEMS_IN_ROW); BYTE* srcPtr = (BYTE*)ImageRaw + iX * 4 + (iY + row) * BitmapWidth * 4; @@ -2119,7 +2120,7 @@ BOOL CIconList::SaveToPNG(BYTE** rawPNG, DWORD* rawPNGSize) } CPNGBitmapWriteCallbackData callbackData; - callbackData.FreeSpace = ImageWidth * ImageCount * ImageHeight * 4 * 2; // radeji pripravim dvojnasobek pameti, tam se PNG MUSI vejit + callbackData.FreeSpace = ImageWidth * ImageCount * ImageHeight * 4 * 2; // allocate double the memory to be safe; the PNG must fit there callbackData.Size = 0; BYTE* output = (BYTE*)malloc(callbackData.FreeSpace); callbackData.RawPNGIterator = output; From dfa56ca7a9b8f87f771992db7ce845f46aa2f0e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 06:30:22 +0200 Subject: [PATCH 633/710] [translation] Fix src/plugins/shared/spl_gen.h comments Refines translated comments in src/plugins/shared/spl_gen.h. Model: OpenAI GPT-5.4 Verification: Reviewed the final PR diff for src/plugins/shared/spl_gen.h, confirmed the file carries the required CommentsTranslationProject marker when applicable, rechecked that clang-format introduces no further delta on the delivered file, and confirmed the PR stays comment-only without code changes or broken structural comments. Telemetry: Provider-backed review stages were not used for this manual cleanup PR, so provider-call and token/request-unit totals remain zero. --- src/plugins/shared/spl_gen.h | 76 ++++++++++++++++++------------------ 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/src/plugins/shared/spl_gen.h b/src/plugins/shared/spl_gen.h index 90b5caf25..6837769cb 100644 --- a/src/plugins/shared/spl_gen.h +++ b/src/plugins/shared/spl_gen.h @@ -263,8 +263,8 @@ URLText #define BUTTONS_YESNOCANCEL 0x00000005 // Yes / No / Cancel #define BUTTONS_YESALLCANCEL 0x00000006 // Yes / All / Cancel #define BUTTONS_MASK 0x000000FF // Internal mask, do not use -// detekci zda kombinace ma tlacitko SKIP nebo YES nechavam zde ve forme inline, aby -// v pripade zavadeni novych kombinaci byla dobre na ocich a nezapomeli jsme ji doplnit +// The detection of whether a combination contains the SKIP or YES button is kept inline here +// so that when new combinations are introduced, it stays visible and we do not forget to add it. inline BOOL ButtonsContainsSkip(DWORD btn) { return (btn & BUTTONS_MASK) == BUTTONS_SKIPCANCEL || @@ -403,7 +403,7 @@ struct CSalamanderPluginViewerData // extension of the CSalamanderPluginViewerData structure for the internal text/hex viewer struct CSalamanderPluginInternalViewerData : public CSalamanderPluginViewerData { - int Mode; // 0 - textovy mod, 1 - hexa mod + int Mode; // 0 - text mode, 1 - hex mode const char* Caption; // NULL -> the window caption contains FileName, otherwise Caption BOOL WholeCaption; // Meaningful only if Caption != NULL. TRUE -> // only the Caption string is shown in the viewer title; FALSE -> @@ -606,9 +606,9 @@ class CSalamanderREGEXPSearchData // (WARNING: only the range <0, 499> is reserved for command numbers) #define SALCMD_VIEW 0 // view (F3 in the panel) #define SALCMD_ALTVIEW 1 // alternate view (Alt+F3 in the panel) -#define SALCMD_VIEWWITH 2 // view with (klavesa Ctrl+Shift+F3 v panelu) +#define SALCMD_VIEWWITH 2 // view with (Ctrl+Shift+F3 in the panel) #define SALCMD_EDIT 3 // edit (F4 in the panel) -#define SALCMD_EDITWITH 4 // edit with (klavesa Ctrl+Shift+F4 v panelu) +#define SALCMD_EDITWITH 4 // edit with (Ctrl+Shift+F4 in the panel) #define SALCMD_OPEN 20 // open (Enter key in the panel) #define SALCMD_QUICKRENAME 21 // quick rename (F2 in the panel) @@ -620,15 +620,15 @@ class CSalamanderREGEXPSearchData #define SALCMD_PROPERTIES 44 // show properties (Alt+Enter in the panel) #define SALCMD_CHANGECASE 45 // change case (Ctrl+F7 in the panel) #define SALCMD_CHANGEATTRS 46 // change attributes (Ctrl+F2 in the panel) -#define SALCMD_OCCUPIEDSPACE 47 // calculate occupied space (klavesa Alt+F10 v panelu) +#define SALCMD_OCCUPIEDSPACE 47 // calculate occupied space (Alt+F10 in the panel) -#define SALCMD_EDITNEWFILE 70 // edit new file (klavesa Shift+F4 v panelu) +#define SALCMD_EDITNEWFILE 70 // edit new file (Shift+F4 in the panel) #define SALCMD_REFRESH 71 // refresh (Ctrl+R in a panel) #define SALCMD_CREATEDIRECTORY 72 // create directory (F7 in a panel) #define SALCMD_DRIVEINFO 73 // drive info (Ctrl+F1 in a panel) -#define SALCMD_CALCDIRSIZES 74 // calculate directory sizes (klavesa Ctrl+Shift+F10 v panelu) +#define SALCMD_CALCDIRSIZES 74 // calculate directory sizes (Ctrl+Shift+F10 in the panel) -#define SALCMD_DISCONNECT 90 // disconnect (network drive or plugin-fs) (klavesa F12 v panelu) +#define SALCMD_DISCONNECT 90 // disconnect (network drive or plugin-fs) (F12 in the panel) #define MAX_GROUPMASK 1001 // maximum number of characters (including the terminating null) in a group mask @@ -708,13 +708,13 @@ class CSalamanderMaskGroup // // Object lifetime: // -// 1) Alokujeme metodou CSalamanderGeneralAbstract::AllocSalamanderMD5 +// 1) Allocate it using CSalamanderGeneralAbstract::AllocSalamanderMD5 // 2) Call Update() repeatedly for the data whose MD5 should be computed // 3) Call Finalize() // 4) Retrieve the computed MD5 with GetDigest() // 5) If you want to reuse the object, call Init() // (it is called automatically in step (1)) and continue with step (2) -// 6) Destrukce objektu metodou CSalamanderGeneralAbstract::FreeSalamanderMD5 +// 6) Destroy the object using CSalamanderGeneralAbstract::FreeSalamanderMD5 // class CSalamanderMD5 { @@ -763,7 +763,7 @@ class CSalamanderPNGAbstract // with 8 bits per channel }; -// vsechny metody je mozne volat pouze z hlavniho threadu +// all methods may be called only from the main thread class CSalamanderPasswordManagerAbstract { public: @@ -806,10 +806,10 @@ class CSalamanderPasswordManagerAbstract // commands for HTML help: see CSalamanderGeneralAbstract::OpenHtmlHelp enum CHtmlHelpCommand { - HHCDisplayTOC, // viz HH_DISPLAY_TOC: dwData = 0 (zadny topic) nebo: pointer to a topic within a compiled help file + HHCDisplayTOC, // see HH_DISPLAY_TOC: dwData = 0 (no topic) or: pointer to a topic within a compiled help file HHCDisplayIndex, // see HH_DISPLAY_INDEX: dwData = 0 (no keyword) or: keyword to select in the index (.hhk) file - HHCDisplaySearch, // viz HH_DISPLAY_SEARCH: dwData = 0 (prazdne hledani) nebo: pointer to an HH_FTS_QUERY structure - HHCDisplayContext, // viz HH_HELP_CONTEXT: dwData = numeric ID of the topic to display + HHCDisplaySearch, // see HH_DISPLAY_SEARCH: dwData = 0 (empty search) or: pointer to an HH_FTS_QUERY structure + HHCDisplayContext, // see HH_HELP_CONTEXT: dwData = numeric ID of the topic to display }; // used as a parameter of OpenHtmlHelpForSalamander when command==HHCDisplayContext @@ -902,7 +902,7 @@ class CSalamanderGeneralAbstract // FlashWindow(mainwnd, TRUE) is called before the dialog is shown and // FlashWindow(mainwnd, FALSE) is called after it is closed; mainwnd is the parent of 'parent' // that no longer has a parent (typically the Salamander main window) - // ERROR: filename+error+title (pokud 'title' == NULL, jde o std. titulek "Error") + // ERROR: filename+error+title (if 'title' == NULL, the standard title "Error" is used) // // The 'flags' variable specifies the displayed buttons; DialogError accepts one of: // BUTTONS_OK // OK (old DialogError3) @@ -920,7 +920,7 @@ class CSalamanderGeneralAbstract virtual int WINAPI DialogOverwrite(HWND parent, DWORD flags, const char* fileName1, const char* fileData1, const char* fileName2, const char* fileData2) = 0; - // QUESTION: filename+question+title (pokud 'title' == NULL, jde o std. titulek "Question") + // QUESTION: filename+question+title (if 'title' == NULL, the standard title "Question" is used) // The 'flags' variable specifies the displayed buttons; DialogQuestion accepts one of: // BUTTONS_YESALLSKIPCANCEL // Yes / All / Skip / Skip all / Cancel (old DialogQuestion) // BUTTONS_YESNOCANCEL // Yes / No / Cancel (old DialogQuestion2) @@ -1400,9 +1400,9 @@ class CSalamanderGeneralAbstract // main thread only (otherwise the panel contents may change) virtual BOOL WINAPI GetPanelWithPluginFS(CPluginFSInterfaceAbstract* pluginFS, int& panel) = 0; - // aktivuje druhy panel (ala klavesa TAB); panely oznacene pres PANEL_SOURCE a PANEL_TARGET - // se tim prirozene prohazuji - // omezeni: hlavni thread + // Activates the other panel (like the TAB key); the panels designated by PANEL_SOURCE and + // PANEL_TARGET naturally swap as a result. + // Restriction: main thread virtual void WINAPI ChangePanel() = 0; // Converts a number to a more readable string (a space after every three digits), writes the string to @@ -1651,9 +1651,9 @@ class CSalamanderGeneralAbstract // marks the calling plugin to be unloaded at the next possible opportunity // (once all posted menu commands have been processed (see PostMenuExtCommand), there are no // messages in the main-thread message queue, and Salamander is not "busy"); - // POZOR: pokud se vola z jineho nez hlavniho threadu, muze dojit k zadosti o unload (probiha - // in the main thread) even before PostUnloadThisPlugin returns (for more information about - // unloadu - viz CPluginInterfaceAbstract::Release) + // WARNING: if this is called from a thread other than the main thread, the unload request + // (processed in the main thread) may be posted even before PostUnloadThisPlugin returns + // (for more information about unloading, see CPluginInterfaceAbstract::Release) // callable from any thread, but only after the plugin entry point has finished; while the // entry point is running, the method may be called only from the main thread virtual void WINAPI PostUnloadThisPlugin() = 0; @@ -1693,7 +1693,7 @@ class CSalamanderGeneralAbstract // WARNING: if called from a thread other than the main thread, the menu command may run // (in the main thread) even before PostMenuExtCommand returns // callable from any thread, and if 'waitForSalIdle' is FALSE, it is necessary to wait until after calling - // CPluginInterfaceAbstract::GetInterfaceForMenuExt (vola se po entry-pointu z hlavniho threadu) + // CPluginInterfaceAbstract::GetInterfaceForMenuExt (called after the entry point from the main thread) virtual void WINAPI PostMenuExtCommand(int id, BOOL waitForSalIdle) = 0; // Determines whether there is a high chance, though this cannot be known with certainty, that Salamander will not be "busy" during the next few moments (no modal dialog open and no message being processed); in that case it returns TRUE, otherwise FALSE. If 'lastIdleTime' is not NULL, it receives the GetTickCount() value from the last transition from the "idle" state to the "busy" state. This can be used, for example, as a prediction for the delivery of a command posted with CSalamanderGeneralAbstract::PostMenuExtCommand and 'waitForSalIdle'==TRUE. Callable from any thread. @@ -1954,21 +1954,21 @@ class CSalamanderGeneralAbstract // Can be called from any thread virtual BYTE WINAPI GetUserDefaultCharset() = 0; - // alokuje novy objekt Boyer-Moorova vyhledavaciho algoritmu - // mozne volat z libovolneho threadu + // Allocates a new object for the Boyer-Moore search algorithm. + // Can be called from any thread. virtual CSalamanderBMSearchData* WINAPI AllocSalamanderBMSearchData() = 0; - // uvolni objekt Boyer-Moorova vyhledavaciho algoritmu (ziskany metodou AllocSalamanderBMSearchData) - // mozne volat z libovolneho threadu + // Releases the Boyer-Moore search object obtained by AllocSalamanderBMSearchData. + // Can be called from any thread. virtual void WINAPI FreeSalamanderBMSearchData(CSalamanderBMSearchData* data) = 0; - // alokuje novy objekt algoritmu pro vyhledavani pomoci regularnich vyrazu - // mozne volat z libovolneho threadu + // Allocates a new object for regular-expression searching. + // Can be called from any thread. virtual CSalamanderREGEXPSearchData* WINAPI AllocSalamanderREGEXPSearchData() = 0; - // uvolni objekt algoritmu pro vyhledavani pomoci regularnich vyrazu (ziskany metodou - // AllocSalamanderREGEXPSearchData) - // mozne volat z libovolneho threadu + // Releases the regular-expression search object obtained by + // AllocSalamanderREGEXPSearchData. + // Can be called from any thread. virtual void WINAPI FreeSalamanderREGEXPSearchData(CSalamanderREGEXPSearchData* data) = 0; // Returns Salamander commands one by one (in the definition order of SALCMD_XXX constants); @@ -2043,12 +2043,12 @@ class CSalamanderGeneralAbstract // virtual DWORD WINAPI UpdateCrc32(const void* buffer, DWORD count, DWORD crcVal) = 0; - // alokuje novy objekt pro vypocet MD5 - // mozne volat z libovolneho threadu + // Allocates a new object for MD5 calculation. + // Can be called from any thread. virtual CSalamanderMD5* WINAPI AllocSalamanderMD5() = 0; - // uvolni objekt pro vypocet MD5 (ziskany metodou AllocSalamanderMD5) - // mozne volat z libovolneho threadu + // Releases the MD5 object obtained by AllocSalamanderMD5. + // Can be called from any thread. virtual void WINAPI FreeSalamanderMD5(CSalamanderMD5* md5) = 0; // Finds '<' and '>' pairs in the text, removes them from the buffer, and adds references to @@ -3109,7 +3109,7 @@ class CSalamanderGeneralAbstract // valid icons from the array; when system colors change, the plugin should reload the icon-overlays and // set them again with this function; the ideal reaction is to handle PLUGINEVENT_COLORSCHANGED in // CPluginInterfaceAbstract::Event() - // POZOR: pred Windows XP (ve W2K) je velikost ikony SALICONSIZE_48 jen 32 bodu! + // WARNING: before Windows XP (on W2K), the SALICONSIZE_48 icon is only 32 pixels in size! // limitation: main thread virtual void WINAPI SetPluginIconOverlays(int iconOverlaysCount, HICON* iconOverlays) = 0; From 5a3b85859ff9e04051b3c3c39eb66fece7ae891c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 06:30:25 +0200 Subject: [PATCH 634/710] [translation] Fix src/plugins/shared/spl_base.h comments Refines translated comments in src/plugins/shared/spl_base.h. Model: OpenAI GPT-5.4 Verification: Reviewed the final PR diff for src/plugins/shared/spl_base.h, confirmed the file carries the required CommentsTranslationProject marker when applicable, rechecked that clang-format introduces no further delta on the delivered file, and confirmed the PR stays comment-only without code changes or broken structural comments. Telemetry: Provider-backed review stages were not used for this manual cleanup PR, so provider-call and token/request-unit totals remain zero. --- src/plugins/shared/spl_base.h | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/plugins/shared/spl_base.h b/src/plugins/shared/spl_base.h index f32f50823..7207eef72 100644 --- a/src/plugins/shared/spl_base.h +++ b/src/plugins/shared/spl_base.h @@ -293,16 +293,18 @@ class CSalamanderConnectAbstract // adds items to the Plugins/"plugin name" menu in Salamander, 'iconIndex' is the // item icon index (-1=no icon; for assigning a bitmap with icons see - // CSalamanderConnectAbstract::SetBitmapWithIcons; u separatoru se ignoruje), 'name' je + // CSalamanderConnectAbstract::SetBitmapWithIcons; it is ignored for separators), 'name' is // the item name (max. MAX_PATH - 1 characters), or NULL for a separator (the // 'state_or'+'state_and' parameters have no meaning in that case); 'hotKey' is the item's hot key // obtained with the SALHOTKEY macro; 'name' may contain a hot-key hint, // separated by '\t'; in that case the 'hotKey' variable must be assigned the - // SALHOTKEY_HINT, vice viz komentar k SALHOTKEY_HINT; 'id' je unikatni identifikacni + // SALHOTKEY_HINT, for more details see the comment for SALHOTKEY_HINT; 'id' is the unique + // identifier // item's unique identifier within the plugin (for a separator it matters only if 'callGetState' is TRUE), // if 'callGetState' is TRUE, the item state is obtained by calling - // CPluginInterfaceForMenuExtAbstract::GetMenuItemState (u separatoru ma vyznam jen stav - // MENU_ITEM_STATE_HIDDEN, ostatni se ignoruji), jinak se k vypoctu stavu polozky (enabled/disabled) + // CPluginInterfaceForMenuExtAbstract::GetMenuItemState (for separators, only the + // MENU_ITEM_STATE_HIDDEN state matters; the others are ignored), otherwise the item state + // (enabled/disabled) // is computed from 'state_or'+'state_and' - the item state is calculated by first building the mask // ('eventMask') as the logical OR of all events that occurred (see // MENU_EVENT_XXX); the item is enabled if the following expression is TRUE: @@ -320,10 +322,11 @@ class CSalamanderConnectAbstract // name (max. MAX_PATH - 1 characters), 'id' is the unique menu-item identifier // within the plugin menu (for a submenu it matters only if 'callGetState' is TRUE), // if 'callGetState' is TRUE, the submenu state is obtained by calling - // CPluginInterfaceForMenuExtAbstract::GetMenuItemState (vyznam maji jen stavy + // CPluginInterfaceForMenuExtAbstract::GetMenuItemState (only the // MENU_ITEM_STATE_ENABLED and MENU_ITEM_STATE_HIDDEN states matter; the others are ignored), otherwise // the item state (enabled/disabled) is computed from 'state_or'+'state_and' - for the state calculation - // stavu polozky viz CSalamanderConnectAbstract::AddMenuItem(), parametr 'skillLevel' + // for the item state calculation, see CSalamanderConnectAbstract::AddMenuItem(); the + // 'skillLevel' parameter // specifies for which user levels the submenu is displayed; the value contains one or more // MENU_SKILLLEVEL_XXX constants ORed together; the submenu is closed by calling // CSalamanderConnectAbstract::AddSubmenuEnd(); @@ -340,7 +343,7 @@ class CSalamanderConnectAbstract // sets the item for FS in the Change Drive menu and in drive bars; 'title' is its text, // 'iconIndex' is the icon index (-1=no icon; for assigning a bitmap with icons see - // CSalamanderConnectAbstract::SetBitmapWithIcons), 'title' muze obsahovat az tri sloupce + // CSalamanderConnectAbstract::SetBitmapWithIcons), 'title' may contain up to three columns // separated by '\t' (see the Alt+F1/F2 menu); item visibility can be set // from Plugins Manager or directly from the plugin by calling // CSalamanderGeneralAbstract::SetChangeDriveMenuItemVisibility @@ -358,7 +361,7 @@ class CSalamanderConnectAbstract // bitmap width, and the icons are always 16x16 pixels; the transparent part of the icons is // purple (RGB(255,0,255)); the bitmap color depth may be 4 or 8 bits (16 or 256 // colors); ideally, prepare both color variants and choose between them according to the - // vysledku metody CSalamanderGeneralAbstract::CanUse256ColorsBitmap() + // result of CSalamanderGeneralAbstract::CanUse256ColorsBitmap() // WARNING: this method is obsolete, does not support alpha transparency; use // SetIconListForGUI() virtual void WINAPI SetBitmapWithIcons(HBITMAP bitmap) = 0; @@ -478,9 +481,10 @@ class CPluginInterfaceAbstract // 'parent' is the parent window for message boxes; 'force' is TRUE if the return // value is ignored; if it returns TRUE, this object and all other objects obtained from it // will no longer be used and the plugin will be unloaded; if a critical shutdown is in progress (see - // CSalamanderGeneralAbstract::IsCriticalShutdown), nema smysl se usera na cokoliv ptat + // CSalamanderGeneralAbstract::IsCriticalShutdown), there is no point in asking the user + // anything // (do not open any windows) - // POZOR!!! Je nutne ukoncit vsechny thready pluginu (pokud Release vrati TRUE, vola se + // WARNING!!! All plugin threads must be terminated (if Release returns TRUE, Salamander calls // FreeLibrary is called on the plugin .SPL, so the plugin code is unmapped from memory and the threads // have nothing left to run; usually neither a bug report nor Windows exception info is generated) virtual BOOL WINAPI Release(HWND parent, BOOL force) = 0; @@ -506,7 +510,7 @@ class CPluginInterfaceAbstract // called to connect the plugin to Salamander; called only after LoadConfiguration, // 'parent' is the parent of the message boxes; 'salamander' is the set of methods used to connect the plugin -/* RULES FOR IMPLEMENTING THE CONNECT METHOD + /* RULES FOR IMPLEMENTING THE CONNECT METHOD (plugins must store the configuration version - see DEMOPLUGin, variable ConfigVersion and constant CURRENT_CONFIG_VERSION; below is an illustrative EXAMPLE of adding the "dmp2" extension to DEMOPLUGin): From 3944cc47bcf429a598e5b8f93164467f4f66ed2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 06:30:29 +0200 Subject: [PATCH 635/710] [translation] Fix src/plugins/shared/spl_menu.h comments Refines translated comments in src/plugins/shared/spl_menu.h. Model: OpenAI GPT-5.4 Verification: Reviewed the final PR diff for src/plugins/shared/spl_menu.h, confirmed the file carries the required CommentsTranslationProject marker when applicable, rechecked that clang-format introduces no further delta on the delivered file, and confirmed the PR stays comment-only without code changes or broken structural comments. Telemetry: Provider-backed review stages were not used for this manual cleanup PR, so provider-call and token/request-unit totals remain zero. --- src/plugins/shared/spl_menu.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/shared/spl_menu.h b/src/plugins/shared/spl_menu.h index f7c555ef6..256680163 100644 --- a/src/plugins/shared/spl_menu.h +++ b/src/plugins/shared/spl_menu.h @@ -33,13 +33,13 @@ class CSalamanderForOperationsAbstract; class CSalamanderBuildMenuAbstract { public: - // ikony se zadavaji metodou CSalamanderBuildMenuAbstract::SetIconListForMenu, zbytek - // popisu viz CSalamanderConnectAbstract::AddMenuItem + // icons are provided through CSalamanderBuildMenuAbstract::SetIconListForMenu; for the + // rest of the description, see CSalamanderConnectAbstract::AddMenuItem virtual void WINAPI AddMenuItem(int iconIndex, const char* name, DWORD hotKey, int id, BOOL callGetState, DWORD state_or, DWORD state_and, DWORD skillLevel) = 0; - // ikony se zadavaji metodou CSalamanderBuildMenuAbstract::SetIconListForMenu, zbytek - // popisu viz CSalamanderConnectAbstract::AddSubmenuStart + // icons are provided through CSalamanderBuildMenuAbstract::SetIconListForMenu; for the + // rest of the description, see CSalamanderConnectAbstract::AddSubmenuStart virtual void WINAPI AddSubmenuStart(int iconIndex, const char* name, int id, BOOL callGetState, DWORD state_or, DWORD state_and, DWORD skillLevel) = 0; From 680b6792a456cb750e7352e5c52718ca5796f275 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 06:30:33 +0200 Subject: [PATCH 636/710] [translation] Fix src/plugins/shared/spl_arc.h comments Refines translated comments in src/plugins/shared/spl_arc.h. Model: OpenAI GPT-5.4 Verification: Reviewed the final PR diff for src/plugins/shared/spl_arc.h, confirmed the file carries the required CommentsTranslationProject marker when applicable, rechecked that clang-format introduces no further delta on the delivered file, and confirmed the PR stays comment-only without code changes or broken structural comments. Telemetry: Provider-backed review stages were not used for this manual cleanup PR, so provider-call and token/request-unit totals remain zero. --- src/plugins/shared/spl_arc.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/shared/spl_arc.h b/src/plugins/shared/spl_arc.h index 4e2a3f7a5..57959325b 100644 --- a/src/plugins/shared/spl_arc.h +++ b/src/plugins/shared/spl_arc.h @@ -119,7 +119,7 @@ class CPluginInterfaceForArchiverAbstract CDynamicString* archiveVolumes) = 0; // Function for 'panel archiver view/edit'; called before the panel with the archive is closed - // POZOR: pokud se nepodari otevrit novou cestu, archiv muze v panelu zustat (nezavisle na tom, + // WARNING: if opening the new path fails, the archive may remain in the panel (regardless of // whatever CanCloseArchive returns); this method therefore cannot be used to destroy the context; // it is intended, for example, to optimize Delete from an archive, when leaving it may // offer to 'shake' the archive @@ -128,7 +128,7 @@ class CPluginInterfaceForArchiverAbstract // 'fileName' is the archive name; 'salamander' is a set of useful methods exported by Salamander; // 'panel' identifies the panel in which the archive is open (PANEL_LEFT or PANEL_RIGHT); // returns TRUE if closing is possible; if 'force' is TRUE, it always returns TRUE; if - // critical shutdown (vice viz CSalamanderGeneralAbstract::IsCriticalShutdown), nema + // critical shutdown (for more details see CSalamanderGeneralAbstract::IsCriticalShutdown), there is // there is no point in prompting the user about anything virtual BOOL WINAPI CanCloseArchive(CSalamanderForOperationsAbstract* salamander, const char* fileName, BOOL force, int panel) = 0; @@ -158,10 +158,10 @@ class CPluginInterfaceForArchiverAbstract // their attributes must be changed before they can be deleted); if possible, // it should not display any windows (the user did not invoke this directly and it may disturb them // during other work); for longer actions it is useful to use a wait window (see - // CSalamanderGeneralAbstract::CreateSafeWaitWindow); 'fileName' je jmeno souboru + // CSalamanderGeneralAbstract::CreateSafeWaitWindow); 'fileName' is the file name // for the copy; if several files are deleted at once (this can happen, for example, after an // edited archive is closed), 'firstFile' is TRUE for the first file and FALSE for the remaining - // soubory (pouziva se ke korektnimu zobrazeni wait-okenka - viz DEMOPLUG) + // files (used to display the wait window correctly; see DEMOPLUG) // // WARNING: it is called in the main thread when a message from the disk cache is delivered to the main window - // a message is sent requesting that a temporary copy be released (typically when a viewer or an From 7c09f9b064f368dfc112386c0012fa9c3fcc0669 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 06:30:37 +0200 Subject: [PATCH 637/710] [translation] Fix src/fileswn4.cpp comments Refines translated comments in src/fileswn4.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed the final PR diff for src/fileswn4.cpp, confirmed the file carries the required CommentsTranslationProject marker when applicable, rechecked that clang-format introduces no further delta on the delivered file, and confirmed the PR stays comment-only without code changes or broken structural comments. Telemetry: Provider-backed review stages were not used for this manual cleanup PR, so provider-call and token/request-unit totals remain zero. --- src/fileswn4.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/fileswn4.cpp b/src/fileswn4.cpp index bf34f3794..d501a5720 100644 --- a/src/fileswn4.cpp +++ b/src/fileswn4.cpp @@ -1844,29 +1844,29 @@ void CFilesWindow::DrawTileItem(HDC hTgtDC, int itemIndex, RECT* itemRect, DWORD out0Len = 0; } - // vnejsi obdelnik, od ktereho mazu smerem k vnitrnimu + // outer rectangle from which I erase toward the inner one RECT outerRect = rect; outerRect.left += TILE_LEFT_MARGIN + IconSizes[iconSize]; //int oldRTop = r.top; - // vnitrni obdelnik, ke kterememu mazu + // inner rectangle toward which I erase RECT r; r.left = outerRect.left + 2; r.right = r.left + 2 + widthNeeded + 2 + 1; - int visibleLines = 1; // nazev je viditelny urcite + int visibleLines = 1; // the name is definitely visible if (out1[0] != 0) visibleLines++; if (out2[0] != 0) visibleLines++; int textH = visibleLines * FontCharHeight + 4; int textX = r.left + 2; - int textY = rect.top + (rect.bottom - rect.top - textH) / 2; // centrujeme + int textY = rect.top + (rect.bottom - rect.top - textH) / 2; // center vertically r.top = textY; r.bottom = textY + textH; - RECT focusR = r; // zazalohujeme pro kresleni focusu + RECT focusR = r; // save for focus-frame drawing if (drawFocusFrame) { From 438b94b72d1183dc95e950572de688d7862dbab5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 06:30:41 +0200 Subject: [PATCH 638/710] [translation] Fix src/drivelst.cpp comments Refines translated comments in src/drivelst.cpp. Model: OpenAI GPT-5.4 Verification: Reviewed the final PR diff for src/drivelst.cpp, confirmed the file carries the required CommentsTranslationProject marker when applicable, rechecked that clang-format introduces no further delta on the delivered file, and confirmed the PR stays comment-only without code changes or broken structural comments. Telemetry: Provider-backed review stages were not used for this manual cleanup PR, so provider-call and token/request-unit totals remain zero. --- src/drivelst.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/drivelst.cpp b/src/drivelst.cpp index af4daacce..36196170e 100644 --- a/src/drivelst.cpp +++ b/src/drivelst.cpp @@ -923,8 +923,8 @@ BOOL CheckAndConnectUNCNetworkPath(HWND parent, const char* UNCPath, BOOL& pathI } // **************************************************************************** -// tenhle kod je vzaty z Knowledge Base a slouzi k ziskani informaci o typu media -// floppy mechaniky (3.5", 5.25", 8") +// this code is taken from the Knowledge Base and is used to obtain information about the media type +// of floppy drives (3.5", 5.25", 8") /* GetDriveFormFactor returns the drive form factor. @@ -1073,7 +1073,7 @@ CDrivesList::CDrivesList(CFilesWindow* filesWindow, const char* currentPath, CachedDrivesMask = 0; CachedCloudStoragesMask = 0; - // standardne nejde o post-cmd, proto nulujeme + // this is normally not a post-command, so clear it *PostCmd = 0; *PostCmdParam = NULL; *FromContextMenu = FALSE; @@ -1658,7 +1658,7 @@ BOOL CDrivesList::BuildData(BOOL noTimeout, TDirectArray* copyDrives else { // remembered and not refreshed network drives will not be returned from GetLogicalDrives() - DWORD netDrives; // bitove pole network disku + DWORD netDrives; // bit array of network drives char netRemotePath['z' - 'a' + 1][MAX_PATH]; GetNetworkDrives(netDrives, netRemotePath); From 1489cbbad5d19baa31c84b6700c5dbe51e396541 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 06:30:45 +0200 Subject: [PATCH 639/710] [translation] Fix src/plugins/shared/lukas/lcutils.h comments Refines translated comments in src/plugins/shared/lukas/lcutils.h. Model: OpenAI GPT-5.4 Verification: Reviewed the final PR diff for src/plugins/shared/lukas/lcutils.h, confirmed the file carries the required CommentsTranslationProject marker when applicable, rechecked that clang-format introduces no further delta on the delivered file, and confirmed the PR stays comment-only without code changes or broken structural comments. Telemetry: Provider-backed review stages were not used for this manual cleanup PR, so provider-call and token/request-unit totals remain zero. --- src/plugins/shared/lukas/lcutils.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/shared/lukas/lcutils.h b/src/plugins/shared/lukas/lcutils.h index e72c72caa..5991258a7 100644 --- a/src/plugins/shared/lukas/lcutils.h +++ b/src/plugins/shared/lukas/lcutils.h @@ -4,7 +4,7 @@ #pragma once -// menu item skill level ALL (zahrnuje beginned, intermediate a advanced) +// menu item skill level ALL (includes beginner, intermediate, and advanced) #define MNTS_ALL (MNTS_B | MNTS_I | MNTS_A) #ifndef QWORD @@ -115,8 +115,8 @@ class CDialogStackAutoObject // **************************************************************************** // -// CDialogEx -- automaticky centrovany dialog, automaticky pridava a odebira -// HWND do/z DialogStack +// CDialogEx -- automatically centered dialog, automatically adds and removes +// HWND to/from DialogStack // class CDialogEx : public CDialog From 5adae64d23b0eabbd08910acacf72d91196495d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 06:35:12 +0200 Subject: [PATCH 640/710] [translation] Fix src/plugins/pictview/PVMessageEnvelope.cpp comments Refines translated comments in src/plugins/pictview/PVMessageEnvelope.cpp. Model: OpenAI GPT-5.4 Verification: Restored the original historical filename reference , confirmed the file still carries the required CommentsTranslationProject marker, reran the Czech residue checker to a clean result with the filename-stem false-positive handling, and verified that clang-format produces no remaining delta and the final PR diff stays comment-only. Telemetry: Provider-backed review stages were not used for this manual cleanup PR, so provider-call and token/request-unit totals remain zero. --- src/plugins/pictview/PVMessageEnvelope.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/pictview/PVMessageEnvelope.cpp b/src/plugins/pictview/PVMessageEnvelope.cpp index 292d8c77e..7ea85393b 100644 --- a/src/plugins/pictview/PVMessageEnvelope.cpp +++ b/src/plugins/pictview/PVMessageEnvelope.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" From 33b93911b7cded9e8d0127e111d4c1c8c5293d00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 06:44:14 +0200 Subject: [PATCH 641/710] [translation] Fix src/common/handles.cpp comments ## Summary - Refines translated comments in `src/common/handles.cpp`. - Keeps the change comment-only; no executable code was modified. - Tightens the approved wording across 8 changed comment units in the final diff. ## Model Model: OpenAI GPT-5.4 ## Verification - Full OSTranslation sequential review pipeline with requested review mode `codex`, actual review providers `codex`, `--prompt-log-mode summary`, `--copilot-event-log summary`, AST grounding through clang, Codex model `gpt-5.4` with `--codex-reasoning medium`, Copilot model `gpt-5.4`, and `--copilot-reasoning high`. - 86 comment units, 86 review results, 86 resolved results, and 86 apply results. - Branch-target comment guard passed for `src/common/handles.cpp` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. - `git diff --check -- src/common/handles.cpp` completed without diff integrity failures. ## Telemetry - Cumulative across all provider stages: 8 provider calls, 176796 estimated tokens, and 0 billing units. - Review stage actual providers: Codex-family 4 calls, 91564 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. - Non-review stages: Codex-family 4 calls, 85232 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. --- src/common/handles.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/handles.cpp b/src/common/handles.cpp index 29fa442b5..5cf52a1cc 100644 --- a/src/common/handles.cpp +++ b/src/common/handles.cpp @@ -568,7 +568,7 @@ C__Handles::~C__Handles() MB_YESNO | MB_SETFOREGROUND) == IDYES) */ { - ConnectToTraceServer(); // v pripade, ze nebyl nahozeny server + ConnectToTraceServer(); // in case the server has not been started TRACE_I("List of opened handles:"); for (int i = 0; i < Handles.Count; i++) { From fa6549ae5340c88cef8acd42d708fb6f3cb24ebc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 06:45:52 +0200 Subject: [PATCH 642/710] [translation] Fix src/common/winlib.cpp comments ## Summary - Refines translated comments in `src/common/winlib.cpp`. - Keeps the change comment-only; no executable code was modified. - Tightens the approved wording across 10 changed comment units in the final diff. ## Model Model: OpenAI GPT-5.4 ## Verification - Full OSTranslation sequential review pipeline with requested review mode `codex`, actual review providers `codex`, `--prompt-log-mode summary`, `--copilot-event-log summary`, AST grounding through clang, Codex model `gpt-5.4` with `--codex-reasoning medium`, Copilot model `gpt-5.4`, and `--copilot-reasoning high`. - 157 comment units, 157 review results, 157 resolved results, and 157 apply results. - Branch-target comment guard passed for `src/common/winlib.cpp` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. - `git diff --check -- src/common/winlib.cpp` completed without diff integrity failures. ## Telemetry - Cumulative across all provider stages: 16 provider calls, 332312 estimated tokens, and 0 billing units. - Review stage actual providers: Codex-family 15 calls, 310932 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. - Non-review stages: Codex-family 1 call, 21380 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. --- src/common/winlib.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/winlib.cpp b/src/common/winlib.cpp index 11372a806..74d7f336b 100644 --- a/src/common/winlib.cpp +++ b/src/common/winlib.cpp @@ -86,7 +86,7 @@ BOOL SetupWinLibHelp(CWinLibHelp* winLibHelp) } // **************************************************************************** -// WinLibIsWindowsVersionOrGreater (kopie SalIsWindowsVersionOrGreater) +// WinLibIsWindowsVersionOrGreater (copy of SalIsWindowsVersionOrGreater) // // Based on SDK 8.1 VersionHelpers.h // Indicates if the current OS version matches, or is greater than, the provided From a88c7262c7f92a73a5b9842af2c9d2a4f2c827bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 06:47:24 +0200 Subject: [PATCH 643/710] [translation] Fix src/plugins/shared/mhandles.cpp comments ## Summary - Refines translated comments in `src/plugins/shared/mhandles.cpp`. - Keeps the change comment-only; no executable code was modified. - Tightens the approved wording across 2 changed comment units in the final diff. ## Model Model: OpenAI GPT-5.4 ## Verification - Full OSTranslation sequential review pipeline with requested review mode `codex`, actual review providers `codex`, `--prompt-log-mode summary`, `--copilot-event-log summary`, AST grounding through clang, Codex model `gpt-5.4` with `--codex-reasoning medium`, Copilot model `gpt-5.4`, and `--copilot-reasoning high`. - 63 comment units, 63 review results, 63 resolved results, and 63 apply results. - Branch-target comment guard passed for `src/plugins/shared/mhandles.cpp` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. - `git diff --check -- src/plugins/shared/mhandles.cpp` completed without diff integrity failures. ## Telemetry - Cumulative across all provider stages: 6 provider calls, 109299 estimated tokens, and 0 billing units. - Review stage actual providers: Codex-family 3 calls, 65929 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. - Non-review stages: Codex-family 3 calls, 43370 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. --- src/plugins/shared/mhandles.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/shared/mhandles.cpp b/src/plugins/shared/mhandles.cpp index d3d97a971..90f5245be 100644 --- a/src/plugins/shared/mhandles.cpp +++ b/src/plugins/shared/mhandles.cpp @@ -704,7 +704,7 @@ C__Handles::~C__Handles() { if (CanUseTrace) { - SalamanderDebug->TraceConnectToServer(); // v pripade, ze nebyl nahozeny server + SalamanderDebug->TraceConnectToServer(); // in case the server has not been started TRACE_I("List of opened handles:"); for (int i = 0; i < Handles.Count; i++) { @@ -723,7 +723,7 @@ C__Handles::~C__Handles() { if (CanUseTrace) { - SalamanderDebug->TraceConnectToServer(); // v pripade, ze nebyl nahozeny server + SalamanderDebug->TraceConnectToServer(); // in case the server has not been started TRACE_I(__HandlesMessageNumberOpened << Handles.Count); } } From 57b36936ff3f72f9b6a0f274ef2c379fd427f2bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 06:50:09 +0200 Subject: [PATCH 644/710] [translation] Fix src/plugins/shared/lukas/str.cpp comments ## Summary - Refines translated comments in `src/plugins/shared/lukas/str.cpp`. - Keeps the change comment-only; no executable code was modified. - Tightens the approved wording across 4 changed comment units in the final diff. ## Model Model: OpenAI GPT-5.4 ## Verification - Full OSTranslation sequential review pipeline with requested review mode `codex`, actual review providers `codex`, `--prompt-log-mode summary`, `--copilot-event-log summary`, AST grounding through clang, Codex model `gpt-5.4` with `--codex-reasoning medium`, Copilot model `gpt-5.4`, and `--copilot-reasoning high`. - 7 comment units, 7 review results, 7 resolved results, and 7 apply results. - Branch-target comment guard passed for `src/plugins/shared/lukas/str.cpp` in strict and ignore-whitespace modes with 2 violations and 0 preprocessing failures. - `git diff --check -- src/plugins/shared/lukas/str.cpp` completed without diff integrity failures. ## Telemetry - Cumulative across all provider stages: 3 provider calls, 47084 estimated tokens, and 0 billing units. - Review stage actual providers: Codex-family 0 calls, 0 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. - Non-review stages: Codex-family 3 calls, 47084 estimated tokens; Copilot SDK 0 calls, 0 Copilot request units. --- src/plugins/shared/lukas/str.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/shared/lukas/str.cpp b/src/plugins/shared/lukas/str.cpp index b1e3c4299..076b25f03 100644 --- a/src/plugins/shared/lukas/str.cpp +++ b/src/plugins/shared/lukas/str.cpp @@ -10,7 +10,7 @@ WORD CType[256]; // **************************************************************************** // -// automaticka inicializace modulu +// automatic module initialization // class CSTR From de6f0cae0b44595c242a21caea173643f5921d6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:57:16 +0200 Subject: [PATCH 645/710] [translation] Fix src/drivelst.cpp comments (#1026) --- src/drivelst.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/drivelst.cpp b/src/drivelst.cpp index 36196170e..6873a2ac3 100644 --- a/src/drivelst.cpp +++ b/src/drivelst.cpp @@ -805,7 +805,7 @@ BOOL RestoreNetworkConnection(HWND parent, const char* name, const char* remoteN if (MainWindow != NULL && MainWindow->HWindow != NULL) PostMessage(MainWindow->HWindow, WM_USER_DRIVES_CHANGE, 0, 0); - break; // return TRUE + break; // function returns TRUE } } memset(dlg.Passwd, 0, sizeof(dlg.Passwd)); @@ -911,7 +911,7 @@ BOOL CheckAndConnectUNCNetworkPath(HWND parent, const char* UNCPath, BOOL& pathI } else { - if (trySharepoint) // if error 67 occurs, try calling the shell so it can make the path accessible + if (trySharepoint) // on error 67, try calling the shell to make the path accessible { SHFILEINFO fi; if (SHGetFileInfoAux(UNCPath, 0, &fi, sizeof(fi), SHGFI_ATTRIBUTES)) @@ -1153,7 +1153,7 @@ unsigned ReadCDVolNameThreadFBody(void* param) // directory accessibility test GetDisplayNameFromSystem(root, buf, MAX_PATH); HANDLES(EnterCriticalSection(&ReadCDVolNameCS)); - if (uid == ReadCDVolNameReqUID) // someone is still waiting for an answer + if (uid == ReadCDVolNameReqUID) // someone is still waiting for the response lstrcpyn(ReadCDVolNameBuffer, buf, MAX_PATH); HANDLES(LeaveCriticalSection(&ReadCDVolNameCS)); } @@ -1490,12 +1490,12 @@ void InitOneDrivePath() HKEY hKey; char path[MAX_PATH]; - for (int i = 0; !done && i < 2; i++) // theoretically only needed for Windows 8 and earlier (since 8.1 we have FOLDERID_SkyDrive) + for (int i = 0; !done && i < 2; i++) // theoretically only needed for Windows 8 and earlier (from 8.1 onward we have FOLDERID_SkyDrive) { if (HANDLES_Q(RegOpenKeyEx(HKEY_CURRENT_USER, - Windows8_1AndLater && !Windows10AndLater ? (i == 0 ? "Software\\Microsoft\\Windows\\CurrentVersion\\OneDrive" : // jen Win 8.1 + Windows8_1AndLater && !Windows10AndLater ? (i == 0 ? "Software\\Microsoft\\Windows\\CurrentVersion\\OneDrive" : // Windows 8.1 only "Software\\Microsoft\\Windows\\CurrentVersion\\SkyDrive") - : (i == 0 ? "Software\\Microsoft\\OneDrive" : "Software\\Microsoft\\SkyDrive"), // krom Win 8.1 + : (i == 0 ? "Software\\Microsoft\\OneDrive" : "Software\\Microsoft\\SkyDrive"), // except Windows 8.1 0, KEY_READ, &hKey)) == ERROR_SUCCESS) { DWORD size = sizeof(path); // size in bytes @@ -1536,7 +1536,7 @@ void InitOneDrivePath() size = sizeof(path); // size in bytes if (SalRegQueryValueEx(hAccount, "UserFolder", 0, &type, (BYTE*)path, &size) == ERROR_SUCCESS && type == REG_SZ && size > 1) - { // Collect everything that has DisplayName and UserFolder and offer it to the user under "OneDrive" + { // Collect every item that has DisplayName and UserFolder and offer it to the user as "OneDrive" //TRACE_I("OneDrive Business: DisplayName: " << disp << ", UserFolder: " << path); OneDriveBusinessStorages.SortIn(new COneDriveBusinessStorage(DupStr(disp), DupStr(path))); } @@ -2196,7 +2196,7 @@ BOOL CDrivesList::BuildData(BOOL noTimeout, TDirectArray* copyDrives if (Drives->Count > 0 && IsLastItemSeparator()) Drives->Delete(Drives->Count - 1); - if (drv.DestroyIcon) // not a hot path, so we have to destroy the icon here + if (drv.DestroyIcon) // not a hot path, so we must destroy the icon here { HANDLES(DestroyIcon(drv.HIcon)); } @@ -2892,7 +2892,7 @@ BOOL CDrivesList::OnContextMenu(BOOL posByMouse, int itemIndex, int panel, const *FromContextMenu = TRUE; return TRUE; } - else // just closing Change Drive menu + else // just closing the Change Drive menu { *PostCmd = 0; // not needed (set from constructor), just for clarity *FromContextMenu = TRUE; @@ -2998,7 +2998,7 @@ BOOL CDrivesList::OnContextMenu(BOOL posByMouse, int itemIndex, int panel, const for (i = 0; i < 2; i++) { win = i == 0 ? MainWindow->LeftPanel : MainWindow->RightPanel; - if (HasTheSameRootPath(win->GetPath(), path)) // same drive (local and UNC) + if (HasTheSameRootPath(win->GetPath(), path)) // same drive (local or UNC) { if (i == 0) releaseLeft = TRUE; @@ -3058,9 +3058,9 @@ BOOL CDrivesList::OnContextMenu(BOOL posByMouse, int itemIndex, int panel, const DisplayMenuAux(MainWindow->ContextMenuChngDrv, (CMINVOKECOMMANDINFO*)&ici); - // the context menu can change the clipboard, so we will check it ... + // the context menu can change the clipboard, so we will verify it ... IdleRefreshStates = TRUE; // we will force the check of the state variables at the next Idle - IdleCheckClipboard = TRUE; // we will the clipboard to be checked as well + IdleCheckClipboard = TRUE; // we will force the clipboard check as well UpdateWindow(MainWindow->HWindow); if (releaseLeft && !changeToFixedDrv) From 67d26bba334f430d1bc57d26592dcc4e71c7da59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:57:20 +0200 Subject: [PATCH 646/710] [translation] Fix src/common/array.h comments (#1027) --- src/common/array.h | 76 ++++++++++++++++++++++------------------------ 1 file changed, 37 insertions(+), 39 deletions(-) diff --git a/src/common/array.h b/src/common/array.h index eba656d11..2ea3e0ba1 100644 --- a/src/common/array.h +++ b/src/common/array.h @@ -48,26 +48,25 @@ std::ostream& operator<<(std::ostream& out, const CErrorType& err); // **************************************************************************** // TDirectArray: -// -behaves like classic array, in addition it can pre-allocate to bigger or -// smaller (look at constructor 'base' and 'delta' values). -// -when adding item to array, copy-constructor is called -// -when deleting item, item destructor is called, you can change this behaviour, -// see CallDestructor method -// -you can use this array for simple types and also for objects which does not -// contain pointers to its own data, reason: -// objects are moved in array (e.g. when reallocating array or when inserting -// item to the beginning of array) simply by using memmove, so during these -// moves contructors/destructors are not called, example: -// char Path[MAX_PATH]; // full file name -// char *Name; // points to 'Path' to file name (without path) -// SOLUTION: store only offsets instead of complete pointers +// - behaves like a classic array but can pre-allocate either more or less +// space (see the constructor parameters 'base' and 'delta') +// - calls the copy constructor when an item is added +// - calls the destructor when an item is removed; use CallDestructor to adjust +// that behavior if necessary +// - suitable for simple types and objects that do not hold pointers to their +// own data; items are shifted within the array (for example, when the +// array is reallocated or an item is inserted at the beginning) with +// memmove, so constructors and destructors are not invoked. Example: +// char Path[MAX_PATH]; // full file name +// char* Name; // points within 'Path' to the file name (without the path) +// Solution: store only offsets instead of raw pointers template class TDirectArray { public: - CErrorType State; // etNone if array is OK, otherwise some error occured - int Count; // current count of items in array + CErrorType State; // etNone if array is OK, otherwise an error occurred + int Count; // current number of items in the array TDirectArray(int base, int delta); virtual ~TDirectArray() { Destroy(); } @@ -97,12 +96,12 @@ class TDirectArray TRACE_C("Index is out of range (index = " << index << ", Count = " << Count << ")."); Error(etUnknownIndex); - return Data[0]; // compiler workaround: return a possibly invalid item + return Data[0]; // return an (invalid) item to satisfy the compiler } #endif } - DATA_TYPE& operator[](int index) // returns a reference to the item at 'index' + DATA_TYPE& operator[](int index) // returns a reference to the item at position 'index' { #if defined(_DEBUG) || defined(__ARRAY_DEBUG) if (index >= 0 && index < Count) @@ -114,7 +113,7 @@ class TDirectArray TRACE_C("Index is out of range (index = " << index << ", Count = " << Count << ")."); Error(etUnknownIndex); - return Data[0]; // compiler workaround: return a possibly invalid item + return Data[0]; // return an (invalid) item to satisfy the compiler } #endif } @@ -131,12 +130,12 @@ class TDirectArray void DestroyMembers(); // release items from memory (calling destructors), keep array void DetachMembers(); // detach all items (destructors are NOT called), keep array void Destroy(); // complete array destruction (calling destructors) - void Delete(int index); // deletes the item at 'index' (calling the destructor), moves remaining items - void Delete(int index, int count); // delete 'count' items at 'index' position (calling destructors), move remaining items - void Detach(int index); // detach item at 'index' position (destructor is NOT called), move remaining items - void Detach(int index, int count); // detach 'count' items at 'index' position (destructors are NOT called), move remaining items + void Delete(int index); // delete the item at position 'index' (calls the destructor) and shift the rest + void Delete(int index, int count); // delete 'count' items at position 'index' (calls destructors) and shift the rest + void Detach(int index); // detach the item at position 'index' (does NOT call the destructor) and shift the rest + void Detach(int index, int count); // detach 'count' items at position 'index' (does NOT call destructors) and shift the rest - int SetDelta(int delta); // change 'Delta', return the actual value used; NOTE: can be used only for an empty array + int SetDelta(int delta); // change 'Delta', return real used value; NOTE: can be used only for empty array protected: DATA_TYPE* Data; // pointer to array @@ -332,7 +331,7 @@ class TSmallerDirectArray #if defined(_DEBUG) || defined(__ARRAY_DEBUG) CErrorType State; // if not etNone, an error has occurred #endif - DATA_TYPE* Data; // ukazatel na pole, public nutne misto etDestructed + DATA_TYPE* Data; // pointer to the array; stays public because we do not track etDestructed here WORD Count; // current item count in the collection TSmallerDirectArray(); @@ -436,19 +435,18 @@ class TSmallerDirectArray // **************************************************************************** // TClassArray: -// -suitable for storing many small objects; element indexes do not change -// -allocates CLASS_TYPE objects directly in the array, -// calling the constructors and destructors of those objects -// -no element-shifting operations are performed on the array, so an element -// always stays at the same index -// -valid array element: (index_prvku < Count && !At(index_prvku).IsEmpty()) +// - suitable for storing many small objects; element indexes do not change +// - allocates CLASS_TYPE objects directly in the array and calls their +// constructors and destructors +// - never shifts entries within the array, so each item remains at the same index +// - an array slot is valid if (item_index < Count && !At(item_index).IsEmpty()) // -// requirements for CLASS_TYPE: -// 1) an IsEmpty() method that returns whether the object's -// destructor has already been called -// 2) operator 'new' defined using the DEFINE_NEW(CLASS_TYPE) macro +// requirements on CLASS_TYPE: +// 1) provide the IsEmpty() method that returns whether the destructor has +// already been called +// 2) define the 'new' operator using the DEFINE_NEW(CLASS_TYPE) macro // -// example: +// Example: // class CSimpleObject // { // public: @@ -464,10 +462,10 @@ class TSmallerDirectArray // // TClassArray Simples(10, 5); // -// adding an element to the array: -// int index_prvku = Simples.FirstFreeIndex; // prvni volny index v poli -// new (&Simples)CSimpleObject(); // returns the address of the object, NULL on error, -// // the element was added and has index index_prvku +// Adding an item to the array: +// int item_index = Simples.FirstFreeIndex; // first free index in the array +// new (&Simples)CSimpleObject(); // returns the object address, NULL on error, +// // item was added and has index item_index template class TClassArray : public TDirectArray From 2f1d4d698ac0359d44ea8e38677d0127c39fb08e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:57:24 +0200 Subject: [PATCH 647/710] [translation] Fix src/common/trace.cpp comments (#1028) --- src/common/trace.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/trace.cpp b/src/common/trace.cpp index 8d1107b87..a2184f089 100644 --- a/src/common/trace.cpp +++ b/src/common/trace.cpp @@ -494,7 +494,7 @@ BOOL C__Trace::Connect(BOOL onUserRequest) // try to open the mutex for access to the shared memory HANDLE hOpenConnectionMutex; hOpenConnectionMutex = OpenMutex(/*MUTEX_ALL_ACCESS*/ SYNCHRONIZE, FALSE, __OPEN_CONNECTION_MUTEX); - if (hOpenConnectionMutex != NULL) // server available + if (hOpenConnectionMutex != NULL) // server found { // acquire ConnectionMutex DWORD waitRet; @@ -1150,7 +1150,7 @@ C__Trace::SendMessageToServer(C__MessageType type, BOOL crash) if (msgBoxOpened) { while (1) - Sleep(1000); // blokace vede na deadlock napr. kdyz je (a nema byt) TRACE_C v DLL_THREAD_DETACH + Sleep(1000); // Blocking causes a deadlock, for example if TRACE_C is used in DLL_THREAD_DETACH, where it must not be. } } } From 08b2312ac6abe4f7e90c68983149390288bde9cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:57:27 +0200 Subject: [PATCH 648/710] [translation] Fix src/lang/texts.rc2 comments (#1029) --- src/lang/texts.rc2 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/lang/texts.rc2 b/src/lang/texts.rc2 index 069bb047e..51a6d4d46 100644 --- a/src/lang/texts.rc2 +++ b/src/lang/texts.rc2 @@ -1,4 +1,5 @@ -#include "..\texts.rh2" +// CommentsTranslationProject: TRANSLATED +#include "..\texts.rh2" STRINGTABLE { @@ -1415,8 +1416,8 @@ STRINGTABLE IDS_GETCOMPRFILESIZEERROR, "Unable to get compressed file size for file: ""%s""\nError: %s\nDo you want to skip all similar errors?" - // pozor %s zde nesmi byt v uvozovkach, protoze bude obsahovat variabilni texty, - // ktere uvozovky budou mit + // Note: %s must not be in quotation marks here, because it will contain variable text + // that already includes quotation marks. IDS_CONFIRM_NTFSCOMPRESS, "Are you sure you want to compress %s?\n\nWarning: files and directories will be decrypted before compressing." IDS_CONFIRM_NTFSUNCOMPRESS, "Are you sure you want to uncompress %s?" IDS_CONFIRM_NTFSENCRYPT, "Are you sure you want to encrypt %s?\n\nWarning: files and directories will be uncompressed before encrypting." @@ -1451,7 +1452,7 @@ STRINGTABLE // // plural strings -- begin // -// znaky '<' a '>' ohranicuji oblast, kterou lze mysi prenest na clipboard +// the '<' and '>' characters mark the area that can be copied to the clipboard with the mouse IDS_PLURAL_X_BYTES, "{!}%s byte{s|0||1|s}" @@ -1484,6 +1485,7 @@ STRINGTABLE IDS_DLG_PLURAL_X_DIRS, "{!}%d Director{y|1|ies}" IDS_DLG_PLURAL_X_FILES_Y_DIRS, "{!}%d File{|1|s} and %d Director{y|1|ies}" +// Keep the original Czech plural examples below as reference data; do not translate this block. // IDS_PLURAL_X_FILES, "{!}%d {vybraný soubor|1|vybrané soubory|4|vybraných souborů}" // IDS_PLURAL_X_DIRS, "{!}%d {vybraný adresář|1|vybrané adresáře|4|vybraných adresářů}" // IDS_PLURAL_X_FILES_Y_DIRS, "{!}%d {vybraný soubor|1|vybrané soubory|4|vybraných souborů} a %d {vybraný adresář|1|vybrané adresáře|4|vybraných adresářů}" From 6ba499a83b95195e018d775cd5b121081c402044 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:57:31 +0200 Subject: [PATCH 649/710] [translation] Fix src/plugins/automation/versinfo.rh2 comments (#1030) --- src/plugins/automation/versinfo.rh2 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/automation/versinfo.rh2 b/src/plugins/automation/versinfo.rh2 index 694953665..c6f6e30a2 100644 --- a/src/plugins/automation/versinfo.rh2 +++ b/src/plugins/automation/versinfo.rh2 @@ -1,4 +1,5 @@ -/* +// CommentsTranslationProject: TRANSLATED +/* Automation Plugin for Open Salamander Copyright (c) 2009-2023 Milan Kase @@ -18,7 +19,7 @@ #define VERSINFO_MAJOR 1 #define VERSINFO_MINORA 7 -#define VERSINFO_MINORB 0 // POZOR: tady musi byt 0, jinak vyleti assert pri buildu +#define VERSINFO_MINORB 0 // Must be 0, otherwise the build will hit an assert. #include "spl_vers.h" // get version and build numbers From 9895d1ffa539c8adb28c3d6e88c7cefe9a02a973 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:57:34 +0200 Subject: [PATCH 650/710] [translation] Fix src/plugins/checksum/checksum.rh2 comments (#1031) --- src/plugins/checksum/checksum.rh2 | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/plugins/checksum/checksum.rh2 b/src/plugins/checksum/checksum.rh2 index a47e02b24..dc55ccebb 100644 --- a/src/plugins/checksum/checksum.rh2 +++ b/src/plugins/checksum/checksum.rh2 @@ -1,4 +1,5 @@ -// WARNING: cannot be replaced by "#pragma once" because it is included from .rc file and it seems resource compiler does not support "#pragma once" +// CommentsTranslationProject: TRANSLATED +// WARNING: cannot be replaced with "#pragma once" because this file is included from a .rc file, and the resource compiler does not seem to support "#pragma once". #ifndef __CHECKSUM_RH2 #define __CHECKSUM_RH2 @@ -86,17 +87,17 @@ #define IDC_CFG_SUM_1 100 -//#define IDC_CFG_CRC IDC_CFG_SUM_1 // tenhle zapis nezkompiluje HTML Help Compiler +//#define IDC_CFG_CRC IDC_CFG_SUM_1 // this form will not compile in HTML Help Compiler #define IDC_CFG_CRC 100 -//#define IDC_CFG_MD5 (IDC_CFG_CRC+1) // tenhle zapis nezkompiluje HTML Help Compiler +//#define IDC_CFG_MD5 (IDC_CFG_CRC+1) // this form won't compile in HTML Help Compiler #define IDC_CFG_MD5 101 -//#define IDC_CFG_SHA1 (IDC_CFG_MD5+1) // tenhle zapis nezkompiluje HTML Help Compiler +//#define IDC_CFG_SHA1 (IDC_CFG_MD5+1) // HTML Help Compiler won't compile this form #define IDC_CFG_SHA1 102 -//#define IDC_CFG_SHA256 (IDC_CFG_SHA1+1) // tenhle zapis nezkompiluje HTML Help Compiler +//#define IDC_CFG_SHA256 (IDC_CFG_SHA1+1) // HTML Help Compiler won't compile this form #define IDC_CFG_SHA256 103 -//#define IDC_CFG_SHA512 (IDC_CFG_SHA256+1) // tenhle zapis nezkompiluje HTML Help Compiler +//#define IDC_CFG_SHA512 (IDC_CFG_SHA256+1) // HTML Help Compiler won't compile this form #define IDC_CFG_SHA512 104 -//#define IDC_CFG_SUM_COUNT (IDC_CFG_SHA512+1) // tenhle zapis nezkompiluje HTML Help Compiler +//#define IDC_CFG_SUM_COUNT (IDC_CFG_SHA512+1) // this form won't compile in HTML Help Compiler #define IDC_CFG_SUM_COUNT 105 #endif // __CHECKSUM_RH2 From fbe078a8fc5fb1fe671e3d1ddc8d100cec728aa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:57:39 +0200 Subject: [PATCH 651/710] [translation] Fix src/plugins/regedt/regedt.rh2 comments (#1032) --- src/plugins/regedt/regedt.rh2 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/plugins/regedt/regedt.rh2 b/src/plugins/regedt/regedt.rh2 index 25e5b87a5..577aa4f6b 100644 --- a/src/plugins/regedt/regedt.rh2 +++ b/src/plugins/regedt/regedt.rh2 @@ -1,4 +1,5 @@ -// WARNING: cannot be replaced by "#pragma once" because it is included from .rc file and it seems resource compiler does not support "#pragma once" +// CommentsTranslationProject: TRANSLATED +// WARNING: cannot be replaced with "#pragma once" because this file is included from a .rc file, and the resource compiler does not seem to support "#pragma once". #ifndef __REGEDT_RH2 #define __REGEDT_RH2 @@ -7,7 +8,7 @@ #endif //defined(APSTUDIO_INVOKED) && !defined(APSTUDIO_READONLY_SYMBOLS) #define IDC_STATIC_1 700 -#include "statics.rh2" // 700 az 739 jsou timto zabrane !!! +#include "statics.rh2" // 700 to 739 are reserved by this include. #define IDI_REGEDT 500 #define IDI_SZ 501 @@ -16,7 +17,7 @@ #define IDI_FIND 504 #define IDB_REGEDT 505 -// menu commandy +// menu commands #define CMD_EXPORT 800 #define CMD_SEARCH 801 #define CMD_NEWVALUE 802 @@ -183,7 +184,7 @@ #define IDS_EXP_BROWSE 1164 #define IDS_EXP_SALDIR 1165 -// IDcka pro propojeni s helpem +// IDs for linking to Help #define IDH_SEARCHREG 1500 #define IDH_NEWKEY 1501 #define IDH_NEWVALUE 1502 From f003713800e879ea03bc0c1fa6dd1d1bf6f5f4ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:57:42 +0200 Subject: [PATCH 652/710] [translation] Fix src/plugins/unmime/unmime.rh2 comments (#1033) --- src/plugins/unmime/unmime.rh2 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/unmime/unmime.rh2 b/src/plugins/unmime/unmime.rh2 index 904e1a7c5..1f741d456 100644 --- a/src/plugins/unmime/unmime.rh2 +++ b/src/plugins/unmime/unmime.rh2 @@ -1,4 +1,5 @@ -// WARNING: cannot be replaced by "#pragma once" because it is included from .rc file and it seems resource compiler does not support "#pragma once" +// CommentsTranslationProject: TRANSLATED +// WARNING: cannot be replaced with "#pragma once" because this file is included from a .rc file, and the resource compiler does not seem to support "#pragma once". #ifndef __UNMIME_RH2 #define __UNMIME_RH2 @@ -7,11 +8,11 @@ #endif //defined(APSTUDIO_INVOKED) && !defined(APSTUDIO_READONLY_SYMBOLS) #define IDC_STATIC_1 2000 -#include "statics.rh2" // 2000 az 2039 jsou timto zabrane !!! +#include "statics.rh2" // 2000 to 2039 are reserved by this include. // ******************************************************************************** // -// TEXTY +// STRINGS // #define IDS_PLUGINNAME 1 From 31e55417ab84892c7040f182c7863f0376515c17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:57:46 +0200 Subject: [PATCH 653/710] [translation] Fix src/plugins/unrar/unrar.rh2 comments (#1034) --- src/plugins/unrar/unrar.rh2 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/plugins/unrar/unrar.rh2 b/src/plugins/unrar/unrar.rh2 index 08455cdd6..97a2e141b 100644 --- a/src/plugins/unrar/unrar.rh2 +++ b/src/plugins/unrar/unrar.rh2 @@ -1,4 +1,5 @@ -// WARNING: cannot be replaced by "#pragma once" because it is included from .rc file and it seems resource compiler does not support "#pragma once" +// CommentsTranslationProject: TRANSLATED +// WARNING: cannot be replaced with "#pragma once" because this file is included from a .rc file, and the resource compiler does not seem to support "#pragma once". #ifndef __UNRAR_RH2 #define __UNRAR_RH2 @@ -7,11 +8,11 @@ #endif //defined(APSTUDIO_INVOKED) && !defined(APSTUDIO_READONLY_SYMBOLS) #define IDC_STATIC_1 300 -#include "statics.rh2" // 300 az 339 jsou timto zabrane !!! +#include "statics.rh2" // 300 to 339 are reserved by this include. //*********************************************************************************** // -// texty +// strings // #define IDS_PLUGINNAME 1000 @@ -55,7 +56,7 @@ //*********************************************************************************** // -// ikony +// icons // #define IDI_LOCK 500 From 1d47f6125e9c465b2ff128730d6a98912f3b761b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:57:50 +0200 Subject: [PATCH 654/710] [translation] Fix src/plugins/filecomp/filecomp.rh2 comments (#1035) --- src/plugins/filecomp/filecomp.rh2 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/plugins/filecomp/filecomp.rh2 b/src/plugins/filecomp/filecomp.rh2 index 8ab67b553..51eaabf29 100644 --- a/src/plugins/filecomp/filecomp.rh2 +++ b/src/plugins/filecomp/filecomp.rh2 @@ -1,4 +1,5 @@ -// WARNING: cannot be replaced by "#pragma once" because it is included from .rc file and it seems resource compiler does not support "#pragma once" +// CommentsTranslationProject: TRANSLATED +// WARNING: cannot be replaced with "#pragma once" because this file is included from a .rc file, and the resource compiler does not seem to support "#pragma once". #ifndef __FILECOMP_RH2 #define __FILECOMP_RH2 @@ -7,7 +8,7 @@ #endif //defined(APSTUDIO_INVOKED) && !defined(APSTUDIO_READONLY_SYMBOLS) #define IDC_STATIC_1 300 -#include "statics.rh2" // 300 az 339 jsou timto zabrane !!! +#include "statics.rh2" // 300 to 339 are reserved by this include. #define IDI_FCICO 500 #define IDC_SPLIT_VERT 501 @@ -18,7 +19,7 @@ //*********************************************************************************** // -// texty +// strings // #define IDS_PLUGINNAME 1000 @@ -122,7 +123,7 @@ //*********************************************************************************** // -// virtualni IDcka - pouze pro vazbu s helpem +// virtual IDs - used only for help mapping // #define IDH_KEYBOARD 400 From 109b4ed2da4dd349f9b7cff0ed8c2d29816f4a70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:57:54 +0200 Subject: [PATCH 655/710] [translation] Fix src/plugins/pictview/pvw32cnv.rh2 comments (#1036) --- src/plugins/pictview/pvw32cnv.rh2 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/pictview/pvw32cnv.rh2 b/src/plugins/pictview/pvw32cnv.rh2 index d5804a9b0..71d9ca045 100644 --- a/src/plugins/pictview/pvw32cnv.rh2 +++ b/src/plugins/pictview/pvw32cnv.rh2 @@ -1,6 +1,7 @@ -// Petr: tento soubor existuje jen pro generovani symbols\plugins\pictview\symbols.inc davkou tools\export_translator\export_inc.py +// CommentsTranslationProject: TRANSLATED +// Petr: this file exists only to generate symbols\plugins\pictview\symbols.inc using tools\export_translator\export_inc.py -// Petr: pridal jsem IDS_PVW32Cnv_XXXX, aby nervala quiet-validace v Translatoru +// Petr: I added IDS_PVW32Cnv_XXXX so the quiet validation in Translator wouldn't complain. #define IDS_PVW32Cnv_4003 4003 #define IDS_PVW32Cnv_4004 4004 #define IDS_PVW32Cnv_4006 4006 From 9c8240fcf9af2e9697f649cb9a80c44b8f583248 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:57:57 +0200 Subject: [PATCH 656/710] [translation] Fix src/plugins/pictview/pictview.rh2 comments (#1037) --- src/plugins/pictview/pictview.rh2 | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/plugins/pictview/pictview.rh2 b/src/plugins/pictview/pictview.rh2 index f4e318fec..45c90aca6 100644 --- a/src/plugins/pictview/pictview.rh2 +++ b/src/plugins/pictview/pictview.rh2 @@ -1,4 +1,5 @@ -// WARNING: cannot be replaced by "#pragma once" because it is included from .rc file and it seems resource compiler does not support "#pragma once" +// CommentsTranslationProject: TRANSLATED +// WARNING: cannot be replaced with "#pragma once" because this file is included from a .rc file, and the resource compiler does not seem to support "#pragma once". #ifndef __PICTVIEW_RH2 #define __PICTVIEW_RH2 @@ -7,16 +8,16 @@ #endif //defined(APSTUDIO_INVOKED) && !defined(APSTUDIO_READONLY_SYMBOLS) #define IDC_STATIC_1 3000 -#include "statics.rh2" // 3000 az 3039 jsou timto zabrane !!! +#include "statics.rh2" // 3000 to 3039 are reserved by this include. -// ikona pro hlavni okno +// icon for the main window #define IDI_WINDOW_ICON 70 #define IDI_SB_ANCHOR 71 #define IDI_SB_CURSOR 72 #define IDI_SB_PIPETTE 73 #define IDI_SB_SIZE 74 -// kruzory: normalni a sevrena ruka +// cursors: normal and clenched hand #define IDC_HAND1 80 #define IDC_HAND2 81 #define IDC_PIPETA 82 @@ -26,7 +27,7 @@ #define IDA_ACCELERATORS 90 -// nastrojove listy +// toolbars #define IDB_TOOLBAR16 95 #define IDB_TOOLBAR256 96 #define IDB_PICTVIEW 97 @@ -120,7 +121,7 @@ #define CMD_ZOOM_INMAX 193 #define CMD_IMG_COPYTO 194 -// Petr: zakomentoval jsem, uz snad nebude nikdy potreba... +// Petr: I commented this out; hopefully it will never be needed again... //#define CMD_INTERNAL_REFRESHLPANEL 195 //#define CMD_INTERNAL_REFRESHRPANEL 196 @@ -128,7 +129,7 @@ #define CMD_INTERNAL_SAVEAS 198 #define CMD_INTERNAL_SCAN_EXTRA_IMAGES 199 -// intervaly pro Recent Files/Directories +// command ID ranges for Recent Files/Directories #define CMD_RECENTFILES_FIRST 460 #define CMD_RECENTFILES_LAST 469 #define CMD_RECENRDIRS_FIRST 470 @@ -200,7 +201,7 @@ #define IDS_MENU_EDIT_LEFT 543 #define IDS_MENU_EDIT_FLIPV 544 #define IDS_MENU_EDIT_FLIPH 545 -// 550 az 552 jsou zabrane +// 550 to 552 are reserved #define IDS_MENU_VIEW 560 #define IDS_MENU_VIEW_ZOOMIN 561 @@ -465,7 +466,7 @@ // Texts for PVW32Cnv.dll - reserved IDs 4000-4999 !!! #define IDS_DLL 4000 -// IDcka stranek v html helpu +// HTML Help page IDs #define IDH_INTRODUCTION 3500 #define IDH_SCANIMAGE 3501 #define IDH_SCREENCAPTURE 3502 From fb21d7184603629f1b782702bb9be536e3e6dbf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:58:01 +0200 Subject: [PATCH 657/710] [translation] Fix src/texts.rh2 comments (#1038) --- src/texts.rh2 | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/texts.rh2 b/src/texts.rh2 index 7674be6a6..b90f404dc 100644 --- a/src/texts.rh2 +++ b/src/texts.rh2 @@ -1,4 +1,5 @@ -// WARNING: cannot be replaced by "#pragma once" because it is included from .rc file and it seems resource compiler does not support "#pragma once" +// CommentsTranslationProject: TRANSLATED +// WARNING: cannot be replaced by "#pragma once" because it is included from .rc file and it seems resource compiler does not support "#pragma once" #ifndef __TEXTS_RH2 #define __TEXTS_RH2 @@ -1078,7 +1079,7 @@ #define IDS_BUTTON_CONTINUE 10847 #define IDS_BUTTON_YES 10848 #define IDS_BUTTON_NO 10849 -// nechat jeste par polozek rezervu +// keep a few items reserved #define IDS_ESCAPE 10860 #define IDS_F11 10861 @@ -1182,7 +1183,7 @@ #define IDS_BROWSEONERRGOTOTITLE 10950 // Configuration: Drives: text of Browse (...) path window: Select the path you want to visit when current path in panel is inaccessible #define IDS_BROWSEONERRGOTOTEXT 10951 -// 10952 je uz pouzite +// 10952 is already used // Error Opening Alternate Data Stream dialog: second item in menu on Ignore button: Ignore &All #define IDS_ERROPENADS_IGNOREALL 10955 @@ -1339,7 +1340,7 @@ #define IDS_PACK_EXE_UZP16 11067 #define IDS_PACK_EXE_BROWSE 11068 -// 11070 je zabrany pro IDS_PACKRET_BREAK2 +// 11070 is reserved for IDS_PACKRET_BREAK2 #define IDS_PACKQRY_PREFIX 11101 // User query, whether discard root dir in archive while compressing @@ -1562,7 +1563,7 @@ // plugins manager/test all: all plugins seem to work correctly #define IDS_PLUGINTESTALLOK 12108 -// 12109 je zabrane !!! +// 12109 is reserved !!! // plugins manager/column name #define IDS_PLUGINS_NAME 12110 @@ -1702,7 +1703,7 @@ // There are no items in this panel. #define IDS_NOITEMSINPANEL 12233 -// text, ktery je pridan ke jmenu plug-inu, aby zvyraznil ze jde o plug-in - " (Plug-in)" +// text appended to the plug-in name to highlight that it is a plug-in - " (Plug-in)" #define IDS_PLUGINSUFFIX 12235 // task list dialog: You cannot break this task. Use another From 6641e2ce685df42496869a7ef01cf37daa6181ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:58:05 +0200 Subject: [PATCH 658/710] [translation] Fix src/plugins/winscp/copy-to-petr-pc.bat comments (#1039) --- src/plugins/winscp/copy-to-petr-pc.bat | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/winscp/copy-to-petr-pc.bat b/src/plugins/winscp/copy-to-petr-pc.bat index 0a11ea490..ceca920c8 100644 --- a/src/plugins/winscp/copy-to-petr-pc.bat +++ b/src/plugins/winscp/copy-to-petr-pc.bat @@ -1,3 +1,4 @@ +@rem CommentsTranslationProject: TRANSLATED @echo off call :langcopy_bat english call :langcopy_bat czech @@ -24,7 +25,7 @@ for %%v in (vc2019) do ( exit /b -rem ---------------------------- Copy rutina pro jazyky +rem ---------------------------- Copy routine for languages :langcopy_bat @@ -40,7 +41,7 @@ for %%v in (vc2019) do ( exit /b -rem ---------------------------- Copy rutina +rem ---------------------------- Copy routine :mycopy_bat From 179446c1364e1410c46187759543c4bb05789337 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:58:09 +0200 Subject: [PATCH 659/710] [translation] Fix src/plugins/winscp/help/hh/salamander_help_shared.css comments (#1040) --- src/plugins/winscp/help/hh/salamander_help_shared.css | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/winscp/help/hh/salamander_help_shared.css b/src/plugins/winscp/help/hh/salamander_help_shared.css index a0f833192..1797e92c2 100644 --- a/src/plugins/winscp/help/hh/salamander_help_shared.css +++ b/src/plugins/winscp/help/hh/salamander_help_shared.css @@ -1,3 +1,4 @@ +/* CommentsTranslationProject: TRANSLATED */ /* Cascading Style Sheet for Open Salamander Help */ /* Shared part used for both CHM and WEB */ @@ -206,14 +207,14 @@ #help_page td.hdr { - /* tmavsi seda na leve strane */ + /* darker gray on the left side */ margin: .25em; background: #dddddd; vertical-align: top; padding: 2px 4px; font-weight: bold; - width: 10%; /* zuzime levou stranu tabulky na minimum */ - padding-right :10px; /* ale nechame tam alespon 10 bodu, at to trochu vypada */ + width: 10%; /* narrow the left side of the table to the minimum */ + padding-right :10px; /* but keep at least 10 points there so it still looks decent */ white-space: nowrap; } From 150adbc06b22c17a12f1f2746924b4a22ce69783 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:58:13 +0200 Subject: [PATCH 660/710] [translation] Fix src/plugins/automation/help/hh/salamander_help_shared.css comments (#1041) --- src/plugins/automation/help/hh/salamander_help_shared.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/automation/help/hh/salamander_help_shared.css b/src/plugins/automation/help/hh/salamander_help_shared.css index a0f833192..f259c75cd 100644 --- a/src/plugins/automation/help/hh/salamander_help_shared.css +++ b/src/plugins/automation/help/hh/salamander_help_shared.css @@ -1,3 +1,4 @@ +/* CommentsTranslationProject: TRANSLATED */ /* Cascading Style Sheet for Open Salamander Help */ /* Shared part used for both CHM and WEB */ @@ -206,14 +207,14 @@ #help_page td.hdr { - /* tmavsi seda na leve strane */ + /* darker gray on the left side */ margin: .25em; background: #dddddd; vertical-align: top; padding: 2px 4px; font-weight: bold; - width: 10%; /* zuzime levou stranu tabulky na minimum */ - padding-right :10px; /* ale nechame tam alespon 10 bodu, at to trochu vypada */ + width: 10%; /* narrow the left side of the table to the minimum */ + padding-right :10px; /* but keep at least 10 points there so it still looks decent */ white-space: nowrap; } @@ -322,4 +323,3 @@ padding-left: 4px; text-align: left; } - From 2348bf7b27ad1c090ba3e45df07aa79d351542c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:58:16 +0200 Subject: [PATCH 661/710] [translation] Fix src/plugins/checksum/help/hh/salamander_help_shared.css comments (#1042) --- src/plugins/checksum/help/hh/salamander_help_shared.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/checksum/help/hh/salamander_help_shared.css b/src/plugins/checksum/help/hh/salamander_help_shared.css index a0f833192..f259c75cd 100644 --- a/src/plugins/checksum/help/hh/salamander_help_shared.css +++ b/src/plugins/checksum/help/hh/salamander_help_shared.css @@ -1,3 +1,4 @@ +/* CommentsTranslationProject: TRANSLATED */ /* Cascading Style Sheet for Open Salamander Help */ /* Shared part used for both CHM and WEB */ @@ -206,14 +207,14 @@ #help_page td.hdr { - /* tmavsi seda na leve strane */ + /* darker gray on the left side */ margin: .25em; background: #dddddd; vertical-align: top; padding: 2px 4px; font-weight: bold; - width: 10%; /* zuzime levou stranu tabulky na minimum */ - padding-right :10px; /* ale nechame tam alespon 10 bodu, at to trochu vypada */ + width: 10%; /* narrow the left side of the table to the minimum */ + padding-right :10px; /* but keep at least 10 points there so it still looks decent */ white-space: nowrap; } @@ -322,4 +323,3 @@ padding-left: 4px; text-align: left; } - From 7ae60b118014d4dfbebfb82d7b43a0a029363f11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:58:20 +0200 Subject: [PATCH 662/710] [translation] Fix src/plugins/demoplug/help/hh/salamander_help_shared.css comments (#1043) --- src/plugins/demoplug/help/hh/salamander_help_shared.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/demoplug/help/hh/salamander_help_shared.css b/src/plugins/demoplug/help/hh/salamander_help_shared.css index a0f833192..f259c75cd 100644 --- a/src/plugins/demoplug/help/hh/salamander_help_shared.css +++ b/src/plugins/demoplug/help/hh/salamander_help_shared.css @@ -1,3 +1,4 @@ +/* CommentsTranslationProject: TRANSLATED */ /* Cascading Style Sheet for Open Salamander Help */ /* Shared part used for both CHM and WEB */ @@ -206,14 +207,14 @@ #help_page td.hdr { - /* tmavsi seda na leve strane */ + /* darker gray on the left side */ margin: .25em; background: #dddddd; vertical-align: top; padding: 2px 4px; font-weight: bold; - width: 10%; /* zuzime levou stranu tabulky na minimum */ - padding-right :10px; /* ale nechame tam alespon 10 bodu, at to trochu vypada */ + width: 10%; /* narrow the left side of the table to the minimum */ + padding-right :10px; /* but keep at least 10 points there so it still looks decent */ white-space: nowrap; } @@ -322,4 +323,3 @@ padding-left: 4px; text-align: left; } - From 826ec7614472fa86635173c03c909bfd63b70f9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:58:24 +0200 Subject: [PATCH 663/710] [translation] Fix src/plugins/ftp/help/hh/salamander_help_shared.css comments (#1044) --- src/plugins/ftp/help/hh/salamander_help_shared.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/ftp/help/hh/salamander_help_shared.css b/src/plugins/ftp/help/hh/salamander_help_shared.css index a0f833192..f259c75cd 100644 --- a/src/plugins/ftp/help/hh/salamander_help_shared.css +++ b/src/plugins/ftp/help/hh/salamander_help_shared.css @@ -1,3 +1,4 @@ +/* CommentsTranslationProject: TRANSLATED */ /* Cascading Style Sheet for Open Salamander Help */ /* Shared part used for both CHM and WEB */ @@ -206,14 +207,14 @@ #help_page td.hdr { - /* tmavsi seda na leve strane */ + /* darker gray on the left side */ margin: .25em; background: #dddddd; vertical-align: top; padding: 2px 4px; font-weight: bold; - width: 10%; /* zuzime levou stranu tabulky na minimum */ - padding-right :10px; /* ale nechame tam alespon 10 bodu, at to trochu vypada */ + width: 10%; /* narrow the left side of the table to the minimum */ + padding-right :10px; /* but keep at least 10 points there so it still looks decent */ white-space: nowrap; } @@ -322,4 +323,3 @@ padding-left: 4px; text-align: left; } - From 907753b55cd204148e6fc8e04a42b558fc505ab4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:58:27 +0200 Subject: [PATCH 664/710] [translation] Fix src/plugins/pictview/help/hh/salamander_help_shared.css comments (#1045) --- src/plugins/pictview/help/hh/salamander_help_shared.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/pictview/help/hh/salamander_help_shared.css b/src/plugins/pictview/help/hh/salamander_help_shared.css index a0f833192..f259c75cd 100644 --- a/src/plugins/pictview/help/hh/salamander_help_shared.css +++ b/src/plugins/pictview/help/hh/salamander_help_shared.css @@ -1,3 +1,4 @@ +/* CommentsTranslationProject: TRANSLATED */ /* Cascading Style Sheet for Open Salamander Help */ /* Shared part used for both CHM and WEB */ @@ -206,14 +207,14 @@ #help_page td.hdr { - /* tmavsi seda na leve strane */ + /* darker gray on the left side */ margin: .25em; background: #dddddd; vertical-align: top; padding: 2px 4px; font-weight: bold; - width: 10%; /* zuzime levou stranu tabulky na minimum */ - padding-right :10px; /* ale nechame tam alespon 10 bodu, at to trochu vypada */ + width: 10%; /* narrow the left side of the table to the minimum */ + padding-right :10px; /* but keep at least 10 points there so it still looks decent */ white-space: nowrap; } @@ -322,4 +323,3 @@ padding-left: 4px; text-align: left; } - From f65f25b6ccb1b2ca2fea903552c862bfea67ee18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:58:31 +0200 Subject: [PATCH 665/710] [translation] Fix src/plugins/regedt/help/hh/salamander_help_shared.css comments (#1046) --- src/plugins/regedt/help/hh/salamander_help_shared.css | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/regedt/help/hh/salamander_help_shared.css b/src/plugins/regedt/help/hh/salamander_help_shared.css index a0f833192..1797e92c2 100644 --- a/src/plugins/regedt/help/hh/salamander_help_shared.css +++ b/src/plugins/regedt/help/hh/salamander_help_shared.css @@ -1,3 +1,4 @@ +/* CommentsTranslationProject: TRANSLATED */ /* Cascading Style Sheet for Open Salamander Help */ /* Shared part used for both CHM and WEB */ @@ -206,14 +207,14 @@ #help_page td.hdr { - /* tmavsi seda na leve strane */ + /* darker gray on the left side */ margin: .25em; background: #dddddd; vertical-align: top; padding: 2px 4px; font-weight: bold; - width: 10%; /* zuzime levou stranu tabulky na minimum */ - padding-right :10px; /* ale nechame tam alespon 10 bodu, at to trochu vypada */ + width: 10%; /* narrow the left side of the table to the minimum */ + padding-right :10px; /* but keep at least 10 points there so it still looks decent */ white-space: nowrap; } From ebc221f5434ba197f62936d08516477528808386 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:58:35 +0200 Subject: [PATCH 666/710] [translation] Fix src/plugins/tar/help/hh/salamander_help_shared.css comments (#1047) --- src/plugins/tar/help/hh/salamander_help_shared.css | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/tar/help/hh/salamander_help_shared.css b/src/plugins/tar/help/hh/salamander_help_shared.css index a0f833192..1797e92c2 100644 --- a/src/plugins/tar/help/hh/salamander_help_shared.css +++ b/src/plugins/tar/help/hh/salamander_help_shared.css @@ -1,3 +1,4 @@ +/* CommentsTranslationProject: TRANSLATED */ /* Cascading Style Sheet for Open Salamander Help */ /* Shared part used for both CHM and WEB */ @@ -206,14 +207,14 @@ #help_page td.hdr { - /* tmavsi seda na leve strane */ + /* darker gray on the left side */ margin: .25em; background: #dddddd; vertical-align: top; padding: 2px 4px; font-weight: bold; - width: 10%; /* zuzime levou stranu tabulky na minimum */ - padding-right :10px; /* ale nechame tam alespon 10 bodu, at to trochu vypada */ + width: 10%; /* narrow the left side of the table to the minimum */ + padding-right :10px; /* but keep at least 10 points there so it still looks decent */ white-space: nowrap; } From 5fc82eeda1511f4da629d45f2ee51125ee9a9f6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:58:38 +0200 Subject: [PATCH 667/710] [translation] Fix src/plugins/uncab/help/hh/salamander_help_shared.css comments (#1048) --- src/plugins/uncab/help/hh/salamander_help_shared.css | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/uncab/help/hh/salamander_help_shared.css b/src/plugins/uncab/help/hh/salamander_help_shared.css index a0f833192..1797e92c2 100644 --- a/src/plugins/uncab/help/hh/salamander_help_shared.css +++ b/src/plugins/uncab/help/hh/salamander_help_shared.css @@ -1,3 +1,4 @@ +/* CommentsTranslationProject: TRANSLATED */ /* Cascading Style Sheet for Open Salamander Help */ /* Shared part used for both CHM and WEB */ @@ -206,14 +207,14 @@ #help_page td.hdr { - /* tmavsi seda na leve strane */ + /* darker gray on the left side */ margin: .25em; background: #dddddd; vertical-align: top; padding: 2px 4px; font-weight: bold; - width: 10%; /* zuzime levou stranu tabulky na minimum */ - padding-right :10px; /* ale nechame tam alespon 10 bodu, at to trochu vypada */ + width: 10%; /* narrow the left side of the table to the minimum */ + padding-right :10px; /* but keep at least 10 points there so it still looks decent */ white-space: nowrap; } From c0c5d935afc9364d513ef40b0163c824c12b9940 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:58:42 +0200 Subject: [PATCH 668/710] [translation] Fix src/plugins/unchm/help/hh/salamander_help_shared.css comments (#1049) --- src/plugins/unchm/help/hh/salamander_help_shared.css | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/unchm/help/hh/salamander_help_shared.css b/src/plugins/unchm/help/hh/salamander_help_shared.css index a0f833192..1797e92c2 100644 --- a/src/plugins/unchm/help/hh/salamander_help_shared.css +++ b/src/plugins/unchm/help/hh/salamander_help_shared.css @@ -1,3 +1,4 @@ +/* CommentsTranslationProject: TRANSLATED */ /* Cascading Style Sheet for Open Salamander Help */ /* Shared part used for both CHM and WEB */ @@ -206,14 +207,14 @@ #help_page td.hdr { - /* tmavsi seda na leve strane */ + /* darker gray on the left side */ margin: .25em; background: #dddddd; vertical-align: top; padding: 2px 4px; font-weight: bold; - width: 10%; /* zuzime levou stranu tabulky na minimum */ - padding-right :10px; /* ale nechame tam alespon 10 bodu, at to trochu vypada */ + width: 10%; /* narrow the left side of the table to the minimum */ + padding-right :10px; /* but keep at least 10 points there so it still looks decent */ white-space: nowrap; } From aae56dd98479712490948cab1fb6c6929ec3f04f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:58:46 +0200 Subject: [PATCH 669/710] [translation] Fix src/plugins/undelete/help/hh/salamander_help_shared.css comments (#1050) --- src/plugins/undelete/help/hh/salamander_help_shared.css | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/undelete/help/hh/salamander_help_shared.css b/src/plugins/undelete/help/hh/salamander_help_shared.css index a0f833192..1797e92c2 100644 --- a/src/plugins/undelete/help/hh/salamander_help_shared.css +++ b/src/plugins/undelete/help/hh/salamander_help_shared.css @@ -1,3 +1,4 @@ +/* CommentsTranslationProject: TRANSLATED */ /* Cascading Style Sheet for Open Salamander Help */ /* Shared part used for both CHM and WEB */ @@ -206,14 +207,14 @@ #help_page td.hdr { - /* tmavsi seda na leve strane */ + /* darker gray on the left side */ margin: .25em; background: #dddddd; vertical-align: top; padding: 2px 4px; font-weight: bold; - width: 10%; /* zuzime levou stranu tabulky na minimum */ - padding-right :10px; /* ale nechame tam alespon 10 bodu, at to trochu vypada */ + width: 10%; /* narrow the left side of the table to the minimum */ + padding-right :10px; /* but keep at least 10 points there so it still looks decent */ white-space: nowrap; } From b080da5c9c791ab6ed6e55e896538adac7954903 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:58:49 +0200 Subject: [PATCH 670/710] [translation] Fix src/plugins/unlha/help/hh/salamander_help_shared.css comments (#1051) --- src/plugins/unlha/help/hh/salamander_help_shared.css | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/unlha/help/hh/salamander_help_shared.css b/src/plugins/unlha/help/hh/salamander_help_shared.css index a0f833192..1797e92c2 100644 --- a/src/plugins/unlha/help/hh/salamander_help_shared.css +++ b/src/plugins/unlha/help/hh/salamander_help_shared.css @@ -1,3 +1,4 @@ +/* CommentsTranslationProject: TRANSLATED */ /* Cascading Style Sheet for Open Salamander Help */ /* Shared part used for both CHM and WEB */ @@ -206,14 +207,14 @@ #help_page td.hdr { - /* tmavsi seda na leve strane */ + /* darker gray on the left side */ margin: .25em; background: #dddddd; vertical-align: top; padding: 2px 4px; font-weight: bold; - width: 10%; /* zuzime levou stranu tabulky na minimum */ - padding-right :10px; /* ale nechame tam alespon 10 bodu, at to trochu vypada */ + width: 10%; /* narrow the left side of the table to the minimum */ + padding-right :10px; /* but keep at least 10 points there so it still looks decent */ white-space: nowrap; } From 4ee0f71e306830f9e580e085ab801b115bc9aaae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:58:53 +0200 Subject: [PATCH 671/710] [translation] Fix src/plugins/unrar/help/hh/salamander_help_shared.css comments (#1052) --- src/plugins/unrar/help/hh/salamander_help_shared.css | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/unrar/help/hh/salamander_help_shared.css b/src/plugins/unrar/help/hh/salamander_help_shared.css index a0f833192..1797e92c2 100644 --- a/src/plugins/unrar/help/hh/salamander_help_shared.css +++ b/src/plugins/unrar/help/hh/salamander_help_shared.css @@ -1,3 +1,4 @@ +/* CommentsTranslationProject: TRANSLATED */ /* Cascading Style Sheet for Open Salamander Help */ /* Shared part used for both CHM and WEB */ @@ -206,14 +207,14 @@ #help_page td.hdr { - /* tmavsi seda na leve strane */ + /* darker gray on the left side */ margin: .25em; background: #dddddd; vertical-align: top; padding: 2px 4px; font-weight: bold; - width: 10%; /* zuzime levou stranu tabulky na minimum */ - padding-right :10px; /* ale nechame tam alespon 10 bodu, at to trochu vypada */ + width: 10%; /* narrow the left side of the table to the minimum */ + padding-right :10px; /* but keep at least 10 points there so it still looks decent */ white-space: nowrap; } From 7f42f834139c7071f57904bb132b7d9d2d96d827 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:58:57 +0200 Subject: [PATCH 672/710] [translation] Fix src/lang/lang.rc2 comments (#1053) --- src/lang/lang.rc2 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lang/lang.rc2 b/src/lang/lang.rc2 index 66df709ee..0a742bcb2 100644 --- a/src/lang/lang.rc2 +++ b/src/lang/lang.rc2 @@ -1,4 +1,5 @@ -// +// CommentsTranslationProject: TRANSLATED +// // lang.rc2 - resources Microsoft Visual C++ does not edit directly // @@ -35,7 +36,7 @@ IDM_VIEWERMENU MENU MENUITEM "&Refresh\tCtrl+R", CM_REREADFILE MENUITEM SEPARATOR -// POZOR: pokud se zmeni index tohoto submenu, je potreba zmenit VIEWER_FILE_MENU_OTHFILESINDEX +// WARNING: if the index of this submenu changes, VIEWER_FILE_MENU_OTHFILESINDEX must also be updated POPUP "Ot&her Files" { MENUITEM "&Previous\tBackspace", CM_PREVFILE From a80d29ea6b7ce50cda75ce7dbff881d6f34e4f2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:59:00 +0200 Subject: [PATCH 673/710] [translation] Fix src/plugins/undelete/library/volenum.cpp comments (#1054) --- src/plugins/undelete/library/volenum.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/undelete/library/volenum.cpp b/src/plugins/undelete/library/volenum.cpp index 38c5cac7c..e87c050a0 100644 --- a/src/plugins/undelete/library/volenum.cpp +++ b/src/plugins/undelete/library/volenum.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "precomp.h" #include "..\undelete.rh2" @@ -73,7 +74,7 @@ BOOL GetDiskFreeSpace95(const char* path, LPDWORD lpSectorsPerCluster, memset(&gdfs, 0, sizeof(gdfs)); gdfs.ExtFree_Level = 0; // required - reg.reg_EBX = 0; // jen tak pro formu + reg.reg_EBX = 0; // just for completeness reg.reg_EDX = (DWORD)(DWORD_PTR)path; // type cast is OK, we will not run it on x64 reg.reg_ECX = sizeof(gdfs); reg.reg_EDI = (DWORD)(DWORD_PTR)&gdfs; // type cast is OK, we will not run it on x64 From 48ae9ef82556f5e57dc2eb19a8d51d34c3cd3fd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:59:04 +0200 Subject: [PATCH 674/710] [translation] Fix src/plugins/zip/common.h comments (#1055) --- src/plugins/zip/common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/zip/common.h b/src/plugins/zip/common.h index 976d93c39..cd50b6a1d 100644 --- a/src/plugins/zip/common.h +++ b/src/plugins/zip/common.h @@ -168,7 +168,7 @@ class CZipCommon CEOCentrDirRecordEx EOCentrDir; //end of central directory record QWORD CentrDirSize; QWORD CentrDirOffs; - int CentrDirStartDisk; //jen pro list a extract + int CentrDirStartDisk; //only for list and extract // number of the disk with the start of the central directory bool Zip64; QWORD ExtraBytes; From 35fec9a738ec9ac68cf7f0e1d7322ba1dbac0ce3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:59:08 +0200 Subject: [PATCH 675/710] [translation] Fix src/consts.h comments (#1056) --- src/consts.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/consts.h b/src/consts.h index 0cca62f5f..f16056c83 100644 --- a/src/consts.h +++ b/src/consts.h @@ -838,6 +838,8 @@ WCHAR* LoadStrW(int resID, HINSTANCE hInstance = NULL); // loads wide-string fro // - "{!}director{y|1|ies}" for parameter values from 0 to 1 (inclusive) will // be "directory", and for values from 2 to "infinity" (2^64-1) will be // "directories" +// - keep the following Czech example unchanged: it documents the original +// plural grammar encoding and is intentionally not translated // - "{!}soubo{rů|0|r|1|ry|4|rů}" for parameter value 0 will be "souborů", for // 1 will be "soubor", for 2 to 4 (inclusive) will be "soubory", and from 5 // to "infinity" will be "souborů" From 79723f6d368864b39c0352bb42848c2efb6390f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:59:11 +0200 Subject: [PATCH 676/710] [translation] Fix src/plugins/shared/dbg.cpp comments (#1057) --- src/plugins/shared/dbg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/shared/dbg.cpp b/src/plugins/shared/dbg.cpp index 2ab65b1a3..3509fa740 100644 --- a/src/plugins/shared/dbg.cpp +++ b/src/plugins/shared/dbg.cpp @@ -374,7 +374,7 @@ void C__Trace::SendMessageToServer(BOOL information, BOOL unicode, BOOL crash) if (msgBoxOpened) { while (1) - Sleep(1000); // blokace vede na deadlock napr. kdyz je (a nema byt) TRACE_C v DLL_THREAD_DETACH + Sleep(1000); // blocking here causes a deadlock, for example when TRACE_C is present in DLL_THREAD_DETACH even though it must not be } } } From 5cc4c422a9546e33e41e87c2959100e5947552d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:59:15 +0200 Subject: [PATCH 677/710] [translation] Fix src/plugins/shared/spl_fs.h comments (#1058) --- src/plugins/shared/spl_fs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/shared/spl_fs.h b/src/plugins/shared/spl_fs.h index 0d6c063fd..96042571e 100644 --- a/src/plugins/shared/spl_fs.h +++ b/src/plugins/shared/spl_fs.h @@ -347,8 +347,8 @@ class CPluginFSInterfaceAbstract // receives information about a change on path 'path' (if 'includingSubdirs' is TRUE, it // also includes changes in subdirectories of path 'path'); this method should decide // whether this FS needs to be refreshed (for example via method - // CSalamanderGeneralAbstract::PostRefreshPanelFS); tyka se jak aktivnich FS, tak - // detached FSs; 'fsName' is the current FS name + // CSalamanderGeneralAbstract::PostRefreshPanelFS); this applies to both active + // FSs and detached FSs; 'fsName' is the current FS name // NOTE: for the plugin as a whole, there is also the method // CPluginInterfaceAbstract::AcceptChangeOnPathNotification() virtual void WINAPI AcceptChangeOnPathNotification(const char* fsName, const char* path, From b49ba923bf1c7215c5af410a8671dcf9e0db58bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:59:18 +0200 Subject: [PATCH 678/710] [translation] Fix src/resource.rh2 comments (#1059) --- src/resource.rh2 | 91 ++++++++++++++++++++++++------------------------ 1 file changed, 46 insertions(+), 45 deletions(-) diff --git a/src/resource.rh2 b/src/resource.rh2 index db2fd652b..146accb0d 100644 --- a/src/resource.rh2 +++ b/src/resource.rh2 @@ -1,4 +1,5 @@ // WARNING: cannot be replaced by "#pragma once" because it is included from .rc file and it seems resource compiler does not support "#pragma once" +// CommentsTranslationProject: TRANSLATED #ifndef __RESOURCE_RH2 #define __RESOURCE_RH2 @@ -9,7 +10,7 @@ #define IDC_STATIC_1 1150 #include "plugins\shared\statics.rh2" -// virtualni IDcka - pouze pro vazbu mezi dialogem a helpem +// virtual IDs - used only to link dialogs with help #define IDD_COPYDIALOG 105 #define IDD_MOVEDIALOG 106 #define IDD_EDITNEWDIALOG 107 @@ -41,18 +42,18 @@ #define IDH_VIEWERINTRO 140 #define IDH_GROUPPOLICY 141 #define IDH_PWDMANAGER 142 -// virtualni IDcka - END +// virtual IDs - END // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! FREESPACE -#define IDS_ZIPLINE1 491 // IDS_ZIPLINE1 .. IDS_ZIPLINE5 musi byt zasebou +#define IDS_ZIPLINE1 491 // IDS_ZIPLINE1 .. IDS_ZIPLINE5 must stay consecutive #define IDS_ZIPLINE2 492 #define IDS_ZIPLINE3 493 #define IDS_ZIPLINE4 494 #define IDS_ZIPLINE5 495 // commands -#define CM_AUTOCONFIG 685 // KICKER - zatim jen pro ladeni... +#define CM_AUTOCONFIG 685 // KICKER - currently only for debugging... #define CM_CONFIGURATION 686 #define CM_SAVECONFIG 687 @@ -256,10 +257,10 @@ #define CM_TASKLIST 856 -#define CM_MENU 857 // vstoupi do MenuLoop (F10 || Alt || BottomTooblar) -#define CM_CONTEXTMENU 858 // otevre context menu k focusu/selectu (Shift+F10 || VK_APPS) +#define CM_MENU 857 // enters MenuLoop (F10 || Alt || BottomToolbar) +#define CM_CONTEXTMENU 858 // opens the context menu for the focus/selection (Shift+F10 || VK_APPS) -#define CM_SHARES 859 // zobrazi seznam sdilenych adresaru +#define CM_SHARES 859 // shows the list of shared directories #define CM_TOGGLEMIDDLETOOLBAR 860 #define CM_CUSTOMIZEMIDDLE 861 @@ -277,12 +278,12 @@ // characters coding #define CM_CODING_MIN 871 -// rezervovat az do 920 (vcetne) +// reserve up to 920 (inclusive) #define CM_CODING_MAX 920 #define CM_SEC_PERMISSIONS 921 -#define CM_DIRMENU 924 // otevre CtxMenu pro aktualni adresar aktivniho panelu +#define CM_DIRMENU 924 // opens CtxMenu for the current directory of the active panel #define CM_CUSTOMIZE_HOTPATHS 925 #define CM_CUSTOMIZE_USERMENU 926 @@ -351,7 +352,7 @@ #define IDB_BOTTOMTOOLBAR 993 #define IDB_HEADER 994 // header: Up/Down #define IDB_MENU 995 // menu: Dot/Up/Down -#define IDB_EDTLBTB 996 // EditListBox - bitmapy pro toolbaru JRYFIXME: TOOLBARHDR_USE_SVG +#define IDB_EDTLBTB 996 // EditListBox - toolbar bitmaps JRYFIXME: TOOLBARHDR_USE_SVG #define IDB_FILTER 997 #define IDB_UPDOWN 999 // Menu popup/Up Down arrow #define IDB_ZOOM 1000 // Zoom Panel @@ -371,7 +372,7 @@ #define IDV_ARROW_MORE 1030 #define IDV_ARROW_LESS 1031 -#define CM_NEWMENU_MIN 1200 // interval vyhrazeny pro prikazy menu New +#define CM_NEWMENU_MIN 1200 // range reserved for New menu commands #define CM_NEWMENU_MAX 2200 #define CM_HELP_CONTENTS 2210 @@ -382,7 +383,7 @@ //#define CM_HELP_TIP 2215 #define CM_HELP_ABOUT 2216 -// commands pro find dialog +// commands for the Find dialog #define CM_FIND_EXIT 2220 #define CM_FIND_VIEW 2221 #define CM_FIND_ALTVIEW 2222 @@ -407,7 +408,7 @@ #define CM_FIND_ADD_CURRENT 2247 #define CM_FIND_MANAGE 2248 #define CM_FIND_PROPERTIES 2249 -#define CM_FIND_OPTIONS_FIRST 2250 // prvnich tricet polozek z options +#define CM_FIND_OPTIONS_FIRST 2250 // the first thirty items from options #define CM_FIND_OPTIONS_LAST 2280 #define CM_FIND_HIDESEL 2281 #define CM_FIND_DELETE 2282 @@ -424,23 +425,23 @@ #define CM_FIND_IGNORE 2293 #define CM_FIND_FULLROWSEL 2294 -#define CM_ACTIVEHOTPATH_MIN 2400 // goto hot path X (rezervace pro HOT_PATHS_COUNT) +#define CM_ACTIVEHOTPATH_MIN 2400 // goto hot path X (reservation for HOT_PATHS_COUNT) #define CM_ACTIVEHOTPATH_MAX 2429 -#define CM_LEFTHOTPATH_MIN 2430 // goto hot path X (rezervace pro HOT_PATHS_COUNT) +#define CM_LEFTHOTPATH_MIN 2430 // goto hot path X (reservation for HOT_PATHS_COUNT) #define CM_LEFTHOTPATH_MAX 2469 -#define CM_RIGHTHOTPATH_MIN 2470 // goto hot path X (rezervace pro HOT_PATHS_COUNT) +#define CM_RIGHTHOTPATH_MIN 2470 // goto hot path X (reservation for HOT_PATHS_COUNT) #define CM_RIGHTHOTPATH_MAX 2499 //#define IDD_TIPOFTHEDAY 2720 -#define CM_LEFTHISTORYPATH_MIN 2840 // historie adresaru pro menu Go To +#define CM_LEFTHISTORYPATH_MIN 2840 // directory history for the Go To menu #define CM_LEFTHISTORYPATH_MAX 2849 -#define CM_RIGHTHISTORYPATH_MIN 2850 // historie adresaru pro menu Go To +#define CM_RIGHTHISTORYPATH_MIN 2850 // directory history for the Go To menu #define CM_RIGHTHISTORYPATH_MAX 2859 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! FREESPACE -// vyhrazene intervaly pro SortBy a FixedWidth po 20 polozkach; vic proste nezobrazime +// ranges reserved for SortBy and FixedWidth, 20 items each; we simply do not show more #define CM_LEFTSORTBY_MIN 2890 #define CM_LEFTSORTBY_MAX 2909 #define CM_RIGHTSORTBY_MIN 2910 @@ -452,23 +453,23 @@ #define CM_LEFTVIEWMODE 2932 #define CM_RIGHTVIEWMODE 2933 -#define CM_ACTIVEZOOMPANEL 2934 // maximalizuje aktivni panel nebo ho vraci zpet +#define CM_ACTIVEZOOMPANEL 2934 // maximizes the active panel or restores it #define CM_LEFTZOOMPANEL 2935 #define CM_RIGHTZOOMPANEL 2936 -#define CM_FULLSCREEN 2937 // maximalizuje hlavni okno a vraci ho zpet +#define CM_FULLSCREEN 2937 // maximizes the main window or restores it #define CM_GOTO_PREV_SEL 2938 #define CM_GOTO_NEXT_SEL 2939 -#define CM_OPEN_IN_OTHER_PANEL 2940 // otevre focusene jmeno v druhem panelu -#define CM_OPEN_IN_OTHER_PANEL_ACT 2941 // zaroven aktivuje druhy panel +#define CM_OPEN_IN_OTHER_PANEL 2940 // opens the focused name in the other panel +#define CM_OPEN_IN_OTHER_PANEL_ACT 2941 // also activates the other panel -// nechat rezervu +// keep some reserve -#define CM_HIDE_SELECTED_NAMES 2945 // schova z panelu oznacena jmena -#define CM_HIDE_UNSELECTED_NAMES 2946 // schova z panelu neoznacena jmena -#define CM_SHOW_ALL_NAME 2947 // zobrazi v panelu vsechna jmena +#define CM_HIDE_SELECTED_NAMES 2945 // hides selected names from the panel +#define CM_HIDE_UNSELECTED_NAMES 2946 // hides unselected names from the panel +#define CM_SHOW_ALL_NAME 2947 // shows all names in the panel #define CM_TOGGLEPLUGINSBAR 2950 @@ -476,40 +477,40 @@ #define CM_LEFT_SMARTMODE 2952 #define CM_RIGHT_SMARTMODE 2953 -#define CM_ACTIVEMODE_1 2970 // Alt+1..0 pro volbu rezimu aktivniho pohledu +#define CM_ACTIVEMODE_1 2970 // Alt+1..0 to select the active view mode #define CM_ACTIVEMODE_2 2971 #define CM_ACTIVEMODE_3 2972 #define CM_ACTIVEMODE_10 2979 -#define CM_LEFTMODE_1 2980 // volba rezimu leveho pohledu +#define CM_LEFTMODE_1 2980 // select the left view mode #define CM_LEFTMODE_2 2981 #define CM_LEFTMODE_3 2982 #define CM_LEFTMODE_10 2989 -#define CM_RIGHTMODE_1 2990 // volba rezimu praveho pohledu +#define CM_RIGHTMODE_1 2990 // select the right view mode #define CM_RIGHTMODE_2 2991 #define CM_RIGHTMODE_3 2992 #define CM_RIGHTMODE_10 2999 -#define CM_USERMENU_MIN 3000 // interval vyhrazeny pro prikazy user-menu +#define CM_USERMENU_MIN 3000 // range reserved for user-menu commands #define CM_USERMENU_MAX 3499 -#define CM_DRIVEBAR_MIN 3500 // interval vyhrazeny pro drive bar +#define CM_DRIVEBAR_MIN 3500 // range reserved for the drive bar #define CM_DRIVEBAR_MAX 3749 -#define CM_DRIVEBAR2_MIN 3750 // interval vyhrazeny pro drive bar 2 +#define CM_DRIVEBAR2_MIN 3750 // range reserved for drive bar 2 #define CM_DRIVEBAR2_MAX 4000 -#define CM_PLUGINCMD_MIN 4001 // interval vyhrazeny pro prikazy z plug-inu +#define CM_PLUGINCMD_MIN 4001 // range reserved for plug-in commands #define CM_PLUGINCMD_MAX 4700 -#define CM_VIEWWITH_MIN 4701 // interval vyhrazeny pro prikazy view-with +#define CM_VIEWWITH_MIN 4701 // range reserved for view-with commands #define CM_VIEWWITH_MAX 5000 -#define CM_PLUGINABOUT_MIN 5001 // interval vyhrazeny pro abouty plug-inu +#define CM_PLUGINABOUT_MIN 5001 // range reserved for plug-in about dialogs #define CM_PLUGINABOUT_MAX 5500 -// command labels CML_xxx - nejde o normalni commandy, ale o pomocne identifikatory -// separatoru a popup menu, pomoci kterych lze snadno identifikovat a lokalizovat -// polozku menu +// command labels CML_xxx - these are not normal commands, but helper identifiers +// for separators and popup menus, which make it easy to identify and localize +// a menu item #define CML_LEFT 5501 #define CML_LEFT_CHANGEDRIVE 5502 #define CML_LEFT_VIEWS1 5503 @@ -559,13 +560,13 @@ #define CML_LAST 5999 -#define CM_PLUGINCFG_MIN 7001 // interval vyhrazeny pro konfiguraci plug-inu +#define CM_PLUGINCFG_MIN 7001 // range reserved for plug-in configuration #define CM_PLUGINCFG_MAX 7500 -#define CM_EDITWITH_MIN 7501 // interval vyhrazeny pro prikazy edit-with +#define CM_EDITWITH_MIN 7501 // range reserved for edit-with commands #define CM_EDITWITH_MAX 7800 -//#define CM_INTERNALVIEWER_MIN 6000 // interval vyhrazeny pro internal viewer +//#define CM_INTERNALVIEWER_MIN 6000 // range reserved for the internal viewer //#define CM_INTERNALVIEWER_MAX 6300 // icons @@ -591,8 +592,8 @@ #define CM_FILEEND 6057 #define CM_LEFT 6058 #define CM_RIGHT 6059 -#define CM_TO_HEX 6060 // pozor - musi byt o 1 mensi nez CM_TO_TEXT -#define CM_TO_TEXT 6061 // pozor - musi byt o 1 vetsi nez CM_TO_HEX +#define CM_TO_HEX 6060 // warning - must be 1 less than CM_TO_TEXT +#define CM_TO_TEXT 6061 // warning - must be 1 greater than CM_TO_HEX #define CM_COPYTOCLIP 6062 #define CM_FINDSET 6063 #define CM_FINDNEXT 6064 @@ -635,7 +636,7 @@ #define IDT_AUTOSCROLL 6200 #define IDT_THUMBSCROLL 6201 -//#define CM_TEXTS_MIN 10000 // interval vyhrazeny pro texty +//#define CM_TEXTS_MIN 10000 // range reserved for texts //#define CM_TEXTS_MAX 18000 #endif // __RESOURCE_RH2 From e23aba0e84f9e01989c4af3b32787fe285a0bb58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:59:22 +0200 Subject: [PATCH 679/710] [translation] Fix tools/salbreak/md5.cpp comments (#1060) --- tools/salbreak/md5.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/salbreak/md5.cpp b/tools/salbreak/md5.cpp index e7cdc79ea..235d961cb 100644 --- a/tools/salbreak/md5.cpp +++ b/tools/salbreak/md5.cpp @@ -1,9 +1,10 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include "md5.h" -// aby nedochazelo k problemum se stredniky v nize nadefinovanych makrech +// to avoid problems with semicolons in the macros defined below inline void __TraceEmptyFunction() {} #define TRACE_E(str) __TraceEmptyFunction() From 66a23ffc4c0aee62c2be37b96388455c00a78615 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:59:27 +0200 Subject: [PATCH 680/710] [translation] Fix tools/salbreak/salbreak.cpp comments (#1061) --- tools/salbreak/salbreak.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/tools/salbreak/salbreak.cpp b/tools/salbreak/salbreak.cpp index 14f570a4c..e4f446bd4 100644 --- a/tools/salbreak/salbreak.cpp +++ b/tools/salbreak/salbreak.cpp @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include #include @@ -11,9 +12,9 @@ #define MAX_LOADSTRING 100 -#define NOHANDLES(function) function // obrana proti zanaseni maker HANDLES do zdrojaku pomoci CheckHnd +#define NOHANDLES(function) function // protects against polluting the source with HANDLES macros via CheckHnd -// aby nedochazelo k problemum se stredniky v nize nadefinovanych makrech +// to avoid problems with semicolons in the macros defined below inline void __TraceEmptyFunction() {} #define TRACE_E(str) __TraceEmptyFunction() @@ -259,7 +260,7 @@ BOOL GetStringSid(LPTSTR* stringSid) return FALSE; } - // volajici musi uvolnit vracenou pamet pomoci LocalFree, viz MSDN + // the caller must free the returned memory with LocalFree, see MSDN ConvertSidToStringSid(pTokenUser->User.Sid, stringSid); free(pTokenUser); @@ -362,13 +363,13 @@ BOOL GetSidMD5(BYTE* sidMD5) */ /* -// podle http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=748596&SiteID=1 -// by se pod vistou mel nastavit integrity level, ale nedokazal jsem problem na Viste/Serveru2008 navodit -// takze zatim nechavam pouze v komentari, dokud na to nenarazime +// according to http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=748596&SiteID=1 +// the integrity level should be set on Vista, but I could not reproduce the problem on +// Vista/Server2008, so for now I am leaving this only as a comment until we run into it // // Windows Integrity Mechanism Design // http://msdn.microsoft.com/en-us/library/bb625963.aspx -if (windowsVistaAndLater) // FIXME: nenarazil jsem na viste na to, ze bych musel integrity level resit (mezi AdAdmin / normalni aplikaci) +if (windowsVistaAndLater) // FIXME: I did not encounter a case on Vista where I would need to handle the integrity level (between AdAdmin and a normal application) { PSECURITY_DESCRIPTOR pSD; ConvertStringSecurityDescriptorToSecurityDescriptor( @@ -457,9 +458,9 @@ SECURITY_ATTRIBUTES* CreateAccessableSecurityAttributes(SECURITY_ATTRIBUTES* sa, //**************************************************************************** // -// GetProcessIntegrityLevel (vytazeno z MSDN) -// V pripade uspechu vrati TRUE a naplni DWORD na ktery odkazuje 'integrityLevel' -// jinak (pri selhani nebo pod OS strasima nez Vista) vrati FALSE +// GetProcessIntegrityLevel (pulled from MSDN) +// Returns TRUE on success and fills the DWORD pointed to by 'integrityLevel' +// otherwise (on failure or on OSes older than Vista) returns FALSE // #define SECURITY_MANDATORY_UNTRUSTED_RID (0x00000000L) @@ -477,7 +478,7 @@ BOOL SalIsWindowsVersionOrGreater(WORD wMajorVersion, WORD wMinorVersion, WORD w VER_MINORVERSION, VER_GREATER_EQUAL), VER_SERVICEPACKMAJOR, VER_GREATER_EQUAL); - SecureZeroMemory(&osvi, sizeof(osvi)); // nahrada za memset (nevyzaduje RTLko) + SecureZeroMemory(&osvi, sizeof(osvi)); // replacement for memset (does not require the RTL) osvi.dwOSVersionInfoSize = sizeof(osvi); osvi.dwMajorVersion = wMajorVersion; osvi.dwMinorVersion = wMinorVersion; @@ -500,7 +501,7 @@ BOOL GetProcessIntegrityLevel(DWORD* integrityLevel) BOOL WindowsVistaAndLater = SalIsWindowsVersionOrGreater(6, 0, 0); - if (WindowsVistaAndLater) // integrity levels byly zavedeny od Windows Vista + if (WindowsVistaAndLater) // integrity levels were introduced starting with Windows Vista { hProcess = GetCurrentProcess(); if (OpenProcessToken(hProcess, TOKEN_QUERY, &hToken)) From 33db1107852cc27ad985031a9f14e3567a576f26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:59:31 +0200 Subject: [PATCH 681/710] [translation] Fix tools/salbreak/salbreak.h comments (#1062) --- tools/salbreak/salbreak.h | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/tools/salbreak/salbreak.h b/tools/salbreak/salbreak.h index a8e06586c..a3944b444 100644 --- a/tools/salbreak/salbreak.h +++ b/tools/salbreak/salbreak.h @@ -1,28 +1,33 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once -// vrati SID (jako retezec) pro nas proces -// vraceny SID je potreba uvolnit pomoci volani LocalFree +// returns the SID (as a string) for the current process +// the returned SID must be freed by calling LocalFree // LPTSTR sid; // if (GetStringSid(&sid)) // LocalFree(sid); BOOL GetStringSid(LPTSTR* stringSid); -// vrati MD5 hash napocitany ze SID, cimz dostavame z variable-length SIDu pole 16 bajtu -// 'sidMD5' musi ukazovat do pole 16 bajtu -// v pripade uspechu vraci TRUE, jinak FALSE a nuluje cele pole 'sidMD5' +// returns the MD5 hash computed from the SID, which gives us a 16-byte array +// from the variable-length SID +// 'sidMD5' must point to a 16-byte array +// returns TRUE on success; otherwise returns FALSE and zeroes the entire 'sidMD5' array BOOL GetSidMD5(BYTE* sidMD5); -// pripravi SECURITY_ATTRIBUTES tak aby pomoci nich vytvareny objekt (mutex, mapovana pamet) byl zabezpecny -// znamena to, ze skupine Everyone je odebran pristup WRITE_DAC | WRITE_OWNER, jinak je vse povoleno -// jde o tridu lepsi zabezpecni nez "NULL DACL", kde je objekt uplne otevren vsem -// lze volat pod kazdym OS, ukazatel vrati od W2K vejs, jinak vraci NULL -// pokud vrati 'psidEveryone' nebo 'paclNewDacl' ruzne od NULL, je treba je destruovat +// prepares SECURITY_ATTRIBUTES so that an object created with them (mutex, +// mapped memory) is secured +// this means the Everyone group is denied WRITE_DAC | WRITE_OWNER access; +// everything else is allowed +// this is a class of security better than a "NULL DACL", where the object is +// completely open to everyone +// can be called on any OS; returns the pointer on W2K and later, otherwise NULL +// if it returns 'psidEveryone' or 'paclNewDacl' different from NULL, they must be destroyed SECURITY_ATTRIBUTES* CreateAccessableSecurityAttributes(SECURITY_ATTRIBUTES* sa, SECURITY_DESCRIPTOR* sd, DWORD allowedAccessMask, PSID* psidEveryone, PACL* paclNewDacl); -// V pripade uspechu vrati TRUE a naplni DWORD na ktery odkazuje 'integrityLevel' -// jinak (pri selhani nebo pod OS strasima nez Vista) vrati FALSE +// returns TRUE on success and fills the DWORD pointed to by 'integrityLevel' +// otherwise (on failure or on OSes older than Vista) returns FALSE BOOL GetProcessIntegrityLevel(DWORD* integrityLevel); From 530603b39ae67a6199dbd11505420cfcd2aec3fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:59:35 +0200 Subject: [PATCH 682/710] [translation] Fix tools/salbreak/tasklist.cpp comments (#1063) --- tools/salbreak/tasklist.cpp | 92 +++++++++++++++++++------------------ 1 file changed, 48 insertions(+), 44 deletions(-) diff --git a/tools/salbreak/tasklist.cpp b/tools/salbreak/tasklist.cpp index 877de7d50..c411b1336 100644 --- a/tools/salbreak/tasklist.cpp +++ b/tools/salbreak/tasklist.cpp @@ -1,32 +1,35 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #include #include "salbreak.h" #include "tasklist.h" -#define NOHANDLES(function) function // obrana proti zanaseni maker HANDLES do zdrojaku pomoci CheckHnd +#define NOHANDLES(function) function // protects against polluting the source with HANDLES macros via CheckHnd CTaskList TaskList; -// process list je sdileny skrz vsechny salamander v lokani session -// od AS 3.0 menime pojeti "Break" udalosti - vyvola v cili exception, takze mame "plnotucny" bug reprot, ale zaroven tim cil konci -// proto menim nasledujici konstanty "AltapSalamander*" -> "AltapSalamander3*", abychom byli oddeleni od starsich verzi -const char* AS_PROCESSLIST_NAME = "AltapSalamander3bProcessList"; // sdilena pamet CProcessList -const char* AS_PROCESSLIST_MUTEX_NAME = "AltapSalamander3bProcessListMutex"; // synchronizace pro pristup do sdilene pameti -const char* AS_PROCESSLIST_EVENT_NAME = "AltapSalamander3bProcessListEvent"; // odpaleni udalosti (co se ma delat je ulozeno ve sdilene pameti) -const char* AS_PROCESSLIST_EVENT_PROCESSED_NAME = "AltapSalamander3bProcessListEventProcessed"; // odpalena udalost byla zpracovana +// the process list is shared across all Salamander instances in the local session +// since AS 3.0 we changed the meaning of the "Break" event: it triggers an exception +// in the target, so we get a full bug report, but the target also terminates +// therefore I changed the following constants from "AltapSalamander*" to +// "AltapSalamander3*" so that we stay separated from older versions +const char* AS_PROCESSLIST_NAME = "AltapSalamander3bProcessList"; // shared memory for CProcessList +const char* AS_PROCESSLIST_MUTEX_NAME = "AltapSalamander3bProcessListMutex"; // synchronization for access to shared memory +const char* AS_PROCESSLIST_EVENT_NAME = "AltapSalamander3bProcessListEvent"; // event trigger (what to do is stored in shared memory) +const char* AS_PROCESSLIST_EVENT_PROCESSED_NAME = "AltapSalamander3bProcessListEventProcessed"; // the triggered event was processed -const char* FIRST_SALAMANDER_MUTEX_NAME = "AltapSalamanderFirstInstance"; // zavedeno od AS 2.52 beta 1 -const char* LOADSAVE_REGISTRY_MUTEX_NAME = "AltapSalamanderLoadSaveRegistry"; // zavedeno od AS 2.52 beta 1 +const char* FIRST_SALAMANDER_MUTEX_NAME = "AltapSalamanderFirstInstance"; // introduced in AS 2.52 beta 1 +const char* LOADSAVE_REGISTRY_MUTEX_NAME = "AltapSalamanderLoadSaveRegistry"; // introduced in AS 2.52 beta 1 // // **************************************************************************** // CTaskList // -// Chceme se dozvedet o SEH Exceptions i na x64 Windows 7 SP1 a dal +// We want to receive SEH exceptions even on x64 Windows 7 SP1 and later // http://blog.paulbetts.org/index.php/2010/07/20/the-case-of-the-disappearing-onload-exception-user-mode-callback-exceptions-in-x64/ // http://connect.microsoft.com/VisualStudio/feedback/details/550944/hardware-exceptions-on-x64-machines-are-silently-caught-in-wndproc-messages // http://support.microsoft.com/kb/976038 @@ -73,27 +76,28 @@ BOOL CTaskList::Init() { OK = FALSE; - //--- pokusime se pripojit na FMO-mutex - zaroven test jestli uz nejaky Salamander bezi + //--- try to connect to the FMO mutex; this also tests whether some Salamander is already running FMOMutex = NOHANDLES(OpenMutex(SYNCHRONIZE, FALSE, AS_PROCESSLIST_MUTEX_NAME)); - if (FMOMutex == NULL) // zadny Salamander 3.0 nebo novejsi v lokalni sessione = koncime + if (FMOMutex == NULL) // no Salamander 3.0 or newer in the local session; we are done { return FALSE; } - else // dalsi instance, jen se pripojime ... + else // another instance; just connect to it ... { - //--- zabereme FMO + //--- take the FMO DWORD waitRet = WaitForSingleObject(FMOMutex, TASKLIST_TODO_TIMEOUT); if (waitRet == WAIT_TIMEOUT) return FALSE; // fail - //--- pripojime se na ostatni systemove objekty pro komunikaci + //--- connect to the other system objects used for communication FMO = NOHANDLES(OpenFileMapping(FILE_MAP_WRITE, FALSE, AS_PROCESSLIST_NAME)); if (FMO == NULL) return FALSE; // fail - ProcessList = (CProcessList*)NOHANDLES(MapViewOfFile(FMO, FILE_MAP_WRITE, 0, 0, 0)); // FIXME_X64 nepredavame x86/x64 nekompatibilni data? + ProcessList = (CProcessList*)NOHANDLES(MapViewOfFile(FMO, FILE_MAP_WRITE, 0, 0, 0)); // FIXME_X64 we do not pass x86/x64-incompatible data, do we? if (ProcessList == NULL) return FALSE; // fail - // aby na event bylo mozne volat SetEvent(), musi mit nahozeny EVENT_MODIFY_STATE, pro Wait* potrebuje SYNCHRONIZE + // to be able to call SetEvent on the event, it must have EVENT_MODIFY_STATE; + // Wait* needs SYNCHRONIZE Event = NOHANDLES(OpenEvent(SYNCHRONIZE | EVENT_MODIFY_STATE, FALSE, AS_PROCESSLIST_EVENT_NAME)); if (Event == NULL) return FALSE; // fail @@ -101,10 +105,10 @@ BOOL CTaskList::Init() if (EventProcessed == NULL) return FALSE; // fail - //--- pridame zaznam do sdilene pameti - // my nejsme Salamander, nic nepridavame + //--- add a record to shared memory + // we are not Salamander, so we do not add anything - //--- uvolnime FMO + //--- release the FMO ReleaseMutex(FMOMutex); } @@ -133,7 +137,7 @@ int CTaskList::GetItems(CProcessListItem* items, DWORD* itemsStateUID, BOOL* tim if (OK) { BOOL changed = FALSE; - //--- zabereme FMO + //--- take the FMO if (WaitForSingleObject(FMOMutex, TASKLIST_TODO_TIMEOUT) == WAIT_TIMEOUT) { if (timeouted != NULL) @@ -143,10 +147,10 @@ int CTaskList::GetItems(CProcessListItem* items, DWORD* itemsStateUID, BOOL* tim CProcessListItem* ptr = ProcessList->Items; - //--- vyhodime killnute procesy + //--- remove terminated processes RemoveKilledItems(&changed); - //--- navratove hodnoty + //--- return values if (items != NULL) memcpy(items, ptr, ProcessList->ItemsCount * sizeof(CProcessListItem)); if (changed) @@ -155,7 +159,7 @@ int CTaskList::GetItems(CProcessListItem* items, DWORD* itemsStateUID, BOOL* tim *itemsStateUID = ProcessList->ItemsStateUID; int count = ProcessList->ItemsCount; - //--- uvolnime FMO + //--- release the FMO ReleaseMutex(FMOMutex); return count; } @@ -169,7 +173,7 @@ BOOL CTaskList::FireEvent(DWORD todo, DWORD pid, BOOL* timeouted) *timeouted = FALSE; if (OK) { - // zabereme ProcessList + // take ProcessList DWORD waitRet = WaitForSingleObject(FMOMutex, 2000); if (waitRet == WAIT_FAILED) return FALSE; @@ -180,44 +184,44 @@ BOOL CTaskList::FireEvent(DWORD todo, DWORD pid, BOOL* timeouted) return FALSE; // fail } - // nastavime predavane parametry + // set the transferred parameters ProcessList->Todo = todo; ProcessList->TodoUID++; ProcessList->TodoTimestamp = GetTickCount(); ProcessList->PID = pid; - // pri breaknuti jine instance Salamandera pustime jeho Salmon nad nas + // when breaking another Salamander instance, allow its Salmon to come to the foreground if (todo == TASKLIST_TODO_BREAK) { for (DWORD i = 0; i < ProcessList->ItemsCount; i++) { if (ProcessList->Items[i].PID == pid) { - AllowSetForegroundWindow(ProcessList->Items[i].PID); // radeji povolime i vlastniho Salamandera, i kdyz to je asi zbytecne... - AllowSetForegroundWindow(ProcessList->Items[i].SalmonPID); // rozhodne musime pustit nad nas jeho Salmon + AllowSetForegroundWindow(ProcessList->Items[i].PID); // better allow its Salamander too, even though that is probably unnecessary... + AllowSetForegroundWindow(ProcessList->Items[i].SalmonPID); // we definitely have to allow its Salmon to come in front of us break; } } } - // uvolnime ProcessList + // release ProcessList ReleaseMutex(FMOMutex); - // spustime kontrolu ve vsech Salamanderech + // start the check in all Salamanders ResetEvent(EventProcessed); SetEvent(Event); - //--- dame chvilku na reakci (behem teto doby by se nekdo mel "chytnout" a ukol splnit) + //--- give it a moment to react (during this time someone should "catch" the task and complete it) BOOL ret = (WaitForSingleObject(EventProcessed, 1000) == WAIT_OBJECT_0); - //--- rekneme vsem Salamanderum, at se pripravi na dalsi command + //--- tell all Salamanders to get ready for the next command ResetEvent(Event); - //--- nastavime zpatky break-PID + //--- restore break-PID back // ProcessList->Todo = 0; // ProcessList->PID = 0; - //--- uvolnime FMO + //--- release the FMO return ret; } @@ -246,14 +250,14 @@ BOOL CTaskList::RemoveKilledItems(BOOL* changed) cont = TRUE; NOHANDLES(CloseHandle(h)); if (cont) - continue; // nechame proces v seznamu + continue; // keep the process in the list } else { DWORD lastError = GetLastError(); if (lastError == ERROR_ACCESS_DENIED) { - continue; // nechame proces v seznamu + continue; // keep the process in the list } } memmove(ptr + i, ptr + i + 1, (c - i - 1) * sizeof(CProcessListItem)); @@ -265,9 +269,9 @@ BOOL CTaskList::RemoveKilledItems(BOOL* changed) ProcessList->ItemsCount = c; /* -// neslape pod XP pokud jsou procesy v ramci jedne session spusteny pod ruznymi uzivateli -// nemame pravo otevrit hande jineho procesu -//--- vyhodime killnuty procesy +// does not work on XP if the processes in one session are started under different users +// we do not have the right to open a handle to another process +//--- remove terminated processes int i; for (i = 0; i < c; i++) { @@ -278,9 +282,9 @@ int i; DWORD exitcode; if (!GetExitCodeProcess(h, &exitcode) || exitcode == STILL_ACTIVE) cont = TRUE; NOHANDLES(CloseHandle(h)); - if (cont) continue; // nechame proces v seznamu + if (cont) continue; // keep the process in the list } -//--- vykopneme proces ze seznamu +//--- remove the process from the list memmove(ptr + i, ptr + i + 1, (c - i - 1) * sizeof(CTLItem)); c--; i--; @@ -290,4 +294,4 @@ int i; */ return TRUE; -} \ No newline at end of file +} From afc1fe2f75150da1b22d30ff22620d69f0ac94a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:59:38 +0200 Subject: [PATCH 683/710] [translation] Fix tools/salbreak/tasklist.h comments (#1064) --- tools/salbreak/tasklist.h | 112 +++++++++++++++++++------------------- 1 file changed, 57 insertions(+), 55 deletions(-) diff --git a/tools/salbreak/tasklist.h b/tools/salbreak/tasklist.h index f28d28868..4716c8a6a 100644 --- a/tools/salbreak/tasklist.h +++ b/tools/salbreak/tasklist.h @@ -1,49 +1,51 @@ // SPDX-FileCopyrightText: 2023 Open Salamander Authors // SPDX-License-Identifier: GPL-2.0-or-later +// CommentsTranslationProject: TRANSLATED #pragma once // // **************************************************************************** -// TRUE = prvni bezici instance verze 3.0 nebo novejsi -// urcuje se na zaklade mutexu v globalnim namespace, takze se vidi s mutexty -// z ostatnich sessions (remote desktop, fast user switching) +// TRUE = the first running instance of version 3.0 or newer +// determined based on a mutex in the global namespace, so it is visible together +// with mutexes from other sessions (remote desktop, fast user switching) extern BOOL FirstInstance_3_or_later; -// sdilena pamet obsahuje: -// DWORD - PID procesu, ktery se ma breaknout -// DWORD - pocet polozek v listu -// MAX_TL_ITEMS * CTLItem - list polozek +// shared memory contains: +// DWORD - PID of the process that should be broken +// DWORD - number of items in the list +// MAX_TL_ITEMS * CTLItem - item list -#define MAX_TL_ITEMS 500 // maximalni pocet polozek ve sdilene pameti, nelze menit! +#define MAX_TL_ITEMS 500 // maximum number of items in shared memory, cannot be changed! -#define TASKLIST_TODO_HIGHLIGHT 1 // okno procesu daneho v 'PID' se ma vysvitit -#define TASKLIST_TODO_BREAK 2 // proces dany v 'PID' se ma breaknout -#define TASKLIST_TODO_TERMINATE 3 // proces dany v 'PID' se ma terminovat -#define TASKLIST_TODO_ACTIVATE 4 // proces dany v 'PID' se ma aktivovat +#define TASKLIST_TODO_HIGHLIGHT 1 // the window of the process given in 'PID' should be highlighted +#define TASKLIST_TODO_BREAK 2 // the process given in 'PID' should be broken +#define TASKLIST_TODO_TERMINATE 3 // the process given in 'PID' should be terminated +#define TASKLIST_TODO_ACTIVATE 4 // the process given in 'PID' should be activated -#define TASKLIST_TODO_TIMEOUT 5000 // 5 vterin, ktere maji procesy pro zpracovani todo +#define TASKLIST_TODO_TIMEOUT 5000 // 5 seconds that processes have to handle todo -#define PROCESS_STATE_STARTING 1 // nas proces startuje, jeste neexistuje hlavni okno -#define PROCESS_STATE_RUNNING 2 // nas proces bezi, mame hlavni okno -#define PROCESS_STATE_ENDING 3 // nas proces konci, nemame uz hlavni okno +#define PROCESS_STATE_STARTING 1 // our process is starting, the main window does not exist yet +#define PROCESS_STATE_RUNNING 2 // our process is running, we have the main window +#define PROCESS_STATE_ENDING 3 // our process is ending, we no longer have the main window -#pragma pack(push, enter_include_tasklist) // aby byly struktury nezavisle na nastavenem zarovnavani +#pragma pack(push, enter_include_tasklist) // keep the structures independent of the current packing setting #pragma pack(4) //extern HANDLE HSalmonProcess; -// POZOR, pomoci struktury komunikuji x64 a x86 procesy, pozor na typy (napr. HANDLE), ktere maji ruzne sirky +// WARNING: x64 and x86 processes communicate through this structure, so watch out +// for types (for example HANDLE) that have different widths struct CProcessListItem { - DWORD PID; // ProcessID, unikatni po dobu behu procesu, pak muze byt znovu pouzito - SYSTEMTIME StartTime; // Kdy byl proces nastartovan - DWORD IntegrityLevel; // Integrity Level procesu, slouzi k rozliseni procesu spustenych na ruzne urovni opravneni - BYTE SID_MD5[16]; // MD5 napocitana ze SID procesu, slouzi nam k rozliseni procesu bezicich pod ruznymi uzivateli; SID ma neznamou delku, proto tato obezlicka - DWORD ProcessState; // Stav v jakem se Salamander nachazi, viz PROCESS_STATE_xxx - UINT64 HMainWindow; // (x64 friendly) Handle hlavniho okna, pokud jiz/jeste existuje (nastavuje se pri jeho vytvareni/destrukci) - DWORD SalmonPID; // ProcessID salmonu, aby mu brakujici proces mohl garantovat pravo pro SetForegroundWindow + DWORD PID; // ProcessID, unique for the lifetime of the process, then it may be reused + SYSTEMTIME StartTime; // when the process was started + DWORD IntegrityLevel; // process Integrity Level, used to distinguish processes running with different privilege levels + BYTE SID_MD5[16]; // MD5 computed from the process SID, used to distinguish processes running under different users; the SID has unknown length, hence this workaround + DWORD ProcessState; // state Salamander is currently in, see PROCESS_STATE_xxx + UINT64 HMainWindow; // (x64 friendly) handle of the main window, if it already/still exists (set when it is created/destroyed) + DWORD SalmonPID; // Salmon ProcessID, so the breaking process can grant it the SetForegroundWindow right CProcessListItem() { @@ -55,27 +57,27 @@ struct CProcessListItem HMainWindow = NULL; SalmonPID = 0; // if (HSalmonProcess != NULL) - // SalmonPID = GetProcessId(HSalmonProcess); // v tuto dobu jiz Salmon bezi + // SalmonPID = GetProcessId(HSalmonProcess); // Salmon is already running at this point } }; // Open Salamander Process List -// !!! POZOR, ke strukture lze pouze pridavat polozky, protoze na ni chodi i starsi verze Salamandera +// !!! WARNING: items may only be added to this structure, because older Salamander versions also use it struct CProcessList { - DWORD Version; // novejsi verze Salamandera mohou zvysovat 'Version' a zacit vyuzivat promenne ReservedX + DWORD Version; // newer Salamander versions may increase 'Version' and start using ReservedX variables - DWORD ItemsCount; // pocet validnich polozek v poli Items - DWORD ItemsStateUID; // "verze" Items seznamu; zvysuje se s kazdou zmenou; slouzi pro Tasks dialog jako signal, ze se ma refreshnout + DWORD ItemsCount; // number of valid items in the Items array + DWORD ItemsStateUID; // "version" of the Items list; increments on every change; used by the Tasks dialog as a signal that it should refresh CProcessListItem Items[MAX_TL_ITEMS]; - DWORD Todo; // urcuje co se ma delat po odpaleni eventu pomoci FireEvent, obsahuje jednu z hodnot TASKLIST_TODO_* - DWORD TodoUID; // poradi zaslaneho pozadavku, pro kazdy dalsi pozadavek ze zvysuje - DWORD TodoTimestamp; // GetTickCount() hodnota ze chvile, kdy byl zakladan Todo pozadavek - DWORD PID; // PID, pro ktery se ma provest cinnost z Todo - //CCommandLineParams CommandLineParams;// cesty pro panely a dalsi parametry pro aktivaci - // POZOR, pokud bude potreba rozsirovat tuto strukturu, bylo by rozumne napred rozsirit CCommandLineParams, napriklad - // reservovat nejake NAX_PATH buffery a par DWORDu, pokud bychom chteli predavat nove command line parametry + DWORD Todo; // determines what should be done after the event is triggered via FireEvent; contains one of the TASKLIST_TODO_* values + DWORD TodoUID; // sequence number of the sent request; increments for each further request + DWORD TodoTimestamp; // GetTickCount() value from the moment the Todo request was created + DWORD PID; // PID for which the Todo action should be performed + //CCommandLineParams CommandLineParams;// paths for panels and other activation parameters + // WARNING: if this structure ever needs to be extended, it would be sensible to extend CCommandLineParams first, for example + // reserve some MAX_PATH buffers and a few DWORDs if we wanted to pass new command-line parameters }; #pragma pack(pop, enter_include_tasklist) @@ -83,14 +85,14 @@ struct CProcessList class CTaskList { protected: - HANDLE FMO; // file-mapping-object, sdilena pamet - CProcessList* ProcessList; // ukazatel do sdilene pameti - HANDLE FMOMutex; // mutex pro reseni pristupu k FMO - HANDLE Event; // event, je-li signaled, mely by se ostatni procesy podivat, - // jestli se nemaji provest cinnost danou v Todo - HANDLE EventProcessed; // pokud jeden z procesu provede cinnost v Todo, nastavi tento - // event na signaled na znameni ridicimu procesu, ze je hotovo - BOOL OK; // probehla konstrukce o.k.? + HANDLE FMO; // file-mapping object, shared memory + CProcessList* ProcessList; // pointer into shared memory + HANDLE FMOMutex; // mutex for synchronizing access to the FMO + HANDLE Event; // if this event is signaled, the other processes should check + // whether they should perform the action given in Todo + HANDLE EventProcessed; // if one of the processes performs the action in Todo, it sets this + // event to signaled to inform the controlling process that it is done + BOOL OK; // did construction complete successfully? public: CTaskList(); @@ -98,21 +100,21 @@ class CTaskList BOOL Init(); - // naplni polozky task-listu, items - pole alespon MAX_TL_ITEMS struktur CTLItem, vraci pocet polozek - // 'items' muze byt NULL, pokud nas zajima pouze 'itemsStateUID' - // vrati "verzi" sestavy procesu; verze se zvysuje s kazdou zmenou v seznamu (pokud je pridana nebo odebrana polozka) - // slouzi pro dialog jako informace, ze ma refreshnout seznam; 'itemsStateUID' muze byt NULL - // pokud je 'timeouted' ruzny od NULL, nastavi zda k neuspechu vedl timeout pri cekani na sdilenou pamet + // fills the task-list items; items is an array of at least MAX_TL_ITEMS CTLItem structures; returns the item count + // 'items' may be NULL if we are interested only in 'itemsStateUID' + // returns the process-list "version"; the version increases with every change in the list (when an item is added or removed) + // serves as information for the dialog that it should refresh the list; 'itemsStateUID' may be NULL + // if 'timeouted' is not NULL, sets whether the failure was caused by a timeout while waiting for shared memory int GetItems(CProcessListItem* items, DWORD* itemsStateUID, BOOL* timeouted = NULL); - // pozada proces 'pid' o provedeni akce dle 'todo' (mimo TASKLIST_TODO_ACTIVATE) - // pokud je 'timeouted' ruzny od NULL, nastavi zda k neuspechu vedl timeout pri cekani na sdilenou pamet + // asks process 'pid' to perform the action specified by 'todo' (except TASKLIST_TODO_ACTIVATE) + // if 'timeouted' is not NULL, sets whether the failure was caused by a timeout while waiting for shared memory BOOL FireEvent(DWORD todo, DWORD pid, BOOL* timeouted = NULL); protected: - // projde seznam procesu a vytridi neexistujici polozky - // nutne volat po uspesnem vstupu kriticke sekce 'FMOMutex'! - // nastavi 'changed' na TRUE, pokud byla nejaka polozka zahozena, jinak na FALSE + // walks the process list and filters out non-existing items + // must be called only after successfully entering the 'FMOMutex' critical section! + // sets 'changed' to TRUE if some item was discarded, otherwise FALSE BOOL RemoveKilledItems(BOOL* changed); }; From dbed16c083da5b2734f7ad3fb41db982be7eefe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:59:42 +0200 Subject: [PATCH 684/710] [translation] Fix src/plugins/automation/generated/readme.txt comments (#1065) --- src/plugins/automation/generated/readme.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/automation/generated/readme.txt b/src/plugins/automation/generated/readme.txt index b0760b3a8..7aa822048 100644 --- a/src/plugins/automation/generated/readme.txt +++ b/src/plugins/automation/generated/readme.txt @@ -1 +1,3 @@ -V tomto adresari jsou jen automaticky generovane soubory. \ No newline at end of file +CommentsTranslationProject: TRANSLATED + +This directory contains only automatically generated files. From 13931f30669e8b0e7630b3c1c065e58d67f29d30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:59:45 +0200 Subject: [PATCH 685/710] [translation] Fix src/plugins/filecomp/todo.txt comments (#1066) --- src/plugins/filecomp/todo.txt | 43 ++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/src/plugins/filecomp/todo.txt b/src/plugins/filecomp/todo.txt index 36ab3dd1d..4d7b69cbe 100644 --- a/src/plugins/filecomp/todo.txt +++ b/src/plugins/filecomp/todo.txt @@ -1,23 +1,24 @@ -Prekopavka --ignore differences caused by ambiguilties in unicode encoding --ShiftBoundaries: mozna optimalizovat pomoci listu --odstranit _ASSERT --vyhazet _CrtCheckMemory() --DiscardConfusingLines puvodni diff pouziva trik -- DiscardConfusingLines +CommentsTranslationProject: TRANSLATED -Prechod na Unicode: --hlasit uzivateli surrogates (zatim ne, teprve az budem umet korektne makat s asijskejma fontama) +Rework +- Ignore differences caused by ambiguities in Unicode encoding. +- ShiftBoundaries: perhaps optimize it using a list. +- Remove _ASSERT. +- Remove _CrtCheckMemory(). +- The original diff uses the DiscardConfusingLines trick. --Plug-in File Comparator porovná soubor se sebou samým, aniž by uživatele - varoval, že dìlá cosi ne zrovna užiteèného. - To bychom mohli detekovat a zobrazit nejaky messagebox, ne? - "There is same file in the left and right panel." Nebo neco takoveho? --Pridat feature, compare multiple files: - -najde prunik mnozin nazvu souboru z obou panelu - -rozdilne soubory vyleje do sesnamu ze ktereho pujde volat compare --zprehlednit help-keyboard strukturovat jako napovedu k less --nekomu se ztraceji ikonky v toolbare - Na zaver: File Comparator som spustil asi 10 - 12x - > z toho asi 3-4x ostal bez ikon, prikladam screen shot (.GIF) - > zobrazili sa bud pri znovu otvoreni FC alebo pri praci s nim. - > Prikladam REPERT o mojom SYSTEME: +Transition to Unicode: +- Report surrogate pairs to the user, but not yet; wait until we can work correctly with Asian fonts. + +- The File Comparator plug-in compares a file with itself without warning the user that this is not especially useful. + We could detect that and show a message box, for example: + "The same file is in the left and right panel." +- Add a feature to compare multiple files: + - Find the intersection of the file-name sets from both panels. + - Put the differing files into a list from which compare can be invoked. +- Clarify the keyboard-help section and structure it more like the less help. +- Toolbar icons disappear for some users. + Final note: I started File Comparator about 10 to 12 times. + > About 3 to 4 times it stayed without icons; I am attaching a screenshot (.GIF). + > They appeared either when FC was opened again or while working with it. + > I am attaching a report about my system. From c0daf0e101806d7334f1b1ea9b78f6a0b6b5e182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:59:49 +0200 Subject: [PATCH 686/710] [translation] Fix src/plugins/ftp/servers/beta.txt comments (#1067) --- src/plugins/ftp/servers/beta.txt | 323 ++++++++++++++++--------------- 1 file changed, 164 insertions(+), 159 deletions(-) diff --git a/src/plugins/ftp/servers/beta.txt b/src/plugins/ftp/servers/beta.txt index 83c834d37..a37fcee8a 100644 --- a/src/plugins/ftp/servers/beta.txt +++ b/src/plugins/ftp/servers/beta.txt @@ -1,172 +1,177 @@ +CommentsTranslationProject: TRANSLATED + This file contains a report about bug fixes and new features -in Altap Salamander. Plus sign means new feature addition, -minus sign means a bug fix. +in Altap Salamander. A plus sign means a new feature, +a minus sign means a bug fix. -FTP released with Altap Salamanderem 2.52: (08/28/2009) --MODE Z: nektere servery (napr. Serv-U 7 a 8) neukoncuji stream komprimovanych - dat, ukazovali jsme to jako chybu po kazdem prenosu, ted uz to ignorujeme --pri kopirovani bookmarky v Connect/Bookmark dialogu se nekopirovalo nastaveni - MODE Z (jen je-li zaple) --pridani bookmarky z panelu chybne inicializovalo pouzity proxy server (rozjely - se default hodnoty ve volani metody AddServer(), chybela hodnota 0 pro - 'encryptedPasswordSize') +FTP released with Altap Salamander 2.52: (08/28/2009) +-MODE Z: some servers (e.g. Serv-U 7 and 8) do not terminate the compressed-data + stream, we used to report that as an error after every transfer, now we ignore it +-when copying a bookmark in the Connect/Bookmark dialog, the MODE Z setting + was not copied (only when enabled) +-adding a bookmark from the panel initialized the selected proxy server incorrectly + (the default values in the AddServer() call shifted, the value 0 for + 'encryptedPasswordSize' was missing) -FTP released with Altap Salamanderem 2.52 beta 2: (08/21/2009) --cache listingu a prohlizenych souboru ze serveru se maze pred pripojenim na - server, pokud neni stejny server pripojen do druheho panelu nebo neni mezi - odpojenymi FS (tedy po zavreni vsech FTP spojeni v panelu a novem otevreni - FTP spojeni se uz neukazuji cachovana data) --podpora komprese datoveho spojeni (MODE Z) --drag&drop bez modifikatoru (ani Shift, ani Ctrl) z FTP v panelu do Explorera - na disk s TEMP adresarem nabizel necekane Move misto Copy, viz +FTP released with Altap Salamander 2.52 beta 2: (08/21/2009) +-the cache of listings and viewed files from the server is cleared before connecting + to the server, unless the same server is connected in the other panel or remains + among disconnected file systems (that is, after closing all FTP connections in the + panel and opening a new FTP connection, cached data is no longer shown) +-support for data-connection compression (MODE Z) +-drag&drop without modifiers (neither Shift nor Ctrl) from FTP in the panel to Explorer + on a disk with a TEMP directory unexpectedly offered Move instead of Copy, see https://forum.altap.cz/viewtopic.php?f=7&t=3303 --cache listingu rozlisuje prikazy, kterymi byl listing ziskan (drive se chybne - pouzivaly vysledky z cache i po zmene listovaciho prikazu) --automaticke aktivovani logu v Logs okne nefungovalo dobre pri pripojeni FTP do - neaktivniho panelu (kliknuti na Drive bare neaktivniho panelu) a pri neuspesnem - pripojeni (v Logs okne zustaval log neuspesneho spojeni misto navratu k logu - v aktivnim panelu) --dialogy ukazane behem provadeni FTP prikazu nad panelem se nechovaly jako modalni, - kliknuti do okna Salamandera je neaktivovalo --pod Vistou nefungovalo kliknuti mysi na zaviraci krizek wait okenek nad panelem --podpora FTPS (FTP over TLS/SSL) --provadel se refresh panelu v neaktivnim Salamanderovi i napr. pri uploadu, pri - dotazu na prepis existujiciho souboru na serveru, v panelu se tedy zobrazoval - dotaz na reconnect (connectiona je z panelu pujcena do operace) - staronove se - refresh provadi az pri aktivaci hl. okna nebo po dokonceni operace (a tedy - vraceni connectiony do panelu) +-the listing cache distinguishes the commands used to obtain the listing (previously + cached results were incorrectly reused even after the listing command changed) +-automatic log activation in the Logs window did not work correctly when FTP was + connected in the inactive panel (clicking the drive bar of the inactive panel) and + after an unsuccessful connection attempt (the log of the failed connection stayed + in the Logs window instead of returning to the log of the active panel) +-dialogs shown above the panel while an FTP command was running did not behave as + modal dialogs, clicking the Salamander window did not activate them +-on Vista, clicking the close button on wait windows above the panel did not work +-support for FTPS (FTP over TLS/SSL) +-the panel was refreshed in inactive Salamander even, for example, during upload; when + prompted to overwrite an existing file on the server, the panel then showed a reconnect + prompt (the connection is borrowed from the panel for the operation) - refresh is now + once again performed only when the main window is activated or after the operation + completes (and the connection is returned to the panel) -FTP released with Altap Salamanderem 2.52 beta 1: (01/29/2009) -+pri chybe Error Storing File to Server je nove mozne rucne prejmenovat soubor (tato - chyba se plete s chybou Error Creating Target File, staci aby byl server zbytecne - aktivni a navazal data connectionu jeste pred tim, nez zkusi otevrit soubor na - disku, coz dela napr. ftp.shutterstock.com) --zrusena hlaska "No path is accessible on this FTP server.", zbytecny pruzeni lidi, - nove provedeme tise disconnect bez dotazu (tyhle hlasce totiz vzdycky predchazi - dotaz na reconnect) --pri otevreni maximalizovaneho progress dialogu (k tomu dojde kdyz je maximalizovany - pri predchozim zavreni) se vzdy vypinal checkbox "Close this dialog when operation - finishes" --neumeli jsme pracovat s URL, ktere v uzivatelskem jmene obsahuji backslash, - napr.: ftp://corp\tomas.kopal@destft01.corp.alpine.eu/ --pri zadani spatneho cisla portu (neni cislo nebo je mimo 1 az 65535) hlasime - chybu (predtim se ignorovalo) +FTP released with Altap Salamander 2.52 beta 1: (01/29/2009) ++when the Error Storing File to Server error occurs, it is now possible to rename the + file manually (this error is confused with Error Creating Target File; it is enough + for the server to be unnecessarily active and establish the data connection before + trying to open the file on disk, which is what ftp.shutterstock.com does, for example) +-removed the "No path is accessible on this FTP server." message; it needlessly annoyed + users, now we silently disconnect without prompting (this message is always preceded + by a reconnect prompt anyway) +-when opening a maximized progress dialog (which happens when it was maximized when it + was last closed), the "Close this dialog when operation finishes" checkbox was always + cleared +-we could not handle URLs whose username contains a backslash, + e.g.: ftp://corp\tomas.kopal@destft01.corp.alpine.eu/ +-when an invalid port number is entered (not a number or outside the range 1 to 65535), + an error is reported (previously it was ignored) -FTP released with Altap Salamanderem 2.5 RC3: (04/13/2007) --upload: vypadek data-connectiony pokud control-connectiona zustala OK, - se behem Resume (appendu) vyhodnocoval, jako ze Resume neni mozny, tedy - pri "Resume or Overwrite" dochazelo k automatickemu prechodu na Overwrite -+obohacene hlaseni do Logu: hlasime duvody selhani Resume, automaticky - prechod na Overwrite a par dalsich zajimavych udalosti --SOCKS 4A/5: preferuji posilani IP adresy pred posilanim jmene adresy obsahujici IP - (nektere proxy servery neumi preklad string_IP->IP) +FTP released with Altap Salamander 2.5 RC3: (04/13/2007) +-upload: if the data connection dropped while the control connection stayed OK, + during Resume (append) it was evaluated as if Resume were impossible, so + "Resume or Overwrite" automatically fell back to Overwrite ++enhanced log reporting: we report the reasons for Resume failure, the automatic + fallback to Overwrite, and several other interesting events +-SOCKS 4A/5: prefer sending an IP address over sending a host name that contains an IP + address (some proxy servers cannot translate string_IP -> IP) -FTP released with Servant Salamanderem 2.5 RC2: (10/27/2006) -+new option in context menu and plugin's menu: List Hidden Files and Directories - (uses "LIST -a" for listing hidden files and dirs on Unix FTP servers) +FTP released with Servant Salamander 2.5 RC2: (10/27/2006) ++new option in the context menu and plugin menu: List Hidden Files and Directories + (uses "LIST -a" for listing hidden files and directories on Unix FTP servers) -FTP released with Servant Salamanderem 2.5 RC1: (04/27/2006) -+kontextove menu na souborech/adresarich v panelu -+Solve Error dialogy: zmena checkboxu na "Remember choice and do not show - this dialog again for operations with the same error" + vyhozeni comboboxu - "If this error occurs again" (ekvivalent vyber v comboboxu se nove dela na - zaklade tlacitka, ktere si user zvoli) -+Solve Error "file already exists" dialog: pridano tlacitko "Overwrite All" - (snazsi nez zapnout checkbox "Remember choice..." a kliknout na Overwrite) -+UNIX parsery: user+group muzou obsahovat mezery, v tomto pripade je jen - preskocime (nelze rozsoudit co je user a co groupa) -+parsery listingu: pridana funkce skip_to_number() - preskoci vse az k - nejblizsi dekadicke cislici -+parsery listingu: datum s rokem 1601 se automaticky predelava na rok 1602 - (stejne je to nesmyslna hodnota, s rokem 1601 je problem pri prevodu na UTC) -+IBM iSeries/i5, AS/400: pri downloadu z cesty /QSYS.LIB se automaticky - orezava .FILE cast jmena (A.FILE/A.MBR -> A.MBR + A.FILE/B.MBR -> A.B.MBR), - pri uploadu se naopak automaticky pridava .FILE cast jmena -+parser listingu pro IBM iSeries/i5, AS/400 -+pridan skryty prikaz Disconnect do menu (slouzi jen pro definici hot-key), - lidi si stezovali, ze chteji disconnect na jedinou klavesu (ne F12, Enter) +FTP released with Servant Salamander 2.5 RC1: (04/27/2006) ++context menu for files/directories in the panel ++Solve Error dialogs: changed the checkbox to "Remember choice and do not show + this dialog again for operations with the same error" and removed the combo box + "If this error occurs again" (the equivalent choice in the combo box is now made + based on the button selected by the user) ++Solve Error "file already exists" dialog: added the "Overwrite All" button + (easier than enabling the "Remember choice..." checkbox and clicking Overwrite) ++UNIX parsers: user and group may contain spaces; in that case we simply skip them + (it is impossible to tell what is the user and what is the group) ++listing parsers: added the skip_to_number() function - skips everything up to the + nearest decimal digit ++listing parsers: a date with year 1601 is automatically changed to 1602 + (it is a nonsense value anyway; year 1601 causes trouble when converting to UTC) ++IBM iSeries/i5, AS/400: when downloading from the /QSYS.LIB path, the .FILE part + of the name is automatically trimmed (A.FILE/A.MBR -> A.MBR + A.FILE/B.MBR -> A.B.MBR), + when uploading, the .FILE part of the name is added automatically instead ++listing parser for IBM iSeries/i5, AS/400 ++added a hidden Disconnect command to the menu (used only for defining a hotkey), + people complained that they wanted Disconnect on a single key (not F12, Enter) -FTP released with Servant Salamanderem 2.5 beta 11: (01/27/2006) -+pri prepisu souboru (download i upload) je fokus na Overwrite tlacitku -+dokoncena podpora pro HTTP 1.1 proxy servery -+dokoncena podpora pro SOCKS4A a SOCKS5 proxy servery -+parser listingu: doplneny svedske a norske nazvy mesicu --pri neaktualnim listingu v cilovem panelu s FTP dochazelo pri uploadu adresaru - ke hlaseni nesmyslnych chyb typu "dir already exists" nebo "dir not found" - (ted se pri takoveto chybe nejprve zkontroluje jestli listing neni prevzaty - z panelu a pripadne se listing automaticky refreshne) --odstranen deadlock (projevoval se dost zridka) pri downloadu souboru pro viewer -+dokoncena podpora pro SOCKS4 proxy servery --uploady pod XP na lokalni siti ve specialnich pripadech bezely pouze 160KB/s, - XP se v techto pripadech nejak nevyporadaji se zapisem dat na socket po 32KB, - doplnil jsem detekci tohoto zpomaleni a zapisuji po mensich blocich (16KB) --pod VM-Ware v XP se pri prenosech kolem 1MB/s nehybal progress - message queue - byla preplnena a tedy nedochazelo k dorucovani WM_TIMER (ted se WM_TIMER pri - velke zatezi generuje umele, aby pouzite timery aspon trochu fungovaly) -+moznost potlacit warning "connection has been lost" (nektere usery nezajima, ze - panel nema otevrene spojeni) -+zmena default hodnoty: upload-transfer-failed-on-created-file = Resume or Overwrite - (misto Overwrite) - ukazalo se, ze lepsi bude risknout chybu Resume (dost - nepravdepodobne), nez pouzivat jen Overwrite (u delsich uploadu se bez Resume - proste neda zit) -+zmena default hodnoty: logovani spojeni pouzivanych pro operace je ted - defaultne zapnute (rezie je minimalni, odpada vysvetlovani "jak logovani zapnout" - kazdemu, kdo ma nejaky problem s FTP) -+v pluginovem menu se pouziva prikaz SALCMD_DISCONNECT - propagace klavesy - F12 pro Disconnect -+heuristika pro ziskani jmena OS z odpovedi na SYST prikaz (nebere - tupe prvni slovo, jak rika RCF o FTP, ale hleda postupne po slovech - znamy typ OS - ted funguje i napr. nemecky preklad: "215 Betriebssystem OS/2") --na zaklade bugreportu od usera vime, ze nejen pri uploadech delsich - nez 1,5 hodiny dochazi k tomu, ze server neodpovi na STOR prikaz - nove jsem - dopsal podporu pro kontrolu velikosti souboru uploadleho v ASCII rezimu - (testuje velikost na shodu s CRLF- nebo LF-velikosti, neni to 100%, - muze hlasit "shodu" i pri nekompletnim souboru, je-li zkracen presne - o tolik znaku, kolik ma radek + ma CRLF konce radek) --v dialogu Add/Edit Proxy Server se pri otevreni vzdy nastavil defaultni - port podle typu proxy serveru (premazalo se nastaveni usera) -+po dokonceni operace na FTP serveru se provede ihned refresh panelu (neceka - se na aktivaci panelu - pokud si uzivatel odskocil do jineho programu, vrati - se do panelu s aktualnim listingem) --pri presunu souboru mezi FTP a sitovou cestou dochazelo ke zbytecnym ztratam - spojeni (operace neumela predat spojeni zpet do panelu, takze si panel zadal - o otevreni noveho spojeni a puvodni spojeni se zahazovalo) --Add Bookmark z kontextoveho menu v panelu nefungovala korektne (mela posunute - parametry) -+podpora pro dalsi mainframe: Tandem +FTP released with Servant Salamander 2.5 beta 11: (01/27/2006) ++when overwriting a file (download and upload), focus is on the Overwrite button ++completed support for HTTP 1.1 proxy servers ++completed support for SOCKS4A and SOCKS5 proxy servers ++listing parser: added Swedish and Norwegian month names +-if the listing in the target FTP panel was stale, uploading a directory caused + meaningless errors such as "dir already exists" or "dir not found" + (now, on such an error, we first check whether the listing was taken from the + panel and refresh it automatically if necessary) +-removed a deadlock (it manifested rather rarely) during download of a file for the viewer ++completed support for SOCKS4 proxy servers +-on XP in a local network, uploads ran at only 160KB/s in special cases, + apparently XP could not cope with writing data to the socket in 32KB chunks in + those cases, I added detection of this slowdown and now write in smaller blocks + (16KB) +-on XP under VMware, at transfer speeds around 1MB/s the progress indicator did not + move - the message queue was full and WM_TIMER messages were therefore not being + delivered (now WM_TIMER is generated artificially under heavy load so the timers in + use work at least somewhat) ++ability to suppress the "connection has been lost" warning (some users do not care + that the panel has no open connection) ++changed default value: upload-transfer-failed-on-created-file = Resume or Overwrite + (instead of Overwrite) - it turned out that it is better to risk a Resume error + (quite unlikely) than to use only Overwrite (for longer uploads, living without + Resume is simply not possible) ++changed default value: logging for connections used by operations is now enabled by + default (overhead is minimal, there is no need to explain "how to enable logging" + to everyone who has some FTP problem) ++the plugin menu uses the SALCMD_DISCONNECT command - propagating the F12 key for + Disconnect ++heuristic for obtaining the OS name from the response to the SYST command (it does + not take the first word blindly, as the FTP RFC says, but searches word by word + for a known OS type - now it also works for, for example, the German translation: + "215 Betriebssystem OS/2") +-based on a bug report from a user, we know that not only uploads longer than + 1.5 hours can cause the server not to respond to the STOR command - I added + support for checking the size of a file uploaded in ASCII mode + (it tests whether the size matches the CRLF or LF size, it is not 100% reliable, + it may report a "match" even for an incomplete file if it is truncated by exactly + as many characters as there are lines and it uses CRLF line endings) +-in the Add/Edit Proxy Server dialog, the default port according to the proxy + server type was always set when the dialog opened (overwriting the user's setting) ++after an operation on the FTP server finishes, the panel is refreshed immediately + (it does not wait for the panel to be activated - if the user switched to another + program, they return to the panel with an up-to-date listing) +-moving files between FTP and a network path caused unnecessary connection losses + (the operation could not hand the connection back to the panel, so the panel + requested a new connection and the original one was discarded) +-Add Bookmark from the panel context menu did not work correctly (its parameters + were shifted) ++support for another mainframe: Tandem -FTP released with Servant Salamanderem 2.5 beta 10a: (09/30/2005) --pri automatickem reconnectu v panelu se nezobrazoval duvod reconnectu - (napr. "connection lost"), ale prazdny text +FTP released with Servant Salamander 2.5 beta 10a: (09/30/2005) +-during automatic reconnect in the panel, the reason for reconnect was not shown + (e.g. "connection lost"), only an empty text -FTP released with Servant Salamanderem 2.5 beta 10: (09/27/2005) -+podpora pro FTP proxy servery (proxy na portu 21, proti klasickemu FTP jen - upravena sekvence login prikazu) --pri delsich uploadech/downloadech nez 1,5 hodiny dochazi k tomu, ze server - neodpovi na STOR/RETR prikaz - doted to znamenalo fail a tedy treba i nove - tahani celeho souboru - nove se dela test velikosti / Resume --uprava parseru VMS1-4 podle novejsi verze listingu prazdneho adresare z - cs.felk.cvut.cz (misto chyby vraci listing s jednim radkem +FTP released with Servant Salamander 2.5 beta 10: (09/27/2005) ++support for FTP proxy servers (proxy on port 21; compared to classic FTP, only + the login command sequence is modified) +-during uploads/downloads longer than 1.5 hours, the server may fail to respond + to the STOR/RETR command - until now that meant failure and thus, for example, + downloading the whole file again - now size checking / Resume is used +-adjusted the VMS1-4 parser according to a newer empty-directory listing from + cs.felk.cvut.cz (instead of an error it returns a listing with one line "Total of 0 files, 0/0 blocks") -+dopsano Skip tlacitko v operacnim dialogu -+dopsana Pause tlacitka v operacnim dialogu -+podpora pro IBM AIX v nemecke verzi (proti stavajicimu parseru ma prohozene - sloupce mesic a den) + PWD odpovedi maji nestandardni format -+Solve Error dialogy uz nevypinaji checkbox "Close this dialog when operation - finishes" (po vyreseni chyb se okno operace samo zavre) -+View, Quick Rename, Delete, Copy/Move from server (download): dopsane zamykani - pouzivanych souboru na serveru (prevence kolizi) -+Quick Rename se pta na prepis existujiciho souboru (da se potlacit v konfiguraci - na Confirmations) -+nove umi i prepis souboru jineho usera na unixovych FTP serverch (pokud - overwrite hlasi chybu, provede se nejdrive delete souboru a pak teprve zapis) -+Solve Error dialogy maji az pet tlacitek (pribylo Resume a Overwrite), - zbytek funkci je stale v kontextovem menu na Retry buttonu --pokud username obsahoval '@', nefungoval upload a mnohe dalsi veci (ted uz - snad username muze obsahovat cokoliv i ':', '/' a '\\') --pri maximalizovanem dialogu operace se Solve Error dialogy otevirali az po - deseti sekundovem cekani + "close when finished" se sam cistil (maximalizace - se chovala jako userova akce v dialogu) --Microsoft IIS (Windows NT) parser nove umi preskocit adresare a soubory beze - jmena (jen mezery v nazvu) ++added a Skip button to the operation dialog ++added Pause buttons to the operation dialog ++support for IBM AIX in the German version (compared to the existing parser, it has + swapped month and day columns) and PWD responses have a nonstandard format ++Solve Error dialogs no longer clear the "Close this dialog when operation finishes" + checkbox (after errors are resolved, the operation window closes itself) ++View, Quick Rename, Delete, Copy/Move from server (download): added locking of + files used on the server (collision prevention) ++Quick Rename asks before overwriting an existing file (can be suppressed in the + Confirmations configuration) ++it can now overwrite files owned by another user on Unix FTP servers too (if + overwrite reports an error, the file is deleted first and only then written) ++Solve Error dialogs can have up to five buttons (Resume and Overwrite were added), + the rest of the functionality remains in the context menu on the Retry button +-if the username contained '@', upload and many other things did not work (now the + username can hopefully contain anything, including ':', '/' and '\\') +-when the operation dialog was maximized, Solve Error dialogs opened only after a + ten-second wait and "close when finished" cleared itself (maximizing was treated + as a user action in the dialog) +-Microsoft IIS (Windows NT) parser can now skip directories and files without names + (only spaces in the name) From 70ce8dafed5c8a1b45dae7c904994ebdceb6e3cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:59:52 +0200 Subject: [PATCH 687/710] [translation] Fix src/plugins/ftp/servers/path_types.txt comments (#1068) --- src/plugins/ftp/servers/path_types.txt | 28 ++++++++++++++------------ 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/plugins/ftp/servers/path_types.txt b/src/plugins/ftp/servers/path_types.txt index bdc065443..f8a442a23 100644 --- a/src/plugins/ftp/servers/path_types.txt +++ b/src/plugins/ftp/servers/path_types.txt @@ -1,23 +1,25 @@ +CommentsTranslationProject: TRANSLATED + UNIX: /pub/d -d - relativni +d - relative / - root VMS: PUB$DEVICE:[PUB.VMS] PUB$DEVICE:[PUB] [PUB.VMS] -PUB$DEVICE:[PUB]FILE.TXT;1 - soubor -[.VMS] - relativni +PUB$DEVICE:[PUB]FILE.TXT;1 - file +[.VMS] - relative [000000] - root PUB$DEVICE:[000000] - root -PUB$DEVICE:[PUB.aa^.bb] - "aa^.bb" je jmeno adresare ("^." je escape-sekvence pro '.') -PUB$DEVICE:[PUB]FI^.LE.TXT;1 - "FI^.LE.TXT;1" je jmeno souboru ("^." je escape-sekvence pro '.') +PUB$DEVICE:[PUB.aa^.bb] - "aa^.bb" is the directory name ("^." is the escape sequence for '.') +PUB$DEVICE:[PUB]FI^.LE.TXT;1 - "FI^.LE.TXT;1" is the file name ("^." is the escape sequence for '.') MVS: 'VEA0016.MAIN.CLIST' 'VEA0016.MAIN.CLIST.' -MAIN.CLIST - relativni +MAIN.CLIST - relative '' - root NOVELL/WINDOWS-NT: @@ -25,24 +27,24 @@ NOVELL/WINDOWS-NT: /PUB/DIR \PUB\DIR\ /PUB/DIR/ -DIR - relativni +DIR - relative / - root \ - root IBM z/VM (CMS): ACADEM:ANONYMOU.PICS -ACADEM:ANONYMOU. - root (pozor: '.' na konci povinna) +ACADEM:ANONYMOU. - root (note: the trailing '.' is required) OS/2: C:/dir1/dir2 -dir2 - relativni +dir2 - relative C:/ - root -(pro sychr pocitame i s backslashem:) +(for safety we also handle backslashes:) C:\dir1\dir2 -dir2 - relativni +dir2 - relative C:\ - root Tandem: \SYSTEM.$VVVVV.SUBVOLUM.FILENAME -SUBVOLUM - relativni -\SYSTEM ('\\' + text do prvni tecky) - root cesty +SUBVOLUM - relative +\SYSTEM ('\\' + text up to the first dot) - path root From 8d6e3ca092bf0aba7015de658526226681c2468c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 17:59:56 +0200 Subject: [PATCH 688/710] [translation] Fix src/plugins/ftp/servers/target_path_types.txt comments (#1069) --- src/plugins/ftp/servers/target_path_types.txt | 68 +++++++++---------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/src/plugins/ftp/servers/target_path_types.txt b/src/plugins/ftp/servers/target_path_types.txt index efb25dd7b..ea86e7f56 100644 --- a/src/plugins/ftp/servers/target_path_types.txt +++ b/src/plugins/ftp/servers/target_path_types.txt @@ -1,50 +1,50 @@ +CommentsTranslationProject: TRANSLATED + OS/2: NOVELL/WINDOWS-NT: UNIX: -/pub/d/dir ("/pub/d/dir" musi byt cesta a musi existovat) -/pub/d/*.* ("/pub/d" musi byt cesta a musi existovat, "*.*" je maska) -/pub/d/newname ("/pub/d" musi byt cesta a musi existovat, "/pub/d/newname" - neexistuje nebo jde o soubor (v tomto pripade musi byt oznaceny - soubor, u adresare nesmysl), "newname" je - novy nazev jedineho zdrojoveho souboru/adresare) +/pub/d/dir ("/pub/d/dir" must be a path and it must exist) +/pub/d/*.* ("/pub/d" must be a path and it must exist, "*.*" is a mask) +/pub/d/newname ("/pub/d" must be a path and it must exist, "/pub/d/newname" + does not exist or it is a file (in this case a file must be selected; + for a directory this would make no sense), "newname" is + the new name of the single source file/directory) VMS: -PUB$DEVICE:[PUB.VMS] ("PUB$DEVICE:[PUB.VMS]" musi byt cesta a musi existovat) +PUB$DEVICE:[PUB.VMS] ("PUB$DEVICE:[PUB.VMS]" must be a path and it must exist) -oznacene jen soubory: -PUB$DEVICE:[PUB.VMS]*.* ("PUB$DEVICE:[PUB.VMS]" musi byt cesta a musi existovat, "*.*" je maska) +only files selected: +PUB$DEVICE:[PUB.VMS]*.* ("PUB$DEVICE:[PUB.VMS]" must be a path and it must exist, "*.*" is a mask) -oznaceny jeden soubor: -PUB$DEVICE:[PUB.VMS]newname ("PUB$DEVICE:[PUB.VMS]" musi byt cesta a musi existovat, - "PUB$DEVICE:[PUB.VMS]newname" neexistuje nebo jde o soubor, - "newname" je novy nazev jedineho zdrojoveho souboru) +one file selected: +PUB$DEVICE:[PUB.VMS]newname ("PUB$DEVICE:[PUB.VMS]" must be a path and it must exist, + "PUB$DEVICE:[PUB.VMS]newname" does not exist or it is a file, + "newname" is the new name of the single source file) -oznacene jen adresare: -PUB$DEVICE:[PUB.VMS.*] ("PUB$DEVICE:[PUB.VMS]" musi byt cesta a musi existovat, "*" je maska) +only directories selected: +PUB$DEVICE:[PUB.VMS.*] ("PUB$DEVICE:[PUB.VMS]" must be a path and it must exist, "*" is a mask) -oznaceny jeden adresar: -PUB$DEVICE:[PUB.VMS.newname] ("PUB$DEVICE:[PUB.VMS]" musi byt cesta a musi existovat, - "PUB$DEVICE:[PUB.VMS.newname]" neexistuje, - "newname" je novy nazev jedineho zdrojoveho adresare) +one directory selected: +PUB$DEVICE:[PUB.VMS.newname] ("PUB$DEVICE:[PUB.VMS]" must be a path and it must exist, + "PUB$DEVICE:[PUB.VMS.newname]" does not exist, + "newname" is the new name of the single source directory) MVS: -'VEA0016.MAIN.CLIST' ("'VEA0016.MAIN.CLIST'" musi byt cesta a musi existovat) -'VEA0016.MAIN.CLIST.*' ("'VEA0016.MAIN.CLIST'" musi byt cesta a musi existovat, "*" je maska) -'VEA0016.MAIN.CLIST.newname' ("'VEA0016.MAIN.CLIST'" musi byt cesta a musi existovat, - 'VEA0016.MAIN.CLIST.newname' neexistuje nebo je soubor, - (v tomto pripade musi byt oznaceny soubor, u adresare nesmysl), - "newname" je novy nazev jedineho zdrojoveho souboru/adresare) +'VEA0016.MAIN.CLIST' ("'VEA0016.MAIN.CLIST'" must be a path and it must exist) +'VEA0016.MAIN.CLIST.*' ("'VEA0016.MAIN.CLIST'" must be a path and it must exist, "*" is a mask) +'VEA0016.MAIN.CLIST.newname' ("'VEA0016.MAIN.CLIST'" must be a path and it must exist, + 'VEA0016.MAIN.CLIST.newname' does not exist or it is a file, + (in this case a file must be selected; for a directory this would make no sense), + "newname" is the new name of the single source file/directory) IBM z/VM (CMS): -ACADEM:ANONYMOU.PICS ("ACADEM:ANONYMOU.PICS" musi byt cesta a musi existovat) - -oznacene jen soubory: -ACADEM:ANONYMOU.PICS.*.* (maska je formatu: filename '.' filetype; "ACADEM:ANONYMOU.PICS" - musi byt cesta a musi existovat) - -oznacene jen adresare: -ACADEM:ANONYMOU.PICS.* (maska je formatu: dirname; "ACADEM:ANONYMOU.PICS" musi byt cesta - a musi existovat) +ACADEM:ANONYMOU.PICS ("ACADEM:ANONYMOU.PICS" must be a path and it must exist) +only files selected: +ACADEM:ANONYMOU.PICS.*.* (the mask format is: filename '.' filetype; "ACADEM:ANONYMOU.PICS" + must be a path and it must exist) +only directories selected: +ACADEM:ANONYMOU.PICS.* (the mask format is: dirname; "ACADEM:ANONYMOU.PICS" must be a path + and it must exist) From 45119092559dc921efc7c281aa4667d3cfe4b0ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 18:00:00 +0200 Subject: [PATCH 689/710] [translation] Fix src/plugins/ftp/servers/todo.txt comments (#1070) --- src/plugins/ftp/servers/todo.txt | 236 ++++++++++++++++++------------- 1 file changed, 139 insertions(+), 97 deletions(-) diff --git a/src/plugins/ftp/servers/todo.txt b/src/plugins/ftp/servers/todo.txt index fd3736c2e..12cfcbcae 100644 --- a/src/plugins/ftp/servers/todo.txt +++ b/src/plugins/ftp/servers/todo.txt @@ -1,107 +1,149 @@ -- porad narazime na lidi, ktery chteji ukladat bookmarky, ale nechteji ukladat - konfiguraci Salama, aby si neco neopspinili (asi trochu uchylaci) ... resit - (dat tam tlacitko pro ulozeni jen FTP konfigu, jaka jsou rizika??? pri unloadu - pluginu to delame taky) -- download/upload do "filename.part" a az po dokonceni prenosu rename na "filename" - (asi jen na UNIXovych serverech + kde to pujde snadno, u ostatnich nechat jak to je ted) +CommentsTranslationProject: TRANSLATED -- CPluginFSInterface::GetFullFSPath by mel nejspis vracet plnou cestu i pri pastnuti - jmena souboru do panelu (ted se tvrde zkousi zmena cesty, takze musi jit o adresar), - ted kvuli tomu nechodi focus souboru v panelu (pres paste jeho jmena do panelu) -- moznost vybrat casovou zonu serveru (nebo aspon zadat o kolik hodin se vsechno - ma automaticky posouvat) -- moznost vybrat transfer mode pro prave startovanou operaci (copy/move)??? -- komprese behem prenosu - MODE Z - zajem na foru nebyl, ale mohlo by byt celkem trivialni -- umoznit userum konfiguraci poctu pripojeni pro operace: asi zadat pocet pro - kazdy typ operace zvlast a pak kdyz se operace nastartuje, zacit je postupne - pridavat (dokud je server nezacne odmitat) -- Move (F6 key): mohlo by umet aspon hromadne prejmenovani na serveru: oznacim vic souboru, - zadam masku "*.old" a prejmenuje se to posloupnosti RNFR+RNTO -- klavesa Enter by mela v progress dialogu v listview Operations i Connections otevirat - Solve Error dialogy -- automaticke rolovani v listview Operations, aby user videl na operace, ktery se prave - provadeji (ted je nutne rolovat rucne), viz https://forum.altap.cz/viewtopic.php?f=2&t=3433 -- upload/download in lower/UPPER case - omrknout konkurenci -- pri zmene bookmarku v Connect dialogu pridat potvrzeni (lidi si to meni nechtene) -- pri reconnectech zjistovat znovu IP adresu serveru (muze byt dynamicka a zmenit se), - asi by stacilo jednou za 5 minut (otazka je, jestli to neni zbytecna komplikace, DNS - je snad lokalni sluzba, takze asi moc zdrzovat nebude) -- pri kopirovani na FAT32 disk varovat u souboru vetsiho nez 4GB minus 2 byty, ze ho neni mozne - ulozit (viz testy v Salamovi: IDS_FILEISTOOBIGFORFAT32) -- do konfigurace u problemu "if tgt file exists" pridat option "overwrite if src is newer" (chtel Tom - jako nahrazku synchronizace) -- pridat moznost "select server code page": pro konverzi listingu do ANSI (ovsem musime si nechat - i originaly kvuli adresaci souboru na serveru): Kalashnikov Alexander : - During files browsing I see unreadable symbols. Our FTP server supports only DOS code table. -- pridat Paste do kontextoveho menu panelu (salamanderi command) -- moznost specifikovat chovani FTP per connection pro veci jako je treba prepisovani souboru, - adresaru, kolize jmen, atp. Tedy to co je mozne nyni nastavit jen pro cely plugin. - Casto u nekterych FTP porad jen prepisuju (napr. kopirovani zdrojaku na testovaci masinu) - a nechci aby me 100 za den otravoval dialog na prepsani. -- FXP: hodi se hlavne pri presunech/kopirovani dat v ramci jednoho serveru - (zrejme by nemuselo byt az tak slozite: pridat control-connectionu na - druhy server a zadat datovy prenos, datovou connectionu uz oteviraji servery - jen mezi sebou - takze nejsme schopny ukazat ani progres) -- lidi chteji do "disconnect or keep connection?" dialogu pri odchodu z FTP - cesty checkbox "always disconnect" (ted je tam jen "always keep") -- lidi taky nechapou, proc se to pta "disconnect or keep connection?" v situaci, kdy uz - byla connectiona zavrena (by server, due to inactive user): asi v teto situaci zmenit - dotaz na "close or keep FTP path?" a checkboxy asi nabizet take oba + zavest tomuto dotazu - zvlastni polozku v FTP-konfiguraci/Confirmations -- Password Manager: pamet na hesla z bookmark ale i z quick-connectu a spojeni na - zaklade pastnuti URL do panelu -- mel by byt chranitelny heslem + uzamknutelny - (kdyz user odejde od masiny, aby se cizi osoba nedostala k jeho heslum) -- casy na FTP nesedi o hodinu diky zmene casu letni/zimni. Doplnit korekci o cele hodiny? -- SSL ("FTPS is simply ftp with SSL for the control channel" (viz CURL) - (server s SSL je GlobalSCAPE FTP Server - trial ver. viz X:\STORE)) -- udelat auto-focus polozky, kterou zpracovava vyfokusena connectiona - delat - to jen kdyz je user neaktivni (abych mu nescroloval behem toho, co sam neco hleda) -- na FTP bookmarku dopsat Export, ktery vytvori soubor, ktery se da snadno - prenest a na druhe masine Importovat a pridat tak FTP bookmarku. Navic by - to melo by jit udelat pro vic vybranych bookmark najednou -- lidi chteji i pamet na cesty v ramci kazdeho serveru (v ramci bookmarky), - je to naprgany ve FlashFXP -- lidi chteji foldry v bookmarkach (kdyz jich nekdo ma stovky, neni se co divit), - proste silenci ;-) -- keep-alive s data-transfer (NLST+LIST): cas pro poslani dalsiho keep-alive prikazu - by se mel urcovat od posledniho data-transferu a ne od posledni aktivity na serveru -- fronta uloh FTP - svuj thread, load/save, export/import vyberu (zprovoznit checkboxy - v F5/F8/F6/Ctrl+F2 dialozich) -- prejit na bookmarkove cesty: ukladat do historie/hotpath/atd na zaklade udaju o serveru - z bookmark (treba ftp:///bookmarkUID/path) - resilo by pamet hesel+passive mode+list-cmd+... - "bookmarkUID" by se asi generovalo z usera + hosta + portu a delalo by se unikatni - pomoci "(cislo)" - user by si to mohl libovolne zmenit (jen zachovat unikatnost + '/' je - zakazany znak) - +co rozsirit hesla v ceste na scrambleny hesla (ftp://user:scrambledpasswd@server/path)??? -- periodicky update listingu (treba po deseti sekundach - nastavitelne) + user - by mel mit sanci povolit refresh pri aktivaci Salama s FTP v panelu -- nekteri silenci chteji refresh uplne zakazat (nechat to ciste na nich, kdy si - stisknou Ctrl+R) - pisou o pomalem pripojeni a "nedulezitych operacich" typu - prejmenovani (asi vic malych operaci za sebou + prudi je cekat vzdy na refresh) -- dodelat sloupce - razeni (nejen podle viditelnych sloupcu) + sirky u custom - sloupcu + zmenu viditelnosti sloupcu + volba zarovnani vlevo -- podpora pro listingy vznikle prikazem NLST (jen jmena) - problem: jak to udelat, - aby to nevzalo vsechny listingy (rest-of-line bude TRUE pro vsechny listingy) - (asi to natvrdo ohackovat podle prikazu listovani - je-li "NLST", vubec nepouzivat - klasicky vyber parseru, proste to primo vrznout do panelu jako soubory) -- pridavani/update server types: - -jmeno pridavaneho noveho typu serveru nekoliduje -> vlozime ho - -user uz novy typ serveru importoval, ale needitoval ho -> updatneme ho (prip. zmenime prioritu) - -user uz novy typ serveru importoval a editoval ho NEBO user pridal - novy typ a jmenem se trefil do nove importovaneho typu -> dotaz na skip/update/rename_existing_and_insert_new -- raw listing v panelu ma zatim dva sloupce - Name+Listing -> predelat na - jeden sloupec (pridat vlastni razeni podle cisel radku a ne podle abecedy + vypnout - razeni podle jmena v panelu a na sloupci "Name") -- HTTP support - staci stazeni jednoho souboru - vcetne retry je to - neocenitelny - WWW browsery jsou strasny sracky -- operace bez parsnuteho listingu - manual mode - ma to vubec cenu prgat??? +- we keep running into users who want to save bookmarks but do not want to save + the Salamander configuration so they do not mess anything up (a bit + eccentric, apparently) ... address this + (add a button to save only the FTP configuration, what are the risks??? we + already do that when the plugin is unloaded) +- download/upload to "filename.part" and rename to "filename" only after the + transfer finishes + (probably only on UNIX servers + wherever it is easy to support, leave the + current behavior elsewhere) + +- CPluginFSInterface::GetFullFSPath should probably return the full path even + when a file name is pasted into the panel (the code currently tries a hard + path change, so it must be a directory), + which is why focusing a file in the panel does not work now (when its name is + pasted into the panel) +- allow selecting the server time zone (or at least specify by how many hours + everything should be shifted automatically) +- allow selecting the transfer mode for the operation being started right now + (copy/move)??? +- compression during transfer - MODE Z - there was no interest on the forum, + but it could be fairly trivial +- allow users to configure the number of connections for operations: probably + enter a separate count for each operation type and then, when the operation + starts, add them gradually + (until the server starts rejecting them) +- Move (F6 key): it should at least support batch renaming on the server: + select multiple files, enter the mask "*.old", and rename them using an + RNFR+RNTO sequence +- the Enter key should open Solve Error dialogs in the progress dialog listviews + Operations and Connections +- automatic scrolling in the Operations listview so the user can see the + operations currently running + (manual scrolling is required now), see https://forum.altap.cz/viewtopic.php?f=2&t=3433 +- upload/download in lower/UPPER case - check the competition +- when a bookmark is changed in the Connect dialog, add a confirmation + (people change it unintentionally) +- during reconnects, resolve the server IP address again (it may be dynamic and + change), + once every 5 minutes would probably be enough (the question is whether this + is not unnecessary complexity, DNS is probably a local service, so it should + not delay things much) +- when copying to a FAT32 disk, warn for files larger than 4 GB minus 2 bytes + that they cannot be saved + (see Salamander tests: IDS_FILEISTOOBIGFORFAT32) +- in the configuration for the "if tgt file exists" problem, add the option + "overwrite if src is newer" (Tom wanted this as a synchronization substitute) +- add the option "select server code page": for converting listings to ANSI + (but we must also keep the originals for addressing files on the server): + Kalashnikov Alexander : + During files browsing I see unreadable symbols. Our FTP server supports only + DOS code table. +- add Paste to the panel context menu (Salamander command) +- allow specifying per-connection FTP behavior for things such as overwriting + files, directories, name collisions, etc. That is, what can currently be set + only for the whole plugin. + On some FTP servers I keep overwriting everything all the time (for example, + copying sources to a test machine), and I do not want an overwrite dialog to + bother me 100 times a day. +- FXP: mainly useful for moving/copying data within one server + (it probably would not even be that hard: add a control connection to the + second server and start the data transfer, the data connection is then opened + by the servers between themselves only, so we cannot show any progress + anyway) +- people want an "always disconnect" checkbox in the "disconnect or keep + connection?" dialog when leaving an FTP path + (there is only "always keep" there now) +- people also do not understand why it asks "disconnect or keep connection?" in + a situation where the connection has already been closed + (by the server, due to inactive user): in this situation, probably change the + prompt to "close or keep FTP path?" and probably offer both checkboxes here + as well + add a separate item for this prompt in FTP + configuration/Confirmations +- Password Manager: remember passwords from bookmarks as well as from quick + connect and connections established by pasting a URL into the panel -- it + should be protectable by a password + lockable + (so that when the user leaves the machine, another person cannot access + their passwords) +- FTP times are off by one hour due to daylight saving / standard time changes. + Add correction by whole hours? +- SSL ("FTPS is simply ftp with SSL for the control channel" (see CURL) + (a server with SSL is GlobalSCAPE FTP Server - trial version, see X:\STORE)) +- auto-focus the item being processed by the focused connection - do it only + when the user is inactive (so I do not scroll the list while they are looking + for something themselves) +- add Export to an FTP bookmark, creating a file that can be transferred easily + and imported on another machine to add the FTP bookmark there. It should also + be possible to do this for multiple selected bookmarks at once +- people also want path history within each server (within the bookmark), + FlashFXP has it hacked in +- people want folders in bookmarks (when someone has hundreds of them, it is + not hard to see why), + just power users gone wild ;-) +- keep-alive with data transfer (NLST+LIST): the time for sending the next + keep-alive command should be based on the last data transfer, not the last + activity on the server +- FTP job queue - its own thread, load/save, export/import selection + (enable checkboxes in the F5/F8/F6/Ctrl+F2 dialogs) +- switch to bookmark-based paths: store history/hot paths/etc. based on server + information from the bookmark + (for example ftp:///bookmarkUID/path) - it would solve password memory + + passive mode + list command + ... + "bookmarkUID" would probably be generated from user + host + port and made + unique using "(number)" - the user could change it freely + (just keep uniqueness + '/' is a forbidden character) + + what about expanding passwords in the path to scrambled passwords + (ftp://user:scrambledpasswd@server/path)??? +- periodic listing refresh (for example every ten seconds - configurable) + the + user should have a chance to enable refresh when Salamander is activated with + FTP in a panel +- some power users want refresh disabled entirely (leave it entirely up to them + when to press Ctrl+R) - they complain about slow connections and + "unimportant operations" such as renaming + (probably several small operations in a row + they are annoyed by waiting for + refresh every time) +- finish columns - sorting (not only by visible columns) + widths for custom + columns + changing column visibility + left alignment option +- support for listings produced by the NLST command (names only) - problem: how + to do it so it does not catch all listings + (rest-of-line will be TRUE for all listings) + (probably hardwire it according to the listing command - if it is "NLST", do + not use the normal parser selection at all, just put it directly into the + panel as files) +- adding/updating server types: + - the name of the newly added server type does not collide -> insert it + - the user has already imported the new server type, but has not edited it + -> update it (possibly change priority) + - the user has already imported and edited the new server type OR the user + added a new type and happened to hit the same name as the newly imported + type -> prompt for skip/update/rename_existing_and_insert_new +- raw listing in the panel currently has two columns - Name+Listing -> convert + it to a single column + (add custom sorting by line numbers instead of alphabetically + disable + sorting by name in the panel and on the "Name" column) +- HTTP support - downloading a single file is enough - with retry it would be + invaluable - web browsers are terrible +- operations without a parsed listing - manual mode - is it even worth hacking + in??? ------------------------------------------------------------------------ ------------------------------------------------------------------------ ------------------------------------------------------------------------ -CRC ze serveru: XCRC (asi nepodporuje zrovna kazdy server) +CRC from the server: XCRC (probably not supported by every server) Cache entire structure (whole site): "LIST -laR" From dd41c2028978c2f12765f3ddbee1cc97d5c46783 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 18:00:04 +0200 Subject: [PATCH 690/710] [translation] Fix src/plugins/ftp/servers/proxy_script.txt comments (#1071) --- src/plugins/ftp/servers/proxy_script.txt | 102 ++++++++++++----------- 1 file changed, 52 insertions(+), 50 deletions(-) diff --git a/src/plugins/ftp/servers/proxy_script.txt b/src/plugins/ftp/servers/proxy_script.txt index cd6fc71ed..99bcc3dc6 100644 --- a/src/plugins/ftp/servers/proxy_script.txt +++ b/src/plugins/ftp/servers/proxy_script.txt @@ -1,53 +1,55 @@ -Popis formatu prihlasovaciho skriptu (pro proxy-servery a firewally): -===================================================================== - -Prvni radek skriptu je vzdy "Connect to:" nasledovany dvojici host:port - jde -o hostitele (server) a port kam se mame pripojit. Hostitel musi byt definovany, -neni-li definovany port, predpoklada se 21. - -Vsechny dalsi radky obsahuji prikazy posilane na server po pripojeni (co radek, -to jeden prikaz). Radky muzou obsahovat promenne, ktere se pred poslanim -prikazu nahradi obsahem techto promennych. - -Mame promenne dvou typu, lisi se podle toho co se deje kdyz promenna neni -definovana (zadana uzivatelem) - prvni typ (rikejme mu "nepovinny") vede -k preskoceni celeho radku (neposle se zadny prikaz), druhy (rikejme mu -"povinny") vede k otevreni okna, kam uzivatel musi zadat hodnotu (nebo -prerusit celou prihlasovani sekvenci). Promenne se pisou do zavorek a -predchazi jim znak "$": napr. "$(Password)". "$$" je escape sekvence pro -znak "$". - -Radky zacinajici na "3xx:" se preskakuji pokud byl prikaz z predchoziho radku -preskocen nebo vratil jinou odpoved nez 3xx (3xx="posli dalsi prikaz, jde -o sekvenci prikazu" - zde jde o user+password sekvence). - -Omezeni parametru na prvnim radku skriptu (za "Connect to:"): hostitele je -mozne definovat jen jako text nebo text obsahujici promennou $(ProxyHost) -nebo $(Host), port je mozne definovat jen jako cislo nebo promennou $(ProxyPort) -nebo promennou $(Port). - -Prihlasovaci sekvence se povazuje za uspesnou (uzivatel je prihlasen na FTP -serveru) pokud zadny spousteny prikaz nevrati odpoved 4xx ani 5xx (4xx="docasna -chyba", 5xx="stala chyba") a posledni poslany prikaz vrati odpoved 2xx -(2xx="uspech"). - - -Promenne: -========= - -$(ProxyHost) - povinny - jmena adresa nebo IP proxy-serveru/firewallu -$(ProxyPort) - vzdy definovany (nezada-li ho uzivatel, nastavi se na 21) -$(ProxyUser) - nepovinny - uzivatelske jmeno pro proxy-server/firewall -$(ProxyPassword) - povinny - heslo pro proxy-server/firewall -$(Host) - vzdy definovany - hostitel (FTP server) -$(Port) - vzdy definovany (nezada-li ho uzivatel, nastavi se na 21) -$(User) - povinny - uzivatelske jmeno pro hostitele (FTP server) -$(Password) - povinny - heslo pro hostitele (FTP server) -$(Account) - povinny - ucet pro hostitele (FTP server) - - -Skripty pro zname typy proxy-serveru/firewallu: -=============================================== +CommentsTranslationProject: TRANSLATED + +Description of the login script format (for proxy servers and firewalls): +========================================================================= + +The first line of the script is always "Connect to:" followed by a host:port +pair - this is the host (server) and port we should connect to. The host must +be defined; if the port is not defined, 21 is assumed. + +All following lines contain commands sent to the server after connecting (one +line, one command). The lines may contain variables that are replaced with +their contents before the command is sent. + +There are two types of variables; they differ in what happens when the variable +is not defined (entered by the user) - the first type (let us call it +"optional") causes the entire line to be skipped (no command is sent), while +the second type (let us call it "required") opens a window where the user must +enter a value (or cancel the entire login sequence). Variables are written in +parentheses and are preceded by the "$" character, for example "$(Password)". +"$$" is an escape sequence for the "$" character. + +Lines starting with "3xx:" are skipped if the command on the previous line was +skipped or returned a reply other than 3xx (3xx = "send the next command, this +is a command sequence" - here this is a user+password sequence). + +Restrictions for parameters on the first script line (after "Connect to:"): +the host may be defined only as text or text containing the $(ProxyHost) or +$(Host) variable, and the port may be defined only as a number or the +$(ProxyPort) or $(Port) variable. + +The login sequence is considered successful (the user is logged in to the FTP +server) if no executed command returns a 4xx or 5xx reply (4xx = "temporary +error", 5xx = "permanent error") and the last sent command returns a 2xx reply +(2xx = "success"). + + +Variables: +========== + +$(ProxyHost) - required - domain name or IP address of the proxy server/firewall +$(ProxyPort) - always defined (if the user does not enter it, it is set to 21) +$(ProxyUser) - optional - user name for the proxy server/firewall +$(ProxyPassword) - required - password for the proxy server/firewall +$(Host) - always defined - host (FTP server) +$(Port) - always defined (if the user does not enter it, it is set to 21) +$(User) - required - user name for the host (FTP server) +$(Password) - required - password for the host (FTP server) +$(Account) - required - account for the host (FTP server) + + +Scripts for known proxy server/firewall types: +============================================== "direct connection" Connect to: $(Host):$(Port) From bbfe62ca66b5101b0ae066618f557c5f21aeac2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 18:00:08 +0200 Subject: [PATCH 691/710] [translation] Fix src/plugins/ftp/servers/parsing.txt comments (#1072) --- src/plugins/ftp/servers/parsing.txt | 966 ++++++++++++++-------------- 1 file changed, 494 insertions(+), 472 deletions(-) diff --git a/src/plugins/ftp/servers/parsing.txt b/src/plugins/ftp/servers/parsing.txt index fb3c805a3..bcec0ee19 100644 --- a/src/plugins/ftp/servers/parsing.txt +++ b/src/plugins/ftp/servers/parsing.txt @@ -1,478 +1,500 @@ -Popis formatu pravidel pro parsovani: -===================================== - -Komentar zacina znakem '#' a je ukoncen koncem radky. - -Vsechny pravidla zacinaji znakem '*' a konci znakem ';'. Pocet -pravidel neni omezen. Pravidlo se sklada z funkci vzajemne -oddelenych znakem ','. - -Funkce se sklada ze jmena, znaku '(', seznamu parametru a -znaku ')'. - -Seznam jmen funkci je uveden dale v dokumentu. - -V seznamu parametru funkce jsou jednotlive parametry vzajemne -oddelene znakem ','. Parametry jsou vyrazy. - -Vyraz tvori identifikator sloupce, stavova promenna, konstanta -nebo jedna binarni operace. Binarni operace se zapisuje -v klasicke notaci (prvni_operand operacni_znak druhy_operand) -a jako operandy se pouzivaji identifikatory sloupcu, stavove -promenne nebo konstanty. - -Seznam stavovych promennych je uveden dale v dokumentu. - -Seznam operacnich znaku je uveden dale v dokumentu. - -Konstanty jsou typu retezec, cislo nebo boolean. - -Retezec je ohranicen znaky '"', retezec nemuze presahovat -konec radky, escape-sekvence jsou uvozeny znakem '\': pro -znak '"' je to "\"", pro znak '\' je to "\\", pro znak -tabelator je to "\t", pro znaky konce radku CR+LF je to -dvojice "\r" a "\n". Nezname escape-sekvence se hlasi jako -chyby. - -Cislo se zapisuje desitkove bez jakychkoliv oddelovacu. -Zaporne cislo zacina znakem '-'. Kladne cislo zacina -znakem '+' (muze byt vynechan). - -Boolean je "true" nebo "false" (psano bez uvozovek). - -Uzivatel definuje sloupce. Kazdy sloupec ma jmeno identifikatoru, -typ hodnot, prazdnou hodnotu a jmeno a popis pro zobrazeni -v panelu. Identifikator se pouziva pri prirazovani hodnot -do sloupcu. Kazda polozka muze mit ve sloupci prirazenou -prave jednu hodnotu. Pokud nedoslo k prirazeni zadne hodnoty, -pouziva se ve sloupci uzivatelem definovana prazdna hodnota. -Dale se u sloupcu definuje, jestli se maji zobrazovat v panelu. -Zobrazeni nelze vypnout u sloupcu typu "Name" a "Extension". - -Identifikator sloupce zacina znakem '<', obsahuje jmeno -identifikatoru zadane uzivatelem a konci znakem '>'. - -Existuji nasledujici typy sloupcu: -- Name - (retezec) prave jeden sloupec tohoto typu je povinny, - nemuze byt schovany, definice prazdne hodnoty u nej nema smysl, - parser do nej musi u kazdeho souboru a adresare priradit, - pokud k prirazeni nedojde, nevznika parsovanim podle aktualniho - pravidla zadny soubor ani adresar - pouziva se pro preskok - prazdnych radek a dalsich nepodstatnych casti listingu, - prirazeni prazdneho retezce do tohoto sloupce se povazuje - za chybu parsovani, -- Extension - generuje se na zaklade hodnoty ve sloupci typu - "Name", nemuze byt schovany, definice prazdne hodnoty u nej - nema smysl, -- Size - (cislo - unsigned int64), u adresaru je hodnota vzdy 0 - a v panelu se zobrazuje "DIR", defaultni prazdna hodnota je 0, -- Date - (datum) - datum musi byt platny (jinak je nahrazen hodnotou - 1.1.1602), defaultni prazdna hodnota je 1.1.1602, -- Time - (cas) - defaultni prazdna hodnota je 0:00:00, -- Type - generuje se na zaklade hodnoty ve sloupci typu "Name", - definice prazdne hodnoty u nej nema smysl, -- Any Text - (retezec) - defaultni prazdna hodnota je "", -- Any Date - (datum) - datum musi byt platny (jinak je nahrazen - hodnotou 1.1.1602), defaultni prazdna hodnota je "", -- Any Time - (cas) - defaultni prazdna hodnota je "", -- Any Number - (cislo - signed int64) - defaultni prazdna hodnota - je "". - -Navic existuji tri sloupce s identifikatory "", "" -a "". Do vsech tri se prirazuji hodnoty typu boolean a rikaji -o polozce jestli je "soubor" nebo "adresar", jestli "je skryta" nebo -"neni skryta" a jestli "je link" nebo "neni link". Prirazeni do techto -sloupcu neni povinne, jejich prazdne hodnoty jsou "soubor", -"neni skryta" a "neni link". - - -Popis formatu podminky pro autodetekci: -======================================= - -Jde o logicky vyraz. Operatory ve vyrazu jsou (od nejvyssi -priority): NOT, AND a OR. NOT (logicka negace) je unarni, AND -(logicky soucin) a OR (logicky soucet) jsou binarni. Ve vyrazu -je dale mozne pouzivat zavorky (vymezeni podvyrazu). Jako operandy -se pouzivaji nasledujici funkce: - -- syst_contains(retezec) - nabyva hodnoty TRUE pokud se v odpovedi - serveru na prikaz SYST (get type of operating system) vyskytuje - zadany retezec, - -- welcome_contains(retezec) - nabyva hodnoty TRUE pokud se v prvni - odpovedi serveru (hned po navazani spojeni) vyskytuje zadany - retezec, - -- reg_exp_in_syst(retezec_regularniho_vyrazu) - nabyva hodnoty TRUE - pokud se v odpovedi serveru na prikaz SYST (get type of operating - system) vyskytuje retezec odpovidajici zadanemu regularnimu - vyrazu, - -- reg_exp_in_welcome(retezec_regularniho_vyrazu) - nabyva hodnoty TRUE - pokud se v prvni odpovedi serveru (hned po navazani spojeni) - vyskytuje retezec odpovidajici zadanemu regularnimu vyrazu. - +CommentsTranslationProject: TRANSLATED -Ziskani listingu pri pevne danem typu serveru: -============================================== - -Spusti se parsovani textu listingu. Pokud parsovani dopadne dobre, -pouziji se ziskane vysledky a algoritmus se ukonci. Pri neuspechu -parsovani se zobrazi text listingu bez uprav v panelu. - -Pred umistenim listingu do panelu jeste probehne odstraneni adresare -"." (je-li ve vysledcich parsovani) a u korenove cesty take -adresare ".." (je-li ve vysledcich parsovani). Pokud v listingu -zustava adresar "..", je vzdy viditelny (ignoruje se hodnota ve -sloupci ""). - - -Popis autodetekce typu serveru: +Description of the rule parsing format: ======================================= -Postupne se prochazeji vsechny definovane typy serveru. U kazdeho se -vyhodnoti "autodetect condition". Pokud tato podminka neni splnena, -pokracuje se v prochazeni dalsim typem serveru. Pri splneni podminky -se spusti parsovani textu listingu. Pokud parsovani dopadne dobre, -pouziji se ziskane vysledky a algoritmus se ukonci. Pokud nastane pri -parsovani chyba, pokracuje se v prochazeni dalsim typem serveru. - -Pokud se timto zpusobem projdou vsechny typy serveru bez uspechu, -pokracuje se postupnym prochazenim tech typu serveru, u kterych -nebyla splnena "autodetect condition". U nich se spousti parsovani -textu listingu. Stejne jako v predeslem pripade se algoritmus ukonci -v okamziku, kdy parsovani probehne bez chyby. - -Pokud zadny parser z definovanych typu serveru neuspeje pri parsovani -textu listingu, zobrazi se text listingu bez uprav v panelu. - -Autodetekce probehne timto zpusobem jen u listingu prvni cesty -na serveru. Pro dalsi listingy ze serveru se zkusi pouzit stejny -typ serveru jako pro predchozi listing (aby napr. prazdne listingy -meli "spravne" sloupce v panelu, atp.). Jen pokud nastane pri -parsovani timto typem serveru chyba, spusti se znovu proces -autodetekce typu serveru. - -Pred umistenim listingu do panelu jeste probehne odstraneni adresare -"." (je-li ve vysledcich parsovani) a u korenove cesty take -adresare ".." (je-li ve vysledcich parsovani). Pokud v listingu -zustava adresar "..", je vzdy viditelny (ignoruje se hodnota ve -sloupci ""). - - -Popis prubehu parsovani: -======================== - -Za uspech parseru se povazuje to, kdyz se podari pouzitim definovanych -pravidel projit cely text listingu. - -Pro popis algoritmu zavedeme pojem "ukazovatko", ktery oznacuje -pozici v textu listingu. +A comment starts with the '#' character and ends at the end of the line. + +All rules start with the '*' character and end with ';'. The number of +rules is unlimited. A rule consists of functions separated by ','. + +A function consists of a name, the '(' character, a list of +parameters, and the ')' character. + +The list of function names is given later in this document. + +In a function parameter list, individual parameters are separated by +','. Parameters are expressions. + +An expression consists of a column identifier, a state variable, a +constant, or one binary operation. A binary operation is written in the +usual notation (first_operand operator second_operand), and its +operands are column identifiers, state variables, or constants. + +The list of state variables is given later in this document. + +The list of operator symbols is given later in this document. -Pravidla se skladaji z funkci. Pravidlo muze byt pouzito jen tehdy, -kdyz se vsechny jeho funkce vyhodnoti jako uspesne, do sloupce typu -"Name" nebyl prirazen prazdny retezec (tedy bud byl prirazen -neprazdny retezec nebo k prirazeni vubec nedoslo) a ukazovatko -skonci na konci nektere radky textu listingu. Po pouziti pravidla -se ukazovatko automaticky presouva na zacatek nasledujici radky -textu listingu. - -Funkce krome vyhodnoceni sve uspesnosti a posunu ukazovatka jeste -muze prirazovat hodnotu do sloupce nebo tuto hodnotu muze menit. - -Parser muze mit definovanou celou radu pravidel. Vyber pravidla, -ktere se ma v dany okamzik parsovani pouzit, se vzdy provadi -v poradi jejich definice. Jinymi slovy, vzdy se pouzije prvni -pouzitelne pravidlo. - -Text listingu muze byt nekompletni z duvodu preruseni jeho nacitani -at jiz na zadost uzivatele nebo pro chybu spojeni se serverem. -Nekompletni text listingu je upraveny tak, ze obsahuje jen kompletni -radky textu (zbytek je oriznuty). - -Parsovani nekompletnich textu listingu je reseno na urovni pouzivani -pravidel. V jednodussim pripade se ukazovatko dostane na konec -textu po pouziti pravidla a tim se parsovani ukonci. Ve slozitejsim -pripade se pri pouziti pravidla vyhodnocuje funkce, ktera ma -ukazovatko posunout na dalsi radku. Tento posun neni mozny jen diky -nekompletnosti textu listingu, a proto se parsovani ukonci uspesne -(jako by text listingu koncil tak, ze by prave pouzivane pravidlo -nebylo vubec treba). - - -Zobrazeni celkove velikosti oznacenych souboru v info-line: -=========================================================== - -Aby se pri oznaceni skupiny souboru v info-line zobrazovala celkova -velikost v bytech nebo blocich, je nutne aby byla velikost souboru -ulozena ve sloupci typu "File Size in Bytes" nebo ve sloupci -typu "Any Number" pojmenovanem standardnim jmenem "Blocks" nebo -"BlkSz". - - -Seznam funkci: -============== - -Pokud neni uvedeno jinak, je funkce vzdy uspesna, neposouva ukazovatko -a neprirazuje hodnotu do zadneho sloupce. Pokud funkce posouva -ukazovatko, tak pokud neni uvedeno jinak, tak neumi preskocit konec -radky. - -Pred pouzitim identifikatoru sloupce ve vyrazu je nutne do -sloupce priradit hodnotu. Bez tohoto prirazeni vyraz nema -smysl (takovy vyraz se da nahradit booleanovou konstantou -vypocitanou dosazenim prazdne hodnoty pro dany sloupec do vyrazu). - -(white-space: mezera nebo tabelator) - -- skip_white_spaces() - preskoci ukazovatkem vsechny znaky white-space, - -- skip_to_number() - preskoci ukazovatkem k nejblizsi dekadicke cislici, - -- white_spaces() - preskoci ukazovatkem vsechny znaky white-space, - funkce je uspesna jen pokud dojde k posunu ukazovatka, - -- white_spaces(cislo) - preskoci ukazovatkem retezec znaku white-space - o delce 'cislo', funkce je uspesna jen pokud takovy retezec existuje, - -- white_spaces_and_line_ends() - preskoci ukazovatkem vsechny znaky - white-space a znaky konce radky, funkce je uspesna jen pokud - dojde k posunu ukazovatka a ukazovatko neskonci na konci listingu - (zarazi se na nejakem znaku), - -- rest_of_line() - posune ukazovatko na konec radky, funkce je uspesna - jen pokud dojde k posunu ukazovatka, - -- rest_of_line() - (typ hodnot ve sloupci musi byt - retezec) - priradi do sloupce retezec, ktery saha od ukazovatka az - do konce radky, ukazovatko se posune na konec radky, funkce je uspesna, - pokud se posune ukazovatko, - -- word() - preskoci ukazovatkem vsechny znaky mimo white-space a znak - konce radky, funkce je uspesna jen pokud dojde k posunuti ukazovatka, - -- word() - (typ hodnot ve sloupci musi byt retezec) - priradi do - sloupce retezec, ktery saha od ukazovatka az do prvniho white-space nebo - konce radky, ukazovatko se posune za konec tohoto retezce, funkce je - uspesna, pokud lze retezec ziskat (obsahuje aspon jeden znak), - -- number() - (typ hodnot ve sloupci musi byt cislo) - priradi - do sloupce dekadicke cislo lezici na pozici ukazovatka, toto cislo - nesmi byt ukoncene pismenem - povolene jsou vsechny oddelovace (',', - '.', ';', ':', atd.) vcetne znaku white-space a konce radku, ukazovatko - se posune za konec tohoto cisla, funkce je uspesna, pokud cislo existuje, - je korektne ukoncene a pokud jde o sloupec typu "Size", pak jeste pokud - je cislo nezaporne, - -- positive_number() - (typ hodnot ve sloupci musi byt cislo) - priradi - do sloupce kladne dekadicke cislo lezici na pozici ukazovatka, je-li cislo - zaporne, do sloupce se priradi defaultni prazdna hodnota (nula pro typ Size, - "" pro typ Any Number), toto cislo nesmi byt ukoncene pismenem - povolene - jsou vsechny oddelovace (',', '.', ';', ':', atd.) vcetne znaku white-space - a konce radku, ukazovatko se posune za konec tohoto cisla, funkce je uspesna, - pokud cislo existuje a je korektne ukoncene, - -- number_with_separators(, retezec) - (typ hodnot ve sloupci musi - byt cislo) - priradi do sloupce dekadicke cislo s oddelovaci radu - (pouziva se pro snazsi cteni velkych cisel, povolene oddelovace jsou - v retezci 'retezec', povolene jsou vsechny znaky krome '+', '-' a cislic) - lezici na pozici ukazovatka, toto cislo nesmi byt ukoncene - pismenem - povolene jsou vsechny oddelovace (',', '.', ';', ':', atd.) - vcetne znaku white-space a konce radku, ukazovatko se posune za konec - tohoto cisla, funkce je uspesna, pokud cislo existuje, je korektne - ukoncene a pokud jde o sloupec typu "Size", pak jeste pokud je cislo - nezaporne, - -- month_3() - (typ hodnot ve sloupci musi byt datum) - obohati - hodnotu ve sloupci o mesic rozpoznany ve trech pismenech na pozici - ukazovatka, pracuje s nazvy mesicu v ruznych jazycich (zatim alespon - anglicky a nemecky), mesic nesmi byt ukonceny pismenem - povolene jsou - vsechny oddelovace (',', '.', ';', ':', atd.) vcetne znaku white-space - a konce radku, ukazovatko se posune za tato tri pismena, funkce je - uspesna jen pokud byl mesic rozpoznan a vsechny mesice v listingu - patri do jedineho jazyku, - -- month_3(, retezec) - (typ hodnot ve sloupci musi byt - datum) - obohati hodnotu ve sloupci o mesic rozpoznany ve trech - pismenech na pozici ukazovatka, nazvy mesicu jsou v retezci, ktery - musi obsahovat dvanact tripismenych nazvu mesicu vzajemne oddelenych - mezerami (napr. "jan feb mar apr may jun jul aug sep oct nov dec" - pro anglictinu), mesic nesmi byt ukonceny pismenem - povolene jsou - vsechny oddelovace (',', '.', ';', ':', atd.) vcetne znaku - white-space a konce radku, ukazovatko se posune za tato tri pismena, - funkce je uspesna jen pokud byl mesic rozpoznan, - -- month_txt() - (typ hodnot ve sloupci musi byt datum) - obohati - hodnotu ve sloupci o mesic rozpoznany na pozici ukazovatka, pracuje - s nazvy mesicu v ruznych jazycich (zatim jen nemecky), mesic nesmi byt - ukonceny pismenem - povolene jsou vsechny oddelovace (',', '.', ';', - ':', atd.) vcetne znaku white-space a konce radku, ukazovatko se posune - za nazev mesice, funkce je uspesna jen pokud byl mesic rozpoznan a - vsechny mesice v listingu patri do jedineho jazyku, - -- month_txt(, retezec) - (typ hodnot ve sloupci musi byt - datum) - obohati hodnotu ve sloupci o mesic rozpoznany na pozici - ukazovatka, nazvy mesicu jsou v retezci, ktery musi obsahovat dvanact - nazvu mesicu vzajemne oddelenych mezerami (napr. - "Jan. Feb. März Apr. Mai Juni Juli Aug. Sept. Okt. Nov. Dez." pro - nemcinu), mesic nesmi byt ukonceny pismenem - povolene jsou vsechny - oddelovace (',', '.', ';', ':', atd.) vcetne znaku white-space a konce - radku, ukazovatko se posune za nazev mesice, funkce je uspesna jen pokud - byl mesic rozpoznan, - -- month() - (typ hodnot ve sloupci musi byt datum) - obohati - hodnotu ve sloupci o mesic ulozeny jako dekadicke cislo na pozici - ukazovatka, toto cislo nesmi byt ukoncene pismenem - povolene jsou - vsechny oddelovace (',', '.', ';', ':', atd.) vcetne znaku white-space - a konce radku, ukazovatko se posune za konec cisla mesice, funkce je - uspesna jen pokud je cislo mesice platne (1 az 12), - -- day() - (typ hodnot ve sloupci musi byt datum) - obohati - hodnotu ve sloupci o den ulozeny jako dekadicke cislo na pozici - ukazovatka, toto cislo nesmi byt ukoncene pismenem - povolene jsou - vsechny oddelovace (',', '.', ';', ':', atd.) vcetne znaku white-space - a konce radku, ukazovatko se posune za konec cisla dne, funkce je - uspesna jen pokud je cislo dne platne (1 az 31), - -- year() - (typ hodnot ve sloupci musi byt datum) - obohati - hodnotu ve sloupci o rok ulozeny jako dekadicke cislo na pozici - ukazovatka, toto cislo nesmi byt ukoncene pismenem - povolene jsou - vsechny oddelovace (',', '.', ';', ':', atd.) vcetne znaku white-space - a konce radku, ukazovatko se posune za konec cisla roku, funkce je - uspesna jen pokud je cislo roku platne (0-999 (0-79=>+2000, - 80-999=>+1900) nebo 1602-9999), - -- time() - (typ hodnot ve sloupci musi byt cas) - obohati - hodnotu ve sloupci o hodiny, minuty, sekundy a pripadne i milisekundy - nalezene jako vzajemne oddelena dekadicka cisla na miste ukazovatka, - ocekavane formaty jsou 00:00 nebo 00:00:00 nebo 00:00:00.000, pokud - primo za posledni cislici casoveho udaje nasleduje retezec "a"/"am" - nebo "p"/"pm", je povazovan za "a.m." (rano) a "p.m." (vecer) a casovy - udaj se prislusne upravi, jinak casovy udaj nesmi byt ukoncen pismenem - ani cislem - povolene jsou vsechny oddelovace (',', '.', ';', ':', atd.) - vcetne znaku white-space a konce radku, ukazovatko se posune za konec - casoveho udaje, funkce je uspesna jen pokud je casovy udaj platny - (0-23, 0-59, 0-59 a 0-999), - -- year_or_time(, ) - (typy hodnot ve sloupcich - sloupec_datum a sloupec_cas musi byt datum a cas) - ziska rok a pripadne - i cas (pokud je na pozici ukazovatka rok, cas neni znamy, je-li na pozici - ukazovatka cas, je rok urcen podle pravidla, ze cely datum by mel byt - stary mene nez sest mesicu od dnesniho datumu) a obohati hodnoty - ve sloupcich o rok a pripadne i o hodiny a minuty, rok je ulozeny jako - dekadicke cislo, cas je ulozen jako dve dekadicka cisla (hodiny a minuty) - oddelena dvojteckou, cisla nesmi byt ukoncena pismenem - povolene jsou - vsechny oddelovace (',', '.', ';', ':', atd.) vcetne znaku white-space - a konce radku, ukazovatko se posune za konec roku nebo casu, funkce je - uspesna jen pokud jsou cisla platna (1602-9999 a 0-23:0-59), - -- all(cislo) - ukazovatko se posune o 'cislo' znaku, funkce je uspesna, - pokud lze ukazovatko posunout, - -- all(, cislo) - (typ hodnot ve sloupci musi byt retezec) - priradi - do sloupce retezec o delce 'cislo', ktery zacina od ukazovatka, ukazovatko - se posune na konec tohoto retezce, funkce je uspesna, pokud lze retezec - ziskat, - -- all_to(retezec) - nastavi ukazovatko za prvni nasledujici vyskyt - retezce 'retezec' (porovnava se case insensitive), - funkce je uspesna jen pokud je retezec nalezen, - -- all_to(, retezec) - (typ hodnot ve sloupci musi byt - retezec) - priradi do sloupce retezec, ktery saha od ukazovatka az za - prvni nasledujici vyskyt retezce 'retezec' (porovnava se case - insensitive), ukazovatko se posune za konec nalezeneho retezce, - funkce je uspesna, pokud je retezec nalezen, - -- all_up_to(, retezec) - (typ hodnot ve sloupci musi byt - retezec) - priradi do sloupce retezec, ktery saha od ukazovatka az do - prvniho nasledujiciho vyskytu retezce 'retezec' (porovnava se case - insensitive), ukazovatko se posune za konec nalezeneho - retezce, funkce je uspesna, pokud je retezec nalezen, - -- unix_link(, , ) - (typy sloupcu - sloupec_name a sloupec_link musi byt "Name" a "Any Text") - zpracuje - retezec, ktery saha od ukazovatka az do konce radky, ukazovatko se - posune na konec radky, ocekava format "link_name -> target_name" - nebo jen "link_name" (je-li odepreny pristup k cili linku), - ziska jmeno linku a pripadne i cil linku a provede detekci jestli - jde o soubor nebo o adresar (heuristika: pokud jmeno nebo pripadne - cil maji priponu, jde pravdepodobne o soubor, jinak o adresar; - pokud tato heuristika nevyhovuje, staci napr. za funkci unix_link - pridat funkci "assign(,false)"), ziskane hodnoty priradi - do sloupcu sloupec_name, sloupec_link (jen pokud se podaril cil - linku ziskat) a is_dir, funkce je uspesna, pokud zpracovavany - retezec odpovida formatu a nezacina na znak white-space, - -- unix_device() - (typ hodnot ve sloupci musi byt retezec) - - priradi do sloupce retezec zacinajici u ukazovatka, ktery je slozeny - ze dvou dekadickych cisel oddelenych carkou a nekolika mezerami - (napr. "27, 26"), ukazovatko posune za tento retezec, funkce je uspesna, - pokud se podari tento retezec ziskat a pokud nekonci pismenem (povolene - jsou vsechny oddelovace (',', '.', ';', ':', atd.) vcetne znaku - white-space a konce radku), - -- if(vyraz) - (typ vysledne hodnoty vyrazu musi byt boolean) - funkce - je uspesna jen pokud je vyraz true, - -- assign(, vyraz) - (typ vysledne hodnoty vyrazu musi odpovidat - typu hodnot sloupce) - priradi hodnotu vyrazu do sloupce, - -- add_string_to_column(, vyraz) - (typ hodnot ve sloupci a typ - vysledne hodnoty vyrazu musi byt retezec) - prida retezec ziskany jako - hodnota vyrazu do sloupce, - -- cut_white_spaces_end() - (typ hodnot ve sloupci musi byt - retezec) - orizne znaky white_space na konci retezce ve sloupci - a tento novy retezec priradi do sloupce, - -- cut_white_spaces_start() - (typ hodnot ve sloupci musi byt - retezec) - orizne znaky white_space na zacatku retezce ve sloupci - a tento novy retezec priradi do sloupce, - -- cut_white_spaces() - (typ hodnot ve sloupci musi byt - retezec) - orizne znaky white_space na zacatku a konci retezce ve - sloupci a tento novy retezec priradi do sloupce, - -- back(cislo) - posune ukazovatko zpet o 'cislo' znaku, funkce je - uspesna pokud je posun mozny. - -- cut_end_of_string(, cislo) - (typ hodnot ve sloupci musi byt - retezec) - orizne retezec ve sloupci o 'cislo' znaku a tento zkraceny - retezec priradi do sloupce, funkce je uspesna, pokud lze retezec zkratit - (pokud ma aspon 'cislo' znaku) - - -Seznam stavovych promennych: -============================ - -- first_nonempty_line - (boolean) - true pokud je ukazovatko na - prvni neprazdne (obsahujici jine znaky nez white-spaces) radce, -- last_nonempty_line - (boolean) - true pokud je ukazovatko na - posledni neprazdne (obsahujici jine znaky nez white-spaces) radce, - nebere se v uvahu jestli text listingu je nebo neni nekompletni, -- next_char - (retezec) - retezec obsahujici jeden znak z pozice - ukazovatka, je-li ukazovatko na konci textu listingu, jde o prazdny - retezec, -- next_word - (retezec) - retezec zacinajici na pozici ukazovatka a - ukonceny znakem white-space nebo koncem radky, -- rest_of_line - (retezec) - retezec zacinajici na pozici ukazovatka a - ukonceny koncem radky, - - -Seznam operacnich znaku: +Constants may be string, number, or boolean. + +A string is delimited by the '"' character. A string may not extend +past the end of the line. Escape sequences use the '\' character: for +'"', it is "\""; for '\', it is "\\"; for a tab character, it is +"\t"; for the line-ending characters CR+LF, it is the pair "\r" and +"\n". Unknown escape sequences are reported as errors. + +A number is written in decimal form without any separators. A negative +number starts with '-'. A positive number starts with '+' (which may be +omitted). + +A boolean is "true" or "false" (written without quotes). + +The user defines columns. Each column has an identifier name, a value +type, an empty value, and a name and description for display in the +panel. The identifier is used when assigning values to columns. Each +item may have exactly one value assigned in a column. If no value is +assigned, the user-defined empty value is used in that column. Columns +also define whether they should be displayed in the panel. Display +cannot be turned off for columns of type "Name" and "Extension". + +A column identifier starts with '<', contains the user-defined +identifier name, and ends with '>'. + +The following column types exist: +- Name - (string) exactly one column of this type is required, it + cannot be hidden, defining an empty value for it makes no sense, and + the parser must assign to it for every file and directory. If no + assignment happens, parsing according to the current rule produces no + file or directory - this is used to skip empty lines and other + unimportant parts of the listing. Assigning the empty string to this + column is considered a parsing error, +- Extension - generated from the value in the "Name" column, cannot be + hidden, defining an empty value for it makes no sense, +- Size - (number - unsigned int64), for directories the value is + always 0 and "DIR" is displayed in the panel; the default empty value + is 0, +- Date - (date) the date must be valid (otherwise it is replaced with + 1.1.1602); the default empty value is 1.1.1602, +- Time - (time) the default empty value is 0:00:00, +- Type - generated from the value in the "Name" column; defining an + empty value for it makes no sense, +- Any Text - (string) the default empty value is "", +- Any Date - (date) the date must be valid (otherwise it is replaced + with 1.1.1602); the default empty value is "", +- Any Time - (time) the default empty value is "", +- Any Number - (number - signed int64) the default empty value is "". + +In addition, there are three columns with identifiers "", +"", and "". Boolean values are assigned to all +three, and they tell whether the item is a "file" or a "directory", +whether it "is hidden" or "is not hidden", and whether it "is a link" +or "is not a link". Assignment to these columns is not required; their +empty values are "file", "is not hidden", and "is not a link". + + +Description of the autodetection condition format: +================================================== + +This is a logical expression. The operators in the expression are +(from highest priority): NOT, AND, and OR. NOT (logical negation) is +unary; AND (logical conjunction) and OR (logical disjunction) are +binary. Parentheses may also be used in the expression (to define +subexpressions). The following functions are used as operands: + +- syst_contains(string) - evaluates to TRUE if the reply to the SYST + command (get type of operating system) contains the given string, + +- welcome_contains(string) - evaluates to TRUE if the given string + appears in the server's first reply (immediately after the connection + is established), + +- reg_exp_in_syst(regular_expression_string) - evaluates to TRUE if the + reply to the SYST command (get type of operating system) contains a + string matching the given regular expression, + +- reg_exp_in_welcome(regular_expression_string) - evaluates to TRUE if + the server's first reply (immediately after the connection is + established) contains a string matching the given regular expression. + + +Obtaining a listing for a fixed server type: +============================================ + +Parsing of the listing text is started. If parsing succeeds, the +obtained results are used and the algorithm terminates. If parsing +fails, the listing text is displayed in the panel without +modifications. + +Before the listing is placed into the panel, the "." directory is +removed (if it is present in the parsing results), and for the root +path the ".." directory is removed as well (if it is present in the +parsing results). If the ".." directory remains in the listing, it is +always visible (the value in the "" column is ignored). + + +Description of server type autodetection: +========================================= + +All defined server types are processed one by one. For each server +type, the "autodetect condition" is evaluated. If the condition is not +satisfied, processing continues with the next server type. If the +condition is satisfied, parsing of the listing text is started. If +parsing succeeds, the obtained results are used and the algorithm +terminates. If a parsing error occurs, processing continues with the +next server type. + +If all server types are processed this way without success, the +algorithm continues by processing those server types whose +"autodetect condition" was not satisfied. For those types, parsing of +the listing text is started. As in the previous case, the algorithm +terminates as soon as parsing succeeds without an error. + +If none of the parsers from the defined server types succeeds in +parsing the listing text, the listing text is displayed in the panel +without modifications. + +Autodetection works this way only for the listing of the first path on +the server. For later listings from the same server, the algorithm +first tries to reuse the same server type that was used for the +previous listing (so that, for example, empty listings still have the +"correct" columns in the panel, and so on). Only if parsing with that +server type fails is the server type autodetection process started +again. + +Before the listing is placed into the panel, the "." directory is +removed (if it is present in the parsing results), and for the root +path the ".." directory is removed as well (if it is present in the +parsing results). If the ".." directory remains in the listing, it is +always visible (the value in the "" column is ignored). + + +Description of the parsing process: +=================================== + +A parser is considered successful when the entire listing text can be +processed using the defined rules. + +For the description of the algorithm, we introduce the term "pointer", +which denotes a position within the listing text. + +Rules consist of functions. A rule may be used only if all of its +functions evaluate as successful, an empty string was not assigned to +the "Name" column (that is, either a non-empty string was assigned or +no assignment happened at all), and the pointer ends at the end of +some line of the listing text. After a rule is used, the pointer is +automatically moved to the beginning of the next line of the listing +text. + +In addition to reporting success and moving the pointer, a function may +also assign a value to a column or modify that value. + +A parser may define an entire sequence of rules. The rule to be used at +any given moment is always selected in the order in which the rules +were defined. In other words, the first usable rule is always used. + +The listing text may be incomplete because loading was interrupted, +either at the user's request or because of a server connection error. +Incomplete listing text is adjusted so that it contains only complete +lines of text (the remainder is cut off). + +Parsing of incomplete listing texts is handled at the rule-application +level. In the simpler case, the pointer reaches the end of the text +after a rule is used and parsing ends there. In the more complex case, +a function evaluated while using a rule is supposed to move the pointer +to the next line. That move is impossible only because the listing text +is incomplete, and parsing therefore ends successfully (as if the +listing text ended in such a way that the currently used rule was not +needed at all). + + +Displaying the total size of selected files in the info line: +============================================================= + +In order for the total size in bytes or blocks to be displayed in the +info line when a group of files is selected, the file size must be +stored in a column of type "File Size in Bytes" or in a column of type +"Any Number" with the standard name "Blocks" or "BlkSz". + + +List of functions: +================== + +Unless stated otherwise, a function always succeeds, does not move the +pointer, and does not assign a value to any column. If a function moves +the pointer, then unless stated otherwise it cannot skip the end of the +line. + +Before a column identifier may be used in an expression, a value must +be assigned to that column. Without such an assignment, the expression +has no meaning (such an expression can be replaced with a boolean +constant computed by substituting the empty value of the given column +into the expression). + +(white-space: space or tab) + +- skip_white_spaces() - skips all white-space characters using the + pointer, + +- skip_to_number() - moves the pointer to the nearest decimal digit, + +- white_spaces() - skips all white-space characters using the pointer; + the function succeeds only if the pointer moves, + +- white_spaces(number) - skips a sequence of white-space characters of + length 'number' using the pointer; the function succeeds only if such + a sequence exists, + +- white_spaces_and_line_ends() - skips all white-space characters and + line-ending characters using the pointer; the function succeeds only + if the pointer moves and does not end at the end of the listing + (it stops on some character), + +- rest_of_line() - moves the pointer to the end of the line; the + function succeeds only if the pointer moves, + +- rest_of_line() - (the value type of the column must be + string) - assigns to the column the string from the pointer position + to the end of the line, moves the pointer to the end of the line, and + succeeds if the pointer moves, + +- word() - skips all characters except white-space and end-of-line + characters using the pointer; the function succeeds only if the + pointer moves, + +- word() - (the value type of the column must be string) - + assigns to the column the string from the pointer position up to the + first white-space character or the end of the line, moves the pointer + past the end of that string, and succeeds if such a string can be + obtained (it contains at least one character), + +- number() - (the value type of the column must be number) - + assigns to the column the decimal number located at the pointer + position. This number must not be followed by a letter - all + separators are allowed (',', '.', ';', ':', and so on), including + white-space and end-of-line characters. The pointer is moved past the + end of the number. The function succeeds if the number exists, is + terminated correctly, and, for a column of type "Size", the number is + also non-negative, + +- positive_number() - (the value type of the column must be + number) - assigns to the column the positive decimal number located + at the pointer position. If the number is negative, the column + receives its default empty value (zero for type Size, "" for type Any + Number). The number must not be followed by a letter - all separators + are allowed (',', '.', ';', ':', and so on), including white-space + and end-of-line characters. The pointer is moved past the end of the + number. The function succeeds if the number exists and is terminated + correctly, + +- number_with_separators(, string) - (the value type of the + column must be number) - assigns to the column the decimal number + with digit group separators located at the pointer position (used to + make large numbers easier to read; the allowed separators are given + in the string 'string'; any characters except '+', '-', and digits + are allowed). The number must not be followed by a letter - all + separators are allowed (',', '.', ';', ':', and so on), including + white-space and end-of-line characters. The pointer is moved past the + end of the number. The function succeeds if the number exists, is + terminated correctly, and, for a column of type "Size", the number is + also non-negative, + +- month_3() - (the value type of the column must be date) - + enriches the value in the column with a month recognized as a + three-letter token at the pointer position. It works with month names + in multiple languages (currently at least English and German). The + month must not be followed by a letter - all separators are allowed + (',', '.', ';', ':', and so on), including white-space and + end-of-line characters. The pointer is moved past those three + letters. The function succeeds only if the month was recognized and + all months in the listing belong to a single language, + +- month_3(, string) - (the value type of the column must be + date) - enriches the value in the column with a month recognized as a + three-letter token at the pointer position. The month names are given + in the string, which must contain twelve three-letter month names + separated by spaces (for example "jan feb mar apr may jun jul aug sep + oct nov dec" for English). The month must not be followed by a + letter - all separators are allowed (',', '.', ';', ':', and so on), + including white-space and end-of-line characters. The pointer is + moved past those three letters. The function succeeds only if the + month was recognized, + +- month_txt() - (the value type of the column must be date) - + enriches the value in the column with a month recognized at the + pointer position. It works with month names in multiple languages + (currently only German). The month must not be followed by a letter - + all separators are allowed (',', '.', ';', ':', and so on), + including white-space and end-of-line characters. The pointer is + moved past the month name. The function succeeds only if the month + was recognized and all months in the listing belong to a single + language, + +- month_txt(, string) - (the value type of the column must be + date) - enriches the value in the column with a month recognized at + the pointer position. The month names are given in the string, which + must contain twelve month names separated by spaces (for example + "Jan. Feb. Maerz Apr. Mai Juni Juli Aug. Sept. Okt. Nov. Dez." for + German). The month must not be followed by a letter - all separators + are allowed (',', '.', ';', ':', and so on), including white-space + and end-of-line characters. The pointer is moved past the month name. + The function succeeds only if the month was recognized, + +- month() - (the value type of the column must be date) - + enriches the value in the column with the month stored as a decimal + number at the pointer position. The number must not be followed by a + letter - all separators are allowed (',', '.', ';', ':', and so on), + including white-space and end-of-line characters. The pointer is + moved past the end of the month number. The function succeeds only if + the month number is valid (1 through 12), + +- day() - (the value type of the column must be date) - + enriches the value in the column with the day stored as a decimal + number at the pointer position. The number must not be followed by a + letter - all separators are allowed (',', '.', ';', ':', and so on), + including white-space and end-of-line characters. The pointer is + moved past the end of the day number. The function succeeds only if + the day number is valid (1 through 31), + +- year() - (the value type of the column must be date) - + enriches the value in the column with the year stored as a decimal + number at the pointer position. The number must not be followed by a + letter - all separators are allowed (',', '.', ';', ':', and so on), + including white-space and end-of-line characters. The pointer is + moved past the end of the year number. The function succeeds only if + the year number is valid (0-999 (0-79 => +2000, 80-999 => +1900) or + 1602-9999), + +- time() - (the value type of the column must be time) - + enriches the value in the column with hours, minutes, seconds, and + optionally milliseconds found as decimal numbers separated from each + other at the pointer position. The expected formats are 00:00, + 00:00:00, or 00:00:00.000. If the string "a"/"am" or "p"/"pm" + follows immediately after the last digit of the time value, it is + treated as "a.m." (morning) or "p.m." (evening) and the time value is + adjusted accordingly. Otherwise, the time value must not be followed + by a letter or a digit - all separators are allowed (',', '.', ';', + ':', and so on), including white-space and end-of-line characters. + The pointer is moved past the end of the time value. The function + succeeds only if the time value is valid (0-23, 0-59, 0-59, and + 0-999), + +- year_or_time(, ) - (the value types of + date_column and time_column must be date and time) - obtains a year + and optionally also a time. If there is a year at the pointer + position, the time is unknown. If there is a time at the pointer + position, the year is determined using the rule that the full date + should be less than six months old relative to the current date. The + function enriches the column values with the year and optionally with + hours and minutes. The year is stored as a decimal number; the time + is stored as two decimal numbers (hours and minutes) separated by a + colon. The numbers must not be followed by a letter - all separators + are allowed (',', '.', ';', ':', and so on), including white-space + and end-of-line characters. The pointer is moved past the end of the + year or time. The function succeeds only if the numbers are valid + (1602-9999 and 0-23:0-59), + +- all(number) - moves the pointer by 'number' characters; the function + succeeds if the pointer can be moved, + +- all(, number) - (the value type of the column must be + string) - assigns to the column a string of length 'number' starting + at the pointer position, moves the pointer to the end of that string, + and succeeds if the string can be obtained, + +- all_to(string) - moves the pointer behind the first following + occurrence of the string 'string' (case-insensitive comparison); the + function succeeds only if the string is found, + +- all_to(, string) - (the value type of the column must be + string) - assigns to the column the string from the pointer position + up to and including the first following occurrence of the string + 'string' (case-insensitive comparison), moves the pointer behind the + end of the found string, and succeeds if the string is found, + +- all_up_to(, string) - (the value type of the column must be + string) - assigns to the column the string from the pointer position + up to the first following occurrence of the string 'string' + (case-insensitive comparison), moves the pointer behind the end of + the found string, and succeeds if the string is found, + +- unix_link(, , ) - (the column + types of name_column and link_column must be "Name" and "Any Text") - + processes the string from the pointer position to the end of the + line, moves the pointer to the end of the line, and expects the + format "link_name -> target_name" or just "link_name" (if access to + the link target is denied). It obtains the link name and optionally + the link target and detects whether it is a file or a directory + (heuristic: if the name or, if available, the target has an + extension, it is probably a file; otherwise it is a directory. If + that heuristic is not suitable, it is enough to append, for example, + the function "assign(,false)" after unix_link). The obtained + values are assigned to the columns name_column, link_column (only if + the link target was obtained), and is_dir. The function succeeds if + the processed string matches the format and does not start with a + white-space character, + +- unix_device() - (the value type of the column must be + string) - assigns to the column a string starting at the pointer + position and consisting of two decimal numbers separated by a comma + and several spaces (for example "27, 26"), moves the pointer behind + that string, and succeeds if the string can be obtained and does not + end with a letter (all separators are allowed (',', '.', ';', ':', + and so on), including white-space and end-of-line characters), + +- if(expression) - (the result type of the expression must be boolean) + - the function succeeds only if the expression is true, + +- assign(, expression) - (the result type of the expression + must match the value type of the column) - assigns the value of the + expression to the column, + +- add_string_to_column(, expression) - (the value type of the + column and the result type of the expression must be string) - adds + the string obtained as the value of the expression to the column, + +- cut_white_spaces_end() - (the value type of the column must + be string) - trims white-space characters from the end of the string + in the column and assigns the new string back to the column, + +- cut_white_spaces_start() - (the value type of the column must + be string) - trims white-space characters from the start of the + string in the column and assigns the new string back to the column, + +- cut_white_spaces() - (the value type of the column must be + string) - trims white-space characters from the start and end of the + string in the column and assigns the new string back to the column, + +- back(number) - moves the pointer back by 'number' characters; the + function succeeds if the move is possible. + +- cut_end_of_string(, number) - (the value type of the column + must be string) - trims 'number' characters from the end of the + string in the column and assigns the shortened string back to the + column. The function succeeds if the string can be shortened (if it + has at least 'number' characters) + + +List of state variables: ======================== -Pred pouzitim identifikatoru sloupce ve vyrazu je nutne do -sloupce priradit hodnotu. Bez tohoto prirazeni vyraz nema -smysl (takovy vyraz se da nahradit booleanovou konstantou -vypocitanou dosazenim prazdne hodnoty pro dany sloupec do vyrazu). - -- == - rovnost (u retezcu je porovnani case sensitive) -- != - nerovnost (u retezcu je porovnani case sensitive) -- eq - rovnost retezcu (case insensitive) -- not_eq - nerovnost retezcu (case insensitive) -- in - podretezec je v retezci (case insensitive) -- not_in - podretezec neni v retezci (case insensitive) -- end_with - retezec konci na retezec (case insensitive) -- not_end_with - retezec nekonci na retezec (case insensitive) +- first_nonempty_line - (boolean) - true if the pointer is on the first + non-empty line (containing characters other than white-space), +- last_nonempty_line - (boolean) - true if the pointer is on the last + non-empty line (containing characters other than white-space); it + does not matter whether the listing text is complete or incomplete, +- next_char - (string) - a string containing one character from the + pointer position; if the pointer is at the end of the listing text, + it is an empty string, +- next_word - (string) - a string starting at the pointer position and + ending at a white-space character or the end of the line, +- rest_of_line - (string) - a string starting at the pointer position + and ending at the end of the line, + + +List of operator symbols: +========================= + +Before a column identifier may be used in an expression, a value must +be assigned to that column. Without such an assignment, the expression +has no meaning (such an expression can be replaced with a boolean +constant computed by substituting the empty value of the given column +into the expression). + +- == - equality (string comparison is case-sensitive) +- != - inequality (string comparison is case-sensitive) +- eq - string equality (case-insensitive) +- not_eq - string inequality (case-insensitive) +- in - substring is contained in string (case-insensitive) +- not_in - substring is not contained in string (case-insensitive) +- end_with - string ends with string (case-insensitive) +- not_end_with - string does not end with string (case-insensitive) From 26fd7e38d769f1564e9821260ae2007b10e57106 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 18:00:12 +0200 Subject: [PATCH 692/710] [translation] Fix src/plugins/ftp/servers/listings_digest.txt comments (#1073) --- src/plugins/ftp/servers/listings_digest.txt | 98 ++++++++++----------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/src/plugins/ftp/servers/listings_digest.txt b/src/plugins/ftp/servers/listings_digest.txt index d546a2f2f..f68c37e9d 100644 --- a/src/plugins/ftp/servers/listings_digest.txt +++ b/src/plugins/ftp/servers/listings_digest.txt @@ -1,7 +1,7 @@ -------------------------------------------------------------------------- -------------------------------------------------------------------------- -------------------------------------------------------------------------- -IBM AS/400 (Valentín Lacko , Gary Kuznitz ) +IBM AS/400 (Valentín Lacko , Gary Kuznitz ) -------------------------------------------------------------------------- Autodetect: syst_contains(" OS/400 ") @@ -46,7 +46,7 @@ Autodetect: syst_contains(" OS/400 ") # skip empty lines anywhere * skip_white_spaces(); ---- CESKE datumy ------------------------------------------------------- +--- CZECH dates -------------------------------------------------------- QPGMR 475136 29.09.09 17:08:12 *FILE VBR 205 03.02.06 11:26:55 *DOC O0000579.TXT QSYS *MEM /QSYS.LIB/QACJINFO.FILE/QACJINFO.MBR @@ -97,7 +97,7 @@ Autodetect: syst_contains(" OS/400 ") # skip empty lines anywhere * skip_white_spaces(); ---- ANGLICKE datumy ---------------------------------------------------- +--- ENGLISH dates ------------------------------------------------------ QPGMR 475136 09/29/09 17:08:12 *FILE QSYS 45056 11/04/99 19:50:02 *FILE /QSYS.LIB/QACJINFO.FILE QSYS *MEM /QSYS.LIB/QACJINFO.FILE/QACJINFO.MBR @@ -116,7 +116,7 @@ QDFTOWN 2147483647 12/31/69 16:00:00 *DDIR QOPT/ -------------------------------------------------------------------------- -------------------------------------------------------------------------- -------------------------------------------------------------------------- -VxWorks: pomuze Eran Gluska +VxWorks: helped by Eran Gluska -------------------------------------------------------------------------- Autodetect: welcome_contains(" VxWorks ") @@ -162,7 +162,7 @@ Autodetect: welcome_contains(" VxWorks ") -------------------------------------------------------------------------- -------------------------------------------------------------------------- -------------------------------------------------------------------------- -OS/2: pomuze Krzysztof Bytnerowicz +OS/2: helped by Krzysztof Bytnerowicz -------------------------------------------------------------------------- # parse lines with files and directories * skip_white_spaces(), positive_number(), white_spaces(1), all(, 9), @@ -223,9 +223,9 @@ drwxr-xr-x folder 3 Mar 22 10:06 Upcoming Events_files -------------------------------------------------------------------------- -------------------------------------------------------------------------- -------------------------------------------------------------------------- -IBM z/VM (CMS): (jmena souboru jsou ze dvou casti - nutne doplnit '.' => napr. - soubor "WELCOME.README") -help: Format: Fixed (F) or Variable (V) + "DIR" pro adresar +IBM z/VM (CMS): (file names are made of two parts - a '.' must be inserted, e.g. + file "WELCOME.README") +help: Format: Fixed (F) or Variable (V) + "DIR" for a directory lrecl = file's logical record length -------------------------------------------------------------------------- # parse lines with directories @@ -253,7 +253,7 @@ VMNNTP DIR - - - 2002-08-27 14:59:51 - WELCNVT EXEC V 72 9 1 1999-09-20 17:16:18 - WELCOME EREADME F 80 21 1 1999-12-27 16:19:00 - WELCOME README V 82 21 1 1999-12-27 16:19:04 - ----------- DRUHA VARIANTA: "DISK" oznacuje adresar (pro oznaceni adresare se nepouziva DIR) +---------- SECOND VARIANT: "DISK" marks a directory (DIR is not used to mark directories) # parse lines with directories * word(), all_to(" DISK"), assign(, true), white_spaces(), word(), white_spaces(), number(), white_spaces(), @@ -271,12 +271,12 @@ WELCOME README V 82 21 1 1999-12-27 16:19:04 - # skip empty lines anywhere * skip_white_spaces(); ----------- NEMAME PRISTUP, test casem -------------------------------- +---------- NO ACCESS, test case -------------------------------------- README FIRST F 80 37 1 1/22/91 11:22:50 ANONYM RFC1118 TXT V 73 1347 16 10/09/89 9:51:07 ANONYM ROOTS-L DISK F 80 5 1 8/31/90 14:22:14 ANONYM WRITERS DISK F 80 8 1 12/18/90 16:51:15 ANONYM --------------- TRETI VARIANTA ------------------------------------------ +-------------- THIRD VARIANT ------------------------------------------- Autodetect: syst_contains("z/VM") # parse lines with directories @@ -301,7 +301,7 @@ Autodetect: syst_contains("z/VM") # skip empty lines anywhere * skip_white_spaces(); ----------- NEMAME PRISTUP, test casem -------------------------------- +---------- NO ACCESS, test case -------------------------------------- Filename FileType Fm Format Lrecl Records Blocks Date Time LASTING GLOBALV A1 V 41 21 1 9/16/91 15:10:32 J43401 NETLOG A0 V 77 1 1 9/12/91 12:36:04 @@ -317,13 +317,13 @@ AUTHORS A1 DIR - - - 9/20/99 10:31:11 -------------------------------------------------------------------------- -------------------------------------------------------------------------- -------------------------------------------------------------------------- -MVS: pomuze Michael Knigge nebo +MVS: helped by Michael Knigge or Krzysztof Bytnerowicz help: Ext = Extents, Dsorg = Data Set Organization (PO = partitioned organized - (library, brat jako archiv=soubor), PS = physical sequential (obycejny file)), + (library, treat as archive=file), PS = physical sequential (ordinary file)), Dsname = Data Set Name, Recfm=Record Format, Lrecl=Logical Record Length, BlkSz=Physical Block Length -"Pseudo Directory" se objevuje jen, pokud je zapnuty pseudo-directory mode FTP serveru +"Pseudo Directory" appears only when pseudo-directory mode is enabled on the FTP server -------------------------------------------------------------------------- Autodetect: syst_contains(" MVS ") @@ -436,7 +436,7 @@ TSO61A Error determining attributes CSNM18.BKP.XE61 VGSA03 Tape BOOL.IMF.SA03.SVCDUMP PATH CAPRI.CSD.PATHA ------------ DRUHA VARIANTA LISTINGU (jiny datum) -------------------- +----------- SECOND LISTING VARIANT (different date) ------------------ Autodetect: syst_contains(" MVS ") # data sets @@ -530,8 +530,8 @@ MVXE61 Not Mounted CSNM2.BKP.XE61 VGSA03 Tape BOOL.IMF.SA03.SVCDUMP PATH CAPRI.CSD.PATHA ------------------------- TRETI VARIANTA LISTINGU --------------------- -help: Init=Initial Size, Id=User, Mod=???? (zeptat se Michaela !!!) +------------------------ THIRD LISTING VARIANT ----------------------- +help: Init=Initial Size, Id=User, Mod=???? (ask Michael!!!) -------------------------------------------------------------------------- Autodetect: syst_contains(" MVS ") @@ -560,7 +560,7 @@ OMCSIRAU 01.01 1992/06/03 1992/06/03 14:46 349 349 0 ASEPMD OMCSIRBF ASCIITAB 01.00 1998/06/08 1998/06/08 13:32 526 526 0 VEA0013 ------------------------- CTVRTA VARIANTA LISTINGU (jiny datum) ------- +------------------------ FOURTH LISTING VARIANT (different date) ----- Autodetect: syst_contains(" MVS ") # members @@ -590,7 +590,7 @@ GREETING 01:00 12/08/93 12/09/93 6:19 12 12 0 MVS OMCSIRBF GREE 01:00 12/08/93 12/09/93 6:19 12 12 0 MVS ------------------------- PATA VARIANTA LISTINGU (chybi created) ----- +------------------------ FIFTH LISTING VARIANT (created missing) ---- Autodetect: syst_contains(" MVS ") # members @@ -619,7 +619,7 @@ NAME VV.MM CHANGED SIZE INIT MOD ID OMCSIRBF #PDEX 01.00 95/09/29 16:29 47 47 0 USER01 ------------------------- SESTA VARIANTA LISTINGU ------------------------- +------------------------ SIXTH LISTING VARIANT ----------------------- Autodetect: syst_contains(" MVS ") #datasets @@ -657,7 +657,7 @@ BIB1 0010F8 000124 DC 24 24 -------------------------------------------------------------------------- -------------------------------------------------------------------------- VMS: (ubvms.cc.buffalo.edu) --------------- PRVNI VARIANTA ------------------------------------------ +-------------- FIRST VARIANT ------------------------------------------- Autodetect: syst_contains(" VMS ") # parse lines with directories @@ -741,8 +741,8 @@ PLILP28D.DIR;1 1 3-APR-1997 17:51 [UCX$NOBO,UCX$NOBODY (RWED,RWED Total of 7 blocks in 7 files. ------------------------- DRUHA VARIANTA - CS.FELK.CVUT.CZ --------------------- -(petr.DIR;2 je soubor - aspon VMS na CS se k nemu tak chova) +------------------------ SECOND VARIANT - CS.FELK.CVUT.CZ --------------------- +(petr.DIR;2 is a file - at least VMS at CS behaves that way) ------------------------------------------------------------------------------- Autodetect: syst_contains(" VMS ") @@ -831,7 +831,7 @@ PLILP28D.DIR;1 1/3 3-APR-1997 17:51:01 [UCX$NOBO,UCX$NOBODY Total of 527 files, 22268/24048 blocks ------------------------- TRETI VARIANTA - web (byty/bloky) --------------------- +------------------------ THIRD VARIANT - web (bytes/blocks) -------------------- Autodetect: syst_contains(" VMS ") # parse lines with directories @@ -893,7 +893,7 @@ TMP.DIR;1 9-OCT-1991 10:29:53 512/1 (RWE,RE,RE,RWE) EA95_0PS.GZ;1 No privilege for attempted operation EA95_0PSD.DIR;1 No privilege for attempted operation ------ CTVRTA VARIANTA - ftp.process.com (cas na ms, chybi prava a bloky) ----- +----- FOURTH VARIANT - ftp.process.com (time in ms, rights and blocks missing) ---- Autodetect: syst_contains(" VMS ") # parse lines with directories @@ -998,7 +998,7 @@ total 0 d [RWCEAFMS] Patera 512 Jun 24 13:59 Windows NT 5.0 Workstation Profile.03.17 - [RWCEAFMS] Patera 124275 Mar 24 2000 pv193cz.zip -------------- DRUHA VARIANTA - Hellsoft (kod parseru viz vyse) ----------- +------------- SECOND VARIANT - Hellsoft (parser code see above) ---------- -------------- listing -------------- -[RWCEMFA] 1 xpatera1 1140 Jun 22 2001 euro50.pcx @@ -1013,10 +1013,10 @@ d[R----F-] 1 supervis 512 Nov 30 08:02 limpouch -------------------------------------------------------------------------- -------------------------------------------------------------------------- -------------------------------------------------------------------------- -UNIX: PRVNI VARIANTA (IBM AIX, Filezilla a dalsi) +UNIX: FIRST VARIANT (IBM AIX, Filezilla, and others) -------------------------------------------------------------------------- -(odlisnost od druhe varianty: maji dve mezery po roce pred jmenem) -(ma prioritu, protoze pravdepodobnejsi jsou jmena bez mezer na zacatku) +(difference from the second variant: they have two spaces after the year before the name) +(has priority because names without leading spaces are more likely) Autodetect: not syst_contains("z/VM ") and not syst_contains("OS/2 ") and not syst_contains(" MACOS ") and not syst_contains("Windows_NT") @@ -1154,9 +1154,9 @@ lrwx------ 1 root name root 0 Oct 16 14:08 cwd lrwx------ 1 solin name users 0 Oct 16 14:15 cwd -> /proc/20493 pr--r--r-- 1 root name root 0 Oct 16 14:08 maps ------------------------- DRUHA VARIANTA - ProFTPD a dalsi ---------- -(funguje korektne pro servery, ktere maji po roce pred jmenem jedinou mezeru; -prvni varianta parseru totiz nekorektne orezava prvni mezeru ve jmene) +------------------------ SECOND VARIANT - ProFTPD and others -------- +(works correctly for servers that have a single space after the year before the name; +the first parser variant incorrectly trims the first space in the name) Autodetect: not syst_contains("z/VM ") and not syst_contains("OS/2 ") and not syst_contains(" MACOS ") and not syst_contains("Windows_NT") @@ -1252,7 +1252,7 @@ lrwx------ 1 root name root 0 Oct 16 14:08 cwd lrwx------ 1 solin name users 0 Oct 16 14:15 cwd -> /proc/20493 pr--r--r-- 1 root name root 0 Oct 16 14:08 maps ------------------------- TRETI VARIANTA - Sun (nejen) --------------------- +------------------------ THIRD VARIANT - Sun (and others) ---------------- Autodetect: (not welcome_contains(" NW ") or not welcome_contains(" HellSoft.")) and not syst_contains("z/VM ") and not syst_contains("OS/2 ") and not syst_contains(" MACOS ") and not syst_contains("Windows_NT") @@ -1327,7 +1327,7 @@ drwxr-x--- 2 other name 2048 Apr 7 1999 advpanel lrwxrwxrwx 1 other name 7 Mar 22 2000 bin -> usr/bin lrwxrwxrwx 1 other name 7 Jul 29 18:06 ccm -> pub/ccm ------------------------- CTVRTA VARIANTA - HP-UNIX (nemecky) -------------- +------------------------ FOURTH VARIANT - HP-UNIX (German) --------------- Autodetect: not syst_contains("z/VM ") and not syst_contains("OS/2 ") and not syst_contains(" MACOS ") and not syst_contains("Windows_NT") @@ -1388,15 +1388,15 @@ Autodetect: not syst_contains("z/VM ") and not syst_contains("OS/2 ") and insgesamt 611176 drwxrwxr-x 5 ftp ftp 4096 4. Jan., 14:00 . drwxrwxr-x 3 ftp ftp 4096 4. Jan., 14:00 .. -lrwxrwxrwx 1 solin users 4 23. März 2004 file_link -> file +lrwxrwxrwx 1 solin users 4 23. März 2004 file_link -> file crw-r----- 1 root disk 27, 24 5. Feb. 2004 zqft0 brw-rw---- 1 root disk 13, 121 19. Mai 2004 xdb57 lrwx------ 1 root root 0 24. Juni 2004 cwd -rw-rw-rw- 1 catusr catia 81 4. Jan., 14:00 CATDXF.in -rwxrwxrwx 1 catusr catia 100403 5. Feb. 2004 CATOLER.out --rwxr-xr-x 1 catusr catia 545 23. März 2004 catcust +-rwxr-xr-x 1 catusr catia 545 23. März 2004 catcust -rwxr-xr-x 1 catusr catia 545 14. Apr. 2004 Acrobat_Reader --rw-rw-r-- 1 catusr catia 1640480 19. Mai 2004 11-59D_323326_BM_V00_ROB_SCHNELLWECHSELKUPPLUNG_VKR±30_40___030702_PJW.model +-rw-rw-r-- 1 catusr catia 1640480 19. Mai 2004 11-59D_323326_BM_V00_ROB_SCHNELLWECHSELKUPPLUNG_VKR±30_40___030702_PJW.model -rw-r----- 1 catusr catia 60640 24. Juni 2004 PECIATKA_STN.model -rwxrwxrwx 1 catusr catia 2558 2. Juli 2003 MECENV.dcls -rw-rw-r-- 1 catusr catia 2916 18. Aug., 09:06 USRENV_1.dcls @@ -1406,15 +1406,15 @@ drwxr--r-- 2 catusr catia 96 31. Okt. 2003 CATSettings -rw-r----- 1 catusr catia 11417 30. Dez., 11:10 ema_KG_update_rollmenu.dcls drwxrwxr-x 5 ftp name ftp 4096 4. Jan., 14:00 . drwxrwxr-x 3 ftp name ftp 4096 4. Jan., 14:00 .. -lrwxrwxrwx 1 solin name users 4 23. März 2004 file_link -> file +lrwxrwxrwx 1 solin name users 4 23. März 2004 file_link -> file crw-r----- 1 root name disk 27, 24 5. Feb. 2004 zqft0 brw-rw---- 1 root name disk 13, 121 19. Mai 2004 xdb57 lrwx------ 1 root name root 0 24. Juni 2004 cwd -rw-rw-rw- 1 cat usr catia 81 4. Jan., 14:00 CATDXF.in -rwxrwxrwx 1 cat usr catia 100403 5. Feb. 2004 CATOLER.out --rwxr-xr-x 1 cat usr catia 545 23. März 2004 catcust +-rwxr-xr-x 1 cat usr catia 545 23. März 2004 catcust -rwxr-xr-x 1 cat usr catia 545 14. Apr. 2004 Acrobat_Reader --rw-rw-r-- 1 cat usr catia 1640480 19. Mai 2004 11-59D_323326_BM_V00_ROB_SCHNELLWECHSELKUPPLUNG_VKR±30_40___030702_PJW.model +-rw-rw-r-- 1 cat usr catia 1640480 19. Mai 2004 11-59D_323326_BM_V00_ROB_SCHNELLWECHSELKUPPLUNG_VKR±30_40___030702_PJW.model -rw-r----- 1 cat usr catia 60640 24. Juni 2004 PECIATKA_STN.model -rwxrwxrwx 1 cat usr catia 2558 2. Juli 2003 MECENV.dcls -rw-rw-r-- 1 cat usr catia 2916 18. Aug., 09:06 USRENV_1.dcls @@ -1423,8 +1423,8 @@ drwxr--r-- 2 cat usr catia 96 31. Okt. 2003 CATSettings -rw-rw-rw- 1 cat usr catia 358 19. Nov., 11:12 DXFCAT.out -rw-r----- 1 cat usr catia 11417 30. Dez., 11:10 ema_KG_update_rollmenu.dcls ------------------------- PATA VARIANTA - nemecky AIX ---------- -(kopie prvni varianty UNIX parseru, jen maji prohozeny mesic a den) +------------------------ FIFTH VARIANT - German AIX ----------------- +(copy of the first UNIX parser variant, only the month and day are swapped) Autodetect: not syst_contains("z/VM ") and not syst_contains("OS/2 ") and not syst_contains(" MACOS ") and not syst_contains("Windows_NT") @@ -1521,7 +1521,7 @@ Autodetect: not syst_contains("z/VM ") and not syst_contains("OS/2 ") and # skip empty lines anywhere * skip_white_spaces(); ------------ (pouzity testovaci listing s anglickyma mesicema) ---------------- +----------- (test listing with English month names used) -------------------- total 80 lrwxrwxrwx 1 biaf iplus 11 14 Dec 2004 BIAF_Wetter -> biaf_wetter drwxrwxr-x 5 ftp ftp 4096 2 Aug 13:39 . @@ -1563,8 +1563,8 @@ lrwx------ 1 root name root 0 16 Oct 14:08 cwd lrwx------ 1 solin name users 0 16 Oct 14:15 cwd -> /proc/20493 pr--r--r-- 1 root name root 0 16 Oct 14:08 maps ------------------------- SESTA VARIANTA - MOXA (inetutils, Linux 2.6.9-MoXaRt) ---------- -(chybi casy + datumy) +------------------------ SIXTH VARIANT - MOXA (inetutils, Linux 2.6.9-MoXaRt) ---------- +(times and dates are missing) Autodetect: not syst_contains("z/VM ") and not syst_contains("OS/2 ") and not syst_contains(" MACOS ") and not syst_contains("Windows_NT") @@ -1745,8 +1745,8 @@ pk_cal.fil 532 -------------------------------------------------------------------------- -PC-NFSD: (WinCmd) - delene nazvy/pripony souboru, carky ve velikosti, - adresarum chybi velikost, a.m./p.m. v casech +PC-NFSD: (WinCmd) - split file names/extensions, commas in sizes, + directories have no size, a.m./p.m. in times -------------------------------------------------------------------------- prog1 exe 2,563,136 06-10-99 10:00a temp 01-27-97 3:41p @@ -1755,7 +1755,7 @@ temp 01-27-97 3:41p -------------------------------------------------------------------------- -VOS (Stratus): (WinCmd) - adresare maji o sloupec mene +VOS (Stratus): (WinCmd) - directories have one fewer column -------------------------------------------------------------------------- w 10 seq 99-04-20 11:15:42 abbreviations m 4 99-07-02 10:11:25 arsffs32 From 853e786f1960b8fcc3d890bdcdce8e59cac540dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 18:00:16 +0200 Subject: [PATCH 693/710] [translation] Fix src/plugins/winscp/lang/empty.txt comments (#1074) --- src/plugins/winscp/lang/empty.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/winscp/lang/empty.txt b/src/plugins/winscp/lang/empty.txt index 8b665688e..23d8e6821 100644 --- a/src/plugins/winscp/lang/empty.txt +++ b/src/plugins/winscp/lang/empty.txt @@ -1 +1,2 @@ -Jen pro vytvoreni tohoto adresare. \ No newline at end of file +CommentsTranslationProject: TRANSLATED +Only used to keep this directory present. From 5810591abc4f473d25d62a802a9218f2fe22989d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 18:00:20 +0200 Subject: [PATCH 694/710] [translation] Fix src/plugins/winscp/lib/empty.txt comments (#1075) --- src/plugins/winscp/lib/empty.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/winscp/lib/empty.txt b/src/plugins/winscp/lib/empty.txt index 8b665688e..23d8e6821 100644 --- a/src/plugins/winscp/lib/empty.txt +++ b/src/plugins/winscp/lib/empty.txt @@ -1 +1,2 @@ -Jen pro vytvoreni tohoto adresare. \ No newline at end of file +CommentsTranslationProject: TRANSLATED +Only used to keep this directory present. From e5e4ac40ba39c0d0a6289dcf241a3c48f205502d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 18:00:24 +0200 Subject: [PATCH 695/710] [translation] Fix src/common/dep/sqlite/readme.txt comments (#1076) --- src/common/dep/sqlite/readme.txt | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/common/dep/sqlite/readme.txt b/src/common/dep/sqlite/readme.txt index 4a9490c1a..7b81cb052 100644 --- a/src/common/dep/sqlite/readme.txt +++ b/src/common/dep/sqlite/readme.txt @@ -1,11 +1,14 @@ -Zdrojaky SQLite z webu http://www.sqlite.org/download.html -Pouzivame sqlite-amalgamation-*.zip -Koncepcne bychom meli pro nove verze Salamander pouzivat nejnovejsi verze SQLite, -abychom byli schopni cist nejnovejsi binarni verze SQLite databazi. +CommentsTranslationProject: TRANSLATED -Updatnout: +SQLite sources are available at http://www.sqlite.org/download.html +Use sqlite-amalgamation-*.zip. +Conceptually, new Salamander versions should use the newest SQLite versions +so we can read the newest binary versions of SQLite databases. + +Update: salamand\sqlite\sqlite3.c salamand\plugins\shared\sqlite\sqlite3.h -Pridat na to-do list: --otestovat novou verzi SQLite na Google Drive, podivat do TRACE, ze cteme cestu k jeho slozce \ No newline at end of file +Add to the to-do list: +- test the new SQLite version on Google Drive and inspect TRACE to confirm that + we read the path to its folder From 2cbc7f59b0c7e6dd23def10cfc0f59121f1c769c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 18:00:28 +0200 Subject: [PATCH 696/710] [translation] Fix src/plugins/zip/vcxproj/selfextr/selfextr.vc.varovani.txt comments (#1077) --- .../zip/vcxproj/selfextr/selfextr.vc.varovani.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/plugins/zip/vcxproj/selfextr/selfextr.vc.varovani.txt b/src/plugins/zip/vcxproj/selfextr/selfextr.vc.varovani.txt index 4d7916d68..a3923b0cd 100644 --- a/src/plugins/zip/vcxproj/selfextr/selfextr.vc.varovani.txt +++ b/src/plugins/zip/vcxproj/selfextr/selfextr.vc.varovani.txt @@ -1,12 +1,14 @@ -Pri prechodu na VC2013 (z VC2008) jsem si dovolil zmenit pro Release a ReleaseEx -randomizaci adresy modulu (zavedeni randomizace) a tim okamzikem prestalo na -vygenerovanych sfxsmall.exe a sfxbig.exe fungovat sfxmake.exe a nasledne upx.exe -(vsechny verze). Takze toto: +CommentsTranslationProject: TRANSLATED + +When moving to VC2013 (from VC2008), I changed address randomization for +Release and ReleaseEx (enabled randomization), and from that moment +sfxmake.exe and subsequently upx.exe (all versions) stopped working on the +generated sfxsmall.exe and sfxbig.exe. So this: false %40..\..\..\shared\baseaddr_x86.txt,$(ProjectName) -se NESMI ani v Release a ReleaseEx zmenit na: +MUST NOT, even in Release and ReleaseEx, be changed to: true From a853b27add13ffffa183d064f21536acb95d082f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 22:45:48 +0200 Subject: [PATCH 697/710] [translation] Fix src/common/trace.h comments Refines translated comments in src/common/trace.h. Model: OpenAI GPT-5.4 Verification: Full OSTranslation sequential review pipeline with requested review mode `codex`, actual review providers none, `--prompt-log-mode summary`, `--copilot-event-log summary`, AST grounding through clang, Codex model `gpt-5.4` with `--codex-reasoning medium`, Copilot model `gpt-5.4-mini`, and `--copilot-reasoning high`. 110 comment units, 110 review results, 110 resolved results, and 110 apply results. Branch-target comment guard passed for `src/common/trace.h` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. `git diff --check -- src/common/trace.h` completed without diff integrity failures. Telemetry: Artifact-local provider usage was 9 requests total and 0 billing units. Codex 9 requests, 119,762 tokens; Copilot 0 requests, 0 tokens. Review reused 29 review-cache hits, 44 deterministic resolutions, 0 request batches. --- src/common/trace.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/trace.h b/src/common/trace.h index 4698d5e32..bd9c4551c 100644 --- a/src/common/trace.h +++ b/src/common/trace.h @@ -632,10 +632,10 @@ class C__Trace const char* File; // helper variables for passing the file name (ANSI) const WCHAR* FileW; // helper variables for passing the file name (Unicode) int Line; // and the line number from which TRACE_X() is called - C__StringStreamBuf TraceStringBuf; // string buffer drzici data trace streamu (ANSI) - C__StringStreamBufW TraceStringBufW; // string buffer drzici data trace streamu (unicode) - C__TraceStream TraceStrStream; // vlastni trace stream (ANSI) - C__TraceStreamW TraceStrStreamW; // vlastni trace stream (unicode) + C__StringStreamBuf TraceStringBuf; // string buffer holding trace stream data (ANSI) + C__StringStreamBufW TraceStringBufW; // string buffer holding trace stream data (Unicode) + C__TraceStream TraceStrStream; // trace stream object (ANSI) + C__TraceStreamW TraceStrStreamW; // trace stream object (Unicode) DWORD StoredLastError; // GetLastError() value before the TRACE_? macro public: From f96bc1e85ef600fe32bf71f19d14f4639af76c96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 22:45:58 +0200 Subject: [PATCH 698/710] [translation] Fix src/common/dep/sqlite/precomp.h comments Refines translated comments in src/common/dep/sqlite/precomp.h. Model: OpenAI GPT-5.4 Verification: Full OSTranslation sequential review pipeline with requested review mode `codex`, actual review providers none, `--prompt-log-mode summary`, `--copilot-event-log summary`, AST grounding through clang, Codex model `gpt-5.4` with `--codex-reasoning medium`, Copilot model `gpt-5.4-mini`, and `--copilot-reasoning high`. 1 comment unit, 1 review result, 1 resolved result, and 1 apply result. Branch-target comment guard passed for `src/common/dep/sqlite/precomp.h` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. `git diff --check -- src/common/dep/sqlite/precomp.h` completed without diff integrity failures. Telemetry: Artifact-local provider usage was 0 requests total and 0 billing units. Codex 0 requests, 0 tokens; Copilot 0 requests, 0 tokens. Review reused 0 request batches. --- src/common/dep/sqlite/precomp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/dep/sqlite/precomp.h b/src/common/dep/sqlite/precomp.h index bf35e3c94..0593ff1e3 100644 --- a/src/common/dep/sqlite/precomp.h +++ b/src/common/dep/sqlite/precomp.h @@ -1,4 +1,4 @@ -// sqlite precomp.h nepouziva, ale overime, ze je v projektu nastaven define pro exporty dll +// sqlite precomp.h is not used, but verify that the project defines the DLL export macro #ifndef SQLITE_API #pragma message ( __FILE__ "SQLITE_API not defined!" ) #endif From 160f8c36126754cf96ffe1581d886b56ea1b0e8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 22:46:09 +0200 Subject: [PATCH 699/710] [translation] Fix src/plugins/dbviewer/parser.cpp comments Refines translated comments in src/plugins/dbviewer/parser.cpp. Model: OpenAI GPT-5.4 Verification: Full OSTranslation sequential review pipeline with requested review mode `codex`, actual review providers `codex`, `--prompt-log-mode summary`, `--copilot-event-log summary`, AST grounding through clang, Codex model `gpt-5.4` with `--codex-reasoning medium`, Copilot model `gpt-5.4-mini`, and `--copilot-reasoning high`. 48 comment units, 48 review results, 48 resolved results, and 48 apply results. Branch-target comment guard passed for `src/plugins/dbviewer/parser.cpp` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. `git diff --check -- src/plugins/dbviewer/parser.cpp` completed without diff integrity failures. Telemetry: Artifact-local provider usage was 20 requests total and 0 billing units. Codex 20 requests, 273,492 tokens; Copilot 0 requests, 0 tokens. Review reused 7 deterministic resolutions, 8 request batches. --- src/plugins/dbviewer/parser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/dbviewer/parser.cpp b/src/plugins/dbviewer/parser.cpp index 5072968b7..c56d5480f 100644 --- a/src/plugins/dbviewer/parser.cpp +++ b/src/plugins/dbviewer/parser.cpp @@ -925,7 +925,7 @@ CParserInterfaceCSV::OpenFile(const char* fileName) if (Csv->GetStatus() != CSVE_OK) { status = TranslateCSVStatus(Csv->GetStatus()); - CloseFile(); // po Close bude Csv=NULL + CloseFile(); // after Close Csv will be NULL } } else From ead019b3773644c979573699616d63956d0ba140 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 22:46:19 +0200 Subject: [PATCH 700/710] [translation] Fix src/plugins/dbviewer/renmain.cpp comments Refines translated comments in src/plugins/dbviewer/renmain.cpp. Model: OpenAI GPT-5.4 Verification: Full OSTranslation sequential review pipeline with requested review mode `codex`, actual review providers `codex`, `--prompt-log-mode summary`, `--copilot-event-log summary`, AST grounding through clang, Codex model `gpt-5.4` with `--codex-reasoning medium`, Copilot model `gpt-5.4-mini`, and `--copilot-reasoning high`. 74 comment units, 74 review results, 74 resolved results, and 74 apply results. Branch-target comment guard passed for `src/plugins/dbviewer/renmain.cpp` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. `git diff --check -- src/plugins/dbviewer/renmain.cpp` completed without diff integrity failures. Telemetry: Artifact-local provider usage was 17 requests total and 0 billing units. Codex 17 requests, 204,848 tokens; Copilot 0 requests, 0 tokens. Review reused 13 deterministic resolutions, 8 request batches. --- src/plugins/dbviewer/renmain.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/dbviewer/renmain.cpp b/src/plugins/dbviewer/renmain.cpp index 66e838ee0..1514af534 100644 --- a/src/plugins/dbviewer/renmain.cpp +++ b/src/plugins/dbviewer/renmain.cpp @@ -1844,7 +1844,7 @@ CRendererWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (xPos >= RowHeight && yPos >= RowHeight) { - // select pres bunky + // selection across cells int x, y; if (HitTest(xPos, yPos, &x, &y, FALSE)) { @@ -1869,7 +1869,7 @@ CRendererWindow::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) if (xPos >= RowHeight && yPos >= RowHeight) { - // select pres bunky + // selection across cells int x, y; if (HitTest(xPos, yPos, &x, &y, FALSE)) { From ece81524e6e8fa625cc627611a21b995711bb6d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 22:46:30 +0200 Subject: [PATCH 701/710] [translation] Fix src/plugins/ftp/operats5.cpp comments Refines translated comments in src/plugins/ftp/operats5.cpp. Model: OpenAI GPT-5.4 Verification: Full OSTranslation sequential review pipeline with requested review mode `codex`, actual review providers `codex`, `--prompt-log-mode summary`, `--copilot-event-log summary`, AST grounding through clang, Codex model `gpt-5.4` with `--codex-reasoning medium`, Copilot model `gpt-5.4-mini`, and `--copilot-reasoning high`. 261 comment units, 261 review results, 261 resolved results, and 261 apply results. Branch-target comment guard passed for `src/plugins/ftp/operats5.cpp` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. `git diff --check -- src/plugins/ftp/operats5.cpp` completed without diff integrity failures. Telemetry: Artifact-local provider usage was 63 requests total and 0 billing units. Codex 63 requests, 610,057 tokens; Copilot 0 requests, 0 tokens. Review reused 26 deterministic resolutions, 51 request batches. --- src/plugins/ftp/operats5.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/ftp/operats5.cpp b/src/plugins/ftp/operats5.cpp index 55a019f0f..aaa67fc2f 100644 --- a/src/plugins/ftp/operats5.cpp +++ b/src/plugins/ftp/operats5.cpp @@ -1779,7 +1779,7 @@ void DoCreateFile(CFTPDiskWork& localWork, char* fullName, BOOL& workDone, BOOL& // break; // resume or overwrite - if resume fails we try overwrite as well } // case 3: // resume or overwrite - if resume fails we try overwrite as well - case 4: // overwrite (pri already exists, transfer failed i force action) + case 4: // overwrite (for already exists, transfer failed, and force action) { if (action == 4) // check whether it is read-only (via the attribute only), but only if we have not done so already { From 68106b04288889b046e5a34e32fbe376d12dbb49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 22:46:40 +0200 Subject: [PATCH 702/710] [translation] Fix src/plugins/shared/dbg.h comments Refines translated comments in src/plugins/shared/dbg.h. Model: OpenAI GPT-5.4 Verification: Full OSTranslation sequential review pipeline with requested review mode `codex`, actual review providers none, `--prompt-log-mode summary`, `--copilot-event-log summary`, AST grounding through clang, Codex model `gpt-5.4` with `--codex-reasoning medium`, Copilot model `gpt-5.4-mini`, and `--copilot-reasoning high`. 105 comment units, 105 review results, 105 resolved results, and 105 apply results. Branch-target comment guard passed for `src/plugins/shared/dbg.h` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. `git diff --check -- src/plugins/shared/dbg.h` completed without diff integrity failures. Telemetry: Artifact-local provider usage was 25 requests total and 0 billing units. Codex 25 requests, 281,815 tokens; Copilot 0 requests, 0 tokens. Review reused 9 review-cache hits, 2 translation-memory hits (2 provider avoids), 43 deterministic resolutions, 0 request batches. --- src/plugins/shared/dbg.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/shared/dbg.h b/src/plugins/shared/dbg.h index f63d35969..601822d44 100644 --- a/src/plugins/shared/dbg.h +++ b/src/plugins/shared/dbg.h @@ -493,8 +493,8 @@ class C__Trace const char* File; // helper variable for passing the file name (ANSI) const WCHAR* FileW; // helper variable for passing the file name (Unicode) int Line; // and the line number from which TRACE_X() is called - C__StringStreamBuf TraceStringBuf; // string buffer drzici data trace streamu (ANSI) - C__StringStreamBufW TraceStringBufW; // string buffer drzici data trace streamu (unicode) + C__StringStreamBuf TraceStringBuf; // string buffer holding trace stream data (ANSI) + C__StringStreamBufW TraceStringBufW; // string buffer holding trace stream data (Unicode) C__TraceStream TraceStrStream; // trace stream object (ANSI) C__TraceStreamW TraceStrStreamW; // trace stream object (Unicode) From e77cfb34171d13e43dd105bb77c27566c108fa08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 22:46:50 +0200 Subject: [PATCH 703/710] [translation] Fix src/plugins/shared/lukas/resedit.cpp comments Refines translated comments in src/plugins/shared/lukas/resedit.cpp. Model: OpenAI GPT-5.4 Verification: Full OSTranslation sequential review pipeline with requested review mode `codex`, actual review providers `codex`, `--prompt-log-mode summary`, `--copilot-event-log summary`, AST grounding through clang, Codex model `gpt-5.4` with `--codex-reasoning medium`, Copilot model `gpt-5.4-mini`, and `--copilot-reasoning high`. 34 comment units, 34 review results, 34 resolved results, and 34 apply results. Branch-target comment guard passed for `src/plugins/shared/lukas/resedit.cpp` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. `git diff --check -- src/plugins/shared/lukas/resedit.cpp` completed without diff integrity failures. Telemetry: Artifact-local provider usage was 16 requests total and 0 billing units. Codex 16 requests, 153,431 tokens; Copilot 0 requests, 0 tokens. Review reused 13 deterministic resolutions, 1 request batch. --- src/plugins/shared/lukas/resedit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/shared/lukas/resedit.cpp b/src/plugins/shared/lukas/resedit.cpp index 62513ecd2..a960d5037 100644 --- a/src/plugins/shared/lukas/resedit.cpp +++ b/src/plugins/shared/lukas/resedit.cpp @@ -93,7 +93,7 @@ BOOL CResEdit::BeginUpdateResource(LPCSTR pFileName, BOOL bDeleteExistingResourc if (lastError == ERROR_INVALID_HANDLE && ++num_of_retries <= 10) { CloseHandle(File); - Sleep(100); // cekame 10x 100ms na "zvalidneni" handlu (asi do toho zasahuje antivir?) + Sleep(100); // Wait up to 10 x 100 ms for the handle to "become valid" (perhaps the antivirus is interfering?) goto try_again; } TRACE_E("Error reading headers."); From 0f8960e799e6adb86e059355d836482c6d3f0ca9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 22:47:00 +0200 Subject: [PATCH 704/710] [translation] Fix src/plugins/shared/spl_gui.h comments Refines translated comments in src/plugins/shared/spl_gui.h. Model: OpenAI GPT-5.4 Verification: Full OSTranslation sequential review pipeline with requested review mode `codex`, actual review providers `codex`, `--prompt-log-mode summary`, `--copilot-event-log summary`, AST grounding through clang, Codex model `gpt-5.4` with `--codex-reasoning medium`, Copilot model `gpt-5.4-mini`, and `--copilot-reasoning high`. 295 comment units, 295 review results, 295 resolved results, and 295 apply results. Branch-target comment guard passed for `src/plugins/shared/spl_gui.h` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. `git diff --check -- src/plugins/shared/spl_gui.h` completed without diff integrity failures. Telemetry: Artifact-local provider usage was 7 requests total and 0 billing units. Codex 7 requests, 15,976 tokens; Copilot 0 requests, 0 tokens. Review reused 30 review-cache hits, 1 translation-memory hit (1 provider avoid), 73 deterministic resolutions, 1 request batch. --- src/plugins/shared/spl_gui.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/shared/spl_gui.h b/src/plugins/shared/spl_gui.h index 410c812a6..e395fef67 100644 --- a/src/plugins/shared/spl_gui.h +++ b/src/plugins/shared/spl_gui.h @@ -1149,11 +1149,11 @@ class CGUIMenuBarAbstract // virtual BOOL WINAPI GetItemRect(int index, RECT& r) = 0; - // prepne menu do Menu mode (jako by user stisknul a pustil Alt) + // switches the menu to Menu mode (as if the user pressed and released Alt) virtual void WINAPI EnterMenu() = 0; // returns TRUE if the menu is in Menu mode virtual BOOL WINAPI IsInMenuLoop() = 0; - // prepina menu do Help mode (Shift + F1) + // switches the menu to Help mode (Shift + F1) virtual void WINAPI SetHelpMode(BOOL helpMode) = 0; // @@ -1847,7 +1847,7 @@ class CGUIToolBarAbstract // **************************************************************************** // CGUIIconListAbstract // -// Nas interni 32-bitovy image list. 8 bitu na kazdy RGB kanal a 8 bitu alfa transparence. +// Our internal 32-bit image list: 8 bits for each RGB channel and 8 bits for alpha transparency. class CGUIIconListAbstract { From b038d337d579099b4dc20e6e5e17ad2fbd9bad5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 22:47:11 +0200 Subject: [PATCH 705/710] [translation] Fix src/plugins/shared/statics.rh2 comments Refines translated comments in src/plugins/shared/statics.rh2. Model: OpenAI GPT-5.4 Verification: Full OSTranslation sequential review pipeline with requested review mode `codex`, actual review providers `codex`, `--prompt-log-mode summary`, `--copilot-event-log summary`, AST grounding through clang, Codex model `gpt-5.4` with `--codex-reasoning medium`, Copilot model `gpt-5.4-mini`, and `--copilot-reasoning high`. 6 comment units, 6 review results, 6 resolved results, and 6 apply results. Branch-target comment guard passed for `src/plugins/shared/statics.rh2` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. `git diff --check -- src/plugins/shared/statics.rh2` completed without diff integrity failures. Telemetry: Artifact-local provider usage was 3 requests total and 0 billing units. Codex 3 requests, 25,116 tokens; Copilot 0 requests, 0 tokens. Review reused 4 deterministic resolutions, 2 request batches. --- src/plugins/shared/statics.rh2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/shared/statics.rh2 b/src/plugins/shared/statics.rh2 index d43752653..fc7db8704 100644 --- a/src/plugins/shared/statics.rh2 +++ b/src/plugins/shared/statics.rh2 @@ -16,7 +16,7 @@ // Any module that includes statics.rh2 must define IDC_STATIC_1 and reserve space for 40 values -//#define IDC_STATIC_1 (IDC_STATIC_1+0) // definovano v nadrazenem headru +//#define IDC_STATIC_1 (IDC_STATIC_1+0) // defined in the parent header #define IDC_STATIC_2 (IDC_STATIC_1+1) #define IDC_STATIC_3 (IDC_STATIC_1+2) #define IDC_STATIC_4 (IDC_STATIC_1+3) From 0c0e27c0c5b7b5c95f657721f653c3cac7a1b705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 22:47:23 +0200 Subject: [PATCH 706/710] [translation] Fix src/plugins/shared/versinfo.rc2 comments Refines translated comments in src/plugins/shared/versinfo.rc2. Model: OpenAI GPT-5.4 Verification: Full OSTranslation sequential review pipeline with requested review mode `codex`, actual review providers `codex`, `--prompt-log-mode summary`, `--copilot-event-log summary`, AST grounding through clang, Codex model `gpt-5.4` with `--codex-reasoning medium`, Copilot model `gpt-5.4-mini`, and `--copilot-reasoning high`. 5 comment units, 5 review results, 5 resolved results, and 5 apply results. Branch-target comment guard passed for `src/plugins/shared/versinfo.rc2` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. `git diff --check -- src/plugins/shared/versinfo.rc2` completed without diff integrity failures. Telemetry: Artifact-local provider usage was 4 requests total and 0 billing units. Codex 4 requests, 25,794 tokens; Copilot 0 requests, 0 tokens. Review reused 2 deterministic resolutions, 2 request batches. --- src/plugins/shared/versinfo.rc2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/shared/versinfo.rc2 b/src/plugins/shared/versinfo.rc2 index 01921fe42..eaceca260 100644 --- a/src/plugins/shared/versinfo.rc2 +++ b/src/plugins/shared/versinfo.rc2 @@ -63,7 +63,7 @@ BEGIN VALUE "SLGCRCofImpSLT", "none\0" #ifdef _LANG_SALAMANDER VALUE "SLGHelpDir", "ENGLISH\0" - VALUE "SLGIncomplete", "\0" // pri nekompletnim prekladu davat: "https://forum.altap.cz/viewforum.php?f=23\0" + VALUE "SLGIncomplete", "\0" // For incomplete translations, use: "https://forum.altap.cz/viewforum.php?f=23\0" #endif #endif END From adcd986953a445c2c66fe933cd97ba3b5f24a638 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 22:47:33 +0200 Subject: [PATCH 707/710] [translation] Fix src/plugins/zip/unreduce.cpp comments Refines translated comments in src/plugins/zip/unreduce.cpp. Model: OpenAI GPT-5.4 Verification: Full OSTranslation sequential review pipeline with requested review mode `codex`, actual review providers `codex`, `--prompt-log-mode summary`, `--copilot-event-log summary`, AST grounding through clang, Codex model `gpt-5.4` with `--codex-reasoning medium`, Copilot model `gpt-5.4-mini`, and `--copilot-reasoning high`. 36 comment units, 36 review results, 36 resolved results, and 36 apply results. Branch-target comment guard passed for `src/plugins/zip/unreduce.cpp` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. `git diff --check -- src/plugins/zip/unreduce.cpp` completed without diff integrity failures. Telemetry: Artifact-local provider usage was 9 requests total and 0 billing units. Codex 9 requests, 96,256 tokens; Copilot 0 requests, 0 tokens. Review reused 12 deterministic resolutions, 3 request batches. --- src/plugins/zip/unreduce.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/zip/unreduce.cpp b/src/plugins/zip/unreduce.cpp index fa0e475d2..12c5e87b9 100644 --- a/src/plugins/zip/unreduce.cpp +++ b/src/plugins/zip/unreduce.cpp @@ -279,7 +279,7 @@ int Unreduce(CDecompressionObject* decompress) /* expand probabilistically reduc /******************************/ /* Function LoadFollowers() */ /******************************/ -#pragma warning(disable : 4244) //aby to nervalo ze prirazuju short do charu +#pragma warning(disable : 4244) //to avoid warnings about assigning short values to chars int LoadFollowers(CDecompressionObject* decompress, f_array* followers, From a396350bb1c253938f629e35a7d10849e634fdaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 22:47:43 +0200 Subject: [PATCH 708/710] [translation] Fix src/plugins/checksum/checksum.rh2 comments Refines translated comments in src/plugins/checksum/checksum.rh2. Model: OpenAI GPT-5.4 Verification: Full OSTranslation sequential review pipeline with requested review mode `codex`, actual review providers `codex`, `--prompt-log-mode summary`, `--copilot-event-log summary`, AST grounding through clang, Codex model `gpt-5.4` with `--codex-reasoning medium`, Copilot model `gpt-5.4-mini`, and `--copilot-reasoning high`. 14 comment units, 14 review results, 14 resolved results, and 14 apply results. Branch-target comment guard passed for `src/plugins/checksum/checksum.rh2` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. `git diff --check -- src/plugins/checksum/checksum.rh2` completed without diff integrity failures. Telemetry: Artifact-local provider usage was 1 request total and 0 billing units. Codex 1 request, 4,634 tokens; Copilot 0 requests, 0 tokens. Review reused 1 translation-memory hit (1 provider avoid), 3 deterministic resolutions, 1 request batch. --- src/plugins/checksum/checksum.rh2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/checksum/checksum.rh2 b/src/plugins/checksum/checksum.rh2 index dc55ccebb..4b0a33304 100644 --- a/src/plugins/checksum/checksum.rh2 +++ b/src/plugins/checksum/checksum.rh2 @@ -8,7 +8,7 @@ #endif //defined(APSTUDIO_INVOKED) && !defined(APSTUDIO_READONLY_SYMBOLS) #define IDC_STATIC_1 300 -#include "statics.rh2" // 300 az 339 jsou timto zabrane !!! +#include "statics.rh2" // 300 to 339 are reserved by this include. #define IDS_PLUGINNAME 1 #define IDS_ABOUTTITLE 2 From d55eda5dd75f22fa57309733fe3568071b24e6c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ry=C5=A1av=C3=BD?= Date: Tue, 21 Apr 2026 22:47:54 +0200 Subject: [PATCH 709/710] [translation] Fix tools/salbreak/salbreak.cpp comments Refines translated comments in tools/salbreak/salbreak.cpp. Model: OpenAI GPT-5.4 Verification: Full OSTranslation sequential review pipeline with requested review mode `codex`, actual review providers `codex`, `--prompt-log-mode summary`, `--copilot-event-log summary`, AST grounding through clang, Codex model `gpt-5.4` with `--codex-reasoning medium`, Copilot model `gpt-5.4-mini`, and `--copilot-reasoning high`. 46 comment units, 46 review results, 46 resolved results, and 46 apply results. Branch-target comment guard passed for `tools/salbreak/salbreak.cpp` in strict and ignore-whitespace modes with 0 violations and 0 preprocessing failures. `git diff --check -- tools/salbreak/salbreak.cpp` completed without diff integrity failures. Telemetry: Artifact-local provider usage was 13 requests total and 0 billing units. Codex 13 requests, 170,333 tokens; Copilot 0 requests, 0 tokens. Review reused 2 deterministic resolutions, 5 request batches. --- tools/salbreak/salbreak.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/salbreak/salbreak.cpp b/tools/salbreak/salbreak.cpp index e4f446bd4..5f011ee9b 100644 --- a/tools/salbreak/salbreak.cpp +++ b/tools/salbreak/salbreak.cpp @@ -350,8 +350,8 @@ BOOL GetSidMD5(BYTE* sidMD5) // Dr. GUI thinks that in your case you should only set the security for specific objects because you are developing a DLL, which may not want to change the security for every object in the process. // The following function wraps CreateMutex with the additional functionality of creating security that is more relaxed than is the default for a service: /* - // pridelime mutexu vsechna mozna prava (aby napriklad fungovalo otevirani mezi AsAdmin a User ucty) - // cistejsi by bylo zavolani funkce ObtainAccessableMutex(), viz jeji obsahly komentar + // grant the mutex all possible access rights (so opening it works, for example, between AsAdmin and User accounts) + // a cleaner solution would be to call ObtainAccessableMutex(), see its detailed comment SECURITY_ATTRIBUTES secAttr; char secDesc[ SECURITY_DESCRIPTOR_MIN_LENGTH ]; secAttr.nLength = sizeof(secAttr); From 26093436ed0a3f87cb07a85b52a047d50a50460e Mon Sep 17 00:00:00 2001 From: OSTranslationReview Smoke Date: Sun, 26 Apr 2026 12:45:23 +0200 Subject: [PATCH 710/710] [translation] Fix src/plugins/ieviewer/markdown.cpp comments Provider: manual_pro Pipeline: OSTranslationReview Scope: validated translated-comment rewrites --- src/plugins/ieviewer/markdown.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/ieviewer/markdown.cpp b/src/plugins/ieviewer/markdown.cpp index 8077e7a62..96c55ceed 100644 --- a/src/plugins/ieviewer/markdown.cpp +++ b/src/plugins/ieviewer/markdown.cpp @@ -116,7 +116,7 @@ IStream* ConvertMarkdownToHTML(const char* name) sprintf_s(buff, "