Attempt to hide shortcut splashscreen sooner

This commit is contained in:
Terry MacDonald 2021-11-09 08:34:40 +13:00
parent a716c4160a
commit 6724a4d2ae
2 changed files with 16 additions and 4 deletions

View File

@ -26,8 +26,8 @@ using System.Resources;
[assembly: Guid("e4ceaf5e-ad01-4695-b179-31168eb74c48")] [assembly: Guid("e4ceaf5e-ad01-4695-b179-31168eb74c48")]
// Version information // Version information
[assembly: AssemblyVersion("2.1.0.201")] [assembly: AssemblyVersion("2.1.0.202")]
[assembly: AssemblyFileVersion("2.1.0.201")] [assembly: AssemblyFileVersion("2.1.0.202")]
[assembly: NeutralResourcesLanguageAttribute( "en" )] [assembly: NeutralResourcesLanguageAttribute( "en" )]
[assembly: CLSCompliant(true)] [assembly: CLSCompliant(true)]

View File

@ -944,6 +944,7 @@ namespace DisplayMagician.UIForms
// Parse the game bitmaps now as we need them // Parse the game bitmaps now as we need them
GameLibraries.GameLibrary.RefreshGameBitmaps(); GameLibraries.GameLibrary.RefreshGameBitmaps();
// Load all the profiles to prepare things // Load all the profiles to prepare things
bool foundChosenProfileInLoadedProfiles = false; bool foundChosenProfileInLoadedProfiles = false;
ProfileItem chosenProfile = null; ProfileItem chosenProfile = null;
@ -1212,6 +1213,8 @@ namespace DisplayMagician.UIForms
} }
if (!gameStillInstalled) if (!gameStillInstalled)
{ {
// Close the splash screen
CloseTheSplashScreen();
DialogResult result = MessageBox.Show( 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.", $"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", @"Game no longer exists",
@ -1232,7 +1235,8 @@ namespace DisplayMagician.UIForms
// since the shortcut was last created, then we need to tell the user // since the shortcut was last created, then we need to tell the user
if (!chosenProfile.IsPossible) if (!chosenProfile.IsPossible)
{ {
// Close the splash screen
CloseTheSplashScreen();
MessageBox.Show( 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.", $"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", @"Display Profile isn't possible now",
@ -1245,6 +1249,8 @@ namespace DisplayMagician.UIForms
if (!foundChosenProfileInLoadedProfiles && !String.IsNullOrWhiteSpace(_shortcutToEdit.ProfileUUID)) if (!foundChosenProfileInLoadedProfiles && !String.IsNullOrWhiteSpace(_shortcutToEdit.ProfileUUID))
{ {
// Close the splash screen
CloseTheSplashScreen();
MessageBox.Show( 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.", @"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", @"Display Profile no longer exists",
@ -1626,13 +1632,19 @@ namespace DisplayMagician.UIForms
// Finally enable the save button if it's still valid // Finally enable the save button if it's still valid
EnableSaveButtonIfValid(); EnableSaveButtonIfValid();
// Close the splash screen
CloseTheSplashScreen();
}
private void CloseTheSplashScreen()
{
// Close the splash screen // Close the splash screen
if (ProgramSettings.LoadSettings().ShowSplashScreen && Program.AppSplashScreen != null && !Program.AppSplashScreen.Disposing && !Program.AppSplashScreen.IsDisposed) if (ProgramSettings.LoadSettings().ShowSplashScreen && Program.AppSplashScreen != null && !Program.AppSplashScreen.Disposing && !Program.AppSplashScreen.IsDisposed)
Program.AppSplashScreen.Invoke(new Action(() => Program.AppSplashScreen.Close())); Program.AppSplashScreen.Invoke(new Action(() => Program.AppSplashScreen.Close()));
this.TopMost = true; this.TopMost = true;
this.Focus(); this.Focus();
this.TopMost = false; this.TopMost = false;
} }
private void rb_standalone_CheckedChanged(object sender, EventArgs e) private void rb_standalone_CheckedChanged(object sender, EventArgs e)