Bug Report
Description
After connecting to one radio and then disconnecting, the user cannot connect to a different radio on the network. The auto-connect logic immediately reconnects to the first radio whenever its discovery broadcast arrives.
Root Cause
The auto-connect lambda in MainWindow triggers on every radioDiscovered signal, checking only if the serial matches lastRadioSerial in QSettings and the radio isn't currently connected. After an intentional disconnect, isConnected() returns false, so the very next discovery broadcast (every ~1 second) reconnects to the original radio before the user can select a different one.
Fix
Added m_userDisconnected flag to MainWindow:
- Set
true when user clicks Disconnect — blocks auto-connect
- Cleared when user explicitly clicks Connect on any radio — re-enables auto-connect with the new radio's serial
- Defaults to
false on app launch so auto-connect to last radio still works
Files Changed
src/gui/MainWindow.h — added m_userDisconnected member
src/gui/MainWindow.cpp — guard auto-connect lambda, set flag on disconnect/connect
🤖 Generated with Claude Code
Bug Report
Description
After connecting to one radio and then disconnecting, the user cannot connect to a different radio on the network. The auto-connect logic immediately reconnects to the first radio whenever its discovery broadcast arrives.
Root Cause
The auto-connect lambda in
MainWindowtriggers on everyradioDiscoveredsignal, checking only if the serial matcheslastRadioSerialin QSettings and the radio isn't currently connected. After an intentional disconnect,isConnected()returns false, so the very next discovery broadcast (every ~1 second) reconnects to the original radio before the user can select a different one.Fix
Added
m_userDisconnectedflag to MainWindow:truewhen user clicks Disconnect — blocks auto-connectfalseon app launch so auto-connect to last radio still worksFiles Changed
src/gui/MainWindow.h— addedm_userDisconnectedmembersrc/gui/MainWindow.cpp— guard auto-connect lambda, set flag on disconnect/connect🤖 Generated with Claude Code