OSDN Git Service

Use Resource to show Menu Item Context
authorFrank Li <lznuaa@gmail.com>
Sun, 8 Mar 2009 12:52:30 +0000 (20:52 +0800)
committerFrank Li <lznuaa@gmail.com>
Mon, 9 Mar 2009 13:23:47 +0000 (21:23 +0800)
Signed-off-by: Frank Li <lznuaa@gmail.com>
src/Resources/CommonResource.h
src/Resources/TortoiseCommon.rc2
src/TortoiseProc/GitLogListBase.cpp

index cbe674c..bc3583e 100644 (file)
 #define IDS_SPELLEDIT_CORRECTIONS              20053\r
 #define IDS_SPELLEDIT_NOCORRECTIONS            20054\r
 \r
+#define IDS_REBASE_SKIP                                        20055\r
+#define IDS_REBASE_EDIT                                        20056\r
+#define IDS_REBASE_PICK                                        20057\r
+#define IDS_REBASE_SQUASH                              20058\r
 \r
-\r
+#define IDS_SWITCH_TO_THIS                             20059\r
+#define IDS_CREATE_BRANCH_AT_THIS              20060\r
+#define IDS_CREATE_TAG_AT_THIS                 20061\r
+#define IDS_EXPORT_TO_THIS                             20062\r
+#define IDS_REBASE_THIS_FORMAT                 20063\r
+#define IDS_RESET_TO_THIS_FORMAT               20064\r
+#define IDS_COMBINE_TO_ONE                             20065\r
+#define IDS_CHERRY_PICK_VERSION                        20066\r
+#define IDS_COPY_COMMIT_HASH                   20067\r
 \r
index dc23f60..e74c38e 100644 (file)
@@ -39,7 +39,7 @@ BEGIN
     IDS_LOG_POPUP_BLAMECOMPARE "Compare and &blame with working BASE"\r
     IDS_LOG_POPUP_BLAMEREVS "&Blame revisions"\r
     IDS_LOG_POPUP_BLAMEDIFF "&Blame changes"\r
-    IDS_LOG_POPUP_VIEWREV   "View revision in &webviewer"\r
+    IDS_LOG_POPUP_VIEWREV   "View revision in Notepad2"\r
     IDS_LOG_POPUP_VIEWPATHREV "View revision for path in &webviewer"\r
     IDS_LOG_POPUP_COMPAREWITHPREVIOUS "Compare with previous revision"\r
     IDS_LOG_POPUP_BLAMEWITHPREVIOUS "Compare and blame with previous revision"\r
@@ -61,7 +61,23 @@ BEGIN
     IDS_LOG_POPUP_EDITLOG   "Edit log message"\r
     IDS_LOG_POPUP_OPENWITH  "Open with..."\r
        IDS_REPOBROWSE_SHOWREVPROP "Show revision properties"\r
-END\r
+       \r
+       IDS_REBASE_SKIP                 "Skip"\r
+       IDS_REBASE_EDIT                 "Edit"\r
+       IDS_REBASE_PICK                 "Pick"\r
+       IDS_REBASE_SQUASH               "Squash"\r
+       \r
+       IDS_SWITCH_TO_THIS                      "Switch/Checkout to this..."\r
+       IDS_CREATE_BRANCH_AT_THIS       "Create Branch at this version..."\r
+       IDS_CREATE_TAG_AT_THIS          "Create Tag at this version..."\r
+       IDS_REBASE_THIS_FORMAT          "*Rebase %s to this..."\r
+       IDS_EXPORT_TO_THIS                          "Export this version..."    \r
+       IDS_RESET_TO_THIS_FORMAT        "Reset %s to this..."\r
+       IDS_COMBINE_TO_ONE                      "*Combine to one commit"\r
+       IDS_CHERRY_PICK_VERSION         "Cherry Pick this version..."\r
+       IDS_COPY_COMMIT_HASH            "Copy Commit Hash"\r
+       \r
+END \r
 \r
 \r
 STRINGTABLE \r
index 58a3692..d9310bc 100644 (file)
@@ -1029,16 +1029,16 @@ void CGitLogListBase::OnContextMenu(CWnd* pWnd, CPoint point)
        {\r
 \r
                if(m_ContextMenuMask&GetContextMenuBit(ID_REBASE_PICK))\r
-                       popup.AppendMenuIcon(ID_REBASE_PICK,   _T("Pick"),   IDI_PICK);\r
+                       popup.AppendMenuIcon(ID_REBASE_PICK,  IDS_REBASE_SKIP,   IDI_PICK);\r
 \r
                if(m_ContextMenuMask&GetContextMenuBit(ID_REBASE_SQUASH))\r
-                       popup.AppendMenuIcon(ID_REBASE_SQUASH, _T("Squash"), IDI_SQUASH);\r
+                       popup.AppendMenuIcon(ID_REBASE_SQUASH,IDS_REBASE_SQUASH, IDI_SQUASH);\r
 \r
                if(m_ContextMenuMask&GetContextMenuBit(ID_REBASE_EDIT))\r
-                       popup.AppendMenuIcon(ID_REBASE_EDIT,   _T("Edit"),   IDI_EDIT);\r
+                       popup.AppendMenuIcon(ID_REBASE_EDIT,  IDS_REBASE_EDIT,   IDI_EDIT);\r
 \r
                if(m_ContextMenuMask&GetContextMenuBit(ID_REBASE_SKIP))\r
-                       popup.AppendMenuIcon(ID_REBASE_SKIP,   _T("SKIP"),   IDI_SKIP);\r
+                       popup.AppendMenuIcon(ID_REBASE_SKIP,  IDS_REBASE_SKIP,   IDI_SKIP);\r
                \r
                if(m_ContextMenuMask&(GetContextMenuBit(ID_REBASE_SKIP)|GetContextMenuBit(ID_REBASE_EDIT)|\r
                              GetContextMenuBit(ID_REBASE_SQUASH)|GetContextMenuBit(ID_REBASE_PICK)))\r
@@ -1089,29 +1089,31 @@ void CGitLogListBase::OnContextMenu(CWnd* pWnd, CPoint point)
                        //if (m_hasWC)\r
                        //      popup.AppendMenuIcon(ID_MERGEREV, IDS_LOG_POPUP_MERGEREV, IDI_MERGE);\r
                        \r
-                       CString str;\r
-                       str.Format(_T("Reset %s to this"),g_Git.GetCurrentBranch());\r
+                       CString str,format;\r
+                       format.LoadString(IDS_RESET_TO_THIS_FORMAT);\r
+                       str.Format(format,g_Git.GetCurrentBranch());\r
 \r
                        if(m_ContextMenuMask&GetContextMenuBit(ID_RESET))\r
                                popup.AppendMenuIcon(ID_RESET,str,IDI_REVERT);\r
 \r
                        if(m_ContextMenuMask&GetContextMenuBit(ID_SWITCHTOREV))\r
-                               popup.AppendMenuIcon(ID_SWITCHTOREV, _T("Switch/Checkout to this") , IDI_SWITCH);\r
+                               popup.AppendMenuIcon(ID_SWITCHTOREV, IDS_SWITCH_TO_THIS , IDI_SWITCH);\r
 \r
                        if(m_ContextMenuMask&GetContextMenuBit(ID_CREATE_BRANCH))\r
-                               popup.AppendMenuIcon(ID_CREATE_BRANCH, _T("Create Branch at this version") , IDI_COPY);\r
+                               popup.AppendMenuIcon(ID_CREATE_BRANCH, IDS_CREATE_BRANCH_AT_THIS , IDI_COPY);\r
 \r
                        if(m_ContextMenuMask&GetContextMenuBit(ID_CREATE_TAG))\r
-                               popup.AppendMenuIcon(ID_CREATE_TAG, _T("Create Tag at this version"), IDI_COPY);\r
+                               popup.AppendMenuIcon(ID_CREATE_TAG,IDS_CREATE_TAG_AT_THIS , IDI_COPY);\r
                        \r
-                       str.Format(_T("*Rebase %s to this"),g_Git.GetCurrentBranch());\r
+                       format.LoadString(IDS_REBASE_THIS_FORMAT);\r
+                       str.Format(format,g_Git.GetCurrentBranch());\r
 \r
                        if(pSelLogEntry->m_CommitHash != m_HeadHash)\r
                                if(m_ContextMenuMask&GetContextMenuBit(ID_REBASE_TO_VERSION))\r
                                        popup.AppendMenuIcon(ID_REBASE_TO_VERSION, str , IDI_REBASE);                   \r
 \r
                        if(m_ContextMenuMask&GetContextMenuBit(ID_EXPORT))\r
-                               popup.AppendMenuIcon(ID_EXPORT, _T("Export this version"), IDI_EXPORT); \r
+                               popup.AppendMenuIcon(ID_EXPORT,IDS_EXPORT_TO_THIS, IDI_EXPORT); \r
                        \r
 \r
                        popup.AppendMenu(MF_SEPARATOR, NULL);\r
@@ -1162,12 +1164,12 @@ 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_COMBINE);\r
+                                                       popup.AppendMenuIcon(ID_COMBINE_COMMIT,IDS_COMBINE_TO_ONE,IDI_COMBINE);\r
                                        }\r
                                }\r
                        }\r
                        if(m_ContextMenuMask&GetContextMenuBit(ID_CHERRY_PICK))\r
-                               popup.AppendMenuIcon(ID_CHERRY_PICK, _T("Cherry Pick this version"), IDI_EXPORT);\r
+                               popup.AppendMenuIcon(ID_CHERRY_PICK, IDS_CHERRY_PICK_VERSION, IDI_EXPORT);\r
                        popup.AppendMenu(MF_SEPARATOR, NULL);\r
        \r
                }\r
@@ -1190,7 +1192,7 @@ void CGitLogListBase::OnContextMenu(CWnd* pWnd, CPoint point)
                if (GetSelectedCount() == 1)\r
                {\r
                        if(m_ContextMenuMask&GetContextMenuBit(ID_COPYHASH))\r
-                               popup.AppendMenuIcon(ID_COPYHASH, _T("Copy Commit Hash"));\r
+                               popup.AppendMenuIcon(ID_COPYHASH, IDS_COPY_COMMIT_HASH);\r
                }\r
                if (GetSelectedCount() != 0)\r
                {\r