Lay the menu bar out the way N1MM lays it out, and fill in the Edit menu

The menu tree comes from N1MM's EntryWindow.Designer.cs: File, Edit, View,
Tools, Config, Window, with the items under the names N1MM gives them. The
window list moved out of View into Window; the call history file moved from
Config into File > Import. Ctrl+W, Ctrl+L and Ctrl+M now work, so the keys
printed in the menu are real. Two commands that had no menu item before:
the CW and SSB function key definitions, and the QTC setup area.

The rest of the Edit menu:

- Ctrl+N asks for a note and puts it in the comment of the contact in the
  boxes, or of the last logged contact when nothing is typed.
- Edit Current Contact opens the Edit Contact form over what is typed but
  not logged. Update hands the values back to the entry boxes.
- Ctrl+Q and Ctrl+A load a logged contact into the boxes and paint them
  pale yellow. Enter writes the change back, Esc puts back what was being
  typed, and stepping forward past the newest contact leaves quick edit.
- Ctrl+U raises the received serial, or a numeric exchange box when the
  contest has no serial.
- Ctrl+F shows the call being typed in the log window, then the next
  contact with that call.

RadioPosition is now OperatingPosition: it is the operator at one radio,
not a place on a band.

Looked at under Xvfb on a 3775-contact log: quick edit back and forward,
Esc, the note dialog, find, and Edit Current Contact putting a zone back
into the entry boxes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-28 12:18:37 +00:00
parent d347538fbc
commit 1c118f9ce4
27 changed files with 694 additions and 158 deletions

View File

@@ -8,7 +8,7 @@ namespace Nonemm.Session.Tests;
public class MessageExpanderTests
{
private static RadioPosition Session(CallHistory? history = null, int radioNumber = 1)
private static OperatingPosition Session(CallHistory? history = null, int radioNumber = 1)
{
FakeLogStore store = new();
ContestInstance instance = store.AddContest(new ContestInstance
@@ -17,7 +17,7 @@ public class MessageExpanderTests
ContestName = "CQWW",
SentExchange = "14",
});
return new RadioPosition(
return new OperatingPosition(
new ContestSession(
store,
new CqWorldWide(ModeCategory.Cw),
@@ -31,7 +31,7 @@ public class MessageExpanderTests
[Fact]
public void MyCallAndTheirCallAreFilledIn()
{
RadioPosition session = Session();
OperatingPosition session = Session();
session.Entry.Call = "JA1XYZ";
Assert.Equal("JA1XYZ DE DL1ABC", MessageExpander.Expand("{CALL} DE {MYCALL}", session));
}
@@ -59,7 +59,7 @@ public class MessageExpanderTests
[Fact]
public void TheSingleCharacterMacrosAreTheirCallMyCallAndTheSerial()
{
RadioPosition session = Session();
OperatingPosition session = Session();
session.Entry.Call = "JA1XYZ";
Assert.Equal("JA1XYZ 599 1 DE DL1ABC", MessageExpander.Expand("! 599 # DE *", session));
@@ -68,7 +68,7 @@ public class MessageExpanderTests
[Fact]
public void TheirCallFallsBackToTheLastOneLogged()
{
RadioPosition session = Session();
OperatingPosition session = Session();
session.Entry.Call = "JA1XYZ";
session.Entry.Set(ExchangeSlot.ReceivedReport, "599");
session.Entry.Set(ExchangeSlot.Zone, "25");
@@ -80,7 +80,7 @@ public class MessageExpanderTests
[Fact]
public void TheFrequencySendsRForTheDecimalPointOnCw()
{
RadioPosition session = Session();
OperatingPosition session = Session();
session.Tune(Frequency.FromKilohertz(14_025.5));
Assert.Equal("14025R5 14026", MessageExpander.Expand("{FREQ} {FREQROUND}", session));
@@ -89,8 +89,8 @@ public class MessageExpanderTests
[Fact]
public void TheOtherRadioFillsInTheOtherMacros()
{
RadioPosition here = Session();
RadioPosition there = Session(radioNumber: 2);
OperatingPosition here = Session();
OperatingPosition there = Session(radioNumber: 2);
there.Tune(Frequency.FromKilohertz(3_525));
Assert.Equal("3525R0 3R5 80M", MessageExpander.Expand("{OTHERFREQ} {OTHERMHZ} {OTHERBAND}", here, there));
@@ -103,7 +103,7 @@ public class MessageExpanderTests
[Fact]
public void TheNameComesFromTheCallHistoryWhenTheContestHasNoNameBox()
{
RadioPosition session = Session(CallHistory.Parse("!!Order!!,Call,Name\nJA1XYZ,Ken"));
OperatingPosition session = Session(CallHistory.Parse("!!Order!!,Call,Name\nJA1XYZ,Ken"));
session.Entry.Call = "JA1XYZ";
Assert.Equal("TU Ken GL", MessageExpander.Expand("TU {NAMEANDSPACE}GL", session));
@@ -112,7 +112,7 @@ public class MessageExpanderTests
[Fact]
public void MyGridAndTheirsAreDifferentMacros()
{
RadioPosition session = Session(CallHistory.Parse("!!Order!!,Call,LOC1\nJA1XYZ,PM95"));
OperatingPosition session = Session(CallHistory.Parse("!!Order!!,Call,LOC1\nJA1XYZ,PM95"));
session.Entry.Call = "JA1XYZ";
Assert.Equal("JN88 PM95", MessageExpander.Expand("{GRID} {GRIDSQUARE}", session));