feat(app): complete the Library: timeline, saved views, quick and mass actions, remote cards

The Library gets a third layout (year bands of photos per month over the card
grid; a month narrows to its year and scrolls to it), saved views stored as
app-scope settings rows, hover quick actions on cards and rows (open, analyse,
render the sequence's preset, sync), the full mass actions bar (analyse,
proxies, verify, tags, rating, move, upload, download, delete into the trash,
CSV) with each button's reason when it cannot run, and, while signed in, the
server's sequences without a local copy as remote cards filterable by origin.
Delete shows the engine's dry run behind a typed confirmation and offers Undo;
the Archive manager gets Delete… and a Trash dialog that restores sequences.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
Claude committed 2026-10-03 11:50:43 +00:00
1 parent 453fb63687
commit 20b9654c33
27 files changed
+2582 -422

No files matched your search

+36
View File
@@ -34,7 +34,31 @@
<data name="Archive.Confirm.RemoveHeading" xml:space="preserve"><value>Remove {0} from the index?</value><comment>long</comment></data>
<data name="Archive.Confirm.RemoveMessage" xml:space="preserve"><value>Its sidecar is gone. Only the index row is removed; no file is deleted.</value><comment>long</comment></data>
<data name="Archive.Copy.Title" xml:space="preserve"><value>Folder to copy into the archive</value><comment>long</comment></data>
<data name="Archive.Delete.Action" xml:space="preserve"><value>Move to trash</value></data>
<data name="Archive.Delete.Blocked" xml:space="preserve"><value>Not moved: {0} · {1}</value><comment>long</comment></data>
<data name="Archive.Delete.Done.one" xml:space="preserve"><value>{0:N0} sequence moved to the trash</value><comment>long</comment></data>
<data name="Archive.Delete.Done.other" xml:space="preserve"><value>{0:N0} sequences moved to the trash</value><comment>long</comment></data>
<data name="Archive.Delete.Failed" xml:space="preserve"><value>The sequences could not move to the trash</value><comment>long</comment></data>
<data name="Archive.Delete.Files.one" xml:space="preserve"><value>{0:N0} file</value></data>
<data name="Archive.Delete.Files.other" xml:space="preserve"><value>{0:N0} files</value></data>
<data name="Archive.Delete.Heading.one" xml:space="preserve"><value>Move {0:N0} sequence to the trash?</value><comment>long</comment></data>
<data name="Archive.Delete.Heading.other" xml:space="preserve"><value>Move {0:N0} sequences to the trash?</value><comment>long</comment></data>
<data name="Archive.Delete.Keep" xml:space="preserve"><value>Keep</value></data>
<data name="Archive.Delete.Kept" xml:space="preserve"><value>They stay in the archive's trash, restorable from Maintenance.</value><comment>long</comment></data>
<data name="Archive.Delete.Line" xml:space="preserve"><value>{0} · {1} · {2}</value><comment>invariant</comment></data>
<data name="Archive.Delete.Message" xml:space="preserve"><value>{0} and {1} ({2}) leave the library and move to the archive's trash; nothing is erased.</value><comment>long</comment></data>
<data name="Archive.Delete.More.one" xml:space="preserve"><value>+ {0:N0} more</value><comment>long</comment></data>
<data name="Archive.Delete.More.other" xml:space="preserve"><value>+ {0:N0} more</value><comment>long</comment></data>
<data name="Archive.Delete.Nothing" xml:space="preserve"><value>Nothing can move to the trash</value><comment>long</comment></data>
<data name="Archive.Delete.Reason.ArchiveRoot" xml:space="preserve"><value>its photos are the archive root</value><comment>long</comment></data>
<data name="Archive.Delete.Reason.Busy" xml:space="preserve"><value>a job is working on it</value><comment>long</comment></data>
<data name="Archive.Delete.Reason.ContainsSequences" xml:space="preserve"><value>other sequences are inside its folder</value><comment>long</comment></data>
<data name="Archive.Delete.Reason.ForeignSidecar" xml:space="preserve"><value>its folder holds another sequence; scan the archive first</value><comment>long</comment></data>
<data name="Archive.Delete.Reason.Offline" xml:space="preserve"><value>the archive is offline or read-only</value><comment>long</comment></data>
<data name="Archive.Delete.Type" xml:space="preserve"><value>Type {0} to confirm</value><comment>long</comment></data>
<data name="Archive.Delete.Undo" xml:space="preserve"><value>Undo</value></data>
<data name="Archive.Dialog.Cancel" xml:space="preserve"><value>Cancel</value></data>
<data name="Archive.Dialog.Close" xml:space="preserve"><value>Close</value></data>
<data name="Archive.Duplicates.Copies.one" xml:space="preserve"><value>{0:N0} copy</value></data>
<data name="Archive.Duplicates.Copies.other" xml:space="preserve"><value>{0:N0} copies</value></data>
<data name="Archive.Duplicates.Folder" xml:space="preserve"><value>Folder</value></data>
@@ -98,6 +122,7 @@
<data name="Archive.Maintenance.Proxies" xml:space="preserve"><value>Rebuild proxies</value></data>
<data name="Archive.Maintenance.Relink" xml:space="preserve"><value>Relink moved archive…</value></data>
<data name="Archive.Maintenance.Run" xml:space="preserve"><value>Run maintenance</value></data>
<data name="Archive.Maintenance.Trash" xml:space="preserve"><value>Trash…</value></data>
<data name="Archive.Orphans.Count.one" xml:space="preserve"><value>{0:N0} issue</value></data>
<data name="Archive.Orphans.Count.other" xml:space="preserve"><value>{0:N0} issues</value></data>
<data name="Archive.Orphans.Failed" xml:space="preserve"><value>The orphan search stopped</value><comment>long</comment></data>
@@ -153,6 +178,7 @@
<data name="Archive.Set.All.other" xml:space="preserve"><value>{0:N0} sequences · all</value></data>
<data name="Archive.Set.Analyse" xml:space="preserve"><value>Analyse</value></data>
<data name="Archive.Set.ClearFilter" xml:space="preserve"><value>Clear filter</value></data>
<data name="Archive.Set.Delete" xml:space="preserve"><value>Delete…</value></data>
<data name="Archive.Set.Export" xml:space="preserve"><value>Export CSV</value></data>
<data name="Archive.Set.Filter" xml:space="preserve"><value>Set filter</value></data>
<data name="Archive.Set.Label" xml:space="preserve"><value>Filtered set</value></data>
@@ -182,6 +208,16 @@
<data name="Archive.Toolbar.Rebuild" xml:space="preserve"><value>Rebuild index…</value></data>
<data name="Archive.Toolbar.Scan" xml:space="preserve"><value>Scan</value></data>
<data name="Archive.Toolbar.Verify" xml:space="preserve"><value>Verify</value></data>
<data name="Archive.Trash.Deleted" xml:space="preserve"><value>Deleted {0}</value><comment>long</comment></data>
<data name="Archive.Trash.Empty" xml:space="preserve"><value>The trash is empty</value><comment>long</comment></data>
<data name="Archive.Trash.Failed" xml:space="preserve"><value>The sequence could not come back from the trash</value><comment>long</comment></data>
<data name="Archive.Trash.Heading" xml:space="preserve"><value>Trash · {0}</value><comment>long</comment></data>
<data name="Archive.Trash.List" xml:space="preserve"><value>Deleted sequences</value></data>
<data name="Archive.Trash.Reading" xml:space="preserve"><value>Reading the trash…</value></data>
<data name="Archive.Trash.Restore" xml:space="preserve"><value>Restore</value></data>
<data name="Archive.Trash.Restored.one" xml:space="preserve"><value>{0:N0} sequence restored</value><comment>long</comment></data>
<data name="Archive.Trash.Restored.other" xml:space="preserve"><value>{0:N0} sequences restored</value><comment>long</comment></data>
<data name="Archive.Trash.Restoring" xml:space="preserve"><value>Restoring {0}…</value><comment>long</comment></data>
<data name="Archive.Tree.Name" xml:space="preserve"><value>Archive tree</value></data>
<data name="Archive.Tree.Undated" xml:space="preserve"><value>Undated</value></data>
<data name="Archive.View.Maintenance" xml:space="preserve"><value>Maintenance</value></data>
+49
View File
@@ -6,12 +6,32 @@
<resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
<data name="Library.Action.Analyse" xml:space="preserve"><value>Analyse</value></data>
<data name="Library.Action.ClearSelection" xml:space="preserve"><value>Clear selection</value></data>
<data name="Library.Action.Delete" xml:space="preserve"><value>Delete…</value></data>
<data name="Library.Action.Download" xml:space="preserve"><value>Download</value></data>
<data name="Library.Action.ExportList" xml:space="preserve"><value>Export list</value></data>
<data name="Library.Action.Folder" xml:space="preserve"><value>Folder</value></data>
<data name="Library.Action.Move" xml:space="preserve"><value>Move…</value></data>
<data name="Library.Action.Open" xml:space="preserve"><value>Open</value></data>
<data name="Library.Action.Proxies" xml:space="preserve"><value>Proxies</value></data>
<data name="Library.Action.Rate" xml:space="preserve"><value>Rating</value></data>
<data name="Library.Action.Render" xml:space="preserve"><value>Render</value></data>
<data name="Library.Action.Sync" xml:space="preserve"><value>Sync</value></data>
<data name="Library.Action.Tag" xml:space="preserve"><value>Tags…</value></data>
<data name="Library.Action.Upload" xml:space="preserve"><value>Upload</value></data>
<data name="Library.Action.Verify" xml:space="preserve"><value>Verify</value></data>
<data name="Library.Adopt.Title" xml:space="preserve"><value>Adopt a folder</value></data>
<data name="Library.Blocked.Archives" xml:space="preserve"><value>Move works on the sequences of one archive at a time.</value><comment>long</comment></data>
<data name="Library.Blocked.InSync" xml:space="preserve"><value>The same on this PC and on the server: nothing to sync.</value><comment>long</comment></data>
<data name="Library.Blocked.NoDownloadRight" xml:space="preserve"><value>Your server account cannot download originals.</value><comment>long</comment></data>
<data name="Library.Blocked.NoIndex" xml:space="preserve"><value>The library index is not open.</value><comment>long</comment></data>
<data name="Library.Blocked.NoSelection" xml:space="preserve"><value>Select one or more sequences first.</value><comment>long</comment></data>
<data name="Library.Blocked.NoSyncRight" xml:space="preserve"><value>Your server account cannot change this sequence.</value><comment>long</comment></data>
<data name="Library.Blocked.NoUploadRight" xml:space="preserve"><value>Your server account cannot upload.</value><comment>long</comment></data>
<data name="Library.Blocked.NotConnected" xml:space="preserve"><value>Sign in to a Titano Server first, on the Server screen.</value><comment>long</comment></data>
<data name="Library.Blocked.NothingToDownload" xml:space="preserve"><value>The selected sequences have nothing to fetch from the server.</value><comment>long</comment></data>
<data name="Library.Blocked.NothingToUpload" xml:space="preserve"><value>The server already has what the selected sequences hold.</value><comment>long</comment></data>
<data name="Library.Blocked.ServerOnly" xml:space="preserve"><value>Only for sequences on this PC; the selection lives on the server.</value><comment>long</comment></data>
<data name="Library.Blocked.Transferring" xml:space="preserve"><value>A transfer of this sequence is already under way.</value><comment>long</comment></data>
<data name="Library.ClearFilters" xml:space="preserve"><value>Clear filters</value></data>
<data name="Library.Column.Camera" xml:space="preserve"><value>Camera</value></data>
<data name="Library.Column.Date" xml:space="preserve"><value>Date</value></data>
@@ -32,10 +52,14 @@
<data name="Library.Export.Show" xml:space="preserve"><value>Show</value></data>
<data name="Library.Export.Title" xml:space="preserve"><value>Export the list to</value></data>
<data name="Library.Filter.AnyCamera" xml:space="preserve"><value>All cameras</value></data>
<data name="Library.Filter.AnyOrigin" xml:space="preserve"><value>This PC and server</value></data>
<data name="Library.Filter.AnyStatus" xml:space="preserve"><value>Any status</value></data>
<data name="Library.Filter.AnyTag" xml:space="preserve"><value>All tags</value></data>
<data name="Library.Filter.AnyYear" xml:space="preserve"><value>All years</value></data>
<data name="Library.Filter.Camera" xml:space="preserve"><value>Camera</value></data>
<data name="Library.Filter.Origin" xml:space="preserve"><value>Origin</value></data>
<data name="Library.Filter.Origin.Local" xml:space="preserve"><value>On this PC</value></data>
<data name="Library.Filter.Origin.Server" xml:space="preserve"><value>Only on server</value></data>
<data name="Library.Filter.Status" xml:space="preserve"><value>Status</value></data>
<data name="Library.Filter.Status.Analysed" xml:space="preserve"><value>Analysed</value></data>
<data name="Library.Filter.Status.NoProxies" xml:space="preserve"><value>Without proxies</value></data>
@@ -48,7 +72,13 @@
<data name="Library.Filter.Year" xml:space="preserve"><value>Year</value></data>
<data name="Library.Interval" xml:space="preserve"><value>{0} s</value></data>
<data name="Library.NoMatch" xml:space="preserve"><value>No sequences match the filters</value></data>
<data name="Library.Post.Failed" xml:space="preserve"><value>The server did not accept the job</value><comment>long</comment></data>
<data name="Library.Queued" xml:space="preserve"><value>{0} queued · {1}</value></data>
<data name="Library.QueuedServer" xml:space="preserve"><value>Sent to the server: {0} · {1}</value><comment>long</comment></data>
<data name="Library.Rate.Failed" xml:space="preserve"><value>The rating could not be saved</value><comment>long</comment></data>
<data name="Library.Rate.None" xml:space="preserve"><value>No rating</value></data>
<data name="Library.Rate.Stars.one" xml:space="preserve"><value>{0:N0} star</value></data>
<data name="Library.Rate.Stars.other" xml:space="preserve"><value>{0:N0} stars</value></data>
<data name="Library.Rescan" xml:space="preserve"><value>Rescan</value></data>
<data name="Library.Search" xml:space="preserve"><value>Search title, camera, tag</value></data>
<data name="Library.Selection.Count.one" xml:space="preserve"><value>{0:N0} selected</value></data>
@@ -65,7 +95,26 @@
<data name="Library.Status.Proxies" xml:space="preserve"><value>Proxies</value></data>
<data name="Library.Status.Remote" xml:space="preserve"><value>Remote</value></data>
<data name="Library.Status.Synced" xml:space="preserve"><value>Synced</value></data>
<data name="Library.Transfers.Queued.one" xml:space="preserve"><value>{0:N0} transfer queued</value><comment>long</comment></data>
<data name="Library.Transfers.Queued.other" xml:space="preserve"><value>{0:N0} transfers queued</value><comment>long</comment></data>
<data name="Library.View" xml:space="preserve"><value>View</value></data>
<data name="Library.View.Grid" xml:space="preserve"><value>Grid</value></data>
<data name="Library.View.List" xml:space="preserve"><value>List</value></data>
<data name="Library.View.Timeline" xml:space="preserve"><value>Timeline</value></data>
<data name="Library.Views" xml:space="preserve"><value>Saved views</value></data>
<data name="Library.Views.Apply" xml:space="preserve"><value>Show view</value></data>
<data name="Library.Views.Delete" xml:space="preserve"><value>Delete view</value></data>
<data name="Library.Views.Deleted" xml:space="preserve"><value>View {0} deleted</value><comment>long</comment></data>
<data name="Library.Views.Error.Empty" xml:space="preserve"><value>Give the view a name.</value><comment>long</comment></data>
<data name="Library.Views.Error.Long" xml:space="preserve"><value>At most {0} characters, no control characters.</value><comment>long</comment></data>
<data name="Library.Views.Error.Taken" xml:space="preserve"><value>Another view already has this name.</value><comment>long</comment></data>
<data name="Library.Views.Name" xml:space="preserve"><value>Name</value></data>
<data name="Library.Views.RenameHeading" xml:space="preserve"><value>Rename view</value></data>
<data name="Library.Views.RenameMenu" xml:space="preserve"><value>Rename view…</value></data>
<data name="Library.Views.Renamed" xml:space="preserve"><value>View renamed to {0}</value><comment>long</comment></data>
<data name="Library.Views.Save" xml:space="preserve"><value>Save</value></data>
<data name="Library.Views.SaveHeading" xml:space="preserve"><value>Save view</value></data>
<data name="Library.Views.SaveMenu" xml:space="preserve"><value>Save view…</value></data>
<data name="Library.Views.Saved" xml:space="preserve"><value>View {0} saved</value><comment>long</comment></data>
<data name="Library.Views.Undo" xml:space="preserve"><value>Undo</value></data>
</root>
+51
View File
@@ -29,6 +29,11 @@
<data name="Tooltips.Archive.ClearFilter" xml:space="preserve"><value>Show every sequence of the selection again</value></data>
<data name="Tooltips.Archive.CloseDialog" xml:space="preserve"><value>Close without changing anything · Esc</value></data>
<data name="Tooltips.Archive.Collapse" xml:space="preserve"><value>Hide the sequences of this year</value></data>
<data name="Tooltips.Archive.DeleteAction.one" xml:space="preserve"><value>Move {0:N0} sequence to the trash; type the number above first</value></data>
<data name="Tooltips.Archive.DeleteAction.other" xml:space="preserve"><value>Move {0:N0} sequences to the trash; type the number above first</value></data>
<data name="Tooltips.Archive.DeleteKeep" xml:space="preserve"><value>Change nothing</value></data>
<data name="Tooltips.Archive.DeletePlan" xml:space="preserve"><value>What moves to the archive's trash, and what cannot move</value></data>
<data name="Tooltips.Archive.DeleteUndo" xml:space="preserve"><value>Bring the sequences back from the trash into their folders</value></data>
<data name="Tooltips.Archive.DuplicateFolder" xml:space="preserve"><value>Show the folder of the first copy in Explorer</value></data>
<data name="Tooltips.Archive.DuplicateOpen" xml:space="preserve"><value>Open the sequence of the first copy in the editor</value></data>
<data name="Tooltips.Archive.Duplicates" xml:space="preserve"><value>Find identical photos across sequences by hash · reads the index only</value></data>
@@ -72,6 +77,7 @@
<data name="Tooltips.Archive.Scan" xml:space="preserve"><value>Incremental scan: new, changed and removed files by modification time and size</value></data>
<data name="Tooltips.Archive.Set" xml:space="preserve"><value>The selected years and sequences (all when nothing is selected), narrowed by camera, status or tag</value></data>
<data name="Tooltips.Archive.SetAnalyse" xml:space="preserve"><value>Run the deep analysis on every sequence in the set</value></data>
<data name="Tooltips.Archive.SetDelete" xml:space="preserve"><value>Move the set to the archive's trash · shows the dry run, then asks you to type to confirm</value></data>
<data name="Tooltips.Archive.SetExport" xml:space="preserve"><value>Export the set as CSV: one row per sequence</value></data>
<data name="Tooltips.Archive.SetMove" xml:space="preserve"><value>Move the set into a new folder layout · dry run first</value></data>
<data name="Tooltips.Archive.SetProxies" xml:space="preserve"><value>Generate or refresh proxies</value></data>
@@ -84,6 +90,8 @@
<data name="Tooltips.Archive.TagsAdd" xml:space="preserve"><value>Tags to add, separated by commas</value></data>
<data name="Tooltips.Archive.TagsRemove" xml:space="preserve"><value>Tags to remove, separated by commas</value></data>
<data name="Tooltips.Archive.TitleTemplate" xml:space="preserve"><value>Title template; the title token is the current title · checked as you type</value></data>
<data name="Tooltips.Archive.Trash" xml:space="preserve"><value>The sequences deleted from this archive, each one restorable</value></data>
<data name="Tooltips.Archive.TrashRestore" xml:space="preserve"><value>Move this sequence back into its folder and the library, with its settings and renders</value></data>
<data name="Tooltips.Archive.Verify" xml:space="preserve"><value>Re-hash every original and report bit rot · reads the whole archive</value></data>
<data name="Tooltips.Archive.YearRow" xml:space="preserve"><value>{0} · Right arrow opens the year, Left arrow closes it</value></data>
<data name="Tooltips.Common.Dismiss" xml:space="preserve"><value>Dismiss</value></data>
@@ -306,10 +314,40 @@
<data name="Tooltips.Library.Grid" xml:space="preserve"><value>Cards with thumbnails</value></data>
<data name="Tooltips.Library.ImportCard" xml:space="preserve"><value>Copy and verify photos from a memory card</value></data>
<data name="Tooltips.Library.List" xml:space="preserve"><value>Table with sortable columns</value></data>
<data name="Tooltips.Library.Mass.Analyse.one" xml:space="preserve"><value>Deep analysis of {0:N0} sequence on this PC · runs as one job</value></data>
<data name="Tooltips.Library.Mass.Analyse.other" xml:space="preserve"><value>Deep analysis of {0:N0} sequences on this PC · runs as one job</value></data>
<data name="Tooltips.Library.Mass.Delete.one" xml:space="preserve"><value>Move {0:N0} sequence to its archive's trash · shows the dry run, then asks you to type to confirm</value></data>
<data name="Tooltips.Library.Mass.Delete.other" xml:space="preserve"><value>Move {0:N0} sequences to their archive's trash · shows the dry run, then asks you to type to confirm</value></data>
<data name="Tooltips.Library.Mass.Download.one" xml:space="preserve"><value>Fetch what {0:N0} sequence lacks here (originals or renders) from the server · runs as a transfer job</value></data>
<data name="Tooltips.Library.Mass.Download.other" xml:space="preserve"><value>Fetch what {0:N0} sequences lack here (originals or renders) from the server · runs as transfer jobs</value></data>
<data name="Tooltips.Library.Mass.ExportList.one" xml:space="preserve"><value>Save {0:N0} row as CSV in a folder you choose</value></data>
<data name="Tooltips.Library.Mass.ExportList.other" xml:space="preserve"><value>Save {0:N0} rows as CSV in a folder you choose</value></data>
<data name="Tooltips.Library.Mass.Move.one" xml:space="preserve"><value>Move {0:N0} sequence into a new folder layout of its archive · shows the dry run first</value></data>
<data name="Tooltips.Library.Mass.Move.other" xml:space="preserve"><value>Move {0:N0} sequences into a new folder layout of their archive · shows the dry run first</value></data>
<data name="Tooltips.Library.Mass.Proxies.one" xml:space="preserve"><value>Build JPEG proxies of {0:N0} sequence · runs as one job</value></data>
<data name="Tooltips.Library.Mass.Proxies.other" xml:space="preserve"><value>Build JPEG proxies of {0:N0} sequences · runs as one job</value></data>
<data name="Tooltips.Library.Mass.Rate.one" xml:space="preserve"><value>Set the rating of {0:N0} sequence, in its sidecar and the index</value></data>
<data name="Tooltips.Library.Mass.Rate.other" xml:space="preserve"><value>Set the rating of {0:N0} sequences, in their sidecars and the index</value></data>
<data name="Tooltips.Library.Mass.Tag.one" xml:space="preserve"><value>Add or remove tags on {0:N0} sequence</value></data>
<data name="Tooltips.Library.Mass.Tag.other" xml:space="preserve"><value>Add or remove tags on {0:N0} sequences</value></data>
<data name="Tooltips.Library.Mass.Upload.one" xml:space="preserve"><value>Send what the server lacks of {0:N0} sequence (originals and settings, or renders) · runs as a transfer job</value></data>
<data name="Tooltips.Library.Mass.Upload.other" xml:space="preserve"><value>Send what the server lacks of {0:N0} sequences (originals and settings, or renders) · runs as transfer jobs</value></data>
<data name="Tooltips.Library.Mass.Verify.one" xml:space="preserve"><value>Re-read {0:N0} sequence and compare every hash with the index · runs as a job</value></data>
<data name="Tooltips.Library.Mass.Verify.other" xml:space="preserve"><value>Re-read {0:N0} sequences and compare every hash with the index · runs as a job per archive</value></data>
<data name="Tooltips.Library.Open" xml:space="preserve"><value>Open in the sequence editor · Enter</value></data>
<data name="Tooltips.Library.OpenArchive" xml:space="preserve"><value>Use an existing archive folder on this PC or the network</value></data>
<data name="Tooltips.Library.Origin" xml:space="preserve"><value>Show the sequences on this PC, only those on the server, or both</value></data>
<data name="Tooltips.Library.Proxies" xml:space="preserve"><value>Build JPEG proxies for fast editing · runs as a job</value></data>
<data name="Tooltips.Library.ProxiesAll" xml:space="preserve"><value>Build proxies of the selected sequences · runs as one job</value></data>
<data name="Tooltips.Library.QuickRender" xml:space="preserve"><value>Queue a render with {0}, this sequence's recommended or default preset · runs as a job</value></data>
<data name="Tooltips.Library.QuickRenderServer" xml:space="preserve"><value>Render with {0} on the server, where the originals are · the server or a render node runs it</value></data>
<data name="Tooltips.Library.QuickSync.DownloadOriginals" xml:space="preserve"><value>Fetch the server's originals this PC lacks, verified by hash · runs as a transfer job</value></data>
<data name="Tooltips.Library.QuickSync.GetExports" xml:space="preserve"><value>Fetch the server's renders this sequence lacks · runs as a transfer job</value></data>
<data name="Tooltips.Library.QuickSync.KeepMine" xml:space="preserve"><value>Settings changed here and on the server; choose what to keep on the Server screen</value></data>
<data name="Tooltips.Library.QuickSync.SendExports" xml:space="preserve"><value>Send the renders of this sequence the server lacks · runs as a transfer job</value></data>
<data name="Tooltips.Library.QuickSync.SyncSettings" xml:space="preserve"><value>Send or take the settings changed on one side</value></data>
<data name="Tooltips.Library.QuickSync.Upload" xml:space="preserve"><value>Send the originals and settings the server lacks · runs as a transfer job</value></data>
<data name="Tooltips.Library.RateChoice" xml:space="preserve"><value>Give the selection this rating</value></data>
<data name="Tooltips.Library.Rescan" xml:space="preserve"><value>Rescan the archive for changes · runs as a job</value></data>
<data name="Tooltips.Library.Row" xml:space="preserve"><value>Click selects · double-click opens</value></data>
<data name="Tooltips.Library.Search" xml:space="preserve"><value>Search titles, camera makes and models, and tags as you type</value></data>
@@ -337,8 +375,21 @@
<data name="Tooltips.Library.Status.Warnings.one" xml:space="preserve"><value>{0:N0} warning; open the sequence for details</value></data>
<data name="Tooltips.Library.Status.Warnings.other" xml:space="preserve"><value>{0:N0} warnings; open the sequence for details</value></data>
<data name="Tooltips.Library.Tags" xml:space="preserve"><value>Show only one tag</value></data>
<data name="Tooltips.Library.Timeline" xml:space="preserve"><value>Year bands with photos per month above the cards</value></data>
<data name="Tooltips.Library.TimelineBands" xml:space="preserve"><value>Click a month to show its year and scroll to its sequences</value></data>
<data name="Tooltips.Library.Verify" xml:space="preserve"><value>Re-read every file and compare its hash with the index · runs as a job</value></data>
<data name="Tooltips.Library.VerifyAll" xml:space="preserve"><value>Verify the hashes of the selected sequences · runs as one job</value></data>
<data name="Tooltips.Library.ViewChoice" xml:space="preserve"><value>Show the search, filters and sort saved under this name</value></data>
<data name="Tooltips.Library.ViewDelete" xml:space="preserve"><value>Forget the saved view on screen; no sequence is touched</value></data>
<data name="Tooltips.Library.ViewName" xml:space="preserve"><value>A short name, such as "Night, 4K, not analysed"</value></data>
<data name="Tooltips.Library.ViewRename" xml:space="preserve"><value>Give the saved view on screen another name</value></data>
<data name="Tooltips.Library.ViewRenameApply" xml:space="preserve"><value>Rename the view · Enter</value></data>
<data name="Tooltips.Library.ViewSave" xml:space="preserve"><value>Save the search, filters and sort on screen as a named view</value></data>
<data name="Tooltips.Library.ViewSaveApply" xml:space="preserve"><value>Save the view · Enter</value></data>
<data name="Tooltips.Library.ViewUndo" xml:space="preserve"><value>Save the deleted view again</value></data>
<data name="Tooltips.Library.Views" xml:space="preserve"><value>Saved views: show one, or save the filters on screen</value></data>
<data name="Tooltips.Library.ViewsActive" xml:space="preserve"><value>Saved view on screen: {0}</value></data>
<data name="Tooltips.Library.ViewsApply" xml:space="preserve"><value>Choose a saved view to show</value></data>
<data name="Tooltips.Library.Year" xml:space="preserve"><value>Show only one year of first capture</value></data>
<data name="Tooltips.Nav.About" xml:space="preserve"><value>Version, diagnostics and links</value></data>
<data name="Tooltips.Nav.Archive" xml:space="preserve"><value>Scan, verify and maintain the archive · Ctrl+4</value></data>
+35
View File
@@ -31,7 +31,30 @@
<data name="Archive.Confirm.RemoveHeading" xml:space="preserve"><value>Rimuovere {0} dall'indice?</value></data>
<data name="Archive.Confirm.RemoveMessage" xml:space="preserve"><value>Il suo sidecar non c'è più. Viene rimossa solo la riga dell'indice; nessun file viene eliminato.</value></data>
<data name="Archive.Copy.Title" xml:space="preserve"><value>Cartella da copiare nell'archivio</value></data>
<data name="Archive.Delete.Action" xml:space="preserve"><value>Sposta nel cestino</value></data>
<data name="Archive.Delete.Blocked" xml:space="preserve"><value>Non spostata: {0} · {1}</value></data>
<data name="Archive.Delete.Done.one" xml:space="preserve"><value>{0:N0} sequenza spostata nel cestino</value></data>
<data name="Archive.Delete.Done.other" xml:space="preserve"><value>{0:N0} sequenze spostate nel cestino</value></data>
<data name="Archive.Delete.Failed" xml:space="preserve"><value>Impossibile spostare le sequenze nel cestino</value></data>
<data name="Archive.Delete.Files.one" xml:space="preserve"><value>{0:N0} file</value></data>
<data name="Archive.Delete.Files.other" xml:space="preserve"><value>{0:N0} file</value></data>
<data name="Archive.Delete.Heading.one" xml:space="preserve"><value>Spostare {0:N0} sequenza nel cestino?</value></data>
<data name="Archive.Delete.Heading.other" xml:space="preserve"><value>Spostare {0:N0} sequenze nel cestino?</value></data>
<data name="Archive.Delete.Keep" xml:space="preserve"><value>Mantieni</value></data>
<data name="Archive.Delete.Kept" xml:space="preserve"><value>Restano nel cestino dell'archivio, ripristinabili da Manutenzione.</value></data>
<data name="Archive.Delete.Message" xml:space="preserve"><value>{0} e {1} ({2}) escono dalla libreria e vanno nel cestino dell'archivio; non viene cancellato nulla.</value></data>
<data name="Archive.Delete.More.one" xml:space="preserve"><value>+ {0:N0} altra</value></data>
<data name="Archive.Delete.More.other" xml:space="preserve"><value>+ altre {0:N0}</value></data>
<data name="Archive.Delete.Nothing" xml:space="preserve"><value>Niente può andare nel cestino</value></data>
<data name="Archive.Delete.Reason.ArchiveRoot" xml:space="preserve"><value>le sue foto sono la radice dell'archivio</value></data>
<data name="Archive.Delete.Reason.Busy" xml:space="preserve"><value>un'attività ci sta lavorando</value></data>
<data name="Archive.Delete.Reason.ContainsSequences" xml:space="preserve"><value>altre sequenze stanno nella sua cartella</value></data>
<data name="Archive.Delete.Reason.ForeignSidecar" xml:space="preserve"><value>la sua cartella contiene un'altra sequenza; prima esegui una scansione</value></data>
<data name="Archive.Delete.Reason.Offline" xml:space="preserve"><value>l'archivio non è raggiungibile o è di sola lettura</value></data>
<data name="Archive.Delete.Type" xml:space="preserve"><value>Digita {0} per confermare</value></data>
<data name="Archive.Delete.Undo" xml:space="preserve"><value>Annulla</value></data>
<data name="Archive.Dialog.Cancel" xml:space="preserve"><value>Annulla</value></data>
<data name="Archive.Dialog.Close" xml:space="preserve"><value>Chiudi</value></data>
<data name="Archive.Duplicates.Copies.one" xml:space="preserve"><value>{0:N0} copia</value></data>
<data name="Archive.Duplicates.Copies.other" xml:space="preserve"><value>{0:N0} copie</value></data>
<data name="Archive.Duplicates.Folder" xml:space="preserve"><value>Cartella</value></data>
@@ -94,6 +117,7 @@
<data name="Archive.Maintenance.Proxies" xml:space="preserve"><value>Ricrea proxy</value></data>
<data name="Archive.Maintenance.Relink" xml:space="preserve"><value>Ricollega archivio spostato…</value></data>
<data name="Archive.Maintenance.Run" xml:space="preserve"><value>Esegui manutenzione</value></data>
<data name="Archive.Maintenance.Trash" xml:space="preserve"><value>Cestino…</value></data>
<data name="Archive.Orphans.Count.one" xml:space="preserve"><value>{0:N0} problema</value></data>
<data name="Archive.Orphans.Count.other" xml:space="preserve"><value>{0:N0} problemi</value></data>
<data name="Archive.Orphans.Failed" xml:space="preserve"><value>Ricerca degli orfani interrotta</value></data>
@@ -148,6 +172,7 @@
<data name="Archive.Set.All.other" xml:space="preserve"><value>{0:N0} sequenze · tutte</value></data>
<data name="Archive.Set.Analyse" xml:space="preserve"><value>Analizza</value></data>
<data name="Archive.Set.ClearFilter" xml:space="preserve"><value>Togli filtro</value></data>
<data name="Archive.Set.Delete" xml:space="preserve"><value>Elimina…</value></data>
<data name="Archive.Set.Export" xml:space="preserve"><value>Esporta CSV</value></data>
<data name="Archive.Set.Filter" xml:space="preserve"><value>Filtro selezione</value></data>
<data name="Archive.Set.Label" xml:space="preserve"><value>Selezione</value></data>
@@ -176,6 +201,16 @@
<data name="Archive.Toolbar.Rebuild" xml:space="preserve"><value>Ricostruisci indice…</value></data>
<data name="Archive.Toolbar.Scan" xml:space="preserve"><value>Scansiona</value></data>
<data name="Archive.Toolbar.Verify" xml:space="preserve"><value>Verifica</value></data>
<data name="Archive.Trash.Deleted" xml:space="preserve"><value>Eliminata il {0}</value></data>
<data name="Archive.Trash.Empty" xml:space="preserve"><value>Il cestino è vuoto</value></data>
<data name="Archive.Trash.Failed" xml:space="preserve"><value>Impossibile ripristinare la sequenza dal cestino</value></data>
<data name="Archive.Trash.Heading" xml:space="preserve"><value>Cestino · {0}</value></data>
<data name="Archive.Trash.List" xml:space="preserve"><value>Sequenze eliminate</value></data>
<data name="Archive.Trash.Reading" xml:space="preserve"><value>Lettura del cestino…</value></data>
<data name="Archive.Trash.Restore" xml:space="preserve"><value>Ripristina</value></data>
<data name="Archive.Trash.Restored.one" xml:space="preserve"><value>{0:N0} sequenza ripristinata</value></data>
<data name="Archive.Trash.Restored.other" xml:space="preserve"><value>{0:N0} sequenze ripristinate</value></data>
<data name="Archive.Trash.Restoring" xml:space="preserve"><value>Ripristino di {0}…</value></data>
<data name="Archive.Tree.Name" xml:space="preserve"><value>Albero dell'archivio</value></data>
<data name="Archive.Tree.Undated" xml:space="preserve"><value>Senza data</value></data>
<data name="Archive.View.Maintenance" xml:space="preserve"><value>Manutenzione</value></data>
+49
View File
@@ -6,12 +6,32 @@
<resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader>
<data name="Library.Action.Analyse" xml:space="preserve"><value>Analizza</value></data>
<data name="Library.Action.ClearSelection" xml:space="preserve"><value>Deseleziona tutto</value></data>
<data name="Library.Action.Delete" xml:space="preserve"><value>Elimina…</value></data>
<data name="Library.Action.Download" xml:space="preserve"><value>Scarica</value></data>
<data name="Library.Action.ExportList" xml:space="preserve"><value>Esporta elenco</value></data>
<data name="Library.Action.Folder" xml:space="preserve"><value>Cartella</value></data>
<data name="Library.Action.Move" xml:space="preserve"><value>Sposta…</value></data>
<data name="Library.Action.Open" xml:space="preserve"><value>Apri</value></data>
<data name="Library.Action.Proxies" xml:space="preserve"><value>Proxy</value></data>
<data name="Library.Action.Rate" xml:space="preserve"><value>Voto</value></data>
<data name="Library.Action.Render" xml:space="preserve"><value>Renderizza</value></data>
<data name="Library.Action.Sync" xml:space="preserve"><value>Sincronizza</value></data>
<data name="Library.Action.Tag" xml:space="preserve"><value>Tag…</value></data>
<data name="Library.Action.Upload" xml:space="preserve"><value>Carica</value></data>
<data name="Library.Action.Verify" xml:space="preserve"><value>Verifica</value></data>
<data name="Library.Adopt.Title" xml:space="preserve"><value>Adotta una cartella</value></data>
<data name="Library.Blocked.Archives" xml:space="preserve"><value>Lo spostamento agisce sulle sequenze di un solo archivio alla volta.</value></data>
<data name="Library.Blocked.InSync" xml:space="preserve"><value>Uguale su questo PC e sul server: niente da sincronizzare.</value></data>
<data name="Library.Blocked.NoDownloadRight" xml:space="preserve"><value>Il tuo account sul server non può scaricare gli originali.</value></data>
<data name="Library.Blocked.NoIndex" xml:space="preserve"><value>L'indice della libreria non è aperto.</value></data>
<data name="Library.Blocked.NoSelection" xml:space="preserve"><value>Prima seleziona una o più sequenze.</value></data>
<data name="Library.Blocked.NoSyncRight" xml:space="preserve"><value>Il tuo account sul server non può modificare questa sequenza.</value></data>
<data name="Library.Blocked.NoUploadRight" xml:space="preserve"><value>Il tuo account sul server non può caricare.</value></data>
<data name="Library.Blocked.NotConnected" xml:space="preserve"><value>Prima accedi a un Titano Server, nella schermata Server.</value></data>
<data name="Library.Blocked.NothingToDownload" xml:space="preserve"><value>Le sequenze selezionate non hanno nulla da ricevere dal server.</value></data>
<data name="Library.Blocked.NothingToUpload" xml:space="preserve"><value>Il server ha già tutto ciò che contengono le sequenze selezionate.</value></data>
<data name="Library.Blocked.ServerOnly" xml:space="preserve"><value>Solo per sequenze su questo PC; la selezione si trova sul server.</value></data>
<data name="Library.Blocked.Transferring" xml:space="preserve"><value>Un trasferimento di questa sequenza è già in corso.</value></data>
<data name="Library.ClearFilters" xml:space="preserve"><value>Azzera i filtri</value></data>
<data name="Library.Column.Camera" xml:space="preserve"><value>Fotocamera</value></data>
<data name="Library.Column.Date" xml:space="preserve"><value>Data</value></data>
@@ -32,10 +52,14 @@
<data name="Library.Export.Show" xml:space="preserve"><value>Mostra</value></data>
<data name="Library.Export.Title" xml:space="preserve"><value>Esporta l'elenco in</value></data>
<data name="Library.Filter.AnyCamera" xml:space="preserve"><value>Tutte le fotocamere</value></data>
<data name="Library.Filter.AnyOrigin" xml:space="preserve"><value>Questo PC e server</value></data>
<data name="Library.Filter.AnyStatus" xml:space="preserve"><value>Qualsiasi stato</value></data>
<data name="Library.Filter.AnyTag" xml:space="preserve"><value>Tutti i tag</value></data>
<data name="Library.Filter.AnyYear" xml:space="preserve"><value>Tutti gli anni</value></data>
<data name="Library.Filter.Camera" xml:space="preserve"><value>Fotocamera</value></data>
<data name="Library.Filter.Origin" xml:space="preserve"><value>Origine</value></data>
<data name="Library.Filter.Origin.Local" xml:space="preserve"><value>Su questo PC</value></data>
<data name="Library.Filter.Origin.Server" xml:space="preserve"><value>Solo sul server</value></data>
<data name="Library.Filter.Status" xml:space="preserve"><value>Stato</value></data>
<data name="Library.Filter.Status.Analysed" xml:space="preserve"><value>Analizzate</value></data>
<data name="Library.Filter.Status.NoProxies" xml:space="preserve"><value>Senza proxy</value></data>
@@ -48,7 +72,13 @@
<data name="Library.Filter.Year" xml:space="preserve"><value>Anno</value></data>
<data name="Library.Interval" xml:space="preserve"><value>{0} s</value></data>
<data name="Library.NoMatch" xml:space="preserve"><value>Nessuna sequenza corrisponde</value></data>
<data name="Library.Post.Failed" xml:space="preserve"><value>Il server non ha accettato l'attività</value></data>
<data name="Library.Queued" xml:space="preserve"><value>{0} in coda · {1}</value></data>
<data name="Library.QueuedServer" xml:space="preserve"><value>Inviato al server: {0} · {1}</value></data>
<data name="Library.Rate.Failed" xml:space="preserve"><value>Impossibile salvare il voto</value></data>
<data name="Library.Rate.None" xml:space="preserve"><value>Nessun voto</value></data>
<data name="Library.Rate.Stars.one" xml:space="preserve"><value>{0:N0} stella</value></data>
<data name="Library.Rate.Stars.other" xml:space="preserve"><value>{0:N0} stelle</value></data>
<data name="Library.Rescan" xml:space="preserve"><value>Ripeti scansione</value></data>
<data name="Library.Search" xml:space="preserve"><value>Cerca titolo, fotocamera, tag</value></data>
<data name="Library.Selection.Count.one" xml:space="preserve"><value>{0:N0} selezionata</value></data>
@@ -65,7 +95,26 @@
<data name="Library.Status.Proxies" xml:space="preserve"><value>Proxy</value></data>
<data name="Library.Status.Remote" xml:space="preserve"><value>Remota</value></data>
<data name="Library.Status.Synced" xml:space="preserve"><value>Sincronizzata</value></data>
<data name="Library.Transfers.Queued.one" xml:space="preserve"><value>{0:N0} trasferimento in coda</value></data>
<data name="Library.Transfers.Queued.other" xml:space="preserve"><value>{0:N0} trasferimenti in coda</value></data>
<data name="Library.View" xml:space="preserve"><value>Vista</value></data>
<data name="Library.View.Grid" xml:space="preserve"><value>Griglia</value></data>
<data name="Library.View.List" xml:space="preserve"><value>Elenco</value></data>
<data name="Library.View.Timeline" xml:space="preserve"><value>Cronologia</value></data>
<data name="Library.Views" xml:space="preserve"><value>Viste salvate</value></data>
<data name="Library.Views.Apply" xml:space="preserve"><value>Mostra vista</value></data>
<data name="Library.Views.Delete" xml:space="preserve"><value>Elimina vista</value></data>
<data name="Library.Views.Deleted" xml:space="preserve"><value>Vista {0} eliminata</value></data>
<data name="Library.Views.Error.Empty" xml:space="preserve"><value>Dai un nome alla vista.</value></data>
<data name="Library.Views.Error.Long" xml:space="preserve"><value>Al massimo {0} caratteri, senza caratteri di controllo.</value></data>
<data name="Library.Views.Error.Taken" xml:space="preserve"><value>Un'altra vista ha già questo nome.</value></data>
<data name="Library.Views.Name" xml:space="preserve"><value>Nome</value></data>
<data name="Library.Views.RenameHeading" xml:space="preserve"><value>Rinomina vista</value></data>
<data name="Library.Views.RenameMenu" xml:space="preserve"><value>Rinomina vista…</value></data>
<data name="Library.Views.Renamed" xml:space="preserve"><value>Vista rinominata in {0}</value></data>
<data name="Library.Views.Save" xml:space="preserve"><value>Salva</value></data>
<data name="Library.Views.SaveHeading" xml:space="preserve"><value>Salva vista</value></data>
<data name="Library.Views.SaveMenu" xml:space="preserve"><value>Salva vista…</value></data>
<data name="Library.Views.Saved" xml:space="preserve"><value>Vista {0} salvata</value></data>
<data name="Library.Views.Undo" xml:space="preserve"><value>Annulla</value></data>
</root>
+1 -1
View File
@@ -64,7 +64,7 @@
<data name="Server.Error.RateLimited" xml:space="preserve"><value>Troppi tentativi; attendi un minuto e riprova.</value></data>
<data name="Server.Error.SamePassword" xml:space="preserve"><value>Scegli una password diversa da quella attuale.</value></data>
<data name="Server.Error.Self" xml:space="preserve"><value>Non puoi farlo sul tuo account.</value></data>
<data name="Server.Error.SequenceBusy" xml:space="preserve"><value>Un job sta lavorando su questa sequenza, oppure non può andare nel cestino; riprova quando è libera.</value></data>
<data name="Server.Error.SequenceBusy" xml:space="preserve"><value>Un'attività sta lavorando su questa sequenza, oppure non può andare nel cestino; riprova quando è libera.</value></data>
<data name="Server.Error.SessionExpired" xml:space="preserve"><value>La sessione è scaduta; accedi di nuovo.</value></data>
<data name="Server.Error.SettingLocked" xml:space="preserve"><value>È impostato da una variabile d'ambiente; modificala lì.</value></data>
<data name="Server.Error.SettingsConflict" xml:space="preserve"><value>La sequenza è cambiata sul server; ricaricala e riapplica la modifica.</value></data>
+51
View File
@@ -29,6 +29,11 @@
<data name="Tooltips.Archive.ClearFilter" xml:space="preserve"><value>Mostra di nuovo tutte le sequenze della selezione</value></data>
<data name="Tooltips.Archive.CloseDialog" xml:space="preserve"><value>Chiudi senza modificare nulla · Esc</value></data>
<data name="Tooltips.Archive.Collapse" xml:space="preserve"><value>Nascondi le sequenze di quest'anno</value></data>
<data name="Tooltips.Archive.DeleteAction.one" xml:space="preserve"><value>Sposta {0:N0} sequenza nel cestino; prima digita il numero indicato</value></data>
<data name="Tooltips.Archive.DeleteAction.other" xml:space="preserve"><value>Sposta {0:N0} sequenze nel cestino; prima digita il numero indicato</value></data>
<data name="Tooltips.Archive.DeleteKeep" xml:space="preserve"><value>Non cambiare nulla</value></data>
<data name="Tooltips.Archive.DeletePlan" xml:space="preserve"><value>Cosa va nel cestino dell'archivio e cosa non può spostarsi</value></data>
<data name="Tooltips.Archive.DeleteUndo" xml:space="preserve"><value>Riporta le sequenze dal cestino nelle loro cartelle</value></data>
<data name="Tooltips.Archive.DuplicateFolder" xml:space="preserve"><value>Mostra in Esplora risorse la cartella della prima copia</value></data>
<data name="Tooltips.Archive.DuplicateOpen" xml:space="preserve"><value>Apri nell'editor la sequenza della prima copia</value></data>
<data name="Tooltips.Archive.Duplicates" xml:space="preserve"><value>Trova foto identiche tra le sequenze tramite hash · legge solo l'indice</value></data>
@@ -72,6 +77,7 @@
<data name="Tooltips.Archive.Scan" xml:space="preserve"><value>Scansione incrementale: file nuovi, modificati e rimossi per data e dimensione</value></data>
<data name="Tooltips.Archive.Set" xml:space="preserve"><value>Anni e sequenze selezionati (tutti se nulla è selezionato), ristretti per fotocamera, stato o tag</value></data>
<data name="Tooltips.Archive.SetAnalyse" xml:space="preserve"><value>Esegui l'analisi profonda su ogni sequenza della selezione</value></data>
<data name="Tooltips.Archive.SetDelete" xml:space="preserve"><value>Sposta la selezione nel cestino dell'archivio · mostra prima la simulazione, poi chiede di digitare per confermare</value></data>
<data name="Tooltips.Archive.SetExport" xml:space="preserve"><value>Esporta la selezione in CSV: una riga per sequenza</value></data>
<data name="Tooltips.Archive.SetMove" xml:space="preserve"><value>Sposta la selezione in una nuova struttura di cartelle · prima la simulazione</value></data>
<data name="Tooltips.Archive.SetProxies" xml:space="preserve"><value>Crea o aggiorna i proxy</value></data>
@@ -84,6 +90,8 @@
<data name="Tooltips.Archive.TagsAdd" xml:space="preserve"><value>Tag da aggiungere, separati da virgole</value></data>
<data name="Tooltips.Archive.TagsRemove" xml:space="preserve"><value>Tag da rimuovere, separati da virgole</value></data>
<data name="Tooltips.Archive.TitleTemplate" xml:space="preserve"><value>Modello del titolo; il segnaposto title è il titolo attuale · controllato mentre scrivi</value></data>
<data name="Tooltips.Archive.Trash" xml:space="preserve"><value>Le sequenze eliminate da questo archivio, ognuna ripristinabile</value></data>
<data name="Tooltips.Archive.TrashRestore" xml:space="preserve"><value>Riporta questa sequenza nella sua cartella e nella libreria, con impostazioni e render</value></data>
<data name="Tooltips.Archive.Verify" xml:space="preserve"><value>Ricalcola l'hash di ogni originale e segnala i danni · legge tutto l'archivio</value></data>
<data name="Tooltips.Archive.YearRow" xml:space="preserve"><value>{0} · Freccia destra apre l'anno, freccia sinistra lo chiude</value></data>
<data name="Tooltips.Common.Dismiss" xml:space="preserve"><value>Chiudi</value></data>
@@ -306,10 +314,40 @@
<data name="Tooltips.Library.Grid" xml:space="preserve"><value>Schede con miniature</value></data>
<data name="Tooltips.Library.ImportCard" xml:space="preserve"><value>Copia e verifica le foto da una scheda di memoria</value></data>
<data name="Tooltips.Library.List" xml:space="preserve"><value>Tabella con colonne ordinabili</value></data>
<data name="Tooltips.Library.Mass.Analyse.one" xml:space="preserve"><value>Analisi approfondita di {0:N0} sequenza su questo PC · un'unica attività</value></data>
<data name="Tooltips.Library.Mass.Analyse.other" xml:space="preserve"><value>Analisi approfondita di {0:N0} sequenze su questo PC · un'unica attività</value></data>
<data name="Tooltips.Library.Mass.Delete.one" xml:space="preserve"><value>Sposta {0:N0} sequenza nel cestino del suo archivio · mostra prima la simulazione, poi chiede di digitare per confermare</value></data>
<data name="Tooltips.Library.Mass.Delete.other" xml:space="preserve"><value>Sposta {0:N0} sequenze nel cestino del loro archivio · mostra prima la simulazione, poi chiede di digitare per confermare</value></data>
<data name="Tooltips.Library.Mass.Download.one" xml:space="preserve"><value>Ricevi dal server ciò che manca qui a {0:N0} sequenza (originali o render) · come attività di trasferimento</value></data>
<data name="Tooltips.Library.Mass.Download.other" xml:space="preserve"><value>Ricevi dal server ciò che manca qui a {0:N0} sequenze (originali o render) · come attività di trasferimento</value></data>
<data name="Tooltips.Library.Mass.ExportList.one" xml:space="preserve"><value>Salva {0:N0} riga come CSV in una cartella a tua scelta</value></data>
<data name="Tooltips.Library.Mass.ExportList.other" xml:space="preserve"><value>Salva {0:N0} righe come CSV in una cartella a tua scelta</value></data>
<data name="Tooltips.Library.Mass.Move.one" xml:space="preserve"><value>Sposta {0:N0} sequenza in una nuova struttura di cartelle del suo archivio · prima la simulazione</value></data>
<data name="Tooltips.Library.Mass.Move.other" xml:space="preserve"><value>Sposta {0:N0} sequenze in una nuova struttura di cartelle del loro archivio · prima la simulazione</value></data>
<data name="Tooltips.Library.Mass.Proxies.one" xml:space="preserve"><value>Crea i proxy JPEG di {0:N0} sequenza · un'unica attività</value></data>
<data name="Tooltips.Library.Mass.Proxies.other" xml:space="preserve"><value>Crea i proxy JPEG di {0:N0} sequenze · un'unica attività</value></data>
<data name="Tooltips.Library.Mass.Rate.one" xml:space="preserve"><value>Imposta il voto di {0:N0} sequenza, nel sidecar e nell'indice</value></data>
<data name="Tooltips.Library.Mass.Rate.other" xml:space="preserve"><value>Imposta il voto di {0:N0} sequenze, nei sidecar e nell'indice</value></data>
<data name="Tooltips.Library.Mass.Tag.one" xml:space="preserve"><value>Aggiungi o rimuovi tag su {0:N0} sequenza</value></data>
<data name="Tooltips.Library.Mass.Tag.other" xml:space="preserve"><value>Aggiungi o rimuovi tag su {0:N0} sequenze</value></data>
<data name="Tooltips.Library.Mass.Upload.one" xml:space="preserve"><value>Invia ciò che manca al server di {0:N0} sequenza (originali e impostazioni, o render) · come attività di trasferimento</value></data>
<data name="Tooltips.Library.Mass.Upload.other" xml:space="preserve"><value>Invia ciò che manca al server di {0:N0} sequenze (originali e impostazioni, o render) · come attività di trasferimento</value></data>
<data name="Tooltips.Library.Mass.Verify.one" xml:space="preserve"><value>Rileggi {0:N0} sequenza e confronta ogni hash con l'indice · come attività</value></data>
<data name="Tooltips.Library.Mass.Verify.other" xml:space="preserve"><value>Rileggi {0:N0} sequenze e confronta ogni hash con l'indice · un'attività per archivio</value></data>
<data name="Tooltips.Library.Open" xml:space="preserve"><value>Apre nell'editor della sequenza · Invio</value></data>
<data name="Tooltips.Library.OpenArchive" xml:space="preserve"><value>Usa una cartella archivio esistente su questo PC o in rete</value></data>
<data name="Tooltips.Library.Origin" xml:space="preserve"><value>Mostra le sequenze su questo PC, solo quelle sul server o entrambe</value></data>
<data name="Tooltips.Library.Proxies" xml:space="preserve"><value>Crea proxy JPEG per una modifica veloce · viene eseguita come attività</value></data>
<data name="Tooltips.Library.ProxiesAll" xml:space="preserve"><value>Crea i proxy delle sequenze selezionate · un'unica attività</value></data>
<data name="Tooltips.Library.QuickRender" xml:space="preserve"><value>Metti in coda un render con {0}, il preset consigliato o predefinito della sequenza · come attività</value></data>
<data name="Tooltips.Library.QuickRenderServer" xml:space="preserve"><value>Renderizza con {0} sul server, dove sono gli originali · lo esegue il server o un nodo di render</value></data>
<data name="Tooltips.Library.QuickSync.DownloadOriginals" xml:space="preserve"><value>Scarica gli originali del server che mancano su questo PC, verificati con l'hash · come attività di trasferimento</value></data>
<data name="Tooltips.Library.QuickSync.GetExports" xml:space="preserve"><value>Ricevi i render del server che mancano a questa sequenza · come attività di trasferimento</value></data>
<data name="Tooltips.Library.QuickSync.KeepMine" xml:space="preserve"><value>Impostazioni cambiate qui e sul server; scegli cosa tenere nella schermata Server</value></data>
<data name="Tooltips.Library.QuickSync.SendExports" xml:space="preserve"><value>Invia i render di questa sequenza che mancano al server · come attività di trasferimento</value></data>
<data name="Tooltips.Library.QuickSync.SyncSettings" xml:space="preserve"><value>Invia o ricevi le impostazioni cambiate da una sola parte</value></data>
<data name="Tooltips.Library.QuickSync.Upload" xml:space="preserve"><value>Invia gli originali e le impostazioni che mancano al server · come attività di trasferimento</value></data>
<data name="Tooltips.Library.RateChoice" xml:space="preserve"><value>Assegna questo voto alla selezione</value></data>
<data name="Tooltips.Library.Rescan" xml:space="preserve"><value>Ripete la scansione dell'archivio per trovare modifiche · viene eseguita come attività</value></data>
<data name="Tooltips.Library.Row" xml:space="preserve"><value>Clic seleziona · doppio clic apre</value></data>
<data name="Tooltips.Library.Search" xml:space="preserve"><value>Cerca titoli, marche e modelli di fotocamera e tag mentre scrivi</value></data>
@@ -337,8 +375,21 @@
<data name="Tooltips.Library.Status.Warnings.one" xml:space="preserve"><value>{0:N0} avviso; apri la sequenza per i dettagli</value></data>
<data name="Tooltips.Library.Status.Warnings.other" xml:space="preserve"><value>{0:N0} avvisi; apri la sequenza per i dettagli</value></data>
<data name="Tooltips.Library.Tags" xml:space="preserve"><value>Mostra un solo tag</value></data>
<data name="Tooltips.Library.Timeline" xml:space="preserve"><value>Fasce per anno con le foto di ogni mese sopra le schede</value></data>
<data name="Tooltips.Library.TimelineBands" xml:space="preserve"><value>Fai clic su un mese per mostrarne l'anno e scorrere alle sue sequenze</value></data>
<data name="Tooltips.Library.Verify" xml:space="preserve"><value>Rilegge ogni file e ne confronta l'hash con l'indice · viene eseguita come attività</value></data>
<data name="Tooltips.Library.VerifyAll" xml:space="preserve"><value>Verifica gli hash delle sequenze selezionate · un'unica attività</value></data>
<data name="Tooltips.Library.ViewChoice" xml:space="preserve"><value>Mostra la ricerca, i filtri e l'ordinamento salvati con questo nome</value></data>
<data name="Tooltips.Library.ViewDelete" xml:space="preserve"><value>Dimentica la vista salvata sullo schermo; nessuna sequenza viene toccata</value></data>
<data name="Tooltips.Library.ViewName" xml:space="preserve"><value>Un nome breve, ad esempio "Notte, 4K, non analizzate"</value></data>
<data name="Tooltips.Library.ViewRename" xml:space="preserve"><value>Dai un altro nome alla vista salvata sullo schermo</value></data>
<data name="Tooltips.Library.ViewRenameApply" xml:space="preserve"><value>Rinomina la vista · Invio</value></data>
<data name="Tooltips.Library.ViewSave" xml:space="preserve"><value>Salva ricerca, filtri e ordinamento sullo schermo come vista con nome</value></data>
<data name="Tooltips.Library.ViewSaveApply" xml:space="preserve"><value>Salva la vista · Invio</value></data>
<data name="Tooltips.Library.ViewUndo" xml:space="preserve"><value>Salva di nuovo la vista eliminata</value></data>
<data name="Tooltips.Library.Views" xml:space="preserve"><value>Viste salvate: mostrane una o salva i filtri sullo schermo</value></data>
<data name="Tooltips.Library.ViewsActive" xml:space="preserve"><value>Vista salvata sullo schermo: {0}</value></data>
<data name="Tooltips.Library.ViewsApply" xml:space="preserve"><value>Scegli una vista salvata da mostrare</value></data>
<data name="Tooltips.Library.Year" xml:space="preserve"><value>Mostra un solo anno del primo scatto</value></data>
<data name="Tooltips.Nav.About" xml:space="preserve"><value>Versione, diagnostica e collegamenti</value></data>
<data name="Tooltips.Nav.Archive" xml:space="preserve"><value>Scansiona, verifica e gestisci l'archivio · Ctrl+4</value></data>
+177
View File
@@ -0,0 +1,177 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ui="clr-namespace:Titano.Ui.Controls;assembly=Titano.Ui"
xmlns:l="clr-namespace:Titano.Ui.Localization;assembly=Titano.Ui"
xmlns:ar="clr-namespace:Titano.App.Archiving"
xmlns:shell="clr-namespace:Titano.App.Shell">
<!-- In-window dialogs of the archive engine's operations, shared by the Archive manager and the Library. -->
<!-- Rows that only show text: focusable, so the arrow keys move through a long list. -->
<Style x:Key="ListBoxItem.Preview" TargetType="ListBoxItem" BasedOn="{StaticResource ListBoxItem.Row}">
<Setter Property="Padding" Value="0" />
<Setter Property="AutomationProperties.Name" Value="{Binding To}" />
</Style>
<!-- Dialog card (DESIGN §4: Surface, Stroke, radius 12, 24 px shadow, two buttons). -->
<Style x:Key="Border.Dialog" TargetType="Border">
<Setter Property="Background" Value="{DynamicResource Brush.Surface}" />
<Setter Property="BorderBrush" Value="{DynamicResource Brush.Stroke}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="CornerRadius" Value="{StaticResource Radius.Dialog}" />
<Setter Property="Padding" Value="24,18,24,20" />
<Setter Property="Effect" Value="{StaticResource Shadow.Popup}" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<DataTemplate DataType="{x:Type ar:RebuildDialogViewModel}">
<Border Style="{StaticResource Border.Dialog}" Width="520">
<StackPanel>
<TextBlock Text="{l:Loc Archive.Rebuild.Heading}" Style="{StaticResource Text.Title}" />
<ItemsControl ItemsSource="{Binding FactRows}" Focusable="False" Margin="0,14,0,0">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type ar:DialogFact}">
<Grid Margin="0,0,0,8">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="{StaticResource Grid.LabelColumn}" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Label}" Style="{StaticResource Text.Label}" />
<TextBlock Grid.Column="1" Text="{Binding Value}" TextTrimming="CharacterEllipsis" ToolTip="{Binding Value}" Typography.NumeralAlignment="Tabular" />
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<TextBlock Text="{Binding BusyText}" Foreground="{DynamicResource Brush.TextMuted}" Visibility="{Binding BusyText, Converter={x:Static ui:NullToCollapsedConverter.Instance}}" />
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,18,0,0">
<Button Content="{l:Loc Archive.Dialog.Cancel}" Command="{Binding CloseCommand}" ToolTip="{Binding CloseToolTip}" IsDefault="True" IsCancel="True"
MinWidth="96" />
<Button Style="{StaticResource Button.Primary}" Content="{l:Loc Archive.Rebuild.Start}" Command="{Binding RebuildCommand}" ToolTip="{Binding RebuildToolTip}"
MinWidth="96" Margin="8,0,0,0" />
</StackPanel>
</StackPanel>
</Border>
</DataTemplate>
<DataTemplate DataType="{x:Type ar:RenameDialogViewModel}">
<Border Style="{StaticResource Border.Dialog}" Width="720" MaxHeight="560">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Text="{Binding Heading}" Style="{StaticResource Text.Title}" />
<Grid Grid.Row="1" Margin="0,14,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="{StaticResource Grid.LabelColumn}" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Text="{l:Loc Archive.Rename.Template}" Style="{StaticResource Text.Label}" />
<TextBox Grid.Column="1" Style="{StaticResource TextBox.Mono}" Text="{Binding Template.Text, UpdateSourceTrigger=PropertyChanged, ValidatesOnNotifyDataErrors=True}"
shell:EditBehavior.Field="{Binding Template}" ToolTip="{Binding Template.ToolTip}" AutomationProperties.Name="{l:Loc Archive.Rename.Template}" />
</Grid>
<TextBlock Grid.Row="2" Text="{Binding SummaryText}" Foreground="{DynamicResource Brush.TextMuted}" Margin="0,12,0,6" Typography.NumeralAlignment="Tabular" />
<ListBox Grid.Row="3" ItemsSource="{Binding Rows}" ItemContainerStyle="{StaticResource ListBoxItem.Preview}" MinHeight="120"
AutomationProperties.Name="{l:Loc Archive.Rename.Preview}">
<ListBox.ItemTemplate>
<DataTemplate DataType="{x:Type ar:RenameRow}">
<Grid Height="30" TextElement.FontSize="12">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" MinWidth="120" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" MinWidth="120" />
</Grid.ColumnDefinitions>
<TextBlock Style="{StaticResource Text.Cell}" Text="{Binding From}" Foreground="{DynamicResource Brush.TextMuted}" ToolTip="{Binding From}" />
<ui:Icon Grid.Column="1" Glyph="{StaticResource Icon.Forward}" Margin="10,0" Foreground="{DynamicResource Brush.TextFaint}" />
<TextBlock Grid.Column="2" Style="{StaticResource Text.Cell}" Text="{Binding To}" ToolTip="{Binding To}" />
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<DockPanel Grid.Row="4" Margin="0,16,0,0">
<Button DockPanel.Dock="Right" Style="{StaticResource Button.Primary}" Content="{l:Loc Archive.Rename.Apply}" Command="{Binding ApplyCommand}"
ToolTip="{Binding ApplyToolTip}" MinWidth="96" Margin="8,0,0,0" />
<Button DockPanel.Dock="Right" Content="{l:Loc Archive.Dialog.Cancel}" Command="{Binding CloseCommand}" ToolTip="{Binding CloseToolTip}" IsCancel="True"
MinWidth="96" />
<TextBlock Text="{Binding BusyText}" Foreground="{DynamicResource Brush.TextMuted}" VerticalAlignment="Center" TextTrimming="CharacterEllipsis" />
</DockPanel>
</Grid>
</Border>
</DataTemplate>
<DataTemplate DataType="{x:Type ar:RetagDialogViewModel}">
<Border Style="{StaticResource Border.Dialog}" Width="520">
<StackPanel>
<TextBlock Text="{Binding Heading}" Style="{StaticResource Text.Title}" />
<Grid Margin="0,14,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="{StaticResource Grid.LabelColumn}" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Text="{l:Loc Archive.Retag.Add}" Style="{StaticResource Text.Label}" />
<TextBox Grid.Column="1" Text="{Binding Add.Text, UpdateSourceTrigger=PropertyChanged, ValidatesOnNotifyDataErrors=True}" shell:EditBehavior.Field="{Binding Add}"
ToolTip="{Binding Add.ToolTip}" AutomationProperties.Name="{l:Loc Archive.Retag.Add}" />
<TextBlock Grid.Row="1" Text="{l:Loc Archive.Retag.Remove}" Style="{StaticResource Text.Label}" Margin="0,10,14,0" />
<TextBox Grid.Row="1" Grid.Column="1" Margin="0,10,0,0" Text="{Binding Remove.Text, UpdateSourceTrigger=PropertyChanged, ValidatesOnNotifyDataErrors=True}"
shell:EditBehavior.Field="{Binding Remove}" ToolTip="{Binding Remove.ToolTip}" AutomationProperties.Name="{l:Loc Archive.Retag.Remove}" />
</Grid>
<TextBlock Text="{Binding SummaryText}" Foreground="{DynamicResource Brush.TextMuted}" Margin="0,12,0,0" Typography.NumeralAlignment="Tabular" />
<DockPanel Margin="0,18,0,0">
<Button DockPanel.Dock="Right" Style="{StaticResource Button.Primary}" Content="{l:Loc Archive.Retag.Apply}" Command="{Binding ApplyCommand}"
ToolTip="{Binding ApplyToolTip}" MinWidth="96" Margin="8,0,0,0" />
<Button DockPanel.Dock="Right" Content="{l:Loc Archive.Dialog.Cancel}" Command="{Binding CloseCommand}" ToolTip="{Binding CloseToolTip}" IsCancel="True"
MinWidth="96" />
<TextBlock Text="{Binding BusyText}" Foreground="{DynamicResource Brush.TextMuted}" VerticalAlignment="Center" TextTrimming="CharacterEllipsis" />
</DockPanel>
</StackPanel>
</Border>
</DataTemplate>
<!-- The archive's trash: deleted sequences, newest first, each with Restore. -->
<DataTemplate DataType="{x:Type ar:TrashDialogViewModel}">
<Border Style="{StaticResource Border.Dialog}" Width="640" MaxHeight="520">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Text="{Binding Heading}" Style="{StaticResource Text.Title}" TextTrimming="CharacterEllipsis" />
<TextBlock Grid.Row="1" Text="{Binding SummaryText}" Foreground="{DynamicResource Brush.TextMuted}" Margin="0,8,0,8" Typography.NumeralAlignment="Tabular" />
<ListBox Grid.Row="2" ItemsSource="{Binding Rows}" MinHeight="120" AutomationProperties.Name="{l:Loc Archive.Trash.List}" KeyboardNavigation.TabNavigation="Continue">
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem" BasedOn="{StaticResource ListBoxItem.PlainRow}">
<Setter Property="AutomationProperties.Name" Value="{Binding Title}" />
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
<DataTemplate DataType="{x:Type ar:TrashRowViewModel}">
<DockPanel Height="48">
<Button DockPanel.Dock="Right" Style="{StaticResource Button.Row}" Content="{l:Loc Archive.Trash.Restore}" Command="{Binding RestoreCommand}"
ToolTip="{l:Loc Tooltips.Archive.TrashRestore}" />
<TextBlock DockPanel.Dock="Right" Text="{Binding DeletedText}" Style="{StaticResource Text.Secondary}" VerticalAlignment="Center" Margin="12,0"
Typography.NumeralAlignment="Tabular" />
<StackPanel VerticalAlignment="Center">
<TextBlock Text="{Binding Title}" FontWeight="SemiBold" TextTrimming="CharacterEllipsis" ToolTip="{Binding Title}" />
<TextBlock Text="{Binding Detail}" Style="{StaticResource Text.Secondary}" TextTrimming="CharacterEllipsis" ToolTip="{Binding Detail}"
Typography.NumeralAlignment="Tabular" />
</StackPanel>
</DockPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<DockPanel Grid.Row="3" Margin="0,16,0,0">
<Button DockPanel.Dock="Right" Content="{l:Loc Archive.Dialog.Close}" Command="{Binding CloseCommand}" ToolTip="{Binding CloseToolTip}" IsCancel="True"
IsDefault="True" MinWidth="96" />
<TextBlock Text="{Binding BusyText}" Foreground="{DynamicResource Brush.TextMuted}" VerticalAlignment="Center" TextTrimming="CharacterEllipsis" />
</DockPanel>
</Grid>
</Border>
</DataTemplate>
</ResourceDictionary>
+47
View File
@@ -0,0 +1,47 @@
using System.Globalization;
using Titano.App.Infrastructure;
using Titano.Core.Localization;
using Titano.Data.Archiving;
namespace Titano.App.Archiving;
/// <summary>The words of a delete dry run (<see cref="DeletePlan"/>): the destructive confirmation and the lines of what cannot move.</summary>
public static class DeletePlans
{
/// <summary>Sequences named one by one in the confirmation; the rest are counted.</summary>
public const int ListedLines = 8;
/// <summary>The destructive confirmation of a plan; null when nothing in it can move.</summary>
public static ConfirmRequest? Request(DeletePlan plan)
{
if (plan.Steps.Count == 0) return null;
var count = plan.Steps.Count.ToString(CultureInfo.InvariantCulture);
var lines = plan.Steps.Take(ListedLines).Select(s => Loc.L("Archive.Delete.Line", s.Sequence.DisplayTitle,
Loc.Plural("Shell.Status.Photos", s.Sequence.FrameCount), Formatting.Bytes(s.Bytes))).ToList();
if (plan.Steps.Count > ListedLines) lines.Add(Loc.Plural("Archive.Delete.More", plan.Steps.Count - ListedLines));
lines.AddRange(Blocked(plan, ListedLines));
return new ConfirmRequest
{
Heading = Loc.Plural("Archive.Delete.Heading", plan.Steps.Count),
Message = Loc.L("Archive.Delete.Message", Loc.Plural("Shell.Status.Photos", plan.Frames), Loc.Plural("Archive.Delete.Files", plan.Files),
Formatting.Bytes(plan.Bytes)),
Detail = string.Join(Environment.NewLine, lines),
DetailToolTip = Loc.L("Tooltips.Archive.DeletePlan"),
SafeText = Loc.L("Archive.Delete.Keep"),
SafeToolTip = Loc.L("Tooltips.Archive.DeleteKeep"),
ActionText = Loc.L("Archive.Delete.Action"),
ActionToolTip = Loc.Plural("Tooltips.Archive.DeleteAction", plan.Steps.Count),
IsDestructive = true,
TypedConfirmation = count,
TypedPrompt = Loc.L("Archive.Delete.Type", count),
};
}
/// <summary>"Not moved: Comet over the ridge · a job is working on it", at most <paramref name="max"/> lines.</summary>
public static IReadOnlyList<string> Blocked(DeletePlan plan, int max)
{
var lines = plan.Blocked.Take(max).Select(b => Loc.L("Archive.Delete.Blocked", b.Sequence.DisplayTitle, Loc.L("Archive.Delete.Reason." + b.Reason))).ToList();
if (plan.Blocked.Count > max) lines.Add(Loc.Plural("Archive.Delete.More", plan.Blocked.Count - max));
return lines;
}
}
@@ -0,0 +1,78 @@
using System.IO;
using Titano.App.Infrastructure;
using Titano.App.Shell;
using Titano.Core.Diagnostics;
using Titano.Core.Localization;
using Titano.Data;
using Titano.Data.Archiving;
namespace Titano.App.Archiving;
/// <summary>
/// "Delete" of the Library and the Archive manager (BRIEF §0.2 rule 8, §12.2, §12.5): the archive engine's dry run is
/// shown in a destructive confirmation that asks to type the number of sequences (DESIGN §4), then the sequences move to
/// their archive's trash; the toast that follows brings them back.
/// </summary>
public static class SequenceDeletion
{
/// <summary>Plans, asks, deletes and offers to undo; true when something moved to the trash.</summary>
public static async Task<bool> RunAsync(ShellViewModel shell, IReadOnlyList<Guid> sequenceIds)
{
if (shell.Services.Archives is not { } archives || sequenceIds.Count == 0) return false;
try
{
var plan = await Task.Run(() => archives.PlanDeleteAsync(sequenceIds));
if (DeletePlans.Request(plan) is not { } request)
{
shell.Notify(Loc.L("Archive.Delete.Nothing"), string.Join(Environment.NewLine, DeletePlans.Blocked(plan, DeletePlans.ListedLines)));
return false;
}
if (!shell.Services.Dialogs.Confirm(request)) return false;
var entries = await Task.Run(() => archives.DeleteAsync(plan, Environment.UserName));
Log.Info("archive", $"{entries.Count} sequence(s) moved to the trash, {plan.Steps.Count - entries.Count} removed from the index only");
await RefreshAsync(shell);
shell.Notify(Loc.Plural("Archive.Delete.Done", plan.Steps.Count), Loc.L("Archive.Delete.Kept"),
entries.Count == 0 ? null : Loc.L("Archive.Delete.Undo"), Loc.L("Tooltips.Archive.DeleteUndo"),
entries.Count == 0 ? null : () => _ = RestoreAsync(shell, entries));
return true;
}
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or InvalidDataException or StaleDeletePlanException or ArgumentException
or DatabaseException)
{
Log.Warning("archive", "Delete failed", ex);
shell.Notify(Loc.L("Archive.Delete.Failed"), ex.Message);
await RefreshAsync(shell);
return false;
}
}
/// <summary>Brings deleted sequences back from their archives' trash and indexes them again.</summary>
public static async Task RestoreAsync(ShellViewModel shell, IReadOnlyList<TrashEntry> entries)
{
if (shell.Services.Archives is not { } archives) return;
var restored = 0;
try
{
foreach (var entry in entries)
{
await Task.Run(() => archives.RestoreAsync(entry.ArchiveId, entry.Name));
restored++;
}
shell.Notify(Loc.Plural("Archive.Trash.Restored", restored));
}
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or InvalidDataException or InvalidOperationException or ArgumentException
or DatabaseException)
{
Log.Warning("archive", "Restore from the trash failed", ex);
shell.Notify(Loc.L("Archive.Trash.Failed"), ex.Message);
}
await RefreshAsync(shell);
}
private static async Task RefreshAsync(ShellViewModel shell)
{
await shell.Library.RefreshAsync();
await shell.Archive.LoadAsync();
shell.Services.Sync.RequestRefresh();
}
}
@@ -0,0 +1,109 @@
using System.IO;
using System.Windows.Input;
using Titano.App.Infrastructure;
using Titano.Core.Diagnostics;
using Titano.Core.Localization;
using Titano.Data;
using Titano.Data.Archiving;
using Titano.Ui.Mvvm;
namespace Titano.App.Archiving;
/// <summary>One deleted sequence in the trash: what it was, when it went, and Restore.</summary>
public sealed class TrashRowViewModel(TrashEntry entry, ICommand restore)
{
public TrashEntry Entry { get; } = entry;
public string Title => Entry.Title;
/// <summary>"3,600 photos · 96.2 GB · 2026/2026-09-28 Canon EOS R5".</summary>
public string Detail => string.Join(" · ", Loc.Plural("Shell.Status.Photos", Entry.Frames), Formatting.Bytes(Entry.Bytes), Entry.Folder);
/// <summary>"Deleted 02/10/2026 18:04".</summary>
public string DeletedText => Loc.L("Archive.Trash.Deleted", Formatting.Date(Entry.DeletedAt) + " " + Formatting.TimeOfDay(Entry.DeletedAt));
public ICommand RestoreCommand { get; } = restore;
}
/// <summary>
/// The archive's trash (BRIEF §0.2 rule 8): every sequence deleted from the Library or the Archive manager, newest
/// first, each restorable into its folder (or a free one next to it) with its ids, settings and renders.
/// </summary>
public sealed class TrashDialogViewModel : ArchiveDialogViewModel
{
private readonly ArchiveService _archives;
private readonly Core.Model.Archive _archive;
private readonly Func<Task> _restored;
private IReadOnlyList<TrashRowViewModel> _rows = [];
public TrashDialogViewModel(ArchiveService archives, Core.Model.Archive archive, Func<Task> restored, Action<ArchiveDialogViewModel> close)
: base(close)
{
_archives = archives;
_archive = archive;
_restored = restored;
}
public string Heading => Loc.L("Archive.Trash.Heading", _archive.Name);
public IReadOnlyList<TrashRowViewModel> Rows
{
get => _rows;
private set
{
if (!Set(ref _rows, value)) return;
OnPropertyChanged(nameof(IsEmpty));
OnPropertyChanged(nameof(SummaryText));
}
}
public bool IsEmpty => _rows.Count == 0;
/// <summary>"3 sequences · 182 GB", or "The trash is empty".</summary>
public string SummaryText => _rows.Count == 0 ? Loc.L("Archive.Trash.Empty")
: Loc.Plural("Shell.Status.Sequences", _rows.Count) + " · " + Formatting.Bytes(_rows.Sum(r => r.Entry.Bytes));
/// <summary>Reads the trash of the archive (off the UI thread).</summary>
public async Task LoadAsync()
{
BusyText = Loc.L("Archive.Trash.Reading");
try
{
var entries = await Task.Run(() => _archives.ListTrashAsync(_archive.Id));
Rows = [.. entries.Select(e => new TrashRowViewModel(e, new AsyncRelayCommand(() => RestoreAsync(e), () => !IsBusy)))];
BusyText = null;
}
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or DatabaseException or ArgumentException)
{
Log.Warning("archive", "Reading the trash failed", ex);
BusyText = ex.Message;
}
}
/// <summary>Shows entries read elsewhere (capture).</summary>
public void Show(IReadOnlyList<TrashEntry> entries) =>
Rows = [.. entries.Select(e => new TrashRowViewModel(e, new AsyncRelayCommand(() => Task.CompletedTask)))];
private async Task RestoreAsync(TrashEntry entry)
{
IsBusy = true;
BusyText = Loc.L("Archive.Trash.Restoring", entry.Title);
try
{
await Task.Run(() => _archives.RestoreAsync(entry.ArchiveId, entry.Name));
Log.Info("archive", $"{entry.Title} restored from the trash");
Rows = [.. _rows.Where(r => r.Entry != entry)];
BusyText = null;
await _restored();
}
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or InvalidDataException or InvalidOperationException or DatabaseException
or ArgumentException)
{
Log.Warning("archive", $"Restoring {entry.Title} failed", ex);
BusyText = ex.Message;
}
finally
{
IsBusy = false;
}
}
}
@@ -13,6 +13,9 @@ public enum LibraryLayout
{
Grid,
List,
/// <summary>Year bands with photos per month above the card grid.</summary>
Timeline,
}
/// <summary>Rendering quality profile (Settings › Rendering).</summary>
+217
View File
@@ -0,0 +1,217 @@
using System.IO;
using System.Net.Http;
using Titano.App.Jobs;
using Titano.App.Server;
using Titano.App.Shell;
using Titano.Core.Diagnostics;
using Titano.Core.Localization;
using Titano.Core.Model;
using Titano.Core.Project;
using Titano.Data;
using Titano.Data.Archiving;
using Titano.Data.Archiving.Jobs;
using Titano.Data.Processing;
using Titano.Data.Sync;
using Titano.Protocol;
using Titano.Protocol.Client;
namespace Titano.App.Library;
/// <summary>
/// What the Library's quick and mass actions run (BRIEF §12.2): analyses, proxies, verifies and renders as jobs on
/// this PC's engine, or posted to the server for a sequence that only lives there; uploads, downloads and settings
/// exchanges through the sync engine (as the Server screen does); ratings through the archive engine (sidecar and
/// index together). Every queued job is announced with a toast that opens the Jobs screen.
/// </summary>
public sealed class LibraryActions(ShellViewModel shell)
{
/// <summary>Wire names of the job kinds a remote card posts (<c>POST /api/v1/jobs</c>).</summary>
private const string RenderKind = "render";
private const string DeepAnalyseKind = "deep-analyse";
private Infrastructure.AppServices Services => shell.Services;
/// <summary>The signed-in server's sync engine and connection; null while signed out.</summary>
public RemoteSource? Remote() =>
Services.Sync is { Service: { } service, Server: { } server, Remote: { } remote } ? new RemoteSource(service, server, remote) : null;
/// <summary>What the signed-in account may do; nothing while signed out.</summary>
public SyncRights Rights => Services.Server.User is { } user ? SyncRights.Of(user.Permissions) : default;
/// <summary>Deep analysis of sequences on this PC (one job), or of a remote card on the server.</summary>
public async Task AnalyseAsync(IReadOnlyList<Sequence> sequences)
{
if (sequences is [{ Origin: SequenceOrigin.Server, SyncState: SyncState.RemoteOnly } remote])
{
await PostAsync(() => Task.FromResult(new CreateJobRequest(DeepAnalyseKind, [remote.Id], null)), JobKind.DeepAnalyse, remote.DisplayTitle);
return;
}
await QueueAsync(ProcessingJobs.DeepAnalysis([.. sequences.Select(s => s.Id)], Label(sequences)));
}
public Task ProxiesAsync(IReadOnlyList<Sequence> sequences) => QueueAsync(ArchiveJobs.Proxies([.. sequences.Select(s => s.Id)], Label(sequences)));
/// <summary>Verification is an archive job: one per archive, naming its sequences.</summary>
public async Task VerifyAsync(IReadOnlyList<Sequence> sequences)
{
if (Services.Database is not { } db) return;
foreach (var group in sequences.GroupBy(s => s.ArchiveId))
{
if (await db.Archives.GetAsync(group.Key) is { } archive) await QueueAsync(ArchiveJobs.Verify(archive, [.. group.Select(s => s.Id)]));
}
}
/// <summary>
/// The Render quick action: the sequence's own export (its recommended preset, else the default) with its project as
/// stored, on this PC's engine — or posted to the server for a remote card, which renders it where the originals are.
/// </summary>
public async Task RenderAsync(Sequence sequence)
{
if (sequence is { Origin: SequenceOrigin.Server, SyncState: SyncState.RemoteOnly })
{
if (Remote() is not { } remote) return;
await PostAsync(async () =>
{
var (project, width, height) = await RemoteProjectAsync(remote, sequence.Id);
return new CreateJobRequest(RenderKind, [sequence.Id], ProcessingJobs.Render(sequence, project.Export with { Batch = [] }, width, height).ParametersJson);
}, JobKind.Render, sequence.DisplayTitle);
return;
}
if (Services.Database is not { } db) return;
var first = (await db.Frames.ListBySequenceAsync(sequence.Id, -1, 1)).FirstOrDefault();
var (w, h) = first is null ? (0, 0) : first.Orientation is >= 5 and <= 8 ? (first.Height, first.Width) : (first.Width, first.Height);
var export = Project(sequence.SettingsJson).Export with { Batch = [] };
await QueueAsync(ProcessingJobs.Render(sequence, export, w, h));
}
/// <summary>Runs one row action of the sync table on a sequence (the card's Sync, a mass Upload or Download); false when it could not start.</summary>
public async Task<bool> SyncAsync(SelectedSequence selected, SyncAction action)
{
if (Remote() is not { } remote || Services.Engine is not { } engine) return false;
var entry = selected.Sync;
switch (action)
{
case SyncAction.Upload when !selected.IsRemote:
await remote.Service.EnqueueUploadAsync(engine, remote.Server, selected.Sequence);
return true;
case SyncAction.SendExports when !selected.IsRemote:
await remote.Service.EnqueueSendExportsAsync(engine, remote.Server, selected.Sequence);
return true;
case SyncAction.DownloadOriginals when entry is not null:
if ((entry.Local?.ArchiveId ?? (await Services.Sync.CurrentArchiveAsync())?.Id) is not { } archive)
{
shell.Notify(Loc.L("Errors.Sync.NoArchive"));
return false;
}
await remote.Service.EnqueueDownloadAsync(engine, remote.Server, entry.Id, entry.Title, SyncDownloadMode.Originals, archive);
return true;
case SyncAction.GetExports when entry is not null:
await remote.Service.EnqueueDownloadAsync(engine, remote.Server, entry.Id, entry.Title, SyncDownloadMode.Exports, null);
return true;
case SyncAction.SyncSettings when entry is not null:
await remote.Service.SyncSettingsAsync(remote.Remote, entry.Id, Services.Sync.Policy, CancellationToken.None);
return true;
default:
return false;
}
}
/// <summary>
/// Opens a remote card with proxies (BRIEF §14.5): at once when its proxies are cached here, otherwise after the
/// proxy download this queues. Returns that download job, or null when the editor opened (or nothing could start).
/// </summary>
public async Task<Guid?> OpenRemoteAsync(Sequence sequence)
{
if (Remote() is not { } remote || Services.Engine is not { } engine) return null;
if (remote.Service.OpenRemote(remote.Server, sequence.Id) is not null)
{
shell.OpenSequence(sequence.Id);
return null;
}
var job = await remote.Service.EnqueueDownloadAsync(engine, remote.Server, sequence.Id, sequence.DisplayTitle, SyncDownloadMode.Proxies, null);
Queued(JobKind.Download, sequence.DisplayTitle);
return job.Id;
}
/// <summary>Sets the rating of sequences on this PC (sidecar and index together); returns how many changed.</summary>
public async Task<int> RateAsync(IReadOnlyList<Sequence> sequences, int rating)
{
if (Services.Archives is not { } archives) return 0;
var changed = 0;
try
{
foreach (var s in sequences.Where(s => s.Rating != rating))
{
await Task.Run(() => archives.SetSequenceInfoAsync(s.Id, s.Title, s.Tags, rating, s.Notes));
changed++;
}
}
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or ArgumentException or DatabaseException)
{
Log.Warning("library", "Rating failed", ex);
shell.Notify(Loc.L("Library.Rate.Failed"), ex.Message);
}
return changed;
}
/// <summary>"Deep analysis queued · Harbour sunset", with a way to the Jobs screen.</summary>
public void Queued(JobKind kind, string label) =>
shell.Notify(Loc.L("Library.Queued", JobText.Kind(kind), label), actionText: Loc.L("Shell.Nav.Jobs"), actionToolTip: Loc.L("Tooltips.Nav.Jobs"),
action: () => shell.Navigate(SectionKey.Jobs));
public static string Label(IReadOnlyList<Sequence> sequences) =>
sequences.Count == 1 ? sequences[0].DisplayTitle : Loc.Plural("Library.Selection.Count", sequences.Count);
private async Task QueueAsync(ArchiveJobRequest request)
{
if (Services.Engine is not { } engine || request.Targets.Count == 0) return;
await engine.EnqueueAsync(request);
Queued(request.Kind, request.Label ?? string.Empty);
}
/// <summary>Posts a job to the signed-in server, which runs it or hands it to a render node (BRIEF §14.6, §14.7).</summary>
private async Task PostAsync(Func<Task<CreateJobRequest>> build, JobKind kind, string label)
{
var session = Services.Server;
if (!session.IsConnected || session.Flow is not { Address: { } address, Token: { } token }) return;
try
{
var request = await build();
using var client = new TitanoClient(address, new CertificatePinning(session.Fingerprints), $"Titano ({Environment.MachineName})") { Token = token };
await client.CreateJobAsync(request);
shell.Notify(Loc.L("Library.QueuedServer", JobText.Kind(kind), label));
}
catch (Exception ex) when (ex is TitanoApiException or HttpRequestException or IOException or TaskCanceledException)
{
Log.Warning("library", $"Posting a {kind} job to {address} failed", ex);
shell.Notify(Loc.L("Library.Post.Failed"), ex.Message);
}
}
/// <summary>The project of a remote card: from its proxy cache when it was opened here, else from the server's manifest; and its frame size when cached.</summary>
private static async Task<(ProjectSettings Project, int Width, int Height)> RemoteProjectAsync(RemoteSource remote, Guid id)
{
if (remote.Service.OpenRemote(remote.Server, id) is { } cached)
{
var frame = cached.Frames.FirstOrDefault(f => f.Width > 0);
var size = frame is null ? (0, 0) : frame.Orientation is >= 5 and <= 8 ? (frame.Height, frame.Width) : (frame.Width, frame.Height);
return (Project(cached.Sequence.SettingsJson), size.Item1, size.Item2);
}
var manifest = await remote.Remote.GetManifestAsync(id, CancellationToken.None);
return (Project(manifest.SettingsJson), 0, 0);
}
private static ProjectSettings Project(string? json)
{
try
{
return json is null ? new ProjectSettings() : ProjectSettings.FromJson(json);
}
catch (System.Text.Json.JsonException ex)
{
Log.Warning("library", "Unreadable project settings; rendering the defaults", ex);
return new ProjectSettings();
}
}
}
+53 -2
View File
@@ -16,7 +16,15 @@ public enum StatusFilter
Warnings,
}
/// <summary>Library filters (search, year, camera, status, tag) and sort; immutable so a page request can carry it.</summary>
/// <summary>Where the sequences of the Library live (BRIEF §4.4 mixed mode): both, this PC, or only the signed-in server.</summary>
public enum OriginFilter
{
Any,
Local,
Server,
}
/// <summary>Library filters (search, year, camera, status, tag, origin) and sort; immutable so a page request can carry it.</summary>
public sealed record LibraryFilter
{
public string? Text { get; init; }
@@ -24,10 +32,12 @@ public sealed record LibraryFilter
public string? Camera { get; init; }
public StatusFilter Status { get; init; }
public string? Tag { get; init; }
public OriginFilter Origin { get; init; }
public SequenceSort Sort { get; init; } = SequenceSort.Newest;
/// <summary>No filter narrows the list (the sort may differ): an empty result means an empty library.</summary>
public bool IsUnfiltered => string.IsNullOrWhiteSpace(Text) && Year is null && Camera is null && Status == StatusFilter.Any && Tag is null;
public bool IsUnfiltered => string.IsNullOrWhiteSpace(Text) && Year is null && Camera is null && Status == StatusFilter.Any && Tag is null
&& Origin == OriginFilter.Any;
/// <summary>The same sort without filters ("Clear filters").</summary>
public LibraryFilter Cleared() => new() { Sort = Sort };
@@ -50,6 +60,47 @@ public sealed record LibraryFilter
};
}
/// <summary>
/// The same test the index applies to its rows (<see cref="ToQuery"/>), for sequences that are not in the index
/// (server sequences without a local copy): title, camera or tag text, capture year, camera model, status, tag.
/// </summary>
public bool Matches(Sequence sequence)
{
if (Year is { } year && sequence.FirstCapture?.Year != year) return false;
if (Camera is not null && sequence.CameraModel != Camera) return false;
var (with, without) = Flags(Status);
if ((sequence.Status & with) != with || (sequence.Status & without) != 0) return false;
if (Tag is not null && !sequence.Tags.Contains(TagRepository.Normalize(Tag), StringComparer.OrdinalIgnoreCase)) return false;
if (string.IsNullOrWhiteSpace(Text)) return true;
var text = Text.Trim();
return new[] { sequence.Title, sequence.CameraMake, sequence.CameraModel }.Any(v => v?.Contains(text, StringComparison.OrdinalIgnoreCase) == true)
|| sequence.Tags.Any(t => t.Contains(text, StringComparison.OrdinalIgnoreCase));
}
/// <summary>The index's order of <see cref="Sort"/> (missing values last, the id as tie-breaker), for merging pages with other sequences.</summary>
public int Compare(Sequence a, Sequence b)
{
var order = Sort switch
{
SequenceSort.Newest => Nullable(a.FirstCapture, b.FirstCapture, descending: true),
SequenceSort.Oldest => Nullable(a.FirstCapture, b.FirstCapture, descending: false),
SequenceSort.Title => string.CompareOrdinal(a.DisplayTitle.ToLowerInvariant(), b.DisplayTitle.ToLowerInvariant()),
SequenceSort.FrameCount => b.FrameCount.CompareTo(a.FrameCount),
_ => b.TotalBytes.CompareTo(a.TotalBytes),
};
if (order != 0) return order;
var ids = string.CompareOrdinal(a.Id.ToString(), b.Id.ToString());
return Sort is SequenceSort.Oldest or SequenceSort.Title ? ids : -ids;
static int Nullable(DateTime? x, DateTime? y, bool descending) => (x, y) switch
{
(null, null) => 0,
(null, _) => 1,
(_, null) => -1,
_ => descending ? y!.Value.CompareTo(x!.Value) : x!.Value.CompareTo(y!.Value),
};
}
/// <summary>Flags that must be set and clear for a status choice.</summary>
public static (SequenceStatus With, SequenceStatus Without) Flags(StatusFilter status) => status switch
{
+63
View File
@@ -0,0 +1,63 @@
using Titano.App.Archiving;
using Titano.Core.Model;
using Titano.Data.Repositories;
namespace Titano.App.Library;
/// <summary>
/// The Library's timeline layout (BRIEF §12.2): one band per capture year, newest first, with the density of photos
/// per month (the Archive heatmap's figures), and the way between a band's month and the sequences of the grid.
/// </summary>
public sealed class LibraryTimeline
{
private LibraryTimeline(IReadOnlyList<HeatRow> bands, IReadOnlyList<int> years)
{
Bands = bands;
Years = years;
}
public static LibraryTimeline Empty { get; } = new([], []);
/// <summary>One row per year, newest first; months to come are NaN.</summary>
public IReadOnlyList<HeatRow> Bands { get; }
/// <summary>The year of each band.</summary>
public IReadOnlyList<int> Years { get; }
public static LibraryTimeline From(ArchiveStats stats, DateTime today)
{
var rows = ArchiveFigures.PhotosPerMonth(stats, today).Reverse().ToList();
var first = stats.ByMonth.Count == 0 ? 0 : stats.ByMonth.Max(m => m.Year);
return new LibraryTimeline(rows, [.. Enumerable.Range(0, rows.Count).Select(i => first - i)]);
}
/// <summary>Year and month of a band's slot; null outside the bands.</summary>
public (int Year, int Month)? MonthAt(int band, int slot) =>
band >= 0 && band < Years.Count && slot is >= 0 and < 12 ? (Years[band], slot + 1) : null;
/// <summary>Band and slot of a month; (−1, −1) when no band shows that year.</summary>
public (int Band, int Slot) SlotOf(int year, int month)
{
var band = IndexOf(Years, year);
return band < 0 || month is < 1 or > 12 ? (-1, -1) : (band, month - 1);
}
/// <summary>Position of the first sequence first captured in that month, in list order; −1 when none of <paramref name="sequences"/> is.</summary>
public static int FirstOfMonth(IReadOnlyList<Sequence> sequences, int year, int month)
{
for (var i = 0; i < sequences.Count; i++)
{
if (sequences[i].FirstCapture is { } at && at.Year == year && at.Month == month) return i;
}
return -1;
}
private static int IndexOf(IReadOnlyList<int> values, int value)
{
for (var i = 0; i < values.Count; i++)
{
if (values[i] == value) return i;
}
return -1;
}
}
+126
View File
@@ -0,0 +1,126 @@
using Titano.App.Server;
using Titano.Core.Localization;
using Titano.Core.Model;
using Titano.Data.Sync;
namespace Titano.App.Library;
/// <summary>The actions of the Library's mass actions bar (BRIEF §12.2).</summary>
public enum MassAction
{
Analyse,
Proxies,
Verify,
Tag,
Rate,
Move,
Upload,
Download,
Delete,
ExportList,
}
/// <summary>A selected sequence and, while signed in, its row of the sync table.</summary>
public sealed record SelectedSequence(Sequence Sequence, SyncEntry? Sync)
{
/// <summary>Only on the server: no copy on this PC (a remote card).</summary>
public bool IsRemote => Sequence is { Origin: SequenceOrigin.Server, SyncState: SyncState.RemoteOnly };
}
/// <summary>What this PC can do right now.</summary>
/// <param name="HasEngine">The index and the job engine are open.</param>
/// <param name="IsSignedIn">A server session is open (uploads, downloads, remote cards).</param>
public sealed record SelectionContext(bool HasEngine, bool IsSignedIn, SyncRights Rights);
/// <summary>
/// Which selected sequences each mass action works on and, when it works on none, why (the disabled button's
/// tooltip, DESIGN §4). Archive actions touch sequences on this PC; Upload and Download follow the sync table's own
/// row actions (<see cref="SyncText.Actions"/>), so the Library and the Server screen never disagree.
/// </summary>
public static class MassActions
{
/// <summary>The selected sequences <paramref name="action"/> works on.</summary>
public static IReadOnlyList<SelectedSequence> Targets(MassAction action, IReadOnlyList<SelectedSequence> selection, SelectionContext context) => action switch
{
MassAction.ExportList => selection,
MassAction.Upload => [.. selection.Where(s => !s.IsRemote && UploadStep(s, context.Rights) is not null)],
MassAction.Download => [.. selection.Where(s => DownloadStep(s, context.Rights) is not null)],
_ => [.. selection.Where(s => !s.IsRemote)],
};
/// <summary>Why <paramref name="action"/> cannot run on the selection, localized; null when it can.</summary>
public static string? Blocker(MassAction action, IReadOnlyList<SelectedSequence> selection, SelectionContext context)
{
if (selection.Count == 0) return Loc.L("Library.Blocked.NoSelection");
if (action == MassAction.ExportList) return null;
if (!context.HasEngine) return Loc.L("Library.Blocked.NoIndex");
var targets = Targets(action, selection, context);
switch (action)
{
case MassAction.Upload or MassAction.Download when !context.IsSignedIn:
return Loc.L("Library.Blocked.NotConnected");
case MassAction.Upload when !context.Rights.CanUpload:
return Loc.L("Library.Blocked.NoUploadRight");
case MassAction.Download when !context.Rights.CanFetchOriginals:
return Loc.L("Library.Blocked.NoDownloadRight");
case MassAction.Upload when targets.Count == 0:
return Loc.L("Library.Blocked.NothingToUpload");
case MassAction.Download when targets.Count == 0:
return Loc.L("Library.Blocked.NothingToDownload");
case MassAction.Upload or MassAction.Download:
return null;
}
if (targets.Count == 0) return Loc.L("Library.Blocked.ServerOnly");
return action == MassAction.Move && targets.Select(t => t.Sequence.ArchiveId).Distinct().Count() > 1 ? Loc.L("Library.Blocked.Archives") : null;
}
/// <summary>The enabled tooltip: what the action does to how many sequences.</summary>
public static string ToolTip(MassAction action, int targets) => Loc.Plural("Tooltips.Library.Mass." + action, targets);
/// <summary>What an upload of a selected local sequence sends: its originals and settings, or only its renders; null when nothing.</summary>
public static SyncAction? UploadStep(SelectedSequence selected, SyncRights rights)
{
// Compared before the table lists it: the sequence is only here.
if (selected.Sync is not { } entry) return rights.CanUpload && !selected.IsRemote ? SyncAction.Upload : null;
var actions = SyncText.Actions(entry, rights);
return actions.Contains(SyncAction.Upload) ? SyncAction.Upload : actions.Contains(SyncAction.SendExports) ? SyncAction.SendExports : null;
}
/// <summary>What a download of a selected sequence fetches: the server's originals, or only its renders; null when nothing.</summary>
public static SyncAction? DownloadStep(SelectedSequence selected, SyncRights rights)
{
if (selected.Sync is not { } entry) return null;
var actions = SyncText.Actions(entry, rights);
return actions.Contains(SyncAction.DownloadOriginals) ? SyncAction.DownloadOriginals : actions.Contains(SyncAction.GetExports) ? SyncAction.GetExports : null;
}
/// <summary>
/// The card's Sync quick action: the first transfer or settings exchange the sync table offers, or Resolve
/// (on the Server screen) for a conflict; null with <paramref name="blocker"/> when there is nothing to do.
/// </summary>
public static SyncAction? QuickSync(SelectedSequence selected, SelectionContext context, out string? blocker)
{
blocker = null;
if (!context.IsSignedIn)
{
blocker = Loc.L("Library.Blocked.NotConnected");
return null;
}
if (selected.Sync is not { } entry) return UploadStep(selected, context.Rights) ?? Blocked(Loc.L("Library.Blocked.NoUploadRight"), out blocker);
if (entry.Transfer is not null) return Blocked(Loc.L("Library.Blocked.Transferring"), out blocker);
if (entry.Status == SyncStatus.Conflict) return SyncAction.KeepMine;
var actions = SyncText.Actions(entry, context.Rights);
SyncAction[] preferred = [SyncAction.Upload, SyncAction.DownloadOriginals, SyncAction.SyncSettings, SyncAction.SendExports, SyncAction.GetExports];
foreach (var action in preferred)
{
if (actions.Contains(action)) return action;
}
return Blocked(Loc.L(entry.Status == SyncStatus.InSync ? "Library.Blocked.InSync" : "Library.Blocked.NoSyncRight"), out blocker);
static SyncAction? Blocked(string reason, out string? why)
{
why = reason;
return null;
}
}
}
+109
View File
@@ -0,0 +1,109 @@
using Titano.Core.Model;
using Titano.Data.Sync;
using Titano.Protocol;
namespace Titano.App.Library;
/// <summary>
/// Server sequences without a copy on this PC, as Library cards (BRIEF §4.4 mixed mode): from the sync table of the
/// signed-in server, with the details of the server's listing when it was read, else what the table keeps.
/// </summary>
public static class RemoteCards
{
/// <summary>Entries of the sync table that have no local copy (only on the server, or kept here as proxies).</summary>
public static IEnumerable<SyncEntry> RemoteOnly(IEnumerable<SyncEntry> entries) => entries.Where(e => e is { Local: null, Link: not null });
/// <summary>One card per remote-only entry: the listing's sequence when known, else the table's title, counts and status.</summary>
public static IReadOnlyList<Sequence> Build(IEnumerable<SyncEntry> entries, IReadOnlyDictionary<Guid, SequenceDto>? listing) =>
[
.. RemoteOnly(entries).Select(e => listing is not null && listing.TryGetValue(e.Link!.RemoteId, out var dto) ? ToSequence(dto) : FromLink(e.Link!)),
];
/// <summary>A server sequence as a card: origin server, remote only, no archive on this PC.</summary>
public static Sequence ToSequence(SequenceDto dto) => new()
{
Id = dto.Id,
ArchiveId = Guid.Empty,
Title = dto.Title,
Folder = dto.Folder,
CameraMake = dto.CameraMake,
CameraModel = dto.CameraModel,
Lens = dto.Lens,
FirstCapture = dto.FirstCapture,
LastCapture = dto.LastCapture,
FrameCount = dto.FrameCount,
MedianInterval = dto.MedianInterval,
TotalBytes = dto.TotalBytes,
Status = (SequenceStatus)dto.Status,
RenderedCount = dto.RenderedCount,
HeroFrameId = dto.HeroFrameId,
Tags = dto.Tags,
Rating = dto.Rating,
Notes = dto.Notes,
SettingsVersion = dto.SettingsVersion,
FramesVersion = dto.FramesVersion,
WarningCount = dto.WarningCount,
OwnerUserId = dto.OwnerUserId,
UpdatedAt = dto.UpdatedAt,
Origin = SequenceOrigin.Server,
SyncState = SyncState.RemoteOnly,
};
/// <summary>What the sync table knows of a server sequence when its listing could not be read.</summary>
public static Sequence FromLink(SyncLink link) => new()
{
Id = link.RemoteId,
ArchiveId = Guid.Empty,
Title = link.Title,
Folder = string.Empty,
FrameCount = link.FrameCount,
TotalBytes = link.TotalBytes,
Status = link.RemoteStatus,
RenderedCount = link.RenderCount,
SettingsVersion = link.RemoteSettingsVersion,
FramesVersion = link.RemoteFramesVersion,
UpdatedAt = link.RemoteUpdatedAt,
Origin = SequenceOrigin.Server,
SyncState = SyncState.RemoteOnly,
};
}
/// <summary>
/// Interleaves remote cards with the index's pages in the order of the filter's sort: each page brings the remote
/// cards that sort before its last row; the last page brings the rest. Not thread-safe: call from one thread (the UI).
/// </summary>
public sealed class RemoteMerge
{
private readonly List<Sequence> _pending = [];
private LibraryFilter _filter = new();
/// <summary>Remote cards not yet handed out.</summary>
public int Pending => _pending.Count;
/// <summary>Starts over with the cards that match <paramref name="filter"/>, in its order.</summary>
public void Reset(LibraryFilter filter, IEnumerable<Sequence> remote)
{
_filter = filter;
_pending.Clear();
if (filter.Origin != OriginFilter.Local) _pending.AddRange(remote.Where(filter.Matches));
_pending.Sort(filter.Compare);
}
/// <summary>A page of the index with the remote cards that belong among it, in order; <paramref name="last"/> adds every card left.</summary>
public IReadOnlyList<Sequence> Merge(IReadOnlyList<Sequence> page, bool last)
{
var take = last ? _pending.Count
: page.Count == 0 ? 0
: _pending.FindIndex(r => _filter.Compare(r, page[^1]) > 0) is var after and >= 0 ? after : _pending.Count;
if (take == 0) return page;
var merged = new List<Sequence>(page.Count + take);
int a = 0, b = 0;
while (a < page.Count || b < take)
{
if (b >= take || (a < page.Count && _filter.Compare(page[a], _pending[b]) <= 0)) merged.Add(page[a++]);
else merged.Add(_pending[b++]);
}
_pending.RemoveRange(0, take);
return merged;
}
}
@@ -0,0 +1,87 @@
using System.Collections.Concurrent;
using System.IO;
using System.Windows.Media;
using Titano.Core.Model;
using Titano.Data.Sync;
using Titano.Ui.Visuals;
namespace Titano.App.Library;
/// <summary>Hero thumbnails (and hover-scrub frames, where there are any) of the Library's cards.</summary>
public interface ISequenceThumbnails
{
Task<ImageSource?> HeroAsync(Sequence sequence, int pixelWidth, CancellationToken ct);
/// <summary>Frames for hover scrubbing; null when the sequence has none to scrub.</summary>
IThumbnailSource? ScrubSource(Sequence sequence);
}
/// <summary>The signed-in server as remote cards see it: its sync engine, its key and a connection.</summary>
public sealed record RemoteSource(SyncService Service, string Server, ISyncRemote Remote);
/// <summary>
/// Thumbnails of server sequences without a copy here (BRIEF §4.4): the hero frame (else the first) from the proxy
/// cache when the sequence was fetched with proxies, otherwise the server's thumbnail of that frame through the API.
/// Decoded at a 64 px width step and kept in an LRU cache; failed downloads are not cached, so they are tried again.
/// </summary>
public sealed class RemoteThumbnails(Func<RemoteSource?> source, int capacity = 256) : ISequenceThumbnails, IDisposable
{
private const int WidthStep = 64;
private readonly ConcurrentDictionary<Guid, Guid?> _heroes = new();
private ThumbnailCache<(Guid Sequence, int Width), ImageSource>? _cache;
private ThumbnailCache<(Guid Sequence, int Width), ImageSource> Cache => _cache ??= new(capacity, LoadAsync, maxConcurrentLoads: 4);
public Task<ImageSource?> HeroAsync(Sequence sequence, int pixelWidth, CancellationToken ct)
{
_heroes[sequence.Id] = sequence.HeroFrameId;
return Cache.GetAsync((sequence.Id, Math.Clamp((pixelWidth + WidthStep - 1) / WidthStep * WidthStep, WidthStep, 1024)), ct);
}
/// <summary>Remote cards do not scrub: every frame would be a download.</summary>
public IThumbnailSource? ScrubSource(Sequence sequence) => null;
/// <summary>Forgets every thumbnail (another server, or the cache was cleared).</summary>
public void Clear() => _cache?.Clear();
public void Dispose() => _cache?.Dispose();
private async Task<ImageSource?> LoadAsync((Guid Sequence, int Width) key, CancellationToken ct)
{
if (source() is not { } connection) return null;
var hero = _heroes.GetValueOrDefault(key.Sequence);
if (connection.Service.OpenRemote(connection.Server, key.Sequence) is { CachedCount: > 0 } cached)
{
var index = hero is { } id ? IndexOf(cached.Frames, id) : -1;
if (index < 0 || cached.Files[index] is null) index = FirstCached(cached.Files);
await using var file = new FileStream(cached.Files[index]!, FileMode.Open, FileAccess.Read, FileShare.Read, 1 << 16, FileOptions.Asynchronous);
return ThumbnailService.DecodeStream(file, cached.Frames[index].Orientation, key.Width);
}
var frameId = hero ?? (await connection.Remote.GetManifestAsync(key.Sequence, ct).ConfigureAwait(false)).Frames.FirstOrDefault()?.Id;
if (frameId is null) return null;
using var thumbnail = new MemoryStream();
await connection.Remote.DownloadFrameAsync(frameId.Value, "thumb", thumbnail, ct).ConfigureAwait(false);
thumbnail.Position = 0;
// The server draws its thumbnails upright.
return ThumbnailService.DecodeStream(thumbnail, 1, key.Width);
}
private static int IndexOf(IReadOnlyList<Frame> frames, Guid id)
{
for (var i = 0; i < frames.Count; i++)
{
if (frames[i].Id == id) return i;
}
return -1;
}
private static int FirstCached(IReadOnlyList<string?> files)
{
for (var i = 0; i < files.Count; i++)
{
if (files[i] is not null) return i;
}
return -1;
}
}
+91
View File
@@ -0,0 +1,91 @@
using System.Text.Json;
using System.Text.Json.Serialization;
using Titano.Core.Diagnostics;
using Titano.Core.Localization;
using Titano.Data.Repositories;
namespace Titano.App.Library;
/// <summary>A named set of Library filters and sort ("Night, 4K, not analysed"), BRIEF §12.2.</summary>
public sealed record SavedView
{
public const int MaxName = 40;
public required Guid Id { get; init; }
public required string Name { get; init; }
public string? Text { get; init; }
public int? Year { get; init; }
public string? Camera { get; init; }
public StatusFilter Status { get; init; }
public string? Tag { get; init; }
public OriginFilter Origin { get; init; }
public SequenceSort Sort { get; init; } = SequenceSort.Newest;
public static SavedView Of(Guid id, string name, LibraryFilter filter) => new()
{
Id = id,
Name = name.Trim(),
Text = string.IsNullOrWhiteSpace(filter.Text) ? null : filter.Text.Trim(),
Year = filter.Year,
Camera = filter.Camera,
Status = filter.Status,
Tag = filter.Tag,
Origin = filter.Origin,
Sort = filter.Sort,
};
public LibraryFilter ToFilter() => new() { Text = Text, Year = Year, Camera = Camera, Status = Status, Tag = Tag, Origin = Origin, Sort = Sort };
/// <summary>The Library shows exactly this view (search text compared trimmed and case-insensitively).</summary>
public bool Matches(LibraryFilter filter) =>
string.Equals(Text ?? string.Empty, filter.Text?.Trim() ?? string.Empty, StringComparison.OrdinalIgnoreCase)
&& Year == filter.Year && Camera == filter.Camera && Status == filter.Status && Tag == filter.Tag && Origin == filter.Origin && Sort == filter.Sort;
/// <summary>The problem of a view name, localized; null when it can be used.</summary>
/// <param name="others">Names of the other saved views (a name is used once).</param>
public static string? Validate(string? name, IEnumerable<string> others)
{
var trimmed = name?.Trim() ?? string.Empty;
if (trimmed.Length == 0) return Loc.L("Library.Views.Error.Empty");
if (trimmed.Length > MaxName || trimmed.Any(char.IsControl)) return Loc.L("Library.Views.Error.Long", MaxName);
return others.Contains(trimmed, StringComparer.CurrentCultureIgnoreCase) ? Loc.L("Library.Views.Error.Taken") : null;
}
}
/// <summary>Saved views as app-scope settings rows (<c>library.view.&lt;id&gt;</c>), one row per view.</summary>
public sealed class SavedViewStore(SettingsRepository settings)
{
private const string Prefix = "library.view.";
/// <summary>Every saved view by name; unreadable rows are skipped.</summary>
public async Task<IReadOnlyList<SavedView>> ListAsync(CancellationToken cancellationToken = default)
{
var views = new List<SavedView>();
foreach (var (key, json) in await settings.ListAsync(SettingScope.App, null, cancellationToken))
{
if (!key.StartsWith(Prefix, StringComparison.Ordinal)) continue;
try
{
if (JsonSerializer.Deserialize(json, SavedViewJson.Default.SavedView) is { } view) views.Add(view);
}
catch (JsonException ex)
{
Log.Warning("library", $"Saved view {key} is unreadable", ex);
}
}
return [.. views.OrderBy(v => v.Name, StringComparer.CurrentCultureIgnoreCase)];
}
/// <summary>Adds the view or replaces the one with its id.</summary>
public Task SaveAsync(SavedView view, CancellationToken cancellationToken = default) =>
settings.SetAsync(SettingScope.App, null, Key(view.Id), view, SavedViewJson.Default.SavedView, cancellationToken);
public Task<bool> DeleteAsync(Guid id, CancellationToken cancellationToken = default) => settings.DeleteAsync(SettingScope.App, null, Key(id), cancellationToken);
private static string Key(Guid id) => Prefix + id.ToString("N");
}
[JsonSourceGenerationOptions(PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
UseStringEnumConverter = true)]
[JsonSerializable(typeof(SavedView))]
internal sealed partial class SavedViewJson : JsonSerializerContext;
+54 -3
View File
@@ -1,20 +1,29 @@
using System.Text.Json;
using System.Windows.Media;
using Titano.App.Infrastructure;
using Titano.Core.Diagnostics;
using Titano.Core.Export;
using Titano.Core.Localization;
using Titano.Core.Model;
using Titano.Core.Naming;
using Titano.Core.Project;
using Titano.Data.Processing;
using Titano.Data.Sync;
using Titano.Ui.Controls;
using Titano.Ui.Mvvm;
using Titano.Ui.Visuals;
namespace Titano.App.Library;
/// <summary>One sequence of the Library grid and list (BRIEF §12.2).</summary>
/// <summary>One sequence of the Library grid and list (BRIEF §12.2): on this PC, or a server sequence without a copy here (a remote card).</summary>
public sealed class SequenceItem : ObservableObject
{
private readonly ThumbnailService? _thumbnails;
private readonly ISequenceThumbnails? _thumbnails;
private Sequence _sequence;
private SyncEntry? _sync;
private string? _syncToolTip;
private bool _canSync;
private string? _presetName;
private ImageSource? _thumbnail;
private IThumbnailSource? _scrub;
private CancellationTokenSource? _loading;
@@ -22,7 +31,7 @@ public sealed class SequenceItem : ObservableObject
private bool _isSelected;
private bool _isAnalysing;
public SequenceItem(Sequence sequence, ThumbnailService? thumbnails)
public SequenceItem(Sequence sequence, ISequenceThumbnails? thumbnails)
{
_sequence = sequence;
_thumbnails = thumbnails;
@@ -31,6 +40,23 @@ public sealed class SequenceItem : ObservableObject
public Sequence Sequence => _sequence;
public Guid Id => _sequence.Id;
/// <summary>Only on the signed-in server (the editor opens it with proxies; archive actions do not apply).</summary>
public bool IsRemote => _sequence is { Origin: SequenceOrigin.Server, SyncState: SyncState.RemoteOnly };
/// <summary>Its row of the sync table of the signed-in server; null while signed out or not compared yet.</summary>
public SyncEntry? Sync => _sync;
/// <summary>The Sync quick action can run (<see cref="SyncToolTip"/> says what it does, or why not).</summary>
public bool CanSync => _canSync;
public string SyncToolTip => _syncToolTip ?? Loc.L("Library.Blocked.NotConnected");
/// <summary>"Render · 4K archive": the preset the Render quick action queues, the recommended one or the default.</summary>
public string RenderToolTip => Loc.L(IsRemote ? "Tooltips.Library.QuickRenderServer" : "Tooltips.Library.QuickRender", PresetName);
/// <summary>The export preset of the sequence's project (the advisor's choice when it made one, else the default).</summary>
public string PresetName => _presetName ??= ResolvePreset(_sequence.SettingsJson);
/// <summary>User title or "{date} {camera}".</summary>
public string Title => _sequence.DisplayTitle;
@@ -70,6 +96,17 @@ public sealed class SequenceItem : ObservableObject
/// <summary>Frames for hover scrubbing; created on first use.</summary>
public IThumbnailSource? ScrubSource => _thumbnails is null || _sequence.FrameCount == 0 ? null : _scrub ??= _thumbnails.ScrubSource(_sequence);
/// <summary>The sync table's row of this sequence and what its Sync quick action does (or why it cannot).</summary>
public void SetSync(SyncEntry? entry, bool canSync, string toolTip)
{
_sync = entry;
_canSync = canSync;
_syncToolTip = toolTip;
OnPropertyChanged(nameof(Sync));
OnPropertyChanged(nameof(CanSync));
OnPropertyChanged(nameof(SyncToolTip));
}
public bool IsSelected
{
get => _isSelected;
@@ -90,6 +127,7 @@ public sealed class SequenceItem : ObservableObject
public void Update(Sequence sequence)
{
var heroChanged = sequence.HeroFrameId != _sequence.HeroFrameId || sequence.FrameCount != _sequence.FrameCount;
if (sequence.SettingsJson != _sequence.SettingsJson) _presetName = null;
_sequence = sequence;
if (heroChanged)
{
@@ -141,6 +179,19 @@ public sealed class SequenceItem : ObservableObject
}
}
private static string ResolvePreset(string? settingsJson)
{
try
{
var project = settingsJson is null ? new ProjectSettings() : ProjectSettings.FromJson(settingsJson);
return ProcessingJobs.PresetName(ExportResolver.Resolve(project.Export));
}
catch (JsonException)
{
return ProcessingJobs.PresetName(ExportResolver.Resolve(new ExportSettings()));
}
}
private void RaiseStatuses()
{
OnPropertyChanged(nameof(Statuses));
+3 -1
View File
@@ -17,7 +17,7 @@ public readonly record struct ThumbnailKey(Guid FrameId, int Width);
/// original and decoded by WIC at the requested width (falling back to decoding the original), turned upright,
/// frozen and kept in an LRU cache. Loads run off the UI thread and stop when the card scrolls away.
/// </summary>
public sealed class ThumbnailService : IDisposable
public sealed class ThumbnailService : ISequenceThumbnails, IDisposable
{
/// <summary>Embedded previews larger than this are not read (a damaged index would make us read gigabytes).</summary>
private const long MaxPreviewBytes = 64L << 20;
@@ -81,6 +81,8 @@ public sealed class ThumbnailService : IDisposable
/// <summary>Hover-scrub frames of a sequence, sampled to at most <paramref name="positions"/> positions.</summary>
public IThumbnailSource ScrubSource(Sequence sequence, int positions = 120) => new ScrubFrames(this, sequence, positions);
IThumbnailSource? ISequenceThumbnails.ScrubSource(Sequence sequence) => ScrubSource(sequence);
/// <summary>Drops decoded thumbnails (Settings › Storage › Clear).</summary>
public void Clear()
{
@@ -0,0 +1,52 @@
using System.Windows.Input;
using Titano.App.Archiving;
using Titano.App.Settings;
using Titano.Core.Localization;
using Titano.Ui.Mvvm;
namespace Titano.App.Library;
/// <summary>Names a saved view: "Save view" (the current filters under a new name) or "Rename view".</summary>
public sealed class ViewNameDialogViewModel : ArchiveDialogViewModel
{
private readonly Func<string, Task> _save;
/// <param name="others">Names of the other saved views (each name is used once).</param>
public ViewNameDialogViewModel(bool rename, string name, IReadOnlyList<string> others, Func<string, Task> save, Action<ArchiveDialogViewModel> close)
: base(close)
{
IsRename = rename;
_save = save;
Name = new EditableField(name, n => SavedView.Validate(n, others), _ => { }, () => Loc.L("Tooltips.Library.ViewName"));
Name.PropertyChanged += (_, _) =>
{
OnPropertyChanged(nameof(SaveToolTip));
CommandManager.InvalidateRequerySuggested();
};
SaveCommand = new AsyncRelayCommand(SaveAsync, () => !IsBusy && !Name.HasErrors);
}
public bool IsRename { get; }
public string Heading => Loc.L(IsRename ? "Library.Views.RenameHeading" : "Library.Views.SaveHeading");
public EditableField Name { get; }
public ICommand SaveCommand { get; }
public string SaveToolTip => Name.Error ?? Loc.L(IsRename ? "Tooltips.Library.ViewRenameApply" : "Tooltips.Library.ViewSaveApply");
private async Task SaveAsync()
{
IsBusy = true;
try
{
await _save(Name.Text.Trim());
Close();
}
finally
{
IsBusy = false;
}
}
}
+32 -151
View File
@@ -7,156 +7,34 @@
xmlns:ar="clr-namespace:Titano.App.Archiving"
xmlns:shell="clr-namespace:Titano.App.Shell">
<UserControl.Resources>
<Style x:Key="Text.PanelHeading" TargetType="TextBlock" BasedOn="{StaticResource Text.Section}">
<Setter Property="FontSize" Value="13" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<Style x:Key="Button.Bar" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Height" Value="30" />
<Setter Property="Margin" Value="0,0,8,0" />
</Style>
<Style x:Key="Button.Tool" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Margin" Value="0,0,8,8" />
</Style>
<!-- Rows that only show text: focusable, so the arrow keys move through a long list. -->
<Style x:Key="ListBoxItem.Preview" TargetType="ListBoxItem" BasedOn="{StaticResource ListBoxItem.Row}">
<Setter Property="Padding" Value="0" />
<Setter Property="AutomationProperties.Name" Value="{Binding To}" />
</Style>
<!-- Report rows with their own buttons: Tab reaches every button. -->
<Style x:Key="ListBoxItem.Duplicate" TargetType="ListBoxItem" BasedOn="{StaticResource ListBoxItem.PlainRow}">
<Setter Property="AutomationProperties.Name" Value="{Binding Row.Title}" />
</Style>
<!-- A filter menu: its values, each checked while chosen. -->
<Style x:Key="MenuItem.Choice" TargetType="MenuItem" BasedOn="{StaticResource {x:Type MenuItem}}">
<Setter Property="Header" Value="{Binding Label}" />
<Setter Property="IsChecked" Value="{Binding IsChecked, Mode=OneWay}" />
<Setter Property="Command" Value="{Binding Command}" />
<Setter Property="ToolTip" Value="{l:Loc Tooltips.Archive.FilterChoice}" />
<Setter Property="ToolTipService.ShowOnDisabled" Value="True" />
</Style>
<!-- Dialog card (DESIGN §4: Surface, Stroke, radius 12, 24 px shadow, two buttons). -->
<Style x:Key="Border.Dialog" TargetType="Border">
<Setter Property="Background" Value="{DynamicResource Brush.Surface}" />
<Setter Property="BorderBrush" Value="{DynamicResource Brush.Stroke}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="CornerRadius" Value="{StaticResource Radius.Dialog}" />
<Setter Property="Padding" Value="24,18,24,20" />
<Setter Property="Effect" Value="{StaticResource Shadow.Popup}" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<DataTemplate DataType="{x:Type ar:RebuildDialogViewModel}">
<Border Style="{StaticResource Border.Dialog}" Width="520">
<StackPanel>
<TextBlock Text="{l:Loc Archive.Rebuild.Heading}" Style="{StaticResource Text.Title}" />
<ItemsControl ItemsSource="{Binding FactRows}" Focusable="False" Margin="0,14,0,0">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type ar:DialogFact}">
<Grid Margin="0,0,0,8">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="{StaticResource Grid.LabelColumn}" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Label}" Style="{StaticResource Text.Label}" />
<TextBlock Grid.Column="1" Text="{Binding Value}" TextTrimming="CharacterEllipsis" ToolTip="{Binding Value}" Typography.NumeralAlignment="Tabular" />
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<TextBlock Text="{Binding BusyText}" Foreground="{DynamicResource Brush.TextMuted}" Visibility="{Binding BusyText, Converter={x:Static ui:NullToCollapsedConverter.Instance}}" />
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,18,0,0">
<Button Content="{l:Loc Archive.Dialog.Cancel}" Command="{Binding CloseCommand}" ToolTip="{Binding CloseToolTip}" IsDefault="True" IsCancel="True"
MinWidth="96" />
<Button Style="{StaticResource Button.Primary}" Content="{l:Loc Archive.Rebuild.Start}" Command="{Binding RebuildCommand}" ToolTip="{Binding RebuildToolTip}"
MinWidth="96" Margin="8,0,0,0" />
</StackPanel>
</StackPanel>
</Border>
</DataTemplate>
<DataTemplate DataType="{x:Type ar:RenameDialogViewModel}">
<Border Style="{StaticResource Border.Dialog}" Width="720" MaxHeight="560">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Text="{Binding Heading}" Style="{StaticResource Text.Title}" />
<Grid Grid.Row="1" Margin="0,14,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="{StaticResource Grid.LabelColumn}" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Text="{l:Loc Archive.Rename.Template}" Style="{StaticResource Text.Label}" />
<TextBox Grid.Column="1" Style="{StaticResource TextBox.Mono}" Text="{Binding Template.Text, UpdateSourceTrigger=PropertyChanged, ValidatesOnNotifyDataErrors=True}"
shell:EditBehavior.Field="{Binding Template}" ToolTip="{Binding Template.ToolTip}" AutomationProperties.Name="{l:Loc Archive.Rename.Template}" />
</Grid>
<TextBlock Grid.Row="2" Text="{Binding SummaryText}" Foreground="{DynamicResource Brush.TextMuted}" Margin="0,12,0,6" Typography.NumeralAlignment="Tabular" />
<ListBox Grid.Row="3" ItemsSource="{Binding Rows}" ItemContainerStyle="{StaticResource ListBoxItem.Preview}" MinHeight="120"
AutomationProperties.Name="{l:Loc Archive.Rename.Preview}">
<ListBox.ItemTemplate>
<DataTemplate DataType="{x:Type ar:RenameRow}">
<Grid Height="30" TextElement.FontSize="12">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" MinWidth="120" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" MinWidth="120" />
</Grid.ColumnDefinitions>
<TextBlock Style="{StaticResource Text.Cell}" Text="{Binding From}" Foreground="{DynamicResource Brush.TextMuted}" ToolTip="{Binding From}" />
<ui:Icon Grid.Column="1" Glyph="{StaticResource Icon.Forward}" Margin="10,0" Foreground="{DynamicResource Brush.TextFaint}" />
<TextBlock Grid.Column="2" Style="{StaticResource Text.Cell}" Text="{Binding To}" ToolTip="{Binding To}" />
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<DockPanel Grid.Row="4" Margin="0,16,0,0">
<Button DockPanel.Dock="Right" Style="{StaticResource Button.Primary}" Content="{l:Loc Archive.Rename.Apply}" Command="{Binding ApplyCommand}"
ToolTip="{Binding ApplyToolTip}" MinWidth="96" Margin="8,0,0,0" />
<Button DockPanel.Dock="Right" Content="{l:Loc Archive.Dialog.Cancel}" Command="{Binding CloseCommand}" ToolTip="{Binding CloseToolTip}" IsCancel="True"
MinWidth="96" />
<TextBlock Text="{Binding BusyText}" Foreground="{DynamicResource Brush.TextMuted}" VerticalAlignment="Center" TextTrimming="CharacterEllipsis" />
</DockPanel>
</Grid>
</Border>
</DataTemplate>
<DataTemplate DataType="{x:Type ar:RetagDialogViewModel}">
<Border Style="{StaticResource Border.Dialog}" Width="520">
<StackPanel>
<TextBlock Text="{Binding Heading}" Style="{StaticResource Text.Title}" />
<Grid Margin="0,14,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="{StaticResource Grid.LabelColumn}" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Text="{l:Loc Archive.Retag.Add}" Style="{StaticResource Text.Label}" />
<TextBox Grid.Column="1" Text="{Binding Add.Text, UpdateSourceTrigger=PropertyChanged, ValidatesOnNotifyDataErrors=True}" shell:EditBehavior.Field="{Binding Add}"
ToolTip="{Binding Add.ToolTip}" AutomationProperties.Name="{l:Loc Archive.Retag.Add}" />
<TextBlock Grid.Row="1" Text="{l:Loc Archive.Retag.Remove}" Style="{StaticResource Text.Label}" Margin="0,10,14,0" />
<TextBox Grid.Row="1" Grid.Column="1" Margin="0,10,0,0" Text="{Binding Remove.Text, UpdateSourceTrigger=PropertyChanged, ValidatesOnNotifyDataErrors=True}"
shell:EditBehavior.Field="{Binding Remove}" ToolTip="{Binding Remove.ToolTip}" AutomationProperties.Name="{l:Loc Archive.Retag.Remove}" />
</Grid>
<TextBlock Text="{Binding SummaryText}" Foreground="{DynamicResource Brush.TextMuted}" Margin="0,12,0,0" Typography.NumeralAlignment="Tabular" />
<DockPanel Margin="0,18,0,0">
<Button DockPanel.Dock="Right" Style="{StaticResource Button.Primary}" Content="{l:Loc Archive.Retag.Apply}" Command="{Binding ApplyCommand}"
ToolTip="{Binding ApplyToolTip}" MinWidth="96" Margin="8,0,0,0" />
<Button DockPanel.Dock="Right" Content="{l:Loc Archive.Dialog.Cancel}" Command="{Binding CloseCommand}" ToolTip="{Binding CloseToolTip}" IsCancel="True"
MinWidth="96" />
<TextBlock Text="{Binding BusyText}" Foreground="{DynamicResource Brush.TextMuted}" VerticalAlignment="Center" TextTrimming="CharacterEllipsis" />
</DockPanel>
</StackPanel>
</Border>
</DataTemplate>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Titano;component/Archive/ArchiveDialogs.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style x:Key="Text.PanelHeading" TargetType="TextBlock" BasedOn="{StaticResource Text.Section}">
<Setter Property="FontSize" Value="13" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<Style x:Key="Button.Bar" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Height" Value="30" />
<Setter Property="Margin" Value="0,0,8,0" />
</Style>
<Style x:Key="Button.Tool" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Margin" Value="0,0,8,8" />
</Style>
<!-- Report rows with their own buttons: Tab reaches every button. -->
<Style x:Key="ListBoxItem.Duplicate" TargetType="ListBoxItem" BasedOn="{StaticResource ListBoxItem.PlainRow}">
<Setter Property="AutomationProperties.Name" Value="{Binding Row.Title}" />
</Style>
<!-- A filter menu: its values, each checked while chosen. -->
<Style x:Key="MenuItem.Choice" TargetType="MenuItem" BasedOn="{StaticResource {x:Type MenuItem}}">
<Setter Property="Header" Value="{Binding Label}" />
<Setter Property="IsChecked" Value="{Binding IsChecked, Mode=OneWay}" />
<Setter Property="Command" Value="{Binding Command}" />
<Setter Property="ToolTip" Value="{l:Loc Tooltips.Archive.FilterChoice}" />
<Setter Property="ToolTipService.ShowOnDisabled" Value="True" />
</Style>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
@@ -203,6 +81,7 @@
<MenuItem Header="{l:Loc Archive.Maintenance.DryRun}" Command="{Binding MaintenanceDryRunCommand}" ToolTip="{l:Loc Tooltips.Archive.MaintenanceDryRun}" ToolTipService.ShowOnDisabled="True" />
<MenuItem Header="{l:Loc Archive.Maintenance.Proxies}" Command="{Binding RebuildProxiesCommand}" ToolTip="{Binding RebuildProxiesToolTip}" ToolTipService.ShowOnDisabled="True" />
<MenuItem Header="{l:Loc Archive.Maintenance.Backup}" Command="{Binding BackupCommand}" ToolTip="{l:Loc Tooltips.Archive.Backup}" ToolTipService.ShowOnDisabled="True" />
<MenuItem Header="{l:Loc Archive.Maintenance.Trash}" Command="{Binding TrashCommand}" ToolTip="{l:Loc Tooltips.Archive.Trash}" ToolTipService.ShowOnDisabled="True" />
<Separator />
<MenuItem Header="{l:Loc Archive.Maintenance.Relink}" Command="{Binding RelinkCommand}" ToolTip="{l:Loc Tooltips.Archive.Relink}" ToolTipService.ShowOnDisabled="True" />
</ContextMenu>
@@ -513,6 +392,8 @@
<Button Style="{StaticResource Button.Bar}" Margin="0,0,8,8" Content="{l:Loc Archive.Set.Move}" Command="{Binding MoveSetCommand}" ToolTip="{Binding MoveSetToolTip}" />
<Button Style="{StaticResource Button.Bar}" Margin="0,0,8,8" Content="{l:Loc Archive.Set.Retag}" Command="{Binding RetagSetCommand}" ToolTip="{Binding RetagSetToolTip}" />
<Button Style="{StaticResource Button.Bar}" Margin="0,0,8,8" Content="{l:Loc Archive.Set.Export}" Command="{Binding ExportSetCommand}" ToolTip="{Binding ExportSetToolTip}" />
<Button Style="{StaticResource Button.Destructive}" Height="30" Margin="0,0,8,8" Content="{l:Loc Archive.Set.Delete}" Command="{Binding DeleteSetCommand}"
ToolTip="{Binding DeleteSetToolTip}" />
</WrapPanel>
</Border>
@@ -521,7 +402,7 @@
</ui:EmptyState>
</Grid>
<!-- In-window dialogs (rebuild, rename, retag) over a scrim; the keyboard stays inside the dialog. -->
<!-- In-window dialogs (rebuild, rename, retag, trash) over a scrim; the keyboard stays inside the dialog. -->
<Grid Visibility="{Binding IsDialogOpen, Converter={StaticResource BoolToVisibility}}" KeyboardNavigation.TabNavigation="Cycle"
KeyboardNavigation.ControlTabNavigation="Cycle" KeyboardNavigation.DirectionalNavigation="Contained">
<Border Background="{DynamicResource Brush.Scrim}" />
+27 -3
View File
@@ -25,8 +25,9 @@ namespace Titano.App.Sections;
/// <summary>
/// Archive manager (BRIEF §12.5, Archive.html): the archive's tree (years, sequences) with its availability, its
/// figures and charts, mass operations on the selected and filtered set (analyse, proxies, thumbnails, verify, rename,
/// move, retag, CSV), and the operations on the whole archive as jobs (scan, rebuild with its dialog, verify,
/// maintenance), plus the maintenance view: index health, duplicates and orphans with safe fixes, recent runs. The
/// move, retag, CSV, delete into the trash), and the operations on the whole archive as jobs (scan, rebuild with its
/// dialog, verify, maintenance), the trash, plus the maintenance view: index health, duplicates and orphans with safe
/// fixes, recent runs. The
/// tree selection is only ever changed by the user: reloads and expanding keep it.
/// </summary>
public sealed class ArchiveViewModel : SectionViewModel
@@ -96,6 +97,8 @@ public sealed class ArchiveViewModel : SectionViewModel
MoveSetCommand = new AsyncRelayCommand(() => OpenRenameDialogAsync(RenameMode.Folders), () => HasSet() && IsOnline());
RetagSetCommand = new RelayCommand(OpenRetag, () => HasSet() && IsOnline());
ExportSetCommand = new AsyncRelayCommand(ExportAsync, HasSet);
DeleteSetCommand = new AsyncRelayCommand(() => SequenceDeletion.RunAsync(Shell, [.. Set().Select(s => s.Id)]), () => HasSet() && IsOnline());
TrashCommand = new AsyncRelayCommand(OpenTrashAsync, () => _archive is not null);
FindDuplicatesCommand = new AsyncRelayCommand(FindDuplicatesAsync, () => _archive is not null && _search is null);
FindOrphansCommand = new AsyncRelayCommand(FindOrphansAsync, () => IsOnline() && _search is null);
@@ -161,6 +164,7 @@ public sealed class ArchiveViewModel : SectionViewModel
public string RenameSetToolTip => WhenSet("Tooltips.Archive.SetRename", needsOnline: true);
public string MoveSetToolTip => WhenSet("Tooltips.Archive.SetMove", needsOnline: true);
public string RetagSetToolTip => WhenSet("Tooltips.Archive.SetRetag", needsOnline: true);
public string DeleteSetToolTip => WhenSet("Tooltips.Archive.SetDelete", needsOnline: true);
public ICommand ScanCommand { get; }
public ICommand RebuildCommand { get; }
@@ -177,6 +181,9 @@ public sealed class ArchiveViewModel : SectionViewModel
public ICommand RelinkCommand { get; }
public ICommand HistoryCommand { get; }
/// <summary>"Maintenance ▾ › Trash…": the sequences deleted from this archive, each restorable.</summary>
public ICommand TrashCommand { get; }
// ---------------- Overview ----------------
public ObservableCollection<ArchiveTreeRowViewModel> TreeRows { get; } = [];
@@ -239,6 +246,9 @@ public sealed class ArchiveViewModel : SectionViewModel
public ICommand RetagSetCommand { get; }
public ICommand ExportSetCommand { get; }
/// <summary>Moves the set to the archive's trash after its dry run and a typed confirmation.</summary>
public ICommand DeleteSetCommand { get; }
/// <summary>The view reports the rows the user selected; the list's own clearing while rows are rebuilt is not a choice.</summary>
public void SetSelection(IEnumerable<ArchiveTreeRowViewModel> rows)
{
@@ -310,7 +320,7 @@ public sealed class ArchiveViewModel : SectionViewModel
// ---------------- Dialogs ----------------
/// <summary>The open in-window dialog (rebuild, rename, retag); null when none.</summary>
/// <summary>The open in-window dialog (rebuild, rename, retag, trash); null when none.</summary>
public ArchiveDialogViewModel? Dialog
{
get => _dialog;
@@ -499,6 +509,7 @@ public sealed class ArchiveViewModel : SectionViewModel
OnPropertyChanged(nameof(RenameSetToolTip));
OnPropertyChanged(nameof(MoveSetToolTip));
OnPropertyChanged(nameof(RetagSetToolTip));
OnPropertyChanged(nameof(DeleteSetToolTip));
CommandManager.InvalidateRequerySuggested();
}
@@ -625,6 +636,19 @@ public sealed class ArchiveViewModel : SectionViewModel
await dialog.PlanAsync();
}
/// <summary>Opens the trash of the archive and reads it.</summary>
public async Task OpenTrashAsync()
{
if (Services.Archives is not { } archives || _archive is not { } archive) return;
var dialog = new TrashDialogViewModel(archives, archive, async () =>
{
await LoadAsync();
await Shell.Library.RefreshAsync();
}, CloseDialog);
OpenDialog(dialog);
await dialog.LoadAsync();
}
private void OpenRetag()
{
if (Services.Archives is not { } archives) return;
+338 -186
View File
@@ -4,180 +4,310 @@
xmlns:ui="clr-namespace:Titano.Ui.Controls;assembly=Titano.Ui"
xmlns:v="clr-namespace:Titano.Ui.Visuals;assembly=Titano.Ui"
xmlns:l="clr-namespace:Titano.Ui.Localization;assembly=Titano.Ui"
xmlns:lib="clr-namespace:Titano.App.Library">
xmlns:lib="clr-namespace:Titano.App.Library"
xmlns:shell="clr-namespace:Titano.App.Shell">
<UserControl.Resources>
<Style x:Key="ListBoxItem.LibraryCard" TargetType="ListBoxItem" BasedOn="{StaticResource ListBoxItem.Card}">
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
<Setter Property="AutomationProperties.Name" Value="{Binding Title}" />
</Style>
<Style x:Key="ListBoxItem.LibraryRow" TargetType="ListBoxItem" BasedOn="{StaticResource ListBoxItem.Row}">
<Setter Property="Height" Value="38" />
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
<Setter Property="AutomationProperties.Name" Value="{Binding Title}" />
</Style>
<Style x:Key="Button.Header" TargetType="Button" BasedOn="{StaticResource Button.Subtle}">
<Setter Property="Height" Value="28" />
<Setter Property="MinWidth" Value="0" />
<Setter Property="Padding" Value="0" />
<Setter Property="FontSize" Value="11" />
<Setter Property="Foreground" Value="{DynamicResource Brush.TextFaint}" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="ui:ControlState.HoverBackground" Value="Transparent" />
</Style>
<DataTemplate x:Key="Template.Status" DataType="{x:Type v:CardStatus}">
<ui:StatusGlyph Kind="{Binding Kind}" Text="{Binding Text}" ToolTip="{Binding ToolTip}" Margin="0,0,8,0" />
</DataTemplate>
<ItemsPanelTemplate x:Key="Panel.Row">
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Titano;component/Archive/ArchiveDialogs.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style x:Key="ListBoxItem.LibraryCard" TargetType="ListBoxItem" BasedOn="{StaticResource ListBoxItem.Card}">
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
<Setter Property="AutomationProperties.Name" Value="{Binding Title}" />
</Style>
<Style x:Key="ListBoxItem.LibraryRow" TargetType="ListBoxItem" BasedOn="{StaticResource ListBoxItem.Row}">
<Setter Property="Height" Value="38" />
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
<Setter Property="AutomationProperties.Name" Value="{Binding Title}" />
</Style>
<Style x:Key="Button.Header" TargetType="Button" BasedOn="{StaticResource Button.Subtle}">
<Setter Property="Height" Value="28" />
<Setter Property="MinWidth" Value="0" />
<Setter Property="Padding" Value="0" />
<Setter Property="FontSize" Value="11" />
<Setter Property="Foreground" Value="{DynamicResource Brush.TextFaint}" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="ui:ControlState.HoverBackground" Value="Transparent" />
</Style>
<Style x:Key="Button.Bar" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Height" Value="30" />
<Setter Property="Margin" Value="0,0,8,8" />
</Style>
<!-- Quick actions revealed on a card (28 px) or a row (26 px, DESIGN §4). -->
<Style x:Key="Button.Quick" TargetType="Button" BasedOn="{StaticResource Button.Icon}">
<Setter Property="Width" Value="28" />
<Setter Property="Height" Value="28" />
<Setter Property="MinWidth" Value="28" />
<Setter Property="Margin" Value="6,0,0,0" />
</Style>
<Style x:Key="Button.RowQuick" TargetType="Button" BasedOn="{StaticResource Button.Quick}">
<Setter Property="Width" Value="26" />
<Setter Property="Height" Value="26" />
<Setter Property="MinWidth" Value="26" />
</Style>
<!-- A menu of choices (saved views, ratings): each checked while it is the one in force. -->
<Style x:Key="MenuItem.View" TargetType="MenuItem" BasedOn="{StaticResource {x:Type MenuItem}}">
<Setter Property="Header" Value="{Binding Label}" />
<Setter Property="IsChecked" Value="{Binding IsChecked, Mode=OneWay}" />
<Setter Property="Command" Value="{Binding Command}" />
<Setter Property="ToolTip" Value="{l:Loc Tooltips.Library.ViewChoice}" />
</Style>
<Style x:Key="MenuItem.Rating" TargetType="MenuItem" BasedOn="{StaticResource MenuItem.View}">
<Setter Property="ToolTip" Value="{l:Loc Tooltips.Library.RateChoice}" />
</Style>
<DataTemplate x:Key="Template.Status" DataType="{x:Type v:CardStatus}">
<ui:StatusGlyph Kind="{Binding Kind}" Text="{Binding Text}" ToolTip="{Binding ToolTip}" Margin="0,0,8,0" />
</DataTemplate>
<ItemsPanelTemplate x:Key="Panel.Row">
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
<!-- Save view / Rename view: one name field. -->
<DataTemplate DataType="{x:Type lib:ViewNameDialogViewModel}">
<Border Style="{StaticResource Border.Dialog}" Width="460">
<StackPanel>
<TextBlock Text="{Binding Heading}" Style="{StaticResource Text.Title}" />
<Grid Margin="0,14,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="{StaticResource Grid.LabelColumn}" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Text="{l:Loc Library.Views.Name}" Style="{StaticResource Text.Label}" />
<TextBox Grid.Column="1" Text="{Binding Name.Text, UpdateSourceTrigger=PropertyChanged, ValidatesOnNotifyDataErrors=True}" shell:EditBehavior.Field="{Binding Name}"
ToolTip="{Binding Name.ToolTip}" AutomationProperties.Name="{l:Loc Library.Views.Name}" />
</Grid>
<DockPanel Margin="0,18,0,0">
<Button DockPanel.Dock="Right" Style="{StaticResource Button.Primary}" Content="{l:Loc Library.Views.Save}" Command="{Binding SaveCommand}"
ToolTip="{Binding SaveToolTip}" IsDefault="True" MinWidth="96" Margin="8,0,0,0" />
<Button DockPanel.Dock="Right" Content="{l:Loc Archive.Dialog.Cancel}" Command="{Binding CloseCommand}" ToolTip="{Binding CloseToolTip}" IsCancel="True"
MinWidth="96" />
<TextBlock Text="{Binding BusyText}" Foreground="{DynamicResource Brush.TextMuted}" VerticalAlignment="Center" TextTrimming="CharacterEllipsis" />
</DockPanel>
</StackPanel>
</Border>
</DataTemplate>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="56" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid IsEnabled="{Binding IsContentEnabled}">
<Grid.RowDefinitions>
<RowDefinition Height="56" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!-- Toolbar (Main.html): search, filters, sort · view switch, rescan. -->
<DockPanel Grid.ColumnSpan="2" Margin="20,0" LastChildFill="False">
<Button DockPanel.Dock="Right" Style="{StaticResource Button.Icon}" ui:ButtonIcon.Glyph="{StaticResource Icon.Refresh}" Command="{Binding RescanCommand}"
ToolTip="{l:Loc Tooltips.Library.Rescan}" AutomationProperties.Name="{l:Loc Library.Rescan}" Margin="10,0,0,0" />
<v:SegmentedControl DockPanel.Dock="Right" SelectedIndex="{Binding LayoutIndex, Mode=TwoWay}" AutomationProperties.Name="{l:Loc Library.View}">
<v:SegmentedItem Glyph="{StaticResource Icon.ViewGrid}" ToolTip="{l:Loc Tooltips.Library.Grid}" AutomationProperties.Name="{l:Loc Library.View.Grid}" />
<v:SegmentedItem Glyph="{StaticResource Icon.ViewList}" ToolTip="{l:Loc Tooltips.Library.List}" AutomationProperties.Name="{l:Loc Library.View.List}" />
</v:SegmentedControl>
<TextBox Width="260" Text="{Binding SearchText, UpdateSourceTrigger=PropertyChanged}" ui:Field.Glyph="{StaticResource Icon.Search}"
ui:Field.Placeholder="{l:Loc Library.Search}" ToolTip="{l:Loc Tooltips.Library.Search}" AutomationProperties.Name="{l:Loc Library.Search}" />
<ComboBox Style="{StaticResource ComboBox.Filter}" Margin="10,0,0,0" ItemsSource="{Binding Years}" SelectedItem="{Binding SelectedYear}" Tag="{Binding IsYearFiltered}"
ItemTemplate="{StaticResource Template.FilterOption}" ToolTip="{l:Loc Tooltips.Library.Year}" AutomationProperties.Name="{l:Loc Library.Filter.Year}" />
<ComboBox Style="{StaticResource ComboBox.Filter}" Margin="10,0,0,0" ItemsSource="{Binding Cameras}" SelectedItem="{Binding SelectedCamera}" Tag="{Binding IsCameraFiltered}"
ItemTemplate="{StaticResource Template.FilterOption}" ToolTip="{l:Loc Tooltips.Library.Camera}" AutomationProperties.Name="{l:Loc Library.Filter.Camera}" />
<ComboBox Style="{StaticResource ComboBox.Filter}" Margin="10,0,0,0" ItemsSource="{Binding Statuses}" SelectedItem="{Binding SelectedStatus}" Tag="{Binding IsStatusFiltered}"
ItemTemplate="{StaticResource Template.FilterOption}" ToolTip="{l:Loc Tooltips.Library.Status}" AutomationProperties.Name="{l:Loc Library.Filter.Status}" />
<ComboBox Style="{StaticResource ComboBox.Filter}" Margin="10,0,0,0" ItemsSource="{Binding Tags}" SelectedItem="{Binding SelectedTag}" Tag="{Binding IsTagFiltered}"
ItemTemplate="{StaticResource Template.FilterOption}" ToolTip="{l:Loc Tooltips.Library.Tags}" AutomationProperties.Name="{l:Loc Library.Filter.Tags}" />
<ComboBox Style="{StaticResource ComboBox.Filter}" Margin="10,0,0,0" ItemsSource="{Binding Sorts}" SelectedItem="{Binding SelectedSort}"
ItemTemplate="{StaticResource Template.FilterOption}" ToolTip="{l:Loc Tooltips.Library.Sort}" AutomationProperties.Name="{l:Loc Library.Sort}" />
</DockPanel>
<!-- Grid view: virtualised, recycling card grid. -->
<ListBox x:Name="CardGrid" Grid.Row="1" Style="{StaticResource ListBox.Cards}" ItemsSource="{Binding Items}" ItemContainerStyle="{StaticResource ListBoxItem.LibraryCard}"
Visibility="{Binding IsGrid, Converter={StaticResource BoolToVisibility}}" AutomationProperties.Name="{l:Loc Shell.Nav.Library}"
ScrollViewer.ScrollChanged="OnScrollChanged">
<ListBox.InputBindings>
<MouseBinding Gesture="LeftDoubleClick" Command="{Binding OpenCommand}" />
<KeyBinding Key="Enter" Command="{Binding OpenCommand}" />
</ListBox.InputBindings>
<ListBox.ItemTemplate>
<DataTemplate DataType="{x:Type lib:SequenceItem}">
<v:SequenceCard Title="{Binding Title}" Subtitle="{Binding Subtitle}" Statuses="{Binding Statuses}" Thumbnail="{Binding Thumbnail}"
ScrubSource="{Binding ScrubSource}" lib:ThumbnailLoading.Width="236"
IsSelected="{Binding IsSelected, RelativeSource={RelativeSource AncestorType=ListBoxItem}, Mode=TwoWay}"
SelectToolTip="{l:Loc Tooltips.Library.Select}" ToolTip="{l:Loc Tooltips.Library.Card}">
<v:SequenceCard.ActionsContent>
<StackPanel Orientation="Horizontal">
<Button Style="{StaticResource Button.Icon}" Width="28" Height="28" MinWidth="28" ui:ButtonIcon.Glyph="{StaticResource Icon.Sequence}"
Command="{Binding DataContext.OpenItemCommand, RelativeSource={RelativeSource AncestorType=ListBox}}" CommandParameter="{Binding}"
ToolTip="{l:Loc Tooltips.Library.Open}" AutomationProperties.Name="{l:Loc Library.Action.Open}" Margin="0,0,6,0" />
<Button Style="{StaticResource Button.Icon}" Width="28" Height="28" MinWidth="28" ui:ButtonIcon.Glyph="{StaticResource Icon.Analyse}"
Command="{Binding DataContext.AnalyseItemCommand, RelativeSource={RelativeSource AncestorType=ListBox}}" CommandParameter="{Binding}"
ToolTip="{l:Loc Tooltips.Library.Analyse}" AutomationProperties.Name="{l:Loc Library.Action.Analyse}" />
</StackPanel>
</v:SequenceCard.ActionsContent>
</v:SequenceCard>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<!-- List view: virtualised table with sortable headers. -->
<Border Grid.Row="1" Style="{StaticResource Border.Panel}" Margin="20,4,20,12" Visibility="{Binding IsList, Converter={StaticResource BoolToVisibility}}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Border BorderBrush="{DynamicResource Brush.Stroke}" BorderThickness="0,0,0,1" Padding="14,2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" MinWidth="180" />
<ColumnDefinition Width="110" />
<ColumnDefinition Width="170" />
<ColumnDefinition Width="80" />
<ColumnDefinition Width="90" />
<ColumnDefinition Width="80" />
<ColumnDefinition Width="90" />
<ColumnDefinition Width="150" />
</Grid.ColumnDefinitions>
<Button Style="{StaticResource Button.Header}" Content="{l:Loc Library.Column.Sequence}" Command="{Binding SortByCommand}" CommandParameter="Title" ToolTip="{l:Loc Tooltips.Library.SortTitle}" />
<Button Grid.Column="1" Style="{StaticResource Button.Header}" Content="{l:Loc Library.Column.Date}" Command="{Binding SortByCommand}" CommandParameter="Date" ToolTip="{l:Loc Tooltips.Library.SortDate}" Margin="10,0,0,0" />
<TextBlock Grid.Column="2" Style="{StaticResource Text.Header}" Text="{l:Loc Library.Column.Camera}" Margin="10,0,0,0" />
<Button Grid.Column="3" Style="{StaticResource Button.Header}" Content="{l:Loc Library.Column.Frames}" HorizontalContentAlignment="Right" Command="{Binding SortByCommand}" CommandParameter="FrameCount" ToolTip="{l:Loc Tooltips.Library.SortFrames}" Margin="10,0,0,0" />
<TextBlock Grid.Column="4" Style="{StaticResource Text.Header}" Text="{l:Loc Library.Column.Span}" TextAlignment="Right" Margin="10,0,0,0" />
<TextBlock Grid.Column="5" Style="{StaticResource Text.Header}" Text="{l:Loc Library.Column.Interval}" TextAlignment="Right" Margin="10,0,0,0" />
<Button Grid.Column="6" Style="{StaticResource Button.Header}" Content="{l:Loc Library.Column.Size}" HorizontalContentAlignment="Right" Command="{Binding SortByCommand}" CommandParameter="Size" ToolTip="{l:Loc Tooltips.Library.SortSize}" Margin="10,0,0,0" />
<TextBlock Grid.Column="7" Style="{StaticResource Text.Header}" Text="{l:Loc Library.Column.State}" Margin="16,0,0,0" />
</Grid>
</Border>
<ListBox x:Name="RowList" Grid.Row="1" ItemsSource="{Binding Items}" ItemContainerStyle="{StaticResource ListBoxItem.LibraryRow}" SelectionMode="Extended"
VirtualizingPanel.IsVirtualizing="True" VirtualizingPanel.VirtualizationMode="Recycling" VirtualizingPanel.ScrollUnit="Pixel"
ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.ScrollChanged="OnScrollChanged" AutomationProperties.Name="{l:Loc Shell.Nav.Library}">
<ListBox.InputBindings>
<MouseBinding Gesture="LeftDoubleClick" Command="{Binding OpenCommand}" />
<KeyBinding Key="Enter" Command="{Binding OpenCommand}" />
</ListBox.InputBindings>
<ListBox.ItemTemplate>
<DataTemplate DataType="{x:Type lib:SequenceItem}">
<Grid ToolTip="{l:Loc Tooltips.Library.Row}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" MinWidth="180" />
<ColumnDefinition Width="110" />
<ColumnDefinition Width="170" />
<ColumnDefinition Width="80" />
<ColumnDefinition Width="90" />
<ColumnDefinition Width="80" />
<ColumnDefinition Width="90" />
<ColumnDefinition Width="150" />
</Grid.ColumnDefinitions>
<TextBlock Style="{StaticResource Text.Cell}" Text="{Binding Title}" />
<TextBlock Grid.Column="1" Style="{StaticResource Text.Cell}" Text="{Binding DateText}" Margin="10,0,0,0" Foreground="{DynamicResource Brush.TextMuted}" />
<TextBlock Grid.Column="2" Style="{StaticResource Text.Cell}" Text="{Binding Camera}" Margin="10,0,0,0" Foreground="{DynamicResource Brush.TextMuted}" />
<TextBlock Grid.Column="3" Style="{StaticResource Text.CellNumber}" Text="{Binding FramesText}" Margin="10,0,0,0" />
<TextBlock Grid.Column="4" Style="{StaticResource Text.CellNumber}" Text="{Binding SpanText}" Margin="10,0,0,0" />
<TextBlock Grid.Column="5" Style="{StaticResource Text.CellNumber}" Text="{Binding IntervalText}" Margin="10,0,0,0" />
<TextBlock Grid.Column="6" Style="{StaticResource Text.CellNumber}" Text="{Binding SizeText}" Margin="10,0,0,0" />
<ItemsControl Grid.Column="7" Margin="16,0,0,0" ItemsSource="{Binding Statuses}" ItemTemplate="{StaticResource Template.Status}"
ItemsPanel="{StaticResource Panel.Row}" VerticalAlignment="Center" Focusable="False" ClipToBounds="True" />
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<!-- Toolbar (Main.html): search, filters, sort · saved views, layout switch, rescan. The search box gives way first. -->
<Grid Grid.ColumnSpan="2" Margin="20,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" MinWidth="140" MaxWidth="260" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBox VerticalAlignment="Center" Text="{Binding SearchText, UpdateSourceTrigger=PropertyChanged}" ui:Field.Glyph="{StaticResource Icon.Search}"
ui:Field.Placeholder="{l:Loc Library.Search}" ToolTip="{l:Loc Tooltips.Library.Search}" AutomationProperties.Name="{l:Loc Library.Search}" />
<StackPanel Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center">
<ComboBox Style="{StaticResource ComboBox.Filter}" Margin="10,0,0,0" ItemsSource="{Binding Years}" SelectedItem="{Binding SelectedYear}" Tag="{Binding IsYearFiltered}"
ItemTemplate="{StaticResource Template.FilterOption}" ToolTip="{l:Loc Tooltips.Library.Year}" AutomationProperties.Name="{l:Loc Library.Filter.Year}" />
<ComboBox Style="{StaticResource ComboBox.Filter}" Margin="10,0,0,0" MaxWidth="170" ItemsSource="{Binding Cameras}" SelectedItem="{Binding SelectedCamera}"
Tag="{Binding IsCameraFiltered}" ItemTemplate="{StaticResource Template.FilterOption}" ToolTip="{l:Loc Tooltips.Library.Camera}"
AutomationProperties.Name="{l:Loc Library.Filter.Camera}" />
<ComboBox Style="{StaticResource ComboBox.Filter}" Margin="10,0,0,0" ItemsSource="{Binding Statuses}" SelectedItem="{Binding SelectedStatus}" Tag="{Binding IsStatusFiltered}"
ItemTemplate="{StaticResource Template.FilterOption}" ToolTip="{l:Loc Tooltips.Library.Status}" AutomationProperties.Name="{l:Loc Library.Filter.Status}" />
<ComboBox Style="{StaticResource ComboBox.Filter}" Margin="10,0,0,0" MaxWidth="170" ItemsSource="{Binding Tags}" SelectedItem="{Binding SelectedTag}" Tag="{Binding IsTagFiltered}"
ItemTemplate="{StaticResource Template.FilterOption}" ToolTip="{l:Loc Tooltips.Library.Tags}" AutomationProperties.Name="{l:Loc Library.Filter.Tags}" />
<ComboBox Style="{StaticResource ComboBox.Filter}" Margin="10,0,0,0" ItemsSource="{Binding Origins}" SelectedItem="{Binding SelectedOrigin}" Tag="{Binding IsOriginFiltered}"
ItemTemplate="{StaticResource Template.FilterOption}" ToolTip="{l:Loc Tooltips.Library.Origin}" AutomationProperties.Name="{l:Loc Library.Filter.Origin}"
Visibility="{Binding ShowsOrigin, Converter={StaticResource BoolToVisibility}}" />
<ComboBox Style="{StaticResource ComboBox.Filter}" Margin="10,0,0,0" ItemsSource="{Binding Sorts}" SelectedItem="{Binding SelectedSort}"
ItemTemplate="{StaticResource Template.FilterOption}" ToolTip="{l:Loc Tooltips.Library.Sort}" AutomationProperties.Name="{l:Loc Library.Sort}" />
</StackPanel>
<StackPanel Grid.Column="3" Orientation="Horizontal" VerticalAlignment="Center" Margin="10,0,0,0">
<Button x:Name="ViewsButton" Click="OnOpenMenu" ui:ButtonIcon.Glyph="{StaticResource Icon.Filter}" ToolTip="{Binding ViewsToolTip}"
AutomationProperties.Name="{l:Loc Library.Views}" Margin="0,0,10,0">
<Button.Style>
<Style TargetType="Button" BasedOn="{StaticResource Button.Icon}">
<Style.Triggers>
<DataTrigger Binding="{Binding IsViewActive}" Value="True">
<Setter Property="BorderBrush" Value="{DynamicResource Brush.Accent}" />
<Setter Property="Foreground" Value="{DynamicResource Brush.Accent}" />
</DataTrigger>
</Style.Triggers>
</Style>
</Button.Style>
<Button.ContextMenu>
<ContextMenu>
<MenuItem Header="{l:Loc Library.Views.Apply}" ItemsSource="{Binding ViewChoices}" ItemContainerStyle="{StaticResource MenuItem.View}"
IsEnabled="{Binding HasViews}" ToolTip="{l:Loc Tooltips.Library.ViewsApply}" ToolTipService.ShowOnDisabled="True" />
<Separator />
<MenuItem Header="{l:Loc Library.Views.SaveMenu}" Command="{Binding SaveViewCommand}" ToolTip="{l:Loc Tooltips.Library.ViewSave}" ToolTipService.ShowOnDisabled="True" />
<MenuItem Header="{l:Loc Library.Views.RenameMenu}" Command="{Binding RenameViewCommand}" ToolTip="{l:Loc Tooltips.Library.ViewRename}"
ToolTipService.ShowOnDisabled="True" />
<MenuItem Header="{l:Loc Library.Views.Delete}" Command="{Binding DeleteViewCommand}" ToolTip="{l:Loc Tooltips.Library.ViewDelete}"
ToolTipService.ShowOnDisabled="True" />
</ContextMenu>
</Button.ContextMenu>
</Button>
<v:SegmentedControl SelectedIndex="{Binding LayoutIndex, Mode=TwoWay}" AutomationProperties.Name="{l:Loc Library.View}">
<v:SegmentedItem Glyph="{StaticResource Icon.ViewGrid}" ToolTip="{l:Loc Tooltips.Library.Grid}" AutomationProperties.Name="{l:Loc Library.View.Grid}" />
<v:SegmentedItem Glyph="{StaticResource Icon.ViewList}" ToolTip="{l:Loc Tooltips.Library.List}" AutomationProperties.Name="{l:Loc Library.View.List}" />
<v:SegmentedItem Glyph="{StaticResource Icon.ViewTimeline}" ToolTip="{l:Loc Tooltips.Library.Timeline}" AutomationProperties.Name="{l:Loc Library.View.Timeline}" />
</v:SegmentedControl>
<Button Style="{StaticResource Button.Icon}" ui:ButtonIcon.Glyph="{StaticResource Icon.Refresh}" Command="{Binding RescanCommand}"
ToolTip="{l:Loc Tooltips.Library.Rescan}" AutomationProperties.Name="{l:Loc Library.Rescan}" Margin="10,0,0,0" />
</StackPanel>
</Grid>
</Border>
<!-- Empty states: one sentence plus the first actions (Components.html). -->
<ui:EmptyState Grid.Row="1" Message="{l:Loc Library.Empty}" Visibility="{Binding IsLibraryEmpty, Converter={StaticResource BoolToVisibility}}">
<StackPanel Orientation="Horizontal">
<Button Style="{StaticResource Button.Primary}" Content="{l:Loc Library.Empty.ImportCard}" Command="{Binding ImportCardCommand}" ToolTip="{l:Loc Tooltips.Library.ImportCard}" Margin="0,0,8,0" />
<Button Content="{l:Loc Library.Empty.Adopt}" Command="{Binding AdoptFolderCommand}" ToolTip="{l:Loc Tooltips.Library.Adopt}" Margin="0,0,8,0" />
<Button Content="{l:Loc Library.Empty.Connect}" Command="{Binding ConnectCommand}" ToolTip="{l:Loc Tooltips.Library.Connect}" />
</StackPanel>
</ui:EmptyState>
<ui:EmptyState Grid.Row="1" Message="{l:Loc Library.NoMatch}" Visibility="{Binding IsNoMatch, Converter={StaticResource BoolToVisibility}}">
<Button Content="{l:Loc Library.ClearFilters}" Command="{Binding ClearFiltersCommand}" ToolTip="{l:Loc Tooltips.Library.ClearFilters}" />
</ui:EmptyState>
<!-- Timeline: one band per year, photos per month; a month narrows to its year and scrolls the grid to it. -->
<Border Grid.Row="1" Grid.ColumnSpan="2" Style="{StaticResource Border.Panel}" Margin="20,4,20,8" Padding="14,8"
Visibility="{Binding IsTimeline, Converter={StaticResource BoolToVisibility}}">
<ScrollViewer MaxHeight="172" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" Focusable="False">
<v:TimelineBands x:Name="Timeline" Bands="{Binding TimelineBands}" SlotLabels="{Binding MonthLabels}" BandHeight="56"
CurrentBand="{Binding TimelineBand, Mode=OneWay}" CurrentSlot="{Binding TimelineSlot, Mode=OneWay}" ValueFormatter="{Binding CountFormatter}"
SlotActivated="OnSlotActivated" ToolTip="{l:Loc Tooltips.Library.TimelineBands}" AutomationProperties.Name="{l:Loc Library.View.Timeline}" />
</ScrollViewer>
</Border>
<!-- Selection panel (320 px, DESIGN §3). -->
<Border Grid.Row="1" Grid.Column="1" Width="320" Margin="0,4,20,12" Style="{StaticResource Border.Panel}" Padding="16"
Visibility="{Binding HasSelection, Converter={StaticResource BoolToVisibility}}">
<Grid>
<!-- One sequence -->
<ScrollViewer VerticalScrollBarVisibility="Auto" Focusable="False" DataContext="{Binding Selected}"
Visibility="{Binding DataContext.IsSingleSelection, RelativeSource={RelativeSource AncestorType=UserControl}, Converter={StaticResource BoolToVisibility}}">
<!-- Grid view (also under the timeline): virtualised, recycling card grid. -->
<ListBox x:Name="CardGrid" Grid.Row="2" Style="{StaticResource ListBox.Cards}" ItemsSource="{Binding Items}" ItemContainerStyle="{StaticResource ListBoxItem.LibraryCard}"
Visibility="{Binding IsGrid, Converter={StaticResource BoolToVisibility}}" AutomationProperties.Name="{l:Loc Shell.Nav.Library}"
ScrollViewer.ScrollChanged="OnScrollChanged">
<ListBox.InputBindings>
<MouseBinding Gesture="LeftDoubleClick" Command="{Binding OpenCommand}" />
<KeyBinding Key="Enter" Command="{Binding OpenCommand}" />
</ListBox.InputBindings>
<ListBox.ItemTemplate>
<DataTemplate DataType="{x:Type lib:SequenceItem}">
<v:SequenceCard Title="{Binding Title}" Subtitle="{Binding Subtitle}" Statuses="{Binding Statuses}" Thumbnail="{Binding Thumbnail}"
ScrubSource="{Binding ScrubSource}" lib:ThumbnailLoading.Width="236"
IsSelected="{Binding IsSelected, RelativeSource={RelativeSource AncestorType=ListBoxItem}, Mode=TwoWay}"
SelectToolTip="{l:Loc Tooltips.Library.Select}" ToolTip="{l:Loc Tooltips.Library.Card}">
<v:SequenceCard.ActionsContent>
<StackPanel Orientation="Horizontal">
<Button Style="{StaticResource Button.Quick}" ui:ButtonIcon.Glyph="{StaticResource Icon.Sequence}"
Command="{Binding DataContext.OpenItemCommand, RelativeSource={RelativeSource AncestorType=ListBox}}" CommandParameter="{Binding}"
ToolTip="{l:Loc Tooltips.Library.Open}" AutomationProperties.Name="{l:Loc Library.Action.Open}" />
<Button Style="{StaticResource Button.Quick}" ui:ButtonIcon.Glyph="{StaticResource Icon.Analyse}"
Command="{Binding DataContext.AnalyseItemCommand, RelativeSource={RelativeSource AncestorType=ListBox}}" CommandParameter="{Binding}"
ToolTip="{l:Loc Tooltips.Library.Analyse}" AutomationProperties.Name="{l:Loc Library.Action.Analyse}" />
<Button Style="{StaticResource Button.Quick}" ui:ButtonIcon.Glyph="{StaticResource Icon.Render}"
Command="{Binding DataContext.RenderItemCommand, RelativeSource={RelativeSource AncestorType=ListBox}}" CommandParameter="{Binding}"
ToolTip="{Binding RenderToolTip}" AutomationProperties.Name="{l:Loc Library.Action.Render}" />
<Button Style="{StaticResource Button.Quick}" ui:ButtonIcon.Glyph="{StaticResource Icon.Sync}"
Command="{Binding DataContext.SyncItemCommand, RelativeSource={RelativeSource AncestorType=ListBox}}" CommandParameter="{Binding}"
ToolTip="{Binding SyncToolTip}" AutomationProperties.Name="{l:Loc Library.Action.Sync}" />
</StackPanel>
</v:SequenceCard.ActionsContent>
</v:SequenceCard>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<!-- List view: virtualised table with sortable headers; columns share the width, row actions appear on the hovered row. -->
<Border Grid.Row="2" Grid.ColumnSpan="2" Style="{StaticResource Border.Panel}" Margin="20,4,20,12" Visibility="{Binding IsList, Converter={StaticResource BoolToVisibility}}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Border BorderBrush="{DynamicResource Brush.Stroke}" BorderThickness="0,0,0,1" Padding="14,2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*" MinWidth="160" />
<ColumnDefinition Width="100" />
<ColumnDefinition Width="*" MinWidth="100" />
<ColumnDefinition Width="72" />
<ColumnDefinition Width="80" />
<ColumnDefinition Width="64" />
<ColumnDefinition Width="80" />
<ColumnDefinition Width="*" MinWidth="120" />
</Grid.ColumnDefinitions>
<Button Style="{StaticResource Button.Header}" Content="{l:Loc Library.Column.Sequence}" Command="{Binding SortByCommand}" CommandParameter="Title" ToolTip="{l:Loc Tooltips.Library.SortTitle}" />
<Button Grid.Column="1" Style="{StaticResource Button.Header}" Content="{l:Loc Library.Column.Date}" Command="{Binding SortByCommand}" CommandParameter="Date" ToolTip="{l:Loc Tooltips.Library.SortDate}" Margin="10,0,0,0" />
<TextBlock Grid.Column="2" Style="{StaticResource Text.Header}" Text="{l:Loc Library.Column.Camera}" Margin="10,0,0,0" />
<Button Grid.Column="3" Style="{StaticResource Button.Header}" Content="{l:Loc Library.Column.Frames}" HorizontalContentAlignment="Right" Command="{Binding SortByCommand}" CommandParameter="FrameCount" ToolTip="{l:Loc Tooltips.Library.SortFrames}" Margin="10,0,0,0" />
<TextBlock Grid.Column="4" Style="{StaticResource Text.Header}" Text="{l:Loc Library.Column.Span}" TextAlignment="Right" Margin="10,0,0,0" />
<TextBlock Grid.Column="5" Style="{StaticResource Text.Header}" Text="{l:Loc Library.Column.Interval}" TextAlignment="Right" Margin="10,0,0,0" />
<Button Grid.Column="6" Style="{StaticResource Button.Header}" Content="{l:Loc Library.Column.Size}" HorizontalContentAlignment="Right" Command="{Binding SortByCommand}" CommandParameter="Size" ToolTip="{l:Loc Tooltips.Library.SortSize}" Margin="10,0,0,0" />
<TextBlock Grid.Column="7" Style="{StaticResource Text.Header}" Text="{l:Loc Library.Column.State}" Margin="16,0,0,0" />
</Grid>
</Border>
<ListBox x:Name="RowList" Grid.Row="1" ItemsSource="{Binding Items}" ItemContainerStyle="{StaticResource ListBoxItem.LibraryRow}" SelectionMode="Extended"
VirtualizingPanel.IsVirtualizing="True" VirtualizingPanel.VirtualizationMode="Recycling" VirtualizingPanel.ScrollUnit="Pixel"
ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.ScrollChanged="OnScrollChanged" AutomationProperties.Name="{l:Loc Shell.Nav.Library}">
<ListBox.InputBindings>
<MouseBinding Gesture="LeftDoubleClick" Command="{Binding OpenCommand}" />
<KeyBinding Key="Enter" Command="{Binding OpenCommand}" />
</ListBox.InputBindings>
<ListBox.ItemTemplate>
<DataTemplate DataType="{x:Type lib:SequenceItem}">
<Grid ToolTip="{l:Loc Tooltips.Library.Row}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*" MinWidth="160" />
<ColumnDefinition Width="100" />
<ColumnDefinition Width="*" MinWidth="100" />
<ColumnDefinition Width="72" />
<ColumnDefinition Width="80" />
<ColumnDefinition Width="64" />
<ColumnDefinition Width="80" />
<ColumnDefinition Width="*" MinWidth="120" />
</Grid.ColumnDefinitions>
<TextBlock Style="{StaticResource Text.Cell}" Text="{Binding Title}" />
<TextBlock Grid.Column="1" Style="{StaticResource Text.Cell}" Text="{Binding DateText}" Margin="10,0,0,0" Foreground="{DynamicResource Brush.TextMuted}" />
<TextBlock Grid.Column="2" Style="{StaticResource Text.Cell}" Text="{Binding Camera}" Margin="10,0,0,0" Foreground="{DynamicResource Brush.TextMuted}" />
<TextBlock Grid.Column="3" Style="{StaticResource Text.CellNumber}" Text="{Binding FramesText}" Margin="10,0,0,0" />
<TextBlock Grid.Column="4" Style="{StaticResource Text.CellNumber}" Text="{Binding SpanText}" Margin="10,0,0,0" />
<TextBlock Grid.Column="5" Style="{StaticResource Text.CellNumber}" Text="{Binding IntervalText}" Margin="10,0,0,0" />
<TextBlock Grid.Column="6" Style="{StaticResource Text.CellNumber}" Text="{Binding SizeText}" Margin="10,0,0,0" />
<ItemsControl Grid.Column="7" Margin="16,0,0,0" ItemsSource="{Binding Statuses}" ItemTemplate="{StaticResource Template.Status}"
ItemsPanel="{StaticResource Panel.Row}" VerticalAlignment="Center" Focusable="False" ClipToBounds="True" />
<Border Grid.Column="7" HorizontalAlignment="Right" Background="{DynamicResource Brush.Card}" Padding="6,0,0,0"
Visibility="{Binding IsMouseOver, RelativeSource={RelativeSource AncestorType=ListBoxItem}, Converter={StaticResource BoolToVisibility}}">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<Button Style="{StaticResource Button.RowQuick}" ui:ButtonIcon.Glyph="{StaticResource Icon.Sequence}"
Command="{Binding DataContext.OpenItemCommand, RelativeSource={RelativeSource AncestorType=ListBox}}" CommandParameter="{Binding}"
ToolTip="{l:Loc Tooltips.Library.Open}" AutomationProperties.Name="{l:Loc Library.Action.Open}" />
<Button Style="{StaticResource Button.RowQuick}" ui:ButtonIcon.Glyph="{StaticResource Icon.Analyse}"
Command="{Binding DataContext.AnalyseItemCommand, RelativeSource={RelativeSource AncestorType=ListBox}}" CommandParameter="{Binding}"
ToolTip="{l:Loc Tooltips.Library.Analyse}" AutomationProperties.Name="{l:Loc Library.Action.Analyse}" />
<Button Style="{StaticResource Button.RowQuick}" ui:ButtonIcon.Glyph="{StaticResource Icon.Render}"
Command="{Binding DataContext.RenderItemCommand, RelativeSource={RelativeSource AncestorType=ListBox}}" CommandParameter="{Binding}"
ToolTip="{Binding RenderToolTip}" AutomationProperties.Name="{l:Loc Library.Action.Render}" />
<Button Style="{StaticResource Button.RowQuick}" ui:ButtonIcon.Glyph="{StaticResource Icon.Sync}"
Command="{Binding DataContext.SyncItemCommand, RelativeSource={RelativeSource AncestorType=ListBox}}" CommandParameter="{Binding}"
ToolTip="{Binding SyncToolTip}" AutomationProperties.Name="{l:Loc Library.Action.Sync}" />
</StackPanel>
</Border>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</Border>
<!-- Empty states: one sentence plus the first actions (Components.html). -->
<ui:EmptyState Grid.Row="2" Grid.ColumnSpan="2" Message="{l:Loc Library.Empty}" Visibility="{Binding IsLibraryEmpty, Converter={StaticResource BoolToVisibility}}">
<StackPanel Orientation="Horizontal">
<Button Style="{StaticResource Button.Primary}" Content="{l:Loc Library.Empty.ImportCard}" Command="{Binding ImportCardCommand}" ToolTip="{l:Loc Tooltips.Library.ImportCard}" Margin="0,0,8,0" />
<Button Content="{l:Loc Library.Empty.Adopt}" Command="{Binding AdoptFolderCommand}" ToolTip="{l:Loc Tooltips.Library.Adopt}" Margin="0,0,8,0" />
<Button Content="{l:Loc Library.Empty.Connect}" Command="{Binding ConnectCommand}" ToolTip="{l:Loc Tooltips.Library.Connect}" />
</StackPanel>
</ui:EmptyState>
<ui:EmptyState Grid.Row="2" Grid.ColumnSpan="2" Message="{l:Loc Library.NoMatch}" Visibility="{Binding IsNoMatch, Converter={StaticResource BoolToVisibility}}">
<Button Content="{l:Loc Library.ClearFilters}" Command="{Binding ClearFiltersCommand}" ToolTip="{l:Loc Tooltips.Library.ClearFilters}" />
</ui:EmptyState>
<!-- One sequence selected in the grid or the timeline: its details (320 px, DESIGN §3). -->
<Border Grid.Row="2" Grid.Column="1" Width="320" Margin="0,4,20,12" Style="{StaticResource Border.Panel}" Padding="16"
Visibility="{Binding ShowsDetails, Converter={StaticResource BoolToVisibility}}">
<ScrollViewer VerticalScrollBarVisibility="Auto" Focusable="False" DataContext="{Binding Selected}">
<StackPanel>
<v:AspectRatioDecorator>
<Border CornerRadius="6" Background="{DynamicResource Brush.Preview}">
@@ -225,31 +355,53 @@
<Button Style="{StaticResource Button.Primary}" Content="{l:Loc Library.Action.Open}" HorizontalAlignment="Stretch" Margin="0,18,0,0"
Command="{Binding DataContext.OpenCommand, RelativeSource={RelativeSource AncestorType=UserControl}}" ToolTip="{l:Loc Tooltips.Library.Open}" />
<WrapPanel Margin="0,8,0,0">
<Button Content="{l:Loc Library.Action.Analyse}" Command="{Binding DataContext.AnalyseCommand, RelativeSource={RelativeSource AncestorType=UserControl}}"
ToolTip="{l:Loc Tooltips.Library.Analyse}" ui:ButtonIcon.Glyph="{StaticResource Icon.Analyse}" Margin="0,0,8,8" />
<Button Content="{l:Loc Library.Action.Proxies}" Command="{Binding DataContext.ProxiesCommand, RelativeSource={RelativeSource AncestorType=UserControl}}"
ToolTip="{l:Loc Tooltips.Library.Proxies}" ui:ButtonIcon.Glyph="{StaticResource Icon.Layers}" Margin="0,0,8,8" />
<Button Content="{l:Loc Library.Action.Verify}" Command="{Binding DataContext.VerifyCommand, RelativeSource={RelativeSource AncestorType=UserControl}}"
ToolTip="{l:Loc Tooltips.Library.Verify}" ui:ButtonIcon.Glyph="{StaticResource Icon.Verify}" Margin="0,0,8,8" />
<Button Content="{l:Loc Library.Action.Render}" Command="{Binding DataContext.RenderItemCommand, RelativeSource={RelativeSource AncestorType=UserControl}}"
CommandParameter="{Binding}" ToolTip="{Binding RenderToolTip}" ui:ButtonIcon.Glyph="{StaticResource Icon.Render}" Margin="0,0,8,8" />
<Button Content="{l:Loc Library.Action.Folder}" Command="{Binding DataContext.RevealCommand, RelativeSource={RelativeSource AncestorType=UserControl}}"
ToolTip="{l:Loc Tooltips.Library.Folder}" ui:ButtonIcon.Glyph="{StaticResource Icon.FolderOpen}" Margin="0,0,8,8" />
</WrapPanel>
</StackPanel>
</ScrollViewer>
</Border>
<!-- Several sequences: mass actions. -->
<StackPanel Visibility="{Binding IsMultiSelection, Converter={StaticResource BoolToVisibility}}">
<TextBlock Text="{Binding SelectionTitle}" Style="{StaticResource Text.Title}" />
<TextBlock Text="{Binding SelectionSummary}" Style="{StaticResource Text.Secondary}" Margin="0,4,0,0" />
<WrapPanel Margin="0,16,0,0">
<Button Content="{l:Loc Library.Action.Analyse}" Command="{Binding AnalyseCommand}" ToolTip="{l:Loc Tooltips.Library.AnalyseAll}" ui:ButtonIcon.Glyph="{StaticResource Icon.Analyse}" Margin="0,0,8,8" />
<Button Content="{l:Loc Library.Action.Proxies}" Command="{Binding ProxiesCommand}" ToolTip="{l:Loc Tooltips.Library.ProxiesAll}" ui:ButtonIcon.Glyph="{StaticResource Icon.Layers}" Margin="0,0,8,8" />
<Button Content="{l:Loc Library.Action.Verify}" Command="{Binding VerifyCommand}" ToolTip="{l:Loc Tooltips.Library.VerifyAll}" ui:ButtonIcon.Glyph="{StaticResource Icon.Verify}" Margin="0,0,8,8" />
<Button Content="{l:Loc Library.Action.ExportList}" Command="{Binding ExportListCommand}" ToolTip="{l:Loc Tooltips.Library.ExportList}" ui:ButtonIcon.Glyph="{StaticResource Icon.Export}" Margin="0,0,8,8" />
</WrapPanel>
<Button Style="{StaticResource Button.Subtle}" Content="{l:Loc Library.Action.ClearSelection}" Command="{Binding ClearSelectionCommand}" ToolTip="{l:Loc Tooltips.Library.ClearSelection}" HorizontalAlignment="Left" Margin="0,8,0,0" />
</StackPanel>
</Grid>
</Border>
<!-- Mass actions bar on the selection (BRIEF §12.2): each button disabled with its reason when it cannot run on it. -->
<Border Grid.Row="3" Grid.ColumnSpan="2" Style="{StaticResource Border.Panel}" Padding="14,8,6,0" Margin="20,0,20,12" MinHeight="48"
Visibility="{Binding HasSelection, Converter={StaticResource BoolToVisibility}}">
<WrapPanel VerticalAlignment="Center">
<TextBlock Text="{Binding SelectionTitle}" FontWeight="SemiBold" VerticalAlignment="Center" Margin="0,0,8,8" Typography.NumeralAlignment="Tabular" />
<TextBlock Text="{Binding SelectionSummary}" Foreground="{DynamicResource Brush.TextMuted}" VerticalAlignment="Center" Margin="0,0,12,8"
Typography.NumeralAlignment="Tabular" />
<Border Width="1" Height="22" Background="{DynamicResource Brush.Stroke}" Margin="0,0,12,8" />
<Button Style="{StaticResource Button.Bar}" Content="{l:Loc Library.Action.Analyse}" Command="{Binding AnalyseCommand}" ToolTip="{Binding AnalyseToolTip}" />
<Button Style="{StaticResource Button.Bar}" Content="{l:Loc Library.Action.Proxies}" Command="{Binding ProxiesCommand}" ToolTip="{Binding ProxiesToolTip}" />
<Button Style="{StaticResource Button.Bar}" Content="{l:Loc Library.Action.Verify}" Command="{Binding VerifyCommand}" ToolTip="{Binding VerifyToolTip}" />
<Button Style="{StaticResource Button.Bar}" Content="{l:Loc Library.Action.Tag}" Command="{Binding TagCommand}" ToolTip="{Binding TagToolTip}" />
<Button Style="{StaticResource Button.Bar}" Click="OnOpenMenu" IsEnabled="{Binding CanRate}" ToolTip="{Binding RateToolTip}" AutomationProperties.Name="{l:Loc Library.Action.Rate}">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{l:Loc Library.Action.Rate}" />
<ui:Icon Glyph="{StaticResource Icon.ChevronDown}" Margin="6,0,0,0" />
</StackPanel>
<Button.ContextMenu>
<ContextMenu ItemsSource="{Binding RatingChoices}" ItemContainerStyle="{StaticResource MenuItem.Rating}" />
</Button.ContextMenu>
</Button>
<Button Style="{StaticResource Button.Bar}" Content="{l:Loc Library.Action.Move}" Command="{Binding MoveCommand}" ToolTip="{Binding MoveToolTip}" />
<Button Style="{StaticResource Button.Bar}" Content="{l:Loc Library.Action.Upload}" Command="{Binding UploadCommand}" ToolTip="{Binding UploadToolTip}" />
<Button Style="{StaticResource Button.Bar}" Content="{l:Loc Library.Action.Download}" Command="{Binding DownloadCommand}" ToolTip="{Binding DownloadToolTip}" />
<Button Style="{StaticResource Button.Bar}" Content="{l:Loc Library.Action.ExportList}" Command="{Binding ExportListCommand}" ToolTip="{Binding ExportListToolTip}" />
<Button Style="{StaticResource Button.Destructive}" Height="30" Margin="0,0,8,8" Content="{l:Loc Library.Action.Delete}" Command="{Binding DeleteCommand}"
ToolTip="{Binding DeleteToolTip}" />
<Button Style="{StaticResource Button.Subtle}" Height="30" Margin="0,0,8,8" Content="{l:Loc Library.Action.ClearSelection}" Command="{Binding ClearSelectionCommand}"
ToolTip="{l:Loc Tooltips.Library.ClearSelection}" />
</WrapPanel>
</Border>
</Grid>
<!-- In-window dialogs (tags, move, view name) over a scrim; the keyboard stays inside the dialog. -->
<Grid Visibility="{Binding IsDialogOpen, Converter={StaticResource BoolToVisibility}}" KeyboardNavigation.TabNavigation="Cycle"
KeyboardNavigation.ControlTabNavigation="Cycle" KeyboardNavigation.DirectionalNavigation="Contained">
<Border Background="{DynamicResource Brush.Scrim}" />
<ContentPresenter x:Name="DialogHost" Content="{Binding Dialog}" Margin="20" />
</Grid>
</Grid>
</UserControl>
+52 -2
View File
@@ -1,15 +1,65 @@
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Input;
using System.Windows.Threading;
using Titano.App.Library;
using Titano.Ui.Visuals;
namespace Titano.App.Sections;
public partial class LibraryView : UserControl
{
public LibraryView() => InitializeComponent();
public LibraryView()
{
InitializeComponent();
DataContextChanged += OnDataContextChanged;
}
private LibraryViewModel? Model => DataContext as LibraryViewModel;
/// <summary>Loads the next page when the grid or the list scrolls within two screens of its end.</summary>
private void OnScrollChanged(object sender, ScrollChangedEventArgs e)
{
if (DataContext is not LibraryViewModel vm || e.ExtentHeight <= 0) return;
if (Model is not { } vm || e.ExtentHeight <= 0) return;
if (e.VerticalOffset + e.ViewportHeight >= e.ExtentHeight - 2 * Math.Max(e.ViewportHeight, 200)) _ = vm.LoadMoreAsync();
}
/// <summary>A month of the timeline: the Library narrows to its year and the grid scrolls to it.</summary>
private void OnSlotActivated(object sender, ChartItemEventArgs e) => Model?.ShowMonth(e.Row, e.Column);
/// <summary>"Saved views" and "Rate ▾" open their menu under themselves.</summary>
private void OnOpenMenu(object sender, RoutedEventArgs e)
{
if (sender is not Button { ContextMenu: { } menu } button) return;
menu.DataContext = DataContext;
menu.PlacementTarget = button;
menu.Placement = PlacementMode.Bottom;
menu.IsOpen = true;
}
private void OnDataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
{
if (e.OldValue is LibraryViewModel old)
{
old.ScrollRequested -= OnScrollRequested;
old.PropertyChanged -= OnModelChanged;
}
if (e.NewValue is LibraryViewModel model)
{
model.ScrollRequested += OnScrollRequested;
model.PropertyChanged += OnModelChanged;
}
}
private void OnScrollRequested(SequenceItem item) =>
Dispatcher.BeginInvoke(DispatcherPriority.Loaded, () => CardGrid.ScrollIntoView(item));
/// <summary>A dialog that opens takes the keyboard: its first field or button.</summary>
private void OnModelChanged(object? sender, PropertyChangedEventArgs e)
{
if (e.PropertyName != nameof(LibraryViewModel.Dialog) || Model?.Dialog is null || !IsVisible) return;
Dispatcher.BeginInvoke(DispatcherPriority.Input, () => DialogHost.MoveFocus(new TraversalRequest(FocusNavigationDirection.First)));
}
}
File diff suppressed because it is too large. Load diff