Machine page destruction - #21778
Open
HellAholic wants to merge 4 commits into
Open
Machine page destruction#21778HellAholic wants to merge 4 commits into
HellAholic wants to merge 4 commits into
Conversation
At any given time only a single field can have unfinished edit, using the generic onDestruction would lead to slow down and each field has a onFinishedEditing trigger. So we only need to save and update the value for a single field rather than triggering it for the entire content.
Update `GcodeTextArea.qml` to only persist the text on destruction when it actually differs from the current property value. This prevents unnecessary `setPropertyValue("value", text)` calls and avoids triggering no-op updates.
Update `NumericTextFieldWithUnit` to apply pending text edits whenever the field loses focus, including when the dialog closes. This replaces the destruction-time commit hook with a focus-based check that only commits when the value actually changed, while keeping tab-focus select-all behavior.
In `PrintHeadMinMaxTextField.qml`, `editingFinishedFunction` now checks whether the parsed input equals `axisValue` before parsing and rewriting the polygon JSON. If unchanged, it restores the binding and returns early, avoiding unnecessary JSON round-trips and reducing work on no-op edits.
Contributor
Test Results24 955 tests 24 953 ✅ 48s ⏱️ Results for commit d021fed. |
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.
This pull request improves how in-progress edits are committed in machine settings dialogs, ensuring user changes are saved more reliably when dialogs are closed or focus is lost. It also optimizes value updates to avoid unnecessary processing when values haven't changed.
User input commit and dialog behavior improvements:
MachineSettings/NumericTextFieldWithUnit.qml, edits are now automatically committed when the text field loses focus (including when dialogs close), ensuring user changes aren't lost if the dialog is closed without explicit confirmation.Component.onDestructionhandler was removed in favor of the improved focus handling, preventing redundant or mistimed commits.Preferences/MachinesPage.qml, the dialog no longer self-destroys immediately, allowing any active edit to be committed before the dialog is closed. The field with focus has itseditingFinishedFunctioncalled before destruction, preventing data loss.Optimizations and correctness:
PrintHeadMinMaxTextField.qml, the code now checks if the value was actually changed before updating, skipping unnecessary JSON parsing and updates if the value is unchanged.GcodeTextArea.qml, the property value is only updated if the text has actually changed, avoiding redundant updates.CURA-13309