initial populating regression testing window
This commit is contained in:
parent
fcde8a1c5b
commit
6b8ab4907c
@ -372,6 +372,62 @@ namespace EduNetworkBuilder
|
|||||||
btnOK.Enabled = false;
|
btnOK.Enabled = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (MyMode == LBContents.regressiontest)
|
||||||
|
{
|
||||||
|
cbLoadPuzzlesAtStart.Visible = false;
|
||||||
|
btnReset.Visible = false;
|
||||||
|
tbSearchBox.Visible = false;
|
||||||
|
|
||||||
|
PuzzleInfo pi;
|
||||||
|
string shown_name;
|
||||||
|
string puzzle_name = "";
|
||||||
|
List<string> Puzzles = NB.GetPuzzleNames();
|
||||||
|
NBSettings oursettings = NB.GetSettings();
|
||||||
|
if (Puzzles == null) return;
|
||||||
|
bool wasfinished = false;
|
||||||
|
foreach (string str in Puzzles)
|
||||||
|
{
|
||||||
|
wasfinished = false;
|
||||||
|
pi = NB.GetPuzzleInfoFromName(str);
|
||||||
|
//shown_name = pi.PuzzleName;
|
||||||
|
shown_name = pi.NetTitle.GetText();
|
||||||
|
puzzle_name = pi.PuzzleName;
|
||||||
|
if (oursettings.CheckIfDone(str))
|
||||||
|
{
|
||||||
|
wasfinished = true;
|
||||||
|
}
|
||||||
|
foreach (string tag in pi.PuzzleTags)
|
||||||
|
{
|
||||||
|
if (isChecked(tag))
|
||||||
|
{
|
||||||
|
MyPuzzleEntry MPE = new MyPuzzleEntry();
|
||||||
|
MPE.PuzzleName = puzzle_name;
|
||||||
|
MPE.Title = shown_name;
|
||||||
|
MPE.isdone = wasfinished;
|
||||||
|
MPE.level = tag;
|
||||||
|
if (selected == "" && !wasfinished) selected = shown_name; //Select the first unfinished puzzle
|
||||||
|
lbWindowData.Items.Add(MPE);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (selected != null && selected != "")
|
||||||
|
{
|
||||||
|
foreach (object one in lbWindowData.Items)
|
||||||
|
{
|
||||||
|
if (one.ToString() == selected)
|
||||||
|
lbWindowData.SelectedItem = selected;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (lbWindowData.SelectedIndex != -1)
|
||||||
|
{
|
||||||
|
btnOK.Enabled = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
btnOK.Enabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnOK_Click(object sender, EventArgs e)
|
private void btnOK_Click(object sender, EventArgs e)
|
||||||
|
Loading…
Reference in New Issue
Block a user