mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-20 03:43:52 +00:00
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:
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user