// set up the columns\r
m_LogList.DeleteAllItems();\r
int c = ((CHeaderCtrl*)(m_LogList.GetDlgItem(0)))->GetItemCount()-1;\r
+ \r
while (c>=0)\r
m_LogList.DeleteColumn(c--);\r
- temp.LoadString(IDS_LOG_REVISION);\r
- m_LogList.InsertColumn(0, temp);\r
+ temp.LoadString(IDS_LOG_GRAPH);\r
+\r
+ m_LogList.InsertColumn(this->LOGLIST_GRAPH, temp);\r
\r
+#if 0 \r
// make the revision column right aligned\r
LVCOLUMN Column;\r
Column.mask = LVCF_FMT;\r
Column.fmt = LVCFMT_RIGHT;\r
m_LogList.SetColumn(0, &Column); \r
- \r
+#endif \r
// CString log;\r
// g_Git.GetLog(log);\r
\r
temp.LoadString(IDS_LOG_ACTIONS);\r
- m_LogList.InsertColumn(1, temp);\r
+ m_LogList.InsertColumn(this->LOGLIST_ACTION, temp);\r
+ \r
+ temp.LoadString(IDS_LOG_MESSAGE);\r
+ m_LogList.InsertColumn(this->LOGLIST_MESSAGE, temp);\r
+ \r
temp.LoadString(IDS_LOG_AUTHOR);\r
- m_LogList.InsertColumn(2, temp);\r
+ m_LogList.InsertColumn(this->LOGLIST_AUTHOR, temp);\r
+ \r
temp.LoadString(IDS_LOG_DATE);\r
- m_LogList.InsertColumn(3, temp);\r
+ m_LogList.InsertColumn(this->LOGLIST_DATE, temp);\r
+ \r
+\r
if (m_bShowBugtraqColumn)\r
{\r
temp = m_ProjectProperties.sLabel;\r
if (temp.IsEmpty())\r
temp.LoadString(IDS_LOG_BUGIDS);\r
- m_LogList.InsertColumn(4, temp);\r
+ m_LogList.InsertColumn(this->LOGLIST_BUG, temp);\r
+\r
}\r
- temp.LoadString(IDS_LOG_MESSAGE);\r
- m_LogList.InsertColumn(m_bShowBugtraqColumn ? 5 : 4, temp);\r
+ \r
m_LogList.SetRedraw(false);\r
ResizeAllListCtrlCols();\r
m_LogList.SetRedraw(true);\r
while (c>=0)\r
m_ChangedFileListCtrl.DeleteColumn(c--);\r
temp.LoadString(IDS_PROGRS_ACTION);\r
- m_ChangedFileListCtrl.InsertColumn(0, temp);\r
+ m_ChangedFileListCtrl.InsertColumn(this->FILELIST_ACTION, temp);\r
+ temp.LoadString(IDS_LOG_FILE_LINE_ADD);\r
+ m_ChangedFileListCtrl.InsertColumn(this->FILELIST_ADD, temp);\r
+ temp.LoadString(IDS_LOG_FILE_LINE_DEL);\r
+ m_ChangedFileListCtrl.InsertColumn(this->FILELIST_DEL, temp);\r
temp.LoadString(IDS_PROGRS_PATH);\r
- m_ChangedFileListCtrl.InsertColumn(1, temp);\r
- temp.LoadString(IDS_LOG_COPYFROM);\r
- m_ChangedFileListCtrl.InsertColumn(2, temp);\r
- temp.LoadString(IDS_LOG_REVISION);\r
- m_ChangedFileListCtrl.InsertColumn(3, temp);\r
+ m_ChangedFileListCtrl.InsertColumn(this->FILELIST_PATH, temp);\r
+ \r
m_ChangedFileListCtrl.SetRedraw(false);\r
CAppUtils::ResizeAllListCtrlCols(&m_ChangedFileListCtrl);\r
m_ChangedFileListCtrl.SetRedraw(true);\r
// we fill here the log message rich edit control,\r
// and also populate the changed files list control\r
// according to the selected revision(s).\r
-#if 0\r
+\r
CWnd * pMsgView = GetDlgItem(IDC_MSGVIEW);\r
// empty the log message view\r
pMsgView->SetWindowText(_T(" "));\r
m_ChangedFileListCtrl.SetRedraw(TRUE);\r
return;\r
}\r
- PLOGENTRYDATA pLogEntry = reinterpret_cast<PLOGENTRYDATA>(m_arShownList.GetAt(selIndex));\r
+ GitRev* pLogEntry = reinterpret_cast<GitRev *>(m_arShownList.GetAt(selIndex));\r
\r
// set the log message text\r
- pMsgView->SetWindowText(pLogEntry->sMessage);\r
+ pMsgView->SetWindowText(_T("*")+pLogEntry->m_Subject+_T("\n\n")+pLogEntry->m_Body);\r
// turn bug ID's into links if the bugtraq: properties have been set\r
// and we can find a match of those in the log message\r
- m_ProjectProperties.FindBugID(pLogEntry->sMessage, pMsgView);\r
+ m_ProjectProperties.FindBugID(pLogEntry->m_Body, pMsgView);\r
CAppUtils::FormatTextInRichEditControl(pMsgView);\r
- m_currentChangedArray = pLogEntry->pArChangedPaths;\r
+ m_currentChangedArray = &(pLogEntry->m_Files);\r
if (m_currentChangedArray == NULL)\r
{\r
InterlockedExchange(&m_bNoDispUpdates, FALSE);\r
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
}\r
m_currentChangedArray = &m_CurrentFilteredChangedArray;\r
}\r
+#endif\r
}\r
else\r
{\r
else\r
SetSortArrow(&m_ChangedFileListCtrl, -1, false);\r
m_ChangedFileListCtrl.SetRedraw(TRUE);\r
-#endif\r
+\r
}\r
\r
void CLogDlg::OnBnClickedGetall()\r
this->m_logEntries.ClearAll();\r
this->m_logEntries.ParserFromLog();\r
m_LogList.SetItemCountEx(this->m_logEntries.size());\r
- \r
- this->m_arShownList.Add(&g_rev);\r
- g_rev.m_AuthorName.Append(_T("Frank Li"));\r
+\r
+ this->m_arShownList.RemoveAll();\r
+\r
+ for(int i=0;i<m_logEntries.size();i++)\r
+ this->m_arShownList.Add(&m_logEntries[i]);\r
\r
#if 0 \r
if (!m_bShowedAll)\r
::FillRect(pLVCD->nmcd.hdc, &rect, brush);\r
::DeleteObject(brush);\r
}\r
-#if 0\r
+\r
// Draw the icon(s) into the compatible DC\r
- if (pLogEntry->actions & LOGACTIONS_MODIFIED)\r
+ if (pLogEntry->m_Action & CTGitPath::LOGACTIONS_MODIFIED)\r
::DrawIconEx(pLVCD->nmcd.hdc, rect.left + ICONITEMBORDER, rect.top, m_hModifiedIcon, iconwidth, iconheight, 0, NULL, DI_NORMAL);\r
nIcons++;\r
\r
- if (pLogEntry->actions & LOGACTIONS_ADDED)\r
+ if (pLogEntry->m_Action & CTGitPath::LOGACTIONS_ADDED)\r
::DrawIconEx(pLVCD->nmcd.hdc, rect.left+nIcons*iconwidth + ICONITEMBORDER, rect.top, m_hAddedIcon, iconwidth, iconheight, 0, NULL, DI_NORMAL);\r
nIcons++;\r
\r
- if (pLogEntry->actions & LOGACTIONS_DELETED)\r
+ if (pLogEntry->m_Action & CTGitPath::LOGACTIONS_DELETED)\r
::DrawIconEx(pLVCD->nmcd.hdc, rect.left+nIcons*iconwidth + ICONITEMBORDER, rect.top, m_hDeletedIcon, iconwidth, iconheight, 0, NULL, DI_NORMAL);\r
nIcons++;\r
\r
- if (pLogEntry->actions & LOGACTIONS_REPLACED)\r
+ if (pLogEntry->m_Action & CTGitPath::LOGACTIONS_REPLACED)\r
::DrawIconEx(pLVCD->nmcd.hdc, rect.left+nIcons*iconwidth + ICONITEMBORDER, rect.top, m_hReplacedIcon, iconwidth, iconheight, 0, NULL, DI_NORMAL);\r
nIcons++;\r
-#endif\r
*pResult = CDRF_SKIPDEFAULT;\r
return;\r
}\r
}\r
void CLogDlg::OnNMCustomdrawChangedFileList(NMHDR *pNMHDR, LRESULT *pResult)\r
{\r
-#if 0\r
+\r
NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>( pNMHDR );\r
// Take the default processing unless we set this to something else below.\r
*pResult = CDRF_DODEFAULT;\r
\r
COLORREF crText = GetSysColor(COLOR_WINDOWTEXT);\r
bool bGrayed = false;\r
+#if 0\r
if ((m_cHidePaths.GetState() & 0x0003)==BST_INDETERMINATE)\r
{\r
if ((m_currentChangedArray)&&((m_currentChangedArray->GetCount() > (INT_PTR)pLVCD->nmcd.dwItemSpec)))\r
{\r
- if (m_currentChangedArray->GetAt(pLVCD->nmcd.dwItemSpec)->sPath.Left(m_sRelativeRoot.GetLength()).Compare(m_sRelativeRoot)!=0)\r
+ //if ((*m_currentChangedArray)[(pLVCD->nmcd.dwItemSpec)]sPath.Left(m_sRelativeRoot.GetLength()).Compare(m_sRelativeRoot)!=0)\r
{\r
crText = GetSysColor(COLOR_GRAYTEXT);\r
bGrayed = true;\r
}\r
else if (m_currentChangedPathList.GetCount() > (INT_PTR)pLVCD->nmcd.dwItemSpec)\r
{\r
- if (m_currentChangedPathList[pLVCD->nmcd.dwItemSpec].GetGitPathString().Left(m_sRelativeRoot.GetLength()).Compare(m_sRelativeRoot)!=0)\r
+ //if (m_currentChangedPathList[pLVCD->nmcd.dwItemSpec].GetGitPathString().Left(m_sRelativeRoot.GetLength()).Compare(m_sRelativeRoot)!=0)\r
{\r
crText = GetSysColor(COLOR_GRAYTEXT);\r
bGrayed = true;\r
}\r
}\r
\r
+#endif\r
if ((!bGrayed)&&(m_currentChangedArray)&&(m_currentChangedArray->GetCount() > (INT_PTR)pLVCD->nmcd.dwItemSpec))\r
{\r
- DWORD action = m_currentChangedArray->GetAt(pLVCD->nmcd.dwItemSpec)->action;\r
- if (action == LOGACTIONS_MODIFIED)\r
+ DWORD action = ((*m_currentChangedArray)[pLVCD->nmcd.dwItemSpec]).m_Action;\r
+ if (action == CTGitPath::LOGACTIONS_MODIFIED)\r
crText = m_Colors.GetColor(CColors::Modified);\r
- if (action == LOGACTIONS_REPLACED)\r
+ if (action == CTGitPath::LOGACTIONS_REPLACED)\r
crText = m_Colors.GetColor(CColors::Deleted);\r
- if (action == LOGACTIONS_ADDED)\r
+ if (action == CTGitPath::LOGACTIONS_ADDED)\r
crText = m_Colors.GetColor(CColors::Added);\r
- if (action == LOGACTIONS_DELETED)\r
+ if (action == CTGitPath::LOGACTIONS_DELETED)\r
crText = m_Colors.GetColor(CColors::Deleted);\r
}\r
\r
// Store the color back in the NMLVCUSTOMDRAW struct.\r
pLVCD->clrText = crText;\r
}\r
-#endif\r
}\r
\r
void CLogDlg::DoSizeV1(int delta)\r
// Which column?\r
switch (pItem->iSubItem)\r
{\r
- case 0: //revision\r
+ case this->LOGLIST_GRAPH: //Graphic\r
if (pLogEntry)\r
{\r
-#if 0\r
- _stprintf_s(pItem->pszText, pItem->cchTextMax, _T("%ld"), pLogEntry->Rev);\r
- // to make the child entries indented, add spaces\r
- size_t len = _tcslen(pItem->pszText);\r
- TCHAR * pBuf = pItem->pszText + len;\r
- DWORD nSpaces = m_maxChild-pLogEntry->childStackDepth;\r
- while ((pItem->cchTextMax >= (int)len)&&(nSpaces))\r
- {\r
- *pBuf = ' ';\r
- pBuf++;\r
- nSpaces--;\r
- }\r
- *pBuf = 0;\r
-#endif\r
}\r
break;\r
- case 1: //action -- no text in the column\r
+ case this->LOGLIST_ACTION: //action -- no text in the column\r
+ break;\r
+ case this->LOGLIST_MESSAGE: //Message\r
+ if (pLogEntry)\r
+ lstrcpyn(pItem->pszText, (LPCTSTR)pLogEntry->m_Subject, pItem->cchTextMax);\r
break;\r
- case 2: //author\r
+ case this->LOGLIST_AUTHOR: //Author\r
if (pLogEntry)\r
lstrcpyn(pItem->pszText, (LPCTSTR)pLogEntry->m_AuthorName, pItem->cchTextMax);\r
break;\r
- case 3: //date\r
-#if 0\r
+ case this->LOGLIST_DATE: //Date\r
if (pLogEntry)\r
- lstrcpyn(pItem->pszText, (LPCTSTR)pLogEntry->sDate, pItem->cchTextMax);\r
+ lstrcpyn(pItem->pszText, (LPCTSTR)pLogEntry->m_AuthorDate.Format(_T("%Y-%m-%d %H:%M")), pItem->cchTextMax);\r
break;\r
-#endif\r
- case 4: //message or bug id\r
-#if 0\r
- if (m_bShowBugtraqColumn)\r
- {\r
- if (pLogEntry)\r
- lstrcpyn(pItem->pszText, (LPCTSTR)pLogEntry->sBugIDs, pItem->cchTextMax);\r
- break;\r
- }\r
-#endif\r
- // fall through here!\r
+ \r
case 5:\r
-#if 0\r
- if (pLogEntry)\r
- {\r
- // Add as many characters as possible from the short log message\r
- // to the list control. If the message is longer than\r
- // allowed width, add "..." as an indication.\r
- const int dots_len = 3;\r
- if (pLogEntry->sShortMessage.GetLength() >= pItem->cchTextMax && pItem->cchTextMax > dots_len)\r
- {\r
- lstrcpyn(pItem->pszText, (LPCTSTR)pLogEntry->sShortMessage, pItem->cchTextMax - dots_len);\r
- lstrcpyn(pItem->pszText + pItem->cchTextMax - dots_len - 1, _T("..."), dots_len + 1);\r
- }\r
- else\r
- lstrcpyn(pItem->pszText, (LPCTSTR)pLogEntry->sShortMessage, pItem->cchTextMax);\r
- }\r
- else if ((itemid == m_arShownList.GetCount()) && m_bStrict && m_bStrictStopped)\r
- {\r
- CString sTemp;\r
- sTemp.LoadString(IDS_LOG_STOPONCOPY_HINT);\r
- lstrcpyn(pItem->pszText, sTemp, pItem->cchTextMax);\r
- }\r
-#endif\r
+\r
break;\r
default:\r
ASSERT(false);\r
\r
void CLogDlg::OnLvnGetdispinfoChangedFileList(NMHDR *pNMHDR, LRESULT *pResult)\r
{\r
-#if 0\r
+\r
NMLVDISPINFO *pDispInfo = reinterpret_cast<NMLVDISPINFO*>(pNMHDR);\r
\r
//Create a pointer to the item\r
lstrcpyn(pItem->pszText, _T(""), pItem->cchTextMax);\r
return;\r
}\r
- LogChangedPath * lcpath = NULL;\r
+ CTGitPath lcpath = NULL;\r
if (m_currentChangedArray)\r
- lcpath = m_currentChangedArray->GetAt(pItem->iItem);\r
+ lcpath = (*m_currentChangedArray)[pItem->iItem];\r
//Does the list need text information?\r
if (pItem->mask & LVIF_TEXT)\r
{\r
//Which column?\r
switch (pItem->iSubItem)\r
{\r
- case 0: //Action\r
+ case this->FILELIST_ACTION: //Action\r
+#if 0\r
if (lcpath)\r
lstrcpyn(pItem->pszText, (LPCTSTR)lcpath->GetAction(), pItem->cchTextMax);\r
else\r
lstrcpyn(pItem->pszText, _T(""), pItem->cchTextMax); \r
+#endif\r
+ lstrcpyn(pItem->pszText, (LPCTSTR)lcpath.GetActionName(), pItem->cchTextMax);\r
+\r
break;\r
- case 1: //path\r
+\r
+ case this->FILELIST_ADD: //add\r
+#if 0\r
if (lcpath)\r
lstrcpyn(pItem->pszText, (LPCTSTR)lcpath->sPath, pItem->cchTextMax);\r
else\r
lstrcpyn(pItem->pszText, (LPCTSTR)m_currentChangedPathList[pItem->iItem].GetGitPathString(), pItem->cchTextMax);\r
+#endif\r
+ lstrcpyn(pItem->pszText, (LPCTSTR)lcpath.m_StatAdd, pItem->cchTextMax);\r
break;\r
- case 2: //copyfrom path\r
+\r
+ case this->FILELIST_DEL: //del\r
+#if 0\r
if (lcpath)\r
lstrcpyn(pItem->pszText, (LPCTSTR)lcpath->sCopyFromPath, pItem->cchTextMax);\r
else\r
lstrcpyn(pItem->pszText, _T(""), pItem->cchTextMax);\r
+#endif\r
+ lstrcpyn(pItem->pszText, (LPCTSTR)lcpath.m_StatDel, pItem->cchTextMax);\r
break;\r
- case 3: //revision\r
+ case this->FILELIST_PATH: //path\r
+#if 0\r
if ((lcpath==NULL)||(lcpath->sCopyFromPath.IsEmpty()))\r
lstrcpyn(pItem->pszText, _T(""), pItem->cchTextMax);\r
else\r
_stprintf_s(pItem->pszText, pItem->cchTextMax, _T("%ld"), lcpath->lCopyFromRev);\r
+#endif\r
+ lstrcpyn(pItem->pszText, (LPCTSTR)lcpath.GetGitPathString(), pItem->cchTextMax);\r
break;\r
}\r
}\r
\r
*pResult = 0;\r
-#endif\r
}\r
\r
void CLogDlg::OnEnChangeSearchedit()\r
const int nColumn = pNMLV->iSubItem;\r
m_bAscendingPathList = nColumn == m_nSortColumnPathList ? !m_bAscendingPathList : TRUE;\r
m_nSortColumnPathList = nColumn;\r
- qsort(m_currentChangedArray->GetData(), m_currentChangedArray->GetSize(), sizeof(LogChangedPath*), (GENERICCOMPAREFN)SortCompare);\r
+// qsort(m_currentChangedArray->GetData(), m_currentChangedArray->GetSize(), sizeof(LogChangedPath*), (GENERICCOMPAREFN)SortCompare);\r
\r
SetSortArrow(&m_ChangedFileListCtrl, m_nSortColumnPathList, m_bAscendingPathList);\r
m_ChangedFileListCtrl.Invalidate();\r
\r
void CLogDlg::ResizeAllListCtrlCols()\r
{\r
-#if 0\r
+\r
const int nMinimumWidth = ICONITEMBORDER+16*4;\r
int maxcol = ((CHeaderCtrl*)(m_LogList.GetDlgItem(0)))->GetItemCount()-1;\r
int nItemCount = m_LogList.GetItemCount();\r
int linewidth = m_LogList.GetStringWidth(m_LogList.GetItemText(index, col)) + 14;\r
if (index < m_arShownList.GetCount())\r
{\r
- PLOGENTRYDATA pCurLogEntry = reinterpret_cast<PLOGENTRYDATA>(m_arShownList.GetAt(index));\r
- if ((pCurLogEntry)&&(pCurLogEntry->Rev == m_wcRev))\r
+ GitRev * pCurLogEntry = reinterpret_cast<GitRev*>(m_arShownList.GetAt(index));\r
+ if ((pCurLogEntry)&&(pCurLogEntry->m_CommitHash == m_wcRev.m_CommitHash))\r
{\r
// set the bold font and ask for the string width again\r
m_LogList.SendMessage(WM_SETFONT, (WPARAM)m_boldFont, NULL);\r
cx = linewidth;\r
}\r
// Adjust columns "Actions" containing icons\r
- if (col == 1)\r
+ if (col == this->LOGLIST_ACTION)\r
{\r
if (cx < nMinimumWidth)\r
{\r
}\r
}\r
\r
+ if (col == this->LOGLIST_MESSAGE)\r
+ {\r
+ if (cx > LOGLIST_MESSAGE_MAX)\r
+ {\r
+ cx = LOGLIST_MESSAGE_MAX;\r
+ }\r
+\r
+ }\r
// keep the bug id column small\r
if ((col == 4)&&(m_bShowBugtraqColumn))\r
{\r
m_LogList.SetColumnWidth(col, cx);\r
}\r
}\r
-#endif\r
+\r
}\r
\r
void CLogDlg::OnBnClickedHidepaths()\r