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
- Connect to a FLEX-6700 → 8 slice tabs (A–H) appear. ✓
- Disconnect.
- Connect to a FLEX-6400 (or any 2-slice / 4-slice radio).
- 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.
Follow-up from #2243 (thanks @rfoust for the original fix).
What
Both
RxApplet::setMaxSlices()and the newMainWindowone-shotinitializedflag 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
Root cause
RxApplet::setMaxSlices()early-returns oncem_sliceBtnsis non-empty:And the
MainWindow::infoChangedlambda from #2243 only fires once per process via theinitializedflag.So neither layer rebuilds the button row when reconnecting to a smaller radio.
Fix sketch
m_sliceBtnsinRxAppleton disconnect (paired withMainWindow::onConnectionStateChanged(false)), then let the existing one-shot logic rebuild on the next connect'sinfoChanged,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.