Corrected error message to last commit

This commit is contained in:
YuSanka 2018-05-10 12:54:02 +02:00
parent 754bfd926b
commit 98d9ce31de

View file

@ -95,23 +95,25 @@ namespace Slic3r { namespace GUI {
if (m_opt.type == coPercent && str.Last() == '%') if (m_opt.type == coPercent && str.Last() == '%')
str.RemoveLast(); str.RemoveLast();
else if (str.Last() == '%') { else if (str.Last() == '%') {
show_error(m_parent, _(L("Current option doesn't support percentage"))); wxString label = m_Label->GetLabel();
if (label.Last() == '\n') label.RemoveLast();
while (label.Last() == ' ') label.RemoveLast();
if (label.Last() == ':') label.RemoveLast();
show_error(m_parent, wxString::Format(_(L("%s doesn't support percentage")), label));
set_value(double_to_string(m_opt.min), true); set_value(double_to_string(m_opt.min), true);
m_value = double(m_opt.min); m_value = double(m_opt.min);
break; break;
} }
double val; double val;
str.ToCDouble(&val); str.ToCDouble(&val);
if (m_opt.min <= val && val <= m_opt.max) if (m_opt.min > val && val > m_opt.max)
m_value = val;
else
{ {
show_error(m_parent, _(L("Input value is out of range"))); show_error(m_parent, _(L("Input value is out of range")));
if (m_opt.min > val) val = m_opt.min; if (m_opt.min > val) val = m_opt.min;
if (val > m_opt.max) val = m_opt.max; if (val > m_opt.max) val = m_opt.max;
set_value(double_to_string(val), true); set_value(double_to_string(val), true);
m_value = val;
} }
m_value = val;
break; } break; }
case coString: case coString:
case coStrings: case coStrings: