Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into definedata-wrapup
Browse files Browse the repository at this point in the history
  • Loading branch information
twastvedt committed May 20, 2024
2 parents e2d3c40 + fa05e22 commit 63ae096
Show file tree
Hide file tree
Showing 24 changed files with 491 additions and 68 deletions.
7 changes: 6 additions & 1 deletion src/DynamoCore/Configuration/PreferenceSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,10 @@ public bool IsBackgroundPreviewActive
/// </summary>
public bool UseHardwareAcceleration { get; set; }

/// <summary>
/// Persistence for Dynamo HomePage
/// </summary>
public List<string> HomePageSettings { get; set; }
#endregion

#region Dynamo application settings
Expand Down Expand Up @@ -982,6 +986,7 @@ public PreferenceSettings()
backupLocation = string.Empty;
GraphChecksumItemsList = new List<GraphChecksumItem>();
isMLAutocompleteTOUApproved = true;
HomePageSettings = new List<string>();
}

/// <summary>
Expand Down Expand Up @@ -1099,7 +1104,7 @@ public static PreferenceSettings LoadContent(string content)
return new PreferenceSettings() { isCreatedFromValidFile = false };
}
}

settings.CustomPackageFolders = settings.CustomPackageFolders.Distinct().ToList();
settings.GroupStyleItemsList = settings.GroupStyleItemsList.GroupBy(entry => entry.Name).Select(result => result.First()).ToList();
MigrateStdLibTokenToBuiltInToken(settings);
Expand Down
4 changes: 3 additions & 1 deletion src/DynamoCore/Extensions/ExtensionLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ public IExtension Load(string extensionPath)
{
if (item.Name == "AssemblyPath")
{
path = Path.Combine(path, item.InnerText);
// Usually the extension configs are written on a Windows system, so we only need to make them compatible with linux
string assemblyRelativePath = OSHelper.IsWindows() ? item.InnerText : item.InnerText.Replace('\\', Path.DirectorySeparatorChar);
path = Path.Combine(path, assemblyRelativePath);
definition.AssemblyPath = path;
}
else if (item.Name == "TypeName")
Expand Down
11 changes: 9 additions & 2 deletions src/DynamoCore/Models/DynamoModelCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,15 @@ private void SelectModelImpl(SelectModelCommand command)

private void AddSelectionAndRecordUndo(ModelBase model)
{
WorkspaceModel.RecordModelsForModification(new List<ModelBase>() { model }, CurrentWorkspace.UndoRecorder);
DynamoSelection.Instance.Selection.AddUnique(model);
try
{
WorkspaceModel.RecordModelsForModification(new List<ModelBase>() { model }, CurrentWorkspace.UndoRecorder);
DynamoSelection.Instance.Selection.AddUnique(model);
}
catch (Exception ex)
{
Logger.LogError("Failed to add model(s) to selection." + "\n" + ex.Message);
}
}

private void ClearSelectionAndRecordUndo()
Expand Down
6 changes: 4 additions & 2 deletions src/DynamoCore/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
abstract Dynamo.Extensions.LinterExtensionBase.Name.get -> string
abstract Dynamo.Extensions.LinterExtensionBase.Name.get -> string
abstract Dynamo.Extensions.LinterExtensionBase.Shutdown() -> void
abstract Dynamo.Extensions.LinterExtensionBase.UniqueId.get -> string
abstract Dynamo.Graph.ModelBase.DeserializeCore(System.Xml.XmlElement nodeElement, Dynamo.Graph.SaveContext context) -> void
Expand Down Expand Up @@ -171,6 +171,8 @@ Dynamo.Configuration.PreferenceSettings.HideAutocompleteMethodOptions.get -> boo
Dynamo.Configuration.PreferenceSettings.HideAutocompleteMethodOptions.set -> void
Dynamo.Configuration.PreferenceSettings.HideNodesBelowSpecificConfidenceLevel.get -> bool
Dynamo.Configuration.PreferenceSettings.HideNodesBelowSpecificConfidenceLevel.set -> void
Dynamo.Configuration.PreferenceSettings.HomePageSettings.get -> System.Collections.Generic.List<string>
Dynamo.Configuration.PreferenceSettings.HomePageSettings.set -> void
Dynamo.Configuration.PreferenceSettings.IronPythonResolveTargetVersion.get -> string
Dynamo.Configuration.PreferenceSettings.IronPythonResolveTargetVersion.set -> void
Dynamo.Configuration.PreferenceSettings.IsADPAnalyticsReportingApproved.get -> bool
Expand Down Expand Up @@ -3133,4 +3135,4 @@ virtual Dynamo.Search.SearchElements.NodeSearchElement.FullName.get -> string
virtual Dynamo.Search.SearchElements.NodeSearchElement.GenerateInputParameters() -> System.Collections.Generic.IEnumerable<System.Tuple<string, string>>
virtual Dynamo.Search.SearchElements.NodeSearchElement.GenerateOutputParameters() -> System.Collections.Generic.IEnumerable<string>
virtual Dynamo.Search.SearchElements.NodeSearchElement.OnItemProduced(Dynamo.Graph.Nodes.NodeModel obj) -> void
virtual Dynamo.Search.SearchElements.SearchElementBase.CreationName.get -> string
virtual Dynamo.Search.SearchElements.SearchElementBase.CreationName.get -> string
27 changes: 27 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.

13 changes: 11 additions & 2 deletions src/DynamoCoreWpf/Properties/Resources.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ Don't worry, you'll have the option to save your work.</value>
<value>_Select All</value>
<comment>Edit menu | Select all nodes</comment>
</data>
<data name="DynamoViewEditMenuUnpinAllPreviewBubbles" xml:space="preserve">
<data name="DynamoViewEditMenuUnpinAllPreviewBubbles" xml:space="preserve">
<value>_Unpin All Preview Bubbles</value>
<comment>Edit menu | Unpin preview bubbles</comment>
</data>
Expand Down Expand Up @@ -3983,4 +3983,13 @@ To make this file into a new template, save it to a different folder, then move
<data name="MessagePackOlderDynamoLink" xml:space="preserve">
<value>#Learn more=https://primer2.dynamobim.org/1_developer_primer_intro/3_developing_for_dynamo/updating-your-packages-and-dynamo-libraries-for-dynamo-3x-net8</value>
</data>
</root>
<data name="DuplicateFilesInPublishWarningMessage" xml:space="preserve">
<value>Files with same name will be overwritten in the final package. To avoid this, rename or discard the duplicate files, or enable the Retain Folder Structure option.\n\n{0} duplicate file(s) found:\n{1}</value>
</data>
<data name="DuplicateFilesInPublishWarningTitle" xml:space="preserve">
<value>Duplicate Files</value>
</data>
<data name="NodeInCanvasSearchCreationError" xml:space="preserve">
<value>Failed to create node: </value>
</data>
</root>
13 changes: 11 additions & 2 deletions src/DynamoCoreWpf/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@
<value>_Select All</value>
<comment>Edit menu | Select all nodes</comment>
</data>
<data name="DynamoViewEditMenuUnpinAllPreviewBubbles" xml:space="preserve">
<data name="DynamoViewEditMenuUnpinAllPreviewBubbles" xml:space="preserve">
<value>_Unpin All Preview Bubbles</value>
<comment>Edit menu | Unpin preview bubbles</comment>
</data>
Expand Down Expand Up @@ -3970,4 +3970,13 @@ To make this file into a new template, save it to a different folder, then move
<data name="MessagePackOlderDynamoLink" xml:space="preserve">
<value>#Learn more=https://primer2.dynamobim.org/1_developer_primer_intro/3_developing_for_dynamo/updating-your-packages-and-dynamo-libraries-for-dynamo-3x-net8</value>
</data>
</root>
<data name="DuplicateFilesInPublishWarningMessage" xml:space="preserve">
<value>Files with same name will be overwritten in the final package. To avoid this, rename or discard the duplicate files, or enable the Retain Folder Structure option.\n\n{0} duplicate file(s) found:\n{1}</value>
</data>
<data name="DuplicateFilesInPublishWarningTitle" xml:space="preserve">
<value>Duplicate Files</value>
</data>
<data name="NodeInCanvasSearchCreationError" xml:space="preserve">
<value>Failed to create node: </value>
</data>
</root>
10 changes: 9 additions & 1 deletion src/DynamoCoreWpf/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1514,6 +1514,8 @@ Dynamo.UI.IViewModelView<T>.ViewModel.get -> T
Dynamo.UI.Prompts.DynamoMessageBox
Dynamo.UI.Prompts.DynamoMessageBox.BodyText.get -> string
Dynamo.UI.Prompts.DynamoMessageBox.BodyText.set -> void
Dynamo.UI.Prompts.DynamoMessageBox.DialogFlags
Dynamo.UI.Prompts.DynamoMessageBox.DialogFlags.Scrollable = 0 -> Dynamo.UI.Prompts.DynamoMessageBox.DialogFlags
Dynamo.UI.Prompts.DynamoMessageBox.DialogResult.get -> bool?
Dynamo.UI.Prompts.DynamoMessageBox.DialogResult.set -> void
Dynamo.UI.Prompts.DynamoMessageBox.DynamoMessageBox() -> void
Expand Down Expand Up @@ -1576,7 +1578,8 @@ Dynamo.UI.Views.ScriptHomeObject.NewCustomNodeWorkspace() -> void
Dynamo.UI.Views.ScriptHomeObject.NewWorkspace() -> void
Dynamo.UI.Views.ScriptHomeObject.OpenFile(string path) -> void
Dynamo.UI.Views.ScriptHomeObject.OpenWorkspace() -> void
Dynamo.UI.Views.ScriptHomeObject.ScriptHomeObject(System.Action<string> requestOpenFile, System.Action requestNewWorkspace, System.Action requestOpenWorkspace, System.Action requestNewCustomNodeWorkspace, System.Action requestApplicationLoaded, System.Action<string> requestShowGuidedTour, System.Action requestShowSampleFilesInFolder, System.Action requestShowBackupFilesInFolder, System.Action requestShowTemplate) -> void
Dynamo.UI.Views.ScriptHomeObject.SaveSettings(string settings) -> void
Dynamo.UI.Views.ScriptHomeObject.ScriptHomeObject(System.Action<string> requestOpenFile, System.Action requestNewWorkspace, System.Action requestOpenWorkspace, System.Action requestNewCustomNodeWorkspace, System.Action requestApplicationLoaded, System.Action<string> requestShowGuidedTour, System.Action requestShowSampleFilesInFolder, System.Action requestShowBackupFilesInFolder, System.Action requestShowTemplate, System.Action<string> requestSaveSettings) -> void
Dynamo.UI.Views.ScriptHomeObject.ShowBackupFilesInFolder() -> void
Dynamo.UI.Views.ScriptHomeObject.ShowSampleFilesInFolder() -> void
Dynamo.UI.Views.ScriptHomeObject.ShowTempalte() -> void
Expand Down Expand Up @@ -4287,6 +4290,7 @@ static Dynamo.UI.Prompts.DynamoMessageBox.Show(string messageBoxText, string cap
static Dynamo.UI.Prompts.DynamoMessageBox.Show(string messageBoxText, string caption, System.Windows.MessageBoxButton button) -> System.Windows.MessageBoxResult
static Dynamo.UI.Prompts.DynamoMessageBox.Show(string messageBoxText, string caption, System.Windows.MessageBoxButton button, System.Windows.MessageBoxImage icon, string tooltip = "") -> System.Windows.MessageBoxResult
static Dynamo.UI.Prompts.DynamoMessageBox.Show(System.Windows.Window owner, string messageBoxText, string caption, bool showRichTextBox, System.Windows.MessageBoxButton button, System.Windows.MessageBoxImage icon) -> System.Windows.MessageBoxResult
static Dynamo.UI.Prompts.DynamoMessageBox.Show(System.Windows.Window owner, string messageBoxText, string caption, System.Collections.Generic.Dictionary<Dynamo.UI.Prompts.DynamoMessageBox.DialogFlags, bool> flags, System.Windows.MessageBoxButton button, System.Windows.MessageBoxImage icon) -> System.Windows.MessageBoxResult
static Dynamo.UI.Prompts.DynamoMessageBox.Show(System.Windows.Window owner, string messageBoxText, string caption, System.Windows.MessageBoxButton button, System.Windows.MessageBoxImage icon) -> System.Windows.MessageBoxResult
static Dynamo.UI.SharedDictionaryManager.ConnectorsDictionary.get -> System.Windows.ResourceDictionary
static Dynamo.UI.SharedDictionaryManager.ConnectorsDictionaryUri.get -> System.Uri
Expand Down Expand Up @@ -4472,6 +4476,8 @@ static Dynamo.Wpf.Properties.Resources.DisablePackageInstallIconTooltip.get -> s
static Dynamo.Wpf.Properties.Resources.DiscardChangesWarningPopupCaption.get -> string
static Dynamo.Wpf.Properties.Resources.DiscardChangesWarningPopupMessage.get -> string
static Dynamo.Wpf.Properties.Resources.DownloadWarningMessageBoxTitle.get -> string
static Dynamo.Wpf.Properties.Resources.DuplicateFilesInPublishWarningMessage.get -> string
static Dynamo.Wpf.Properties.Resources.DuplicateFilesInPublishWarningTitle.get -> string
static Dynamo.Wpf.Properties.Resources.DynamoShowFileTrustWarning.get -> string
static Dynamo.Wpf.Properties.Resources.DynamoUpdateAvailableToolTip.get -> string
static Dynamo.Wpf.Properties.Resources.DynamoViewCancelButtonTooltip.get -> string
Expand Down Expand Up @@ -4877,6 +4883,7 @@ static Dynamo.Wpf.Properties.Resources.NodeHelpWindowNodeDescription.get -> stri
static Dynamo.Wpf.Properties.Resources.NodeHelpWindowNodeInput.get -> string
static Dynamo.Wpf.Properties.Resources.NodeHelpWindowNodeOutput.get -> string
static Dynamo.Wpf.Properties.Resources.NodeHelpWindowNodeType.get -> string
static Dynamo.Wpf.Properties.Resources.NodeInCanvasSearchCreationError.get -> string
static Dynamo.Wpf.Properties.Resources.NodeInfoDismissButtonToolTip.get -> string
static Dynamo.Wpf.Properties.Resources.NodeInformationalStateDismiss.get -> string
static Dynamo.Wpf.Properties.Resources.NodeInformationalStateDismissAll.get -> string
Expand Down Expand Up @@ -5500,6 +5507,7 @@ static Dynamo.Wpf.Utilities.MessageBoxService.Show(string msg, string title, boo
static Dynamo.Wpf.Utilities.MessageBoxService.Show(string msg, string title, System.Windows.MessageBoxButton button, System.Collections.Generic.IEnumerable<string> buttonNames, System.Windows.MessageBoxImage img) -> System.Windows.MessageBoxResult
static Dynamo.Wpf.Utilities.MessageBoxService.Show(string msg, string title, System.Windows.MessageBoxButton button, System.Windows.MessageBoxImage img) -> System.Windows.MessageBoxResult
static Dynamo.Wpf.Utilities.MessageBoxService.Show(System.Windows.Window owner, string msg, string title, bool showRichTextBox, System.Windows.MessageBoxButton button, System.Windows.MessageBoxImage img) -> System.Windows.MessageBoxResult
static Dynamo.Wpf.Utilities.MessageBoxService.Show(System.Windows.Window owner, string msg, string title, System.Collections.Generic.Dictionary<Dynamo.UI.Prompts.DynamoMessageBox.DialogFlags, bool> flags, System.Windows.MessageBoxButton button, System.Windows.MessageBoxImage img) -> System.Windows.MessageBoxResult
static Dynamo.Wpf.Utilities.MessageBoxService.Show(System.Windows.Window owner, string msg, string title, System.Windows.MessageBoxButton button, System.Collections.Generic.IEnumerable<string> buttonNames, System.Windows.MessageBoxImage img) -> System.Windows.MessageBoxResult
static Dynamo.Wpf.Utilities.MessageBoxService.Show(System.Windows.Window owner, string msg, string title, System.Windows.MessageBoxButton button, System.Windows.MessageBoxImage img) -> System.Windows.MessageBoxResult
static Dynamo.Wpf.Utilities.WebView2Utilities.ValidateWebView2RuntimeInstalled() -> bool
Expand Down
16 changes: 14 additions & 2 deletions src/DynamoCoreWpf/UI/Prompts/DynamoMessageBox.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,27 @@

<!-- Body Text -->
<TextBlock Name="BodyTextBlock"
Grid.Row="1"
Margin="20"
Margin="20"
VerticalAlignment="Center"
DockPanel.Dock="Left"
FontFamily="{StaticResource ArtifaktElementRegular}"
FontSize="14px"
Foreground="#3C3C3C"
Text="{Binding BodyText, UpdateSourceTrigger=PropertyChanged}"
TextWrapping="Wrap" />
<!-- Body text in scrollable text box -->
<ScrollViewer Name="ScrollableBodyTextBlock" VerticalScrollBarVisibility="Auto"
Margin="20" MaxHeight="250" Grid.Row="1" Visibility="Collapsed">
<TextBlock
VerticalAlignment="Center"
DockPanel.Dock="Left"
FontFamily="{StaticResource ArtifaktElementRegular}"
FontSize="14px"
Foreground="#3C3C3C"
Text="{Binding BodyText, UpdateSourceTrigger=PropertyChanged}"
TextWrapping="Wrap" />
</ScrollViewer>
<!-- Body text in custom rich text box, mostly used in guided tours -->
<localui:CustomRichTextBox x:Name="ContentRichTextBox"
IsDocumentEnabled="True"
Visibility="Collapsed"
Expand Down
45 changes: 45 additions & 0 deletions src/DynamoCoreWpf/UI/Prompts/DynamoMessageBox.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,15 @@ public MessageBoxImage MessageBoxImage
/// </summary>
public string Tooltip { get; private set; }

/// <summary>
/// A list of customization options for dialog box
/// </summary>
public enum DialogFlags
{
//Enables scrollable text in the message box
Scrollable = 0,
}

#endregion

/// <summary>
Expand Down Expand Up @@ -204,6 +213,7 @@ public static MessageBoxResult Show(Window owner, string messageBoxText, string
dynamoMessageBox.ShowDialog();
return dynamoMessageBox.CustomDialogResult;
}

/// <summary>
/// Displays a dialog to the user and returns their choice as a MessageBoxResult.
/// </summary>
Expand Down Expand Up @@ -234,6 +244,41 @@ public static MessageBoxResult Show(Window owner,string messageBoxText, string c
return dynamoMessageBox.CustomDialogResult;
}

/// <summary>
/// Displays a dialog to the user and returns their choice as a MessageBoxResult.
/// </summary>
/// <param name="owner">owning window of the messagebox</param>
/// <param name="messageBoxText">Content of the message</param>
/// <param name="caption">MessageBox title</param>
/// <param name="flags">Provide a list of flags that can be used to customize the dialog box, e.g Scrollable</param>
/// <param name="button">Type of button shown in the MessageBox: Ok, OkCancel; etc</param>
/// <param name="icon">Type of message: Warning, Error</param>
/// <returns></returns>
public static MessageBoxResult Show(Window owner, string messageBoxText, string caption, Dictionary<DialogFlags, bool> flags, MessageBoxButton button,
MessageBoxImage icon)
{
var dynamoMessageBox = new DynamoMessageBox
{
BodyText = messageBoxText,
TitleText = caption,
MessageBoxButton = button,
MessageBoxImage = icon
};
if (owner != null && owner.IsLoaded)
{
dynamoMessageBox.Owner = owner;
}

if (flags.TryGetValue(DialogFlags.Scrollable, out bool scrollable) && scrollable)
{
dynamoMessageBox.BodyTextBlock.Visibility = Visibility.Collapsed;
dynamoMessageBox.ScrollableBodyTextBlock.Visibility = Visibility.Visible;
}
dynamoMessageBox.ConfigureButtons(button);
dynamoMessageBox.ShowDialog();
return dynamoMessageBox.CustomDialogResult;
}

/// <summary>
/// Displays a dialog to the user and returns their choice as a MessageBoxResult.
/// </summary>
Expand Down
Loading

0 comments on commit 63ae096

Please sign in to comment.