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

This commit is contained in:
Jeff Young 2023-09-12 16:17:36 +01:00
parent ee724f6a2b
commit 7d1dbb77c3
5 changed files with 20 additions and 19 deletions

View File

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

View File

@ -252,6 +252,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
@ -429,12 +435,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

@ -51,7 +51,7 @@
#include <widgets/symbol_filedlg_save_as.h>
void SYMBOL_EDIT_FRAME::updateTitle()
void SYMBOL_EDIT_FRAME::UpdateTitle()
{
wxString title;
@ -93,7 +93,7 @@ void SYMBOL_EDIT_FRAME::SelectActiveLibrary( const wxString& aLibrary )
if( !selectedLib.empty() )
SetCurLib( selectedLib );
updateTitle();
UpdateTitle();
}
@ -295,7 +295,7 @@ bool SYMBOL_EDIT_FRAME::LoadOneLibrarySymbolAux( LIB_SYMBOL* aEntry, const wxStr
GetInfoBar()->Dismiss();
}
updateTitle();
UpdateTitle();
RebuildSymbolUnitsList();
SetShowDeMorgan( GetCurSymbol()->HasConversion() );
@ -524,7 +524,7 @@ void SYMBOL_EDIT_FRAME::Save()
if( IsSymbolTreeShown() )
m_treePane->GetLibTree()->RefreshLibTree();
updateTitle();
UpdateTitle();
}
@ -765,7 +765,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
@ -1234,7 +1234,7 @@ bool SYMBOL_EDIT_FRAME::saveAllLibraries( bool aRequireConfirmation )
}
}
updateTitle();
UpdateTitle();
return retv;
}

View File

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

View File

@ -412,6 +412,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