| |
49 |
49 |
CCustomCopyDlg::CCustomCopyDlg(const chengine::TTaskDefinition& rTaskDefinition) : |
| |
50 |
50 |
ictranslate::CLanguageDialog(IDD_CUSTOM_COPY_DIALOG), |
| |
51 |
51 |
m_tTaskDefinition(rTaskDefinition) |
| |
52 |
52 |
{ |
| |
53 |
53 |
} |
| |
54 |
54 |
|
| |
55 |
55 |
void CCustomCopyDlg::DoDataExchange(CDataExchange* pDX) |
| |
56 |
56 |
{ |
| |
57 |
57 |
CLanguageDialog::DoDataExchange(pDX); |
| |
58 |
58 |
|
| |
59 |
59 |
DDX_Control(pDX, IDC_DESTPATH_COMBOBOXEX, m_ctlDstPath); |
| |
60 |
60 |
DDX_Control(pDX, IDC_FILTERS_LIST, m_ctlFilters); |
| |
61 |
61 |
DDX_Control(pDX, IDC_BUFFERSIZES_LIST, m_ctlBufferSizes); |
| |
62 |
62 |
DDX_Control(pDX, IDC_OPERATION_COMBO, m_ctlOperation); |
| |
63 |
63 |
DDX_Control(pDX, IDC_PRIORITY_COMBO, m_ctlPriority); |
| |
64 |
64 |
DDX_Control(pDX, IDC_FILES_LIST, m_ctlFiles); |
| |
65 |
65 |
DDX_Control(pDX, IDC_FEEDBACK_RULES_SUMMARY_EDIT, m_ctlFeedbackRules); |
| |
66 |
66 |
DDX_Check(pDX, IDC_ONLYSTRUCTURE_CHECK, m_bOnlyCreate); |
| |
67 |
67 |
DDX_Check(pDX, IDC_IGNOREFOLDERS_CHECK, m_bIgnoreFolders); |
| |
68 |
68 |
DDX_Check(pDX, IDC_FORCEDIRECTORIES_CHECK, m_bForceDirectories); |
| |
69 |
|
DDX_Check(pDX, IDC_FILTERS_CHECK, m_bFilters); |
| |
70 |
|
DDX_Check(pDX, IDC_ADVANCED_CHECK, m_bAdvanced); |
| |
|
69 |
DDX_Check(pDX, IDC_DONT_CREATE_EMPTY_DIRECTORIES_CHECK, m_bExcludeEmptyDirectories); |
| |
71 |
70 |
} |
| |
72 |
71 |
|
| |
73 |
72 |
BEGIN_MESSAGE_MAP(CCustomCopyDlg, ictranslate::CLanguageDialog) |
| |
74 |
73 |
ON_BN_CLICKED(IDC_ADDDIR_BUTTON, OnAddDirectoryButton) |
| |
75 |
74 |
ON_BN_CLICKED(IDC_ADDFILE_BUTTON, OnAddFilesButton) |
| |
76 |
75 |
ON_BN_CLICKED(IDC_REMOVEFILEFOLDER_BUTTON, OnRemoveButton) |
| |
77 |
76 |
ON_BN_CLICKED(IDC_DESTBROWSE_BUTTON, OnBrowseButton) |
| |
78 |
77 |
ON_BN_CLICKED(IDC_BUFFERSIZES_BUTTON, OnChangebufferButton) |
| |
79 |
78 |
ON_BN_CLICKED(IDC_ADDFILTER_BUTTON, OnAddfilterButton) |
| |
80 |
79 |
ON_BN_CLICKED(IDC_REMOVEFILTER_BUTTON, OnRemovefilterButton) |
| |
81 |
80 |
ON_WM_DESTROY() |
| |
82 |
|
ON_BN_CLICKED(IDC_FILTERS_CHECK, OnFiltersCheck) |
| |
83 |
|
ON_BN_CLICKED(IDC_STANDARD_CHECK, OnStandardCheck) |
| |
84 |
|
ON_BN_CLICKED(IDC_ADVANCED_CHECK, OnAdvancedCheck) |
| |
85 |
81 |
ON_NOTIFY(NM_DBLCLK, IDC_FILTERS_LIST, OnDblclkFiltersList) |
| |
86 |
82 |
ON_LBN_DBLCLK(IDC_BUFFERSIZES_LIST, OnDblclkBuffersizesList) |
| |
87 |
83 |
ON_CBN_EDITCHANGE(IDC_DESTPATH_COMBOBOXEX, OnEditchangeDestpathComboboxex) |
| |
88 |
84 |
ON_BN_CLICKED(IDC_IMPORT_BUTTON, OnImportButton) |
| |
89 |
85 |
ON_BN_CLICKED(IDC_IGNOREFOLDERS_CHECK, OnIgnorefoldersCheck) |
| |
90 |
86 |
ON_BN_CLICKED(IDC_FORCEDIRECTORIES_CHECK, OnForcedirectoriesCheck) |
| |
|
87 |
ON_BN_CLICKED(IDC_DONT_CREATE_EMPTY_DIRECTORIES_CHECK, OnExcludeEmptyDirectories) |
| |
91 |
88 |
ON_BN_CLICKED(IDC_EXPORT_BUTTON, OnExportButtonClicked) |
| |
92 |
89 |
ON_BN_CLICKED(IDC_CUSTOM_RULES_BUTTON, OnBnCustomRules) |
| |
93 |
90 |
ON_WM_SIZE() |
| |
94 |
91 |
END_MESSAGE_MAP() |
| |
95 |
92 |
|
| |
96 |
93 |
|
| |
97 |
94 |
|
| |
98 |
95 |
BOOL CCustomCopyDlg::OnInitDialog() |
| |
99 |
96 |
{ |
| |
100 |
97 |
CLanguageDialog::OnInitDialog(); |
| |
101 |
98 |
|
| |
102 |
99 |
|
| |
103 |
100 |
HICON hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); |
| |
104 |
101 |
SetIcon(hIcon, FALSE); |
| |
105 |
102 |
|
| |
106 |
|
AddResizableControl(IDC_001_STATIC, 0.0, 0.0, 1.0, 0.0); |
| |
|
103 |
AddResizableControl(IDC_HDR_SOURCE_FILES_STATIC, 0.0, 0.0, 1.0, 0.0); |
| |
107 |
104 |
AddResizableControl(IDC_FILES_LIST, 0.0, 0.0, 1.0, 0.5); |
| |
108 |
105 |
AddResizableControl(IDC_ADDFILE_BUTTON, 1.0, 0.0, 0.0, 0.0); |
| |
109 |
106 |
AddResizableControl(IDC_ADDDIR_BUTTON, 1.0, 0.0, 0.0, 0.0); |
| |
110 |
107 |
AddResizableControl(IDC_REMOVEFILEFOLDER_BUTTON, 1.0, 0.0, 0.0, 0.0); |
| |
111 |
108 |
AddResizableControl(IDC_IMPORT_BUTTON, 1.0, 0.0, 0.0, 0.0); |
| |
112 |
109 |
|
| |
113 |
|
AddResizableControl(IDC_002_STATIC, 0.0, 0.5, 1.0, 0.0); |
| |
|
110 |
AddResizableControl(IDC_HDR_DESTIONATION_PATH_STATIC, 0.0, 0.5, 1.0, 0.0); |
| |
114 |
111 |
AddResizableControl(IDC_DESTPATH_COMBOBOXEX, 0.0, 0.5, 1.0, 0.0); |
| |
115 |
112 |
AddResizableControl(IDC_DESTBROWSE_BUTTON, 1.0, 0.5, 0.0, 0.0); |
| |
116 |
113 |
|
| |
117 |
|
AddResizableControl(IDC_BAR1_STATIC, 0.0, 0.5, 0.5, 0.0); |
| |
118 |
|
AddResizableControl(IDC_007_STATIC, 0.5, 0.5, 0.0, 0.0); |
| |
119 |
|
AddResizableControl(IDC_BAR2_STATIC, 0.5, 0.5, 0.5, 0.0); |
| |
|
114 |
AddResizableControl(IDC_LEFT_STANDARD_OPTIONS_STATIC, 0.0, 0.5, 0.5, 0.0); |
| |
|
115 |
AddResizableControl(IDC_HDR_STANDARD_OPTIONS_STATIC, 0.5, 0.5, 0.0, 0.0); |
| |
|
116 |
AddResizableControl(IDC_RIGHT_STANDARD_OPTIONS_STATIC, 0.5, 0.5, 0.5, 0.0); |
| |
120 |
117 |
|
| |
121 |
|
AddResizableControl(IDC_003_STATIC, 0.0, 0.5, 0.5, 0.0); |
| |
122 |
|
AddResizableControl(IDC_004_STATIC, 0.5, 0.5, 0.5, 0.0); |
| |
|
118 |
AddResizableControl(IDC_HDR_OPERATION_TYPE_STATIC, 0.0, 0.5, 0.5, 0.0); |
| |
|
119 |
AddResizableControl(IDC_HDR_PRIORITY_STATIC, 0.5, 0.5, 0.5, 0.0); |
| |
123 |
120 |
|
| |
124 |
121 |
AddResizableControl(IDC_OPERATION_COMBO, 0.0, 0.5, 0.5, 0.0); |
| |
125 |
122 |
AddResizableControl(IDC_PRIORITY_COMBO, 0.5, 0.5, 0.5, 0.0); |
| |
126 |
123 |
|
| |
127 |
|
AddResizableControl(IDC_006_STATIC, 0.0, 0.5, 1.0, 0.0); |
| |
|
124 |
AddResizableControl(IDC_HDR_BUFFER_SIZES_STATIC, 0.0, 0.5, 1.0, 0.0); |
| |
128 |
125 |
AddResizableControl(IDC_BUFFERSIZES_LIST, 0.0, 0.5, 1.0, 0.0); |
| |
129 |
126 |
AddResizableControl(IDC_BUFFERSIZES_BUTTON, 1.0, 0.5, 0.0, 0.0); |
| |
130 |
127 |
|
| |
131 |
|
AddResizableControl(IDC_FILTERS_CHECK, 0.0, 0.5, 0.0, 0.0); |
| |
132 |
|
AddResizableControl(IDC_BAR3_STATIC, 0.0, 0.5, 1.0, 0.0); |
| |
|
128 |
AddResizableControl(IDC_LEFT_FILTERS_STATIC, 0.0, 0.5, 0.0, 0.0); |
| |
|
129 |
AddResizableControl(IDC_HDR_FILTERS_STATIC, 0.0, 0.5, 0.0, 0.0); |
| |
|
130 |
AddResizableControl(IDC_RIGHT_FILTERS_STATIC, 0.0, 0.5, 1.0, 0.0); |
| |
133 |
131 |
AddResizableControl(IDC_FILTERS_LIST, 0.0, 0.5, 1.0, 0.5); |
| |
134 |
132 |
AddResizableControl(IDC_ADDFILTER_BUTTON, 1.0, 0.5, 0.0, 0.0); |
| |
135 |
133 |
AddResizableControl(IDC_REMOVEFILTER_BUTTON, 1.0, 0.5, 0.0, 0.0); |
| |
136 |
134 |
|
| |
137 |
|
AddResizableControl(IDC_BAR7_STATIC, 0.0, 1.0, 0.0, 0.0); |
| |
138 |
|
AddResizableControl(IDC_FEEDBACK_RULES_STATIC, 0.0, 1.0, 0.0, 0.0); |
| |
139 |
|
AddResizableControl(IDC_BAR8_STATIC, 0.0, 1.0, 1.0, 0.0); |
| |
|
135 |
AddResizableControl(IDC_LEFT_FEEDBACK_RULES_STATIC, 0.0, 1.0, 0.0, 0.0); |
| |
|
136 |
AddResizableControl(IDC_HDR_FEEDBACK_RULES_STATIC, 0.0, 1.0, 0.0, 0.0); |
| |
|
137 |
AddResizableControl(IDC_RIGHT_FEEDBACK_RULES_STATIC, 0.0, 1.0, 1.0, 0.0); |
| |
140 |
138 |
AddResizableControl(IDC_FEEDBACK_RULES_SUMMARY_EDIT, 0.0, 1.0, 1.0, 0.0); |
| |
141 |
139 |
AddResizableControl(IDC_CUSTOM_RULES_BUTTON, 1.0, 1.0, 0.0, 0.0); |
| |
142 |
140 |
|
| |
143 |
|
AddResizableControl(IDC_ADVANCED_CHECK, 0.0, 1.0, 0.0, 0.0); |
| |
144 |
|
AddResizableControl(IDC_BAR4_STATIC, 0.0, 1.0, 1.0, 0.0); |
| |
|
141 |
AddResizableControl(IDC_LEFT_ADVANCED_OPTIONS_STATIC, 0.0, 1.0, 0.0, 0.0); |
| |
|
142 |
AddResizableControl(IDC_HDR_ADVANCED_OPTIONS_STATIC, 0.0, 1.0, 0.0, 0.0); |
| |
|
143 |
AddResizableControl(IDC_RIGHT_ADVANCED_OPTIONS_STATIC, 0.0, 1.0, 1.0, 0.0); |
| |
145 |
144 |
|
| |
146 |
145 |
AddResizableControl(IDC_IGNOREFOLDERS_CHECK, 0.0, 1.0, 1.0, 0.0); |
| |
147 |
146 |
AddResizableControl(IDC_ONLYSTRUCTURE_CHECK, 0.0, 1.0, 1.0, 0.0); |
| |
148 |
147 |
AddResizableControl(IDC_FORCEDIRECTORIES_CHECK, 0.0, 1.0, 1.0, 0.0); |
| |
|
148 |
AddResizableControl(IDC_DONT_CREATE_EMPTY_DIRECTORIES_CHECK, 0.0, 1.0, 1.0, 0.0); |
| |
149 |
149 |
|
| |
150 |
|
AddResizableControl(IDC_BAR5_STATIC, 0.0, 1.0, 1.0, 0.0); |
| |
|
150 |
AddResizableControl(IDC_BOTTOM_BAR_STATIC, 0.0, 1.0, 1.0, 0.0); |
| |
151 |
151 |
AddResizableControl(IDOK, 1.0, 1.0, 0.0, 0.0); |
| |
152 |
152 |
AddResizableControl(IDCANCEL, 1.0, 1.0, 0.0, 0.0); |
| |
153 |
153 |
AddResizableControl(IDC_EXPORT_BUTTON, 0.0, 1.0, 0.0, 0.0); |
| |
154 |
154 |
|
| |
155 |
155 |
InitializeResizableControls(); |
| |
156 |
156 |
|
| |
157 |
157 |
|
| |
158 |
158 |
SetWindowPos(&wndNoTopMost, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE ); |
| |
159 |
159 |
|
| |
160 |
160 |
|
| |
161 |
161 |
SHFILEINFO sfi; |
| |
162 |
162 |
HIMAGELIST hImageList = (HIMAGELIST)SHGetFileInfo(_T("C:\\"), FILE_ATTRIBUTE_NORMAL, &sfi, sizeof(SHFILEINFO), |
| |
163 |
163 |
SHGFI_SYSICONINDEX | SHGFI_SMALLICON); |
| |
164 |
164 |
|
| |
165 |
165 |
m_ilImages.Attach(hImageList); |
| |
166 |
166 |
m_ctlFiles.SetImageList(&m_ilImages, LVSIL_SMALL); |
| |
167 |
167 |
|
| |
168 |
168 |
|
| |
169 |
169 |
CRect rc; |
| |
170 |
170 |
m_ctlFiles.GetWindowRect(&rc); |
|
| |
261 |
261 |
lvc.iSubItem=2; |
| |
262 |
262 |
lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_HDRDATE_STRING); |
| |
263 |
263 |
lvc.cchTextMax=lstrlen(lvc.pszText); |
| |
264 |
264 |
lvc.cx=static_cast<int>(0.3*rc.Width()); |
| |
265 |
265 |
m_ctlFilters.InsertColumn(4, &lvc); |
| |
266 |
266 |
|
| |
267 |
267 |
|
| |
268 |
268 |
lvc.iSubItem=3; |
| |
269 |
269 |
lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_HDRATTRIB_STRING); |
| |
270 |
270 |
lvc.cchTextMax=lstrlen(lvc.pszText); |
| |
271 |
271 |
lvc.cx=static_cast<int>(0.1*rc.Width()); |
| |
272 |
272 |
m_ctlFilters.InsertColumn(5, &lvc); |
| |
273 |
273 |
|
| |
274 |
274 |
|
| |
275 |
275 |
lvc.iSubItem=4; |
| |
276 |
276 |
lvc.pszText=(PTSTR)GetResManager().LoadString(IDS_HDREXCLUDEATTRIB_STRING); |
| |
277 |
277 |
lvc.cchTextMax=lstrlen(lvc.pszText); |
| |
278 |
278 |
lvc.cx=static_cast<int>(0.1*rc.Width()); |
| |
279 |
279 |
m_ctlFilters.InsertColumn(6, &lvc); |
| |
280 |
280 |
|
| |
281 |
|
m_bFilters = !m_tTaskDefinition.GetFilters().IsEmpty(); |
| |
282 |
|
|
| |
283 |
281 |
|
| |
284 |
282 |
m_bIgnoreFolders = chengine::GetTaskPropValue<chengine::eTO_IgnoreDirectories>(m_tTaskDefinition.GetConfiguration()); |
| |
285 |
283 |
m_bForceDirectories = chengine::GetTaskPropValue<chengine::eTO_CreateDirectoriesRelativeToRoot>(m_tTaskDefinition.GetConfiguration()); |
| |
|
284 |
m_bExcludeEmptyDirectories = chengine::GetTaskPropValue<chengine::eTO_ExcludeEmptyDirectories>(m_tTaskDefinition.GetConfiguration()); |
| |
286 |
285 |
m_bOnlyCreate = chengine::GetTaskPropValue<chengine::eTO_CreateEmptyFiles>(m_tTaskDefinition.GetConfiguration()); |
| |
287 |
|
m_bAdvanced = (m_bIgnoreFolders | m_bForceDirectories | m_bOnlyCreate); |
| |
288 |
286 |
|
| |
289 |
287 |
UpdateData(FALSE); |
| |
290 |
288 |
|
| |
291 |
289 |
UpdateFeedbackRulesEdit(); |
| |
292 |
290 |
|
| |
293 |
291 |
EnableControls(); |
| |
294 |
292 |
|
| |
295 |
293 |
return TRUE; |
| |
296 |
294 |
} |
| |
297 |
295 |
|
| |
298 |
296 |
void CCustomCopyDlg::OnLanguageChanged() |
| |
299 |
297 |
{ |
| |
300 |
298 |
UpdateData(TRUE); |
| |
301 |
299 |
|
| |
302 |
300 |
|
| |
303 |
301 |
UpdateFilesListCtrlHeaderWidth(); |
| |
304 |
302 |
|
| |
305 |
303 |
|
| |
306 |
304 |
int iPos=m_ctlOperation.GetCurSel(); |
| |
307 |
305 |
m_ctlOperation.ResetContent(); |
|
| |
708 |
706 |
break; |
| |
709 |
707 |
|
| |
710 |
708 |
int iItem = m_ctlFilters.GetNextSelectedItem(pos); |
| |
711 |
709 |
m_ctlFilters.DeleteItem(iItem); |
| |
712 |
710 |
afFilters.RemoveAt(iItem); |
| |
713 |
711 |
} |
| |
714 |
712 |
} |
| |
715 |
713 |
|
| |
716 |
714 |
void CCustomCopyDlg::OnDestroy() |
| |
717 |
715 |
{ |
| |
718 |
716 |
m_ctlFiles.SetImageList(nullptr, LVSIL_SMALL); |
| |
719 |
717 |
m_ilImages.Detach(); |
| |
720 |
718 |
|
| |
721 |
719 |
CLanguageDialog::OnDestroy(); |
| |
722 |
720 |
} |
| |
723 |
721 |
|
| |
724 |
722 |
void CCustomCopyDlg::EnableControls() |
| |
725 |
723 |
{ |
| |
726 |
724 |
UpdateData(TRUE); |
| |
727 |
725 |
|
| |
728 |
|
m_ctlFilters.EnableWindow(m_bFilters); |
| |
729 |
|
GetDlgItem(IDC_ADDFILTER_BUTTON)->EnableWindow(m_bFilters); |
| |
730 |
|
GetDlgItem(IDC_REMOVEFILTER_BUTTON)->EnableWindow(m_bFilters); |
| |
731 |
|
|
| |
732 |
|
GetDlgItem(IDC_IGNOREFOLDERS_CHECK)->EnableWindow(m_bAdvanced && !m_bForceDirectories); |
| |
733 |
|
GetDlgItem(IDC_FORCEDIRECTORIES_CHECK)->EnableWindow(m_bAdvanced && !m_bIgnoreFolders); |
| |
734 |
|
GetDlgItem(IDC_ONLYSTRUCTURE_CHECK)->EnableWindow(m_bAdvanced); |
| |
|
726 |
GetDlgItem(IDC_IGNOREFOLDERS_CHECK)->EnableWindow(!m_bForceDirectories && !m_bExcludeEmptyDirectories); |
| |
|
727 |
GetDlgItem(IDC_FORCEDIRECTORIES_CHECK)->EnableWindow(!m_bIgnoreFolders); |
| |
|
728 |
GetDlgItem(IDC_DONT_CREATE_EMPTY_DIRECTORIES_CHECK)->EnableWindow(!m_bIgnoreFolders); |
| |
735 |
729 |
} |
| |
736 |
730 |
|
| |
737 |
|
void CCustomCopyDlg::OnFiltersCheck() |
| |
738 |
|
{ |
| |
739 |
|
EnableControls(); |
| |
740 |
|
} |
| |
741 |
|
|
| |
742 |
|
void CCustomCopyDlg::OnStandardCheck() |
| |
743 |
|
{ |
| |
744 |
|
EnableControls(); |
| |
745 |
|
} |
| |
746 |
|
|
| |
747 |
|
void CCustomCopyDlg::OnAdvancedCheck() |
| |
748 |
|
{ |
| |
749 |
|
EnableControls(); |
| |
750 |
|
} |
| |
751 |
|
|
| |
752 |
731 |
void CCustomCopyDlg::OnDblclkFiltersList(NMHDR* , LRESULT* pResult) |
| |
753 |
732 |
{ |
| |
754 |
733 |
POSITION pos = m_ctlFilters.GetFirstSelectedItemPosition(); |
| |
755 |
734 |
if(pos != nullptr) |
| |
756 |
735 |
{ |
| |
757 |
736 |
chengine::TFileFiltersArray& afFilters = m_tTaskDefinition.GetFilters(); |
| |
758 |
737 |
|
| |
759 |
738 |
int iItem = m_ctlFilters.GetNextSelectedItem(pos); |
| |
760 |
739 |
CFilterDlg dlg; |
| |
761 |
740 |
const chengine::TFileFilter& rFilter = afFilters.GetAt(iItem); |
| |
762 |
741 |
dlg.m_ffFilter = rFilter; |
| |
763 |
742 |
|
| |
764 |
743 |
for(size_t stIndex = 0; stIndex < afFilters.GetCount(); ++stIndex) |
| |
765 |
744 |
{ |
| |
766 |
745 |
const chengine::TFileFilter& rLoopFilter = afFilters.GetAt(stIndex); |
| |
767 |
746 |
if(rLoopFilter.GetUseMask() && boost::numeric_cast<int>(stIndex) != iItem) |
| |
768 |
747 |
dlg.m_astrAddMask.Add(rLoopFilter.GetCombinedMask().c_str()); |
| |
769 |
748 |
if (rLoopFilter.GetUseExcludeMask() && boost::numeric_cast<int>(stIndex) != iItem) |
| |
770 |
749 |
dlg.m_astrAddExcludeMask.Add(rLoopFilter.GetCombinedExcludeMask().c_str()); |
| |
771 |
750 |
} |
|
| |
930 |
909 |
strToken.TrimRight(_T("\" \t\r\n")); |
| |
931 |
910 |
|
| |
932 |
911 |
AddPath(strToken); |
| |
933 |
912 |
uiCount++; |
| |
934 |
913 |
|
| |
935 |
914 |
strToken = strData.Tokenize(_T("\n"), iPos); |
| |
936 |
915 |
} |
| |
937 |
916 |
|
| |
938 |
917 |
|
| |
939 |
918 |
ictranslate::CFormat fmt(GetResManager().LoadString(IDS_IMPORTREPORT_STRING)); |
| |
940 |
919 |
fmt.SetParam(_T("%count"), uiCount); |
| |
941 |
920 |
AfxMessageBox(fmt.ToString()); |
| |
942 |
921 |
} |
| |
943 |
922 |
} |
| |
944 |
923 |
|
| |
945 |
924 |
void CCustomCopyDlg::OnForcedirectoriesCheck() |
| |
946 |
925 |
{ |
| |
947 |
926 |
UpdateData(TRUE); |
| |
948 |
927 |
|
| |
949 |
928 |
GetDlgItem(IDC_IGNOREFOLDERS_CHECK)->EnableWindow(!m_bForceDirectories); |
| |
|
929 |
if(m_bForceDirectories) |
| |
|
930 |
{ |
| |
|
931 |
m_bIgnoreFolders = FALSE; |
| |
|
932 |
UpdateData(FALSE); |
| |
950 |
933 |
} |
| |
|
934 |
} |
| |
951 |
935 |
|
| |
|
936 |
void CCustomCopyDlg::OnExcludeEmptyDirectories() |
| |
|
937 |
{ |
| |
|
938 |
UpdateData(TRUE); |
| |
|
939 |
|
| |
|
940 |
GetDlgItem(IDC_IGNOREFOLDERS_CHECK)->EnableWindow(!m_bExcludeEmptyDirectories); |
| |
|
941 |
if(m_bExcludeEmptyDirectories) |
| |
|
942 |
{ |
| |
|
943 |
m_bIgnoreFolders = FALSE; |
| |
|
944 |
UpdateData(FALSE); |
| |
|
945 |
} |
| |
|
946 |
} |
| |
|
947 |
|
| |
952 |
948 |
void CCustomCopyDlg::OnIgnorefoldersCheck() |
| |
953 |
949 |
{ |
| |
954 |
950 |
UpdateData(TRUE); |
| |
955 |
951 |
|
| |
956 |
952 |
GetDlgItem(IDC_FORCEDIRECTORIES_CHECK)->EnableWindow(!m_bIgnoreFolders); |
| |
|
953 |
GetDlgItem(IDC_DONT_CREATE_EMPTY_DIRECTORIES_CHECK)->EnableWindow(!m_bIgnoreFolders); |
| |
|
954 |
|
| |
|
955 |
if(m_bIgnoreFolders) |
| |
|
956 |
{ |
| |
|
957 |
m_bForceDirectories = FALSE; |
| |
|
958 |
m_bExcludeEmptyDirectories = FALSE; |
| |
|
959 |
UpdateData(FALSE); |
| |
957 |
960 |
} |
| |
|
961 |
} |
| |
958 |
962 |
|
| |
959 |
963 |
void CCustomCopyDlg::OnExportButtonClicked() |
| |
960 |
964 |
{ |
| |
961 |
965 |
UpdateData(TRUE); |
| |
962 |
966 |
|
| |
963 |
967 |
if (!HasBasicTaskData()) |
| |
964 |
968 |
{ |
| |
965 |
969 |
MsgBox(IDS_MISSINGDATA_STRING); |
| |
966 |
970 |
return; |
| |
967 |
971 |
} |
| |
968 |
972 |
|
| |
969 |
973 |
UpdateInternalTaskDefinition(); |
| |
970 |
974 |
|
| |
971 |
975 |
CFileDialog dlg(FALSE, _T("xml"), _T("Task"), OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, GetResManager().LoadString(IDS_FLTALLFILTER_STRING)); |
| |
972 |
976 |
if (dlg.DoModal() == IDOK) |
| |
973 |
977 |
{ |
| |
974 |
978 |
CString strError; |
| |
975 |
979 |
try |
| |
976 |
980 |
{ |
| |
977 |
981 |
m_tTaskDefinition.Store(chcore::PathFromString(dlg.GetPathName())); |
|
| |
1003 |
1007 |
|
| |
1004 |
1008 |
m_tTaskDefinition.SetDestinationPath(chcore::PathFromString(strDstPath)); |
| |
1005 |
1009 |
|
| |
1006 |
1010 |
for (int i = 0; i < m_ctlFiles.GetItemCount(); i++) |
| |
1007 |
1011 |
{ |
| |
1008 |
1012 |
m_tTaskDefinition.AddSourcePath(chcore::PathFromString(m_ctlFiles.GetItemText(i, 0))); |
| |
1009 |
1013 |
} |
| |
1010 |
1014 |
|
| |
1011 |
1015 |
|
| |
1012 |
1016 |
m_tTaskDefinition.SetOperationType(m_ctlOperation.GetCurSel() == 0 ? chengine::eOperation_Copy : chengine::eOperation_Move); |
| |
1013 |
1017 |
|
| |
1014 |
1018 |
|
| |
1015 |
1019 |
m_tTaskDefinition.SetFeedbackRules(m_rules); |
| |
1016 |
1020 |
|
| |
1017 |
1021 |
|
| |
1018 |
1022 |
chengine::SetTaskPropValue<chengine::eTO_ThreadPriority>(m_tTaskDefinition.GetConfiguration(), IndexToPriority(m_ctlPriority.GetCurSel())); |
| |
1019 |
1023 |
|
| |
1020 |
1024 |
chengine::SetTaskPropValue<chengine::eTO_IgnoreDirectories>(m_tTaskDefinition.GetConfiguration(), (m_bIgnoreFolders != 0)); |
| |
1021 |
1025 |
chengine::SetTaskPropValue<chengine::eTO_CreateDirectoriesRelativeToRoot>(m_tTaskDefinition.GetConfiguration(), (m_bForceDirectories != 0)); |
| |
1022 |
1026 |
chengine::SetTaskPropValue<chengine::eTO_CreateEmptyFiles>(m_tTaskDefinition.GetConfiguration(), (m_bOnlyCreate != 0)); |
| |
|
1027 |
chengine::SetTaskPropValue<chengine::eTO_ExcludeEmptyDirectories>(m_tTaskDefinition.GetConfiguration(), (m_bExcludeEmptyDirectories != 0)); |
| |
1023 |
1028 |
} |
| |
1024 |
1029 |
|
| |
1025 |
1030 |
bool CCustomCopyDlg::HasBasicTaskData() |
| |
1026 |
1031 |
{ |
| |
1027 |
1032 |
CString strDstPath; |
| |
1028 |
1033 |
m_ctlDstPath.GetWindowText(strDstPath); |
| |
1029 |
1034 |
|
| |
1030 |
1035 |
if (strDstPath.IsEmpty() || m_ctlFiles.GetItemCount() == 0) |
| |
1031 |
1036 |
return false; |
| |
1032 |
1037 |
|
| |
1033 |
1038 |
return true; |
| |
1034 |
1039 |
} |
| |
1035 |
1040 |
|
| |
1036 |
1041 |
void CCustomCopyDlg::UpdateFilesListCtrlHeaderWidth() |
| |
1037 |
1042 |
{ |
| |
1038 |
1043 |
CRect rc; |
| |
1039 |
1044 |
m_ctlFiles.GetWindowRect(&rc); |
| |
1040 |
1045 |
rc.right -= GetSystemMetrics(SM_CXEDGE) * 2; |
| |
1041 |
1046 |
|
| |
1042 |
1047 |
|