Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pavlov <ipavlov@users.sourceforge.net>2007-05-25 04:00:00 +0400
committerKornel LesiƄski <kornel@geekhood.net>2016-05-28 02:15:51 +0300
commitc574fc0f4bba94e693b0e22f730d355b75d4f4ce (patch)
treeda4ebd90c776d508ac679d50492f29461db80be0 /CPP/7zip/UI/GUI
parenta145bfc7cf17f7bbcfae8f0064333c8ea75b455c (diff)
4.46 beta
Diffstat (limited to 'CPP/7zip/UI/GUI')
-rwxr-xr-xCPP/7zip/UI/GUI/CompressDialog.cpp6
-rwxr-xr-xCPP/7zip/UI/GUI/CompressDialog.h2
-rwxr-xr-xCPP/7zip/UI/GUI/ExtractDialog.cpp5
-rwxr-xr-xCPP/7zip/UI/GUI/ExtractGUI.cpp7
-rwxr-xr-xCPP/7zip/UI/GUI/GUI.cpp9
-rwxr-xr-xCPP/7zip/UI/GUI/GUI.dsp9
-rwxr-xr-xCPP/7zip/UI/GUI/Resource/BenchmarkDialog/BenchmarkDialog.cpp17
-rwxr-xr-xCPP/7zip/UI/GUI/Resource/BenchmarkDialog/BenchmarkDialog.h5
-rwxr-xr-xCPP/7zip/UI/GUI/UpdateGUI.cpp11
-rwxr-xr-xCPP/7zip/UI/GUI/makefile1
10 files changed, 46 insertions, 26 deletions
diff --git a/CPP/7zip/UI/GUI/CompressDialog.cpp b/CPP/7zip/UI/GUI/CompressDialog.cpp
index de182923..3591b14f 100755
--- a/CPP/7zip/UI/GUI/CompressDialog.cpp
+++ b/CPP/7zip/UI/GUI/CompressDialog.cpp
@@ -53,6 +53,7 @@ static CIDLangPair kIDLangPairs[] =
{ IDC_STATIC_COMPRESS_UPDATE_MODE, 0x02000D02 },
{ IDC_STATIC_COMPRESS_OPTIONS, 0x02000D07 },
{ IDC_COMPRESS_SFX, 0x02000D08 },
+ { IDC_COMPRESS_SHARED, 0x02000D16 },
{ IDC_COMPRESS_ENCRYPTION, 0x02000D10 },
{ IDC_STATIC_COMPRESS_PASSWORD1, 0x02000B01 },
@@ -194,7 +195,7 @@ static const CFormatInfo g_Formats[] =
},
{
L"GZip",
- (1 << 5) | (1 << 7) | (1 << 9),
+ (1 << 1) | (1 << 5) | (1 << 7) | (1 << 9),
g_GZipMethods, MY_SIZE_OF_ARRAY(g_GZipMethods),
false, false, false, false, false, false
},
@@ -301,6 +302,7 @@ bool CCompressDialog::OnInit()
SetItemText(IDC_COMPRESS_HARDWARE_THREADS, s);
CheckButton(IDC_COMPRESS_SFX, Info.SFXMode);
+ CheckButton(IDC_COMPRESS_SHARED, Info.OpenShareForWrite);
CheckControlsEnable();
@@ -539,6 +541,8 @@ void CCompressDialog::OnOK()
Info.EncryptionMethod = GetEncryptionMethodSpec();
Info.ArchiverInfoIndex = m_Format.GetCurSel();
Info.SFXMode = IsSFX();
+ Info.OpenShareForWrite = IsButtonCheckedBool(IDC_COMPRESS_SHARED);
+
m_RegistryInfo.EncryptHeaders = Info.EncryptHeaders = IsButtonCheckedBool(IDC_COMPRESS_CHECK_ENCRYPT_FILE_NAMES);
m_Params.GetText(Info.Options);
diff --git a/CPP/7zip/UI/GUI/CompressDialog.h b/CPP/7zip/UI/GUI/CompressDialog.h
index 1ff20cd0..cf479f0a 100755
--- a/CPP/7zip/UI/GUI/CompressDialog.h
+++ b/CPP/7zip/UI/GUI/CompressDialog.h
@@ -43,6 +43,8 @@ namespace NCompressDialog
UString EncryptionMethod;
bool SFXMode;
+ bool OpenShareForWrite;
+
UString ArchiveName; // in: Relative for ; out: abs
UString CurrentDirPrefix;
diff --git a/CPP/7zip/UI/GUI/ExtractDialog.cpp b/CPP/7zip/UI/GUI/ExtractDialog.cpp
index 55c871ad..3345b7df 100755
--- a/CPP/7zip/UI/GUI/ExtractDialog.cpp
+++ b/CPP/7zip/UI/GUI/ExtractDialog.cpp
@@ -36,6 +36,8 @@ static const int kPathModeButtons[] =
IDC_EXTRACT_RADIO_NO_PATHNAMES
};
+#ifndef _SFX
+
static const NExtract::NPathMode::EEnum kPathModeButtonsVals[] =
{
NExtract::NPathMode::kFullPathnames,
@@ -74,7 +76,6 @@ static const int kFilesButtons[] =
static const int kNumFilesButtons = sizeof(kFilesButtons) / sizeof(kFilesButtons[0]);
*/
-#ifndef _SFX
void CExtractDialog::GetPathMode()
{
for (int i = 0; i < kNumPathnamesButtons; i++)
@@ -169,7 +170,9 @@ static CIDLangPair kIDLangPairs[] =
// static const int kWildcardsButtonIndex = 2;
+#ifndef NO_REGISTRY
static const int kHistorySize = 8;
+#endif
bool CExtractDialog::OnInit()
{
diff --git a/CPP/7zip/UI/GUI/ExtractGUI.cpp b/CPP/7zip/UI/GUI/ExtractGUI.cpp
index 3edb1229..b73f9870 100755
--- a/CPP/7zip/UI/GUI/ExtractGUI.cpp
+++ b/CPP/7zip/UI/GUI/ExtractGUI.cpp
@@ -72,7 +72,7 @@ struct CThreadExtracting
ExtractCallbackSpec->ProgressDialog.MyClose();
return 0;
}
- static DWORD WINAPI MyThreadFunction(void *param)
+ static THREAD_FUNC_DECL MyThreadFunction(void *param)
{
return ((CThreadExtracting *)param)->Process();
}
@@ -154,9 +154,8 @@ HRESULT ExtractGUI(
extracter.Options = &options;
extracter.OpenCallback = openCallback;
- CThread thread;
- if (!thread.Create(CThreadExtracting::MyThreadFunction, &extracter))
- throw 271824;
+ NWindows::CThread thread;
+ RINOK(thread.Create(CThreadExtracting::MyThreadFunction, &extracter));
extracter.ExtractCallbackSpec->StartProgressDialog(title);
if (extracter.Result == S_OK && options.TestMode &&
extracter.ExtractCallbackSpec->Messages.IsEmpty() &&
diff --git a/CPP/7zip/UI/GUI/GUI.cpp b/CPP/7zip/UI/GUI/GUI.cpp
index ad58a451..2d401fc8 100755
--- a/CPP/7zip/UI/GUI/GUI.cpp
+++ b/CPP/7zip/UI/GUI/GUI.cpp
@@ -46,14 +46,13 @@ HINSTANCE g_hInstance;
bool g_IsNT = false;
#endif
-static const wchar_t *kExceptionErrorMessage = L"Error:";
-static const wchar_t *kUserBreak = L"Break signaled";
+// static const wchar_t *kExceptionErrorMessage = L"Error:";
+// static const wchar_t *kUserBreak = L"Break signaled";
static const wchar_t *kMemoryExceptionMessage = L"ERROR: Can't allocate required memory!";
static const wchar_t *kUnknownExceptionMessage = L"Unknown Error";
-static const wchar_t *kInternalExceptionMessage = L"Internal Error #";
-
-static const wchar_t *kIncorrectCommandMessage = L"Incorrect command";
+// static const wchar_t *kInternalExceptionMessage = L"Internal Error #";
+// static const wchar_t *kIncorrectCommandMessage = L"Incorrect command";
static void ErrorMessage(const wchar_t *message)
{
diff --git a/CPP/7zip/UI/GUI/GUI.dsp b/CPP/7zip/UI/GUI/GUI.dsp
index ccfe98ab..9586eebf 100755
--- a/CPP/7zip/UI/GUI/GUI.dsp
+++ b/CPP/7zip/UI/GUI/GUI.dsp
@@ -684,6 +684,15 @@ SOURCE=..\..\..\..\C\Alloc.c
SOURCE=..\..\..\..\C\Alloc.h
# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Threads.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Threads.h
+# End Source File
# End Group
# Begin Group "Common"
diff --git a/CPP/7zip/UI/GUI/Resource/BenchmarkDialog/BenchmarkDialog.cpp b/CPP/7zip/UI/GUI/Resource/BenchmarkDialog/BenchmarkDialog.cpp
index 15d6ee39..894faefb 100755
--- a/CPP/7zip/UI/GUI/Resource/BenchmarkDialog/BenchmarkDialog.cpp
+++ b/CPP/7zip/UI/GUI/Resource/BenchmarkDialog/BenchmarkDialog.cpp
@@ -76,8 +76,6 @@ static const UInt32 kMaxDicSize =
(1 << 27);
#endif
-static const int kDefaultDictionary = 22;
-
bool CBenchmarkDialog::OnInit()
{
#ifdef LANG
@@ -423,7 +421,7 @@ struct CThreadBenchmark
HRESULT Process();
HRESULT Result;
- static DWORD WINAPI MyThreadFunction(void *param)
+ static THREAD_FUNC_DECL MyThreadFunction(void *param)
{
((CThreadBenchmark *)param)->Result = ((CThreadBenchmark *)param)->Process();
return 0;
@@ -465,8 +463,9 @@ HRESULT CBenchCallback::SetDecodeResult(const CBenchInfo &info, bool final)
if (info2.NumIterations == 0)
info2.NumIterations = 1;
- info2.GlobalTime /= info2.NumIterations;
- info2.UserTime /= info2.NumIterations;
+ info2.UnpackSize *= info2.NumIterations;
+ info2.PackSize *= info2.NumIterations;
+ info2.NumIterations = 1;
if (final && SyncInfo->DecompressingInfo.GlobalTime == 0)
{
@@ -575,10 +574,8 @@ HRESULT Benchmark(
benchmarkDialog._syncInfo.NumThreads = numThreads;
benchmarker.SyncInfo = &benchmarkDialog._syncInfo;
- CThread thread;
- if (!thread.Create(CThreadBenchmark::MyThreadFunction, &benchmarker))
- return E_FAIL;
+ NWindows::CThread thread;
+ RINOK(thread.Create(CThreadBenchmark::MyThreadFunction, &benchmarker));
benchmarkDialog.Create(0);
- thread.Wait();
- return S_OK;
+ return thread.Wait();
}
diff --git a/CPP/7zip/UI/GUI/Resource/BenchmarkDialog/BenchmarkDialog.h b/CPP/7zip/UI/GUI/Resource/BenchmarkDialog/BenchmarkDialog.h
index 716d0f55..9474c5b8 100755
--- a/CPP/7zip/UI/GUI/Resource/BenchmarkDialog/BenchmarkDialog.h
+++ b/CPP/7zip/UI/GUI/Resource/BenchmarkDialog/BenchmarkDialog.h
@@ -39,6 +39,11 @@ public:
CBenchInfo2 DecompressingInfoTemp;
CBenchInfo2 DecompressingInfo;
+ CProgressSyncInfo()
+ {
+ if (_startEvent.Create() != S_OK)
+ throw 3986437;
+ }
void Init()
{
Changed = false;
diff --git a/CPP/7zip/UI/GUI/UpdateGUI.cpp b/CPP/7zip/UI/GUI/UpdateGUI.cpp
index 1150804e..b446b4c5 100755
--- a/CPP/7zip/UI/GUI/UpdateGUI.cpp
+++ b/CPP/7zip/UI/GUI/UpdateGUI.cpp
@@ -30,7 +30,7 @@
using namespace NWindows;
using namespace NFile;
-static const wchar_t *kIncorrectOutDir = L"Incorrect output directory path";
+// static const wchar_t *kIncorrectOutDir = L"Incorrect output directory path";
static const wchar_t *kDefaultSfxModule = L"7z.sfx";
static const wchar_t *kSFXExtension = L"exe";
@@ -76,7 +76,7 @@ struct CThreadUpdating
UpdateCallbackGUI->ProgressDialog.MyClose();
return 0;
}
- static DWORD WINAPI MyThreadFunction(void *param)
+ static THREAD_FUNC_DECL MyThreadFunction(void *param)
{
return ((CThreadUpdating *)param)->Process();
}
@@ -273,6 +273,7 @@ static HRESULT ShowDialog(
di.CurrentDirPrefix = currentDirPrefix;
di.SFXMode = options.SfxMode;
+ di.OpenShareForWrite = options.OpenShareForWrite;
if (callback->PasswordIsDefined)
di.Password = callback->Password;
@@ -334,6 +335,7 @@ static HRESULT ShowDialog(
di.EncryptHeadersIsAllowed, di.EncryptHeaders,
di.SFXMode);
+ options.OpenShareForWrite = di.OpenShareForWrite;
ParseAndAddPropertires(options.MethodMode.Properties, di.Options);
if (di.SFXMode)
@@ -388,9 +390,8 @@ HRESULT UpdateGUI(
tu.OpenCallback = openCallback;
tu.ErrorInfo = &errorInfo;
- CThread thread;
- if (!thread.Create(CThreadUpdating::MyThreadFunction, &tu))
- throw 271824;
+ NWindows::CThread thread;
+ RINOK(thread.Create(CThreadUpdating::MyThreadFunction, &tu))
tu.UpdateCallbackGUI->StartProgressDialog(LangString(IDS_PROGRESS_COMPRESSING, 0x02000DC0));
return tu.Result;
}
diff --git a/CPP/7zip/UI/GUI/makefile b/CPP/7zip/UI/GUI/makefile
index cac56df0..cd1536fe 100755
--- a/CPP/7zip/UI/GUI/makefile
+++ b/CPP/7zip/UI/GUI/makefile
@@ -100,6 +100,7 @@ FM_OBJS = \
C_OBJS = \
$O\Alloc.obj \
+ $O\Threads.obj \
!include "../../Crc2.mak"