mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-15 02:37:51 -06:00
Changed logic to avoid saving a project while a gizmo is in editing mode
This commit is contained in:
parent
580dc890b8
commit
1d4f7a8870
2 changed files with 12 additions and 4 deletions
|
@ -207,6 +207,12 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_S
|
||||||
// declare events
|
// declare events
|
||||||
Bind(wxEVT_CLOSE_WINDOW, [this](wxCloseEvent& event) {
|
Bind(wxEVT_CLOSE_WINDOW, [this](wxCloseEvent& event) {
|
||||||
#if ENABLE_PROJECT_DIRTY_STATE
|
#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)
|
if (m_plater != nullptr)
|
||||||
m_plater->save_project_if_dirty();
|
m_plater->save_project_if_dirty();
|
||||||
|
|
||||||
|
@ -691,12 +697,15 @@ bool MainFrame::can_start_new_project() const
|
||||||
#if ENABLE_PROJECT_DIRTY_STATE
|
#if ENABLE_PROJECT_DIRTY_STATE
|
||||||
bool MainFrame::can_save() const
|
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
|
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()
|
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)
|
void Plater::export_3mf(const boost::filesystem::path& output_path)
|
||||||
#endif // ENABLE_PROJECT_DIRTY_STATE
|
#endif // ENABLE_PROJECT_DIRTY_STATE
|
||||||
{
|
{
|
||||||
if (p->model.objects.empty()
|
if (p->model.objects.empty())
|
||||||
|| canvas3D()->get_gizmos_manager().is_in_editing_mode(true))
|
|
||||||
#if ENABLE_PROJECT_DIRTY_STATE
|
#if ENABLE_PROJECT_DIRTY_STATE
|
||||||
return false;
|
return false;
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue