diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index 1d4d05c4cf..c6b8a204cd 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -813,9 +813,9 @@ void SCH_EDIT_FRAME::OnUpdateHiddenPins( wxUpdateUIEvent& aEvent ) void SCH_EDIT_FRAME::OnUpdateSave( wxUpdateUIEvent& aEvent ) { - SCH_SHEET_LIST sheetList( g_RootSheet ); + SCH_SCREENS screenList( g_RootSheet ); - aEvent.Enable( sheetList.IsModified() ); + aEvent.Enable( screenList.IsModified() ); } diff --git a/eeschema/sch_screen.cpp b/eeschema/sch_screen.cpp index 4b4f690430..deb59ab9b3 100644 --- a/eeschema/sch_screen.cpp +++ b/eeschema/sch_screen.cpp @@ -1668,3 +1668,17 @@ void SCH_SCREENS::BuildClientSheetPathList() } } } + + +bool SCH_SCREENS::IsModified() const +{ + for( const SCH_SCREEN* screen : m_screens ) + { + if( screen->IsModify() ) + return true; + } + + return false; +} + + diff --git a/eeschema/sch_screen.h b/eeschema/sch_screen.h index 2647dfc809..8712f8e10b 100644 --- a/eeschema/sch_screen.h +++ b/eeschema/sch_screen.h @@ -652,6 +652,13 @@ public: */ bool CanCauseCaseSensitivityIssue( const wxString& aSchematicFileName ) const; + /** + * Check if this screen list has any modified screens. + * + * @return true if there are any modified screens in this list. + */ + bool IsModified() const; + private: void addScreenToList( SCH_SCREEN* aScreen ); void buildScreenList( SCH_SHEET* aSheet);