mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-21 20:18:17 +08:00
Fixed Wizard material configuration check
This commit is contained in:
parent
a9b1ab0a4c
commit
cc4026cfc5
@ -1605,7 +1605,7 @@ void ConfigWizard::priv::on_3rdparty_install(const VendorProfile *vendor, bool i
|
|||||||
load_pages();
|
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)
|
const auto exist_preset = [this](const std::string& section, const Materials& materials)
|
||||||
{
|
{
|
||||||
@ -1620,13 +1620,13 @@ bool ConfigWizard::priv::check_material_config()
|
|||||||
return false;
|
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")), "");
|
show_info(q, _(L("You have to select at least one filament for selected printers")), "");
|
||||||
return false;
|
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")), "");
|
show_info(q, _(L("You have to select at least one material for selected printers")), "");
|
||||||
return false;
|
return false;
|
||||||
@ -1861,7 +1861,7 @@ ConfigWizard::ConfigWizard(wxWindow *parent)
|
|||||||
p->add_page(p->page_filaments = new PageMaterials(this, &p->filaments,
|
p->add_page(p->page_filaments = new PageMaterials(this, &p->filaments,
|
||||||
_(L("Filament Profiles Selection")), _(L("Filaments")), _(L("Type:")) ));
|
_(L("Filament Profiles Selection")), _(L("Filaments")), _(L("Type:")) ));
|
||||||
p->add_page(p->page_sla_materials = new PageMaterials(this, &p->sla_materials,
|
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_custom = new PageCustom(this));
|
||||||
p->add_page(p->page_update = new PageUpdate(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
|
// check, that there is selected at least one filament/material
|
||||||
ConfigWizardPage* active_page = this->p->index->active_page();
|
ConfigWizardPage* active_page = this->p->index->active_page();
|
||||||
if ( (active_page == p->page_filaments || active_page == p->page_sla_materials)
|
if ( (active_page == p->page_filaments || active_page == p->page_sla_materials)
|
||||||
&& !p->check_material_config())
|
&& !p->check_material_config(dynamic_cast<PageMaterials*>(active_page)->materials->technology))
|
||||||
return;
|
return;
|
||||||
this->p->index->go_next();
|
this->p->index->go_next();
|
||||||
});
|
});
|
||||||
|
|
||||||
p->btn_finish->Bind(wxEVT_BUTTON, [this](const wxCommandEvent &)
|
p->btn_finish->Bind(wxEVT_BUTTON, [this](const wxCommandEvent &)
|
||||||
{
|
{
|
||||||
if (!p->check_material_config())
|
if (!p->check_material_config(T_ANY))
|
||||||
return;
|
return;
|
||||||
this->EndModal(wxID_OK);
|
this->EndModal(wxID_OK);
|
||||||
});
|
});
|
||||||
|
@ -489,7 +489,7 @@ struct ConfigWizard::priv
|
|||||||
void on_printer_pick(PagePrinters *page, const PrinterPickerEvent &evt);
|
void on_printer_pick(PagePrinters *page, const PrinterPickerEvent &evt);
|
||||||
void on_3rdparty_install(const VendorProfile *vendor, bool install);
|
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);
|
void apply_config(AppConfig *app_config, PresetBundle *preset_bundle, const PresetUpdater *updater);
|
||||||
// #ys_FIXME_alise
|
// #ys_FIXME_alise
|
||||||
void update_presets_in_config(const std::string& section, const std::string& alias_key, bool add);
|
void update_presets_in_config(const std::string& section, const std::string& alias_key, bool add);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user