From 1b7c2658faf55f5d4af7607444f85941ecfc8128 Mon Sep 17 00:00:00 2001 From: Ivo Petrov <48355182+ivaylo-matov@users.noreply.github.com> Date: Mon, 16 Sep 2024 21:22:40 +0100 Subject: [PATCH] [DYN-7330] Add a button to show sample graph folder and sample dataset (update) (#15485) --- src/DynamoCoreWpf/Controls/StartPage.xaml.cs | 4 ++++ src/DynamoCoreWpf/DynamoCoreWpf.csproj | 2 +- src/DynamoCoreWpf/Views/HomePage/HomePage.xaml.cs | 9 +++++---- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/DynamoCoreWpf/Controls/StartPage.xaml.cs b/src/DynamoCoreWpf/Controls/StartPage.xaml.cs index ca92535604d..1ee8f9944de 100644 --- a/src/DynamoCoreWpf/Controls/StartPage.xaml.cs +++ b/src/DynamoCoreWpf/Controls/StartPage.xaml.cs @@ -295,6 +295,10 @@ private void SetSampleDatasetsPath() { sampleDatasetsPath = datasetsPath; } + else + { + DynamoViewModel.Model.Logger.Log("Error, Dataset folder not found."); + } } } catch (Exception ex) diff --git a/src/DynamoCoreWpf/DynamoCoreWpf.csproj b/src/DynamoCoreWpf/DynamoCoreWpf.csproj index ef816e2e081..bf4f97c5d2c 100644 --- a/src/DynamoCoreWpf/DynamoCoreWpf.csproj +++ b/src/DynamoCoreWpf/DynamoCoreWpf.csproj @@ -59,7 +59,7 @@ - 1.0.18 + 1.0.19 DynamoHome diff --git a/src/DynamoCoreWpf/Views/HomePage/HomePage.xaml.cs b/src/DynamoCoreWpf/Views/HomePage/HomePage.xaml.cs index 906f6c5761f..63ff2b8ac44 100644 --- a/src/DynamoCoreWpf/Views/HomePage/HomePage.xaml.cs +++ b/src/DynamoCoreWpf/Views/HomePage/HomePage.xaml.cs @@ -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"); } @@ -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"); }