Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

infolist: fix #2465 (different info for FS and plugin; add info for FS) + Ctrl-Alt-\ for jump to the mount point #2467

Merged
merged 2 commits into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions far2l/bootstrap/scripts/FarEng.hlf.m4
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,8 @@ Pressing #Shift-Enter# on "#..#" opens the current directory in the GUI file bro

Change to the root folder #Ctrl-\\#

Change to the mount point of the current folder's file system #Ctrl-Alt-\\#

Change to the home directory (~~) #Ctrl-`#

Change folder, enter an archive (also a SFX archive), #Ctrl-[Shift-]PgDn#
Expand Down
2 changes: 2 additions & 0 deletions far2l/bootstrap/scripts/FarHun.hlf.m4
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,8 @@ $ #Panelvezérlő parancsok - rendszerparancsok#

Belépés a gyökérmappába #Ctrl-\\#

Change to the mount point of the current folder's file system #Ctrl-Alt-\\#

Change to the home directory (~~) #Ctrl-`#

Belépés mappába vagy tömörített fájlba (SFX-be is), #Ctrl-PgDn#
Expand Down
3 changes: 3 additions & 0 deletions far2l/bootstrap/scripts/FarRus.hlf.m4
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,9 @@ $ #Команды управления панелями - сервисные к

Сменить папку на корневую #Ctrl-\\#

Сменить каталог на точку монтирования #Ctrl-Alt-\\#
файловой системы текущего каталога

Сменить каталог на домашний (~~) #Ctrl-`#

Смена папки, вход в архив (также в SFX архив), #Ctrl-[Shift-]PgDn#
Expand Down
2 changes: 2 additions & 0 deletions far2l/bootstrap/scripts/FarUkr.hlf.m4
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,8 @@ $ #Команда управління панелями - сервісні ко

Змінити папку на кореневу #Ctrl-\\#

Change to the mount point of the current folder's file system #Ctrl-Alt-\\#

Change to the home directory (~~) #Ctrl-`#

Зміна папки, вхід до архіву (також у SFX архів), #Ctrl-[Shift-]PgDn#
Expand Down
132 changes: 132 additions & 0 deletions far2l/bootstrap/scripts/farlang.templ.m4
Original file line number Diff line number Diff line change
Expand Up @@ -13062,6 +13062,138 @@ InfoDiskNumber
"Серійний номер"
"Серыйны нумар"

InfoDiskCurDir
"Текущий каталог"
"Current Directory"
upd:"Current Directory"
upd:"Current Directory"
upd:"Current Directory"
upd:"Current Directory"
upd:"Current Directory"
upd:"Current Directory"
upd:"Current Directory"

InfoDiskRealDir
"Реальный путь к каталогу"
"Real Directory Path"
upd:"Real Directory Path"
upd:"Real Directory Path"
upd:"Real Directory Path"
upd:"Real Directory Path"
upd:"Real Directory Path"
upd:"Real Directory Path"
upd:"Real Directory Path"

InfoDiskMountPoint
"ФС Точка монтирования"
"FS Mount Point"
upd:"FS Mount Point"
upd:"FS Mount Point"
upd:"FS Mount Point"
upd:"FS Mount Point"
upd:"FS Mount Point"
upd:"FS Mount Point"
upd:"FS Mount Point"

InfoDiskMaxFilenameLength
"ФС Максимальная длина имени"
"FS Maximum Filename Length"
upd:"FS Maximum Filename Length"
upd:"FS Maximum Filename Length"
upd:"FS Maximum Filename Length"
upd:"FS Maximum Filename Length"
upd:"FS Maximum Filename Length"
upd:"FS Maximum Filename Length"
upd:"FS Maximum Filename Length"

InfoPluginTitle
" Плагин на панели "
" Plugin in panel "
upd:" Plugin in panel "
upd:" Plugin in panel "
upd:" Plugin in panel "
upd:" Plugin in panel "
upd:" Plugin in panel "
upd:" Plugin in panel "
upd:" Plugin in panel "

InfoPluginStartDir
"Плагин запущен в каталоге"
"Plugin start in Directory"
upd:"Plugin start in Directory"
upd:"Plugin start in Directory"
upd:"Plugin start in Directory"
upd:"Plugin start in Directory"
upd:"Plugin start in Directory"
upd:"Plugin start in Directory"
upd:"Plugin start in Directory"

InfoPluginModuleName
"Plugin Module Name"
"Plugin Module Name"
upd:"Plugin Module Name"
upd:"Plugin Module Name"
upd:"Plugin Module Name"
upd:"Plugin Module Name"
upd:"Plugin Module Name"
upd:"Plugin Module Name"
upd:"Plugin Module Name"

InfoPluginHostFile
"Plugin HostFile"
"Plugin HostFile"
upd:"Plugin HostFile"
upd:"Plugin HostFile"
upd:"Plugin HostFile"
upd:"Plugin HostFile"
upd:"Plugin HostFile"
upd:"Plugin HostFile"
upd:"Plugin HostFile"

InfoPluginCurDir
"Plugin CurDir"
"Plugin CurDir"
upd:"Plugin CurDir"
upd:"Plugin CurDir"
upd:"Plugin CurDir"
upd:"Plugin CurDir"
upd:"Plugin CurDir"
upd:"Plugin CurDir"
upd:"Plugin CurDir"

InfoPluginPanelTitle
"Plugin PanelTitle"
"Plugin PanelTitle"
upd:"Plugin PanelTitle"
upd:"Plugin PanelTitle"
upd:"Plugin PanelTitle"
upd:"Plugin PanelTitle"
upd:"Plugin PanelTitle"
upd:"Plugin PanelTitle"
upd:"Plugin PanelTitle"

InfoPluginFormat
"Plugin Format"
"Plugin Format"
upd:"Plugin Format"
upd:"Plugin Format"
upd:"Plugin Format"
upd:"Plugin Format"
upd:"Plugin Format"
upd:"Plugin Format"
upd:"Plugin Format"

InfoPluginShortcutData
"Plugin ShortcutData"
"Plugin ShortcutData"
upd:"Plugin ShortcutData"
upd:"Plugin ShortcutData"
upd:"Plugin ShortcutData"
upd:"Plugin ShortcutData"
upd:"Plugin ShortcutData"
upd:"Plugin ShortcutData"
upd:"Plugin ShortcutData"

InfoMemory
" Память "
" Memory "
Expand Down
5 changes: 4 additions & 1 deletion far2l/src/farwinapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ bool apiExpandEnvironmentStrings(const wchar_t *src, FARString &strDest)

BOOL apiGetVolumeInformation(const wchar_t *lpwszRootPathName, FARString *pVolumeName,
DWORD64 *lpVolumeSerialNumber, LPDWORD lpMaximumComponentLength, LPDWORD lpFileSystemFlags,
FARString *pFileSystemName)
FARString *pFileSystemName, FARString *pFileSystemMountPoint)
{
struct statvfs svfs {};
const std::string &path = Wide2MB(lpwszRootPathName);
Expand Down Expand Up @@ -507,6 +507,9 @@ BOOL apiGetVolumeInformation(const wchar_t *lpwszRootPathName, FARString *pVolum
if (pFileSystemName) {
*pFileSystemName = MountInfo().GetFileSystem(path);
}
if (*pFileSystemMountPoint) {
*pFileSystemMountPoint = MountInfo().GetFileSystemMountPoint(lpwszRootPathName);
}

return TRUE;
}
Expand Down
2 changes: 1 addition & 1 deletion far2l/src/farwinapi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ bool apiExpandEnvironmentStrings(const wchar_t *src, FARString &strDest);

BOOL apiGetVolumeInformation(const wchar_t *lpwszRootPathName, FARString *pVolumeName,
DWORD64 *lpVolumeSerialNumber, LPDWORD lpMaximumComponentLength, LPDWORD lpFileSystemFlags,
FARString *pFileSystemName);
FARString *pFileSystemName, FARString *pFileSystemMountPoint = nullptr);

void apiFindDataToDataEx(const FAR_FIND_DATA *pSrc, FAR_FIND_DATA_EX *pDest);

Expand Down
17 changes: 16 additions & 1 deletion far2l/src/mix/MountInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,22 @@ std::string MountInfo::GetFileSystem(const std::string &path) const
return out;
}

std::string MountInfo::GetFileSystemMountPoint(const wchar_t *lpwsz_path) const
{
std::string out;
size_t longest_match = 0;
FARString str_real_path;
ConvertNameToReal(lpwsz_path, str_real_path);
const std::string &path = Wide2MB( str_real_path.CPtr() );
for (const auto &it : *_mountpoints) {
if (it.path.size() > longest_match && StrStartsFrom(path, it.path.c_str())) {
longest_match = it.path.size();
out = it.path;
}
}
return out;
}

bool MountInfo::IsMultiThreadFriendly(const std::string &path) const
{
if (_mtfs != 0) {
Expand All @@ -400,4 +416,3 @@ bool MountInfo::IsMultiThreadFriendly(const std::string &path) const
}
return out;
}

2 changes: 2 additions & 0 deletions far2l/src/mix/MountInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ class MountInfo

std::string GetFileSystem(const std::string &path) const;

std::string GetFileSystemMountPoint(const wchar_t *lpwsz_path) const;

/// Returns true if path fine to be used multi-threaded-ly
bool IsMultiThreadFriendly(const std::string &path) const;
};
12 changes: 10 additions & 2 deletions far2l/src/panels/filelist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "constitle.hpp"
#include "plugapi.hpp"
#include "CachedCreds.hpp"
#include "MountInfo.h"

extern PanelViewSettings ViewSettingsArray[];
extern size_t SizeViewSettingsArray;
Expand Down Expand Up @@ -1286,6 +1287,7 @@ int FileList::ProcessKey(FarKey Key)
return TRUE;
}

case KEY_CTRLBACKSLASH | KEY_ALT:
case KEY_CTRLBACKSLASH: {
_ALGO(CleverSysLog clv(L"Ctrl-/"));
_ALGO(SysLog(L"%ls, FileCount=%d", (PanelMode == PLUGIN_PANEL ? "PluginPanel" : "FilePanel"),
Expand All @@ -1309,8 +1311,14 @@ int FileList::ProcessKey(FarKey Key)
}
}

if (NeedChangeDir)
ChangeDir(WGOOD_SLASH);
if (NeedChangeDir) {
if ( (Key & KEY_ALT) && (PanelMode != PLUGIN_PANEL) ) { // to mount point only in local FS
FARString strFileSystemMountPoint = MountInfo().GetFileSystemMountPoint(strCurDir);
ChangeDir(strFileSystemMountPoint.IsEmpty() ? WGOOD_SLASH : strFileSystemMountPoint);
}
else // to root dir
ChangeDir(WGOOD_SLASH);
}

CtrlObject->Cp()->ActivePanel->Show();
return TRUE;
Expand Down
Loading