Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DYN-6130 remove the toast notification #14317

Merged
merged 7 commits into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 19 additions & 11 deletions src/DynamoCoreWpf/UI/GuidedTour/GuidesManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ internal void Initialize()
guideBackgroundElement.ClearCutOffSection();
guideBackgroundElement.ClearHighlightSection();
stopwatch = Stopwatch.StartNew();
}
}

/// <summary>
/// Creates the background for the GuidedTour
Expand Down Expand Up @@ -244,10 +244,10 @@ internal void ExitTour()
{
Logging.Analytics.TrackEvent(Logging.Actions.Completed, Logging.Categories.GuidedTourOperations, guidName, currentGuide.CurrentStep.Sequence);
}
else
else
{
Logging.Analytics.TrackEvent(Logging.Actions.End, Logging.Categories.GuidedTourOperations, guidName, currentGuide.CurrentStep.Sequence);
}
}
Logging.Analytics.TrackTimedEvent(Logging.Categories.GuidedTourOperations, Logging.Actions.TimeElapsed.ToString(), stopwatch.Elapsed, guidName);

currentGuide.ClearGuide();
Expand Down Expand Up @@ -338,7 +338,7 @@ private void CreateGuideSteps(string jsonFile)
totalTooltips = (from step in guide.GuideSteps
where step.StepType == Step.StepTypes.TOOLTIP ||
step.StepType == Step.StepTypes.SURVEY
select step).GroupBy(x=>x.Sequence).Count();
select step).GroupBy(x => x.Sequence).Count();

foreach (Step step in guide.GuideSteps)
{
Expand Down Expand Up @@ -464,7 +464,7 @@ private Step CreateStep(Step jsonStepInfo, HostControlInfo hostControlInfo, int
}
};
var popupWindow = newStep.stepUIPopup as PopupWindow;
if(popupWindow != null && hostControlInfo.HtmlPage != null && !string.IsNullOrEmpty(hostControlInfo.HtmlPage.FileName))
if (popupWindow != null && hostControlInfo.HtmlPage != null && !string.IsNullOrEmpty(hostControlInfo.HtmlPage.FileName))
{
popupWindow.WebBrowserUserDataFolder = userDataFolder != null ? userDataFolder.FullName : string.Empty;
}
Expand Down Expand Up @@ -525,11 +525,11 @@ internal Guide GetNextGuide()


private void Popup_StepClosed(string name, Step.StepTypes stepType)
{
{
GuideFlowEvents.OnGuidedTourFinish(currentGuide.Name);

//The exit tour popup will be shown only when a popup (doesn't apply for survey) is closed or when the tour is closed.
if(stepType != Step.StepTypes.SURVEY)
if (stepType != Step.StepTypes.SURVEY)
CreateRealTimeInfoWindow(Res.ExitTourWindowContent);
}

Expand All @@ -546,10 +546,7 @@ internal void CreateRealTimeInfoWindow(string content, bool stayOpen = false)
UIElement hostUIElement = GuideUtilities.FindChild(mainRootElement, "statusBarPanel");

// When popup already exist, replace it
if ( exitTourPopup != null && exitTourPopup.IsOpen)
{
exitTourPopup.IsOpen = false;
}
CloseRealTimeInfoWindow();
// Otherwise creates the RealTimeInfoWindow popup and set up all the needed values
// to show the popup over the Dynamo workspace
exitTourPopup = new RealTimeInfoWindow()
Expand All @@ -565,5 +562,16 @@ internal void CreateRealTimeInfoWindow(string content, bool stayOpen = false)
exitTourPopup.PlacementTarget = hostUIElement;
exitTourPopup.IsOpen = true;
}

/// <summary>
/// Closes the exitTourPopup if exist and it's open
/// </summary>
internal void CloseRealTimeInfoWindow()
{
if (exitTourPopup != null && exitTourPopup.IsOpen)
{
exitTourPopup.IsOpen = false;
}
}
}
}
1 change: 1 addition & 0 deletions src/DynamoCoreWpf/ViewModels/Core/DynamoViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3419,6 +3419,7 @@ public bool PerformShutdownSequence(ShutdownParams shutdownParams)
WatchHandler.RequestSelectGeometry -= BackgroundPreviewViewModel.AddLabelForPath;
model.ComputeModelDeserialized -= model_ComputeModelDeserialized;
model.RequestNotification -= model_RequestNotification;
MainGuideManager?.CloseRealTimeInfoWindow();
Copy link
Contributor

@QilongTang QilongTang Aug 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jesusalvino Can you move this line to below BackgroundPreviewViewModel.Dispose();? The section below is for DynamoModel shutdown, maybe we are missing a comment there. Can you add that as well?


return true;
}
Expand Down