mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-29 17:44:36 +08:00
Follow-up to f37b9c4d51
:
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:
parent
52e0e5b8cc
commit
3eb63c93e1
@ -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);
|
set_value(double_to_string(val), true);
|
||||||
};
|
};
|
||||||
if (m_opt_id == "extrusion_multiplier") {
|
if (m_opt_id == "extrusion_multiplier") {
|
||||||
wxString msg_text = format_wxstr(_L("Input value is out of range\n"
|
if (m_value.empty() || boost::any_cast<double>(m_value) != val) {
|
||||||
"Are you sure that %s is a correct value and you want to continue?"), str);
|
wxString msg_text = format_wxstr(_L("Input value is out of range\n"
|
||||||
wxMessageDialog dialog(m_parent, msg_text, _L("Parameter validation") + ": " + m_opt_id, wxICON_WARNING | wxYES | wxNO);
|
"Are you sure that %s is a correct value and you want to continue?"), str);
|
||||||
if (dialog.ShowModal() == wxID_NO)
|
wxMessageDialog dialog(m_parent, msg_text, _L("Parameter validation") + ": " + m_opt_id, wxICON_WARNING | wxYES | wxNO);
|
||||||
set_val(val);
|
if (dialog.ShowModal() == wxID_NO)
|
||||||
|
set_val(val);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
show_error(m_parent, _L("Input value is out of range"));
|
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(),
|
// on_kill_focus() cause a call of OptionsGroup::reload_config(),
|
||||||
// Thus, do it only when it's really needed (when undefined value was input)
|
// Thus, do it only when it's really needed (when undefined value was input)
|
||||||
on_kill_focus();
|
on_kill_focus();
|
||||||
else if (value_was_changed() && m_on_change != nullptr && !m_disable_change_event) {
|
else if (value_was_changed())
|
||||||
// For this moment m_value is already updated in value_was_changed()
|
on_change_field();
|
||||||
// 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
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextCtrl::set_value(const boost::any& value, bool change_event/* = false*/) {
|
void TextCtrl::set_value(const boost::any& value, bool change_event/* = false*/) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user