Update symbol editor's title bar when renaming the canvas symbol.

(cherry picked from commit 7d1dbb77c3)
This commit is contained in:
Jeff Young 2023-09-12 16:17:36 +01:00
parent 16f259da81
commit 0eca698a39
5 changed files with 20 additions and 19 deletions

View File

@ -170,7 +170,7 @@ SYMBOL_EDIT_FRAME::SYMBOL_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
ReCreateVToolbar();
ReCreateOptToolbar();
updateTitle();
UpdateTitle();
UpdateSymbolMsgPanelInfo();
RebuildSymbolUnitsList();
@ -558,7 +558,7 @@ bool SYMBOL_EDIT_FRAME::CanCloseSymbolFromSchematic( bool doClose )
if( doClose )
{
SetCurSymbol( nullptr, false );
updateTitle();
UpdateTitle();
}
return true;
@ -849,7 +849,7 @@ void SYMBOL_EDIT_FRAME::OnModify()
m_treePane->GetLibTree()->RefreshLibTree();
if( !GetTitle().StartsWith( "*" ) )
updateTitle();
UpdateTitle();
}
@ -1224,7 +1224,7 @@ void SYMBOL_EDIT_FRAME::ShowChangedLanguage()
GetCanvas()->Refresh();
}
updateTitle();
UpdateTitle();
}
@ -1518,7 +1518,7 @@ void SYMBOL_EDIT_FRAME::LoadSymbolFromSchematic( SCH_SYMBOL* aSymbol )
OnToggleSymbolTree( evt );
}
updateTitle();
UpdateTitle();
RebuildSymbolUnitsList();
SetShowDeMorgan( GetCurSymbol()->HasConversion() );
UpdateSymbolMsgPanelInfo();

View File

@ -247,6 +247,12 @@ public:
UpdateSymbolMsgPanelInfo();
}
/**
* Update the main window title bar with the current library name and read only status
* of the library.
*/
void UpdateTitle();
bool IsSymbolFromSchematic() const
{
// If we've already vetted closing this window, then we have no symbol anymore
@ -427,12 +433,6 @@ private:
*/
bool saveLibrary( const wxString& aLibrary, bool aNewFile );
/**
* Update the main window title bar with the current library name and read only status
* of the library.
*/
void updateTitle();
/**
* Set the current active library to \a aLibrary.
*

View File

@ -56,7 +56,7 @@ SYMBOL_SAVEAS_TYPE SYMBOL_LEGACYFILEDLG_SAVE_AS::m_option = SYMBOL_SAVEAS_TYPE::
#endif
void SYMBOL_EDIT_FRAME::updateTitle()
void SYMBOL_EDIT_FRAME::UpdateTitle()
{
wxString title;
@ -98,7 +98,7 @@ void SYMBOL_EDIT_FRAME::SelectActiveLibrary( const wxString& aLibrary )
if( !selectedLib.empty() )
SetCurLib( selectedLib );
updateTitle();
UpdateTitle();
}
@ -298,7 +298,7 @@ bool SYMBOL_EDIT_FRAME::LoadOneLibrarySymbolAux( LIB_SYMBOL* aEntry, const wxStr
GetInfoBar()->Dismiss();
}
updateTitle();
UpdateTitle();
RebuildSymbolUnitsList();
SetShowDeMorgan( GetCurSymbol()->HasConversion() );
@ -493,7 +493,7 @@ void SYMBOL_EDIT_FRAME::Save()
if( IsSymbolTreeShown() )
m_treePane->GetLibTree()->RefreshLibTree();
updateTitle();
UpdateTitle();
}
@ -713,7 +713,7 @@ void SYMBOL_EDIT_FRAME::UpdateAfterSymbolProperties( wxString* aOldName )
RebuildSymbolUnitsList();
SetShowDeMorgan( GetCurSymbol()->Flatten()->HasConversion() );
updateTitle();
UpdateTitle();
// N.B. The view needs to be rebuilt first as the Symbol Properties change may invalidate
// the view pointers by rebuilting the field table
@ -1217,7 +1217,7 @@ bool SYMBOL_EDIT_FRAME::saveAllLibraries( bool aRequireConfirmation )
}
}
updateTitle();
UpdateTitle();
return retv;
}

View File

@ -97,7 +97,7 @@ void SYMBOL_EDIT_FRAME::GetSymbolFromRedoList()
RebuildSymbolUnitsList();
SetShowDeMorgan( symbol->HasConversion() );
updateTitle();
UpdateTitle();
RebuildView();
OnModify();
@ -145,7 +145,7 @@ void SYMBOL_EDIT_FRAME::GetSymbolFromUndoList()
RebuildSymbolUnitsList();
SetShowDeMorgan( symbol->HasConversion() );
updateTitle();
UpdateTitle();
RebuildView();
OnModify();

View File

@ -377,6 +377,7 @@ int SYMBOL_EDITOR_CONTROL::RenameSymbol( const TOOL_EVENT& aEvent )
editFrame->RebuildView();
editFrame->OnModify();
editFrame->UpdateTitle();
// N.B. The view needs to be rebuilt first as the Symbol Properties change may
// invalidate the view pointers by rebuilting the field table