diff options
author | Igor Pavlov <ipavlov@users.sourceforge.net> | 2008-08-13 04:00:00 +0400 |
---|---|---|
committer | Kornel LesiĆski <kornel@geekhood.net> | 2016-05-28 02:15:56 +0300 |
commit | 173c07e166fdf6fcd20f18ea73008f1b628945df (patch) | |
tree | 13ebea85cdc4c16ae93714ff0627ee9f91ad7e08 /CPP/7zip/UI/GUI/ExtractGUI.cpp | |
parent | 3901bf0ab88106a5b031cba7bc18d60cdebf7eef (diff) |
4.59 beta
Diffstat (limited to 'CPP/7zip/UI/GUI/ExtractGUI.cpp')
-rwxr-xr-x | CPP/7zip/UI/GUI/ExtractGUI.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/CPP/7zip/UI/GUI/ExtractGUI.cpp b/CPP/7zip/UI/GUI/ExtractGUI.cpp index 7936fa86..a03bd77a 100755 --- a/CPP/7zip/UI/GUI/ExtractGUI.cpp +++ b/CPP/7zip/UI/GUI/ExtractGUI.cpp @@ -21,7 +21,6 @@ #include "resource.h" #include "ExtractRes.h" -#include "OpenCallbackGUI.h" #include "ExtractDialog.h" using namespace NWindows; @@ -32,11 +31,12 @@ struct CThreadExtracting { CCodecs *codecs; CExtractCallbackImp *ExtractCallbackSpec; + CIntVector FormatIndices; + UStringVector *ArchivePaths; UStringVector *ArchivePathsFull; const NWildcard::CCensorNode *WildcardCensor; const CExtractOptions *Options; - COpenCallbackGUI *OpenCallback; CMyComPtr<IExtractCallbackUI> ExtractCallback; CDecompressStat Stat; UString ErrorMessage; @@ -48,20 +48,20 @@ struct CThreadExtracting try { Result = DecompressArchives( - codecs, + codecs, FormatIndices, *ArchivePaths, *ArchivePathsFull, - *WildcardCensor, *Options, OpenCallback, ExtractCallback, ErrorMessage, Stat); + *WildcardCensor, *Options, ExtractCallbackSpec, ExtractCallback, ErrorMessage, Stat); } catch(const UString &s) { ErrorMessage = s; Result = E_FAIL; - } + } catch(const wchar_t *s) { ErrorMessage = s; Result = E_FAIL; - } + } catch(const char *s) { ErrorMessage = GetUnicodeString(s); @@ -110,16 +110,17 @@ static void AddSizePair(UINT resourceID, UInt32 langID, UInt64 value, UString &s HRESULT ExtractGUI( CCodecs *codecs, - UStringVector &archivePaths, + const CIntVector &formatIndices, + UStringVector &archivePaths, UStringVector &archivePathsFull, const NWildcard::CCensorNode &wildcardCensor, CExtractOptions &options, bool showDialog, - COpenCallbackGUI *openCallback, CExtractCallbackImp *extractCallback) { CThreadExtracting extracter; extracter.codecs = codecs; + extracter.FormatIndices = formatIndices; if (!options.TestMode) { @@ -131,7 +132,7 @@ HRESULT ExtractGUI( CExtractDialog dialog; if (!NFile::NDirectory::MyGetFullPathName(outputDir, dialog.DirectoryPath)) { - MyMessageBox(kIncorrectOutDir); + ShowErrorMessage(kIncorrectOutDir); return E_FAIL; } NFile::NName::NormalizeDirPathPrefix(dialog.DirectoryPath); @@ -145,13 +146,13 @@ HRESULT ExtractGUI( options.OverwriteMode = dialog.OverwriteMode; options.PathMode = dialog.PathMode; #ifndef _SFX - openCallback->Password = dialog.Password; - openCallback->PasswordIsDefined = !dialog.Password.IsEmpty(); + extractCallback->Password = dialog.Password; + extractCallback->PasswordIsDefined = !dialog.Password.IsEmpty(); #endif } if (!NFile::NDirectory::MyGetFullPathName(outputDir, options.OutputDir)) { - MyMessageBox(kIncorrectOutDir); + ShowErrorMessage(kIncorrectOutDir); return E_FAIL; } NFile::NName::NormalizeDirPathPrefix(options.OutputDir); @@ -160,10 +161,10 @@ HRESULT ExtractGUI( if(!NFile::NDirectory::CreateComplexDirectory(options.OutputDir)) { UString s = GetUnicodeString(NError::MyFormatMessage(GetLastError())); - UString s2 = MyFormatNew(IDS_CANNOT_CREATE_FOLDER, - #ifdef LANG - 0x02000603, - #endif + UString s2 = MyFormatNew(IDS_CANNOT_CREATE_FOLDER, + #ifdef LANG + 0x02000603, + #endif options.OutputDir); MyMessageBox(s2 + UString(L"\n") + s); return E_FAIL; @@ -171,7 +172,7 @@ HRESULT ExtractGUI( */ } - UString title = LangStringSpec(options.TestMode ? IDS_PROGRESS_TESTING : IDS_PROGRESS_EXTRACTING, + UString title = LangStringSpec(options.TestMode ? IDS_PROGRESS_TESTING : IDS_PROGRESS_EXTRACTING, options.TestMode ? 0x02000F90: 0x02000890); extracter.ExtractCallbackSpec = extractCallback; @@ -182,12 +183,11 @@ HRESULT ExtractGUI( extracter.ArchivePathsFull = &archivePathsFull; extracter.WildcardCensor = &wildcardCensor; extracter.Options = &options; - extracter.OpenCallback = openCallback; NWindows::CThread thread; RINOK(thread.Create(CThreadExtracting::MyThreadFunction, &extracter)); extracter.ExtractCallbackSpec->StartProgressDialog(title); - if (extracter.Result == S_OK && options.TestMode && + if (extracter.Result == S_OK && options.TestMode && extracter.ExtractCallbackSpec->Messages.IsEmpty() && extracter.ExtractCallbackSpec->NumArchiveErrors == 0) { |