Skip to content

Commit

Permalink
Add "Archive..." to context menu of File tree tab
Browse files Browse the repository at this point in the history
  • Loading branch information
australiensun committed May 26, 2013
1 parent 91079be commit c374690
Show file tree
Hide file tree
Showing 4 changed files with 2,141 additions and 2,107 deletions.
14 changes: 14 additions & 0 deletions GitUI/CommandsDialogs/FormArchive.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,20 @@ public GitRevision SelectedRevision
}
}

public void SetPathArgument(string path)
{
if (path.IsNullOrEmpty())
{
checkBoxPathFilter.Checked = false;
textBoxPaths.Text = "";
}
else
{
checkBoxPathFilter.Checked = true;
textBoxPaths.Text = path;
}
}

private enum OutputFormat
{
Zip,
Expand Down
11 changes: 11 additions & 0 deletions GitUI/CommandsDialogs/FormBrowse.Designer.cs

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

13 changes: 13 additions & 0 deletions GitUI/CommandsDialogs/FormBrowse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2471,6 +2471,19 @@ private void fileTreeOpenContainingFolderToolStripMenuItem_Click(object sender,
}
}

private void fileTreeArchiveToolStripMenuItem_Click(object sender, EventArgs e)
{
var selectedRevisions = RevisionGrid.GetSelectedRevisions();
if (selectedRevisions.Count != 1)
{
MessageBox.Show("Select exactly one revision.");
return;
}

var gitItem = (GitItem)GitTree.SelectedNode.Tag; // this should not fail, if it still does, user should know
UICommands.StartArchiveDialog(this, selectedRevisions.First(), gitItem.FileName);
}

private void DiffContextMenu_Opening(object sender, System.ComponentModel.CancelEventArgs e)
{
bool artificialRevSelected;
Expand Down

0 comments on commit c374690

Please sign in to comment.