mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-07 09:15:00 -06:00
18.05
This commit is contained in:
@@ -5,6 +5,13 @@
|
||||
<dependency>
|
||||
<dependentAssembly><assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/></dependentAssembly>
|
||||
</dependency>
|
||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"><application>
|
||||
<!-- Vista --> <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
|
||||
<!-- Win 7 --> <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
|
||||
<!-- Win 8 --> <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
|
||||
<!-- Win 8.1 --> <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
|
||||
<!-- Win 10 --> <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
|
||||
</application></compatibility>
|
||||
<asmv3:application>
|
||||
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
|
||||
<dpiAware>true</dpiAware>
|
||||
|
||||
@@ -52,22 +52,9 @@ static void AddValuePair(UString &s, UINT resourceID, UInt64 value, bool addColo
|
||||
|
||||
static void AddSizePair(UString &s, UINT resourceID, UInt64 value)
|
||||
{
|
||||
{
|
||||
wchar_t sz[32];
|
||||
AddLangString(s, resourceID);
|
||||
s += ": ";
|
||||
ConvertUInt64ToString(value, sz);
|
||||
s += MyFormatNew(IDS_FILE_SIZE, sz);
|
||||
}
|
||||
// s += sz;
|
||||
if (value >= (1 << 20))
|
||||
{
|
||||
char sz[32];
|
||||
ConvertUInt64ToString(value >> 20, sz);
|
||||
s += " (";
|
||||
s += sz;
|
||||
s += " MB)";
|
||||
}
|
||||
AddLangString(s, resourceID);
|
||||
s += ": ";
|
||||
AddSizeValue(s, value);
|
||||
s.Add_LF();
|
||||
}
|
||||
|
||||
@@ -86,16 +73,31 @@ public:
|
||||
UStringVector *ArchivePathsFull;
|
||||
const NWildcard::CCensorNode *WildcardCensor;
|
||||
const CExtractOptions *Options;
|
||||
|
||||
#ifndef _SFX
|
||||
CHashBundle *HashBundle;
|
||||
virtual void ProcessWasFinished_GuiVirt();
|
||||
#endif
|
||||
|
||||
CMyComPtr<IExtractCallbackUI> ExtractCallback;
|
||||
UString Title;
|
||||
|
||||
CPropNameValPairs Pairs;
|
||||
};
|
||||
|
||||
|
||||
#ifndef _SFX
|
||||
void CThreadExtracting::ProcessWasFinished_GuiVirt()
|
||||
{
|
||||
if (HashBundle && !Pairs.IsEmpty())
|
||||
ShowHashResults(Pairs, *this);
|
||||
}
|
||||
#endif
|
||||
|
||||
HRESULT CThreadExtracting::ProcessVirt()
|
||||
{
|
||||
CDecompressStat Stat;
|
||||
|
||||
#ifndef _SFX
|
||||
if (HashBundle)
|
||||
HashBundle->Init();
|
||||
@@ -109,16 +111,23 @@ HRESULT CThreadExtracting::ProcessVirt()
|
||||
HashBundle,
|
||||
#endif
|
||||
FinalMessage.ErrorMessage.Message, Stat);
|
||||
|
||||
#ifndef _SFX
|
||||
if (res == S_OK && Options->TestMode && ExtractCallbackSpec->IsOK())
|
||||
if (res == S_OK && ExtractCallbackSpec->IsOK())
|
||||
{
|
||||
UString s;
|
||||
|
||||
AddValuePair(s, IDS_ARCHIVES_COLON, Stat.NumArchives, false);
|
||||
AddSizePair(s, IDS_PROP_PACKED_SIZE, Stat.PackSize);
|
||||
|
||||
if (!HashBundle)
|
||||
if (HashBundle)
|
||||
{
|
||||
AddValuePair(Pairs, IDS_ARCHIVES_COLON, Stat.NumArchives);
|
||||
AddSizeValuePair(Pairs, IDS_PROP_PACKED_SIZE, Stat.PackSize);
|
||||
AddHashBundleRes(Pairs, *HashBundle, UString());
|
||||
}
|
||||
else if (Options->TestMode)
|
||||
{
|
||||
UString s;
|
||||
|
||||
AddValuePair(s, IDS_ARCHIVES_COLON, Stat.NumArchives, false);
|
||||
AddSizePair(s, IDS_PROP_PACKED_SIZE, Stat.PackSize);
|
||||
|
||||
if (Stat.NumFolders != 0)
|
||||
AddValuePair(s, IDS_PROP_FOLDERS, Stat.NumFolders);
|
||||
AddValuePair(s, IDS_PROP_FILES, Stat.NumFiles);
|
||||
@@ -129,24 +138,19 @@ HRESULT CThreadExtracting::ProcessVirt()
|
||||
AddValuePair(s, IDS_PROP_NUM_ALT_STREAMS, Stat.NumAltStreams);
|
||||
AddSizePair(s, IDS_PROP_ALT_STREAMS_SIZE, Stat.AltStreams_UnpackSize);
|
||||
}
|
||||
}
|
||||
|
||||
if (HashBundle)
|
||||
{
|
||||
s.Add_LF();
|
||||
AddHashBundleRes(s, *HashBundle, UString());
|
||||
AddLangString(s, IDS_MESSAGE_NO_ERRORS);
|
||||
FinalMessage.OkMessage.Title = Title;
|
||||
FinalMessage.OkMessage.Message = s;
|
||||
}
|
||||
|
||||
s.Add_LF();
|
||||
AddLangString(s, IDS_MESSAGE_NO_ERRORS);
|
||||
|
||||
FinalMessage.OkMessage.Title = Title;
|
||||
FinalMessage.OkMessage.Message = s;
|
||||
}
|
||||
#endif
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
||||
HRESULT ExtractGUI(
|
||||
CCodecs *codecs,
|
||||
const CObjectVector<COpenType> &formatIndices,
|
||||
@@ -252,11 +256,11 @@ HRESULT ExtractGUI(
|
||||
|
||||
extracter.Title = title;
|
||||
extracter.ExtractCallbackSpec = extractCallback;
|
||||
extracter.ExtractCallbackSpec->ProgressDialog = &extracter.ProgressDialog;
|
||||
extracter.ExtractCallbackSpec->ProgressDialog = &extracter;
|
||||
extracter.ExtractCallback = extractCallback;
|
||||
extracter.ExtractCallbackSpec->Init();
|
||||
|
||||
extracter.ProgressDialog.CompressingMode = false;
|
||||
extracter.CompressingMode = false;
|
||||
|
||||
extracter.ArchivePaths = &archivePaths;
|
||||
extracter.ArchivePathsFull = &archivePathsFull;
|
||||
@@ -266,10 +270,9 @@ HRESULT ExtractGUI(
|
||||
extracter.HashBundle = hb;
|
||||
#endif
|
||||
|
||||
extracter.ProgressDialog.IconID = IDI_ICON;
|
||||
extracter.IconID = IDI_ICON;
|
||||
|
||||
RINOK(extracter.Create(title, hwndParent));
|
||||
messageWasDisplayed = extracter.ThreadFinishedOK &
|
||||
extracter.ProgressDialog.MessagesDisplayed;
|
||||
messageWasDisplayed = extracter.ThreadFinishedOK && extracter.MessagesDisplayed;
|
||||
return extracter.Result;
|
||||
}
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
|
||||
#include <shlwapi.h>
|
||||
|
||||
#include "../../../../C/Alloc.h"
|
||||
|
||||
#include "../../../Common/MyInitGuid.h"
|
||||
|
||||
#include "../../../Common/CommandLineParser.h"
|
||||
@@ -16,9 +14,6 @@
|
||||
|
||||
#include "../../../Windows/FileDir.h"
|
||||
#include "../../../Windows/NtCheck.h"
|
||||
#ifdef _WIN32
|
||||
#include "../../../Windows/MemoryLock.h"
|
||||
#endif
|
||||
|
||||
#include "../Common/ArchiveCommandLine.h"
|
||||
#include "../Common/ExitCode.h"
|
||||
@@ -37,8 +32,6 @@ using namespace NWindows;
|
||||
|
||||
HINSTANCE g_hInstance;
|
||||
|
||||
bool g_LargePagesMode = false;
|
||||
|
||||
#ifndef UNDER_CE
|
||||
|
||||
DWORD g_ComCtl32Version;
|
||||
@@ -126,24 +119,6 @@ static int Main2()
|
||||
parser.Parse1(commandStrings, options);
|
||||
parser.Parse2(options);
|
||||
|
||||
#if defined(_WIN32) && !defined(UNDER_CE)
|
||||
NSecurity::EnablePrivilege_SymLink();
|
||||
#endif
|
||||
|
||||
#ifdef _7ZIP_LARGE_PAGES
|
||||
if (options.LargePages)
|
||||
{
|
||||
SetLargePageSize();
|
||||
// note: this process also can inherit that Privilege from parent process
|
||||
g_LargePagesMode =
|
||||
#if defined(_WIN32) && !defined(UNDER_CE)
|
||||
NSecurity::EnablePrivilege_LockMemory();
|
||||
#else
|
||||
true;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
CREATE_CODECS_OBJECT
|
||||
|
||||
codecs->CaseSensitiveChange = options.CaseSensitiveChange;
|
||||
@@ -403,7 +378,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */,
|
||||
{
|
||||
return ShowMemErrorMessage();
|
||||
}
|
||||
catch(const CArcCmdLineException &e)
|
||||
catch(const CMessagePathException &e)
|
||||
{
|
||||
ErrorMessage(e);
|
||||
return NExitCode::kUserError;
|
||||
|
||||
@@ -425,6 +425,14 @@ SOURCE=.\CompressDialog.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\FileManager\EditDialog.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\FileManager\EditDialog.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ExtractDialog.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -433,6 +441,14 @@ SOURCE=.\ExtractDialog.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\FileManager\ListViewDialog.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\FileManager\ListViewDialog.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\FileManager\OverwriteDialog.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -975,6 +991,14 @@ SOURCE=..\..\..\Windows\Control\Static.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\COM.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -1051,6 +1075,14 @@ SOURCE=..\..\..\Windows\FileSystem.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\MemoryGlobal.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\MemoryGlobal.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\MemoryLock.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "../FileManager/FormatUtils.h"
|
||||
#include "../FileManager/LangUtils.h"
|
||||
#include "../FileManager/ListViewDialog.h"
|
||||
#include "../FileManager/OverwriteDialogRes.h"
|
||||
#include "../FileManager/ProgressDialog2.h"
|
||||
#include "../FileManager/ProgressDialog2Res.h"
|
||||
@@ -19,13 +20,18 @@
|
||||
|
||||
using namespace NWindows;
|
||||
|
||||
|
||||
|
||||
class CHashCallbackGUI: public CProgressThreadVirt, public IHashCallbackUI
|
||||
{
|
||||
UInt64 NumFiles;
|
||||
bool _curIsFolder;
|
||||
UString FirstFileName;
|
||||
|
||||
CPropNameValPairs PropNameValPairs;
|
||||
|
||||
HRESULT ProcessVirt();
|
||||
virtual void ProcessWasFinished_GuiVirt();
|
||||
|
||||
public:
|
||||
const NWildcard::CCensor *censor;
|
||||
@@ -40,49 +46,62 @@ public:
|
||||
|
||||
void AddErrorMessage(DWORD systemError, const wchar_t *name)
|
||||
{
|
||||
ProgressDialog.Sync.AddError_Code_Name(systemError, name);
|
||||
Sync.AddError_Code_Name(systemError, name);
|
||||
}
|
||||
};
|
||||
|
||||
static void AddValuePair(UString &s, UINT resourceID, UInt64 value)
|
||||
|
||||
void AddValuePair(CPropNameValPairs &pairs, UINT resourceID, UInt64 value)
|
||||
{
|
||||
AddLangString(s, resourceID);
|
||||
s += ": ";
|
||||
CProperty &pair = pairs.AddNew();
|
||||
AddLangString(pair.Name, resourceID);
|
||||
char sz[32];
|
||||
ConvertUInt64ToString(value, sz);
|
||||
s += sz;
|
||||
s.Add_LF();
|
||||
pair.Value = sz;
|
||||
}
|
||||
|
||||
static void AddSizeValuePair(UString &s, UINT resourceID, UInt64 value)
|
||||
|
||||
void AddSizeValue(UString &s, UInt64 value)
|
||||
{
|
||||
AddLangString(s, resourceID);
|
||||
s += ": ";
|
||||
{
|
||||
wchar_t sz[32];
|
||||
ConvertUInt64ToString(value, sz);
|
||||
s += MyFormatNew(IDS_FILE_SIZE, sz);
|
||||
}
|
||||
if (value >= (1 << 10))
|
||||
{
|
||||
char c;
|
||||
if (value >= ((UInt64)10 << 30)) { value >>= 30; c = 'G'; }
|
||||
if (value >= (10 << 20)) { value >>= 20; c = 'M'; }
|
||||
else { value >>= 10; c = 'K'; }
|
||||
char sz[32];
|
||||
ConvertUInt64ToString(value >> 20, sz);
|
||||
ConvertUInt64ToString(value, sz);
|
||||
s += " (";
|
||||
s += sz;
|
||||
s += " MB)";
|
||||
s.Add_LF();
|
||||
s += " ";
|
||||
s += (wchar_t)c;
|
||||
s += "iB)";
|
||||
}
|
||||
}
|
||||
|
||||
void AddSizeValuePair(CPropNameValPairs &pairs, UINT resourceID, UInt64 value)
|
||||
{
|
||||
CProperty &pair = pairs.AddNew();
|
||||
LangString(resourceID, pair.Name);
|
||||
AddSizeValue(pair.Value, value);
|
||||
}
|
||||
|
||||
|
||||
HRESULT CHashCallbackGUI::StartScanning()
|
||||
{
|
||||
CProgressSync &sync = ProgressDialog.Sync;
|
||||
CProgressSync &sync = Sync;
|
||||
sync.Set_Status(LangString(IDS_SCANNING));
|
||||
return CheckBreak();
|
||||
}
|
||||
|
||||
HRESULT CHashCallbackGUI::ScanProgress(const CDirItemsStat &st, const FString &path, bool isDir)
|
||||
{
|
||||
return ProgressDialog.Sync.ScanProgress(st.NumFiles, st.GetTotalBytes(), path, isDir);
|
||||
return Sync.ScanProgress(st.NumFiles, st.GetTotalBytes(), path, isDir);
|
||||
}
|
||||
|
||||
HRESULT CHashCallbackGUI::ScanError(const FString &path, DWORD systemError)
|
||||
@@ -98,26 +117,26 @@ HRESULT CHashCallbackGUI::FinishScanning(const CDirItemsStat &st)
|
||||
|
||||
HRESULT CHashCallbackGUI::CheckBreak()
|
||||
{
|
||||
return ProgressDialog.Sync.CheckStop();
|
||||
return Sync.CheckStop();
|
||||
}
|
||||
|
||||
HRESULT CHashCallbackGUI::SetNumFiles(UInt64 numFiles)
|
||||
{
|
||||
CProgressSync &sync = ProgressDialog.Sync;
|
||||
CProgressSync &sync = Sync;
|
||||
sync.Set_NumFilesTotal(numFiles);
|
||||
return CheckBreak();
|
||||
}
|
||||
|
||||
HRESULT CHashCallbackGUI::SetTotal(UInt64 size)
|
||||
{
|
||||
CProgressSync &sync = ProgressDialog.Sync;
|
||||
CProgressSync &sync = Sync;
|
||||
sync.Set_NumBytesTotal(size);
|
||||
return CheckBreak();
|
||||
}
|
||||
|
||||
HRESULT CHashCallbackGUI::SetCompleted(const UInt64 *completed)
|
||||
{
|
||||
return ProgressDialog.Sync.Set_NumBytesCur(completed);
|
||||
return Sync.Set_NumBytesCur(completed);
|
||||
}
|
||||
|
||||
HRESULT CHashCallbackGUI::BeforeFirstFile(const CHashBundle & /* hb */)
|
||||
@@ -130,7 +149,7 @@ HRESULT CHashCallbackGUI::GetStream(const wchar_t *name, bool isFolder)
|
||||
if (NumFiles == 0)
|
||||
FirstFileName = name;
|
||||
_curIsFolder = isFolder;
|
||||
CProgressSync &sync = ProgressDialog.Sync;
|
||||
CProgressSync &sync = Sync;
|
||||
sync.Set_FilePath(name, isFolder);
|
||||
return CheckBreak();
|
||||
}
|
||||
@@ -147,49 +166,47 @@ HRESULT CHashCallbackGUI::OpenFileError(const FString &path, DWORD systemError)
|
||||
|
||||
HRESULT CHashCallbackGUI::SetOperationResult(UInt64 /* fileSize */, const CHashBundle & /* hb */, bool /* showHash */)
|
||||
{
|
||||
CProgressSync &sync = ProgressDialog.Sync;
|
||||
CProgressSync &sync = Sync;
|
||||
if (!_curIsFolder)
|
||||
NumFiles++;
|
||||
sync.Set_NumFilesCur(NumFiles);
|
||||
return CheckBreak();
|
||||
}
|
||||
|
||||
static void AddHashString(UString &s, const CHasherState &h, unsigned digestIndex, const wchar_t *title)
|
||||
static void AddHashString(CProperty &s, const CHasherState &h, unsigned digestIndex)
|
||||
{
|
||||
s += title;
|
||||
s.Add_Space();
|
||||
char temp[k_HashCalc_DigestSize_Max * 2 + 4];
|
||||
AddHashHexToString(temp, h.Digests[digestIndex], h.DigestSize);
|
||||
s += temp;
|
||||
s.Add_LF();
|
||||
s.Value = temp;
|
||||
}
|
||||
|
||||
static void AddHashResString(UString &s, const CHasherState &h, unsigned digestIndex, UInt32 resID)
|
||||
static void AddHashResString(CPropNameValPairs &s, const CHasherState &h, unsigned digestIndex, UInt32 resID)
|
||||
{
|
||||
UString s2 = LangString(resID);
|
||||
CProperty &pair = s.AddNew();
|
||||
UString &s2 = pair.Name;
|
||||
LangString(resID, s2);
|
||||
UString name (h.Name);
|
||||
s2.Replace(L"CRC", name);
|
||||
AddHashString(s, h, digestIndex, s2);
|
||||
s2.Replace(L":", L"");
|
||||
AddHashString(pair, h, digestIndex);
|
||||
}
|
||||
|
||||
void AddHashBundleRes(UString &s, const CHashBundle &hb, const UString &firstFileName)
|
||||
|
||||
void AddHashBundleRes(CPropNameValPairs &s, const CHashBundle &hb, const UString &firstFileName)
|
||||
{
|
||||
if (hb.NumErrors != 0)
|
||||
{
|
||||
AddValuePair(s, IDS_PROP_NUM_ERRORS, hb.NumErrors);
|
||||
s.Add_LF();
|
||||
}
|
||||
|
||||
if (hb.NumFiles == 1 && hb.NumDirs == 0 && !firstFileName.IsEmpty())
|
||||
{
|
||||
AddLangString(s, IDS_PROP_NAME);
|
||||
s += ": ";
|
||||
s += firstFileName;
|
||||
s.Add_LF();
|
||||
CProperty &pair = s.AddNew();
|
||||
LangString(IDS_PROP_NAME, pair.Name);
|
||||
pair.Value = firstFileName;
|
||||
}
|
||||
else
|
||||
{
|
||||
AddValuePair(s, IDS_PROP_FOLDERS, hb.NumDirs);
|
||||
if (hb.NumDirs != 0)
|
||||
AddValuePair(s, IDS_PROP_FOLDERS, hb.NumDirs);
|
||||
AddValuePair(s, IDS_PROP_FILES, hb.NumFiles);
|
||||
}
|
||||
|
||||
@@ -197,25 +214,18 @@ void AddHashBundleRes(UString &s, const CHashBundle &hb, const UString &firstFil
|
||||
|
||||
if (hb.NumAltStreams != 0)
|
||||
{
|
||||
s.Add_LF();
|
||||
AddValuePair(s, IDS_PROP_NUM_ALT_STREAMS, hb.NumAltStreams);
|
||||
AddSizeValuePair(s, IDS_PROP_ALT_STREAMS_SIZE, hb.AltStreamsSize);
|
||||
}
|
||||
|
||||
if (hb.NumErrors == 0 && hb.Hashers.IsEmpty())
|
||||
{
|
||||
s.Add_LF();
|
||||
AddLangString(s, IDS_MESSAGE_NO_ERRORS);
|
||||
}
|
||||
|
||||
FOR_VECTOR (i, hb.Hashers)
|
||||
{
|
||||
s.Add_LF();
|
||||
const CHasherState &h = hb.Hashers[i];
|
||||
if (hb.NumFiles == 1 && hb.NumDirs == 0)
|
||||
{
|
||||
s += h.Name;
|
||||
AddHashString(s, h, k_HashCalc_Index_DataSum, L":");
|
||||
CProperty &pair = s.AddNew();
|
||||
pair.Name += h.Name;
|
||||
AddHashString(pair, h, k_HashCalc_Index_DataSum);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -229,32 +239,55 @@ void AddHashBundleRes(UString &s, const CHashBundle &hb, const UString &firstFil
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void AddHashBundleRes(UString &s, const CHashBundle &hb, const UString &firstFileName)
|
||||
{
|
||||
CPropNameValPairs pairs;
|
||||
AddHashBundleRes(pairs, hb, firstFileName);
|
||||
|
||||
FOR_VECTOR (i, pairs)
|
||||
{
|
||||
const CProperty &pair = pairs[i];
|
||||
s += pair.Name;
|
||||
s += ": ";
|
||||
s += pair.Value;
|
||||
s.Add_LF();
|
||||
}
|
||||
|
||||
if (hb.NumErrors == 0 && hb.Hashers.IsEmpty())
|
||||
{
|
||||
s.Add_LF();
|
||||
AddLangString(s, IDS_MESSAGE_NO_ERRORS);
|
||||
s.Add_LF();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
HRESULT CHashCallbackGUI::AfterLastFile(const CHashBundle &hb)
|
||||
{
|
||||
UString s;
|
||||
AddHashBundleRes(s, hb, FirstFileName);
|
||||
AddHashBundleRes(PropNameValPairs, hb, FirstFileName);
|
||||
|
||||
CProgressSync &sync = ProgressDialog.Sync;
|
||||
CProgressSync &sync = Sync;
|
||||
sync.Set_NumFilesCur(hb.NumFiles);
|
||||
|
||||
CProgressMessageBoxPair &pair = GetMessagePair(hb.NumErrors != 0);
|
||||
pair.Message = s;
|
||||
LangString(IDS_CHECKSUM_INFORMATION, pair.Title);
|
||||
// CProgressMessageBoxPair &pair = GetMessagePair(hb.NumErrors != 0);
|
||||
// pair.Message = s;
|
||||
// LangString(IDS_CHECKSUM_INFORMATION, pair.Title);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
HRESULT CHashCallbackGUI::ProcessVirt()
|
||||
{
|
||||
NumFiles = 0;
|
||||
|
||||
AString errorInfo;
|
||||
HRESULT res = HashCalc(EXTERNAL_CODECS_LOC_VARS
|
||||
*censor, *options, errorInfo, this);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
HRESULT HashCalcGUI(
|
||||
DECL_EXTERNAL_CODECS_LOC_VARS
|
||||
const NWildcard::CCensor &censor,
|
||||
@@ -268,15 +301,49 @@ HRESULT HashCalcGUI(
|
||||
t.censor = &censor;
|
||||
t.options = &options;
|
||||
|
||||
t.ProgressDialog.ShowCompressionInfo = false;
|
||||
t.ShowCompressionInfo = false;
|
||||
|
||||
const UString title = LangString(IDS_CHECKSUM_CALCULATING);
|
||||
|
||||
t.ProgressDialog.MainTitle = "7-Zip"; // LangString(IDS_APP_TITLE);
|
||||
t.ProgressDialog.MainAddTitle = title;
|
||||
t.ProgressDialog.MainAddTitle.Add_Space();
|
||||
t.MainTitle = "7-Zip"; // LangString(IDS_APP_TITLE);
|
||||
t.MainAddTitle = title;
|
||||
t.MainAddTitle.Add_Space();
|
||||
|
||||
RINOK(t.Create(title));
|
||||
messageWasDisplayed = t.ThreadFinishedOK && t.ProgressDialog.MessagesDisplayed;
|
||||
messageWasDisplayed = t.ThreadFinishedOK && t.MessagesDisplayed;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
void ShowHashResults(const CPropNameValPairs &propPairs, HWND hwnd)
|
||||
{
|
||||
CListViewDialog lv;
|
||||
|
||||
FOR_VECTOR (i, propPairs)
|
||||
{
|
||||
const CProperty &pair = propPairs[i];
|
||||
lv.Strings.Add(pair.Name);
|
||||
lv.Values.Add(pair.Value);
|
||||
}
|
||||
|
||||
lv.Title = LangString(IDS_CHECKSUM_INFORMATION);
|
||||
lv.DeleteIsAllowed = true;
|
||||
lv.SelectFirst = false;
|
||||
lv.NumColumns = 2;
|
||||
|
||||
lv.Create(hwnd);
|
||||
}
|
||||
|
||||
|
||||
void ShowHashResults(const CHashBundle &hb, const UString &firstFileName, HWND hwnd)
|
||||
{
|
||||
CPropNameValPairs propPairs;
|
||||
AddHashBundleRes(propPairs, hb, firstFileName);
|
||||
ShowHashResults(propPairs, hwnd);
|
||||
}
|
||||
|
||||
|
||||
void CHashCallbackGUI::ProcessWasFinished_GuiVirt()
|
||||
{
|
||||
ShowHashResults(PropNameValPairs, *this);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#define __HASH_GUI_H
|
||||
|
||||
#include "../Common/HashCalc.h"
|
||||
#include "../Common/Property.h"
|
||||
|
||||
HRESULT HashCalcGUI(
|
||||
DECL_EXTERNAL_CODECS_LOC_VARS
|
||||
@@ -11,6 +12,16 @@ HRESULT HashCalcGUI(
|
||||
const CHashOptions &options,
|
||||
bool &messageWasDisplayed);
|
||||
|
||||
typedef CObjectVector<CProperty> CPropNameValPairs;
|
||||
|
||||
void AddValuePair(CPropNameValPairs &pairs, UINT resourceID, UInt64 value);
|
||||
void AddSizeValue(UString &s, UInt64 value);
|
||||
void AddSizeValuePair(CPropNameValPairs &pairs, UINT resourceID, UInt64 value);
|
||||
|
||||
void AddHashBundleRes(CPropNameValPairs &s, const CHashBundle &hb, const UString &firstFileName);
|
||||
void AddHashBundleRes(UString &s, const CHashBundle &hb, const UString &firstFileName);
|
||||
|
||||
void ShowHashResults(const CPropNameValPairs &propPairs, HWND hwnd);
|
||||
void ShowHashResults(const CHashBundle &hb, const UString &firstFileName, HWND hwnd);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -460,7 +460,7 @@ HRESULT UpdateGUI(
|
||||
tu.cmdArcPath = &cmdArcPath;
|
||||
|
||||
tu.UpdateCallbackGUI = callback;
|
||||
tu.UpdateCallbackGUI->ProgressDialog = &tu.ProgressDialog;
|
||||
tu.UpdateCallbackGUI->ProgressDialog = &tu;
|
||||
tu.UpdateCallbackGUI->Init();
|
||||
|
||||
UString title = LangString(IDS_PROGRESS_COMPRESSING);
|
||||
@@ -476,10 +476,10 @@ HRESULT UpdateGUI(
|
||||
|
||||
tu.WildcardCensor = &censor;
|
||||
tu.Options = &options;
|
||||
tu.ProgressDialog.IconID = IDI_ICON;
|
||||
tu.IconID = IDI_ICON;
|
||||
|
||||
RINOK(tu.Create(title, hwndParent));
|
||||
|
||||
messageWasDisplayed = tu.ThreadFinishedOK && tu.ProgressDialog.MessagesDisplayed;
|
||||
messageWasDisplayed = tu.ThreadFinishedOK && tu.MessagesDisplayed;
|
||||
return tu.Result;
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ COMMON_OBJS = \
|
||||
$O\Wildcard.obj \
|
||||
|
||||
WIN_OBJS = \
|
||||
$O\Clipboard.obj \
|
||||
$O\CommonDialog.obj \
|
||||
$O\DLL.obj \
|
||||
$O\ErrorMsg.obj \
|
||||
@@ -45,6 +46,7 @@ WIN_OBJS = \
|
||||
$O\FileLink.obj \
|
||||
$O\FileName.obj \
|
||||
$O\FileSystem.obj \
|
||||
$O\MemoryGlobal.obj \
|
||||
$O\MemoryLock.obj \
|
||||
$O\PropVariant.obj \
|
||||
$O\PropVariantConv.obj \
|
||||
@@ -102,10 +104,12 @@ AR_COMMON_OBJS = \
|
||||
$O\OutStreamWithCRC.obj \
|
||||
|
||||
FM_OBJS = \
|
||||
$O\EditDialog.obj \
|
||||
$O\ExtractCallback.obj \
|
||||
$O\FormatUtils.obj \
|
||||
$O\HelpUtils.obj \
|
||||
$O\LangUtils.obj \
|
||||
$O\ListViewDialog.obj \
|
||||
$O\OpenCallback.obj \
|
||||
$O\ProgramLocation.obj \
|
||||
$O\PropertyName.obj \
|
||||
|
||||
@@ -21,3 +21,5 @@ IDI_ICON ICON "FM.ico"
|
||||
#include "Extract.rc"
|
||||
#include "../FileManager/BrowseDialog.rc"
|
||||
#include "../FileManager/ComboDialog.rc"
|
||||
#include "../FileManager/EditDialog.rc"
|
||||
#include "../FileManager/ListViewDialog.rc"
|
||||
|
||||
Reference in New Issue
Block a user