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
diff options
context:
space:
mode:
authorYuSanka <yusanka@gmail.com>2022-02-08 19:19:13 +0300
committerYuSanka <yusanka@gmail.com>2022-02-08 19:19:30 +0300
commitd0b694daffaa77da6ec07d3a5ebf78e91ed6af8d (patch)
treec65be6bde8e7b4f1491acbf5749c6ccc2fe2ac10
parenta4ecf2f2a6d140a25e9b76e90ae5f4cf8457bd91 (diff)
Linux specific: Fixed a bug focusing of the some settings tabs
Steps to repro of a bug: 1. FFF/SLA printer is selected 2. Load 3mf projet with SLA/FFF printer 3. Chnage printer to the FFF/SLA => (Print a Filanemt Settings)/(Print a Materials Settings) are disabled Notes: This issue appeared after https://github.com/prusa3d/PrusaSlicer/commit/bfce4f6, when find_toplevel_parent(plater) instead of plater was set as a parent for ProgressDialogs
-rw-r--r--src/slic3r/GUI/Plater.cpp19
1 files changed, 15 insertions, 4 deletions
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<size_t> Plater::priv::load_files(const std::vector<fs::path>& 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<size_t> Plater::priv::load_files(const std::vector<fs::path>& 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<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
const auto &path = input_files[i];
#endif // _WIN32
const auto filename = path.filename();
- dlg.Update(static_cast<int>(100.0f * static_cast<float>(i) / static_cast<float>(input_files.size())), _L("Loading file") + ": " + from_path(filename));
- dlg.Fit();
+ progress_dlg.Update(static_cast<int>(100.0f * static_cast<float>(i) / static_cast<float>(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<size_t> Plater::priv::load_files(const std::vector<fs::path>& 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};
{