Fixed 2 bugs :

1. "Revert" buttons on the bar don't work for a "Compatible printers" and a "Compatible prints profiles".
   And cause a crash if they are pressed in Print(SLA) Settings.

2. A label of a "Compatible printers" option is always black in Filament(Materials) Settings Tab
This commit is contained in:
YuSanka 2020-03-04 20:58:14 +01:00
parent fc453df38f
commit 57f3f299cd
3 changed files with 93 additions and 101 deletions

View file

@ -427,7 +427,9 @@ void ConfigOptionsGroup::back_to_config_value(const DynamicPrintConfig& config,
auto *nozzle_diameter = dynamic_cast<const ConfigOptionFloats*>(config.option("nozzle_diameter"));
value = int(nozzle_diameter->values.size());
}
else if (m_opt_map.find(opt_key) == m_opt_map.end() || opt_key == "bed_shape") {
else if (m_opt_map.find(opt_key) == m_opt_map.end() ||
// This option don't have corresponded field
opt_key == "bed_shape" || opt_key == "compatible_printers" || opt_key == "compatible_prints" ) {
value = get_config_value(config, opt_key);
change_opt_value(*m_config, opt_key, value);
return;
@ -644,7 +646,7 @@ boost::any ConfigOptionsGroup::get_config_value(const DynamicPrintConfig& config
ret = static_cast<wxString>(config.opt_string(opt_key));
break;
case coStrings:
if (opt_key.compare("compatible_printers") == 0) {
if (opt_key == "compatible_printers" || opt_key == "compatible_prints") {
ret = config.option<ConfigOptionStrings>(opt_key)->values;
break;
}