From abc97eea2b9e58f56d7126a117d633d622790e72 Mon Sep 17 00:00:00 2001 From: Michael Babienco Date: Tue, 3 Mar 2026 09:43:47 +0900 Subject: [PATCH] Show error if output dir does not exist --- src/ViewModels/SettingsViewModel.cs | 11 ++++++++++- src/Views/SettingsView.axaml | 11 ++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/ViewModels/SettingsViewModel.cs b/src/ViewModels/SettingsViewModel.cs index 52cc762..7a6ebd6 100644 --- a/src/ViewModels/SettingsViewModel.cs +++ b/src/ViewModels/SettingsViewModel.cs @@ -63,6 +63,7 @@ class SettingsViewModel: ChangeNotifier { _settings.OutputPdfDir = value; NotifyPropertyChanged(); + NotifyPropertyChanged(nameof(IsOutputPdfDirValid)); } } @@ -122,6 +123,14 @@ class SettingsViewModel: ChangeNotifier public void Save() { - DialogHost.Close("DialogHost", _settings); + if (!IsOutputPdfDirValid) + { + ErrorMessage = "Output directory cannot be found!"; + } + else + { + ErrorMessage = ""; + DialogHost.Close("DialogHost", _settings); + } } } \ No newline at end of file diff --git a/src/Views/SettingsView.axaml b/src/Views/SettingsView.axaml index d163d9f..81746bd 100644 --- a/src/Views/SettingsView.axaml +++ b/src/Views/SettingsView.axaml @@ -20,7 +20,7 @@ FontWeight="Bold" /> + Width="350"> Always reduce size of images if above this file size in megabytes (MB): Use legacy PDF handling (does not work with macOS annotations) Always save report PDF in working directory -