fix(kad): refresh status bar after StopKad() - #133
Merged
Conversation
CamuleApp::StopKad() stopped Kademlia but never called ShowConnectionState() afterwards, so the status-bar Kad indicator kept showing "Connected to Kad" until the next periodic refresh in the main timer loop. The symmetric BootstrapKad() path at amule.cpp:2312 already calls ShowConnectionState() after Start(); add the matching call after Stop() so the indicator updates immediately. Most visible impact is the "Disconnect Kad" button in KadDlg — KadDlg::OnBnClickedDisconnectKad calls theApp->StopKad() directly, so the user clicks the button and sees no UI change. Closes amule-project#131.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #131. The "Disconnect Kad" button in KadDlg stopped Kademlia but left the status-bar Kad indicator stuck on "Connected to Kad" until the next periodic refresh, as reported with screenshots.
Root cause
CamuleApp::StopKad()at amule.cpp:2299 calledKademlia::CKademlia::Stop()but neverShowConnectionState(). The symmetricBootstrapKad()path at amule.cpp:2312 already callsShowConnectionState()afterStart()— the asymmetry was the bug.Fix
Add the matching
ShowConnectionState()call afterStop()so the status-bar indicator refreshes immediately (ShowConnectionStateis a local UI-side refresh — it computes the connection bitmask and callsNotify_ShowConnStateto update the main window; no EC traffic).Scope
Visible to users via
KadDlg.cpp:206(the "Disconnect Kad" button) — that path callstheApp->StopKad()directly with no follow-up refresh.The EC handlers in
ExternalConn.cpp(cases around lines 2267, 2274, 2294, 2328, 2345) already callShowConnectionState()themselves after stopping Kad, so they were not affected. The internalamule.cpp:1442(lost-connection in the main timer loop) andamule.cpp:1696(shutdown) paths are also unaffected — the surrounding code in those frames already refreshes.Putting the call inside
StopKad()means future callers don't have to remember to refresh.Test plan