Set the project state to 'dirty' only if a project has a name (was saved or loaded).

Do not mark the project as dirty if it is a new project which hasn't been saved yet.
This commit is contained in:
YuSanka 2021-09-24 13:01:16 +02:00
parent 6c37955d75
commit 7eea15fdde

View File

@ -195,8 +195,10 @@ void ProjectDirtyStateManager::update_from_undo_redo_stack(UpdateType type)
void ProjectDirtyStateManager::update_from_presets() void ProjectDirtyStateManager::update_from_presets()
{ {
m_state.presets = false; m_state.presets = false;
for (const auto& [type, name] : wxGetApp().get_selected_presets()) { // check switching of the presets only for exist/loaded project, but not for new
m_state.presets |= !m_initial_presets[type].empty() && m_initial_presets[type] != name; if (!wxGetApp().plater()->get_project_filename().IsEmpty()) {
for (const auto& [type, name] : wxGetApp().get_selected_presets())
m_state.presets |= !m_initial_presets[type].empty() && m_initial_presets[type] != name;
} }
m_state.presets |= wxGetApp().has_unsaved_preset_changes(); m_state.presets |= wxGetApp().has_unsaved_preset_changes();
wxGetApp().mainframe->update_title(); wxGetApp().mainframe->update_title();