This commit is contained in:
bubnikv 2019-12-05 15:04:59 +01:00
commit 073579eefc
6 changed files with 58 additions and 24 deletions
src/slic3r/GUI

View file

@ -655,14 +655,6 @@ void PageMaterials::update_lists(int sel1, int sel2)
sel2_prev = sel2;
}
// for the very begining
if ((wizard_p()->run_reason == ConfigWizard::RR_DATA_EMPTY || wizard_p()->run_reason == ConfigWizard::RR_DATA_LEGACY)
&& list_l3->size() > 0 )
{
list_l3->Check(0, true);
wizard_p()->update_presets_in_config(materials->appconfig_section(), list_l3->get_data(0), true);
}
}
void PageMaterials::select_material(int i)
@ -1254,7 +1246,7 @@ const std::string Materials::UNKNOWN = "(Unknown)";
void Materials::push(const Preset *preset)
{
presets.insert(preset);
presets.push_back(preset);
types.insert(technology & T_FFF
? Materials::get_filament_type(preset)
: Materials::get_material_type(preset));
@ -1524,7 +1516,9 @@ void ConfigWizard::priv::update_materials(Technology technology)
for (const auto &printer : pair.second.preset_bundle->printers)
// Filter out inapplicable printers
if (printer.is_visible && printer.printer_technology() == ptFFF &&
is_compatible_with_printer(PresetWithVendorProfile(filament, nullptr), PresetWithVendorProfile(printer, nullptr))) {
is_compatible_with_printer(PresetWithVendorProfile(filament, nullptr), PresetWithVendorProfile(printer, nullptr)) &&
// Check if filament is already added
! filaments.containts(&filament)) {
filaments.push(&filament);
if (!filament.alias.empty())
aliases_fff[filament.alias].insert(filament.name);
@ -1549,7 +1543,9 @@ void ConfigWizard::priv::update_materials(Technology technology)
for (const auto &printer : pair.second.preset_bundle->printers)
// Filter out inapplicable printers
if (printer.is_visible && printer.printer_technology() == ptSLA &&
is_compatible_with_printer(PresetWithVendorProfile(material, nullptr), PresetWithVendorProfile(printer, nullptr))) {
is_compatible_with_printer(PresetWithVendorProfile(material, nullptr), PresetWithVendorProfile(printer, nullptr)) &&
// Check if material is already added
! sla_materials.containts(&material)) {
sla_materials.push(&material);
if (!material.alias.empty())
aliases_sla[material.alias].insert(material.name);
@ -1897,14 +1893,23 @@ ConfigWizard::ConfigWizard(wxWindow *parent)
});
p->btn_prev->Bind(wxEVT_BUTTON, [this](const wxCommandEvent &) { this->p->index->go_prev(); });
p->btn_next->Bind(wxEVT_BUTTON, [this](const wxCommandEvent &) { this->p->index->go_next(); });
p->btn_next->Bind(wxEVT_BUTTON, [this](const wxCommandEvent &)
{
// 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())
return;
this->p->index->go_next();
});
p->btn_finish->Bind(wxEVT_BUTTON, [this](const wxCommandEvent &)
{
if (!p->check_material_config())
return;
this->EndModal(wxID_OK);
});
// p->btn_finish->Hide();
p->btn_sel_all->Bind(wxEVT_BUTTON, [this](const wxCommandEvent &) {
p->any_sla_selected = true;
@ -1917,7 +1922,6 @@ ConfigWizard::ConfigWizard(wxWindow *parent)
p->index->Bind(EVT_INDEX_PAGE, [this](const wxCommandEvent &) {
const bool is_last = p->index->active_is_last();
p->btn_next->Show(! is_last);
// p->btn_finish->Show(is_last);
if (is_last)
p->btn_finish->SetFocus();