Make sure the title is updated when file is saved/reverted/etc.

Fixes https://gitlab.com/kicad/code/kicad/issues/7626
This commit is contained in:
Jeff Young 2021-02-20 14:36:28 +00:00
parent 67c7e7c759
commit 91e876ce0d
8 changed files with 12 additions and 11 deletions

View File

@ -185,6 +185,7 @@ bool SCH_EDIT_FRAME::SaveEEFile( SCH_SHEET* aSheet, bool aSaveUnderNewName )
screen->ClrSave(); screen->ClrSave();
screen->ClrModify(); screen->ClrModify();
UpdateTitle();
msg.Printf( _( "File \"%s\" saved." ), screen->GetFileName() ); msg.Printf( _( "File \"%s\" saved." ), screen->GetFileName() );
SetStatusText( msg, 0 ); SetStatusText( msg, 0 );

View File

@ -549,6 +549,7 @@ void SYMBOL_EDIT_FRAME::Save()
} }
m_treePane->GetLibTree()->RefreshLibTree(); m_treePane->GetLibTree()->RefreshLibTree();
updateTitle();
} }

View File

@ -1054,6 +1054,7 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& aFileName, bool addToHistory,
GetScreen()->ClrModify(); GetScreen()->ClrModify();
GetScreen()->ClrSave(); GetScreen()->ClrSave();
UpdateTitle();
return true; return true;
} }

View File

@ -284,7 +284,7 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent,
m_appearancePanel->ApplyLayerPreset( cfg->m_ActiveLayerPreset ); m_appearancePanel->ApplyLayerPreset( cfg->m_ActiveLayerPreset );
GetToolManager()->RunAction( ACTIONS::zoomFitScreen, false ); GetToolManager()->RunAction( ACTIONS::zoomFitScreen, false );
updateTitle(); UpdateTitle();
setupUnits( GetSettings() ); setupUnits( GetSettings() );
// Default shutdown reason until a file is loaded // Default shutdown reason until a file is loaded
@ -737,11 +737,11 @@ void FOOTPRINT_EDIT_FRAME::OnModify()
m_treePane->GetLibTree()->RefreshLibTree(); m_treePane->GetLibTree()->RefreshLibTree();
if( !GetTitle().StartsWith( "*" ) ) if( !GetTitle().StartsWith( "*" ) )
updateTitle(); UpdateTitle();
} }
void FOOTPRINT_EDIT_FRAME::updateTitle() void FOOTPRINT_EDIT_FRAME::UpdateTitle()
{ {
wxString title; wxString title;
LIB_ID fpid = GetLoadedFPID(); LIB_ID fpid = GetLoadedFPID();
@ -799,7 +799,7 @@ void FOOTPRINT_EDIT_FRAME::UpdateView()
GetCanvas()->UpdateColors(); GetCanvas()->UpdateColors();
GetCanvas()->DisplayBoard( GetBoard() ); GetCanvas()->DisplayBoard( GetBoard() );
m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD ); m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD );
updateTitle(); UpdateTitle();
} }

View File

@ -305,6 +305,8 @@ public:
///< Reload displayed items and sets view. ///< Reload displayed items and sets view.
void UpdateView(); void UpdateView();
void UpdateTitle();
void FocusOnLibID( const LIB_ID& aLibID ); void FocusOnLibID( const LIB_ID& aLibID );
void KiwayMailIn( KIWAY_EXPRESS& mail ) override; void KiwayMailIn( KIWAY_EXPRESS& mail ) override;
@ -325,11 +327,6 @@ protected:
*/ */
void initLibraryTree(); void initLibraryTree();
/**
* Updates window title according to getLibNickName().
*/
void updateTitle();
void restoreLastFootprint(); void restoreLastFootprint();
void retainLastFootprint(); void retainLastFootprint();

View File

@ -153,7 +153,7 @@ void FOOTPRINT_EDIT_FRAME::editFootprintProperties( FOOTPRINT* aFootprint )
m_treePane->GetLibTree()->RefreshLibTree(); m_treePane->GetLibTree()->RefreshLibTree();
} }
updateTitle(); // in case of a name change... UpdateTitle(); // in case of a name change...
UpdateMsgPanel(); UpdateMsgPanel();
} }

View File

@ -1042,7 +1042,7 @@ bool FOOTPRINT_EDIT_FRAME::SaveFootprintAs( FOOTPRINT* aFootprint )
wxString msg = wxString::Format( fmt, footprintName.GetData(), libraryName.GetData() ); wxString msg = wxString::Format( fmt, footprintName.GetData(), libraryName.GetData() );
SetStatusText( msg ); SetStatusText( msg );
updateTitle(); UpdateTitle();
ReCreateHToolbar(); ReCreateHToolbar();
return true; return true;

View File

@ -252,6 +252,7 @@ int FOOTPRINT_EDITOR_CONTROL::Save( const TOOL_EVENT& aEvent )
canvas()->ForceRefresh(); canvas()->ForceRefresh();
m_frame->ClearModify(); m_frame->ClearModify();
m_frame->UpdateTitle();
} }
} }