Skip Run QSOs on the bandmap and refocus the callsign box after Alt+W
A QSO logged in Run mode is no longer added to the bandmap as a local spot, including when recent contacts are re-spotted at startup. Releasing Alt moves focus to the menu bar. Alt+W now sets a flag, and the Alt key-up handler puts focus back on the callsign box. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -326,8 +326,9 @@ public sealed partial class AppSession : IDisposable
|
|||||||
Logging.Changed += (_, _) => Changed?.Invoke(this, EventArgs.Empty);
|
Logging.Changed += (_, _) => Changed?.Invoke(this, EventArgs.Empty);
|
||||||
Logging.Logged += (_, qso) =>
|
Logging.Logged += (_, qso) =>
|
||||||
{
|
{
|
||||||
// a WAE QTC row is traffic about a station, not a station on the air
|
// a WAE QTC row is traffic about a station, not a station on the air;
|
||||||
if (contest.IsContact(qso))
|
// 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));
|
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);
|
DateTime since = DateTime.UtcNow - TimeSpan.FromMinutes(Settings.RecentContactSpotMinutes);
|
||||||
HashSet<(string, Band?)> held = [.. Bandmap.All().Select(s => (s.Call.Text, s.Band))];
|
HashSet<(string, Band?)> held = [.. Bandmap.All().Select(s => (s.Call.Text, s.Band))];
|
||||||
List<Spot> spots = [];
|
List<Spot> 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);
|
Spot spot = new(qso.Call, qso.Frequency, qso.TimestampUtc, SpotSource.Log);
|
||||||
if (held.Add((spot.Call.Text, spot.Band)))
|
if (held.Add((spot.Call.Text, spot.Band)))
|
||||||
|
|||||||
@@ -102,6 +102,7 @@ public sealed partial class EntryWindow : Window
|
|||||||
MainMenu.IsVisible = false;
|
MainMenu.IsVisible = false;
|
||||||
}
|
}
|
||||||
AddHandler(KeyDownEvent, OnWindowKeyDown, RoutingStrategies.Tunnel);
|
AddHandler(KeyDownEvent, OnWindowKeyDown, RoutingStrategies.Tunnel);
|
||||||
|
AddHandler(KeyUpEvent, OnWindowKeyUp, RoutingStrategies.Tunnel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -327,6 +328,21 @@ public sealed partial class EntryWindow : Window
|
|||||||
Refresh();
|
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)
|
private void OnWindowKeyDown(object? sender, KeyEventArgs e)
|
||||||
{
|
{
|
||||||
if (Logging is null)
|
if (Logging is null)
|
||||||
@@ -420,6 +436,7 @@ public sealed partial class EntryWindow : Window
|
|||||||
break;
|
break;
|
||||||
case Key.W when e.KeyModifiers.HasFlag(KeyModifiers.Alt):
|
case Key.W when e.KeyModifiers.HasFlag(KeyModifiers.Alt):
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
|
refocusOnAltUp = true;
|
||||||
OnWipeOrRestore(this, new RoutedEventArgs());
|
OnWipeOrRestore(this, new RoutedEventArgs());
|
||||||
break;
|
break;
|
||||||
case Key.L when e.KeyModifiers.HasFlag(KeyModifiers.Control):
|
case Key.L when e.KeyModifiers.HasFlag(KeyModifiers.Control):
|
||||||
|
|||||||
Reference in New Issue
Block a user