From 3dacb5eb8afda99aad81f4723cb966c0fa91ba1d Mon Sep 17 00:00:00 2001 From: Igor Pavlov Date: Thu, 15 Apr 2010 00:00:00 +0000 Subject: 9.13 --- CPP/7zip/UI/FileManager/App.cpp | 17 ++-- CPP/7zip/UI/FileManager/App.h | 4 +- CPP/7zip/UI/FileManager/ClassDefs.cpp | 4 - CPP/7zip/UI/FileManager/FM.cpp | 7 +- CPP/7zip/UI/FileManager/FM.dsp | 8 -- CPP/7zip/UI/FileManager/FileFolderPluginOpen.cpp | 5 +- CPP/7zip/UI/FileManager/FileFolderPluginOpen.h | 4 +- CPP/7zip/UI/FileManager/IFolder.h | 26 +++--- CPP/7zip/UI/FileManager/MenuPage.cpp | 3 + CPP/7zip/UI/FileManager/MenuPage.rc | 2 +- CPP/7zip/UI/FileManager/Panel.cpp | 23 +++--- CPP/7zip/UI/FileManager/Panel.h | 8 +- CPP/7zip/UI/FileManager/PanelFolderChange.cpp | 6 +- CPP/7zip/UI/FileManager/PanelItemOpen.cpp | 12 +-- CPP/7zip/UI/FileManager/PanelMenu.cpp | 100 +++++++++++++++-------- CPP/7zip/UI/FileManager/PluginInterface.h | 35 +++----- CPP/7zip/UI/FileManager/makefile | 1 - 17 files changed, 148 insertions(+), 117 deletions(-) (limited to 'CPP/7zip/UI/FileManager') diff --git a/CPP/7zip/UI/FileManager/App.cpp b/CPP/7zip/UI/FileManager/App.cpp index 184d6ca0..c195a79d 100755 --- a/CPP/7zip/UI/FileManager/App.cpp +++ b/CPP/7zip/UI/FileManager/App.cpp @@ -107,7 +107,8 @@ void CApp::SetShowSystemMenu() #define ILC_COLOR32 0x0020 #endif -HRESULT CApp::CreateOnePanel(int panelIndex, const UString &mainPath, bool &archiveIsOpened, bool &encrypted) +HRESULT CApp::CreateOnePanel(int panelIndex, const UString &mainPath, const UString &arcFormat, + bool &archiveIsOpened, bool &encrypted) { if (PanelsCreated[panelIndex]) return S_OK; @@ -122,7 +123,7 @@ HRESULT CApp::CreateOnePanel(int panelIndex, const UString &mainPath, bool &arch path = mainPath; int id = 1000 + 100 * panelIndex; RINOK(Panels[panelIndex].Create(_window, _window, - id, path, &m_PanelCallbackImp[panelIndex], &AppState, archiveIsOpened, encrypted)); + id, path, arcFormat, &m_PanelCallbackImp[panelIndex], &AppState, archiveIsOpened, encrypted)); PanelsCreated[panelIndex] = true; return S_OK; } @@ -269,7 +270,7 @@ void CApp::SaveToolbarChanges() void MyLoadMenu(); -HRESULT CApp::Create(HWND hwnd, const UString &mainPath, int xSizes[2], bool &archiveIsOpened, bool &encrypted) +HRESULT CApp::Create(HWND hwnd, const UString &mainPath, const UString &arcFormat, int xSizes[2], bool &archiveIsOpened, bool &encrypted) { _window.Attach(hwnd); #ifdef UNDER_CE @@ -310,7 +311,7 @@ HRESULT CApp::Create(HWND hwnd, const UString &mainPath, int xSizes[2], bool &ar bool archiveIsOpened2 = false; bool encrypted2 = false; bool mainPanel = (i == LastFocusedPanel); - RINOK(CreateOnePanel(i, mainPanel ? mainPath : L"", archiveIsOpened2, encrypted2)); + RINOK(CreateOnePanel(i, mainPanel ? mainPath : L"", arcFormat, archiveIsOpened2, encrypted2)); if (mainPanel) { archiveIsOpened = archiveIsOpened2; @@ -328,7 +329,7 @@ HRESULT CApp::SwitchOnOffOnePanel() { NumPanels++; bool archiveIsOpened, encrypted; - RINOK(CreateOnePanel(1 - LastFocusedPanel, UString(), archiveIsOpened, encrypted)); + RINOK(CreateOnePanel(1 - LastFocusedPanel, UString(), UString(), archiveIsOpened, encrypted)); Panels[1 - LastFocusedPanel].Enable(true); Panels[1 - LastFocusedPanel].Show(SW_SHOWNORMAL); } @@ -596,8 +597,10 @@ void CApp::OnCopy(bool move, bool copyToSame, int srcPanelIndex) } #endif - if (indices.Size() > 1 || (!destPath.IsEmpty() && destPath.Back() == WCHAR_PATH_SEPARATOR) || - NFind::DoesDirExist(destPath)) + if (indices.Size() > 1 || + (!destPath.IsEmpty() && destPath.Back() == WCHAR_PATH_SEPARATOR) || + NFind::DoesDirExist(destPath) || + srcPanel.IsArcFolder()) { NDirectory::CreateComplexDirectory(destPath); NName::NormalizeDirPathPrefix(destPath); diff --git a/CPP/7zip/UI/FileManager/App.h b/CPP/7zip/UI/FileManager/App.h index 8c573cfa..a057c34e 100755 --- a/CPP/7zip/UI/FileManager/App.h +++ b/CPP/7zip/UI/FileManager/App.h @@ -161,8 +161,8 @@ public: void OnSetSameFolder(int srcPanelIndex); void OnSetSubFolder(int srcPanelIndex); - HRESULT CreateOnePanel(int panelIndex, const UString &mainPath, bool &archiveIsOpened, bool &encrypted); - HRESULT Create(HWND hwnd, const UString &mainPath, int xSizes[2], bool &archiveIsOpened, bool &encrypted); + HRESULT CreateOnePanel(int panelIndex, const UString &mainPath, const UString &arcFormat, bool &archiveIsOpened, bool &encrypted); + HRESULT Create(HWND hwnd, const UString &mainPath, const UString &arcFormat, int xSizes[2], bool &archiveIsOpened, bool &encrypted); void Read(); void Save(); void Release(); diff --git a/CPP/7zip/UI/FileManager/ClassDefs.cpp b/CPP/7zip/UI/FileManager/ClassDefs.cpp index 99405d9b..ca05cc6d 100755 --- a/CPP/7zip/UI/FileManager/ClassDefs.cpp +++ b/CPP/7zip/UI/FileManager/ClassDefs.cpp @@ -4,8 +4,4 @@ #include "Common/MyInitGuid.h" -#include "PluginInterface.h" #include "../Agent/Agent.h" - -DEFINE_GUID(CLSID_CZipContextMenu, -0x23170F69, 0x40C1, 0x278A, 0x10, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00); diff --git a/CPP/7zip/UI/FileManager/FM.cpp b/CPP/7zip/UI/FileManager/FM.cpp index 43a8162f..639a9b23 100755 --- a/CPP/7zip/UI/FileManager/FM.cpp +++ b/CPP/7zip/UI/FileManager/FM.cpp @@ -37,6 +37,7 @@ HINSTANCE g_hInstance; HWND g_HWND; bool g_OpenArchive = false; static UString g_MainPath; +static UString g_ArcFormat; static bool g_Maximized = false; #ifndef UNDER_CE @@ -443,7 +444,9 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */, UString paramString, tailString; SplitStringToTwoStrings(commandsString, paramString, tailString); paramString.Trim(); - + tailString.Trim(); + if (tailString.Left(2) == L"-t") + g_ArcFormat = tailString.Mid(2); if (!paramString.IsEmpty()) { g_MainPath = paramString; @@ -639,7 +642,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) if (NFile::NFind::DoesFileExist(g_MainPath)) needOpenFile = true; } - HRESULT res = g_App.Create(hWnd, g_MainPath, xSizes, archiveIsOpened, encrypted); + HRESULT res = g_App.Create(hWnd, g_MainPath, g_ArcFormat, xSizes, archiveIsOpened, encrypted); if (res == E_ABORT) { diff --git a/CPP/7zip/UI/FileManager/FM.dsp b/CPP/7zip/UI/FileManager/FM.dsp index f8ec9364..b821d460 100755 --- a/CPP/7zip/UI/FileManager/FM.dsp +++ b/CPP/7zip/UI/FileManager/FM.dsp @@ -442,14 +442,6 @@ SOURCE=.\OptionsDialog.cpp # End Source File # Begin Source File -SOURCE=.\PluginsPage.cpp -# End Source File -# Begin Source File - -SOURCE=.\PluginsPage.h -# End Source File -# Begin Source File - SOURCE=.\SettingsPage.cpp # End Source File # Begin Source File diff --git a/CPP/7zip/UI/FileManager/FileFolderPluginOpen.cpp b/CPP/7zip/UI/FileManager/FileFolderPluginOpen.cpp index 310b890c..25aec359 100755 --- a/CPP/7zip/UI/FileManager/FileFolderPluginOpen.cpp +++ b/CPP/7zip/UI/FileManager/FileFolderPluginOpen.cpp @@ -20,6 +20,7 @@ using namespace NRegistryAssociations; struct CThreadArchiveOpen { UString Path; + UString ArcFormat; CMyComPtr InStream; CMyComPtr FolderManager; CMyComPtr OpenCallback; @@ -33,7 +34,7 @@ struct CThreadArchiveOpen try { CProgressCloser closer(OpenCallbackSpec->ProgressDialog); - Result = FolderManager->OpenFolderFile(InStream, Path, &Folder, OpenCallback); + Result = FolderManager->OpenFolderFile(InStream, Path, ArcFormat, &Folder, OpenCallback); } catch(...) { Result = E_FAIL; } } @@ -58,6 +59,7 @@ static int FindPlugin(const CObjectVector &plugins, const UString & HRESULT OpenFileFolderPlugin( IInStream *inStream, const UString &path, + const UString &arcFormat, HMODULE *module, IFolderFolder **resultFolder, HWND parentWindow, @@ -128,6 +130,7 @@ HRESULT OpenFileFolderPlugin( t.InStream = inStream; t.Path = path; + t.ArcFormat = arcFormat; UString progressTitle = LangString(IDS_OPENNING, 0x03020283); t.OpenCallbackSpec->ProgressDialog.MainWindow = parentWindow; diff --git a/CPP/7zip/UI/FileManager/FileFolderPluginOpen.h b/CPP/7zip/UI/FileManager/FileFolderPluginOpen.h index 692417ba..85717efd 100755 --- a/CPP/7zip/UI/FileManager/FileFolderPluginOpen.h +++ b/CPP/7zip/UI/FileManager/FileFolderPluginOpen.h @@ -3,7 +3,7 @@ #ifndef __FILE_FOLDER_PLUGIN_OPEN_H #define __FILE_FOLDER_PLUGIN_OPEN_H -HRESULT OpenFileFolderPlugin(IInStream *inStream, const UString &path, - HMODULE *module, IFolderFolder **resultFolder, HWND parentWindow, bool &encrypted, UString &password); +HRESULT OpenFileFolderPlugin(IInStream *inStream, const UString &path, const UString &arcFormat, + HMODULE *module, IFolderFolder **resultFolder, HWND parentWindow, bool &encrypted, UString &password); #endif diff --git a/CPP/7zip/UI/FileManager/IFolder.h b/CPP/7zip/UI/FileManager/IFolder.h index b301f513..743017b8 100755 --- a/CPP/7zip/UI/FileManager/IFolder.h +++ b/CPP/7zip/UI/FileManager/IFolder.h @@ -112,32 +112,36 @@ FOLDER_INTERFACE(IFolderProperties, 0x0E) INTERFACE_FolderProperties(PURE) }; -#define INTERFACE_IFolderArchiveProperties(x) \ - STDMETHOD(GetArchiveProperty)(PROPID propID, PROPVARIANT *value) x; \ - STDMETHOD(GetNumberOfArchiveProperties)(UInt32 *numProperties) x; \ - STDMETHOD(GetArchivePropertyInfo)(UInt32 index, BSTR *name, PROPID *propID, VARTYPE *varType) x; - -FOLDER_INTERFACE(IFolderArchiveProperties, 0x0C) +#define INTERFACE_IFolderArcProps(x) \ + STDMETHOD(GetArcNumLevels)(UInt32 *numLevels) x; \ + STDMETHOD(GetArcProp)(UInt32 level, PROPID propID, PROPVARIANT *value) x; \ + STDMETHOD(GetArcNumProps)(UInt32 level, UInt32 *numProps) x; \ + STDMETHOD(GetArcPropInfo)(UInt32 level, UInt32 index, BSTR *name, PROPID *propID, VARTYPE *varType) x; \ + STDMETHOD(GetArcProp2)(UInt32 level, PROPID propID, PROPVARIANT *value) x; \ + STDMETHOD(GetArcNumProps2)(UInt32 level, UInt32 *numProps) x; \ + STDMETHOD(GetArcPropInfo2)(UInt32 level, UInt32 index, BSTR *name, PROPID *propID, VARTYPE *varType) x; \ + +FOLDER_INTERFACE(IFolderArcProps, 0x10) { - INTERFACE_IFolderArchiveProperties(PURE) + INTERFACE_IFolderArcProps(PURE) }; -FOLDER_INTERFACE(IGetFolderArchiveProperties, 0x0D) +FOLDER_INTERFACE(IGetFolderArcProps, 0x11) { - STDMETHOD(GetFolderArchiveProperties)(IFolderArchiveProperties **object) PURE; + STDMETHOD(GetFolderArcProps)(IFolderArcProps **object) PURE; }; #define FOLDER_MANAGER_INTERFACE(i, x) DECL_INTERFACE(i, 9, x) #define INTERFACE_IFolderManager(x) \ - STDMETHOD(OpenFolderFile)(IInStream *inStream, const wchar_t *filePath, IFolderFolder **resultFolder, IProgress *progress) x; \ + STDMETHOD(OpenFolderFile)(IInStream *inStream, const wchar_t *filePath, const wchar_t *arcFormat, IFolderFolder **resultFolder, IProgress *progress) x; \ STDMETHOD(GetExtensions)(BSTR *extensions) x; \ STDMETHOD(GetIconPath)(const wchar_t *ext, BSTR *iconPath, Int32 *iconIndex) x; \ // STDMETHOD(GetTypes)(BSTR *types) PURE; // STDMETHOD(CreateFolderFile)(const wchar_t *type, const wchar_t *filePath, IProgress *progress) PURE; -FOLDER_MANAGER_INTERFACE(IFolderManager, 0x04) +FOLDER_MANAGER_INTERFACE(IFolderManager, 0x05) { INTERFACE_IFolderManager(PURE); }; diff --git a/CPP/7zip/UI/FileManager/MenuPage.cpp b/CPP/7zip/UI/FileManager/MenuPage.cpp index 719c86ad..e1041204 100755 --- a/CPP/7zip/UI/FileManager/MenuPage.cpp +++ b/CPP/7zip/UI/FileManager/MenuPage.cpp @@ -35,6 +35,7 @@ struct CContextMenuItem static CContextMenuItem kMenuItems[] = { { IDS_CONTEXT_OPEN, 0x02000103, kOpen}, + { IDS_CONTEXT_OPEN, 0x02000103, kOpenAs}, { IDS_CONTEXT_EXTRACT, 0x02000105, kExtract}, { IDS_CONTEXT_EXTRACT_HERE, 0x0200010B, kExtractHere }, { IDS_CONTEXT_EXTRACT_TO, 0x0200010D, kExtractTo }, @@ -83,6 +84,8 @@ bool CMenuPage::OnInit() CContextMenuItem &menuItem = kMenuItems[i]; UString s = LangString(menuItem.ControlID, menuItem.LangID); + if (menuItem.Flag == kOpenAs) + s += L" >"; switch(menuItem.ControlID) { diff --git a/CPP/7zip/UI/FileManager/MenuPage.rc b/CPP/7zip/UI/FileManager/MenuPage.rc index bb4281d8..791a1c08 100755 --- a/CPP/7zip/UI/FileManager/MenuPage.rc +++ b/CPP/7zip/UI/FileManager/MenuPage.rc @@ -2,7 +2,7 @@ #include "../../GuiCommon.rc" #define xc 196 -#define yc 164 +#define yc 174 IDD_MENU MY_PAGE #include "MenuPage2.rc" diff --git a/CPP/7zip/UI/FileManager/Panel.cpp b/CPP/7zip/UI/FileManager/Panel.cpp index 3988f1f3..34f77861 100755 --- a/CPP/7zip/UI/FileManager/Panel.cpp +++ b/CPP/7zip/UI/FileManager/Panel.cpp @@ -71,7 +71,9 @@ static LPCWSTR kClassName = L"7-Zip::Panel"; HRESULT CPanel::Create(HWND mainWindow, HWND parentWindow, UINT id, - const UString ¤tFolderPrefix, CPanelCallback *panelCallback, CAppState *appState, + const UString ¤tFolderPrefix, + const UString &arcFormat, + CPanelCallback *panelCallback, CAppState *appState, bool &archiveIsOpened, bool &encrypted) { _mainWindow = mainWindow; @@ -91,7 +93,7 @@ HRESULT CPanel::Create(HWND mainWindow, HWND parentWindow, UINT id, if (currentFolderPrefix[0] == L'.') if (!NFile::NDirectory::MyGetFullPathName(currentFolderPrefix, cfp)) cfp = currentFolderPrefix; - RINOK(BindToPath(cfp, archiveIsOpened, encrypted)); + RINOK(BindToPath(cfp, arcFormat, archiveIsOpened, encrypted)); if (!CreateEx(0, kClassName, 0, WS_CHILD | WS_VISIBLE, 0, 0, _xSize, 260, @@ -715,19 +717,18 @@ UString CPanel::GetFolderTypeID() const return L""; } -bool CPanel::IsRootFolder() const +bool CPanel::IsFolderTypeEqTo(const wchar_t *s) const { - return (GetFolderTypeID() == L"RootFolder"); + return GetFolderTypeID() == s; } -bool CPanel::IsFSFolder() const +bool CPanel::IsRootFolder() const { return IsFolderTypeEqTo(L"RootFolder"); } +bool CPanel::IsFSFolder() const { return IsFolderTypeEqTo(L"FSFolder"); } +bool CPanel::IsFSDrivesFolder() const { return IsFolderTypeEqTo(L"FSDrives"); } +bool CPanel::IsArcFolder() const { - return (GetFolderTypeID() == L"FSFolder"); -} - -bool CPanel::IsFSDrivesFolder() const -{ - return (GetFolderTypeID() == L"FSDrives"); + UString s = GetFolderTypeID(); + return s.Left(5) == L"7-Zip"; } UString CPanel::GetFsPath() const diff --git a/CPP/7zip/UI/FileManager/Panel.h b/CPP/7zip/UI/FileManager/Panel.h index ead12d2e..fb6d255b 100755 --- a/CPP/7zip/UI/FileManager/Panel.h +++ b/CPP/7zip/UI/FileManager/Panel.h @@ -349,7 +349,7 @@ public: // PanelFolderChange.cpp void SetToRootFolder(); - HRESULT BindToPath(const UString &fullPath, bool &archiveIsOpened, bool &encrypted); // can be prefix + HRESULT BindToPath(const UString &fullPath, const UString &arcFormat, bool &archiveIsOpened, bool &encrypted); // can be prefix HRESULT BindToPathAndRefresh(const UString &path); void OpenDrivesFolder(); @@ -367,6 +367,7 @@ public: HRESULT Create(HWND mainWindow, HWND parentWindow, UINT id, const UString ¤tFolderPrefix, + const UString &arcFormat, CPanelCallback *panelCallback, CAppState *appState, bool &archiveIsOpened, bool &encrypted); void SetFocusToList(); @@ -465,9 +466,11 @@ public: void KillSelection(); UString GetFolderTypeID() const; + bool IsFolderTypeEqTo(const wchar_t *s) const; bool IsRootFolder() const; bool IsFSFolder() const; bool IsFSDrivesFolder() const; + bool IsArcFolder() const; bool IsFsOrDrivesFolder() const { return IsFSFolder() || IsFSDrivesFolder(); } bool IsDeviceDrivesPrefix() const { return _currentFolderPrefix == L"\\\\.\\"; } bool IsFsOrPureDrivesFolder() const { return IsFSFolder() || (IsFSDrivesFolder() && !IsDeviceDrivesPrefix()); } @@ -539,8 +542,9 @@ public: HRESULT OpenItemAsArchive(IInStream *inStream, const CTempFileInfo &tempFileInfo, const UString &virtualFilePath, + const UString &arcFormat, bool &encrypted); - HRESULT OpenItemAsArchive(const UString &name, bool &encrypted); + HRESULT OpenItemAsArchive(const UString &name, const UString &arcFormat, bool &encrypted); HRESULT OpenItemAsArchive(int index); void OpenItemInArchive(int index, bool tryInternal, bool tryExternal, bool editMode); diff --git a/CPP/7zip/UI/FileManager/PanelFolderChange.cpp b/CPP/7zip/UI/FileManager/PanelFolderChange.cpp index 41ffe9da..afa4c041 100755 --- a/CPP/7zip/UI/FileManager/PanelFolderChange.cpp +++ b/CPP/7zip/UI/FileManager/PanelFolderChange.cpp @@ -35,7 +35,7 @@ void CPanel::SetToRootFolder() rootFolderSpec->Init(); } -HRESULT CPanel::BindToPath(const UString &fullPath, bool &archiveIsOpened, bool &encrypted) +HRESULT CPanel::BindToPath(const UString &fullPath, const UString &arcFormat, bool &archiveIsOpened, bool &encrypted) { archiveIsOpened = false; encrypted = false; @@ -114,7 +114,7 @@ HRESULT CPanel::BindToPath(const UString &fullPath, bool &archiveIsOpened, bool UString fileName; if (NDirectory::GetOnlyName(sysPath, fileName)) { - HRESULT res = OpenItemAsArchive(fileName, encrypted); + HRESULT res = OpenItemAsArchive(fileName, arcFormat, encrypted); if (res != S_FALSE) { RINOK(res); @@ -145,7 +145,7 @@ HRESULT CPanel::BindToPathAndRefresh(const UString &path) { CDisableTimerProcessing disableTimerProcessing1(*this); bool archiveIsOpened, encrypted; - RINOK(BindToPath(path, archiveIsOpened, encrypted)); + RINOK(BindToPath(path, UString(), archiveIsOpened, encrypted)); RefreshListCtrl(UString(), -1, true, UStringVector()); return S_OK; } diff --git a/CPP/7zip/UI/FileManager/PanelItemOpen.cpp b/CPP/7zip/UI/FileManager/PanelItemOpen.cpp index b77d3e2a..15e01483 100755 --- a/CPP/7zip/UI/FileManager/PanelItemOpen.cpp +++ b/CPP/7zip/UI/FileManager/PanelItemOpen.cpp @@ -67,6 +67,7 @@ public: HRESULT CPanel::OpenItemAsArchive(IInStream *inStream, const CTempFileInfo &tempFileInfo, const UString &virtualFilePath, + const UString &arcFormat, bool &encrypted) { encrypted = false; @@ -95,6 +96,7 @@ HRESULT CPanel::OpenItemAsArchive(IInStream *inStream, UString password; RINOK(OpenFileFolderPlugin(inStream, folderLink.FilePath.IsEmpty() ? virtualFilePath : folderLink.FilePath, + arcFormat, &library, &newFolder, GetParent(), encrypted, password)); folderLink.Password = password; @@ -114,20 +116,20 @@ HRESULT CPanel::OpenItemAsArchive(IInStream *inStream, return S_OK; } -HRESULT CPanel::OpenItemAsArchive(const UString &name, bool &encrypted) +HRESULT CPanel::OpenItemAsArchive(const UString &name, const UString &arcFormat, bool &encrypted) { CTempFileInfo tfi; tfi.ItemName = name; tfi.FolderPath = _currentFolderPrefix; tfi.FilePath = _currentFolderPrefix + name; - return OpenItemAsArchive(NULL, tfi, _currentFolderPrefix + name, encrypted); + return OpenItemAsArchive(NULL, tfi, _currentFolderPrefix + name, arcFormat, encrypted); } HRESULT CPanel::OpenItemAsArchive(int index) { CDisableTimerProcessing disableTimerProcessing1(*this); bool encrypted; - RINOK(OpenItemAsArchive(GetItemRelPath(index), encrypted)); + RINOK(OpenItemAsArchive(GetItemRelPath(index), UString(), encrypted)); RefreshListCtrl(); return S_OK; } @@ -575,7 +577,7 @@ void CPanel::OpenItemInArchive(int index, bool tryInternal, bool tryExternal, bo if (subStream) { bool encrypted; - if (OpenItemAsArchive(subStream, tempFileInfo, fullVirtPath, encrypted) == S_OK) + if (OpenItemAsArchive(subStream, tempFileInfo, fullVirtPath, UString(), encrypted) == S_OK) { tempDirectory.DisableDeleting(); RefreshListCtrl(); @@ -623,7 +625,7 @@ void CPanel::OpenItemInArchive(int index, bool tryInternal, bool tryExternal, bo if (tryAsArchive) { bool encrypted; - if (OpenItemAsArchive(NULL, tempFileInfo, fullVirtPath, encrypted) == S_OK) + if (OpenItemAsArchive(NULL, tempFileInfo, fullVirtPath, UString(), encrypted) == S_OK) { tempDirectory.DisableDeleting(); RefreshListCtrl(); diff --git a/CPP/7zip/UI/FileManager/PanelMenu.cpp b/CPP/7zip/UI/FileManager/PanelMenu.cpp index 093f02f0..c60751b5 100755 --- a/CPP/7zip/UI/FileManager/PanelMenu.cpp +++ b/CPP/7zip/UI/FileManager/PanelMenu.cpp @@ -15,7 +15,6 @@ #include "App.h" #include "LangUtils.h" #include "MyLoadMenu.h" -#include "PluginInterface.h" #include "PropertyName.h" #include "resource.h" @@ -24,11 +23,6 @@ using namespace NWindows; LONG g_DllRefCount = 0; -/* -// {23170F69-40C1-278A-1000-000100020000} -DEFINE_GUID(CLSID_CZipContextMenu, -0x23170F69, 0x40C1, 0x278A, 0x10, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00); -*/ static const UINT kSevenZipStartMenuID = kPluginMenuStartID ; static const UINT kSystemStartMenuID = kPluginMenuStartID + 100; @@ -55,6 +49,7 @@ void CPanel::InvokeSystemCommand(const char *command) } static const wchar_t *kSeparator = L"----------------------------\n"; +static const wchar_t *kSeparatorSmall = L"----\n"; static const wchar_t *kPropValueSeparator = L": "; extern UString ConvertSizeToString(UInt64 value); @@ -99,9 +94,9 @@ static void AddPropertyString(PROPID propID, const wchar_t *nameBSTR, void CPanel::Properties() { - CMyComPtr getFolderArchiveProperties; - _folder.QueryInterface(IID_IGetFolderArchiveProperties, &getFolderArchiveProperties); - if (!getFolderArchiveProperties) + CMyComPtr getFolderArcProps; + _folder.QueryInterface(IID_IGetFolderArcProps, &getFolderArcProps); + if (!getFolderArcProps) { InvokeSystemCommand("properties"); return; @@ -137,10 +132,12 @@ void CPanel::Properties() message += kSeparator; } + /* message += LangString(IDS_PROP_FILE_TYPE, 0x02000214); message += kPropValueSeparator; message += GetFolderTypeID(); message += L"\n"; + */ { NCOM::CPropVariant prop; @@ -172,30 +169,63 @@ void CPanel::Properties() } } - CMyComPtr getFolderArchiveProperties; - _folder.QueryInterface(IID_IGetFolderArchiveProperties, &getFolderArchiveProperties); - if (getFolderArchiveProperties) + CMyComPtr getFolderArcProps; + _folder.QueryInterface(IID_IGetFolderArcProps, &getFolderArcProps); + if (getFolderArcProps) { - CMyComPtr getProps; - getFolderArchiveProperties->GetFolderArchiveProperties(&getProps); + CMyComPtr getProps; + getFolderArcProps->GetFolderArcProps(&getProps); if (getProps) { - UInt32 numProps; - if (getProps->GetNumberOfArchiveProperties(&numProps) == S_OK) + UInt32 numLevels; + if (getProps->GetArcNumLevels(&numLevels) != S_OK) + numLevels = 0; + for (UInt32 level2 = 0; level2 < numLevels; level2++) { - if (numProps > 0) - message += kSeparator; - for (UInt32 i = 0; i < numProps; i++) { - CMyComBSTR name; - PROPID propID; - VARTYPE vt; - if (getProps->GetArchivePropertyInfo(i, &name, &propID, &vt) != S_OK) - continue; - NCOM::CPropVariant prop; - if (getProps->GetArchiveProperty(propID, &prop) != S_OK) - continue; - AddPropertyString(propID, name, prop, message); + UInt32 level = numLevels - 1 - level2; + UInt32 numProps; + if (getProps->GetArcNumProps(level, &numProps) == S_OK) + { + message += kSeparator; + for (Int32 i = -2; i < (Int32)numProps; i++) + { + CMyComBSTR name; + PROPID propID; + VARTYPE vt; + if (i == -2) + propID = kpidPath; + else if (i == -1) + propID = kpidType; + else if (getProps->GetArcPropInfo(level, i, &name, &propID, &vt) != S_OK) + continue; + NCOM::CPropVariant prop; + if (getProps->GetArcProp(level, propID, &prop) != S_OK) + continue; + AddPropertyString(propID, name, prop, message); + } + } + } + if (level2 != numLevels - 1) + { + UInt32 level = numLevels - 1 - level2; + UInt32 numProps; + if (getProps->GetArcNumProps2(level, &numProps) == S_OK) + { + message += kSeparatorSmall; + for (Int32 i = 0; i < (Int32)numProps; i++) + { + CMyComBSTR name; + PROPID propID; + VARTYPE vt; + if (getProps->GetArcPropInfo2(level, i, &name, &propID, &vt) != S_OK) + continue; + NCOM::CPropVariant prop; + if (getProps->GetArcProp2(level, propID, &prop) != S_OK) + continue; + AddPropertyString(propID, name, prop, message); + } + } } } } @@ -212,9 +242,9 @@ void CPanel::EditCut() void CPanel::EditCopy() { /* - CMyComPtr getFolderArchiveProperties; - _folder.QueryInterface(IID_IGetFolderArchiveProperties, &getFolderArchiveProperties); - if (!getFolderArchiveProperties) + CMyComPtr getFolderArcProps; + _folder.QueryInterface(IID_IGetFolderArcProps, &getFolderArcProps); + if (!getFolderArcProps) { InvokeSystemCommand("copy"); return; @@ -445,13 +475,15 @@ void CPanel::CreateSevenZipMenu(HMENU menuSpec, bool sevenZipMenuCreated = false; - CMyComPtr contextMenu; - contextMenu = new CZipContextMenu; + CZipContextMenu *contextMenuSpec = new CZipContextMenu; + CMyComPtr contextMenu = contextMenuSpec; // if (contextMenu.CoCreateInstance(CLSID_CZipContextMenu, IID_IContextMenu) == S_OK) { + /* CMyComPtr initContextMenu; if (contextMenu.QueryInterface(IID_IInitContextMenu, &initContextMenu) != S_OK) return; + */ UString currentFolderUnicode = _currentFolderPrefix; UStringVector names; int i; @@ -462,7 +494,7 @@ void CPanel::CreateSevenZipMenu(HMENU menuSpec, namePointers.Add(names[i]); // NFile::NDirectory::MySetCurrentDirectory(currentFolderUnicode); - if (initContextMenu->InitContextMenu(currentFolderUnicode, &namePointers.Front(), + if (contextMenuSpec->InitContextMenu(currentFolderUnicode, &namePointers.Front(), operatedIndices.Size()) == S_OK) { HRESULT res = contextMenu->QueryContextMenu(menu, 0, kSevenZipStartMenuID, diff --git a/CPP/7zip/UI/FileManager/PluginInterface.h b/CPP/7zip/UI/FileManager/PluginInterface.h index 905aff9a..72711fde 100755 --- a/CPP/7zip/UI/FileManager/PluginInterface.h +++ b/CPP/7zip/UI/FileManager/PluginInterface.h @@ -1,42 +1,31 @@ // PluginInterface.h -#ifndef __PLUGININTERFACE_H -#define __PLUGININTERFACE_H +#ifndef __PLUGIN_INTERFACE_H +#define __PLUGIN_INTERFACE_H -#include "Common/MyString.h" +/* +#include "../../../Common/Types.h" +#include "../../IDecl.h" -// {23170F69-40C1-278D-0000-000100010000} -DEFINE_GUID(IID_IInitContextMenu, -0x23170F69, 0x40C1, 0x278D, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00); -MIDL_INTERFACE("23170F69-40C1-278D-0000-000100010000") -IInitContextMenu: public IUnknown -{ -public: - STDMETHOD(InitContextMenu)(const wchar_t *aFolder, const wchar_t **aNames, UINT32 aNumFiles) PURE; +#define PLUGIN_INTERFACE(i, x) DECL_INTERFACE(i, 0x0A, x) +PLUGIN_INTERFACE(IInitContextMenu, 0x00) +{ + STDMETHOD(InitContextMenu)(const wchar_t *folder, const wchar_t **names, UINT32 numFiles) PURE; }; -// {23170F69-40C1-278D-0000-000100020100} -DEFINE_GUID(IID_IPluginOptionsCallback, -0x23170F69, 0x40C1, 0x278D, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00); -MIDL_INTERFACE("23170F69-40C1-278D-0000-000100020000") -IPluginOptionsCallback: public IUnknown +PLUGIN_INTERFACE(IPluginOptionsCallback, 0x01) { -public: STDMETHOD(GetProgramFolderPath)(BSTR *value) PURE; STDMETHOD(GetProgramPath)(BSTR *value) PURE; STDMETHOD(GetRegistryCUPath)(BSTR *value) PURE; }; -// {23170F69-40C1-278D-0000-000100020000} -DEFINE_GUID(IID_IPluginOptions, -0x23170F69, 0x40C1, 0x278D, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00); -MIDL_INTERFACE("23170F69-40C1-278D-0000-000100020000") -IPluginOptions: public IUnknown +PLUGIN_INTERFACE(IPluginOptions, 0x02) { -public: STDMETHOD(PluginOptions)(HWND hWnd, IPluginOptionsCallback *callback) PURE; // STDMETHOD(GetFileExtensions)(BSTR *extensions) PURE; }; +*/ #endif diff --git a/CPP/7zip/UI/FileManager/makefile b/CPP/7zip/UI/FileManager/makefile index 01016038..eeca66f9 100755 --- a/CPP/7zip/UI/FileManager/makefile +++ b/CPP/7zip/UI/FileManager/makefile @@ -65,7 +65,6 @@ FM_OBJS = \ $O\MessagesDialog.obj \ $O\OverwriteDialog.obj \ $O\PasswordDialog.obj \ - $O\PluginsPage.obj \ $O\ProgressDialog2.obj \ $O\SettingsPage.obj \ $O\SplitDialog.obj \ -- cgit v1.2.3