Permalink
Browse files

add Git extensions and GitTortoise to Pending Changes window

  • Loading branch information...
1 parent e12acc1 commit f7d39a8a82860efc2efb90fb33de4eccccf7c46d @yysun committed Jan 29, 2012
Showing with 103 additions and 44 deletions.
  1. +16 −4 BasicSccProvider.cs
  2. +4 −0 CommandId.cs
  3. +83 −40 PkgCmd.vsct
View
@@ -109,8 +109,8 @@ protected override void Initialize()
cmd = new CommandID(GuidList.guidSccProviderCmdSet, CommandId.icmdSccCommandGitTortoise);
menu = new MenuCommand(new EventHandler(OnTortoiseGitCommand), cmd);
- mcs.AddCommand(menu);
+ mcs.AddCommand(menu);
for (int i = 0; i < GitToolCommands.GitExtCommands.Count; i++)
{
cmd = new CommandID(GuidList.guidSccProviderCmdSet, CommandId.icmdGitExtCommand1 + i);
@@ -136,6 +136,10 @@ protected override void Initialize()
cmd = new CommandID(GuidList.guidSccProviderCmdSet, CommandId.icmdPendingChangesCommitToBranch);
menu = new MenuCommand(new EventHandler(OnSwitchBranchCommand), cmd);
mcs.AddCommand(menu);
+
+ cmd = new CommandID(GuidList.guidSccProviderCmdSet, CommandId.icmdSccCommandAbout);
+ menu = new MenuCommand(new EventHandler(OnAbout), cmd);
+ mcs.AddCommand(menu);
}
@@ -231,7 +235,7 @@ int IOleCommandTarget.QueryStatus(ref Guid guidCmdGroup, uint cCmds, OLECMD[] pr
else
cmdf |= OLECMDF.OLECMDF_INVISIBLE;
break;
-
+
case CommandId.icmdSccCommandUndo:
case CommandId.icmdSccCommandCompare:
if (sccService.CanCompareSelectedFile) cmdf |= OLECMDF.OLECMDF_ENABLED;
@@ -246,6 +250,7 @@ int IOleCommandTarget.QueryStatus(ref Guid guidCmdGroup, uint cCmds, OLECMD[] pr
if (sccService.IsSolutionGitControlled) cmdf |= OLECMDF.OLECMDF_ENABLED;
break;
+ case CommandId.icmdSccCommandAbout:
case CommandId.icmdSccCommandRefresh:
//if (sccService.IsSolutionGitControlled)
cmdf |= OLECMDF.OLECMDF_ENABLED;
@@ -352,7 +357,7 @@ private void OnInitCommand(object sender, EventArgs e)
private void OnTortoiseGitCommand(object sender, EventArgs e)
{
var tortoiseGitPath = GitSccOptions.Current.TortoiseGitPath;
- RunDetatched(tortoiseGitPath, "/command:commit");
+ RunDetatched(tortoiseGitPath, "/command:log");
}
private string GetTargetPath(GitToolCommand command)
@@ -395,7 +400,14 @@ private void OnGitExtCommandExec(object sender, EventArgs e)
RunDetatched(gitExtensionPath, GitToolCommands.GitExtCommands[idx].Command);
}
}
-
+
+ private void OnAbout(object sender, EventArgs e)
+ {
+ var path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
+ path = Path.Combine(path, "Readme.txt");
+ Process.Start(path);
+ }
+
private void ShowPendingChangesWindow(object sender, EventArgs e)
{
ShowToolWindow(typeof(PendingChangesToolWindow));
View
@@ -27,12 +27,16 @@ static class CommandId
public const int icmdPendingChangesRefresh = 0x114;
public const int icmdHistoryViewRefresh = 0x115;
+ public const int icmdSccCommandAbout = 0x116;
+
// Define the list of menus (these include toolbars)
public const int imnuHistoryToolWindowToolbarMenu = 0x200;
public const int imnuPendingChangesToolWindowToolbarMenu = 0x202;
public const int imnuGitSourceControlMenu = 0x205;
+ public const int imnuPendingChangesToolWindowGitExt = 0x951;
+ public const int imnuPendingChangesToolWindowGitTor = 0x961;
// Define the list of icons (use decimal numbers here, to match the resource IDs)
public const int iiconProductIcon = 400;
View
@@ -5,16 +5,15 @@
<Extern href="msobtnid.h"/>
<Commands package="guidSccProviderPkg">
<Menus>
-
- <Menu guid="guidSccProviderCmdSet" id="imnuHistoryToolWindowToolbarMenu" priority="0x0000" type="ToolWindowToolbar">
- <Parent guid="guidSccProviderCmdSet" id="imnuHistoryToolWindowToolbarMenu"/>
+
+ <Menu guid="guidSccProviderCmdSet" id="imnuGitSourceControlMenu" priority="0x0000" type="Menu">
<CommandFlag>TextChanges</CommandFlag>
<Strings>
- <ButtonText>Git History</ButtonText>
- <CommandName>GitHistory</CommandName>
+ <ButtonText>Git</ButtonText>
+ <CommandName>Git</CommandName>
</Strings>
</Menu>
-
+
<Menu guid="guidSccProviderCmdSet" id="imnuPendingChangesToolWindowToolbarMenu" priority="0x0000" type="ToolWindowToolbar">
<Parent guid="guidSccProviderCmdSet" id="imnuPendingChangesToolWindowToolbarMenu"/>
<CommandFlag>TextChanges</CommandFlag>
@@ -23,26 +22,36 @@
<CommandName>GitPendingChanges</CommandName>
</Strings>
</Menu>
-
- <Menu guid="guidSccProviderCmdSet" id="imnuGitSourceControlMenu" priority="0x0000" type="Menu">
+
+ <Menu guid="guidSccProviderCmdSet" id="imnuPendingChangesToolWindowGitExt" priority="0x0011" type="MenuController">
+ <Parent guid="guidSccProviderCmdSet" id="igrpPendingChangesToolWindowToolbarGroup"/>
+ <CommandFlag>IconAndText</CommandFlag>
<CommandFlag>TextChanges</CommandFlag>
+ <CommandFlag>TextIsAnchorCommand</CommandFlag>
<Strings>
- <ButtonText>Git</ButtonText>
- <CommandName>Git</CommandName>
+ <ButtonText>Git Extensions</ButtonText>
+ <CommandName>GitExt Menu Controller</CommandName>
</Strings>
</Menu>
+ <Menu guid="guidSccProviderCmdSet" id="imnuPendingChangesToolWindowGitTor" priority="0x0012" type="MenuController">
+ <Parent guid="guidSccProviderCmdSet" id="igrpPendingChangesToolWindowToolbarGroup"/>
+ <CommandFlag>IconAndText</CommandFlag>
+ <CommandFlag>TextChanges</CommandFlag>
+ <CommandFlag>TextIsAnchorCommand</CommandFlag>
+ <Strings>
+ <ButtonText>Git Extensions</ButtonText>
+ <CommandName>GitExt Menu Controller</CommandName>
+ </Strings>
+ </Menu>
+
</Menus>
<Groups>
<Group guid="guidSccProviderCmdSet" id="igrpSourceControlCommands" priority="0x0000">
<Parent guid="guidSccProviderCmdSet" id="imnuGitSourceControlMenu"/>
</Group>
-
- <Group guid="guidSccProviderCmdSet" id="igrpHistoryToolWindowToolbarGroup" priority="0x0100">
- <Parent guid="guidSccProviderCmdSet" id="imnuHistoryToolWindowToolbarMenu"/>
- </Group>
<Group guid="guidSccProviderCmdSet" id="igrpPendingChangesToolWindowToolbarGroup" priority="0x0100">
<Parent guid="guidSccProviderCmdSet" id="imnuPendingChangesToolWindowToolbarMenu"/>
@@ -55,10 +64,18 @@
<Group guid="guidSccProviderCmdSet" id="igrpGitTorCommands" priority="0x0200">
<Parent guid="guidSccProviderCmdSet" id="imnuGitSourceControlMenu"/>
</Group>
+
+ <Group guid="guidSccProviderCmdSet" id="igrpPendingChangesToolWindowGitExt" priority="0x0000">
+ <Parent guid="guidSccProviderCmdSet" id="imnuPendingChangesToolWindowGitExt"/>
+ </Group>
+ <Group guid="guidSccProviderCmdSet" id="igrpPendingChangesToolWindowGitTor" priority="0x0000">
+ <Parent guid="guidSccProviderCmdSet" id="imnuPendingChangesToolWindowGitTor"/>
+ </Group>
</Groups>
<Buttons>
+
<Button guid="guidSccProviderCmdSet" id="icmdSccCommandGitBash" priority="0x0106" type="Button">
<Parent guid="guidSccProviderCmdSet" id="igrpSourceControlCommands"/>
<Icon guid="guidSccProviderImages" id="iconGitBash" />
@@ -77,7 +94,7 @@
<CommandFlag>DefaultInvisible</CommandFlag>
<CommandFlag>IconAndText</CommandFlag>
<Strings>
- <ButtonText>Git Extensions ...</ButtonText>
+ <ButtonText>Git Extensions</ButtonText>
</Strings>
</Button>
@@ -88,7 +105,7 @@
<CommandFlag>DefaultInvisible</CommandFlag>
<CommandFlag>IconAndText</CommandFlag>
<Strings>
- <ButtonText>TortoiseGit ...</ButtonText>
+ <ButtonText>TortoiseGit</ButtonText>
</Strings>
</Button>
@@ -102,6 +119,7 @@
<ButtonText>Compare ...</ButtonText>
</Strings>
</Button>
+
<Button guid="guidSccProviderCmdSet" id="icmdSccCommandUndo" priority="0x0102" type="Button">
<Parent guid="guidSccProviderCmdSet" id="igrpSourceControlCommands"/>
<Icon guid="guidSccProviderImages" id="iconUncheckout" />
@@ -150,9 +168,10 @@
<Icon guid="guidSccProviderImages" id="iconGitExt" />
<CommandFlag>DynamicItemStart</CommandFlag>
<CommandFlag>DefaultInvisible</CommandFlag>
+ <CommandFlag>FixMenuController</CommandFlag>
<Strings>
<CommandName>icmdGitExtCommand1</CommandName>
- <ButtonText>Git Extensions Commands</ButtonText>
+ <ButtonText>Git Extensions</ButtonText>
</Strings>
</Button>
@@ -161,9 +180,10 @@
<Icon guid="guidSccProviderImages" id="iconGitTor" />
<CommandFlag>DynamicItemStart</CommandFlag>
<CommandFlag>DefaultInvisible</CommandFlag>
+ <CommandFlag>FixMenuController</CommandFlag>
<Strings>
<CommandName>icmdGitTorCommand1</CommandName>
- <ButtonText>TortoiseGit Commands</ButtonText>
+ <ButtonText>TortoiseGit</ButtonText>
</Strings>
</Button>
@@ -187,6 +207,16 @@
</Strings>
</Button>
+ <Button guid="guidSccProviderCmdSet" id="icmdSccCommandAbout" priority="0x0106" type="Button">
+ <Icon guid="guidSccProviderImages" id="iconGitBash" />
+ <CommandFlag>DynamicVisibility</CommandFlag>
+ <CommandFlag>DefaultInvisible</CommandFlag>
+ <CommandFlag>IconAndText</CommandFlag>
+ <Strings>
+ <ButtonText>Git - About ...</ButtonText>
+ </Strings>
+ </Button>
+
<!-- buttons on pending changes tool window's tool bar -->
<Button guid="guidSccProviderCmdSet" id="icmdPendingChangesCommit" priority="0x0000" type="Button">
<Parent guid="guidSccProviderCmdSet" id="igrpPendingChangesToolWindowToolbarGroup"/>
@@ -228,17 +258,6 @@
<ButtonText>Refresh</ButtonText>
</Strings>
</Button>
-
- <Button guid="guidSccProviderCmdSet" id="icmdHistoryViewRefresh" priority="0x0006" type="Button">
- <Parent guid="guidSccProviderCmdSet" id="igrpHistoryToolWindowToolbarGroup"/>
- <Icon guid="guidSccProviderImages" id="iconRefresh" />
- <CommandFlag>DynamicVisibility</CommandFlag>
- <CommandFlag>DefaultInvisible</CommandFlag>
- <CommandFlag>IconAndText</CommandFlag>
- <Strings>
- <ButtonText>Refresh</ButtonText>
- </Strings>
- </Button>
</Buttons>
@@ -280,6 +299,16 @@
<Parent guid="guidSHLMainMenu" id="IDG_VS_CTXT_SOLUTION_SCC"/>
</CommandPlacement>
+ <CommandPlacement guid="guidSccProviderCmdSet" id="icmdSccCommandAbout" priority="0x0004">
+ <Parent guid="guidSHLMainMenu" id="IDG_VS_CTXT_ITEM_SCC"/>
+ </CommandPlacement>
+ <CommandPlacement guid="guidSccProviderCmdSet" id="icmdSccCommandAbout" priority="0x0004">
+ <Parent guid="guidSHLMainMenu" id="IDG_VS_CTXT_PROJECT_SCC"/>
+ </CommandPlacement>
+ <CommandPlacement guid="guidSccProviderCmdSet" id="icmdSccCommandAbout" priority="0x0004">
+ <Parent guid="guidSHLMainMenu" id="IDG_VS_CTXT_SOLUTION_SCC"/>
+ </CommandPlacement>
+
<CommandPlacement guid="guidSccProviderCmdSet" id="icmdSccCommandHistory" priority="0x0004">
<Parent guid="guidSHLMainMenu" id="IDG_VS_CTXT_ITEM_SCC"/>
</CommandPlacement>
@@ -290,22 +319,29 @@
<Parent guid="guidSHLMainMenu" id="IDG_VS_CTXT_SOLUTION_SCC"/>
</CommandPlacement>
- <CommandPlacement guid="guidSccProviderCmdSet" id="icmdPendingChangesCommitToBranch" priority="0x0006">
- <Parent guid="guidSccProviderCmdSet" id="igrpHistoryToolWindowToolbarGroup"/>
+ <CommandPlacement guid="guidSccProviderCmdSet" id="icmdSccCommandEditIgnore" priority="0x0007">
+ <Parent guid="guidSccProviderCmdSet" id="igrpPendingChangesToolWindowToolbarGroup"/>
</CommandPlacement>
- <!--<CommandPlacement guid="guidSccProviderCmdSet" id="icmdSccCommandRefresh" priority="0x0007">
- <Parent guid="guidSccProviderCmdSet" id="igrpHistoryToolWindowToolbarGroup"/>
- </CommandPlacement>-->
<CommandPlacement guid="guidSccProviderCmdSet" id="icmdSccCommandGitBash" priority="0x0008">
- <Parent guid="guidSccProviderCmdSet" id="igrpHistoryToolWindowToolbarGroup"/>
+ <Parent guid="guidSccProviderCmdSet" id="igrpPendingChangesToolWindowToolbarGroup"/>
</CommandPlacement>
- <CommandPlacement guid="guidSccProviderCmdSet" id="icmdSccCommandEditIgnore" priority="0x0007">
+
+ <CommandPlacement guid="guidSccProviderCmdSet" id="icmdSccCommandGitExtension" priority="0x0009">
<Parent guid="guidSccProviderCmdSet" id="igrpPendingChangesToolWindowToolbarGroup"/>
</CommandPlacement>
- <CommandPlacement guid="guidSccProviderCmdSet" id="icmdSccCommandGitBash" priority="0x0008">
+ <CommandPlacement guid="guidSccProviderCmdSet" id="icmdSccCommandGitTortoise" priority="0x0010">
<Parent guid="guidSccProviderCmdSet" id="igrpPendingChangesToolWindowToolbarGroup"/>
</CommandPlacement>
-
+
+ <CommandPlacement guid="guidSccProviderCmdSet" id="icmdGitExtCommand1" priority="0x0002">
+ <Parent guid="guidSccProviderCmdSet" id="igrpPendingChangesToolWindowGitExt"/>
+ </CommandPlacement>
+ <CommandPlacement guid="guidSccProviderCmdSet" id="icmdGitTorCommand1" priority="0x0002">
+ <Parent guid="guidSccProviderCmdSet" id="igrpPendingChangesToolWindowGitTor"/>
+ </CommandPlacement>
+
+
+
</CommandPlacements>
<Symbols>
@@ -337,15 +373,22 @@
<IDSymbol name="icmdPendingChangesRefresh" value="0x114"/>
<IDSymbol name="icmdHistoryViewRefresh" value="0x115"/>
-
+ <IDSymbol name="icmdSccCommandAbout" value="0x116"/>
+
<IDSymbol name="igrpGitExtCommands" value="0x800"/>
<IDSymbol name="imnuGitExtMenu" value="0x801"/>
<IDSymbol name="igrpGitTorCommands" value="0x900"/>
<IDSymbol name="imnuGitTorMenu" value="0x901"/>
<IDSymbol name="icmdGitExtCommand1" value="0x811"/>
<IDSymbol name="icmdGitTorCommand1" value="0x911"/>
-
+
+ <IDSymbol name="imnuPendingChangesToolWindowGitExt" value="0x951"/>
+ <IDSymbol name="igrpPendingChangesToolWindowGitExt" value="0x952"/>
+
+ <IDSymbol name="imnuPendingChangesToolWindowGitTor" value="0x961"/>
+ <IDSymbol name="igrpPendingChangesToolWindowGitTor" value="0x962"/>
+
</GuidSymbol>
<GuidSymbol name="guidSccProviderImages" value="{495089FD-A8CA-4260-8EB1-794E2956B625}" >
<IDSymbol name="iconGitBash" value="1"/>

0 comments on commit f7d39a8

Please sign in to comment.