CompressDialog.cpp (p7zip_15.14.1_src_all) | : | CompressDialog.cpp (p7zip_16.02_src_all) | ||
---|---|---|---|---|
skipping to change at line 714 | skipping to change at line 714 | |||
UString password2; | UString password2; | |||
_password2Control.GetText(password2); | _password2Control.GetText(password2); | |||
if (password2 != Info.Password) | if (password2 != Info.Password) | |||
{ | { | |||
ShowErrorMessageHwndRes(*this, IDS_PASSWORD_NOT_MATCH); | ShowErrorMessageHwndRes(*this, IDS_PASSWORD_NOT_MATCH); | |||
return; | return; | |||
} | } | |||
} | } | |||
SaveOptionsInMem(); | SaveOptionsInMem(); | |||
UString s; | ||||
if (!GetFinalPath_Smart(s)) | ||||
{ | { | |||
ShowErrorMessage(*this, k_IncorrectPathMessage); | UString s; | |||
return; | if (!GetFinalPath_Smart(s)) | |||
} | { | |||
ShowErrorMessage(*this, k_IncorrectPathMessage); | ||||
return; | ||||
} | ||||
m_RegistryInfo.ArcPaths.Clear(); | m_RegistryInfo.ArcPaths.Clear(); | |||
AddUniqueString(m_RegistryInfo.ArcPaths, s); | AddUniqueString(m_RegistryInfo.ArcPaths, s); | |||
Info.ArcPath = s; | Info.ArcPath = s; | |||
} | ||||
Info.UpdateMode = (NCompressDialog::NUpdateMode::EEnum)k_UpdateMode_Vals[m_Upd ateMode.GetCurSel()];; | Info.UpdateMode = (NCompressDialog::NUpdateMode::EEnum)k_UpdateMode_Vals[m_Upd ateMode.GetCurSel()];; | |||
Info.PathMode = (NWildcard::ECensorPathMode)k_PathMode_Vals[m_PathMode.GetCurS el()]; | Info.PathMode = (NWildcard::ECensorPathMode)k_PathMode_Vals[m_PathMode.GetCurS el()]; | |||
Info.Level = GetLevelSpec(); | Info.Level = GetLevelSpec(); | |||
Info.Dictionary = GetDictionarySpec(); | Info.Dictionary = GetDictionarySpec(); | |||
Info.Order = GetOrderSpec(); | Info.Order = GetOrderSpec(); | |||
Info.OrderMode = GetOrderMode(); | Info.OrderMode = GetOrderMode(); | |||
Info.NumThreads = GetNumThreadsSpec(); | Info.NumThreads = GetNumThreadsSpec(); | |||
skipping to change at line 1007 | skipping to change at line 1009 | |||
} | } | |||
if (comboBox.GetCount() > 0) | if (comboBox.GetCount() > 0) | |||
comboBox.SetCurSel(0); | comboBox.SetCurSel(0); | |||
} | } | |||
void CCompressDialog::SetLevel() | void CCompressDialog::SetLevel() | |||
{ | { | |||
m_Level.ResetContent(); | m_Level.ResetContent(); | |||
const CFormatInfo &fi = g_Formats[GetStaticFormatIndex()]; | const CFormatInfo &fi = g_Formats[GetStaticFormatIndex()]; | |||
const CArcInfoEx &ai = (*ArcFormats)[GetFormatIndex()]; | const CArcInfoEx &ai = (*ArcFormats)[GetFormatIndex()]; | |||
int index = FindRegistryFormat(ai.Name); | ||||
UInt32 level = 5; | UInt32 level = 5; | |||
if (index >= 0) | ||||
{ | { | |||
const NCompression::CFormatOptions &fo = m_RegistryInfo.Formats[index]; | int index = FindRegistryFormat(ai.Name); | |||
if (fo.Level <= 9) | if (index >= 0) | |||
level = fo.Level; | { | |||
else | const NCompression::CFormatOptions &fo = m_RegistryInfo.Formats[index]; | |||
level = 9; | if (fo.Level <= 9) | |||
level = fo.Level; | ||||
else | ||||
level = 9; | ||||
} | ||||
} | } | |||
for (unsigned i = 0; i <= 9; i++) | for (unsigned i = 0; i <= 9; i++) | |||
{ | { | |||
if ((fi.LevelsMask & (1 << i)) != 0) | if ((fi.LevelsMask & (1 << i)) != 0) | |||
{ | { | |||
UInt32 langID = g_Levels[i]; | UInt32 langID = g_Levels[i]; | |||
int index = (int)m_Level.AddString(LangString(langID)); | int index = (int)m_Level.AddString(LangString(langID)); | |||
m_Level.SetItemData(index, i); | m_Level.SetItemData(index, i); | |||
} | } | |||
skipping to change at line 1469 | skipping to change at line 1473 | |||
if (level == 0) | if (level == 0) | |||
return; | return; | |||
UInt32 dict = GetDictionarySpec(); | UInt32 dict = GetDictionarySpec(); | |||
if (dict == (UInt32)(Int32)-1) | if (dict == (UInt32)(Int32)-1) | |||
dict = 1; | dict = 1; | |||
UInt32 defaultBlockSize = (UInt32)(Int32)-1; | UInt32 defaultBlockSize = (UInt32)(Int32)-1; | |||
const CArcInfoEx &ai = (*ArcFormats)[GetFormatIndex()]; | const CArcInfoEx &ai = (*ArcFormats)[GetFormatIndex()]; | |||
int index = FindRegistryFormat(ai.Name); | ||||
if (index >= 0) | ||||
{ | { | |||
const NCompression::CFormatOptions &fo = m_RegistryInfo.Formats[index]; | int index = FindRegistryFormat(ai.Name); | |||
if (fo.Method.IsEqualTo_NoCase(GetMethodSpec())) | if (index >= 0) | |||
defaultBlockSize = fo.BlockLogSize; | { | |||
const NCompression::CFormatOptions &fo = m_RegistryInfo.Formats[index]; | ||||
if (fo.Method.IsEqualTo_NoCase(GetMethodSpec())) | ||||
defaultBlockSize = fo.BlockLogSize; | ||||
} | ||||
} | ||||
{ | ||||
int index = (int)m_Solid.AddString(LangString(IDS_COMPRESS_NON_SOLID)); | ||||
m_Solid.SetItemData(index, (UInt32)kNoSolidBlockSize); | ||||
m_Solid.SetCurSel(0); | ||||
} | } | |||
index = (int)m_Solid.AddString(LangString(IDS_COMPRESS_NON_SOLID)); | bool needSet = (defaultBlockSize == (UInt32)(Int32)-1); | |||
m_Solid.SetItemData(index, (UInt32)kNoSolidBlockSize); | ||||
m_Solid.SetCurSel(0); | ||||
bool needSet = defaultBlockSize == (UInt32)(Int32)-1; | ||||
for (unsigned i = 20; i <= 36; i++) | for (unsigned i = 20; i <= 36; i++) | |||
{ | { | |||
if (needSet && dict >= (((UInt64)1 << (i - 7))) && i <= 32) | if (needSet && dict >= (((UInt64)1 << (i - 7))) && i <= 32) | |||
defaultBlockSize = i; | defaultBlockSize = i; | |||
TCHAR s[40]; | TCHAR s[40]; | |||
ConvertUInt32ToString(1 << (i % 10), s); | ConvertUInt32ToString(1 << (i % 10), s); | |||
if (i < 30) lstrcat(s, TEXT(" M")); | if (i < 30) lstrcat(s, TEXT(" M")); | |||
else lstrcat(s, TEXT(" G")); | else lstrcat(s, TEXT(" G")); | |||
lstrcat(s, TEXT("B")); | lstrcat(s, TEXT("B")); | |||
int index = (int)m_Solid.AddString(s); | int index = (int)m_Solid.AddString(s); | |||
m_Solid.SetItemData(index, (UInt32)i); | m_Solid.SetItemData(index, (UInt32)i); | |||
} | } | |||
index = (int)m_Solid.AddString(LangString(IDS_COMPRESS_SOLID)); | { | |||
m_Solid.SetItemData(index, kSolidBlockSize); | int index = (int)m_Solid.AddString(LangString(IDS_COMPRESS_SOLID)); | |||
m_Solid.SetItemData(index, kSolidBlockSize); | ||||
} | ||||
if (defaultBlockSize == (UInt32)(Int32)-1) | if (defaultBlockSize == (UInt32)(Int32)-1) | |||
defaultBlockSize = kSolidBlockSize; | defaultBlockSize = kSolidBlockSize; | |||
if (defaultBlockSize != kNoSolidBlockSize) | if (defaultBlockSize != kNoSolidBlockSize) | |||
SetNearestSelectComboBox(m_Solid, defaultBlockSize); | SetNearestSelectComboBox(m_Solid, defaultBlockSize); | |||
} | } | |||
void CCompressDialog::SetNumThreads() | void CCompressDialog::SetNumThreads() | |||
{ | { | |||
m_NumThreads.ResetContent(); | m_NumThreads.ResetContent(); | |||
const CFormatInfo &fi = g_Formats[GetStaticFormatIndex()]; | const CFormatInfo &fi = g_Formats[GetStaticFormatIndex()]; | |||
if (!fi.MultiThread) | if (!fi.MultiThread) | |||
return; | return; | |||
UInt32 numHardwareThreads = NSystem::GetNumberOfProcessors(); | UInt32 numHardwareThreads = NSystem::GetNumberOfProcessors(); | |||
UInt32 defaultValue = numHardwareThreads; | UInt32 defaultValue = numHardwareThreads; | |||
const CArcInfoEx &ai = (*ArcFormats)[GetFormatIndex()]; | ||||
int index = FindRegistryFormat(ai.Name); | ||||
if (index >= 0) | ||||
{ | { | |||
const NCompression::CFormatOptions &fo = m_RegistryInfo.Formats[index]; | const CArcInfoEx &ai = (*ArcFormats)[GetFormatIndex()]; | |||
if (fo.Method.IsEqualTo_NoCase(GetMethodSpec()) && fo.NumThreads != (UInt32) | int index = FindRegistryFormat(ai.Name); | |||
(Int32)-1) | if (index >= 0) | |||
defaultValue = fo.NumThreads; | { | |||
const NCompression::CFormatOptions &fo = m_RegistryInfo.Formats[index]; | ||||
if (fo.Method.IsEqualTo_NoCase(GetMethodSpec()) && fo.NumThreads != (UInt3 | ||||
2)(Int32)-1) | ||||
defaultValue = fo.NumThreads; | ||||
} | ||||
} | } | |||
UInt32 numAlgoThreadsMax = 1; | UInt32 numAlgoThreadsMax = 1; | |||
int methodID = GetMethodID(); | int methodID = GetMethodID(); | |||
switch (methodID) | switch (methodID) | |||
{ | { | |||
case kLZMA: numAlgoThreadsMax = 2; break; | case kLZMA: numAlgoThreadsMax = 2; break; | |||
case kLZMA2: numAlgoThreadsMax = 32; break; | case kLZMA2: numAlgoThreadsMax = 32; break; | |||
case kBZip2: numAlgoThreadsMax = 32; break; | case kBZip2: numAlgoThreadsMax = 32; break; | |||
} | } | |||
End of changes. 12 change blocks. | ||||
33 lines changed or deleted | 47 lines changed or added |