diff --git a/far2l/bootstrap/scripts/FarEng.hlf.m4 b/far2l/bootstrap/scripts/FarEng.hlf.m4 index 197cb433b..43562dc14 100644 --- a/far2l/bootstrap/scripts/FarEng.hlf.m4 +++ b/far2l/bootstrap/scripts/FarEng.hlf.m4 @@ -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# diff --git a/far2l/bootstrap/scripts/FarHun.hlf.m4 b/far2l/bootstrap/scripts/FarHun.hlf.m4 index f5194448d..325a285dd 100644 --- a/far2l/bootstrap/scripts/FarHun.hlf.m4 +++ b/far2l/bootstrap/scripts/FarHun.hlf.m4 @@ -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# diff --git a/far2l/bootstrap/scripts/FarRus.hlf.m4 b/far2l/bootstrap/scripts/FarRus.hlf.m4 index cadc1270a..41ea78423 100644 --- a/far2l/bootstrap/scripts/FarRus.hlf.m4 +++ b/far2l/bootstrap/scripts/FarRus.hlf.m4 @@ -807,6 +807,9 @@ $ #Команды управления панелями - сервисные к Сменить папку на корневую #Ctrl-\\# + Сменить каталог на точку монтирования #Ctrl-Alt-\\# + файловой системы текущего каталога + Сменить каталог на домашний (~~) #Ctrl-`# Смена папки, вход в архив (также в SFX архив), #Ctrl-[Shift-]PgDn# diff --git a/far2l/bootstrap/scripts/FarUkr.hlf.m4 b/far2l/bootstrap/scripts/FarUkr.hlf.m4 index 6d06eb96a..828ef5f4c 100644 --- a/far2l/bootstrap/scripts/FarUkr.hlf.m4 +++ b/far2l/bootstrap/scripts/FarUkr.hlf.m4 @@ -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# diff --git a/far2l/bootstrap/scripts/farlang.templ.m4 b/far2l/bootstrap/scripts/farlang.templ.m4 index 092472609..2877c20ef 100644 --- a/far2l/bootstrap/scripts/farlang.templ.m4 +++ b/far2l/bootstrap/scripts/farlang.templ.m4 @@ -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 " diff --git a/far2l/src/farwinapi.cpp b/far2l/src/farwinapi.cpp index c4d73e205..671dd94e6 100644 --- a/far2l/src/farwinapi.cpp +++ b/far2l/src/farwinapi.cpp @@ -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); @@ -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; } diff --git a/far2l/src/farwinapi.hpp b/far2l/src/farwinapi.hpp index 3c38fee82..be78cb12c 100644 --- a/far2l/src/farwinapi.hpp +++ b/far2l/src/farwinapi.hpp @@ -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); diff --git a/far2l/src/mix/MountInfo.cpp b/far2l/src/mix/MountInfo.cpp index 913c27eee..e8b3b27a1 100644 --- a/far2l/src/mix/MountInfo.cpp +++ b/far2l/src/mix/MountInfo.cpp @@ -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) { @@ -400,4 +416,3 @@ bool MountInfo::IsMultiThreadFriendly(const std::string &path) const } return out; } - diff --git a/far2l/src/mix/MountInfo.h b/far2l/src/mix/MountInfo.h index 80a2d3446..6103b2cf8 100644 --- a/far2l/src/mix/MountInfo.h +++ b/far2l/src/mix/MountInfo.h @@ -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; }; diff --git a/far2l/src/panels/filelist.cpp b/far2l/src/panels/filelist.cpp index e271b7866..2841d3c20 100644 --- a/far2l/src/panels/filelist.cpp +++ b/far2l/src/panels/filelist.cpp @@ -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; @@ -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"), @@ -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; diff --git a/far2l/src/panels/infolist.cpp b/far2l/src/panels/infolist.cpp index fd97bef43..e28f073d3 100644 --- a/far2l/src/panels/infolist.cpp +++ b/far2l/src/panels/infolist.cpp @@ -107,9 +107,10 @@ void InfoList::DisplayObject() { FARString strTitle; FARString strOutStr; + FARString strRealDir; Panel *AnotherPanel; // FARString strDriveRoot; - FARString strVolumeName, strFileSystemName; + FARString strVolumeName, strFileSystemName, strFileSystemMountPoint; DWORD MaxNameLength, FileSystemFlags; DWORD64 VolumeNumber; FARString strDiskNumber; @@ -150,50 +151,119 @@ void InfoList::DisplayObject() AnotherPanel = CtrlObject->Cp()->GetAnotherPanel(this); AnotherPanel->GetCurDir(strCurDir); - if (strCurDir.IsEmpty()) - apiGetCurrentDirectory(strCurDir); + if (AnotherPanel->GetMode() != PLUGIN_PANEL) { - fprintf(stderr, "apiGetVolumeInformation: %ls\n", strCurDir.CPtr()); - if (apiGetVolumeInformation(strCurDir, &strVolumeName, &VolumeNumber, &MaxNameLength, &FileSystemFlags, - &strFileSystemName)) { - // strTitle=FARString(L" ")+DiskType+L" "+Msg::InfoDisk+L" "+(strDriveRoot)+L" ("+strFileSystemName+L") "; - strTitle = FARString(L" ") + L" (" + strFileSystemName + L") "; + if (strCurDir.IsEmpty()) + apiGetCurrentDirectory(strCurDir); - strDiskNumber.Format(L"%08X-%08X", (DWORD)(VolumeNumber >> 32), (DWORD)(VolumeNumber & 0xffffffff)); - } else // Error! - strTitle = strCurDir; // strDriveRoot; + ConvertNameToReal(strCurDir, strRealDir); - TruncStr(strTitle, X2 - X1 - 3); - GotoXY(X1 + (X2 - X1 + 1 - (int)strTitle.GetLength()) / 2, CurY++); - PrintText(strTitle); + fprintf(stderr, "apiGetVolumeInformation: %ls\n", strRealDir.CPtr()); + bool b_info = apiGetVolumeInformation(strRealDir, &strVolumeName, &VolumeNumber, &MaxNameLength, &FileSystemFlags, + &strFileSystemName, &strFileSystemMountPoint); + if (b_info) { + // strTitle=FARString(L" ")+DiskType+L" "+Msg::InfoDisk+L" "+(strDriveRoot)+L" ("+strFileSystemName+L") "; + strTitle = FARString(L"") + L" (" + strFileSystemName + L") "; + + strDiskNumber.Format(L"%08X-%08X", (DWORD)(VolumeNumber >> 32), (DWORD)(VolumeNumber & 0xffffffff)); + } else // Error! + strTitle = strCurDir; // strDriveRoot; - /* #3 - disk info: size */ + TruncStr(strTitle, X2 - X1 - 3); + GotoXY(X1 + (X2 - X1 + 1 - (int)strTitle.GetLength()) / 2, CurY++); + PrintText(strTitle); - uint64_t TotalSize, TotalFree, UserFree; + /* #3 - disk info: size */ + + uint64_t TotalSize, TotalFree, UserFree; + + if (apiGetDiskSize(strCurDir, &TotalSize, &TotalFree, &UserFree)) { + GotoXY(X1 + 2, CurY++); + PrintText(Msg::InfoDiskTotal); + InsertCommas(TotalSize, strOutStr); + PrintInfo(strOutStr); + + GotoXY(X1 + 2, CurY++); + PrintText(Msg::InfoDiskFree); + InsertCommas(UserFree, strOutStr); + PrintInfo(strOutStr); + } + + /* #4 - disk info: label & SN */ + + if (!strVolumeName.IsEmpty()) { + GotoXY(X1 + 2, CurY++); + PrintText(Msg::InfoDiskLabel); + PrintInfo(strVolumeName); + } - if (apiGetDiskSize(strCurDir, &TotalSize, &TotalFree, &UserFree)) { GotoXY(X1 + 2, CurY++); - PrintText(Msg::InfoDiskTotal); - InsertCommas(TotalSize, strOutStr); - PrintInfo(strOutStr); + PrintText(Msg::InfoDiskNumber); + PrintInfo(strDiskNumber); + + // new fields + CurY++; // skip line GotoXY(X1 + 2, CurY++); - PrintText(Msg::InfoDiskFree); - InsertCommas(UserFree, strOutStr); - PrintInfo(strOutStr); + PrintText(Msg::InfoDiskCurDir); + PrintInfo(strCurDir); + + GotoXY(X1 + 2, CurY++); + PrintText(Msg::InfoDiskRealDir); + PrintInfo(strRealDir); + + if (b_info) { + GotoXY(X1 + 2, CurY++); + PrintText(Msg::InfoDiskMountPoint); + PrintInfo(strFileSystemMountPoint); + + GotoXY(X1 + 2, CurY++); + PrintText(Msg::InfoDiskMaxFilenameLength); + strTitle.Format(L"%lu", (unsigned long) MaxNameLength); + PrintInfo(strTitle); + } + } + else { // plugin + strTitle = Msg::InfoPluginTitle; + GotoXY(X1 + (X2 - X1 + 1 - (int)strTitle.GetLength()) / 2, CurY++); + PrintText(strTitle); + + GotoXY(X1 + 2, CurY++); + PrintText(Msg::InfoPluginStartDir); + PrintInfo(strCurDir); + + HANDLE hPlugin = AnotherPanel->GetPluginHandle(); + if (hPlugin != INVALID_HANDLE_VALUE) { + PluginHandle *ph = (PluginHandle *)hPlugin; + GotoXY(X1 + 2, CurY++); + PrintText(Msg::InfoPluginModuleName); + PrintInfo(PointToName(ph->pPlugin->GetModuleName())); + } - /* #4 - disk info: label & SN */ + OpenPluginInfo Info; + AnotherPanel->GetOpenPluginInfo(&Info); - if (!strVolumeName.IsEmpty()) { GotoXY(X1 + 2, CurY++); - PrintText(Msg::InfoDiskLabel); - PrintInfo(strVolumeName); - } + PrintText(Msg::InfoPluginHostFile); + PrintInfo(Info.HostFile); - GotoXY(X1 + 2, CurY++); - PrintText(Msg::InfoDiskNumber); - PrintInfo(strDiskNumber); + GotoXY(X1 + 2, CurY++); + PrintText(Msg::InfoPluginCurDir); + PrintInfo(Info.CurDir); + + GotoXY(X1 + 2, CurY++); + PrintText(Msg::InfoPluginPanelTitle); + PrintInfo(Info.PanelTitle); + + GotoXY(X1 + 2, CurY++); + PrintText(Msg::InfoPluginFormat); + PrintInfo(Info.Format); + + GotoXY(X1 + 2, CurY++); + PrintText(Msg::InfoPluginShortcutData); + PrintInfo(Info.ShortcutData); + } /* #4 - memory info */