Added a message when key was changed

This commit is contained in:
Sigmanor 2016-01-25 14:45:31 +02:00
parent a44fb626d7
commit 7efb253534

View file

@ -270,12 +270,22 @@ private void MainWindow_FormClosing(object sender, FormClosingEventArgs e)
if (customRTB.Text != "") if (customRTB.Text != "")
{ {
DialogResult res = new DialogResult(); DialogResult res = new DialogResult();
string messageBoxText = "";
if (keyChanged == false)
{
messageBoxText = "Save file: " + "\"" + NameWithotPath + "\"" + " ? ";
}
if (keyChanged == true)
{
messageBoxText = "Save file: " + "\"" + NameWithotPath + "\"" + " with a new key? ";
}
//Save file with a new key?
using (new CenterWinDialog(this)) using (new CenterWinDialog(this))
{ {
res = MessageBox.Show("Save file: " + "\"" + NameWithotPath + "\"" + " ? ", res = MessageBox.Show(messageBoxText, "Crypto Notepad",
"Crypto Notepad", MessageBoxButtons.YesNoCancel,
MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
MessageBoxIcon.Question);
if (res == DialogResult.Yes) if (res == DialogResult.Yes)
{ {
if (filename == noname) if (filename == noname)