Make a test-all button

This commit is contained in:
Tim Young 2018-09-28 08:07:54 -05:00
parent c10db3a8bb
commit 03c9f3404a

View File

@ -396,10 +396,13 @@ namespace EduNetworkBuilder
if (MyMode == LBContents.regressiontest)
{
cbLoadPuzzlesAtStart.Visible = false;
btnReset.Visible = false;
btnReset.Visible = true;
btnReset.Text = "Close";
tbSearchBox.Visible = false;
btnOK.Text = "Test";
btnAdd.Text = "Test All";
btnOK.Text = "Test One";
PuzzleInfo pi;
string shown_name;
@ -408,6 +411,7 @@ namespace EduNetworkBuilder
NBSettings oursettings = NB.GetSettings();
if (Puzzles == null) return;
bool wasfinished = false;
int count = 0;
foreach (string str in Puzzles)
{
wasfinished = false;
@ -443,6 +447,7 @@ namespace EduNetworkBuilder
MPE.HasTest = oursettings.HasReplay(puzzle_name);
if (selected == "" && !wasfinished) selected = shown_name; //Select the first unfinished puzzle
lbWindowData.Items.Add(MPE);
if(MPE.HasTest) count++; //we can only test-all if there are tests to do
break;
}
}
@ -460,6 +465,8 @@ namespace EduNetworkBuilder
{
btnOK.Enabled = false;
}
if (count > 0) btnAdd.Enabled = true;
else btnAdd.Enabled = false;
}
}
@ -633,7 +640,7 @@ namespace EduNetworkBuilder
}
Close();
}
//In regression, this is the close button
//In regression, this is the test all button
if (MyMode == LBContents.regressiontest)
{
ClosingRegression = true;
@ -741,6 +748,15 @@ namespace EduNetworkBuilder
}
private void btnReset_Click(object sender, EventArgs e)
{
if (MyMode == LBContents.regressiontest)
{
//In regressiontest mode, this is the cancel.
ClosingRegression = true;
Close();
return;
}
else
{
DialogResult answer = MessageBox.Show(NB.Translate("LBW_btnResetYouSure"), NB.Translate("LBW_btnResetForget"), MessageBoxButtons.YesNo);
if (answer == System.Windows.Forms.DialogResult.Yes)
@ -750,6 +766,7 @@ namespace EduNetworkBuilder
UpdateForm();
}
}
}
private void tbSearchBox_TextChanged(object sender, EventArgs e)
{