Eeschema: move auto-save test from SCH_SHEET_PATH to SCH_SHEET.
This commit is contained in:
parent
769e18d376
commit
81e6af6c81
|
@ -1253,6 +1253,31 @@ bool SCH_SHEET::IsModified() const
|
|||
}
|
||||
|
||||
|
||||
bool SCH_SHEET::IsAutoSaveRequired()
|
||||
{
|
||||
if( m_screen->IsModify() )
|
||||
return true;
|
||||
|
||||
bool retv = false;
|
||||
SCH_ITEM* item = m_screen->GetDrawItems();
|
||||
|
||||
while( item && !retv )
|
||||
{
|
||||
if( item->Type() == SCH_SHEET_T )
|
||||
{
|
||||
SCH_SHEET* sheet = static_cast<SCH_SHEET*>( item );
|
||||
|
||||
if( sheet->m_screen )
|
||||
retv = sheet->m_screen->IsSave();
|
||||
}
|
||||
|
||||
item = item->Next();
|
||||
}
|
||||
|
||||
return retv;
|
||||
}
|
||||
|
||||
|
||||
void SCH_SHEET::ClearModifyStatus()
|
||||
{
|
||||
m_screen->ClrModify();
|
||||
|
|
|
@ -649,6 +649,13 @@ public:
|
|||
*/
|
||||
void ClearModifyStatus();
|
||||
|
||||
/**
|
||||
* Function IsAutoSaveRequired
|
||||
* checks the entire hierarchy for any modifications that require auto save.
|
||||
* @return True if the hierarchy is modified otherwise false.
|
||||
*/
|
||||
bool IsAutoSaveRequired();
|
||||
|
||||
#if defined(DEBUG)
|
||||
void Show( int nestLevel, std::ostream& os ) const; // override
|
||||
#endif
|
||||
|
|
|
@ -684,18 +684,6 @@ void SCH_SHEET_LIST::BuildSheetList( SCH_SHEET* aSheet )
|
|||
}
|
||||
|
||||
|
||||
bool SCH_SHEET_LIST::IsAutoSaveRequired()
|
||||
{
|
||||
for( SCH_SHEET_PATH* sheet = GetFirst(); sheet; sheet = GetNext() )
|
||||
{
|
||||
if( sheet->LastScreen() && sheet->LastScreen()->IsSave() )
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void SCH_SHEET_LIST::AnnotatePowerSymbols( PART_LIBS* aLibs )
|
||||
{
|
||||
int ref = 1;
|
||||
|
|
|
@ -436,13 +436,6 @@ public:
|
|||
*/
|
||||
SCH_SHEET_PATH* GetSheetByPath( const wxString aPath, bool aHumanReadable = true );
|
||||
|
||||
/**
|
||||
* Function IsAutoSaveRequired
|
||||
* checks the entire hierarchy for any modifications that require auto save.
|
||||
* @return True if the hierarchy is modified otherwise false.
|
||||
*/
|
||||
bool IsAutoSaveRequired();
|
||||
|
||||
/**
|
||||
* Function AnnotatePowerSymbols
|
||||
* clear and annotates the entire hierarchy of the sheet path list.
|
||||
|
|
|
@ -1179,12 +1179,9 @@ bool SCH_EDIT_FRAME::isAutoSaveRequired() const
|
|||
{
|
||||
// In case this event happens before g_RootSheet is initialized which does happen
|
||||
// on mingw64 builds.
|
||||
|
||||
if( g_RootSheet != NULL )
|
||||
{
|
||||
SCH_SHEET_LIST sheetList;
|
||||
|
||||
return sheetList.IsAutoSaveRequired();
|
||||
return g_RootSheet->IsAutoSaveRequired();
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue