Add confirmation dialog before resetting work coordinate zero#3126
Merged
breiler merged 1 commit intoJun 14, 2026
Merged
Conversation
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
The DRO "Reset Zero" buttons (all-axes and per-axis X/Y/Z/A/B/C) now show a confirmation dialog before they wipe the work-coordinate zero. The dialog includes a "Don't ask again" checkbox; if checked, the prompt is permanently dismissed and the choice is persisted to settings. The confirmation is on by default, so existing users get the safety net immediately and anyone who finds it annoying can opt out in one click.
Implementation:
Settings.javagains aconfirmResetZeroflag (defaulttrue) withisConfirmResetZero()/setConfirmResetZero(boolean)accessors following the existingscrollWindowEnabledboolean pattern.ResetZeroConfirmationhelper centralizes the prompt: short-circuits totruewhen confirmation is disabled, otherwise shows aJOptionPaneyes/no dialog with the opt-out checkbox and persists the choice viaSettingsFactory.saveSettings.ResetCoordinatesToZeroActionandReset{X,Y,Z,A,B,C}CoordinateToZeroAction) guard theiractionPerformedwithResetZeroConfirmation.confirmResetZero(backend)before callingbackend.resetCoordinate(s)ToZero(...).MessagesBundle_en_US.properties.Why this matters
Users accidentally hit the reset-zero buttons when they meant to run a return-to-zero macro, silently destroying a carefully set work origin. This implements the design the maintainer specified in the issue thread: "a confirmation box, asking if the user is sure to reset the zero coordinates with an option to hide future questions." #3040
Testing
mvn -pl ugs-core,ugs-platform/ugs-platform-ugscore -am compilesucceeds.ResetZeroConfirmationTest(4 tests, all green): verifies the helper returnstruewithout showing a dialog when confirmation is disabled (and leaves the flag untouched), handles a nullSettings, that the setting defaults totrue, and that the setter updates the value.Fixes #3040