Open folder for report after creating

This commit is contained in:
2026-02-17 09:47:10 +09:00
parent 96c5fb46b4
commit 2f39be9728
+8 -3
View File
@@ -284,7 +284,6 @@ class MainViewModel : BaseViewModel, IFontResolver
var topLevel = TopLevelGrabber?.GetTopLevel(); var topLevel = TopLevelGrabber?.GetTopLevel();
if (topLevel is not null) if (topLevel is not null)
{ {
Console.WriteLine(file.FilePath);
var launcher = topLevel.Launcher; var launcher = topLevel.Launcher;
launcher.LaunchUriAsync(new Uri(file.FilePath)); launcher.LaunchUriAsync(new Uri(file.FilePath));
} }
@@ -293,16 +292,21 @@ class MainViewModel : BaseViewModel, IFontResolver
public void OpenFileLocation(object f) => OpenFileLocationImpl((ReportFile)f); public void OpenFileLocation(object f) => OpenFileLocationImpl((ReportFile)f);
private void OpenFileLocationImpl(ReportFile file) private void OpenFileLocationImpl(ReportFile file)
{
OpenFolderForFileInFileViewer(file.FilePath);
}
private void OpenFolderForFileInFileViewer(string fullPathToFile)
{ {
var topLevel = TopLevelGrabber?.GetTopLevel(); var topLevel = TopLevelGrabber?.GetTopLevel();
var dirName = Path.GetDirectoryName(file.FilePath); var dirName = Path.GetDirectoryName(fullPathToFile);
if (topLevel is not null && dirName != null) if (topLevel is not null && dirName != null)
{ {
Console.WriteLine(file.FilePath);
var launcher = topLevel.Launcher; var launcher = topLevel.Launcher;
launcher.LaunchUriAsync(new Uri(dirName)); launcher.LaunchUriAsync(new Uri(dirName));
} }
} }
}
public void ResortPDFItemsByDate() public void ResortPDFItemsByDate()
{ {
@@ -578,6 +582,7 @@ class MainViewModel : BaseViewModel, IFontResolver
pdfRenderer.PdfDocument.Save(outputPDFFileName); pdfRenderer.PdfDocument.Save(outputPDFFileName);
LogInfo("Saved PDF output to: " + outputPDFFileName); LogInfo("Saved PDF output to: " + outputPDFFileName);
await CreateAndSaveReportObjectAfterReportCreation(); await CreateAndSaveReportObjectAfterReportCreation();
OpenFolderForFileInFileViewer(outputPDFFileName);
IsCreatingPDF = false; IsCreatingPDF = false;
} }
} }