Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/DynamoDS/Dynamo
Browse files Browse the repository at this point in the history
  • Loading branch information
zeusongit committed Jan 17, 2024
2 parents a7d388d + 61a4f7d commit 2aa9ecf
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 26 deletions.
9 changes: 9 additions & 0 deletions src/DynamoCoreWpf/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/DynamoCoreWpf/Properties/Resources.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -3885,4 +3885,7 @@ In certain complex graphs or host program scenarios, Automatic mode may cause in
<data name="SignOutConfirmationDialogTitle" xml:space="preserve">
<value>Sign out of Dynamo</value>
</data>
<data name="ResetChangesWarningPopupMessage" xml:space="preserve">
<value>Your changes will be lost if you proceed.</value>
</data>
</root>
3 changes: 3 additions & 0 deletions src/DynamoCoreWpf/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -3872,4 +3872,7 @@ In certain complex graphs or host program scenarios, Automatic mode may cause in
<data name="SignOutConfirmationDialogTitle" xml:space="preserve">
<value>Sign out of Dynamo</value>
</data>
<data name="ResetChangesWarningPopupMessage" xml:space="preserve">
<value>Your changes will be lost if you proceed.</value>
</data>
</root>
10 changes: 0 additions & 10 deletions src/DynamoCoreWpf/UI/GuidedTour/GuidesManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,22 +262,13 @@ internal void ExitTour()

dynamoViewModel.OnEnableShortcutBarItems(true);

EnableDynamoUI();

//Hide guide background overlay
guideBackgroundElement.Visibility = Visibility.Hidden;
GuidesValidationMethods.CurrentExecutingGuide = null;
tourStarted = false;
}
}

private void EnableDynamoUI()
{
var dynamoView = mainRootElement as DynamoView;
if (dynamoView != null)
dynamoView.EnableEnvironment(true);
}

/// <summary>
/// Creates the exit modal when close button is pressed
/// </summary>
Expand Down Expand Up @@ -306,7 +297,6 @@ private void ContinueTourButton_Click(object sender, RoutedEventArgs e)
private void ExitTourButton_Click(object sender, RoutedEventArgs e)
{
exitGuideWindow.IsOpen = false;
EnableDynamoUI();
GuideFlowEvents.OnGuidedTourExited(currentGuide.Name);
ExitTour();
}
Expand Down
7 changes: 0 additions & 7 deletions src/DynamoCoreWpf/UI/GuidedTour/GuidesValidationMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -392,13 +392,6 @@ private static void ClosePackageManager(PackageManagerView packageManager)
packageManager.PackageManagerViewModel.Width = PMDefaultWidth;
packageManager.PackageManagerViewModel.Height = PMDefaultHeight;
packageManagerViewModel.PropertyChanged -= searchPackagesPropertyChanged.Invoke;

//Enable the DynamoView.mainGrid so the user will be able to interact with Dynamo
var dynamoView = packageManager.Owner as DynamoView;
if (dynamoView != null)
{
dynamoView.EnableEnvironment(true);
}
packageManager.Close();

}
Expand Down
10 changes: 3 additions & 7 deletions src/DynamoCoreWpf/Views/Core/DynamoView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2316,11 +2316,6 @@ private void HandlePackageManagerWindowClosed(object sender, EventArgs e)
cmd.Dispose();
}

internal void EnableEnvironment(bool isEnabled)
{
this.mainGrid.IsEnabled = isEnabled;
}

/// <summary>
/// Adds/Removes an overlay so the user won't be able to interact with the background (this behavior was implemented for Dynamo and for Library)
/// </summary>
Expand All @@ -2329,14 +2324,15 @@ internal void EnableOverlayBlocker(bool isEnabled)
{
object[] parametersInvokeScript = new object[] { "fullOverlayVisible", new object[] { isEnabled } };
ResourceUtilities.ExecuteJSFunction(this, parametersInvokeScript);
var backgroundName = "BackgroundBlocker";

if (isEnabled)
{
//By default the shortcutsBarGrid has a ZIndex = 1 then will be shown over the overlay that's why we need to change the ZIndex
Panel.SetZIndex(shortcutsBarGrid, 0);
var backgroundElement = new GuideBackground(this)
{
Name = "BackgroundBlocker",
Name = backgroundName,
HorizontalAlignment = HorizontalAlignment.Left,
VerticalAlignment = VerticalAlignment.Top,
Visibility = Visibility.Visible
Expand All @@ -2351,7 +2347,7 @@ internal void EnableOverlayBlocker(bool isEnabled)
{
//Restoring the ZIndex value to the default one.
Panel.SetZIndex(shortcutsBarGrid, 1);
var backgroundElement = mainGrid.Children.OfType<GuideBackground>().FirstOrDefault();
var backgroundElement = mainGrid.Children.OfType<GuideBackground>().Where(element => element.Name == backgroundName).FirstOrDefault();
if (backgroundElement != null)
{
mainGrid.Children.Remove(backgroundElement);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,8 @@ private void CancelButton_Click(object sender, RoutedEventArgs e)
MessageBoxResult response = DynamoModel.IsTestMode ? MessageBoxResult.OK :
MessageBoxService.Show(
Owner,
Dynamo.Wpf.Properties.Resources.DiscardChangesWarningPopupMessage,
Dynamo.Wpf.Properties.Resources.DiscardChangesWarningPopupCaption,
Wpf.Properties.Resources.ResetChangesWarningPopupMessage,
Wpf.Properties.Resources.DiscardChangesWarningPopupCaption,
MessageBoxButton.OKCancel,
MessageBoxImage.Warning);

Expand Down

0 comments on commit 2aa9ecf

Please sign in to comment.