diff --git a/src/slic3r/GUI/Field.cpp b/src/slic3r/GUI/Field.cpp index 5fd5ef73a7c..10cae794dbe 100644 --- a/src/slic3r/GUI/Field.cpp +++ b/src/slic3r/GUI/Field.cpp @@ -1641,8 +1641,8 @@ void Choice::propagate_value() switch (m_opt.type) { case coFloatOrPercent: { - std::string old_val = !m_value.empty() ? boost::any_cast(m_value) : ""; - if (old_val == boost::any_cast(get_value())) + FloatOrPercent old_val = !m_value.empty() ? boost::any_cast(m_value) : FloatOrPercent{}; + if (old_val == boost::any_cast(get_value())) return; break; } @@ -1911,9 +1911,10 @@ boost::any& Choice::get_value() (ret_str != m_opt.enum_values[ret_enum] && ret_str != _(m_opt.enum_labels[ret_enum]))) // modifies ret_string! get_value_by_opt_type(ret_str); - else if (m_opt.type == coFloatOrPercent) - m_value = m_opt.enum_values[ret_enum]; - else if (m_opt.type == coInt) + else if (m_opt.type == coFloatOrPercent) { + m_value = FloatOrPercent{string_to_double_decimal_point(m_opt.enum_values[ret_enum]), + (m_opt.enum_values[ret_enum].find('%') != std::string::npos)}; + } else if (m_opt.type == coInt) m_value = atoi(m_opt.enum_values[ret_enum].c_str()); else m_value = string_to_double_decimal_point(m_opt.enum_values[ret_enum]); diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 2f32d045059..5dc1d0281cf 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -3118,7 +3118,12 @@ wxString GUI_App::current_language_code_safe() const void GUI_App::open_web_page_localized(const std::string &http_address) { - open_browser_with_warning_dialog(http_address + "&lng=" + this->current_language_code_safe(), nullptr, false); + wxString lng_param = wxString("lng=") + this->current_language_code_safe(); + + // Check if http_address already contains a query parameter + size_t query_pos = http_address.find('?'); + open_browser_with_warning_dialog(wxString(http_address) + wxString(query_pos == std::string::npos ? "?" : "&") + lng_param, + nullptr, false); } // If we are switching from the FFF-preset to the SLA, we should to control the printed objects if they have a part(s).