Skip to content

Interactive 2D wave optics simulator. Turn any image into a refractive scene, add sources, watch waves refract, diffract and interfere. Probes, intensity maps, video export.

C#

Export dialogs remember their folder; Export last; export shortcuts

Alexander Graefe586b83f9659
diff --git a/CLAUDE.md b/CLAUDE.md
index d2d2329..22d4137 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -257,7 +257,16 @@ FrameStore: native memory up to the budget, the rest in a temp file (%LOCALAPPDA
lattice came in disabled and ran black until 2026-10-16).
**Languages**: four string tables, live switch; converter output needs the language as an extra binding input.
- **Export**: field, intensity or both, a still of the shown frame, from the current run when fresh and full,
- else a run is made first; in the dialog's order (2026-10-19) H.264 MP4 via Media Foundation (the only
+ else a run is made first. **The Save dialog starts where the session's last export of its kind went** (2026-10-28,
+ Jeroen's report, the user's rule: the first export after a project is opened starts in the project's folder under the
+ project's name as before, every one after it in the last one's folder; a run's export proposes the last name with the
+ layer suffix swapped, a still and probe data their own names; per kind and per project file, kept in the user settings
+ as `ExportHint` entries, 20 projects, restored when the project is opened, the user's choice over the project file: a
+ path belongs to the machine, not to a shared file, and an export must not dirty the project).
+ **Export last** (Ctrl+E, File menu below Export, 2026-10-28, the user's request): the session's last run export again,
+ the same layers, format and path, no dialog, an existing file or sequence folder replaced without a question; a still
+ does not count; disabled until the first run export since the project was opened. Shortcuts (the user's choice, GIMP's
+ pair): Ctrl+Shift+E, I, B the field, the intensity, both; Ctrl+Shift+F, G the two frames. In the dialog's order (2026-10-19) H.264 MP4 via Media Foundation (the only
Windows-bound library piece besides WIC JPEG, which has an in-house fallback), MPEG-1, OpenDML AVI, QuickTime
MOV with the Animation codec or the PNG codec (2026-10-19, each sample a PNG, for a lossless hand-over to Resolve,
Premiere and Final Cut; both share `.mov`, so the dialog's filter decides the format and the extension follows it,
@@ -303,7 +312,7 @@ numbers: no GPU JPEG, no OpenCL colouring at presentation, no `Vector256`, no Di
`library_check` (100+ checks: engines, store, renderer, half tables, screen path, schemes, probes, scratch, reduced preview, importer, export, parts, group move, open edges, work groups on a prime grid, ranges, XOR gate, zone plate, gate port follower, history, clipboard).
UI, all on `Common.ps1`, with their check counts: `PreviewCheck` 43, `RunCheck` 71, `LanguageCheck` 11,
-`ProbeGraphCheck` 39, `ImportCheck` 10, `ExportCheck` 38, `PreviewQualityCheck` 35, `SceneImageCheck` 8,
+`ProbeGraphCheck` 39, `ImportCheck` 10, `ExportCheck` 41, `PreviewQualityCheck` 35, `SceneImageCheck` 8,
`ColorPickerCheck` 13, `KeyboardCheck` 13, `AboutCheck` 18, `SelectionCheck` 10. Test projects `tiny*.wdproj` sit beside them. A harness
sets the persisted settings it expects (split orientation, preview quality). Known flake: a second app start in one
script sometimes comes up active; only the foreground guard fails then.
diff --git a/WaveDudeNext.WPF/Commands/ExportCommands.cs b/WaveDudeNext.WPF/Commands/ExportCommands.cs
index e7d0a50..68712d5 100644
--- a/WaveDudeNext.WPF/Commands/ExportCommands.cs
+++ b/WaveDudeNext.WPF/Commands/ExportCommands.cs
@@ -24,24 +24,39 @@ namespace WaveDudeNext.WPF.Commands;
/// File > Export and on the pictures' context menus. Each opens the Save dialog for the format and name,
/// then renders the export range of the current run (started first when there is none or it is stale)
/// with the display settings as they are; the frame commands write the frame the preview shows, from the
-/// same run, as one PNG or JPEG.
+/// same run, as one PNG or JPEG. The shortcuts (2026-10-28, the user's choice, GIMP's pair for the first two: Ctrl+E
+/// exports to the last file again without asking, Ctrl+Shift+E opens the dialog) are Ctrl+E for <see cref="Last"/>,
+/// Ctrl+Shift+E, I and B for the field, the intensity and both, Ctrl+Shift+F and G for the two frames.
/// </summary>
public static class ExportCommands
{
- /// <summary>Exports the field pictures.</summary>
- public static readonly RoutedUICommand Field = new("Export field", nameof(Field), typeof(ExportCommands));
+ /// <summary>Exports the field pictures (Ctrl+Shift+E).</summary>
+ public static readonly RoutedUICommand Field = new("Export field", nameof(Field), typeof(ExportCommands),
+ [new KeyGesture(Key.E, ModifierKeys.Control | ModifierKeys.Shift)]);
- /// <summary>Exports the intensity pictures.</summary>
- public static readonly RoutedUICommand Intensity = new("Export intensity", nameof(Intensity), typeof(ExportCommands));
+ /// <summary>Exports the intensity pictures (Ctrl+Shift+I).</summary>
+ public static readonly RoutedUICommand Intensity = new("Export intensity", nameof(Intensity), typeof(ExportCommands),
+ [new KeyGesture(Key.I, ModifierKeys.Control | ModifierKeys.Shift)]);
- /// <summary>Exports both, as two outputs named <c>_field</c> and <c>_intensity</c> after the chosen name.</summary>
- public static readonly RoutedUICommand Both = new("Export both", nameof(Both), typeof(ExportCommands));
+ /// <summary>Exports both, as two outputs named <c>_field</c> and <c>_intensity</c> after the chosen name (Ctrl+Shift+B).</summary>
+ public static readonly RoutedUICommand Both = new("Export both", nameof(Both), typeof(ExportCommands),
+ [new KeyGesture(Key.B, ModifierKeys.Control | ModifierKeys.Shift)]);
- /// <summary>Exports the field frame the preview shows as one image.</summary>
- public static readonly RoutedUICommand FieldFrame = new("Export field frame", nameof(FieldFrame), typeof(ExportCommands));
+ /// <summary>Exports the field frame the preview shows as one image (Ctrl+Shift+F).</summary>
+ public static readonly RoutedUICommand FieldFrame = new("Export field frame", nameof(FieldFrame), typeof(ExportCommands),
+ [new KeyGesture(Key.F, ModifierKeys.Control | ModifierKeys.Shift)]);
- /// <summary>Exports the intensity frame the preview shows as one image.</summary>
- public static readonly RoutedUICommand IntensityFrame = new("Export intensity frame", nameof(IntensityFrame), typeof(ExportCommands));
+ /// <summary>Exports the intensity frame the preview shows as one image (Ctrl+Shift+G).</summary>
+ public static readonly RoutedUICommand IntensityFrame = new("Export intensity frame", nameof(IntensityFrame), typeof(ExportCommands),
+ [new KeyGesture(Key.G, ModifierKeys.Control | ModifierKeys.Shift)]);
+
+ /// <summary>
+ /// Repeats this session's last export of a run's pictures (Ctrl+E, 2026-10-28, the user's request): the same layers,
+ /// format and path, no dialog, and what is there is replaced without a question. A still does not count (the user's
+ /// choice); nothing to repeat until the first such export since a project was opened, when the command is disabled.
+ /// </summary>
+ public static readonly RoutedUICommand Last = new("Export last", nameof(Last), typeof(ExportCommands),
+ [new KeyGesture(Key.E, ModifierKeys.Control)]);
/// <summary>
/// Writes a probe's recording as a CSV file (2026-10-18); the parameter is the <see cref="Model.Probe"/>.
diff --git a/WaveDudeNext.WPF/MainWindow.Export.cs b/WaveDudeNext.WPF/MainWindow.Export.cs
index 6b2ca22..1ee6b79 100644
--- a/WaveDudeNext.WPF/MainWindow.Export.cs
+++ b/WaveDudeNext.WPF/MainWindow.Export.cs
@@ -74,6 +74,114 @@ public partial class MainWindow
/// <summary>Whether an export is running or waiting for its run.</summary>
private bool IsExporting => Export?.IsActive == true || IsExportWaiting;
+ /// <summary>The layer suffixes of an export's file name, which an export of both layers appends itself.</summary>
+ private static readonly string[] LayerSuffixes = ["_field", "_intensity"];
+
+ /// <summary>A run's export as it was made: the layers, the format and the path, its extension the format's.</summary>
+ private sealed record RunExport(bool Field, bool Intensity, ExportFormat Format, string Path);
+
+ /// <summary>Projects whose export paths the settings keep (<see cref="Settings.ExportHints"/>), the oldest dropped beyond it.</summary>
+ private const int ExportHintCount = 20;
+
+ /// <summary>
+ /// This session's last export of a run's pictures, which Export last (<see cref="ExportCommands.Last"/>) makes again as
+ /// it was; null before the first since a project was opened, when the command is disabled (2026-10-28, the user's
+ /// request; a still is no "last export", his choice). Never restored from the settings: a repeat as the first keystroke
+ /// of a session would replace a file without a question.
+ /// </summary>
+ private RunExport? _lastRunExport;
+
+ /// <summary>
+ /// Where the last export of a run's pictures went, which the next such dialog proposes as folder and name, a layer
+ /// suffix swapped for the export's own; null when the dialog starts in the project's folder under the project's name
+ /// as it always did (2026-10-28, Jeroen's report: every dialog started in the project's folder, so exports elsewhere
+ /// meant navigating there each time). Set by each export of the kind, kept per project file in the user settings
+ /// (<see cref="ExportHint"/>, the user's choice, 2026-10-28: a path belongs to the machine, not to a project file
+ /// that may be shared) and restored when the project is opened; a project without a file keeps the session's alone.
+ /// </summary>
+ private string? _runExportPath;
+
+ /// <summary>Where the last still went: the next still's dialog starts in its folder, the name the frame's own.</summary>
+ private string? _stillExportPath;
+
+ /// <summary>Where the last probe data went: the next probe's dialog starts in its folder, the name the probe's own.</summary>
+ private string? _probeExportPath;
+
+ /// <summary>A project opened, imported or made new: nothing to repeat, and the dialogs start in the project's folder until <see cref="RestoreExportPaths"/> finds a hint.</summary>
+ private void ForgetExportPaths()
+ {
+ _lastRunExport = null;
+ _runExportPath = null;
+ _stillExportPath = null;
+ _probeExportPath = null;
+ }
+
+ /// <summary>A project opened from its file: the paths the settings keep for it, if any, so its dialogs start where its last exports went.</summary>
+ private void RestoreExportPaths()
+ {
+ if (Filename is not { } file || Settings.Default.ExportHints.Find(h => string.Equals(h.Project, file, StringComparison.OrdinalIgnoreCase)) is not { } hint)
+ {
+ return;
+ }
+ _runExportPath = hint.Run.Length > 0 ? hint.Run : null;
+ _stillExportPath = hint.Still.Length > 0 ? hint.Still : null;
+ _probeExportPath = hint.Probe.Length > 0 ? hint.Probe : null;
+ Logger.Debug("Export paths restored from the settings: run {Run}, still {Still}, probe {Probe}", hint.Run, hint.Still, hint.Probe);
+ }
+
+ /// <summary>
+ /// Keeps the export paths for the project file in the user settings, this project first, the others after it up to
+ /// <see cref="ExportHintCount"/> and only while their project files exist; a project without a file keeps nothing.
+ /// </summary>
+ private void RememberExportPaths()
+ {
+ if (Filename is not { } file)
+ {
+ return;
+ }
+ // a fresh list, as the recent files are kept
+ var hints = new List<ExportHint> { new() { Project = file, Run = _runExportPath ?? "", Still = _stillExportPath ?? "", Probe = _probeExportPath ?? "" } };
+ foreach (ExportHint entry in Settings.Default.ExportHints)
+ {
+ if (!string.Equals(entry.Project, file, StringComparison.OrdinalIgnoreCase) && hints.Count < ExportHintCount && File.Exists(entry.Project))
+ {
+ hints.Add(entry);
+ }
+ }
+ Settings.Default.ExportHints = hints;
+ SaveSettings();
+ }
+
+ /// <summary>
+ /// Where an export dialog starts and the name it proposes: the folder of <paramref name="remembered"/>, this session's
+ /// last export of the kind, while it exists, else the project's folder, else the settings' last export folder; the name
+ /// <paramref name="suggested"/>, or with <paramref name="takeName"/> the remembered file's stem, a layer suffix at its
+ /// end swapped for <paramref name="suffix"/> (the intensity exported after the field is not proposed the field's file).
+ /// </summary>
+ private (string Folder, string Name) ExportStart(string? remembered, bool takeName, string suggested, string suffix = "")
+ {
+ string? folder = Path.GetDirectoryName(remembered);
+ if (folder == null || !Directory.Exists(folder))
+ {
+ return (ProjectFolder ?? (Directory.Exists(Settings.Default.LastExportFolder) ? Settings.Default.LastExportFolder : ""), suggested);
+ }
+ string name = suggested;
+ if (takeName)
+ {
+ name = Path.GetFileNameWithoutExtension(remembered!);
+ foreach (string known in LayerSuffixes)
+ {
+ if (name.EndsWith(known, StringComparison.OrdinalIgnoreCase))
+ {
+ name = name[..^known.Length] + suffix;
+ break;
+ }
+ }
+ }
+ Logger.Debug("Export dialog starts where the session's last export went: {Folder}, as {Name}", folder, name);
+ return (folder, name);
+ }
+
private void OnExportChanged()
{
CommandManager.InvalidateRequerySuggested();
@@ -114,14 +222,15 @@ public partial class MainWindow
}
else
{
+ (string folder, string name) = ExportStart(_probeExportPath, takeName: false, suggested);
var dialog = new SaveFileDialog
{
Title = (string)FindResource("ExportDialogTitleProbeCsv"),
Filter = (string)FindResource("ExportDialogFilterCsv"),
AddExtension = true,
DefaultExt = ProbeCsv.Extension,
- FileName = suggested,
- InitialDirectory = ProjectFolder ?? (Directory.Exists(Settings.Default.LastExportFolder) ? Settings.Default.LastExportFolder : ""),
+ FileName = name,
+ InitialDirectory = folder,
};
if (dialog.ShowDialog(this) != true)
{
@@ -131,6 +240,8 @@ public partial class MainWindow
chosen = dialog.FileName;
Settings.Default.LastExportFolder = Path.GetDirectoryName(chosen) ?? "";
}
+ _probeExportPath = chosen;
+ RememberExportPaths();
Logger.Debug("Export: probe '{Probe}' ({Kind}, {Layer}, {Measurement}) as CSV to {Path}", probe.Name, probe.Kind, probe.Layer, probe.Measurement, chosen);
SimulationRun? run = await EnsureRunForExport(intensity: probe.Layer == ProbeLayer.Intensity, needsHalves: false);
if (run == null)
@@ -196,6 +307,8 @@ public partial class MainWindow
}
else
{
+ // a still keeps the frame's name and takes the last still's folder; a run's export takes the last one's folder and name
+ (string folder, string name) = ExportStart(still ? _stillExportPath : _runExportPath, takeName: !still, ProjectName() + suffix, suffix);
var dialog = new SaveFileDialog
{
Title = (string)FindResource(still ? "ExportDialogTitleFrame" : field && intensity ? "ExportDialogTitleBoth" : field ? "ExportDialogTitleField" : "ExportDialogTitleIntensity"),
@@ -203,8 +316,8 @@ public partial class MainWindow
FilterIndex = filterIndex,
AddExtension = true,
DefaultExt = ExportFormats.Extension(formats[filterIndex - 1]),
- FileName = ProjectName() + suffix,
- InitialDirectory = ProjectFolder ?? (Directory.Exists(Settings.Default.LastExportFolder) ? Settings.Default.LastExportFolder : ""),
+ FileName = name,
+ InitialDirectory = folder,
};
if (dialog.ShowDialog(this) != true)
{
@@ -234,6 +347,42 @@ public partial class MainWindow
{
chosen = Path.ChangeExtension(chosen, ExportFormats.Extension(format));
}
+ // remembered for the next dialog of the kind, in the settings too, and a run's for Export last
+ if (still)
+ {
+ _stillExportPath = chosen;
+ }
+ else
+ {
+ _runExportPath = chosen;
+ _lastRunExport = new RunExport(field, intensity, format, chosen);
+ }
+ RememberExportPaths();
+ await StartExport(field, intensity, still, stillFrame, format, chosen, ask: true);
+ }
+
+ /// <summary>Export last (Ctrl+E, 2026-10-28, the user's request): the session's last run export again, the same layers, format and path, no dialog and no question about what is there.</summary>
+ private async void OnExportLast(object sender, ExecutedRoutedEventArgs e)
+ {
+ if (IsExporting || _lastRunExport is not { } last)
+ {
+ return;
+ }
+ Logger.Debug("Export last: the last export made again");
+ await StartExport(last.Field, last.Intensity, still: false, stillFrame: 0, last.Format, last.Path, ask: false);
+ }
+
+ /// <summary>Something to repeat: a run export since the project was opened.</summary>
+ private void CanExportLast(object sender, CanExecuteRoutedEventArgs e) => e.CanExecute = _lastRunExport != null && !IsExporting && Project.Simulation.Steps > 0;
+
+ /// <summary>
+ /// The run (started first when there is none or it is stale), the targets, the job: the pictures <paramref name="field"/>
+ /// and <paramref name="intensity"/> as <paramref name="format"/> at <paramref name="chosen"/>, whose extension is the
+ /// format's; a <paramref name="still"/> is the one frame <paramref name="stillFrame"/> as a single image file.
+ /// </summary>
+ /// <param name="ask">Whether a sequence folder that exists with files in it is replaced only on request; Export last replaces it without asking.</param>
+ private async Task StartExport(bool field, bool intensity, bool still, int stillFrame, ExportFormat format, string chosen, bool ask)
+ {
Logger.Debug("Export: {What} as {Format} to {Path}", still ? "the shown frame " + stillFrame : field && intensity ? "field and intensity" : field ? "field" : "intensity", format, chosen);
if (!ExportFormats.IsAvailable(format))
{
@@ -247,7 +396,7 @@ public partial class MainWindow
{
string folder = Path.GetDirectoryName(chosen) ?? "";
string name = Path.GetFileNameWithoutExtension(chosen);
- foreach (string known in new[] { "_field", "_intensity" })
+ foreach (string known in LayerSuffixes)
{
if (name.EndsWith(known, StringComparison.OrdinalIgnoreCase))
{
@@ -262,14 +411,21 @@ public partial class MainWindow
{
outputs.Add((field ? FrameLayer.Field : FrameLayer.Intensity, chosen));
}
- // a sequence goes to a folder of its own; one that exists with files in it is replaced only on request
+ // a sequence goes to a folder of its own; one that exists with files in it is replaced only on request (Export last asks nothing)
if (!still && ExportFormats.IsSequence(format))
{
foreach ((_, string path) in outputs)
{
string folder = ExportFormats.SequenceFolder(path);
- if (Directory.Exists(folder) && Directory.EnumerateFileSystemEntries(folder).Any()
- && MessageWindow.Show(this, string.Format((string)FindResource("ExportFolderExistsFormat"), folder), MessageKind.Question, MessageButtons.YesNo) != MessageAnswer.Yes)
+ if (!Directory.Exists(folder) || !Directory.EnumerateFileSystemEntries(folder).Any())
+ {
+ continue;
+ }
+ if (!ask)
+ {
+ Logger.Debug("Export last: {Folder} replaced without asking", folder);
+ }
+ else if (MessageWindow.Show(this, string.Format((string)FindResource("ExportFolderExistsFormat"), folder), MessageKind.Question, MessageButtons.YesNo) != MessageAnswer.Yes)
{
Logger.Debug("Export cancelled: {Folder} kept", folder);
return;
diff --git a/WaveDudeNext.WPF/MainWindow.Live.cs b/WaveDudeNext.WPF/MainWindow.Live.cs
index 409e057..597c462 100644
--- a/WaveDudeNext.WPF/MainWindow.Live.cs
+++ b/WaveDudeNext.WPF/MainWindow.Live.cs
@@ -149,6 +149,7 @@ public partial class MainWindow
_imageCache = null;
_embeddedCache = null;
_composedCache = null;
+ ForgetExportPaths();
// the new project's own schemes and scene image; the pane does not exist yet when the constructor sets the first project
Dispatcher.InvokeAsync(() =>
{
diff --git a/WaveDudeNext.WPF/MainWindow.xaml b/WaveDudeNext.WPF/MainWindow.xaml
index 93f8f1b..516b10a 100644
--- a/WaveDudeNext.WPF/MainWindow.xaml
+++ b/WaveDudeNext.WPF/MainWindow.xaml
@@ -173,6 +173,7 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
<CommandBinding Command="{x:Static commands:ExportCommands.Both}" CanExecute="CanExport" Executed="OnExportBoth" />
<CommandBinding Command="{x:Static commands:ExportCommands.FieldFrame}" CanExecute="CanExport" Executed="OnExportFieldFrame" />
<CommandBinding Command="{x:Static commands:ExportCommands.IntensityFrame}" CanExecute="CanExport" Executed="OnExportIntensityFrame" />
+ <CommandBinding Command="{x:Static commands:ExportCommands.Last}" CanExecute="CanExportLast" Executed="OnExportLast" />
<CommandBinding Command="{x:Static commands:ExportCommands.ProbeCsv}" CanExecute="CanExportProbeCsv" Executed="OnExportProbeCsv" />
<CommandBinding Command="{x:Static commands:SimulationCommands.EnsureRun}" Executed="OnEnsureRun" />
<CommandBinding Command="{x:Static commands:SimulationCommands.SetFrameMemory}" Executed="OnSetFrameMemory" />
@@ -232,14 +233,16 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
<Separator />
<!-- export of the current run's frames (the export range, the display settings as they are); the same entries sit on the pictures' context menus -->
<MenuItem Header="{DynamicResource MenuFileExport}" AutomationProperties.AutomationId="MenuExport" controls:MenuIcon.Glyph="&#xEDE1;">
- <MenuItem Command="{x:Static commands:ExportCommands.Field}" Header="{DynamicResource MenuFileExportField}" AutomationProperties.AutomationId="MenuExportField" controls:MenuIcon.Glyph="&#xEDE1;" />
- <MenuItem Command="{x:Static commands:ExportCommands.Intensity}" Header="{DynamicResource MenuFileExportIntensity}" AutomationProperties.AutomationId="MenuExportIntensity" controls:MenuIcon.Glyph="&#xEDE1;" />
- <MenuItem Command="{x:Static commands:ExportCommands.Both}" Header="{DynamicResource MenuFileExportBoth}" AutomationProperties.AutomationId="MenuExportBoth" controls:MenuIcon.Glyph="&#xEDE1;" />
+ <MenuItem Command="{x:Static commands:ExportCommands.Field}" Header="{DynamicResource MenuFileExportField}" InputGestureText="Ctrl+Shift+E" AutomationProperties.AutomationId="MenuExportField" controls:MenuIcon.Glyph="&#xEDE1;" />
+ <MenuItem Command="{x:Static commands:ExportCommands.Intensity}" Header="{DynamicResource MenuFileExportIntensity}" InputGestureText="Ctrl+Shift+I" AutomationProperties.AutomationId="MenuExportIntensity" controls:MenuIcon.Glyph="&#xEDE1;" />
+ <MenuItem Command="{x:Static commands:ExportCommands.Both}" Header="{DynamicResource MenuFileExportBoth}" InputGestureText="Ctrl+Shift+B" AutomationProperties.AutomationId="MenuExportBoth" controls:MenuIcon.Glyph="&#xEDE1;" />
<Separator />
<!-- the frame the preview shows, from the same run, as one image -->
- <MenuItem Command="{x:Static commands:ExportCommands.FieldFrame}" Header="{DynamicResource MenuFileExportFieldFrame}" AutomationProperties.AutomationId="MenuExportFieldFrame" controls:MenuIcon.Glyph="&#xEB9F;" />
- <MenuItem Command="{x:Static commands:ExportCommands.IntensityFrame}" Header="{DynamicResource MenuFileExportIntensityFrame}" AutomationProperties.AutomationId="MenuExportIntensityFrame" controls:MenuIcon.Glyph="&#xEB9F;" />
+ <MenuItem Command="{x:Static commands:ExportCommands.FieldFrame}" Header="{DynamicResource MenuFileExportFieldFrame}" InputGestureText="Ctrl+Shift+F" AutomationProperties.AutomationId="MenuExportFieldFrame" controls:MenuIcon.Glyph="&#xEB9F;" />
+ <MenuItem Command="{x:Static commands:ExportCommands.IntensityFrame}" Header="{DynamicResource MenuFileExportIntensityFrame}" InputGestureText="Ctrl+Shift+G" AutomationProperties.AutomationId="MenuExportIntensityFrame" controls:MenuIcon.Glyph="&#xEB9F;" />
</MenuItem>
+ <!-- the session's last run export again, the same layers, format and path, nothing asked (2026-10-28, the user's request) -->
+ <MenuItem Command="{x:Static commands:ExportCommands.Last}" Header="{DynamicResource MenuFileExportLast}" InputGestureText="Ctrl+E" AutomationProperties.AutomationId="MenuExportLast" controls:MenuIcon.Glyph="&#xE8EE;" />
<Separator />
<MenuItem Command="ApplicationCommands.Close" Header="{DynamicResource MenuFileClose}" controls:MenuIcon.Glyph="&#xE711;" />
<Separator />
diff --git a/WaveDudeNext.WPF/MainWindow.xaml.cs b/WaveDudeNext.WPF/MainWindow.xaml.cs
index b36a66e..e387a7e 100644
--- a/WaveDudeNext.WPF/MainWindow.xaml.cs
+++ b/WaveDudeNext.WPF/MainWindow.xaml.cs
@@ -218,6 +218,7 @@ public partial class MainWindow : Window
Project = loaded;
Filename = fileName;
_suggestedFileName = null;
+ RestoreExportPaths();
Logger.Info("Opened '{Path}'", fileName);
RememberRecent(fileName);
projectTree.SelectRoot();
diff --git a/WaveDudeNext.WPF/Panes/PreviewPane.xaml b/WaveDudeNext.WPF/Panes/PreviewPane.xaml
index 3f3fbfd..76fc881 100644
--- a/WaveDudeNext.WPF/Panes/PreviewPane.xaml
+++ b/WaveDudeNext.WPF/Panes/PreviewPane.xaml
@@ -714,11 +714,11 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
<MenuItem Header="{DynamicResource MenuBrightness}" Command="{x:Static commands:DisplayCommands.EditBrightness}" CommandParameter="{x:Static model:ProbeLayer.Field}" AutomationProperties.AutomationId="ContextBrightness" controls:MenuIcon.Glyph="&#xE706;" />
<MenuItem Header="{DynamicResource MenuAutoBrightness}" controls:MenuIcon.Drawing="AutoBrightness" Command="{x:Static commands:DisplayCommands.AutoBrightness}" CommandParameter="{x:Static model:ProbeLayer.Field}" AutomationProperties.AutomationId="ContextAutoBrightness" />
<Separator />
- <MenuItem Header="{DynamicResource MenuExportThisFrame}" Command="{x:Static commands:ExportCommands.FieldFrame}" AutomationProperties.AutomationId="ContextExportFrame" controls:MenuIcon.Glyph="&#xEB9F;" />
+ <MenuItem Header="{DynamicResource MenuExportThisFrame}" Command="{x:Static commands:ExportCommands.FieldFrame}" InputGestureText="Ctrl+Shift+F" AutomationProperties.AutomationId="ContextExportFrame" controls:MenuIcon.Glyph="&#xEB9F;" />
<Separator />
- <MenuItem Header="{DynamicResource MenuFileExportField}" Command="{x:Static commands:ExportCommands.Field}" AutomationProperties.AutomationId="ContextExportField" controls:MenuIcon.Glyph="&#xEDE1;" />
- <MenuItem Header="{DynamicResource MenuFileExportIntensity}" Command="{x:Static commands:ExportCommands.Intensity}" AutomationProperties.AutomationId="ContextExportIntensity" controls:MenuIcon.Glyph="&#xEDE1;" />
- <MenuItem Header="{DynamicResource MenuFileExportBoth}" Command="{x:Static commands:ExportCommands.Both}" AutomationProperties.AutomationId="ContextExportBoth" controls:MenuIcon.Glyph="&#xEDE1;" />
+ <MenuItem Header="{DynamicResource MenuFileExportField}" Command="{x:Static commands:ExportCommands.Field}" InputGestureText="Ctrl+Shift+E" AutomationProperties.AutomationId="ContextExportField" controls:MenuIcon.Glyph="&#xEDE1;" />
+ <MenuItem Header="{DynamicResource MenuFileExportIntensity}" Command="{x:Static commands:ExportCommands.Intensity}" InputGestureText="Ctrl+Shift+I" AutomationProperties.AutomationId="ContextExportIntensity" controls:MenuIcon.Glyph="&#xEDE1;" />
+ <MenuItem Header="{DynamicResource MenuFileExportBoth}" Command="{x:Static commands:ExportCommands.Both}" InputGestureText="Ctrl+Shift+B" AutomationProperties.AutomationId="ContextExportBoth" controls:MenuIcon.Glyph="&#xEDE1;" />
</ContextMenu>
</HeaderedContentControl.ContextMenu>
</HeaderedContentControl>
@@ -740,11 +740,11 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
<MenuItem Header="{DynamicResource MenuBrightness}" Command="{x:Static commands:DisplayCommands.EditBrightness}" CommandParameter="{x:Static model:ProbeLayer.Intensity}" AutomationProperties.AutomationId="ContextBrightness" controls:MenuIcon.Glyph="&#xE706;" />
<MenuItem Header="{DynamicResource MenuAutoBrightness}" controls:MenuIcon.Drawing="AutoBrightness" Command="{x:Static commands:DisplayCommands.AutoBrightness}" CommandParameter="{x:Static model:ProbeLayer.Intensity}" AutomationProperties.AutomationId="ContextAutoBrightness" />
<Separator />
- <MenuItem Header="{DynamicResource MenuExportThisFrame}" Command="{x:Static commands:ExportCommands.IntensityFrame}" AutomationProperties.AutomationId="ContextExportFrame" controls:MenuIcon.Glyph="&#xEB9F;" />
+ <MenuItem Header="{DynamicResource MenuExportThisFrame}" Command="{x:Static commands:ExportCommands.IntensityFrame}" InputGestureText="Ctrl+Shift+G" AutomationProperties.AutomationId="ContextExportFrame" controls:MenuIcon.Glyph="&#xEB9F;" />
<Separator />
- <MenuItem Header="{DynamicResource MenuFileExportField}" Command="{x:Static commands:ExportCommands.Field}" AutomationProperties.AutomationId="ContextExportField" controls:MenuIcon.Glyph="&#xEDE1;" />
- <MenuItem Header="{DynamicResource MenuFileExportIntensity}" Command="{x:Static commands:ExportCommands.Intensity}" AutomationProperties.AutomationId="ContextExportIntensity" controls:MenuIcon.Glyph="&#xEDE1;" />
- <MenuItem Header="{DynamicResource MenuFileExportBoth}" Command="{x:Static commands:ExportCommands.Both}" AutomationProperties.AutomationId="ContextExportBoth" controls:MenuIcon.Glyph="&#xEDE1;" />
+ <MenuItem Header="{DynamicResource MenuFileExportField}" Command="{x:Static commands:ExportCommands.Field}" InputGestureText="Ctrl+Shift+E" AutomationProperties.AutomationId="ContextExportField" controls:MenuIcon.Glyph="&#xEDE1;" />
+ <MenuItem Header="{DynamicResource MenuFileExportIntensity}" Command="{x:Static commands:ExportCommands.Intensity}" InputGestureText="Ctrl+Shift+I" AutomationProperties.AutomationId="ContextExportIntensity" controls:MenuIcon.Glyph="&#xEDE1;" />
+ <MenuItem Header="{DynamicResource MenuFileExportBoth}" Command="{x:Static commands:ExportCommands.Both}" InputGestureText="Ctrl+Shift+B" AutomationProperties.AutomationId="ContextExportBoth" controls:MenuIcon.Glyph="&#xEDE1;" />
</ContextMenu>
</HeaderedContentControl.ContextMenu>
</HeaderedContentControl>
diff --git a/WaveDudeNext.WPF/Settings.cs b/WaveDudeNext.WPF/Settings.cs
index a684ee1..918413e 100644
--- a/WaveDudeNext.WPF/Settings.cs
+++ b/WaveDudeNext.WPF/Settings.cs
@@ -242,6 +242,20 @@ public sealed class Settings : INotifyPropertyChanged
set => Set(ref _exportFilterIndex, value);
}
+ private List<ExportHint> _exportHints = [];
+
+ /// <summary>
+ /// Where each project's last exports went, newest project first (2026-10-28, the user's choice: a path belongs to the
+ /// machine, so it lives here and not in a project file that may be shared): the export dialogs of a project start there
+ /// when it is opened again. A fresh list on every change.
+ /// </summary>
+ [XmlElement("ExportHint")]
+ public List<ExportHint> ExportHints
+ {
+ get => _exportHints;
+ set => Set(ref _exportHints, value);
+ }
+
/// <summary>Writes the settings to <see cref="FilePath"/>, creating the folder; file errors are the caller's.</summary>
public void Save()
{
@@ -286,3 +300,23 @@ public sealed class Settings : INotifyPropertyChanged
}
}
}
+
+/// <summary>Where a project's last exports went: an entry of <see cref="Settings.ExportHints"/>, an attribute each, the empty ones left out.</summary>
+public sealed class ExportHint
+{
+ /// <summary>The project file's full path, the key.</summary>
+ [XmlAttribute, DefaultValue("")]
+ public string Project { get; set; } = "";
+
+ /// <summary>The last export of the run's pictures, folder and file name; empty for none.</summary>
+ [XmlAttribute, DefaultValue("")]
+ public string Run { get; set; } = "";
+
+ /// <summary>The last still; empty for none.</summary>
+ [XmlAttribute, DefaultValue("")]
+ public string Still { get; set; } = "";
+
+ /// <summary>The last probe data file; empty for none.</summary>
+ [XmlAttribute, DefaultValue("")]
+ public string Probe { get; set; } = "";
+}
diff --git a/WaveDudeNext.WPF/Strings/Strings.DE.xaml b/WaveDudeNext.WPF/Strings/Strings.DE.xaml
index 61af08d..e2c3678 100644
--- a/WaveDudeNext.WPF/Strings/Strings.DE.xaml
+++ b/WaveDudeNext.WPF/Strings/Strings.DE.xaml
@@ -38,6 +38,7 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
<s:String x:Key="MenuFileExportBoth">_Beides exportieren...</s:String>
<s:String x:Key="MenuFileExportFieldFrame">Feld-Ein_zelbild exportieren...</s:String>
<s:String x:Key="MenuFileExportIntensityFrame">Intensitäts-Einzelbild e_xportieren...</s:String>
+ <s:String x:Key="MenuFileExportLast">Letzten Export _wiederholen</s:String>
<s:String x:Key="MenuExportThisFrame">_Dieses Bild exportieren...</s:String>
<s:String x:Key="MenuBrightness">_Helligkeit</s:String>
<s:String x:Key="MenuAutoBrightness">_Automatische Helligkeit</s:String>
diff --git a/WaveDudeNext.WPF/Strings/Strings.EN.xaml b/WaveDudeNext.WPF/Strings/Strings.EN.xaml
index fdaee38..149a912 100644
--- a/WaveDudeNext.WPF/Strings/Strings.EN.xaml
+++ b/WaveDudeNext.WPF/Strings/Strings.EN.xaml
@@ -38,6 +38,7 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
<s:String x:Key="MenuFileExportBoth">Export _both...</s:String>
<s:String x:Key="MenuFileExportFieldFrame">Export field f_rame...</s:String>
<s:String x:Key="MenuFileExportIntensityFrame">Export intensity fra_me...</s:String>
+ <s:String x:Key="MenuFileExportLast">Export _last</s:String>
<s:String x:Key="MenuExportThisFrame">Export _this frame...</s:String>
<s:String x:Key="MenuBrightness">_Brightness</s:String>
<s:String x:Key="MenuAutoBrightness">_Auto brightness</s:String>
diff --git a/WaveDudeNext.WPF/Strings/Strings.FR.xaml b/WaveDudeNext.WPF/Strings/Strings.FR.xaml
index e6a25cd..4df4b5a 100644
--- a/WaveDudeNext.WPF/Strings/Strings.FR.xaml
+++ b/WaveDudeNext.WPF/Strings/Strings.FR.xaml
@@ -38,6 +38,7 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
<s:String x:Key="MenuFileExportBoth">Exporter les _deux...</s:String>
<s:String x:Key="MenuFileExportFieldFrame">Exporter l'i_mage du champ...</s:String>
<s:String x:Key="MenuFileExportIntensityFrame">Exporter l'image de l'intensi_té...</s:String>
+ <s:String x:Key="MenuFileExportLast">Répéter le _dernier export</s:String>
<s:String x:Key="MenuExportThisFrame">Exporter _cette image...</s:String>
<s:String x:Key="MenuBrightness">_Luminosité</s:String>
<s:String x:Key="MenuAutoBrightness">Luminosité _automatique</s:String>
diff --git a/WaveDudeNext.WPF/Strings/Strings.NL.xaml b/WaveDudeNext.WPF/Strings/Strings.NL.xaml
index 0d33014..7fc9944 100644
--- a/WaveDudeNext.WPF/Strings/Strings.NL.xaml
+++ b/WaveDudeNext.WPF/Strings/Strings.NL.xaml
@@ -38,6 +38,7 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
<s:String x:Key="MenuFileExportBoth">_Beide exporteren...</s:String>
<s:String x:Key="MenuFileExportFieldFrame">Veld_beeld exporteren...</s:String>
<s:String x:Key="MenuFileExportIntensityFrame">Intensiteitsbeel_d exporteren...</s:String>
+ <s:String x:Key="MenuFileExportLast">Laatste export _herhalen</s:String>
<s:String x:Key="MenuExportThisFrame">_Dit beeld exporteren...</s:String>
<s:String x:Key="MenuBrightness">_Helderheid</s:String>
<s:String x:Key="MenuAutoBrightness">_Automatische helderheid</s:String>
diff --git a/_tools/ui_check/ExportCheck.ps1 b/_tools/ui_check/ExportCheck.ps1
index b5558cc..128188b 100644
--- a/_tools/ui_check/ExportCheck.ps1
+++ b/_tools/ui_check/ExportCheck.ps1
@@ -89,6 +89,15 @@ try {
Check "the run made for the export stays in the preview (100 frames)" ((Frame) -like "* / 99") (Frame)
Check "and is reported completed" ((RunStatus) -like "Completed*") (RunStatus)
+ # File > Export last (Ctrl+E, 2026-10-28): the last export again, to the same folder, without the question about a folder with files in it
+ $before = (Get-Item (Join-Path $field "tiny_field_0099.png")).LastWriteTimeUtc
+ Step "F10" 0x79 150; Step "Down" $VK_DOWN 150
+ for ($i = 0; $i -lt 6; $i++) { Step "Down" $VK_DOWN 80 }
+ Check "'Export last' sits below Export in the File menu" ((PopupFocusedId) -eq "MenuExportLast") (PopupFocusedId)
+ Step "Enter" $VK_RETURN 200
+ Check "Export last rewrites the 100 PNGs without asking about the folder" (WaitFor { (Pngs $field) -eq 100 -and (Get-Item (Join-Path $field "tiny_field_0099.png")).LastWriteTimeUtc -gt $before } 60000) ("{0} files, status '{1}'" -f (Pngs $field), (ExportStatus))
+ Check "and ends" (WaitFor { (ExportStatus) -eq "" } 10000) (ExportStatus)
+
# an edit: the title gets its asterisk and the run goes stale
FocusOn "Source:Source 1"
Step "Right" $VK_RIGHT 300
@@ -101,8 +110,8 @@ try {
FocusOn "Source:Source 1"
Step "Apps" $VK_APPS 300
Check "the Apps key opens the picture's context menu with the export entries" (WaitFor { PopupItemVisible "Export both..." } 3000)
- # opened by keyboard, no entry is highlighted yet: Down walks Field, Intensity, Both
- for ($i = 0; $i -lt 4 -and (PopupFocusedId) -ne "ContextExportBoth"; $i++) { Step "Down" $VK_DOWN 120 }
+ # opened by keyboard, no entry is highlighted yet: Down walks Brightness, Auto brightness, This frame, Field, Intensity, Both
+ for ($i = 0; $i -lt 8 -and (PopupFocusedId) -ne "ContextExportBoth"; $i++) { Step "Down" $VK_DOWN 120 }
Check "Down reaches 'Export both...'" ((PopupFocusedId) -eq "ContextExportBoth") (PopupFocusedId)
Step "Enter" $VK_RETURN 200
$intensity = Join-Path $out "tiny_intensity"
@@ -114,8 +123,8 @@ try {
# the still: the context menu's first entry writes the shown frame (frame 0, step 0) as one file, from the run
FocusOn "Source:Source 1"
Step "Apps" $VK_APPS 300
- for ($i = 0; $i -lt 2 -and (PopupFocusedId) -ne "ContextExportFrame"; $i++) { Step "Down" $VK_DOWN 120 }
- Check "'Export this frame...' is the context menu's first entry" ((PopupFocusedId) -eq "ContextExportFrame") (PopupFocusedId)
+ for ($i = 0; $i -lt 4 -and (PopupFocusedId) -ne "ContextExportFrame"; $i++) { Step "Down" $VK_DOWN 120 }
+ Check "'Export this frame...' is the context menu's first export entry, after the two brightness entries" ((PopupFocusedId) -eq "ContextExportFrame") (PopupFocusedId)
Step "Enter" $VK_RETURN 200
$still = Join-Path $out "tiny_field_0000.png"
Check "the shown frame lands as tiny_field_0000.png (the frame number, padded like a sequence's files)" (WaitFor { Test-Path $still } 20000) ((Find "StatusMessage").Current.Name)