OSDN Git Service

LogDlg: Reorg context menu sequence
authorFrank Li <lznuaa@gmail.com>
Fri, 27 Feb 2009 07:30:15 +0000 (15:30 +0800)
committerFrank Li <lznuaa@gmail.com>
Fri, 27 Feb 2009 07:30:15 +0000 (15:30 +0800)
Signed-off-by: Frank Li <lznuaa@gmail.com>
src/TortoiseProc/GitLogListBase.cpp

index c4425a8..58a3692 100644 (file)
@@ -1103,18 +1103,7 @@ void CGitLogListBase::OnContextMenu(CWnd* pWnd, CPoint point)
 \r
                        if(m_ContextMenuMask&GetContextMenuBit(ID_CREATE_TAG))\r
                                popup.AppendMenuIcon(ID_CREATE_TAG, _T("Create Tag at this version"), IDI_COPY);\r
-               }\r
-       \r
-               if ( GetSelectedCount() >0 )\r
-               {\r
-                       if(m_ContextMenuMask&GetContextMenuBit(ID_CHERRY_PICK))\r
-                               popup.AppendMenuIcon(ID_CHERRY_PICK, _T("Cherry Pick this version"), IDI_EXPORT);\r
-       \r
-               }\r
-\r
-               if (GetSelectedCount() == 1)\r
-               {\r
-                       CString str;\r
+                       \r
                        str.Format(_T("*Rebase %s to this"),g_Git.GetCurrentBranch());\r
 \r
                        if(pSelLogEntry->m_CommitHash != m_HeadHash)\r
@@ -1126,8 +1115,10 @@ void CGitLogListBase::OnContextMenu(CWnd* pWnd, CPoint point)
                        \r
 \r
                        popup.AppendMenu(MF_SEPARATOR, NULL);\r
+\r
                }\r
-               else if (GetSelectedCount() >= 2)\r
+       \r
+               if (GetSelectedCount() >= 2)\r
                {\r
                        bool bAddSeparator = false;\r
                        if (IsSelectionContinuous() || (GetSelectedCount() == 2))\r
@@ -1144,7 +1135,20 @@ void CGitLogListBase::OnContextMenu(CWnd* pWnd, CPoint point)
                                bAddSeparator = true;\r
                        }\r
 \r
-                       if ( IsSelectionContinuous() )\r
+                       if (m_hasWC)\r
+                       {\r
+                               //popup.AppendMenuIcon(ID_REVERTREV, IDS_LOG_POPUP_REVERTREVS, IDI_REVERT);\r
+//                             if (m_hasWC)\r
+//                                     popup.AppendMenuIcon(ID_MERGEREV, IDS_LOG_POPUP_MERGEREVS, IDI_MERGE);\r
+                               bAddSeparator = true;\r
+                       }\r
+                       if (bAddSeparator)\r
+                               popup.AppendMenu(MF_SEPARATOR, NULL);\r
+               }\r
+\r
+               if ( GetSelectedCount() >0 )\r
+               {\r
+                       if ( IsSelectionContinuous() && GetSelectedCount() >= 2 )\r
                        {\r
                                if(m_ContextMenuMask&GetContextMenuBit(ID_COMBINE_COMMIT))\r
                                {\r
@@ -1158,20 +1162,17 @@ void CGitLogListBase::OnContextMenu(CWnd* pWnd, CPoint point)
                                                hash=hash.Left(40);\r
                                                GitRev* pLastEntry = reinterpret_cast<GitRev*>(m_arShownList.GetAt(LastSelect));\r
                                                if(pLastEntry->m_CommitHash == hash)\r
-                                                       popup.AppendMenuIcon(ID_COMBINE_COMMIT,_T("*Combine to one commit"),IDI_MERGE);\r
+                                                       popup.AppendMenuIcon(ID_COMBINE_COMMIT,_T("*Combine to one commit"),IDI_COMBINE);\r
                                        }\r
                                }\r
                        }\r
-                       if (m_hasWC)\r
-                       {\r
-                               //popup.AppendMenuIcon(ID_REVERTREV, IDS_LOG_POPUP_REVERTREVS, IDI_REVERT);\r
-//                             if (m_hasWC)\r
-//                                     popup.AppendMenuIcon(ID_MERGEREV, IDS_LOG_POPUP_MERGEREVS, IDI_MERGE);\r
-                               bAddSeparator = true;\r
-                       }\r
-                       if (bAddSeparator)\r
-                               popup.AppendMenu(MF_SEPARATOR, NULL);\r
+                       if(m_ContextMenuMask&GetContextMenuBit(ID_CHERRY_PICK))\r
+                               popup.AppendMenuIcon(ID_CHERRY_PICK, _T("Cherry Pick this version"), IDI_EXPORT);\r
+                       popup.AppendMenu(MF_SEPARATOR, NULL);\r
+       \r
                }\r
+\r
+               \r
 #if 0\r
 //             if ((selEntries.size() > 0)&&(bAllFromTheSameAuthor))\r
 //             {\r