diff --git a/src/Nonemm.App/AppSession.cs b/src/Nonemm.App/AppSession.cs index bd3da36..8ee6bb8 100644 --- a/src/Nonemm.App/AppSession.cs +++ b/src/Nonemm.App/AppSession.cs @@ -326,8 +326,9 @@ public sealed partial class AppSession : IDisposable Logging.Changed += (_, _) => Changed?.Invoke(this, EventArgs.Empty); Logging.Logged += (_, qso) => { - // a WAE QTC row is traffic about a station, not a station on the air - if (contest.IsContact(qso)) + // a WAE QTC row is traffic about a station, not a station on the air; + // a Run QSO is a station that called us, so it is not a spot to work + if (contest.IsContact(qso) && !qso.IsRunQso) { Bandmap.Add(new Spot(qso.Call, qso.Frequency, qso.TimestampUtc, SpotSource.Log)); } @@ -696,7 +697,7 @@ public sealed partial class AppSession : IDisposable DateTime since = DateTime.UtcNow - TimeSpan.FromMinutes(Settings.RecentContactSpotMinutes); HashSet<(string, Band?)> held = [.. Bandmap.All().Select(s => (s.Call.Text, s.Band))]; List spots = []; - foreach (Qso qso in contacts.Where(q => q.TimestampUtc >= since && Logging!.Contest.IsContact(q))) + foreach (Qso qso in contacts.Where(q => q.TimestampUtc >= since && !q.IsRunQso && Logging!.Contest.IsContact(q))) { Spot spot = new(qso.Call, qso.Frequency, qso.TimestampUtc, SpotSource.Log); if (held.Add((spot.Call.Text, spot.Band))) diff --git a/src/Nonemm.App/Windows/EntryWindow.axaml.cs b/src/Nonemm.App/Windows/EntryWindow.axaml.cs index 393be46..aaee26e 100644 --- a/src/Nonemm.App/Windows/EntryWindow.axaml.cs +++ b/src/Nonemm.App/Windows/EntryWindow.axaml.cs @@ -102,6 +102,7 @@ public sealed partial class EntryWindow : Window MainMenu.IsVisible = false; } AddHandler(KeyDownEvent, OnWindowKeyDown, RoutingStrategies.Tunnel); + AddHandler(KeyUpEvent, OnWindowKeyUp, RoutingStrategies.Tunnel); } @@ -327,6 +328,21 @@ public sealed partial class EntryWindow : Window Refresh(); } + /// Set by Alt+W. Releasing Alt moves focus to the menu bar, so the + /// callsign box takes focus back when Alt comes up. + private bool refocusOnAltUp; + + private void OnWindowKeyUp(object? sender, KeyEventArgs e) + { + if (!refocusOnAltUp || e.Key is not (Key.LeftAlt or Key.RightAlt)) + { + return; + } + refocusOnAltUp = false; + e.Handled = true; + boxes[0].Focus(); + } + private void OnWindowKeyDown(object? sender, KeyEventArgs e) { if (Logging is null) @@ -420,6 +436,7 @@ public sealed partial class EntryWindow : Window break; case Key.W when e.KeyModifiers.HasFlag(KeyModifiers.Alt): e.Handled = true; + refocusOnAltUp = true; OnWipeOrRestore(this, new RoutedEventArgs()); break; case Key.L when e.KeyModifiers.HasFlag(KeyModifiers.Control):