File import splash, disable input file drive check by default

This commit is contained in:
N00MKRAD
2024-10-16 13:50:26 +02:00
parent 3a13e975fd
commit a521f9cfbb
5 changed files with 21 additions and 7 deletions

View File

@@ -450,9 +450,14 @@ namespace Flowframes.Forms.Main
_mainTabInitialized = true;
}
public void Initialized()
public static void CloseAllSplashForms ()
{
Application.OpenForms.OfType<SplashForm>().ToList().ForEach(f => f.Close());
}
public void Initialized()
{
CloseAllSplashForms();
_initialized = true;
runBtn.Enabled = true;

View File

@@ -8,12 +8,17 @@ namespace Flowframes.Forms
public enum TextSize { Small, Medium, Large }
private static readonly string[] fontPresets = { "Yu Gothic UI, 14pt", "Yu Gothic UI, 18pt", "Yu Gothic UI, 21.75pt" };
public SplashForm(string status = "", bool topMost = true, TextSize textSize = TextSize.Large)
public SplashForm(string status = "", bool topMost = true, TextSize textSize = TextSize.Large, bool show = true)
{
InitializeComponent();
SetStatus(status);
TopMost = topMost;
statusLabel.Font = (Font)new FontConverter().ConvertFromInvariantString(fontPresets[(int)textSize]);
if (show)
{
Show();
}
}
private void SplashForm_Load(object sender, System.EventArgs e)

View File

@@ -16,8 +16,7 @@ namespace Flowframes.Media
return;
Logger.Log($"Detecting hardare encoding support...");
SplashForm statusForm = new SplashForm("Checking hardware encoders...", textSize: SplashForm.TextSize.Medium);
statusForm.Show();
var statusForm = new SplashForm("Checking hardware encoders...", textSize: SplashForm.TextSize.Medium);
var previousMainFormOpacity = Program.mainForm.Opacity;

View File

@@ -46,7 +46,6 @@ namespace Flowframes
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
var splash = new SplashForm("Starting Flowframes...");
splash.Show();
// Force culture to en-US across entire application (to avoid number parsing issues etc)
var culture = new CultureInfo("en-US");
@@ -61,8 +60,8 @@ namespace Flowframes
Paths.Init();
Config.Init();
Task.Run(() => DiskSpaceCheckLoop());
Logger.Log($"Command Line: {Environment.CommandLine}", true);
Task.Run(() => DiskSpaceCheckLoop());
LaunchGui();
}

View File

@@ -13,6 +13,8 @@ using System.Threading.Tasks;
using System.Windows.Forms;
using Flowframes.Data;
using Flowframes.MiscUtils;
using Flowframes.Forms;
using Flowframes.Forms.Main;
namespace Flowframes.Ui
{
@@ -34,10 +36,12 @@ namespace Flowframes.Ui
if (Config.GetBool(Config.Key.clearLogOnInput))
Logger.ClearLogBox();
var importSplash = new SplashForm("Importing...", topMost: false);
SetOutPath(outputTbox, inputTbox.Text.Trim().GetParentDir());
Program.lastInputPath = path;
Program.lastInputPathIsSsd = OsUtils.DriveIsSSD(path);
Program.lastInputPathIsSsd = Config.GetBool("checkInputFileDriveType", false) && OsUtils.DriveIsSSD(path);
if (!Program.lastInputPathIsSsd)
Logger.Log("Your file seems to be on an HDD or USB device. It is recommended to interpolate videos on an SSD drive for best performance.");
@@ -70,6 +74,8 @@ namespace Flowframes.Ui
}
catch { }
Form1.CloseAllSplashForms();
if (!Cli.AutoRun)
{
Program.mainForm.Enabled = true;