Skip to content

Commit

Permalink
Add Dynamo Preference Non-UI Flag for legacy behavior (#14575)
Browse files Browse the repository at this point in the history
* Add flag

* Update comment

* UpdateTests

---------

Co-authored-by: Craig Long <[email protected]>
Co-authored-by: Michael Kirschner <[email protected]>
  • Loading branch information
3 people authored Nov 13, 2023
1 parent 4971e9d commit 40e4357
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/DynamoCore/Configuration/PreferenceSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,12 @@ public string IronPythonResolveTargetVersion

#region Dynamo Player and Generative Design settings

/// <summary>
/// Enable legacy behavior for Dynamo Player to allow renamed Watch nodes to be seen as graph output.
/// This flag is for use in the 2024 product release year and can removed for 2025
/// </summary>
public bool EnableDynamoPlayerRenamedWatchAsOutput { get; set; }

/// <summary>
/// Collections of folders used by individual Dynamo Player or Generative Design as entry points.
/// </summary>
Expand Down Expand Up @@ -906,6 +912,7 @@ public PreferenceSettings()
ViewExtensionSettings = new List<ViewExtensionSettings>();
GroupStyleItemsList = new List<GroupStyleItem>();
ReadNotificationIds = new List<string>();
EnableDynamoPlayerRenamedWatchAsOutput = false;
DynamoPlayerFolderGroups = new List<DynamoPlayerFolderGroup>();
backupLocation = string.Empty;
}
Expand Down
4 changes: 4 additions & 0 deletions test/DynamoCoreTests/Configuration/PreferenceSettingsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public void TestSettingsSerialization()
Assert.AreEqual(settings.ViewExtensionSettings.Count, 0);
Assert.AreEqual(settings.DefaultRunType, RunType.Automatic);
Assert.AreEqual(settings.DynamoPlayerFolderGroups.Count, 0);
Assert.AreEqual(settings.EnableDynamoPlayerRenamedWatchAsOutput, false);
Assert.AreEqual(settings.Locale, "Default");

// Save
Expand All @@ -89,6 +90,7 @@ public void TestSettingsSerialization()
Assert.AreEqual(settings.ViewExtensionSettings.Count, 0);
Assert.AreEqual(settings.DefaultRunType, RunType.Automatic);
Assert.AreEqual(settings.DynamoPlayerFolderGroups.Count, 0);
Assert.AreEqual(settings.EnableDynamoPlayerRenamedWatchAsOutput, false);
Assert.AreEqual(settings.Locale, "Default");

// Change setting values
Expand Down Expand Up @@ -136,6 +138,7 @@ public void TestSettingsSerialization()
}
}
});
settings.EnableDynamoPlayerRenamedWatchAsOutput = true;
settings.Locale = "zh-CN";


Expand Down Expand Up @@ -173,6 +176,7 @@ public void TestSettingsSerialization()
Assert.AreEqual(styleItemsList.HexColorString, "000000");
Assert.AreEqual(settings.DynamoPlayerFolderGroups.Count, 1);
Assert.AreEqual(settings.DynamoPlayerFolderGroups[0].Folders.Count, 1);
Assert.AreEqual(settings.EnableDynamoPlayerRenamedWatchAsOutput, true);
Assert.AreEqual(settings.Locale, "zh-CN");
}

Expand Down
1 change: 1 addition & 0 deletions test/settings/DynamoSettings-NewSettings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
<ReadNotificationIds>
<string>1</string>
</ReadNotificationIds>
<EnableDynamoPlayerRenamedWatchAsOutput>true</EnableDynamoPlayerRenamedWatchAsOutput>
<DynamoPlayerFolderGroups>
<DynamoPlayerFolderGroup/>
</DynamoPlayerFolderGroups>
Expand Down

0 comments on commit 40e4357

Please sign in to comment.