Fix std::optional value() build error on older macOS SDK

For old macOS (pre 10.14), std::optional does not have .value() method, so the code is using operator*() instead.
This commit is contained in:
YuSanka 2023-02-06 15:13:04 +01:00
parent 917c9ad47b
commit 8b3ff9b9c4
5 changed files with 12 additions and 12 deletions

View file

@ -194,7 +194,7 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con
const ConfigOptionDef *fill_pattern_def = config->option_def("fill_pattern");
assert(fill_pattern_def != nullptr);
if (auto label = fill_pattern_def->enum_def->enum_to_label(fill_pattern); label.has_value()) {
wxString msg_text = GUI::format_wxstr(_L("The %1% infill pattern is not supposed to work at 100%% density."), _(label.value()));
wxString msg_text = GUI::format_wxstr(_L("The %1% infill pattern is not supposed to work at 100%% density."), _(*label));
if (is_global_config)
msg_text += "\n\n" + _L("Shall I switch to rectilinear fill pattern?");
MessageDialog dialog(m_msg_dlg_parent, msg_text, _L("Infill"),