diff options
Diffstat (limited to 'CPP/7zip/UI')
25 files changed, 143 insertions, 31 deletions
diff --git a/CPP/7zip/UI/Agent/AgentOut.cpp b/CPP/7zip/UI/Agent/AgentOut.cpp index e4d34a72..ffeac1c6 100755 --- a/CPP/7zip/UI/Agent/AgentOut.cpp +++ b/CPP/7zip/UI/Agent/AgentOut.cpp @@ -11,14 +11,15 @@ #include "Windows/PropVariantConversions.h" #include "Windows/Time.h" -#include "../../Compress/Copy/CopyCoder.h" +#include "../../Compress/CopyCoder.h" + #include "../../Common/FileStreams.h" -#include "../Common/UpdatePair.h" #include "../Common/EnumDirItems.h" #include "../Common/HandlerLoader.h" -#include "../Common/UpdateCallback.h" #include "../Common/OpenArchive.h" +#include "../Common/UpdateCallback.h" +#include "../Common/UpdatePair.h" #include "Agent.h" #include "UpdateCallbackAgent.h" @@ -143,6 +144,21 @@ static HRESULT EnumerateArchiveItems(CAgent *agent, return S_OK; } +struct CAgUpCallbackImp: public IUpdateProduceCallback +{ + const CObjectVector<CArcItem> *_arcItems; + IFolderArchiveUpdateCallback *_callback; + + CAgUpCallbackImp(const CObjectVector<CArcItem> *a, + IFolderArchiveUpdateCallback *callback): _arcItems(a), _callback(callback) {} + HRESULT ShowDeleteFile(int arcIndex); +}; + +HRESULT CAgUpCallbackImp::ShowDeleteFile(int arcIndex) +{ + return _callback->DeleteOperation((*_arcItems)[arcIndex].Name); +} + STDMETHODIMP CAgent::DoOperation( CCodecs *codecs, int formatIndex, @@ -221,7 +237,8 @@ STDMETHODIMP CAgent::DoOperation( { CRecordVector<CUpdatePair> updatePairs; GetUpdatePairInfoList(dirItems, arcItems, fileTimeType, updatePairs); - UpdateProduce(updatePairs, actionSet, updatePairs2); + CAgUpCallbackImp upCallback(&arcItems, updateCallback100); + UpdateProduce(updatePairs, actionSet, updatePairs2, &upCallback); } UInt32 numFiles = 0; diff --git a/CPP/7zip/UI/Agent/UpdateCallbackAgent.cpp b/CPP/7zip/UI/Agent/UpdateCallbackAgent.cpp index 6f435b35..e14197d2 100755 --- a/CPP/7zip/UI/Agent/UpdateCallbackAgent.cpp +++ b/CPP/7zip/UI/Agent/UpdateCallbackAgent.cpp @@ -102,3 +102,10 @@ HRESULT CUpdateCallbackAgent::CryptoGetTextPassword2(Int32 *passwordIsDefined, B } return _cryptoGetTextPassword->CryptoGetTextPassword2(passwordIsDefined, password); } + +/* +HRESULT CUpdateCallbackAgent::ShowDeleteFile(const wchar_t *name) +{ + return Callback->DeleteOperation(name); +} +*/
\ No newline at end of file diff --git a/CPP/7zip/UI/Common/Update.cpp b/CPP/7zip/UI/Common/Update.cpp index f2207557..1f88a6f0 100755 --- a/CPP/7zip/UI/Common/Update.cpp +++ b/CPP/7zip/UI/Common/Update.cpp @@ -19,7 +19,8 @@ #include "Windows/Time.h" #include "../../Common/FileStreams.h" -#include "../../Compress/Copy/CopyCoder.h" + +#include "../../Compress/CopyCoder.h" #include "../Common/DirItem.h" #include "../Common/EnumDirItems.h" @@ -285,6 +286,22 @@ bool CUpdateOptions::Init(const CCodecs *codecs, const CIntVector &formatIndices return true; } +/* +struct CUpdateProduceCallbackImp: public IUpdateProduceCallback +{ + const CObjectVector<CArcItem> *_arcItems; + IUpdateCallbackUI *_callback; + + CUpdateProduceCallbackImp(const CObjectVector<CArcItem> *a, + IUpdateCallbackUI *callback): _arcItems(a), _callback(callback) {} + virtual HRESULT ShowDeleteFile(int arcIndex); +}; + +HRESULT CUpdateProduceCallbackImp::ShowDeleteFile(int arcIndex) +{ + return _callback->ShowDeleteFile((*_arcItems)[arcIndex].Name); +} +*/ static HRESULT Compress( CCodecs *codecs, @@ -351,7 +368,8 @@ static HRESULT Compress( { CRecordVector<CUpdatePair> updatePairs; GetUpdatePairInfoList(dirItems, arcItems, fileTimeType, updatePairs); // must be done only once!!! - UpdateProduce(updatePairs, actionSet, updatePairs2); + // CUpdateProduceCallbackImp upCallback(&arcItems, callback); + UpdateProduce(updatePairs, actionSet, updatePairs2, NULL /* &upCallback */); } UInt32 numFiles = 0; diff --git a/CPP/7zip/UI/Common/UpdateCallback.h b/CPP/7zip/UI/Common/UpdateCallback.h index 411ee011..2a814b37 100755 --- a/CPP/7zip/UI/Common/UpdateCallback.h +++ b/CPP/7zip/UI/Common/UpdateCallback.h @@ -23,7 +23,7 @@ virtual HRESULT OpenFileError(const wchar_t *name, DWORD systemError) x; \ virtual HRESULT SetOperationResult(Int32 operationResult) x; \ virtual HRESULT CryptoGetTextPassword2(Int32 *passwordIsDefined, BSTR *password) x; \ - + // virtual HRESULT ShowDeleteFile(const wchar_t *name) x; \ // virtual HRESULT CloseProgress() { return S_OK; }; struct IUpdateCallbackUI diff --git a/CPP/7zip/UI/Common/UpdateProduce.cpp b/CPP/7zip/UI/Common/UpdateProduce.cpp index b2bc59a5..c21db3b2 100755 --- a/CPP/7zip/UI/Common/UpdateProduce.cpp +++ b/CPP/7zip/UI/Common/UpdateProduce.cpp @@ -10,8 +10,9 @@ static const char *kUpdateActionSetCollision = "Internal collision in update act void UpdateProduce( const CRecordVector<CUpdatePair> &updatePairs, - const NUpdateArchive::CActionSet &actionSet, - CRecordVector<CUpdatePair2> &operationChain) + const CActionSet &actionSet, + CRecordVector<CUpdatePair2> &operationChain, + IUpdateProduceCallback *callback) { for (int i = 0; i < updatePairs.Size(); i++) { @@ -22,6 +23,7 @@ void UpdateProduce( up2.DirIndex = pair.DirIndex; up2.ArcIndex = pair.ArcIndex; up2.NewData = up2.NewProps = true; + switch(actionSet.StateActions[pair.State]) { case NPairAction::kIgnore: @@ -30,6 +32,8 @@ void UpdateProduce( IgnoreArchiveItem(m_ArchiveItems[pair.ArcIndex]); // cout << "deleting"; */ + if (callback) + callback->ShowDeleteFile(pair.ArcIndex); continue; case NPairAction::kCopy: diff --git a/CPP/7zip/UI/Common/UpdateProduce.h b/CPP/7zip/UI/Common/UpdateProduce.h index 7e1a4a3f..e18648cd 100755 --- a/CPP/7zip/UI/Common/UpdateProduce.h +++ b/CPP/7zip/UI/Common/UpdateProduce.h @@ -21,9 +21,15 @@ struct CUpdatePair2 CUpdatePair2(): IsAnti(false), DirIndex(-1), ArcIndex(-1), NewNameIndex(-1) {} }; +struct IUpdateProduceCallback +{ + virtual HRESULT ShowDeleteFile(int arcIndex) = 0; +}; + void UpdateProduce( const CRecordVector<CUpdatePair> &updatePairs, const NUpdateArchive::CActionSet &actionSet, - CRecordVector<CUpdatePair2> &operationChain); + CRecordVector<CUpdatePair2> &operationChain, + IUpdateProduceCallback *callback); #endif diff --git a/CPP/7zip/UI/Console/Console.dsp b/CPP/7zip/UI/Console/Console.dsp index ba5cd727..bb2f0e1d 100755 --- a/CPP/7zip/UI/Console/Console.dsp +++ b/CPP/7zip/UI/Console/Console.dsp @@ -696,11 +696,11 @@ SOURCE=..\..\Compress\LZMA_Alone\LzmaBenchCon.h # End Group # Begin Source File -SOURCE=..\..\Compress\Copy\CopyCoder.cpp +SOURCE=..\..\Compress\CopyCoder.cpp # End Source File # Begin Source File -SOURCE=..\..\Compress\Copy\CopyCoder.h +SOURCE=..\..\Compress\CopyCoder.h # End Source File # End Group # Begin Group "C" diff --git a/CPP/7zip/UI/Console/UpdateCallbackConsole.cpp b/CPP/7zip/UI/Console/UpdateCallbackConsole.cpp index f81b6491..bf22d34b 100755 --- a/CPP/7zip/UI/Console/UpdateCallbackConsole.cpp +++ b/CPP/7zip/UI/Console/UpdateCallbackConsole.cpp @@ -217,3 +217,22 @@ HRESULT CUpdateCallbackConsole::CryptoGetTextPassword2(Int32 *passwordIsDefined, #endif } + +/* +HRESULT CUpdateCallbackConsole::ShowDeleteFile(const wchar_t *name) +{ + // MT_LOCK + if (StdOutMode) + return S_OK; + RINOK(Finilize()); + m_PercentPrinter.PrintString("Deleting "); + if (name[0] == 0) + name = kEmptyFileAlias; + m_PercentPrinter.PrintString(name); + if (EnablePercents) + m_PercentPrinter.RePrintRatio(); + m_NeedBeClosed = true; + m_NeedNewLine = true; + return S_OK; +} +*/ diff --git a/CPP/7zip/UI/Console/makefile b/CPP/7zip/UI/Console/makefile index 1fde7c66..01682e9a 100755 --- a/CPP/7zip/UI/Console/makefile +++ b/CPP/7zip/UI/Console/makefile @@ -111,7 +111,7 @@ $(7ZIP_COMMON_OBJS): ../../Common/$(*B).cpp $(COMPL) $(UI_COMMON_OBJS): ../Common/$(*B).cpp $(COMPL) -$O\CopyCoder.obj: ../../Compress/Copy/$(*B).cpp +$O\CopyCoder.obj: ../../Compress/$(*B).cpp $(COMPL) $(LZMA_BENCH_OBJS): ../../Compress/LZMA_Alone/$(*B).cpp $(COMPL) diff --git a/CPP/7zip/UI/Far/Far.dsp b/CPP/7zip/UI/Far/Far.dsp index 8c1d1357..7bb43ef7 100755 --- a/CPP/7zip/UI/Far/Far.dsp +++ b/CPP/7zip/UI/Far/Far.dsp @@ -518,11 +518,11 @@ SOURCE=..\Agent\UpdateCallbackAgent.h # PROP Default_Filter "" # Begin Source File -SOURCE=..\..\Compress\Copy\CopyCoder.cpp +SOURCE=..\..\Compress\CopyCoder.cpp # End Source File # Begin Source File -SOURCE=..\..\Compress\Copy\CopyCoder.h +SOURCE=..\..\Compress\CopyCoder.h # End Source File # End Group # Begin Group "7-zip Common" diff --git a/CPP/7zip/UI/Far/makefile b/CPP/7zip/UI/Far/makefile index 2c820077..dba62d63 100755 --- a/CPP/7zip/UI/Far/makefile +++ b/CPP/7zip/UI/Far/makefile @@ -101,7 +101,7 @@ $(UI_COMMON_OBJS): ../Common/$(*B).cpp $(COMPL) $(AGENT_OBJS): ../Agent/$(*B).cpp $(COMPL) -$O\CopyCoder.obj: ../../Compress/Copy/$(*B).cpp +$O\CopyCoder.obj: ../../Compress/$(*B).cpp $(COMPL) $(C_OBJS): ../../../../C/$(*B).c $(COMPL_O2) diff --git a/CPP/7zip/UI/FileManager/App.cpp b/CPP/7zip/UI/FileManager/App.cpp index db5ef0da..11c76458 100755 --- a/CPP/7zip/UI/FileManager/App.cpp +++ b/CPP/7zip/UI/FileManager/App.cpp @@ -355,8 +355,10 @@ HRESULT CApp::Create(HWND hwnd, const UString &mainPath, int xSizes[2], bool &ar ReadListMode(listMode); for (i = 0; i < kNumPanelsMax; i++) { - Panels[i]._ListViewMode = listMode.Panels[i]; - Panels[i]._xSize = xSizes[i]; + CPanel &panel = Panels[i]; + panel._ListViewMode = listMode.Panels[i]; + panel._xSize = xSizes[i]; + panel._flatModeForArc = ReadFlatView(i); } for (i = 0; i < kNumPanelsMax; i++) if (NumPanels > 1 || i == LastFocusedPanel) @@ -414,6 +416,7 @@ void CApp::Save() path = GetFolderPath(panel._parentFolders[0].ParentFolder); SavePanelPath(i, path); listMode.Panels[i] = panel.GetListViewMode(); + SaveFlatView(i, panel._flatModeForArc); } SaveListMode(listMode); } diff --git a/CPP/7zip/UI/FileManager/FM.dsp b/CPP/7zip/UI/FileManager/FM.dsp index 38e3e19a..d13e0a1f 100755 --- a/CPP/7zip/UI/FileManager/FM.dsp +++ b/CPP/7zip/UI/FileManager/FM.dsp @@ -1319,11 +1319,11 @@ SOURCE=..\Agent\UpdateCallbackAgent.h # PROP Default_Filter "" # Begin Source File -SOURCE=..\..\Compress\Copy\CopyCoder.cpp +SOURCE=..\..\Compress\CopyCoder.cpp # End Source File # Begin Source File -SOURCE=..\..\Compress\Copy\CopyCoder.h +SOURCE=..\..\Compress\CopyCoder.h # End Source File # End Group # Begin Group "Interface" diff --git a/CPP/7zip/UI/FileManager/Panel.cpp b/CPP/7zip/UI/FileManager/Panel.cpp index cdb12ced..40192c5f 100755 --- a/CPP/7zip/UI/FileManager/Panel.cpp +++ b/CPP/7zip/UI/FileManager/Panel.cpp @@ -756,6 +756,10 @@ void CPanel::SetListViewMode(UInt32 index) void CPanel::ChangeFlatMode() { _flatMode = !_flatMode; + if (_parentFolders.Size() > 0) + _flatModeForArc = _flatMode; + else + _flatModeForDisk = _flatMode; RefreshListCtrlSaveFocused(); } diff --git a/CPP/7zip/UI/FileManager/Panel.h b/CPP/7zip/UI/FileManager/Panel.h index 86f3dc25..4ba36a71 100755 --- a/CPP/7zip/UI/FileManager/Panel.h +++ b/CPP/7zip/UI/FileManager/Panel.h @@ -271,6 +271,8 @@ public: int _xSize; bool _flatMode; + bool _flatModeForDisk; + bool _flatModeForArc; bool _dontShowMode; @@ -336,6 +338,8 @@ public: _selectionIsDefined(false), _ListViewMode(3), _flatMode(false), + _flatModeForDisk(false), + _flatModeForArc(false), _xSize(300), _mySelectMode(false), _enableItemChangeNotify(true), diff --git a/CPP/7zip/UI/FileManager/PanelFolderChange.cpp b/CPP/7zip/UI/FileManager/PanelFolderChange.cpp index f4d024b2..01fec329 100755 --- a/CPP/7zip/UI/FileManager/PanelFolderChange.cpp +++ b/CPP/7zip/UI/FileManager/PanelFolderChange.cpp @@ -501,6 +501,8 @@ void CPanel::OpenParentFolder() if (_parentFolders.Size () > 1) OpenParentArchiveFolder(); _parentFolders.DeleteBack(); + if (_parentFolders.IsEmpty()) + _flatMode = _flatModeForDisk; } } @@ -528,6 +530,7 @@ void CPanel::CloseOpenFolders() OpenParentArchiveFolder(); _parentFolders.DeleteBack(); } + _flatMode = _flatModeForDisk; _folder.Release(); _library.Free(); } diff --git a/CPP/7zip/UI/FileManager/PanelItemOpen.cpp b/CPP/7zip/UI/FileManager/PanelItemOpen.cpp index 4d087a07..c40b0d18 100755 --- a/CPP/7zip/UI/FileManager/PanelItemOpen.cpp +++ b/CPP/7zip/UI/FileManager/PanelItemOpen.cpp @@ -105,6 +105,8 @@ HRESULT CPanel::OpenItemAsArchive(const UString &name, _folder = newFolder; _library.Attach(library.Detach()); + _flatMode = _flatModeForArc; + return S_OK; } diff --git a/CPP/7zip/UI/FileManager/PanelItems.cpp b/CPP/7zip/UI/FileManager/PanelItems.cpp index 3b309d27..58e14759 100755 --- a/CPP/7zip/UI/FileManager/PanelItems.cpp +++ b/CPP/7zip/UI/FileManager/PanelItems.cpp @@ -572,7 +572,8 @@ void CPanel::OpenSelectedItems(bool tryInternal) if (focusedItem >= 0) { int realIndex = GetRealItemIndex(focusedItem); - if (realIndex == kParentIndex && (tryInternal || indices.Size() == 0)) + if (realIndex == kParentIndex && (tryInternal || indices.Size() == 0) && + _listView.GetItemState(focusedItem, LVIS_SELECTED) == LVIS_SELECTED) indices.Insert(0, realIndex); } diff --git a/CPP/7zip/UI/FileManager/RegistryUtils.cpp b/CPP/7zip/UI/FileManager/RegistryUtils.cpp index f071a9c9..ed118457 100755 --- a/CPP/7zip/UI/FileManager/RegistryUtils.cpp +++ b/CPP/7zip/UI/FileManager/RegistryUtils.cpp @@ -3,6 +3,7 @@ #include "StdAfx.h" #include "RegistryUtils.h" +#include "Common/IntToString.h" #include "Windows/Registry.h" using namespace NWindows; @@ -28,6 +29,8 @@ static const TCHAR *kLargePagesEnable = TEXT("LargePages"); // static const TCHAR *kSingleClick = TEXT("SingleClick"); // static const TCHAR *kUnderline = TEXT("Underline"); +static const TCHAR *kFlatViewName = TEXT("FlatViewArc"); + void SaveRegLang(const UString &langFile) { CKey key; @@ -149,4 +152,12 @@ bool ReadUnderline(){ return ReadOption(kUnderline, false); } void SaveLockMemoryEnable(bool enable) { Save7ZipOption(kLargePagesEnable, enable); } bool ReadLockMemoryEnable() { return Read7ZipOption(kLargePagesEnable, false); } +static CSysString GetFlatViewName(UInt32 panelIndex) +{ + TCHAR panelString[32]; + ConvertUInt64ToString(panelIndex, panelString); + return (CSysString)kFlatViewName + panelString; +} +void SaveFlatView(UInt32 panelIndex, bool enable) { SaveOption(GetFlatViewName(panelIndex), enable); } +bool ReadFlatView(UInt32 panelIndex) { return ReadOption(GetFlatViewName(panelIndex), false); } diff --git a/CPP/7zip/UI/FileManager/RegistryUtils.h b/CPP/7zip/UI/FileManager/RegistryUtils.h index 0fec6f80..9b9c91cf 100755 --- a/CPP/7zip/UI/FileManager/RegistryUtils.h +++ b/CPP/7zip/UI/FileManager/RegistryUtils.h @@ -43,4 +43,7 @@ void SaveUnderline(bool enable); bool ReadUnderline(); */ +void SaveFlatView(UInt32 panelIndex, bool enable); +bool ReadFlatView(UInt32 panelIndex); + #endif diff --git a/CPP/7zip/UI/FileManager/UpdateCallback100.cpp b/CPP/7zip/UI/FileManager/UpdateCallback100.cpp index 8f6597f4..e23c7d34 100755 --- a/CPP/7zip/UI/FileManager/UpdateCallback100.cpp +++ b/CPP/7zip/UI/FileManager/UpdateCallback100.cpp @@ -60,8 +60,9 @@ STDMETHODIMP CUpdateCallback100Imp::CompressOperation(const wchar_t *name) return S_OK; } -STDMETHODIMP CUpdateCallback100Imp::DeleteOperation(const wchar_t * /* name */) +STDMETHODIMP CUpdateCallback100Imp::DeleteOperation(const wchar_t *name) { + ProgressDialog.ProgressSynch.SetCurrentFileName(name); return S_OK; } diff --git a/CPP/7zip/UI/FileManager/makefile b/CPP/7zip/UI/FileManager/makefile index 78921b90..bc1d2662 100755 --- a/CPP/7zip/UI/FileManager/makefile +++ b/CPP/7zip/UI/FileManager/makefile @@ -185,7 +185,7 @@ $(UI_COMMON_OBJS): ../Common/$(*B).cpp $(AGENT_OBJS): ../Agent/$(*B).cpp $(COMPL) -$O\CopyCoder.obj: ../../Compress/Copy/$(*B).cpp +$O\CopyCoder.obj: ../../Compress/$(*B).cpp $(COMPL) $(C_OBJS): ../../../../C/$(*B).c $(COMPL_O2) diff --git a/CPP/7zip/UI/GUI/GUI.dsp b/CPP/7zip/UI/GUI/GUI.dsp index 1de7ac97..e5fbec0e 100755 --- a/CPP/7zip/UI/GUI/GUI.dsp +++ b/CPP/7zip/UI/GUI/GUI.dsp @@ -629,11 +629,11 @@ SOURCE=..\..\Compress\LZMA_Alone\LzmaBench.h # End Group # Begin Source File -SOURCE=..\..\Compress\Copy\CopyCoder.cpp +SOURCE=..\..\Compress\CopyCoder.cpp # End Source File # Begin Source File -SOURCE=..\..\Compress\Copy\CopyCoder.h +SOURCE=..\..\Compress\CopyCoder.h # End Source File # End Group # Begin Group "C" diff --git a/CPP/7zip/UI/GUI/UpdateCallbackGUI.cpp b/CPP/7zip/UI/GUI/UpdateCallbackGUI.cpp index 8d63ee58..10c0a798 100755 --- a/CPP/7zip/UI/GUI/UpdateCallbackGUI.cpp +++ b/CPP/7zip/UI/GUI/UpdateCallbackGUI.cpp @@ -2,17 +2,18 @@ #include "StdAfx.h" -#include "UpdateCallbackGUI.h" - -#include "Common/StringConvert.h" -#include "Common/IntToString.h" #include "Common/Defs.h" +#include "Common/IntToString.h" +#include "Common/StringConvert.h" -#include "Windows/PropVariant.h" #include "Windows/Error.h" +#include "Windows/PropVariant.h" + #include "../FileManager/MessagesDialog.h" #include "../FileManager/PasswordDialog.h" +#include "UpdateCallbackGUI.h" + using namespace NWindows; CUpdateCallbackGUI::~CUpdateCallbackGUI() @@ -229,4 +230,12 @@ void CUpdateCallbackGUI::Open_ClearPasswordWasAskedFlag() PasswordWasAsked = false; } +/* +HRESULT CUpdateCallbackGUI::ShowDeleteFile(const wchar_t *name) +{ + ProgressDialog.ProgressSynch.SetCurrentFileName(name); + return S_OK; +} +*/ + #endif diff --git a/CPP/7zip/UI/GUI/makefile b/CPP/7zip/UI/GUI/makefile index e2caf8ee..b92935ab 100755 --- a/CPP/7zip/UI/GUI/makefile +++ b/CPP/7zip/UI/GUI/makefile @@ -145,7 +145,7 @@ $O\MyMessages.obj: ../Explorer/MyMessages.cpp $(COMPL) -$O\CopyCoder.obj: ../../Compress/Copy/$(*B).cpp +$O\CopyCoder.obj: ../../Compress/$(*B).cpp $(COMPL) $(LZMA_BENCH_OBJS): ../../Compress/LZMA_Alone/$(*B).cpp $(COMPL) |