Skip to content
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
9 changes: 9 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.

3 changes: 3 additions & 0 deletions src/DynamoCoreWpf/Properties/Resources.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1553,6 +1553,9 @@ Next assemblies were loaded several times:
<data name="OpenDynamoDefinitionDialogTitle" xml:space="preserve">
<value>Open {0} Definition...</value>
</data>
<data name="OpenDynamoTemplateDialogTitle" xml:space="preserve">
<value>New Graph from Template...</value>
</data>
<data name="PackageDownloadConfirmMessageBoxTitle" xml:space="preserve">
<value>Package Download Confirmation</value>
<comment>Message box title</comment>
Expand Down
3 changes: 3 additions & 0 deletions src/DynamoCoreWpf/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,9 @@ To avoid unintended behavior, uninstall the conflicting loaded package(s), resta
<data name="OpenDynamoDefinitionDialogTitle" xml:space="preserve">
<value>Open {0} Definition...</value>
</data>
<data name="OpenDynamoTemplateDialogTitle" xml:space="preserve">
<value>New Graph from Template...</value>
</data>
Comment thread
johnpierson marked this conversation as resolved.
<data name="PackageDownloadConfirmMessageBoxTitle" xml:space="preserve">
<value>Package Download Confirmation</value>
<comment>Message box title</comment>
Expand Down
1 change: 1 addition & 0 deletions src/DynamoCoreWpf/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ static Dynamo.Wpf.Properties.Resources.DynamoSplashScreen.get -> string
static Dynamo.Wpf.Properties.Resources.MessageBoxDontShowAgainLabel.get -> string
static Dynamo.Wpf.Properties.Resources.OfflineStatusTooltip.get -> string
static Dynamo.Wpf.Properties.Resources.OnlineStatusTooltip.get -> string
static Dynamo.Wpf.Properties.Resources.OpenDynamoTemplateDialogTitle.get -> string
static Dynamo.Wpf.Properties.Resources.PackageDropdownInstalledVersionLabel.get -> string
static Dynamo.Wpf.Properties.Resources.PackageManagerPackageUpdateAvailable.get -> string
static Dynamo.Wpf.Properties.Resources.PackageManagerUninstall.get -> string
Expand Down
18 changes: 13 additions & 5 deletions src/DynamoCoreWpf/ViewModels/Core/DynamoViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2485,14 +2485,22 @@ private void ShowOpenDialogAndOpenResult(object parameter)
return;
}

bool isTemplate = parameter != null && (parameter as string).Equals("Template");
bool isTemplate = parameter is string s && string.Equals(s, "Template", StringComparison.Ordinal);
var fileExtensions = isTemplate ? "*.dyn" : "*.dyn;*.dyf";
var dialogTitle = isTemplate
? Resources.OpenDynamoTemplateDialogTitle
: string.Format(Resources.OpenDynamoDefinitionDialogTitle, BrandingResourceProvider.ProductName);
var fileFilter = string.Format(Resources.FileDialogDynamoDefinitions,
BrandingResourceProvider.ProductName, fileExtensions);
if (!isTemplate)
{
fileFilter += "|" + string.Format(Resources.FileDialogAllFiles, "*.*");
}

DynamoOpenFileDialog _fileDialog = new DynamoOpenFileDialog(this)
{
Filter = string.Format(Resources.FileDialogDynamoDefinitions,
BrandingResourceProvider.ProductName, "*.dyn;*.dyf") + "|" +
string.Format(Resources.FileDialogAllFiles, "*.*"),
Title = string.Format(Resources.OpenDynamoDefinitionDialogTitle,BrandingResourceProvider.ProductName)
Filter = fileFilter,
Title = dialogTitle
};

// If opening a template, use templates dir as the initial dir
Expand Down
Loading