Index: src/ch/ClipboardMonitor.cpp =================================================================== diff -u -N -r9479911a096555a7504c5c8a8eaee83ecb63440c -r8b7479db2ee71a3d00779c67fe6a1b1d9ec414b8 --- src/ch/ClipboardMonitor.cpp (.../ClipboardMonitor.cpp) (revision 9479911a096555a7504c5c8a8eaee83ecb63440c) +++ src/ch/ClipboardMonitor.cpp (.../ClipboardMonitor.cpp) (revision 8b7479db2ee71a3d00779c67fe6a1b1d9ec414b8) @@ -28,6 +28,7 @@ #include "CfgProperties.h" #include "FolderDialog.h" #include "ShutdownDlg.h" +#include "DirectoryChooser.h" using namespace chcore; @@ -123,61 +124,12 @@ EmptyClipboard(); CloseClipboard(); - // get dest folder - CFolderDialog dlg; - - GetPropValue(rConfig, dlg.m_bdData.cvShortcuts); - GetPropValue(rConfig, dlg.m_bdData.cvRecent); - - dlg.m_bdData.bExtended=GetPropValue(rConfig); - dlg.m_bdData.cx=GetPropValue(rConfig); - dlg.m_bdData.cy=GetPropValue(rConfig); - dlg.m_bdData.iView=GetPropValue(rConfig); - dlg.m_bdData.bIgnoreDialogs=GetPropValue(rConfig); - - dlg.m_bdData.strInitialDir=(dlg.m_bdData.cvRecent.size() > 0) ? dlg.m_bdData.cvRecent.at(0) : _T(""); - - if(eOperation == chcore::eOperation_Copy) - dlg.m_bdData.strCaption = GetResManager().LoadString(IDS_TITLECOPY_STRING); - else if(eOperation == chcore::eOperation_Move) - dlg.m_bdData.strCaption = GetResManager().LoadString(IDS_TITLEMOVE_STRING); - else - dlg.m_bdData.strCaption = GetResManager().LoadString(IDS_TITLEUNKNOWNOPERATION_STRING); - dlg.m_bdData.strText = GetResManager().LoadString(IDS_MAINBROWSETEXT_STRING); - - // set count of data to display - size_t stClipboardSize = tTaskDefinition.GetSourcePathCount(); - size_t stEntries = (stClipboardSize > 3) ? 2 : stClipboardSize; - for(size_t stIndex = 0; stIndex < stEntries; stIndex++) - { - dlg.m_bdData.strText += tTaskDefinition.GetSourcePathAt(stIndex).ToString(); - dlg.m_bdData.strText += _T("\n"); - } - - // add ... - if (stEntries < stClipboardSize) - dlg.m_bdData.strText+=_T("..."); - - // show window - INT_PTR iResult = dlg.DoModal(); - - // set data to config - SetPropValue(rConfig, dlg.m_bdData.cvShortcuts); - SetPropValue(rConfig, dlg.m_bdData.cvRecent); - - SetPropValue(rConfig, dlg.m_bdData.bExtended); - SetPropValue(rConfig, dlg.m_bdData.cx); - SetPropValue(rConfig, dlg.m_bdData.cy); - SetPropValue(rConfig, dlg.m_bdData.iView); - SetPropValue(rConfig, dlg.m_bdData.bIgnoreDialogs); - rConfig.Write(); - + TSmartPath pathSelected; + INT_PTR iResult = DirectoryChooser::ChooseDirectory(eOperation, tTaskDefinition.GetSourcePaths(), pathSelected); if(iResult == IDOK) { // get dest path - CString strData; - dlg.GetPath(strData); - tTaskDefinition.SetDestinationPath(chcore::PathFromString(strData)); + tTaskDefinition.SetDestinationPath(pathSelected); // load resource strings chcore::SetTaskPropValue(tTaskDefinition.GetConfiguration(), GetResManager().LoadString(IDS_FIRSTCOPY_STRING));