Put the QTC window's settings on its right-click menu

N1MM keeps them on a Setup tab inside the window; here they are a dialog behind
a right-click, which suits a window this size better. Four of them, with N1MM's
own defaults: how many QTCs a series carries, whether the RX Ready and Cfm steps
are stopped at on the way through, and whether Hdr Agn and Agn clear what they
are asking for again.

Each one changes what the window does. The series count is passed to the search
for contacts worth reporting, the two skip settings are the focus order, and the
two clear settings are what the Agn buttons do. The Cfm buttons also disappear
when a RTTY station is reading its own log out, which is what N1MM does with
them.

N1MM's remaining QTC settings are all about putting traffic on the air — the CW
messages for Agn and TU, the field spacing, the four SSB recordings, the RTTY
templates — and nothing here transmits, so they are left out rather than shown
as settings that do nothing. The dialog says so where the operator will look.

The right-click menu needed a background on the panel to come up anywhere but
over a control: a panel with no background is not hit-tested.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-28 00:10:39 +00:00
parent 9ae5078c84
commit 648da1918a
8 changed files with 146 additions and 17 deletions

View File

@@ -0,0 +1,28 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="Nonemm.App.Dialogs.QtcSetupDialog"
Title="QTC setup" Width="420" SizeToContent="Height"
WindowStartupLocation="CenterOwner" CanResize="False">
<StackPanel Margin="14" Spacing="8">
<StackPanel Orientation="Horizontal" Spacing="8">
<TextBlock Text="QTCs in a series" VerticalAlignment="Center" />
<TextBox Name="CountBox" Width="50" />
</StackPanel>
<TextBlock Text="1 to 10, and fewer when the station has already had some."
FontSize="11" Opacity="0.7" TextWrapping="Wrap" Margin="0,-4,0,0" />
<CheckBox Name="SkipReadyBox" Content="Skip the RX Ready step" />
<TextBlock Text="Off puts the cursor on RX Ready when the window opens, so the other station is told to go ahead before anything is typed."
FontSize="11" Opacity="0.7" TextWrapping="Wrap" Margin="24,-6,0,0" />
<CheckBox Name="SkipConfirmBox" Content="Skip the Cfm step" />
<TextBlock Text="Off stops at each line's Cfm button before moving to the next line."
FontSize="11" Opacity="0.7" TextWrapping="Wrap" Margin="24,-6,0,0" />
<CheckBox Name="HeaderAgainClearsBox" Content="Hdr Agn clears the header" />
<CheckBox Name="AgainClearsBox" Content="Agn clears the line" />
<TextBlock Name="MissingText" FontSize="11" Opacity="0.7" TextWrapping="Wrap" Margin="0,6,0,0"
Text="N1MM's other QTC settings are for sending: the CW messages for Agn and TU, the field spacing, the SSB recordings and the RTTY message templates. Nothing here transmits, so they are left out rather than shown as settings that do nothing." />
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Spacing="6" Margin="0,8,0,0">
<Button Content="Cancel" Click="OnCancel" />
<Button Content="Save" Click="OnSave" IsDefault="True" />
</StackPanel>
</StackPanel>
</Window>

View File

@@ -0,0 +1,36 @@
using Avalonia.Controls;
using Avalonia.Interactivity;
using Nonemm.App.Configuration;
namespace Nonemm.App.Dialogs;
/// The QTC window's own settings, on its right-click menu as N1MM keeps them on
/// the window's Setup tab.
public sealed partial class QtcSetupDialog : Window
{
private readonly Settings settings;
public QtcSetupDialog(Settings settings)
{
this.settings = settings;
InitializeComponent();
CountBox.Text = settings.QtcLinesPerSeries.ToString();
SkipReadyBox.IsChecked = settings.QtcSkipReady;
SkipConfirmBox.IsChecked = settings.QtcSkipConfirm;
HeaderAgainClearsBox.IsChecked = settings.QtcHeaderAgainClears;
AgainClearsBox.IsChecked = settings.QtcAgainClearsLine;
}
private void OnSave(object? sender, RoutedEventArgs e) => Close(settings with
{
QtcLinesPerSeries = int.TryParse(CountBox.Text, out int count)
? Math.Clamp(count, 1, 10)
: settings.QtcLinesPerSeries,
QtcSkipReady = SkipReadyBox.IsChecked == true,
QtcSkipConfirm = SkipConfirmBox.IsChecked == true,
QtcHeaderAgainClears = HeaderAgainClearsBox.IsChecked == true,
QtcAgainClearsLine = AgainClearsBox.IsChecked == true,
});
private void OnCancel(object? sender, RoutedEventArgs e) => Close(null);
}