diff options
author | Igor Pavlov <ipavlov@users.sourceforge.net> | 2007-09-04 04:00:00 +0400 |
---|---|---|
committer | Kornel LesiĆski <kornel@geekhood.net> | 2016-05-28 02:15:54 +0300 |
commit | b82f80647dd2b3890cdbebfe2aae44f7564baf5a (patch) | |
tree | 043d13c287b1485cc06cd6fb9fd6f8bfd0e061c0 /CPP/7zip/UI/FileManager | |
parent | 051769bbc577aeede90558b6ab5c9be187940ca0 (diff) |
4.54 beta
Diffstat (limited to 'CPP/7zip/UI/FileManager')
-rwxr-xr-x | CPP/7zip/UI/FileManager/App.cpp | 47 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/App.h | 8 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/FM.dsp | 32 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/FSFolder.cpp | 4 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/FSFolder.h | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/FSFolderCopy.cpp | 34 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/LangUtils.cpp | 4 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/MyLoadMenu.cpp | 16 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/Panel.cpp | 3 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/Panel.h | 11 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PanelCopy.cpp | 51 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PanelCrc.cpp | 3 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PanelDrag.cpp | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PanelFolderChange.cpp | 1 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PanelKey.cpp | 42 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PanelMenu.cpp | 45 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PanelOperations.cpp | 6 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/PanelSplitFile.cpp | 7 | ||||
-rwxr-xr-x | CPP/7zip/UI/FileManager/makefile | 8 |
19 files changed, 245 insertions, 81 deletions
diff --git a/CPP/7zip/UI/FileManager/App.cpp b/CPP/7zip/UI/FileManager/App.cpp index 0f88ce47..86479f04 100755 --- a/CPP/7zip/UI/FileManager/App.cpp +++ b/CPP/7zip/UI/FileManager/App.cpp @@ -18,6 +18,7 @@ #include "ExtractCallback.h" #include "ViewSettings.h" #include "RegistryUtils.h" +#include "LangUtils.h" using namespace NWindows; using namespace NFile; @@ -32,6 +33,7 @@ void CPanelCallbackImp::OnTab() { if (g_App.NumPanels != 1) _app->Panels[1 - _index].SetFocusToList(); + _app->RefreshTitle(); } void CPanelCallbackImp::SetFocusToPath(int index) @@ -40,26 +42,17 @@ void CPanelCallbackImp::SetFocusToPath(int index) if (g_App.NumPanels == 1) newPanelIndex = g_App.LastFocusedPanel; _app->Panels[newPanelIndex]._headerComboBox.SetFocus(); + _app->RefreshTitle(); } -void CPanelCallbackImp::OnCopy(bool move, bool copyToSame) - { _app->OnCopy(move, copyToSame, _index); } - -void CPanelCallbackImp::OnSetSameFolder() - { _app->OnSetSameFolder(_index); } - -void CPanelCallbackImp::OnSetSubFolder() - { _app->OnSetSubFolder(_index); } - -void CPanelCallbackImp::PanelWasFocused() - { _app->SetFocusedPanel(_index); } - -void CPanelCallbackImp::DragBegin() - { _app->DragBegin(_index); } - -void CPanelCallbackImp::DragEnd() - { _app->DragEnd(); } +void CPanelCallbackImp::OnCopy(bool move, bool copyToSame) { _app->OnCopy(move, copyToSame, _index); } +void CPanelCallbackImp::OnSetSameFolder() { _app->OnSetSameFolder(_index); } +void CPanelCallbackImp::OnSetSubFolder() { _app->OnSetSubFolder(_index); } +void CPanelCallbackImp::PanelWasFocused() { _app->SetFocusedPanel(_index); _app->RefreshTitle(_index); } +void CPanelCallbackImp::DragBegin() { _app->DragBegin(_index); } +void CPanelCallbackImp::DragEnd() { _app->DragEnd(); } +void CPanelCallbackImp::RefreshTitle(bool always) { _app->RefreshTitle(_index, always); } void CApp::SetListSettings() { @@ -636,6 +629,7 @@ void CApp::OnCopy(bool move, bool copyToSame, int srcPanelIndex) } } + RefreshTitleAlways(); if (copyToSame || move) { srcPanel.RefreshListCtrl(srcSelState); @@ -757,3 +751,22 @@ void CApp::OnNotify(int /* ctrlID */, LPNMHDR pnmh) #endif } } + +void CApp::RefreshTitle(bool always) +{ + UString path = GetFocusedPanel()._currentFolderPrefix; + if (path.IsEmpty()) + path += LangString(IDS_APP_TITLE, 0x03000000); + if (!always && path == PrevTitle) + return; + PrevTitle = path; + NWindows::MySetWindowText(_window, path); +} + +void CApp::RefreshTitle(int panelIndex, bool always) +{ + if (panelIndex != GetFocusedPanelIndex()) + return; + RefreshTitle(always); +} + diff --git a/CPP/7zip/UI/FileManager/App.h b/CPP/7zip/UI/FileManager/App.h index faa40afe..2479d81e 100755 --- a/CPP/7zip/UI/FileManager/App.h +++ b/CPP/7zip/UI/FileManager/App.h @@ -41,6 +41,7 @@ public: virtual void PanelWasFocused(); virtual void DragBegin(); virtual void DragEnd(); + virtual void RefreshTitle(bool always); }; class CApp; @@ -216,6 +217,8 @@ public: { GetFocusedPanel().CreateFile(); } // Edit + void EditCut() + { GetFocusedPanel().EditCut(); } void EditCopy() { GetFocusedPanel().EditCopy(); } void EditPaste() @@ -327,6 +330,11 @@ public: { GetFocusedPanel().TestArchives(); } void OnNotify(int ctrlID, LPNMHDR pnmh); + + UString PrevTitle; + void RefreshTitle(bool always = false); + void RefreshTitleAlways() { RefreshTitle(true); } + void RefreshTitle(int panelIndex, bool always = false); }; #endif diff --git a/CPP/7zip/UI/FileManager/FM.dsp b/CPP/7zip/UI/FileManager/FM.dsp index 1ba0bcf1..d2284325 100755 --- a/CPP/7zip/UI/FileManager/FM.dsp +++ b/CPP/7zip/UI/FileManager/FM.dsp @@ -759,6 +759,14 @@ SOURCE=..\..\..\Windows\Control\Window2.h # End Group # Begin Source File +SOURCE=..\..\..\Windows\Clipboard.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Windows\Clipboard.h +# End Source File +# Begin Source File + SOURCE=..\..\..\Windows\CommonDialog.cpp # End Source File # Begin Source File @@ -999,14 +1007,6 @@ SOURCE=..\..\..\Common\Lang.h # End Source File # Begin Source File -SOURCE=..\..\..\Common\ListFileUtils.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\..\Common\ListFileUtils.h -# End Source File -# Begin Source File - SOURCE=..\..\..\Common\MyCom.h # End Source File # Begin Source File @@ -1043,22 +1043,6 @@ SOURCE=..\..\..\Common\Random.h # End Source File # Begin Source File -SOURCE=..\..\..\Common\StdInStream.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\..\Common\StdInStream.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\Common\StdOutStream.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\..\Common\StdOutStream.h -# End Source File -# Begin Source File - SOURCE=..\..\..\Common\StringConvert.cpp # End Source File # Begin Source File diff --git a/CPP/7zip/UI/FileManager/FSFolder.cpp b/CPP/7zip/UI/FileManager/FSFolder.cpp index 9a88f674..f6994066 100755 --- a/CPP/7zip/UI/FileManager/FSFolder.cpp +++ b/CPP/7zip/UI/FileManager/FSFolder.cpp @@ -5,8 +5,6 @@ #include "FSFolder.h" #include "Common/StringConvert.h" -#include "Common/StdInStream.h" -#include "Common/StdOutStream.h" #include "Common/UTFConvert.h" #include "Common/ComTry.h" @@ -73,7 +71,7 @@ HRESULT CFSFolder::Init(const UString &path, IFolderFolder *parentFolder) return S_OK; } -static HRESULT GetFolderSize(const UString &path, UInt64 &numFolders, UInt64 &numFiles, UInt64 &size, IProgress *progress) +HRESULT GetFolderSize(const UString &path, UInt64 &numFolders, UInt64 &numFiles, UInt64 &size, IProgress *progress) { RINOK(progress->SetCompleted(NULL)); numFiles = numFolders = size = 0; diff --git a/CPP/7zip/UI/FileManager/FSFolder.h b/CPP/7zip/UI/FileManager/FSFolder.h index 63de80cc..d938969f 100755 --- a/CPP/7zip/UI/FileManager/FSFolder.h +++ b/CPP/7zip/UI/FileManager/FSFolder.h @@ -113,6 +113,8 @@ public: } }; +HRESULT GetFolderSize(const UString &path, UInt64 &numFolders, UInt64 &numFiles, UInt64 &size, IProgress *progress); + } #endif diff --git a/CPP/7zip/UI/FileManager/FSFolderCopy.cpp b/CPP/7zip/UI/FileManager/FSFolderCopy.cpp index 1a1b2250..32823fb9 100755 --- a/CPP/7zip/UI/FileManager/FSFolderCopy.cpp +++ b/CPP/7zip/UI/FileManager/FSFolderCopy.cpp @@ -469,6 +469,40 @@ STDMETHODIMP CFSFolder::MoveTo( STDMETHODIMP CFSFolder::CopyFrom(const wchar_t * /* fromFolderPath */, const wchar_t ** /* itemsPaths */, UInt32 /* numItems */, IProgress * /* progress */) { + /* + UInt64 numFolders, numFiles, totalSize; + numFiles = numFolders = totalSize = 0; + UInt32 i; + for (i = 0; i < numItems; i++) + { + UString path = (UString)fromFolderPath + itemsPaths[i]; + + CFileInfoW fileInfo; + if (!FindFile(path, fileInfo)) + return ::GetLastError(); + if (fileInfo.IsDirectory()) + { + UInt64 subFolders, subFiles, subSize; + RINOK(GetFolderSize(path + UString(L"\\") + fileInfo.Name, subFolders, subFiles, subSize, progress)); + numFolders += subFolders; + numFolders++; + numFiles += subFiles; + totalSize += subSize; + } + else + { + numFiles++; + totalSize += fileInfo.Size; + } + } + RINOK(progress->SetTotal(totalSize)); + RINOK(callback->SetNumFiles(numFiles)); + for (i = 0; i < numItems; i++) + { + UString path = (UString)fromFolderPath + itemsPaths[i]; + } + return S_OK; + */ return E_NOTIMPL; } diff --git a/CPP/7zip/UI/FileManager/LangUtils.cpp b/CPP/7zip/UI/FileManager/LangUtils.cpp index f41e764e..bf75df00 100755 --- a/CPP/7zip/UI/FileManager/LangUtils.cpp +++ b/CPP/7zip/UI/FileManager/LangUtils.cpp @@ -35,7 +35,7 @@ void ReloadLang() if (GetProgramFolderPath(folderPath)) langPath = folderPath + UString(L"Lang\\") + langPath; } - g_Lang.Open(GetSystemString(langPath)); + g_Lang.Open(langPath); } } @@ -107,7 +107,7 @@ void LoadLangs(CObjectVector<CLangEx> &langs) if (fileInfo.Name.Right(kExtSize) != L".txt") continue; lang.ShortName = fileInfo.Name.Left(fileInfo.Name.Length() - kExtSize); - if (lang.Lang.Open(GetSystemString(filePath))) + if (lang.Lang.Open(filePath)) langs.Add(lang); } } diff --git a/CPP/7zip/UI/FileManager/MyLoadMenu.cpp b/CPP/7zip/UI/FileManager/MyLoadMenu.cpp index a2a6c202..4ad152b1 100755 --- a/CPP/7zip/UI/FileManager/MyLoadMenu.cpp +++ b/CPP/7zip/UI/FileManager/MyLoadMenu.cpp @@ -6,6 +6,7 @@ #include "Windows/Menu.h" #include "Windows/Error.h" +#include "Windows/Clipboard.h" #include "../../PropID.h" @@ -30,6 +31,7 @@ extern void OptionsDialog(HWND hwndOwner, HINSTANCE hInstance); using namespace NWindows; static const int kFileMenuIndex = 0; +static const int kEditMenuIndex = 1; static const int kViewMenuIndex = 2; static const int kBookmarksMenuIndex = kViewMenuIndex + 1; @@ -321,7 +323,16 @@ void OnMenuActivating(HWND /* hWnd */, HMENU hMenu, int position) } // CopyMenu(g_FileMenu, hMenu); g_App.GetFocusedPanel().CreateFileMenu(hMenu); - + } + else if (position == kEditMenuIndex) + { + /* + CMenu menu; + menu.Attach(hMenu); + menu.EnableItem(IDM_EDIT_CUT, MF_ENABLED); + menu.EnableItem(IDM_EDIT_COPY, MF_ENABLED); + menu.EnableItem(IDM_EDIT_PASTE, IsClipboardFormatAvailableHDROP() ? MF_ENABLED : MF_GRAYED); + */ } else if (position == kViewMenuIndex) { @@ -545,6 +556,9 @@ bool OnMenuCommand(HWND hWnd, int id) break; // Edit + case IDM_EDIT_CUT: + g_App.EditCut(); + break; case IDM_EDIT_COPY: g_App.EditCopy(); break; diff --git a/CPP/7zip/UI/FileManager/Panel.cpp b/CPP/7zip/UI/FileManager/Panel.cpp index b1ef614f..ac6e7d4b 100755 --- a/CPP/7zip/UI/FileManager/Panel.cpp +++ b/CPP/7zip/UI/FileManager/Panel.cpp @@ -891,6 +891,7 @@ void CPanel::TestArchives() _folder.QueryInterface(IID_IArchiveFolder, &archiveFolder); if (archiveFolder) { + { CThreadTest extracter; extracter.ArchiveFolder = archiveFolder; @@ -938,6 +939,8 @@ void CPanel::TestArchives() if (extracter.Result != S_OK && extracter.Result != E_ABORT) MessageBoxError(extracter.Result, L"Testing Error"); } + } + RefreshTitleAlways(); return; } diff --git a/CPP/7zip/UI/FileManager/Panel.h b/CPP/7zip/UI/FileManager/Panel.h index 1f6dc140..a9c6a304 100755 --- a/CPP/7zip/UI/FileManager/Panel.h +++ b/CPP/7zip/UI/FileManager/Panel.h @@ -32,9 +32,8 @@ const int kToolbarStartID = 2000; const int kParentIndex = -1; -class CPanelCallback +struct CPanelCallback { -public: virtual void OnTab() = 0; virtual void SetFocusToPath(int index) = 0; virtual void OnCopy(bool move, bool copyToSame) = 0; @@ -43,6 +42,7 @@ public: virtual void PanelWasFocused() = 0; virtual void DragBegin() = 0; virtual void DragEnd() = 0; + virtual void RefreshTitle(bool always) = 0; }; void PanelCopyItems(); @@ -378,6 +378,7 @@ public: void InvokeSystemCommand(const char *command); void Properties(); + void EditCut(); void EditCopy(); void EditPaste(); @@ -499,13 +500,17 @@ public: HRESULT CopyFrom(const UString &folderPrefix, const UStringVector &filePaths, bool showErrorMessages, UStringVector *messages); - void CopyFrom(const UStringVector &filePaths); + void CopyFromNoAsk(const UStringVector &filePaths); + void CopyFromAsk(const UStringVector &filePaths); // empty folderPath means create new Archive to path of first fileName. void DropObject(IDataObject * dataObject, const UString &folderPath); // empty folderPath means create new Archive to path of first fileName. void CompressDropFiles(const UStringVector &fileNames, const UString &folderPath); + + void RefreshTitle(bool always = false) { _panelCallback->RefreshTitle(always); } + void RefreshTitleAlways() { RefreshTitle(true); } }; #endif diff --git a/CPP/7zip/UI/FileManager/PanelCopy.cpp b/CPP/7zip/UI/FileManager/PanelCopy.cpp index 0bb5dafa..c5745010 100755 --- a/CPP/7zip/UI/FileManager/PanelCopy.cpp +++ b/CPP/7zip/UI/FileManager/PanelCopy.cpp @@ -58,37 +58,42 @@ HRESULT CPanel::CopyTo(const CRecordVector<UInt32> &indices, const UString &fold return E_FAIL; } + HRESULT res; + { CThreadExtractInArchive2 extracter; - + extracter.ExtractCallbackSpec = new CExtractCallbackImp; extracter.ExtractCallback = extracter.ExtractCallbackSpec; extracter.ExtractCallbackSpec->ParentWindow = GetParent(); extracter.ExtractCallbackSpec->ShowMessages = showErrorMessages; extracter.ExtractCallbackSpec->ProgressDialog.CompressingMode = false; - + UString title = moveMode ? LangString(IDS_MOVING, 0x03020206): LangString(IDS_COPYING, 0x03020205); UString progressWindowTitle = LangString(IDS_APP_TITLE, 0x03000000); - + extracter.ExtractCallbackSpec->ProgressDialog.MainWindow = GetParent(); extracter.ExtractCallbackSpec->ProgressDialog.MainTitle = progressWindowTitle; extracter.ExtractCallbackSpec->ProgressDialog.MainAddTitle = title + L" "; - + extracter.ExtractCallbackSpec->OverwriteMode = NExtract::NOverwriteMode::kAskBefore; extracter.ExtractCallbackSpec->Init(); extracter.Indices = indices; extracter.DestPath = folder; extracter.FolderOperations = folderOperations; extracter.MoveMode = moveMode; - + NWindows::CThread extractThread; RINOK(extractThread.Create(CThreadExtractInArchive2::MyThreadFunction, &extracter)); extracter.ExtractCallbackSpec->StartProgressDialog(title); - + if (messages != 0) *messages = extracter.ExtractCallbackSpec->Messages; - return extracter.Result; + res = extracter.Result; + } + RefreshTitleAlways(); + return res; } @@ -135,6 +140,8 @@ HRESULT CPanel::CopyFrom(const UString &folderPrefix, const UStringVector &fileP return E_FAIL; } + HRESULT res; + { CThreadUpdate updater; updater.UpdateCallbackSpec = new CUpdateCallback100Imp; updater.UpdateCallback = updater.UpdateCallbackSpec; @@ -164,20 +171,14 @@ HRESULT CPanel::CopyFrom(const UString &folderPrefix, const UStringVector &fileP if (messages != 0) *messages = updater.UpdateCallbackSpec->Messages; - return updater.Result; + res = updater.Result; + } + RefreshTitleAlways(); + return res; } -void CPanel::CopyFrom(const UStringVector &filePaths) +void CPanel::CopyFromNoAsk(const UStringVector &filePaths) { - UString title = LangString(IDS_CONFIRM_FILE_COPY, 0x03020222); - UString message = LangString(IDS_WANT_TO_COPY_FILES, 0x03020223); - message += L"\n\'"; - message += _currentFolderPrefix; - message += L"\' ?"; - int res = ::MessageBoxW(*(this), message, title, MB_YESNOCANCEL | MB_ICONQUESTION | MB_SYSTEMMODAL); - if (res != IDYES) - return; - CDisableTimerProcessing disableTimerProcessing(*this); CSelectedState srcSelState; @@ -201,3 +202,17 @@ void CPanel::CopyFrom(const UStringVector &filePaths) SetFocusToList(); } +void CPanel::CopyFromAsk(const UStringVector &filePaths) +{ + UString title = LangString(IDS_CONFIRM_FILE_COPY, 0x03020222); + UString message = LangString(IDS_WANT_TO_COPY_FILES, 0x03020223); + message += L"\n\'"; + message += _currentFolderPrefix; + message += L"\' ?"; + int res = ::MessageBoxW(*(this), message, title, MB_YESNOCANCEL | MB_ICONQUESTION | MB_SYSTEMMODAL); + if (res != IDYES) + return; + + CopyFromNoAsk(filePaths); +} + diff --git a/CPP/7zip/UI/FileManager/PanelCrc.cpp b/CPP/7zip/UI/FileManager/PanelCrc.cpp index b2163742..4ce435da 100755 --- a/CPP/7zip/UI/FileManager/PanelCrc.cpp +++ b/CPP/7zip/UI/FileManager/PanelCrc.cpp @@ -290,6 +290,7 @@ void CApp::CalculateCrc() combiner.DirEnumerator.BasePrefix = srcPanel._currentFolderPrefix; combiner.DirEnumerator.FlatMode = GetFlatMode(); + { CProgressDialog progressDialog; combiner.ProgressDialog = &progressDialog; combiner.ErrorCode = 0; @@ -362,4 +363,6 @@ void CApp::CalculateCrc() } srcPanel.MessageBoxInfo(s, LangString(IDS_CHECKSUM_INFORMATION, 0x03020720)); } + } + RefreshTitleAlways(); } diff --git a/CPP/7zip/UI/FileManager/PanelDrag.cpp b/CPP/7zip/UI/FileManager/PanelDrag.cpp index 0baa151a..f242c8a1 100755 --- a/CPP/7zip/UI/FileManager/PanelDrag.cpp +++ b/CPP/7zip/UI/FileManager/PanelDrag.cpp @@ -792,5 +792,5 @@ void CPanel::CompressDropFiles(const UStringVector &fileNames, const UString &fo ); } else - CopyFrom(fileNames); + CopyFromAsk(fileNames); } diff --git a/CPP/7zip/UI/FileManager/PanelFolderChange.cpp b/CPP/7zip/UI/FileManager/PanelFolderChange.cpp index a8cfb3be..d6fdcc98 100755 --- a/CPP/7zip/UI/FileManager/PanelFolderChange.cpp +++ b/CPP/7zip/UI/FileManager/PanelFolderChange.cpp @@ -145,6 +145,7 @@ void CPanel::LoadFullPathAndShow() // _headerComboBox.SendMessage(CB_RESETCONTENT, 0, 0); _headerComboBox.SetText(_currentFolderPrefix); + RefreshTitle(); /* for (int i = 0; i < g_Folders.m_Strings.Size(); i++) diff --git a/CPP/7zip/UI/FileManager/PanelKey.cpp b/CPP/7zip/UI/FileManager/PanelKey.cpp index 5f002de9..218476ed 100755 --- a/CPP/7zip/UI/FileManager/PanelKey.cpp +++ b/CPP/7zip/UI/FileManager/PanelKey.cpp @@ -157,8 +157,25 @@ bool CPanel::OnKeyDown(LPNMLVKEYDOWN keyDownInfo, LRESULT &result) } case VK_INSERT: { - OnInsert(); - return true; + if (!alt) + { + if (ctrl && !shift) + { + EditCopy(); + return true; + } + if (shift && !ctrl) + { + EditPaste(); + return true; + } + if (!shift && !ctrl && _mySelectMode) + { + OnInsert(); + return true; + } + } + return false; } case VK_DOWN: { @@ -249,6 +266,27 @@ bool CPanel::OnKeyDown(LPNMLVKEYDOWN keyDownInfo, LRESULT &result) return true; } return false; + case 'X': + if (ctrl) + { + EditCut(); + return true; + } + return false; + case 'C': + if (ctrl) + { + EditCopy(); + return true; + } + return false; + case 'V': + if (ctrl) + { + EditPaste(); + return true; + } + return false; case 'N': if (ctrl) { diff --git a/CPP/7zip/UI/FileManager/PanelMenu.cpp b/CPP/7zip/UI/FileManager/PanelMenu.cpp index 58d457cb..8ebbc8ac 100755 --- a/CPP/7zip/UI/FileManager/PanelMenu.cpp +++ b/CPP/7zip/UI/FileManager/PanelMenu.cpp @@ -4,6 +4,7 @@ #include "Windows/Menu.h" #include "Windows/COM.h" #include "Windows/PropVariant.h" +#include "Windows/Clipboard.h" #include "../Common/PropIDUtils.h" #include "../../PropID.h" @@ -27,6 +28,7 @@ static const UINT kSystemStartMenuID = kPluginMenuStartID + 100; void CPanel::InvokeSystemCommand(const char *command) { + NCOM::CComInitializer comInitializer; if (!IsFSFolder() && !IsFSDrivesFolder()) return; CRecordVector<UInt32> operatedIndices; @@ -181,18 +183,51 @@ void CPanel::Properties() } } -// Copy and paste do not work, if you know why write me. +void CPanel::EditCut() +{ + // InvokeSystemCommand("cut"); +} void CPanel::EditCopy() { - NCOM::CComInitializer comInitializer; - InvokeSystemCommand("copy"); + /* + CMyComPtr<IGetFolderArchiveProperties> getFolderArchiveProperties; + _folder.QueryInterface(IID_IGetFolderArchiveProperties, &getFolderArchiveProperties); + if (!getFolderArchiveProperties) + { + InvokeSystemCommand("copy"); + return; + } + */ + UString s; + CRecordVector<UInt32> indices; + GetSelectedItemsIndices(indices); + for (int i = 0; i < indices.Size(); i++) + { + if (i > 0) + s += L"\xD\n"; + s += GetItemName(indices[i]); + } + ClipboardSetText(_mainWindow, s); } void CPanel::EditPaste() { - NCOM::CComInitializer comInitializer; - InvokeSystemCommand("paste"); + /* + UStringVector names; + ClipboardGetFileNames(names); + CopyFromNoAsk(names); + UString s; + for (int i = 0; i < names.Size(); i++) + { + s += L" "; + s += names[i]; + } + + MessageBoxW(0, s, L"", 0); + */ + + // InvokeSystemCommand("paste"); } HRESULT CPanel::CreateShellContextMenu( diff --git a/CPP/7zip/UI/FileManager/PanelOperations.cpp b/CPP/7zip/UI/FileManager/PanelOperations.cpp index 392ca370..2cdabdc1 100755 --- a/CPP/7zip/UI/FileManager/PanelOperations.cpp +++ b/CPP/7zip/UI/FileManager/PanelOperations.cpp @@ -220,6 +220,7 @@ void CPanel::DeleteItemsInternal(CRecordVector<UInt32> &indices) if (::MessageBoxW(GetParent(), message, title, MB_OKCANCEL | MB_ICONQUESTION) != IDOK) return; + { CThreadDelete deleter; deleter.UpdateCallbackSpec = new CUpdateCallback100Imp; deleter.UpdateCallback = deleter.UpdateCallbackSpec; @@ -242,6 +243,8 @@ void CPanel::DeleteItemsInternal(CRecordVector<UInt32> &indices) HRESULT result = deleter.Result; if (result != S_OK) MessageBoxError(result, LangString(IDS_ERROR_DELETING, 0x03020217)); + } + RefreshTitleAlways(); } BOOL CPanel::OnBeginLabelEdit(LV_DISPINFOW * lpnmh) @@ -319,6 +322,7 @@ void CPanel::CreateFolder() // HRESULT result = folderOperations->CreateFolder(newName, 0); + { CThreadCreateFolder upd; upd.UpdateCallbackSpec = new CUpdateCallback100Imp; upd.UpdateCallback = upd.UpdateCallbackSpec; @@ -352,6 +356,8 @@ void CPanel::CreateFolder() state.SelectedNames.Clear(); state.FocusedName = newName; state.SelectFocused = true; + } + RefreshTitleAlways(); RefreshListCtrl(state); } diff --git a/CPP/7zip/UI/FileManager/PanelSplitFile.cpp b/CPP/7zip/UI/FileManager/PanelSplitFile.cpp index b9cce2d8..cbfc6c25 100755 --- a/CPP/7zip/UI/FileManager/PanelSplitFile.cpp +++ b/CPP/7zip/UI/FileManager/PanelSplitFile.cpp @@ -259,6 +259,7 @@ void CApp::Split() CThreadSplit spliter; // spliter.Panel = this; + { CProgressDialog progressDialog; spliter.ProgressDialog = &progressDialog; @@ -284,6 +285,9 @@ void CApp::Split() if (thread.Create(CThreadSplit::MyThreadFunction, &spliter) != S_OK) throw 271824; progressDialog.Create(title, _window); + } + RefreshTitleAlways(); + if (!spliter.Error.IsEmpty()) srcPanel.MessageBoxMyError(spliter.Error); @@ -442,6 +446,7 @@ void CApp::Combine() CThreadCombine combiner; // combiner.Panel = this; + { CProgressDialog progressDialog; combiner.ProgressDialog = &progressDialog; @@ -471,6 +476,8 @@ void CApp::Combine() if (thread.Create(CThreadCombine::MyThreadFunction, &combiner) != S_OK) throw 271824; progressDialog.Create(title, _window); + } + RefreshTitleAlways(); if (!combiner.Error.IsEmpty()) srcPanel.MessageBoxMyError(combiner.Error); diff --git a/CPP/7zip/UI/FileManager/makefile b/CPP/7zip/UI/FileManager/makefile index 68723921..0b815ad9 100755 --- a/CPP/7zip/UI/FileManager/makefile +++ b/CPP/7zip/UI/FileManager/makefile @@ -70,20 +70,18 @@ COMMON_OBJS = \ $O\CRC.obj \ $O\IntToString.obj \ $O\Lang.obj \ - $O\ListFileUtils.obj \ + $O\MyString.obj \ + $O\MyVector.obj \ $O\NewHandler.obj \ $O\Random.obj \ - $O\StdInStream.obj \ - $O\StdOutStream.obj \ - $O\MyString.obj \ $O\StringConvert.obj \ $O\StringToInt.obj \ $O\TextConfig.obj \ $O\UTFConvert.obj \ - $O\MyVector.obj \ $O\Wildcard.obj \ WIN_OBJS = \ + $O\Clipboard.obj \ $O\CommonDialog.obj \ $O\DLL.obj \ $O\Error.obj \ |