mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-16 06:35:57 +08:00
Type filtering fix
This commit is contained in:
parent
3dec56da12
commit
e33c80a681
@ -915,7 +915,8 @@ void PageMaterials::update_lists(int sel_type, int sel_vendor, int last_selected
|
|||||||
sel_printers_count = list_printer->GetSelections(sel_printers);
|
sel_printers_count = list_printer->GetSelections(sel_printers);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (sel_printers[0] != 0 && sel_printers[0] != 1) {
|
}
|
||||||
|
if (sel_printers_count > 0 && sel_printers[0] != 0 && sel_printers[0] != 1) {
|
||||||
for (int i = 0; i < sel_printers_count; i++) {
|
for (int i = 0; i < sel_printers_count; i++) {
|
||||||
const std::string& printer_name = list_printer->get_data(sel_printers[i]);
|
const std::string& printer_name = list_printer->get_data(sel_printers[i]);
|
||||||
const Preset* printer = nullptr;
|
const Preset* printer = nullptr;
|
||||||
@ -932,7 +933,8 @@ void PageMaterials::update_lists(int sel_type, int sel_vendor, int last_selected
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else if(last_selected_printer == 0){
|
}
|
||||||
|
else if (sel_printers_count > 0 && last_selected_printer == 0) {
|
||||||
//clear selection except "ALL"
|
//clear selection except "ALL"
|
||||||
list_printer->SetSelection(wxNOT_FOUND);
|
list_printer->SetSelection(wxNOT_FOUND);
|
||||||
list_printer->SetSelection(0);
|
list_printer->SetSelection(0);
|
||||||
@ -944,13 +946,14 @@ void PageMaterials::update_lists(int sel_type, int sel_vendor, int last_selected
|
|||||||
list_type->append(type, &type);
|
list_type->append(type, &type);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (last_selected_printer == 1) {
|
}
|
||||||
|
else if (sel_printers_count > 0 && last_selected_printer == 1) {
|
||||||
//clear selection except "CUSTOM"
|
//clear selection except "CUSTOM"
|
||||||
list_printer->SetSelection(wxNOT_FOUND);
|
list_printer->SetSelection(wxNOT_FOUND);
|
||||||
list_printer->SetSelection(1);
|
list_printer->SetSelection(1);
|
||||||
sel_printers_count = list_printer->GetSelections(sel_printers);
|
sel_printers_count = list_printer->GetSelections(sel_printers);
|
||||||
|
|
||||||
materials->filter_presets(nullptr, CUSTOM, CUSTOM, CUSTOM, [this](const Preset* p) {
|
materials->filter_presets(nullptr, CUSTOM, EMPTY, EMPTY, [this](const Preset* p) {
|
||||||
const std::string& type = this->materials->get_type(p);
|
const std::string& type = this->materials->get_type(p);
|
||||||
if (list_type->find(type) == wxNOT_FOUND) {
|
if (list_type->find(type) == wxNOT_FOUND) {
|
||||||
list_type->append(type, &type);
|
list_type->append(type, &type);
|
||||||
@ -959,7 +962,7 @@ void PageMaterials::update_lists(int sel_type, int sel_vendor, int last_selected
|
|||||||
|
|
||||||
}
|
}
|
||||||
sort_list_data(list_type, true, true);
|
sort_list_data(list_type, true, true);
|
||||||
}
|
|
||||||
sel_printers_prev = sel_printers;
|
sel_printers_prev = sel_printers;
|
||||||
sel_type = 0;
|
sel_type = 0;
|
||||||
sel_type_prev = wxNOT_FOUND;
|
sel_type_prev = wxNOT_FOUND;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user