This commit is contained in:
Alexander 2019-11-11 19:25:39 +02:00
parent 9fde277705
commit 3d012ea475

View file

@ -1144,6 +1144,10 @@ private async void SaveAsMainMenu_Click(object sender, EventArgs e)
PublicVar.openFileName = "Unnamed.cnp";
saveFileDialog.FileName = "Unnamed.cnp";
}
if (saveFileDialog.ShowDialog() != DialogResult.OK)
{
return;
}
EnterKeyForm enterKeyForm = new EnterKeyForm
{
Owner = this
@ -1157,14 +1161,7 @@ private async void SaveAsMainMenu_Click(object sender, EventArgs e)
return;
}
}
if (saveFileDialog.ShowDialog() != DialogResult.OK)
{
return;
}
if (TypedPassword.Value == null)
{
TypedPassword.Value = PublicVar.encryptionKey.Get();
}
PublicVar.encryptionKey.Set(TypedPassword.Value);
filePath = saveFileDialog.FileName;
mainMenu.Enabled = false;
toolbarPanel.Enabled = false;
@ -1184,7 +1181,6 @@ private async void SaveAsMainMenu_Click(object sender, EventArgs e)
richTextBox.ReadOnly = false;
richTextBox.Modified = false;
Text = Path.GetFileName(filePath) + " " + PublicVar.appName;
PublicVar.encryptionKey.Set(TypedPassword.Value);
TypedPassword.Value = null;
PublicVar.openFileName = Path.GetFileName(saveFileDialog.FileName);
StatusPanelMessage("save");