Skip to content

Commit

Permalink
[DYN-7330] Add a button to show sample graph folder and sample datase…
Browse files Browse the repository at this point in the history
…t (update) (#15485)
  • Loading branch information
ivaylo-matov authored Sep 16, 2024
1 parent 8bef8e6 commit 1b7c265
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions src/DynamoCoreWpf/Controls/StartPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,10 @@ private void SetSampleDatasetsPath()
{
sampleDatasetsPath = datasetsPath;
}
else
{
DynamoViewModel.Model.Logger.Log("Error, Dataset folder not found.");
}
}
}
catch (Exception ex)
Expand Down
2 changes: 1 addition & 1 deletion src/DynamoCoreWpf/DynamoCoreWpf.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

<Target Name="NpmRunBuildHomePage" BeforeTargets="BeforeBuild">
<PropertyGroup>
<PackageVersion>1.0.18</PackageVersion>
<PackageVersion>1.0.19</PackageVersion>
<PackageName>DynamoHome</PackageName>
</PropertyGroup>
<Exec Command="$(PowerShellCommand) -ExecutionPolicy ByPass -Command echo ($(SolutionDir)\pkgexist.ps1 $(PackageName) $(PackageVersion))" ConsoleToMSBuild="true">
Expand Down
9 changes: 5 additions & 4 deletions src/DynamoCoreWpf/Views/HomePage/HomePage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -615,8 +615,10 @@ internal void ShowSampleFilesInFolder()
return;
}

Process.Start(new ProcessStartInfo("explorer.exe", "/select,"
+ this.startPage.SampleFolderPath)
// Open the default Explorer location if the Sample folder cannot be found
string explorerArg = this.startPage.SampleFolderPath != null ? "/select," + this.startPage.SampleFolderPath : "";

Process.Start(new ProcessStartInfo("explorer.exe", explorerArg)
{ UseShellExecute = true });
Logging.Analytics.TrackEvent(Logging.Actions.Show, Logging.Categories.DynamoHomeOperations, "Sample Files");
}
Expand All @@ -630,8 +632,7 @@ internal void ShowSampleDatasetsInFolder()
return;
}

Process.Start(new ProcessStartInfo("explorer.exe", /*"/select,"*/
/*+ */this.startPage.SampleDatasetsPath)
Process.Start(new ProcessStartInfo("explorer.exe", this.startPage.SampleDatasetsPath)
{ UseShellExecute = true });
Logging.Analytics.TrackEvent(Logging.Actions.Show, Logging.Categories.DynamoHomeOperations, "Dataset Files");
}
Expand Down

0 comments on commit 1b7c265

Please sign in to comment.