mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-13 18:11:37 -06:00
4.37 beta
This commit is contained in:
committed by
Kornel Lesiński
parent
8304895f29
commit
cb9eea7264
@@ -612,7 +612,7 @@ void CApp::OnCopy(bool move, bool copyToSame, int srcPanelIndex)
|
||||
folderPrefix = srcPanel._currentFolderPrefix;
|
||||
filePaths.Reserve(indices.Size());
|
||||
for(int i = 0; i < indices.Size(); i++)
|
||||
filePaths.Add(srcPanel.GetItemName(indices[i]));
|
||||
filePaths.Add(srcPanel.GetItemRelPath(indices[i]));
|
||||
|
||||
result = destPanel.CopyFrom(folderPrefix, filePaths, true, 0);
|
||||
|
||||
|
||||
@@ -262,6 +262,8 @@ public:
|
||||
void SetListSettings();
|
||||
void SetShowSystemMenu();
|
||||
void SwitchOnOffOnePanel();
|
||||
bool GetFlatMode() { return Panels[LastFocusedPanel].GetFlatMode(); }
|
||||
void ChangeFlatMode() { Panels[LastFocusedPanel].ChangeFlatMode(); }
|
||||
|
||||
void OpenBookmark(int index)
|
||||
{ GetFocusedPanel().OpenBookmark(index); }
|
||||
|
||||
@@ -34,7 +34,8 @@ static STATPROPSTG kProperties[] =
|
||||
{ NULL, kpidLastAccessTime, VT_FILETIME},
|
||||
{ NULL, kpidAttributes, VT_UI4},
|
||||
{ NULL, kpidPackedSize, VT_UI8},
|
||||
{ NULL, kpidComment, VT_BSTR}
|
||||
{ NULL, kpidComment, VT_BSTR},
|
||||
{ NULL, kpidPrefix, VT_BSTR}
|
||||
};
|
||||
|
||||
HRESULT CFSFolder::Init(const UString &path, IFolderFolder *parentFolder)
|
||||
@@ -42,6 +43,8 @@ HRESULT CFSFolder::Init(const UString &path, IFolderFolder *parentFolder)
|
||||
_parentFolder = parentFolder;
|
||||
_path = path;
|
||||
|
||||
_findChangeNotificationDefined = false;
|
||||
|
||||
if (_findChangeNotification.FindFirst(_path, false,
|
||||
FILE_NOTIFY_CHANGE_FILE_NAME |
|
||||
FILE_NOTIFY_CHANGE_DIR_NAME |
|
||||
@@ -77,8 +80,7 @@ static HRESULT GetFolderSize(const UString &path, UInt64 &size, IProgress *progr
|
||||
if (fileInfo.IsDirectory())
|
||||
{
|
||||
UInt64 subSize;
|
||||
RINOK(GetFolderSize(path + UString(L"\\") + fileInfo.Name,
|
||||
subSize, progress));
|
||||
RINOK(GetFolderSize(path + UString(L"\\") + fileInfo.Name, subSize, progress));
|
||||
size += subSize;
|
||||
}
|
||||
else
|
||||
@@ -87,29 +89,67 @@ static HRESULT GetFolderSize(const UString &path, UInt64 &size, IProgress *progr
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CFSFolder::LoadSubItems(CDirItem &dirItem, const UString &path)
|
||||
{
|
||||
{
|
||||
CEnumeratorW enumerator(path + L"*");
|
||||
CDirItem fileInfo;
|
||||
while (enumerator.Next(fileInfo))
|
||||
{
|
||||
fileInfo.CompressedSizeIsDefined = false;
|
||||
/*
|
||||
if (!GetCompressedFileSize(_path + fileInfo.Name,
|
||||
fileInfo.CompressedSize))
|
||||
fileInfo.CompressedSize = fileInfo.Size;
|
||||
*/
|
||||
if (fileInfo.IsDirectory())
|
||||
{
|
||||
// fileInfo.Size = GetFolderSize(_path + fileInfo.Name);
|
||||
fileInfo.Size = 0;
|
||||
}
|
||||
dirItem.Files.Add(fileInfo);
|
||||
}
|
||||
}
|
||||
if (!_flatMode)
|
||||
return S_OK;
|
||||
|
||||
for (int i = 0; i < dirItem.Files.Size(); i++)
|
||||
{
|
||||
CDirItem &item = dirItem.Files[i];
|
||||
if (item.IsDirectory())
|
||||
LoadSubItems(item, path + item.Name + L'\\');
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CFSFolder::AddRefs(CDirItem &dirItem)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < dirItem.Files.Size(); i++)
|
||||
{
|
||||
CDirItem &item = dirItem.Files[i];
|
||||
item.Parent = &dirItem;
|
||||
_refs.Add(&item);
|
||||
}
|
||||
if (!_flatMode)
|
||||
return;
|
||||
for (i = 0; i < dirItem.Files.Size(); i++)
|
||||
{
|
||||
CDirItem &item = dirItem.Files[i];
|
||||
if (item.IsDirectory())
|
||||
AddRefs(item);
|
||||
}
|
||||
}
|
||||
|
||||
STDMETHODIMP CFSFolder::LoadItems()
|
||||
{
|
||||
// OutputDebugString(TEXT("Start\n"));
|
||||
INT32 dummy;
|
||||
WasChanged(&dummy);
|
||||
_files.Clear();
|
||||
CEnumeratorW enumerator(_path + L"*");
|
||||
CFileInfoEx fileInfo;
|
||||
while (enumerator.Next(fileInfo))
|
||||
{
|
||||
fileInfo.CompressedSizeIsDefined = false;
|
||||
/*
|
||||
if (!GetCompressedFileSize(_path + fileInfo.Name,
|
||||
fileInfo.CompressedSize))
|
||||
fileInfo.CompressedSize = fileInfo.Size;
|
||||
*/
|
||||
if (fileInfo.IsDirectory())
|
||||
{
|
||||
// fileInfo.Size = GetFolderSize(_path + fileInfo.Name);
|
||||
fileInfo.Size = 0;
|
||||
}
|
||||
_files.Add(fileInfo);
|
||||
}
|
||||
Clear();
|
||||
RINOK(LoadSubItems(_root, _path));
|
||||
AddRefs(_root);
|
||||
|
||||
// OutputDebugString(TEXT("Finish\n"));
|
||||
_commentsAreLoaded = false;
|
||||
return S_OK;
|
||||
@@ -178,7 +218,7 @@ bool CFSFolder::SaveComments()
|
||||
|
||||
STDMETHODIMP CFSFolder::GetNumberOfItems(UInt32 *numItems)
|
||||
{
|
||||
*numItems = _files.Size();
|
||||
*numItems = _refs.Size();
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -197,9 +237,9 @@ STDMETHODIMP CFSFolder::GetNumberOfSubFolders(UInt32 *numSubFolders)
|
||||
STDMETHODIMP CFSFolder::GetProperty(UInt32 itemIndex, PROPID propID, PROPVARIANT *value)
|
||||
{
|
||||
NCOM::CPropVariant propVariant;
|
||||
if (itemIndex >= (UInt32)_files.Size())
|
||||
if (itemIndex >= (UInt32)_refs.Size())
|
||||
return E_INVALIDARG;
|
||||
CFileInfoEx &fileInfo = _files[itemIndex];
|
||||
CDirItem &fileInfo = *_refs[itemIndex];
|
||||
switch(propID)
|
||||
{
|
||||
case kpidIsFolder:
|
||||
@@ -216,8 +256,7 @@ STDMETHODIMP CFSFolder::GetProperty(UInt32 itemIndex, PROPID propID, PROPVARIANT
|
||||
{
|
||||
fileInfo.CompressedSizeIsDefined = true;
|
||||
if (fileInfo.IsDirectory () ||
|
||||
!MyGetCompressedFileSizeW(_path + fileInfo.Name,
|
||||
fileInfo.CompressedSize))
|
||||
!MyGetCompressedFileSizeW(_path + GetRelPath(fileInfo), fileInfo.CompressedSize))
|
||||
fileInfo.CompressedSize = fileInfo.Size;
|
||||
}
|
||||
propVariant = fileInfo.CompressedSize;
|
||||
@@ -235,11 +274,21 @@ STDMETHODIMP CFSFolder::GetProperty(UInt32 itemIndex, PROPID propID, PROPVARIANT
|
||||
propVariant = fileInfo.LastWriteTime;
|
||||
break;
|
||||
case kpidComment:
|
||||
{
|
||||
LoadComments();
|
||||
UString comment;
|
||||
if (_comments.GetValue(fileInfo.Name, comment))
|
||||
if (_comments.GetValue(GetRelPath(fileInfo), comment))
|
||||
propVariant = comment;
|
||||
break;
|
||||
}
|
||||
case kpidPrefix:
|
||||
{
|
||||
if (_flatMode)
|
||||
{
|
||||
propVariant = GetPrefix(fileInfo);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
propVariant.Detach(value);
|
||||
return S_OK;
|
||||
@@ -250,19 +299,35 @@ HRESULT CFSFolder::BindToFolderSpec(const wchar_t *name, IFolderFolder **resultF
|
||||
*resultFolder = 0;
|
||||
CFSFolder *folderSpec = new CFSFolder;
|
||||
CMyComPtr<IFolderFolder> subFolder = folderSpec;
|
||||
RINOK(folderSpec ->Init(_path + name + UString(L'\\'), 0));
|
||||
RINOK(folderSpec->Init(_path + name + UString(L'\\'), 0));
|
||||
*resultFolder = subFolder.Detach();
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
UString CFSFolder::GetPrefix(const CDirItem &item) const
|
||||
{
|
||||
UString path;
|
||||
CDirItem *cur = item.Parent;
|
||||
while (cur->Parent != 0)
|
||||
{
|
||||
path = cur->Name + UString('\\') + path;
|
||||
cur = cur->Parent;
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
UString CFSFolder::GetRelPath(const CDirItem &item) const
|
||||
{
|
||||
return GetPrefix(item) + item.Name;
|
||||
}
|
||||
|
||||
STDMETHODIMP CFSFolder::BindToFolder(UInt32 index, IFolderFolder **resultFolder)
|
||||
{
|
||||
*resultFolder = 0;
|
||||
const NFind::CFileInfoW &fileInfo = _files[index];
|
||||
const CDirItem &fileInfo = *_refs[index];
|
||||
if (!fileInfo.IsDirectory())
|
||||
return E_INVALIDARG;
|
||||
return BindToFolderSpec(fileInfo.Name, resultFolder);
|
||||
return BindToFolderSpec(GetRelPath(fileInfo), resultFolder);
|
||||
}
|
||||
|
||||
STDMETHODIMP CFSFolder::BindToFolder(const wchar_t *name, IFolderFolder **resultFolder)
|
||||
@@ -328,6 +393,8 @@ STDMETHODIMP CFSFolder::GetName(BSTR *name)
|
||||
STDMETHODIMP CFSFolder::GetNumberOfProperties(UInt32 *numProperties)
|
||||
{
|
||||
*numProperties = sizeof(kProperties) / sizeof(kProperties[0]);
|
||||
if (!_flatMode)
|
||||
(*numProperties)--;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -395,7 +462,7 @@ STDMETHODIMP CFSFolder::Clone(IFolderFolder **resultFolder)
|
||||
|
||||
HRESULT CFSFolder::GetItemFullSize(int index, UInt64 &size, IProgress *progress)
|
||||
{
|
||||
const CFileInfoW &fileInfo = _files[index];
|
||||
const CDirItem &fileInfo = *_refs[index];
|
||||
if (fileInfo.IsDirectory())
|
||||
{
|
||||
/*
|
||||
@@ -415,7 +482,7 @@ HRESULT CFSFolder::GetItemFullSize(int index, UInt64 &size, IProgress *progress)
|
||||
*totalSize += size;
|
||||
}
|
||||
*/
|
||||
return GetFolderSize(_path + fileInfo.Name, size, progress);
|
||||
return GetFolderSize(_path + GetRelPath(fileInfo), size, progress);
|
||||
}
|
||||
size = fileInfo.Size;
|
||||
return S_OK;
|
||||
@@ -424,7 +491,7 @@ HRESULT CFSFolder::GetItemFullSize(int index, UInt64 &size, IProgress *progress)
|
||||
STDMETHODIMP CFSFolder::GetItemFullSize(UInt32 index, PROPVARIANT *value, IProgress *progress)
|
||||
{
|
||||
NCOM::CPropVariant propVariant;
|
||||
if (index >= (UInt32)_files.Size())
|
||||
if (index >= (UInt32)_refs.Size())
|
||||
return E_INVALIDARG;
|
||||
UInt64 size = 0;
|
||||
HRESULT result = GetItemFullSize(index, size, progress);
|
||||
@@ -476,8 +543,9 @@ STDMETHODIMP CFSFolder::CreateFile(const wchar_t *name, IProgress *progress)
|
||||
|
||||
STDMETHODIMP CFSFolder::Rename(UInt32 index, const wchar_t *newName, IProgress *progress)
|
||||
{
|
||||
const CFileInfoW &fileInfo = _files[index];
|
||||
if (!NDirectory::MyMoveFile(_path + fileInfo.Name, _path + newName))
|
||||
const CDirItem &fileInfo = *_refs[index];
|
||||
const UString fullPrefix = _path + GetPrefix(fileInfo);
|
||||
if (!NDirectory::MyMoveFile(fullPrefix + fileInfo.Name, fullPrefix + newName))
|
||||
return GetLastError();
|
||||
return S_OK;
|
||||
}
|
||||
@@ -489,8 +557,8 @@ STDMETHODIMP CFSFolder::Delete(const UInt32 *indices, UInt32 numItems,
|
||||
for (UInt32 i = 0; i < numItems; i++)
|
||||
{
|
||||
int index = indices[i];
|
||||
const CFileInfoW &fileInfo = _files[indices[i]];
|
||||
const UString fullPath = _path + fileInfo.Name;
|
||||
const CDirItem &fileInfo = *_refs[indices[i]];
|
||||
const UString fullPath = _path + GetRelPath(fileInfo);
|
||||
bool result;
|
||||
if (fileInfo.IsDirectory())
|
||||
result = NDirectory::RemoveDirectoryWithSubItems(fullPath);
|
||||
@@ -507,9 +575,11 @@ STDMETHODIMP CFSFolder::Delete(const UInt32 *indices, UInt32 numItems,
|
||||
STDMETHODIMP CFSFolder::SetProperty(UInt32 index, PROPID propID,
|
||||
const PROPVARIANT *value, IProgress *progress)
|
||||
{
|
||||
if (index >= (UInt32)_files.Size())
|
||||
if (index >= (UInt32)_refs.Size())
|
||||
return E_INVALIDARG;
|
||||
CFileInfoEx &fileInfo = _files[index];
|
||||
CDirItem &fileInfo = *_refs[index];
|
||||
if (fileInfo.Parent->Parent != 0)
|
||||
return E_NOTIMPL;
|
||||
switch(propID)
|
||||
{
|
||||
case kpidComment:
|
||||
@@ -543,12 +613,12 @@ STDMETHODIMP CFSFolder::SetProperty(UInt32 index, PROPID propID,
|
||||
|
||||
STDMETHODIMP CFSFolder::GetSystemIconIndex(UInt32 index, INT32 *iconIndex)
|
||||
{
|
||||
if (index >= (UInt32)_files.Size())
|
||||
if (index >= (UInt32)_refs.Size())
|
||||
return E_INVALIDARG;
|
||||
const CFileInfoEx &fileInfo = _files[index];
|
||||
const CDirItem &fileInfo = *_refs[index];
|
||||
*iconIndex = 0;
|
||||
int iconIndexTemp;
|
||||
if (GetRealIconIndex(_path + fileInfo.Name, fileInfo.Attributes, iconIndexTemp) != 0)
|
||||
if (GetRealIconIndex(_path + GetRelPath(fileInfo), fileInfo.Attributes, iconIndexTemp) != 0)
|
||||
{
|
||||
*iconIndex = iconIndexTemp;
|
||||
return S_OK;
|
||||
@@ -556,5 +626,11 @@ STDMETHODIMP CFSFolder::GetSystemIconIndex(UInt32 index, INT32 *iconIndex)
|
||||
return GetLastError();
|
||||
}
|
||||
|
||||
STDMETHODIMP CFSFolder::SetFlatMode(Int32 flatMode)
|
||||
{
|
||||
_flatMode = IntToBool(flatMode);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
// static const LPCTSTR kInvalidFileChars = TEXT("\\/:*?\"<>|");
|
||||
|
||||
|
||||
@@ -20,6 +20,20 @@ struct CFileInfoEx: public NWindows::NFile::NFind::CFileInfoW
|
||||
UInt64 CompressedSize;
|
||||
};
|
||||
|
||||
struct CDirItem;
|
||||
|
||||
struct CDirItem: public CFileInfoEx
|
||||
{
|
||||
CDirItem *Parent;
|
||||
CObjectVector<CDirItem> Files;
|
||||
|
||||
CDirItem(): Parent(0) {}
|
||||
void Clear()
|
||||
{
|
||||
Files.Clear();
|
||||
Parent = 0;
|
||||
}
|
||||
};
|
||||
|
||||
class CFSFolder:
|
||||
public IFolderFolder,
|
||||
@@ -32,6 +46,7 @@ class CFSFolder:
|
||||
public IFolderGetItemFullSize,
|
||||
public IFolderClone,
|
||||
public IFolderGetSystemIconIndex,
|
||||
public IFolderSetFlatMode,
|
||||
public CMyUnknownImp
|
||||
{
|
||||
UInt64 GetSizeOfItem(int anIndex) const;
|
||||
@@ -46,6 +61,7 @@ public:
|
||||
MY_QUERYINTERFACE_ENTRY(IFolderGetItemFullSize)
|
||||
MY_QUERYINTERFACE_ENTRY(IFolderClone)
|
||||
MY_QUERYINTERFACE_ENTRY(IFolderGetSystemIconIndex)
|
||||
MY_QUERYINTERFACE_ENTRY(IFolderSetFlatMode)
|
||||
MY_QUERYINTERFACE_END
|
||||
MY_ADDREF_RELEASE
|
||||
|
||||
@@ -67,6 +83,8 @@ public:
|
||||
STDMETHOD(Clone)(IFolderFolder **resultFolder);
|
||||
STDMETHOD(GetItemFullSize)(UInt32 index, PROPVARIANT *value, IProgress *progress);
|
||||
|
||||
STDMETHOD(SetFlatMode)(Int32 flatMode);
|
||||
|
||||
// IFolderOperations
|
||||
|
||||
STDMETHOD(CreateFolder)(const wchar_t *name, IProgress *progress);
|
||||
@@ -84,7 +102,9 @@ public:
|
||||
|
||||
private:
|
||||
UString _path;
|
||||
CObjectVector<CFileInfoEx> _files;
|
||||
CDirItem _root;
|
||||
CRecordVector<CDirItem *> _refs;
|
||||
|
||||
CMyComPtr<IFolderFolder> _parentFolder;
|
||||
|
||||
bool _findChangeNotificationDefined;
|
||||
@@ -92,6 +112,8 @@ private:
|
||||
bool _commentsAreLoaded;
|
||||
CPairsStorage _comments;
|
||||
|
||||
bool _flatMode;
|
||||
|
||||
NWindows::NFile::NFind::CFindChangeNotification _findChangeNotification;
|
||||
|
||||
HRESULT GetItemFullSize(int index, UInt64 &size, IProgress *progress);
|
||||
@@ -100,8 +122,22 @@ private:
|
||||
|
||||
bool LoadComments();
|
||||
bool SaveComments();
|
||||
HRESULT LoadSubItems(CDirItem &dirItem, const UString &path);
|
||||
void AddRefs(CDirItem &dirItem);
|
||||
public:
|
||||
HRESULT Init(const UString &path, IFolderFolder *parentFolder);
|
||||
|
||||
CFSFolder() : _flatMode(false) {}
|
||||
|
||||
UString GetPrefix(const CDirItem &item) const;
|
||||
UString GetRelPath(const CDirItem &item) const;
|
||||
UString GetRelPath(UInt32 index) const { return GetRelPath(*_refs[index]); }
|
||||
|
||||
void Clear()
|
||||
{
|
||||
_root.Clear();
|
||||
_refs.Clear();
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -252,7 +252,7 @@ STDMETHODIMP CFSFolder::CopyTo(const UInt32 *indices, UInt32 numItems,
|
||||
for (i = 0; i < numItems; i++)
|
||||
{
|
||||
int index = indices[i];
|
||||
if (index >= _files.Size())
|
||||
if (index >= _refs.Size())
|
||||
return E_INVALIDARG;
|
||||
UINT64 size;
|
||||
RINOK(GetItemFullSize(indices[i], size, callback));
|
||||
@@ -286,11 +286,11 @@ STDMETHODIMP CFSFolder::CopyTo(const UInt32 *indices, UInt32 numItems,
|
||||
RINOK(callback->SetCompleted(&completedSize));
|
||||
for (i = 0; i < numItems; i++)
|
||||
{
|
||||
const CFileInfoW &fileInfo = _files[indices[i]];
|
||||
const CDirItem &fileInfo = *_refs[indices[i]];
|
||||
UString destPath2 = destPath;
|
||||
if (!directName)
|
||||
destPath2 += fileInfo.Name;
|
||||
UString srcPath = _path + fileInfo.Name;
|
||||
UString srcPath = _path + GetPrefix(fileInfo) + fileInfo.Name;
|
||||
if (fileInfo.IsDirectory())
|
||||
{
|
||||
RINOK(CopyFolder(srcPath, destPath2, callback, completedSize));
|
||||
@@ -415,7 +415,7 @@ STDMETHODIMP CFSFolder::MoveTo(
|
||||
for (i = 0; i < numItems; i++)
|
||||
{
|
||||
int index = indices[i];
|
||||
if (index >= _files.Size())
|
||||
if (index >= _refs.Size())
|
||||
return E_INVALIDARG;
|
||||
UINT64 size;
|
||||
RINOK(GetItemFullSize(indices[i], size, callback));
|
||||
@@ -445,11 +445,11 @@ STDMETHODIMP CFSFolder::MoveTo(
|
||||
RINOK(callback->SetCompleted(&completedSize));
|
||||
for (i = 0; i < numItems; i++)
|
||||
{
|
||||
const CFileInfoW &fileInfo = _files[indices[i]];
|
||||
const CDirItem &fileInfo = *_refs[indices[i]];
|
||||
UString destPath2 = destPath;
|
||||
if (!directName)
|
||||
destPath2 += fileInfo.Name;
|
||||
UString srcPath = _path + fileInfo.Name;
|
||||
UString srcPath = _path + GetPrefix(fileInfo) + fileInfo.Name;
|
||||
if (fileInfo.IsDirectory())
|
||||
{
|
||||
RINOK(MyMoveFolder(srcPath, destPath2, callback, completedSize));
|
||||
|
||||
@@ -133,8 +133,13 @@ FOLDER_INTERFACE(IFolderClone, 0x09)
|
||||
STDMETHOD(Clone)(IFolderFolder **resultFolder) PURE;
|
||||
};
|
||||
|
||||
FOLDER_INTERFACE(IFolderSetFlatMode, 0x0A)
|
||||
{
|
||||
STDMETHOD(SetFlatMode)(Int32 flatMode) PURE;
|
||||
};
|
||||
|
||||
/*
|
||||
FOLDER_INTERFACE(IFolderOpen, 0x0A)
|
||||
FOLDER_INTERFACE(IFolderOpen, 0x10)
|
||||
{
|
||||
STDMETHOD(FolderOpen)(
|
||||
const wchar_t *aFileName,
|
||||
|
||||
@@ -114,6 +114,7 @@ static CIDLangPair kIDLangPairs[] =
|
||||
|
||||
{ IDM_VIEW_REFRESH, 0x03000440 },
|
||||
|
||||
{ IDM_VIEW_FLAT_VIEW, 0x03000449 },
|
||||
{ IDM_VIEW_TWO_PANELS, 0x03000450 },
|
||||
{ IDM_VIEW_ARCHIVE_TOOLBAR, 0x03000460 },
|
||||
{ IDM_VIEW_STANDARD_TOOLBAR, 0x03000461 },
|
||||
@@ -331,6 +332,8 @@ void OnMenuActivating(HWND hWnd, HMENU hMenu, int position)
|
||||
IDM_VIEW_LARGE_ICONS + g_App.GetListViewMode(), MF_BYCOMMAND);
|
||||
menu.CheckItem(IDM_VIEW_TWO_PANELS, MF_BYCOMMAND |
|
||||
((g_App.NumPanels == 2) ? MF_CHECKED : MF_UNCHECKED));
|
||||
menu.CheckItem(IDM_VIEW_FLAT_VIEW, MF_BYCOMMAND |
|
||||
((g_App.GetFlatMode()) ? MF_CHECKED : MF_UNCHECKED));
|
||||
menu.CheckItem(IDM_VIEW_ARCHIVE_TOOLBAR, MF_BYCOMMAND |
|
||||
(g_App.ShowArchiveToolbar ? MF_CHECKED : MF_UNCHECKED));
|
||||
menu.CheckItem(IDM_VIEW_STANDARD_TOOLBAR, MF_BYCOMMAND |
|
||||
@@ -635,10 +638,12 @@ bool OnMenuCommand(HWND hWnd, int id)
|
||||
case IDM_VIEW_REFRESH:
|
||||
g_App.RefreshView();
|
||||
break;
|
||||
case IDM_VIEW_FLAT_VIEW:
|
||||
g_App.ChangeFlatMode();
|
||||
break;
|
||||
case IDM_VIEW_TWO_PANELS:
|
||||
g_App.SwitchOnOffOnePanel();
|
||||
break;
|
||||
|
||||
case IDM_VIEW_STANDARD_TOOLBAR:
|
||||
g_App.SwitchStandardToolbar();
|
||||
break;
|
||||
|
||||
@@ -93,7 +93,7 @@ LRESULT CPanel::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
|
||||
OnShiftSelectMessage();
|
||||
return 0;
|
||||
case kReLoadMessage:
|
||||
OnReload();
|
||||
RefreshListCtrl(_selectedState);
|
||||
return 0;
|
||||
case kSetFocusToListView:
|
||||
_listView.SetFocus();
|
||||
@@ -736,6 +736,13 @@ void CPanel::SetListViewMode(UINT32 index)
|
||||
// RefreshListCtrlSaveFocused();
|
||||
}
|
||||
|
||||
void CPanel::ChangeFlatMode()
|
||||
{
|
||||
_flatMode = !_flatMode;
|
||||
RefreshListCtrlSaveFocused();
|
||||
}
|
||||
|
||||
|
||||
void CPanel::RefreshStatusBar()
|
||||
{
|
||||
PostMessage(kRefreshStatusBar);
|
||||
@@ -759,7 +766,7 @@ void CPanel::AddToArchive()
|
||||
for (int i = 0; i < indices.Size(); i++)
|
||||
{
|
||||
int index = indices[i];
|
||||
names.Add(_currentFolderPrefix + GetItemName(index));
|
||||
names.Add(_currentFolderPrefix + GetItemRelPath(index));
|
||||
}
|
||||
const UString archiveName = CreateArchiveName(
|
||||
names.Front(), (names.Size() > 1), false);
|
||||
@@ -791,7 +798,7 @@ void CPanel::ExtractArchives()
|
||||
MessageBox(kSelectOneFile);
|
||||
return;
|
||||
}
|
||||
paths.Add(_currentFolderPrefix + GetItemName(index));
|
||||
paths.Add(_currentFolderPrefix + GetItemRelPath(index));
|
||||
}
|
||||
::ExtractArchives(paths, _currentFolderPrefix, true);
|
||||
}
|
||||
@@ -819,7 +826,7 @@ void CPanel::TestArchives()
|
||||
MessageBox(kSelectOneFile);
|
||||
return;
|
||||
}
|
||||
paths.Add(_currentFolderPrefix + GetItemName(index));
|
||||
paths.Add(_currentFolderPrefix + GetItemRelPath(index));
|
||||
}
|
||||
::TestArchives(paths);
|
||||
}
|
||||
|
||||
@@ -232,7 +232,7 @@ public:
|
||||
bool _mySelectMode;
|
||||
CBoolVector _selectedStatusVector;
|
||||
|
||||
UString _focusedName;
|
||||
CSelectedState _selectedState;
|
||||
|
||||
UInt32 GetRealIndex(const LVITEMW &item) const
|
||||
{
|
||||
@@ -257,6 +257,10 @@ public:
|
||||
UInt32 _ListViewMode;
|
||||
int _xSize;
|
||||
|
||||
bool _flatMode;
|
||||
|
||||
bool _dontShowMode;
|
||||
|
||||
|
||||
UString _currentFolderPrefix;
|
||||
|
||||
@@ -273,6 +277,8 @@ public:
|
||||
void RefreshListCtrlSaveFocused();
|
||||
|
||||
UString GetItemName(int itemIndex) const;
|
||||
UString GetItemPrefix(int itemIndex) const;
|
||||
UString GetItemRelPath(int itemIndex) const;
|
||||
bool IsItemFolder(int itemIndex) const;
|
||||
UInt64 GetItemSize(int itemIndex) const;
|
||||
|
||||
@@ -316,10 +322,12 @@ public:
|
||||
_startGroupSelect(0),
|
||||
_selectionIsDefined(false),
|
||||
_ListViewMode(3),
|
||||
_flatMode(false),
|
||||
_xSize(300),
|
||||
_mySelectMode(false),
|
||||
_enableItemChangeNotify(true)
|
||||
{}
|
||||
_enableItemChangeNotify(true),
|
||||
_dontShowMode(false)
|
||||
{}
|
||||
|
||||
void SetExtendedStyle()
|
||||
{
|
||||
@@ -471,6 +479,9 @@ public:
|
||||
void SetListViewMode(UInt32 index);
|
||||
UInt32 GetListViewMode() const { return _ListViewMode; };
|
||||
|
||||
void ChangeFlatMode();
|
||||
bool GetFlatMode() const { return _flatMode; };
|
||||
|
||||
void RefreshStatusBar();
|
||||
void OnRefreshStatusBar();
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ static const UInt32 kBufSize = (1 << 15);
|
||||
|
||||
struct CDirEnumerator
|
||||
{
|
||||
bool FlatMode;
|
||||
UString BasePrefix;
|
||||
UStringVector FileNames;
|
||||
|
||||
@@ -38,6 +39,8 @@ struct CDirEnumerator
|
||||
int Index;
|
||||
bool GetNextFile(NFind::CFileInfoW &fileInfo, bool &filled, UString &fullPath, DWORD &errorCode);
|
||||
void Init();
|
||||
|
||||
CDirEnumerator(): FlatMode(false) {};
|
||||
};
|
||||
|
||||
void CDirEnumerator::Init()
|
||||
@@ -57,6 +60,10 @@ bool CDirEnumerator::GetNextFile(NFind::CFileInfoW &fileInfo, bool &filled, UStr
|
||||
if (Index >= FileNames.Size())
|
||||
return true;
|
||||
const UString &path = FileNames[Index];
|
||||
int pos = path.ReverseFind('\\');
|
||||
resPath.Empty();
|
||||
if (pos >= 0)
|
||||
resPath = path.Left(pos + 1);
|
||||
if (!NFind::FindFile(BasePrefix + path, fileInfo))
|
||||
{
|
||||
errorCode = ::GetLastError();
|
||||
@@ -64,7 +71,6 @@ bool CDirEnumerator::GetNextFile(NFind::CFileInfoW &fileInfo, bool &filled, UStr
|
||||
return false;
|
||||
}
|
||||
Index++;
|
||||
resPath.Empty();
|
||||
break;
|
||||
}
|
||||
bool found;
|
||||
@@ -83,7 +89,7 @@ bool CDirEnumerator::GetNextFile(NFind::CFileInfoW &fileInfo, bool &filled, UStr
|
||||
Prefixes.DeleteBack();
|
||||
}
|
||||
resPath += fileInfo.Name;
|
||||
if (fileInfo.IsDirectory())
|
||||
if (!FlatMode && fileInfo.IsDirectory())
|
||||
{
|
||||
UString prefix = resPath + (UString)(wchar_t)kDirDelimiter;
|
||||
Enumerators.Add(NFind::CEnumeratorW(BasePrefix + prefix + (UString)(wchar_t)kAnyStringWildcard));
|
||||
@@ -276,8 +282,9 @@ void CApp::CalculateCrc()
|
||||
|
||||
CThreadCrc combiner;
|
||||
for (int i = 0; i < indices.Size(); i++)
|
||||
combiner.DirEnumerator.FileNames.Add(srcPanel.GetItemName(indices[i]));
|
||||
combiner.DirEnumerator.FileNames.Add(srcPanel.GetItemRelPath(indices[i]));
|
||||
combiner.DirEnumerator.BasePrefix = srcPanel._currentFolderPrefix;
|
||||
combiner.DirEnumerator.FlatMode = GetFlatMode();
|
||||
|
||||
CProgressDialog progressDialog;
|
||||
combiner.ProgressDialog = &progressDialog;
|
||||
|
||||
@@ -319,7 +319,15 @@ void CPanel::OnDrag(LPNMLISTVIEW nmListView)
|
||||
{
|
||||
UStringVector names;
|
||||
for (int i = 0; i < indices.Size(); i++)
|
||||
names.Add(dirPrefix + GetItemName(indices[i]));
|
||||
{
|
||||
UInt32 index = indices[i];
|
||||
UString s;
|
||||
if (isFSFolder)
|
||||
s = GetItemRelPath(index);
|
||||
else
|
||||
s = GetItemName(index);
|
||||
names.Add(dirPrefix + s);
|
||||
}
|
||||
if (!CopyNamesToHGlobal(dataObjectSpec->hGlobal, names))
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ HRESULT CPanel::OpenItemAsArchive(const UString &name)
|
||||
HRESULT CPanel::OpenItemAsArchive(int index)
|
||||
{
|
||||
CDisableTimerProcessing disableTimerProcessing1(*this);
|
||||
RINOK(OpenItemAsArchive(GetItemName(index)));
|
||||
RINOK(OpenItemAsArchive(GetItemRelPath(index)));
|
||||
RefreshListCtrl();
|
||||
return S_OK;
|
||||
}
|
||||
@@ -279,14 +279,14 @@ void CPanel::EditItem(int index)
|
||||
OpenItemInArchive(index, false, true, true);
|
||||
return;
|
||||
}
|
||||
HANDLE hProcess = StartEditApplication(_currentFolderPrefix + GetItemName(index), (HWND)*this);
|
||||
HANDLE hProcess = StartEditApplication(_currentFolderPrefix + GetItemRelPath(index), (HWND)*this);
|
||||
if (hProcess != 0)
|
||||
::CloseHandle(hProcess);
|
||||
}
|
||||
|
||||
void CPanel::OpenFolderExternal(int index)
|
||||
{
|
||||
HANDLE hProcess = StartApplication(GetFsPath() + GetItemName(index), (HWND)*this);
|
||||
HANDLE hProcess = StartApplication(GetFsPath() + GetItemRelPath(index), (HWND)*this);
|
||||
if (hProcess != 0)
|
||||
::CloseHandle(hProcess);
|
||||
}
|
||||
@@ -299,7 +299,7 @@ void CPanel::OpenItem(int index, bool tryInternal, bool tryExternal)
|
||||
OpenItemInArchive(index, tryInternal, tryExternal, false);
|
||||
return;
|
||||
}
|
||||
UString name = GetItemName(index);
|
||||
UString name = GetItemRelPath(index);
|
||||
if (IsNameVirus(name))
|
||||
{
|
||||
MessageBoxMyError(virusMessage);
|
||||
@@ -411,7 +411,7 @@ static DWORD WINAPI MyThreadFunction(void *param)
|
||||
void CPanel::OpenItemInArchive(int index, bool tryInternal, bool tryExternal,
|
||||
bool editMode)
|
||||
{
|
||||
UString name = GetItemName(index);
|
||||
const UString name = GetItemName(index);
|
||||
if (IsNameVirus(name))
|
||||
{
|
||||
MessageBoxMyError(virusMessage);
|
||||
|
||||
@@ -215,7 +215,7 @@ void CPanel::GetSelectedNames(UStringVector &selectedNames)
|
||||
GetSelectedItemsIndices(indices);
|
||||
selectedNames.Reserve(indices.Size());
|
||||
for (int i = 0; i < indices.Size(); i++)
|
||||
selectedNames.Add(GetItemName(indices[i]));
|
||||
selectedNames.Add(GetItemRelPath(indices[i]));
|
||||
|
||||
/*
|
||||
for (int i = 0; i < _listView.GetItemCount(); i++)
|
||||
@@ -245,19 +245,12 @@ void CPanel::SaveSelectedState(CSelectedState &s)
|
||||
s.FocusedName.Empty();
|
||||
s.SelectedNames.Clear();
|
||||
s.FocusedItem = _listView.GetFocusedItem();
|
||||
if (!_focusedName.IsEmpty())
|
||||
{
|
||||
s.FocusedName = _focusedName;
|
||||
s.SelectFocused = true;
|
||||
_focusedName.Empty();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (s.FocusedItem >= 0)
|
||||
{
|
||||
int realIndex = GetRealItemIndex(s.FocusedItem);
|
||||
if (realIndex != kParentIndex)
|
||||
s.FocusedName = GetItemName(realIndex);
|
||||
s.FocusedName = GetItemRelPath(realIndex);
|
||||
/*
|
||||
const int kSize = 1024;
|
||||
WCHAR name[kSize + 1];
|
||||
@@ -307,6 +300,7 @@ void CPanel::SetFocusedSelectedItem(int index, bool select)
|
||||
void CPanel::RefreshListCtrl(const UString &focusedName, int focusedPos, bool selectFocused,
|
||||
const UStringVector &selectedNames)
|
||||
{
|
||||
_dontShowMode = false;
|
||||
LoadFullPathAndShow();
|
||||
// OutputDebugStringA("=======\n");
|
||||
// OutputDebugStringA("s1 \n");
|
||||
@@ -340,6 +334,11 @@ void CPanel::RefreshListCtrl(const UString &focusedName, int focusedPos, bool se
|
||||
bool isRoot = IsRootFolder();
|
||||
_headerToolBar.EnableButton(kParentFolderID, !IsRootFolder());
|
||||
|
||||
CMyComPtr<IFolderSetFlatMode> folderSetFlatMode;
|
||||
_folder.QueryInterface(IID_IFolderSetFlatMode, &folderSetFlatMode);
|
||||
if (folderSetFlatMode)
|
||||
folderSetFlatMode->SetFlatMode(BoolToInt(_flatMode));
|
||||
|
||||
if (_folder->LoadItems() != S_OK)
|
||||
return;
|
||||
|
||||
@@ -385,10 +384,11 @@ void CPanel::RefreshListCtrl(const UString &focusedName, int focusedPos, bool se
|
||||
for(UInt32 i = 0; i < numItems; i++)
|
||||
{
|
||||
UString itemName = GetItemName(i);
|
||||
if (itemName.CompareNoCase(focusedName) == 0)
|
||||
const UString relPath = GetItemRelPath(i);
|
||||
if (relPath.CompareNoCase(focusedName) == 0)
|
||||
cursorIndex = _listView.GetItemCount();
|
||||
bool selected = false;
|
||||
if (selectedNames.FindInSorted(itemName) >= 0)
|
||||
if (selectedNames.FindInSorted(relPath) >= 0)
|
||||
selected = true;
|
||||
_selectedStatusVector.Add(selected);
|
||||
|
||||
@@ -623,6 +623,24 @@ UString CPanel::GetItemName(int itemIndex) const
|
||||
return (propVariant.bstrVal);
|
||||
}
|
||||
|
||||
UString CPanel::GetItemPrefix(int itemIndex) const
|
||||
{
|
||||
if (itemIndex == kParentIndex)
|
||||
return UString();
|
||||
NCOM::CPropVariant propVariant;
|
||||
if (_folder->GetProperty(itemIndex, kpidPrefix, &propVariant) != S_OK)
|
||||
throw 2723400;
|
||||
UString prefix;
|
||||
if (propVariant.vt == VT_BSTR)
|
||||
prefix = propVariant.bstrVal;
|
||||
return prefix;
|
||||
}
|
||||
|
||||
UString CPanel::GetItemRelPath(int itemIndex) const
|
||||
{
|
||||
return GetItemPrefix(itemIndex) + GetItemName(itemIndex);
|
||||
}
|
||||
|
||||
|
||||
bool CPanel::IsItemFolder(int itemIndex) const
|
||||
{
|
||||
|
||||
@@ -43,6 +43,9 @@ static UString ConvertSizeToString(UINT64 value)
|
||||
|
||||
LRESULT CPanel::SetItemText(LVITEMW &item)
|
||||
{
|
||||
if (_dontShowMode)
|
||||
return 0;
|
||||
|
||||
UINT32 realIndex = GetRealIndex(item);
|
||||
/*
|
||||
if ((item.mask & LVIF_IMAGE) != 0)
|
||||
|
||||
@@ -102,7 +102,7 @@ HRESULT CPanel::CreateShellContextMenu(
|
||||
for (int i = 0; i < operatedIndices.Size(); i++)
|
||||
{
|
||||
LPITEMIDLIST pidl;
|
||||
UString fileName = GetItemName(operatedIndices[i]);
|
||||
UString fileName = GetItemRelPath(operatedIndices[i]);
|
||||
if (IsFSDrivesFolder())
|
||||
fileName += L'\\';
|
||||
RINOK(parentFolder->ParseDisplayName(GetParent(), 0,
|
||||
@@ -263,7 +263,7 @@ void CPanel::CreateSevenZipMenu(HMENU menuSpec,
|
||||
UStringVector names;
|
||||
int i;
|
||||
for(i = 0; i < operatedIndices.Size(); i++)
|
||||
names.Add(currentFolderUnicode + GetItemName(operatedIndices[i]));
|
||||
names.Add(currentFolderUnicode + GetItemRelPath(operatedIndices[i]));
|
||||
CRecordVector<const wchar_t *> namePointers;
|
||||
for(i = 0; i < operatedIndices.Size(); i++)
|
||||
namePointers.Add(names[i]);
|
||||
|
||||
@@ -73,7 +73,7 @@ void CPanel::DeleteItems(bool toRecycleBin)
|
||||
size_t size = 0;
|
||||
for (int i = 0; i < indices.Size(); i++)
|
||||
{
|
||||
const AString path = GetSystemString(GetFsPath() + GetItemName(indices[i]));
|
||||
const AString path = GetSystemString(GetFsPath() + GetItemRelPath(indices[i]));
|
||||
buffer.EnsureCapacity(size + path.Length() + 1);
|
||||
memmove(((CHAR *)buffer) + size, (const CHAR *)path, (path.Length() + 1) * sizeof(CHAR));
|
||||
size += path.Length() + 1;
|
||||
@@ -104,7 +104,7 @@ void CPanel::DeleteItems(bool toRecycleBin)
|
||||
size_t size = 0;
|
||||
for (int i = 0; i < indices.Size(); i++)
|
||||
{
|
||||
const UString path = GetFsPath() + GetItemName(indices[i]);
|
||||
const UString path = GetFsPath() + GetItemRelPath(indices[i]);
|
||||
buffer.EnsureCapacity(size + path.Length() + 1);
|
||||
memmove(((WCHAR *)buffer) + size, (const WCHAR *)path, (path.Length() + 1) * sizeof(WCHAR));
|
||||
size += path.Length() + 1;
|
||||
@@ -159,7 +159,7 @@ void CPanel::DeleteItems(bool toRecycleBin)
|
||||
if (indices.Size() == 1)
|
||||
{
|
||||
int index = indices[0];
|
||||
const UString itemName = GetItemName(index);
|
||||
const UString itemName = GetItemRelPath(index);
|
||||
if (IsItemFolder(index))
|
||||
{
|
||||
title = LangString(IDS_CONFIRM_FOLDER_DELETE, 0x03020211);
|
||||
@@ -228,12 +228,15 @@ BOOL CPanel::OnEndLabelEdit(LV_DISPINFOW * lpnmh)
|
||||
MessageBoxMyError(L"Renaming is not supported");
|
||||
return FALSE;
|
||||
}
|
||||
UString newName = lpnmh->item.pszText;
|
||||
const UString newName = lpnmh->item.pszText;
|
||||
CPanel::CDisableTimerProcessing disableTimerProcessing2(*this);
|
||||
|
||||
SaveSelectedState(_selectedState);
|
||||
|
||||
int realIndex = GetRealIndex(lpnmh->item);
|
||||
if (realIndex == kParentIndex)
|
||||
return FALSE;
|
||||
const UString prefix = GetItemPrefix(realIndex);
|
||||
HRESULT result = folderOperations->Rename(realIndex, newName, 0);
|
||||
if (result != S_OK)
|
||||
{
|
||||
@@ -242,11 +245,16 @@ BOOL CPanel::OnEndLabelEdit(LV_DISPINFOW * lpnmh)
|
||||
}
|
||||
// Can't use RefreshListCtrl here.
|
||||
// RefreshListCtrlSaveFocused();
|
||||
_focusedName = newName;
|
||||
_selectedState.FocusedName = prefix + newName;
|
||||
_selectedState.SelectFocused = true;
|
||||
|
||||
// We need clear all items to disable GetText before Reload:
|
||||
// number of items can change.
|
||||
_listView.DeleteAllItems();
|
||||
// _listView.DeleteAllItems();
|
||||
// But seems it can still call GetText (maybe for current item)
|
||||
// so we can't delete items.
|
||||
|
||||
_dontShowMode = true;
|
||||
|
||||
PostMessage(kReLoadMessage);
|
||||
return TRUE;
|
||||
@@ -355,7 +363,7 @@ void CPanel::ChangeComment()
|
||||
else if (propVariant.vt != VT_EMPTY)
|
||||
return;
|
||||
}
|
||||
UString name = GetItemName(realIndex);
|
||||
UString name = GetItemRelPath(realIndex);
|
||||
CComboDialog comboDialog;
|
||||
comboDialog.Title = name + L" " + LangString(IDS_COMMENT, 0x03020290);
|
||||
comboDialog.Value = comment;
|
||||
|
||||
@@ -29,9 +29,17 @@ int CALLBACK CompareItems2(LPARAM lParam1, LPARAM lParam2, LPARAM lpData)
|
||||
// if (panel->_sortIndex == 0)
|
||||
case kpidName:
|
||||
{
|
||||
UString &name1 = panel->GetItemName(lParam1);
|
||||
UString &name2 = panel->GetItemName(lParam2);
|
||||
return name1.CompareNoCase(name2);
|
||||
const UString &name1 = panel->GetItemName(lParam1);
|
||||
const UString &name2 = panel->GetItemName(lParam2);
|
||||
int res = name1.CompareNoCase(name2);
|
||||
/*
|
||||
if (res != 0 || !panel->_flatMode)
|
||||
return res;
|
||||
const UString &prefix1 = panel->GetItemPrefix(lParam1);
|
||||
const UString &prefix2 = panel->GetItemPrefix(lParam2);
|
||||
return res = prefix1.CompareNoCase(prefix2);
|
||||
*/
|
||||
return res;
|
||||
}
|
||||
case kpidNoProperty:
|
||||
{
|
||||
@@ -39,8 +47,8 @@ int CALLBACK CompareItems2(LPARAM lParam1, LPARAM lParam2, LPARAM lpData)
|
||||
}
|
||||
case kpidExtension:
|
||||
{
|
||||
UString &ext1 = GetExtension(panel->GetItemName(lParam1));
|
||||
UString &ext2 = GetExtension(panel->GetItemName(lParam2));
|
||||
const UString &ext1 = GetExtension(panel->GetItemName(lParam1));
|
||||
const UString &ext2 = GetExtension(panel->GetItemName(lParam2));
|
||||
return ext1.CompareNoCase(ext2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ void CApp::Split()
|
||||
}
|
||||
const UString itemName = srcPanel.GetItemName(index);
|
||||
|
||||
UString srcPath = srcPanel._currentFolderPrefix;
|
||||
UString srcPath = srcPanel._currentFolderPrefix + srcPanel.GetItemPrefix(index);
|
||||
UString path = srcPath;
|
||||
int destPanelIndex = (NumPanels <= 1) ? srcPanelIndex : (1 - srcPanelIndex);
|
||||
CPanel &destPanel = Panels[destPanelIndex];
|
||||
@@ -212,7 +212,7 @@ void CApp::Split()
|
||||
if (destPanel.IsFSFolder())
|
||||
path = destPanel._currentFolderPrefix;
|
||||
CSplitDialog splitDialog;
|
||||
splitDialog.FilePath = itemName;
|
||||
splitDialog.FilePath = srcPanel.GetItemRelPath(index);
|
||||
splitDialog.Path = path;
|
||||
if (splitDialog.Create(srcPanel.GetParent()) == IDCANCEL)
|
||||
return;
|
||||
@@ -412,7 +412,7 @@ void CApp::Combine()
|
||||
}
|
||||
const UString itemName = srcPanel.GetItemName(index);
|
||||
|
||||
UString srcPath = srcPanel._currentFolderPrefix;
|
||||
UString srcPath = srcPanel._currentFolderPrefix + srcPanel.GetItemPrefix(index);
|
||||
UString path = srcPath;
|
||||
int destPanelIndex = (NumPanels <= 1) ? srcPanelIndex : (1 - srcPanelIndex);
|
||||
CPanel &destPanel = Panels[destPanelIndex];
|
||||
@@ -423,7 +423,7 @@ void CApp::Combine()
|
||||
copyDialog.Value = path;
|
||||
copyDialog.Title = LangString(IDS_COMBINE, 0x03020600);
|
||||
copyDialog.Title += ' ';
|
||||
copyDialog.Title += itemName;
|
||||
copyDialog.Title += srcPanel.GetItemRelPath(index);
|
||||
|
||||
copyDialog.Static = LangString(IDS_COMBINE_TO, 0x03020601);;
|
||||
if (copyDialog.Create(srcPanel.GetParent()) == IDCANCEL)
|
||||
|
||||
@@ -45,6 +45,7 @@ static CPropertyIDNamePair kPropertyIDNamePairs[] =
|
||||
{ kpidBlock, IDS_PROPERTY_BLOCK, 0x0200021B },
|
||||
{ kpidComment, IDS_PROPERTY_COMMENT, 0x0200021C },
|
||||
{ kpidPosition, IDS_PROPERTY_POSITION, 0x0200021D },
|
||||
{ kpidPrefix, IDS_PROPERTY_PREFIX, 0x0200021E },
|
||||
|
||||
{ kpidTotalSize, IDS_PROPERTY_TOTAL_SIZE, 0x03031100 },
|
||||
{ kpidFreeSpace, IDS_PROPERTY_FREE_SPACE, 0x03031101 },
|
||||
|
||||
@@ -25,3 +25,4 @@
|
||||
#define IDS_PROPERTY_BLOCK 27
|
||||
#define IDS_PROPERTY_COMMENT 28
|
||||
#define IDS_PROPERTY_POSITION 29
|
||||
#define IDS_PROPERTY_PREFIX 30
|
||||
|
||||
@@ -31,4 +31,5 @@ BEGIN
|
||||
IDS_PROPERTY_BLOCK "Block"
|
||||
IDS_PROPERTY_COMMENT "Comment"
|
||||
IDS_PROPERTY_POSITION "Position"
|
||||
IDS_PROPERTY_PREFIX "Path Prefix"
|
||||
END
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#define IDM_OPEN_PARENT_FOLDER 431
|
||||
#define IDM_FOLDERS_HISTORY 432
|
||||
#define IDM_VIEW_REFRESH 440
|
||||
#define IDM_VIEW_FLAT_VIEW 449
|
||||
#define IDM_VIEW_TWO_PANELS 450
|
||||
#define IDM_VIEW_TOOLBARS 451
|
||||
#define IDM_VIEW_STANDARD_TOOLBAR 460
|
||||
|
||||
@@ -67,6 +67,7 @@ BEGIN
|
||||
MENUITEM "Size\tCtrl+F6", IDM_VIEW_ARANGE_BY_SIZE
|
||||
MENUITEM "Unsorted\tCtrl+F7", IDM_VIEW_ARANGE_NO_SORT
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Flat View", IDM_VIEW_FLAT_VIEW
|
||||
MENUITEM "&2 Panels\tF9", IDM_VIEW_TWO_PANELS
|
||||
POPUP "Toolbars"
|
||||
BEGIN
|
||||
|
||||
Reference in New Issue
Block a user