UINT CFileDiffDlg::DiffThread() { RefreshCursor(); m_cFileList.ShowText(CString(MAKEINTRESOURCE(IDS_FILEDIFF_WAIT))); m_cFileList.DeleteAllItems(); m_arFileList.Clear(); EnableInputControl(false); #if 0 bool bSuccess = true; if (m_bDoPegDiff) { // bSuccess = DiffSummarizePeg(m_path1, m_peg, m_rev1, m_rev2, m_depth, m_bIgnoreancestry); } else { // bSuccess = DiffSummarize(m_path1, m_rev1, m_path2, m_rev2, m_depth, m_bIgnoreancestry); } // if (!bSuccess) // { // m_cFileList.ShowText(GetLastErrorMessage()); // InterlockedExchange(&m_bThreadRunning, FALSE); // return 0; // } #endif if( m_rev1.m_CommitHash.IsEmpty() || m_rev2.m_CommitHash.IsEmpty()) g_Git.RefreshGitIndex(); g_Git.GetCommitDiffList(m_rev1.m_CommitHash.ToString(),m_rev2.m_CommitHash.ToString(),m_arFileList); CString sFilterText; m_cFilter.GetWindowText(sFilterText); m_cFileList.SetRedraw(false); Filter(sFilterText); if (m_arFileList.GetCount()>0) { // Highlight first entry in file list m_cFileList.SetSelectionMark(0); m_cFileList.SetItemState(0, LVIS_SELECTED, LVIS_SELECTED); } int mincol = 0; int maxcol = ((CHeaderCtrl*)(m_cFileList.GetDlgItem(0)))->GetItemCount()-1; int col; for (col = mincol; col <= maxcol; col++) { m_cFileList.SetColumnWidth(col,LVSCW_AUTOSIZE_USEHEADER); } m_cFileList.ClearText(); m_cFileList.SetRedraw(true); InterlockedExchange(&m_bThreadRunning, FALSE); InvalidateRect(NULL); RefreshCursor(); EnableInputControl(true); return 0; }
LRESULT CFileDiffDlg::OnDiffFinished(WPARAM, LPARAM) { CString sFilterText; m_cFilter.GetWindowText(sFilterText); m_cFileList.SetRedraw(false); Filter(sFilterText); if (!m_arFileList.IsEmpty()) { // Highlight first entry in file list m_cFileList.SetSelectionMark(0); m_cFileList.SetItemState(0, LVIS_SELECTED, LVIS_SELECTED); } int mincol = 0; int maxcol = m_cFileList.GetHeaderCtrl()->GetItemCount() - 1; int col; for (col = mincol; col <= maxcol; ++col) { m_cFileList.SetColumnWidth(col, LVSCW_AUTOSIZE_USEHEADER); } m_cFileList.ClearText(); if (m_arFileList.IsEmpty()) m_cFileList.ShowText(CString(MAKEINTRESOURCE(IDS_COMPAREREV_NODIFF))); m_cFileList.SetRedraw(true); InvalidateRect(NULL); RefreshCursor(); EnableInputControl(true); return 0; }
LRESULT CFileDiffDlg::OnDisableButtons(WPARAM, LPARAM) { RefreshCursor(); m_cFileList.ShowText(CString(MAKEINTRESOURCE(IDS_FILEDIFF_WAIT))); m_cFileList.DeleteAllItems(); m_arFileList.Clear(); EnableInputControl(false); return 0; }