From 7d1dbb77c3d1f074f6a188efe04fc8ecfee96993 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 12 Sep 2023 16:17:36 +0100 Subject: [PATCH] Update symbol editor's title bar when renaming the canvas symbol. --- eeschema/symbol_editor/symbol_edit_frame.cpp | 10 +++++----- eeschema/symbol_editor/symbol_edit_frame.h | 12 ++++++------ eeschema/symbol_editor/symbol_editor.cpp | 12 ++++++------ eeschema/symbol_editor/symbol_editor_undo_redo.cpp | 4 ++-- eeschema/tools/symbol_editor_control.cpp | 1 + 5 files changed, 20 insertions(+), 19 deletions(-) diff --git a/eeschema/symbol_editor/symbol_edit_frame.cpp b/eeschema/symbol_editor/symbol_edit_frame.cpp index 8628e3f1b6..ebcba7ec7c 100644 --- a/eeschema/symbol_editor/symbol_edit_frame.cpp +++ b/eeschema/symbol_editor/symbol_edit_frame.cpp @@ -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(); diff --git a/eeschema/symbol_editor/symbol_edit_frame.h b/eeschema/symbol_editor/symbol_edit_frame.h index 222bb76058..6f1a3caadd 100644 --- a/eeschema/symbol_editor/symbol_edit_frame.h +++ b/eeschema/symbol_editor/symbol_edit_frame.h @@ -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. * diff --git a/eeschema/symbol_editor/symbol_editor.cpp b/eeschema/symbol_editor/symbol_editor.cpp index 2cbcb1ecb5..d2d92c401d 100644 --- a/eeschema/symbol_editor/symbol_editor.cpp +++ b/eeschema/symbol_editor/symbol_editor.cpp @@ -51,7 +51,7 @@ #include -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; } diff --git a/eeschema/symbol_editor/symbol_editor_undo_redo.cpp b/eeschema/symbol_editor/symbol_editor_undo_redo.cpp index 32c6abea12..37fbdcbb9e 100644 --- a/eeschema/symbol_editor/symbol_editor_undo_redo.cpp +++ b/eeschema/symbol_editor/symbol_editor_undo_redo.cpp @@ -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(); diff --git a/eeschema/tools/symbol_editor_control.cpp b/eeschema/tools/symbol_editor_control.cpp index 309cfdc927..ee9a683e92 100644 --- a/eeschema/tools/symbol_editor_control.cpp +++ b/eeschema/tools/symbol_editor_control.cpp @@ -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