From 131679c4fccdb200d6a184ffc45bd57dba1d0243 Mon Sep 17 00:00:00 2001 From: Aviator-Coding Date: Mon, 27 Nov 2023 14:40:39 -0500 Subject: [PATCH 1/2] Missformatted URL if no additional GET Parameter has been supplied --- src/slic3r/GUI/GUI_App.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index e31171c3098..ff85929221f 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). From 8ff918a99ce8a063c4e56d83cb44b1e332050cfb Mon Sep 17 00:00:00 2001 From: supermerill Date: Fri, 29 Dec 2023 22:24:40 +0100 Subject: [PATCH 2/2] fix flaot&percent open-enum fields supermerill/superslicer#4025 --- src/slic3r/GUI/Field.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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]);