OSDN Git Service

Add "BrowseRef" to shell extension command.
authorFrank Li <lznuaa@gmail.com>
Fri, 12 Jun 2009 14:38:48 +0000 (22:38 +0800)
committerFrank Li <lznuaa@gmail.com>
Fri, 12 Jun 2009 14:38:48 +0000 (22:38 +0800)
Press "shift" and right click. you will show "browse Refence" command.

Signed-off-by: Frank Li <lznuaa@gmail.com>
src/TortoiseProc/Commands/Command.cpp
src/TortoiseProc/TortoiseProc.vcproj
src/TortoiseShell/ContextMenu.cpp
src/TortoiseShell/Globals.h
src/TortoiseShell/ShellExt.h
src/TortoiseShell/resource.h
src/TortoiseShell/resourceshell.rc

index 45043be..8466501 100644 (file)
@@ -61,8 +61,8 @@
 #include "ReflogCommand.h"\r
 #include "SendMailCommand.h"\r
 #include "CatCommand.h"\r
+#include "RefBrowseCommand.h"\r
 \r
-#include "BrowseRefsDlg.h"\r
 \r
 #if 0\r
 \r
@@ -178,7 +178,7 @@ typedef enum
        cmdSubUpdate,\r
        cmdSubSync,\r
        cmdRefLog,\r
-       cmdTest\r
+       cmdRefBrowse\r
        \r
 } TGitCommand;\r
 \r
@@ -253,22 +253,10 @@ static const struct CommandInfo
        {       cmdSubUpdate,           _T("subupdate")                 },\r
        {       cmdSubSync,                     _T("subsync")                   },\r
        {       cmdRefLog,                      _T("reflog")                    },\r
-       {       cmdTest,                        _T("test")                              },\r
+       {       cmdRefBrowse,           _T("refbrowse")                 },\r
 };\r
 \r
 \r
-\r
-class TestCommand : public Command\r
-{\r
-       virtual bool Execute()\r
-       {\r
-               CBrowseRefsDlg(orgCmdLinePath.GetWinPath()).DoModal();\r
-               return true;\r
-       }\r
-};\r
-       \r
-\r
-\r
 Command * CommandServer::GetCommand(const CString& sCmd)\r
 {\r
        // Look up the command\r
@@ -375,8 +363,8 @@ Command * CommandServer::GetCommand(const CString& sCmd)
                return new SendMailCommand;\r
        case cmdCat:\r
                return new CatCommand;\r
-       case cmdTest:\r
-               return new TestCommand;\r
+       case cmdRefBrowse:\r
+               return new RefBrowseCommand;\r
 #if 0\r
 \r
        \r
index 467a000..6270413 100644 (file)
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath=".\copy.ico"\r
+                               RelativePath="..\Resources\copy.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\Resources\copy.ico"\r
+                               RelativePath=".\copy.ico"\r
                                >\r
                        </File>\r
                        <File\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\Resources\explorer.ico"\r
+                               RelativePath=".\explorer.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath=".\explorer.ico"\r
+                               RelativePath="..\Resources\explorer.ico"\r
                                >\r
                        </File>\r
                        <File\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath=".\newfolder.ico"\r
+                               RelativePath="..\Resources\newfolder.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\Resources\newfolder.ico"\r
+                               RelativePath=".\newfolder.ico"\r
                                >\r
                        </File>\r
                        <File\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath=".\refresh.ico"\r
+                               RelativePath="..\Resources\refresh.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\Resources\refresh.ico"\r
+                               RelativePath=".\refresh.ico"\r
                                >\r
                        </File>\r
                        <File\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\Resources\save.ico"\r
+                               RelativePath=".\save.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath=".\save.ico"\r
+                               RelativePath="..\Resources\save.ico"\r
                                >\r
                        </File>\r
                        <File\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath=".\up.ico"\r
+                               RelativePath="..\Resources\up.ico"\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\Resources\up.ico"\r
+                               RelativePath=".\up.ico"\r
                                >\r
                        </File>\r
                        <File\r
                                        >\r
                                </File>\r
                        </Filter>\r
+                       <Filter\r
+                               Name="RefBrowse"\r
+                               >\r
+                               <File\r
+                                       RelativePath=".\Commands\RefBrowseCommand.h"\r
+                                       >\r
+                               </File>\r
+                       </Filter>\r
                </Filter>\r
                <Filter\r
                        Name="Utility Dialogs"\r
index 953a281..1889ebf 100644 (file)
@@ -71,6 +71,10 @@ CShellExt::MenuInfo CShellExt::menuInfo[] =
        { ShellMenuRefLog,                                              MENUREFLOG,                     IDI_LOG,                                IDS_MENUREFLOG,                         IDS_MENUDESCREFLOG,\r
        ITEMIS_INSVN|ITEMIS_ONLYONE|ITEMIS_EXTENDED, ITEMIS_ADDED, ITEMIS_FOLDER|ITEMIS_FOLDERINSVN|ITEMIS_ONLYONE|ITEMIS_EXTENDED, ITEMIS_ADDED, ITEMIS_FOLDERINSVN|ITEMIS_ONLYONE|ITEMIS_EXTENDED, ITEMIS_ADDED, 0, 0 },\r
 \r
+       { ShellMenuRefBrowse,                                   MENUREFBROWSE,          IDI_REPOBROWSE,                 IDS_MENUREFBROWSE,                      IDS_MENUDESCREFBROWSE,\r
+       ITEMIS_INSVN|ITEMIS_ONLYONE|ITEMIS_EXTENDED, ITEMIS_ADDED, ITEMIS_FOLDER|ITEMIS_FOLDERINSVN|ITEMIS_ONLYONE|ITEMIS_EXTENDED, ITEMIS_ADDED, ITEMIS_FOLDERINSVN|ITEMIS_ONLYONE|ITEMIS_EXTENDED, ITEMIS_ADDED, 0, 0 },\r
+\r
+\r
 //     { ShellMenuRepoBrowse,                                  MENUREPOBROWSE,         IDI_REPOBROWSE,                 IDS_MENUREPOBROWSE,                     IDS_MENUDESCREPOBROWSE,\r
 //     ITEMIS_ONLYONE, 0, ITEMIS_FOLDERINSVN|ITEMIS_ONLYONE, 0, 0, 0, 0, 0 },\r
 \r
@@ -1846,6 +1850,14 @@ STDMETHODIMP CShellExt::InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi)
                                svnCmd += _T("\"");\r
                 }\r
                                break;\r
+                       case ShellMenuRefBrowse:\r
+                               svnCmd += _T("refbrowse /path:\"");\r
+                               if (files_.size() > 0)\r
+                                       svnCmd += files_.front();\r
+                               else\r
+                                       svnCmd += folder_;\r
+                               svnCmd += _T("\"");\r
+                               break;\r
                        case ShellMenuRefLog:\r
                                svnCmd += _T("reflog /path:\"");\r
                                if (files_.size() > 0)\r
index c404f83..fca182b 100644 (file)
@@ -37,7 +37,7 @@
 #define MENUDIFF                       0x0000000000010000\r
 #define MENULOG                                0x0000000000020000\r
 #define MENUCONFLICTEDITOR     0x0000000000040000\r
-//#define MENURELOCATE         0x0000000000080000\r
+#define MENUREFBROWSE          0x0000000000080000\r
 #define MENUSHOWCHANGED                0x0000000000100000\r
 #define MENUIGNORE                     0x0000000000200000\r
 #define MENUREFLOG                     0x0000000000400000\r
index 190276c..e17bd74 100644 (file)
@@ -134,6 +134,7 @@ protected:
                ShellMenuIgnoreCaseSensitive,\r
                ShellMenuIgnoreCaseInsensitive,\r
                ShellMenuRefLog,\r
+               ShellMenuRefBrowse,\r
                ShellMenuBlame,\r
                ShellMenuApplyPatch,\r
                ShellMenuCreatePatch,\r
index 6519125..9beed4e 100644 (file)
 #define IDI_MENUSYNC                    321\r
 #define IDS_MENUSENDMAIL                321\r
 #define IDS_MENUDESSENDMAIL             322\r
+#define IDS_MENUREFBROWSE                              333\r
+#define IDS_MENUDESCREFBROWSE                  334\r
 #define IDC_REVISION                    1001\r
 #define IDC_LOCKED                      1002\r
 #define IDC_REPOURL                     1003\r
index 7918c96..99eb891 100644 (file)
@@ -270,7 +270,9 @@ BEGIN
     IDS_MENUSUBADD          "Submodule Add"\r
     IDS_MENUSUBSYNC         "Submodule Sync"\r
     IDS_MENUREFLOG          "Show &Reflog"\r
+    IDS_MENUREFBROWSE       "Browse Reference"\r
     IDS_MENUDESCREFLOG      "Shows reference log"\r
+    IDS_MENUDESCREFBROWSE   "Browse reference"\r
     IDS_MENUSTASHLIST       "Stash List"\r
 END\r
 \r