From 1d3957c2fc9a641e2da4cc78e23e4ebda2e85424 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Sun, 3 Mar 2013 19:14:00 +0100 Subject: [PATCH] Remember the check state of the checkboxes in the TortoiseMerge find dialog, and also remember the last used search string Based on TortoiseSVN revision #23961. Signed-off-by: Sven Strickroth --- src/TortoiseMerge/FindDlg.cpp | 14 +++++++++++++- src/TortoiseMerge/FindDlg.h | 8 ++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/TortoiseMerge/FindDlg.cpp b/src/TortoiseMerge/FindDlg.cpp index 47fcd570f..94e8e5930 100644 --- a/src/TortoiseMerge/FindDlg.cpp +++ b/src/TortoiseMerge/FindDlg.cpp @@ -1,6 +1,6 @@ // TortoiseGitMerge - a Diff/Patch program -// Copyright (C) 2006, 2011-2012 - TortoiseSVN +// Copyright (C) 2006, 2011-2013 - TortoiseSVN // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -34,6 +34,9 @@ CFindDlg::CFindDlg(CWnd* pParent /*=NULL*/) , m_bLimitToDiffs(FALSE) , m_bWholeWord(FALSE) , m_FindMsg(0) + , m_regMatchCase(L"Software\\TortoiseGitMerge\\FindMatchCase", FALSE) + , m_regLimitToDiffs(L"Software\\TortoiseGitMerge\\FindLimitToDiffs", FALSE) + , m_regWholeWord(L"Software\\TortoiseGitMerge\\FindWholeWord", FALSE) { } @@ -77,6 +80,9 @@ void CFindDlg::OnOK() { UpdateData(); m_FindCombo.SaveHistory(); + m_regMatchCase = m_bMatchCase; + m_regLimitToDiffs = m_bLimitToDiffs; + m_regWholeWord = m_bWholeWord; if (m_FindCombo.GetString().IsEmpty()) return; @@ -93,8 +99,14 @@ BOOL CFindDlg::OnInitDialog() CDialog::OnInitDialog(); m_FindMsg = RegisterWindowMessage(FINDMSGSTRING); + m_bMatchCase = (BOOL)(DWORD)m_regMatchCase; + m_bLimitToDiffs = (BOOL)(DWORD)m_regLimitToDiffs; + m_bWholeWord = (BOOL)(DWORD)m_regWholeWord; + UpdateData(FALSE); + m_FindCombo.DisableTrimming(); m_FindCombo.LoadHistory(_T("Software\\TortoiseGitMerge\\History\\Find"), _T("Search")); + m_FindCombo.SetCurSel(0); m_FindCombo.SetFocus(); diff --git a/src/TortoiseMerge/FindDlg.h b/src/TortoiseMerge/FindDlg.h index 490d2a68c..86ad26d7e 100644 --- a/src/TortoiseMerge/FindDlg.h +++ b/src/TortoiseMerge/FindDlg.h @@ -1,6 +1,6 @@ // TortoiseGitMerge - a Diff/Patch program -// Copyright (C) 2006-2007, 2010 - TortoiseSVN +// Copyright (C) 2006-2007, 2010,2013 - TortoiseSVN // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -20,6 +20,7 @@ #include "resource.h" #include "afxcmn.h" #include "HistoryCombo.h" +#include "registry.h" /** * \ingroup TortoiseMerge @@ -39,7 +40,7 @@ public: bool LimitToDiffs() {return !!m_bLimitToDiffs;} bool WholeWord() {return !!m_bWholeWord;} CString GetFindString() {return m_FindCombo.GetString();} - void SetFindString(const CString& str) { m_FindCombo.SetWindowText(str); } + void SetFindString(const CString& str) { if (!str.IsEmpty()) { m_FindCombo.SetWindowText(str); } } // Dialog Data enum { IDD = IDD_FIND }; @@ -61,4 +62,7 @@ private: BOOL m_bWholeWord; CHistoryCombo m_FindCombo; CWnd * m_pParent; + CRegDWORD m_regMatchCase; + CRegDWORD m_regLimitToDiffs; + CRegDWORD m_regWholeWord; }; -- 2.11.4.GIT