Fix for issues:
Issue 1:
1. Change "Extrusion multiplier" parameter,
2. Save edited preset.
3. Change "Extrusion multiplier" parameter -> preset wasn't marked as "modified"

Issue 2:
1. Change "Extrusion multiplier" parameter with out of range value
2. Push ENTER for the message dialog
3. Answer "Yes"
4. Same message dialog appears again
This commit is contained in:
YuSanka 2020-12-16 13:07:27 +01:00
parent 52e0e5b8cc
commit 3eb63c93e1

View file

@ -265,11 +265,13 @@ void Field::get_value_by_opt_type(wxString& str, const bool check_value/* = true
set_value(double_to_string(val), true);
};
if (m_opt_id == "extrusion_multiplier") {
wxString msg_text = format_wxstr(_L("Input value is out of range\n"
"Are you sure that %s is a correct value and you want to continue?"), str);
wxMessageDialog dialog(m_parent, msg_text, _L("Parameter validation") + ": " + m_opt_id, wxICON_WARNING | wxYES | wxNO);
if (dialog.ShowModal() == wxID_NO)
set_val(val);
if (m_value.empty() || boost::any_cast<double>(m_value) != val) {
wxString msg_text = format_wxstr(_L("Input value is out of range\n"
"Are you sure that %s is a correct value and you want to continue?"), str);
wxMessageDialog dialog(m_parent, msg_text, _L("Parameter validation") + ": " + m_opt_id, wxICON_WARNING | wxYES | wxNO);
if (dialog.ShowModal() == wxID_NO)
set_val(val);
}
}
else {
show_error(m_parent, _L("Input value is out of range"));
@ -573,13 +575,8 @@ void TextCtrl::propagate_value()
// on_kill_focus() cause a call of OptionsGroup::reload_config(),
// Thus, do it only when it's really needed (when undefined value was input)
on_kill_focus();
else if (value_was_changed() && m_on_change != nullptr && !m_disable_change_event) {
// For this moment m_value is already updated in value_was_changed()
// so instead of call on_change_field() { m_on_change(m_opt_id, get_value()); }
// just do next:
m_on_change(m_opt_id, m_value);
// on_change_field(); // #ysFIXME delete after testing
}
else if (value_was_changed())
on_change_field();
}
void TextCtrl::set_value(const boost::any& value, bool change_event/* = false*/) {