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)); Index: src/ch/DirectoryChooser.cpp =================================================================== diff -u -N --- src/ch/DirectoryChooser.cpp (revision 0) +++ src/ch/DirectoryChooser.cpp (revision 8b7479db2ee71a3d00779c67fe6a1b1d9ec414b8) @@ -0,0 +1,93 @@ +// ============================================================================ +// Copyright (C) 2001-2014 by Jozef Starosczyk +// ixen@copyhandler.com +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU Library General Public License +// (version 2) as published by the Free Software Foundation; +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU Library General Public +// License along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// ============================================================================ +#include "stdafx.h" +#include "DirectoryChooser.h" +#include "ch.h" +#include "FolderDialog.h" +#include "..\libchcore\TPathContainer.h" +#include "..\libchcore\TPath.h" + +namespace DirectoryChooser +{ +INT_PTR ChooseDirectory(chcore::EOperationType eOperation, const chcore::TPathContainer& rInputPaths, chcore::TSmartPath& rSelectedPath) +{ + rSelectedPath.Clear(); + + chcore::TConfig& rConfig = GetConfig(); + + // 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 = rInputPaths.GetCount(); + size_t stEntries = (stClipboardSize > 3) ? 2 : stClipboardSize; + for(size_t stIndex = 0; stIndex < stEntries; stIndex++) + { + dlg.m_bdData.strText += rInputPaths.GetAt(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(); + + if(iResult == IDOK) + { + CString strPath; + dlg.GetPath(strPath); + + rSelectedPath = chcore::PathFromString(strPath); + } + + return iResult; +} +} Index: src/ch/DirectoryChooser.h =================================================================== diff -u -N --- src/ch/DirectoryChooser.h (revision 0) +++ src/ch/DirectoryChooser.h (revision 8b7479db2ee71a3d00779c67fe6a1b1d9ec414b8) @@ -0,0 +1,30 @@ +// ============================================================================ +// Copyright (C) 2001-2014 by Jozef Starosczyk +// ixen@copyhandler.com +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU Library General Public License +// (version 2) as published by the Free Software Foundation; +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU Library General Public +// License along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// ============================================================================ +#ifndef __DIRECTORYCHOOSER_H__ +#define __DIRECTORYCHOOSER_H__ + +#include "..\libchcore\EOperationTypes.h" + +namespace DirectoryChooser +{ + INT_PTR ChooseDirectory(chcore::EOperationType eOperation, const chcore::TPathContainer& rInputPaths, chcore::TSmartPath& rSelectedPath); +} + + +#endif Index: src/ch/FolderDialog.h =================================================================== diff -u -N -r9ea1e103b5fa4ddfebf8028f121ce16e917eec04 -r8b7479db2ee71a3d00779c67fe6a1b1d9ec414b8 --- src/ch/FolderDialog.h (.../FolderDialog.h) (revision 9ea1e103b5fa4ddfebf8028f121ce16e917eec04) +++ src/ch/FolderDialog.h (.../FolderDialog.h) (revision 8b7479db2ee71a3d00779c67fe6a1b1d9ec414b8) @@ -129,7 +129,6 @@ CThemedButton m_ctlAddShortcut; CThemedButton m_ctlRemoveShortcut; - // Generated message map functions //{{AFX_MSG(CFolderDialog) afx_msg void OnEndLabelEditShortcutList(NMHDR* pNMHDR, LRESULT* pResult); Index: src/ch/MainWnd.cpp =================================================================== diff -u -N -rd0bc3c187684f54894c7280a936d5507a5e49f35 -r8b7479db2ee71a3d00779c67fe6a1b1d9ec414b8 --- src/ch/MainWnd.cpp (.../MainWnd.cpp) (revision d0bc3c187684f54894c7280a936d5507a5e49f35) +++ src/ch/MainWnd.cpp (.../MainWnd.cpp) (revision 8b7479db2ee71a3d00779c67fe6a1b1d9ec414b8) @@ -43,6 +43,7 @@ #include "../libchcore/TTaskManagerStatsSnapshot.h" #include "../libchcore/TSQLiteSerializerFactory.h" #include "TRecentPathsTools.h" +#include "DirectoryChooser.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -450,7 +451,7 @@ chcore::TString wstrData(pszBuffer); chcore::TTaskDefinition tTaskDefinition; - tTaskDefinition.LoadFromString(wstrData); + tTaskDefinition.LoadFromString(wstrData, true); // apply current options from global config; in the future we might want to merge the incoming options with global ones instead of overwriting... chcore::TConfig& rConfig = GetConfig(); @@ -475,6 +476,14 @@ tTaskDefinition = dlg.m_tTaskDefinition; } + else if(tTaskDefinition.GetDestinationPath().IsEmpty()) + { + chcore::TSmartPath pathSelected; + if(DirectoryChooser::ChooseDirectory(tTaskDefinition.GetOperationType(), tTaskDefinition.GetSourcePaths(), pathSelected) == IDOK) + tTaskDefinition.SetDestinationPath(pathSelected); + else + break; + } // load resource strings chcore::SetTaskPropValue(tTaskDefinition.GetConfiguration(), GetResManager().LoadString(IDS_FIRSTCOPY_STRING)); @@ -629,6 +638,7 @@ case WM_GETCONFIG: { chcore::TConfig& rConfig = GetConfig(); + ictranslate::CResourceManager& rResManager = GetResManager(); TShellExtMenuConfig cfgShellExt; @@ -649,7 +659,7 @@ bool bAddedAnyOption = false; if(GetPropValue(rConfig)) { - spRootItem->AddChild(boost::make_shared(GetResManager().LoadString(IDS_MENUCOPY_STRING), GetResManager().LoadString(IDS_MENUTIPCOPY_STRING), + spRootItem->AddChild(boost::make_shared(rResManager.LoadString(IDS_MENUCOPY_STRING), rResManager.LoadString(IDS_MENUTIPCOPY_STRING), TOperationTypeInfo(TOperationTypeInfo::eOpType_Specified, chcore::eOperation_Copy), TSourcePathsInfo(TSourcePathsInfo::eSrcType_InitializeIDataObject), TDestinationPathInfo(TDestinationPathInfo::eDstType_InitializePidlFolder, chcore::TSmartPath()), false, chcore::eOperation_Copy)); @@ -658,7 +668,7 @@ if(GetPropValue(rConfig)) { - spRootItem->AddChild(boost::make_shared(GetResManager().LoadString(IDS_MENUMOVE_STRING), GetResManager().LoadString(IDS_MENUTIPMOVE_STRING), + spRootItem->AddChild(boost::make_shared(rResManager.LoadString(IDS_MENUMOVE_STRING), rResManager.LoadString(IDS_MENUTIPMOVE_STRING), TOperationTypeInfo(TOperationTypeInfo::eOpType_Specified, chcore::eOperation_Move), TSourcePathsInfo(TSourcePathsInfo::eSrcType_InitializeIDataObject), TDestinationPathInfo(TDestinationPathInfo::eDstType_InitializePidlFolder, chcore::TSmartPath()), false, chcore::eOperation_Move)); @@ -667,7 +677,7 @@ if(GetPropValue(rConfig)) { - spRootItem->AddChild(boost::make_shared(GetResManager().LoadString(IDS_MENUCOPYMOVESPECIAL_STRING), GetResManager().LoadString(IDS_MENUTIPCOPYMOVESPECIAL_STRING), + spRootItem->AddChild(boost::make_shared(rResManager.LoadString(IDS_MENUCOPYMOVESPECIAL_STRING), rResManager.LoadString(IDS_MENUTIPCOPYMOVESPECIAL_STRING), TOperationTypeInfo(TOperationTypeInfo::eOpType_Autodetect, chcore::eOperation_Copy), TSourcePathsInfo(TSourcePathsInfo::eSrcType_InitializeIDataObject), TDestinationPathInfo(TDestinationPathInfo::eDstType_InitializePidlFolder, chcore::TSmartPath()), true)); @@ -685,18 +695,18 @@ { if(GetPropValue(rConfig)) { - spRootItem->AddChild(boost::make_shared(GetResManager().LoadString(IDS_MENUPASTE_STRING), GetResManager().LoadString(IDS_MENUTIPPASTE_STRING), + spRootItem->AddChild(boost::make_shared(rResManager.LoadString(IDS_MENUPASTE_STRING), rResManager.LoadString(IDS_MENUTIPPASTE_STRING), TOperationTypeInfo(TOperationTypeInfo::eOpType_Autodetect, chcore::eOperation_Copy), TSourcePathsInfo(TSourcePathsInfo::eSrcType_Clipboard), TDestinationPathInfo(TDestinationPathInfo::eDstType_InitializeAuto, chcore::TSmartPath()), false)); } if(GetPropValue(rConfig)) { - spRootItem->AddChild(boost::make_shared(GetResManager().LoadString(IDS_MENUPASTESPECIAL_STRING), GetResManager().LoadString(IDS_MENUTIPPASTESPECIAL_STRING), + spRootItem->AddChild(boost::make_shared(rResManager.LoadString(IDS_MENUPASTESPECIAL_STRING), rResManager.LoadString(IDS_MENUTIPPASTESPECIAL_STRING), TOperationTypeInfo(TOperationTypeInfo::eOpType_Autodetect, chcore::eOperation_Copy), TSourcePathsInfo(TSourcePathsInfo::eSrcType_Clipboard), - TDestinationPathInfo(TDestinationPathInfo::eDstType_InitializeAuto, chcore::TSmartPath()), false)); + TDestinationPathInfo(TDestinationPathInfo::eDstType_InitializeAuto, chcore::TSmartPath()), true)); } if(GetPropValue(rConfig) || GetPropValue(rConfig) || GetPropValue(rConfig)) @@ -735,7 +745,7 @@ if(GetPropValue(rConfig)) { - boost::shared_ptr menuItem(boost::make_shared(GetResManager().LoadString(IDS_MENUCOPYTO_STRING), GetResManager().LoadString(IDS_MENUTIPCOPYTO_STRING))); + boost::shared_ptr menuItem(boost::make_shared(rResManager.LoadString(IDS_MENUCOPYTO_STRING), rResManager.LoadString(IDS_MENUTIPCOPYTO_STRING))); BOOST_FOREACH(const CShortcut& tShortcut, vShortcuts) { menuItem->AddChild(boost::make_shared((PCTSTR)tShortcut.m_strName, (PCTSTR)tShortcut.m_strPath, @@ -745,11 +755,21 @@ } spRootItem->AddChild(menuItem); + + // optionally separator + if(!vShortcuts.empty()) + menuItem->AddChild(boost::make_shared()); + + // "Choose" menu option + menuItem->AddChild(boost::make_shared(rResManager.LoadString(IDS_SHELLEXT_CHOOSE_DIR_STRING), rResManager.LoadString(IDS_SHELLEXT_CHOOSE_DIR_TOOLTIP_STRING), + TOperationTypeInfo(TOperationTypeInfo::eOpType_Specified, chcore::eOperation_Copy), + TSourcePathsInfo(TSourcePathsInfo::eSrcType_InitializeAuto), + TDestinationPathInfo(TDestinationPathInfo::eDstType_Choose, chcore::TSmartPath()), false)); } if(GetPropValue(rConfig)) { - boost::shared_ptr menuItem(boost::make_shared(GetResManager().LoadString(IDS_MENUMOVETO_STRING), GetResManager().LoadString(IDS_MENUTIPMOVETO_STRING))); + boost::shared_ptr menuItem(boost::make_shared(rResManager.LoadString(IDS_MENUMOVETO_STRING), rResManager.LoadString(IDS_MENUTIPMOVETO_STRING))); BOOST_FOREACH(const CShortcut& tShortcut, vShortcuts) { menuItem->AddChild(boost::make_shared((PCTSTR)tShortcut.m_strName, (PCTSTR)tShortcut.m_strPath, @@ -759,11 +779,21 @@ } spRootItem->AddChild(menuItem); + + // optionally separator + if(!vShortcuts.empty()) + menuItem->AddChild(boost::make_shared()); + + // "Choose" menu option + menuItem->AddChild(boost::make_shared(rResManager.LoadString(IDS_SHELLEXT_CHOOSE_DIR_STRING), rResManager.LoadString(IDS_SHELLEXT_CHOOSE_DIR_TOOLTIP_STRING), + TOperationTypeInfo(TOperationTypeInfo::eOpType_Specified, chcore::eOperation_Move), + TSourcePathsInfo(TSourcePathsInfo::eSrcType_InitializeAuto), + TDestinationPathInfo(TDestinationPathInfo::eDstType_Choose, chcore::TSmartPath()), false)); } if(GetPropValue(rConfig)) { - boost::shared_ptr menuItem(boost::make_shared(GetResManager().LoadString(IDS_MENUCOPYMOVETOSPECIAL_STRING), GetResManager().LoadString(IDS_MENUTIPCOPYMOVETOSPECIAL_STRING))); + boost::shared_ptr menuItem(boost::make_shared(rResManager.LoadString(IDS_MENUCOPYMOVETOSPECIAL_STRING), rResManager.LoadString(IDS_MENUTIPCOPYMOVETOSPECIAL_STRING))); BOOST_FOREACH(const CShortcut& tShortcut, vShortcuts) { menuItem->AddChild(boost::make_shared((PCTSTR)tShortcut.m_strName, (PCTSTR)tShortcut.m_strPath, @@ -773,6 +803,16 @@ } spRootItem->AddChild(menuItem); + + // optionally separator + if(!vShortcuts.empty()) + menuItem->AddChild(boost::make_shared()); + + // "Choose" menu option + menuItem->AddChild(boost::make_shared(rResManager.LoadString(IDS_SHELLEXT_CHOOSE_DIR_STRING), rResManager.LoadString(IDS_SHELLEXT_CHOOSE_DIR_TOOLTIP_STRING), + TOperationTypeInfo(TOperationTypeInfo::eOpType_Specified, chcore::eOperation_Copy), + TSourcePathsInfo(TSourcePathsInfo::eSrcType_InitializeAuto), + TDestinationPathInfo(TDestinationPathInfo::eDstType_Choose, chcore::TSmartPath()), true)); } } } Index: src/ch/ch.rc =================================================================== diff -u -N -r75318f0d3808d8d3c02dbc333c80b6d6e07fae13 -r8b7479db2ee71a3d00779c67fe6a1b1d9ec414b8 --- src/ch/ch.rc (.../ch.rc) (revision 75318f0d3808d8d3c02dbc333c80b6d6e07fae13) +++ src/ch/ch.rc (.../ch.rc) (revision 8b7479db2ee71a3d00779c67fe6a1b1d9ec414b8) @@ -1122,6 +1122,8 @@ IDS_DIALOGS_SHOW_HIDE_STRING "Show/hide dialogs" IDS_SHELLEXT_REGISTER_SHOWHIDE_STRING "Show message about shell extension not registered" IDS_SHELLEXT_VERSIONMISMATCH_SHOWHIDE_STRING "Show message about shell extension version mismatch" + IDS_SHELLEXT_CHOOSE_DIR_STRING "Choose directory..." + IDS_SHELLEXT_CHOOSE_DIR_TOOLTIP_STRING "Allows to choose the destination directory" END STRINGTABLE Index: src/ch/ch.vc90.vcproj =================================================================== diff -u -N -r096451721a732567aad7e103bfe2d0a9f2f32c95 -r8b7479db2ee71a3d00779c67fe6a1b1d9ec414b8 --- src/ch/ch.vc90.vcproj (.../ch.vc90.vcproj) (revision 096451721a732567aad7e103bfe2d0a9f2f32c95) +++ src/ch/ch.vc90.vcproj (.../ch.vc90.vcproj) (revision 8b7479db2ee71a3d00779c67fe6a1b1d9ec414b8) @@ -811,6 +811,14 @@ > + + + + Index: src/ch/resource.h =================================================================== diff -u -N -r75318f0d3808d8d3c02dbc333c80b6d6e07fae13 -r8b7479db2ee71a3d00779c67fe6a1b1d9ec414b8 --- src/ch/resource.h (.../resource.h) (revision 75318f0d3808d8d3c02dbc333c80b6d6e07fae13) +++ src/ch/resource.h (.../resource.h) (revision 8b7479db2ee71a3d00779c67fe6a1b1d9ec414b8) @@ -507,6 +507,8 @@ #define IDS_MENUTIPCOPYTO_STRING 9013 #define IDS_MENUTIPMOVETO_STRING 9014 #define IDS_MENUTIPCOPYMOVETOSPECIAL_STRING 9015 +#define IDS_SHELLEXT_CHOOSE_DIR_STRING 9016 +#define IDS_SHELLEXT_CHOOSE_DIR_TOOLTIP_STRING 9017 #define IDS_BROWSE_STRING 13000 #define IDS_BDREMOTENAME_STRING 13001 #define IDS_BDLOCALNAME_STRING 13002 Index: src/chext/TShellExtData.cpp =================================================================== diff -u -N -r5e13d7ff5d449cdb79a004e3e5239fc9777f1f9f -r8b7479db2ee71a3d00779c67fe6a1b1d9ec414b8 --- src/chext/TShellExtData.cpp (.../TShellExtData.cpp) (revision 5e13d7ff5d449cdb79a004e3e5239fc9777f1f9f) +++ src/chext/TShellExtData.cpp (.../TShellExtData.cpp) (revision 8b7479db2ee71a3d00779c67fe6a1b1d9ec414b8) @@ -197,6 +197,9 @@ return false; break; } + case TDestinationPathInfo::eDstType_Choose: + break; // returns true + default: return false; } @@ -385,6 +388,10 @@ tDestinationPath = spMenuItem->GetDestinationPathInfo().GetDefaultDestinationPath(); break; } + case TDestinationPathInfo::eDstType_Choose: + // tDestinationPath is already clear; returning true + break; + default: return false; } Index: src/common/TShellExtMenuConfig.h =================================================================== diff -u -N -r488f785a5369dfe98e89d21915b82766b101a5c2 -r8b7479db2ee71a3d00779c67fe6a1b1d9ec414b8 --- src/common/TShellExtMenuConfig.h (.../TShellExtMenuConfig.h) (revision 488f785a5369dfe98e89d21915b82766b101a5c2) +++ src/common/TShellExtMenuConfig.h (.../TShellExtMenuConfig.h) (revision 8b7479db2ee71a3d00779c67fe6a1b1d9ec414b8) @@ -100,6 +100,7 @@ eDstType_InitializePidlFolder, eDstType_InitializeIDataObject, eDstType_InitializeAuto, + eDstType_Choose, }; public: Index: src/libchcore/TTaskDefinition.cpp =================================================================== diff -u -N -rb193a95402f2bf4c456fb9d65d111caaf6994823 -r8b7479db2ee71a3d00779c67fe6a1b1d9ec414b8 --- src/libchcore/TTaskDefinition.cpp (.../TTaskDefinition.cpp) (revision b193a95402f2bf4c456fb9d65d111caaf6994823) +++ src/libchcore/TTaskDefinition.cpp (.../TTaskDefinition.cpp) (revision 8b7479db2ee71a3d00779c67fe6a1b1d9ec414b8) @@ -121,7 +121,8 @@ void TTaskDefinition::SetDestinationPath(const TSmartPath& pathDestination) { m_pathDestinationPath = pathDestination; - m_pathDestinationPath.AppendSeparatorIfDoesNotExist(); + if(!m_pathDestinationPath.IsEmpty()) + m_pathDestinationPath.AppendSeparatorIfDoesNotExist(); m_bModified = true; } @@ -255,7 +256,7 @@ tTaskInfo.WriteToString(strOutput); } -void TTaskDefinition::LoadFromString(const TString& strInput) +void TTaskDefinition::LoadFromString(const TString& strInput, bool bAllowEmptyDstPath) { // read everything TConfig tTaskInfo; @@ -289,10 +290,11 @@ GetConfigValue(tTaskInfo, _T("TaskDefinition.Filters"), m_afFilters); // destination path - if(!GetConfigValue(tTaskInfo, _T("TaskDefinition.DestinationPath"), m_pathDestinationPath) || m_pathDestinationPath.IsEmpty()) + if(!GetConfigValue(tTaskInfo, _T("TaskDefinition.DestinationPath"), m_pathDestinationPath) || (!bAllowEmptyDstPath && m_pathDestinationPath.IsEmpty())) THROW_CORE_EXCEPTION(eErr_MissingXmlData); - m_pathDestinationPath.AppendSeparatorIfDoesNotExist(); + if(!m_pathDestinationPath.IsEmpty()) + m_pathDestinationPath.AppendSeparatorIfDoesNotExist(); // type of the operation int iOperation = eOperation_None; Index: src/libchcore/TTaskDefinition.h =================================================================== diff -u -N -rb193a95402f2bf4c456fb9d65d111caaf6994823 -r8b7479db2ee71a3d00779c67fe6a1b1d9ec414b8 --- src/libchcore/TTaskDefinition.h (.../TTaskDefinition.h) (revision b193a95402f2bf4c456fb9d65d111caaf6994823) +++ src/libchcore/TTaskDefinition.h (.../TTaskDefinition.h) (revision 8b7479db2ee71a3d00779c67fe6a1b1d9ec414b8) @@ -81,7 +81,7 @@ void Load(const TSmartPath& strPath); void StoreInString(TString& strInput); - void LoadFromString(const TString& strInput); + void LoadFromString(const TString& strInput, bool bAllowEmptyDstPath = false); private: TString m_strTaskName; ///< Unique ID of the task that will process this request (generated automatically)