Fixes for template filament profiles:

- do not show "Template Filaments" in the list of vendors in wizard

- slight refactoring

- typos
This commit is contained in:
Lukas Matena 2022-10-06 16:28:38 +02:00 committed by David Kocik
parent 548205ffd8
commit 1589d89ca2
2 changed files with 4 additions and 3 deletions

View File

@ -1218,8 +1218,7 @@ size_t PresetCollection::update_compatible_internal(const PresetWithVendorProfil
for (size_t idx_preset = m_num_default_presets; idx_preset < m_presets.size(); ++idx_preset) {
if (m_presets[idx_preset].vendor && !m_presets[idx_preset].vendor->templates_profile && m_presets[idx_preset].is_compatible) {
std::string preset_alias = m_presets[idx_preset].alias;
for (size_t idx_in_templates = 0; idx_in_templates < indices_of_template_presets.size(); ++idx_in_templates) {
size_t idx_of_template_in_presets = indices_of_template_presets[idx_in_templates];
for (size_t idx_of_template_in_presets : indices_of_template_presets) {
if (m_presets[idx_of_template_in_presets].alias == preset_alias) {
// unselect selected template filament if there is non-template alias compatible
if (idx_of_template_in_presets == m_idx_selected && (unselect_if_incompatible == PresetSelectCompatibleType::Always || unselect_if_incompatible == PresetSelectCompatibleType::OnlyIfWasCompatible)) {

View File

@ -1197,7 +1197,7 @@ void PageMaterials::select_material(int i)
const std::string& alias_key = list_profile->get_data(i);
if (checked && template_shown && !notification_shown) {
notification_shown = true;
wxString message = _L("You have selelected template filament. Please note that these filaments are available for all printers but are NOT certain to be compatible with your printer. Do you still wish to have this filament selected?\n(This message won't be displayed again.)");
wxString message = _L("You have selected template filament. Please note that these filaments are available for all printers but are NOT certain to be compatible with your printer. Do you still wish to have this filament selected?\n(This message won't be displayed again.)");
MessageDialog msg(this, message, _L("Notice"), wxYES_NO);
if (msg.ShowModal() == wxID_NO) {
list_profile->Check(i, false);
@ -1608,6 +1608,8 @@ PageVendors::PageVendors(ConfigWizard *parent)
for (const auto &pair : wizard_p()->bundles) {
const VendorProfile *vendor = pair.second.vendor_profile;
if (vendor->id == PresetBundle::PRUSA_BUNDLE) { continue; }
if (vendor->templates_profile)
continue;
auto *cbox = new wxCheckBox(this, wxID_ANY, vendor->name);
cbox->Bind(wxEVT_CHECKBOX, [=](wxCommandEvent &event) {