From: Frank Li Date: Sun, 1 Feb 2009 09:41:06 +0000 (+0800) Subject: Git LogDlg "Hide unrelated changed paths" Check box work X-Git-Url: http://git.sourceforge.jp/view?p=tortoisegit%2FTortoiseGitJp.git;a=commitdiff_plain;h=2d57b34a707f9a107930cc24322f009cdcf6dd28;hp=473358810da356e0d3b4fd6e1ed91ba7f604c6f6 Git LogDlg "Hide unrelated changed paths" Check box work Signed-off-by: Frank Li --- diff --git a/src/Git/GitStatusListCtrl.cpp b/src/Git/GitStatusListCtrl.cpp index bc8933d..4edf274 100644 --- a/src/Git/GitStatusListCtrl.cpp +++ b/src/Git/GitStatusListCtrl.cpp @@ -4315,7 +4315,11 @@ void CGitStatusListCtrl::OnNMCustomdraw(NMHDR *pNMHDR, LRESULT *pResult) // brown : missing, deleted, replaced // green : merged (or potential merges) // red : conflicts or sure conflicts - if(entry->m_Action & CTGitPath::LOGACTIONS_UNMERGED) + if(entry->m_Action & CTGitPath::LOGACTIONS_GRAY) + { + crText = RGB(128,128,128); + + }else if(entry->m_Action & CTGitPath::LOGACTIONS_UNMERGED) { crText = m_Colors.GetColor(CColors::Conflict); @@ -5318,8 +5322,12 @@ int CGitStatusListCtrl::UpdateWithGitPathList(CTGitPathList &list) m_arStatusArray.clear(); for(int i=0;im_Checked = TRUE; + CTGitPath * gitpath=(CTGitPath*)&list[i]; + + if(gitpath ->m_Action & CTGitPath::LOGACTIONS_HIDE) + continue; + + gitpath->m_Checked = TRUE; m_arStatusArray.push_back((CTGitPath*)&list[i]); } return 0; diff --git a/src/Git/TGitPath.h b/src/Git/TGitPath.h index d6b8964..3ac37bc 100644 --- a/src/Git/TGitPath.h +++ b/src/Git/TGitPath.h @@ -20,6 +20,10 @@ public: LOGACTIONS_UNVER = 0x80000000, LOGACTIONS_IGNORE = 0x40000000, //LOGACTIONS_CONFLICT = 0x20000000, + + // For log filter only + LOGACTIONS_HIDE = 0x20000000, + LOGACTIONS_GRAY = 0x10000000, }; CString m_StatAdd; diff --git a/src/TortoiseProc/LogDlg.cpp b/src/TortoiseProc/LogDlg.cpp index fd68088..0ba7f79 100644 --- a/src/TortoiseProc/LogDlg.cpp +++ b/src/TortoiseProc/LogDlg.cpp @@ -387,7 +387,7 @@ LRESULT CLogDlg::OnLogListLoading(WPARAM wParam, LPARAM lParam) //DialogEnableWindow(IDC_GETALL, FALSE); //DialogEnableWindow(IDC_SHOWWHOLEPROJECT, FALSE); - DialogEnableWindow(IDC_INCLUDEMERGE, FALSE); + //DialogEnableWindow(IDC_INCLUDEMERGE, FALSE); DialogEnableWindow(IDC_STATBUTTON, FALSE); DialogEnableWindow(IDC_REFRESH, FALSE); DialogEnableWindow(IDC_HIDEPATHS,FALSE); @@ -399,9 +399,10 @@ LRESULT CLogDlg::OnLogListLoading(WPARAM wParam, LPARAM lParam) DialogEnableWindow(IDC_SHOWWHOLEPROJECT, TRUE); DialogEnableWindow(IDC_GETALL, TRUE); - //DialogEnableWindow(IDC_INCLUDEMERGE, TRUE); + DialogEnableWindow(IDC_INCLUDEMERGE, TRUE); DialogEnableWindow(IDC_STATBUTTON, TRUE); DialogEnableWindow(IDC_REFRESH, TRUE); + DialogEnableWindow(IDC_HIDEPATHS,TRUE); // PostMessage(WM_TIMER, LOGFILTER_TIMER); GetDlgItem(IDC_PROGRESS)->ShowWindow(FALSE); @@ -540,6 +541,21 @@ void CLogDlg::FillLogMessageCtrl(bool bShow /* = true*/) m_ProjectProperties.FindBugID(pLogEntry->m_Body, pMsgView); CAppUtils::FormatTextInRichEditControl(pMsgView); + int HidePaths=m_cHidePaths.GetState() & 0x0003; + CString matchpath=this->m_path.GetGitPathString(); + + for(int i=0;im_Files.GetCount() && (!matchpath.IsEmpty());i++) + { + ((CTGitPath&)pLogEntry->m_Files[i]).m_Action &= ~(CTGitPath::LOGACTIONS_HIDE|CTGitPath::LOGACTIONS_GRAY); + + if(pLogEntry->m_Files[i].GetGitPathString().Left(matchpath.GetLength()) != matchpath) + { + if(HidePaths==BST_CHECKED) + ((CTGitPath&)pLogEntry->m_Files[i]).m_Action |= CTGitPath::LOGACTIONS_HIDE; + if(HidePaths==BST_INDETERMINATE) + ((CTGitPath&)pLogEntry->m_Files[i]).m_Action |= CTGitPath::LOGACTIONS_GRAY; + } + } m_ChangedFileListCtrl.UpdateWithGitPathList(pLogEntry->m_Files); m_ChangedFileListCtrl.m_CurrentVersion=pLogEntry->m_CommitHash; m_ChangedFileListCtrl.Show(SVNSLC_SHOWVERSIONED); @@ -547,24 +563,7 @@ void CLogDlg::FillLogMessageCtrl(bool bShow /* = true*/) m_ChangedFileListCtrl.SetRedraw(TRUE); return; } -#if 0 - // fill in the changed files list control - if ((m_cHidePaths.GetState() & 0x0003)==BST_CHECKED) - { - m_CurrentFilteredChangedArray.RemoveAll(); - for (INT_PTR c = 0; c < m_currentChangedArray->GetCount(); ++c) - { - LogChangedPath * cpath = m_currentChangedArray->GetAt(c); - if (cpath == NULL) - continue; - if (m_currentChangedArray->GetAt(c)->sPath.Left(m_sRelativeRoot.GetLength()).Compare(m_sRelativeRoot)==0) - { - m_CurrentFilteredChangedArray.Add(cpath); - } - } - m_currentChangedArray = &m_CurrentFilteredChangedArray; - } -#endif + } else {