diff --git a/src/nanosvg/README-prusa.txt b/src/nanosvg/README-prusa.txt new file mode 100644 index 0000000000..8388aa8ef3 --- /dev/null +++ b/src/nanosvg/README-prusa.txt @@ -0,0 +1 @@ +Upstream source: https://github.com/memononen/nanosvg/tree/c1f6e209c16b18b46aa9f45d7e619acf42c29726 \ No newline at end of file diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index 0b2af37b8e..7e64abcde1 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -162,8 +162,8 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con if (config->opt_bool("support_material")) { // Ask only once. - if (!m_support_material_overhangs_queried) { - m_support_material_overhangs_queried = true; + if (!support_material_overhangs_queried) { + support_material_overhangs_queried = true; if (!config->opt_bool("overhangs")/* != 1*/) { wxString msg_text = _(L("Supports work better, if the following feature is enabled:\n" "- Detect bridging perimeters")); @@ -182,7 +182,7 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con } } else { - m_support_material_overhangs_queried = false; + support_material_overhangs_queried = false; } if (config->option("fill_density")->value == 100) { diff --git a/src/slic3r/GUI/ConfigManipulation.hpp b/src/slic3r/GUI/ConfigManipulation.hpp index 0b50c8ab0f..0d6250b5af 100644 --- a/src/slic3r/GUI/ConfigManipulation.hpp +++ b/src/slic3r/GUI/ConfigManipulation.hpp @@ -17,11 +17,14 @@ class ModelConfig; namespace GUI { +// This variable have to be static because of use its value from Preset configuration +// and from object/parts configuration from the Settings in sidebar +static bool support_material_overhangs_queried {false}; + class ConfigManipulation { bool is_msg_dlg_already_exist{ false }; - bool m_support_material_overhangs_queried{false}; bool m_is_initialized_support_material_overhangs_queried{ false }; // function to loading of changed configuration @@ -63,7 +66,7 @@ public: void initialize_support_material_overhangs_queried(bool queried) { m_is_initialized_support_material_overhangs_queried = true; - m_support_material_overhangs_queried = queried; + support_material_overhangs_queried = queried; } }; diff --git a/src/slic3r/GUI/ConfigWizard.cpp b/src/slic3r/GUI/ConfigWizard.cpp index 2ddee6e865..85268fca15 100644 --- a/src/slic3r/GUI/ConfigWizard.cpp +++ b/src/slic3r/GUI/ConfigWizard.cpp @@ -2292,26 +2292,54 @@ void ConfigWizard::priv::select_default_materials_for_printer_models(Technology { PageMaterials *page_materials = technology & T_FFF ? page_filaments : page_sla_materials; const std::string &appconfig_section = page_materials->materials->appconfig_section(); - - auto select_default_materials_for_printer_page = [this, appconfig_section, printer_models](PagePrinters *page_printers, Technology technology) + + // Following block was unnecessary. Its enough to iterate printer_models once. Not for every vendor printer page. + // Filament is selected on same page for all printers of same technology. + /* + auto select_default_materials_for_printer_page = [this, appconfig_section, printer_models, technology](PagePrinters *page_printers, Technology technology) { const std::string vendor_id = page_printers->get_vendor_id(); for (auto& pair : bundles) if (pair.first == vendor_id) - for (const VendorProfile::PrinterModel *printer_model : printer_models) - for (const std::string &material : printer_model->default_materials) - appconfig_new.set(appconfig_section, material, "1"); + for (const VendorProfile::PrinterModel *printer_model : printer_models) + for (const std::string &material : printer_model->default_materials) + appconfig_new.set(appconfig_section, material, "1"); }; PagePrinters* page_printers = technology & T_FFF ? page_fff : page_msla; select_default_materials_for_printer_page(page_printers, technology); - for (const auto& printer : pages_3rdparty) + for (const auto& printer : pages_3rdparty) { page_printers = technology & T_FFF ? printer.second.first : printer.second.second; if (page_printers) select_default_materials_for_printer_page(page_printers, technology); } + */ + + // Iterate printer_models and select default materials. If none available -> msg to user. + std::vector models_without_default; + for (const VendorProfile::PrinterModel* printer_model : printer_models) { + if (printer_model->default_materials.empty()) { + models_without_default.emplace_back(printer_model); + } else { + for (const std::string& material : printer_model->default_materials) + appconfig_new.set(appconfig_section, material, "1"); + } + } + + if (!models_without_default.empty()) { + std::string printer_names = "\n\n"; + for (const VendorProfile::PrinterModel* printer_model : models_without_default) { + printer_names += printer_model->name + "\n"; + } + printer_names += "\n\n"; + std::string message = (technology & T_FFF ? + GUI::format(_L("Following printer profiles has no default filament: %1%Please select one manually."), printer_names) : + GUI::format(_L("Following printer profiles has no default material: %1%Please select one manually."), printer_names)); + MessageDialog msg(q, message, _L("Notice"), wxOK); + msg.ShowModal(); + } update_materials(technology); ((technology & T_FFF) ? page_filaments : page_sla_materials)->reload_presets();