Update method improved

This commit is contained in:
Alexander 2019-10-02 19:35:34 +03:00
parent acaab489a2
commit 7281d0bae4

View file

@ -1,4 +1,4 @@
using Crypto_Notepad.Properties;
using Crypto_Notepad.Properties;
using System;
using System.ComponentModel;
using System.Diagnostics;
@ -46,7 +46,7 @@ protected override void WndProc(ref Message m)
}
#region Functions
#region Methods
private void DecryptAES()
{
EnterKeyForm enterKeyForm = new EnterKeyForm
@ -379,8 +379,6 @@ private void CheckForUpdates(bool autoCheck)
if (serverVersion > appVersion)
{
mainMenu.Invoke((Action)delegate
{
if (statusPanel.Visible)
{
StatusPanelMessage("update-needed");
@ -402,13 +400,10 @@ private void CheckForUpdates(bool autoCheck)
}
}
}
});
}
if (serverVersion <= appVersion && autoCheck)
{
mainMenu.Invoke((Action)delegate
{
using (new CenterWinDialog(this))
{
if (statusPanel.Visible)
@ -420,9 +415,7 @@ private void CheckForUpdates(bool autoCheck)
MessageBox.Show("Crypto Notepad is up to date.", PublicVar.appName, MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
});
}
}
catch
{
@ -605,6 +598,7 @@ public void MenuIcons()
}
}
}
public void Toolbaricons(bool oldicons)
{
if (oldicons)
@ -744,8 +738,9 @@ private void MainWindow_Load(object sender, EventArgs e)
if (settings.autoCheckUpdate)
{
Thread up = new Thread(() => CheckForUpdates(false));
up.Start();
//Thread up = new Thread(() => CheckForUpdates(false));
//up.Start();
CheckForUpdates(false);
}
MenuIcons();
@ -1319,8 +1314,9 @@ private void DocsMainMenu_Click(object sender, EventArgs e)
private void UpdatesMainMenu_Click(object sender, EventArgs e)
{
Thread up = new Thread(() => CheckForUpdates(true));
up.Start();
//Thread up = new Thread(() => CheckForUpdates(true));
//up.Start();
CheckForUpdates(true);
}
private void AboutMainMenu_Click(object sender, EventArgs e)