diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index d30d9ad88..8bd3a9180 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -2377,7 +2377,7 @@ std::vector Plater::priv::load_files(const std::vector& input_ } const auto loading = _L("Loading") + dots; - wxProgressDialog dlg(loading, "", 100, find_toplevel_parent(q), wxPD_AUTO_HIDE); + wxProgressDialog progress_dlg(loading, "", 100, find_toplevel_parent(q), wxPD_AUTO_HIDE); wxBusyCursor busy; auto *new_model = (!load_model || one_by_one) ? nullptr : new Slic3r::Model(); @@ -2386,7 +2386,8 @@ std::vector Plater::priv::load_files(const std::vector& input_ int answer_convert_from_meters = wxOK_DEFAULT; int answer_convert_from_imperial_units = wxOK_DEFAULT; - for (size_t i = 0; i < input_files.size(); ++i) { + size_t input_files_size = input_files.size(); + for (size_t i = 0; i < input_files_size; ++i) { #ifdef _WIN32 auto path = input_files[i]; // On Windows, we swap slashes to back slashes, see GH #6803 as read_from_file() does not understand slashes on Windows thus it assignes full path to names of loaded objects. @@ -2396,8 +2397,8 @@ std::vector Plater::priv::load_files(const std::vector& input_ const auto &path = input_files[i]; #endif // _WIN32 const auto filename = path.filename(); - dlg.Update(static_cast(100.0f * static_cast(i) / static_cast(input_files.size())), _L("Loading file") + ": " + from_path(filename)); - dlg.Fit(); + progress_dlg.Update(static_cast(100.0f * static_cast(i) / static_cast(input_files.size())), _L("Loading file") + ": " + from_path(filename)); + progress_dlg.Fit(); const bool type_3mf = std::regex_match(path.string(), pattern_3mf); const bool type_zip_amf = !type_3mf && std::regex_match(path.string(), pattern_zip_amf); @@ -2408,6 +2409,16 @@ std::vector Plater::priv::load_files(const std::vector& input_ bool is_project_file = type_prusa; try { if (type_3mf || type_zip_amf) { +#ifdef __linux__ + // On Linux Constructor of the ProgressDialog calls DisableOtherWindows() function which causes a disabling of all children of the find_toplevel_parent(q) + // And a destructor of the ProgressDialog calls ReenableOtherWindows() function which revert previously disabled children. + // But if printer technology will be changes during project loading, + // then related SLA Print and Materials Settings or FFF Print and Filaments Settings will be unparent from the wxNoteBook + // and that is why they will never be enabled after destruction of the ProgressDialog. + // So, distroy progress_gialog if we are loading project file + if (input_files_size == 1) + progress_dlg.Destroy(); +#endif DynamicPrintConfig config; PrinterTechnology loaded_printer_technology {ptFFF}; {