Repository navigation
fix: keep the Start/Stop button in sync with the detector state - #34
Open
leiteszeke wants to merge 1 commit into
Open
leiteszeke wants to merge 1 commit into
leiteszeke wants to merge 1 commit into
Conversation
draw_source_update() reset the dock button on every source update, so changing a source setting while detecting relabelled the running Stop button as "Start DRAW", re-enabled it while detectors were still starting, and with the input preview on disabled it so detection could not be stopped. With two sources, whichever updated last won. Each source now reports its own preview state; the dock disables Start only while some source is previewing and leaves the button alone while detectors are starting or running.
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
draw_source_update()reset the dock's Start button on every source update. As a result:Draw Displaysetting while detecting relabelled the running Stop button as Start DRAW;Changes
src/bridge.{h,cpp}—draw_dock_set_button_enabled(bool)→draw_dock_set_preview(source, active): each source reports its own preview state.src/DrawDock.{cpp,hpp}— the dock keeps the set of sources that are previewing.RefreshStartButton()disables Start only while some source is previewing, and leaves the button alone while detectors are starting or running (button checked), so it can always be used to stop them.src/draw.c— reports per source, and clears it when the source is destroyed (a deleted source can't leave the button stuck disabled).No behaviour change when nothing is detecting: preview on → button shows Preview in progress and is disabled, preview off → Start DRAW.
How it was tested
cmake --preset macos), tests pass (ctest).Draw Displaysources on one image input: