Browse Source

demo1

Signed-off-by: Henk Westhuis <henk_westhuis@hotmail.com>
pull/198/head
Henk Westhuis 17 years ago
committed by Henk Westhuis
parent
commit
431f6418cf
  1. 42
      GitUI/ApplyPatch.cs
  2. 2
      GitUI/MergePatch.Designer.cs
  3. 18
      GitUI/MergePatch.cs

42
GitUI/ApplyPatch.cs

@ -226,31 +226,31 @@ namespace PatchApply
private void toolStripButton3_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Are you sure you want to apply this patch?", "Save", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
patchManager.SavePatch();
MessageBox.Show("Patch applied!");
Clear();
}
//if (MessageBox.Show("Are you sure you want to apply this patch?", "Save", MessageBoxButtons.YesNo) == DialogResult.Yes)
//{
// patchManager.SavePatch();
// MessageBox.Show("Patch applied!");
// Clear();
//}
}
private void ApplyPatch_FormClosing(object sender, FormClosingEventArgs e)
{
if (patchManager.patches.Count > 0)
{
DialogResult result = MessageBox.Show("There is a patch loaded. Do you want to apply this patch before exit?", "Close", MessageBoxButtons.YesNoCancel);
if (result == DialogResult.Yes)
{
patchManager.SavePatch();
MessageBox.Show("Patch applied!");
Clear();
}
else
if (result == DialogResult.Cancel)
{
e.Cancel = true;
}
}
//if (patchManager.patches.Count > 0)
//{
// DialogResult result = MessageBox.Show("There is a patch loaded. Do you want to apply this patch before exit?", "Close", MessageBoxButtons.YesNoCancel);
// if (result == DialogResult.Yes)
// {
// patchManager.SavePatch();
// MessageBox.Show("Patch applied!");
// Clear();
// }
// else
// if (result == DialogResult.Cancel)
// {
// e.Cancel = true;
// }
//}
}
private void ApplyPatch_Load(object sender, EventArgs e)

2
GitUI/MergePatch.Designer.cs

@ -152,6 +152,8 @@
this.Controls.Add(this.BrowsePatch);
this.Name = "MergePatch";
this.Text = "Apply patch";
this.Load += new System.EventHandler(this.MergePatch_Load);
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MergePatch_FormClosing);
this.ResumeLayout(false);
this.PerformLayout();

18
GitUI/MergePatch.cs

@ -78,8 +78,8 @@ namespace GitUI
Output.Text = result;
if (result.Contains("Patch failed"))
{
EnableButtons();
}
EnableButtons();
}
private void Mergetool_Click(object sender, EventArgs e)
@ -120,5 +120,21 @@ namespace GitUI
FormAddFiles form = new FormAddFiles();
form.Show();
}
private void MergePatch_Load(object sender, EventArgs e)
{
}
private void MergePatch_FormClosing(object sender, FormClosingEventArgs e)
{
if (Directory.Exists(GitCommands.Settings.WorkingDir + ".git\\rebase-apply\\"))
{
if (MessageBox.Show("You are in the middle of a patch apply. You need to resolve, skip or abort this patch.\nAre you sure to exit now?", "Exit", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
e.Cancel = true;
}
}
}
}
}
Loading…
Cancel
Save