From 6724a4d2ae8fcb314520eda588ea1ce185fde066 Mon Sep 17 00:00:00 2001 From: Terry MacDonald Date: Tue, 9 Nov 2021 08:34:40 +1300 Subject: [PATCH] Attempt to hide shortcut splashscreen sooner --- DisplayMagician/Properties/AssemblyInfo.cs | 4 ++-- DisplayMagician/UIForms/ShortcutForm.cs | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/DisplayMagician/Properties/AssemblyInfo.cs b/DisplayMagician/Properties/AssemblyInfo.cs index 431bb12..28341a8 100644 --- a/DisplayMagician/Properties/AssemblyInfo.cs +++ b/DisplayMagician/Properties/AssemblyInfo.cs @@ -26,8 +26,8 @@ using System.Resources; [assembly: Guid("e4ceaf5e-ad01-4695-b179-31168eb74c48")] // Version information -[assembly: AssemblyVersion("2.1.0.201")] -[assembly: AssemblyFileVersion("2.1.0.201")] +[assembly: AssemblyVersion("2.1.0.202")] +[assembly: AssemblyFileVersion("2.1.0.202")] [assembly: NeutralResourcesLanguageAttribute( "en" )] [assembly: CLSCompliant(true)] diff --git a/DisplayMagician/UIForms/ShortcutForm.cs b/DisplayMagician/UIForms/ShortcutForm.cs index 305a0ea..16f064c 100644 --- a/DisplayMagician/UIForms/ShortcutForm.cs +++ b/DisplayMagician/UIForms/ShortcutForm.cs @@ -944,6 +944,7 @@ namespace DisplayMagician.UIForms // Parse the game bitmaps now as we need them GameLibraries.GameLibrary.RefreshGameBitmaps(); + // Load all the profiles to prepare things bool foundChosenProfileInLoadedProfiles = false; ProfileItem chosenProfile = null; @@ -1212,6 +1213,8 @@ namespace DisplayMagician.UIForms } if (!gameStillInstalled) { + // Close the splash screen + CloseTheSplashScreen(); DialogResult result = MessageBox.Show( $"This shortcut refers to the '{_shortcutToEdit.GameName}' game that was installed in your {_shortcutToEdit.GameLibrary.ToString("G")} library. This game is no longer installed, so the shortcut won't work. You either need to change the game used in the Shortcut to another installed game, or you need to install the game files on your computer again.", @"Game no longer exists", @@ -1232,7 +1235,8 @@ namespace DisplayMagician.UIForms // since the shortcut was last created, then we need to tell the user if (!chosenProfile.IsPossible) { - + // Close the splash screen + CloseTheSplashScreen(); MessageBox.Show( $"The '{chosenProfile.Name}' Display Profile used by this Shortcut still exists, but it isn't possible to use it right now. You can either change the Display Profile this Shortcut uses, or you can change your Displays to make the Display Profile valid again.", @"Display Profile isn't possible now", @@ -1245,6 +1249,8 @@ namespace DisplayMagician.UIForms if (!foundChosenProfileInLoadedProfiles && !String.IsNullOrWhiteSpace(_shortcutToEdit.ProfileUUID)) { + // Close the splash screen + CloseTheSplashScreen(); MessageBox.Show( @"The Display Profile used by this Shortcut no longer exists and cannot be used. You need to choose a new Display Profile for this Shortcut.", @"Display Profile no longer exists", @@ -1626,13 +1632,19 @@ namespace DisplayMagician.UIForms // Finally enable the save button if it's still valid EnableSaveButtonIfValid(); + // Close the splash screen + CloseTheSplashScreen(); + + } + + private void CloseTheSplashScreen() + { // Close the splash screen if (ProgramSettings.LoadSettings().ShowSplashScreen && Program.AppSplashScreen != null && !Program.AppSplashScreen.Disposing && !Program.AppSplashScreen.IsDisposed) Program.AppSplashScreen.Invoke(new Action(() => Program.AppSplashScreen.Close())); this.TopMost = true; this.Focus(); this.TopMost = false; - } private void rb_standalone_CheckedChanged(object sender, EventArgs e)