From 051769bbc577aeede90558b6ab5c9be187940ca0 Mon Sep 17 00:00:00 2001 From: Igor Pavlov Date: Mon, 27 Aug 2007 00:00:00 +0000 Subject: 4.53 beta --- CPP/7zip/UI/Explorer/ContextMenu.cpp | 10 +- CPP/7zip/UI/Explorer/ContextMenu.h | 4 +- CPP/7zip/UI/Explorer/DllExports.cpp | 28 +-- CPP/7zip/UI/Explorer/Explorer.dsp | 288 ++--------------------- CPP/7zip/UI/Explorer/FoldersPage.cpp | 157 ++++++++++++ CPP/7zip/UI/Explorer/FoldersPage.h | 30 +++ CPP/7zip/UI/Explorer/FoldersPage.rc | 36 +++ CPP/7zip/UI/Explorer/FoldersPage/FoldersPage.cpp | 157 ------------ CPP/7zip/UI/Explorer/FoldersPage/FoldersPage.h | 30 --- CPP/7zip/UI/Explorer/FoldersPage/resource.h | 12 - CPP/7zip/UI/Explorer/FoldersPage/resource.rc | 36 --- CPP/7zip/UI/Explorer/FoldersPageRes.h | 12 + CPP/7zip/UI/Explorer/MyMessages.cpp | 2 +- CPP/7zip/UI/Explorer/OptionsDialog.cpp | 10 +- CPP/7zip/UI/Explorer/OptionsDialog.h | 2 +- CPP/7zip/UI/Explorer/SystemPage.cpp | 213 +++++++++++++++++ CPP/7zip/UI/Explorer/SystemPage.h | 25 ++ CPP/7zip/UI/Explorer/SystemPage.rc | 24 ++ CPP/7zip/UI/Explorer/SystemPage/SystemPage.cpp | 212 ----------------- CPP/7zip/UI/Explorer/SystemPage/SystemPage.h | 25 -- CPP/7zip/UI/Explorer/SystemPage/resource.h | 6 - CPP/7zip/UI/Explorer/SystemPage/resource.rc | 24 -- CPP/7zip/UI/Explorer/SystemPageRes.h | 6 + CPP/7zip/UI/Explorer/makefile | 56 +---- CPP/7zip/UI/Explorer/resource.rc | 4 +- 25 files changed, 546 insertions(+), 863 deletions(-) create mode 100755 CPP/7zip/UI/Explorer/FoldersPage.cpp create mode 100755 CPP/7zip/UI/Explorer/FoldersPage.h create mode 100755 CPP/7zip/UI/Explorer/FoldersPage.rc delete mode 100755 CPP/7zip/UI/Explorer/FoldersPage/FoldersPage.cpp delete mode 100755 CPP/7zip/UI/Explorer/FoldersPage/FoldersPage.h delete mode 100755 CPP/7zip/UI/Explorer/FoldersPage/resource.h delete mode 100755 CPP/7zip/UI/Explorer/FoldersPage/resource.rc create mode 100755 CPP/7zip/UI/Explorer/FoldersPageRes.h create mode 100755 CPP/7zip/UI/Explorer/SystemPage.cpp create mode 100755 CPP/7zip/UI/Explorer/SystemPage.h create mode 100755 CPP/7zip/UI/Explorer/SystemPage.rc delete mode 100755 CPP/7zip/UI/Explorer/SystemPage/SystemPage.cpp delete mode 100755 CPP/7zip/UI/Explorer/SystemPage/SystemPage.h delete mode 100755 CPP/7zip/UI/Explorer/SystemPage/resource.h delete mode 100755 CPP/7zip/UI/Explorer/SystemPage/resource.rc create mode 100755 CPP/7zip/UI/Explorer/SystemPageRes.h (limited to 'CPP/7zip/UI/Explorer') diff --git a/CPP/7zip/UI/Explorer/ContextMenu.cpp b/CPP/7zip/UI/Explorer/ContextMenu.cpp index 53f778cc..06210412 100755 --- a/CPP/7zip/UI/Explorer/ContextMenu.cpp +++ b/CPP/7zip/UI/Explorer/ContextMenu.cpp @@ -19,14 +19,14 @@ #include "Windows/Menu.h" #include "Windows/ResourceString.h" -#include "../../FileManager/FormatUtils.h" -#include "../../FileManager/ProgramLocation.h" +#include "../FileManager/FormatUtils.h" +#include "../FileManager/ProgramLocation.h" #include "../Common/ZipRegistry.h" #include "../Common/ArchiveName.h" #ifdef LANG -#include "../../FileManager/LangUtils.h" +#include "../FileManager/LangUtils.h" #endif #include "resource.h" @@ -37,7 +37,7 @@ // #include "CompressEngine.h" #include "MyMessages.h" -#include "../Resource/Extract/resource.h" +#include "../GUI/ExtractRes.h" #include "../Common/CompressCall.h" using namespace NWindows; @@ -311,7 +311,7 @@ static UString GetReducedString(const UString &s) static const wchar_t *kExtractExludeExtensions[] = { - L"txt", L"htm", L"html", L"xml", L"doc", L"xls", + L"txt", L"htm", L"html", L"xml", L"bmp", L"gif", L"jpeg", L"jpg" }; diff --git a/CPP/7zip/UI/Explorer/ContextMenu.h b/CPP/7zip/UI/Explorer/ContextMenu.h index 9ab80dfd..88b33178 100755 --- a/CPP/7zip/UI/Explorer/ContextMenu.h +++ b/CPP/7zip/UI/Explorer/ContextMenu.h @@ -9,8 +9,8 @@ DEFINE_GUID(CLSID_CZipContextMenu, #include "Common/MyString.h" -#include "../../FileManager/PluginInterface.h" -#include "../../FileManager/MyCom2.h" +#include "../FileManager/PluginInterface.h" +#include "../FileManager/MyCom2.h" class CZipContextMenu: diff --git a/CPP/7zip/UI/Explorer/DllExports.cpp b/CPP/7zip/UI/Explorer/DllExports.cpp index fb7daf04..6072e92a 100755 --- a/CPP/7zip/UI/Explorer/DllExports.cpp +++ b/CPP/7zip/UI/Explorer/DllExports.cpp @@ -20,9 +20,8 @@ #include "Windows/DLL.h" #include "Windows/Registry.h" -#include "../../IPassword.h" -#include "../../FileManager/LangUtils.h" -#include "../Agent/Agent.h" +#include "../FileManager/LangUtils.h" +#include "../FileManager/IFolder.h" #include "ContextMenu.h" #include "OptionsDialog.h" @@ -51,7 +50,6 @@ public: CShellExtClassFactory() { InterlockedIncrement(&g_DllRefCount); } ~CShellExtClassFactory() { InterlockedDecrement(&g_DllRefCount); } - MY_UNKNOWN_IMP1_MT(IClassFactory) STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID, void**); @@ -258,16 +256,6 @@ STDAPI CreateObject( LoadLangOneTime(); COM_TRY_BEGIN *outObject = 0; - if (*classID == CLSID_CAgentArchiveHandler) - { - if (*interfaceID == IID_IFolderManager) - { - CMyComPtr manager = new CArchiveFolderManager; - *outObject = manager.Detach(); - return S_OK; - } - return E_NOINTERFACE; - } if (*classID == CLSID_CSevenZipOptions) { if (*interfaceID == IID_IPluginOptions) @@ -291,13 +279,6 @@ STDAPI GetPluginProperty(PROPID propID, PROPVARIANT *value) if ((value->bstrVal = ::SysAllocString(L"7-Zip")) != 0) value->vt = VT_BSTR; return S_OK; - case NPlugin::kClassID: - { - if ((value->bstrVal = ::SysAllocStringByteLen( - (const char *)&CLSID_CAgentArchiveHandler, sizeof(GUID))) != 0) - value->vt = VT_BSTR; - return S_OK; - } case NPlugin::kOptionsClassID: { if ((value->bstrVal = ::SysAllocStringByteLen( @@ -305,11 +286,6 @@ STDAPI GetPluginProperty(PROPID propID, PROPVARIANT *value) value->vt = VT_BSTR; return S_OK; } - /* - case NArchive::kType: - propVariant = UINT32(0); - break; - */ } return S_OK; } diff --git a/CPP/7zip/UI/Explorer/Explorer.dsp b/CPP/7zip/UI/Explorer/Explorer.dsp index 586d9aae..2f9252c7 100755 --- a/CPP/7zip/UI/Explorer/Explorer.dsp +++ b/CPP/7zip/UI/Explorer/Explorer.dsp @@ -45,7 +45,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 1 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXPLORER_EXPORTS" /YX /FD /c -# ADD CPP /nologo /Gz /MD /W3 /GX /O1 /I "..\..\..\\" /D "NDEBUG" /D "_MBCS" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "EXPLORER_EXPORTS" /D "LANG" /D "NEW_FOLDER_INTERFACE" /D "EXTERNAL_CODECS" /Yu"StdAfx.h" /FD /c +# ADD CPP /nologo /Gz /MD /W3 /GX /O1 /I "..\..\..\\" /D "NDEBUG" /D "_MBCS" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "EXPLORER_EXPORTS" /D "LANG" /Yu"StdAfx.h" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "NDEBUG" @@ -72,7 +72,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 1 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXPLORER_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /Gz /MTd /W3 /Gm /GX /ZI /Od /I "..\..\..\\" /D "_DEBUG" /D "_MBCS" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "EXPLORER_EXPORTS" /D "LANG" /D "NEW_FOLDER_INTERFACE" /D "EXTERNAL_CODECS" /Yu"StdAfx.h" /FD /GZ /c +# ADD CPP /nologo /Gz /MTd /W3 /Gm /GX /ZI /Od /I "..\..\..\\" /D "_DEBUG" /D "_MBCS" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "EXPLORER_EXPORTS" /D "LANG" /Yu"StdAfx.h" /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "_DEBUG" @@ -99,7 +99,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 1 # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "EXPLORER_EXPORTS" /D "LANG" /D "_MBCS" /Yu"StdAfx.h" /FD /c -# ADD CPP /nologo /Gz /MD /W3 /GX /O1 /I "..\..\..\\" /D "NDEBUG" /D "_UNICODE" /D "UNICODE" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "EXPLORER_EXPORTS" /D "LANG" /D "NEW_FOLDER_INTERFACE" /D "EXTERNAL_CODECS" /Yu"StdAfx.h" /FD /c +# ADD CPP /nologo /Gz /MD /W3 /GX /O1 /I "..\..\..\\" /D "NDEBUG" /D "_UNICODE" /D "UNICODE" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "EXPLORER_EXPORTS" /D "LANG" /Yu"StdAfx.h" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "NDEBUG" @@ -128,7 +128,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 1 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "EXPLORER_EXPORTS" /D "LANG" /D "_MBCS" /Yu"StdAfx.h" /FD /GZ /c -# ADD CPP /nologo /Gz /MTd /W3 /Gm /GX /ZI /Od /I "..\..\..\\" /D "_DEBUG" /D "_UNICODE" /D "UNICODE" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "EXPLORER_EXPORTS" /D "LANG" /D "NEW_FOLDER_INTERFACE" /D "EXTERNAL_CODECS" /Yu"StdAfx.h" /FD /GZ /c +# ADD CPP /nologo /Gz /MTd /W3 /Gm /GX /ZI /Od /I "..\..\..\\" /D "_DEBUG" /D "_UNICODE" /D "UNICODE" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "EXPLORER_EXPORTS" /D "LANG" /Yu"StdAfx.h" /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "_DEBUG" @@ -182,14 +182,6 @@ SOURCE=.\StdAfx.h # PROP Default_Filter "" # Begin Source File -SOURCE=..\Common\ArchiveExtractCallback.cpp -# End Source File -# Begin Source File - -SOURCE=..\Common\ArchiveExtractCallback.h -# End Source File -# Begin Source File - SOURCE=..\Common\ArchiveName.cpp # End Source File # Begin Source File @@ -198,14 +190,6 @@ SOURCE=..\Common\ArchiveName.h # End Source File # Begin Source File -SOURCE=..\Common\ArchiveOpenCallback.cpp -# End Source File -# Begin Source File - -SOURCE=..\Common\ArchiveOpenCallback.h -# End Source File -# Begin Source File - SOURCE=..\Common\CompressCall.cpp # End Source File # Begin Source File @@ -214,106 +198,6 @@ SOURCE=..\Common\CompressCall.h # End Source File # Begin Source File -SOURCE=..\Common\DefaultName.cpp -# End Source File -# Begin Source File - -SOURCE=..\Common\DefaultName.h -# End Source File -# Begin Source File - -SOURCE=..\Common\EnumDirItems.cpp -# End Source File -# Begin Source File - -SOURCE=..\Common\EnumDirItems.h -# End Source File -# Begin Source File - -SOURCE=..\Common\ExtractingFilePath.cpp -# End Source File -# Begin Source File - -SOURCE=..\Common\ExtractingFilePath.h -# End Source File -# Begin Source File - -SOURCE=..\Common\HandlerLoader.h -# End Source File -# Begin Source File - -SOURCE=..\Common\LoadCodecs.cpp -# End Source File -# Begin Source File - -SOURCE=..\Common\LoadCodecs.h -# End Source File -# Begin Source File - -SOURCE=..\Common\OpenArchive.cpp -# End Source File -# Begin Source File - -SOURCE=..\Common\OpenArchive.h -# End Source File -# Begin Source File - -SOURCE=..\Common\PropIDUtils.cpp -# End Source File -# Begin Source File - -SOURCE=..\Common\PropIDUtils.h -# End Source File -# Begin Source File - -SOURCE=..\Common\SortUtils.cpp -# End Source File -# Begin Source File - -SOURCE=..\Common\SortUtils.h -# End Source File -# Begin Source File - -SOURCE=..\Common\UpdateAction.cpp -# End Source File -# Begin Source File - -SOURCE=..\Common\UpdateAction.h -# End Source File -# Begin Source File - -SOURCE=..\Common\UpdateCallback.cpp -# End Source File -# Begin Source File - -SOURCE=..\Common\UpdateCallback.h -# End Source File -# Begin Source File - -SOURCE=..\Common\UpdatePair.cpp -# End Source File -# Begin Source File - -SOURCE=..\Common\UpdatePair.h -# End Source File -# Begin Source File - -SOURCE=..\Common\UpdateProduce.cpp -# End Source File -# Begin Source File - -SOURCE=..\Common\UpdateProduce.h -# End Source File -# Begin Source File - -SOURCE=..\Common\WorkDir.cpp -# End Source File -# Begin Source File - -SOURCE=..\Common\WorkDir.h -# End Source File -# Begin Source File - SOURCE=..\Common\ZipRegistry.cpp # End Source File # Begin Source File @@ -343,86 +227,30 @@ SOURCE=.\MyMessages.h # End Group # Begin Group "Dialogs" -# PROP Default_Filter "" -# Begin Group "Options" - -# PROP Default_Filter "" -# Begin Group "SystemPage" - # PROP Default_Filter "" # Begin Source File -SOURCE=.\SystemPage\SystemPage.cpp +SOURCE=.\FoldersPage.cpp # End Source File # Begin Source File -SOURCE=.\SystemPage\SystemPage.h -# End Source File -# End Group -# Begin Group "FoldersPage" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\FoldersPage\FoldersPage.cpp -# End Source File -# Begin Source File - -SOURCE=.\FoldersPage\FoldersPage.h -# End Source File -# End Group -# End Group -# End Group -# Begin Group "Agent" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\Agent\Agent.cpp -# End Source File -# Begin Source File - -SOURCE=..\Agent\Agent.h -# End Source File -# Begin Source File - -SOURCE=..\Agent\AgentOut.cpp -# End Source File -# Begin Source File - -SOURCE=..\Agent\AgentProxy.cpp -# End Source File -# Begin Source File - -SOURCE=..\Agent\AgentProxy.h -# End Source File -# Begin Source File - -SOURCE=..\Agent\ArchiveFolder.cpp -# End Source File -# Begin Source File - -SOURCE=..\Agent\ArchiveFolderOpen.cpp +SOURCE=.\FoldersPage.h # End Source File # Begin Source File -SOURCE=..\Agent\ArchiveFolderOut.cpp +SOURCE=.\FoldersPageRes.h # End Source File # Begin Source File -SOURCE=..\Agent\IFileExtractCallback.h +SOURCE=.\SystemPage.cpp # End Source File # Begin Source File -SOURCE=..\Agent\IFolderArchive.h +SOURCE=.\SystemPage.h # End Source File # Begin Source File -SOURCE=..\Agent\UpdateCallbackAgent.cpp -# End Source File -# Begin Source File - -SOURCE=..\Agent\UpdateCallbackAgent.h +SOURCE=.\SystemPageRes.h # End Source File # End Group # Begin Group "FileManager" @@ -430,87 +258,47 @@ SOURCE=..\Agent\UpdateCallbackAgent.h # PROP Default_Filter "" # Begin Source File -SOURCE=..\..\FileManager\FormatUtils.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\FileManager\FormatUtils.h -# End Source File -# Begin Source File - -SOURCE=..\..\FileManager\HelpUtils.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\FileManager\HelpUtils.h -# End Source File -# Begin Source File - -SOURCE=..\..\FileManager\IFolder.h -# End Source File -# Begin Source File - -SOURCE=..\..\FileManager\LangUtils.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\FileManager\LangUtils.h +SOURCE=..\FileManager\FormatUtils.cpp # End Source File # Begin Source File -SOURCE=..\..\FileManager\ProgramLocation.cpp +SOURCE=..\FileManager\FormatUtils.h # End Source File # Begin Source File -SOURCE=..\..\FileManager\ProgramLocation.h +SOURCE=..\FileManager\HelpUtils.cpp # End Source File # Begin Source File -SOURCE=..\..\FileManager\RegistryUtils.cpp +SOURCE=..\FileManager\HelpUtils.h # End Source File # Begin Source File -SOURCE=..\..\FileManager\RegistryUtils.h +SOURCE=..\FileManager\IFolder.h # End Source File -# End Group -# Begin Group "7-zip common" - -# PROP Default_Filter "" # Begin Source File -SOURCE=..\..\Common\FilePathAutoRename.cpp +SOURCE=..\FileManager\LangUtils.cpp # End Source File # Begin Source File -SOURCE=..\..\Common\FilePathAutoRename.h +SOURCE=..\FileManager\LangUtils.h # End Source File # Begin Source File -SOURCE=..\..\Common\FileStreams.cpp +SOURCE=..\FileManager\ProgramLocation.cpp # End Source File # Begin Source File -SOURCE=..\..\Common\FileStreams.h +SOURCE=..\FileManager\ProgramLocation.h # End Source File # Begin Source File -SOURCE=..\..\Common\StreamUtils.cpp +SOURCE=..\FileManager\RegistryUtils.cpp # End Source File # Begin Source File -SOURCE=..\..\Common\StreamUtils.h -# End Source File -# End Group -# Begin Group "Compress" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\..\Compress\Copy\CopyCoder.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\Compress\Copy\CopyCoder.h +SOURCE=..\FileManager\RegistryUtils.h # End Source File # End Group # Begin Group "C" @@ -518,24 +306,6 @@ SOURCE=..\..\Compress\Copy\CopyCoder.h # PROP Default_Filter "" # Begin Source File -SOURCE=..\..\..\..\C\Alloc.c -# SUBTRACT CPP /YX /Yc /Yu -# End Source File -# Begin Source File - -SOURCE=..\..\..\..\C\Alloc.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\..\C\Sort.c -# SUBTRACT CPP /YX /Yc /Yu -# End Source File -# Begin Source File - -SOURCE=..\..\..\..\C\Sort.h -# End Source File -# Begin Source File - SOURCE=..\..\..\..\C\Threads.c # SUBTRACT CPP /YX /Yc /Yu # End Source File @@ -745,22 +515,6 @@ SOURCE=..\..\..\Windows\Menu.h # End Source File # Begin Source File -SOURCE=..\..\..\Windows\PropVariant.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\..\Windows\PropVariant.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\Windows\PropVariantConversions.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\..\Windows\PropVariantConversions.h -# End Source File -# Begin Source File - SOURCE=..\..\..\Windows\Registry.cpp # End Source File # Begin Source File diff --git a/CPP/7zip/UI/Explorer/FoldersPage.cpp b/CPP/7zip/UI/Explorer/FoldersPage.cpp new file mode 100755 index 00000000..b3470390 --- /dev/null +++ b/CPP/7zip/UI/Explorer/FoldersPage.cpp @@ -0,0 +1,157 @@ +// FoldersPage.cpp + +#include "StdAfx.h" + +#include "FoldersPageRes.h" +#include "FoldersPage.h" + +#include "Common/StringConvert.h" +#include "Windows/Defs.h" +#include "Windows/Shell.h" +#include "Windows/ResourceString.h" + +#include "../Common/ZipRegistry.h" + +#include "../FileManager/HelpUtils.h" +#include "../FileManager/LangUtils.h" + +using namespace NWindows; + +static CIDLangPair kIDLangPairs[] = +{ + { IDC_FOLDERS_STATIC_WORKING_FOLDER, 0x01000210 }, + { IDC_FOLDERS_WORK_RADIO_SYSTEM, 0x01000211 }, + { IDC_FOLDERS_WORK_RADIO_CURRENT, 0x01000212 }, + { IDC_FOLDERS_WORK_RADIO_SPECIFIED, 0x01000213 }, + { IDC_FOLDERS_WORK_CHECK_FOR_REMOVABLE, 0x01000214 } +}; + +static const int kWorkModeButtons[] = +{ + IDC_FOLDERS_WORK_RADIO_SYSTEM, + IDC_FOLDERS_WORK_RADIO_CURRENT, + IDC_FOLDERS_WORK_RADIO_SPECIFIED +}; + +static const int kNumWorkModeButtons = sizeof(kWorkModeButtons) / sizeof(kWorkModeButtons[0]); + +bool CFoldersPage::OnInit() +{ + LangSetDlgItemsText(HWND(*this), kIDLangPairs, sizeof(kIDLangPairs) / sizeof(kIDLangPairs[0])); + ReadWorkDirInfo(m_WorkDirInfo); + + CheckButton(IDC_FOLDERS_WORK_CHECK_FOR_REMOVABLE, m_WorkDirInfo.ForRemovableOnly); + + CheckRadioButton(kWorkModeButtons[0], kWorkModeButtons[kNumWorkModeButtons - 1], + kWorkModeButtons[m_WorkDirInfo.Mode]); + + m_WorkPath.Init(*this, IDC_FOLDERS_WORK_EDIT_PATH); + m_ButtonSetWorkPath.Init(*this, IDC_FOLDERS_WORK_BUTTON_PATH); + + m_WorkPath.SetText(m_WorkDirInfo.Path); + + MyEnableControls(); + + return CPropertyPage::OnInit(); +} + +int CFoldersPage::GetWorkMode() const +{ + for (int i = 0; i < kNumWorkModeButtons; i++) + if(IsButtonCheckedBool(kWorkModeButtons[i])) + return i; + throw 0; +} + +void CFoldersPage::MyEnableControls() +{ + bool enablePath = (GetWorkMode() == NWorkDir::NMode::kSpecified); + m_WorkPath.Enable(enablePath); + m_ButtonSetWorkPath.Enable(enablePath); +} + +void CFoldersPage::GetWorkDir(NWorkDir::CInfo &workDirInfo) +{ + m_WorkPath.GetText(workDirInfo.Path); + workDirInfo.ForRemovableOnly = IsButtonCheckedBool(IDC_FOLDERS_WORK_CHECK_FOR_REMOVABLE); + workDirInfo.Mode = NWorkDir::NMode::EEnum(GetWorkMode()); +} + +/* +bool CFoldersPage::WasChanged() +{ + NWorkDir::CInfo workDirInfo; + GetWorkDir(workDirInfo); + return (workDirInfo.Mode != m_WorkDirInfo.Mode || + workDirInfo.ForRemovableOnly != m_WorkDirInfo.ForRemovableOnly || + workDirInfo.Path.Compare(m_WorkDirInfo.Path) != 0); +} +*/ + +void CFoldersPage::ModifiedEvent() +{ + Changed(); + /* + if (WasChanged()) + Changed(); + else + UnChanged(); + */ +} + +bool CFoldersPage::OnButtonClicked(int buttonID, HWND buttonHWND) +{ + for (int i = 0; i < kNumWorkModeButtons; i++) + if (buttonID == kWorkModeButtons[i]) + { + MyEnableControls(); + ModifiedEvent(); + return true; + } + switch(buttonID) + { + case IDC_FOLDERS_WORK_BUTTON_PATH: + OnFoldersWorkButtonPath(); + break; + case IDC_FOLDERS_WORK_CHECK_FOR_REMOVABLE: + break; + default: + return CPropertyPage::OnButtonClicked(buttonID, buttonHWND); + } + ModifiedEvent(); + return true; +} + +bool CFoldersPage::OnCommand(int code, int itemID, LPARAM lParam) +{ + if (code == EN_CHANGE && itemID == IDC_FOLDERS_WORK_EDIT_PATH) + { + ModifiedEvent(); + return true; + } + return CPropertyPage::OnCommand(code, itemID, lParam); +} + +void CFoldersPage::OnFoldersWorkButtonPath() +{ + UString currentPath; + m_WorkPath.GetText(currentPath); + UString title = LangString(IDS_FOLDERS_SET_WORK_PATH_TITLE, 0x01000281); + UString resultPath; + if (NShell::BrowseForFolder(HWND(*this), title, currentPath, resultPath)) + m_WorkPath.SetText(resultPath); +} + +LONG CFoldersPage::OnApply() +{ + GetWorkDir(m_WorkDirInfo); + SaveWorkDirInfo(m_WorkDirInfo); + return PSNRET_NOERROR; +} + +static LPCWSTR kFoldersTopic = L"fm/plugins/7-zip/options.htm#folders"; + +void CFoldersPage::OnNotifyHelp() +{ + ShowHelpWindow(NULL, kFoldersTopic); +} diff --git a/CPP/7zip/UI/Explorer/FoldersPage.h b/CPP/7zip/UI/Explorer/FoldersPage.h new file mode 100755 index 00000000..be8a362f --- /dev/null +++ b/CPP/7zip/UI/Explorer/FoldersPage.h @@ -0,0 +1,30 @@ +// FoldersPage.h + +#ifndef __FOLDERSPAGE_H +#define __FOLDERSPAGE_H + +#include "Windows/Control/PropertyPage.h" + +#include "../Common/ZipRegistry.h" + +class CFoldersPage : public NWindows::NControl::CPropertyPage +{ + NWorkDir::CInfo m_WorkDirInfo; + + void MyEnableControls(); + void ModifiedEvent(); + NWindows::NControl::CDialogChildControl m_WorkPath; + NWindows::NControl::CDialogChildControl m_ButtonSetWorkPath; + void OnFoldersWorkButtonPath(); + int GetWorkMode() const; + void GetWorkDir(NWorkDir::CInfo &workDirInfo); + // bool WasChanged(); +public: + virtual bool OnInit(); + virtual bool OnCommand(int code, int itemID, LPARAM lParam); + virtual void OnNotifyHelp(); + virtual LONG OnApply(); + virtual bool OnButtonClicked(int buttonID, HWND buttonHWND); +}; + +#endif diff --git a/CPP/7zip/UI/Explorer/FoldersPage.rc b/CPP/7zip/UI/Explorer/FoldersPage.rc new file mode 100755 index 00000000..cb9694a6 --- /dev/null +++ b/CPP/7zip/UI/Explorer/FoldersPage.rc @@ -0,0 +1,36 @@ +#include "FoldersPageRes.h" +#include "../../GuiCommon.rc" + +#define xSize2 196 +#define ySize2 140 +#define xSize (xSize2 + marg + marg) +#define ySize (ySize2 + marg + marg) + +#define marg2 marg +#define marg3 10 +#define gPos (marg + marg2) +#define gSize (xSize2 - marg2 - marg2) +#define gPos2 (gPos + marg3) + + +IDD_FOLDERS DIALOG 0, 0, xSize, ySize MY_PAGE_STYLE +CAPTION "Folders" +MY_FONT +BEGIN + GROUPBOX "&Working folder", IDC_FOLDERS_STATIC_WORKING_FOLDER, marg, marg, xSize2, 98 + CONTROL "&System temp folder", IDC_FOLDERS_WORK_RADIO_SYSTEM, "Button", BS_AUTORADIOBUTTON | WS_GROUP, + gPos, 20, gSize, 10 + CONTROL "&Current", IDC_FOLDERS_WORK_RADIO_CURRENT, "Button", BS_AUTORADIOBUTTON, + gPos, 34, gSize, 10 + CONTROL "Specified:", IDC_FOLDERS_WORK_RADIO_SPECIFIED, "Button", BS_AUTORADIOBUTTON, + gPos, 48, gSize, 10 + EDITTEXT IDC_FOLDERS_WORK_EDIT_PATH, gPos2, 63, gSize - marg3 - bDotsSize - 10, 14, ES_AUTOHSCROLL + PUSHBUTTON "...", IDC_FOLDERS_WORK_BUTTON_PATH, xSize - marg - marg2 - bDotsSize, 63, bDotsSize, bYSize + CONTROL "Use for removable drives only", IDC_FOLDERS_WORK_CHECK_FOR_REMOVABLE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, + gPos, 87, gSize, 10 +END + +STRINGTABLE +BEGIN + IDS_FOLDERS_SET_WORK_PATH_TITLE "Specify a location for temporary archive files." +END diff --git a/CPP/7zip/UI/Explorer/FoldersPage/FoldersPage.cpp b/CPP/7zip/UI/Explorer/FoldersPage/FoldersPage.cpp deleted file mode 100755 index 776813d8..00000000 --- a/CPP/7zip/UI/Explorer/FoldersPage/FoldersPage.cpp +++ /dev/null @@ -1,157 +0,0 @@ -// FoldersPage.cpp - -#include "StdAfx.h" - -#include "resource.h" -#include "FoldersPage.h" - -#include "Common/StringConvert.h" -#include "Windows/Defs.h" -#include "Windows/Shell.h" -#include "Windows/ResourceString.h" - -#include "../../../FileManager/HelpUtils.h" -#include "../../Common/ZipRegistry.h" - -#include "../../../FileManager/LangUtils.h" - -using namespace NWindows; - -static CIDLangPair kIDLangPairs[] = -{ - { IDC_FOLDERS_STATIC_WORKING_FOLDER, 0x01000210 }, - { IDC_FOLDERS_WORK_RADIO_SYSTEM, 0x01000211 }, - { IDC_FOLDERS_WORK_RADIO_CURRENT, 0x01000212 }, - { IDC_FOLDERS_WORK_RADIO_SPECIFIED, 0x01000213 }, - { IDC_FOLDERS_WORK_CHECK_FOR_REMOVABLE, 0x01000214 } -}; - -static const int kWorkModeButtons[] = -{ - IDC_FOLDERS_WORK_RADIO_SYSTEM, - IDC_FOLDERS_WORK_RADIO_CURRENT, - IDC_FOLDERS_WORK_RADIO_SPECIFIED -}; - -static const int kNumWorkModeButtons = sizeof(kWorkModeButtons) / sizeof(kWorkModeButtons[0]); - -bool CFoldersPage::OnInit() -{ - LangSetDlgItemsText(HWND(*this), kIDLangPairs, sizeof(kIDLangPairs) / sizeof(kIDLangPairs[0])); - ReadWorkDirInfo(m_WorkDirInfo); - - CheckButton(IDC_FOLDERS_WORK_CHECK_FOR_REMOVABLE, m_WorkDirInfo.ForRemovableOnly); - - CheckRadioButton(kWorkModeButtons[0], kWorkModeButtons[kNumWorkModeButtons - 1], - kWorkModeButtons[m_WorkDirInfo.Mode]); - - m_WorkPath.Init(*this, IDC_FOLDERS_WORK_EDIT_PATH); - m_ButtonSetWorkPath.Init(*this, IDC_FOLDERS_WORK_BUTTON_PATH); - - m_WorkPath.SetText(m_WorkDirInfo.Path); - - MyEnableControls(); - - return CPropertyPage::OnInit(); -} - -int CFoldersPage::GetWorkMode() const -{ - for (int i = 0; i < kNumWorkModeButtons; i++) - if(IsButtonCheckedBool(kWorkModeButtons[i])) - return i; - throw 0; -} - -void CFoldersPage::MyEnableControls() -{ - bool enablePath = (GetWorkMode() == NWorkDir::NMode::kSpecified); - m_WorkPath.Enable(enablePath); - m_ButtonSetWorkPath.Enable(enablePath); -} - -void CFoldersPage::GetWorkDir(NWorkDir::CInfo &workDirInfo) -{ - m_WorkPath.GetText(workDirInfo.Path); - workDirInfo.ForRemovableOnly = IsButtonCheckedBool(IDC_FOLDERS_WORK_CHECK_FOR_REMOVABLE); - workDirInfo.Mode = NWorkDir::NMode::EEnum(GetWorkMode()); -} - -/* -bool CFoldersPage::WasChanged() -{ - NWorkDir::CInfo workDirInfo; - GetWorkDir(workDirInfo); - return (workDirInfo.Mode != m_WorkDirInfo.Mode || - workDirInfo.ForRemovableOnly != m_WorkDirInfo.ForRemovableOnly || - workDirInfo.Path.Compare(m_WorkDirInfo.Path) != 0); -} -*/ - -void CFoldersPage::ModifiedEvent() -{ - Changed(); - /* - if (WasChanged()) - Changed(); - else - UnChanged(); - */ -} - -bool CFoldersPage::OnButtonClicked(int buttonID, HWND buttonHWND) -{ - for (int i = 0; i < kNumWorkModeButtons; i++) - if (buttonID == kWorkModeButtons[i]) - { - MyEnableControls(); - ModifiedEvent(); - return true; - } - switch(buttonID) - { - case IDC_FOLDERS_WORK_BUTTON_PATH: - OnFoldersWorkButtonPath(); - break; - case IDC_FOLDERS_WORK_CHECK_FOR_REMOVABLE: - break; - default: - return CPropertyPage::OnButtonClicked(buttonID, buttonHWND); - } - ModifiedEvent(); - return true; -} - -bool CFoldersPage::OnCommand(int code, int itemID, LPARAM lParam) -{ - if (code == EN_CHANGE && itemID == IDC_FOLDERS_WORK_EDIT_PATH) - { - ModifiedEvent(); - return true; - } - return CPropertyPage::OnCommand(code, itemID, lParam); -} - -void CFoldersPage::OnFoldersWorkButtonPath() -{ - UString currentPath; - m_WorkPath.GetText(currentPath); - UString title = LangString(IDS_FOLDERS_SET_WORK_PATH_TITLE, 0x01000281); - UString resultPath; - if (NShell::BrowseForFolder(HWND(*this), title, currentPath, resultPath)) - m_WorkPath.SetText(resultPath); -} - -LONG CFoldersPage::OnApply() -{ - GetWorkDir(m_WorkDirInfo); - SaveWorkDirInfo(m_WorkDirInfo); - return PSNRET_NOERROR; -} - -static LPCWSTR kFoldersTopic = L"fm/plugins/7-zip/options.htm#folders"; - -void CFoldersPage::OnNotifyHelp() -{ - ShowHelpWindow(NULL, kFoldersTopic); -} diff --git a/CPP/7zip/UI/Explorer/FoldersPage/FoldersPage.h b/CPP/7zip/UI/Explorer/FoldersPage/FoldersPage.h deleted file mode 100755 index 97950fc6..00000000 --- a/CPP/7zip/UI/Explorer/FoldersPage/FoldersPage.h +++ /dev/null @@ -1,30 +0,0 @@ -// FoldersPage.h - -#ifndef __FOLDERSPAGE_H -#define __FOLDERSPAGE_H - -#include "Windows/Control/PropertyPage.h" - -#include "../../Common/ZipRegistry.h" - -class CFoldersPage : public NWindows::NControl::CPropertyPage -{ - NWorkDir::CInfo m_WorkDirInfo; - - void MyEnableControls(); - void ModifiedEvent(); - NWindows::NControl::CDialogChildControl m_WorkPath; - NWindows::NControl::CDialogChildControl m_ButtonSetWorkPath; - void OnFoldersWorkButtonPath(); - int GetWorkMode() const; - void GetWorkDir(NWorkDir::CInfo &workDirInfo); - // bool WasChanged(); -public: - virtual bool OnInit(); - virtual bool OnCommand(int code, int itemID, LPARAM lParam); - virtual void OnNotifyHelp(); - virtual LONG OnApply(); - virtual bool OnButtonClicked(int buttonID, HWND buttonHWND); -}; - -#endif diff --git a/CPP/7zip/UI/Explorer/FoldersPage/resource.h b/CPP/7zip/UI/Explorer/FoldersPage/resource.h deleted file mode 100755 index 3052409b..00000000 --- a/CPP/7zip/UI/Explorer/FoldersPage/resource.h +++ /dev/null @@ -1,12 +0,0 @@ -#define IDD_FOLDERS 900 - -#define IDS_FOLDERS_SET_WORK_PATH_TITLE 103 - -#define IDC_FOLDERS_STATIC_WORKING_FOLDER 1001 - -#define IDC_FOLDERS_WORK_RADIO_SYSTEM 1011 -#define IDC_FOLDERS_WORK_RADIO_CURRENT 1012 -#define IDC_FOLDERS_WORK_RADIO_SPECIFIED 1013 -#define IDC_FOLDERS_WORK_EDIT_PATH 1014 -#define IDC_FOLDERS_WORK_BUTTON_PATH 1015 -#define IDC_FOLDERS_WORK_CHECK_FOR_REMOVABLE 1017 diff --git a/CPP/7zip/UI/Explorer/FoldersPage/resource.rc b/CPP/7zip/UI/Explorer/FoldersPage/resource.rc deleted file mode 100755 index 96b2c9d3..00000000 --- a/CPP/7zip/UI/Explorer/FoldersPage/resource.rc +++ /dev/null @@ -1,36 +0,0 @@ -#include "resource.h" -#include "../../../GuiCommon.rc" - -#define xSize2 196 -#define ySize2 140 -#define xSize (xSize2 + marg + marg) -#define ySize (ySize2 + marg + marg) - -#define marg2 marg -#define marg3 10 -#define gPos (marg + marg2) -#define gSize (xSize2 - marg2 - marg2) -#define gPos2 (gPos + marg3) - - -IDD_FOLDERS DIALOG 0, 0, xSize, ySize MY_PAGE_STYLE -CAPTION "Folders" -MY_FONT -BEGIN - GROUPBOX "&Working folder", IDC_FOLDERS_STATIC_WORKING_FOLDER, marg, marg, xSize2, 98 - CONTROL "&System temp folder", IDC_FOLDERS_WORK_RADIO_SYSTEM, "Button", BS_AUTORADIOBUTTON | WS_GROUP, - gPos, 20, gSize, 10 - CONTROL "&Current", IDC_FOLDERS_WORK_RADIO_CURRENT, "Button", BS_AUTORADIOBUTTON, - gPos, 34, gSize, 10 - CONTROL "Specified:", IDC_FOLDERS_WORK_RADIO_SPECIFIED, "Button", BS_AUTORADIOBUTTON, - gPos, 48, gSize, 10 - EDITTEXT IDC_FOLDERS_WORK_EDIT_PATH, gPos2, 63, gSize - marg3 - bDotsSize - 10, 14, ES_AUTOHSCROLL - PUSHBUTTON "...", IDC_FOLDERS_WORK_BUTTON_PATH, xSize - marg - marg2 - bDotsSize, 63, bDotsSize, bYSize - CONTROL "Use for removable drives only", IDC_FOLDERS_WORK_CHECK_FOR_REMOVABLE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, - gPos, 87, gSize, 10 -END - -STRINGTABLE -BEGIN - IDS_FOLDERS_SET_WORK_PATH_TITLE "Specify a location for temporary archive files." -END diff --git a/CPP/7zip/UI/Explorer/FoldersPageRes.h b/CPP/7zip/UI/Explorer/FoldersPageRes.h new file mode 100755 index 00000000..3052409b --- /dev/null +++ b/CPP/7zip/UI/Explorer/FoldersPageRes.h @@ -0,0 +1,12 @@ +#define IDD_FOLDERS 900 + +#define IDS_FOLDERS_SET_WORK_PATH_TITLE 103 + +#define IDC_FOLDERS_STATIC_WORKING_FOLDER 1001 + +#define IDC_FOLDERS_WORK_RADIO_SYSTEM 1011 +#define IDC_FOLDERS_WORK_RADIO_CURRENT 1012 +#define IDC_FOLDERS_WORK_RADIO_SPECIFIED 1013 +#define IDC_FOLDERS_WORK_EDIT_PATH 1014 +#define IDC_FOLDERS_WORK_BUTTON_PATH 1015 +#define IDC_FOLDERS_WORK_CHECK_FOR_REMOVABLE 1017 diff --git a/CPP/7zip/UI/Explorer/MyMessages.cpp b/CPP/7zip/UI/Explorer/MyMessages.cpp index a29581be..58ab1f85 100755 --- a/CPP/7zip/UI/Explorer/MyMessages.cpp +++ b/CPP/7zip/UI/Explorer/MyMessages.cpp @@ -8,7 +8,7 @@ #include "Windows/ResourceString.h" #ifdef LANG -#include "../../FileManager/LangUtils.h" +#include "../FileManager/LangUtils.h" #endif using namespace NWindows; diff --git a/CPP/7zip/UI/Explorer/OptionsDialog.cpp b/CPP/7zip/UI/Explorer/OptionsDialog.cpp index b7831afd..4b2d3b51 100755 --- a/CPP/7zip/UI/Explorer/OptionsDialog.cpp +++ b/CPP/7zip/UI/Explorer/OptionsDialog.cpp @@ -9,11 +9,11 @@ #include "Common/StringConvert.h" #include "Windows/Control/PropertyPage.h" -#include "../../FileManager/LangUtils.h" -#include "FoldersPage/FoldersPage.h" -#include "FoldersPage/resource.h" -#include "SystemPage/SystemPage.h" -#include "SystemPage/resource.h" +#include "../FileManager/LangUtils.h" +#include "FoldersPage.h" +#include "FoldersPageRes.h" +#include "SystemPage.h" +#include "SystemPageRes.h" using namespace NWindows; diff --git a/CPP/7zip/UI/Explorer/OptionsDialog.h b/CPP/7zip/UI/Explorer/OptionsDialog.h index 7e85d357..affa4329 100755 --- a/CPP/7zip/UI/Explorer/OptionsDialog.h +++ b/CPP/7zip/UI/Explorer/OptionsDialog.h @@ -3,7 +3,7 @@ #ifndef __SEVENZIP_OPTIONSDIALOG_H #define __SEVENZIP_OPTIONSDIALOG_H -#include "../../FileManager/PluginInterface.h" +#include "../FileManager/PluginInterface.h" #include "Common/MyCom.h" // {23170F69-40C1-278D-1000-000100020000} diff --git a/CPP/7zip/UI/Explorer/SystemPage.cpp b/CPP/7zip/UI/Explorer/SystemPage.cpp new file mode 100755 index 00000000..dd60b6d5 --- /dev/null +++ b/CPP/7zip/UI/Explorer/SystemPage.cpp @@ -0,0 +1,213 @@ +// SystemPage.cpp + +#include "StdAfx.h" + +#include "resource.h" +#include "SystemPageRes.h" +#include "SystemPage.h" + +#include "Common/StringConvert.h" +#include "Windows/Defs.h" +#include "Windows/Control/ListView.h" + +#include "../Common/ZipRegistry.h" + +#include "../FileManager/HelpUtils.h" +#include "../FileManager/LangUtils.h" +#include "../FileManager/FormatUtils.h" + +#include "RegistryContextMenu.h" +#include "ContextMenuFlags.h" + +using namespace NContextMenuFlags; + +static CIDLangPair kIDLangPairs[] = +{ + { IDC_SYSTEM_INTEGRATE_TO_CONTEXT_MENU, 0x01000301}, + { IDC_SYSTEM_CASCADED_MENU, 0x01000302}, + { IDC_SYSTEM_STATIC_CONTEXT_MENU_ITEMS, 0x01000310} +}; + +static LPCWSTR kSystemTopic = L"fm/plugins/7-zip/options.htm#system"; + +struct CContextMenuItem +{ + int ControlID; + UInt32 LangID; + UInt32 Flag; +}; + +static CContextMenuItem kMenuItems[] = +{ + { IDS_CONTEXT_OPEN, 0x02000103, kOpen}, + { IDS_CONTEXT_EXTRACT, 0x02000105, kExtract}, + { IDS_CONTEXT_EXTRACT_HERE, 0x0200010B, kExtractHere }, + { IDS_CONTEXT_EXTRACT_TO, 0x0200010D, kExtractTo }, + + { IDS_CONTEXT_TEST, 0x02000109, kTest}, + + { IDS_CONTEXT_COMPRESS, 0x02000107, kCompress }, + { IDS_CONTEXT_COMPRESS_EMAIL, 0x02000111, kCompressEmail }, + { IDS_CONTEXT_COMPRESS_TO, 0x0200010F, kCompressTo7z }, + { IDS_CONTEXT_COMPRESS_TO_EMAIL, 0x02000113, kCompressTo7zEmail}, + { IDS_CONTEXT_COMPRESS_TO, 0x0200010F, kCompressToZip }, + { IDS_CONTEXT_COMPRESS_TO_EMAIL, 0x02000113, kCompressToZipEmail} +}; + +const int kNumMenuItems = sizeof(kMenuItems) / sizeof(kMenuItems[0]); + +bool CSystemPage::OnInit() +{ + _initMode = true; + LangSetDlgItemsText(HWND(*this), kIDLangPairs, sizeof(kIDLangPairs) / sizeof(kIDLangPairs[0])); + + CheckButton(IDC_SYSTEM_INTEGRATE_TO_CONTEXT_MENU, + NZipRootRegistry::CheckContextMenuHandler()); + + CheckButton(IDC_SYSTEM_CASCADED_MENU, ReadCascadedMenu()); + + UInt32 contextMenuFlags; + if (!ReadContextMenuStatus(contextMenuFlags)) + contextMenuFlags = NContextMenuFlags::GetDefaultFlags(); + + m_ListView.Attach(GetItem(IDC_SYSTEM_OPTIONS_LIST)); + + /* + CheckButton(IDC_SYSTEM_INTEGRATE_TO_CONTEXT_MENU, + NRegistryAssociations::CheckContextMenuHandler()); + */ + + UInt32 newFlags = LVS_EX_CHECKBOXES | LVS_EX_FULLROWSELECT; + m_ListView.SetExtendedListViewStyle(newFlags, newFlags); + + UString s; // = TEXT("Items"); // LangLoadString(IDS_PROPERTY_EXTENSION, 0x02000205); + LVCOLUMNW column; + column.mask = LVCF_WIDTH | LVCF_TEXT | LVCF_FMT | LVCF_SUBITEM; + column.cx = 270; + column.fmt = LVCFMT_LEFT; + column.pszText = (LPWSTR)(LPCWSTR)s; + column.iSubItem = 0; + m_ListView.InsertColumn(0, &column); + + for (int i = 0; i < kNumMenuItems; i++) + { + CContextMenuItem &menuItem = kMenuItems[i]; + LVITEMW item; + item.iItem = i; + item.mask = LVIF_TEXT | LVIF_PARAM; + item.lParam = i; + + UString s = LangString(menuItem.ControlID, menuItem.LangID); + + switch(menuItem.ControlID) + { + case IDS_CONTEXT_EXTRACT_TO: + { + s = MyFormatNew(s, LangString(IDS_CONTEXT_FOLDER, 0x02000140)); + break; + } + case IDS_CONTEXT_COMPRESS_TO: + case IDS_CONTEXT_COMPRESS_TO_EMAIL: + { + UString s2 = LangString(IDS_CONTEXT_ARCHIVE, 0x02000141); + switch(menuItem.Flag) + { + case kCompressTo7z: + case kCompressTo7zEmail: + s2 += L".7z"; + break; + case kCompressToZip: + case kCompressToZipEmail: + s2 += L".zip"; + break; + } + s = MyFormatNew(s, s2); + break; + } + } + + // UString MyFormatNew(const UString &format, const UString &argument); + + item.pszText = (LPWSTR)(LPCWSTR)s; + item.iSubItem = 0; + int itemIndex = m_ListView.InsertItem(&item); + m_ListView.SetCheckState(itemIndex, ((contextMenuFlags & menuItem.Flag) != 0)); + } + + _initMode = false; + return CPropertyPage::OnInit(); +} + +STDAPI DllRegisterServer(void); +STDAPI DllUnregisterServer(void); + +LONG CSystemPage::OnApply() +{ + if (IsButtonCheckedBool(IDC_SYSTEM_INTEGRATE_TO_CONTEXT_MENU)) + { + DllRegisterServer(); + NZipRootRegistry::AddContextMenuHandler(); + } + else + { + DllUnregisterServer(); + NZipRootRegistry::DeleteContextMenuHandler(); + } + SaveCascadedMenu(IsButtonCheckedBool(IDC_SYSTEM_CASCADED_MENU)); + + UInt32 flags = 0; + for (int i = 0; i < kNumMenuItems; i++) + if (m_ListView.GetCheckState(i)) + flags |= kMenuItems[i].Flag; + SaveContextMenuStatus(flags); + + return PSNRET_NOERROR; +} + +void CSystemPage::OnNotifyHelp() +{ + ShowHelpWindow(NULL, kSystemTopic); +} + +bool CSystemPage::OnButtonClicked(int buttonID, HWND buttonHWND) +{ + switch(buttonID) + { + case IDC_SYSTEM_CASCADED_MENU: + case IDC_SYSTEM_INTEGRATE_TO_CONTEXT_MENU: + Changed(); + return true; + } + return CPropertyPage::OnButtonClicked(buttonID, buttonHWND); + +} + +bool CSystemPage::OnNotify(UINT controlID, LPNMHDR lParam) +{ + if (lParam->hwndFrom == HWND(m_ListView)) + { + switch(lParam->code) + { + case (LVN_ITEMCHANGED): + return OnItemChanged((const NMLISTVIEW *)lParam); + } + } + return CPropertyPage::OnNotify(controlID, lParam); +} + + +bool CSystemPage::OnItemChanged(const NMLISTVIEW *info) +{ + if (_initMode) + return true; + if ((info->uChanged & LVIF_STATE) != 0) + { + UINT oldState = info->uOldState & LVIS_STATEIMAGEMASK; + UINT newState = info->uNewState & LVIS_STATEIMAGEMASK; + if (oldState != newState) + Changed(); + } + // PostMessage(kRefreshpluginsListMessage, 0); + // RefreshPluginsList(); + return true; +} diff --git a/CPP/7zip/UI/Explorer/SystemPage.h b/CPP/7zip/UI/Explorer/SystemPage.h new file mode 100755 index 00000000..75fdeb2b --- /dev/null +++ b/CPP/7zip/UI/Explorer/SystemPage.h @@ -0,0 +1,25 @@ +// SystemPage.h + +#ifndef __SYSTEMPAGE_H +#define __SYSTEMPAGE_H + +#include "Windows/Control/PropertyPage.h" +#include "Windows/Control/ListView.h" + +#include "../Common/LoadCodecs.h" + +class CSystemPage: public NWindows::NControl::CPropertyPage +{ + bool _initMode; + CObjectVector m_Archivers; + NWindows::NControl::CListView m_ListView; +public: + virtual bool OnInit(); + virtual void OnNotifyHelp(); + virtual bool OnNotify(UINT controlID, LPNMHDR lParam); + virtual bool OnItemChanged(const NMLISTVIEW *info); + virtual LONG OnApply(); + virtual bool OnButtonClicked(int buttonID, HWND buttonHWND); +}; + +#endif diff --git a/CPP/7zip/UI/Explorer/SystemPage.rc b/CPP/7zip/UI/Explorer/SystemPage.rc new file mode 100755 index 00000000..a3b36409 --- /dev/null +++ b/CPP/7zip/UI/Explorer/SystemPage.rc @@ -0,0 +1,24 @@ +#include "SystemPageRes.h" +#include "../../GuiCommon.rc" + +#define xSize2 196 +#define ySize2 164 +#define xSize (xSize2 + marg + marg) +#define ySize (ySize2 + marg + marg) + +IDD_SYSTEM DIALOG 0, 0, xSize, ySize MY_PAGE_STYLE +CAPTION "System" +MY_FONT +BEGIN + CONTROL "Integrate 7-Zip to shell context menu", IDC_SYSTEM_INTEGRATE_TO_CONTEXT_MENU, + "Button", BS_AUTOCHECKBOX | WS_TABSTOP, + marg, marg, xSize2, 10 + CONTROL "Cascaded context menu", IDC_SYSTEM_CASCADED_MENU, + "Button", BS_AUTOCHECKBOX | WS_TABSTOP, + marg, 21, xSize2, 10 + LTEXT "Context menu items:", IDC_SYSTEM_STATIC_CONTEXT_MENU_ITEMS, + marg, 37, xSize2, 8 + CONTROL "List1", IDC_SYSTEM_OPTIONS_LIST, "SysListView32", + LVS_REPORT | LVS_SINGLESEL | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP, + marg, 50, xSize2, ySize - marg - 50 +END diff --git a/CPP/7zip/UI/Explorer/SystemPage/SystemPage.cpp b/CPP/7zip/UI/Explorer/SystemPage/SystemPage.cpp deleted file mode 100755 index cc2f974d..00000000 --- a/CPP/7zip/UI/Explorer/SystemPage/SystemPage.cpp +++ /dev/null @@ -1,212 +0,0 @@ -// SystemPage.cpp - -#include "StdAfx.h" -#include "resource.h" -#include "../resource.h" - -#include "Common/StringConvert.h" -#include "Windows/Defs.h" -#include "Windows/Control/ListView.h" - -#include "SystemPage.h" - -#include "../../Common/ZipRegistry.h" -#include "../RegistryContextMenu.h" -#include "../ContextMenuFlags.h" - -#include "../../../FileManager/HelpUtils.h" -#include "../../../FileManager/LangUtils.h" -#include "../../../FileManager/FormatUtils.h" - -using namespace NContextMenuFlags; - -static CIDLangPair kIDLangPairs[] = -{ - { IDC_SYSTEM_INTEGRATE_TO_CONTEXT_MENU, 0x01000301}, - { IDC_SYSTEM_CASCADED_MENU, 0x01000302}, - { IDC_SYSTEM_STATIC_CONTEXT_MENU_ITEMS, 0x01000310} -}; - -static LPCWSTR kSystemTopic = L"fm/plugins/7-zip/options.htm#system"; - -struct CContextMenuItem -{ - int ControlID; - UINT32 LangID; - UINT32 Flag; -}; - -static CContextMenuItem kMenuItems[] = -{ - { IDS_CONTEXT_OPEN, 0x02000103, kOpen}, - { IDS_CONTEXT_EXTRACT, 0x02000105, kExtract}, - { IDS_CONTEXT_EXTRACT_HERE, 0x0200010B, kExtractHere }, - { IDS_CONTEXT_EXTRACT_TO, 0x0200010D, kExtractTo }, - - { IDS_CONTEXT_TEST, 0x02000109, kTest}, - - { IDS_CONTEXT_COMPRESS, 0x02000107, kCompress }, - { IDS_CONTEXT_COMPRESS_EMAIL, 0x02000111, kCompressEmail }, - { IDS_CONTEXT_COMPRESS_TO, 0x0200010F, kCompressTo7z }, - { IDS_CONTEXT_COMPRESS_TO_EMAIL, 0x02000113, kCompressTo7zEmail}, - { IDS_CONTEXT_COMPRESS_TO, 0x0200010F, kCompressToZip }, - { IDS_CONTEXT_COMPRESS_TO_EMAIL, 0x02000113, kCompressToZipEmail}, -}; - -const int kNumMenuItems = sizeof(kMenuItems) / sizeof(kMenuItems[0]); - -bool CSystemPage::OnInit() -{ - _initMode = true; - LangSetDlgItemsText(HWND(*this), kIDLangPairs, sizeof(kIDLangPairs) / sizeof(kIDLangPairs[0])); - - CheckButton(IDC_SYSTEM_INTEGRATE_TO_CONTEXT_MENU, - NZipRootRegistry::CheckContextMenuHandler()); - - CheckButton(IDC_SYSTEM_CASCADED_MENU, ReadCascadedMenu()); - - UINT32 contextMenuFlags; - if (!ReadContextMenuStatus(contextMenuFlags)) - contextMenuFlags = NContextMenuFlags::GetDefaultFlags(); - - m_ListView.Attach(GetItem(IDC_SYSTEM_OPTIONS_LIST)); - - /* - CheckButton(IDC_SYSTEM_INTEGRATE_TO_CONTEXT_MENU, - NRegistryAssociations::CheckContextMenuHandler()); - */ - - UINT32 newFlags = LVS_EX_CHECKBOXES | LVS_EX_FULLROWSELECT; - m_ListView.SetExtendedListViewStyle(newFlags, newFlags); - - UString s; // = TEXT("Items"); // LangLoadString(IDS_PROPERTY_EXTENSION, 0x02000205); - LVCOLUMNW column; - column.mask = LVCF_WIDTH | LVCF_TEXT | LVCF_FMT | LVCF_SUBITEM; - column.cx = 270; - column.fmt = LVCFMT_LEFT; - column.pszText = (LPWSTR)(LPCWSTR)s; - column.iSubItem = 0; - m_ListView.InsertColumn(0, &column); - - for (int i = 0; i < kNumMenuItems; i++) - { - CContextMenuItem &menuItem = kMenuItems[i]; - LVITEMW item; - item.iItem = i; - item.mask = LVIF_TEXT | LVIF_PARAM; - item.lParam = i; - - UString s = LangString(menuItem.ControlID, menuItem.LangID); - - switch(menuItem.ControlID) - { - case IDS_CONTEXT_EXTRACT_TO: - { - s = MyFormatNew(s, LangString(IDS_CONTEXT_FOLDER, 0x02000140)); - break; - } - case IDS_CONTEXT_COMPRESS_TO: - case IDS_CONTEXT_COMPRESS_TO_EMAIL: - { - UString s2 = LangString(IDS_CONTEXT_ARCHIVE, 0x02000141); - switch(menuItem.Flag) - { - case kCompressTo7z: - case kCompressTo7zEmail: - s2 += L".7z"; - break; - case kCompressToZip: - case kCompressToZipEmail: - s2 += L".zip"; - break; - } - s = MyFormatNew(s, s2); - break; - } - } - - // UString MyFormatNew(const UString &format, const UString &argument); - - item.pszText = (LPWSTR)(LPCWSTR)s; - item.iSubItem = 0; - int itemIndex = m_ListView.InsertItem(&item); - m_ListView.SetCheckState(itemIndex, ((contextMenuFlags & menuItem.Flag) != 0)); - } - - _initMode = false; - return CPropertyPage::OnInit(); -} - -STDAPI DllRegisterServer(void); -STDAPI DllUnregisterServer(void); - -LONG CSystemPage::OnApply() -{ - if (IsButtonCheckedBool(IDC_SYSTEM_INTEGRATE_TO_CONTEXT_MENU)) - { - DllRegisterServer(); - NZipRootRegistry::AddContextMenuHandler(); - } - else - { - DllUnregisterServer(); - NZipRootRegistry::DeleteContextMenuHandler(); - } - SaveCascadedMenu(IsButtonCheckedBool(IDC_SYSTEM_CASCADED_MENU)); - - UINT32 flags = 0; - for (int i = 0; i < kNumMenuItems; i++) - if (m_ListView.GetCheckState(i)) - flags |= kMenuItems[i].Flag; - SaveContextMenuStatus(flags); - - return PSNRET_NOERROR; -} - -void CSystemPage::OnNotifyHelp() -{ - ShowHelpWindow(NULL, kSystemTopic); -} - -bool CSystemPage::OnButtonClicked(int buttonID, HWND buttonHWND) -{ - switch(buttonID) - { - case IDC_SYSTEM_CASCADED_MENU: - case IDC_SYSTEM_INTEGRATE_TO_CONTEXT_MENU: - Changed(); - return true; - } - return CPropertyPage::OnButtonClicked(buttonID, buttonHWND); - -} - -bool CSystemPage::OnNotify(UINT aControlID, LPNMHDR lParam) -{ - if (lParam->hwndFrom == HWND(m_ListView)) - { - switch(lParam->code) - { - case (LVN_ITEMCHANGED): - return OnItemChanged((const NMLISTVIEW *)lParam); - } - } - return CPropertyPage::OnNotify(aControlID, lParam); -} - - -bool CSystemPage::OnItemChanged(const NMLISTVIEW *info) -{ - if (_initMode) - return true; - if ((info->uChanged & LVIF_STATE) != 0) - { - UINT oldState = info->uOldState & LVIS_STATEIMAGEMASK; - UINT newState = info->uNewState & LVIS_STATEIMAGEMASK; - if (oldState != newState) - Changed(); - } - // PostMessage(kRefreshpluginsListMessage, 0); - // RefreshPluginsList(); - return true; -} diff --git a/CPP/7zip/UI/Explorer/SystemPage/SystemPage.h b/CPP/7zip/UI/Explorer/SystemPage/SystemPage.h deleted file mode 100755 index 75130189..00000000 --- a/CPP/7zip/UI/Explorer/SystemPage/SystemPage.h +++ /dev/null @@ -1,25 +0,0 @@ -// SystemPage.h - -#ifndef __SYSTEMPAGE_H -#define __SYSTEMPAGE_H - -#include "Windows/Control/PropertyPage.h" -#include "Windows/Control/ListView.h" - -#include "../../Common/LoadCodecs.h" - -class CSystemPage: public NWindows::NControl::CPropertyPage -{ - bool _initMode; - CObjectVector m_Archivers; - NWindows::NControl::CListView m_ListView; -public: - virtual bool OnInit(); - virtual void OnNotifyHelp(); - virtual bool OnNotify(UINT aControlID, LPNMHDR lParam); - virtual bool OnItemChanged(const NMLISTVIEW *info); - virtual LONG OnApply(); - virtual bool OnButtonClicked(int aButtonID, HWND aButtonHWND); -}; - -#endif diff --git a/CPP/7zip/UI/Explorer/SystemPage/resource.h b/CPP/7zip/UI/Explorer/SystemPage/resource.h deleted file mode 100755 index b125849c..00000000 --- a/CPP/7zip/UI/Explorer/SystemPage/resource.h +++ /dev/null @@ -1,6 +0,0 @@ -#define IDD_SYSTEM 102 - -#define IDC_SYSTEM_INTEGRATE_TO_CONTEXT_MENU 1010 -#define IDC_SYSTEM_CASCADED_MENU 1011 -#define IDC_SYSTEM_STATIC_CONTEXT_MENU_ITEMS 1020 -#define IDC_SYSTEM_OPTIONS_LIST 1022 diff --git a/CPP/7zip/UI/Explorer/SystemPage/resource.rc b/CPP/7zip/UI/Explorer/SystemPage/resource.rc deleted file mode 100755 index fdfed433..00000000 --- a/CPP/7zip/UI/Explorer/SystemPage/resource.rc +++ /dev/null @@ -1,24 +0,0 @@ -#include "resource.h" -#include "../../../GuiCommon.rc" - -#define xSize2 196 -#define ySize2 164 -#define xSize (xSize2 + marg + marg) -#define ySize (ySize2 + marg + marg) - -IDD_SYSTEM DIALOG 0, 0, xSize, ySize MY_PAGE_STYLE -CAPTION "System" -MY_FONT -BEGIN - CONTROL "Integrate 7-Zip to shell context menu", IDC_SYSTEM_INTEGRATE_TO_CONTEXT_MENU, - "Button", BS_AUTOCHECKBOX | WS_TABSTOP, - marg, marg, xSize2, 10 - CONTROL "Cascaded context menu", IDC_SYSTEM_CASCADED_MENU, - "Button", BS_AUTOCHECKBOX | WS_TABSTOP, - marg, 21, xSize2, 10 - LTEXT "Context menu items:", IDC_SYSTEM_STATIC_CONTEXT_MENU_ITEMS, - marg, 37, xSize2, 8 - CONTROL "List1", IDC_SYSTEM_OPTIONS_LIST, "SysListView32", - LVS_REPORT | LVS_SINGLESEL | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP, - marg, 50, xSize2, ySize - marg - 50 -END diff --git a/CPP/7zip/UI/Explorer/SystemPageRes.h b/CPP/7zip/UI/Explorer/SystemPageRes.h new file mode 100755 index 00000000..b125849c --- /dev/null +++ b/CPP/7zip/UI/Explorer/SystemPageRes.h @@ -0,0 +1,6 @@ +#define IDD_SYSTEM 102 + +#define IDC_SYSTEM_INTEGRATE_TO_CONTEXT_MENU 1010 +#define IDC_SYSTEM_CASCADED_MENU 1011 +#define IDC_SYSTEM_STATIC_CONTEXT_MENU_ITEMS 1020 +#define IDC_SYSTEM_OPTIONS_LIST 1022 diff --git a/CPP/7zip/UI/Explorer/makefile b/CPP/7zip/UI/Explorer/makefile index f208988b..d2203b2c 100755 --- a/CPP/7zip/UI/Explorer/makefile +++ b/CPP/7zip/UI/Explorer/makefile @@ -1,11 +1,9 @@ PROG = 7-zip.dll DEF_FILE = Explorer.def LIBS = $(LIBS) user32.lib oleaut32.lib advapi32.lib htmlhelp.lib shell32.lib comctl32.lib ole32.lib comdlg32.lib -CFLAGS = $(CFLAGS) -I ../../../ \ +CFLAGS = $(CFLAGS) -I ../../../ -Ob2 \ -DLANG \ - -DNEW_FOLDER_INTERFACE \ -DWIN_LONG_PATH \ - -DEXTERNAL_CODECS \ EXPLORER_OBJS = \ $O\DllExports.obj \ @@ -13,6 +11,8 @@ EXPLORER_OBJS = \ $O\MyMessages.obj \ $O\OptionsDialog.obj \ $O\RegistryContextMenu.obj \ + $O\SystemPage.obj \ + $O\FoldersPage.obj \ COMMON_OBJS = \ $O\IntToString.obj \ @@ -37,8 +37,6 @@ WIN_OBJS = \ $O\FileIO.obj \ $O\FileName.obj \ $O\Menu.obj \ - $O\PropVariant.obj \ - $O\PropVariantConversions.obj \ $O\Registry.obj \ $O\ResourceString.obj \ $O\Shell.obj \ @@ -49,40 +47,11 @@ WIN_CTRL_OBJS = \ $O\Dialog.obj \ $O\PropertyPage.obj \ -7ZIP_COMMON_OBJS = \ - $O\FilePathAutoRename.obj \ - $O\FileStreams.obj \ - $O\StreamUtils.obj \ - UI_COMMON_OBJS = \ - $O\ArchiveExtractCallback.obj \ $O\ArchiveName.obj \ - $O\ArchiveOpenCallback.obj \ $O\CompressCall.obj \ - $O\DefaultName.obj \ - $O\EnumDirItems.obj \ - $O\ExtractingFilePath.obj \ - $O\LoadCodecs.obj \ - $O\OpenArchive.obj \ - $O\PropIDUtils.obj \ - $O\SortUtils.obj \ - $O\UpdateAction.obj \ - $O\UpdateCallback.obj \ - $O\UpdatePair.obj \ - $O\UpdateProduce.obj \ - $O\WorkDir.obj \ $O\ZipRegistry.obj \ -AGENT_OBJS = \ - $O\Agent.obj \ - $O\AgentOut.obj \ - $O\AgentProxy.obj \ - $O\ArchiveFolder.obj \ - $O\ArchiveFolderOpen.obj \ - $O\ArchiveFolderOut.obj \ - $O\UpdateCallbackAgent.obj \ - - FM_COMMON_OBJS = \ $O\FormatUtils.obj \ $O\HelpUtils.obj \ @@ -91,8 +60,6 @@ FM_COMMON_OBJS = \ $O\RegistryUtils.obj \ C_OBJS = \ - $O\Alloc.obj \ - $O\Sort.obj \ $O\Threads.obj \ OBJS = \ @@ -101,14 +68,9 @@ OBJS = \ $(COMMON_OBJS) \ $(WIN_OBJS) \ $(WIN_CTRL_OBJS) \ - $(7ZIP_COMMON_OBJS) \ $(UI_COMMON_OBJS) \ - $(AGENT_OBJS) \ $(FM_COMMON_OBJS)\ $(C_OBJS) \ - $O\SystemPage.obj \ - $O\FoldersPage.obj \ - $O\CopyCoder.obj \ $O\resource.res !include "../../../Build.mak" @@ -121,19 +83,9 @@ $(WIN_OBJS): ../../../Windows/$(*B).cpp $(COMPL) $(WIN_CTRL_OBJS): ../../../Windows/Control/$(*B).cpp $(COMPL) -$(7ZIP_COMMON_OBJS): ../../Common/$(*B).cpp - $(COMPL) $(UI_COMMON_OBJS): ../Common/$(*B).cpp $(COMPL) -$(AGENT_OBJS): ../Agent/$(*B).cpp - $(COMPL) -$(FM_COMMON_OBJS): ../../FileManager/$(*B).cpp - $(COMPL) -$O\SystemPage.obj: SystemPage/$(*B).cpp - $(COMPL) -$O\FoldersPage.obj: FoldersPage/$(*B).cpp - $(COMPL) -$O\CopyCoder.obj: ../../Compress/Copy/$(*B).cpp +$(FM_COMMON_OBJS): ../FileManager/$(*B).cpp $(COMPL) $(C_OBJS): ../../../../C/$(*B).c $(COMPL_O2) diff --git a/CPP/7zip/UI/Explorer/resource.rc b/CPP/7zip/UI/Explorer/resource.rc index bf7601d9..157fa4cc 100755 --- a/CPP/7zip/UI/Explorer/resource.rc +++ b/CPP/7zip/UI/Explorer/resource.rc @@ -33,6 +33,6 @@ BEGIN IDS_CONFIG_DIALOG_CAPTION "7-Zip Options" END -#include "FoldersPage/resource.rc" -#include "SystemPage/resource.rc" +#include "FoldersPage.rc" +#include "SystemPage.rc" -- cgit v1.2.3