diff options
Diffstat (limited to '')
-rw-r--r-- | CPP/7zip/UI/GUI/CompressDialog.cpp | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/CPP/7zip/UI/GUI/CompressDialog.cpp b/CPP/7zip/UI/GUI/CompressDialog.cpp index c2aee6c..fd53062 100644 --- a/CPP/7zip/UI/GUI/CompressDialog.cpp +++ b/CPP/7zip/UI/GUI/CompressDialog.cpp | |||
@@ -18,6 +18,7 @@ | |||
18 | #include "../FileManager/HelpUtils.h" | 18 | #include "../FileManager/HelpUtils.h" |
19 | #include "../FileManager/PropertyName.h" | 19 | #include "../FileManager/PropertyName.h" |
20 | #include "../FileManager/SplitUtils.h" | 20 | #include "../FileManager/SplitUtils.h" |
21 | #include "../FileManager/resourceGui.h" | ||
21 | 22 | ||
22 | #include "../Explorer/MyMessages.h" | 23 | #include "../Explorer/MyMessages.h" |
23 | 24 | ||
@@ -1015,41 +1016,34 @@ static bool IsAsciiString(const UString &s) | |||
1015 | 1016 | ||
1016 | static void AddSize_MB(UString &s, UInt64 size) | 1017 | static void AddSize_MB(UString &s, UInt64 size) |
1017 | { | 1018 | { |
1019 | s.Add_LF(); | ||
1018 | const UInt64 v2 = size + ((UInt32)1 << 20) - 1; | 1020 | const UInt64 v2 = size + ((UInt32)1 << 20) - 1; |
1019 | if (size <= v2) | 1021 | if (size < v2) |
1020 | size = v2; | 1022 | size = v2; |
1021 | s.Add_UInt64(size >> 20); | 1023 | s.Add_UInt64(size >> 20); |
1022 | s += " MB"; | 1024 | s += " MB : "; |
1023 | } | 1025 | } |
1024 | 1026 | ||
1027 | static void AddSize_MB_id(UString &s, UInt64 size, UInt32 id) | ||
1028 | { | ||
1029 | AddSize_MB(s, size); | ||
1030 | AddLangString(s, id); | ||
1031 | } | ||
1025 | 1032 | ||
1026 | void SetErrorMessage_MemUsage(UString &s, UInt64 reqSize, UInt64 ramSize, UInt64 ramLimit, const UString &usageString); | 1033 | void SetErrorMessage_MemUsage(UString &s, UInt64 reqSize, UInt64 ramSize, UInt64 ramLimit, const UString &usageString); |
1027 | void SetErrorMessage_MemUsage(UString &s, UInt64 reqSize, UInt64 ramSize, UInt64 ramLimit, const UString &usageString) | 1034 | void SetErrorMessage_MemUsage(UString &s, UInt64 reqSize, UInt64 ramSize, UInt64 ramLimit, const UString &usageString) |
1028 | { | 1035 | { |
1029 | s += "The operation was blocked by 7-Zip"; | 1036 | AddLangString(s, IDS_MEM_OPERATION_BLOCKED); |
1030 | s.Add_LF(); | ||
1031 | s += "The operation can require big amount of RAM (memory):"; | ||
1032 | s.Add_LF(); | 1037 | s.Add_LF(); |
1038 | AddLangString(s, IDS_MEM_REQUIRES_BIG_MEM); | ||
1033 | s.Add_LF(); | 1039 | s.Add_LF(); |
1034 | AddSize_MB(s, reqSize); | 1040 | AddSize_MB(s, reqSize); |
1035 | 1041 | s += usageString; | |
1036 | if (!usageString.IsEmpty()) | 1042 | AddSize_MB_id(s, ramSize, IDS_MEM_RAM_SIZE); |
1037 | { | ||
1038 | s += " : "; | ||
1039 | s += usageString; | ||
1040 | } | ||
1041 | |||
1042 | s.Add_LF(); | ||
1043 | AddSize_MB(s, ramSize); | ||
1044 | s += " : RAM"; | ||
1045 | |||
1046 | // if (ramLimit != 0) | 1043 | // if (ramLimit != 0) |
1047 | { | 1044 | { |
1048 | s.Add_LF(); | 1045 | AddSize_MB_id(s, ramLimit, IDS_MEM_USAGE_LIMIT_SET_BY_7ZIP); |
1049 | AddSize_MB(s, ramLimit); | ||
1050 | s += " : 7-Zip limit"; | ||
1051 | } | 1046 | } |
1052 | |||
1053 | s.Add_LF(); | 1047 | s.Add_LF(); |
1054 | s.Add_LF(); | 1048 | s.Add_LF(); |
1055 | AddLangString(s, IDS_MEM_ERROR); | 1049 | AddLangString(s, IDS_MEM_ERROR); |
@@ -1095,10 +1089,16 @@ void CCompressDialog::OnOK() | |||
1095 | const UInt64 limit = Get_MemUse_Bytes(); | 1089 | const UInt64 limit = Get_MemUse_Bytes(); |
1096 | if (memUsage > limit) | 1090 | if (memUsage > limit) |
1097 | { | 1091 | { |
1098 | UString s; | 1092 | UString s2; |
1099 | UString s2 = LangString(IDT_COMPRESS_MEMORY); | 1093 | LangString_OnlyFromLangFile(IDS_MEM_REQUIRED_MEM_SIZE, s2); |
1100 | if (s2.IsEmpty()) | 1094 | if (s2.IsEmpty()) |
1101 | GetItemText(IDT_COMPRESS_MEMORY, s2); | 1095 | { |
1096 | s2 = LangString(IDT_COMPRESS_MEMORY); | ||
1097 | if (s2.IsEmpty()) | ||
1098 | GetItemText(IDT_COMPRESS_MEMORY, s2); | ||
1099 | s2.RemoveChar(L':'); | ||
1100 | } | ||
1101 | UString s; | ||
1102 | SetErrorMessage_MemUsage(s, memUsage, _ramSize, limit, s2); | 1102 | SetErrorMessage_MemUsage(s, memUsage, _ramSize, limit, s2); |
1103 | MessageBoxError(s); | 1103 | MessageBoxError(s); |
1104 | return; | 1104 | return; |
@@ -1823,8 +1823,8 @@ static int Combo_AddDict2(NWindows::NControl::CComboBox &cb, size_t sizeReal, si | |||
1823 | s.Add_UInt64(sizeShow >> moveBits); | 1823 | s.Add_UInt64(sizeShow >> moveBits); |
1824 | s.Add_Space(); | 1824 | s.Add_Space(); |
1825 | if (c != 0) | 1825 | if (c != 0) |
1826 | s += c; | 1826 | s.Add_Char(c); |
1827 | s += 'B'; | 1827 | s.Add_Char('B'); |
1828 | if (sizeReal == k_Auto_Dict) | 1828 | if (sizeReal == k_Auto_Dict) |
1829 | Modify_Auto(s); | 1829 | Modify_Auto(s); |
1830 | const int index = (int)ComboBox_AddStringAscii(cb, s); | 1830 | const int index = (int)ComboBox_AddStringAscii(cb, s); |
@@ -2394,8 +2394,8 @@ static void Add_Size(AString &s, UInt64 val) | |||
2394 | s.Add_UInt64(val >> moveBits); | 2394 | s.Add_UInt64(val >> moveBits); |
2395 | s.Add_Space(); | 2395 | s.Add_Space(); |
2396 | if (moveBits != 0) | 2396 | if (moveBits != 0) |
2397 | s += c; | 2397 | s.Add_Char(c); |
2398 | s += 'B'; | 2398 | s.Add_Char('B'); |
2399 | } | 2399 | } |
2400 | 2400 | ||
2401 | 2401 | ||
@@ -2714,8 +2714,8 @@ static void AddMemSize(UString &res, UInt64 size) | |||
2714 | res.Add_UInt64(size >> moveBits); | 2714 | res.Add_UInt64(size >> moveBits); |
2715 | res.Add_Space(); | 2715 | res.Add_Space(); |
2716 | if (moveBits != 0) | 2716 | if (moveBits != 0) |
2717 | res += c; | 2717 | res.Add_Char(c); |
2718 | res += 'B'; | 2718 | res.Add_Char('B'); |
2719 | } | 2719 | } |
2720 | 2720 | ||
2721 | 2721 | ||
@@ -2727,7 +2727,7 @@ int CCompressDialog::AddMemComboItem(UInt64 val, bool isPercent, bool isDefault) | |||
2727 | { | 2727 | { |
2728 | UString s; | 2728 | UString s; |
2729 | s.Add_UInt64(val); | 2729 | s.Add_UInt64(val); |
2730 | s += '%'; | 2730 | s.Add_Char('%'); |
2731 | if (isDefault) | 2731 | if (isDefault) |
2732 | sUser = k_Auto_Prefix; | 2732 | sUser = k_Auto_Prefix; |
2733 | else | 2733 | else |
@@ -3510,7 +3510,7 @@ void COptionsDialog::SetPrec() | |||
3510 | // defaultPrec = kTimePrec_Unix; | 3510 | // defaultPrec = kTimePrec_Unix; |
3511 | // flags = (UInt32)1 << kTimePrec_Unix; | 3511 | // flags = (UInt32)1 << kTimePrec_Unix; |
3512 | 3512 | ||
3513 | s += ":"; | 3513 | s.Add_Colon(); |
3514 | if (methodID >= 0 && (unsigned)methodID < Z7_ARRAY_SIZE(kMethodsNames)) | 3514 | if (methodID >= 0 && (unsigned)methodID < Z7_ARRAY_SIZE(kMethodsNames)) |
3515 | s += kMethodsNames[methodID]; | 3515 | s += kMethodsNames[methodID]; |
3516 | if (methodID == kPosix) | 3516 | if (methodID == kPosix) |