5 #include "RefLogList.h"
7 IMPLEMENT_DYNAMIC(CRefLogList
, CGitLogList
)
9 CRefLogList::CRefLogList()
11 m_ColumnRegKey
=_T("reflog");
15 void CRefLogList::InsertRefLogColumn()
19 CRegDWORD
regFullRowSelect(_T("Software\\TortoiseGit\\FullRowSelect"), TRUE
);
20 DWORD exStyle
= LVS_EX_HEADERDRAGDROP
| LVS_EX_DOUBLEBUFFER
| LVS_EX_INFOTIP
| LVS_EX_SUBITEMIMAGES
;
21 if (DWORD(regFullRowSelect
))
22 exStyle
|= LVS_EX_FULLROWSELECT
;
23 SetExtendedStyle(exStyle
);
25 static UINT normal
[] =
40 m_dwDefaultColumns
= 0xFFFF;
45 m_ColumnManager
.SetNames(normal
, sizeof(normal
)/sizeof(UINT
));
46 m_ColumnManager
.ReadSettings(m_dwDefaultColumns
, m_ColumnRegKey
+_T("loglist"), sizeof(normal
)/sizeof(UINT
), with
);
52 void CRefLogList::OnLvnGetdispinfoLoglist(NMHDR
*pNMHDR
, LRESULT
*pResult
)
54 NMLVDISPINFO
*pDispInfo
= reinterpret_cast<NMLVDISPINFO
*>(pNMHDR
);
56 // Create a pointer to the item
57 LV_ITEM
* pItem
= &(pDispInfo
)->item
;
59 // Do the list need text information?
60 if (!(pItem
->mask
& LVIF_TEXT
))
63 // By default, clear text buffer.
64 lstrcpyn(pItem
->pszText
, _T(""), pItem
->cchTextMax
);
66 bool bOutOfRange
= pItem
->iItem
>= ShownCountWithStopped();
69 if (m_bNoDispUpdates
|| bOutOfRange
)
73 int itemid
= pItem
->iItem
;
74 GitRev
* pLogEntry
= NULL
;
75 if (itemid
< m_arShownList
.GetCount())
76 pLogEntry
= reinterpret_cast<GitRev
*>(m_arShownList
.GetAt(pItem
->iItem
));
81 switch (pItem
->iSubItem
)
83 case this->REFLOG_HASH
: //Graphic
86 lstrcpyn(pItem
->pszText
,pLogEntry
->m_CommitHash
.ToString(), pItem
->cchTextMax
);
89 case REFLOG_REF
: //action -- no text in the column
91 lstrcpyn(pItem
->pszText
, pLogEntry
->m_Ref
, pItem
->cchTextMax
);
93 case REFLOG_ACTION
: //Message
95 lstrcpyn(pItem
->pszText
, (LPCTSTR
)pLogEntry
->m_RefAction
, pItem
->cchTextMax
);
97 case REFLOG_MESSAGE
: //Author
99 lstrcpyn(pItem
->pszText
, (LPCTSTR
)pLogEntry
->m_Subject
, pItem
->cchTextMax
);
107 void CRefLogList::OnNMCustomdrawLoglist(NMHDR
*pNMHDR
, LRESULT
*pResult
)
110 NMLVCUSTOMDRAW
* pLVCD
= reinterpret_cast<NMLVCUSTOMDRAW
*>( pNMHDR
);
111 // Take the default processing unless we set this to something else below.
112 *pResult
= CDRF_DODEFAULT
;