mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 13:55:58 +08:00
fix of crash on empty config -> add template filament
fixed checking if template profile needs to be installed fixed checking path before loading profile header from cache / vendor
This commit is contained in:
parent
7873c28584
commit
41d5c16b76
@ -2808,6 +2808,9 @@ bool ConfigWizard::priv::check_and_install_missing_materials(Technology technolo
|
||||
}
|
||||
}
|
||||
}
|
||||
// todo: just workaround so template_profile_selected wont get to false after this function is called for SLA
|
||||
// this will work unltil there are no SLA template filaments
|
||||
if (technology == ptFFF) {
|
||||
// template_profile_selected check
|
||||
template_profile_selected = false;
|
||||
for (const auto& bp : bundles) {
|
||||
@ -2825,6 +2828,7 @@ bool ConfigWizard::priv::check_and_install_missing_materials(Technology technolo
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
assert(printer_models_without_material.empty() || only_for_model_id.empty() || only_for_model_id == (*printer_models_without_material.begin())->id);
|
||||
return printer_models_without_material;
|
||||
};
|
||||
@ -2988,10 +2992,11 @@ bool ConfigWizard::priv::apply_config(AppConfig *app_config, PresetBundle *prese
|
||||
}
|
||||
|
||||
const auto vendor = enabled_vendors.find(pair.first);
|
||||
if (vendor == enabled_vendors.end() && ((pair.second.vendor_profile && !pair.second.vendor_profile->templates_profile) || !pair.second.vendor_profile) ) { continue; }
|
||||
|
||||
if (template_profile_selected && pair.second.vendor_profile && pair.second.vendor_profile->templates_profile && vendor == enabled_vendors.end()) {
|
||||
// Templates vendor needs to be installed
|
||||
if (vendor == enabled_vendors.end()) {
|
||||
// vendor not found
|
||||
// if templates vendor and needs to be installed, add it
|
||||
// then continue
|
||||
if (template_profile_selected && pair.second.vendor_profile && pair.second.vendor_profile->templates_profile)
|
||||
install_bundles.emplace_back(pair.first);
|
||||
continue;
|
||||
}
|
||||
|
@ -808,6 +808,7 @@ void GUI_App::post_init()
|
||||
// Configuration is not compatible and reconfigure was refused by the user. Application is closing.
|
||||
return;
|
||||
CallAfter([this] {
|
||||
// preset_updater->sync downloads profile updates on background so it must begin after config wizard finished.
|
||||
bool cw_showed = this->config_wizard_startup();
|
||||
this->preset_updater->sync(preset_bundle);
|
||||
this->app_version_check(false);
|
||||
|
@ -920,6 +920,7 @@ bool PresetUpdater::install_bundles_rsrc(std::vector<std::string> bundles, bool
|
||||
auto path_in_cache_vendor = (p->cache_vendor_path / bundle).replace_extension(".ini");
|
||||
auto path_in_vendors = (p->vendor_path / bundle).replace_extension(".ini");
|
||||
// find if in cache vendor is newer version than in resources
|
||||
if (boost::filesystem::exists(path_in_cache_vendor)) {
|
||||
auto vp_cache = VendorProfile::from_ini(path_in_cache_vendor, false);
|
||||
auto vp_rsrc = VendorProfile::from_ini(path_in_rsrc, false);
|
||||
if (vp_cache.config_version > vp_rsrc.config_version) {
|
||||
@ -937,6 +938,8 @@ bool PresetUpdater::install_bundles_rsrc(std::vector<std::string> bundles, bool
|
||||
|
||||
} else
|
||||
updates.updates.emplace_back(std::move(path_in_rsrc), std::move(path_in_vendors), Version(), "", "");
|
||||
} else
|
||||
updates.updates.emplace_back(std::move(path_in_rsrc), std::move(path_in_vendors), Version(), "", "");
|
||||
}
|
||||
|
||||
return p->perform_updates(std::move(updates), snapshot);
|
||||
|
Loading…
x
Reference in New Issue
Block a user