diff --git a/src/libslic3r/SLAPrint.cpp b/src/libslic3r/SLAPrint.cpp index 5ecb7c1d9..ee24cf3ec 100644 --- a/src/libslic3r/SLAPrint.cpp +++ b/src/libslic3r/SLAPrint.cpp @@ -60,12 +60,14 @@ const std::array OBJ_STEP_LABELS = // Should also add up to 100 (%) const std::array PRINT_STEP_LEVELS = { - 80, // slapsRasterize - 20, // slapsValidate + 5, // slapsStats + 94, // slapsRasterize + 1, // slapsValidate }; const std::array PRINT_STEP_LABELS = { + L("Calculating statistics"), // slapsStats L("Rasterizing layers"), // slapsRasterize L("Validating"), // slapsValidate }; @@ -913,6 +915,16 @@ void SLAPrint::process() report_status(*this, -2, "", SlicingStatus::RELOAD_SLA_PREVIEW); }; + auto fillstats = [this]() { + + m_print_statistics.clear(); + + // Fill statistics + fill_statistics(); + + report_status(*this, -2, "", SlicingStatus::RELOAD_SLA_PREVIEW); + }; + // Rasterizing the model objects, and their supports auto rasterize = [this, max_objstatus, ilhs]() { if(canceled()) return; @@ -1050,8 +1062,6 @@ void SLAPrint::process() // Print all the layers in parallel tbb::parallel_for(0, lvlcnt, lvlfn); - // Fill statistics - this->fill_statistics(); // Set statistics values to the printer m_printer->set_statistics({(m_print_statistics.objects_used_material + m_print_statistics.support_used_material)/1000, double(m_default_object_config.faded_layers.getInt()), @@ -1075,6 +1085,7 @@ void SLAPrint::process() std::array print_program = { + fillstats, rasterize, [](){} // validate }; @@ -1116,7 +1127,7 @@ void SLAPrint::process() } std::array printsteps = { - slapsRasterize, slapsValidate + slapsStats, slapsRasterize, slapsValidate }; // this would disable the rasterization step diff --git a/src/libslic3r/SLAPrint.hpp b/src/libslic3r/SLAPrint.hpp index 88152830f..afdfab415 100644 --- a/src/libslic3r/SLAPrint.hpp +++ b/src/libslic3r/SLAPrint.hpp @@ -11,6 +11,7 @@ namespace Slic3r { enum SLAPrintStep : unsigned int { + slapsStats, slapsRasterize, slapsValidate, slapsCount diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index da62ddab0..1f616a101 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -3767,8 +3767,8 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt) // of the scene with the background processing data should be performed. post_event(SimpleEvent(EVT_GLCANVAS_MOUSE_DRAGGING_FINISHED)); } - else if (evt.LeftUp() && !m_mouse.dragging && (m_hover_volume_id == -1) && !gizmos_overlay_contains_mouse && !m_gizmos.is_dragging() - && !is_layers_editing_enabled()) + else if (evt.LeftUp() && !m_mouse.dragging && (m_hover_volume_id == -1) && !gizmos_overlay_contains_mouse && !m_gizmos.grabber_contains_mouse() && !m_gizmos.is_dragging() + && !is_layers_editing_enabled()) { // deselect and propagate event through callback if (!evt.ShiftDown() && m_picking_enabled && !m_mouse.ignore_up_event) diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index d66e6f5ad..177f924c7 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -203,7 +203,16 @@ bool GUI_App::OnInit() load_current_presets(); mainframe->Show(true); + + /* Temporary workaround for the correct behavior of the Scrolled sidebar panel: + * change min hight of object list to the normal min value (15 * wxGetApp().em_unit()) + * after first whole Mainframe updating/layouting + */ + if (obj_list()->GetMinSize().GetY() > 15 * em_unit()) + obj_list()->SetMinSize(wxSize(-1, 15 * em_unit())); + update_mode(); // update view mode after fix of the object_list size + m_initialized = true; return true; } @@ -317,6 +326,13 @@ void GUI_App::recreate_GUI() dlg.Update(90, _(L("Loading of a mode view")) + dots); + /* Temporary workaround for the correct behavior of the Scrolled sidebar panel: + * change min hight of object list to the normal min value (15 * wxGetApp().em_unit()) + * after first whole Mainframe updating/layouting + */ + if (obj_list()->GetMinSize().GetY() > 15 * em_unit()) + obj_list()->SetMinSize(wxSize(-1, 15 * em_unit())); + update_mode(); // #ys_FIXME_delete_after_testing Do we still need this ? @@ -633,12 +649,28 @@ void GUI_App::add_config_menu(wxMenuBar *menu) } case ConfigMenuLanguage: { + /* Before change application language, let's check unsaved changes + * and draw user's attention to the application restarting after a language change + */ + wxMessageDialog dialog(nullptr, + _(L("Application will be restarted after language change, " + "and 3D-Scene will be cleaned.")) + "\n" + + _(L("Please, check your changes before.")) + "\n\n" + + _(L("Continue anyway?")), + _(L("Attention!")), + wxICON_QUESTION | wxYES_NO | wxNO_DEFAULT); + if ( dialog.ShowModal() != wxID_YES) + return; + + if (!wxGetApp().check_unsaved_changes()) + return; + wxArrayString names; wxArrayLong identifiers; get_installed_languages(names, identifiers); if (select_language(names, identifiers)) { save_language(); - show_info(mainframe->m_tabpanel, _(L("Application will be restarted")), _(L("Attention!"))); +// show_info(mainframe->m_tabpanel, _(L("Application will be restarted")), _(L("Attention!"))); _3DScene::remove_all_canvases();// remove all canvas before recreate GUI recreate_GUI(); } @@ -674,11 +706,11 @@ bool GUI_App::check_unsaved_changes() // No changes, the application may close or reload presets. return true; // Ask the user. - auto dialog = new wxMessageDialog(mainframe, + wxMessageDialog dialog(mainframe, _(L("You have unsaved changes ")) + dirty + _(L(". Discard changes and continue anyway?")), _(L("Unsaved Presets")), wxICON_QUESTION | wxYES_NO | wxNO_DEFAULT); - return dialog->ShowModal() == wxID_YES; + return dialog.ShowModal() == wxID_YES; } bool GUI_App::checked_tab(Tab* tab) diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index da5a2fe29..642a9fb55 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -127,7 +127,11 @@ ObjectList::~ObjectList() void ObjectList::create_objects_ctrl() { - SetMinSize(wxSize(-1, 15 * wxGetApp().em_unit())); + /* Temporary workaround for the correct behavior of the Scrolled sidebar panel: + * 1. set a height of the list to some big value + * 2. change it to the normal min value (15 * wxGetApp().em_unit()) after first whole Mainframe updating/layouting + */ + SetMinSize(wxSize(-1, 3000)); m_sizer = new wxBoxSizer(wxVERTICAL); m_sizer->Add(this, 1, wxGROW);