OSDN Git Service

Show bold font for HEAD at log dialog
authorFrank Li <lznuaa@gmail.com>
Sat, 21 Feb 2009 08:08:11 +0000 (16:08 +0800)
committerFrank Li <lznuaa@gmail.com>
Sat, 21 Feb 2009 08:08:11 +0000 (16:08 +0800)
Signed-off-by: Frank Li <lznuaa@gmail.com>
src/TortoiseProc/GitLogListBase.cpp
src/TortoiseProc/GitLogListBase.h

index da2078b..b46cc7e 100644 (file)
@@ -83,6 +83,7 @@ CGitLogListBase::CGitLogListBase():CHintListCtrl()
 \r
        g_Git.GetMapHashToFriendName(m_HashMap);\r
        m_CurrentBranch=g_Git.GetCurrentBranch();\r
+       this->m_HeadHash=g_Git.GetHash(CString(_T("HEAD"))).Left(40);\r
 \r
        m_From=CTime(1970,1,2,0,0,0);\r
        m_To=CTime::GetCurrentTime();\r
@@ -728,6 +729,12 @@ void CGitLogListBase::OnNMCustomdrawLoglist(NMHDR *pNMHDR, LRESULT *pResult)
                                                *pResult = CDRF_NOTIFYSUBITEMDRAW | CDRF_NEWFONT;\r
                                        }\r
 \r
+                                       if(data->m_CommitHash == m_HeadHash)\r
+                                       {\r
+                                               SelectObject(pLVCD->nmcd.hdc, m_boldFont);\r
+                                               *pResult = CDRF_NOTIFYSUBITEMDRAW | CDRF_NEWFONT;\r
+                                       }\r
+\r
 //                                     if ((data->childStackDepth)||(m_mergedRevs.find(data->Rev) != m_mergedRevs.end()))\r
 //                                             crText = GetSysColor(COLOR_GRAYTEXT);\r
 //                                     if (data->Rev == m_wcRev)\r
@@ -1119,6 +1126,11 @@ void CGitLogListBase::OnContextMenu(CWnd* pWnd, CPoint point)
                        if(m_ContextMenuMask&GetContextMenuBit(ID_CHERRY_PICK))\r
                                popup.AppendMenuIcon(ID_CHERRY_PICK, _T("Cherry Pick this version"), IDI_EXPORT);\r
 \r
+                       str.Format(_T("Rebase %s to this"),g_Git.GetCurrentBranch());\r
+\r
+                       if(m_ContextMenuMask&GetContextMenuBit(ID_REBASE_TO_VERSION))\r
+                               popup.AppendMenuIcon(ID_REBASE_TO_VERSION, str , IDI_EXPORT);                   \r
+\r
                        if(m_ContextMenuMask&GetContextMenuBit(ID_EXPORT))\r
                                popup.AppendMenuIcon(ID_EXPORT, _T("Export this version"), IDI_EXPORT); \r
                        \r
index 6ed2495..c6c31e0 100644 (file)
@@ -139,6 +139,7 @@ public:
        ID_REBASE_SQUASH,\r
        ID_REBASE_SKIP,\r
        ID_COMBINE_COMMIT,\r
+       ID_REBASE_TO_VERSION,\r
        };\r
        inline unsigned __int64 GetContextMenuBit(int i){ return ((unsigned __int64 )0x1)<<i ;}\r
        void InsertGitColumn();\r
@@ -175,6 +176,7 @@ public:
                m_HashMap.clear();\r
                g_Git.GetMapHashToFriendName(m_HashMap);\r
                m_CurrentBranch=g_Git.GetCurrentBranch();\r
+               this->m_HeadHash=g_Git.GetHash(CString(_T("HEAD"))).Left(40);\r
        }\r
        void TerminateThread()\r
        {\r
@@ -245,6 +247,7 @@ protected:
        CColors                         m_Colors;\r
 \r
        CString                         m_CurrentBranch;\r
+       CString                         m_HeadHash;\r
        \r
        COLORREF                        m_LineColors[Lanes::COLORS_NUM];\r
        DWORD                           m_DateFormat;   // DATE_SHORTDATE or DATE_LONGDATE\r