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; _mainTabInitialized = true;
} }
public void Initialized() public static void CloseAllSplashForms ()
{ {
Application.OpenForms.OfType<SplashForm>().ToList().ForEach(f => f.Close()); Application.OpenForms.OfType<SplashForm>().ToList().ForEach(f => f.Close());
}
public void Initialized()
{
CloseAllSplashForms();
_initialized = true; _initialized = true;
runBtn.Enabled = true; runBtn.Enabled = true;

View File

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

View File

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

View File

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

View File

@@ -13,6 +13,8 @@ using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using Flowframes.Data; using Flowframes.Data;
using Flowframes.MiscUtils; using Flowframes.MiscUtils;
using Flowframes.Forms;
using Flowframes.Forms.Main;
namespace Flowframes.Ui namespace Flowframes.Ui
{ {
@@ -34,10 +36,12 @@ namespace Flowframes.Ui
if (Config.GetBool(Config.Key.clearLogOnInput)) if (Config.GetBool(Config.Key.clearLogOnInput))
Logger.ClearLogBox(); Logger.ClearLogBox();
var importSplash = new SplashForm("Importing...", topMost: false);
SetOutPath(outputTbox, inputTbox.Text.Trim().GetParentDir()); SetOutPath(outputTbox, inputTbox.Text.Trim().GetParentDir());
Program.lastInputPath = path; Program.lastInputPath = path;
Program.lastInputPathIsSsd = OsUtils.DriveIsSSD(path); Program.lastInputPathIsSsd = Config.GetBool("checkInputFileDriveType", false) && OsUtils.DriveIsSSD(path);
if (!Program.lastInputPathIsSsd) 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."); 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 { } catch { }
Form1.CloseAllSplashForms();
if (!Cli.AutoRun) if (!Cli.AutoRun)
{ {
Program.mainForm.Enabled = true; Program.mainForm.Enabled = true;