Changed logic to avoid saving a project while a gizmo is in editing mode
This commit is contained in:
parent
580dc890b8
commit
1d4f7a8870
@ -207,6 +207,12 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_S
|
||||
// declare events
|
||||
Bind(wxEVT_CLOSE_WINDOW, [this](wxCloseEvent& event) {
|
||||
#if ENABLE_PROJECT_DIRTY_STATE
|
||||
if (event.CanVeto() && m_plater->canvas3D()->get_gizmos_manager().is_in_editing_mode(true)) {
|
||||
// prevents to open the save dirty project dialog
|
||||
event.Veto();
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_plater != nullptr)
|
||||
m_plater->save_project_if_dirty();
|
||||
|
||||
@ -691,12 +697,15 @@ bool MainFrame::can_start_new_project() const
|
||||
#if ENABLE_PROJECT_DIRTY_STATE
|
||||
bool MainFrame::can_save() const
|
||||
{
|
||||
return (m_plater != nullptr) && !m_plater->model().objects.empty() && !m_plater->get_project_filename().empty() && m_plater->is_project_dirty();
|
||||
return (m_plater != nullptr) && !m_plater->model().objects.empty() &&
|
||||
!m_plater->canvas3D()->get_gizmos_manager().is_in_editing_mode(false) &&
|
||||
!m_plater->get_project_filename().empty() && m_plater->is_project_dirty();
|
||||
}
|
||||
|
||||
bool MainFrame::can_save_as() const
|
||||
{
|
||||
return (m_plater != nullptr) && !m_plater->model().objects.empty();
|
||||
return (m_plater != nullptr) && !m_plater->model().objects.empty() &&
|
||||
!m_plater->canvas3D()->get_gizmos_manager().is_in_editing_mode(false);
|
||||
}
|
||||
|
||||
void MainFrame::save_project()
|
||||
|
@ -5371,8 +5371,7 @@ bool Plater::export_3mf(const boost::filesystem::path& output_path)
|
||||
void Plater::export_3mf(const boost::filesystem::path& output_path)
|
||||
#endif // ENABLE_PROJECT_DIRTY_STATE
|
||||
{
|
||||
if (p->model.objects.empty()
|
||||
|| canvas3D()->get_gizmos_manager().is_in_editing_mode(true))
|
||||
if (p->model.objects.empty())
|
||||
#if ENABLE_PROJECT_DIRTY_STATE
|
||||
return false;
|
||||
#else
|
||||
|
Loading…
Reference in New Issue
Block a user