Index: src/ch/CustomCopyDlg.cpp =================================================================== diff -u -r336bb030d9b4bff561ff100563725213ed6703c9 -re912e0a6b456c2eed24bec7303a908d3ff0aa59a --- src/ch/CustomCopyDlg.cpp (.../CustomCopyDlg.cpp) (revision 336bb030d9b4bff561ff100563725213ed6703c9) +++ src/ch/CustomCopyDlg.cpp (.../CustomCopyDlg.cpp) (revision e912e0a6b456c2eed24bec7303a908d3ff0aa59a) @@ -593,13 +593,13 @@ if (rFilter.m_bUseSize) { - _sntprintf(szLoaded, 1024, _T("%s %s"), GetResManager()->LoadString(IDS_LT_STRING+rFilter.m_iSizeType1), GetSizeString(static_cast<__int64>(rFilter.m_ullSize1), szData, true)); + _sntprintf(szLoaded, 1024, _T("%s %s"), GetResManager()->LoadString(IDS_LT_STRING+rFilter.m_iSizeType1), GetSizeString(rFilter.m_ullSize1, szData, true)); szLoaded[1023] = _T('\0'); if (rFilter.m_bUseSize2) { _tcscat(szLoaded, GetResManager()->LoadString(IDS_AND_STRING)); CString strLoaded2; - strLoaded2.Format(_T("%s %s"), GetResManager()->LoadString(IDS_LT_STRING+rFilter.m_iSizeType2), GetSizeString(static_cast<__int64>(rFilter.m_ullSize2), szData, true)); + strLoaded2.Format(_T("%s %s"), GetResManager()->LoadString(IDS_LT_STRING+rFilter.m_iSizeType2), GetSizeString(rFilter.m_ullSize2, szData, true)); _tcscat(szLoaded, strLoaded2); } } Fisheye: Tag e912e0a6b456c2eed24bec7303a908d3ff0aa59a refers to a dead (removed) revision in file `src/ch/DstFileErrorDlg.cpp'. Fisheye: No comparison available. Pass `N' to diff? Index: src/ch/FeedbackFileErrorDlg.cpp =================================================================== diff -u --- src/ch/FeedbackFileErrorDlg.cpp (revision 0) +++ src/ch/FeedbackFileErrorDlg.cpp (revision e912e0a6b456c2eed24bec7303a908d3ff0aa59a) @@ -0,0 +1,94 @@ +// FeedbackOpenFileErrorDlg.cpp : implementation file +// + +#include "stdafx.h" +#include "ch.h" +#include "FeedbackFileErrorDlg.h" +#include "FeedbackHandler.h" + +// CFeedbackFileErrorDlg dialog + +IMPLEMENT_DYNAMIC(CFeedbackFileErrorDlg, ictranslate::CLanguageDialog) + +CFeedbackFileErrorDlg::CFeedbackFileErrorDlg(const tchar_t* pszPath, ulong_t ulSysError, CWnd* pParent /*=NULL*/) + : ictranslate::CLanguageDialog(CFeedbackFileErrorDlg::IDD, pParent), + m_bAllItems(FALSE), + m_strPath(pszPath), + m_ulSysError(ulSysError) +{ + +} + +CFeedbackFileErrorDlg::~CFeedbackFileErrorDlg() +{ +} + +void CFeedbackFileErrorDlg::DoDataExchange(CDataExchange* pDX) +{ + ictranslate::CLanguageDialog::DoDataExchange(pDX); + DDX_Check(pDX, IDC_ALL_ITEMS_CHECK, m_bAllItems); + DDX_Control(pDX, IDC_INFO_STATIC, m_ctlErrorInfo); +} + + +BEGIN_MESSAGE_MAP(CFeedbackFileErrorDlg, ictranslate::CLanguageDialog) + ON_BN_CLICKED(IDC_RETRY_BUTTON, &CFeedbackFileErrorDlg::OnBnClickedRetryButton) + ON_BN_CLICKED(IDC_SKIP_BUTTON, &CFeedbackFileErrorDlg::OnBnClickedSkipButton) + ON_BN_CLICKED(IDC_PAUSE_BUTTON, &CFeedbackFileErrorDlg::OnBnClickedPauseButton) + ON_BN_CLICKED(IDCANCEL, &CFeedbackFileErrorDlg::OnBnClickedCancel) +END_MESSAGE_MAP() + + +// CFeedbackFileErrorDlg message handlers +BOOL CFeedbackFileErrorDlg::OnInitDialog() +{ + CLanguageDialog::OnInitDialog(); + + ictranslate::CResourceManager* pResManager = GetResManager(); + BOOST_ASSERT(pResManager); + if(pResManager) + { + CString strFmt; + strFmt = pResManager->LoadString(IDS_INFO_FILE_STRING); + strFmt += _T("\r\n"); + strFmt += pResManager->LoadString(IDS_INFO_REASON_STRING); + + // get system error string + TCHAR szSystem[1024]; + DWORD dwPos=FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, m_ulSysError, 0, szSystem, 1023, NULL); + szSystem[1023] = _T('\0'); + + // get rid of \r\n at the end of szSystem + while(--dwPos && (szSystem[dwPos] == 0x0a || szSystem[dwPos] == 0x0d)) + szSystem[dwPos]=_T('\0'); + + ictranslate::CFormat fmt(strFmt); + fmt.SetParam(_t("%filename"), m_strPath); + fmt.SetParam(_t("%reason"), szSystem); + + m_ctlErrorInfo.SetWindowText(fmt); + } + + return TRUE; // return TRUE unless you set the focus to a control + // EXCEPTION: OCX Property Pages should return FALSE +} + +void CFeedbackFileErrorDlg::OnBnClickedRetryButton() +{ + EndDialog(CFeedbackHandler::eResult_Retry); +} + +void CFeedbackFileErrorDlg::OnBnClickedSkipButton() +{ + EndDialog(CFeedbackHandler::eResult_Skip); +} + +void CFeedbackFileErrorDlg::OnBnClickedPauseButton() +{ + EndDialog(CFeedbackHandler::eResult_Pause); +} + +void CFeedbackFileErrorDlg::OnBnClickedCancel() +{ + EndDialog(CFeedbackHandler::eResult_Cancel); +} Index: src/ch/FeedbackFileErrorDlg.h =================================================================== diff -u --- src/ch/FeedbackFileErrorDlg.h (revision 0) +++ src/ch/FeedbackFileErrorDlg.h (revision e912e0a6b456c2eed24bec7303a908d3ff0aa59a) @@ -0,0 +1,52 @@ +/*************************************************************************** + * Copyright (C) 2001-2008 by J�zef 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 __FEEDBACKFILEERRORDLG_H__ +#define __FEEDBACKFILEERRORDLG_H__ +#include "afxwin.h" + +// CFeedbackFileErrorDlg dialog +class CFeedbackFileErrorDlg : public ictranslate::CLanguageDialog +{ + DECLARE_DYNAMIC(CFeedbackFileErrorDlg) + +public: + CFeedbackFileErrorDlg(const tchar_t* pszPath, ulong_t ulSysError, CWnd* pParent = NULL); // standard constructor + virtual ~CFeedbackFileErrorDlg(); + +// Dialog Data + enum { IDD = IDD_FEEDBACK_FILE_ERROR_DIALOG }; + + afx_msg void OnBnClickedRetryButton(); + afx_msg void OnBnClickedSkipButton(); + afx_msg void OnBnClickedPauseButton(); + afx_msg void OnBnClickedCancel(); + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + + DECLARE_MESSAGE_MAP() +public: + BOOL m_bAllItems; + CStatic m_ctlErrorInfo; + CString m_strPath; + ulong_t m_ulSysError; + virtual BOOL OnInitDialog(); +}; + +#endif Index: src/ch/FeedbackHandler.cpp =================================================================== diff -u --- src/ch/FeedbackHandler.cpp (revision 0) +++ src/ch/FeedbackHandler.cpp (revision e912e0a6b456c2eed24bec7303a908d3ff0aa59a) @@ -0,0 +1,108 @@ +/*************************************************************************** + * Copyright (C) 2001-2008 by J�zef 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 "FeedbackHandler.h" +#include "FeedbackReplaceDlg.h" +#include "FeedbackFileErrorDlg.h" +#include "FeedbackNotEnoughSpaceDlg.h" + +CFeedbackHandler::CFeedbackHandler() : + chcore::IFeedbackHandler() +{ + memset(m_aeFeedbackTypeStatus, 0, sizeof(m_aeFeedbackTypeStatus)); +} + +CFeedbackHandler::~CFeedbackHandler() +{ + +} + +ull_t CFeedbackHandler::RequestFeedback(ull_t ullFeedbackID, ptr_t pFeedbackParam) +{ + BOOST_ASSERT(pFeedbackParam && ullFeedbackID < eFT_LastType); + if(!pFeedbackParam || ullFeedbackID >= eFT_LastType) + return eResult_Unknown; + + // if we have an action selected for this type (e.g. by selecting 'use for all items') + if(m_aeFeedbackTypeStatus[ullFeedbackID] != eResult_Unknown) + return m_aeFeedbackTypeStatus[ullFeedbackID]; + + // standard processing of feedback + EFeedbackResult eFeedbackResult = eResult_Unknown; + BOOL bUseForAllItems = FALSE; + switch(ullFeedbackID) + { + case eFT_FileAlreadyExists: + { + FEEDBACK_ALREADYEXISTS* pData = (FEEDBACK_ALREADYEXISTS*)pFeedbackParam; + CFeedbackReplaceDlg dlg(pData->pfiSrc, pData->pfiDst); + eFeedbackResult = (EFeedbackResult)dlg.DoModal(); + bUseForAllItems = dlg.m_bAllItems; + + break; + } + case eFT_FileError: + { + FEEDBACK_FILEERROR* pData = (FEEDBACK_FILEERROR*)pFeedbackParam; + CFeedbackFileErrorDlg dlg(pData->pszPath, pData->ulError); + eFeedbackResult = (EFeedbackResult)dlg.DoModal(); + bUseForAllItems = dlg.m_bAllItems; + + break; + } + case eFT_NotEnoughSpace: + { + FEEDBACK_NOTENOUGHSPACE* pData = (FEEDBACK_NOTENOUGHSPACE*)pFeedbackParam; + CFeedbackNotEnoughSpaceDlg dlg(pData->ullRequiredSize, pData->pszSrcPath, pData->pszDstPath); + eFeedbackResult = (EFeedbackResult)dlg.DoModal(); + bUseForAllItems = dlg.m_bAllItems; + + break; + } + default: + BOOST_ASSERT(false); + return eResult_Unknown; + } + + // remember feedback option for next time + if(bUseForAllItems) + m_aeFeedbackTypeStatus[ullFeedbackID] = eFeedbackResult; + + return eFeedbackResult; +} + +void CFeedbackHandler::Delete() +{ + delete this; +} + +chcore::IFeedbackHandler* CFeedbackHandlerFactory::Create() +{ + return new CFeedbackHandler; +} + +chcore::IFeedbackHandlerFactory* CFeedbackHandlerFactory::CreateFactory() +{ + return new CFeedbackHandlerFactory; +} + +void CFeedbackHandlerFactory::Delete() +{ + delete this; +} Index: src/ch/FeedbackHandler.h =================================================================== diff -u --- src/ch/FeedbackHandler.h (revision 0) +++ src/ch/FeedbackHandler.h (revision e912e0a6b456c2eed24bec7303a908d3ff0aa59a) @@ -0,0 +1,94 @@ +/*************************************************************************** + * Copyright (C) 2001-2008 by J�zef 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 __FEEDBACKHANDLER_H__ +#define __FEEDBACKHANDLER_H__ + +#include "../libchcore/FeedbackHandlerBase.h" +#include "FileInfo.h" + +struct FEEDBACK_ALREADYEXISTS +{ + CFileInfo* pfiSrc; + CFileInfo* pfiDst; +}; + +struct FEEDBACK_FILEERROR +{ + const tchar_t* pszPath; + ulong_t ulError; +}; + +struct FEEDBACK_NOTENOUGHSPACE +{ + ull_t ullRequiredSize; + const tchar_t* pszSrcPath; + const tchar_t* pszDstPath; +}; + +class CFeedbackHandler : public chcore::IFeedbackHandler +{ +public: + enum EFeedbackType + { + eFT_Unknown = 0, + eFT_FileAlreadyExists, + eFT_FileError, + eFT_NotEnoughSpace, + eFT_LastType + }; + + enum EFeedbackResult + { + eResult_Unknown = 0, + eResult_Overwrite, + eResult_CopyRest, + eResult_Skip, + eResult_Cancel, + eResult_Pause, + eResult_Retry + }; + +protected: + CFeedbackHandler(); + ~CFeedbackHandler(); + +public: + virtual ull_t RequestFeedback(ull_t ullFeedbackID, ptr_t pFeedbackParam); + virtual void Delete(); + +protected: + EFeedbackResult m_aeFeedbackTypeStatus[eFT_LastType]; + + friend class CFeedbackHandlerFactory; +}; + +class CFeedbackHandlerFactory : public chcore::IFeedbackHandlerFactory +{ +protected: + CFeedbackHandlerFactory() {} + ~CFeedbackHandlerFactory() {} + +public: + chcore::IFeedbackHandler* Create(); + virtual void Delete(); + + static IFeedbackHandlerFactory* CreateFactory(); +}; + +#endif Index: src/ch/FeedbackNotEnoughSpaceDlg.cpp =================================================================== diff -u --- src/ch/FeedbackNotEnoughSpaceDlg.cpp (revision 0) +++ src/ch/FeedbackNotEnoughSpaceDlg.cpp (revision e912e0a6b456c2eed24bec7303a908d3ff0aa59a) @@ -0,0 +1,149 @@ +/*************************************************************************** +* Copyright (C) 2001-2008 by J�zef 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 "ch.h" +#include "FeedbackNotEnoughSpaceDlg.h" +#include "btnIDs.h" +#include "StringHelpers.h" +#include "..\Common\FileSupport.h" +#include "FeedbackHandler.h" +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CFeedbackNotEnoughSpaceDlg dialog + + +CFeedbackNotEnoughSpaceDlg::CFeedbackNotEnoughSpaceDlg(ull_t ullSizeRequired, const tchar_t* pszSrcPath, const tchar_t* pszDstPath) + :ictranslate::CLanguageDialog(CFeedbackNotEnoughSpaceDlg::IDD), + m_bAllItems(FALSE), + m_ullRequired(ullSizeRequired), + m_strDisk(pszDstPath) +{ + m_vstrFiles.push_back(pszSrcPath); +} + + +void CFeedbackNotEnoughSpaceDlg::DoDataExchange(CDataExchange* pDX) +{ + CLanguageDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CFeedbackNotEnoughSpaceDlg) + DDX_Control(pDX, IDC_FILES_LIST, m_ctlFiles); + //}}AFX_DATA_MAP + DDX_Check(pDX, IDC_ALL_ITEMS_CHECK, m_bAllItems); +} + + +BEGIN_MESSAGE_MAP(CFeedbackNotEnoughSpaceDlg,ictranslate::CLanguageDialog) + //{{AFX_MSG_MAP(CFeedbackNotEnoughSpaceDlg) + ON_WM_TIMER() + ON_BN_CLICKED(IDC_RETRY_BUTTON, OnRetryButton) + ON_BN_CLICKED(IDC_IGNORE_BUTTON, OnIgnoreButton) + //}}AFX_MSG_MAP + ON_BN_CLICKED(IDCANCEL, &CFeedbackNotEnoughSpaceDlg::OnBnClickedCancel) +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CFeedbackNotEnoughSpaceDlg message handlers +void CFeedbackNotEnoughSpaceDlg::UpdateDialog() +{ + // format needed text + ictranslate::CFormat fmt(GetResManager()->LoadString(IDS_NERPATH_STRING)); + fmt.SetParam(_t("%path"), m_strDisk); + + CWnd* pWnd=GetDlgItem(IDC_HEADER_STATIC); + if (pWnd) + pWnd->SetWindowText(fmt); + + // now the sizes + TCHAR szData[128]; + pWnd=GetDlgItem(IDC_REQUIRED_STATIC); + if (pWnd) + pWnd->SetWindowText(GetSizeString(m_ullRequired, szData, 128)); + ull_t ullFree; + pWnd=GetDlgItem(IDC_AVAILABLE_STATIC); + if (pWnd && GetDynamicFreeSpace(m_strDisk, &ullFree, NULL)) + pWnd->SetWindowText(GetSizeString(ullFree, szData, 128)); +} + +BOOL CFeedbackNotEnoughSpaceDlg::OnInitDialog() +{ + CLanguageDialog::OnInitDialog(); + + // set to top + SetWindowPos(&wndNoTopMost, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE /*| SWP_SHOWWINDOW*/); + + // needed data + for (size_t i=0;iSetWindowText(GetSizeString(ullFree, szData, 128)); + + // end dialog if this is enough + if (m_ullRequired <= ullFree) + { + CLanguageDialog::OnTimer(nIDEvent); + EndDialog(ID_RETRY); + } + } + } + + CLanguageDialog::OnTimer(nIDEvent); +} + +void CFeedbackNotEnoughSpaceDlg::OnRetryButton() +{ + EndDialog(CFeedbackHandler::eResult_Retry); +} + +void CFeedbackNotEnoughSpaceDlg::OnIgnoreButton() +{ + EndDialog(CFeedbackHandler::eResult_Skip); +} + +void CFeedbackNotEnoughSpaceDlg::OnLanguageChanged() +{ + UpdateDialog(); +} + +void CFeedbackNotEnoughSpaceDlg::OnBnClickedCancel() +{ + EndDialog(CFeedbackHandler::eResult_Cancel); +} Fisheye: tag d2b121c78f510b5384b8ef0ca80afbfd7f77fef7 is not in file src/ch/FeedbackNotEnoughSpaceDlg.h Fisheye: Tag e912e0a6b456c2eed24bec7303a908d3ff0aa59a refers to a dead (removed) revision in file `src/ch/NotEnoughRoomDlg.h'. Fisheye: No comparison available. Pass `N' to diff? Index: src/ch/FeedbackReplaceDlg.cpp =================================================================== diff -u --- src/ch/FeedbackReplaceDlg.cpp (revision 0) +++ src/ch/FeedbackReplaceDlg.cpp (revision e912e0a6b456c2eed24bec7303a908d3ff0aa59a) @@ -0,0 +1,135 @@ +// FeedbackReplaceDlg.cpp : implementation file +// + +#include "stdafx.h" +#include "ch.h" +#include "FeedbackReplaceDlg.h" +#include "../libictranslate/ResourceManager.h" +#include "FileInfo.h" +#include "FeedbackHandler.h" + +// CFeedbackReplaceDlg dialog + +IMPLEMENT_DYNAMIC(CFeedbackReplaceDlg, ictranslate::CLanguageDialog) + +CFeedbackReplaceDlg::CFeedbackReplaceDlg(const CFileInfo* pfiSrcFile, const CFileInfo* pfiDstFile, CWnd* pParent /*=NULL*/) + : ictranslate::CLanguageDialog(CFeedbackReplaceDlg::IDD, pParent), + m_pfiSrcFile(pfiSrcFile), + m_pfiDstFile(pfiDstFile) + , m_bAllItems(FALSE) +{ + +} + +CFeedbackReplaceDlg::~CFeedbackReplaceDlg() +{ +} + +void CFeedbackReplaceDlg::DoDataExchange(CDataExchange* pDX) +{ + ictranslate::CLanguageDialog::DoDataExchange(pDX); + DDX_Control(pDX, IDC_SRC_ICON_STATIC, m_ctlSrcIcon); + DDX_Control(pDX, IDC_DST_ICON_STATIC, m_ctlDstIcon); + DDX_Control(pDX, IDC_SRC_INFO_STATIC, m_ctlSrcInfo); + DDX_Control(pDX, IDC_DST_INFO_STATIC, m_ctlDstInfo); + DDX_Check(pDX, IDC_ALL_ITEMS_CHECK, m_bAllItems); +} + + +BEGIN_MESSAGE_MAP(CFeedbackReplaceDlg, ictranslate::CLanguageDialog) + ON_BN_CLICKED(IDC_REPLACE_BUTTON, &CFeedbackReplaceDlg::OnBnClickedReplaceButton) + ON_BN_CLICKED(IDC_COPY_REST_BUTTON, &CFeedbackReplaceDlg::OnBnClickedCopyRestButton) + ON_BN_CLICKED(IDC_SKIP_BUTTON, &CFeedbackReplaceDlg::OnBnClickedSkipButton) + ON_BN_CLICKED(IDC_PAUSE_BUTTON, &CFeedbackReplaceDlg::OnBnClickedPauseButton) + ON_BN_CLICKED(IDC_CANCEL_BUTTON, &CFeedbackReplaceDlg::OnBnClickedCancelButton) +END_MESSAGE_MAP() + + +// CFeedbackReplaceDlg message handlers + +BOOL CFeedbackReplaceDlg::OnInitDialog() +{ + CLanguageDialog::OnInitDialog(); + + // load the informations about files + RefreshFilesInfo(); + RefreshImages(); + + return TRUE; // return TRUE unless you set the focus to a control + // EXCEPTION: OCX Property Pages should return FALSE +} + +void CFeedbackReplaceDlg::RefreshFilesInfo() +{ + BOOST_ASSERT(m_pfiSrcFile && m_pfiDstFile); + if(!m_pfiSrcFile || !m_pfiDstFile) + return; + + // load template + ictranslate::CResourceManager* pManager = GetResManager(); + BOOST_ASSERT(pManager); + if(!pManager) + return; + + CString strTemplate; + strTemplate += pManager->LoadString(IDS_INFO_FILE_STRING); + strTemplate += _T("\r\n"); + strTemplate += pManager->LoadString(IDS_INFO_SIZE_STRING); + strTemplate += _T("\r\n"); + strTemplate += pManager->LoadString(IDS_INFO_MODIFIED_STRING); + + ictranslate::CFormat fmt(strTemplate); + fmt.SetParam(_T("%filename"), m_pfiSrcFile->GetFullFilePath()); + fmt.SetParam(_T("%size"), m_pfiSrcFile->GetLength64()); + fmt.SetParam(_T("%datemod"), m_pfiSrcFile->GetLastWriteTime().Format(LOCALE_NOUSEROVERRIDE, LANG_USER_DEFAULT)); + + m_ctlSrcInfo.SetWindowText(fmt); + + fmt.SetFormat(strTemplate); + fmt.SetParam(_T("%filename"), m_pfiDstFile->GetFullFilePath()); + fmt.SetParam(_T("%size"), m_pfiDstFile->GetLength64()); + fmt.SetParam(_T("%datemod"), m_pfiDstFile->GetLastWriteTime().Format(LOCALE_NOUSEROVERRIDE, LANG_USER_DEFAULT)); + + m_ctlDstInfo.SetWindowText(fmt); +} + +void CFeedbackReplaceDlg::RefreshImages() +{ + BOOST_ASSERT(m_pfiSrcFile && m_pfiDstFile); + if(!m_pfiSrcFile || !m_pfiDstFile) + return; + + SHFILEINFO shfi; + DWORD_PTR dwRes = SHGetFileInfo(m_pfiSrcFile->GetFullFilePath(), 0, &shfi, sizeof(shfi), SHGFI_ICON); + if(dwRes) + m_ctlSrcIcon.SetIcon(shfi.hIcon); + + dwRes = SHGetFileInfo(m_pfiDstFile->GetFullFilePath(), 0, &shfi, sizeof(shfi), SHGFI_ICON); + if(dwRes) + m_ctlDstIcon.SetIcon(shfi.hIcon); +} + +void CFeedbackReplaceDlg::OnBnClickedReplaceButton() +{ + EndDialog(CFeedbackHandler::eResult_Overwrite); +} + +void CFeedbackReplaceDlg::OnBnClickedCopyRestButton() +{ + EndDialog(CFeedbackHandler::eResult_CopyRest); +} + +void CFeedbackReplaceDlg::OnBnClickedSkipButton() +{ + EndDialog(CFeedbackHandler::eResult_Skip); +} + +void CFeedbackReplaceDlg::OnBnClickedPauseButton() +{ + EndDialog(CFeedbackHandler::eResult_Pause); +} + +void CFeedbackReplaceDlg::OnBnClickedCancelButton() +{ + EndDialog(CFeedbackHandler::eResult_Cancel); +} Index: src/ch/FeedbackReplaceDlg.h =================================================================== diff -u --- src/ch/FeedbackReplaceDlg.h (revision 0) +++ src/ch/FeedbackReplaceDlg.h (revision e912e0a6b456c2eed24bec7303a908d3ff0aa59a) @@ -0,0 +1,64 @@ +/*************************************************************************** + * Copyright (C) 2001-2008 by J�zef 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 __FEEDBACKREPLACEDLG_H__ +#define __FEEDBACKREPLACEDLG_H__ + +#include "afxwin.h" +#include "resource.h" +class CFileInfo; + +class CFeedbackReplaceDlg : public ictranslate::CLanguageDialog +{ + DECLARE_DYNAMIC(CFeedbackReplaceDlg) +public: + // Dialog Data + enum { IDD = IDD_FEEDBACK_REPLACE_DIALOG }; + +public: + CFeedbackReplaceDlg(const CFileInfo* pfiSrcFile, const CFileInfo* pfiDstFile, CWnd* pParent = NULL); // standard constructor + virtual ~CFeedbackReplaceDlg(); + + virtual BOOL OnInitDialog(); + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + + void RefreshFilesInfo(); + void RefreshImages(); + + DECLARE_MESSAGE_MAP() +public: + CStatic m_ctlSrcIcon; + CStatic m_ctlDstIcon; + CStatic m_ctlSrcInfo; + CStatic m_ctlDstInfo; + BOOL m_bAllItems; + +protected: + const CFileInfo* m_pfiSrcFile; + const CFileInfo* m_pfiDstFile; +public: + afx_msg void OnBnClickedReplaceButton(); + afx_msg void OnBnClickedCopyRestButton(); + afx_msg void OnBnClickedSkipButton(); + afx_msg void OnBnClickedPauseButton(); + afx_msg void OnBnClickedCancelButton(); +}; + +#endif Index: src/ch/FolderDialog.cpp =================================================================== diff -u -rd2b121c78f510b5384b8ef0ca80afbfd7f77fef7 -re912e0a6b456c2eed24bec7303a908d3ff0aa59a --- src/ch/FolderDialog.cpp (.../FolderDialog.cpp) (revision d2b121c78f510b5384b8ef0ca80afbfd7f77fef7) +++ src/ch/FolderDialog.cpp (.../FolderDialog.cpp) (revision e912e0a6b456c2eed24bec7303a908d3ff0aa59a) @@ -662,11 +662,11 @@ if (!bSkipFreeSpace) { // get disk free space - __int64 llFree, llTotal; - if (GetDynamicFreeSpace(strPath, &llFree, &llTotal)) + ull_t ullFree, ullTotal; + if (GetDynamicFreeSpace(strPath, &ullFree, &ullTotal)) { - m_strTip+=GetResManager()->LoadString(IDS_BDFREESPACE_STRING)+CString(GetSizeString(llFree, szSizeFree, false))+_T("\n"); - m_strTip+=GetResManager()->LoadString(IDS_BDCAPACITY_STRING)+CString(GetSizeString(llTotal, szSizeTotal, false))+_T("\n"); + m_strTip+=GetResManager()->LoadString(IDS_BDFREESPACE_STRING)+CString(GetSizeString(ullFree, szSizeFree, false))+_T("\n"); + m_strTip+=GetResManager()->LoadString(IDS_BDCAPACITY_STRING)+CString(GetSizeString(ullTotal, szSizeTotal, false))+_T("\n"); } } } @@ -701,11 +701,11 @@ m_strTip=sc.m_strName+_T("\r\n")+CString(GetResManager()->LoadString(IDS_BDPATH2_STRING))+sc.m_strPath; // get disk free space - __int64 llFree, llTotal; - if (GetDynamicFreeSpace(sc.m_strPath, &llFree, &llTotal)) + ull_t ullFree, ullTotal; + if (GetDynamicFreeSpace(sc.m_strPath, &ullFree, &ullTotal)) { - m_strTip+=CString(_T("\r\n"))+GetResManager()->LoadString(IDS_BDFREESPACE_STRING)+CString(GetSizeString(llFree, m_szBuffer, false))+_T("\n"); - m_strTip+=GetResManager()->LoadString(IDS_BDCAPACITY_STRING)+CString(GetSizeString(llTotal, m_szBuffer, false)); + m_strTip+=CString(_T("\r\n"))+GetResManager()->LoadString(IDS_BDFREESPACE_STRING)+CString(GetSizeString(ullFree, m_szBuffer, false))+_T("\n"); + m_strTip+=GetResManager()->LoadString(IDS_BDCAPACITY_STRING)+CString(GetSizeString(ullTotal, m_szBuffer, false)); } pit->pszText=(LPTSTR)(LPCTSTR)m_strTip; Index: src/ch/MainWnd.cpp =================================================================== diff -u -rd0fdcc905035e648382256101a3d99f429af6d56 -re912e0a6b456c2eed24bec7303a908d3ff0aa59a --- src/ch/MainWnd.cpp (.../MainWnd.cpp) (revision d0fdcc905035e648382256101a3d99f429af6d56) +++ src/ch/MainWnd.cpp (.../MainWnd.cpp) (revision e912e0a6b456c2eed24bec7303a908d3ff0aa59a) @@ -34,14 +34,9 @@ #include "FolderDialog.h" #include "CustomCopyDlg.h" -#include "ReplaceFilesDlg.h" #include "btnIDs.h" -#include "SmallReplaceFilesDlg.h" -#include "ReplaceOnlyDlg.h" -#include "DstFileErrorDlg.h" #include "..\Common\FileSupport.h" #include "AboutDlg.h" -#include "NotEnoughRoomDlg.h" #include "register.h" #include "ShutdownDlg.h" #include "StringHelpers.h" @@ -155,7 +150,8 @@ ///////////////////////////////////////////////////////////////////////////// // CMainWnd construction/destruction -CMainWnd::CMainWnd() +CMainWnd::CMainWnd() : + m_pFeedbackFactory(CFeedbackHandlerFactory::CreateFactory()) { m_pdlgStatus=NULL; m_pdlgMiniView=NULL; @@ -164,6 +160,8 @@ CMainWnd::~CMainWnd() { + if(m_pFeedbackFactory) + m_pFeedbackFactory->Delete(); } // case insensitive replacement @@ -431,144 +429,73 @@ { // do we copy rest or recopy ? bool bCopyRest=GetConfig()->get_bool(PP_CMUSEAUTOCOMPLETEFILES); - UINT uiNotificationType=(UINT)GetConfig()->get_signed_num(PP_CMSHOWVISUALFEEDBACK); +// UINT uiNotificationType=(UINT)GetConfig()->get_signed_num(PP_CMSHOWVISUALFEEDBACK); // Data regarding dest file CFileInfo fiDest; bool bExist=fiDest.Create(pData->strDstFile, -1); - int iDlgCode=-1; - int *piLastDlgDesc=NULL; // ptr to int describing last used dialog + chcore::IFeedbackHandler* piFeedbackHandler = pData->pTask->GetFeedbackHandler(); + BOOST_ASSERT(piFeedbackHandler); + +// int iDlgCode=-1; +// int *piLastDlgDesc=NULL; // ptr to int describing last used dialog // don't ask for copy rest - bool bDontAsk=(pData->pTask->GetCurrentIndex() == pData->pTask->GetLastProcessedIndex()); +// bool bDontAsk=(pData->pTask->GetCurrentIndex() == pData->pTask->GetLastProcessedIndex()); pData->pTask->SetLastProcessedIndex(-1); // if dest file size >0 - we can do somethng more than usual - if ( bExist ) + if(bExist) { // src and dst files are the same - if (fiDest == *pData->pfiSrcFile) + FEEDBACK_ALREADYEXISTS feedStruct = { pData->pfiSrcFile, &fiDest }; + CFeedbackHandler::EFeedbackResult frResult = (CFeedbackHandler::EFeedbackResult)piFeedbackHandler->RequestFeedback(CFeedbackHandler::eFT_FileAlreadyExists, &feedStruct); + // check for dialog result + switch(frResult) { - // copy automatically or ask - if (uiNotificationType > 1 && !bDontAsk) + case CFeedbackHandler::eResult_Overwrite: { - if (pData->pTask->m_iIdentical == -1) - { - // show feedback - CSmallReplaceFilesDlg dlg; - dlg.m_pfiSource=pData->pfiSrcFile; - dlg.m_pfiDest=&fiDest; - dlg.m_bEnableTimer=GetConfig()->get_bool(PP_CMUSETIMEDFEEDBACK); - dlg.m_iTime=(int)GetConfig()->get_signed_num(PP_CMFEEDBACKTIME); - dlg.m_iDefaultOption=ID_IGNORE; - iDlgCode=dlg.DoModal(); - - piLastDlgDesc=&pData->pTask->m_iIdentical; - } - else - iDlgCode=pData->pTask->m_iIdentical; + bCopyRest=false; + break; } - else + case CFeedbackHandler::eResult_CopyRest: { - // increase progress + bCopyRest=true; + break; + } + case CFeedbackHandler::eResult_Skip: + { pData->pTask->IncreaseProcessedSize(pData->pfiSrcFile->GetLength64()); pData->pTask->IncreaseProcessedTasksSize(pData->pfiSrcFile->GetLength64()); - pData->bProcessed = false; - return; // don't continue if NC==0 or 1 + return; } - } - else // iDst != *pData->pfiSrcFile - { - // src and dst are different - check sizes - if (fiDest.GetLength64() < pData->pfiSrcFile->GetLength64()) + case CFeedbackHandler::eResult_Cancel: { - // we can copy rest - if (uiNotificationType > 0 && !bDontAsk) + // log + if (GetConfig()->get_bool(PP_CMCREATELOG)) { - if (pData->pTask->m_iDestinationLess == -1) - { - // show dialog - CReplaceFilesDlg dlg; - dlg.m_pfiSource=pData->pfiSrcFile; - dlg.m_pfiDest=&fiDest; - dlg.m_bEnableTimer=GetConfig()->get_bool(PP_CMUSETIMEDFEEDBACK); - dlg.m_iTime=(int)GetConfig()->get_signed_num(PP_CMFEEDBACKTIME); - dlg.m_iDefaultOption=ID_COPYREST; - - iDlgCode=dlg.DoModal(); - - piLastDlgDesc=&pData->pTask->m_iDestinationLess; - } - else - iDlgCode=pData->pTask->m_iDestinationLess; + fmt.SetFormat(GetResManager()->LoadString(IDS_OTFPRECHECKCANCELREQUEST_STRING)); + fmt.SetParam(_t("%path"), pData->pfiSrcFile->GetFullFilePath()); + pData->pTask->m_log.logi(fmt); } - // else do nothing - bCopyRest has been initialized + throw new CProcessingException(E_CANCEL, pData->pTask); + break; } - else + case CFeedbackHandler::eResult_Pause: { - // dst >= src size - if (uiNotificationType > 1 && !bDontAsk) - { - if (pData->pTask->m_iDestinationGreater == -1) - { - CSmallReplaceFilesDlg dlg; - dlg.m_pfiSource=pData->pfiSrcFile; - dlg.m_pfiDest=&fiDest; - dlg.m_bEnableTimer=GetConfig()->get_bool(PP_CMUSETIMEDFEEDBACK); - dlg.m_iTime=(int)GetConfig()->get_signed_num(PP_CMFEEDBACKTIME); - dlg.m_iDefaultOption=ID_RECOPY; - iDlgCode=dlg.DoModal(); // wy�wietl - - piLastDlgDesc=&pData->pTask->m_iDestinationGreater; - } - else - iDlgCode=pData->pTask->m_iDestinationGreater; - } - else - bCopyRest=false; // this case - recopy + throw new CProcessingException(E_PAUSE, pData->pTask); + break; } - } // iDst == *pData->pfiSrcFile - } // bExist - - // check for dialog result - switch (iDlgCode) - { - case -1: - break; - case ID_IGNOREALL: - if (piLastDlgDesc != NULL) - *piLastDlgDesc=ID_IGNOREALL; - case ID_IGNORE: - pData->pTask->IncreaseProcessedSize(pData->pfiSrcFile->GetLength64()); - pData->pTask->IncreaseProcessedTasksSize(pData->pfiSrcFile->GetLength64()); - pData->bProcessed = false; - return; - break; - case ID_COPYRESTALL: - if (piLastDlgDesc != NULL) - *piLastDlgDesc=ID_COPYRESTALL; - case ID_COPYREST: - bCopyRest=true; - break; - case IDCANCEL: - // log - if (GetConfig()->get_bool(PP_CMCREATELOG)) - { - fmt.SetFormat(GetResManager()->LoadString(IDS_OTFPRECHECKCANCELREQUEST_STRING)); - fmt.SetParam(_t("%path"), pData->pfiSrcFile->GetFullFilePath()); - pData->pTask->m_log.logi(fmt); + default: + { + BOOST_ASSERT(FALSE); // unknown result + throw new CProcessingException(E_ERROR, pData->pTask, 0, _t("Unknown feedback result type")); + break; + } } - throw new CProcessingException(E_CANCEL, pData->pTask); - break; - case ID_RECOPYALL: - if (piLastDlgDesc != NULL) - *piLastDlgDesc=ID_RECOPYALL; - case ID_RECOPY: - bCopyRest=false; - break; - } + }// bExist // change attributes of a dest file if (!GetConfig()->get_bool(PP_CMPROTECTROFILES)) @@ -591,72 +518,42 @@ if (hSrc == INVALID_HANDLE_VALUE) { DWORD dwLastError=GetLastError(); - if (uiNotificationType < 1) + CString strFile = pData->pfiSrcFile->GetFullFilePath(); + FEEDBACK_FILEERROR feedStruct = { (PCTSTR)strFile, dwLastError }; + CFeedbackHandler::EFeedbackResult frResult = (CFeedbackHandler::EFeedbackResult)piFeedbackHandler->RequestFeedback(CFeedbackHandler::eFT_FileError, &feedStruct); + + switch (frResult) { + case CFeedbackHandler::eResult_Skip: + pData->pTask->IncreaseProcessedSize(pData->pfiSrcFile->GetLength64()); + pData->pTask->IncreaseProcessedTasksSize(pData->pfiSrcFile->GetLength64()); + pData->bProcessed = false; + return; + break; + case CFeedbackHandler::eResult_Cancel: // log - fmt.SetFormat(GetResManager()->LoadString(IDS_OTFOPENINGERROR_STRING)); + fmt.SetFormat(GetResManager()->LoadString(IDS_OTFOPENINGCANCELREQUEST_STRING)); fmt.SetParam(_t("%errno"), dwLastError); fmt.SetParam(_t("%path"), pData->pfiSrcFile->GetFullFilePath()); pData->pTask->m_log.loge(TSTRFMT, fmt); - throw new CProcessingException(E_ERROR, pData->pTask, dwLastError, fmt); - } - else - { - if (pData->pTask->m_iMissingInput == -1) + throw new CProcessingException(E_CANCEL, pData->pTask); + break; + case CFeedbackHandler::eResult_Pause: + throw new CProcessingException(E_PAUSE, pData->pTask); + break; + case CFeedbackHandler::eResult_Retry: + // log + fmt.SetFormat(GetResManager()->LoadString(IDS_OTFOPENINGRETRY_STRING)); + fmt.SetParam(_t("%errno"), dwLastError); + fmt.SetParam(_t("%path"), pData->pfiSrcFile->GetFullFilePath()); + pData->pTask->m_log.loge(TSTRFMT, fmt); + goto l_openingsrc; + break; + default: { - // no source file - feedback - CFileInfo fiRealSrc; - fiRealSrc.Create(pData->pfiSrcFile->GetFullFilePath(), -1); - - CReplaceOnlyDlg dlg; - dlg.m_pfiSource=pData->pfiSrcFile; - dlg.m_pfiDest=&fiRealSrc; - dlg.m_bEnableTimer=GetConfig()->get_bool(PP_CMUSETIMEDFEEDBACK); - dlg.m_iTime=(int)GetConfig()->get_signed_num(PP_CMFEEDBACKTIME); - dlg.m_iDefaultOption=ID_WAIT; - - FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwLastError, 0, dlg.m_strMessage.GetBuffer(_MAX_PATH), _MAX_PATH, NULL); - dlg.m_strMessage.ReleaseBuffer(); - - iDlgCode=dlg.DoModal(); - } - else - iDlgCode=pData->pTask->m_iMissingInput; - - switch (iDlgCode) - { - case ID_IGNOREALL: - pData->pTask->m_iMissingInput=ID_IGNOREALL; - case ID_IGNORE: - pData->pTask->IncreaseProcessedSize(pData->pfiSrcFile->GetLength64()); - pData->pTask->IncreaseProcessedTasksSize(pData->pfiSrcFile->GetLength64()); - pData->bProcessed = false; - return; + BOOST_ASSERT(FALSE); // unknown result + throw new CProcessingException(E_ERROR, pData->pTask, 0, _t("Unknown feedback result type")); break; - case IDCANCEL: - // log - fmt.SetFormat(GetResManager()->LoadString(IDS_OTFOPENINGCANCELREQUEST_STRING)); - fmt.SetParam(_t("%errno"), dwLastError); - fmt.SetParam(_t("%path"), pData->pfiSrcFile->GetFullFilePath()); - pData->pTask->m_log.loge(TSTRFMT, fmt); - throw new CProcessingException(E_CANCEL, pData->pTask); - break; - case ID_WAIT: - // log - fmt.SetFormat(GetResManager()->LoadString(IDS_OTFOPENINGWAITREQUEST_STRING)); - fmt.SetParam(_t("%errno"), dwLastError); - fmt.SetParam(_t("%path"), pData->pfiSrcFile->GetFullFilePath()); - pData->pTask->m_log.loge(TSTRFMT, fmt); - throw new CProcessingException(E_ERROR, pData->pTask, dwLastError, fmt); - break; - case ID_RETRY: - // log - fmt.SetFormat(GetResManager()->LoadString(IDS_OTFOPENINGRETRY_STRING)); - fmt.SetParam(_t("%errno"), dwLastError); - fmt.SetParam(_t("%path"), pData->pfiSrcFile->GetFullFilePath()); - pData->pTask->m_log.loge(TSTRFMT, fmt); - goto l_openingsrc; - break; } } } @@ -667,70 +564,46 @@ if (hDst == INVALID_HANDLE_VALUE) { DWORD dwLastError=GetLastError(); - if (uiNotificationType < 1) + CString strFile = pData->strDstFile; + + FEEDBACK_FILEERROR feedStruct = { (PCTSTR)strFile, dwLastError }; + CFeedbackHandler::EFeedbackResult frResult = (CFeedbackHandler::EFeedbackResult)piFeedbackHandler->RequestFeedback(CFeedbackHandler::eFT_FileError, &feedStruct); + switch (frResult) { + case CFeedbackHandler::eResult_Retry: + // change attributes + if (!GetConfig()->get_bool(PP_CMPROTECTROFILES)) + SetFileAttributes(pData->strDstFile, FILE_ATTRIBUTE_NORMAL); + // log - fmt.SetFormat(GetResManager()->LoadString(IDS_OTFDESTOPENINGERROR_STRING)); + fmt.SetFormat(GetResManager()->LoadString(IDS_OTFDESTOPENINGRETRY_STRING)); fmt.SetParam(_t("%errno"), dwLastError); fmt.SetParam(_t("%path"), pData->strDstFile); pData->pTask->m_log.loge(TSTRFMT, fmt); - throw new CProcessingException(E_ERROR, pData->pTask, dwLastError, fmt); - } - else - { - if (pData->pTask->m_iOutputError == -1) + goto l_openingdst; + break; + case CFeedbackHandler::eResult_Cancel: + // log + fmt.SetFormat(GetResManager()->LoadString(IDS_OTFDESTOPENINGCANCELREQUEST_STRING)); + fmt.SetParam(_t("%errno"), dwLastError); + fmt.SetParam(_t("%path"), pData->strDstFile); + pData->pTask->m_log.loge(TSTRFMT, fmt); + throw new CProcessingException(E_CANCEL, pData->pTask); + break; + case CFeedbackHandler::eResult_Skip: + pData->pTask->IncreaseProcessedSize(pData->pfiSrcFile->GetLength64()); + pData->pTask->IncreaseProcessedTasksSize(pData->pfiSrcFile->GetLength64()); + pData->bProcessed = false; + return; + break; + case CFeedbackHandler::eResult_Pause: + throw new CProcessingException(E_PAUSE, pData->pTask); + break; + default: { - CDstFileErrorDlg dlg; - dlg.m_strFilename=pData->strDstFile; - FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwLastError, 0, dlg.m_strMessage.GetBuffer(_MAX_PATH), _MAX_PATH, NULL); - dlg.m_strMessage.ReleaseBuffer(); - - dlg.m_bEnableTimer=GetConfig()->get_bool(PP_CMUSETIMEDFEEDBACK); - dlg.m_iTime=(int)GetConfig()->get_signed_num(PP_CMFEEDBACKTIME); - dlg.m_iDefaultOption=ID_WAIT; - iDlgCode=dlg.DoModal(); - } - else - iDlgCode=pData->pTask->m_iOutputError; - - switch (iDlgCode) - { - case ID_RETRY: - // change attributes - if (!GetConfig()->get_bool(PP_CMPROTECTROFILES)) - SetFileAttributes(pData->strDstFile, FILE_ATTRIBUTE_NORMAL); - - // log - fmt.SetFormat(GetResManager()->LoadString(IDS_OTFDESTOPENINGRETRY_STRING)); - fmt.SetParam(_t("%errno"), dwLastError); - fmt.SetParam(_t("%path"), pData->strDstFile); - pData->pTask->m_log.loge(TSTRFMT, fmt); - goto l_openingdst; + BOOST_ASSERT(FALSE); // unknown result + throw new CProcessingException(E_ERROR, pData->pTask, 0, _t("Unknown feedback result type")); break; - case IDCANCEL: - // log - fmt.SetFormat(GetResManager()->LoadString(IDS_OTFDESTOPENINGCANCELREQUEST_STRING)); - fmt.SetParam(_t("%errno"), dwLastError); - fmt.SetParam(_t("%path"), pData->strDstFile); - pData->pTask->m_log.loge(TSTRFMT, fmt); - throw new CProcessingException(E_CANCEL, pData->pTask); - break; - case ID_IGNOREALL: - pData->pTask->m_iOutputError=ID_IGNOREALL; - case ID_IGNORE: - pData->pTask->IncreaseProcessedSize(pData->pfiSrcFile->GetLength64()); - pData->pTask->IncreaseProcessedTasksSize(pData->pfiSrcFile->GetLength64()); - pData->bProcessed = false; - return; - break; - case ID_WAIT: - // log - fmt.SetFormat(GetResManager()->LoadString(IDS_OTFDESTOPENINGWAITREQUEST_STRING)); - fmt.SetParam(_t("%errno"), dwLastError); - fmt.SetParam(_t("%path"), pData->strDstFile); - pData->pTask->m_log.loge(TSTRFMT, fmt); - throw new CProcessingException(E_ERROR, pData->pTask, dwLastError, fmt); - break; } } } @@ -1166,53 +1039,48 @@ } // check for free space - __int64 i64Needed, i64Available; + ull_t ullNeededSize = 0, ullAvailableSize = 0; l_showfeedback: pTask->m_log.logi(GetResManager()->LoadString(IDS_OTFCHECKINGSPACE_STRING)); - if (!pTask->GetRequiredFreeSpace(&i64Needed, &i64Available)) + if (!pTask->GetRequiredFreeSpace(&ullNeededSize, &ullAvailableSize)) { fmt.SetFormat(GetResManager()->LoadString(IDS_OTFNOTENOUGHFREESPACE_STRING)); - fmt.SetParam(_t("%needsize"), i64Needed); - fmt.SetParam(_t("%availablesize"), i64Available); + fmt.SetParam(_t("%needsize"), ullNeededSize); + fmt.SetParam(_t("%availablesize"), ullAvailableSize); pTask->m_log.logw(fmt); - // default - int iResult=ID_IGNORE; + chcore::IFeedbackHandler* piFeedbackHandler = pTask->GetFeedbackHandler(); + BOOST_ASSERT(piFeedbackHandler); - if (GetConfig()->get_signed_num(PP_CMSHOWVISUALFEEDBACK) > 0) + if(pTask->GetClipboardDataSize() > 0) { - // make user know that some place is missing - CNotEnoughRoomDlg dlg; - dlg.m_bEnableTimer=GetConfig()->get_bool(PP_CMUSETIMEDFEEDBACK); - dlg.m_iTime=(int)GetConfig()->get_signed_num(PP_CMFEEDBACKTIME); - - dlg.m_llRequired=i64Needed; - - for (int i=0;iGetClipboardDataSize();i++) - dlg.m_strFiles.Add(pTask->GetClipboardData(i)->GetPath()); - - dlg.m_strDisk=pTask->GetDestPath().GetPath(); + CString strSrcPath = pTask->GetClipboardData(0)->GetPath(); + CString strDstPath = pTask->GetDestPath().GetPath(); + FEEDBACK_NOTENOUGHSPACE feedStruct = { ullNeededSize, (PCTSTR)strSrcPath, (PCTSTR)strDstPath }; + CFeedbackHandler::EFeedbackResult frResult = (CFeedbackHandler::EFeedbackResult)piFeedbackHandler->RequestFeedback(CFeedbackHandler::eFT_NotEnoughSpace, &feedStruct); - // show - iResult=dlg.DoModal(); - } - - switch (iResult) - { - case IDCANCEL: + // default + switch (frResult) { - pTask->m_log.logi(GetResManager()->LoadString(IDS_OTFFREESPACECANCELREQUEST_STRING)); - throw new CProcessingException(E_CANCEL, pTask); + case CFeedbackHandler::eResult_Cancel: + { + pTask->m_log.logi(GetResManager()->LoadString(IDS_OTFFREESPACECANCELREQUEST_STRING)); + throw new CProcessingException(E_CANCEL, pTask); + break; + } + case CFeedbackHandler::eResult_Retry: + pTask->m_log.logi(GetResManager()->LoadString(IDS_OTFFREESPACERETRYING_STRING)); + goto l_showfeedback; break; + case CFeedbackHandler::eResult_Skip: + pTask->m_log.logi(GetResManager()->LoadString(IDS_OTFFREESPACEIGNORE_STRING)); + break; + default: + BOOST_ASSERT(FALSE); // unknown result + throw new CProcessingException(E_ERROR, pTask, 0, _t("Unknown feedback result type")); + break; } - case ID_RETRY: - pTask->m_log.logi(GetResManager()->LoadString(IDS_OTFFREESPACERETRYING_STRING)); - goto l_showfeedback; - break; - case ID_IGNORE: - pTask->m_log.logi(GetResManager()->LoadString(IDS_OTFFREESPACEIGNORE_STRING)); - break; } } @@ -1291,6 +1159,10 @@ PlaySound(szPath, NULL, SND_FILENAME | SND_ASYNC); } + // pause task if requested + if(e->m_iType == E_PAUSE) + pTask->SetStatus(ST_PAUSED, ST_PAUSED); + // cleanup changes flags and calls cleanup for a task e->Cleanup(); delete e; @@ -1340,7 +1212,7 @@ UINT nCount=DragQueryFile(static_cast(handle), 0xffffffff, NULL, 0); - pTask=new CTask(&pData->m_pTasks->m_tcd); + pTask = pData->m_pTasks->CreateTask(); for (UINT i=0;iSetDestPath(strDstPath); CClipboardEntry* pEntry; @@ -1984,7 +1856,7 @@ } // new task - CTask *pTask=new CTask(&m_tasks.m_tcd); + CTask *pTask = m_tasks.CreateTask(); pTask->SetDestPath(dlg.m_ccData.m_strDestPath); CClipboardEntry *pEntry; for (int i=0;iLoadString(IDS_CURRENTPASS_STRING), td.m_ucCurrentCopy, td.m_ucCopies); m_strTemp+=m_szData; GetDlgItem(IDC_PROGRESS_STATIC)->SetWindowText(m_strTemp); // transfer if (m_i64LastProcessed == 0) // if first time - show average - m_strTemp=GetSizeString( td.m_lTimeElapsed ? td.m_iProcessedSize/td.m_lTimeElapsed : 0, m_szData, _MAX_PATH); // last avg + m_strTemp=GetSizeString( td.m_lTimeElapsed ? td.m_ullProcessedSize/td.m_lTimeElapsed : 0, m_szData, _MAX_PATH); // last avg else if ( (dwCurrentTime-m_dwLastUpdate) != 0) - m_strTemp=GetSizeString( (static_cast(td.m_iProcessedSize) - static_cast(m_i64LastProcessed))/(static_cast(dwCurrentTime-m_dwLastUpdate)/1000.0), m_szData, _MAX_PATH); + m_strTemp=GetSizeString( (static_cast(td.m_ullProcessedSize) - static_cast(m_i64LastProcessed))/(static_cast(dwCurrentTime-m_dwLastUpdate)/1000.0), m_szData, _MAX_PATH); else - m_strTemp=GetSizeString( 0I64, m_szData, _MAX_PATH); + m_strTemp=GetSizeString( 0ULL, m_szData, _MAX_PATH); // avg transfer GetDlgItem(IDC_TRANSFER_STATIC)->SetWindowText(m_strTemp+_T("/s (")+CString(GetResManager()->LoadString(IDS_AVERAGEWORD_STRING)) - +CString(GetSizeString(td.m_lTimeElapsed ? td.m_iProcessedSize/td.m_lTimeElapsed : 0, m_szData, _MAX_PATH))+_T("/s )") + +CString(GetSizeString(td.m_lTimeElapsed ? td.m_ullProcessedSize/td.m_lTimeElapsed : 0, m_szData, _MAX_PATH))+_T("/s )") ); // elapsed time/estimated time FormatTime(td.m_lTimeElapsed, m_szTimeBuffer1, 40); - FormatTime( (td.m_iProcessedSize == 0) ? 0 : static_cast((static_cast<__int64>(td.m_iSizeAll)*static_cast<__int64>(td.m_lTimeElapsed))/td.m_iProcessedSize), m_szTimeBuffer2, 40); + FormatTime( (td.m_ullProcessedSize == 0) ? 0 : static_cast((static_cast<__int64>(td.m_ullSizeAll)*static_cast<__int64>(td.m_lTimeElapsed))/td.m_ullProcessedSize), m_szTimeBuffer2, 40); _sntprintf(m_szData, _MAX_PATH, _T("%s / %s"), m_szTimeBuffer1, m_szTimeBuffer2); GetDlgItem(IDC_TIME_STATIC)->SetWindowText(m_szData); // remember current processed data (used for calculating transfer) - m_i64LastProcessed=td.m_iProcessedSize; + m_i64LastProcessed=td.m_ullProcessedSize; // set progress m_ctlCurrentProgress.SetPos(td.m_nPercent); @@ -769,7 +769,7 @@ if (dwCurrentTime-m_dwLastUpdate != 0) m_strTemp=GetSizeString( (static_cast(m_pTasks->GetPosition()) - static_cast(m_i64LastAllTasksProcessed))/static_cast(static_cast(dwCurrentTime-m_dwLastUpdate)/1000.0), m_szData, _MAX_PATH); else - m_strTemp=GetSizeString( 0I64, m_szData, _MAX_PATH); + m_strTemp=GetSizeString( 0ULL, m_szData, _MAX_PATH); GetDlgItem(IDC_OVERALL_TRANSFER_STATIC)->SetWindowText(m_strTemp+_T("/s")); m_i64LastAllTasksProcessed=m_pTasks->GetPosition(); @@ -922,7 +922,7 @@ szData[0] = _T('\0'); } - _tcscat(szData, GetSizeString((__int64)uiValue, m_szData, _MAX_PATH)); + _tcscat(szData, GetSizeString((ull_t)uiValue, m_szData, _MAX_PATH)); GetDlgItem(IDC_BUFFERSIZE_STATIC)->SetWindowText(szData); } Index: src/ch/StringHelpers.cpp =================================================================== diff -u -rd2b121c78f510b5384b8ef0ca80afbfd7f77fef7 -re912e0a6b456c2eed24bec7303a908d3ff0aa59a --- src/ch/StringHelpers.cpp (.../StringHelpers.cpp) (revision d2b121c78f510b5384b8ef0ca80afbfd7f77fef7) +++ src/ch/StringHelpers.cpp (.../StringHelpers.cpp) (revision e912e0a6b456c2eed24bec7303a908d3ff0aa59a) @@ -58,6 +58,7 @@ return pszBuffer; } +/* LPTSTR GetSizeString(__int64 llData, LPTSTR pszBuffer, size_t stMaxBufferSize, bool bStrict) { if (llData < 0) @@ -74,3 +75,21 @@ return pszBuffer; } +*/ + +LPTSTR GetSizeString(ull_t ullData, LPTSTR pszBuffer, size_t stMaxBufferSize, bool bStrict) +{ + if (ullData < 0) + ullData=0; + + if (ullData >= 1258291200 && (!bStrict || (ullData % 1073741824) == 0)) + _sntprintf(pszBuffer, stMaxBufferSize, _T("%.2f %s"), (double)(ullData/1073741824.0), GetResManager()->LoadString(IDS_GBYTE_STRING)); + else if (ullData >= 1228800 && (!bStrict || (ullData % 1048576) == 0)) + _sntprintf(pszBuffer, stMaxBufferSize, _T("%.2f %s"), (double)(ullData/1048576.0), GetResManager()->LoadString(IDS_MBYTE_STRING)); + else if (ullData >= 1200 && (!bStrict || (ullData % 1024) == 0)) + _sntprintf(pszBuffer, stMaxBufferSize, _T("%.2f %s"), (double)(ullData/1024.0), GetResManager()->LoadString(IDS_KBYTE_STRING)); + else + _sntprintf(pszBuffer, stMaxBufferSize, _T("%I64u %s"), ullData, GetResManager()->LoadString(IDS_BYTE_STRING)); + + return pszBuffer; +} Index: src/ch/StringHelpers.h =================================================================== diff -u -rd2b121c78f510b5384b8ef0ca80afbfd7f77fef7 -re912e0a6b456c2eed24bec7303a908d3ff0aa59a --- src/ch/StringHelpers.h (.../StringHelpers.h) (revision d2b121c78f510b5384b8ef0ca80afbfd7f77fef7) +++ src/ch/StringHelpers.h (.../StringHelpers.h) (revision e912e0a6b456c2eed24bec7303a908d3ff0aa59a) @@ -25,6 +25,7 @@ #endif LPTSTR GetSizeString(double dData, LPTSTR pszBuffer, size_t stMaxBufferSize); -LPTSTR GetSizeString(__int64 llData, LPTSTR pszBuffer, size_t stMaxBufferSize, bool bStrict=false); +//LPTSTR GetSizeString(__int64 llData, LPTSTR pszBuffer, size_t stMaxBufferSize, bool bStrict=false); +LPTSTR GetSizeString(ull_t ullData, LPTSTR pszBuffer, size_t stMaxBufferSize, bool bStrict=false); #endif Index: src/ch/Structs.cpp =================================================================== diff -u -rf6c4389122d92e5f84a509e9be0facebac429151 -re912e0a6b456c2eed24bec7303a908d3ff0aa59a --- src/ch/Structs.cpp (.../Structs.cpp) (revision f6c4389122d92e5f84a509e9be0facebac429151) +++ src/ch/Structs.cpp (.../Structs.cpp) (revision e912e0a6b456c2eed24bec7303a908d3ff0aa59a) @@ -111,9 +111,12 @@ //////////////////////////////////////////////////////////////////////////// // CTask members -CTask::CTask(const TASK_CREATE_DATA *pCreateData) : - m_log() +CTask::CTask(chcore::IFeedbackHandler* piFeedbackHandler, const TASK_CREATE_DATA *pCreateData) : + m_log(), + m_piFeedbackHandler(piFeedbackHandler) { + BOOST_ASSERT(piFeedbackHandler); + m_nCurrentIndex=0; m_iLastProcessedIndex=-1; m_nStatus=ST_NULL_STATUS; @@ -160,6 +163,8 @@ CTask::~CTask() { KillThread(); + if(m_piFeedbackHandler) + m_piFeedbackHandler->Delete(); } // m_clipboard @@ -875,9 +880,9 @@ pData->m_strErrorDesc=m_strErrorDesc; pData->m_uiStatus=m_nStatus; pData->m_iIndex=m_nCurrentIndex+m_ucCurrentCopy*m_files.GetSize(); - pData->m_iProcessedSize=m_nProcessed; + pData->m_ullProcessedSize=m_nProcessed; pData->m_iSize=m_files.GetSize()*m_ucCopies; - pData->m_iSizeAll=m_nAll; + pData->m_ullSizeAll=m_nAll; pData->m_ucCurrentCopy=static_cast(m_ucCurrentCopy+1); // visual aspect pData->m_ucCopies=m_ucCopies; pData->m_pstrUniqueName=&m_strUniqueName; @@ -1120,16 +1125,16 @@ return iIndex; } -bool CTask::GetRequiredFreeSpace(__int64 *pi64Needed, __int64 *pi64Available) +bool CTask::GetRequiredFreeSpace(ull_t *pullNeeded, ull_t *pullAvailable) { - *pi64Needed=GetAllSize()-GetProcessedSize(); // it'd be nice to round up to take cluster size into consideration, + *pullNeeded=GetAllSize()-GetProcessedSize(); // it'd be nice to round up to take cluster size into consideration, // but GetDiskFreeSpace returns flase values // get free space - if (!GetDynamicFreeSpace(GetDestPath().GetPath(), pi64Available, NULL)) + if (!GetDynamicFreeSpace(GetDestPath().GetPath(), pullAvailable, NULL)) return true; - return (*pi64Needed <= *pi64Available); + return (*pullNeeded <= *pullAvailable); } void CTask::SetTaskPath(const tchar_t* pszDir) @@ -1184,18 +1189,56 @@ //////////////////////////////////////////////////////////////////////////////// // CTaskArray members -void CTaskArray::Create(UINT (*pfnTaskProc)(LPVOID pParam)) +CTaskArray::CTaskArray() : + CArray(), + m_uhRange(0), + m_uhPosition(0), + m_uiOperationsPending(0), + m_lFinished(0), + m_piFeedbackFactory(NULL) { +} + +CTaskArray::~CTaskArray() +{ + // NOTE: do not delete the feedback factory, since we are not responsible for releasing it +} + +void CTaskArray::Create(chcore::IFeedbackHandlerFactory* piFeedbackHandlerFactory, UINT (*pfnTaskProc)(LPVOID pParam)) +{ + BOOST_ASSERT(piFeedbackHandlerFactory && pfnTaskProc); + m_tcd.pcs=&m_cs; m_tcd.pfnTaskProc=pfnTaskProc; m_tcd.pTasksAll=&m_uhRange; m_tcd.pTasksProcessed=&m_uhPosition; m_tcd.puiOperationsPending=&m_uiOperationsPending; m_tcd.plFinished=&m_lFinished; + m_piFeedbackFactory = piFeedbackHandlerFactory; } -CTaskArray::~CTaskArray() +CTask* CTaskArray::CreateTask() { + BOOST_ASSERT(m_piFeedbackFactory); + if(!m_piFeedbackFactory) + return NULL; + + chcore::IFeedbackHandler* piHandler = m_piFeedbackFactory->Create(); + if(!piHandler) + return NULL; + + CTask* pTask = NULL; + try + { + pTask = new CTask(piHandler, &m_tcd); + } + catch(...) + { +// piHandler->Delete(); + throw; + } + + return pTask; } int CTaskArray::GetSize( ) @@ -1400,7 +1443,7 @@ bWorking=finder.FindNextFile(); // load data - pTask=new CTask(&m_tcd); + pTask = CreateTask(); try { @@ -1479,19 +1522,19 @@ GetAt(i)->CancelProcessing(); } -__int64 CTaskArray::GetPosition() +ull_t CTaskArray::GetPosition() { m_cs.Lock(); - __int64 rv=m_uhPosition; + ull_t rv=m_uhPosition; m_cs.Unlock(); return rv; } -__int64 CTaskArray::GetRange() +ull_t CTaskArray::GetRange() { m_cs.Lock(); - __int64 rv=m_uhRange; + ull_t rv=m_uhRange; m_cs.Unlock(); return rv; Index: src/ch/Structs.h =================================================================== diff -u -rf6c4389122d92e5f84a509e9be0facebac429151 -re912e0a6b456c2eed24bec7303a908d3ff0aa59a --- src/ch/Structs.h (.../Structs.h) (revision f6c4389122d92e5f84a509e9be0facebac429151) +++ src/ch/Structs.h (.../Structs.h) (revision e912e0a6b456c2eed24bec7303a908d3ff0aa59a) @@ -24,6 +24,7 @@ #include "DataBuffer.h" //#include "LogFile.h" #include "../libicpf/log.h" +#include "../libchcore/FeedbackHandlerBase.h" #define ST_NULL_STATUS 0x00000000 @@ -74,6 +75,7 @@ #define E_KILL_REQUEST 0x00 #define E_ERROR 0x01 #define E_CANCEL 0x02 +#define E_PAUSE 0x03 ///////////////////////////////////////////////////////////////////// // CTask @@ -109,8 +111,8 @@ const BUFFERSIZES* m_pbsSizes; int m_nPriority; - __int64 m_iProcessedSize; - __int64 m_iSizeAll; + ull_t m_ullProcessedSize; + ull_t m_ullSizeAll; int m_nPercent; long m_lTimeElapsed; @@ -134,7 +136,7 @@ class CTask { public: - CTask(const TASK_CREATE_DATA *pCreateData); + CTask(chcore::IFeedbackHandler* piFeedbackHandler, const TASK_CREATE_DATA *pCreateData); ~CTask(); public: @@ -252,11 +254,13 @@ // CString GetLogName(); - bool GetRequiredFreeSpace(__int64 *pi64Needed, __int64 *pi64Available); + bool GetRequiredFreeSpace(ull_t *pi64Needed, ull_t *pi64Available); void SetTaskPath(const tchar_t* pszDir); const tchar_t* GetTaskPath() const; + chcore::IFeedbackHandler* GetFeedbackHandler() const { return m_piFeedbackHandler; } + // Implementation protected: CClipboardArray m_clipboard; @@ -310,6 +314,7 @@ long m_lLastTime; // not store // feedback + chcore::IFeedbackHandler* m_piFeedbackHandler; int m_iIdentical; int m_iDestinationLess; int m_iDestinationGreater; @@ -343,11 +348,13 @@ class CTaskArray : public CArray { public: - CTaskArray() : CArray() { m_uhRange=0; m_uhPosition=0; m_uiOperationsPending=0; m_lFinished=0; }; + CTaskArray(); ~CTaskArray(); - void Create(UINT (*pfnTaskProc)(LPVOID pParam)); + void Create(chcore::IFeedbackHandlerFactory* piFeedbackHandlerFactory, UINT (*pfnTaskProc)(LPVOID pParam)); + CTask* CreateTask(); + int GetSize( ); int GetUpperBound( ); void SetSize( int nNewSize, int nGrowBy = -1 ); @@ -372,8 +379,8 @@ bool TasksRetryProcessing(bool bOnlyErrors=false, UINT uiInterval=0); void TasksCancelProcessing(); - __int64 GetPosition(); - __int64 GetRange(); + ull_t GetPosition(); + ull_t GetRange(); int GetPercent(); UINT GetOperationsPending(); @@ -393,6 +400,9 @@ CCriticalSection m_cs; TASK_CREATE_DATA m_tcd; + +protected: + chcore::IFeedbackHandlerFactory* m_piFeedbackFactory; }; /////////////////////////////////////////////////////////////////////////// Index: src/ch/ch.rc =================================================================== diff -u -r829650fe5755561af4dc1c25b6df7a728a737684 -re912e0a6b456c2eed24bec7303a908d3ff0aa59a --- src/ch/ch.rc (.../ch.rc) (revision 829650fe5755561af4dc1c25b6df7a728a737684) +++ src/ch/ch.rc (.../ch.rc) (revision e912e0a6b456c2eed24bec7303a908d3ff0aa59a) @@ -150,125 +150,21 @@ PUSHBUTTON "&Help",IDC_HELP_BUTTON,287,106,50,14,0,0,HIDC_HELP_BUTTON END -IDD_FEEDBACK_DSTFILE_DIALOG DIALOGEX 0, 0, 290, 111 +IDD_FEEDBACK_FILE_ERROR_DIALOG DIALOGEX 0, 0, 283, 112 STYLE DS_SYSMODAL | DS_SETFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Copy handler - error opening file" +CAPTION "File Error" FONT 8, "Tahoma", 0, 0, 0x1 BEGIN - PUSHBUTTON "&Retry",IDC_RETRY_BUTTON,7,90,53,14,0,0,HIDC_RETRY_BUTTON - PUSHBUTTON "&Ignore",IDC_IGNORE_BUTTON,63,90,50,14,0,0,HIDC_IGNORE_BUTTON - PUSHBUTTON "I&gnore all",IDC_IGNORE_ALL_BUTTON,114,90,62,14,0,0,HIDC_IGNORE_ALL_BUTTON - DEFPUSHBUTTON "&Wait",IDC_WAIT_BUTTON,178,90,50,14,0,0,HIDC_WAIT_BUTTON - PUSHBUTTON "&Cancel",IDCANCEL,233,90,50,14,0,0,HIDCANCEL - EDITTEXT IDC_FILENAME_EDIT,44,23,239,17,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,0,HIDC_FILENAME_EDIT - EDITTEXT IDC_MESSAGE_EDIT,44,57,239,24,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,0,HIDC_MESSAGE_EDIT - ICON IDI_ERR_ICON,IDC_001_STATIC,11,15,20,20,SS_REALSIZEIMAGE - LTEXT "Cannot open file for writing:",IDC_002_STATIC,38,13,245,8 - LTEXT "Error description:",IDC_003_STATIC,38,46,245,8 + PUSHBUTTON "&Retry",IDC_RETRY_BUTTON,7,79,64,14,0,0,HIDC_RETRY_BUTTON + PUSHBUTTON "&Skip",IDC_SKIP_BUTTON,74,79,64,14,0,0,HIDC_SKIP_BUTTON + DEFPUSHBUTTON "&Pause",IDC_PAUSE_BUTTON,141,79,64,14,0,0,HIDC_PAUSE_BUTTON + PUSHBUTTON "&Cancel",IDCANCEL,212,79,64,14,0,0,HIDCANCEL + ICON IDI_ERR_ICON,IDC_001_STATIC,15,15,21,20,SS_REALSIZEIMAGE + CONTROL "&Apply to all items",IDC_ALL_ITEMS_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,95,269,10 + LTEXT "Encountered an error while processing file.",IDC_DESC_STATIC,43,7,223,23 + LTEXT "File: c:\\test.avi\nReason: No permission to perform the operation requested.",IDC_INFO_STATIC,51,28,225,42 END -IDD_FEEDBACK_IGNOREWAITRETRY_DIALOG DIALOGEX 0, 0, 294, 242 -STYLE DS_SYSMODAL | DS_SETFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Copy handler - error opening file" -FONT 8, "Tahoma", 0, 0, 0x1 -BEGIN - PUSHBUTTON "&Retry",IDC_RETRY_BUTTON,7,221,50,14,0,0,HIDC_RETRY_BUTTON - PUSHBUTTON "&Ignore",IDC_IGNORE_BUTTON,60,221,50,14,0,0,HIDC_IGNORE_BUTTON - PUSHBUTTON "I&gnore all",IDC_IGNORE_ALL_BUTTON,110,221,69,14,0,0,HIDC_IGNORE_ALL_BUTTON - DEFPUSHBUTTON "&Wait",IDC_WAIT_BUTTON,183,221,50,14,0,0,HIDC_WAIT_BUTTON - PUSHBUTTON "&Cancel",IDCANCEL,237,221,50,14,0,0,HIDCANCEL - EDITTEXT IDC_MESSAGE_EDIT,49,19,238,23,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | NOT WS_BORDER,0,HIDC_MESSAGE_EDIT - EDITTEXT IDC_FILENAME_EDIT,111,54,176,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,0,HIDC_FILENAME_EDIT - EDITTEXT IDC_FILESIZE_EDIT,111,69,176,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,0,HIDC_FILESIZE_EDIT - EDITTEXT IDC_CREATETIME_EDIT,111,84,176,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,0,HIDC_CREATETIME_EDIT - EDITTEXT IDC_MODIFY_TIME_EDIT,111,99,176,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,0,HIDC_MODIFY_TIME_EDIT - EDITTEXT IDC_DEST_FILENAME_EDIT,111,130,176,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,0,HIDC_DEST_FILENAME_EDIT - EDITTEXT IDC_DEST_FILESIZE_EDIT,111,145,176,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,0,HIDC_DEST_FILESIZE_EDIT - EDITTEXT IDC_DEST_CREATETIME_EDIT,111,160,176,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,0,HIDC_DEST_CREATETIME_EDIT - EDITTEXT IDC_DEST_MODIFYTIME_EDIT,111,175,176,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,0,HIDC_DEST_MODIFYTIME_EDIT - LTEXT "Cannot open source file for reading - reason:",IDC_001_STATIC,49,10,238,8 - LTEXT "Name:",IDC_002_STATIC,53,54,53,8 - LTEXT "Size:",IDC_003_STATIC,53,69,53,8 - LTEXT "Created:",IDC_004_STATIC,53,84,53,8 - LTEXT "Last modified:",IDC_005_STATIC,53,99,53,8 - LTEXT "Expected source file:",IDC_006_STATIC,49,42,238,8 - ICON IDI_ERR_ICON,IDC_007_STATIC,16,19,20,20,SS_REALSIZEIMAGE - LTEXT "Name:",IDC_008_STATIC,53,130,53,8 - LTEXT "Size:",IDC_009_STATIC,53,145,53,8 - LTEXT "Created:",IDC_010_STATIC,53,160,53,8 - LTEXT "Last modified:",IDC_011_STATIC,53,175,53,8 - LTEXT "Source file found:",IDC_012_STATIC,49,118,81,8 - LTEXT "What would you like to do ?",IDC_013_STATIC,39,204,248,8 -END - -IDD_FEEDBACK_REPLACE_FILES_DIALOG DIALOGEX 0, 0, 294, 258 -STYLE DS_SYSMODAL | DS_SETFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Copy handler - smaller destination file found" -FONT 8, "Tahoma", 0, 0, 0x1 -BEGIN - DEFPUSHBUTTON "Co&py rest",IDC_COPY_REST_BUTTON,7,237,62,14,0,0,HIDC_COPY_REST_BUTTON - PUSHBUTTON "R&ecopy",IDC_RECOPY_BUTTON,69,237,74,14,0,0,HIDC_RECOPY_BUTTON - PUSHBUTTON "&Ignore",IDC_IGNORE_BUTTON,143,237,58,14,0,0,HIDC_IGNORE_BUTTON - PUSHBUTTON "&Cancel",IDCANCEL,237,237,50,14,0,0,HIDCANCEL - PUSHBUTTON "Cop&y rest all",IDC_COPY_REST_ALL_BUTTON,7,222,83,14,0,0,HIDC_COPY_REST_ALL_BUTTON - PUSHBUTTON "Recopy &all",IDC_RECOPY_ALL_BUTTON,91,222,110,14,0,0,HIDC_RECOPY_ALL_BUTTON - PUSHBUTTON "I&gnore all",IDC_IGNORE_ALL_BUTTON,201,222,86,14,0,0,HIDC_IGNORE_ALL_BUTTON - EDITTEXT IDC_FILENAME_EDIT,111,62,176,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,0,HIDC_FILENAME_EDIT - EDITTEXT IDC_FILESIZE_EDIT,111,77,176,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,0,HIDC_FILESIZE_EDIT - EDITTEXT IDC_CREATETIME_EDIT,111,92,176,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,0,HIDC_CREATETIME_EDIT - EDITTEXT IDC_MODIFY_TIME_EDIT,111,107,176,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,0,HIDC_MODIFY_TIME_EDIT - EDITTEXT IDC_DEST_FILENAME_EDIT,111,138,176,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,0,HIDC_DEST_FILENAME_EDIT - EDITTEXT IDC_DEST_FILESIZE_EDIT,111,153,176,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,0,HIDC_DEST_FILESIZE_EDIT - EDITTEXT IDC_DEST_CREATETIME_EDIT,111,168,176,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,0,HIDC_DEST_CREATETIME_EDIT - EDITTEXT IDC_DEST_MODIFYTIME_EDIT,111,183,176,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,0,HIDC_DEST_MODIFYTIME_EDIT - ICON IDI_QUESTION_ICON,IDC_001_STATIC,10,15,20,20,SS_REALSIZEIMAGE - LTEXT "Destination file exists and is smaller than source file.\nPossible reasons:\n- copying/moving source file wasn't finished (copy rest)\n- file being copied is in another version than destination file (recopy)",IDC_002_STATIC,41,7,246,41 - LTEXT "Name:",IDC_003_STATIC,48,62,61,8 - LTEXT "Size:",IDC_004_STATIC,48,77,61,8 - LTEXT "Created:",IDC_005_STATIC,48,92,61,8 - LTEXT "Last modified:",IDC_006_STATIC,48,107,61,8 - LTEXT "Source file:",IDC_007_STATIC,41,50,246,8 - LTEXT "Name:",IDC_008_STATIC,48,138,61,8 - LTEXT "Size:",IDC_009_STATIC,48,153,61,8 - LTEXT "Created:",IDC_010_STATIC,48,168,61,8 - LTEXT "Last modified:",IDC_011_STATIC,48,183,61,8 - LTEXT "Destination file:",IDC_012_STATIC,41,125,246,8 - LTEXT "What would you like to do ?",IDC_013_STATIC,41,203,246,8 -END - -IDD_FEEDBACK_SMALL_REPLACE_FILES_DIALOG DIALOGEX 0, 0, 294, 258 -STYLE DS_SYSMODAL | DS_SETFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Copy handler - destination file found" -FONT 8, "Tahoma", 0, 0, 0x1 -BEGIN - PUSHBUTTON "R&ecopy",IDC_RECOPY_BUTTON,7,237,143,14,0,0,HIDC_RECOPY_BUTTON - DEFPUSHBUTTON "&Ignore",IDC_IGNORE_BUTTON,151,237,86,14,0,0,HIDC_IGNORE_BUTTON - PUSHBUTTON "&Cancel",IDCANCEL,237,237,50,14,0,0,HIDCANCEL - PUSHBUTTON "Recopy &all",IDC_RECOPY_ALL_BUTTON,7,222,143,14,0,0,HIDC_RECOPY_ALL_BUTTON - PUSHBUTTON "I&gnore all",IDC_IGNORE_ALL_BUTTON,151,222,136,14,0,0,HIDC_IGNORE_ALL_BUTTON - EDITTEXT IDC_FILENAME_EDIT,111,64,173,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,0,HIDC_FILENAME_EDIT - EDITTEXT IDC_FILESIZE_EDIT,111,79,173,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,0,HIDC_FILESIZE_EDIT - EDITTEXT IDC_CREATETIME_EDIT,111,94,173,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,0,HIDC_CREATETIME_EDIT - EDITTEXT IDC_MODIFY_TIME_EDIT,111,109,173,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,0,HIDC_MODIFY_TIME_EDIT - EDITTEXT IDC_DEST_FILENAME_EDIT,111,138,173,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,0,HIDC_DEST_FILENAME_EDIT - EDITTEXT IDC_DEST_FILESIZE_EDIT,111,153,173,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,0,HIDC_DEST_FILESIZE_EDIT - EDITTEXT IDC_DEST_CREATETIME_EDIT,111,168,173,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,0,HIDC_DEST_CREATETIME_EDIT - EDITTEXT IDC_DEST_MODIFYTIME_EDIT,111,183,173,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER,0,HIDC_DEST_MODIFYTIME_EDIT - ICON IDI_QUESTION_ICON,IDC_001_STATIC,10,15,20,20,SS_REALSIZEIMAGE - LTEXT "Destination file exists and has equal or greater size than source file.\nPossible reasons:\n- file being copied is in another version than destination one (recopy/ignore)\n- source and destination files are identical (ignore)",IDC_002_STATIC,41,7,246,44 - LTEXT "Name:",IDC_003_STATIC,48,64,61,8 - LTEXT "Size:",IDC_004_STATIC,48,79,61,8 - LTEXT "Created:",IDC_005_STATIC,48,94,61,8 - LTEXT "Last modified:",IDC_006_STATIC,48,109,61,8 - LTEXT "Source file:",IDC_007_STATIC,41,52,246,8 - LTEXT "Name:",IDC_008_STATIC,48,138,61,8 - LTEXT "Size:",IDC_009_STATIC,48,153,61,8 - LTEXT "Created:",IDC_010_STATIC,48,168,61,8 - LTEXT "Last modified:",IDC_011_STATIC,48,183,61,8 - LTEXT "Destination file:",IDC_012_STATIC,41,125,246,8 - LTEXT "What would you like to do ?",IDC_013_STATIC,41,203,246,8 -END - IDD_MINIVIEW_DIALOG DIALOGEX 0, 0, 90, 23 STYLE DS_ABSALIGN | DS_SYSMODAL | DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION EXSTYLE WS_EX_TOOLWINDOW @@ -366,21 +262,22 @@ CONTROL "",IDC_PRIORITY_STATIC,"STATICEX",0x4,312,88,143,12,WS_EX_STATICEDGE,HIDC_PRIORITY_STATIC END -IDD_FEEDBACK_NOTENOUGHPLACE_DIALOG DIALOGEX 0, 0, 254, 138 +IDD_FEEDBACK_NOTENOUGHSPACE_DIALOG DIALOGEX 0, 0, 254, 147 STYLE DS_SYSMODAL | DS_SETFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Copy handler - not enough free space" +CAPTION "Not enough free space" FONT 8, "Tahoma", 0, 0, 0x1 BEGIN - PUSHBUTTON "&Retry",IDC_RETRY_BUTTON,78,117,57,14,0,0,HIDC_RETRY_BUTTON - PUSHBUTTON "C&ontinue",IDC_IGNORE_BUTTON,136,117,57,14,0,0,HIDC_IGNORE_BUTTON - PUSHBUTTON "&Cancel",IDCANCEL,197,117,50,14,0,0,HIDCANCEL + PUSHBUTTON "&Retry",IDC_RETRY_BUTTON,78,113,57,14,0,0,HIDC_RETRY_BUTTON + PUSHBUTTON "C&ontinue",IDC_IGNORE_BUTTON,136,113,57,14,0,0,HIDC_IGNORE_BUTTON + PUSHBUTTON "&Cancel",IDCANCEL,197,113,50,14,0,0,HIDCANCEL LISTBOX IDC_FILES_LIST,41,35,206,44,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP,0,HIDC_FILES_LIST LTEXT "",IDC_REQUIRED_STATIC,108,85,139,8,0,0,HIDC_REQUIRED_STATIC LTEXT "",IDC_AVAILABLE_STATIC,108,97,139,8,0,0,HIDC_AVAILABLE_STATIC ICON IDI_WARNING_ICON,IDC_001_STATIC,9,11,20,20,SS_REALSIZEIMAGE LTEXT "Required space:",IDC_003_STATIC,41,85,59,8 LTEXT "Space available:",IDC_004_STATIC,41,97,59,8 LTEXT "",IDC_HEADER_STATIC,41,7,206,24 + CONTROL "&Do not ask anymore",IDC_ALL_ITEMS_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,130,240,10 END IDD_SHUTDOWN_DIALOG DIALOGEX 0, 0, 186, 86 @@ -573,7 +470,25 @@ PUSHBUTTON "&Download latest version...",IDC_OPEN_WEBPAGE_BUTTON,85,62,112,14 END +IDD_FEEDBACK_REPLACE_DIALOG DIALOGEX 0, 0, 272, 152 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "File already exists" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + LTEXT "File you are trying to copy already exists. What do you want to do ?",IDC_INFO_STATIC,7,7,258,15 + PUSHBUTTON "&Replace",IDC_REPLACE_BUTTON,7,118,50,14 + PUSHBUTTON "&Copy rest",IDC_COPY_REST_BUTTON,60,118,50,14 + CONTROL "&Apply to all items",IDC_ALL_ITEMS_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,135,258,10 + PUSHBUTTON "&Skip",IDC_SKIP_BUTTON,111,118,50,14 + PUSHBUTTON "&Pause",IDC_PAUSE_BUTTON,163,118,50,14 + PUSHBUTTON "&Cancel",IDC_CANCEL_BUTTON,215,118,50,14 + ICON "",IDC_SRC_ICON_STATIC,21,31,21,20 + ICON "",IDC_DST_ICON_STATIC,21,79,21,20 + LTEXT "File: c:\\projects\\xxx.avi\nSize: 154kB\nLast modified: 2008-01-12",IDC_SRC_INFO_STATIC,59,27,206,41 + LTEXT "File: c:\\projects\\xxx.avi\nSize: 154kB\nLast modified: 2008-01-12",IDC_DST_INFO_STATIC,59,74,206,41 +END + ///////////////////////////////////////////////////////////////////////////// // // DESIGNINFO @@ -590,38 +505,14 @@ BOTTOMMARGIN, 120 END - IDD_FEEDBACK_DSTFILE_DIALOG, DIALOG + IDD_FEEDBACK_FILE_ERROR_DIALOG, DIALOG BEGIN LEFTMARGIN, 7 - RIGHTMARGIN, 283 + RIGHTMARGIN, 276 TOPMARGIN, 7 - BOTTOMMARGIN, 104 + BOTTOMMARGIN, 105 END - IDD_FEEDBACK_IGNOREWAITRETRY_DIALOG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 287 - TOPMARGIN, 7 - BOTTOMMARGIN, 235 - END - - IDD_FEEDBACK_REPLACE_FILES_DIALOG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 287 - TOPMARGIN, 7 - BOTTOMMARGIN, 251 - END - - IDD_FEEDBACK_SMALL_REPLACE_FILES_DIALOG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 287 - TOPMARGIN, 7 - BOTTOMMARGIN, 251 - END - IDD_MINIVIEW_DIALOG, DIALOG BEGIN LEFTMARGIN, 7 @@ -654,12 +545,12 @@ BOTTOMMARGIN, 243 END - IDD_FEEDBACK_NOTENOUGHPLACE_DIALOG, DIALOG + IDD_FEEDBACK_NOTENOUGHSPACE_DIALOG, DIALOG BEGIN LEFTMARGIN, 7 RIGHTMARGIN, 247 TOPMARGIN, 7 - BOTTOMMARGIN, 131 + BOTTOMMARGIN, 140 END IDD_SHUTDOWN_DIALOG, DIALOG @@ -725,6 +616,14 @@ TOPMARGIN, 7 BOTTOMMARGIN, 76 END + + IDD_FEEDBACK_REPLACE_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 265 + TOPMARGIN, 7 + BOTTOMMARGIN, 145 + END END #endif // APSTUDIO_INVOKED @@ -1271,6 +1170,9 @@ IDS_BDDIR_STRING "Directory" IDS_BDTREE_STRING "Tree" IDS_BDNDSCONTAINER_STRING "NDS Container" + IDS_INFO_FILE_STRING "File: %filename" + IDS_INFO_SIZE_STRING "Size: %size" + IDS_INFO_MODIFIED_STRING "Modified: %datemod" END STRINGTABLE @@ -1295,6 +1197,11 @@ "CH shell extension registered on your system does not match the Copy Handler version you are currently running.\nPlease re-register the shell extension using Copy Handler context menu and reboot your system to make sure the proper version is loaded.\n\nCopy Handler shell extension will be disabled." END +STRINGTABLE +BEGIN + IDS_INFO_REASON_STRING "Reason: %reason" +END + #endif // English (U.S.) resources ///////////////////////////////////////////////////////////////////////////// Index: src/ch/ch.vc90.vcproj =================================================================== diff -u -rd0fdcc905035e648382256101a3d99f429af6d56 -re912e0a6b456c2eed24bec7303a908d3ff0aa59a --- src/ch/ch.vc90.vcproj (.../ch.vc90.vcproj) (revision d0fdcc905035e648382256101a3d99f429af6d56) +++ src/ch/ch.vc90.vcproj (.../ch.vc90.vcproj) (revision e912e0a6b456c2eed24bec7303a908d3ff0aa59a) @@ -534,10 +534,22 @@ > + + + + + + @@ -566,10 +578,6 @@ > - - @@ -590,14 +598,6 @@ > - - - - @@ -614,10 +614,6 @@ > - - @@ -795,6 +791,22 @@ > + + + + + + + + @@ -831,10 +843,6 @@ > - - @@ -855,14 +863,6 @@ > - - - - @@ -967,10 +967,6 @@ > - - Index: src/ch/resource.h =================================================================== diff -u -rd0fdcc905035e648382256101a3d99f429af6d56 -re912e0a6b456c2eed24bec7303a908d3ff0aa59a --- src/ch/resource.h (.../resource.h) (revision d0fdcc905035e648382256101a3d99f429af6d56) +++ src/ch/resource.h (.../resource.h) (revision e912e0a6b456c2eed24bec7303a908d3ff0aa59a) @@ -26,13 +26,12 @@ #define IDD_NEW_QUICK_ACCESS_DIALOG 152 #define IDR_ADVANCED_MENU 160 #define IDD_REPLACE_PATHS_DIALOG 161 -#define IDD_FEEDBACK_IGNOREWAITRETRY_DIALOG 162 #define IDI_QUESTION_ICON 163 -#define IDD_FEEDBACK_REPLACE_FILES_DIALOG 164 -#define IDD_FEEDBACK_SMALL_REPLACE_FILES_DIALOG 165 #define IDD_FEEDBACK_DSTFILE_DIALOG 167 +#define IDD_FEEDBACK_FILE_ERROR_DIALOG 167 #define IDR_POPUP_TOOLBAR 170 #define IDD_FEEDBACK_NOTENOUGHPLACE_DIALOG 173 +#define IDD_FEEDBACK_NOTENOUGHSPACE_DIALOG 173 #define IDI_INFO_ICON 175 #define IDI_ERR_ICON 176 #define IDI_WARNING_ICON 177 @@ -57,6 +56,7 @@ #define IDC_ABOUTBOX 210 #define IDD_CRASH_DIALOG 212 #define IDD_UPDATER_DIALOG 213 +#define IDD_FEEDBACK_REPLACE_DIALOG 214 #define IDC_PROGRAM_STATIC 1000 #define IDC_ADDFILE_BUTTON 1002 #define IDC_STATUS_LIST 1003 @@ -130,24 +130,10 @@ #define IDC_ONLY_CREATE_CHECK 1074 #define IDC_ADVANCED_BUTTON 1077 #define IDC_PATHS_LIST 1078 -#define IDC_FILENAME_EDIT 1088 -#define IDC_FILESIZE_EDIT 1089 #define IDC_DESTFILENAME_EDIT 1090 -#define IDC_CREATETIME_EDIT 1091 -#define IDC_MODIFY_TIME_EDIT 1092 -#define IDC_DEST_FILENAME_EDIT 1093 -#define IDC_DEST_FILESIZE_EDIT 1094 -#define IDC_DEST_CREATETIME_EDIT 1095 -#define IDC_DEST_MODIFYTIME_EDIT 1096 #define IDC_IGNORE_BUTTON 1097 -#define IDC_IGNORE_ALL_BUTTON 1098 -#define IDC_WAIT_BUTTON 1099 #define IDC_RETRY_BUTTON 1100 #define IDC_COPY_REST_BUTTON 1103 -#define IDC_RECOPY_BUTTON 1104 -#define IDC_COPY_REST_ALL_BUTTON 1106 -#define IDC_RECOPY_ALL_BUTTON 1107 -#define IDC_MESSAGE_EDIT 1112 #define IDC_COUNT_EDIT 1119 #define IDC_SHOW_LOG_BUTTON 1120 #define IDC_STICK_BUTTON 1122 @@ -300,6 +286,14 @@ #define IDC_INFO_STATIC 1282 #define IDC_OPEN_WEBPAGE_BUTTON 1283 #define IDC_LANGUAGE_STATIC 1284 +#define IDC_REPLACE_BUTTON 1285 +#define IDC_ALL_ITEMS_CHECK 1287 +#define IDC_SKIP_BUTTON 1288 +#define IDC_SRC_ICON_STATIC 1291 +#define IDC_DST_ICON_STATIC 1292 +#define IDC_SRC_INFO_STATIC 1293 +#define IDC_DST_INFO_STATIC 1294 +#define IDC_DESC_STATIC 1297 #define IDS_APPNAME_STRING 5000 #define IDS_PRIORITY0_STRING 5001 #define IDS_PRIORITY1_STRING 5002 @@ -530,6 +524,10 @@ #define IDS_BDDIR_STRING 13034 #define IDS_BDTREE_STRING 13035 #define IDS_BDNDSCONTAINER_STRING 13036 +#define IDS_INFO_FILE_STRING 13037 +#define IDS_INFO_SIZE_STRING 13038 +#define IDS_INFO_MODIFIED_STRING 13039 +#define IDS_INFO_REASON_STRING 13040 #define IDS_TITLECOPY_STRING 13500 #define IDS_TITLEMOVE_STRING 13501 #define IDS_TITLEUNKNOWNOPERATION_STRING 13502 @@ -640,9 +638,9 @@ #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_3D_CONTROLS 1 -#define _APS_NEXT_RESOURCE_VALUE 214 +#define _APS_NEXT_RESOURCE_VALUE 215 #define _APS_NEXT_COMMAND_VALUE 32818 -#define _APS_NEXT_CONTROL_VALUE 1285 +#define _APS_NEXT_CONTROL_VALUE 1298 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif Index: src/ch/resource.hm =================================================================== diff -u -r328d5100c7f464a4b1fbbbd7ccfa07bf2aaae2cf -re912e0a6b456c2eed24bec7303a908d3ff0aa59a --- src/ch/resource.hm (.../resource.hm) (revision 328d5100c7f464a4b1fbbbd7ccfa07bf2aaae2cf) +++ src/ch/resource.hm (.../resource.hm) (revision e912e0a6b456c2eed24bec7303a908d3ff0aa59a) @@ -12,7 +12,7 @@ #define HIDC_ARCHIVE_CHECK 0x80c3048b // IDD_FILTER_DIALOG [Angielski (Stany Zjednoczone)] #define HIDC_ASSOCIATEDFILES__STATIC 0x80830410 // IDD_STATUS_DIALOG [Angielski (Stany Zjednoczone)] #define HIDC_ATTRIBUTES_CHECK 0x80c3048a // IDD_FILTER_DIALOG [Angielski (Stany Zjednoczone)] -#define HIDC_AVAILABLE_STATIC 0x80ad0468 // IDD_FEEDBACK_NOTENOUGHPLACE_DIALOG [Angielski (Stany Zjednoczone)] +#define HIDC_AVAILABLE_STATIC 0x80ad0468 // IDD_FEEDBACK_NOTENOUGHSPACE_DIALOG [Angielski (Stany Zjednoczone)] #define HIDC_BROWSE_BUTTON 0x80d10428 // IDD_RECENTEDIT_DIALOG [Angielski (Stany Zjednoczone)] #define HIDC_BUFFERSIZES_BUTTON 0x80950400 // IDD_CUSTOM_COPY_DIALOG [Angielski (Stany Zjednoczone)] #define HIDC_BUFFERSIZES_LIST 0x809503f4 // IDD_CUSTOM_COPY_DIALOG [Angielski (Stany Zjednoczone)] @@ -48,7 +48,7 @@ #define HIDC_DOWN_BUTTON 0x80d004a9 // IDD_SHORTCUTEDIT_DIALOG [Angielski (Stany Zjednoczone)] #define HIDC_ERRORS_EDIT 0x8083047b // IDD_STATUS_DIALOG [Angielski (Stany Zjednoczone)] #define HIDC_EXCLUDEMASK_CHECK 0x80c30499 // IDD_FILTER_DIALOG [Angielski (Stany Zjednoczone)] -#define HIDC_FILENAME_EDIT 0x80a70440 // IDD_FEEDBACK_DSTFILE_DIALOG [Angielski (Stany Zjednoczone)] +#define HIDC_FILENAME_EDIT 0x80a70440 // IDD_FEEDBACK_IGNOREWAITRETRY_DIALOG [Angielski (Stany Zjednoczone)] #define HIDC_FILESIZE_EDIT 0x80a20441 // IDD_FEEDBACK_IGNOREWAITRETRY_DIALOG [Angielski (Stany Zjednoczone)] #define HIDC_FILES_LIST 0x80950429 // IDD_CUSTOM_COPY_DIALOG [Angielski (Stany Zjednoczone)] #define HIDC_FILTEREXCLUDE_COMBO 0x80c30498 // IDD_FILTER_DIALOG [Angielski (Stany Zjednoczone)] @@ -60,12 +60,12 @@ #define HIDC_HELP_BUTTON 0x808904e9 // IDD_BUFFERSIZE_DIALOG [Angielski (Stany Zjednoczone)] #define HIDC_HIDDEN_CHECK 0x80c3048d // IDD_FILTER_DIALOG [Angielski (Stany Zjednoczone)] #define HIDC_IGNOREFOLDERS_CHECK 0x809503f7 // IDD_CUSTOM_COPY_DIALOG [Angielski (Stany Zjednoczone)] -#define HIDC_IGNORE_ALL_BUTTON 0x80a7044a // IDD_FEEDBACK_DSTFILE_DIALOG [Angielski (Stany Zjednoczone)] -#define HIDC_IGNORE_BUTTON 0x80a70449 // IDD_FEEDBACK_DSTFILE_DIALOG [Angielski (Stany Zjednoczone)] +#define HIDC_IGNORE_ALL_BUTTON 0x80a7044a // IDD_FEEDBACK_IGNOREWAITRETRY_DIALOG [Angielski (Stany Zjednoczone)] +#define HIDC_IGNORE_BUTTON 0x80a70449 // IDD_FEEDBACK_IGNOREWAITRETRY_DIALOG [Angielski (Stany Zjednoczone)] #define HIDC_IMPORT_BUTTON 0x809504a7 // IDD_CUSTOM_COPY_DIALOG [Angielski (Stany Zjednoczone)] #define HIDC_LANMULTIPLIER_COMBO 0x80890478 // IDD_BUFFERSIZE_DIALOG [Angielski (Stany Zjednoczone)] #define HIDC_LANSIZE_EDIT 0x80890477 // IDD_BUFFERSIZE_DIALOG [Angielski (Stany Zjednoczone)] -#define HIDC_MESSAGE_EDIT 0x80a70458 // IDD_FEEDBACK_DSTFILE_DIALOG [Angielski (Stany Zjednoczone)] +#define HIDC_MESSAGE_EDIT 0x80a70458 // IDD_FEEDBACK_IGNOREWAITRETRY_DIALOG [Angielski (Stany Zjednoczone)] #define HIDC_MODIFY_TIME_EDIT 0x80a20444 // IDD_FEEDBACK_IGNOREWAITRETRY_DIALOG [Angielski (Stany Zjednoczone)] #define HIDC_NAME_EDIT 0x80d0049d // IDD_SHORTCUTEDIT_DIALOG [Angielski (Stany Zjednoczone)] #define HIDC_ONEDISKMULTIPLIER_COMBO 0x80890472 // IDD_BUFFERSIZE_DIALOG [Angielski (Stany Zjednoczone)] @@ -80,7 +80,7 @@ #define HIDC_PATH_COMBOBOXEX 0x80d0049e // IDD_SHORTCUTEDIT_DIALOG [Angielski (Stany Zjednoczone)] #define HIDC_PATH_EDIT 0x80d1041f // IDD_RECENTEDIT_DIALOG [Angielski (Stany Zjednoczone)] #define HIDC_PAUSE_ALL_BUTTON 0x80830414 // IDD_STATUS_DIALOG [Angielski (Stany Zjednoczone)] -#define HIDC_PAUSE_BUTTON 0x808303fa // IDD_STATUS_DIALOG [Angielski (Stany Zjednoczone)] +#define HIDC_PAUSE_BUTTON 0x80a703fa // IDD_FEEDBACK_FILE_ERROR_DIALOG [Angielski (Stany Zjednoczone)] #define HIDC_PRIORITY_COMBO 0x8095042f // IDD_CUSTOM_COPY_DIALOG [Angielski (Stany Zjednoczone)] #define HIDC_PRIORITY_STATIC 0x80830407 // IDD_STATUS_DIALOG [Angielski (Stany Zjednoczone)] #define HIDC_PROGRESS_LIST 0x80910419 // IDD_MINIVIEW_DIALOG [Angielski (Stany Zjednoczone)] @@ -93,11 +93,11 @@ #define HIDC_REMOVEFILEFOLDER_BUTTON 0x809503ec // IDD_CUSTOM_COPY_DIALOG [Angielski (Stany Zjednoczone)] #define HIDC_REMOVEFILTER_BUTTON 0x80950402 // IDD_CUSTOM_COPY_DIALOG [Angielski (Stany Zjednoczone)] #define HIDC_REMOVE_FINISHED_BUTTON 0x80830417 // IDD_STATUS_DIALOG [Angielski (Stany Zjednoczone)] -#define HIDC_REQUIRED_STATIC 0x80ad0467 // IDD_FEEDBACK_NOTENOUGHPLACE_DIALOG [Angielski (Stany Zjednoczone)] +#define HIDC_REQUIRED_STATIC 0x80ad0467 // IDD_FEEDBACK_NOTENOUGHSPACE_DIALOG [Angielski (Stany Zjednoczone)] #define HIDC_RESTART_ALL_BUTTON 0x80830415 // IDD_STATUS_DIALOG [Angielski (Stany Zjednoczone)] #define HIDC_RESTART_BUTTON 0x80830412 // IDD_STATUS_DIALOG [Angielski (Stany Zjednoczone)] #define HIDC_RESUME_BUTTON 0x808303fd // IDD_STATUS_DIALOG [Angielski (Stany Zjednoczone)] -#define HIDC_RETRY_BUTTON 0x80a7044c // IDD_FEEDBACK_DSTFILE_DIALOG [Angielski (Stany Zjednoczone)] +#define HIDC_RETRY_BUTTON 0x80a7044c // IDD_FEEDBACK_FILE_ERROR_DIALOG [Angielski (Stany Zjednoczone)] #define HIDC_ROLL_UNROLL_BUTTON 0x8083040e // IDD_STATUS_DIALOG [Angielski (Stany Zjednoczone)] #define HIDC_SET_BUFFERSIZE_BUTTON 0x808303f5 // IDD_STATUS_DIALOG [Angielski (Stany Zjednoczone)] #define HIDC_SET_PRIORITY_BUTTON 0x808303f8 // IDD_STATUS_DIALOG [Angielski (Stany Zjednoczone)] @@ -113,6 +113,7 @@ #define HIDC_SIZETYPE1_COMBO 0x80c30482 // IDD_FILTER_DIALOG [Angielski (Stany Zjednoczone)] #define HIDC_SIZETYPE2_COMBO 0x80c30486 // IDD_FILTER_DIALOG [Angielski (Stany Zjednoczone)] #define HIDC_SIZE_CHECK 0x80c3047f // IDD_FILTER_DIALOG [Angielski (Stany Zjednoczone)] +#define HIDC_SKIP_BUTTON 0x80a70508 // IDD_FEEDBACK_FILE_ERROR_DIALOG [Angielski (Stany Zjednoczone)] #define HIDC_SOURCE_EDIT 0x80a1041a // IDD_REPLACE_PATHS_DIALOG [Angielski (Stany Zjednoczone)] #define HIDC_SOURCE_STATIC 0x80830403 // IDD_STATUS_DIALOG [Angielski (Stany Zjednoczone)] #define HIDC_START_ALL_BUTTON 0x80830411 // IDD_STATUS_DIALOG [Angielski (Stany Zjednoczone)] @@ -126,6 +127,6 @@ #define HIDC_TWODISKSMULTIPLIER_COMBO 0x80890474 // IDD_BUFFERSIZE_DIALOG [Angielski (Stany Zjednoczone)] #define HIDC_TWODISKSSIZE_EDIT 0x80890473 // IDD_BUFFERSIZE_DIALOG [Angielski (Stany Zjednoczone)] #define HIDC_UP_BUTTON 0x80d004a8 // IDD_SHORTCUTEDIT_DIALOG [Angielski (Stany Zjednoczone)] -#define HIDC_WAIT_BUTTON 0x80a7044b // IDD_FEEDBACK_DSTFILE_DIALOG [Angielski (Stany Zjednoczone)] +#define HIDC_WAIT_BUTTON 0x80a7044b // IDD_FEEDBACK_IGNOREWAITRETRY_DIALOG [Angielski (Stany Zjednoczone)] #define HIDHELP 0x80900009 // IDD_OPTIONS_DIALOG [Angielski (Stany Zjednoczone)] #define HIDOK 0x80640001 // IDD_ABOUTBOX [Angielski (Stany Zjednoczone)] Index: src/chext/MenuExt.cpp =================================================================== diff -u -rd0fdcc905035e648382256101a3d99f429af6d56 -re912e0a6b456c2eed24bec7303a908d3ff0aa59a --- src/chext/MenuExt.cpp (.../MenuExt.cpp) (revision d0fdcc905035e648382256101a3d99f429af6d56) +++ src/chext/MenuExt.cpp (.../MenuExt.cpp) (revision e912e0a6b456c2eed24bec7303a908d3ff0aa59a) @@ -34,7 +34,7 @@ { int iOffset=0; size_t iLength=_tcslen(lpszString); - for (int j=0;jGetShortcutsPtr(); TCHAR szText[256], szSize[32]; - __int64 iiFree; + ull_t ullFree; for (int i=0;iiShortcutsCount;i++) { // modify text - if (g_pscsShared->bShowFreeSpace && GetDynamicFreeSpace(pShortcuts[i].szPath, &iiFree, NULL)) + if (g_pscsShared->bShowFreeSpace && GetDynamicFreeSpace(pShortcuts[i].szPath, &ullFree, NULL)) { - _sntprintf(szText, 256 - 1, _T("%s (%s)"), pShortcuts[i].szName, GetSizeString(iiFree, szSize, 32)); + _sntprintf(szText, 256 - 1, _T("%s (%s)"), pShortcuts[i].szName, GetSizeString(ullFree, szSize, 32)); szText[256 - 1] = _T('\0'); _tcsncpy(pShortcuts[i].szName, szText, 127); // OTF("Text to display=%s\r\n", pShortcuts[i].szName); Index: src/chext/StdAfx.h =================================================================== diff -u -rd0fdcc905035e648382256101a3d99f429af6d56 -re912e0a6b456c2eed24bec7303a908d3ff0aa59a --- src/chext/StdAfx.h (.../StdAfx.h) (revision d0fdcc905035e648382256101a3d99f429af6d56) +++ src/chext/StdAfx.h (.../StdAfx.h) (revision e912e0a6b456c2eed24bec7303a908d3ff0aa59a) @@ -33,4 +33,6 @@ #include #include +#include "../libicpf/gen_types.h" + #endif Index: src/common/FileSupport.cpp =================================================================== diff -u -rd2b121c78f510b5384b8ef0ca80afbfd7f77fef7 -re912e0a6b456c2eed24bec7303a908d3ff0aa59a --- src/common/FileSupport.cpp (.../FileSupport.cpp) (revision d2b121c78f510b5384b8ef0ca80afbfd7f77fef7) +++ src/common/FileSupport.cpp (.../FileSupport.cpp) (revision e912e0a6b456c2eed24bec7303a908d3ff0aa59a) @@ -85,61 +85,23 @@ // disk support routines -bool GetDynamicFreeSpace(LPCTSTR lpszPath, __int64* pFree, __int64* pTotal) +bool GetDynamicFreeSpace(LPCTSTR lpszPath, ull_t* pFree, ull_t* pTotal) { - typedef BOOL(__stdcall *PGETDISKFREESPACEEX)(LPCTSTR lpDirectoryName, PULARGE_INTEGER lpFreeBytesAvailable, PULARGE_INTEGER lpTotalNumberOfBytes, PULARGE_INTEGER lpTotalNumberOfFreeBytes); - ULARGE_INTEGER ui64Available, ui64Total; - PGETDISKFREESPACEEX pGetDiskFreeSpaceEx; - HMODULE hModule = GetModuleHandle(_T("kernel32.dll")); - if(!hModule) - return false; - pGetDiskFreeSpaceEx = (PGETDISKFREESPACEEX)GetProcAddress(hModule, "GetDiskFreeSpaceExA"); - if (pGetDiskFreeSpaceEx) + if(!GetDiskFreeSpaceEx(lpszPath, &ui64Available, &ui64Total, NULL)) { - if (!pGetDiskFreeSpaceEx(lpszPath, &ui64Available, &ui64Total, NULL)) - { - if (pFree) - *pFree=-1; - if (pTotal) - *pTotal=-1; - return false; - } - else - { - if (pFree) - *pFree=ui64Available.QuadPart; - if (pTotal) - *pTotal=ui64Total.QuadPart; - return true; - } + if(pFree) + *pFree=-1; + if(pTotal) + *pTotal=-1; + return false; } - else + else { - // support for win95 (not osr2) - // set the root for path and correct '\\' at the end - TCHAR szDisk[_MAX_DRIVE]; - _tsplitpath(lpszPath, szDisk, NULL, NULL, NULL); - if (_tcslen(szDisk) != 0 && szDisk[_tcslen(szDisk)-1] != _T('\\')) - _tcscat(szDisk, _T("\\")); - - // std func - DWORD dwSectPerClust, dwBytesPerSect, dwFreeClusters, dwTotalClusters; - if (!GetDiskFreeSpace(szDisk, &dwSectPerClust, &dwBytesPerSect, &dwFreeClusters, &dwTotalClusters)) - { - if (pFree) - *pFree=-1; - if (pTotal) - *pTotal=-1; - return false; - } - else - { - if (pFree) - *pFree=((__int64)dwFreeClusters*(__int64)dwSectPerClust)*(__int64)dwBytesPerSect; - if (pTotal) - *pTotal=((__int64)dwTotalClusters*(__int64)dwSectPerClust)*(__int64)dwBytesPerSect; - return true; - } + if(pFree) + *pFree=ui64Available.QuadPart; + if(pTotal) + *pTotal=ui64Total.QuadPart; + return true; } } Index: src/common/FileSupport.h =================================================================== diff -u -rd2b121c78f510b5384b8ef0ca80afbfd7f77fef7 -re912e0a6b456c2eed24bec7303a908d3ff0aa59a --- src/common/FileSupport.h (.../FileSupport.h) (revision d2b121c78f510b5384b8ef0ca80afbfd7f77fef7) +++ src/common/FileSupport.h (.../FileSupport.h) (revision e912e0a6b456c2eed24bec7303a908d3ff0aa59a) @@ -26,6 +26,6 @@ bool SetFileSize64(LPCTSTR lpszFilename, __int64 llSize); // disk support routines -bool GetDynamicFreeSpace(LPCTSTR lpszPath, __int64* pFree, __int64* pTotal); +bool GetDynamicFreeSpace(LPCTSTR lpszPath, ull_t* pFree, ull_t* pTotal); #endif \ No newline at end of file Index: src/libchcore/FeedbackHandlerBase.h =================================================================== diff -u --- src/libchcore/FeedbackHandlerBase.h (revision 0) +++ src/libchcore/FeedbackHandlerBase.h (revision e912e0a6b456c2eed24bec7303a908d3ff0aa59a) @@ -0,0 +1,41 @@ +/*************************************************************************** + * Copyright (C) 2001-2008 by J�zef 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 __FEEDBACKHANDLERBASE_H__ +#define __FEEDBACKHANDLERBASE_H__ + +#include "libchcore.h" +#include "../libicpf/interface.h" + +BEGIN_CHCORE_NAMESPACE + +class IFeedbackHandler : public icpf::IInterface +{ +public: + virtual ull_t RequestFeedback(ull_t ullFeedbackID, ptr_t pFeedbackParam) = 0; +}; + +class IFeedbackHandlerFactory : public icpf::IInterface +{ +public: + virtual IFeedbackHandler* Create() = 0; +}; + +END_CHCORE_NAMESPACE + +#endif Index: src/libchcore/libchcore.vc90.vcproj =================================================================== diff -u -r6bc9b521ae26321f21d29a1116d052b1b8746498 -re912e0a6b456c2eed24bec7303a908d3ff0aa59a --- src/libchcore/libchcore.vc90.vcproj (.../libchcore.vc90.vcproj) (revision 6bc9b521ae26321f21d29a1116d052b1b8746498) +++ src/libchcore/libchcore.vc90.vcproj (.../libchcore.vc90.vcproj) (revision e912e0a6b456c2eed24bec7303a908d3ff0aa59a) @@ -421,6 +421,10 @@ > + +