Skip to content

Commit

Permalink
Merge branch 'RC2.19.5_master' of github.com:DynamoDS/Dynamo into RC2…
Browse files Browse the repository at this point in the history
….19.5_master
  • Loading branch information
aparajit-pratap committed Mar 18, 2024
2 parents 121657e + cdf8c5a commit 8db26f3
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion src/DynamoCoreWpf/Views/SplashScreen/SplashScreen.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -475,9 +475,15 @@ private static bool IsValidPreferencesFile(string filePath)
/// <summary>
/// If the user wants to close the window, we shutdown the application and don't launch Dynamo
/// </summary>
internal void CloseWindow()
/// <param name="isCheckboxChecked">If true, the user has chosen to not show splash screen on next run.</param>
internal void CloseWindow(bool isCheckboxChecked = false)
{
CloseWasExplicit = true;
if (viewModel != null && isCheckboxChecked)
{
viewModel.PreferenceSettings.EnableStaticSplashScreen = !isCheckboxChecked;
}

if (Application.Current != null)
{
Application.Current.Shutdown();
Expand Down Expand Up @@ -519,6 +525,9 @@ enum ImportStatus
success
}

/// <summary>
/// This class is used to expose the methods that can be called from the webview2 component, SplashScreen.
/// </summary>
[ClassInterface(ClassInterfaceType.AutoDual)]
[ComVisible(true)]
public class ScriptObject
Expand All @@ -528,7 +537,12 @@ public class ScriptObject
readonly Func<bool> RequestSignIn;
readonly Func<bool> RequestSignOut;
readonly Action RequestCloseWindow;
readonly Action<bool> RequestCloseWindowPreserve;

/// <summary>
/// [Obsolete] Constructor for ScriptObject
/// </summary>
[Obsolete]
public ScriptObject(Action<bool> requestLaunchDynamo, Action<string> requestImportSettings, Func< bool> requestSignIn, Func<bool> requestSignOut, Action requestCloseWindow)
{
RequestLaunchDynamo = requestLaunchDynamo;
Expand All @@ -537,6 +551,17 @@ public ScriptObject(Action<bool> requestLaunchDynamo, Action<string> requestImpo
RequestSignOut = requestSignOut;
RequestCloseWindow = requestCloseWindow;
}
/// <summary>
/// Constructor for ScriptObject with an overload for close window method, to preserve "Don't show again" setting on splash screen on explicit close event.
/// </summary>
public ScriptObject(Action<bool> requestLaunchDynamo, Action<string> requestImportSettings, Func<bool> requestSignIn, Func<bool> requestSignOut, Action<bool> requestCloseWindow)
{
RequestLaunchDynamo = requestLaunchDynamo;
RequestImportSettings = requestImportSettings;
RequestSignIn = requestSignIn;
RequestSignOut = requestSignOut;
RequestCloseWindowPreserve = requestCloseWindow;
}

public void LaunchDynamo(bool showScreenAgain)
{
Expand All @@ -560,5 +585,9 @@ public void CloseWindow()
{
RequestCloseWindow();
}
public void CloseWindowPreserve(bool isCheckboxChecked)
{
RequestCloseWindowPreserve(isCheckboxChecked);
}
}
}

0 comments on commit 8db26f3

Please sign in to comment.