Index: src/ch/RuleEditAlreadyExistsDlg.cpp =================================================================== diff -u --- src/ch/RuleEditAlreadyExistsDlg.cpp (revision 0) +++ src/ch/RuleEditAlreadyExistsDlg.cpp (revision 1c585b955eb548cbedc7d36f1ea5af484206e7eb) @@ -0,0 +1,190 @@ +/*************************************************************************** +* Copyright (C) 2001-2020 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 "RuleEditAlreadyExistsDlg.h" +#include "resource.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// FeedbackRuleEditorDlg dialog + +RuleEditAlreadyExistsDlg::RuleEditAlreadyExistsDlg(const chengine::FeedbackAlreadyExistsRule& rRule) : + CLanguageDialog(IDD_RULE_EDIT_ALREADYEXISTS_DIALOG), + m_rule(rRule) +{ +} + +void RuleEditAlreadyExistsDlg::DoDataExchange(CDataExchange* pDX) +{ + CLanguageDialog::DoDataExchange(pDX); + + DDX_Check(pDX, IDC_INCLUDE_MASK_CHECK, m_bUseIncludeMask); + DDX_Control(pDX, IDC_INCLUDE_MASK_COMBO, m_ctlIncludeMask); + + DDX_Check(pDX, IDC_EXCLUDE_MASK_CHECK, m_bUseExcludeMask); + DDX_Control(pDX, IDC_EXCLUDE_MASK_COMBO, m_ctlExcludeMask); + + DDX_Check(pDX, IDC_FILTER_BY_DATE_CHECK, m_bUseDateCompareType); + DDX_Control(pDX, IDC_FILTER_BY_DATE_COMBO, m_ctlDateCompareType); + + DDX_Check(pDX, IDC_FILTER_BY_SIZE_CHECK, m_bUseSizeCompareType); + DDX_Control(pDX, IDC_FILTER_BY_SIZE_COMBO, m_ctlSizeCompareType); + + DDX_Control(pDX, IDC_RESPONSE_COMBO, m_ctlResponse); +} + +BEGIN_MESSAGE_MAP(RuleEditAlreadyExistsDlg,ictranslate::CLanguageDialog) + ON_BN_CLICKED(IDC_INCLUDE_MASK_CHECK, EnableControls) + ON_BN_CLICKED(IDC_EXCLUDE_MASK_CHECK, EnableControls) + ON_BN_CLICKED(IDC_FILTER_BY_DATE_CHECK, EnableControls) + ON_BN_CLICKED(IDC_FILTER_BY_SIZE_CHECK, EnableControls) +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// FeedbackRuleEditorDlg message handlers + +BOOL RuleEditAlreadyExistsDlg::OnInitDialog() +{ + CLanguageDialog::OnInitDialog(); + + // fill the combos with data + + // strings <, <=, ... + for(int iIndex = IDS_LT_STRING; iIndex <= IDS_DT_STRING; iIndex++) + { + const wchar_t* pszData = GetResManager().LoadString(iIndex); + m_ctlSizeCompareType.AddString(pszData); + m_ctlDateCompareType.AddString(pszData); + } + + // copy data from TFileFilter to a dialog - mask + m_bUseIncludeMask = m_rule.GetUseMask(); + + m_ctlIncludeMask.SetCurSel(m_ctlIncludeMask.AddString(m_rule.GetCombinedMask().c_str())); + for(int i = 0; i < m_astrAddMask.GetSize(); i++) + { + m_ctlIncludeMask.AddString(m_astrAddMask.GetAt(i)); + } + + m_bUseExcludeMask = m_rule.GetUseExcludeMask(); + m_ctlExcludeMask.SetCurSel(m_ctlExcludeMask.AddString(m_rule.GetCombinedExcludeMask().c_str())); + for(int i = 0; i < m_astrAddExcludeMask.GetSize(); i++) + { + m_ctlExcludeMask.AddString(m_astrAddExcludeMask.GetAt(i)); + } + + // size + m_bUseSizeCompareType = m_rule.GetUseSizeCompare(); + m_ctlSizeCompareType.SetCurSel(m_rule.GetSizeCompareType()); + + // date + m_bUseDateCompareType = m_rule.GetUseDateCompare(); + m_ctlDateCompareType.SetCurSel(m_rule.GetDateCompareType()); + + // response + for(int iIndex = IDS_FEEDBACK_RESPONSE_UNKNOWN; iIndex <= IDS_FEEDBACK_RESPONSE_RENAME; ++iIndex) + { + const wchar_t* pszData = GetResManager().LoadString(iIndex); + m_ctlResponse.AddString(pszData); + } + + UpdateData(FALSE); + + EnableControls(); + + return TRUE; +} + +void RuleEditAlreadyExistsDlg::OnLanguageChanged() +{ + // selection + int iSizeCompareTypeIndex = m_ctlSizeCompareType.GetCurSel(); + int iDateCompareTypeIndex = m_ctlDateCompareType.GetCurSel(); + int iResponseIndex = m_ctlResponse.GetCurSel(); + + m_ctlSizeCompareType.ResetContent(); + m_ctlDateCompareType.ResetContent(); + m_ctlResponse.ResetContent(); + + // strings <, <=, ... + for(int iIndex = IDS_LT_STRING; iIndex <= IDS_DT_STRING; iIndex++) + { + const wchar_t* pszData = GetResManager().LoadString(iIndex); + m_ctlSizeCompareType.AddString(pszData); + m_ctlDateCompareType.AddString(pszData); + } + + for(int iIndex = IDS_FEEDBACK_RESPONSE_UNKNOWN; iIndex <= IDS_FEEDBACK_RESPONSE_RENAME; ++iIndex) + { + const wchar_t* pszData = GetResManager().LoadString(iIndex); + m_ctlResponse.AddString(pszData); + } + + m_ctlSizeCompareType.SetCurSel(iSizeCompareTypeIndex); + m_ctlDateCompareType.SetCurSel(iDateCompareTypeIndex); + m_ctlResponse.SetCurSel(iResponseIndex); +} + +void RuleEditAlreadyExistsDlg::EnableControls() +{ + UpdateData(TRUE); + // mask + m_ctlIncludeMask.EnableWindow(m_bUseIncludeMask); + m_ctlExcludeMask.EnableWindow(m_bUseExcludeMask); + + // size + m_ctlSizeCompareType.EnableWindow(m_bUseSizeCompareType); + + // date + m_ctlDateCompareType.EnableWindow(m_bUseDateCompareType); +} + +void RuleEditAlreadyExistsDlg::OnOK() +{ + UpdateData(TRUE); + + // TFileFilter --> dialogu - mask + CString strText; + m_ctlIncludeMask.GetWindowText(strText); + m_rule.SetUseMask(((m_bUseIncludeMask != 0) && !strText.IsEmpty())); + m_rule.SetCombinedMask((PCTSTR)strText); + + m_ctlExcludeMask.GetWindowText(strText); + m_rule.SetUseExcludeMask((m_bUseExcludeMask != 0) && !strText.IsEmpty()); + m_rule.SetCombinedExcludeMask((PCTSTR)strText); + + // size + m_rule.SetUseSizeCompare(m_bUseSizeCompareType != 0); + m_rule.SetSizeCompareType((chengine::ECompareType)m_ctlSizeCompareType.GetCurSel()); + + // date + m_rule.SetUseDateCompare(m_bUseDateCompareType != 0); + m_rule.SetDateCompareType((chengine::ECompareType)m_ctlDateCompareType.GetCurSel()); + + // response + m_rule.SetResult((chengine::EFeedbackResult)m_ctlResponse.GetCurSel()); + + CLanguageDialog::OnOK(); +} Index: src/ch/RuleEditAlreadyExistsDlg.h =================================================================== diff -u --- src/ch/RuleEditAlreadyExistsDlg.h (revision 0) +++ src/ch/RuleEditAlreadyExistsDlg.h (revision 1c585b955eb548cbedc7d36f1ea5af484206e7eb) @@ -0,0 +1,60 @@ +/*************************************************************************** +* 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. * +***************************************************************************/ +#pragma once + +#include "../libchengine/FeedbackAlreadyExistsRule.h" + +///////////////////////////////////////////////////////////////////////////// +// FeedbackRuleEditorDlg dialog + +class RuleEditAlreadyExistsDlg : public ictranslate::CLanguageDialog +{ +// Construction +public: + RuleEditAlreadyExistsDlg(const chengine::FeedbackAlreadyExistsRule& rRule); + + chengine::FeedbackAlreadyExistsRule GetRule() const { return m_rule; } + +protected: + void OnLanguageChanged() override; + void EnableControls(); + + BOOL OnInitDialog() override; + void OnOK() override; + void DoDataExchange(CDataExchange* pDX) override; + + DECLARE_MESSAGE_MAP() + +private: + BOOL m_bUseIncludeMask = FALSE; + CComboBox m_ctlIncludeMask; + BOOL m_bUseExcludeMask = FALSE; + CComboBox m_ctlExcludeMask; + BOOL m_bUseDateCompareType = FALSE; + CComboBox m_ctlDateCompareType; + BOOL m_bUseSizeCompareType = FALSE; + CComboBox m_ctlSizeCompareType; + + CComboBox m_ctlResponse; + + chengine::FeedbackAlreadyExistsRule m_rule; + + CStringArray m_astrAddMask; + CStringArray m_astrAddExcludeMask; +}; Index: src/ch/RuleEditDlg.cpp =================================================================== diff -u --- src/ch/RuleEditDlg.cpp (revision 0) +++ src/ch/RuleEditDlg.cpp (revision 1c585b955eb548cbedc7d36f1ea5af484206e7eb) @@ -0,0 +1,712 @@ +/*************************************************************************** +* 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 "resource.h" +#include "RuleEditDlg.h" +#include "ch.h" +#include "RuleEditAlreadyExistsDlg.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +using namespace string; +using namespace chengine; + +RuleEditDlg::RuleEditDlg(const FeedbackRules& rRules) : + ictranslate::CLanguageDialog(IDD_RULE_EDIT_ALL_DIALOG), + m_rules(rRules) +{ +} + +void RuleEditDlg::DoDataExchange(CDataExchange* pDX) +{ + CLanguageDialog::DoDataExchange(pDX); + + DDX_Control(pDX, IDC_FILE_ALREADY_EXISTS_RULES_LIST, m_ctlAlreadyExistsRulesList); + DDX_Control(pDX, IDC_FILE_ERROR_RULES_LIST, m_ctlErrorRulesList); + DDX_Control(pDX, IDC_NOT_ENOUGH_SPACE_RULES_LIST, m_ctlNotEnoughSpaceRulesList); +} + +BEGIN_MESSAGE_MAP(RuleEditDlg, ictranslate::CLanguageDialog) + ON_BN_CLICKED(IDC_ALREADY_EXISTS_CHANGE_BUTTON, OnAlreadyExistsChangeButton) + ON_BN_CLICKED(IDC_ALREADY_EXISTS_ADD_BUTTON, OnAlreadyExistsAddButton) + ON_BN_CLICKED(IDC_ALREADY_EXISTS_REMOVE_BUTTON, OnAlreadyExistsRemoveButton) + + ON_BN_CLICKED(IDC_FILE_ERROR_CHANGE_BUTTON, OnErrorChangeButton) + ON_BN_CLICKED(IDC_FILE_ERROR_ADD_BUTTON, OnErrorAddButton) + ON_BN_CLICKED(IDC_FILE_ERROR_REMOVE_BUTTON, OnErrorRemoveButton) + + ON_BN_CLICKED(IDC_NOT_ENOUGH_SPACE_CHANGE_BUTTON, OnNotEnoughSpaceChangeButton) + ON_BN_CLICKED(IDC_NOT_ENOUGH_SPACE_ADD_BUTTON, OnNotEnoughSpaceAddButton) + ON_BN_CLICKED(IDC_NOT_ENOUGH_SPACE_REMOVE_BUTTON, OnNotEnoughSpaceRemoveButton) + + ON_NOTIFY(NM_DBLCLK, IDC_FILE_ALREADY_EXISTS_RULES_LIST, OnDblclkAlreadyExistsList) + ON_NOTIFY(NM_DBLCLK, IDC_FILE_ERROR_RULES_LIST, OnDblclkErrorList) + ON_NOTIFY(NM_DBLCLK, IDC_NOT_ENOUGH_SPACE_RULES_LIST, OnDblclkNotEnoughSpaceList) +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// RuleEditDlg message handlers +BOOL RuleEditDlg::OnInitDialog() +{ + CLanguageDialog::OnInitDialog(); + + // set dialog icon + HICON hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); + SetIcon(hIcon, FALSE); + + AddResizableControl(IDC_FILE_ALREADY_EXISTS_STATIC, 0.0, 0.0, 1.0, 0.0); + AddResizableControl(IDC_FILE_ALREADY_EXISTS_RULES_LIST, 0.0, 0.0, 1.0, 0.34); + AddResizableControl(IDC_ALREADY_EXISTS_CHANGE_BUTTON, 1.0, 0.34, 0.0, 0.0); + AddResizableControl(IDC_ALREADY_EXISTS_ADD_BUTTON, 1.0, 0.34, 0.0, 0.0); + AddResizableControl(IDC_ALREADY_EXISTS_REMOVE_BUTTON, 1.0, 0.34, 0.0, 0.0); + + AddResizableControl(IDC_FILE_ERROR_RULES_STATIC, 0.0, 0.34, 1.0, 0.0); + AddResizableControl(IDC_FILE_ERROR_RULES_LIST, 0.0, 0.34, 1.0, 0.33); + AddResizableControl(IDC_FILE_ERROR_CHANGE_BUTTON, 1.0, 0.67, 0.0, 0.0); + AddResizableControl(IDC_FILE_ERROR_ADD_BUTTON, 1.0, 0.67, 0.0, 0.0); + AddResizableControl(IDC_FILE_ERROR_REMOVE_BUTTON, 1.0, 0.67, 0.0, 0.0); + + AddResizableControl(IDC_NOT_ENOUGH_SPACE_STATIC, 0.0, 0.67, 1.0, 0.0); + AddResizableControl(IDC_NOT_ENOUGH_SPACE_RULES_LIST, 0.0, 0.67, 1.0, 0.33); + AddResizableControl(IDC_NOT_ENOUGH_SPACE_CHANGE_BUTTON, 1.0, 1.0, 0.0, 0.0); + AddResizableControl(IDC_NOT_ENOUGH_SPACE_ADD_BUTTON, 1.0, 1.0, 0.0, 0.0); + AddResizableControl(IDC_NOT_ENOUGH_SPACE_REMOVE_BUTTON, 1.0, 1.0, 0.0, 0.0); + + AddResizableControl(IDOK, 1.0, 1.0, 0.0, 0.0); + AddResizableControl(IDCANCEL, 1.0, 1.0, 0.0, 0.0); + + InitializeResizableControls(); + + // styles + m_ctlAlreadyExistsRulesList.SetExtendedStyle(m_ctlAlreadyExistsRulesList.GetExtendedStyle() | LVS_EX_FULLROWSELECT); + m_ctlErrorRulesList.SetExtendedStyle(m_ctlErrorRulesList.GetExtendedStyle() | LVS_EX_FULLROWSELECT); + m_ctlNotEnoughSpaceRulesList.SetExtendedStyle(m_ctlNotEnoughSpaceRulesList.GetExtendedStyle() | LVS_EX_FULLROWSELECT); + + // init columns in lists + InitAlreadyExistsColumns(); + InitErrorColumns(); + InitNotEnoughSpaceColumns(); + + UpdateData(FALSE); + + return TRUE; +} + +void RuleEditDlg::InitAlreadyExistsColumns() +{ + CRect rc; + m_ctlAlreadyExistsRulesList.GetWindowRect(&rc); + rc.right -= GetSystemMetrics(SM_CXEDGE) * 2; + + LVCOLUMN lvc; + lvc.mask = LVCF_FMT | LVCF_SUBITEM | LVCF_TEXT | LVCF_WIDTH; + lvc.fmt = LVCFMT_LEFT; + + // mask + lvc.iSubItem = -1; + lvc.pszText = (PTSTR)GetResManager().LoadString(IDS_HDRMASK_STRING); + lvc.cchTextMax = lstrlen(lvc.pszText); + lvc.cx = static_cast(0.15 * rc.Width()); + m_ctlAlreadyExistsRulesList.InsertColumn(1, &lvc); + + // exclude mask + lvc.iSubItem = 0; + lvc.pszText = (PTSTR)GetResManager().LoadString(IDS_HDREXCLUDEMASK_STRING); + lvc.cchTextMax = lstrlen(lvc.pszText); + lvc.cx = static_cast(0.15 * rc.Width()); + m_ctlAlreadyExistsRulesList.InsertColumn(2, &lvc); + + // size + lvc.iSubItem = 1; + lvc.pszText = (PTSTR)GetResManager().LoadString(IDS_HDRSIZE_STRING); + lvc.cchTextMax = lstrlen(lvc.pszText); + lvc.cx = static_cast(0.3 * rc.Width()); + m_ctlAlreadyExistsRulesList.InsertColumn(3, &lvc); + + // time + lvc.iSubItem = 2; + lvc.pszText = (PTSTR)GetResManager().LoadString(IDS_HDRDATE_STRING); + lvc.cchTextMax = lstrlen(lvc.pszText); + lvc.cx = static_cast(0.3 * rc.Width()); + m_ctlAlreadyExistsRulesList.InsertColumn(4, &lvc); + + // attributes + lvc.iSubItem = 3; + lvc.pszText = (PTSTR)GetResManager().LoadString(IDS_HDRRESULT_STRING); + lvc.cchTextMax = lstrlen(lvc.pszText); + lvc.cx = static_cast(0.1 * rc.Width()); + m_ctlAlreadyExistsRulesList.InsertColumn(5, &lvc); +} + +void RuleEditDlg::InitErrorColumns() +{ + CRect rc; + m_ctlErrorRulesList.GetWindowRect(&rc); + rc.right -= GetSystemMetrics(SM_CXEDGE) * 2; + + LVCOLUMN lvc; + lvc.mask = LVCF_FMT | LVCF_SUBITEM | LVCF_TEXT | LVCF_WIDTH; + lvc.fmt = LVCFMT_LEFT; + + // mask + lvc.iSubItem = -1; + lvc.pszText = (PTSTR)GetResManager().LoadString(IDS_HDRMASK_STRING); + lvc.cchTextMax = lstrlen(lvc.pszText); + lvc.cx = static_cast(0.15 * rc.Width()); + m_ctlErrorRulesList.InsertColumn(1, &lvc); + + // exclude mask + lvc.iSubItem = 0; + lvc.pszText = (PTSTR)GetResManager().LoadString(IDS_HDREXCLUDEMASK_STRING); + lvc.cchTextMax = lstrlen(lvc.pszText); + lvc.cx = static_cast(0.15 * rc.Width()); + m_ctlErrorRulesList.InsertColumn(2, &lvc); + + // operation type + lvc.iSubItem = 1; + lvc.pszText = (PTSTR)GetResManager().LoadString(IDS_HDROPERATION_STRING); + lvc.cchTextMax = lstrlen(lvc.pszText); + lvc.cx = static_cast(0.3 * rc.Width()); + m_ctlErrorRulesList.InsertColumn(3, &lvc); + + // system error + lvc.iSubItem = 2; + lvc.pszText = (PTSTR)GetResManager().LoadString(IDS_HDRSYSTEMERROR_STRING); + lvc.cchTextMax = lstrlen(lvc.pszText); + lvc.cx = static_cast(0.3 * rc.Width()); + m_ctlErrorRulesList.InsertColumn(4, &lvc); + + // result + lvc.iSubItem = 3; + lvc.pszText = (PTSTR)GetResManager().LoadString(IDS_HDRRESULT_STRING); + lvc.cchTextMax = lstrlen(lvc.pszText); + lvc.cx = static_cast(0.1 * rc.Width()); + m_ctlErrorRulesList.InsertColumn(5, &lvc); +} + +void RuleEditDlg::InitNotEnoughSpaceColumns() +{ + CRect rc; + m_ctlNotEnoughSpaceRulesList.GetWindowRect(&rc); + rc.right -= GetSystemMetrics(SM_CXEDGE) * 2; + + LVCOLUMN lvc; + lvc.mask = LVCF_FMT | LVCF_SUBITEM | LVCF_TEXT | LVCF_WIDTH; + lvc.fmt = LVCFMT_LEFT; + + // mask + lvc.iSubItem = -1; + lvc.pszText = (PTSTR)GetResManager().LoadString(IDS_HDRMASK_STRING); + lvc.cchTextMax = lstrlen(lvc.pszText); + lvc.cx = static_cast(0.15 * rc.Width()); + m_ctlNotEnoughSpaceRulesList.InsertColumn(1, &lvc); + + // exclude mask + lvc.iSubItem = 0; + lvc.pszText = (PTSTR)GetResManager().LoadString(IDS_HDREXCLUDEMASK_STRING); + lvc.cchTextMax = lstrlen(lvc.pszText); + lvc.cx = static_cast(0.15 * rc.Width()); + m_ctlNotEnoughSpaceRulesList.InsertColumn(2, &lvc); + + // result + lvc.iSubItem = 1; + lvc.pszText = (PTSTR)GetResManager().LoadString(IDS_HDRRESULT_STRING); + lvc.cchTextMax = lstrlen(lvc.pszText); + lvc.cx = static_cast(0.1 * rc.Width()); + m_ctlNotEnoughSpaceRulesList.InsertColumn(5, &lvc); +} + +void RuleEditDlg::FillAlreadyExistsList() +{ + const auto& rRules = m_rules.GetAlreadyExistsRules(); + + m_ctlAlreadyExistsRulesList.DeleteAllItems(); + + for(size_t stIndex = 0; stIndex < rRules.GetCount(); ++stIndex) + { + const auto& rRule = rRules.GetAt(stIndex); + AddAlreadyExistsRule(rRule, boost::numeric_cast(stIndex)); + } +} + +void RuleEditDlg::FillErrorList() +{ + const auto& rRules = m_rules.GetErrorRules(); + + m_ctlErrorRulesList.DeleteAllItems(); + + for(size_t stIndex = 0; stIndex < rRules.GetCount(); ++stIndex) + { + const auto& rRule = rRules.GetAt(stIndex); + AddErrorRule(rRule, boost::numeric_cast(stIndex)); + } +} + +void RuleEditDlg::FillNotEnoughSpaceList() +{ + const auto& rRules = m_rules.GetNotEnoughSpaceRules(); + + m_ctlNotEnoughSpaceRulesList.DeleteAllItems(); + + for(size_t stIndex = 0; stIndex < rRules.GetCount(); ++stIndex) + { + const auto& rRule = rRules.GetAt(stIndex); + AddNotEnoughSpaceRule(rRule, boost::numeric_cast(stIndex)); + } +} + +void RuleEditDlg::AddAlreadyExistsRule(const FeedbackAlreadyExistsRule& rRule, int iPos) +{ + LVITEM lvi; + CString strLoaded; + + lvi.mask = LVIF_TEXT; + lvi.iItem = (iPos == -1) ? m_ctlAlreadyExistsRulesList.GetItemCount() : iPos; + + ///////////////////// + lvi.iSubItem = 0; + + if(rRule.GetUseMask()) + { + string::TString strData = rRule.GetCombinedMask(); + strLoaded = strData.c_str(); + } + else + strLoaded = L""; + + lvi.pszText = (PTSTR)(PCTSTR)strLoaded; + lvi.cchTextMax = lstrlen(lvi.pszText); + m_ctlAlreadyExistsRulesList.InsertItem(&lvi); + + ///////////////////// + lvi.iSubItem = 1; + + if(rRule.GetUseExcludeMask()) + { + string::TString strData = rRule.GetCombinedExcludeMask(); + strLoaded = strData.c_str(); + } + else + strLoaded = L""; + + lvi.pszText = (PTSTR)(PCTSTR)strLoaded; + lvi.cchTextMax = lstrlen(lvi.pszText); + m_ctlAlreadyExistsRulesList.SetItem(&lvi); + + ///////////////// + lvi.iSubItem = 2; + + TString strSrcFile = GetResManager().LoadString(IDS_SOURCE_FILE_STRING); + TString strDstFile = GetResManager().LoadString(IDS_SOURCE_FILE_STRING); + + if(rRule.GetUseSizeCompare()) + { + TString strOperator = GetResManager().LoadString(IDS_LT_STRING + rRule.GetSizeCompareType()); + + strLoaded.Format(_T("%s %s %s"), strSrcFile.c_str(), strOperator.c_str(), strDstFile.c_str()); + } + else + strLoaded = L""; + + lvi.pszText = (PTSTR)(PCTSTR)strLoaded; + lvi.cchTextMax = lstrlen(lvi.pszText); + m_ctlAlreadyExistsRulesList.SetItem(&lvi); + + /////////////////// + lvi.iSubItem = 3; + + if(rRule.GetUseDateCompare()) + { + TString strOperator = GetResManager().LoadString(IDS_LT_STRING + rRule.GetDateCompareType()); + + strLoaded.Format(_T("%s %s %s"), strSrcFile.c_str(), strOperator.c_str(), strDstFile.c_str()); + } + else + strLoaded = L""; + + lvi.pszText = (PTSTR)(PCTSTR)strLoaded; + lvi.cchTextMax = lstrlen(lvi.pszText); + m_ctlAlreadyExistsRulesList.SetItem(&lvi); + + ///////////////////// + lvi.iSubItem = 4; + strLoaded.Empty(); + + strLoaded = GetResManager().LoadString(IDS_FEEDBACK_RESPONSE_UNKNOWN + rRule.GetResult()); + + lvi.pszText = (PTSTR)(PCTSTR)strLoaded; + lvi.cchTextMax = lstrlen(lvi.pszText); + m_ctlAlreadyExistsRulesList.SetItem(&lvi); +} + +void RuleEditDlg::AddErrorRule(const FeedbackErrorRule& rRule, int iPos) +{ + LVITEM lvi; + CString strLoaded; + + lvi.mask = LVIF_TEXT; + lvi.iItem = (iPos == -1) ? m_ctlErrorRulesList.GetItemCount() : iPos; + + ///////////////////// + lvi.iSubItem = 0; + + if(rRule.GetUseMask()) + { + string::TString strData = rRule.GetCombinedMask(); + strLoaded = strData.c_str(); + } + else + strLoaded = L""; + + lvi.pszText = (PTSTR)(PCTSTR)strLoaded; + lvi.cchTextMax = lstrlen(lvi.pszText); + m_ctlErrorRulesList.InsertItem(&lvi); + + ///////////////////// + lvi.iSubItem = 1; + + if(rRule.GetUseExcludeMask()) + { + string::TString strData = rRule.GetCombinedExcludeMask(); + strLoaded = strData.c_str(); + } + else + strLoaded = L""; + + lvi.pszText = (PTSTR)(PCTSTR)strLoaded; + lvi.cchTextMax = lstrlen(lvi.pszText); + m_ctlErrorRulesList.SetItem(&lvi); + + ///////////////// + lvi.iSubItem = 2; + + TString strSrcFile = GetResManager().LoadString(IDS_SOURCE_FILE_STRING); + TString strDstFile = GetResManager().LoadString(IDS_SOURCE_FILE_STRING); + + if(rRule.GetUseErrorType()) + strLoaded = GetResManager().LoadString(IDS_OPERATION_DELETEERROR + rRule.GetErrorType()); + else + strLoaded = L""; + + lvi.pszText = (PTSTR)(PCTSTR)strLoaded; + lvi.cchTextMax = lstrlen(lvi.pszText); + m_ctlErrorRulesList.SetItem(&lvi); + + /////////////////// + lvi.iSubItem = 3; + + if(rRule.GetUseSystemErrorNo()) + strLoaded.Format(_T("%u"), rRule.GetSystemErrorNo()); + else + strLoaded = L""; + + lvi.pszText = (PTSTR)(PCTSTR)strLoaded; + lvi.cchTextMax = lstrlen(lvi.pszText); + m_ctlErrorRulesList.SetItem(&lvi); + + ///////////////////// + lvi.iSubItem = 4; + strLoaded.Empty(); + + strLoaded = GetResManager().LoadString(IDS_FEEDBACK_RESPONSE_UNKNOWN + rRule.GetResult()); + + lvi.pszText = (PTSTR)(PCTSTR)strLoaded; + lvi.cchTextMax = lstrlen(lvi.pszText); + m_ctlErrorRulesList.SetItem(&lvi); +} + +void RuleEditDlg::AddNotEnoughSpaceRule(const FeedbackNotEnoughSpaceRule& rRule, int iPos) +{ + LVITEM lvi; + CString strLoaded; + + lvi.mask = LVIF_TEXT; + lvi.iItem = (iPos == -1) ? m_ctlNotEnoughSpaceRulesList.GetItemCount() : iPos; + + ///////////////////// + lvi.iSubItem = 0; + + if(rRule.GetUseMask()) + { + string::TString strData = rRule.GetCombinedMask(); + strLoaded = strData.c_str(); + } + else + strLoaded = L""; + + lvi.pszText = (PTSTR)(PCTSTR)strLoaded; + lvi.cchTextMax = lstrlen(lvi.pszText); + m_ctlNotEnoughSpaceRulesList.InsertItem(&lvi); + + ///////////////////// + lvi.iSubItem = 1; + + if(rRule.GetUseExcludeMask()) + { + string::TString strData = rRule.GetCombinedExcludeMask(); + strLoaded = strData.c_str(); + } + else + strLoaded = L""; + + lvi.pszText = (PTSTR)(PCTSTR)strLoaded; + lvi.cchTextMax = lstrlen(lvi.pszText); + m_ctlNotEnoughSpaceRulesList.SetItem(&lvi); + + ///////////////////// + lvi.iSubItem = 2; + strLoaded.Empty(); + + strLoaded = GetResManager().LoadString(IDS_FEEDBACK_RESPONSE_UNKNOWN + rRule.GetResult()); + + lvi.pszText = (PTSTR)(PCTSTR)strLoaded; + lvi.cchTextMax = lstrlen(lvi.pszText); + m_ctlNotEnoughSpaceRulesList.SetItem(&lvi); +} + +void RuleEditDlg::OnLanguageChanged() +{ + UpdateData(TRUE); + + m_ctlAlreadyExistsRulesList.DeleteAllItems(); + m_ctlErrorRulesList.DeleteAllItems(); + m_ctlNotEnoughSpaceRulesList.DeleteAllItems(); + + while(m_ctlAlreadyExistsRulesList.DeleteColumn(0)); + while(m_ctlErrorRulesList.DeleteColumn(0)); + while(m_ctlNotEnoughSpaceRulesList.DeleteColumn(0)); + + InitAlreadyExistsColumns(); + InitErrorColumns(); + InitNotEnoughSpaceColumns(); + + // refresh the entries in filters' list + FillAlreadyExistsList(); + FillErrorList(); + FillNotEnoughSpaceList(); +} + +void RuleEditDlg::OnOK() +{ + UpdateData(TRUE); + + CLanguageDialog::OnOK(); +} + +void RuleEditDlg::OnDblclkAlreadyExistsList(NMHDR* /*pNMHDR*/, LRESULT* pResult) +{ + OnAlreadyExistsChangeButton(); + *pResult = 0; +} + +void RuleEditDlg::OnAlreadyExistsChangeButton() +{ + POSITION pos = m_ctlAlreadyExistsRulesList.GetFirstSelectedItemPosition(); + if(pos != nullptr) + { + FeedbackAlreadyExistsRuleList& rRules = m_rules.GetAlreadyExistsRules(); + + int iItem = m_ctlAlreadyExistsRulesList.GetNextSelectedItem(pos); + if(iItem < 0) + return; + + auto& rRule = rRules.GetAt(iItem); + + RuleEditAlreadyExistsDlg dlg(rRule); + if(dlg.DoModal() == IDOK) + { + // delete old element + m_ctlAlreadyExistsRulesList.DeleteItem(iItem); + + rRule = dlg.GetRule(); + AddAlreadyExistsRule(rRule, iItem); + } + } +} + +void RuleEditDlg::OnAlreadyExistsAddButton() +{ + FeedbackAlreadyExistsRule newRule; + + RuleEditAlreadyExistsDlg dlg(newRule); + if(dlg.DoModal() == IDOK) + { + const auto& rRule = dlg.GetRule(); + m_rules.GetAlreadyExistsRules().Add(rRule); + AddAlreadyExistsRule(rRule, -1); + } +} + +void RuleEditDlg::OnAlreadyExistsRemoveButton() +{ + FeedbackAlreadyExistsRuleList& rRules = m_rules.GetAlreadyExistsRules(); + + while(true) + { + POSITION pos = m_ctlAlreadyExistsRulesList.GetFirstSelectedItemPosition(); + if(pos == nullptr) + break; + + int iItem = m_ctlAlreadyExistsRulesList.GetNextSelectedItem(pos); + if(iItem < 0) + return; + + m_ctlAlreadyExistsRulesList.DeleteItem(iItem); + rRules.RemoveAt(iItem); + } +} + +void RuleEditDlg::OnDblclkErrorList(NMHDR* /*pNMHDR*/, LRESULT* pResult) +{ + OnErrorChangeButton(); + *pResult = 0; +} + +void RuleEditDlg::OnErrorChangeButton() +{ + POSITION pos = m_ctlErrorRulesList.GetFirstSelectedItemPosition(); + if(pos != nullptr) + { + FeedbackErrorRuleList& rRules = m_rules.GetErrorRules(); + + int iItem = m_ctlErrorRulesList.GetNextSelectedItem(pos); + if(iItem < 0) + return; + + auto& rRule = rRules.GetAt(iItem); + rRule; + +/* + RuleEditErrorDlg dlg(rRule); + if(dlg.DoModal() == IDOK) + { + // delete old element + m_ctlErrorRulesList.DeleteItem(iItem); + + rRule = dlg.GetRule(); + AddErrorRule(rRule, iItem); + } +*/ + } +} + +void RuleEditDlg::OnErrorAddButton() +{ + FeedbackErrorRule newRule; + +/* + RuleEditErrorDlg dlg(newRule); + if(dlg.DoModal() == IDOK) + { + const auto& rRule = dlg.GetRule(); + m_rules.GetErrorRules().Add(rRule); + AddErrorRule(rRule, -1); + } +*/ +} + +void RuleEditDlg::OnErrorRemoveButton() +{ + FeedbackErrorRuleList& rRules = m_rules.GetErrorRules(); + + while(true) + { + POSITION pos = m_ctlErrorRulesList.GetFirstSelectedItemPosition(); + if(pos == nullptr) + break; + + int iItem = m_ctlErrorRulesList.GetNextSelectedItem(pos); + if(iItem < 0) + return; + + m_ctlErrorRulesList.DeleteItem(iItem); + rRules.RemoveAt(iItem); + } +} + +void RuleEditDlg::OnDblclkNotEnoughSpaceList(NMHDR* /*pNMHDR*/, LRESULT* pResult) +{ + OnNotEnoughSpaceChangeButton(); + *pResult = 0; +} + +void RuleEditDlg::OnNotEnoughSpaceChangeButton() +{ + POSITION pos = m_ctlNotEnoughSpaceRulesList.GetFirstSelectedItemPosition(); + if(pos != nullptr) + { + FeedbackErrorRuleList& rRules = m_rules.GetErrorRules(); + + int iItem = m_ctlNotEnoughSpaceRulesList.GetNextSelectedItem(pos); + if(iItem < 0) + return; + + auto& rRule = rRules.GetAt(iItem); + rRule; +/* + RuleEditNotEnoughSpaceDlg dlg(rRule); + if(dlg.DoModal() == IDOK) + { + // delete old element + m_ctlNotEnoughSpaceRulesList.DeleteItem(iItem); + + rRule = dlg.GetRule(); + AddNotEnoughSpaceRule(rRule, iItem); + } +*/ + } +} + +void RuleEditDlg::OnNotEnoughSpaceAddButton() +{ + FeedbackErrorRule newRule; + +/* + RuleEditNotEnoughSpaceDlg dlg(newRule); + if(dlg.DoModal() == IDOK) + { + const auto& rRule = dlg.GetRule(); + m_rules.GetNotEnoughSpaceRules().Add(rRule); + AddNotEnoughSpaceRule(rRule, -1); + } +*/ +} + +void RuleEditDlg::OnNotEnoughSpaceRemoveButton() +{ + FeedbackNotEnoughSpaceRuleList& rRules = m_rules.GetNotEnoughSpaceRules(); + + while(true) + { + POSITION pos = m_ctlNotEnoughSpaceRulesList.GetFirstSelectedItemPosition(); + if(pos == nullptr) + break; + + int iItem = m_ctlNotEnoughSpaceRulesList.GetNextSelectedItem(pos); + if(iItem < 0) + return; + + m_ctlNotEnoughSpaceRulesList.DeleteItem(iItem); + rRules.RemoveAt(iItem); + } +} Index: src/ch/RuleEditDlg.h =================================================================== diff -u --- src/ch/RuleEditDlg.h (revision 0) +++ src/ch/RuleEditDlg.h (revision 1c585b955eb548cbedc7d36f1ea5af484206e7eb) @@ -0,0 +1,82 @@ +/*************************************************************************** +* 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. * +***************************************************************************/ +#pragma once + +#include "CDragDropListCtrl.h" +#include "CDragDropComboEx.h" +#include "../libchengine/FeedbackRules.h" + +///////////////////////////////////////////////////////////////////////////// +// RuleEditDlg dialog + +class RuleEditDlg : public ictranslate::CLanguageDialog +{ +// Construction +public: + explicit RuleEditDlg(const chengine::FeedbackRules& rRules); + +// Overrides +protected: + void DoDataExchange(CDataExchange* pDX) override; // DDX/DDV support + +// Implementation +protected: + void OnLanguageChanged() override; + + // Generated message map functions + BOOL OnInitDialog() override; + + void InitAlreadyExistsColumns(); + void InitErrorColumns(); + void InitNotEnoughSpaceColumns(); + + void FillAlreadyExistsList(); + void FillErrorList(); + void FillNotEnoughSpaceList(); + + void AddAlreadyExistsRule(const chengine::FeedbackAlreadyExistsRule& rRule, int iPos); + void AddErrorRule(const chengine::FeedbackErrorRule& rRule, int iPos); + void AddNotEnoughSpaceRule(const chengine::FeedbackNotEnoughSpaceRule& rRule, int iPos); + + void OnOK() override; + + afx_msg void OnDblclkAlreadyExistsList(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnAlreadyExistsChangeButton(); + afx_msg void OnAlreadyExistsAddButton(); + afx_msg void OnAlreadyExistsRemoveButton(); + + afx_msg void OnDblclkErrorList(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnErrorChangeButton(); + afx_msg void OnErrorAddButton(); + afx_msg void OnErrorRemoveButton(); + + afx_msg void OnDblclkNotEnoughSpaceList(NMHDR* pNMHDR, LRESULT* pResult); + afx_msg void OnNotEnoughSpaceChangeButton(); + afx_msg void OnNotEnoughSpaceAddButton(); + afx_msg void OnNotEnoughSpaceRemoveButton(); + + DECLARE_MESSAGE_MAP() + +public: + chengine::FeedbackRules m_rules; + + CListCtrl m_ctlAlreadyExistsRulesList; + CListCtrl m_ctlErrorRulesList; + CListCtrl m_ctlNotEnoughSpaceRulesList; +}; Index: src/ch/ch.rc =================================================================== diff -u -rb9453afbc6264bc3f3c6a7f86fadab7744e0fb16 -r1c585b955eb548cbedc7d36f1ea5af484206e7eb --- src/ch/ch.rc (.../ch.rc) (revision b9453afbc6264bc3f3c6a7f86fadab7744e0fb16) +++ src/ch/ch.rc (.../ch.rc) (revision 1c585b955eb548cbedc7d36f1ea5af484206e7eb) @@ -427,7 +427,102 @@ LTEXT "Modified:",IDC_DST_TIME_STATIC,49,159,45,8 END +IDD_RULE_EDIT_ALREADYEXISTS_DIALOG DIALOGEX 0, 0, 291, 219 +STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "File already exists rule editor" +FONT 8, "Tahoma", 0, 0, 0x1 +BEGIN + CONTROL "Include mask (separate by vertical lines ie. *.jpg|*.gif)",IDC_INCLUDE_MASK_CHECK, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,23,277,10 + COMBOBOX IDC_INCLUDE_MASK_COMBO,15,35,269,98,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP + CONTROL "Exclude mask",IDC_EXCLUDE_MASK_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,51,277,10 + COMBOBOX IDC_EXCLUDE_MASK_COMBO,15,64,269,170,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP + CONTROL "Filtering by size",IDC_FILTER_BY_SIZE_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,82,277,10 + COMBOBOX IDC_FILTER_BY_SIZE_COMBO,122,95,50,135,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + CONTROL "Filtering by modification date",IDC_FILTER_BY_DATE_CHECK, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,113,277,10 + COMBOBOX IDC_FILTER_BY_DATE_COMBO,122,127,50,133,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "&OK",IDOK,179,198,50,14 + PUSHBUTTON "&Cancel",IDCANCEL,234,198,50,14 + CONTROL "",IDC_BOTTOM_BAR_STATIC,"Static",SS_ETCHEDHORZ,7,191,275,1 + LTEXT "When all of the following conditions are met...:",IDC_HEADER_STATIC,7,7,277,8 + LTEXT "...then respond with:",IDC_RESPONSE_STATIC,7,155,277,8 + COMBOBOX IDC_RESPONSE_COMBO,15,168,269,133,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + RTEXT "Size of source file",IDC_SOURCE_SIZE_STATIC,15,96,103,8 + LTEXT "size of destination file",IDC_DST_SIZE_STATIC,176,96,103,8 + RTEXT "Date of source file",IDC_SOURCE_DATE_STATIC,15,129,103,8 + LTEXT "date of destination file",IDC_DST_DATE_STATIC,176,129,103,8 +END +IDD_RULE_EDIT_ERROR_DIALOG DIALOGEX 0, 0, 291, 219 +STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "File error rule editor" +FONT 8, "Tahoma", 0, 0, 0x1 +BEGIN + CONTROL "Include mask (separate by vertical lines ie. *.jpg|*.gif)",IDC_INCLUDE_MASK_CHECK, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,23,277,10 + COMBOBOX IDC_INCLUDE_MASK_COMBO,15,35,269,98,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP + CONTROL "Exclude mask",IDC_EXCLUDE_MASK_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,51,277,10 + COMBOBOX IDC_EXCLUDE_MASK_COMBO,15,64,269,170,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP + CONTROL "Filtering by operation",IDC_FILTER_BY_OPERATION_CHECK, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,82,277,10 + COMBOBOX IDC_FILTER_BY_OPERATION_COMBO,15,96,269,135,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + CONTROL "Filtering by system error number",IDC_FILTER_BY_SYSTEMERROR_CHECK, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,113,277,10 + DEFPUSHBUTTON "&OK",IDOK,179,198,50,14 + PUSHBUTTON "&Cancel",IDCANCEL,234,198,50,14 + CONTROL "",IDC_001_STATIC,"Static",SS_ETCHEDHORZ,7,191,275,1 + LTEXT "When all of the following conditions are met...:",IDC_HEADER_STATIC,7,7,277,8 + LTEXT "...then respond with:",IDC_RESPONSE_STATIC,7,155,277,8 + COMBOBOX IDC_RESPONSE_COMBO,15,168,269,133,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + EDITTEXT IDC_FILTER_BY_SYSTEMERROR_EDIT,15,126,269,14,ES_AUTOHSCROLL +END + +IDD_RULE_EDIT_NOTENOUGHSPACE_DIALOG DIALOGEX 0, 0, 291, 157 +STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Not enough space rule editor" +FONT 8, "Tahoma", 0, 0, 0x1 +BEGIN + CONTROL "Include mask (separate by vertical lines ie. *.jpg|*.gif)",IDC_INCLUDE_MASK_CHECK, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,23,277,10 + COMBOBOX IDC_INCLUDE_MASK_COMBO,15,35,269,98,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP + CONTROL "Exclude mask",IDC_EXCLUDE_MASK_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,51,277,10 + COMBOBOX IDC_EXCLUDE_MASK_COMBO,15,64,269,170,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP + DEFPUSHBUTTON "&OK",IDOK,179,135,50,14 + PUSHBUTTON "&Cancel",IDCANCEL,234,135,50,14 + CONTROL "",IDC_BOTTOM_BAR_STATIC,"Static",SS_ETCHEDHORZ,7,128,274,1 + LTEXT "When all of the following conditions are met...:",IDC_HEADER_STATIC,7,7,277,8 + LTEXT "...then respond with:",IDC_RESPONSE_STATIC,7,92,277,8 + COMBOBOX IDC_RESPONSE_COMBO,15,105,269,133,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP +END + +IDD_RULE_EDIT_ALL_DIALOG DIALOGEX 0, 0, 351, 341 +STYLE DS_SETFONT | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +EXSTYLE WS_EX_APPWINDOW +CAPTION "Feedback rules editor" +FONT 8, "Tahoma", 0, 0, 0x1 +BEGIN + CONTROL "List2",IDC_FILE_ALREADY_EXISTS_RULES_LIST,"SysListView32",LVS_REPORT | WS_BORDER | WS_TABSTOP,7,18,337,65 + PUSHBUTTON "&OK",IDOK,239,320,50,14 + PUSHBUTTON "&Cancel",IDCANCEL,294,320,50,14 + CONTROL "",IDC_BOTTOM_BAR_STATIC,"Static",SS_ETCHEDHORZ,8,313,336,1 + PUSHBUTTON "Change...",IDC_ALREADY_EXISTS_CHANGE_BUTTON,184,87,50,14 + PUSHBUTTON "Remove",IDC_ALREADY_EXISTS_REMOVE_BUTTON,294,87,50,14 + LTEXT "File already exists rules:",IDC_FILE_ALREADY_EXISTS_STATIC,7,7,337,8 + CONTROL "",IDC_FILE_ERROR_RULES_LIST,"SysListView32",LVS_REPORT | WS_BORDER | WS_TABSTOP,7,119,337,65 + LTEXT "File error rules:",IDC_FILE_ERROR_RULES_STATIC,7,108,337,8 + CONTROL "",IDC_NOT_ENOUGH_SPACE_RULES_LIST,"SysListView32",LVS_REPORT | WS_BORDER | WS_TABSTOP,7,223,337,65 + LTEXT "Not enough space rules:",IDC_NOT_ENOUGH_SPACE_STATIC,7,212,337,8 + PUSHBUTTON "Add...",IDC_ALREADY_EXISTS_ADD_BUTTON,239,87,50,14 + PUSHBUTTON "Change...",IDC_FILE_ERROR_CHANGE_BUTTON,184,188,50,14 + PUSHBUTTON "Remove",IDC_FILE_ERROR_REMOVE_BUTTON,294,188,50,14 + PUSHBUTTON "Add...",IDC_FILE_ERROR_ADD_BUTTON,239,188,50,14 + PUSHBUTTON "Change...",IDC_NOT_ENOUGH_SPACE_CHANGE_BUTTON,184,292,50,14 + PUSHBUTTON "Remove",IDC_NOT_ENOUGH_SPACE_REMOVE_BUTTON,294,292,50,14 + PUSHBUTTON "Add...",IDC_NOT_ENOUGH_SPACE_ADD_BUTTON,239,292,50,14 +END + + ///////////////////////////////////////////////////////////////////////////// // // DESIGNINFO @@ -563,6 +658,38 @@ TOPMARGIN, 7 BOTTOMMARGIN, 216 END + + IDD_RULE_EDIT_ALREADYEXISTS_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 284 + TOPMARGIN, 7 + BOTTOMMARGIN, 212 + END + + IDD_RULE_EDIT_ERROR_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 284 + TOPMARGIN, 7 + BOTTOMMARGIN, 212 + END + + IDD_RULE_EDIT_NOTENOUGHSPACE_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 284 + TOPMARGIN, 7 + BOTTOMMARGIN, 150 + END + + IDD_RULE_EDIT_ALL_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 344 + TOPMARGIN, 7 + BOTTOMMARGIN, 334 + END END #endif // APSTUDIO_INVOKED @@ -676,7 +803,27 @@ 0 END +IDD_RULE_EDIT_ALREADYEXISTS_DIALOG AFX_DIALOG_LAYOUT +BEGIN + 0 +END +IDD_RULE_EDIT_ERROR_DIALOG AFX_DIALOG_LAYOUT +BEGIN + 0 +END + +IDD_RULE_EDIT_NOTENOUGHSPACE_DIALOG AFX_DIALOG_LAYOUT +BEGIN + 0 +END + +IDD_RULE_EDIT_ALL_DIALOG AFX_DIALOG_LAYOUT +BEGIN + 0 +END + + ///////////////////////////////////////////////////////////////////////////// // // Icon @@ -1265,8 +1412,18 @@ IDS_EQ_STRING "=" IDS_GE_STRING ">=" IDS_GT_STRING ">" + IDS_DT_STRING "<>" IDS_UPDATER_NEW_VERSION_STRING "Updated version: %officialver (%numericver).\nReleased: %reldate" + IDS_FEEDBACK_RESPONSE_UNKNOWN "Unknown" + IDS_FEEDBACK_RESPONSE_OVERWRITE "Replace" + IDS_FEEDBACK_RESPONSE_RESUME "Resume" + IDS_FEEDBACK_RESPONSE_SKIP "Skip" + IDS_FEEDBACK_RESPONSE_CANCEL "Cancel" + IDS_FEEDBACK_RESPONSE_PAUSE "Pause" + IDS_FEEDBACK_RESPONSE_RETRY "Retry" + IDS_FEEDBACK_RESPONSE_IGNORE "Ignore" + IDS_FEEDBACK_RESPONSE_RENAME "Rename" END STRINGTABLE @@ -1342,14 +1499,33 @@ IDS_FILTERDATE_STRING "any" IDS_HDREXCLUDEMASK_STRING "Exclude mask" IDS_HDREXCLUDEATTRIB_STRING "Attributes excluded" + IDS_HDRRESULT_STRING "Response" + IDS_HDROPERATION_STRING "Operation" + IDS_HDRSYSTEMERROR_STRING "System error" IDS_FILTERATTRIB_STRING "none" IDS_EMPTYFILTER_STRING "None of filtering options were selected" IDS_FLTALLFILTER_STRING "All files (*.*)|*.*||" IDS_IMPORTREPORT_STRING "Imported %count path(s)" + IDS_SOURCE_FILE_STRING "source" + IDS_DESTINATION_FILE_STRING "destination" END STRINGTABLE BEGIN + IDS_OPERATION_DELETEERROR "Delete" + IDS_OPERATION_SEEKERROR "Seek" + IDS_OPERATION_RESIZEERROR "Resize" + IDS_OPERATION_READERROR "Read" + IDS_OPERATION_WRITEERROR "Write" + IDS_OPERATION_FINALIZEERROR "Finalize" + IDS_OPERATION_FASTMOVEERROR "Fast move" + IDS_OPERATION_CREATEERROR "Create" + IDS_OPERATION_CHECKFORFREESPACE "Check for free space" + IDS_OPERATION_RETRIEVEFILEINFO "Retrieve file information" +END + +STRINGTABLE +BEGIN IDS_IMPORTERROR_STRING "Cannot import paths from the specified file" IDS_ERROR_INITIALIZING_COMMON_CONTROLS "Cannot initialize common controls. The application will now exit." Index: src/ch/ch.vc140.vcxproj =================================================================== diff -u -r547f865c69434c14c6f16e4b529d4198f6fe2040 -r1c585b955eb548cbedc7d36f1ea5af484206e7eb --- src/ch/ch.vc140.vcxproj (.../ch.vc140.vcxproj) (revision 547f865c69434c14c6f16e4b529d4198f6fe2040) +++ src/ch/ch.vc140.vcxproj (.../ch.vc140.vcxproj) (revision 1c585b955eb548cbedc7d36f1ea5af484206e7eb) @@ -561,6 +561,8 @@ + + @@ -638,6 +640,8 @@ + + Index: src/ch/ch.vc140.vcxproj.filters =================================================================== diff -u -r547f865c69434c14c6f16e4b529d4198f6fe2040 -r1c585b955eb548cbedc7d36f1ea5af484206e7eb --- src/ch/ch.vc140.vcxproj.filters (.../ch.vc140.vcxproj.filters) (revision 547f865c69434c14c6f16e4b529d4198f6fe2040) +++ src/ch/ch.vc140.vcxproj.filters (.../ch.vc140.vcxproj.filters) (revision 1c585b955eb548cbedc7d36f1ea5af484206e7eb) @@ -58,6 +58,9 @@ {7a5ae1dd-a331-406c-a572-4997184a5725} + + {8c3e3738-a438-429e-8ad7-0dc13303f711} + @@ -252,6 +255,12 @@ Resource Files + + Source Files\GUI\Dialogs\Feedback rule editor + + + Source Files\GUI\Dialogs\Feedback rule editor + @@ -434,6 +443,12 @@ Source Files\Tools + + Source Files\GUI\Dialogs\Feedback rule editor + + + Source Files\GUI\Dialogs\Feedback rule editor + Index: src/ch/resource.h =================================================================== diff -u -rb9453afbc6264bc3f3c6a7f86fadab7744e0fb16 -r1c585b955eb548cbedc7d36f1ea5af484206e7eb --- src/ch/resource.h (.../resource.h) (revision b9453afbc6264bc3f3c6a7f86fadab7744e0fb16) +++ src/ch/resource.h (.../resource.h) (revision 1c585b955eb548cbedc7d36f1ea5af484206e7eb) @@ -58,6 +58,10 @@ #define IDR_FEEDBACK_MASS_SKIP_MENU 226 #define IDR_FEEDBACK_MASS_RENAME_MENU 228 #define IDR_FEEDBACK_MASS_RESUME_MENU 230 +#define IDD_RULE_EDIT_ALREADYEXISTS_DIALOG 231 +#define IDD_RULE_EDIT_ERROR_DIALOG 232 +#define IDD_RULE_EDIT_NOTENOUGHSPACE_DIALOG 233 +#define IDD_RULE_EDIT_ALL_DIALOG 234 #define IDC_PROGRAM_STATIC 1000 #define IDC_ADDFILE_BUTTON 1002 #define IDC_STATUS_LIST 1003 @@ -76,7 +80,9 @@ #define IDC_TASKCOUNT_PROGRESS 1010 #define IDC_ADDDIR_BUTTON 1011 #define IDC_CURRENTOBJECT_PROGRESS 1011 +#define IDC_FILE_ERROR_RULES_LIST 1011 #define IDC_BUFFERSIZES_LIST 1012 +#define IDC_NOT_ENOUGH_SPACE_RULES_LIST 1012 #define IDC_SET_BUFFERSIZE_BUTTON 1013 #define IDC_FILTERS_CHECK 1014 #define IDC_IGNOREFOLDERS_CHECK 1015 @@ -395,7 +401,39 @@ #define IDC_DST_SIZE_STATIC 1384 #define IDC_DST_TIME_STATIC 1385 #define IDC_DST_RENAME_EDIT 1387 +#define IDC_FILTER_BY_SYSTEMERROR_EDIT 1387 #define IDC_DST_RENAME_STATIC 1388 +#define IDC_ALREADY_EXISTS_CHANGE_BUTTON 1388 +#define IDC_ALREADY_EXISTS_REMOVE_BUTTON 1389 +#define IDC_FILE_ALREADY_EXISTS_STATIC 1390 +#define IDC_FILE_ERROR_RULES_STATIC 1391 +#define IDC_NOT_ENOUGH_SPACE_STATIC 1392 +#define IDC_FILE_ALREADY_EXISTS_RULES_LIST 1393 +#define IDC_ALREADY_EXISTS_ADD_BUTTON 1394 +#define IDC_FILE_ERROR_CHANGE_BUTTON 1395 +#define IDC_FILE_ERROR_REMOVE_BUTTON 1396 +#define IDC_FILE_ERROR_ADD_BUTTON 1397 +#define IDC_NOT_ENOUGH_SPACE_CHANGE_BUTTON 1398 +#define IDC_NOT_ENOUGH_SPACE_REMOVE_BUTTON 1399 +#define IDC_NOT_ENOUGH_SPACE_ADD_BUTTON 1400 +#define IDC_BOTTOM_BAR_STATIC 1401 +#define IDC_INCLUDE_MASK_CHECK 1402 +#define IDC_INCLUDE_MASK_COMBO 1403 +#define IDC_EXCLUDE_MASK_CHECK 1404 +#define IDC_EXCLUDE_MASK_COMBO 1405 +#define IDC_FILTER_BY_SIZE_CHECK 1406 +#define IDC_FILTER_BY_SIZE_COMBO 1407 +#define IDC_FILTER_BY_DATE_CHECK 1408 +#define IDC_FILTER_BY_DATE_COMBO 1409 +#define IDC_RESPONSE_STATIC 1410 +#define IDC_RESPONSE_COMBO 1411 +#define IDC_FILTER_BY_OPERATION_CHECK 1412 +#define IDC_FILTER_BY_OPERATION_COMBO 1413 +#define IDC_FILTER_BY_SYSTEMERROR_CHECK 1414 +#define IDC_SOURCE_SIZE_STATIC 1415 +#define IDC_DESTINATION_SIZE_STATIC 1416 +#define IDC_SOURCE_DATE_STATIC 1417 +#define IDC_DST_DATE_STATIC 1418 #define IDS_APPNAME_STRING 5000 #define IDS_PRIORITY0_STRING 5001 #define IDS_PRIORITY1_STRING 5002 @@ -418,7 +456,8 @@ #define IDS_EQ_STRING 5019 #define IDS_GE_STRING 5020 #define IDS_GT_STRING 5021 -#define IDS_UPDATER_NEW_VERSION_STRING 5022 +#define IDS_DT_STRING 5022 +#define IDS_UPDATER_NEW_VERSION_STRING 5023 #define IDS_UPDATER_EQUAL_VERSION_STRING 5024 #define IDS_UPDATER_ERROR_STRING 5025 #define IDS_UPDATER_WAITING_STRING 5026 @@ -444,6 +483,17 @@ #define IDS_UPDATER_NEWVERSIONEXISTS 5048 #define IDS_UPDATER_RELEASENOTES 5049 #define IDS_FINALIZE_CH_ERROR 5050 + +#define IDS_FEEDBACK_RESPONSE_UNKNOWN 5051 +#define IDS_FEEDBACK_RESPONSE_OVERWRITE 5052 +#define IDS_FEEDBACK_RESPONSE_RESUME 5053 +#define IDS_FEEDBACK_RESPONSE_SKIP 5054 +#define IDS_FEEDBACK_RESPONSE_CANCEL 5055 +#define IDS_FEEDBACK_RESPONSE_PAUSE 5056 +#define IDS_FEEDBACK_RESPONSE_RETRY 5057 +#define IDS_FEEDBACK_RESPONSE_IGNORE 5058 +#define IDS_FEEDBACK_RESPONSE_RENAME 5059 + #define IDS_ONECOPY_STRING 6000 #define IDS_REGISTEROK_STRING 6001 #define IDS_REGISTERERR_STRING 6002 @@ -658,6 +708,23 @@ #define IDS_IMPORTERROR_STRING 15024 #define IDS_ERROR_INITIALIZING_COMMON_CONTROLS 15025 #define IDS_ERROR_INITIALIZING_RICH_EDIT_CONTROL 15026 +#define IDS_HDRRESULT_STRING 15027 +#define IDS_SOURCE_FILE_STRING 15028 +#define IDS_DESTINATION_FILE_STRING 15029 +#define IDS_HDROPERATION_STRING 15030 +#define IDS_HDRSYSTEMERROR_STRING 15031 + +#define IDS_OPERATION_DELETEERROR 15032 +#define IDS_OPERATION_SEEKERROR 15033 +#define IDS_OPERATION_RESIZEERROR 15034 +#define IDS_OPERATION_READERROR 15035 +#define IDS_OPERATION_WRITEERROR 15036 +#define IDS_OPERATION_FINALIZEERROR 15037 +#define IDS_OPERATION_FASTMOVEERROR 15038 +#define IDS_OPERATION_CREATEERROR 15039 +#define IDS_OPERATION_CHECKFORFREESPACE 15040 +#define IDS_OPERATION_RETRIEVEFILEINFO 15041 + #define IDS_NERPATH_STRING 16500 #define IDS_DATECREATED_STRING 18000 #define IDS_DATELASTWRITE_STRING 18001 @@ -753,9 +820,9 @@ #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_3D_CONTROLS 1 -#define _APS_NEXT_RESOURCE_VALUE 231 +#define _APS_NEXT_RESOURCE_VALUE 235 #define _APS_NEXT_COMMAND_VALUE 32833 -#define _APS_NEXT_CONTROL_VALUE 1387 +#define _APS_NEXT_CONTROL_VALUE 1419 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif