Skip to content

Commit

Permalink
fix connection length
Browse files Browse the repository at this point in the history
supermerill committed Dec 29, 2023
2 parents feb5782 + 8ff918a commit 5baf04a
Showing 2 changed files with 12 additions and 6 deletions.
11 changes: 6 additions & 5 deletions src/slic3r/GUI/Field.cpp
Original file line number Diff line number Diff line change
@@ -1641,8 +1641,8 @@ void Choice::propagate_value()
switch (m_opt.type) {
case coFloatOrPercent:
{
std::string old_val = !m_value.empty() ? boost::any_cast<std::string>(m_value) : "";
if (old_val == boost::any_cast<std::string>(get_value()))
FloatOrPercent old_val = !m_value.empty() ? boost::any_cast<FloatOrPercent>(m_value) : FloatOrPercent{};
if (old_val == boost::any_cast<FloatOrPercent>(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]);
7 changes: 6 additions & 1 deletion src/slic3r/GUI/GUI_App.cpp
Original file line number Diff line number Diff line change
@@ -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).

0 comments on commit 5baf04a

Please sign in to comment.