Skip to content

Commit

Permalink
Insert Changes (#13705)
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
dnenov authored Jan 31, 2023
1 parent 49847b7 commit ce73889
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 10 deletions.
18 changes: 18 additions & 0 deletions src/DynamoCore/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion src/DynamoCore/Properties/Resources.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -893,4 +893,10 @@ This package likely contains an assembly that is blocked. You will need to load
<data name="FailedInsertFileNodeExistNotification" xml:space="preserve">
<value>Failed to insert the file as some of the nodes already exist in the current worspace.</value>
</data>
</root>
<data name="InsertDialogBoxText" xml:space="preserve">
<value>Insert Dynamo Definition...</value>
</data>
<data name="InsertGraphRunModeNotificationText" xml:space="preserve">
<value>Example file added to workspace. Run mode changed to Manual.</value>
</data>
</root>
8 changes: 7 additions & 1 deletion src/DynamoCore/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -896,4 +896,10 @@ This package likely contains an assembly that is blocked. You will need to load
<data name="FailedInsertFileNodeExistNotification" xml:space="preserve">
<value>Failed to insert the file as some of the nodes already exist in the current worspace.</value>
</data>
</root>
<data name="InsertDialogBoxText" xml:space="preserve">
<value>Insert Dynamo Definition...</value>
</data>
<data name="InsertGraphRunModeNotificationText" xml:space="preserve">
<value>Example file added to workspace. Run mode changed to Manual.</value>
</data>
</root>
16 changes: 8 additions & 8 deletions src/DynamoCoreWpf/ViewModels/Core/DynamoViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1819,7 +1819,7 @@ private void model_ComputeModelDeserialized()
/// <param name="notification"></param>
private void model_RequestNotification(string notification)
{
this.MainGuideManager.CreateRealTimeInfoWindow(notification, true);
this.MainGuideManager.CreateRealTimeInfoWindow(notification);
}

/// <summary>
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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<string, bool>(_fileDialog.FileName, _fileDialog.RunManualMode));

if (HomeSpace.RunSettings.RunType != RunType.Manual)
{
MainGuideManager.CreateRealTimeInfoWindow(Properties.Resources.InsertGraphRunModeNotificationText);
HomeSpace.RunSettings.RunType = RunType.Manual;
}
}
}
}
Expand Down

0 comments on commit ce73889

Please sign in to comment.