Add new tab views for image catalog functionality
- Implement GeneralTabView for source and destination path settings, options, processing parameters, and image library selection. - Create LogoTabView for logo selection, preview, and positioning options. - Add PhotoTabView for photo dimensions and JPEG quality settings. - Introduce RaceUploadTabView for race setup and processed photo upload functionality, including API integration. - Develop TextTabView for horizontal and vertical text settings, font options, and race time configuration. - Implement ThumbnailsTabView for thumbnail creation options and settings.
This commit is contained in:
parent
6cf0c029fc
commit
90fb03bf0c
18 changed files with 1322 additions and 1008 deletions
56
imagecatalog/AvaloniaViews/GeneralTabView.axaml.cs
Normal file
56
imagecatalog/AvaloniaViews/GeneralTabView.axaml.cs
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
|
||||
namespace ImageCatalog_2.AvaloniaViews;
|
||||
|
||||
public partial class GeneralTabView : Avalonia.Controls.UserControl
|
||||
{
|
||||
public GeneralTabView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void OpenSourceFolder_Click(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
if (DataContext is DataModel model)
|
||||
{
|
||||
OpenInExplorer(model.SourcePath);
|
||||
}
|
||||
}
|
||||
|
||||
private void OpenDestinationFolder_Click(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
if (DataContext is DataModel model)
|
||||
{
|
||||
OpenInExplorer(model.DestinationPath);
|
||||
}
|
||||
}
|
||||
|
||||
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}\"");
|
||||
}
|
||||
else if (Directory.Exists(normalizedPath))
|
||||
{
|
||||
Process.Start(new ProcessStartInfo { FileName = normalizedPath, UseShellExecute = true });
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Ignore failures when opening Explorer.
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue