mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-15 11:35:54 +08:00
common filaments for custom printer
This commit is contained in:
parent
e566e948a3
commit
e794ce4c1d
@ -1989,14 +1989,15 @@ void ConfigWizard::priv::load_pages()
|
||||
if (any_fff_selected) { index->add_page(page_filaments); }
|
||||
// Filaments page if only custom printer is selected
|
||||
const AppConfig* app_config = wxGetApp().app_config;
|
||||
if (!any_fff_selected && custom_printer_selected && (app_config->get("no_common") == "0")) {
|
||||
if (!any_fff_selected && (custom_printer_selected || custom_printer_in_bundle) && (app_config->get("no_common") == "0")) {
|
||||
update_materials(T_ANY);
|
||||
index->add_page(page_filaments);
|
||||
}
|
||||
}
|
||||
if (any_sla_selected) { index->add_page(page_sla_materials); }
|
||||
|
||||
// there should to be selected at least one printer
|
||||
btn_finish->Enable(any_fff_selected || any_sla_selected || custom_printer_selected);
|
||||
btn_finish->Enable(any_fff_selected || any_sla_selected || custom_printer_selected || custom_printer_in_bundle);
|
||||
|
||||
index->add_page(page_update);
|
||||
index->add_page(page_reload_from_disk);
|
||||
@ -2057,6 +2058,13 @@ void ConfigWizard::priv::load_vendors()
|
||||
}
|
||||
}
|
||||
|
||||
for (const auto& printer : wxGetApp().preset_bundle->printers) {
|
||||
if (!printer.is_default && !printer.is_system && printer.is_visible) {
|
||||
custom_printer_in_bundle = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize the is_visible flag in printer Presets
|
||||
for (auto &pair : bundles) {
|
||||
pair.second.preset_bundle->load_installed_printers(appconfig_new);
|
||||
@ -2178,7 +2186,7 @@ void ConfigWizard::priv::set_run_reason(RunReason run_reason)
|
||||
|
||||
void ConfigWizard::priv::update_materials(Technology technology)
|
||||
{
|
||||
if (any_fff_selected && (technology & T_FFF)) {
|
||||
if ((any_fff_selected || custom_printer_in_bundle || custom_printer_selected) && (technology & T_FFF)) {
|
||||
filaments.clear();
|
||||
aliases_fff.clear();
|
||||
// Iterate filaments in all bundles
|
||||
|
@ -560,7 +560,8 @@ struct ConfigWizard::priv
|
||||
std::unique_ptr<DynamicPrintConfig> custom_config; // Backing for custom printer definition
|
||||
bool any_fff_selected; // Used to decide whether to display Filaments page
|
||||
bool any_sla_selected; // Used to decide whether to display SLA Materials page
|
||||
bool custom_printer_selected { false };
|
||||
bool custom_printer_selected { false }; // New custom printer is requested
|
||||
bool custom_printer_in_bundle { false }; // Older custom printer already exists when wizard starts
|
||||
// Set to true if there are none FFF printers on the main FFF page. If true, only SLA printers are shown (not even custum printers)
|
||||
bool only_sla_mode { false };
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user