Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVojtech Kral <vojtech@kral.hk>2019-10-07 12:25:05 +0300
committerVojtech Kral <vojtech@kral.hk>2019-10-07 18:21:45 +0300
commit570c038eb78698aeb199aac0d5d85d9508039ff5 (patch)
treed9cf062be7bfa3802d0023add44b7ebb1ad3280a /src
parenteda01341d0579576ab10450017b6e160c00a3d6e (diff)
ConfigWizard: Fix printer pre-selection on fresh config
Diffstat (limited to 'src')
-rw-r--r--src/slic3r/GUI/ConfigWizard.cpp45
1 files changed, 29 insertions, 16 deletions
diff --git a/src/slic3r/GUI/ConfigWizard.cpp b/src/slic3r/GUI/ConfigWizard.cpp
index 5af298cc1..bc73e3262 100644
--- a/src/slic3r/GUI/ConfigWizard.cpp
+++ b/src/slic3r/GUI/ConfigWizard.cpp
@@ -1617,24 +1617,37 @@ void ConfigWizard::priv::apply_config(AppConfig *app_config, PresetBundle *prese
std::string preferred_model;
- // Figure out the default pre-selected printer based on the seletions in the picker.
+ // Figure out the default pre-selected printer based on the selections in the pickers.
// The default is the first selected printer model (one with at least 1 variant selected).
// The default is only applied by load_presets() if the user doesn't have a (visible) printer
// selected already.
-// TODO:
- // const auto vendor_prusa = bundle.vendors.find("PrusaResearch");
- // const auto config_prusa = enabled_vendors.find("PrusaResearch");
- // if (vendor_prusa != bundle.vendors.end() && config_prusa != enabled_vendors.end()) {
- // for (const auto &model : vendor_prusa->second.models) {
- // const auto model_it = config_prusa->second.find(model.id);
- // if (model_it != config_prusa->second.end() && model_it->second.size() > 0) {
- // preferred_model = model.id;
- // break;
- // }
- // }
- // }
-
- // preset_bundle->load_presets(*app_config, preferred_model);
+ // Prusa printers are considered first, then 3rd party.
+ const auto config_prusa = enabled_vendors.find("PrusaResearch");
+ if (config_prusa != enabled_vendors.end()) {
+ for (const auto &model : bundles.prusa_bundle().vendor_profile->models) {
+ const auto model_it = config_prusa->second.find(model.id);
+ if (model_it != config_prusa->second.end() && model_it->second.size() > 0) {
+ preferred_model = model.id;
+ break;
+ }
+ }
+ }
+ if (preferred_model.empty()) {
+ for (const auto &bundle : bundles) {
+ if (bundle.second.is_prusa_bundle) { continue; }
+
+ const auto config = enabled_vendors.find(bundle.first);
+ for (const auto &model : bundle.second.vendor_profile->models) {
+ const auto model_it = config->second.find(model.id);
+ if (model_it != config->second.end() && model_it->second.size() > 0) {
+ preferred_model = model.id;
+ break;
+ }
+ }
+ }
+ }
+
+ preset_bundle->load_presets(*app_config, preferred_model);
if (page_custom->custom_wanted()) {
page_firmware->apply_custom_config(*custom_config);
@@ -1753,7 +1766,7 @@ ConfigWizard::ConfigWizard(wxWindow *parent)
p->load_pages();
p->page_fff->select_all(true, false);
p->page_msla->select_all(true, false);
- p->index->go_to(p->page_update);
+ p->index->go_to(p->page_mode);
});
p->index->Bind(EVT_INDEX_PAGE, [this](const wxCommandEvent &) {