From ce7388971cade380c57c6c228540580ffb7fe08f Mon Sep 17 00:00:00 2001 From: Deyan Nenov Date: Tue, 31 Jan 2023 18:06:53 +0000 Subject: [PATCH] Insert Changes (#13705) - added Insert dialog box title to resources, changed the text - added insert run mode change notification to resources - change the Toast type (now disappears on the next mouseclick) - change the order in which Insert is done and the mode is changed, i.e. mode would change only if a graph has been inserted --- .../Properties/Resources.Designer.cs | 18 ++++++++++++++++++ src/DynamoCore/Properties/Resources.en-US.resx | 8 +++++++- src/DynamoCore/Properties/Resources.resx | 8 +++++++- .../ViewModels/Core/DynamoViewModel.cs | 16 ++++++++-------- 4 files changed, 40 insertions(+), 10 deletions(-) diff --git a/src/DynamoCore/Properties/Resources.Designer.cs b/src/DynamoCore/Properties/Resources.Designer.cs index 2ecc76a36aa..32bd5599f6b 100644 --- a/src/DynamoCore/Properties/Resources.Designer.cs +++ b/src/DynamoCore/Properties/Resources.Designer.cs @@ -983,6 +983,24 @@ public static string InputPortAlternativeName { } } + /// + /// Looks up a localized string similar to Insert Dynamo Definition.... + /// + public static string InsertDialogBoxText { + get { + return ResourceManager.GetString("InsertDialogBoxText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Example file added to workspace. Run mode changed to Manual.. + /// + public static string InsertGraphRunModeNotificationText { + get { + return ResourceManager.GetString("InsertGraphRunModeNotificationText", resourceCulture); + } + } + /// /// Looks up a localized string similar to The folder '{0}' does not exist. /// diff --git a/src/DynamoCore/Properties/Resources.en-US.resx b/src/DynamoCore/Properties/Resources.en-US.resx index 8629f90bf6e..169fbb1c124 100644 --- a/src/DynamoCore/Properties/Resources.en-US.resx +++ b/src/DynamoCore/Properties/Resources.en-US.resx @@ -893,4 +893,10 @@ This package likely contains an assembly that is blocked. You will need to load Failed to insert the file as some of the nodes already exist in the current worspace. - + + Insert Dynamo Definition... + + + Example file added to workspace. Run mode changed to Manual. + + \ No newline at end of file diff --git a/src/DynamoCore/Properties/Resources.resx b/src/DynamoCore/Properties/Resources.resx index 95551a65cbd..6cf05711a03 100644 --- a/src/DynamoCore/Properties/Resources.resx +++ b/src/DynamoCore/Properties/Resources.resx @@ -896,4 +896,10 @@ This package likely contains an assembly that is blocked. You will need to load Failed to insert the file as some of the nodes already exist in the current worspace. - + + Insert Dynamo Definition... + + + Example file added to workspace. Run mode changed to Manual. + + \ No newline at end of file diff --git a/src/DynamoCoreWpf/ViewModels/Core/DynamoViewModel.cs b/src/DynamoCoreWpf/ViewModels/Core/DynamoViewModel.cs index a477ed8437f..98cf70ea584 100644 --- a/src/DynamoCoreWpf/ViewModels/Core/DynamoViewModel.cs +++ b/src/DynamoCoreWpf/ViewModels/Core/DynamoViewModel.cs @@ -1819,7 +1819,7 @@ private void model_ComputeModelDeserialized() /// private void model_RequestNotification(string notification) { - this.MainGuideManager.CreateRealTimeInfoWindow(notification, true); + this.MainGuideManager.CreateRealTimeInfoWindow(notification); } /// @@ -1893,7 +1893,7 @@ private void ShowInsertDialogAndInsertResult(object parameter) Filter = string.Format(Resources.FileDialogDynamoDefinitions, BrandingResourceProvider.ProductName, fileExtensions) + "|" + string.Format(Resources.FileDialogAllFiles, "*.*"), - Title = string.Format("Insert Title (Replace)", BrandingResourceProvider.ProductName) + Title = string.Format(Properties.Resources.InsertDialogBoxText, BrandingResourceProvider.ProductName) }; // if you've got the current space path, use it as the inital dir @@ -1921,17 +1921,17 @@ private void ShowInsertDialogAndInsertResult(object parameter) _fileDialog.InitialDirectory = path; } - if (HomeSpace.RunSettings.RunType != RunType.Manual) - { - MainGuideManager.CreateRealTimeInfoWindow("Example file added to workspace. Run mode changed to Manual.", true); - HomeSpace.RunSettings.RunType = RunType.Manual; - } - if (_fileDialog.ShowDialog() == DialogResult.OK) { if (CanOpen(_fileDialog.FileName)) { Insert(new Tuple(_fileDialog.FileName, _fileDialog.RunManualMode)); + + if (HomeSpace.RunSettings.RunType != RunType.Manual) + { + MainGuideManager.CreateRealTimeInfoWindow(Properties.Resources.InsertGraphRunModeNotificationText); + HomeSpace.RunSettings.RunType = RunType.Manual; + } } } }