mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-19 19:33:47 +00:00
FIX: Support raft interface lost when filament removed
Jira: STUDIO-13777 Change-Id: I500bfb558e6739a79c679afad10e8be121a49ec2 (cherry picked from commit c9cf0843d2ecb3d2c549e2282a922b8fa4ae9ddc)
This commit is contained in:
@@ -457,7 +457,12 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con
|
|||||||
if (opt != nullptr) {
|
if (opt != nullptr) {
|
||||||
if (opt->getInt() > filament_cnt) {
|
if (opt->getInt() > filament_cnt) {
|
||||||
DynamicPrintConfig new_conf = *config;
|
DynamicPrintConfig new_conf = *config;
|
||||||
new_conf.set_key_value(key, new ConfigOptionInt(0));
|
const DynamicPrintConfig *conf_temp = wxGetApp().plater()->config();
|
||||||
|
int new_value = 0;
|
||||||
|
if (conf_temp != nullptr && conf_temp->has(key)) {
|
||||||
|
new_value = conf_temp->opt_int(key);
|
||||||
|
}
|
||||||
|
new_conf.set_key_value(key, new ConfigOptionInt(new_value));
|
||||||
apply(config, &new_conf);
|
apply(config, &new_conf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -752,14 +752,21 @@ struct DynamicFilamentList : DynamicList
|
|||||||
if (items.empty())
|
if (items.empty())
|
||||||
update(true);
|
update(true);
|
||||||
auto cb = dynamic_cast<ComboBox *>(c->window);
|
auto cb = dynamic_cast<ComboBox *>(c->window);
|
||||||
auto n = cb->GetSelection();
|
wxString old_selection = cb->GetStringSelection();
|
||||||
|
int old_index = cb->GetSelection();
|
||||||
cb->Clear();
|
cb->Clear();
|
||||||
cb->Append(_L("Default"));
|
cb->Append(_L("Default"));
|
||||||
for (auto i : items) {
|
for (auto i : items) {
|
||||||
cb->Append(i.first, i.second ? *i.second : wxNullBitmap);
|
cb->Append(i.first, i.second ? *i.second : wxNullBitmap);
|
||||||
}
|
}
|
||||||
if ((unsigned int)n < cb->GetCount())
|
int new_index = cb->FindString(old_selection);
|
||||||
cb->SetSelection(n);
|
if (new_index != wxNOT_FOUND) {
|
||||||
|
cb->SetSelection(new_index);
|
||||||
|
} else if ((unsigned int) old_index < cb->GetCount()) {
|
||||||
|
cb->SetSelection(old_index);
|
||||||
|
} else {
|
||||||
|
cb->SetSelection(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
wxString get_value(int index) override
|
wxString get_value(int index) override
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user