Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FormChooseCommit: add button that opens the Go to commit dialog that helps to find a specific commit #1723

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
79 changes: 61 additions & 18 deletions GitUI/HelperDialogs/FormChooseCommit.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions GitUI/HelperDialogs/FormChooseCommit.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
using System;
using System.Windows.Forms;
using GitCommands;
using GitUI.CommandsDialogs.BrowseDialog;
using ResourceManager.Translation;

namespace GitUI.HelperDialogs
{
public partial class FormChooseCommit : GitModuleForm
{
private readonly TranslationString _noRevisionFoundError =
new TranslationString("No revision found.");

private FormChooseCommit()
: this(null)
{ }
Expand Down Expand Up @@ -62,5 +67,24 @@ private void revisionGrid_DoubleClickRevision(object sender, UserControls.Revisi
Close();
}
}

private void buttonGotoCommit_Click(object sender, EventArgs e)
{
using (var formGoToCommit = new FormGoToCommit(UICommands))
{
if (formGoToCommit.ShowDialog(this) == DialogResult.OK)
{
string revisionGuid = formGoToCommit.GetRevision();
if (!string.IsNullOrEmpty(revisionGuid))
{
revisionGrid.SetSelectedRevision(new GitRevision(Module, revisionGuid));
}
else
{
MessageBox.Show(this, _noRevisionFoundError.Text);
}
}
}
}
}
}