mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-07 11:14:58 -06:00
4.54 beta
This commit is contained in:
committed by
Kornel Lesiński
parent
051769bbc5
commit
b82f80647d
@@ -2,8 +2,7 @@
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include <initguid.h>
|
||||
|
||||
#include "Common/MyInitGuid.h"
|
||||
#include "Common/StringConvert.h"
|
||||
#include "Common/IntToString.h"
|
||||
|
||||
@@ -45,6 +44,7 @@ typedef UINT32 (WINAPI * CreateObjectFunc)(
|
||||
const GUID *interfaceID,
|
||||
void **outObject);
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifndef _UNICODE
|
||||
bool g_IsNT = false;
|
||||
static inline bool IsItWindowsNT()
|
||||
@@ -56,6 +56,7 @@ static inline bool IsItWindowsNT()
|
||||
return (versionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
void PrintString(const UString &s)
|
||||
{
|
||||
@@ -678,9 +679,11 @@ __cdecl
|
||||
#endif
|
||||
main(int argc, char* argv[])
|
||||
{
|
||||
#ifdef _WIN32
|
||||
#ifndef _UNICODE
|
||||
g_IsNT = IsItWindowsNT();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
PrintStringLn(kCopyrightString);
|
||||
|
||||
|
||||
@@ -262,13 +262,11 @@ static bool AddNameToCensor(NWildcard::CCensor &wildcardCensor,
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline UINT GetCurrentCodePage() { return AreFileApisANSI() ? CP_ACP : CP_OEMCP; }
|
||||
|
||||
static void AddToCensorFromListFile(NWildcard::CCensor &wildcardCensor,
|
||||
LPCWSTR fileName, bool include, NRecursedType::EEnum type, UINT codePage)
|
||||
{
|
||||
UStringVector names;
|
||||
if (!ReadNamesFromListFile(GetSystemString(fileName, GetCurrentCodePage()), names, codePage))
|
||||
if (!ReadNamesFromListFile(fileName, names, codePage))
|
||||
throw kIncorrectListFile;
|
||||
for (int i = 0; i < names.Size(); i++)
|
||||
if (!AddNameToCensor(wildcardCensor, names[i], include, type))
|
||||
|
||||
@@ -48,11 +48,7 @@ void CArchiveExtractCallback::Init(
|
||||
_extractCallback2 = extractCallback2;
|
||||
_compressProgress.Release();
|
||||
_extractCallback2.QueryInterface(IID_ICompressProgressInfo, &_compressProgress);
|
||||
if (!_localProgress)
|
||||
{
|
||||
LocalProgressSpec = new CLocalProgress();
|
||||
_localProgress = LocalProgressSpec;
|
||||
}
|
||||
|
||||
LocalProgressSpec->Init(extractCallback2, true);
|
||||
|
||||
_itemDefaultName = itemDefaultName;
|
||||
|
||||
@@ -98,7 +98,11 @@ public:
|
||||
WriteCreated(false),
|
||||
WriteAccessed(false),
|
||||
_multiArchives(false)
|
||||
{}
|
||||
{
|
||||
LocalProgressSpec = new CLocalProgress();
|
||||
_localProgress = LocalProgressSpec;
|
||||
}
|
||||
|
||||
CLocalProgress *LocalProgressSpec;
|
||||
CMyComPtr<ICompressProgressInfo> _localProgress;
|
||||
bool _ratioMode;
|
||||
|
||||
@@ -119,6 +119,7 @@ STDMETHODIMP COpenCallbackImp::GetStream(const wchar_t *name, IInStream **inStre
|
||||
inFile->OpenCallbackImp = this;
|
||||
inFile->OpenCallbackRef = this;
|
||||
FileNames.Add(name);
|
||||
TotalSize += _fileInfo.Size;
|
||||
return S_OK;
|
||||
COM_TRY_END
|
||||
}
|
||||
|
||||
@@ -75,6 +75,7 @@ private:
|
||||
public:
|
||||
UStringVector FileNames;
|
||||
IOpenCallbackUI *Callback;
|
||||
UInt64 TotalSize;
|
||||
|
||||
COpenCallbackImp(): Callback(NULL) {}
|
||||
void Init(const UString &folderPrefix, const UString &fileName)
|
||||
@@ -84,6 +85,7 @@ public:
|
||||
throw 1;
|
||||
FileNames.Clear();
|
||||
_subArchiveMode = false;
|
||||
TotalSize = 0;
|
||||
}
|
||||
int FindName(const UString &name);
|
||||
};
|
||||
|
||||
@@ -163,7 +163,8 @@ HRESULT DecompressArchives(
|
||||
archiveFileInfo.Size,
|
||||
archiveLink.GetDefaultItemName(),
|
||||
wildcardCensor, options, extractCallback, extractCallbackSpec, errorMessage));
|
||||
extractCallbackSpec->LocalProgressSpec->InSize += archiveFileInfo.Size;
|
||||
extractCallbackSpec->LocalProgressSpec->InSize += archiveFileInfo.Size +
|
||||
archiveLink.VolumesSize;
|
||||
extractCallbackSpec->LocalProgressSpec->OutSize = extractCallbackSpec->UnpackSize;
|
||||
if (!errorMessage.IsEmpty())
|
||||
return E_FAIL;
|
||||
|
||||
@@ -366,8 +366,10 @@ HRESULT MyOpenArchive(
|
||||
UString &defaultItemName0,
|
||||
UString &defaultItemName1,
|
||||
UStringVector &volumePaths,
|
||||
UInt64 &volumesSize,
|
||||
IOpenCallbackUI *openCallbackUI)
|
||||
{
|
||||
volumesSize = 0;
|
||||
COpenCallbackImp *openCallbackSpec = new COpenCallbackImp;
|
||||
CMyComPtr<IArchiveOpenCallback> openCallback = openCallbackSpec;
|
||||
openCallbackSpec->Callback = openCallbackUI;
|
||||
@@ -391,6 +393,7 @@ HRESULT MyOpenArchive(
|
||||
volumePaths.Add(prefix + name);
|
||||
for (int i = 0; i < openCallbackSpec->FileNames.Size(); i++)
|
||||
volumePaths.Add(prefix + openCallbackSpec->FileNames[i]);
|
||||
volumesSize = openCallbackSpec->TotalSize;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -435,6 +438,7 @@ HRESULT MyOpenArchive(CCodecs *codecs,
|
||||
&archiveLink.Archive0, &archiveLink.Archive1,
|
||||
archiveLink.DefaultItemName0, archiveLink.DefaultItemName1,
|
||||
archiveLink.VolumePaths,
|
||||
archiveLink.VolumesSize,
|
||||
openCallbackUI);
|
||||
archiveLink.IsOpen = (res == S_OK);
|
||||
return res;
|
||||
|
||||
@@ -69,6 +69,7 @@ HRESULT MyOpenArchive(
|
||||
UString &defaultItemName0,
|
||||
UString &defaultItemName1,
|
||||
UStringVector &volumePaths,
|
||||
UInt64 &volumesSize,
|
||||
IOpenCallbackUI *openCallbackUI);
|
||||
|
||||
struct CArchiveLink
|
||||
@@ -83,6 +84,8 @@ struct CArchiveLink
|
||||
|
||||
UStringVector VolumePaths;
|
||||
|
||||
UInt64 VolumesSize;
|
||||
|
||||
int GetNumLevels() const
|
||||
{
|
||||
int result = 0;
|
||||
@@ -97,7 +100,7 @@ struct CArchiveLink
|
||||
|
||||
bool IsOpen;
|
||||
|
||||
CArchiveLink(): IsOpen(false) {};
|
||||
CArchiveLink(): IsOpen(false), VolumesSize(0) {};
|
||||
|
||||
IInArchive *GetArchive() { return Archive1 != 0 ? Archive1: Archive0; }
|
||||
UString GetDefaultItemName() { return Archive1 != 0 ? DefaultItemName1: DefaultItemName0; }
|
||||
|
||||
@@ -7,12 +7,9 @@
|
||||
#include "Common/CommandLineParser.h"
|
||||
#include "Common/MyException.h"
|
||||
#include "Common/IntToString.h"
|
||||
#include "Common/ListFileUtils.h"
|
||||
#include "Common/StdInStream.h"
|
||||
#include "Common/StdOutStream.h"
|
||||
#include "Common/StringConvert.h"
|
||||
#include "Common/StringToInt.h"
|
||||
#include "Common/Wildcard.h"
|
||||
|
||||
#include "Windows/FileDir.h"
|
||||
#include "Windows/FileName.h"
|
||||
|
||||
@@ -371,14 +371,6 @@ SOURCE=..\..\..\Common\Random.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\StdInStream.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\StdInStream.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\StringConvert.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
@@ -17,16 +17,14 @@ EXPLORER_OBJS = \
|
||||
COMMON_OBJS = \
|
||||
$O\IntToString.obj \
|
||||
$O\Lang.obj \
|
||||
$O\ListFileUtils.obj \
|
||||
$O\MyString.obj \
|
||||
$O\MyVector.obj \
|
||||
$O\NewHandler.obj \
|
||||
$O\Random.obj \
|
||||
$O\StdInStream.obj \
|
||||
$O\MyString.obj \
|
||||
$O\StringConvert.obj \
|
||||
$O\StringToInt.obj \
|
||||
$O\TextConfig.obj \
|
||||
$O\UTFConvert.obj \
|
||||
$O\MyVector.obj \
|
||||
$O\Wildcard.obj \
|
||||
|
||||
WIN_OBJS = \
|
||||
|
||||
@@ -79,6 +79,10 @@ void CPlugin::ReadPluginPanelItem(PluginPanelItem &panelItem, UInt32 itemIndex)
|
||||
throw 272340;
|
||||
|
||||
CSysString oemString = UnicodeStringToMultiByte(propVariant.bstrVal, CP_OEMCP);
|
||||
const int kFileNameSizeMax = (int)(sizeof(panelItem.FindData.cFileName) / sizeof(panelItem.FindData.cFileName[0]) - 1);
|
||||
if (oemString.Length() > kFileNameSizeMax)
|
||||
oemString = oemString.Left(kFileNameSizeMax);
|
||||
|
||||
MyStringCopy(panelItem.FindData.cFileName, (const char *)oemString);
|
||||
panelItem.FindData.cAlternateFileName[0] = 0;
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "ExtractCallback.h"
|
||||
#include "ViewSettings.h"
|
||||
#include "RegistryUtils.h"
|
||||
#include "LangUtils.h"
|
||||
|
||||
using namespace NWindows;
|
||||
using namespace NFile;
|
||||
@@ -32,6 +33,7 @@ void CPanelCallbackImp::OnTab()
|
||||
{
|
||||
if (g_App.NumPanels != 1)
|
||||
_app->Panels[1 - _index].SetFocusToList();
|
||||
_app->RefreshTitle();
|
||||
}
|
||||
|
||||
void CPanelCallbackImp::SetFocusToPath(int index)
|
||||
@@ -40,26 +42,17 @@ void CPanelCallbackImp::SetFocusToPath(int index)
|
||||
if (g_App.NumPanels == 1)
|
||||
newPanelIndex = g_App.LastFocusedPanel;
|
||||
_app->Panels[newPanelIndex]._headerComboBox.SetFocus();
|
||||
_app->RefreshTitle();
|
||||
}
|
||||
|
||||
|
||||
void CPanelCallbackImp::OnCopy(bool move, bool copyToSame)
|
||||
{ _app->OnCopy(move, copyToSame, _index); }
|
||||
|
||||
void CPanelCallbackImp::OnSetSameFolder()
|
||||
{ _app->OnSetSameFolder(_index); }
|
||||
|
||||
void CPanelCallbackImp::OnSetSubFolder()
|
||||
{ _app->OnSetSubFolder(_index); }
|
||||
|
||||
void CPanelCallbackImp::PanelWasFocused()
|
||||
{ _app->SetFocusedPanel(_index); }
|
||||
|
||||
void CPanelCallbackImp::DragBegin()
|
||||
{ _app->DragBegin(_index); }
|
||||
|
||||
void CPanelCallbackImp::DragEnd()
|
||||
{ _app->DragEnd(); }
|
||||
void CPanelCallbackImp::OnCopy(bool move, bool copyToSame) { _app->OnCopy(move, copyToSame, _index); }
|
||||
void CPanelCallbackImp::OnSetSameFolder() { _app->OnSetSameFolder(_index); }
|
||||
void CPanelCallbackImp::OnSetSubFolder() { _app->OnSetSubFolder(_index); }
|
||||
void CPanelCallbackImp::PanelWasFocused() { _app->SetFocusedPanel(_index); _app->RefreshTitle(_index); }
|
||||
void CPanelCallbackImp::DragBegin() { _app->DragBegin(_index); }
|
||||
void CPanelCallbackImp::DragEnd() { _app->DragEnd(); }
|
||||
void CPanelCallbackImp::RefreshTitle(bool always) { _app->RefreshTitle(_index, always); }
|
||||
|
||||
void CApp::SetListSettings()
|
||||
{
|
||||
@@ -636,6 +629,7 @@ void CApp::OnCopy(bool move, bool copyToSame, int srcPanelIndex)
|
||||
}
|
||||
}
|
||||
|
||||
RefreshTitleAlways();
|
||||
if (copyToSame || move)
|
||||
{
|
||||
srcPanel.RefreshListCtrl(srcSelState);
|
||||
@@ -757,3 +751,22 @@ void CApp::OnNotify(int /* ctrlID */, LPNMHDR pnmh)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void CApp::RefreshTitle(bool always)
|
||||
{
|
||||
UString path = GetFocusedPanel()._currentFolderPrefix;
|
||||
if (path.IsEmpty())
|
||||
path += LangString(IDS_APP_TITLE, 0x03000000);
|
||||
if (!always && path == PrevTitle)
|
||||
return;
|
||||
PrevTitle = path;
|
||||
NWindows::MySetWindowText(_window, path);
|
||||
}
|
||||
|
||||
void CApp::RefreshTitle(int panelIndex, bool always)
|
||||
{
|
||||
if (panelIndex != GetFocusedPanelIndex())
|
||||
return;
|
||||
RefreshTitle(always);
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ public:
|
||||
virtual void PanelWasFocused();
|
||||
virtual void DragBegin();
|
||||
virtual void DragEnd();
|
||||
virtual void RefreshTitle(bool always);
|
||||
};
|
||||
|
||||
class CApp;
|
||||
@@ -216,6 +217,8 @@ public:
|
||||
{ GetFocusedPanel().CreateFile(); }
|
||||
|
||||
// Edit
|
||||
void EditCut()
|
||||
{ GetFocusedPanel().EditCut(); }
|
||||
void EditCopy()
|
||||
{ GetFocusedPanel().EditCopy(); }
|
||||
void EditPaste()
|
||||
@@ -327,6 +330,11 @@ public:
|
||||
{ GetFocusedPanel().TestArchives(); }
|
||||
|
||||
void OnNotify(int ctrlID, LPNMHDR pnmh);
|
||||
|
||||
UString PrevTitle;
|
||||
void RefreshTitle(bool always = false);
|
||||
void RefreshTitleAlways() { RefreshTitle(true); }
|
||||
void RefreshTitle(int panelIndex, bool always = false);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -759,6 +759,14 @@ SOURCE=..\..\..\Windows\Control\Window2.h
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\Clipboard.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\Clipboard.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\CommonDialog.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -999,14 +1007,6 @@ SOURCE=..\..\..\Common\Lang.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\ListFileUtils.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\ListFileUtils.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\MyCom.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -1043,22 +1043,6 @@ SOURCE=..\..\..\Common\Random.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\StdInStream.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\StdInStream.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\StdOutStream.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\StdOutStream.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\StringConvert.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
#include "FSFolder.h"
|
||||
|
||||
#include "Common/StringConvert.h"
|
||||
#include "Common/StdInStream.h"
|
||||
#include "Common/StdOutStream.h"
|
||||
#include "Common/UTFConvert.h"
|
||||
#include "Common/ComTry.h"
|
||||
|
||||
@@ -73,7 +71,7 @@ HRESULT CFSFolder::Init(const UString &path, IFolderFolder *parentFolder)
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT GetFolderSize(const UString &path, UInt64 &numFolders, UInt64 &numFiles, UInt64 &size, IProgress *progress)
|
||||
HRESULT GetFolderSize(const UString &path, UInt64 &numFolders, UInt64 &numFiles, UInt64 &size, IProgress *progress)
|
||||
{
|
||||
RINOK(progress->SetCompleted(NULL));
|
||||
numFiles = numFolders = size = 0;
|
||||
|
||||
@@ -113,6 +113,8 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
HRESULT GetFolderSize(const UString &path, UInt64 &numFolders, UInt64 &numFiles, UInt64 &size, IProgress *progress);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -469,6 +469,40 @@ STDMETHODIMP CFSFolder::MoveTo(
|
||||
STDMETHODIMP CFSFolder::CopyFrom(const wchar_t * /* fromFolderPath */,
|
||||
const wchar_t ** /* itemsPaths */, UInt32 /* numItems */, IProgress * /* progress */)
|
||||
{
|
||||
/*
|
||||
UInt64 numFolders, numFiles, totalSize;
|
||||
numFiles = numFolders = totalSize = 0;
|
||||
UInt32 i;
|
||||
for (i = 0; i < numItems; i++)
|
||||
{
|
||||
UString path = (UString)fromFolderPath + itemsPaths[i];
|
||||
|
||||
CFileInfoW fileInfo;
|
||||
if (!FindFile(path, fileInfo))
|
||||
return ::GetLastError();
|
||||
if (fileInfo.IsDirectory())
|
||||
{
|
||||
UInt64 subFolders, subFiles, subSize;
|
||||
RINOK(GetFolderSize(path + UString(L"\\") + fileInfo.Name, subFolders, subFiles, subSize, progress));
|
||||
numFolders += subFolders;
|
||||
numFolders++;
|
||||
numFiles += subFiles;
|
||||
totalSize += subSize;
|
||||
}
|
||||
else
|
||||
{
|
||||
numFiles++;
|
||||
totalSize += fileInfo.Size;
|
||||
}
|
||||
}
|
||||
RINOK(progress->SetTotal(totalSize));
|
||||
RINOK(callback->SetNumFiles(numFiles));
|
||||
for (i = 0; i < numItems; i++)
|
||||
{
|
||||
UString path = (UString)fromFolderPath + itemsPaths[i];
|
||||
}
|
||||
return S_OK;
|
||||
*/
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ void ReloadLang()
|
||||
if (GetProgramFolderPath(folderPath))
|
||||
langPath = folderPath + UString(L"Lang\\") + langPath;
|
||||
}
|
||||
g_Lang.Open(GetSystemString(langPath));
|
||||
g_Lang.Open(langPath);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ void LoadLangs(CObjectVector<CLangEx> &langs)
|
||||
if (fileInfo.Name.Right(kExtSize) != L".txt")
|
||||
continue;
|
||||
lang.ShortName = fileInfo.Name.Left(fileInfo.Name.Length() - kExtSize);
|
||||
if (lang.Lang.Open(GetSystemString(filePath)))
|
||||
if (lang.Lang.Open(filePath))
|
||||
langs.Add(lang);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include "Windows/Menu.h"
|
||||
#include "Windows/Error.h"
|
||||
#include "Windows/Clipboard.h"
|
||||
|
||||
#include "../../PropID.h"
|
||||
|
||||
@@ -30,6 +31,7 @@ extern void OptionsDialog(HWND hwndOwner, HINSTANCE hInstance);
|
||||
using namespace NWindows;
|
||||
|
||||
static const int kFileMenuIndex = 0;
|
||||
static const int kEditMenuIndex = 1;
|
||||
static const int kViewMenuIndex = 2;
|
||||
static const int kBookmarksMenuIndex = kViewMenuIndex + 1;
|
||||
|
||||
@@ -321,7 +323,16 @@ void OnMenuActivating(HWND /* hWnd */, HMENU hMenu, int position)
|
||||
}
|
||||
// CopyMenu(g_FileMenu, hMenu);
|
||||
g_App.GetFocusedPanel().CreateFileMenu(hMenu);
|
||||
|
||||
}
|
||||
else if (position == kEditMenuIndex)
|
||||
{
|
||||
/*
|
||||
CMenu menu;
|
||||
menu.Attach(hMenu);
|
||||
menu.EnableItem(IDM_EDIT_CUT, MF_ENABLED);
|
||||
menu.EnableItem(IDM_EDIT_COPY, MF_ENABLED);
|
||||
menu.EnableItem(IDM_EDIT_PASTE, IsClipboardFormatAvailableHDROP() ? MF_ENABLED : MF_GRAYED);
|
||||
*/
|
||||
}
|
||||
else if (position == kViewMenuIndex)
|
||||
{
|
||||
@@ -545,6 +556,9 @@ bool OnMenuCommand(HWND hWnd, int id)
|
||||
break;
|
||||
|
||||
// Edit
|
||||
case IDM_EDIT_CUT:
|
||||
g_App.EditCut();
|
||||
break;
|
||||
case IDM_EDIT_COPY:
|
||||
g_App.EditCopy();
|
||||
break;
|
||||
|
||||
@@ -891,6 +891,7 @@ void CPanel::TestArchives()
|
||||
_folder.QueryInterface(IID_IArchiveFolder, &archiveFolder);
|
||||
if (archiveFolder)
|
||||
{
|
||||
{
|
||||
CThreadTest extracter;
|
||||
|
||||
extracter.ArchiveFolder = archiveFolder;
|
||||
@@ -938,6 +939,8 @@ void CPanel::TestArchives()
|
||||
if (extracter.Result != S_OK && extracter.Result != E_ABORT)
|
||||
MessageBoxError(extracter.Result, L"Testing Error");
|
||||
}
|
||||
}
|
||||
RefreshTitleAlways();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,9 +32,8 @@ const int kToolbarStartID = 2000;
|
||||
|
||||
const int kParentIndex = -1;
|
||||
|
||||
class CPanelCallback
|
||||
struct CPanelCallback
|
||||
{
|
||||
public:
|
||||
virtual void OnTab() = 0;
|
||||
virtual void SetFocusToPath(int index) = 0;
|
||||
virtual void OnCopy(bool move, bool copyToSame) = 0;
|
||||
@@ -43,6 +42,7 @@ public:
|
||||
virtual void PanelWasFocused() = 0;
|
||||
virtual void DragBegin() = 0;
|
||||
virtual void DragEnd() = 0;
|
||||
virtual void RefreshTitle(bool always) = 0;
|
||||
};
|
||||
|
||||
void PanelCopyItems();
|
||||
@@ -378,6 +378,7 @@ public:
|
||||
|
||||
void InvokeSystemCommand(const char *command);
|
||||
void Properties();
|
||||
void EditCut();
|
||||
void EditCopy();
|
||||
void EditPaste();
|
||||
|
||||
@@ -499,13 +500,17 @@ public:
|
||||
HRESULT CopyFrom(const UString &folderPrefix, const UStringVector &filePaths,
|
||||
bool showErrorMessages, UStringVector *messages);
|
||||
|
||||
void CopyFrom(const UStringVector &filePaths);
|
||||
void CopyFromNoAsk(const UStringVector &filePaths);
|
||||
void CopyFromAsk(const UStringVector &filePaths);
|
||||
|
||||
// empty folderPath means create new Archive to path of first fileName.
|
||||
void DropObject(IDataObject * dataObject, const UString &folderPath);
|
||||
|
||||
// empty folderPath means create new Archive to path of first fileName.
|
||||
void CompressDropFiles(const UStringVector &fileNames, const UString &folderPath);
|
||||
|
||||
void RefreshTitle(bool always = false) { _panelCallback->RefreshTitle(always); }
|
||||
void RefreshTitleAlways() { RefreshTitle(true); }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -58,37 +58,42 @@ HRESULT CPanel::CopyTo(const CRecordVector<UInt32> &indices, const UString &fold
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
HRESULT res;
|
||||
{
|
||||
CThreadExtractInArchive2 extracter;
|
||||
|
||||
|
||||
extracter.ExtractCallbackSpec = new CExtractCallbackImp;
|
||||
extracter.ExtractCallback = extracter.ExtractCallbackSpec;
|
||||
extracter.ExtractCallbackSpec->ParentWindow = GetParent();
|
||||
extracter.ExtractCallbackSpec->ShowMessages = showErrorMessages;
|
||||
extracter.ExtractCallbackSpec->ProgressDialog.CompressingMode = false;
|
||||
|
||||
|
||||
UString title = moveMode ?
|
||||
LangString(IDS_MOVING, 0x03020206):
|
||||
LangString(IDS_COPYING, 0x03020205);
|
||||
UString progressWindowTitle = LangString(IDS_APP_TITLE, 0x03000000);
|
||||
|
||||
|
||||
extracter.ExtractCallbackSpec->ProgressDialog.MainWindow = GetParent();
|
||||
extracter.ExtractCallbackSpec->ProgressDialog.MainTitle = progressWindowTitle;
|
||||
extracter.ExtractCallbackSpec->ProgressDialog.MainAddTitle = title + L" ";
|
||||
|
||||
|
||||
extracter.ExtractCallbackSpec->OverwriteMode = NExtract::NOverwriteMode::kAskBefore;
|
||||
extracter.ExtractCallbackSpec->Init();
|
||||
extracter.Indices = indices;
|
||||
extracter.DestPath = folder;
|
||||
extracter.FolderOperations = folderOperations;
|
||||
extracter.MoveMode = moveMode;
|
||||
|
||||
|
||||
NWindows::CThread extractThread;
|
||||
RINOK(extractThread.Create(CThreadExtractInArchive2::MyThreadFunction, &extracter));
|
||||
extracter.ExtractCallbackSpec->StartProgressDialog(title);
|
||||
|
||||
|
||||
if (messages != 0)
|
||||
*messages = extracter.ExtractCallbackSpec->Messages;
|
||||
return extracter.Result;
|
||||
res = extracter.Result;
|
||||
}
|
||||
RefreshTitleAlways();
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -135,6 +140,8 @@ HRESULT CPanel::CopyFrom(const UString &folderPrefix, const UStringVector &fileP
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
HRESULT res;
|
||||
{
|
||||
CThreadUpdate updater;
|
||||
updater.UpdateCallbackSpec = new CUpdateCallback100Imp;
|
||||
updater.UpdateCallback = updater.UpdateCallbackSpec;
|
||||
@@ -164,20 +171,14 @@ HRESULT CPanel::CopyFrom(const UString &folderPrefix, const UStringVector &fileP
|
||||
if (messages != 0)
|
||||
*messages = updater.UpdateCallbackSpec->Messages;
|
||||
|
||||
return updater.Result;
|
||||
res = updater.Result;
|
||||
}
|
||||
RefreshTitleAlways();
|
||||
return res;
|
||||
}
|
||||
|
||||
void CPanel::CopyFrom(const UStringVector &filePaths)
|
||||
void CPanel::CopyFromNoAsk(const UStringVector &filePaths)
|
||||
{
|
||||
UString title = LangString(IDS_CONFIRM_FILE_COPY, 0x03020222);
|
||||
UString message = LangString(IDS_WANT_TO_COPY_FILES, 0x03020223);
|
||||
message += L"\n\'";
|
||||
message += _currentFolderPrefix;
|
||||
message += L"\' ?";
|
||||
int res = ::MessageBoxW(*(this), message, title, MB_YESNOCANCEL | MB_ICONQUESTION | MB_SYSTEMMODAL);
|
||||
if (res != IDYES)
|
||||
return;
|
||||
|
||||
CDisableTimerProcessing disableTimerProcessing(*this);
|
||||
|
||||
CSelectedState srcSelState;
|
||||
@@ -201,3 +202,17 @@ void CPanel::CopyFrom(const UStringVector &filePaths)
|
||||
SetFocusToList();
|
||||
}
|
||||
|
||||
void CPanel::CopyFromAsk(const UStringVector &filePaths)
|
||||
{
|
||||
UString title = LangString(IDS_CONFIRM_FILE_COPY, 0x03020222);
|
||||
UString message = LangString(IDS_WANT_TO_COPY_FILES, 0x03020223);
|
||||
message += L"\n\'";
|
||||
message += _currentFolderPrefix;
|
||||
message += L"\' ?";
|
||||
int res = ::MessageBoxW(*(this), message, title, MB_YESNOCANCEL | MB_ICONQUESTION | MB_SYSTEMMODAL);
|
||||
if (res != IDYES)
|
||||
return;
|
||||
|
||||
CopyFromNoAsk(filePaths);
|
||||
}
|
||||
|
||||
|
||||
@@ -290,6 +290,7 @@ void CApp::CalculateCrc()
|
||||
combiner.DirEnumerator.BasePrefix = srcPanel._currentFolderPrefix;
|
||||
combiner.DirEnumerator.FlatMode = GetFlatMode();
|
||||
|
||||
{
|
||||
CProgressDialog progressDialog;
|
||||
combiner.ProgressDialog = &progressDialog;
|
||||
combiner.ErrorCode = 0;
|
||||
@@ -362,4 +363,6 @@ void CApp::CalculateCrc()
|
||||
}
|
||||
srcPanel.MessageBoxInfo(s, LangString(IDS_CHECKSUM_INFORMATION, 0x03020720));
|
||||
}
|
||||
}
|
||||
RefreshTitleAlways();
|
||||
}
|
||||
|
||||
@@ -792,5 +792,5 @@ void CPanel::CompressDropFiles(const UStringVector &fileNames, const UString &fo
|
||||
);
|
||||
}
|
||||
else
|
||||
CopyFrom(fileNames);
|
||||
CopyFromAsk(fileNames);
|
||||
}
|
||||
|
||||
@@ -145,6 +145,7 @@ void CPanel::LoadFullPathAndShow()
|
||||
|
||||
// _headerComboBox.SendMessage(CB_RESETCONTENT, 0, 0);
|
||||
_headerComboBox.SetText(_currentFolderPrefix);
|
||||
RefreshTitle();
|
||||
|
||||
/*
|
||||
for (int i = 0; i < g_Folders.m_Strings.Size(); i++)
|
||||
|
||||
@@ -157,8 +157,25 @@ bool CPanel::OnKeyDown(LPNMLVKEYDOWN keyDownInfo, LRESULT &result)
|
||||
}
|
||||
case VK_INSERT:
|
||||
{
|
||||
OnInsert();
|
||||
return true;
|
||||
if (!alt)
|
||||
{
|
||||
if (ctrl && !shift)
|
||||
{
|
||||
EditCopy();
|
||||
return true;
|
||||
}
|
||||
if (shift && !ctrl)
|
||||
{
|
||||
EditPaste();
|
||||
return true;
|
||||
}
|
||||
if (!shift && !ctrl && _mySelectMode)
|
||||
{
|
||||
OnInsert();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
case VK_DOWN:
|
||||
{
|
||||
@@ -249,6 +266,27 @@ bool CPanel::OnKeyDown(LPNMLVKEYDOWN keyDownInfo, LRESULT &result)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
case 'X':
|
||||
if (ctrl)
|
||||
{
|
||||
EditCut();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
case 'C':
|
||||
if (ctrl)
|
||||
{
|
||||
EditCopy();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
case 'V':
|
||||
if (ctrl)
|
||||
{
|
||||
EditPaste();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
case 'N':
|
||||
if (ctrl)
|
||||
{
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "Windows/Menu.h"
|
||||
#include "Windows/COM.h"
|
||||
#include "Windows/PropVariant.h"
|
||||
#include "Windows/Clipboard.h"
|
||||
#include "../Common/PropIDUtils.h"
|
||||
#include "../../PropID.h"
|
||||
|
||||
@@ -27,6 +28,7 @@ static const UINT kSystemStartMenuID = kPluginMenuStartID + 100;
|
||||
|
||||
void CPanel::InvokeSystemCommand(const char *command)
|
||||
{
|
||||
NCOM::CComInitializer comInitializer;
|
||||
if (!IsFSFolder() && !IsFSDrivesFolder())
|
||||
return;
|
||||
CRecordVector<UInt32> operatedIndices;
|
||||
@@ -181,18 +183,51 @@ void CPanel::Properties()
|
||||
}
|
||||
}
|
||||
|
||||
// Copy and paste do not work, if you know why write me.
|
||||
void CPanel::EditCut()
|
||||
{
|
||||
// InvokeSystemCommand("cut");
|
||||
}
|
||||
|
||||
void CPanel::EditCopy()
|
||||
{
|
||||
NCOM::CComInitializer comInitializer;
|
||||
InvokeSystemCommand("copy");
|
||||
/*
|
||||
CMyComPtr<IGetFolderArchiveProperties> getFolderArchiveProperties;
|
||||
_folder.QueryInterface(IID_IGetFolderArchiveProperties, &getFolderArchiveProperties);
|
||||
if (!getFolderArchiveProperties)
|
||||
{
|
||||
InvokeSystemCommand("copy");
|
||||
return;
|
||||
}
|
||||
*/
|
||||
UString s;
|
||||
CRecordVector<UInt32> indices;
|
||||
GetSelectedItemsIndices(indices);
|
||||
for (int i = 0; i < indices.Size(); i++)
|
||||
{
|
||||
if (i > 0)
|
||||
s += L"\xD\n";
|
||||
s += GetItemName(indices[i]);
|
||||
}
|
||||
ClipboardSetText(_mainWindow, s);
|
||||
}
|
||||
|
||||
void CPanel::EditPaste()
|
||||
{
|
||||
NCOM::CComInitializer comInitializer;
|
||||
InvokeSystemCommand("paste");
|
||||
/*
|
||||
UStringVector names;
|
||||
ClipboardGetFileNames(names);
|
||||
CopyFromNoAsk(names);
|
||||
UString s;
|
||||
for (int i = 0; i < names.Size(); i++)
|
||||
{
|
||||
s += L" ";
|
||||
s += names[i];
|
||||
}
|
||||
|
||||
MessageBoxW(0, s, L"", 0);
|
||||
*/
|
||||
|
||||
// InvokeSystemCommand("paste");
|
||||
}
|
||||
|
||||
HRESULT CPanel::CreateShellContextMenu(
|
||||
|
||||
@@ -220,6 +220,7 @@ void CPanel::DeleteItemsInternal(CRecordVector<UInt32> &indices)
|
||||
if (::MessageBoxW(GetParent(), message, title, MB_OKCANCEL | MB_ICONQUESTION) != IDOK)
|
||||
return;
|
||||
|
||||
{
|
||||
CThreadDelete deleter;
|
||||
deleter.UpdateCallbackSpec = new CUpdateCallback100Imp;
|
||||
deleter.UpdateCallback = deleter.UpdateCallbackSpec;
|
||||
@@ -242,6 +243,8 @@ void CPanel::DeleteItemsInternal(CRecordVector<UInt32> &indices)
|
||||
HRESULT result = deleter.Result;
|
||||
if (result != S_OK)
|
||||
MessageBoxError(result, LangString(IDS_ERROR_DELETING, 0x03020217));
|
||||
}
|
||||
RefreshTitleAlways();
|
||||
}
|
||||
|
||||
BOOL CPanel::OnBeginLabelEdit(LV_DISPINFOW * lpnmh)
|
||||
@@ -319,6 +322,7 @@ void CPanel::CreateFolder()
|
||||
|
||||
// HRESULT result = folderOperations->CreateFolder(newName, 0);
|
||||
|
||||
{
|
||||
CThreadCreateFolder upd;
|
||||
upd.UpdateCallbackSpec = new CUpdateCallback100Imp;
|
||||
upd.UpdateCallback = upd.UpdateCallbackSpec;
|
||||
@@ -352,6 +356,8 @@ void CPanel::CreateFolder()
|
||||
state.SelectedNames.Clear();
|
||||
state.FocusedName = newName;
|
||||
state.SelectFocused = true;
|
||||
}
|
||||
RefreshTitleAlways();
|
||||
RefreshListCtrl(state);
|
||||
}
|
||||
|
||||
|
||||
@@ -259,6 +259,7 @@ void CApp::Split()
|
||||
CThreadSplit spliter;
|
||||
// spliter.Panel = this;
|
||||
|
||||
{
|
||||
CProgressDialog progressDialog;
|
||||
spliter.ProgressDialog = &progressDialog;
|
||||
|
||||
@@ -284,6 +285,9 @@ void CApp::Split()
|
||||
if (thread.Create(CThreadSplit::MyThreadFunction, &spliter) != S_OK)
|
||||
throw 271824;
|
||||
progressDialog.Create(title, _window);
|
||||
}
|
||||
RefreshTitleAlways();
|
||||
|
||||
|
||||
if (!spliter.Error.IsEmpty())
|
||||
srcPanel.MessageBoxMyError(spliter.Error);
|
||||
@@ -442,6 +446,7 @@ void CApp::Combine()
|
||||
CThreadCombine combiner;
|
||||
// combiner.Panel = this;
|
||||
|
||||
{
|
||||
CProgressDialog progressDialog;
|
||||
combiner.ProgressDialog = &progressDialog;
|
||||
|
||||
@@ -471,6 +476,8 @@ void CApp::Combine()
|
||||
if (thread.Create(CThreadCombine::MyThreadFunction, &combiner) != S_OK)
|
||||
throw 271824;
|
||||
progressDialog.Create(title, _window);
|
||||
}
|
||||
RefreshTitleAlways();
|
||||
|
||||
if (!combiner.Error.IsEmpty())
|
||||
srcPanel.MessageBoxMyError(combiner.Error);
|
||||
|
||||
@@ -70,20 +70,18 @@ COMMON_OBJS = \
|
||||
$O\CRC.obj \
|
||||
$O\IntToString.obj \
|
||||
$O\Lang.obj \
|
||||
$O\ListFileUtils.obj \
|
||||
$O\MyString.obj \
|
||||
$O\MyVector.obj \
|
||||
$O\NewHandler.obj \
|
||||
$O\Random.obj \
|
||||
$O\StdInStream.obj \
|
||||
$O\StdOutStream.obj \
|
||||
$O\MyString.obj \
|
||||
$O\StringConvert.obj \
|
||||
$O\StringToInt.obj \
|
||||
$O\TextConfig.obj \
|
||||
$O\UTFConvert.obj \
|
||||
$O\MyVector.obj \
|
||||
$O\Wildcard.obj \
|
||||
|
||||
WIN_OBJS = \
|
||||
$O\Clipboard.obj \
|
||||
$O\CommonDialog.obj \
|
||||
$O\DLL.obj \
|
||||
$O\Error.obj \
|
||||
|
||||
@@ -759,14 +759,6 @@ SOURCE=..\..\..\Common\NewHandler.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\StdInStream.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\StdInStream.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\StringConvert.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
@@ -4,10 +4,6 @@
|
||||
|
||||
#include "OpenCallbackGUI.h"
|
||||
|
||||
#include "Common/StdOutStream.h"
|
||||
#include "Common/StdInStream.h"
|
||||
#include "Common/StringConvert.h"
|
||||
|
||||
#ifndef _NO_CRYPTO
|
||||
#include "../FileManager/PasswordDialog.h"
|
||||
#endif
|
||||
|
||||
@@ -25,14 +25,13 @@ COMMON_OBJS = \
|
||||
$O\IntToString.obj \
|
||||
$O\Lang.obj \
|
||||
$O\ListFileUtils.obj \
|
||||
$O\NewHandler.obj \
|
||||
$O\StdInStream.obj \
|
||||
$O\MyString.obj \
|
||||
$O\MyVector.obj \
|
||||
$O\NewHandler.obj \
|
||||
$O\StringConvert.obj \
|
||||
$O\StringToInt.obj \
|
||||
$O\TextConfig.obj \
|
||||
$O\UTFConvert.obj \
|
||||
$O\MyVector.obj \
|
||||
$O\Wildcard.obj \
|
||||
|
||||
WIN_OBJS = \
|
||||
|
||||
Reference in New Issue
Block a user