diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 2f12ceb41..8695b187a 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -1432,6 +1432,11 @@ MainWindow::MainWindow(QWidget* parent) m_radioInfoLabel->setText(m_radioModel.model()); if (m_radioVersionLabel && !m_radioModel.version().isEmpty()) m_radioVersionLabel->setText(m_radioModel.version()); + // Also refresh the station/nickname label: the nickname can be corrected + // by the async "info" reply after connect, and this handler previously + // updated only model + version, leaving a stale station name on screen. + if (!m_radioModel.nickname().isEmpty()) + setStatusBarStationText(m_stationLabel, m_radioModel.nickname()); }); // Propagate late-arriving SmartSDR+ subscription + dual-SCU diversity @@ -5277,6 +5282,15 @@ void MainWindow::onConnectionStateChanged(bool connected) #endif audioStopRx(); audioStopTx(); + // Clear the cached DAX-TX stream id on connection loss. RadioModel already + // resets its own dax_tx state on disconnect, but AudioEngine::m_txStreamId + // was left holding the OLD id — so after a reconnect the AX.25 modem's + // "create the stream only if txStreamId()==0" guard saw a stale non-zero + // id, skipped ensureDaxTxStream(), and pumped modem audio to a dead stream + // (bare carrier, no modulation). Resetting it here makes the next transmit + // re-create the DAX-TX stream on the new connection. + if (m_audio) + m_audio->setTxStreamId(0); for (auto it = m_panFpsReconcileConnections.begin(); it != m_panFpsReconcileConnections.end(); ++it) { diff --git a/src/models/RadioModel.cpp b/src/models/RadioModel.cpp index a05747fd7..6a773a706 100644 --- a/src/models/RadioModel.cpp +++ b/src/models/RadioModel.cpp @@ -1767,6 +1767,14 @@ void RadioModel::connectToRadio(const RadioInfo& info) m_name = info.name; m_model = info.model; m_version = info.version; + // Seed nickname/callsign from the discovery packet so the status-bar station + // label is correct the instant onConnectionStateChanged(true) reads it. These + // were previously only set later from the async "info" reply, so on connect + // the label showed a STALE m_nickname — blank on the first connect, or the + // PREVIOUSLY connected radio's name (it is never cleared on disconnect). The + // async reply still refreshes them if they differ. + m_nickname = info.nickname; + m_callsign = info.callsign; m_declaredBands = parseDeclaredBands(info.bands); // empty for real Flex m_maxSlices = maxSlicesForModel(m_model); if (reloadAntennaAliases()) @@ -3803,6 +3811,13 @@ void RadioModel::onDisconnected() m_staleSessionSerial = m_chassisSerial; m_chassisSerial.clear(); m_callsign.clear(); + // Clear the nickname here too, not just on the connectToRadio() seeding + // path: connectViaWan() takes no RadioInfo and the LAN auto-reconnect timer + // calls m_connection->connectToRadio(m_lastInfo) directly, both bypassing + // RadioModel::connectToRadio(). Clearing on the disconnect side closes all + // three paths at once, so a reconnect can never show the previous radio's + // station label while the async info reply is in flight. (#4260 review) + m_nickname.clear(); m_region.clear(); m_rxAudio = {}; m_netCwStreamId = 0;