OSDN Git Service

Add Resolve to explore context menu
[tortoisegit/TortoiseGitJp.git] / src / TortoiseShell / ContextMenu.cpp
index a37baf4..5f819b6 100644 (file)
@@ -73,6 +73,9 @@ CShellExt::MenuInfo CShellExt::menuInfo[] =
        { ShellMenuShowChanged,                                 MENUSHOWCHANGED,        IDI_SHOWCHANGED,                IDS_MENUSHOWCHANGED,            IDS_MENUDESCSHOWCHANGED,\r
        ITEMIS_INSVN|ITEMIS_ONLYONE, 0, ITEMIS_FOLDER|ITEMIS_FOLDERINSVN|ITEMIS_ONLYONE, 0, 0, 0, 0, 0},\r
 \r
+       { ShellMenuRebase,                                          MENUREBASE,                 IDI_SHOWCHANGED,                IDS_MENUREBASE,                         IDS_MENUREBASE,\r
+       ITEMIS_INSVN|ITEMIS_ONLYONE, 0, ITEMIS_FOLDER|ITEMIS_FOLDERINSVN|ITEMIS_ONLYONE, 0, 0, 0, 0, 0},\r
+\r
 //     { ShellMenuRevisionGraph,                               MENUREVISIONGRAPH,      IDI_REVISIONGRAPH,              IDS_MENUREVISIONGRAPH,          IDS_MENUDESCREVISIONGRAPH,\r
 //     ITEMIS_INSVN|ITEMIS_ONLYONE, ITEMIS_ADDED, ITEMIS_FOLDER|ITEMIS_FOLDERINSVN|ITEMIS_ONLYONE, ITEMIS_ADDED, 0, 0, 0, 0},\r
 \r
@@ -81,8 +84,8 @@ CShellExt::MenuInfo CShellExt::menuInfo[] =
        { ShellMenuConflictEditor,                              MENUCONFLICTEDITOR,     IDI_CONFLICT,                   IDS_MENUCONFLICT,                       IDS_MENUDESCCONFLICT,\r
        ITEMIS_INSVN|ITEMIS_CONFLICTED, ITEMIS_FOLDER, 0, 0, 0, 0, 0, 0 },\r
 \r
-//     { ShellMenuResolve,                                             MENURESOLVE,            IDI_RESOLVE,                    IDS_MENURESOLVE,                        IDS_MENUDESCRESOLVE,\r
-//     ITEMIS_INSVN|ITEMIS_CONFLICTED, 0, ITEMIS_INSVN|ITEMIS_FOLDER, 0, ITEMIS_FOLDERINSVN, 0, 0, 0 },\r
+       { ShellMenuResolve,                                             MENURESOLVE,            IDI_RESOLVE,                    IDS_MENURESOLVE,                        IDS_MENUDESCRESOLVE,\r
+       ITEMIS_INSVN|ITEMIS_CONFLICTED, 0, ITEMIS_INSVN|ITEMIS_FOLDER, 0, ITEMIS_FOLDERINSVN, 0, 0, 0 },\r
 \r
 //     { ShellMenuUpdateExt,                                   MENUUPDATEEXT,          IDI_UPDATE,                             IDS_MENUUPDATEEXT,                      IDS_MENUDESCUPDATEEXT,\r
 //     ITEMIS_INSVN, ITEMIS_ADDED, ITEMIS_FOLDERINSVN, ITEMIS_ADDED, 0, 0, 0, 0 },\r
@@ -1173,13 +1176,8 @@ STDMETHODIMP CShellExt::QueryContextMenu(HMENU hMenu,
                                        }\r
                                        else\r
                                        {\r
-                                               // the 'get lock' command is special\r
                                                bool bIsTop = ((topmenu & menuInfo[menuIndex].menuID) != 0);\r
-                                               if (menuInfo[menuIndex].command == ShellMenuLock)\r
-                                               {\r
-                                                       if ((itemStates & ITEMIS_NEEDSLOCK) && g_ShellCache.IsGetLockTop())\r
-                                                               bIsTop = true;\r
-                                               }\r
+\r
                                                // insert the menu entry\r
                                                InsertGitMenu(  bIsTop,\r
                                                                                bIsTop ? hMenu : subMenu,\r
@@ -1620,6 +1618,14 @@ STDMETHODIMP CShellExt::InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi)
                                        svnCmd += folder_;\r
                                svnCmd += _T("\"");\r
                                break;\r
+                       case ShellMenuRebase:\r
+                               svnCmd += _T("rebase /path:\"");\r
+                               if (files_.size() > 0)\r
+                                       svnCmd += files_.front();\r
+                               else\r
+                                       svnCmd += folder_;\r
+                               svnCmd += _T("\"");\r
+                               break;\r
                        case ShellMenuShowChanged:\r
                                if (files_.size() > 1)\r
                 {\r
@@ -1759,28 +1765,6 @@ STDMETHODIMP CShellExt::InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi)
                                        svnCmd += folder_;\r
                                svnCmd += _T("\"");\r
                                break;\r
-                       case ShellMenuLock:\r
-                               tempfile = WriteFileListToTempFile();\r
-                               svnCmd += _T("lock /pathfile:\"");\r
-                               svnCmd += tempfile;\r
-                               svnCmd += _T("\"");\r
-                               svnCmd += _T(" /deletepathfile");\r
-                               break;\r
-                       case ShellMenuUnlock:\r
-                               tempfile = WriteFileListToTempFile();\r
-                               svnCmd += _T("unlock /pathfile:\"");\r
-                               svnCmd += tempfile;\r
-                               svnCmd += _T("\"");\r
-                               svnCmd += _T(" /deletepathfile");\r
-                               break;\r
-                       case ShellMenuUnlockForce:\r
-                               tempfile = WriteFileListToTempFile();\r
-                               svnCmd += _T("unlock /pathfile:\"");\r
-                               svnCmd += tempfile;\r
-                               svnCmd += _T("\"");\r
-                               svnCmd += _T(" /deletepathfile");\r
-                               svnCmd += _T(" /force");\r
-                               break;\r
                        case ShellMenuProperties:\r
                                tempfile = WriteFileListToTempFile();\r
                                svnCmd += _T("properties /pathfile:\"");\r
@@ -2149,18 +2133,6 @@ LPCTSTR CShellExt::GetMenuTextFromResource(int id)
                        resource = MAKEINTRESOURCE(menuInfo[menuIndex].iconID);\r
                        switch (id)\r
                        {\r
-                       case ShellMenuLock:\r
-                               // menu lock is special because it can be set to the top\r
-                               // with a separate option in the registry\r
-                               space = ((layout & MENULOCK) || ((itemStates & ITEMIS_NEEDSLOCK) && g_ShellCache.IsGetLockTop())) ? 0 : 6;\r
-                               if ((layout & MENULOCK) || ((itemStates & ITEMIS_NEEDSLOCK) && g_ShellCache.IsGetLockTop()))\r
-                               {\r
-                                       _tcscpy_s(textbuf, 255, _T("Git "));\r
-                                       _tcscat_s(textbuf, 255, stringtablebuffer);\r
-                                       _tcscpy_s(stringtablebuffer, 255, textbuf);\r
-                               }\r
-                               break;\r
-                               // the sub menu entries are special because they're *always* on the top level menu\r
                        case ShellSubMenuMultiple:\r
                        case ShellSubMenuLink:\r
                        case ShellSubMenuFolder:\r