feat: Add EXIF data removal option and update related UI bindings
Some checks failed
Build Windows Avalonia / build (push) Failing after 2m32s

This commit is contained in:
Maddo 2026-11-30 19:18:08 +01:00
commit fc0598e2fb
10 changed files with 104 additions and 72 deletions

View file

@ -2,8 +2,6 @@ using Avalonia.Controls;
using Avalonia.Platform.Storage;
using Avalonia.Threading;
using Microsoft.Extensions.DependencyInjection;
using System.Diagnostics;
using System.IO;
namespace CatalogLite;
@ -55,16 +53,6 @@ public partial class MainWindow : Window
}
}
private void OpenSourcePath_Click(object? sender, Avalonia.Interactivity.RoutedEventArgs e)
{
OpenInExplorer(_viewModel.SourcePath);
}
private void OpenDestinationPath_Click(object? sender, Avalonia.Interactivity.RoutedEventArgs e)
{
OpenInExplorer(_viewModel.DestinationPath);
}
private async void OnShowMessageRequested(object? sender, LiteMessageEventArgs e)
{
await ShowMessageDialogAsync(e.Title, e.Message);
@ -108,46 +96,4 @@ public partial class MainWindow : Window
closeButton.Click += (_, _) => dialog.Close();
await dialog.ShowDialog(this);
}
private static void OpenInExplorer(string? path)
{
if (string.IsNullOrWhiteSpace(path))
{
return;
}
var normalizedPath = path.Trim().Trim('"');
try
{
if (File.Exists(normalizedPath))
{
Process.Start("explorer.exe", $"/select,\"{normalizedPath}\"");
return;
}
if (Directory.Exists(normalizedPath))
{
Process.Start(new ProcessStartInfo
{
FileName = normalizedPath,
UseShellExecute = true
});
return;
}
var containingDirectory = Path.GetDirectoryName(normalizedPath);
if (!string.IsNullOrWhiteSpace(containingDirectory) && Directory.Exists(containingDirectory))
{
Process.Start(new ProcessStartInfo
{
FileName = containingDirectory,
UseShellExecute = true
});
}
}
catch
{
}
}
}