From cc4026cfc50d25efd7d54964345b6100d8c8a7f8 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Tue, 10 Dec 2019 13:42:13 +0100 Subject: [PATCH] Fixed Wizard material configuration check --- src/slic3r/GUI/ConfigWizard.cpp | 12 ++++++------ src/slic3r/GUI/ConfigWizard_private.hpp | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/slic3r/GUI/ConfigWizard.cpp b/src/slic3r/GUI/ConfigWizard.cpp index eca32c8b02..971bd1f1d3 100644 --- a/src/slic3r/GUI/ConfigWizard.cpp +++ b/src/slic3r/GUI/ConfigWizard.cpp @@ -1605,7 +1605,7 @@ void ConfigWizard::priv::on_3rdparty_install(const VendorProfile *vendor, bool i load_pages(); } -bool ConfigWizard::priv::check_material_config() +bool ConfigWizard::priv::check_material_config(Technology technology) { const auto exist_preset = [this](const std::string& section, const Materials& materials) { @@ -1620,13 +1620,13 @@ bool ConfigWizard::priv::check_material_config() return false; }; - if (any_fff_selected && !exist_preset(AppConfig::SECTION_FILAMENTS, filaments)) + if (any_fff_selected && technology & T_FFF && !exist_preset(AppConfig::SECTION_FILAMENTS, filaments)) { show_info(q, _(L("You have to select at least one filament for selected printers")), ""); return false; } - if (any_sla_selected && !exist_preset(AppConfig::SECTION_MATERIALS, sla_materials)) + if (any_sla_selected && technology & T_SLA && !exist_preset(AppConfig::SECTION_MATERIALS, sla_materials)) { show_info(q, _(L("You have to select at least one material for selected printers")), ""); return false; @@ -1861,7 +1861,7 @@ ConfigWizard::ConfigWizard(wxWindow *parent) p->add_page(p->page_filaments = new PageMaterials(this, &p->filaments, _(L("Filament Profiles Selection")), _(L("Filaments")), _(L("Type:")) )); p->add_page(p->page_sla_materials = new PageMaterials(this, &p->sla_materials, - _(L("SLA Material Profiles Selection")), _(L("SLA Materials")), _(L("Layer height:")) )); + _(L("SLA Material Profiles Selection")) + " ", _(L("SLA Materials")), _(L("Layer height:")) )); p->add_page(p->page_custom = new PageCustom(this)); p->add_page(p->page_update = new PageUpdate(this)); @@ -1899,14 +1899,14 @@ ConfigWizard::ConfigWizard(wxWindow *parent) // check, that there is selected at least one filament/material ConfigWizardPage* active_page = this->p->index->active_page(); if ( (active_page == p->page_filaments || active_page == p->page_sla_materials) - && !p->check_material_config()) + && !p->check_material_config(dynamic_cast(active_page)->materials->technology)) return; this->p->index->go_next(); }); p->btn_finish->Bind(wxEVT_BUTTON, [this](const wxCommandEvent &) { - if (!p->check_material_config()) + if (!p->check_material_config(T_ANY)) return; this->EndModal(wxID_OK); }); diff --git a/src/slic3r/GUI/ConfigWizard_private.hpp b/src/slic3r/GUI/ConfigWizard_private.hpp index d0cd14b471..fc91909e71 100644 --- a/src/slic3r/GUI/ConfigWizard_private.hpp +++ b/src/slic3r/GUI/ConfigWizard_private.hpp @@ -489,7 +489,7 @@ struct ConfigWizard::priv void on_printer_pick(PagePrinters *page, const PrinterPickerEvent &evt); void on_3rdparty_install(const VendorProfile *vendor, bool install); - bool check_material_config(); + bool check_material_config(Technology technology); void apply_config(AppConfig *app_config, PresetBundle *preset_bundle, const PresetUpdater *updater); // #ys_FIXME_alise void update_presets_in_config(const std::string& section, const std::string& alias_key, bool add);