mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-10 00:39:08 +08:00
Hopefully a fix of support_material_contact_distance: numeric input not valid (#2278)
Fixed an issue where one was comparing non-localized label with a localized one.
This commit is contained in:
parent
9fca67d281
commit
f6de7a629b
@ -583,12 +583,15 @@ void Choice::BUILD() {
|
|||||||
// recast as a wxWindow to fit the calling convention
|
// recast as a wxWindow to fit the calling convention
|
||||||
window = dynamic_cast<wxWindow*>(temp);
|
window = dynamic_cast<wxWindow*>(temp);
|
||||||
|
|
||||||
if (m_opt.enum_labels.empty() && m_opt.enum_values.empty()) {
|
if (! m_opt.enum_labels.empty() || ! m_opt.enum_values.empty()) {
|
||||||
}
|
if (m_opt.enum_labels.empty()) {
|
||||||
else{
|
// Append non-localized enum_values
|
||||||
for (auto el : m_opt.enum_labels.empty() ? m_opt.enum_values : m_opt.enum_labels) {
|
for (auto el : m_opt.enum_values)
|
||||||
const wxString& str = _(el);//m_opt_id == "support" ? _(el) : el;
|
temp->Append(el);
|
||||||
temp->Append(str);
|
} else {
|
||||||
|
// Append localized enum_labels
|
||||||
|
for (auto el : m_opt.enum_labels)
|
||||||
|
temp->Append(_(el));
|
||||||
}
|
}
|
||||||
set_selection();
|
set_selection();
|
||||||
}
|
}
|
||||||
@ -856,7 +859,7 @@ boost::any& Choice::get_value()
|
|||||||
else if (m_opt.gui_type == "f_enum_open") {
|
else if (m_opt.gui_type == "f_enum_open") {
|
||||||
const int ret_enum = field->GetSelection();
|
const int ret_enum = field->GetSelection();
|
||||||
if (ret_enum < 0 || m_opt.enum_values.empty() || m_opt.type == coStrings ||
|
if (ret_enum < 0 || m_opt.enum_values.empty() || m_opt.type == coStrings ||
|
||||||
ret_str != m_opt.enum_values[ret_enum] && ret_str != m_opt.enum_labels[ret_enum] )
|
(ret_str != m_opt.enum_values[ret_enum] && ret_str != _(m_opt.enum_labels[ret_enum])))
|
||||||
// modifies ret_string!
|
// modifies ret_string!
|
||||||
get_value_by_opt_type(ret_str);
|
get_value_by_opt_type(ret_str);
|
||||||
else
|
else
|
||||||
@ -892,15 +895,16 @@ void Choice::msw_rescale()
|
|||||||
// Set rescaled size
|
// Set rescaled size
|
||||||
field->SetSize(size);
|
field->SetSize(size);
|
||||||
|
|
||||||
size_t idx, counter = idx = 0;
|
size_t idx = 0;
|
||||||
if (m_opt.enum_labels.empty() && m_opt.enum_values.empty()) {}
|
if (! m_opt.enum_labels.empty() || ! m_opt.enum_values.empty()) {
|
||||||
else{
|
size_t counter = 0;
|
||||||
for (auto el : m_opt.enum_labels.empty() ? m_opt.enum_values : m_opt.enum_labels) {
|
bool labels = ! m_opt.enum_labels.empty();
|
||||||
const wxString& str = _(el);
|
for (const std::string &el : labels ? m_opt.enum_labels : m_opt.enum_values) {
|
||||||
field->Append(str);
|
wxString text = labels ? _(el) : wxString::ToUTF8(el.c_str());
|
||||||
if (el.compare(selection) == 0)
|
field->Append(text);
|
||||||
|
if (text == selection)
|
||||||
idx = counter;
|
idx = counter;
|
||||||
++counter;
|
++ counter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user