Show error if output dir does not exist
This commit is contained in:
@@ -63,6 +63,7 @@ class SettingsViewModel: ChangeNotifier
|
|||||||
{
|
{
|
||||||
_settings.OutputPdfDir = value;
|
_settings.OutputPdfDir = value;
|
||||||
NotifyPropertyChanged();
|
NotifyPropertyChanged();
|
||||||
|
NotifyPropertyChanged(nameof(IsOutputPdfDirValid));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,6 +123,14 @@ class SettingsViewModel: ChangeNotifier
|
|||||||
|
|
||||||
public void Save()
|
public void Save()
|
||||||
{
|
{
|
||||||
|
if (!IsOutputPdfDirValid)
|
||||||
|
{
|
||||||
|
ErrorMessage = "Output directory cannot be found!";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ErrorMessage = "";
|
||||||
DialogHost.Close("DialogHost", _settings);
|
DialogHost.Close("DialogHost", _settings);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
FontWeight="Bold" />
|
FontWeight="Bold" />
|
||||||
<TextBlock TextWrapping="Wrap"
|
<TextBlock TextWrapping="Wrap"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Width="300">
|
Width="350">
|
||||||
Always reduce size of images if above this file size in megabytes (MB):
|
Always reduce size of images if above this file size in megabytes (MB):
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<NumericUpDown Value="{Binding ImageResizeThreshold}"
|
<NumericUpDown Value="{Binding ImageResizeThreshold}"
|
||||||
@@ -33,18 +33,23 @@
|
|||||||
Margin="0,0,0,4" />
|
Margin="0,0,0,4" />
|
||||||
<CheckBox IsChecked="{Binding !UseDocnetPDFImageRendering}">Use legacy PDF handling (does not work with macOS annotations)</CheckBox>
|
<CheckBox IsChecked="{Binding !UseDocnetPDFImageRendering}">Use legacy PDF handling (does not work with macOS annotations)</CheckBox>
|
||||||
<CheckBox IsChecked="{Binding SaveOutputPdfInWorkingDir}">Always save report PDF in working directory</CheckBox>
|
<CheckBox IsChecked="{Binding SaveOutputPdfInWorkingDir}">Always save report PDF in working directory</CheckBox>
|
||||||
<Grid ColumnDefinitions="*, *"
|
<Grid ColumnDefinitions="Auto, *"
|
||||||
IsVisible="{Binding !SaveOutputPdfInWorkingDir}">
|
IsVisible="{Binding !SaveOutputPdfInWorkingDir}">
|
||||||
<Button Content="Choose output folder..."
|
<Button Content="Choose output folder..."
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Command="{Binding ChooseOutputFolder}"
|
Command="{Binding ChooseOutputFolder}"
|
||||||
VerticalAlignment="Top"/>
|
VerticalAlignment="Top"/>
|
||||||
<TextBlock Text="{Binding OutputPdfDirPath}"
|
<TextBlock Text="{Binding OutputPdfDirPath}"
|
||||||
Margin="6,0,0,0"
|
Margin="4,0,0,0"
|
||||||
TextWrapping="Wrap"
|
TextWrapping="Wrap"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
VerticalAlignment="Top"/>
|
VerticalAlignment="Top"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
<TextBlock TextWrapping="Wrap"
|
||||||
|
Foreground="Red"
|
||||||
|
Text="{Binding ErrorMessage}"
|
||||||
|
IsVisible="{Binding HasErrorMessage}"/>
|
||||||
<StackPanel Orientation="Horizontal"
|
<StackPanel Orientation="Horizontal"
|
||||||
Spacing="12"
|
Spacing="12"
|
||||||
Margin="0,4,0,0"
|
Margin="0,4,0,0"
|
||||||
|
|||||||
Reference in New Issue
Block a user