Skip to content

RX slice tab row doesn't rebuild on reconnect to a different radio model #2254

@ten9876

Description

@ten9876

Follow-up from #2243 (thanks @rfoust for the original fix).

What

Both RxApplet::setMaxSlices() and the new MainWindow one-shot initialized flag are scoped to the process lifetime, not the current connection. Pre-existing behaviour, not introduced by #2243 — but worth tracking now that we've cleaned up the rest of the slice-tab capacity path.

Repro

  1. Connect to a FLEX-6700 → 8 slice tabs (A–H) appear. ✓
  2. Disconnect.
  3. Connect to a FLEX-6400 (or any 2-slice / 4-slice radio).
  4. Tab row still shows 8 buttons; the upper ones never resolve to live slices.

Root cause

RxApplet::setMaxSlices() early-returns once m_sliceBtns is non-empty:

void RxApplet::setMaxSlices(int maxSlices)
{
    if (!m_sliceBtns.isEmpty()) {
        return;
    }
    ...
}

And the MainWindow::infoChanged lambda from #2243 only fires once per process via the initialized flag.

So neither layer rebuilds the button row when reconnecting to a smaller radio.

Fix sketch

  • Either tear down m_sliceBtns in RxApplet on disconnect (paired with MainWindow::onConnectionStateChanged(false)), then let the existing one-shot logic rebuild on the next connect's infoChanged,
  • Or change setMaxSlices() to be idempotent — clear the existing buttons and rebuild whenever the count changes.

The first approach reuses the (now-correct) one-shot path; the second simplifies callers but means more allocations on each model-change event.

cc @rfoust — same area you just fixed; flagging in case you want first crack at it, otherwise we'll pick it up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting-responseWaiting for reporter to provide additional informationbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions