OSDN Git Service

Git LogDlg "Hide unrelated changed paths" Check box work
[tortoisegit/TortoiseGitJp.git] / src / TortoiseProc / LogDlg.cpp
index fd68088..0ba7f79 100644 (file)
@@ -387,7 +387,7 @@ LRESULT CLogDlg::OnLogListLoading(WPARAM wParam, LPARAM lParam)
 \r
                //DialogEnableWindow(IDC_GETALL, FALSE);\r
                //DialogEnableWindow(IDC_SHOWWHOLEPROJECT, FALSE);\r
-               DialogEnableWindow(IDC_INCLUDEMERGE, FALSE);\r
+               //DialogEnableWindow(IDC_INCLUDEMERGE, FALSE);\r
                DialogEnableWindow(IDC_STATBUTTON, FALSE);\r
                DialogEnableWindow(IDC_REFRESH, FALSE);\r
                DialogEnableWindow(IDC_HIDEPATHS,FALSE);\r
@@ -399,9 +399,10 @@ LRESULT CLogDlg::OnLogListLoading(WPARAM wParam, LPARAM lParam)
                DialogEnableWindow(IDC_SHOWWHOLEPROJECT, TRUE);\r
 \r
                DialogEnableWindow(IDC_GETALL, TRUE);\r
-               //DialogEnableWindow(IDC_INCLUDEMERGE, TRUE);\r
+               DialogEnableWindow(IDC_INCLUDEMERGE, TRUE);\r
                DialogEnableWindow(IDC_STATBUTTON, TRUE);\r
                DialogEnableWindow(IDC_REFRESH, TRUE);\r
+               DialogEnableWindow(IDC_HIDEPATHS,TRUE);\r
 \r
 //             PostMessage(WM_TIMER, LOGFILTER_TIMER);\r
                GetDlgItem(IDC_PROGRESS)->ShowWindow(FALSE);\r
@@ -540,6 +541,21 @@ void CLogDlg::FillLogMessageCtrl(bool bShow /* = true*/)
                        m_ProjectProperties.FindBugID(pLogEntry->m_Body, pMsgView);\r
                        CAppUtils::FormatTextInRichEditControl(pMsgView);\r
 \r
+                       int HidePaths=m_cHidePaths.GetState() & 0x0003;\r
+                       CString matchpath=this->m_path.GetGitPathString();\r
+\r
+                       for(int i=0;i<pLogEntry->m_Files.GetCount() && (!matchpath.IsEmpty());i++)\r
+                       {\r
+                               ((CTGitPath&)pLogEntry->m_Files[i]).m_Action &= ~(CTGitPath::LOGACTIONS_HIDE|CTGitPath::LOGACTIONS_GRAY);\r
+                               \r
+                               if(pLogEntry->m_Files[i].GetGitPathString().Left(matchpath.GetLength()) != matchpath)\r
+                               {\r
+                                       if(HidePaths==BST_CHECKED)\r
+                                               ((CTGitPath&)pLogEntry->m_Files[i]).m_Action |= CTGitPath::LOGACTIONS_HIDE;\r
+                                       if(HidePaths==BST_INDETERMINATE)\r
+                                               ((CTGitPath&)pLogEntry->m_Files[i]).m_Action |= CTGitPath::LOGACTIONS_GRAY;\r
+                               }\r
+                       }\r
                        m_ChangedFileListCtrl.UpdateWithGitPathList(pLogEntry->m_Files);\r
                        m_ChangedFileListCtrl.m_CurrentVersion=pLogEntry->m_CommitHash;\r
                        m_ChangedFileListCtrl.Show(SVNSLC_SHOWVERSIONED);\r
@@ -547,24 +563,7 @@ void CLogDlg::FillLogMessageCtrl(bool bShow /* = true*/)
                        m_ChangedFileListCtrl.SetRedraw(TRUE);\r
                        return;\r
                }\r
-#if 0\r
-               // fill in the changed files list control\r
-               if ((m_cHidePaths.GetState() & 0x0003)==BST_CHECKED)\r
-               {\r
-                       m_CurrentFilteredChangedArray.RemoveAll();\r
-                       for (INT_PTR c = 0; c < m_currentChangedArray->GetCount(); ++c)\r
-                       {\r
-                               LogChangedPath * cpath = m_currentChangedArray->GetAt(c);\r
-                               if (cpath == NULL)\r
-                                       continue;\r
-                               if (m_currentChangedArray->GetAt(c)->sPath.Left(m_sRelativeRoot.GetLength()).Compare(m_sRelativeRoot)==0)\r
-                               {\r
-                                       m_CurrentFilteredChangedArray.Add(cpath);\r
-                               }\r
-                       }\r
-                       m_currentChangedArray = &m_CurrentFilteredChangedArray;\r
-               }\r
-#endif\r
+\r
        }\r
        else\r
        {\r