mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -06:00
Fix of the change of the perimeters count in a vase-mode (part fix of #1649)
This commit is contained in:
parent
19a6461608
commit
66f998bdbf
4 changed files with 13 additions and 2 deletions
|
@ -436,7 +436,7 @@ void SpinCtrl::BUILD() {
|
||||||
propagate_value();
|
propagate_value();
|
||||||
}), temp->GetId());
|
}), temp->GetId());
|
||||||
|
|
||||||
temp->Bind(wxEVT_SPINCTRL, ([this](wxCommandEvent e) { on_change_field(); }), temp->GetId());
|
temp->Bind(wxEVT_SPINCTRL, ([this](wxCommandEvent e) { propagate_value(); }), temp->GetId());
|
||||||
|
|
||||||
temp->Bind(wxEVT_TEXT_ENTER, ([this](wxCommandEvent e)
|
temp->Bind(wxEVT_TEXT_ENTER, ([this](wxCommandEvent e)
|
||||||
{
|
{
|
||||||
|
@ -472,7 +472,7 @@ void SpinCtrl::propagate_value()
|
||||||
{
|
{
|
||||||
if (tmp_value < 0)
|
if (tmp_value < 0)
|
||||||
on_kill_focus();
|
on_kill_focus();
|
||||||
else
|
else if (boost::any_cast<int>(m_value) != tmp_value)
|
||||||
on_change_field();
|
on_change_field();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -325,6 +325,7 @@ public:
|
||||||
void set_value(const boost::any& value, bool change_event = false) {
|
void set_value(const boost::any& value, bool change_event = false) {
|
||||||
m_disable_change_event = !change_event;
|
m_disable_change_event = !change_event;
|
||||||
tmp_value = boost::any_cast<int>(value);
|
tmp_value = boost::any_cast<int>(value);
|
||||||
|
m_value = value;
|
||||||
dynamic_cast<wxSpinCtrl*>(window)->SetValue(tmp_value);
|
dynamic_cast<wxSpinCtrl*>(window)->SetValue(tmp_value);
|
||||||
m_disable_change_event = false;
|
m_disable_change_event = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1132,6 +1132,13 @@ void TabPrint::update()
|
||||||
if (m_preset_bundle->printers.get_selected_preset().printer_technology() == ptSLA)
|
if (m_preset_bundle->printers.get_selected_preset().printer_technology() == ptSLA)
|
||||||
return; // ys_FIXME
|
return; // ys_FIXME
|
||||||
|
|
||||||
|
//! Temporary workaround for the correct updates of the SpinCtrl (like "perimeters"):
|
||||||
|
// KillFocus() for the wxSpinCtrl use CallAfter function. So,
|
||||||
|
// to except the duplicate call of the update() after dialog->ShowModal(),
|
||||||
|
// let check if this process is already started.
|
||||||
|
if (is_msg_dlg_already_exist)
|
||||||
|
return;
|
||||||
|
|
||||||
Freeze();
|
Freeze();
|
||||||
|
|
||||||
double fill_density = m_config->option<ConfigOptionPercent>("fill_density")->value;
|
double fill_density = m_config->option<ConfigOptionPercent>("fill_density")->value;
|
||||||
|
@ -1147,6 +1154,7 @@ void TabPrint::update()
|
||||||
"- no ensure_vertical_shell_thickness\n"
|
"- no ensure_vertical_shell_thickness\n"
|
||||||
"\nShall I adjust those settings in order to enable Spiral Vase?"));
|
"\nShall I adjust those settings in order to enable Spiral Vase?"));
|
||||||
auto dialog = new wxMessageDialog(parent(), msg_text, _(L("Spiral Vase")), wxICON_WARNING | wxYES | wxNO);
|
auto dialog = new wxMessageDialog(parent(), msg_text, _(L("Spiral Vase")), wxICON_WARNING | wxYES | wxNO);
|
||||||
|
is_msg_dlg_already_exist = true;
|
||||||
DynamicPrintConfig new_conf = *m_config;
|
DynamicPrintConfig new_conf = *m_config;
|
||||||
if (dialog->ShowModal() == wxID_YES) {
|
if (dialog->ShowModal() == wxID_YES) {
|
||||||
new_conf.set_key_value("perimeters", new ConfigOptionInt(1));
|
new_conf.set_key_value("perimeters", new ConfigOptionInt(1));
|
||||||
|
@ -1162,6 +1170,7 @@ void TabPrint::update()
|
||||||
}
|
}
|
||||||
load_config(new_conf);
|
load_config(new_conf);
|
||||||
on_value_change("fill_density", fill_density);
|
on_value_change("fill_density", fill_density);
|
||||||
|
is_msg_dlg_already_exist = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_config->opt_bool("wipe_tower") && m_config->opt_bool("support_material") &&
|
if (m_config->opt_bool("wipe_tower") && m_config->opt_bool("support_material") &&
|
||||||
|
|
|
@ -287,6 +287,7 @@ protected:
|
||||||
|
|
||||||
class TabPrint : public Tab
|
class TabPrint : public Tab
|
||||||
{
|
{
|
||||||
|
bool is_msg_dlg_already_exist {false};
|
||||||
public:
|
public:
|
||||||
TabPrint(wxNotebook* parent) :
|
TabPrint(wxNotebook* parent) :
|
||||||
Tab(parent, _(L("Print Settings")), "print") {}
|
Tab(parent, _(L("Print Settings")), "print") {}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue