Lay the station form out the way N1MM lays it out
The dialog now carries N1MM's fields in N1MM's order, with the labels to the left of the boxes and the tip text at the top right. New fields in StoredStation: the address, the licence class, the position, the radio, the antenna and the email address. The grid square and the position fill each other in, as they do in N1MM. Which box has focus decides the direction, because TextChanged arrives too late to tell a typed edit from a programmed one. The fields N1MM's form does not have are gone from it. Continent and the country prefix are looked up from the callsign after Ok; the rest keep the value they had. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,7 @@ using Avalonia.Platform.Storage;
|
||||
using Nonemm.App.Configuration;
|
||||
using Nonemm.App.Dialogs;
|
||||
using Nonemm.Core;
|
||||
using Nonemm.Core.Country;
|
||||
using Nonemm.Formats.Adif;
|
||||
using Nonemm.Formats.Cabrillo;
|
||||
using Nonemm.Session;
|
||||
@@ -244,7 +245,7 @@ public sealed partial class EntryWindow
|
||||
StoredStation? updated = await dialog.ShowDialog<StoredStation?>(this);
|
||||
if (updated is not null)
|
||||
{
|
||||
session.Save(session.Settings with { Station = updated });
|
||||
session.Save(session.Settings with { Station = FromCall(updated) });
|
||||
if (Logging is not null)
|
||||
{
|
||||
session.OpenContest(Logging.Instance.ContestNumber);
|
||||
@@ -252,6 +253,18 @@ public sealed partial class EntryWindow
|
||||
}
|
||||
}
|
||||
|
||||
/// N1MM's station form has no continent or country box: it looks both up
|
||||
/// from the callsign in the country file.
|
||||
private StoredStation FromCall(StoredStation station)
|
||||
{
|
||||
CountryLookup? country = session.Countries?.Find(station.Callsign);
|
||||
return country is null ? station : station with
|
||||
{
|
||||
Continent = country.Continent,
|
||||
CountryPrefix = country.Entity.PrimaryPrefix,
|
||||
};
|
||||
}
|
||||
|
||||
private async void OnRadioSettings(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
RadioDialog dialog = new(session.Settings);
|
||||
|
||||
Reference in New Issue
Block a user