small fixes

This commit is contained in:
Asval 2026-06-20 11:31:31 +02:00
parent 3fc249448a
commit e3747e5a67
5 changed files with 37 additions and 37 deletions

@ -1 +1 @@
Subproject commit 338fdf5bb380245a26ce1c5b540159c9b8a1c277
Subproject commit 20f91801ae8b6dd7318e6fc3055f8c354b7f78ff

View File

@ -54,6 +54,7 @@ public class ExportSessionOptionsViewModel : ViewModel
set
{
if (!SetProperty(ref field, value)) return;
RaisePropertyChanged(nameof(SocketSettingsEnabled));
RaisePropertyChanged(nameof(CompressionSettingsEnabled));
}
}
@ -85,6 +86,8 @@ public class ExportSessionOptionsViewModel : ViewModel
set => SetProperty(ref field, value);
}
public bool SocketSettingsEnabled => SelectedMeshFormat == EMeshFormat.ActorX;
public IEnumerable<EFileCompressionFormat> CompressionFormats { get; } = Enum.GetValues<EFileCompressionFormat>();
public EFileCompressionFormat SelectedCompressionFormat
{

View File

@ -386,6 +386,10 @@ public class LogEntryViewModel(LogEvent log)
{
public LogEventLevel Level { get; } = log.Level;
public DateTimeOffset Timestamp { get; } = log.Timestamp;
public string Message { get; } = log.RenderMessage();
public string Message { get; } = log.Exception switch
{
NullReferenceException or ArgumentException => log.RenderMessage(),
_ => log.Exception?.Message ?? log.RenderMessage()
};
public Exception? Exception { get; } = log.Exception;
}

View File

@ -147,19 +147,15 @@
</Canvas>
</Viewbox>
<TextBlock Grid.Column="1" Text="{Binding Timestamp, StringFormat='[{0:HH:mm:ss.fff}]'}"
FontSize="11" FontFamily="Consolas" Margin="0 0 5 0"
Foreground="{DynamicResource {x:Static adonisUi:Brushes.DisabledForegroundBrush}}"
VerticalAlignment="Center" />
FontSize="11" Margin="0 0 5 0" VerticalAlignment="Center"
Foreground="{DynamicResource {x:Static adonisUi:Brushes.DisabledForegroundBrush}}" />
<TextBlock Grid.Column="2"
Text="{Binding Message}"
FontSize="11" FontFamily="Consolas"
Foreground="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}"
VerticalAlignment="Center" />
Text="{Binding Message}" FontSize="11" VerticalAlignment="Center"
Foreground="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}" />
</Grid>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding Level}" Value="{x:Static serilog:LogEventLevel.Verbose}">
<Setter TargetName="LevelIcon" Property="Data" Value="{StaticResource NoteIcon}" />
<Setter TargetName="LevelIcon" Property="Fill" Value="{DynamicResource {x:Static adonisUi:Brushes.DisabledForegroundBrush}}" />
</DataTrigger>
<DataTrigger Binding="{Binding Level}" Value="{x:Static serilog:LogEventLevel.Debug}">
<Setter TargetName="LevelIcon" Property="Data" Value="{StaticResource BugIcon}" />
@ -568,10 +564,12 @@
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock Grid.Row="6" Grid.Column="0" Text="Socket Format" VerticalAlignment="Center" Margin="0 0 0 5" />
<TextBlock Grid.Row="6" Grid.Column="0" Text="Socket Format" VerticalAlignment="Center" Margin="0 0 0 5"
IsEnabled="{Binding Options.SocketSettingsEnabled}" />
<ComboBox Grid.Row="6" Grid.Column="2" Grid.ColumnSpan="3" Margin="0 0 0 5"
ItemsSource="{Binding Options.SocketFormats}"
SelectedItem="{Binding Options.SelectedSocketFormat, Mode=TwoWay}">
SelectedItem="{Binding Options.SelectedSocketFormat, Mode=TwoWay}"
IsEnabled="{Binding Options.SocketSettingsEnabled}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Converter={x:Static converters:EnumToStringConverter.Instance}}" />
@ -752,24 +750,15 @@
</Button>
<Button Grid.Column="3" MinWidth="78" Margin="0 0 12 0" IsDefault="False" IsCancel="False"
HorizontalAlignment="Right" VerticalAlignment="Bottom" Click="OnExportOrOkClick">
<Button.Style>
<Style TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Content" Value="Export" />
<Setter Property="IsEnabled" Value="{Binding CanExport}" />
<Setter Property="Visibility" Value="Visible" />
<Style.Triggers>
<DataTrigger Binding="{Binding IsRunning}" Value="True">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
<DataTrigger Binding="{Binding IsFinished}" Value="True">
<Setter Property="Content" Value="OK" />
<Setter Property="IsEnabled" Value="True" />
</DataTrigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
HorizontalAlignment="Right" VerticalAlignment="Bottom" Content="Export"
IsEnabled="{Binding CanExport}"
Visibility="{Binding IsFinished, Converter={x:Static converters:InvertBoolToVisibilityConverter.Instance}}"
Click="OnExportClick" />
<Button Grid.Column="3" MinWidth="78" Margin="0 0 12 0" IsDefault="False" IsCancel="False"
HorizontalAlignment="Right" VerticalAlignment="Bottom" Content="OK"
Visibility="{Binding IsFinished, Converter={StaticResource BoolToVisibilityConverter}}"
Click="OnOkClick" />
</Grid>
</Border>
</Grid>

View File

@ -16,13 +16,15 @@ public partial class ExportSessionWindow
DataContext = ExportSessionViewModel.Instance;
}
private async void OnExportOrOkClick(object sender, RoutedEventArgs e)
private async void OnExportClick(object sender, RoutedEventArgs e)
{
if (sender is not Button { DataContext: ExportSessionViewModel viewModel })
return;
if (sender is Button { DataContext: ExportSessionViewModel { CanExport: true } viewModel })
await viewModel.ExportAsync();
}
if (viewModel.IsFinished) Close();
else if (viewModel.CanExport) await viewModel.ExportAsync();
private void OnOkClick(object sender, RoutedEventArgs e)
{
Close();
}
private void OnCancelClick(object sender, RoutedEventArgs e)
@ -46,12 +48,14 @@ public partial class ExportSessionWindow
private void OnMakeDefaultOptions(object sender, RoutedEventArgs e)
{
ExportSessionViewModel.Instance.Options.SaveAsUserDefaults();
if (sender is Button { DataContext: ExportSessionViewModel viewModel })
viewModel.Options.SaveAsUserDefaults();
}
private void OnResetOptions(object sender, RoutedEventArgs e)
{
ExportSessionViewModel.Instance.Options.ResetToUserDefaults();
if (sender is Button { DataContext: ExportSessionViewModel viewModel })
viewModel.Options.ResetToUserDefaults();
}
private void OnHyperlinkClick(object sender, RoutedEventArgs e)