Index: src/ch/MiniViewDlg.cpp =================================================================== diff -u -r9ea1e103b5fa4ddfebf8028f121ce16e917eec04 -r0a673d59b6baab3d616ce2570e5bf63378fa7e3c --- src/ch/MiniViewDlg.cpp (.../MiniViewDlg.cpp) (revision 9ea1e103b5fa4ddfebf8028f121ce16e917eec04) +++ src/ch/MiniViewDlg.cpp (.../MiniViewDlg.cpp) (revision 0a673d59b6baab3d616ce2570e5bf63378fa7e3c) @@ -199,8 +199,11 @@ pItem->m_crColor=RGB(50, 50, 50); else pItem->m_crColor=RGB(0, 255, 0); - - pItem->m_strText = m_tMiniDisplayData.m_strPath; + + if(m_tMiniDisplayData.m_strPath.IsEmpty()) + pItem->m_strText = GetResManager().LoadString(IDS_NONEINPUTFILE_STRING); + else + pItem->m_strText = m_tMiniDisplayData.m_strPath; pItem->m_uiPos=m_tMiniDisplayData.m_nPercent; pItem->m_spTask = spTask; } Index: src/ch/StatusDlg.cpp =================================================================== diff -u -r1d7d79169d480a02e335b8b0a4919f9c78d58325 -r0a673d59b6baab3d616ce2570e5bf63378fa7e3c --- src/ch/StatusDlg.cpp (.../StatusDlg.cpp) (revision 1d7d79169d480a02e335b8b0a4919f9c78d58325) +++ src/ch/StatusDlg.cpp (.../StatusDlg.cpp) (revision 0a673d59b6baab3d616ce2570e5bf63378fa7e3c) @@ -167,7 +167,7 @@ } stIndex++; - }; + } // refresh data timer SetTimer(777, GetPropValue(GetConfig()), NULL); @@ -225,14 +225,18 @@ _itot(nPos, m_szData, 10); // get data snapshot from task + TASK_DISPLAY_DATA td; spTask->GetSnapshot(&td); // index subitem + CString strStatusText = GetStatusString(td); + CString strTemp; + LVITEM lvi; lvi.mask=LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE; lvi.iItem=nPos; lvi.iSubItem=0; - lvi.pszText=td.m_szStatusText; - lvi.cchTextMax=lstrlen(lvi.pszText); + lvi.pszText = (PTSTR)(PCTSTR)strStatusText; + lvi.cchTextMax = lstrlen(lvi.pszText); lvi.lParam = spTask->GetSessionUniqueID(); lvi.iImage=GetImageFromStatus(td.m_eTaskState); if (nPos < m_ctlStatusList.GetItemCount()) @@ -243,17 +247,20 @@ // status subitem lvi.mask=LVIF_TEXT; lvi.iSubItem=1; - m_strTemp = td.m_strFileName; - lvi.pszText=m_strTemp.GetBuffer(0); - m_strTemp.ReleaseBuffer(); + if(td.m_strFileName.IsEmpty()) + strTemp = GetResManager().LoadString(IDS_NONEINPUTFILE_STRING); + else + strTemp = td.m_strFileName; + lvi.pszText=strTemp.GetBuffer(0); + strTemp.ReleaseBuffer(); lvi.cchTextMax=lstrlen(lvi.pszText); m_ctlStatusList.SetItem(&lvi); // insert 'file' subitem lvi.iSubItem=2; - m_strTemp=td.m_strDstPath; - lvi.pszText=m_strTemp.GetBuffer(0); - m_strTemp.ReleaseBuffer(); + strTemp=td.m_strDstPath; + lvi.pszText=strTemp.GetBuffer(0); + strTemp.ReleaseBuffer(); lvi.cchTextMax=lstrlen(lvi.pszText); m_ctlStatusList.SetItem(&lvi); @@ -269,27 +276,31 @@ if(spTask == m_spSelectedItem && GetPropValue(GetConfig())) { // data that can be changed by a thread - GetDlgItem(IDC_OPERATION_STATIC)->SetWindowText(td.m_szStatusText); // operation - GetDlgItem(IDC_SOURCE_STATIC)->SetWindowText(td.m_strFullFilePath); // src object + GetDlgItem(IDC_OPERATION_STATIC)->SetWindowText(strStatusText); // operation + + if(td.m_strFullFilePath.IsEmpty()) + GetDlgItem(IDC_SOURCE_STATIC)->SetWindowText(GetResManager().LoadString(IDS_NONEINPUTFILE_STRING)); + else + GetDlgItem(IDC_SOURCE_STATIC)->SetWindowText(td.m_strFullFilePath); // src object // count of processed data/overall count of data _sntprintf(m_szData, _MAX_PATH, _T("%d/%d ("), td.m_stIndex, td.m_stSize); - m_strTemp=CString(m_szData); - m_strTemp+=GetSizeString(td.m_ullProcessedSize, m_szData, _MAX_PATH)+CString(_T("/")); - m_strTemp+=GetSizeString(td.m_ullSizeAll, m_szData, _MAX_PATH)+CString(_T(")")); - GetDlgItem(IDC_PROGRESS_STATIC)->SetWindowText(m_strTemp); + strTemp=CString(m_szData); + strTemp+=GetSizeString(td.m_ullProcessedSize, m_szData, _MAX_PATH)+CString(_T("/")); + strTemp+=GetSizeString(td.m_ullSizeAll, m_szData, _MAX_PATH)+CString(_T(")")); + GetDlgItem(IDC_PROGRESS_STATIC)->SetWindowText(strTemp); // transfer if (m_i64LastProcessed == 0) // if first time - show average - m_strTemp=GetSizeString( td.m_timeElapsed ? td.m_ullProcessedSize/td.m_timeElapsed : 0, m_szData, _MAX_PATH); // last avg + strTemp=GetSizeString( td.m_timeElapsed ? td.m_ullProcessedSize/td.m_timeElapsed : 0, m_szData, _MAX_PATH); // last avg else if ( (dwCurrentTime-m_dwLastUpdate) != 0) - m_strTemp=GetSizeString( (static_cast(td.m_ullProcessedSize) - static_cast(m_i64LastProcessed))/(static_cast(dwCurrentTime-m_dwLastUpdate)/1000.0), m_szData, _MAX_PATH); + 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( 0ULL, m_szData, _MAX_PATH); + strTemp=GetSizeString( 0ULL, m_szData, _MAX_PATH); // avg transfer - GetDlgItem(IDC_TRANSFER_STATIC)->SetWindowText(m_strTemp+_T("/s (")+CString(GetResManager().LoadString(IDS_AVERAGEWORD_STRING)) + GetDlgItem(IDC_TRANSFER_STATIC)->SetWindowText(strTemp+_T("/s (")+CString(GetResManager().LoadString(IDS_AVERAGEWORD_STRING)) +CString(GetSizeString(td.m_timeElapsed ? td.m_ullProcessedSize/td.m_timeElapsed : 0, m_szData, _MAX_PATH))+_T("/s )") ); @@ -710,8 +721,9 @@ _sntprintf(m_szData, _MAX_PATH, _T("%s"), GetResManager().LoadString(IDS_STATUSTITLE_STRING)); // if changed - GetWindowText(m_strTemp); - if (m_strTemp != CString(m_szData)) + CString strTemp; + GetWindowText(strTemp); + if (strTemp != CString(m_szData)) SetWindowText(m_szData); // refresh overall progress @@ -720,20 +732,20 @@ m_ctlProgressAll.SetPos(nPercent); // progress - count of processed data/count of data - m_strTemp=GetSizeString(m_pTasks->GetPosition(), m_szData, _MAX_PATH)+CString(_T("/")); - m_strTemp+=GetSizeString(m_pTasks->GetRange(), m_szData, _MAX_PATH); - GetDlgItem(IDC_OVERALL_PROGRESS_STATIC)->SetWindowText(m_strTemp); + strTemp=GetSizeString(m_pTasks->GetPosition(), m_szData, _MAX_PATH)+CString(_T("/")); + strTemp+=GetSizeString(m_pTasks->GetRange(), m_szData, _MAX_PATH); + GetDlgItem(IDC_OVERALL_PROGRESS_STATIC)->SetWindowText(strTemp); // transfer if (m_i64LastAllTasksProcessed == 0) m_i64LastAllTasksProcessed=m_pTasks->GetPosition(); 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); + 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( 0ULL, m_szData, _MAX_PATH); + strTemp=GetSizeString( 0ULL, m_szData, _MAX_PATH); - GetDlgItem(IDC_OVERALL_TRANSFER_STATIC)->SetWindowText(m_strTemp+_T("/s")); + GetDlgItem(IDC_OVERALL_TRANSFER_STATIC)->SetWindowText(strTemp+_T("/s")); m_i64LastAllTasksProcessed=m_pTasks->GetPosition(); m_dwLastUpdate=dwCurrentTime; } @@ -952,3 +964,88 @@ InitializeResizableControls(); } + +CString CStatusDlg::GetStatusString(const TASK_DISPLAY_DATA& rTaskDisplayData) +{ + CString strStatusText; + // status string + // first + switch(rTaskDisplayData.m_eTaskState) + { + case eTaskState_Error: + { + strStatusText = GetResManager().LoadString(IDS_STATUS_ERROR_STRING); + strStatusText += _T("/"); + break; + } + case eTaskState_Paused: + { + strStatusText = GetResManager().LoadString(IDS_STATUS_PAUSED_STRING); + strStatusText += _T("/"); + break; + } + case eTaskState_Finished: + { + strStatusText = GetResManager().LoadString(IDS_STATUS_FINISHED_STRING); + strStatusText += _T("/"); + break; + } + case eTaskState_Waiting: + { + strStatusText = GetResManager().LoadString(IDS_STATUS_WAITING_STRING); + strStatusText += _T("/"); + break; + } + case eTaskState_Cancelled: + { + strStatusText = GetResManager().LoadString(IDS_STATUS_CANCELLED_STRING); + strStatusText += _T("/"); + break; + } + case eTaskState_None: + { + strStatusText = GetResManager().LoadString(IDS_STATUS_INITIALIZING_STRING); + strStatusText += _T("/"); + break; + } + case eTaskState_Processing: + break; + default: + BOOST_ASSERT(false); // not implemented state + } + + // second part + + if(rTaskDisplayData.m_eSubOperationType == eSubOperation_Deleting) + strStatusText += GetResManager().LoadString(IDS_STATUS_DELETING_STRING); + else if(rTaskDisplayData.m_eSubOperationType == eSubOperation_Scanning) + strStatusText += GetResManager().LoadString(IDS_STATUS_SEARCHING_STRING); + else if(rTaskDisplayData.m_eOperationType == eOperation_Copy) + { + strStatusText += GetResManager().LoadString(IDS_STATUS_COPYING_STRING); + if(!rTaskDisplayData.m_pafFilters && rTaskDisplayData.m_pafFilters->IsEmpty()) + strStatusText += GetResManager().LoadString(IDS_FILTERING_STRING); + } + else if(rTaskDisplayData.m_eOperationType == eOperation_Move) + { + strStatusText += GetResManager().LoadString(IDS_STATUS_MOVING_STRING); + if(!rTaskDisplayData.m_pafFilters && rTaskDisplayData.m_pafFilters->IsEmpty()) + strStatusText += GetResManager().LoadString(IDS_FILTERING_STRING); + } + else + strStatusText += GetResManager().LoadString(IDS_STATUS_UNKNOWN_STRING); + + // third part + if(rTaskDisplayData.m_bIgnoreDirectories) + { + strStatusText += _T("/"); + strStatusText += GetResManager().LoadString(IDS_STATUS_ONLY_FILES_STRING); + } + if(rTaskDisplayData.m_bCreateEmptyFiles) + { + strStatusText += _T("/"); + strStatusText += GetResManager().LoadString(IDS_STATUS_WITHOUT_CONTENTS_STRING); + } + + return strStatusText; +} Index: src/ch/StatusDlg.h =================================================================== diff -u -r044d0e17cdedf3055202486a2235e1a3c8dd6e56 -r0a673d59b6baab3d616ce2570e5bf63378fa7e3c --- src/ch/StatusDlg.h (.../StatusDlg.h) (revision 044d0e17cdedf3055202486a2235e1a3c8dd6e56) +++ src/ch/StatusDlg.h (.../StatusDlg.h) (revision 0a673d59b6baab3d616ce2570e5bf63378fa7e3c) @@ -29,10 +29,13 @@ // CStatusDlg dialog class CStatusDlg : public ictranslate::CLanguageDialog { + enum { IDD = IDD_STATUS_DIALOG }; + // Construction public: CStatusDlg(CTaskArray* pTasks, CWnd* pParent = NULL); // standard constructor ~CStatusDlg(); + void PostCloseMessage(); void SetBufferSizesString(UINT uiValue, int iIndex); void RefreshStatus(); @@ -46,55 +49,16 @@ void AddTaskInfo(int nPos, const CTaskPtr& spTask, DWORD dwCurrentTime); void EnableControls(bool bEnable=true); - CTaskArray* m_pTasks; - CTaskPtr m_spSelectedItem; - CTaskPtr m_spLastSelected; - CTaskPtr m_spInitialSelection; - - TCHAR m_szData[_MAX_PATH]; - TCHAR m_szTimeBuffer1[40]; - TCHAR m_szTimeBuffer2[40]; - TCHAR m_szTimeBuffer3[40]; - - __int64 m_i64LastProcessed; - __int64 m_i64LastAllTasksProcessed; - DWORD m_dwLastUpdate; - - LVITEM lvi; - TASK_DISPLAY_DATA td; - CString m_strTemp; - - CImageList m_images; - - static bool m_bLock; // locker - -// Dialog Data - //{{AFX_DATA(CStatusDlg) - enum { IDD = IDD_STATUS_DIALOG }; - CProgressCtrl m_ctlCurrentProgress; - CFFListCtrl m_ctlStatusList; - CProgressCtrl m_ctlProgressAll; - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CStatusDlg) - public: - protected: +protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam); virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam); - //}}AFX_VIRTUAL -// Implementation -protected: virtual void OnLanguageChanged(); void PrepareResizableControls(); + CString GetStatusString(const TASK_DISPLAY_DATA& rTaskDisplayData); - // Generated message map functions - //{{AFX_MSG(CStatusDlg) virtual BOOL OnInitDialog(); afx_msg void OnTimer(UINT_PTR nIDEvent); afx_msg void OnPauseButton(); @@ -115,8 +79,33 @@ afx_msg void OnShowLogButton(); afx_msg void OnStickButton(); afx_msg void OnResumeButton(); - //}}AFX_MSG + DECLARE_MESSAGE_MAP() + +public: + CTaskPtr m_spInitialSelection; + + static bool m_bLock; // locker + +protected: + CTaskArray* m_pTasks; + CTaskPtr m_spSelectedItem; + CTaskPtr m_spLastSelected; + + TCHAR m_szData[_MAX_PATH]; + TCHAR m_szTimeBuffer1[40]; + TCHAR m_szTimeBuffer2[40]; + TCHAR m_szTimeBuffer3[40]; + + __int64 m_i64LastProcessed; + __int64 m_i64LastAllTasksProcessed; + DWORD m_dwLastUpdate; + + CImageList m_images; + + CProgressCtrl m_ctlCurrentProgress; + CFFListCtrl m_ctlStatusList; + CProgressCtrl m_ctlProgressAll; }; //{{AFX_INSERT_LOCATION}} Index: src/ch/ch.rc =================================================================== diff -u -r1d7d79169d480a02e335b8b0a4919f9c78d58325 -r0a673d59b6baab3d616ce2570e5bf63378fa7e3c --- src/ch/ch.rc (.../ch.rc) (revision 1d7d79169d480a02e335b8b0a4919f9c78d58325) +++ src/ch/ch.rc (.../ch.rc) (revision 0a673d59b6baab3d616ce2570e5bf63378fa7e3c) @@ -826,18 +826,19 @@ STRINGTABLE BEGIN - IDS_STATUS0_STRING "Searching" - IDS_STATUS1_STRING "Copying" - IDS_STATUS2_STRING "Moving" - IDS_STATUS3_STRING "Finished" - IDS_STATUS4_STRING "Error" - IDS_STATUS5_STRING "Paused" - IDS_STATUS6_STRING "Deleting" - IDS_STATUS7_STRING "Unknown" - IDS_STATUS8_STRING "Cancelled" - IDS_STATUS9_STRING "Waiting" - IDS_STATUS10_STRING "Only files" - IDS_STATUS11_STRING "Without contents" + IDS_STATUS_SEARCHING_STRING "Searching" + IDS_STATUS_COPYING_STRING "Copying" + IDS_STATUS_MOVING_STRING "Moving" + IDS_STATUS_FINISHED_STRING "Finished" + IDS_STATUS_ERROR_STRING "Error" + IDS_STATUS_PAUSED_STRING "Paused" + IDS_STATUS_DELETING_STRING "Deleting" + IDS_STATUS_UNKNOWN_STRING "Unknown" + IDS_STATUS_CANCELLED_STRING "Cancelled" + IDS_STATUS_WAITING_STRING "Waiting" + IDS_STATUS_ONLY_FILES_STRING "Only files" + IDS_STATUS_WITHOUT_CONTENTS_STRING "Without contents" + IDS_STATUS_INITIALIZING_STRING "Initializing" IDS_SHELLEXECUTEERROR_STRING "Error #%errno calling ShellExecute for file %path" IDS_BSDEFAULT_STRING "Default: " Index: src/ch/resource.h =================================================================== diff -u -r044d0e17cdedf3055202486a2235e1a3c8dd6e56 -r0a673d59b6baab3d616ce2570e5bf63378fa7e3c --- src/ch/resource.h (.../resource.h) (revision 044d0e17cdedf3055202486a2235e1a3c8dd6e56) +++ src/ch/resource.h (.../resource.h) (revision 0a673d59b6baab3d616ce2570e5bf63378fa7e3c) @@ -533,18 +533,18 @@ #define IDS_TASKNOTPAUSED_STRING 21517 #define IDS_TASKNOTSELECTED_STRING 21518 #define IDS_NONEINPUTFILE_STRING 21519 -#define IDS_STATUS0_STRING 21522 -#define IDS_STATUS1_STRING 21523 -#define IDS_STATUS2_STRING 21524 -#define IDS_STATUS3_STRING 21525 -#define IDS_STATUS4_STRING 21526 -#define IDS_STATUS5_STRING 21527 -#define IDS_STATUS6_STRING 21528 -#define IDS_STATUS7_STRING 21529 -#define IDS_STATUS8_STRING 21530 -#define IDS_STATUS9_STRING 21531 -#define IDS_STATUS10_STRING 21532 -#define IDS_STATUS11_STRING 21533 +#define IDS_STATUS_SEARCHING_STRING 21522 +#define IDS_STATUS_COPYING_STRING 21523 +#define IDS_STATUS_MOVING_STRING 21524 +#define IDS_STATUS_FINISHED_STRING 21525 +#define IDS_STATUS_ERROR_STRING 21526 +#define IDS_STATUS_PAUSED_STRING 21527 +#define IDS_STATUS_DELETING_STRING 21528 +#define IDS_STATUS_UNKNOWN_STRING 21529 +#define IDS_STATUS_CANCELLED_STRING 21530 +#define IDS_STATUS_WAITING_STRING 21531 +#define IDS_STATUS_ONLY_FILES_STRING 21532 +#define IDS_STATUS_WITHOUT_CONTENTS_STRING 21533 #define IDS_SHELLEXECUTEERROR_STRING 21534 #define IDS_BSDEFAULT_STRING 21535 #define IDS_BSONEDISK_STRING 21536 @@ -554,6 +554,7 @@ #define IDS_EMPTYASSOCFILE_STRING 21549 #define IDS_FILTERING_STRING 21550 #define IDS_CONFIRMCANCEL_STRING 21551 +#define IDS_STATUS_INITIALIZING_STRING 21552 #define ID_POPUP_SHOW_STATUS 32773 #define ID_POPUP_TIME_CRITICAL 32774 #define ID_POPUP_HIGHEST 32775 Index: src/ch/task.cpp =================================================================== diff -u -r1d7d79169d480a02e335b8b0a4919f9c78d58325 -r0a673d59b6baab3d616ce2570e5bf63378fa7e3c --- src/ch/task.cpp (.../task.cpp) (revision 1d7d79169d480a02e335b8b0a4919f9c78d58325) +++ src/ch/task.cpp (.../task.cpp) (revision 0a673d59b6baab3d616ce2570e5bf63378fa7e3c) @@ -1,5 +1,5 @@ /*************************************************************************** -* Copyright (C) 2001-2008 by Jozef Starosczyk * +* Copyright (C) 2001-2010 by Jozef Starosczyk * * ixen@copyhandler.com * * * * This program is free software; you can redistribute it and/or modify * @@ -18,25 +18,28 @@ ***************************************************************************/ #include "Stdafx.h" #include "task.h" -#include "StringHelpers.h" -#include "../common/FileSupport.h" -#include "ch.h" -#include "FeedbackHandler.h" + #include #include #include #include +#include "StringHelpers.h" +#include "../common/FileSupport.h" +#include "FeedbackHandler.h" + +#include "TTaskConfiguration.h" + // assume max sectors of 4kB (for rounding) #define MAXSECTORSIZE 4096 //////////////////////////////////////////////////////////////////////////////// // TTasksGlobalStats members TTasksGlobalStats::TTasksGlobalStats() : -m_ullGlobalTotalSize(0), -m_ullGlobalProcessedSize(0), -m_stRunningTasks(0) + m_ullGlobalTotalSize(0), + m_ullGlobalProcessedSize(0), + m_stRunningTasks(0) { } @@ -429,7 +432,8 @@ m_bRareStateModified(false), m_bOftenStateModified(false), m_stSessionUniqueID(stSessionUniqueID), - m_localStats() + m_localStats(), + m_eCurrentState(eTaskState_None) { BOOST_ASSERT(piFeedbackHandler); @@ -810,7 +814,7 @@ if(m_tTaskDefinition.GetSourcePathCount() > 0) pData->m_strPath = m_arrSourcePaths.GetAt(0)->GetFileName(); else - pData->m_strPath = GetResManager().LoadString(IDS_NONEINPUTFILE_STRING); + pData->m_strPath.Empty(); } } @@ -846,8 +850,8 @@ } else { - pData->m_strFullFilePath = GetResManager().LoadString(IDS_NONEINPUTFILE_STRING); - pData->m_strFileName = pData->m_strFullFilePath; + pData->m_strFullFilePath.Empty(); + pData->m_strFileName.Empty(); } } } @@ -862,7 +866,12 @@ pData->m_stSize=m_files.GetSize(); pData->m_ullSizeAll = m_localStats.GetTotalSize(); pData->m_strUniqueName = m_tTaskDefinition.GetTaskUniqueID(); + pData->m_eOperationType = m_tTaskDefinition.GetOperationType(); + pData->m_eSubOperationType = m_tTaskDefinition.GetOperationPlan().GetSubOperationAt(m_tTaskBasicProgressInfo.GetSubOperationIndex()); + pData->m_bIgnoreDirectories = GetTaskPropValue(m_tTaskDefinition.GetConfiguration()); + pData->m_bCreateEmptyFiles = GetTaskPropValue(m_tTaskDefinition.GetConfiguration()); + if(m_files.GetSize() > 0) pData->m_iCurrentBufferIndex=m_bsSizes.m_bOnlyDefault ? 0 : m_files.GetAt((stCurrentIndex < m_files.GetSize()) ? stCurrentIndex : 0)->GetBufferIndex(m_tDestinationPath); else @@ -871,78 +880,6 @@ // percents pData->m_nPercent = m_localStats.GetProgressInPercent(); - // status string - // first - switch(m_eCurrentState) - { - case eTaskState_Error: - { - GetResManager().LoadStringCopy(IDS_STATUS0_STRING+4, pData->m_szStatusText, _MAX_PATH); - _tcscat(pData->m_szStatusText, _T("/")); - break; - } - case eTaskState_Paused: - { - GetResManager().LoadStringCopy(IDS_STATUS0_STRING+5, pData->m_szStatusText, _MAX_PATH); - _tcscat(pData->m_szStatusText, _T("/")); - break; - } - case eTaskState_Finished: - { - GetResManager().LoadStringCopy(IDS_STATUS0_STRING+3, pData->m_szStatusText, _MAX_PATH); - _tcscat(pData->m_szStatusText, _T("/")); - break; - } - case eTaskState_Waiting: - { - GetResManager().LoadStringCopy(IDS_STATUS0_STRING+9, pData->m_szStatusText, _MAX_PATH); - _tcscat(pData->m_szStatusText, _T("/")); - break; - } - case eTaskState_Cancelled: - { - GetResManager().LoadStringCopy(IDS_STATUS0_STRING+8, pData->m_szStatusText, _MAX_PATH); - _tcscat(pData->m_szStatusText, _T("/")); - break; - } - default: - _tcscpy(pData->m_szStatusText, _T("")); - } - - // second part - EOperationType eOperationType = m_tTaskDefinition.GetOperationType(); - ESubOperationType eSubOperation = m_tTaskDefinition.GetOperationPlan().GetSubOperationAt(m_tTaskBasicProgressInfo.GetSubOperationIndex()); - if(eSubOperation == eSubOperation_Deleting) - _tcscat(pData->m_szStatusText, GetResManager().LoadString(IDS_STATUS0_STRING+6)); - else if(eSubOperation == eSubOperation_Scanning) - _tcscat(pData->m_szStatusText, GetResManager().LoadString(IDS_STATUS0_STRING+0)); - else if(eOperationType == eOperation_Copy) - { - _tcscat(pData->m_szStatusText, GetResManager().LoadString(IDS_STATUS0_STRING+1)); - if(!m_afFilters.IsEmpty()) - _tcscat(pData->m_szStatusText, GetResManager().LoadString(IDS_FILTERING_STRING)); - } - else if(eOperationType == eOperation_Move) - { - _tcscat(pData->m_szStatusText, GetResManager().LoadString(IDS_STATUS0_STRING+2)); - if(!m_afFilters.IsEmpty()) - _tcscat(pData->m_szStatusText, GetResManager().LoadString(IDS_FILTERING_STRING)); - } - else - _tcscat(pData->m_szStatusText, GetResManager().LoadString(IDS_STATUS0_STRING+7)); - - // third part - if(GetTaskPropValue(m_tTaskDefinition.GetConfiguration())) - { - _tcscat(pData->m_szStatusText, _T("/")); - _tcscat(pData->m_szStatusText, GetResManager().LoadString(IDS_STATUS0_STRING+10)); - } - if(GetTaskPropValue(m_tTaskDefinition.GetConfiguration())) - { - _tcscat(pData->m_szStatusText, _T("/")); - _tcscat(pData->m_szStatusText, GetResManager().LoadString(IDS_STATUS0_STRING+11)); - } - // time pData->m_timeElapsed = m_localStats.GetTimeElapsed(); } @@ -1335,14 +1272,14 @@ // delete data if(spFileInfo->IsDirectory()) { - if(!GetPropValue(GetConfig())) + if(!GetTaskPropValue(m_tTaskDefinition.GetConfiguration())) SetFileAttributes(spFileInfo->GetFullFilePath(), FILE_ATTRIBUTE_NORMAL | FILE_ATTRIBUTE_DIRECTORY); bSuccess=RemoveDirectory(spFileInfo->GetFullFilePath()); } else { // set files attributes to normal - it'd slow processing a bit, but it's better. - if(!GetPropValue(GetConfig())) + if(!GetTaskPropValue(m_tTaskDefinition.GetConfiguration())) SetFileAttributes(spFileInfo->GetFullFilePath(), FILE_ATTRIBUTE_NORMAL); bSuccess=DeleteFile(spFileInfo->GetFullFilePath()); } @@ -1860,7 +1797,8 @@ // NOTE: we are using here the file size read when scanning directories for files; it might be // outdated at this point, but at present we don't want to re-read file size since it // will cost additional disk access - bool bNoBuffer = (GetPropValue(GetConfig()) && pData->spSrcFile->GetLength64() >= (unsigned long long)GetPropValue(GetConfig())); + bool bNoBuffer = (GetTaskPropValue(m_tTaskDefinition.GetConfiguration()) && + pData->spSrcFile->GetLength64() >= GetTaskPropValue(m_tTaskDefinition.GetConfiguration())); // first open the source file and handle any failures eResult = OpenSourceFileFB(hSrc, pData->spSrcFile, bNoBuffer); @@ -1877,7 +1815,7 @@ // change attributes of a dest file // NOTE: probably should be removed from here and report problems with read-only files // directly to the user (as feedback request) - if(!GetPropValue(GetConfig())) + if(!GetTaskPropValue(m_tTaskDefinition.GetConfiguration())) SetFileAttributes(pData->strDstFile, FILE_ATTRIBUTE_NORMAL); // open destination file, handle the failures and possibly existence of the destination file @@ -2280,21 +2218,21 @@ spFileInfo->SetFlags(ccp.bProcessed ? FIF_PROCESSED : 0, FIF_PROCESSED); // if moving - delete file (only if config flag is set) - if(bMove && spFileInfo->GetFlags() & FIF_PROCESSED && !GetPropValue(GetConfig())) + if(bMove && spFileInfo->GetFlags() & FIF_PROCESSED && !GetTaskPropValue(m_tTaskDefinition.GetConfiguration())) { - if(!GetPropValue(GetConfig())) + if(!GetTaskPropValue(m_tTaskDefinition.GetConfiguration())) SetFileAttributes(spFileInfo->GetFullFilePath(), FILE_ATTRIBUTE_NORMAL); DeleteFile(spFileInfo->GetFullFilePath()); // there will be another try later, so I don't check // if succeeded } } // set a time - if(GetPropValue(GetConfig())) + if(GetTaskPropValue(m_tTaskDefinition.GetConfiguration())) SetFileDirectoryTime(ccp.strDstFile, spFileInfo); // no error checking (but most probably it should be checked) // attributes - if(GetPropValue(GetConfig())) + if(GetTaskPropValue(m_tTaskDefinition.GetConfiguration())) SetFileAttributes(ccp.strDstFile, spFileInfo->GetAttributes()); // as above } @@ -2423,10 +2361,10 @@ // set thread options HANDLE hThread = GetCurrentThread(); - ::SetThreadPriorityBoost(hThread, GetPropValue(GetConfig())); + ::SetThreadPriorityBoost(hThread, GetTaskPropValue(m_tTaskDefinition.GetConfiguration())); // determine when to scan directories - bool bReadTasksSize = GetPropValue(GetConfig()); + bool bReadTasksSize = GetTaskPropValue(m_tTaskDefinition.GetConfiguration()); // wait for permission to really start (but only if search for files is not allowed to start regardless of the lock) size_t stSubOperationIndex = m_tTaskBasicProgressInfo.GetSubOperationIndex(); Index: src/ch/task.h =================================================================== diff -u -r1d7d79169d480a02e335b8b0a4919f9c78d58325 -r0a673d59b6baab3d616ce2570e5bf63378fa7e3c --- src/ch/task.h (.../task.h) (revision 1d7d79169d480a02e335b8b0a4919f9c78d58325) +++ src/ch/task.h (.../task.h) (revision 0a673d59b6baab3d616ce2570e5bf63378fa7e3c) @@ -60,6 +60,8 @@ CFiltersArray* m_pafFilters; ETaskCurrentState m_eTaskState; + EOperationType m_eOperationType; + ESubOperationType m_eSubOperationType; const BUFFERSIZES* m_pbsSizes; int m_nPriority; @@ -72,7 +74,8 @@ CString m_strUniqueName; // doesn't change from first setting - TCHAR m_szStatusText[_MAX_PATH]; + bool m_bIgnoreDirectories; + bool m_bCreateEmptyFiles; }; struct TASK_MINI_DISPLAY_DATA