fix: warn user when filament serial input sanitizes to empty string - #10879
fix: warn user when filament serial input sanitizes to empty string#10879BenJule wants to merge 4 commits into
Conversation
|
Apologies — this PR was closed by mistake on 2026-06-07, and that was an error on my side, not a deliberate decision to withdraw the change. It happened as an unintended side effect of a branch cleanup in my fork: deleting the head branch automatically closed this PR. The contribution still stands. I have restored the branch and reopened the PR. Sorry for the noise and any confusion this caused. |
tonghao-bbl
left a comment
There was a problem hiding this comment.
Hi @BenJule Can you have a look at these small issues in the comment?
| } | ||
| boost::algorithm::trim(vendor_name); | ||
| boost::algorithm::trim(serial_name); | ||
| if (!serial_str.IsEmpty() && serial_name.empty()) { |
There was a problem hiding this comment.
!serial_str.IsEmpty()is not needed here, check line 1022or leave it blank.in the message dilaog is not OK here since we dont accpet empty string as checked above
serial_str is already guaranteed non-empty by the earlier check, so the !serial_str.IsEmpty() guard was dead. The message also wrongly offered to 'leave it blank', which is rejected above; reworded to just ask for a fix.
|
Good catch, both fixed. Dropped the redundant serial_str.IsEmpty() guard since the empty case already returns earlier, and reworded the message so it no longer says you can leave it blank. |
| @@ -1038,6 +1038,12 @@ wxBoxSizer *CreateFilamentPresetDialog::create_button_item() | |||
| } | |||
| boost::algorithm::trim(vendor_name); | |||
| boost::algorithm::trim(serial_name); | |||
| if (serial_name.empty()) { | |||
There was a problem hiding this comment.
The check is duplicated with L1042
There was a problem hiding this comment.
Fixed, thanks. The second condition now only checks vendor_name.empty(), since the empty serial case already returns immediately above.
There was a problem hiding this comment.
Correction: my previous follow-up modified the earlier guard instead of the duplicated post-trim check. This is now fixed correctly: the first validation again checks both vendor and serial, while the later condition only checks vendor_name.empty() because the empty serial case already returns immediately above.
Signed-off-by: Benjamin Lütker <benjamin.luetker@gmail.com>
Signed-off-by: Benjamin Lütker <benjamin.luetker@gmail.com>
Summary
Changes
src/slic3r/GUI/CreatePresetsDialog.cpp: Add validation that warns the user when serial input becomes empty after sanitizationTest plan