ui: explain plz

* provide more information with the error message
This commit is contained in:
citizen-VM 2020-08-24 21:19:17 +02:00
parent e1688c9b84
commit 79b446494f
Signed by: wanderer
GPG Key ID: 6391444A736EEE7E

View File

@ -84,7 +84,7 @@ namespace KRY_0x01_ng
if (str_to_check.Length < 9)
{
/* because why not, 8 is still lame */
MessageBox.Show($"The key is too short ({str_to_check.Length} characters).\nKey requirements: 9-25 unique alphabetic characters", "Error");
MessageBox.Show($"The key is too short ({str_to_check.Length} characters).\nKey requirements: 9-25 unique alphabetic characters", "Error: short key");
return false;
}
else if (str_to_check.Length > 25)
@ -96,7 +96,7 @@ namespace KRY_0x01_ng
Match match = Regex.Match(str_to_check, @"\d|\s+");
if (match.Success)
{
MessageBox.Show("Only alphabetic characters are allowed.\nCheck the key for numbers, symbols or tab whitespace and remove them before continuing.", "Error");
MessageBox.Show("Only alphabetic characters are allowed.\nCheck the key for numbers, symbols or tab whitespace and remove them before continuing.", "Error: invalid chars in key");
return false;
}
@ -159,7 +159,7 @@ namespace KRY_0x01_ng
Match match = Regex.Match(msg, @"\d|\s+");
if (match.Success)
{
MessageBox.Show("Only alphabetic characters and spaces are allowed.\nCheck the message for numbers, symbols or tab whitespace and remove them before continuing.\nAlso, \"W\" will be replaced by \"V\".", "Error");
MessageBox.Show("Only alphabetic characters and spaces are allowed.\nCheck the message for numbers, symbols or tab whitespace and remove them before continuing.\nAlso, \"W\" will be replaced by \"V\".", "Error: invalid chars in message");
return;
}
msg = msg.Replace("W", "V");
@ -178,7 +178,7 @@ namespace KRY_0x01_ng
Match match = Regex.Match(msg, @"\d|\s+|W");
if (match.Success)
{
MessageBox.Show("Only alphabetic characters (with the exception of W) are allowed.\nCheck the cryptmessage for numbers, symbols or tab whitespace and remove them before continuing.", "Error");
MessageBox.Show("Only alphabetic characters (with the exception of W) are allowed.\nCheck the cryptmessage for numbers, symbols or tab whitespace and remove them before continuing.", "Error: invalid chars in cryptmessage");
return false;
}
if (tb_m.Text.Length % 2 != 0)