OSDN Git Service

Add Settings for Log branch tag line number
authorFrank Li <lznuaa@gmail.com>
Thu, 22 Jan 2009 02:21:18 +0000 (10:21 +0800)
committerFrank Li <lznuaa@gmail.com>
Thu, 22 Jan 2009 02:21:18 +0000 (10:21 +0800)
Signed-off-by: Frank Li <lznuaa@gmail.com>
12 files changed:
src/Git/GitStatusListCtrl.cpp
src/Git/TGitPath.cpp
src/Resources/TortoiseProcENG.rc
src/TortoiseProc/Colors.cpp
src/TortoiseProc/Colors.h
src/TortoiseProc/GitLogListBase.cpp
src/TortoiseProc/GitLogListBase.h
src/TortoiseProc/Settings/Settings.cpp
src/TortoiseProc/Settings/SettingsColors2.cpp
src/TortoiseProc/Settings/SettingsColors2.h
src/TortoiseProc/Settings/SettingsColors3.cpp
src/TortoiseProc/Settings/SettingsColors3.h

index 20be5b8..b248c5b 100644 (file)
@@ -5258,9 +5258,9 @@ int CGitStatusListCtrl::UpdateFileList(git_revnum_t hash,CTGitPathList *list)
                        cmdout.clear();\r
                        CString cmd;\r
                        if(list == NULL)\r
-                               cmd=(_T("git.exe diff-index --raw HEAD --numstat -C -M"));\r
+                               cmd=(_T("git.exe diff-index --raw HEAD --numstat -C -M -z"));\r
                        else\r
-                               cmd.Format(_T("git.exe diff-index --raw HEAD --numstat -C -M -- \"%s\""),(*list)[i].GetGitPathString());\r
+                               cmd.Format(_T("git.exe diff-index  --raw HEAD --numstat -C -M -z -- \"%s\""),(*list)[i].GetGitPathString());\r
 \r
                        if(g_Git.Run(cmd,&cmdout))\r
                        {\r
@@ -5278,7 +5278,13 @@ int CGitStatusListCtrl::UpdateFileList(git_revnum_t hash,CTGitPathList *list)
                                return -1;\r
 \r
                        }\r
+                       \r
+                       if(list == NULL)\r
+                               cmd=(_T("git.exe diff-index --cached --raw HEAD --numstat -C -M -z"));\r
+                       else\r
+                               cmd.Format(_T("git.exe diff-index  --cached --raw HEAD --numstat -C -M -z -- \"%s\""),(*list)[i].GetGitPathString());\r
 \r
+                       g_Git.Run(cmd,&cmdout);\r
                        //out+=cmdout;\r
                        out.append(cmdout,0);\r
                }\r
@@ -5298,9 +5304,9 @@ int CGitStatusListCtrl::UpdateFileList(git_revnum_t hash,CTGitPathList *list)
                        BYTE_VECTOR cmdout;\r
                        CString cmd;\r
                        if(list == NULL)\r
-                               cmd.Format(_T("git.exe diff-tree --raw --numstat -C -M %s"),hash);\r
+                               cmd.Format(_T("git.exe diff-tree --raw --numstat -C -M -z %s"),hash);\r
                        else\r
-                               cmd.Format(_T("git.exe diff-tree --raw  --numstat -C -M %s -- \"%s\""),hash,(*list)[i].GetGitPathString());\r
+                               cmd.Format(_T("git.exe diff-tree --raw  --numstat -C -M %s -z -- \"%s\""),hash,(*list)[i].GetGitPathString());\r
 \r
                        g_Git.Run(cmd,&cmdout);\r
 \r
index e33d018..a31dca5 100644 (file)
@@ -882,7 +882,7 @@ int CTGitPathList::ParserFromLog(BYTE_VECTOR &log)
 {\r
        this->Clear();\r
        int pos=0;\r
-       BYTE *p=&log[0];\r
+       //BYTE *p=&log[0];\r
        //CString one;\r
        CTGitPath path;\r
        m_Action=0;\r
index 307341d..4d2b66a 100644 (file)
Binary files a/src/Resources/TortoiseProcENG.rc and b/src/Resources/TortoiseProcENG.rc differ
index e8b7000..4b6839a 100644 (file)
 #include "StdAfx.h"\r
 #include ".\colors.h"\r
 \r
-CColors::CColors(void) : m_regAdded(_T("Software\\TortoiseGit\\Colors\\Added"), RGB(100, 0, 100))\r
-       , m_regCmd(_T("Software\\TortoiseGit\\Colors\\Cmd"), ::GetSysColor(COLOR_GRAYTEXT))\r
-       , m_regConflict(_T("Software\\TortoiseGit\\Colors\\Conflict"), RGB(255, 0, 0))\r
-       , m_regModified(_T("Software\\TortoiseGit\\Colors\\Modified"), RGB(0, 50, 160))\r
-       , m_regMerged(_T("Software\\TortoiseGit\\Colors\\Merged"), RGB(0, 100, 0))\r
-       , m_regDeleted(_T("Software\\TortoiseGit\\Colors\\Deleted"), RGB(100, 0, 0))\r
-       , m_regLastCommit(_T("Software\\TortoiseGit\\Colors\\LastCommit"), RGB(100, 100, 100))\r
-       , m_regDeletedNode(_T("Software\\TortoiseGit\\Colors\\DeletedNode"), RGB(255, 0, 0))\r
-       , m_regAddedNode(_T("Software\\TortoiseGit\\Colors\\AddedNode"), RGB(0, 255, 0))\r
-       , m_regReplacedNode(_T("Software\\TortoiseGit\\Colors\\ReplacedNode"), RGB(0, 255, 0))\r
-       , m_regRenamedNode(_T("Software\\TortoiseGit\\Colors\\RenamedNode"), RGB(0, 0, 255))\r
-       , m_regLastCommitNode(_T("Software\\TortoiseGit\\Colors\\LastCommitNode"), RGB(200, 200, 200))\r
-       , m_regPropertyChanged(_T("Software\\TortoiseGit\\Colors\\PropertyChanged"), RGB(0, 50, 160))\r
+CColors::COLOR_DATA CColors::m_ColorArray[]=\r
+{\r
+       {Cmd,_T("Software\\TortoiseGit\\Colors\\Cmd"),RGB(100, 100, 100)},\r
+       {Conflict,_T("Software\\TortoiseGit\\Colors\\Conflict"), RGB(255, 0, 0)},\r
+       {Modified,_T("Software\\TortoiseGit\\Colors\\Modified"), RGB(0, 50, 160)},\r
+       {Merged,_T("Software\\TortoiseGit\\Colors\\Merged"), RGB(0, 100, 0)},\r
+       {Deleted,_T("Software\\TortoiseGit\\Colors\\Deleted"), RGB(100, 0, 0)},\r
+       {Added,_T("Software\\TortoiseGit\\Colors\\Added"), RGB(100, 0, 100)},\r
+       {LastCommit,_T("Software\\TortoiseGit\\Colors\\LastCommit"), RGB(100, 100, 100)},\r
+       {DeletedNode,_T("Software\\TortoiseGit\\Colors\\DeletedNode"), RGB(255, 0, 0)},\r
+       {AddedNode,_T("Software\\TortoiseGit\\Colors\\AddedNode"), RGB(0, 255, 0)},\r
+       {ReplacedNode,_T("Software\\TortoiseGit\\Colors\\ReplacedNode"), RGB(0, 255, 0)},\r
+       {RenamedNode,_T("Software\\TortoiseGit\\Colors\\RenamedNode"), RGB(0, 0, 255)},\r
+       {LastCommitNode,_T("Software\\TortoiseGit\\Colors\\LastCommitNode"), RGB(200, 200, 200)},\r
+       {PropertyChanged,_T("Software\\TortoiseGit\\Colors\\PropertyChanged"), RGB(0, 50, 160)},\r
+       {CurrentBranch,_T("Software\\TortoiseGit\\Colors\\CurrentBranch"), RGB(255, 0, 0)},\r
+       {LocalBranch,_T("Software\\TortoiseGit\\Colors\\LocalBranch"), RGB(128, 0, 0)},\r
+       {RemoteBranch,_T("Software\\TortoiseGit\\Colors\\RemoteBranch"), RGB(128, 128, 0)},\r
+       {Tag,_T("Software\\TortoiseGit\\Colors\\Tag"), RGB(0, 255, 255)},\r
+       {BranchLine1,_T("Software\\TortoiseGit\\Colors\\BranchLine1"), RGB(0,0,0)},\r
+       {BranchLine2,_T("Software\\TortoiseGit\\Colors\\BranchLine2"), RGB(0xFF,0,0)},\r
+       {BranchLine3,_T("Software\\TortoiseGit\\Colors\\BranchLine3"), RGB(0,0xFF,0)},\r
+       {BranchLine4,_T("Software\\TortoiseGit\\Colors\\BranchLine4"), RGB(0,0,0xFF)},\r
+       {BranchLine5,_T("Software\\TortoiseGit\\Colors\\BranchLine5"), RGB(128,128,128)},\r
+       {BranchLine6,_T("Software\\TortoiseGit\\Colors\\BranchLine6"), RGB(128,128,0)},\r
+       {BranchLine7,_T("Software\\TortoiseGit\\Colors\\BranchLine7"), RGB(0,128,128)},\r
+       {BranchLine8,_T("Software\\TortoiseGit\\Colors\\BranchLine8"), RGB(128,0,128)},\r
+       {COLOR_END,_T("Software\\TortoiseGit\\Colors\\END"),RGB(0,0,0)},\r
+\r
+};\r
+\r
+CColors::CColors(void) \r
 {\r
 }\r
 \r
@@ -41,105 +60,41 @@ CColors::~CColors(void)
 \r
 COLORREF CColors::GetColor(Colors col, bool bDefault /*=true*/)\r
 {\r
-       switch (col)\r
+       int i=0;\r
+       while(1)\r
        {\r
-       case Cmd:\r
-               if (bDefault)\r
-                       return ::GetSysColor(COLOR_GRAYTEXT);\r
-               return (COLORREF)(DWORD)m_regCmd;\r
-       case Conflict:\r
-               if (bDefault)\r
-                       return RGB(255, 0, 0);\r
-               return (COLORREF)(DWORD)m_regConflict;\r
-       case Modified:\r
-               if (bDefault)\r
-                       return RGB(0, 50, 160);\r
-               return (COLORREF)(DWORD)m_regModified;\r
-       case Merged:\r
-               if (bDefault)\r
-                       return RGB(0, 100, 0);\r
-               return (COLORREF)(DWORD)m_regMerged;\r
-       case Deleted:\r
-               if (bDefault)\r
-                       return RGB(100, 0, 0);\r
-               return (COLORREF)(DWORD)m_regDeleted;\r
-       case Added:\r
-               if (bDefault)\r
-                       return RGB(100, 0, 100);\r
-               return (COLORREF)(DWORD)m_regAdded;\r
-       case LastCommit:\r
-               if (bDefault)\r
-                       return RGB(100, 100, 100);\r
-               return (COLORREF)(DWORD)m_regAdded;\r
-       case DeletedNode:\r
-               if (bDefault)\r
-                       return RGB(255, 0, 0);\r
-               return (COLORREF)(DWORD)m_regDeletedNode;\r
-       case AddedNode:\r
-               if (bDefault)\r
-                       return RGB(0, 255, 0);\r
-               return (COLORREF)(DWORD)m_regAddedNode;\r
-       case ReplacedNode:\r
-               if (bDefault)\r
-                       return RGB(0, 255, 0);\r
-               return (COLORREF)(DWORD)m_regReplacedNode;\r
-       case RenamedNode:\r
-               if (bDefault)\r
-                       return RGB(0, 0, 255);\r
-               return (COLORREF)(DWORD)m_regRenamedNode;\r
-       case LastCommitNode:\r
-               if (bDefault)\r
-                       return RGB(200, 200, 200);\r
-               return (COLORREF)(DWORD)m_regLastCommitNode;\r
-       case PropertyChanged:\r
-               if (bDefault)\r
-                       return RGB(0, 50, 160);\r
-               return (COLORREF)(DWORD)m_regPropertyChanged;\r
+               if(m_ColorArray[i].Color == COLOR_END)\r
+                       return RGB(0,0,0);\r
+\r
+               if(m_ColorArray[i].Color == col)\r
+               {\r
+                       if(bDefault)\r
+                               return m_ColorArray[i].Default;\r
+                       else\r
+                       {\r
+                               CRegDWORD reg(m_ColorArray[i].RegKey,m_ColorArray[i].Default);\r
+                               return (COLORREF)(DWORD) reg;\r
+                       }\r
+               }\r
+\r
+               i++;\r
        }\r
-       return RGB(0,0,0);\r
 }\r
 \r
 void CColors::SetColor(Colors col, COLORREF cr)\r
 {\r
-       switch (col)\r
+       int i=0;\r
+       while(1)\r
        {\r
-       case Cmd:\r
-               m_regCmd = cr;\r
-               break;\r
-       case Conflict:\r
-               m_regConflict = cr;\r
-               break;\r
-       case Modified:\r
-               m_regModified = cr;\r
-               break;\r
-       case Merged:\r
-               m_regMerged = cr;\r
-               break;\r
-       case Deleted:\r
-               m_regDeleted = cr;\r
-               break;\r
-       case Added:\r
-               m_regAdded = cr;\r
-               break;\r
-       case DeletedNode:\r
-               m_regDeletedNode = cr;\r
-               break;\r
-       case AddedNode:\r
-               m_regAddedNode = cr;\r
-               break;\r
-       case ReplacedNode:\r
-               m_regReplacedNode = cr;\r
-               break;\r
-       case RenamedNode:\r
-               m_regRenamedNode = cr;\r
-               break;\r
-       case LastCommit:\r
-               m_regLastCommit = cr;\r
-               break;\r
-       case PropertyChanged:\r
-               m_regPropertyChanged = cr;\r
-               break;\r
-       default:\r
-               ATLASSERT(false);\r
+               if(m_ColorArray[i].Color == COLOR_END)\r
+                       break;\r
+\r
+               if(m_ColorArray[i].Color == col)\r
+               {\r
+                       CRegDWORD reg(m_ColorArray[i].RegKey,m_ColorArray[i].Default);\r
+                       reg=cr;\r
+                       \r
+               }\r
+               i++;\r
        }\r
-}
\ No newline at end of file
+}\r
index 4400165..035949a 100644 (file)
@@ -43,13 +43,37 @@ public:
                ReplacedNode,\r
                RenamedNode,\r
                LastCommitNode,\r
-               PropertyChanged\r
+               PropertyChanged,\r
+               CurrentBranch,\r
+               LocalBranch,\r
+               RemoteBranch,\r
+               Tag,\r
+               BranchLine1,\r
+               BranchLine2,\r
+               BranchLine3,\r
+               BranchLine4,\r
+               BranchLine5,\r
+               BranchLine6,\r
+               BranchLine7,\r
+               BranchLine8,\r
+               COLOR_END=-1\r
        };\r
        \r
        COLORREF GetColor(Colors col, bool bDefault = false);\r
        void SetColor(Colors col, COLORREF cr);\r
-       \r
+\r
+       struct COLOR_DATA\r
+       {\r
+               Colors          Color;\r
+               TCHAR *         RegKey;\r
+               COLORREF        Default;\r
+       };\r
+\r
 private:\r
+\r
+       static COLOR_DATA m_ColorArray[];\r
+\r
+       /*\r
        CRegDWORD m_regCmd;\r
        CRegDWORD m_regConflict;\r
        CRegDWORD m_regModified;\r
@@ -63,4 +87,17 @@ private:
        CRegDWORD m_regRenamedNode;\r
        CRegDWORD m_regLastCommitNode;\r
        CRegDWORD m_regPropertyChanged;\r
+       CRegDWORD m_regCurrentBranch;\r
+       CRegDWORD m_regLocalBranch;\r
+       CRegDWORD m_regRemoteBranch;\r
+       CRegDWORD m_regTag;\r
+       CRegDWORD m_regBranchLine1;\r
+       CRegDWORD m_regBranchLine2;\r
+       CRegDWORD m_regBranchLine3;\r
+       CRegDWORD m_regBranchLine4;\r
+       CRegDWORD m_regBranchLine5;\r
+       CRegDWORD m_regBranchLine6;\r
+       CRegDWORD m_regBranchLine7;\r
+       CRegDWORD m_regBranchLine8;\r
+*/\r
 };\r
index df70d6e..4997bd7 100644 (file)
@@ -83,6 +83,7 @@ CGitLogListBase::CGitLogListBase():CHintListCtrl()
        m_bFilterWithRegex = !!CRegDWORD(_T("Software\\TortoiseGit\\UseRegexFilter"), TRUE);\r
 \r
        g_Git.GetMapHashToFriendName(m_HashMap);\r
+       m_CurrentBranch=g_Git.GetCurrentBranch();\r
 \r
        m_From=CTime(1970,1,2,0,0,0);\r
        m_To=CTime::GetCurrentTime();\r
@@ -90,6 +91,11 @@ CGitLogListBase::CGitLogListBase():CHintListCtrl()
        m_LoadingThread = NULL;\r
 \r
        m_bExitThread=FALSE;\r
+\r
+       for(int i=0;i<Lanes::COLORS_NUM;i++)\r
+       {\r
+               m_LineColors[i] = m_Colors.GetColor((CColors::Colors)(CColors::BranchLine1+i));\r
+       }\r
 }\r
 \r
 CGitLogListBase::~CGitLogListBase()\r
@@ -386,14 +392,18 @@ void CGitLogListBase::DrawTagBranch(HDC hdc,CRect &rect,INT_PTR index)
                shortname=_T("");\r
                if(GetShortName(str,shortname,_T("refs/heads/")))\r
                {\r
-                       brush = ::CreateSolidBrush(RGB(0xff, 0, 0));\r
+                       if( shortname == m_CurrentBranch )\r
+                               brush = ::CreateSolidBrush(m_Colors.GetColor(CColors::CurrentBranch));\r
+                       else\r
+                               brush = ::CreateSolidBrush(m_Colors.GetColor(CColors::LocalBranch));\r
+\r
                }else if(GetShortName(str,shortname,_T("refs/remotes/")))\r
                {\r
-                       brush = ::CreateSolidBrush(RGB(0xff, 0xff, 0));\r
+                       brush = ::CreateSolidBrush(m_Colors.GetColor(CColors::RemoteBranch));\r
                }\r
                else if(GetShortName(str,shortname,_T("refs/tags/")))\r
                {\r
-                       brush = ::CreateSolidBrush(RGB(0, 0, 0xff));\r
+                       brush = ::CreateSolidBrush(m_Colors.GetColor(CColors::Tag));\r
                }\r
 \r
                if(!shortname.IsEmpty())\r
@@ -609,11 +619,7 @@ void CGitLogListBase::DrawGraph(HDC hdc,CRect &rect,INT_PTR index)
        rItem.stateMask = LVIS_SELECTED | LVIS_FOCUSED;\r
        GetItem(&rItem);\r
 \r
-       static const COLORREF colors[Lanes::COLORS_NUM] = { RGB(0,0,0), RGB(0xFF,0,0), RGB(0,0xFF,0),\r
-                                                  RGB(0,0,0xFF), RGB(128,128,128), RGB(128,128,0),\r
-                                                  RGB(0,128,128), RGB(128,0,128) };\r
-\r
-\r
+       \r
 //     p->translate(QPoint(opt.rect.left(), opt.rect.top()));\r
 \r
 \r
@@ -646,10 +652,10 @@ void CGitLogListBase::DrawGraph(HDC hdc,CRect &rect,INT_PTR index)
                            || ln ==Lanes:: CROSS_EMPTY) ? mergeLane : i;\r
 \r
                if (ln == Lanes::CROSS) {\r
-                       paintGraphLane(hdc, rect.Height(),Lanes::NOT_ACTIVE, x1, x2, colors[col % Lanes::COLORS_NUM],rect.top);\r
-                       paintGraphLane(hdc, rect.Height(),Lanes::CROSS, x1, x2, colors[mergeLane % Lanes::COLORS_NUM],rect.top);\r
+                       paintGraphLane(hdc, rect.Height(),Lanes::NOT_ACTIVE, x1, x2, m_LineColors[col % Lanes::COLORS_NUM],rect.top);\r
+                       paintGraphLane(hdc, rect.Height(),Lanes::CROSS, x1, x2, m_LineColors[mergeLane % Lanes::COLORS_NUM],rect.top);\r
                } else\r
-                       paintGraphLane(hdc, rect.Height(),ln, x1, x2, colors[col % Lanes::COLORS_NUM],rect.top);\r
+                       paintGraphLane(hdc, rect.Height(),ln, x1, x2, m_LineColors[col % Lanes::COLORS_NUM],rect.top);\r
        }\r
 \r
        TRACE(_T("index %d %d\r\n"),index,data->m_Lanes.size());\r
index d668f14..fb3dfd7 100644 (file)
@@ -158,6 +158,7 @@ public:
        {       \r
                m_HashMap.clear();\r
                g_Git.GetMapHashToFriendName(m_HashMap);\r
+               m_CurrentBranch=g_Git.GetCurrentBranch();\r
        }\r
        void TerminateThread()\r
        {\r
@@ -214,9 +215,11 @@ protected:
        CStoreSelection*        m_pStoreSelection;\r
        MAP_HASH_NAME           m_HashMap;\r
 \r
+       CColors                         m_Colors;\r
 \r
-\r
+       CString                         m_CurrentBranch;\r
        \r
+       COLORREF                        m_LineColors[Lanes::COLORS_NUM];\r
 };\r
 \r
 \r
index 782c2e2..8794e03 100644 (file)
@@ -94,6 +94,8 @@ void CSettings::AddPropPages()
        AddPage(m_pMiscPage);\r
        AddPage(m_pRevisionGraphPage);\r
        AddPage(m_pColorsPage);\r
+       AddPage(m_pColorsPage2);\r
+       AddPage(m_pColorsPage3);\r
        AddPage(m_pSavedPage);\r
 //     AddPage(m_pLogCachePage);\r
 //    AddPage(m_pLogCacheListPage);\r
@@ -143,6 +145,8 @@ void CSettings::HandleRestart()
 ////   restart |= m_pLogCachePage->GetRestart();\r
 //     restart |= m_pLogCacheListPage->GetRestart();\r
        restart |= m_pColorsPage->GetRestart();\r
+       restart |= m_pColorsPage2->GetRestart();\r
+       restart |= m_pColorsPage3->GetRestart();\r
        restart |= m_pSavedPage->GetRestart();\r
 ////   restart |= m_pHooksPage->GetRestart();\r
        restart |= m_pBugTraqPage->GetRestart();\r
index 98aed92..3b8e953 100644 (file)
@@ -34,96 +34,65 @@ CSettingsColors2::~CSettingsColors2()
 void CSettingsColors2::DoDataExchange(CDataExchange* pDX)\r
 {\r
        ISettingsPropPage::DoDataExchange(pDX);\r
-       DDX_Control(pDX, IDC_CONFLICTCOLOR, m_cConflict);\r
-       DDX_Control(pDX, IDC_ADDEDCOLOR, m_cAdded);\r
-       DDX_Control(pDX, IDC_DELETEDCOLOR, m_cDeleted);\r
-       DDX_Control(pDX, IDC_MERGEDCOLOR, m_cMerged);\r
-       DDX_Control(pDX, IDC_MODIFIEDCOLOR, m_cModified);\r
-       DDX_Control(pDX, IDC_DELETEDNODECOLOR, m_cDeletedNode);\r
-       DDX_Control(pDX, IDC_ADDEDNODECOLOR, m_cAddedNode);\r
-       DDX_Control(pDX, IDC_REPLACEDNODECOLOR, m_cReplacedNode);\r
-       DDX_Control(pDX, IDC_RENAMEDNODECOLOR, m_cRenamedNode);\r
+       DDX_Control(pDX, IDC_CURRENT_BRANCH, this->m_cCurrentBranch);\r
+       DDX_Control(pDX, IDC_LOCAL_BRANCH,       this->m_cLocalBranch);\r
+       DDX_Control(pDX, IDC_REMOTE_BRANCH,  this->m_cRemoteBranch);\r
+       DDX_Control(pDX, IDC_TAGS,                      this->m_cTags);\r
 }\r
 \r
 \r
 BEGIN_MESSAGE_MAP(CSettingsColors2, ISettingsPropPage)\r
        ON_BN_CLICKED(IDC_RESTORE, OnBnClickedRestore)\r
-       ON_BN_CLICKED(IDC_CONFLICTCOLOR, &CSettingsColors2::OnBnClickedColor)\r
-       ON_BN_CLICKED(IDC_ADDEDCOLOR, &CSettingsColors2::OnBnClickedColor)\r
-       ON_BN_CLICKED(IDC_DELETEDCOLOR, &CSettingsColors2::OnBnClickedColor)\r
-       ON_BN_CLICKED(IDC_MERGEDCOLOR, &CSettingsColors2::OnBnClickedColor)\r
-       ON_BN_CLICKED(IDC_MODIFIEDCOLOR, &CSettingsColors2::OnBnClickedColor)\r
-       ON_BN_CLICKED(IDC_DELETEDNODECOLOR, &CSettingsColors2::OnBnClickedColor)\r
-       ON_BN_CLICKED(IDC_ADDEDNODECOLOR, &CSettingsColors2::OnBnClickedColor)\r
-       ON_BN_CLICKED(IDC_REPLACEDNODECOLOR, &CSettingsColors2::OnBnClickedColor)\r
-       ON_BN_CLICKED(IDC_RENAMEDNODECOLOR, &CSettingsColors2::OnBnClickedColor)\r
+       ON_BN_CLICKED(IDC_CURRENT_BRANCH, &CSettingsColors2::OnBnClickedColor)\r
+       ON_BN_CLICKED(IDC_LOCAL_BRANCH, &CSettingsColors2::OnBnClickedColor)\r
+       ON_BN_CLICKED(IDC_REMOTE_BRANCH, &CSettingsColors2::OnBnClickedColor)\r
+       ON_BN_CLICKED(IDC_TAGS, &CSettingsColors2::OnBnClickedColor)\r
 END_MESSAGE_MAP()\r
 \r
 BOOL CSettingsColors2::OnInitDialog()\r
 {\r
        ISettingsPropPage::OnInitDialog();\r
 \r
-       m_cAdded.SetColor(m_Colors.GetColor(CColors::Added));\r
-       m_cDeleted.SetColor(m_Colors.GetColor(CColors::Deleted));\r
-       m_cMerged.SetColor(m_Colors.GetColor(CColors::Merged));\r
-       m_cModified.SetColor(m_Colors.GetColor(CColors::Modified));\r
-       m_cConflict.SetColor(m_Colors.GetColor(CColors::Conflict));\r
-       m_cAddedNode.SetColor(m_Colors.GetColor(CColors::AddedNode));\r
-       m_cDeletedNode.SetColor(m_Colors.GetColor(CColors::DeletedNode));\r
-       m_cRenamedNode.SetColor(m_Colors.GetColor(CColors::RenamedNode));\r
-       m_cReplacedNode.SetColor(m_Colors.GetColor(CColors::ReplacedNode));\r
-\r
+       m_cCurrentBranch.SetColor(m_Colors.GetColor(CColors::CurrentBranch));\r
+       m_cLocalBranch.SetColor(m_Colors.GetColor(CColors::LocalBranch));\r
+       m_cRemoteBranch.SetColor(m_Colors.GetColor(CColors::RemoteBranch));\r
+       m_cTags.SetColor(m_Colors.GetColor(CColors::Tag));\r
+       \r
        CString sDefaultText, sCustomText;\r
        sDefaultText.LoadString(IDS_COLOURPICKER_DEFAULTTEXT);\r
        sCustomText.LoadString(IDS_COLOURPICKER_CUSTOMTEXT);\r
-       m_cAdded.EnableAutomaticButton(sDefaultText, m_Colors.GetColor(CColors::Added, true));\r
-       m_cAdded.EnableOtherButton(sCustomText);\r
-       m_cDeleted.EnableAutomaticButton(sDefaultText, m_Colors.GetColor(CColors::Deleted, true));\r
-       m_cDeleted.EnableOtherButton(sCustomText);\r
-       m_cMerged.EnableAutomaticButton(sDefaultText, m_Colors.GetColor(CColors::Merged, true));\r
-       m_cMerged.EnableOtherButton(sCustomText);\r
-       m_cModified.EnableAutomaticButton(sDefaultText, m_Colors.GetColor(CColors::Modified, true));\r
-       m_cModified.EnableOtherButton(sCustomText);\r
-       m_cConflict.EnableAutomaticButton(sDefaultText, m_Colors.GetColor(CColors::Conflict, true));\r
-       m_cConflict.EnableOtherButton(sCustomText);\r
-       m_cAddedNode.EnableAutomaticButton(sDefaultText, m_Colors.GetColor(CColors::AddedNode, true));\r
-       m_cAddedNode.EnableOtherButton(sCustomText);\r
-       m_cDeletedNode.EnableAutomaticButton(sDefaultText, m_Colors.GetColor(CColors::DeletedNode, true));\r
-       m_cDeletedNode.EnableOtherButton(sCustomText);\r
-       m_cRenamedNode.EnableAutomaticButton(sDefaultText, m_Colors.GetColor(CColors::RenamedNode, true));\r
-       m_cRenamedNode.EnableOtherButton(sCustomText);\r
-       m_cReplacedNode.EnableAutomaticButton(sDefaultText, m_Colors.GetColor(CColors::ReplacedNode, true));\r
-       m_cReplacedNode.EnableOtherButton(sCustomText);\r
+\r
+       m_cCurrentBranch.EnableAutomaticButton(sDefaultText, m_Colors.GetColor(CColors::CurrentBranch, true));\r
+       m_cCurrentBranch.EnableOtherButton(sCustomText);\r
        \r
+       m_cLocalBranch.EnableAutomaticButton(sDefaultText, m_Colors.GetColor(CColors::LocalBranch, true));\r
+       m_cLocalBranch.EnableOtherButton(sCustomText);\r
+\r
+       m_cRemoteBranch.EnableAutomaticButton(sDefaultText, m_Colors.GetColor(CColors::RemoteBranch, true));\r
+       m_cRemoteBranch.EnableOtherButton(sCustomText);\r
+\r
+       m_cTags.EnableAutomaticButton(sDefaultText, m_Colors.GetColor(CColors::Tag, true));\r
+       m_cTags.EnableOtherButton(sCustomText);\r
+\r
        return TRUE;\r
 }\r
 \r
 void CSettingsColors2::OnBnClickedRestore()\r
 {\r
-       m_cAdded.SetColor(m_Colors.GetColor(CColors::Added));\r
-       m_cDeleted.SetColor(m_Colors.GetColor(CColors::Deleted));\r
-       m_cMerged.SetColor(m_Colors.GetColor(CColors::Merged));\r
-       m_cModified.SetColor(m_Colors.GetColor(CColors::Modified));\r
-       m_cConflict.SetColor(m_Colors.GetColor(CColors::Conflict));\r
-       m_cAddedNode.SetColor(m_Colors.GetColor(CColors::AddedNode));\r
-       m_cDeletedNode.SetColor(m_Colors.GetColor(CColors::DeletedNode));\r
-       m_cRenamedNode.SetColor(m_Colors.GetColor(CColors::RenamedNode));\r
-       m_cReplacedNode.SetColor(m_Colors.GetColor(CColors::ReplacedNode));\r
+       m_cCurrentBranch.SetColor(m_Colors.GetColor(CColors::CurrentBranch));\r
+       m_cLocalBranch.SetColor(m_Colors.GetColor(CColors::LocalBranch));\r
+       m_cRemoteBranch.SetColor(m_Colors.GetColor(CColors::RemoteBranch));\r
+       m_cTags.SetColor(m_Colors.GetColor(CColors::Tag));\r
+\r
        SetModified(TRUE);\r
 }\r
 \r
 BOOL CSettingsColors2::OnApply()\r
 {\r
-       m_Colors.SetColor(CColors::Added, m_cAdded.GetColor() == -1 ? m_cAdded.GetAutomaticColor() : m_cAdded.GetColor());\r
-       m_Colors.SetColor(CColors::Deleted, m_cDeleted.GetColor() == -1 ? m_cDeleted.GetAutomaticColor() : m_cDeleted.GetColor());\r
-       m_Colors.SetColor(CColors::Merged, m_cMerged.GetColor() == -1 ? m_cMerged.GetAutomaticColor() : m_cMerged.GetColor());\r
-       m_Colors.SetColor(CColors::Modified, m_cModified.GetColor() == -1 ? m_cModified.GetAutomaticColor() : m_cModified.GetColor());\r
-       m_Colors.SetColor(CColors::Conflict, m_cConflict.GetColor() == -1 ? m_cConflict.GetAutomaticColor() : m_cConflict.GetColor());\r
-       m_Colors.SetColor(CColors::AddedNode, m_cAddedNode.GetColor() == -1 ? m_cAddedNode.GetAutomaticColor() : m_cAddedNode.GetColor());\r
-       m_Colors.SetColor(CColors::DeletedNode, m_cDeletedNode.GetColor() == -1 ? m_cDeletedNode.GetAutomaticColor() : m_cDeletedNode.GetColor());\r
-       m_Colors.SetColor(CColors::RenamedNode, m_cRenamedNode.GetColor() == -1 ? m_cRenamedNode.GetAutomaticColor() : m_cRenamedNode.GetColor());\r
-       m_Colors.SetColor(CColors::ReplacedNode, m_cReplacedNode.GetColor() == -1 ? m_cReplacedNode.GetAutomaticColor() : m_cReplacedNode.GetColor());\r
-       m_Colors.SetColor(CColors::PropertyChanged, m_cModified.GetColor() == -1 ? m_cModified.GetAutomaticColor() : m_cModified.GetColor());\r
+       m_Colors.SetColor(CColors::CurrentBranch,       m_cCurrentBranch.GetColor() == -1 ? m_cCurrentBranch.GetAutomaticColor() :      m_cCurrentBranch.GetColor());\r
+       m_Colors.SetColor(CColors::LocalBranch,         m_cLocalBranch.GetColor() == -1 ?       m_cLocalBranch.GetAutomaticColor() :    m_cLocalBranch.GetColor());\r
+       m_Colors.SetColor(CColors::RemoteBranch,        m_cRemoteBranch.GetColor() == -1 ?      m_cRemoteBranch.GetAutomaticColor() :   m_cRemoteBranch.GetColor());\r
+       m_Colors.SetColor(CColors::Tag,                         m_cTags.GetColor() == -1 ?                      m_cTags.GetAutomaticColor() :                   m_cTags.GetColor());\r
 \r
        return ISettingsPropPage::OnApply();\r
 }\r
index c74c1fb..a3d34c9 100644 (file)
@@ -45,15 +45,11 @@ protected:
 \r
        DECLARE_MESSAGE_MAP()\r
 private:\r
-       CMFCColorButton m_cConflict;\r
-       CMFCColorButton m_cAdded;\r
-       CMFCColorButton m_cDeleted;\r
-       CMFCColorButton m_cMerged;\r
-       CMFCColorButton m_cModified;\r
-       CMFCColorButton m_cAddedNode;\r
-       CMFCColorButton m_cDeletedNode;\r
-       CMFCColorButton m_cRenamedNode;\r
-       CMFCColorButton m_cReplacedNode;\r
+       CMFCColorButton m_cCurrentBranch;\r
+       CMFCColorButton m_cRemoteBranch;\r
+       CMFCColorButton m_cLocalBranch;\r
+       CMFCColorButton m_cTags;\r
+       \r
        CColors                 m_Colors;\r
 public:\r
 };\r
index b24104d..5631ccb 100644 (file)
@@ -34,97 +34,64 @@ CSettingsColors3::~CSettingsColors3()
 void CSettingsColors3::DoDataExchange(CDataExchange* pDX)\r
 {\r
        ISettingsPropPage::DoDataExchange(pDX);\r
-       DDX_Control(pDX, IDC_CONFLICTCOLOR, m_cConflict);\r
-       DDX_Control(pDX, IDC_ADDEDCOLOR, m_cAdded);\r
-       DDX_Control(pDX, IDC_DELETEDCOLOR, m_cDeleted);\r
-       DDX_Control(pDX, IDC_MERGEDCOLOR, m_cMerged);\r
-       DDX_Control(pDX, IDC_MODIFIEDCOLOR, m_cModified);\r
-       DDX_Control(pDX, IDC_DELETEDNODECOLOR, m_cDeletedNode);\r
-       DDX_Control(pDX, IDC_ADDEDNODECOLOR, m_cAddedNode);\r
-       DDX_Control(pDX, IDC_REPLACEDNODECOLOR, m_cReplacedNode);\r
-       DDX_Control(pDX, IDC_RENAMEDNODECOLOR, m_cRenamedNode);\r
+       DDX_Control(pDX, IDC_COLOR_LINE1, m_cLine[0]);\r
+       DDX_Control(pDX, IDC_COLOR_LINE2, m_cLine[1]);\r
+       DDX_Control(pDX, IDC_COLOR_LINE3, m_cLine[2]);\r
+       DDX_Control(pDX, IDC_COLOR_LINE4, m_cLine[3]);\r
+       DDX_Control(pDX, IDC_COLOR_LINE5, m_cLine[4]);\r
+       DDX_Control(pDX, IDC_COLOR_LINE6, m_cLine[5]);\r
+       DDX_Control(pDX, IDC_COLOR_LINE7, m_cLine[6]);\r
+       DDX_Control(pDX, IDC_COLOR_LINE8, m_cLine[7]);\r
+\r
 }\r
 \r
 \r
 BEGIN_MESSAGE_MAP(CSettingsColors3, ISettingsPropPage)\r
        ON_BN_CLICKED(IDC_RESTORE, OnBnClickedRestore)\r
-       ON_BN_CLICKED(IDC_CONFLICTCOLOR, &CSettingsColors3::OnBnClickedColor)\r
-       ON_BN_CLICKED(IDC_ADDEDCOLOR, &CSettingsColors3::OnBnClickedColor)\r
-       ON_BN_CLICKED(IDC_DELETEDCOLOR, &CSettingsColors3::OnBnClickedColor)\r
-       ON_BN_CLICKED(IDC_MERGEDCOLOR, &CSettingsColors3::OnBnClickedColor)\r
-       ON_BN_CLICKED(IDC_MODIFIEDCOLOR, &CSettingsColors3::OnBnClickedColor)\r
-       ON_BN_CLICKED(IDC_DELETEDNODECOLOR, &CSettingsColors3::OnBnClickedColor)\r
-       ON_BN_CLICKED(IDC_ADDEDNODECOLOR, &CSettingsColors3::OnBnClickedColor)\r
-       ON_BN_CLICKED(IDC_REPLACEDNODECOLOR, &CSettingsColors3::OnBnClickedColor)\r
-       ON_BN_CLICKED(IDC_RENAMEDNODECOLOR, &CSettingsColors3::OnBnClickedColor)\r
+       ON_BN_CLICKED(IDC_COLOR_LINE1, &CSettingsColors3::OnBnClickedColor)\r
+       ON_BN_CLICKED(IDC_COLOR_LINE2, &CSettingsColors3::OnBnClickedColor)\r
+       ON_BN_CLICKED(IDC_COLOR_LINE3, &CSettingsColors3::OnBnClickedColor)\r
+       ON_BN_CLICKED(IDC_COLOR_LINE4, &CSettingsColors3::OnBnClickedColor)\r
+       ON_BN_CLICKED(IDC_COLOR_LINE5, &CSettingsColors3::OnBnClickedColor)\r
+       ON_BN_CLICKED(IDC_COLOR_LINE6, &CSettingsColors3::OnBnClickedColor)\r
+       ON_BN_CLICKED(IDC_COLOR_LINE7, &CSettingsColors3::OnBnClickedColor)\r
+       ON_BN_CLICKED(IDC_COLOR_LINE8, &CSettingsColors3::OnBnClickedColor)\r
 END_MESSAGE_MAP()\r
 \r
 BOOL CSettingsColors3::OnInitDialog()\r
 {\r
        ISettingsPropPage::OnInitDialog();\r
-\r
-       m_cAdded.SetColor(m_Colors.GetColor(CColors::Added));\r
-       m_cDeleted.SetColor(m_Colors.GetColor(CColors::Deleted));\r
-       m_cMerged.SetColor(m_Colors.GetColor(CColors::Merged));\r
-       m_cModified.SetColor(m_Colors.GetColor(CColors::Modified));\r
-       m_cConflict.SetColor(m_Colors.GetColor(CColors::Conflict));\r
-       m_cAddedNode.SetColor(m_Colors.GetColor(CColors::AddedNode));\r
-       m_cDeletedNode.SetColor(m_Colors.GetColor(CColors::DeletedNode));\r
-       m_cRenamedNode.SetColor(m_Colors.GetColor(CColors::RenamedNode));\r
-       m_cReplacedNode.SetColor(m_Colors.GetColor(CColors::ReplacedNode));\r
-\r
+       \r
        CString sDefaultText, sCustomText;\r
        sDefaultText.LoadString(IDS_COLOURPICKER_DEFAULTTEXT);\r
        sCustomText.LoadString(IDS_COLOURPICKER_CUSTOMTEXT);\r
-       m_cAdded.EnableAutomaticButton(sDefaultText, m_Colors.GetColor(CColors::Added, true));\r
-       m_cAdded.EnableOtherButton(sCustomText);\r
-       m_cDeleted.EnableAutomaticButton(sDefaultText, m_Colors.GetColor(CColors::Deleted, true));\r
-       m_cDeleted.EnableOtherButton(sCustomText);\r
-       m_cMerged.EnableAutomaticButton(sDefaultText, m_Colors.GetColor(CColors::Merged, true));\r
-       m_cMerged.EnableOtherButton(sCustomText);\r
-       m_cModified.EnableAutomaticButton(sDefaultText, m_Colors.GetColor(CColors::Modified, true));\r
-       m_cModified.EnableOtherButton(sCustomText);\r
-       m_cConflict.EnableAutomaticButton(sDefaultText, m_Colors.GetColor(CColors::Conflict, true));\r
-       m_cConflict.EnableOtherButton(sCustomText);\r
-       m_cAddedNode.EnableAutomaticButton(sDefaultText, m_Colors.GetColor(CColors::AddedNode, true));\r
-       m_cAddedNode.EnableOtherButton(sCustomText);\r
-       m_cDeletedNode.EnableAutomaticButton(sDefaultText, m_Colors.GetColor(CColors::DeletedNode, true));\r
-       m_cDeletedNode.EnableOtherButton(sCustomText);\r
-       m_cRenamedNode.EnableAutomaticButton(sDefaultText, m_Colors.GetColor(CColors::RenamedNode, true));\r
-       m_cRenamedNode.EnableOtherButton(sCustomText);\r
-       m_cReplacedNode.EnableAutomaticButton(sDefaultText, m_Colors.GetColor(CColors::ReplacedNode, true));\r
-       m_cReplacedNode.EnableOtherButton(sCustomText);\r
-       \r
+\r
+       for(int i=0;i<8;i++)\r
+       {\r
+               m_cLine[i].SetColor(m_Colors.GetColor((CColors::Colors)(CColors::BranchLine1+i)));\r
+               m_cLine[i].EnableAutomaticButton(sDefaultText, m_Colors.GetColor((CColors::Colors)(CColors::BranchLine1+i), true));\r
+               m_cLine[i].EnableOtherButton(sCustomText);\r
+       }\r
+\r
        return TRUE;\r
 }\r
 \r
 void CSettingsColors3::OnBnClickedRestore()\r
 {\r
-       m_cAdded.SetColor(m_Colors.GetColor(CColors::Added));\r
-       m_cDeleted.SetColor(m_Colors.GetColor(CColors::Deleted));\r
-       m_cMerged.SetColor(m_Colors.GetColor(CColors::Merged));\r
-       m_cModified.SetColor(m_Colors.GetColor(CColors::Modified));\r
-       m_cConflict.SetColor(m_Colors.GetColor(CColors::Conflict));\r
-       m_cAddedNode.SetColor(m_Colors.GetColor(CColors::AddedNode));\r
-       m_cDeletedNode.SetColor(m_Colors.GetColor(CColors::DeletedNode));\r
-       m_cRenamedNode.SetColor(m_Colors.GetColor(CColors::RenamedNode));\r
-       m_cReplacedNode.SetColor(m_Colors.GetColor(CColors::ReplacedNode));\r
+       for(int i=0;i<8;i++)\r
+       {\r
+               m_cLine[i].SetColor(m_Colors.GetColor((CColors::Colors)(CColors::BranchLine1+i)));\r
+       }\r
        SetModified(TRUE);\r
 }\r
 \r
 BOOL CSettingsColors3::OnApply()\r
 {\r
-       m_Colors.SetColor(CColors::Added, m_cAdded.GetColor() == -1 ? m_cAdded.GetAutomaticColor() : m_cAdded.GetColor());\r
-       m_Colors.SetColor(CColors::Deleted, m_cDeleted.GetColor() == -1 ? m_cDeleted.GetAutomaticColor() : m_cDeleted.GetColor());\r
-       m_Colors.SetColor(CColors::Merged, m_cMerged.GetColor() == -1 ? m_cMerged.GetAutomaticColor() : m_cMerged.GetColor());\r
-       m_Colors.SetColor(CColors::Modified, m_cModified.GetColor() == -1 ? m_cModified.GetAutomaticColor() : m_cModified.GetColor());\r
-       m_Colors.SetColor(CColors::Conflict, m_cConflict.GetColor() == -1 ? m_cConflict.GetAutomaticColor() : m_cConflict.GetColor());\r
-       m_Colors.SetColor(CColors::AddedNode, m_cAddedNode.GetColor() == -1 ? m_cAddedNode.GetAutomaticColor() : m_cAddedNode.GetColor());\r
-       m_Colors.SetColor(CColors::DeletedNode, m_cDeletedNode.GetColor() == -1 ? m_cDeletedNode.GetAutomaticColor() : m_cDeletedNode.GetColor());\r
-       m_Colors.SetColor(CColors::RenamedNode, m_cRenamedNode.GetColor() == -1 ? m_cRenamedNode.GetAutomaticColor() : m_cRenamedNode.GetColor());\r
-       m_Colors.SetColor(CColors::ReplacedNode, m_cReplacedNode.GetColor() == -1 ? m_cReplacedNode.GetAutomaticColor() : m_cReplacedNode.GetColor());\r
-       m_Colors.SetColor(CColors::PropertyChanged, m_cModified.GetColor() == -1 ? m_cModified.GetAutomaticColor() : m_cModified.GetColor());\r
-\r
+       for(int i=0;i<8;i++)\r
+       {\r
+               m_Colors.SetColor((CColors::Colors)(CColors::BranchLine1+i), \r
+                       m_cLine[i].GetColor() == -1 ? m_cLine[i].GetAutomaticColor() : m_cLine[i].GetColor());\r
+       }\r
        return ISettingsPropPage::OnApply();\r
 }\r
 \r
index 42e99d1..da2bd89 100644 (file)
@@ -45,15 +45,7 @@ protected:
 \r
        DECLARE_MESSAGE_MAP()\r
 private:\r
-       CMFCColorButton m_cConflict;\r
-       CMFCColorButton m_cAdded;\r
-       CMFCColorButton m_cDeleted;\r
-       CMFCColorButton m_cMerged;\r
-       CMFCColorButton m_cModified;\r
-       CMFCColorButton m_cAddedNode;\r
-       CMFCColorButton m_cDeletedNode;\r
-       CMFCColorButton m_cRenamedNode;\r
-       CMFCColorButton m_cReplacedNode;\r
+       CMFCColorButton m_cLine[8];\r
        CColors                 m_Colors;\r
 public:\r
 };\r