Add the edit contact dialog
Ctrl+Y from the entry window, or Enter on a row in the log, opens the whole contact in one dialog. It reaches the fields the log has no column for: QSX frequency, name, QTH, comment, grid, power, radio number, run position, and the country and WPX prefixes. Previous and Next walk the log without closing and offer to save first. The dialog checks values through the same QsoEditor the log columns use, so a zone the contest will not take is refused the same way in both places. QsoEdit now names the field that was refused, so the dialog can put the cursor back in the right box, and QsoEditor.ApplyAll changes several fields at once. Points and the multiplier flags are shown but not editable. They are worked out from the rules every time the log changes, so a typed value would be lost on the next edit. N1MM lets you type them; we do not, rather than offering a box that does nothing. A contact's own country prefix now wins over the country file when scoring. Without this, correcting the country in the dialog would change what the log shows and what Cabrillo says, but not the score. LoggingSession.Update now broadcasts the change like Edit does, so a contact saved from the dialog reaches the other stations. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -209,6 +209,21 @@ public class LoggingSessionTests
|
||||
Assert.Equal("JA2XYZ", change?.Qso.Call.Text);
|
||||
}
|
||||
|
||||
/// The country file gets a call wrong now and then. Correcting the country
|
||||
/// by hand has to change the score, or the correction is decoration.
|
||||
[Fact]
|
||||
public void CorrectingTheCountryChangesTheScore()
|
||||
{
|
||||
LoggingSession session = Session();
|
||||
Type(session, "JA1XYZ", "25");
|
||||
Qso logged = session.LogContact();
|
||||
Assert.Equal(3, session.Log.Tally.Points);
|
||||
|
||||
session.Edit(logged.Id, QsoField.CountryPrefix, "DL");
|
||||
|
||||
Assert.Equal(0, session.Log.Tally.Points);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ADeleteReportsTheContactThatWent()
|
||||
{
|
||||
|
||||
@@ -132,4 +132,54 @@ public class QsoEditorTests
|
||||
[Fact]
|
||||
public void AnEmptyNumberReadsBackAsAnEmptyColumn() =>
|
||||
Assert.Equal("", QsoEditor.Read(Contact() with { Zone = 0 }, QsoField.Zone));
|
||||
|
||||
[Fact]
|
||||
public void SeveralFieldsCanBeChangedAtOnce()
|
||||
{
|
||||
QsoEdit edit = CqWw().ApplyAll(Contact(),
|
||||
[
|
||||
new(QsoField.Call, "DL2XYZ"),
|
||||
new(QsoField.Zone, "14"),
|
||||
new(QsoField.Comment, "first QSO"),
|
||||
]);
|
||||
|
||||
Assert.Equal("DL2XYZ", edit.Result!.Call.Text);
|
||||
Assert.Equal(14, edit.Result.Zone);
|
||||
Assert.Equal("first QSO", edit.Result.Comment);
|
||||
Assert.Equal("DL", edit.Result.CountryPrefix);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TheFirstValueTheContestWillNotTakeStopsTheWholeChange()
|
||||
{
|
||||
QsoEdit edit = CqWw().ApplyAll(Contact(),
|
||||
[
|
||||
new(QsoField.Call, "DL2XYZ"),
|
||||
new(QsoField.Zone, "41"),
|
||||
]);
|
||||
|
||||
Assert.Null(edit.Result);
|
||||
Assert.Equal(QsoField.Zone, edit.Field);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ARefusalNamesTheFieldItCameFrom() =>
|
||||
Assert.Equal(QsoField.Call, CqWw().Apply(Contact(), QsoField.Call, "12345").Field);
|
||||
|
||||
[Fact]
|
||||
public void AQsxFrequencyCanBeCleared() =>
|
||||
Assert.Equal(
|
||||
0,
|
||||
CqWw().Apply(Contact() with { QsxFrequency = Frequency.FromKilohertz(14_200) },
|
||||
QsoField.QsxFrequency, "").Result!.QsxFrequency.Hertz);
|
||||
|
||||
/// The working frequency is what the contact was made on, so it cannot be
|
||||
/// emptied the way the QSX frequency can.
|
||||
[Fact]
|
||||
public void TheWorkingFrequencyCannotBeCleared() =>
|
||||
Assert.False(CqWw().Apply(Contact(), QsoField.Frequency, "").IsAccepted);
|
||||
|
||||
[Fact]
|
||||
public void ACorrectedCountryPrefixIsKept() =>
|
||||
Assert.Equal("DL", CqWw().Apply(Contact(), QsoField.CountryPrefix, "dl").Result!.CountryPrefix);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user