From 8b4e9b9479607ed70eb86f47101ae77cb3e7e247 Mon Sep 17 00:00:00 2001 From: Sup Yut Sum Date: Sat, 11 Oct 2014 22:04:14 +0800 Subject: [PATCH] Refresh find dialog ref list when reloading log list refs Signed-off-by: Sup Yut Sum --- src/TortoiseProc/FindDlg.cpp | 8 +++++++- src/TortoiseProc/FindDlg.h | 1 + src/TortoiseProc/GitLogListAction.cpp | 4 ++++ src/TortoiseProc/GitLogListBase.cpp | 2 ++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/TortoiseProc/FindDlg.cpp b/src/TortoiseProc/FindDlg.cpp index 721c649d7..e87e38c76 100644 --- a/src/TortoiseProc/FindDlg.cpp +++ b/src/TortoiseProc/FindDlg.cpp @@ -147,10 +147,16 @@ BOOL CFindDlg::OnInitDialog() m_ctrlRefList.GetClientRect(&rect); this->m_ctrlRefList.InsertColumn(0,_T("Ref"),0, rect.Width()-50); + RefreshList(); + return FALSE; +} + +void CFindDlg::RefreshList() +{ + m_RefList.clear(); if (g_Git.GetRefList(m_RefList)) MessageBox(g_Git.GetGitLastErr(_T("Could not get all refs.")), _T("TortoiseGit"), MB_ICONERROR); AddToList(); - return FALSE; } void CFindDlg::OnCbnEditchangeFindcombo() diff --git a/src/TortoiseProc/FindDlg.h b/src/TortoiseProc/FindDlg.h index 8e3dc56f8..eb56fa65f 100644 --- a/src/TortoiseProc/FindDlg.h +++ b/src/TortoiseProc/FindDlg.h @@ -47,6 +47,7 @@ public: bool IsRef() {return !!m_bIsRef;} CString GetFindString() {return m_FindString;} void SetFindString(const CString& str) { if (!str.IsEmpty()) { m_FindCombo.SetWindowText(str); } } + void RefreshList(); // Dialog Data enum { IDD = IDD_FIND }; diff --git a/src/TortoiseProc/GitLogListAction.cpp b/src/TortoiseProc/GitLogListAction.cpp index 0efe3ed26..18ae48df8 100644 --- a/src/TortoiseProc/GitLogListAction.cpp +++ b/src/TortoiseProc/GitLogListAction.cpp @@ -424,6 +424,8 @@ void CGitLogList::ContextMenuAction(int cmd,int FirstSelect, int LastSelect, CMe } CAppUtils::CreateBranchTag((cmd&0xFFFF) == ID_CREATE_TAG, &str); ReloadHashMap(); + if (m_pFindDialog) + m_pFindDialog->RefreshList(); Invalidate(); ::PostMessage(this->GetParent()->m_hWnd,MSG_REFLOG_CHANGED,0,0); } @@ -937,6 +939,8 @@ void CGitLogList::ContextMenuAction(int cmd,int FirstSelect, int LastSelect, CMe } } this->ReloadHashMap(); + if (m_pFindDialog) + m_pFindDialog->RefreshList(); CRect rect; this->GetItemRect(FirstSelect,&rect,LVIR_BOUNDS); this->InvalidateRect(rect); diff --git a/src/TortoiseProc/GitLogListBase.cpp b/src/TortoiseProc/GitLogListBase.cpp index ba7b54206..f9876fcf6 100644 --- a/src/TortoiseProc/GitLogListBase.cpp +++ b/src/TortoiseProc/GitLogListBase.cpp @@ -3092,6 +3092,8 @@ void CGitLogListBase::Refresh(BOOL IsCleanFilter) //Update branch and Tag info ReloadHashMap(); + if (m_pFindDialog) + m_pFindDialog->RefreshList(); //Assume Thread have exited //if(!m_bThreadRunning) { -- 2.11.4.GIT