private IReadOnlyList <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(RevisionGridControl.Commands.ShowAllBranches), ExecuteAction = () => _revisionGrid.ShowAllBranches(), IsCheckedFunc = () => _revisionGrid.IsShowAllBranchesChecked }, new MenuCommand { Name = "ShowCurrentBranchOnly", Text = "Show current branch only", ShortcutKeyDisplayString = GetShortcutKeyDisplayStringFromRevisionGridIfAvailable(RevisionGridControl.Commands.ShowCurrentBranchOnly), ExecuteAction = () => _revisionGrid.ShowCurrentBranchOnly(), IsCheckedFunc = () => _revisionGrid.IsShowCurrentBranchOnlyChecked }, new MenuCommand { Name = "ShowFilteredBranches", Text = "Show filtered branches", ShortcutKeyDisplayString = GetShortcutKeyDisplayStringFromRevisionGridIfAvailable(RevisionGridControl.Commands.ShowFilteredBranches), ExecuteAction = () => _revisionGrid.ShowFilteredBranches(), IsCheckedFunc = () => _revisionGrid.IsShowFilteredBranchesChecked }, MenuCommand.CreateSeparator(), new MenuCommand { Name = "ShowRemoteBranches", Text = "Show remote branches", ShortcutKeyDisplayString = GetShortcutKeyDisplayStringFromRevisionGridIfAvailable(RevisionGridControl.Commands.ShowRemoteBranches), ExecuteAction = () => _revisionGrid.ToggleShowRemoteBranches(), IsCheckedFunc = () => AppSettings.ShowRemoteBranches }, new MenuCommand { Name = "ShowArtificialCommits", Text = "Show artificial commits", ExecuteAction = () => _revisionGrid.ToggleShowArtificialCommits(), IsCheckedFunc = () => AppSettings.RevisionGraphShowWorkingDirChanges }, new MenuCommand { Name = "ShowReflogReferences", Text = "Show reflog references", ExecuteAction = () => _revisionGrid.ToggleShowReflogReferences(), IsCheckedFunc = () => AppSettings.ShowReflogReferences }, MenuCommand.CreateSeparator(), new MenuCommand { Name = "ShowSuperprojectTags", Text = "Show superproject tags", ExecuteAction = () => _revisionGrid.ToggleShowSuperprojectTags(), IsCheckedFunc = () => AppSettings.ShowSuperprojectTags }, new MenuCommand { Name = "ShowSuperprojectBranches", Text = "Show superproject branches", ExecuteAction = () => _revisionGrid.ShowSuperprojectBranches_ToolStripMenuItemClick(), IsCheckedFunc = () => AppSettings.ShowSuperprojectBranches }, new MenuCommand { Name = "ShowSuperprojectRemoteBranches", Text = "Show superproject remote branches", ExecuteAction = () => _revisionGrid.ShowSuperprojectRemoteBranches_ToolStripMenuItemClick(), IsCheckedFunc = () => AppSettings.ShowSuperprojectRemoteBranches }, MenuCommand.CreateSeparator(), new MenuCommand { Name = "showRevisionGraphColumnToolStripMenuItem", Text = "Show revision graph column", ExecuteAction = () => _revisionGrid.ToggleRevisionGraphColumn(), IsCheckedFunc = () => AppSettings.ShowRevisionGridGraphColumn }, new MenuCommand { Name = "showAuthorAvatarColumnToolStripMenuItem", Text = "Show author avatar column", ExecuteAction = () => _revisionGrid.ToggleAuthorAvatarColumn(), IsCheckedFunc = () => AppSettings.ShowAuthorAvatarColumn }, new MenuCommand { Name = "showAuthorNameColumnToolStripMenuItem", Text = "Show author name column", ExecuteAction = () => _revisionGrid.ToggleAuthorNameColumn(), IsCheckedFunc = () => AppSettings.ShowAuthorNameColumn }, new MenuCommand { Name = "showDateColumnToolStripMenuItem", Text = "Show date column", ExecuteAction = () => _revisionGrid.ToggleDateColumn(), IsCheckedFunc = () => AppSettings.ShowDateColumn }, new MenuCommand { Name = "showIdColumnToolStripMenuItem", Text = "Show SHA-1 column", ExecuteAction = () => _revisionGrid.ToggleObjectIdColumn(), IsCheckedFunc = () => AppSettings.ShowObjectIdColumn }, new MenuCommand { Name = "showBuildStatusIconToolStripMenuItem", Text = "Show build status icon", ExecuteAction = () => _revisionGrid.ToggleBuildStatusIconColumn(), IsCheckedFunc = () => AppSettings.ShowBuildStatusIconColumn }, new MenuCommand { Name = "showBuildStatusTextToolStripMenuItem", Text = "Show build status text", ExecuteAction = () => _revisionGrid.ToggleBuildStatusTextColumn(), IsCheckedFunc = () => AppSettings.ShowBuildStatusTextColumn }, MenuCommand.CreateSeparator(), new MenuCommand { Name = "drawNonrelativesGrayToolStripMenuItem", Text = "Draw non relatives gray", ExecuteAction = () => _revisionGrid.ToggleDrawNonRelativesGray(), IsCheckedFunc = () => AppSettings.RevisionGraphDrawNonRelativesGray }, new MenuCommand { Name = "AuthorDateSort", Text = "Sort commits by author date", ExecuteAction = () => _revisionGrid.ToggleAuthorDateSort(), IsCheckedFunc = () => AppSettings.SortByAuthorDate }, new MenuCommand { Name = "showAuthorDateToolStripMenuItem", Text = "Show author date", ExecuteAction = () => _revisionGrid.ToggleShowAuthorDate(), IsCheckedFunc = () => AppSettings.ShowAuthorDate }, new MenuCommand { Name = "showRelativeDateToolStripMenuItem", Text = "Show relative date", ExecuteAction = () => _revisionGrid.ToggleShowRelativeDate(null), IsCheckedFunc = () => AppSettings.RelativeDate }, new MenuCommand { Name = "showMergeCommitsToolStripMenuItem", Text = "Show merge commits", ShortcutKeyDisplayString = GetShortcutKeyDisplayStringFromRevisionGridIfAvailable(RevisionGridControl.Commands.ToggleShowMergeCommits), ExecuteAction = () => _revisionGrid.ToggleShowMergeCommits(), IsCheckedFunc = () => AppSettings.ShowMergeCommits }, new MenuCommand { Name = "showTagsToolStripMenuItem", Text = "Show tags", ShortcutKeyDisplayString = GetShortcutKeyDisplayStringFromRevisionGridIfAvailable(RevisionGridControl.Commands.ToggleShowTags), ExecuteAction = () => _revisionGrid.ToggleShowTags(), IsCheckedFunc = () => AppSettings.ShowTags }, new MenuCommand { Name = "showGitNotesToolStripMenuItem", Text = "Show git notes", ExecuteAction = () => _revisionGrid.ToggleShowGitNotes(), IsCheckedFunc = () => AppSettings.ShowGitNotes }, MenuCommand.CreateSeparator(), new MenuCommand { Name = "ToggleHighlightSelectedBranch", Text = "Highlight selected branch (until refresh)", ShortcutKeyDisplayString = GetShortcutKeyDisplayStringFromRevisionGridIfAvailable(RevisionGridControl.Commands.ToggleHighlightSelectedBranch), ExecuteAction = () => _revisionGrid.ExecuteCommand(RevisionGridControl.Commands.ToggleHighlightSelectedBranch) }, MenuCommand.CreateSeparator(), new MenuCommand { Name = "showFirstParent", Text = "Show first parents", Image = Images.ShowFirstParent, ShortcutKeyDisplayString = GetShortcutKeyDisplayStringFromRevisionGridIfAvailable(RevisionGridControl.Commands.ShowFirstParent), ExecuteAction = () => _revisionGrid.ShowFirstParent(), IsCheckedFunc = () => AppSettings.ShowFirstParent }, new MenuCommand { Name = "filterToolStripMenuItem", Text = "Set advanced filter", Image = Images.EditFilter, ShortcutKeyDisplayString = GetShortcutKeyDisplayStringFromRevisionGridIfAvailable(RevisionGridControl.Commands.RevisionFilter), ExecuteAction = () => _revisionGrid.ShowRevisionFilterDialog() } }); }