Skip to content

Extract inline TxBandDialog to TxBandDialog.{cpp,h} + migrate to PersistentDialog (#2679 follow-up 2/3) #2768

Description

@ten9876

Context

Part of #2679 (umbrella PersistentDialog migrations). Reference implementation: PR #2742 (migrated ProfileImportExportDialog).

Important context the umbrella issue didn't capture: `TxBandDialog` is not currently a standalone class — it's a 119-line inline-constructed `QDialog` inside `MainWindow.cpp` starting at line 6548. This sub-issue requires an extra extract-to-class step before the PersistentDialog migration can apply.

This is why the umbrella ordered this one second — slightly more work than `PropDashboardDialog` (#2767), still simpler than `RadioSetupDialog`.

What to do — two-phase change

Phase A — Extract the inline construction

  1. Create `src/gui/TxBandDialog.{cpp,h}` — a real class.
  2. Copy the 119-line inline construction at `MainWindow.cpp:6548` (after `m_txBandDialog = dlg;`) into the new `TxBandDialog` constructor.
  3. Constructor signature should accept whatever data the inline construction needed (probably `RadioModel*` plus the current TX-profile string, based on the existing setup).
  4. Wire signals between MainWindow and the new TxBandDialog class as needed.
  5. `MainWindow.h` — change `QPointer m_txBandDialog;` at line 496 to `QPointer m_txBandDialog;`.
  6. `MainWindow.cpp` — replace the inline construction block with a `showOrRaisePersistent(m_txBandDialog, ...)` call.

Phase B — Inherit from PersistentDialog

Apply the same recipe as PR #2742:

  1. New `TxBandDialog` class inherits `: public PersistentDialog`.
  2. Constructor `: PersistentDialog("TX Band Settings", "TxBandDialogGeometry", parent)`.
  3. Build content into `bodyWidget()` instead of a hand-rolled body widget.
  4. Drop the manual `FramelessWindowTitleBar` + `FramelessResizer` setup — base class provides them.
  5. `closeEvent` forwards to `PersistentDialog::closeEvent` if overridden at all.
  6. `MainWindow.cpp` — remove the `setDialogFramelessMode(m_txBandDialog, on)` branch at line 11632-11633 from `setFramelessWindow()` — base class propagates via `m_persistentDialogs` registry.

AppSettings geometry key

Use `TxBandDialogGeometry` (PascalCase).

Acceptance criteria

  • `src/gui/TxBandDialog.{cpp,h}` exist as standalone files.
  • `TxBandDialog` inherits from `PersistentDialog`.
  • `m_txBandDialog` is typed `QPointer` (no `QDialog` fallback).
  • `MainWindow.cpp` has zero inline TxBandDialog construction.
  • Lazy-construct site uses `showOrRaisePersistent`.
  • `setFramelessWindow()` no longer calls `setDialogFramelessMode` for `m_txBandDialog`.
  • Geometry persists across launches under AppSettings key `TxBandDialogGeometry`.
  • TX-band header grid, per-band TX power / tune-power / hwalc-enabled / inhibit / RCA/ACC enables all work identically to today.
  • CMakeLists.txt registers `src/gui/TxBandDialog.cpp` in the gui sources block.

Risk

  • Extract step is the load-bearing change. Test thoroughly that TX Band Settings opens, edits propagate to the radio, and closes save state.
  • 119 lines of UI code needs careful translation — preserve the FlexLib bandset semantics (`transmit bandset {BandId} ...` commands, `interlock bandset {BandId} ...` commands).

Pickup

AetherClaude-eligible but more substantial than #2767 — extra extract step. Ship as one PR (extract + migrate together) since the extract isn't useful in isolation.

73, Jeremy KK7GWY & Claude (AI dev partner)

Metadata

Metadata

Assignees

No one assigned

    Labels

    GUIUser interfaceenhancementImprovement to existing featuremaintainer-reviewRequires maintainer review before any action is takenrefactorCode cleanup, restructuring, or consolidation — no user-visible behavior change

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions