From 2f39be972812eddb428cb43384eb2b4cd5b64c13 Mon Sep 17 00:00:00 2001 From: Michael Babienco Date: Tue, 17 Feb 2026 09:47:10 +0900 Subject: [PATCH] Open folder for report after creating --- ViewModels/MainViewModel.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ViewModels/MainViewModel.cs b/ViewModels/MainViewModel.cs index f9db52c..81b0875 100644 --- a/ViewModels/MainViewModel.cs +++ b/ViewModels/MainViewModel.cs @@ -284,7 +284,6 @@ class MainViewModel : BaseViewModel, IFontResolver var topLevel = TopLevelGrabber?.GetTopLevel(); if (topLevel is not null) { - Console.WriteLine(file.FilePath); var launcher = topLevel.Launcher; launcher.LaunchUriAsync(new Uri(file.FilePath)); } @@ -293,16 +292,21 @@ class MainViewModel : BaseViewModel, IFontResolver public void OpenFileLocation(object f) => OpenFileLocationImpl((ReportFile)f); private void OpenFileLocationImpl(ReportFile file) + { + OpenFolderForFileInFileViewer(file.FilePath); + } + + private void OpenFolderForFileInFileViewer(string fullPathToFile) { var topLevel = TopLevelGrabber?.GetTopLevel(); - var dirName = Path.GetDirectoryName(file.FilePath); + var dirName = Path.GetDirectoryName(fullPathToFile); if (topLevel is not null && dirName != null) { - Console.WriteLine(file.FilePath); var launcher = topLevel.Launcher; launcher.LaunchUriAsync(new Uri(dirName)); } } + } public void ResortPDFItemsByDate() { @@ -578,6 +582,7 @@ class MainViewModel : BaseViewModel, IFontResolver pdfRenderer.PdfDocument.Save(outputPDFFileName); LogInfo("Saved PDF output to: " + outputPDFFileName); await CreateAndSaveReportObjectAfterReportCreation(); + OpenFolderForFileInFileViewer(outputPDFFileName); IsCreatingPDF = false; } } \ No newline at end of file