This commit is contained in:
Igor Pavlov
2015-09-22 00:00:00 +00:00
committed by Kornel Lesiński
parent cba375916f
commit f6444c3256
96 changed files with 7301 additions and 2409 deletions

View File

@@ -1465,6 +1465,9 @@ STDMETHODIMP CAgentFolder::Extract(const UInt32 *indices,
extractCallbackSpec->InitForMulti(false, pathMode, overwriteMode);
if (extractCallback2)
extractCallback2->SetTotal(_agentSpec->GetArc().GetEstmatedPhySize());
FString pathU;
if (path)
{

View File

@@ -251,7 +251,9 @@ public:
FOR_VECTOR (i, _archiveLink.Arcs)
{
const CArc &arc = _archiveLink.Arcs[i];
if (!g_CodecsObj->Formats[arc.FormatIndex].UpdateEnabled || arc.IsReadOnly)
if (arc.FormatIndex < 0
|| arc.IsReadOnly
|| !g_CodecsObj->Formats[arc.FormatIndex].UpdateEnabled)
return true;
}
return false;
@@ -274,9 +276,14 @@ public:
UString s2;
if (arc.ErrorInfo.ErrorFormatIndex >= 0)
{
s2.AddAscii("Can not open the file as [");
s2 += g_CodecsObj->Formats[arc.ErrorInfo.ErrorFormatIndex].Name;
s2.AddAscii("] archive");
if (arc.ErrorInfo.ErrorFormatIndex == arc.FormatIndex)
s2.AddAscii("Warning: The archive is open with offset");
else
{
s2.AddAscii("Can not open the file as [");
s2 += g_CodecsObj->GetFormatNamePtr(arc.ErrorInfo.ErrorFormatIndex);
s2.AddAscii("] archive");
}
}
if (!arc.ErrorInfo.ErrorMessage.IsEmpty())
@@ -288,6 +295,7 @@ public:
s2.AddAscii("]: ");
s2 += arc.ErrorInfo.ErrorMessage;
}
if (!s2.IsEmpty())
{
if (!s.IsEmpty())

View File

@@ -216,10 +216,9 @@ void CArchiveExtractCallback::Init(
// _progressTotal = 0;
// _progressTotal_Defined = false;
_progressTotal = _packTotal;
_progressTotal_Defined = true;
_packTotal = packSize;
_progressTotal = packSize;
_progressTotal_Defined = true;
_extractCallback2 = extractCallback2;
_compressProgress.Release();
@@ -962,7 +961,12 @@ if (askExtractMode == NArchive::NExtract::NAskMode::kExtract && !_testMode)
bool isAnti = false;
RINOK(_arc->IsItemAnti(index, isAnti));
Correct_FsPath(_pathMode == NExtract::NPathMode::kAbsPaths, pathParts, _item.MainIsDir);
#ifdef SUPPORT_ALT_STREAMS
if (!_item.IsAltStream
|| !pathParts.IsEmpty()
|| !(_removePartsForAltStreams || _pathMode == NExtract::NPathMode::kNoPathsAlt))
#endif
Correct_FsPath(_pathMode == NExtract::NPathMode::kAbsPaths, pathParts, _item.MainIsDir);
#ifdef SUPPORT_ALT_STREAMS
@@ -970,12 +974,18 @@ if (askExtractMode == NArchive::NExtract::NAskMode::kExtract && !_testMode)
{
UString s = _item.AltStreamName;
Correct_AltStream_Name(s);
bool needColon = ((!_removePartsForAltStreams && _pathMode != NExtract::NPathMode::kNoPathsAlt) || !pathParts.IsEmpty());
bool needColon = true;
if (pathParts.IsEmpty())
{
pathParts.AddNew();
if (_pathMode == NExtract::NPathMode::kAbsPaths &&
if (_removePartsForAltStreams || _pathMode == NExtract::NPathMode::kNoPathsAlt)
needColon = false;
}
else if (_pathMode == NExtract::NPathMode::kAbsPaths &&
NWildcard::GetNumPrefixParts_if_DrivePath(pathParts) == pathParts.Size())
pathParts.AddNew();
UString &name = pathParts.Back();
if (needColon)
name += (wchar_t)(_ntOptions.ReplaceColonForAltStream ? L'_' : L':');

View File

@@ -17,7 +17,9 @@ static void ReplaceIncorrectChars(UString &s)
if (
#ifdef _WIN32
c == ':' || c == '*' || c == '?' || c < 0x20 || c == '<' || c == '>' || c == '|' || c == '"'
|| c == '/' ||
|| c == '/'
|| c == 0x202E // RLO
||
#endif
c == WCHAR_PATH_SEPARATOR)
s.ReplaceOneCharAtPos(i, '_');
@@ -53,7 +55,9 @@ void Correct_AltStream_Name(UString &s)
for (unsigned i = 0; i < len; i++)
{
wchar_t c = s[i];
if (c == ':' || c == '\\' || c == '/')
if (c == ':' || c == '\\' || c == '/'
|| c == 0x202E // RLO
)
s.ReplaceOneCharAtPos(i, '_');
}
if (s.IsEmpty())

View File

@@ -299,6 +299,8 @@ public:
UInt64 AvailPhySize; // PhySize, but it's reduced if exceed end of file
// bool offsetDefined;
UInt64 GetEstmatedPhySize() const { return PhySizeDefined ? PhySize : FileSize; }
UInt64 ArcStreamOffset; // offset of stream that is open by Archive Handler
Int64 GetGlobalOffset() const { return ArcStreamOffset + Offset; } // it's global offset of archive

View File

@@ -847,7 +847,7 @@ int Main2(
#endif
ecs->Init(g_StdStream, g_ErrStream, percentsStream);
ecs->MutiArcMode = (ArchivePathsSorted.Size() > 1);
ecs->MultiArcMode = (ArchivePathsSorted.Size() > 1);
ecs->LogLevel = options.LogLevel;
ecs->PercentsNameLevel = percentsNameLevel;

View File

@@ -19,7 +19,7 @@ HRESULT COpenCallbackConsole::Open_CheckBreak()
HRESULT COpenCallbackConsole::Open_SetTotal(const UInt64 *files, const UInt64 *bytes)
{
if (!MutiArcMode && NeedPercents())
if (!MultiArcMode && NeedPercents())
{
if (files)
{
@@ -46,7 +46,7 @@ HRESULT COpenCallbackConsole::Open_SetTotal(const UInt64 *files, const UInt64 *b
HRESULT COpenCallbackConsole::Open_SetCompleted(const UInt64 *files, const UInt64 *bytes)
{
if (!MutiArcMode && NeedPercents())
if (!MultiArcMode && NeedPercents())
{
if (files)
{

View File

@@ -26,7 +26,7 @@ protected:
public:
bool MutiArcMode;
bool MultiArcMode;
void ClosePercents()
{
@@ -37,7 +37,7 @@ public:
COpenCallbackConsole():
_totalFilesDefined(false),
_totalBytesDefined(false),
MutiArcMode(false)
MultiArcMode(false)
#ifndef _NO_CRYPTO
, PasswordIsDefined(false)

View File

@@ -373,18 +373,21 @@ static HANDLE MyOpenFilePluginW(const wchar_t *name)
HRESULT result = ::OpenArchive(fullName, &archiveHandler,
archiverInfoResult, defaultName, openArchiveCallback);
*/
if (result != S_OK)
{
if (result == E_ABORT)
return (HANDLE)-2;
ShowSysErrorMessage(result);
return INVALID_HANDLE_VALUE;
}
if (result == E_ABORT)
return (HANDLE)-2;
UString errorMessage = agent->GetErrorMessage();
if (!errorMessage.IsEmpty())
g_StartupInfo.ShowErrorMessage(UnicodeStringToMultiByte(errorMessage, CP_OEMCP));
if (result != S_OK)
{
if (result == S_FALSE)
return INVALID_HANDLE_VALUE;
ShowSysErrorMessage(result);
return INVALID_HANDLE_VALUE;
}
// ::OutputDebugStringA("after OpenArchive\n");
CPlugin *plugin = new CPlugin(

View File

@@ -68,6 +68,7 @@ void CStartupInfo::SetErrorTitle(AString &s)
s += GetMsgString(NMessageID::kError);
}
/*
int CStartupInfo::ShowErrorMessage(const char *message)
{
AString s;
@@ -75,6 +76,7 @@ int CStartupInfo::ShowErrorMessage(const char *message)
const char *items[]= { s, message };
return ShowWarningWithOk(items, ARRAY_SIZE(items));
}
*/
int CStartupInfo::ShowErrorMessage2(const char *m1, const char *m2)
{
@@ -84,48 +86,45 @@ int CStartupInfo::ShowErrorMessage2(const char *m1, const char *m2)
return ShowWarningWithOk(items, ARRAY_SIZE(items));
}
/*
static void SplitString(const AString &srcString, AStringVector &destStrings)
static void SplitString(const AString &src, AStringVector &destStrings)
{
destStrings.Clear();
AString string;
unsigned len = srcString.Len();
AString s;
unsigned len = src.Len();
if (len == 0)
return;
for (unsigned i = 0; i < len; i++)
{
char c = srcString[i];
char c = src[i];
if (c == '\n')
{
if (!string.IsEmpty())
if (!s.IsEmpty())
{
destStrings.Add(string);
string.Empty();
destStrings.Add(s);
s.Empty();
}
}
else
string += c;
s += c;
}
if (!string.IsEmpty())
destStrings.Add(string);
if (!s.IsEmpty())
destStrings.Add(s);
}
*/
/*
int CStartupInfo::ShowMessageLines(const char *message)
int CStartupInfo::ShowErrorMessage(const char *message)
{
AStringVector strings;
SplitString(message, strings);
const unsigned kNumStringsMax = 20;
const char *items[kNumStringsMax + 1] = { GetMsgString(NMessageID::kError) };
unsigned pos = 1;
const char *items[kNumStringsMax + 1];
unsigned pos = 0;
items[pos++] = GetMsgString(NMessageID::kError);
for (unsigned i = 0; i < strings.Size() && pos < kNumStringsMax; i++)
items[pos++] = strings[i];
items[pos++] = GetMsgString(NMessageID::kOk);
return ShowMessage(FMSG_WARNING, NULL, items, pos, 1);
}
*/
/*
int CStartupInfo::ShowMessageLines(const char *message)

View File

@@ -188,7 +188,7 @@ public:
// File Menu
void OpenItem() { GetFocusedPanel().OpenSelectedItems(true); }
void OpenItemInside() { GetFocusedPanel().OpenFocusedItemAsInternal(); }
void OpenItemInside(const wchar_t *type) { GetFocusedPanel().OpenFocusedItemAsInternal(type); }
void OpenItemOutside() { GetFocusedPanel().OpenSelectedItems(false); }
void EditItem(bool useEditor) { GetFocusedPanel().EditItem(useEditor); }
void Rename() { GetFocusedPanel().RenameFile(); }

View File

@@ -91,15 +91,45 @@ HRESULT CExtractCallbackImp::Open_CheckBreak()
return ProgressDialog->Sync.CheckStop();
}
HRESULT CExtractCallbackImp::Open_SetTotal(const UInt64 * /* numFiles */, const UInt64 * /* numBytes */)
HRESULT CExtractCallbackImp::Open_SetTotal(const UInt64 *files, const UInt64 *bytes)
{
// if (numFiles != NULL) ProgressDialog->Sync.SetNumFilesTotal(*numFiles);
return S_OK;
HRESULT res = S_OK;
if (!MultiArcMode)
{
if (files)
{
_totalFilesDefined = true;
// res = ProgressDialog->Sync.Set_NumFilesTotal(*files);
}
else
_totalFilesDefined = false;
if (bytes)
{
_totalBytesDefined = true;
ProgressDialog->Sync.Set_NumBytesTotal(*bytes);
}
else
_totalBytesDefined = false;
}
return res;
}
HRESULT CExtractCallbackImp::Open_SetCompleted(const UInt64 * /* numFiles */, const UInt64 * /* numBytes */)
HRESULT CExtractCallbackImp::Open_SetCompleted(const UInt64 *files, const UInt64 *bytes)
{
// if (numFiles != NULL) ProgressDialog->Sync.SetNumFilesCur(*numFiles);
if (!MultiArcMode)
{
if (files)
{
ProgressDialog->Sync.Set_NumFilesCur(*files);
}
if (bytes)
{
}
}
return ProgressDialog->Sync.CheckStop();
}

View File

@@ -284,6 +284,10 @@ public:
UString _lang_Skipping;
UString _lang_Empty;
bool _totalFilesDefined;
bool _totalBytesDefined;
bool MultiArcMode;
CExtractCallbackImp():
#ifndef _NO_CRYPTO
PasswordIsDefined(false),
@@ -291,7 +295,12 @@ public:
#endif
OverwriteMode(NExtract::NOverwriteMode::kAsk),
StreamMode(false),
ProcessAltStreams(true)
ProcessAltStreams(true),
_totalFilesDefined(false),
_totalBytesDefined(false),
MultiArcMode(false)
#ifndef _SFX
, _hashCalc(NULL)
#endif

View File

@@ -2,13 +2,13 @@
#define IDB_LINK_LINK 7701
#define IDT_LINK_PATH_FROM 7702
#define IDT_LINK_PATH_TO 7703
#define IDT_LINK_PATH_FROM 7702
#define IDT_LINK_PATH_TO 7703
#define IDG_LINK_TYPE 7710
#define IDR_LINK_TYPE_HARD 7711
#define IDR_LINK_TYPE_SYM_FILE 7712
#define IDR_LINK_TYPE_SYM_DIR 7713
#define IDR_LINK_TYPE_SYM_FILE 7712
#define IDR_LINK_TYPE_SYM_DIR 7713
#define IDR_LINK_TYPE_JUNCTION 7714

View File

@@ -143,7 +143,9 @@ static void MyChangeMenu(HMENU menuLoc, int level, int menuIndex)
else
continue;
}
LangString_OnlyFromLangFile(langID, newString);
if (newString.IsEmpty())
continue;
}
@@ -154,7 +156,21 @@ static void MyChangeMenu(HMENU menuLoc, int level, int menuIndex)
int langPos = FindLangItem(item.wID);
// we don't need lang change for CRC items!!!
LangString_OnlyFromLangFile(langPos >= 0 ? kIDLangPairs[langPos].LangID : item.wID, newString);
UInt32 langID = langPos >= 0 ? kIDLangPairs[langPos].LangID : item.wID;
if (langID == IDM_OPEN_INSIDE_ONE || langID == IDM_OPEN_INSIDE_PARSER)
{
LangString_OnlyFromLangFile(IDM_OPEN_INSIDE, newString);
newString.Replace(L"&", L"");
int tabPos = newString.Find(L"\t");
if (tabPos >= 0)
newString.DeleteFrom(tabPos);
newString += (langID == IDM_OPEN_INSIDE_ONE ? L" *" : L" #");
}
else
LangString_OnlyFromLangFile(langID, newString);
if (newString.IsEmpty())
continue;
@@ -162,6 +178,7 @@ static void MyChangeMenu(HMENU menuLoc, int level, int menuIndex)
if (tabPos >= 0)
newString += item.StringValue.Ptr(tabPos);
}
{
item.StringValue = newString;
item.fMask = Get_fMask_for_String();
@@ -358,6 +375,7 @@ void CFileMenu::Load(HMENU hMenu, unsigned startPos)
ReadRegDiff(diffPath);
unsigned numRealItems = startPos;
for (unsigned i = 0;; i++)
{
CMenuItem item;
@@ -375,6 +393,13 @@ void CFileMenu::Load(HMENU hMenu, unsigned startPos)
if (item.wID == IDM_DIFF && diffPath.IsEmpty())
continue;
if (item.wID == IDM_OPEN_INSIDE_ONE || item.wID == IDM_OPEN_INSIDE_PARSER)
{
// We use diff as "super mode" marker for additional commands.
if (diffPath.IsEmpty())
continue;
}
bool isOneFsFile = (isFsFolder && numItems == 1 && allAreFiles);
bool disable = (!isOneFsFile && (item.wID == IDM_SPLIT || item.wID == IDM_COMBINE));
@@ -415,6 +440,7 @@ void CFileMenu::Load(HMENU hMenu, unsigned startPos)
numRealItems = startPos;
}
}
destMenu.RemoveAllItemsFrom(numRealItems);
}
@@ -432,7 +458,11 @@ bool ExecuteFileCommand(int id)
{
// File
case IDM_OPEN: g_App.OpenItem(); break;
case IDM_OPEN_INSIDE: g_App.OpenItemInside(); break;
case IDM_OPEN_INSIDE: g_App.OpenItemInside(NULL); break;
case IDM_OPEN_INSIDE_ONE: g_App.OpenItemInside(L"*"); break;
case IDM_OPEN_INSIDE_PARSER: g_App.OpenItemInside(L"#"); break;
case IDM_OPEN_OUTSIDE: g_App.OpenItemOutside(); break;
case IDM_FILE_VIEW: g_App.EditItem(false); break;
case IDM_FILE_EDIT: g_App.EditItem(true); break;

View File

@@ -285,7 +285,7 @@ private:
HRESULT InitColumns();
// void InitColumns2(PROPID sortID);
void InsertColumn(int index);
void InsertColumn(unsigned index);
void SetFocusedSelectedItem(int index, bool select);
HRESULT RefreshListCtrl(const UString &focusedName, int focusedPos, bool selectFocused,
@@ -351,6 +351,7 @@ public:
*/
return (UInt32)item.lParam;
}
int GetRealItemIndex(int indexInListView) const
{
/*
@@ -690,7 +691,7 @@ public:
void OpenAltStreams();
void OpenFocusedItemAsInternal();
void OpenFocusedItemAsInternal(const wchar_t *type = NULL);
void OpenSelectedItems(bool internal);
void OpenFolderExternal(int index);
@@ -703,13 +704,14 @@ public:
const UString &arcFormat,
bool &encrypted);
HRESULT OpenItemAsArchive(const UString &relPath, const UString &arcFormat, bool &encrypted);
HRESULT OpenItemAsArchive(int index);
HRESULT OpenItemAsArchive(int index, const wchar_t *type = NULL);
void OpenItemInArchive(int index, bool tryInternal, bool tryExternal,
bool editMode, bool useEditor);
bool editMode, bool useEditor, const wchar_t *type = NULL);
HRESULT OnOpenItemChanged(UInt32 index, const wchar_t *fullFilePath, bool usePassword, const UString &password);
LRESULT OnOpenItemChanged(LPARAM lParam);
void OpenItem(int index, bool tryInternal, bool tryExternal);
bool IsVirus_Message(const UString &name);
void OpenItem(int index, bool tryInternal, bool tryExternal, const wchar_t *type = NULL);
void EditItem(bool useEditor);
void EditItem(int index, bool useEditor);

View File

@@ -157,12 +157,6 @@ public:
}
};
static bool IsNameVirus(const UString &name)
{
// return (name.Find(L" ") >= 0);
return (wcsstr(name, L" ") != NULL);
}
struct CTmpProcessInfo: public CTempFileInfo
{
CChildProcesses Processes;
@@ -320,12 +314,12 @@ HRESULT CPanel::OpenItemAsArchive(const UString &relPath, const UString &arcForm
return OpenItemAsArchive(NULL, tfi, fullPath, arcFormat, encrypted);
}
HRESULT CPanel::OpenItemAsArchive(int index)
HRESULT CPanel::OpenItemAsArchive(int index, const wchar_t *type)
{
CDisableTimerProcessing disableTimerProcessing1(*this);
CDisableNotify disableNotify(*this);
bool encrypted;
HRESULT res = OpenItemAsArchive(GetItemRelPath2(index), UString(), encrypted);
HRESULT res = OpenItemAsArchive(GetItemRelPath2(index), type ? type : L"", encrypted);
if (res != S_OK)
{
RefreshTitle(true); // in case of error we must refresh changed title of 7zFM
@@ -600,19 +594,77 @@ void CPanel::OpenFolderExternal(int index)
StartApplicationDontWait(fsPrefix, name, (HWND)*this);
}
void CPanel::OpenItem(int index, bool tryInternal, bool tryExternal)
bool CPanel::IsVirus_Message(const UString &name)
{
UString name2;
const wchar_t cRLO = (wchar_t)0x202E;
bool isVirus = false;
bool isSpaceError = false;
name2 = name;
if (name2.Find(cRLO) >= 0)
{
UString badString = cRLO;
name2.Replace(badString, L"[RLO]");
isVirus = true;
}
{
const wchar_t *kVirusSpaces = L" ";
// const unsigned kNumSpaces = strlen(kVirusSpaces);
for (;;)
{
int pos = name2.Find(kVirusSpaces);
if (pos < 0)
break;
isVirus = true;
isSpaceError = true;
name2.Replace(kVirusSpaces, L" ");
}
}
if (!isVirus)
return false;
UString s = LangString(IDS_VIRUS);
if (!isSpaceError)
{
int pos1 = s.Find(L'(');
if (pos1 >= 0)
{
int pos2 = s.Find(L')', pos1 + 1);
if (pos2 >= 0)
{
s.Delete(pos1, pos2 + 1 - pos1);
if (pos1 > 0 && s[pos1 - 1] == ' ' && s[pos1] == '.')
s.Delete(pos1 - 1);
}
}
}
UString name3 = name;
name3.Replace(L'\n', L'_');
name2.Replace(L'\n', L'_');
s.Add_LF(); s += name2;
s.Add_LF(); s += name3;
MessageBoxMyError(s);
return true;
}
void CPanel::OpenItem(int index, bool tryInternal, bool tryExternal, const wchar_t *type)
{
CDisableTimerProcessing disableTimerProcessing(*this);
UString name = GetItemRelPath2(index);
if (IsNameVirus(name))
{
MessageBoxErrorLang(IDS_VIRUS);
if (IsVirus_Message(name))
return;
}
if (!_parentFolders.IsEmpty())
{
OpenItemInArchive(index, tryInternal, tryExternal, false, false);
OpenItemInArchive(index, tryInternal, tryExternal, false, false, type);
return;
}
@@ -623,7 +675,7 @@ void CPanel::OpenItem(int index, bool tryInternal, bool tryExternal)
if (tryInternal)
if (!tryExternal || !DoItemAlwaysStart(name))
{
HRESULT res = OpenItemAsArchive(index);
HRESULT res = OpenItemAsArchive(index, type);
disableNotify.Restore(); // we must restore to allow text notification update
InvalidateList();
if (res == S_OK || res == E_ABORT)
@@ -634,6 +686,7 @@ void CPanel::OpenItem(int index, bool tryInternal, bool tryExternal)
return;
}
}
if (tryExternal)
{
// SetCurrentDirectory opens HANDLE to folder!!!
@@ -939,16 +992,13 @@ static HRESULT GetTime(IFolderFolder *folder, UInt32 index, PROPID propID, FILET
}
*/
void CPanel::OpenItemInArchive(int index, bool tryInternal, bool tryExternal, bool editMode, bool useEditor)
void CPanel::OpenItemInArchive(int index, bool tryInternal, bool tryExternal, bool editMode, bool useEditor, const wchar_t *type)
{
const UString name = GetItemName(index);
const UString relPath = GetItemRelPath(index);
if (IsNameVirus(name))
{
MessageBoxErrorLang(IDS_VIRUS);
if (IsVirus_Message(name))
return;
}
if (!_folderOperations)
{
@@ -966,6 +1016,7 @@ void CPanel::OpenItemInArchive(int index, bool tryInternal, bool tryExternal, bo
MessageBoxLastError();
return;
}
FString tempDir = tempDirectory.GetPath();
FString tempDirNorm = tempDir;
NName::NormalizeDirPathPrefix(tempDirNorm);
@@ -993,7 +1044,7 @@ void CPanel::OpenItemInArchive(int index, bool tryInternal, bool tryExternal, bo
if (subStream)
{
bool encrypted;
HRESULT res = OpenItemAsArchive(subStream, tempFileInfo, fullVirtPath, UString(), encrypted);
HRESULT res = OpenItemAsArchive(subStream, tempFileInfo, fullVirtPath, type ? type : L"", encrypted);
if (res == S_OK)
{
tempDirectory.DisableDeleting();
@@ -1104,7 +1155,7 @@ void CPanel::OpenItemInArchive(int index, bool tryInternal, bool tryExternal, bo
CMyComPtr<IInStream> bufInStream = bufInStreamSpec;
bufInStreamSpec->Init(file.Data, streamSize, virtFileSystem);
bool encrypted;
if (OpenItemAsArchive(bufInStream, tempFileInfo, fullVirtPath, UString(), encrypted) == S_OK)
if (OpenItemAsArchive(bufInStream, tempFileInfo, fullVirtPath, type ? type : L"", encrypted) == S_OK)
{
tempDirectory.DisableDeleting();
RefreshListCtrl();
@@ -1130,7 +1181,7 @@ void CPanel::OpenItemInArchive(int index, bool tryInternal, bool tryExternal, bo
if (tryAsArchive)
{
bool encrypted;
if (OpenItemAsArchive(NULL, tempFileInfo, fullVirtPath, UString(), encrypted) == S_OK)
if (OpenItemAsArchive(NULL, tempFileInfo, fullVirtPath, type ? type : L"", encrypted) == S_OK)
{
tempDirectory.DisableDeleting();
RefreshListCtrl();

View File

@@ -210,14 +210,15 @@ HRESULT CPanel::InitColumns()
*/
_sortID = _listViewInfo.SortID;
_visibleProperties.Sort();
for (i = 0; i < _visibleProperties.Size(); i++)
{
InsertColumn(i);
}
return S_OK;
}
void CPanel::InsertColumn(int index)
void CPanel::InsertColumn(unsigned index)
{
const CItemProperty &prop = _visibleProperties[index];
LV_COLUMNW column;
@@ -225,6 +226,7 @@ void CPanel::InsertColumn(int index)
column.cx = prop.Width;
column.fmt = GetColumnAlign(prop.ID, prop.Type);
column.iOrder = prop.Order;
// iOrder must be <= _listView.ItemCount
column.iSubItem = index;
column.pszText = const_cast<wchar_t *>((const wchar_t *)prop.Name);
_listView.InsertColumn(index, &column);
@@ -775,7 +777,7 @@ void CPanel::EditItem(bool useEditor)
EditItem(realIndex, useEditor);
}
void CPanel::OpenFocusedItemAsInternal()
void CPanel::OpenFocusedItemAsInternal(const wchar_t *type)
{
int focusedItem = _listView.GetFocusedItem();
if (focusedItem < 0)
@@ -784,7 +786,7 @@ void CPanel::OpenFocusedItemAsInternal()
if (IsItem_Folder(realIndex))
OpenFolder(realIndex);
else
OpenItem(realIndex, true, false);
OpenItem(realIndex, true, false, type);
}
void CPanel::OpenSelectedItems(bool tryInternal)
@@ -1059,10 +1061,10 @@ void CPanel::ShowColumnsContextMenu(int x, int y)
if (prop.IsVisible)
{
int prevVisibleSize = _visibleProperties.Size();
prop.Order = prevVisibleSize;
unsigned num = _visibleProperties.Size();
prop.Order = num;
_visibleProperties.Add(prop);
InsertColumn(prevVisibleSize);
InsertColumn(num);
}
else
{

View File

@@ -320,23 +320,33 @@ LRESULT CPanel::SetItemText(LVITEMW &item)
const wchar_t *name = NULL;
unsigned nameLen = 0;
_folderGetItemName->GetItemName(realIndex, &name, &nameLen);
if (name)
{
unsigned dest = 0;
unsigned limit = item.cchTextMax - 1;
for (unsigned i = 0; dest < limit;)
{
wchar_t c = name[i++];
if (c == 0)
break;
text[dest++] = c;
if (c != ' ')
{
if (c != 0x202E) // RLO
continue;
text[dest - 1] = '_';
continue;
}
if (name[i + 1] != ' ')
continue;
unsigned t = 2;
for (; name[i + t] == ' '; t++);
if (t >= 4 && dest + 4 <= limit)
{
text[dest++] = '.';
@@ -346,6 +356,7 @@ LRESULT CPanel::SetItemText(LVITEMW &item)
i += t;
}
}
text[dest] = 0;
return 0;
}

View File

@@ -47,6 +47,9 @@
#define IDM_LINK 558
#define IDM_ALT_STREAMS 559
#define IDM_OPEN_INSIDE_ONE 590
#define IDM_OPEN_INSIDE_PARSER 591
#define IDM_SELECT_ALL 600
#define IDM_DESELECT_ALL 601
#define IDM_INVERT_SELECTION 602

View File

@@ -19,6 +19,8 @@ BEGIN
BEGIN
MENUITEM "&Open\tEnter", IDM_OPEN
MENUITEM "Open &Inside\tCtrl+PgDn", IDM_OPEN_INSIDE
MENUITEM "Open Inside *", IDM_OPEN_INSIDE_ONE
MENUITEM "Open Inside #", IDM_OPEN_INSIDE_PARSER
MENUITEM "Open O&utside\tShift+Enter", IDM_OPEN_OUTSIDE
MENUITEM "&View\tF3", IDM_FILE_VIEW
MENUITEM "&Edit\tF4", IDM_FILE_EDIT

View File

@@ -18,7 +18,7 @@
#define IDX_EXTRACT_ELIM_DUP 3430
#define IDX_EXTRACT_NT_SECUR 3431
// #define IDX_EXTRACT_ALT_STREAMS 3432
// #define IDX_EXTRACT_ALT_STREAMS 3432
#define IDX_PASSWORD_SHOW 3803
#define IDG_PASSWORD 3807

View File

@@ -254,6 +254,8 @@ static int Main2()
}
}
ecs->MultiArcMode = (ArchivePathsSorted.Size() > 1);
HRESULT result = ExtractGUI(codecs,
formatIndices, excludedFormatIndices,
ArchivePathsSorted,

View File

@@ -1,10 +1,10 @@
#define IDS_PROGRESS_REMOVE 3305
#define IDS_PROGRESS_ADD 3320
#define IDS_PROGRESS_UPDATE 3321
#define IDS_PROGRESS_ANALYZE 3322
#define IDS_PROGRESS_REPLICATE 3323
#define IDS_PROGRESS_REPACK 3324
#define IDS_PROGRESS_ADD 3320
#define IDS_PROGRESS_UPDATE 3321
#define IDS_PROGRESS_ANALYZE 3322
#define IDS_PROGRESS_REPLICATE 3323
#define IDS_PROGRESS_REPACK 3324
#define IDS_PROGRESS_DELETE 3326
#define IDS_PROGRESS_HEADER 3327
#define IDS_PROGRESS_DELETE 3326
#define IDS_PROGRESS_HEADER 3327