5 #include "RefLogList.h"
7 IMPLEMENT_DYNAMIC(CRefLogList
, CGitLogList
)
9 CRefLogList::CRefLogList()
11 m_ColumnRegKey
=_T("reflog");
12 this->m_ContextMenuMask
|= this->GetContextMenuBit(ID_LOG
);
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;
44 m_ColumnManager
.SetNames(normal
, _countof(normal
));
45 m_ColumnManager
.ReadSettings(m_dwDefaultColumns
,0, m_ColumnRegKey
+_T("loglist"), _countof(normal
), with
);
51 void CRefLogList::OnLvnGetdispinfoLoglist(NMHDR
*pNMHDR
, LRESULT
*pResult
)
53 NMLVDISPINFO
*pDispInfo
= reinterpret_cast<NMLVDISPINFO
*>(pNMHDR
);
55 // Create a pointer to the item
56 LV_ITEM
* pItem
= &(pDispInfo
)->item
;
58 // Do the list need text information?
59 if (!(pItem
->mask
& LVIF_TEXT
))
62 // By default, clear text buffer.
63 lstrcpyn(pItem
->pszText
, _T(""), pItem
->cchTextMax
);
65 bool bOutOfRange
= pItem
->iItem
>= ShownCountWithStopped();
68 if (m_bNoDispUpdates
|| bOutOfRange
)
72 int itemid
= pItem
->iItem
;
73 GitRev
* pLogEntry
= NULL
;
74 if (itemid
< m_arShownList
.GetCount())
75 pLogEntry
= reinterpret_cast<GitRev
*>(m_arShownList
.GetAt(pItem
->iItem
));
80 switch (pItem
->iSubItem
)
82 case this->REFLOG_HASH
:
85 lstrcpyn(pItem
->pszText
,pLogEntry
->m_CommitHash
.ToString(), pItem
->cchTextMax
);
90 lstrcpyn(pItem
->pszText
, pLogEntry
->m_Ref
, pItem
->cchTextMax
);
94 lstrcpyn(pItem
->pszText
, (LPCTSTR
)pLogEntry
->m_RefAction
, pItem
->cchTextMax
);
98 lstrcpyn(pItem
->pszText
, (LPCTSTR
)pLogEntry
->GetSubject().Trim(), pItem
->cchTextMax
);
106 void CRefLogList::OnNMCustomdrawLoglist(NMHDR
*pNMHDR
, LRESULT
*pResult
)
108 UNREFERENCED_PARAMETER(pNMHDR
);
109 // Take the default processing unless we set this to something else below.
110 *pResult
= CDRF_DODEFAULT
;