Be more aggressive about updating title to show dirty status.

Fixes https://gitlab.com/kicad/code/kicad/issues/7613
This commit is contained in:
Jeff Young 2021-02-19 21:58:22 +00:00
parent 1a36971583
commit 5994ce3711
5 changed files with 20 additions and 8 deletions

View File

@ -796,6 +796,9 @@ void SCH_EDIT_FRAME::OnModify()
GetCanvas()->Refresh();
UpdateHierarchyNavigator();
if( !GetTitle().StartsWith( "*" ) )
UpdateTitle();
}
@ -1254,8 +1257,8 @@ void SCH_EDIT_FRAME::UpdateTitle()
unsaved = true;
title.Printf( wxT( "%s%s [%s] %s%s\u2014 " ) + _( "Schematic Editor" ),
fn.GetName(),
IsContentModified() ? "*" : "",
fn.GetName(),
GetCurrentSheet().PathHumanReadable( false ),
readOnly ? _( "[Read Only]" ) + wxS( " " ) : "",
unsaved ? _( "[Unsaved]" ) + wxS( " " ) : "" );

View File

@ -781,6 +781,9 @@ void SYMBOL_EDIT_FRAME::OnModify()
storeCurrentPart();
m_treePane->GetLibTree()->RefreshLibTree();
if( !GetTitle().StartsWith( "*" ) )
UpdateTitle();
}

View File

@ -138,8 +138,8 @@ void SYMBOL_EDIT_FRAME::updateTitle()
if( IsSymbolFromSchematic() )
{
title = wxString::Format( _( "%s%s [from schematic]" ) + wxT( " \u2014 " ),
m_reference,
IsContentModified() ? "*" : "" );
GetScreen() && GetScreen()->IsModify() ? "*" : "",
m_reference );
}
else
{
@ -148,8 +148,8 @@ void SYMBOL_EDIT_FRAME::updateTitle()
bool readOnly = m_libMgr && m_libMgr->IsLibraryReadOnly( GetCurLib() );
title = wxString::Format( wxT( "%s%s %s\u2014 " ),
GetScreen() && GetScreen()->IsModify() ? "*" : "",
GetCurPart()->GetLibId().Format().c_str(),
IsContentModified() ? "*" : "",
readOnly ? _( "[Read Only Library]" ) + wxT( " " ) : "" );
}
}

View File

@ -735,6 +735,9 @@ void FOOTPRINT_EDIT_FRAME::OnModify()
PCB_BASE_FRAME::OnModify();
Update3DView( true );
m_treePane->GetLibTree()->RefreshLibTree();
if( !GetTitle().StartsWith( "*" ) )
UpdateTitle();
}
@ -748,8 +751,8 @@ void FOOTPRINT_EDIT_FRAME::updateTitle()
if( IsCurrentFPFromBoard() )
{
title = wxString::Format( _( "%s%s [from %s.%s]" ) + wxT( " \u2014 " ),
footprint->GetReference(),
IsContentModified() ? "*" : "",
footprint->GetReference(),
Prj().GetProjectName(),
PcbFileExtension );
}
@ -766,16 +769,16 @@ void FOOTPRINT_EDIT_FRAME::updateTitle()
// Note: don't used GetLoadedFPID(); footprint name may have been edited
title += wxString::Format( wxT( "%s%s %s\u2014 " ),
FROM_UTF8( footprint->GetFPID().Format().c_str() ),
IsContentModified() ? "*" : "",
FROM_UTF8( footprint->GetFPID().Format().c_str() ),
writable ? "" : _( "[Read Only]" ) + wxS( " " ) );
}
else if( !fpid.GetLibItemName().empty() )
{
// Note: don't used GetLoadedFPID(); footprint name may have been edited
title += wxString::Format( wxT( "%s%s %s \u2014 " ),
FROM_UTF8( footprint->GetFPID().GetLibItemName().c_str() ),
IsContentModified() ? "*" : "",
FROM_UTF8( footprint->GetFPID().GetLibItemName().c_str() ),
_( "[Unsaved]" ) );
}

View File

@ -1169,6 +1169,9 @@ void PCB_EDIT_FRAME::OnModify( )
Update3DView( true );
if( !GetTitle().StartsWith( "*" ) )
UpdateTitle();
m_ZoneFillsDirty = true;
}
@ -1191,8 +1194,8 @@ void PCB_EDIT_FRAME::UpdateTitle()
unsaved = true;
SetTitle( wxString::Format( wxT( "%s%s %s%s\u2014 " ) + _( "PCB Editor" ),
fn.GetName(),
IsContentModified() ? "*" : "",
fn.GetName(),
readOnly ? _( "[Read Only]" ) + wxS( " " ) : "",
unsaved ? _( "[Unsaved]" ) + wxS( " " ) : "" ) );
}