Fix Printer Agent preset undo (#15645)

Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>
This commit is contained in:
Kiss Lorand
2026-09-13 21:03:45 -03:00
committed by GitHub
co-authored by Rodrigo Faselli
parent aef9ca2efb
commit fd63164268
2 changed files with 8 additions and 44 deletions
+3 -5
View File
@@ -798,11 +798,9 @@ void ConfigOptionsGroup::back_to_config_value(const DynamicPrintConfig& config,
#endif
else if (opt_key == "printer_agent")
{
// why: printer_agent is a coString kept out of m_opt_map. The generic non-opt_map revert
// below restores the edited config from get_value(), but a deregistered/"(missing)" saved
// id has no selectable row, so the field yields no value and the edited config keeps the
// user's interim pick -> stuck dirty. Restore the SAVED id straight into the edited config
// (displayable or not; config is the saved or system baseline), then repaint and notify.
// A deregistered/"(missing)" saved id has no selectable row, so the field yields no
// value. Restore the saved id directly instead of letting the generic revert path read
// the field value back into the edited config.
const std::string saved_id = config.opt_string("printer_agent");
set_value(opt_key, saved_id);
this->change_opt_value(opt_key, saved_id);