private IEnumerable <MenuCommand> CreateViewMenuCommands() { return(new[] { // the first three MenuCommands just reuse (the currently rather // convoluted) logic from RevisionGrid. // // After refactoring the three items should be added to RevisionGrid // as done with "ShowRemoteBranches" and not via RevisionGrid.Designer.cs new MenuCommand { Name = "ShowAllBranches", Text = "Show all branches", ShortcutKeyDisplayString = GetShortcutKeyDisplayStringFromRevisionGridIfAvailable(RevisionGrid.Commands.ShowAllBranches), ExecuteAction = () => _revisionGrid.ShowAllBranches_ToolStripMenuItemClick(null, null), IsCheckedFunc = () => _revisionGrid.ShowAllBranches_ToolStripMenuItemChecked }, new MenuCommand { Name = "ShowCurrentBranchOnly", Text = "Show current branch only", ShortcutKeyDisplayString = GetShortcutKeyDisplayStringFromRevisionGridIfAvailable(RevisionGrid.Commands.ShowCurrentBranchOnly), ExecuteAction = () => _revisionGrid.ShowCurrentBranchOnly_ToolStripMenuItemClick(null, null), IsCheckedFunc = () => _revisionGrid.ShowCurrentBranchOnly_ToolStripMenuItemChecked }, new MenuCommand { Name = "ShowFilteredBranches", Text = "Show filtered branches", ShortcutKeyDisplayString = GetShortcutKeyDisplayStringFromRevisionGridIfAvailable(RevisionGrid.Commands.ShowFilteredBranches), ExecuteAction = () => _revisionGrid.ShowFilteredBranches_ToolStripMenuItemClick(null, null), IsCheckedFunc = () => _revisionGrid.ShowFilteredBranches_ToolStripMenuItemChecked }, MenuCommand.CreateSeparator(), new MenuCommand { Name = "ShowRemoteBranches", Text = "Show remote branches", ShortcutKeyDisplayString = GetShortcutKeyDisplayStringFromRevisionGridIfAvailable(RevisionGrid.Commands.ShowRemoteBranches), ExecuteAction = () => _revisionGrid.ShowRemoteBranches_ToolStripMenuItemClick(null, null), IsCheckedFunc = () => AppSettings.ShowRemoteBranches }, new MenuCommand { Name = "ShowReflogReferences", Text = "Show reflog references", ExecuteAction = () => _revisionGrid.ShowReflogReferences_ToolStripMenuItemClick(null, null), IsCheckedFunc = () => AppSettings.ShowReflogReferences }, MenuCommand.CreateSeparator(), new MenuCommand { Name = "ShowSuperprojectTags", Text = "Show superproject tags", ExecuteAction = () => _revisionGrid.ShowSuperprojectTags_ToolStripMenuItemClick(null, null), IsCheckedFunc = () => AppSettings.ShowSuperprojectTags }, new MenuCommand { Name = "ShowSuperprojectBranches", Text = "Show superproject branches", ExecuteAction = () => _revisionGrid.ShowSuperprojectBranches_ToolStripMenuItemClick(null, null), IsCheckedFunc = () => AppSettings.ShowSuperprojectBranches }, new MenuCommand { Name = "ShowSuperprojectRemoteBranches", Text = "Show superproject remote branches", ExecuteAction = () => _revisionGrid.ShowSuperprojectRemoteBranches_ToolStripMenuItemClick(null, null), IsCheckedFunc = () => AppSettings.ShowSuperprojectRemoteBranches }, MenuCommand.CreateSeparator(), new MenuCommand { Name = "showRevisionGraphToolStripMenuItem", Text = "Show revision graph", ExecuteAction = () => _revisionGrid.ShowRevisionGraph_ToolStripMenuItemClick(null, null), IsCheckedFunc = () => _revisionGrid.IsGraphLayout() }, new MenuCommand { Name = "drawNonrelativesGrayToolStripMenuItem", Text = "Draw non relatives gray", ExecuteAction = () => _revisionGrid.DrawNonrelativesGray_ToolStripMenuItemClick(null, null), IsCheckedFunc = () => AppSettings.RevisionGraphDrawNonRelativesGray }, new MenuCommand { Name = "orderRevisionsByDateToolStripMenuItem", Text = "Order revisions by date", ExecuteAction = () => _revisionGrid.OrderRevisionsByDate_ToolStripMenuItemClick(null, null), IsCheckedFunc = () => AppSettings.OrderRevisionByDate }, new MenuCommand { Name = "showAuthorDateToolStripMenuItem", Text = "Show author date", ExecuteAction = () => _revisionGrid.ShowAuthorDate_ToolStripMenuItemClick(null, null), IsCheckedFunc = () => AppSettings.ShowAuthorDate }, new MenuCommand { Name = "showRelativeDateToolStripMenuItem", Text = "Show relative date", ExecuteAction = () => _revisionGrid.ShowRelativeDate_ToolStripMenuItemClick(null, null), IsCheckedFunc = () => AppSettings.RelativeDate }, new MenuCommand { Name = "showMergeCommitsToolStripMenuItem", Text = "Show merge commits", ShortcutKeyDisplayString = GetShortcutKeyDisplayStringFromRevisionGridIfAvailable(RevisionGrid.Commands.ToggleShowMergeCommits), ExecuteAction = () => _revisionGrid.ShowMergeCommits_ToolStripMenuItemClick(null, null), IsCheckedFunc = () => AppSettings.ShowMergeCommits }, new MenuCommand { Name = "showTagsToolStripMenuItem", Text = "Show tags", ShortcutKeyDisplayString = GetShortcutKeyDisplayStringFromRevisionGridIfAvailable(RevisionGrid.Commands.ToggleShowTags), ExecuteAction = () => _revisionGrid.ShowTags_ToolStripMenuItemClick(null, null), IsCheckedFunc = () => AppSettings.ShowTags }, new MenuCommand { Name = "showIdsToolStripMenuItem", Text = "Show SHA-1", ExecuteAction = () => _revisionGrid.ShowIds_ToolStripMenuItemClick(null, null), IsCheckedFunc = () => AppSettings.ShowIds }, new MenuCommand { Name = "showGitNotesToolStripMenuItem", Text = "Show git notes", ExecuteAction = () => _revisionGrid.ShowGitNotes_ToolStripMenuItemClick(null, null), IsCheckedFunc = () => AppSettings.ShowGitNotes }, new MenuCommand { Name = "showIsMessageMultilineToolStripMenuItem", Text = "Show indicator for multiline message", ExecuteAction = () => { AppSettings.ShowIndicatorForMultilineMessage = !AppSettings.ShowIndicatorForMultilineMessage; _revisionGrid.ForceRefreshRevisions(); }, IsCheckedFunc = () => AppSettings.ShowIndicatorForMultilineMessage }, MenuCommand.CreateSeparator(), new MenuCommand { Name = "ToggleHighlightSelectedBranch", Text = "Highlight selected branch (until refresh)", ShortcutKeyDisplayString = GetShortcutKeyDisplayStringFromRevisionGridIfAvailable(RevisionGrid.Commands.ToggleHighlightSelectedBranch), ExecuteAction = () => _revisionGrid.ExecuteCommand(RevisionGrid.Commands.ToggleHighlightSelectedBranch) }, new MenuCommand { Name = "ToggleRevisionCardLayout", Text = "Change commit view layout", ShortcutKeyDisplayString = GetShortcutKeyDisplayStringFromRevisionGridIfAvailable(RevisionGrid.Commands.ToggleRevisionCardLayout), ExecuteAction = () => _revisionGrid.ToggleRevisionCardLayout() }, MenuCommand.CreateSeparator(), new MenuCommand { Name = "showFirstParent", Text = "Show first parents", Image = Properties.Resources.IconShowFirstParent, ShortcutKeyDisplayString = GetShortcutKeyDisplayStringFromRevisionGridIfAvailable(RevisionGrid.Commands.ShowFirstParent), ExecuteAction = () => _revisionGrid.ShowFirstParent(), IsCheckedFunc = () => AppSettings.ShowFirstParent }, new MenuCommand { Name = "filterToolStripMenuItem", Text = "Set advanced filter", Image = Properties.Resources.IconFilter, ShortcutKeyDisplayString = GetShortcutKeyDisplayStringFromRevisionGridIfAvailable(RevisionGrid.Commands.RevisionFilter), ExecuteAction = () => _revisionGrid.FilterToolStripMenuItemClick(null, null) }, new MenuCommand { Name = "ToggleBranchTreePanel", Text = "Toggle left panel", Image = Properties.MsVsImages.Branch_16x, ExecuteAction = () => _revisionGrid.OnToggleBranchTreePanelRequested() } }); }