Skip to content

Commit

Permalink
Fix missing action buttons on OutputBox
Browse files Browse the repository at this point in the history
  • Loading branch information
sboulema committed Aug 9, 2016
1 parent 27a738e commit 81fae92
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 42 deletions.
12 changes: 6 additions & 6 deletions TGit/Helpers/ProcessHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ private void OutputDataHandler(object sendingProcess, DataReceivedEventArgs outL

var text = outLine.Data + Environment.NewLine;

_outputBox.BeginInvoke((Action) (() => _outputBox.richTextBox1.AppendText(text, text.StartsWith(">"))));
_outputBox.BeginInvoke((Action) (() => _outputBox.richTextBox1.Select(_outputBox.richTextBox1.TextLength - text.Length + 1, 0)));
_outputBox.BeginInvoke((Action) (() => _outputBox.richTextBox1.ScrollToCaret()));
_outputBox.BeginInvoke((Action) (() => _outputBox.richTextBox.AppendText(text, text.StartsWith(">"))));
_outputBox.BeginInvoke((Action) (() => _outputBox.richTextBox.Select(_outputBox.richTextBox.TextLength - text.Length + 1, 0)));
_outputBox.BeginInvoke((Action) (() => _outputBox.richTextBox.ScrollToCaret()));
}

private void process_Exited(object sender, EventArgs e)
Expand All @@ -214,12 +214,12 @@ private void process_Exited(object sender, EventArgs e)
var exitCodeText = process.ExitCode == 0 ? "Succes" : "Error";
var summaryText = $"{Environment.NewLine}{exitCodeText} ({_stopwatch.ElapsedMilliseconds} ms @ {process.StartTime})";

_outputBox.BeginInvoke((Action) (() => _outputBox.richTextBox1.AppendText(
_outputBox.BeginInvoke((Action) (() => _outputBox.richTextBox.AppendText(
summaryText,
process.ExitCode == 0 ? Color.Blue : Color.Red,
true)));
_outputBox.BeginInvoke((Action) (() => _outputBox.richTextBox1.Select(_outputBox.richTextBox1.TextLength - summaryText.Length + Environment.NewLine.Length, 0)));
_outputBox.BeginInvoke((Action) (() => _outputBox.richTextBox1.ScrollToCaret()));
_outputBox.BeginInvoke((Action) (() => _outputBox.richTextBox.Select(_outputBox.richTextBox.TextLength - summaryText.Length + Environment.NewLine.Length, 0)));
_outputBox.BeginInvoke((Action) (() => _outputBox.richTextBox.ScrollToCaret()));
_outputBox.BeginInvoke((Action) (() => _outputBox.okButton.Enabled = true));
}
}
Expand Down
44 changes: 12 additions & 32 deletions TGit/OutputBox.Designer.cs

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

8 changes: 4 additions & 4 deletions TGit/OutputBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public OutputBox(DTE dte)
private void okButton_Click(object sender, EventArgs e)
{
Close();
textBox.Clear();
richTextBox.Clear();
okButton.Enabled = false;
}

Expand All @@ -43,9 +43,9 @@ private void StashButton_Click(object sender, EventArgs e)

private void textBox_TextChanged(object sender, EventArgs e)
{
if (!textBox.Text.ToLower().Contains("error")) return;
if (!richTextBox.Text.ToLower().Contains("error")) return;

if (textBox.Text.ToLower().Contains("fix conflicts") && !flowLayoutPanel1.Controls.Find("Resolve", true).Any())
if (richTextBox.Text.ToLower().Contains("fix conflicts") && !flowLayoutPanel1.Controls.Find("Resolve", true).Any())
{
var resolveButton = new Button
{
Expand All @@ -57,7 +57,7 @@ private void textBox_TextChanged(object sender, EventArgs e)
flowLayoutPanel1.Controls.Add(resolveButton);
}

if (textBox.Text.ToLower().Contains("stash") && !flowLayoutPanel1.Controls.Find("Stash", true).Any())
if (richTextBox.Text.ToLower().Contains("stash") && !flowLayoutPanel1.Controls.Find("Stash", true).Any())
{
var stashButton = new Button
{
Expand Down

0 comments on commit 81fae92

Please sign in to comment.