Add bulk check to Checksums button

Hold control to have the Bulk Legality analysis spit out its results to
the clipboard.
This commit is contained in:
Kurt 2019-04-14 09:08:33 -07:00
parent 34ea56c2a7
commit 95267afb2d

View File

@ -685,7 +685,7 @@ private void B_JPEG_Click(object sender, EventArgs e)
WinFormsUtil.Alert(MsgSaveJPEGExportFail);
return;
}
string filename = SAV.JPEGTitle + "'s picture";
string filename = $"{SAV.JPEGTitle}'s picture";
var sfd = new SaveFileDialog { FileName = filename, Filter = "JPEG|*.jpeg" };
if (sfd.ShowDialog() != DialogResult.OK)
return;
@ -694,9 +694,32 @@ private void B_JPEG_Click(object sender, EventArgs e)
private void ClickVerifyCHK(object sender, EventArgs e)
{
if (SAV.Edited) { WinFormsUtil.Alert(MsgSaveChecksumFailEdited); return; }
if (ModifierKeys == Keys.Control)
{
var bulk = new BulkAnalysis(SAV);
if (bulk.Parse.Count == 0)
{
WinFormsUtil.Alert("Clean!");
return;
}
var lines = bulk.Parse.Select(z => $"{z.Judgement}: {z.Comment}");
var msg = string.Join(Environment.NewLine, lines);
Clipboard.SetText(msg);
SystemSounds.Asterisk.Play();
return;
}
if (SAV.Edited)
{
WinFormsUtil.Alert(MsgSaveChecksumFailEdited);
return;
}
if (SAV.ChecksumsValid)
{
WinFormsUtil.Alert(MsgSaveChecksumValid);
return;
}
if (SAV.ChecksumsValid) { WinFormsUtil.Alert(MsgSaveChecksumValid); return; }
if (DialogResult.Yes == WinFormsUtil.Prompt(MessageBoxButtons.YesNo, MsgSaveChecksumFailExport))
Clipboard.SetText(SAV.ChecksumInfo);
}