Added notification in window title bar when file saved

This commit is contained in:
Alexander 2019-08-30 13:07:26 +03:00
parent 300fadf616
commit 0df8dba2cb

View file

@ -1,4 +1,4 @@
using IWshRuntimeLibrary; using IWshRuntimeLibrary;
using System; using System;
using System.ComponentModel; using System.ComponentModel;
using System.Diagnostics; using System.Diagnostics;
@ -10,6 +10,7 @@
using System.Reflection; using System.Reflection;
using System.Security.Cryptography; using System.Security.Cryptography;
using System.Threading; using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using File = System.IO.File; using File = System.IO.File;
@ -441,6 +442,17 @@ private void CheckForUpdates(bool autoCheck)
} }
} }
private async void SaveStatus()
{
if (!Text.Contains(" [File Saved]"))
{
string common = Text;
Text += " [File Saved]";
await Task.Delay(3000);
Text = common;
}
}
private void AutoLock(bool minimize) private void AutoLock(bool minimize)
{ {
EnterKeyForm f2 = new EnterKeyForm(); EnterKeyForm f2 = new EnterKeyForm();
@ -1003,6 +1015,7 @@ private void SaveToolStripMenuItem_Click(object sender, EventArgs e)
} }
RichTextBox.Modified = false; RichTextBox.Modified = false;
PublicVar.keyChanged = false; PublicVar.keyChanged = false;
SaveStatus();
} }
private void SaveAsToolStripMenuItem_Click(object sender, EventArgs e) private void SaveAsToolStripMenuItem_Click(object sender, EventArgs e)
@ -1052,6 +1065,7 @@ private void SaveAsToolStripMenuItem_Click(object sender, EventArgs e)
PublicVar.encryptionKey.Set(TypedPassword.Value); PublicVar.encryptionKey.Set(TypedPassword.Value);
TypedPassword.Value = null; TypedPassword.Value = null;
PublicVar.openFileName = Path.GetFileName(SaveFile.FileName); PublicVar.openFileName = Path.GetFileName(SaveFile.FileName);
SaveStatus();
} }
private void OpenFileLocationToolStripMenuItem_Click(object sender, EventArgs e) private void OpenFileLocationToolStripMenuItem_Click(object sender, EventArgs e)