Network checks no longer stop the window from rendering on startup

This commit is contained in:
N00MKRAD
2021-03-13 14:48:19 +01:00
parent d77a299936
commit 20d2922c29
3 changed files with 23 additions and 8 deletions

View File

@@ -1462,6 +1462,7 @@
this.Text = "Flowframes";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
this.Load += new System.EventHandler(this.Form1_Load);
this.Shown += new System.EventHandler(this.Form1_Shown);
this.DragDrop += new System.Windows.Forms.DragEventHandler(this.Form1_DragDrop);
this.DragEnter += new System.Windows.Forms.DragEventHandler(this.Form1_DragEnter);
this.panel1.ResumeLayout(false);

View File

@@ -14,6 +14,7 @@ using HTAlt.WinForms;
using Flowframes.Data;
using Microsoft.WindowsAPICodePack.Taskbar;
using Flowframes.MiscUtils;
using System.Threading.Tasks;
namespace Flowframes
{
@@ -53,20 +54,26 @@ namespace Flowframes
InterpolateUtils.preview = previewPicturebox;
UpdateStepByStepControls();
Initialized();
Checks();
HandleArguments();
Text = $"Flowframes {Updater.GetInstalledVer()}";
Text = $"Flowframes";
}
void Checks()
private void Form1_Shown(object sender, EventArgs e)
{
Checks();
}
async Task Checks()
{
try
{
GetWebInfo.LoadNews(newsLabel);
GetWebInfo.LoadPatronListCsv(patronsLabel);
Updater.AsyncUpdateCheck();
Updater.UpdateModelList();
Python.CheckCompression();
await Task.Delay(10);
Text = $"Flowframes " + Updater.GetInstalledVerStr();
await Updater.UpdateModelList(); // Update AI model list
await Updater.AsyncUpdateCheck(); // Check for Flowframes updates
await GetWebInfo.LoadNews(newsLabel); // Loads news/MOTD
await GetWebInfo.LoadPatronListCsv(patronsLabel); // Load patron list
await Python.CheckCompression();
}
catch (Exception e)
{

View File

@@ -14,6 +14,13 @@ namespace Flowframes.OS
public enum VersionCompareResult { Older, Newer, Equal };
public static string latestVerUrl = "https://dl.nmkd.de/flowframes/exe/ver.ini";
public static string GetInstalledVerStr ()
{
Version ver = GetInstalledVer();
if (ver.Major == 0 && ver.Minor == 0 && ver.Minor == 0) return "";
return ver.ToString();
}
public static Version GetInstalledVer()
{
try