feat(app): library, jobs, settings, server, welcome and about screens
Local-mode composition root (SQLite index, one JobEngine fed by a single handler registration list), keyset-paged library with thumbnail cache and hover scrub, live job list with throttled updates and the shell job bar, settings with live template validation and encoder self-test, server connection with trust-on-first-use and DPAPI token, first-run welcome, About with update check, and --capture screenshots with synthetic data. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
94 files changed
+10130
-374
No files matched your search
@@ -0,0 +1,120 @@
|
||||
using System.Windows.Input;
|
||||
using Titano.App.Infrastructure;
|
||||
using Titano.Core.Localization;
|
||||
using Titano.Ui.Controls;
|
||||
using Titano.Ui.Mvvm;
|
||||
|
||||
namespace Titano.App.Settings;
|
||||
|
||||
/// <summary>Sections of the Settings screen (BRIEF §12.8).</summary>
|
||||
public enum SettingsPage
|
||||
{
|
||||
General,
|
||||
Archive,
|
||||
Rendering,
|
||||
Storage,
|
||||
Server,
|
||||
Updates,
|
||||
Advanced,
|
||||
}
|
||||
|
||||
/// <summary>An entry of the section list: name, tooltip (what is inside) and the words the search matches.</summary>
|
||||
public sealed class SettingsPageItem(SettingsPage page, string[] keywordKeys) : ObservableObject
|
||||
{
|
||||
public SettingsPage Page { get; } = page;
|
||||
|
||||
public string Label => Loc.L("Settings.Page." + Page);
|
||||
|
||||
public string ToolTip => Loc.L("Tooltips.Settings.Page." + Page);
|
||||
|
||||
/// <summary>True when <paramref name="text"/> appears in the page name, its tooltip or one of its labels.</summary>
|
||||
public bool Matches(string text) =>
|
||||
Label.Contains(text, StringComparison.CurrentCultureIgnoreCase)
|
||||
|| ToolTip.Contains(text, StringComparison.CurrentCultureIgnoreCase)
|
||||
|| keywordKeys.Any(k => Loc.L(k).Contains(text, StringComparison.CurrentCultureIgnoreCase));
|
||||
|
||||
internal void Refresh() => OnAllPropertiesChanged();
|
||||
}
|
||||
|
||||
/// <summary>A choice of a settings dropdown.</summary>
|
||||
public sealed record SettingsOption<T>(T Value, string Label)
|
||||
{
|
||||
public override string ToString() => Label;
|
||||
}
|
||||
|
||||
/// <summary>One row of the encoder table with its self-test state.</summary>
|
||||
public sealed class EncoderRowViewModel(EncoderRow row) : ObservableObject
|
||||
{
|
||||
private SelfTestResult? _result;
|
||||
private bool _isTesting;
|
||||
|
||||
public EncoderRow Row { get; } = row;
|
||||
|
||||
public string Codec => Row.Codec;
|
||||
|
||||
/// <summary>"NVIDIA NVENC (hardware)".</summary>
|
||||
public string Name => Row.Source switch
|
||||
{
|
||||
EncoderSource.MediaFoundation => Loc.L(Row.Hardware ? "Settings.Rendering.Encoder.Hardware" : "Settings.Rendering.Encoder.Software", Row.DisplayName),
|
||||
_ => Loc.L("Settings.Rendering.Encoder.BuiltIn", Row.DisplayName),
|
||||
};
|
||||
|
||||
/// <summary>"Main10", "10-bit" or "—".</summary>
|
||||
public string TenBitText => !Row.TenBit ? "—" : Row.VideoCodec == Core.Video.VideoCodec.Hevc ? "Main10" : Loc.L("Settings.Rendering.TenBit");
|
||||
|
||||
public bool HasTenBit => Row.TenBit;
|
||||
|
||||
/// <summary>"8192×8192" or "no limit".</summary>
|
||||
public string MaxText => Row.MaxWidth > 0 ? $"{Row.MaxWidth}×{Row.MaxHeight}" : Loc.L("Settings.Rendering.NoLimit");
|
||||
|
||||
public bool IsTesting
|
||||
{
|
||||
get => _isTesting;
|
||||
set
|
||||
{
|
||||
if (Set(ref _isTesting, value)) RaiseResult();
|
||||
}
|
||||
}
|
||||
|
||||
public SelfTestResult? Result
|
||||
{
|
||||
get => _result;
|
||||
set
|
||||
{
|
||||
if (Set(ref _result, value)) RaiseResult();
|
||||
}
|
||||
}
|
||||
|
||||
public bool HasResult => _result is not null || _isTesting;
|
||||
|
||||
public StatusKind ResultKind => _isTesting ? StatusKind.Running : _result is { Passed: true } ? StatusKind.Done : StatusKind.Failed;
|
||||
|
||||
/// <summary>"142 fps · ok", "failed", "testing".</summary>
|
||||
public string ResultText => _isTesting ? Loc.L("Settings.Rendering.Testing")
|
||||
: _result is not { } r ? "—"
|
||||
: r.Passed ? Loc.L("Settings.Rendering.Passed", Formatting.Rate(r.FramesPerSecond))
|
||||
: Loc.L("Settings.Rendering.Failed");
|
||||
|
||||
public string ResultToolTip => _result is { Passed: false, Error: { } error } ? error : Loc.L("Tooltips.Settings.SelfTestResult");
|
||||
|
||||
internal void Refresh() => OnAllPropertiesChanged();
|
||||
|
||||
private void RaiseResult()
|
||||
{
|
||||
OnPropertyChanged(nameof(HasResult));
|
||||
OnPropertyChanged(nameof(ResultKind));
|
||||
OnPropertyChanged(nameof(ResultText));
|
||||
OnPropertyChanged(nameof(ResultToolTip));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>A trusted server certificate in Settings › Server.</summary>
|
||||
public sealed class TrustedCertificateRow(TrustedCertificate certificate, ICommand forget)
|
||||
{
|
||||
public TrustedCertificate Certificate { get; } = certificate;
|
||||
public string Server => Certificate.Server ?? "—";
|
||||
public string Fingerprint => Titano.App.Server.ServerSession.ShortFingerprint(Certificate.Fingerprint);
|
||||
public string FullFingerprint => Certificate.Fingerprint;
|
||||
public string TrustedText => Formatting.Date(Certificate.TrustedAt);
|
||||
public ICommand ForgetCommand { get; } = forget;
|
||||
}
|
||||
Reference in new issue
Block a user