Move show_substitutions_info() call into UI thread

This commit is contained in:
tamasmeszaros 2021-06-29 16:21:56 +02:00 committed by Vojtech Bubnik
parent 965c2f2c55
commit 0094d50d93

View file

@ -140,27 +140,22 @@ void SLAImportJob::process()
if (p->path.empty()) return; if (p->path.empty()) return;
std::string path = p->path.ToUTF8().data(); std::string path = p->path.ToUTF8().data();
ConfigSubstitutions config_substitutions;
try { try {
switch (p->sel) { switch (p->sel) {
case Sel::modelAndProfile: case Sel::modelAndProfile:
config_substitutions = import_sla_archive(path, p->win, p->mesh, p->profile, progr); p->config_substitutions = import_sla_archive(path, p->win, p->mesh, p->profile, progr);
break; break;
case Sel::modelOnly: case Sel::modelOnly:
config_substitutions = import_sla_archive(path, p->win, p->mesh, progr); p->config_substitutions = import_sla_archive(path, p->win, p->mesh, progr);
break; break;
case Sel::profileOnly: case Sel::profileOnly:
config_substitutions = import_sla_archive(path, p->profile); p->config_substitutions = import_sla_archive(path, p->profile);
break; break;
} }
} catch (std::exception &ex) { } catch (std::exception &ex) {
p->err = ex.what(); p->err = ex.what();
} }
if (! config_substitutions.empty()) {
show_substitutions_info(config_substitutions, path);
}
update_status(100, was_canceled() ? _(L("Importing canceled.")) : update_status(100, was_canceled() ? _(L("Importing canceled.")) :
_(L("Importing done."))); _(L("Importing done.")));
@ -187,6 +182,7 @@ void SLAImportJob::prepare()
p->path = !nm.Exists(wxFILE_EXISTS_REGULAR) ? "" : nm.GetFullPath(); p->path = !nm.Exists(wxFILE_EXISTS_REGULAR) ? "" : nm.GetFullPath();
p->sel = dlg.get_selection(); p->sel = dlg.get_selection();
p->win = dlg.get_marchsq_windowsize(); p->win = dlg.get_marchsq_windowsize();
p->config_substitutions.clear();
} else { } else {
p->path = ""; p->path = "";
} }
@ -230,8 +226,11 @@ void SLAImportJob::finalize()
p->plater->sidebar().obj_list()->load_mesh_object(TriangleMesh{p->mesh}, p->plater->sidebar().obj_list()->load_mesh_object(TriangleMesh{p->mesh},
name, is_centered); name, is_centered);
} }
if (! p->config_substitutions.empty())
show_substitutions_info(p->config_substitutions, p->path.ToUTF8().data());
reset(); reset();
} }
}} }} // namespace Slic3r::GUI