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-7475: Cherry picks for 2.16.4 #15499

Merged
merged 14 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DYNAMO v.2.16.3 © 2022 Autodesk, Inc. All rights reserved.
DYNAMO v.2.16.4 © 2022 Autodesk, Inc. All rights reserved.
Dynamo License

Those portions created by Ian are provided with the following copyright:
Expand Down
1,302 changes: 645 additions & 657 deletions doc/distrib/License.rtf

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/AssemblySharedInfoGenerator/AssemblySharedInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
// to distinguish one build from another. AssemblyFileVersion is specified
// in AssemblyVersionInfo.cs so that it can be easily incremented by the
// automated build process.
[assembly: AssemblyVersion("2.16.3.8080")]
[assembly: AssemblyVersion("2.16.4.10050")]


// By default, the "Product version" shown in the file properties window is
Expand All @@ -64,4 +64,4 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("2.16.3.8080")]
[assembly: AssemblyFileVersion("2.16.4.10050")]
2 changes: 1 addition & 1 deletion src/AssemblySharedInfoGenerator/AssemblySharedInfo.tt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ using System.Runtime.InteropServices;
<#+
int MajorVersion = 2;
int MinorVersion = 16;
int BuildNumber = 3;
int BuildNumber = 4;
// The datetime baseline we choose using this algorithm will affect build number and all nuget packages uploaded
// Please only change when major or minor version got incremented
int RevisionNumber = ((int)(DateTime.UtcNow - new DateTime(2022,1,1)).TotalDays)*10+((int)DateTime.UtcNow.Hour)/3;
Expand Down
2 changes: 1 addition & 1 deletion src/Config/upiconfig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<upi_attribute name='id' value='Win64'/>
<upi_element name='level'>
<upi_attribute name='name' value='build'/>
<upi_attribute name='id' value='2.16.3' />
<upi_attribute name='id' value='2.16.4' />
</upi_element>
</upi_element>
</upi_element>
Expand Down
9 changes: 8 additions & 1 deletion src/DynamoCore/Core/CustomNodeManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,14 @@ internal CustomNodeWorkspaceModel Collapse(
currentWorkspace.RemoveGroup(group);

group.GUID = Guid.NewGuid();
group.Nodes = group.DeletedModelBases;
group.Nodes = group.Nodes.Concat(group.DeletedModelBases);
//for nested groups
//if any of the previously added annotations has a DeletedModelBases with the same group as the current one, then add it to the Nodes
var nestedGroup = newAnnotations.FirstOrDefault(x => x.DeletedModelBases.OfType<AnnotationModel>().Any(y => y.GUID == group.GUID));
if (nestedGroup != null)
{
nestedGroup.Nodes = nestedGroup.Nodes.Append(group);
}
newAnnotations.Add(group);
}

Expand Down
5 changes: 5 additions & 0 deletions src/DynamoCoreWpf/DynamoCoreWpf.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
<EnableDefaultCompileItems>False</EnableDefaultCompileItems>
<EnableDefaultEmbeddedResourceItems>False</EnableDefaultEmbeddedResourceItems>
</PropertyGroup>
<ItemGroup>
<None Remove="UI\Images\TitleBarButtons\close-darktheme-disabled-16px.png" />
</ItemGroup>

<ItemGroup>
<None Remove="UI\Images\AboutWindow\logo_about_dark.png" />
<None Remove="UI\Images\Alignment\align_bottom.png" />
Expand Down Expand Up @@ -818,6 +822,7 @@
<Resource Include="UI\Images\NodeStates\hidden-64px.png" />
<Resource Include="UI\Images\NodeStates\info-64px.png" />
<Resource Include="UI\Images\TitleBarButtons\close-darktheme-default-16px.png" />
<Resource Include="UI\Images\TitleBarButtons\close-darktheme-disabled-16px.png" />
<Resource Include="UI\Images\TitleBarButtons\close-lighttheme-default-16px.png" />
<Resource Include="UI\Images\TitleBarButtons\close-lighttheme-hover-16px.png" />
<Resource Include="UI\Images\TitleBarButtons\max-darktheme-default-16px.png" />
Expand Down
28 changes: 18 additions & 10 deletions src/DynamoCoreWpf/UI/GuidedTour/GuidesManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ internal void Initialize()
guideBackgroundElement.ClearCutOffSection();
guideBackgroundElement.ClearHighlightSection();
stopwatch = Stopwatch.StartNew();
}
}

/// <summary>
/// Creates the background for the GuidedTour
Expand Down Expand Up @@ -239,10 +239,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 @@ -332,7 +332,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 @@ -458,7 +458,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 @@ -523,7 +523,7 @@ 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 @@ -540,10 +540,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 @@ -559,5 +556,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;
}
}
}
}
5 changes: 5 additions & 0 deletions src/DynamoCoreWpf/UI/GuidedTour/GuidesValidationMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,18 @@ internal static void ExecuteClosePackagesSearch(Step stepInfo, StepUIAutomation
{
CloseButtonSearchPackages = GuideUtilities.FindChild(ownedWindow, handler.HandlerElement) as Button;
CloseButtonSearchPackages.Click += CloseButton_Click;
CloseButtonSearchPackages.IsEnabled = false;
}
}
}
else
{
if (CloseButtonSearchPackages != null)
{
CloseButtonSearchPackages.IsEnabled = true;
CloseButtonSearchPackages.Click -= CloseButton_Click;
CloseButtonSearchPackages = null;
}
}
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/DynamoCoreWpf/UI/Themes/Modern/DynamoModern.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2915,6 +2915,9 @@
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="closeIcon" Property="Source" Value="pack://application:,,,/DynamoCoreWpf;component/UI/Images/TitleBarButtons/close-lighttheme-hover-16px.png" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="closeIcon" Property="Source" Value="pack://application:,,,/DynamoCoreWpf;component/UI/Images/TitleBarButtons/close-darktheme-disabled-16px.png" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
Expand Down
48 changes: 26 additions & 22 deletions src/DynamoCoreWpf/ViewModels/Core/AnnotationViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class AnnotationViewModel : ViewModelBase
private AnnotationModel annotationModel;
private IEnumerable<PortModel> originalInPorts;
private IEnumerable<PortModel> originalOutPorts;
private Dictionary<Guid, int> GroupIdToCutGeometryIndex = new Dictionary<Guid, int>();
private Dictionary<Guid, Geometry> GroupIdToCutGeometry = new Dictionary<Guid, Geometry>();
// vertical offset accounts for the port margins
private const int verticalOffset = 20;
private const int portVerticalMidPoint = 17;
Expand Down Expand Up @@ -220,7 +220,7 @@ private set
private ObservableCollection<PortViewModel> outPorts;
/// <summary>
/// Collection of all output ports on this group.
/// All nodes contained in the group which output port
/// All nodes contained in the group which output port
/// is connected to a node outside of this group will have
/// their output ports added to this collection.
/// </summary>
Expand Down Expand Up @@ -249,7 +249,7 @@ public bool IsExpanded
OutPorts.Clear();
if (value)
{
this.ShowGroupContents();
this.ShowGroupContents();
}
else
{
Expand Down Expand Up @@ -916,7 +916,7 @@ private void RedrawConnectors()
.SelectMany(x => x.Nodes.OfType<NodeModel>())
.Concat(this.Nodes.OfType<NodeModel>());

foreach (var connector in allNodes.SelectMany(x=>x.AllConnectors))
foreach (var connector in allNodes.SelectMany(x => x.AllConnectors))
{
var connectorViewModel = WorkspaceViewModel
.Connectors
Expand Down Expand Up @@ -944,7 +944,7 @@ internal void ShowGroupContents()
if (viewModel is AnnotationViewModel annotationViewModel)
{
// Update connectors and ports if the nested group is not collapsed
if(annotationViewModel.Nodes.Any() && !annotationViewModel.IsCollapsed)
if (annotationViewModel.Nodes.Any() && !annotationViewModel.IsCollapsed)
{
UpdateConnectorsAndPortsOnShowContents(annotationViewModel.Nodes);
}
Expand Down Expand Up @@ -1054,7 +1054,7 @@ internal void SelectAll()
this.WorkspaceViewModel.DynamoViewModel.ExecuteCommand(
new DynamoModel.SelectModelCommand(annotationGuid, Keyboard.Modifiers.AsDynamoType()));

//Select all the models inside the group - This avoids some performance bottleneck
//Select all the models inside the group - This avoids some performance bottleneck
//with many nodes selected at the same time - which makes moving the group very slow

var groupedGroupsNodes = this.AnnotationModel.Nodes.OfType<AnnotationModel>().SelectMany(x => x.Nodes);
Expand Down Expand Up @@ -1166,7 +1166,7 @@ private void UpdateAllGroupedGroups()
private void HandleNodesCollectionChanges()
{
var allGroupedGroups = Nodes.OfType<AnnotationModel>();
var removedFromGroup = GroupIdToCutGeometryIndex.Keys
var removedFromGroup = GroupIdToCutGeometry.Keys
.ToList()
.Except(allGroupedGroups.Select(x => x.GUID));

Expand All @@ -1179,7 +1179,7 @@ private void HandleNodesCollectionChanges()

var addedToGroup = allGroupedGroups
.Select(x => x.GUID)
.Except(GroupIdToCutGeometryIndex.Keys.ToList());
.Except(GroupIdToCutGeometry.Keys.ToList());

foreach (var key in addedToGroup)
{
Expand All @@ -1196,14 +1196,14 @@ private void HandleNodesCollectionChanges()

private void RemoveKeyFromCutGeometryDictionary(Guid groupGuid)
{
if (GroupIdToCutGeometryIndex is null ||
!GroupIdToCutGeometryIndex.ContainsKey(groupGuid))
if (GroupIdToCutGeometry is null ||
!GroupIdToCutGeometry.ContainsKey(groupGuid))
{
return;
}

NestedGroupsGeometries.RemoveAt(GroupIdToCutGeometryIndex[groupGuid]);
GroupIdToCutGeometryIndex.Remove(groupGuid);
NestedGroupsGeometries.Remove(GroupIdToCutGeometry[groupGuid]);
GroupIdToCutGeometry.Remove(groupGuid);

var groupViewModel = this.WorkspaceViewModel.Annotations
.Where(x => x.AnnotationModel.GUID == groupGuid)
Expand All @@ -1218,11 +1218,12 @@ private void RemoveKeyFromCutGeometryDictionary(Guid groupGuid)
private void AddToCutGeometryDictionary(AnnotationViewModel annotationViewModel)
{
var key = annotationViewModel.AnnotationModel.GUID;
if (GroupIdToCutGeometryIndex.ContainsKey(key)) return;
if (GroupIdToCutGeometry.ContainsKey(key)) return;

int nextPos = NestedGroupsGeometries.Count;
NestedGroupsGeometries.Insert(nextPos, CreateRectangleGeometry(annotationViewModel));
GroupIdToCutGeometryIndex[key] = nextPos;
var geo = CreateRectangleGeometry(annotationViewModel);
NestedGroupsGeometries.Insert(nextPos, geo);
GroupIdToCutGeometry[key] = geo;

annotationViewModel.PropertyChanged += GroupViewModel_PropertyChanged;
}
Expand Down Expand Up @@ -1256,16 +1257,19 @@ private void GroupViewModel_PropertyChanged(object sender, System.ComponentModel
private void UpdateGroupCutGeometry(AnnotationViewModel annotationViewModel)
{
var key = annotationViewModel.AnnotationModel.GUID;
if (GroupIdToCutGeometryIndex == null ||
!GroupIdToCutGeometryIndex.ContainsKey(key))
if (GroupIdToCutGeometry == null ||
!GroupIdToCutGeometry.ContainsKey(key))
{
return;
}
var index = GroupIdToCutGeometryIndex[key];
if (index >= 0 &&
index < NestedGroupsGeometries.Count)
var geo = GroupIdToCutGeometry[key];
if (geo != null)
{
NestedGroupsGeometries[index] = CreateRectangleGeometry(annotationViewModel);
int index = NestedGroupsGeometries.IndexOf(geo);
if (index >= 0 && index < NestedGroupsGeometries.Count)
{
NestedGroupsGeometries[index] = CreateRectangleGeometry(annotationViewModel);
}
}
}

Expand All @@ -1284,4 +1288,4 @@ public override void Dispose()
base.Dispose();
}
}
}
}
1 change: 1 addition & 0 deletions src/DynamoCoreWpf/ViewModels/Core/DynamoViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3039,6 +3039,7 @@ public bool PerformShutdownSequence(ShutdownParams shutdownParams)


BackgroundPreviewViewModel.Dispose();
MainGuideManager?.CloseRealTimeInfoWindow();

model.ShutDown(shutdownParams.ShutdownHost);
if (shutdownParams.ShutdownHost)
Expand Down
9 changes: 8 additions & 1 deletion src/DynamoCoreWpf/ViewModels/Core/NodeViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,14 @@ private void Logic_NodeMessagesClearing(NodeModel obj)
// 1. Compile-time warnings in CBNs
// 2. Obsolete nodes with warnings
// 3. Dummy or unresolved nodes
if (nodeLogic.State == ElementState.Error || nodeLogic.State == ElementState.PersistentWarning || ErrorBubble == null) return;
if (nodeLogic.State == ElementState.Error || nodeLogic.State == ElementState.PersistentWarning) return;

// For certain nodes without ErrorBubble in place, handle color overlay specifically
if (ErrorBubble == null)
{
HandleColorOverlayChange();
return;
}

if (DynamoViewModel.UIDispatcher != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1338,7 +1338,7 @@ private void RemoveItem(object parameter)
if (!(parameter is PackageItemRootViewModel packageItemRootViewModel)) return;

string fileName = packageItemRootViewModel.FileInfo == null ? packageItemRootViewModel.Name : packageItemRootViewModel.FileInfo.FullName;
string fileType = packageItemRootViewModel.DependencyType.ToString();
DependencyType fileType = packageItemRootViewModel.DependencyType;

if (fileName.ToLower().EndsWith(".dll") || fileType.Equals(DependencyType.Assembly))
{
Expand All @@ -1358,7 +1358,6 @@ private void RemoveItem(object parameter)

RefreshPackageContents();
return;

}

private bool CanShowAddFileDialogAndAdd()
Expand Down
6 changes: 6 additions & 0 deletions src/DynamoCoreWpf/ViewModels/Preview/WatchViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,9 @@ public WatchViewModel(string label, string path, Action<string> tagGeometry, boo

private static string GetStringFromObject(object obj)
{
if (obj == null)
return Resources.NullString;

TypeCode type = Type.GetTypeCode(obj.GetType());
switch (type)
{
Expand Down Expand Up @@ -285,6 +288,9 @@ private static string ObjectToLabelString(object obj)

private string GetDisplayType(object obj)
{
if (obj == null)
return Resources.NullString;

TypeCode typeCode = Type.GetTypeCode(obj.GetType());
// returning a customized user friendly string instead of just returning the name of the type
switch (typeCode)
Expand Down
7 changes: 5 additions & 2 deletions src/DynamoCoreWpf/Views/Core/NoteView.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Linq;
using System.Text.RegularExpressions;
using System.Collections.Generic;
Expand Down Expand Up @@ -57,7 +57,10 @@ void OnNoteViewLoaded(object sender, RoutedEventArgs e)

void OnNoteViewUnloaded(object sender, RoutedEventArgs e)
{
ViewModel.RequestsSelection -= OnViewModelRequestsSelection;
if (ViewModel != null)
{
ViewModel.RequestsSelection -= OnViewModelRequestsSelection;
}
}

void OnViewModelRequestsSelection(object sender, EventArgs e)
Expand Down
Loading
Loading