From 48d63642ea04d046e68e3ae58e4bda1923286e3d Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Sun, 3 Mar 2013 20:04:02 +0100 Subject: [PATCH] LogDlg: Remember the check state of the checkboxes find dialog, and also remember the last used search string Inspired by TortoiseSVN rev. 23961. Signed-off-by: Sven Strickroth --- src/TortoiseProc/FindDlg.cpp | 12 +++++++++++- src/TortoiseProc/FindDlg.h | 5 +++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/TortoiseProc/FindDlg.cpp b/src/TortoiseProc/FindDlg.cpp index a9d44734e..de13bc77a 100644 --- a/src/TortoiseProc/FindDlg.cpp +++ b/src/TortoiseProc/FindDlg.cpp @@ -20,6 +20,7 @@ #include "stdafx.h" #include "resource.h" #include "FindDlg.h" +#include "registry.h" // CFindDlg dialog @@ -35,6 +36,8 @@ CFindDlg::CFindDlg(CWnd* pParent /*=NULL*/) , m_bWholeWord(FALSE) , m_bIsRef(false) , m_FindMsg(0) + , m_regMatchCase(L"Software\\TortoiseGit\\LogDialog\\FindMatchCase", FALSE) + , m_regWholeWord(L"Software\\TortoiseGit\\LogDialog\\FindWholeWord", FALSE) { m_pParent = pParent; } @@ -88,6 +91,9 @@ void CFindDlg::OnOK() UpdateData(); m_FindCombo.SaveHistory(); + m_regMatchCase = m_bMatchCase; + m_regWholeWord = m_bWholeWord; + if (m_FindCombo.GetString().IsEmpty()) return; m_bFindNext = true; @@ -107,8 +113,12 @@ BOOL CFindDlg::OnInitDialog() CDialog::OnInitDialog(); m_FindMsg = RegisterWindowMessage(FINDMSGSTRING); - m_FindCombo.LoadHistory(_T("Software\\TortoiseGit\\History\\Find"), _T("Search")); + m_bMatchCase = (BOOL)(DWORD)m_regMatchCase; + m_bWholeWord = (BOOL)(DWORD)m_regWholeWord; + UpdateData(FALSE); + m_FindCombo.LoadHistory(_T("Software\\TortoiseGit\\History\\Find"), _T("Search")); + m_FindCombo.SetCurSel(0); m_FindCombo.SetFocus(); this->AddAnchor(IDC_STATIC_FIND, TOP_LEFT, TOP_RIGHT); diff --git a/src/TortoiseProc/FindDlg.h b/src/TortoiseProc/FindDlg.h index 1a8ecdc46..3cfdb1889 100644 --- a/src/TortoiseProc/FindDlg.h +++ b/src/TortoiseProc/FindDlg.h @@ -5,6 +5,8 @@ #include "afxwin.h" #include "StandAloneDlg.h" #include "LoglistCommonResource.h" +#include "registry.h" + // CFindDlg dialog #define IDT_FILTER 101 @@ -24,6 +26,7 @@ public: bool WholeWord() {return !!m_bWholeWord;} bool IsRef() {return !!m_bIsRef;} CString GetFindString() {return m_FindString;} + void SetFindString(const CString& str) { if (!str.IsEmpty()) { m_FindCombo.SetWindowText(str); } } // Dialog Data enum { IDD = IDD_FIND }; @@ -49,6 +52,8 @@ protected: CString m_FindString; CWnd *m_pParent; STRING_VECTOR m_RefList; + CRegDWORD m_regMatchCase; + CRegDWORD m_regWholeWord; void AddToList(); -- 2.11.4.GIT