From a521f9cfbbf7dbca00a6d07b75280e358a97ecaf Mon Sep 17 00:00:00 2001 From: N00MKRAD <61149547+n00mkrad@users.noreply.github.com> Date: Wed, 16 Oct 2024 13:50:26 +0200 Subject: [PATCH] File import splash, disable input file drive check by default --- CodeLegacy/Forms/Main/Form1.cs | 7 ++++++- CodeLegacy/Forms/SplashForm.cs | 7 ++++++- CodeLegacy/Media/HwEncCheck.cs | 3 +-- CodeLegacy/Program.cs | 3 +-- CodeLegacy/Ui/MainUiFunctions.cs | 8 +++++++- 5 files changed, 21 insertions(+), 7 deletions(-) diff --git a/CodeLegacy/Forms/Main/Form1.cs b/CodeLegacy/Forms/Main/Form1.cs index 8e684fa..bdcbc7f 100644 --- a/CodeLegacy/Forms/Main/Form1.cs +++ b/CodeLegacy/Forms/Main/Form1.cs @@ -450,9 +450,14 @@ namespace Flowframes.Forms.Main _mainTabInitialized = true; } - public void Initialized() + public static void CloseAllSplashForms () { Application.OpenForms.OfType().ToList().ForEach(f => f.Close()); + } + + public void Initialized() + { + CloseAllSplashForms(); _initialized = true; runBtn.Enabled = true; diff --git a/CodeLegacy/Forms/SplashForm.cs b/CodeLegacy/Forms/SplashForm.cs index 38bc0fe..9828978 100644 --- a/CodeLegacy/Forms/SplashForm.cs +++ b/CodeLegacy/Forms/SplashForm.cs @@ -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) diff --git a/CodeLegacy/Media/HwEncCheck.cs b/CodeLegacy/Media/HwEncCheck.cs index 68b777c..d76ddd9 100644 --- a/CodeLegacy/Media/HwEncCheck.cs +++ b/CodeLegacy/Media/HwEncCheck.cs @@ -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; diff --git a/CodeLegacy/Program.cs b/CodeLegacy/Program.cs index 220275f..f1d701b 100644 --- a/CodeLegacy/Program.cs +++ b/CodeLegacy/Program.cs @@ -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(); } diff --git a/CodeLegacy/Ui/MainUiFunctions.cs b/CodeLegacy/Ui/MainUiFunctions.cs index 639ceb5..dfa2b45 100644 --- a/CodeLegacy/Ui/MainUiFunctions.cs +++ b/CodeLegacy/Ui/MainUiFunctions.cs @@ -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;