From 6d924dcc4363d171d5be1160d1f040552d9d1603 Mon Sep 17 00:00:00 2001 From: Tim Gerundt Date: Mon, 7 Oct 2019 23:58:45 +0200 Subject: [PATCH] Add "Ignore codepage differences" to quick options --- Src/MainFrm.cpp | 14 ++++++++++++++ Src/MainFrm.h | 2 ++ Src/Merge.rc | 1 + Src/resource.h | 1 + 4 files changed, 18 insertions(+) diff --git a/Src/MainFrm.cpp b/Src/MainFrm.cpp index e7a93b384b0..4e3ad11bfc3 100644 --- a/Src/MainFrm.cpp +++ b/Src/MainFrm.cpp @@ -223,6 +223,8 @@ BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd) ON_UPDATE_COMMAND_UI(IDC_DIFF_CASESENSITIVE, OnUpdateDiffCaseSensitive) ON_COMMAND(IDC_DIFF_IGNOREEOL, OnDiffIgnoreEOL) ON_UPDATE_COMMAND_UI(IDC_DIFF_IGNOREEOL, OnUpdateDiffIgnoreEOL) + ON_COMMAND(IDC_DIFF_IGNORECP, OnDiffIgnoreCP) + ON_UPDATE_COMMAND_UI(IDC_DIFF_IGNORECP, OnUpdateDiffIgnoreCP) ON_COMMAND(IDC_RECURS_CHECK, OnIncludeSubfolders) ON_UPDATE_COMMAND_UI(IDC_RECURS_CHECK, OnUpdateIncludeSubfolders) ON_COMMAND_RANGE(ID_COMPMETHOD_FULL_CONTENTS, ID_COMPMETHOD_SIZE, OnCompareMethod) @@ -2329,6 +2331,18 @@ void CMainFrame::OnUpdateDiffIgnoreEOL(CCmdUI* pCmdUI) pCmdUI->Enable(); } +void CMainFrame::OnDiffIgnoreCP() +{ + GetOptionsMgr()->SaveOption(OPT_CMP_IGNORE_CODEPAGE, !GetOptionsMgr()->GetBool(OPT_CMP_IGNORE_CODEPAGE)); + ApplyDiffOptions(); +} + +void CMainFrame::OnUpdateDiffIgnoreCP(CCmdUI* pCmdUI) +{ + pCmdUI->SetCheck(GetOptionsMgr()->GetBool(OPT_CMP_IGNORE_CODEPAGE)); + pCmdUI->Enable(); +} + void CMainFrame::OnIncludeSubfolders() { GetOptionsMgr()->SaveOption(OPT_CMP_INCLUDE_SUBDIRS, !GetOptionsMgr()->GetBool(OPT_CMP_INCLUDE_SUBDIRS)); diff --git a/Src/MainFrm.h b/Src/MainFrm.h index b4ccddb5a93..0b23a9b7f0f 100644 --- a/Src/MainFrm.h +++ b/Src/MainFrm.h @@ -289,6 +289,8 @@ class CMainFrame : public CMDIFrameWnd afx_msg void OnUpdateDiffCaseSensitive(CCmdUI* pCmdUI); afx_msg void OnDiffIgnoreEOL(); afx_msg void OnUpdateDiffIgnoreEOL(CCmdUI* pCmdUI); + afx_msg void OnDiffIgnoreCP(); + afx_msg void OnUpdateDiffIgnoreCP(CCmdUI* pCmdUI); afx_msg void OnIncludeSubfolders(); afx_msg void OnUpdateIncludeSubfolders(CCmdUI* pCmdUI); afx_msg void OnCompareMethod(UINT nID); diff --git a/Src/Merge.rc b/Src/Merge.rc index 24d61a5c0e7..5df506856d4 100644 --- a/Src/Merge.rc +++ b/Src/Merge.rc @@ -786,6 +786,7 @@ BEGIN END MENUITEM "Case sensi&tive", IDC_DIFF_CASESENSITIVE MENUITEM "Igno&re carriage return differences (Windows/Unix/Mac)", IDC_DIFF_IGNOREEOL + MENUITEM "Ignore codepage &differences", IDC_DIFF_IGNORECP MENUITEM SEPARATOR MENUITEM "&Include Subfolders", IDC_RECURS_CHECK POPUP "&Compare method:" diff --git a/Src/resource.h b/Src/resource.h index 03cf988e36c..0a48199c406 100644 --- a/Src/resource.h +++ b/Src/resource.h @@ -489,6 +489,7 @@ #define IDC_USE_DIR_COMPARE_COLORS 1364 #define IDC_PLUGIN_FILEFILTERS 1365 #define IDC_PLUGIN_FILEFILTERS_DEFAULTS 1366 +#define IDC_DIFF_IGNORECP 1377 #define IDC_EDIT_WHOLE_WORD 8603 #define IDC_EDIT_MATCH_CASE 8604 #define IDC_EDIT_FINDTEXT 8605