diff --git a/src/libslic3r/Format/3mf.cpp b/src/libslic3r/Format/3mf.cpp index 58592e0d7e..613b7444af 100644 --- a/src/libslic3r/Format/3mf.cpp +++ b/src/libslic3r/Format/3mf.cpp @@ -666,7 +666,6 @@ namespace Slic3r { close_zip_reader(&archive); -#if ENABLE_RELOAD_FROM_DISK_FOR_3MF if (m_version == 0) { // if the 3mf was not produced by PrusaSlicer and there is more than one instance, // split the object in as many objects as instances @@ -711,7 +710,6 @@ namespace Slic3r { ++i; } } -#endif // ENABLE_RELOAD_FROM_DISK_FOR_3MF for (const IdToModelObjectMap::value_type& object : m_objects) { if (object.second >= int(m_model->objects.size())) { @@ -779,7 +777,6 @@ namespace Slic3r { return false; } -#if ENABLE_RELOAD_FROM_DISK_FOR_3MF int object_idx = 0; for (ModelObject* o : model.objects) { int volume_idx = 0; @@ -795,7 +792,6 @@ namespace Slic3r { } ++object_idx; } -#endif // ENABLE_RELOAD_FROM_DISK_FOR_3MF // // fixes the min z of the model if negative // model.adjust_min_z(); @@ -1877,7 +1873,6 @@ namespace Slic3r { stl_get_size(&stl); triangle_mesh.repair(); -#if ENABLE_RELOAD_FROM_DISK_FOR_3MF if (m_version == 0) { // if the 3mf was not produced by PrusaSlicer and there is only one instance, // bake the transformation into the geometry to allow the reload from disk command @@ -1887,7 +1882,6 @@ namespace Slic3r { object.instances.front()->set_transformation(Slic3r::Geometry::Transformation()); } } -#endif // ENABLE_RELOAD_FROM_DISK_FOR_3MF ModelVolume* volume = object.add_volume(std::move(triangle_mesh)); // stores the volume matrix taken from the metadata, if present diff --git a/src/libslic3r/Technologies.hpp b/src/libslic3r/Technologies.hpp index b83f7638b7..77a70436cd 100644 --- a/src/libslic3r/Technologies.hpp +++ b/src/libslic3r/Technologies.hpp @@ -41,8 +41,6 @@ //==================== #define ENABLE_2_4_0_ALPHA0 1 -// Enable reload from disk command for 3mf files -#define ENABLE_RELOAD_FROM_DISK_FOR_3MF (1 && ENABLE_2_4_0_ALPHA0) // Enable showing gcode line numbers in preview horizontal slider #define ENABLE_GCODE_LINES_ID_IN_H_SLIDER (1 && ENABLE_2_4_0_ALPHA0) // Enable validation of custom gcode against gcode processor reserved keywords diff --git a/src/slic3r/GUI/ConfigWizard.cpp b/src/slic3r/GUI/ConfigWizard.cpp index aec5d3839b..127a6417e8 100644 --- a/src/slic3r/GUI/ConfigWizard.cpp +++ b/src/slic3r/GUI/ConfigWizard.cpp @@ -40,6 +40,7 @@ #include "slic3r/Utils/PresetUpdater.hpp" #include "format.hpp" #include "MsgDialog.hpp" +#include "libslic3r/libslic3r.h" #if defined(__linux__) && defined(__WXGTK3__) #define wxLinux_gtk3 true @@ -65,6 +66,7 @@ bool Bundle::load(fs::path source_path, bool ais_in_resources, bool ais_prusa_bu std::string path_string = source_path.string(); auto [config_substitutions, presets_loaded] = preset_bundle->load_configbundle(path_string, PresetBundle::LoadConfigBundleAttribute::LoadSystem); + UNUSED(config_substitutions); // No substitutions shall be reported when loading a system config bundle, no substitutions are allowed. assert(config_substitutions.empty()); auto first_vendor = preset_bundle->vendors.begin(); diff --git a/src/slic3r/GUI/ImGuiWrapper.cpp b/src/slic3r/GUI/ImGuiWrapper.cpp index 799b5be4ac..9980ba5a71 100644 --- a/src/slic3r/GUI/ImGuiWrapper.cpp +++ b/src/slic3r/GUI/ImGuiWrapper.cpp @@ -204,7 +204,8 @@ bool ImGuiWrapper::update_mouse_data(wxMouseEvent& evt) unsigned buttons = (evt.LeftIsDown() ? 1 : 0) | (evt.RightIsDown() ? 2 : 0) | (evt.MiddleIsDown() ? 4 : 0); m_mouse_buttons = buttons; - new_frame(); + if (want_mouse()) + new_frame(); return want_mouse(); } @@ -222,9 +223,6 @@ bool ImGuiWrapper::update_key_data(wxKeyEvent &evt) if (key != 0) { io.AddInputCharacter(key); } - - new_frame(); - return want_keyboard() || want_text_input(); } else { // Key up/down event int key = evt.GetKeyCode(); @@ -235,10 +233,11 @@ bool ImGuiWrapper::update_key_data(wxKeyEvent &evt) io.KeyCtrl = evt.ControlDown(); io.KeyAlt = evt.AltDown(); io.KeySuper = evt.MetaDown(); - - new_frame(); - return want_keyboard() || want_text_input(); } + bool ret = want_keyboard() || want_text_input(); + if (ret) + new_frame(); + return ret; } void ImGuiWrapper::new_frame() diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index c81a495691..8614acf680 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -1985,7 +1985,7 @@ void MainFrame::select_tab(size_t tab/* = size_t(-1)*/) m_main_sizer->Show(m_tabpanel, tab != 0); // plater should be focused for correct navigation inside search window - if (tab == 0 && m_plater->canvas3D()->is_search_pressed()) + if (tab == 0) m_plater->SetFocus(); Layout(); } diff --git a/src/slic3r/GUI/Notebook.cpp b/src/slic3r/GUI/Notebook.cpp index afc0241d8c..bcc1d2e595 100644 --- a/src/slic3r/GUI/Notebook.cpp +++ b/src/slic3r/GUI/Notebook.cpp @@ -50,7 +50,7 @@ void ButtonsListCtrl::OnPaint(wxPaintEvent&) const wxColour& selected_btn_bg = Slic3r::GUI::wxGetApp().get_color_selected_btn_bg(); const wxColour& default_btn_bg = Slic3r::GUI::wxGetApp().get_highlight_default_clr(); const wxColour& btn_marker_color = Slic3r::GUI::wxGetApp().get_color_hovered_btn_label(); - for (int idx = 0; idx < m_pageButtons.size(); idx++) { + for (int idx = 0; idx < int(m_pageButtons.size()); idx++) { wxButton* btn = m_pageButtons[idx]; btn->SetBackgroundColour(idx == m_selection ? selected_btn_bg : default_btn_bg); diff --git a/src/slic3r/GUI/NotificationManager.cpp b/src/slic3r/GUI/NotificationManager.cpp index 6f51f0cf86..b000cbd69c 100644 --- a/src/slic3r/GUI/NotificationManager.cpp +++ b/src/slic3r/GUI/NotificationManager.cpp @@ -272,9 +272,9 @@ void NotificationManager::PopNotification::count_lines() // find next suitable endline if (ImGui::CalcTextSize(text.substr(last_end).c_str()).x >= m_window_width - m_window_width_offset) { // more than one line till end - int next_space = text.find_first_of(' ', last_end); + size_t next_space = text.find_first_of(' ', last_end); if (next_space > 0 && next_space < text.length()) { - int next_space_candidate = text.find_first_of(' ', next_space + 1); + size_t next_space_candidate = text.find_first_of(' ', next_space + 1); while (next_space_candidate > 0 && ImGui::CalcTextSize(text.substr(last_end, next_space_candidate - last_end).c_str()).x < m_window_width - m_window_width_offset) { next_space = next_space_candidate; next_space_candidate = text.find_first_of(' ', next_space + 1); diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index b642610d86..99c1e15988 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1172,7 +1172,7 @@ void Tab::activate_option(const std::string& opt_key, const wxString& category) wxString page_title = translate_category(category, m_type); auto cur_item = m_treectrl->GetFirstVisibleItem(); - if (!cur_item || !m_treectrl->IsVisible(cur_item)) + if (!cur_item) return; while (cur_item) {