From 9a213207fbeea2386bcfb50b4c39094e2e56bac2 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 5 Oct 2018 13:55:34 +0100 Subject: [PATCH] Clearer titles for editing board footprints. Also cleans up the naming on the symbol editor side. --- eeschema/lib_edit_frame.cpp | 4 ++-- eeschema/lib_edit_frame.h | 12 ++++++------ eeschema/libedit.cpp | 10 +++++----- eeschema/libedit_undo_redo.cpp | 4 ++-- kicad/commandframe.cpp | 4 ++-- pcbnew/footprint_edit_frame.cpp | 10 ++++++++-- 6 files changed, 25 insertions(+), 19 deletions(-) diff --git a/eeschema/lib_edit_frame.cpp b/eeschema/lib_edit_frame.cpp index 7e3310fbe7..25777d2204 100644 --- a/eeschema/lib_edit_frame.cpp +++ b/eeschema/lib_edit_frame.cpp @@ -251,7 +251,7 @@ LIB_EDIT_FRAME::LIB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : ReCreateVToolbar(); ReCreateOptToolbar(); - DisplayLibInfos(); + updateTitle(); DisplayCmpDoc(); UpdatePartSelectList(); @@ -1046,7 +1046,7 @@ void LIB_EDIT_FRAME::OnEditComponentProperties( wxCommandEvent& event ) m_libMgr->UpdatePart( GetCurPart(), GetCurLib() ); UpdatePartSelectList(); - DisplayLibInfos(); + updateTitle(); DisplayCmpDoc(); OnModify(); m_canvas->Refresh(); diff --git a/eeschema/lib_edit_frame.h b/eeschema/lib_edit_frame.h index 0caedeb393..f3a77f6a94 100644 --- a/eeschema/lib_edit_frame.h +++ b/eeschema/lib_edit_frame.h @@ -342,12 +342,6 @@ public: void UpdatePartSelectList(); - /** - * Updates the main window title bar with the current library name and read only status - * of the library. - */ - void DisplayLibInfos(); - /** * Redraw the current component loaded in library editor * Display reference like in schematic (a reference U is shown U? or U?A) @@ -482,6 +476,12 @@ private: */ bool saveLibrary( const wxString& aLibrary, bool aNewFile ); + /** + * Updates the main window title bar with the current library name and read only status + * of the library. + */ + void updateTitle(); + /** * Called when the frame is activated. Tests if the current library exists. * The library list can be changed by the schematic editor after reloading a new schematic diff --git a/eeschema/libedit.cpp b/eeschema/libedit.cpp index 3e8e72f8d8..5f87983cc1 100644 --- a/eeschema/libedit.cpp +++ b/eeschema/libedit.cpp @@ -55,10 +55,10 @@ #include #include -void LIB_EDIT_FRAME::DisplayLibInfos() +void LIB_EDIT_FRAME::updateTitle() { wxString lib = GetCurLib(); - wxString title = _( "Symbol Library Editor" ); + wxString title = _( "Symbol Editor" ); if( GetCurPart() ) title += wxT( " \u2014 " ) + GetCurPart()->GetLibId().Format(); @@ -77,7 +77,7 @@ void LIB_EDIT_FRAME::SelectActiveLibrary( const wxString& aLibrary ) if( !selectedLib.empty() ) SetCurLib( selectedLib ); - DisplayLibInfos(); + updateTitle(); } @@ -182,7 +182,7 @@ bool LIB_EDIT_FRAME::LoadOneLibraryPartAux( LIB_ALIAS* aEntry, const wxString& a SetShowDeMorgan( GetCurPart()->HasConversion() ); Zoom_Automatique( false ); - DisplayLibInfos(); + updateTitle(); UpdatePartSelectList(); // Display the document information based on the entry selected just in @@ -239,7 +239,7 @@ void LIB_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg ) m_canvas->DrawCrossHair( DC ); - DisplayLibInfos(); + updateTitle(); UpdateStatusBar(); } diff --git a/eeschema/libedit_undo_redo.cpp b/eeschema/libedit_undo_redo.cpp index 3de2dcb516..d5c4b0dfd9 100644 --- a/eeschema/libedit_undo_redo.cpp +++ b/eeschema/libedit_undo_redo.cpp @@ -92,7 +92,7 @@ void LIB_EDIT_FRAME::GetComponentFromRedoList( wxCommandEvent& event ) SetDrawItem( NULL ); UpdatePartSelectList(); SetShowDeMorgan( part->HasConversion() ); - DisplayLibInfos(); + updateTitle(); DisplayCmpDoc(); OnModify(); m_canvas->Refresh(); @@ -139,7 +139,7 @@ void LIB_EDIT_FRAME::GetComponentFromUndoList( wxCommandEvent& event ) SetDrawItem( NULL ); UpdatePartSelectList(); SetShowDeMorgan( part->HasConversion() ); - DisplayLibInfos(); + updateTitle(); DisplayCmpDoc(); OnModify(); m_canvas->Refresh(); diff --git a/kicad/commandframe.cpp b/kicad/commandframe.cpp index 70f6973dbd..5a7441816d 100644 --- a/kicad/commandframe.cpp +++ b/kicad/commandframe.cpp @@ -73,7 +73,7 @@ void LAUNCHER_PANEL::CreateCommandToolbar() AddButton( ID_TO_SCH_LIB_EDITOR, KiBitmap( icon_libedit_xpm ), - _( "Symbol Library Editor" ) ); + _( "Symbol Editor" ) ); separator = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); m_buttonSizer->Add( separator, 0, wxEXPAND | wxALL, 8 ); @@ -84,7 +84,7 @@ void LAUNCHER_PANEL::CreateCommandToolbar() AddButton( ID_TO_PCB_FP_EDITOR, KiBitmap( icon_modedit_xpm ), - _( "Footprint Library Editor" ) ); + _( "Footprint Editor" ) ); separator = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); m_buttonSizer->Add( separator, 0, wxEXPAND | wxALL, 8 ); diff --git a/pcbnew/footprint_edit_frame.cpp b/pcbnew/footprint_edit_frame.cpp index 78664beb3a..415c7cc9bc 100644 --- a/pcbnew/footprint_edit_frame.cpp +++ b/pcbnew/footprint_edit_frame.cpp @@ -750,11 +750,17 @@ void FOOTPRINT_EDIT_FRAME::OnModify() void FOOTPRINT_EDIT_FRAME::updateTitle() { - wxString title = _( "Footprint Library Editor" ); + wxString title = _( "Footprint Editor" ); LIB_ID fpid = GetLoadedFPID(); bool writable = true; - if( fpid.IsValid() ) + if( IsCurrentFPFromBoard() ) + { + title += wxString::Format( wxT( " \u2014 %s [from %s.%s]" ), + GetBoard()->m_Modules->GetReference(), + Prj().GetProjectName(), PcbFileExtension ); + } + else if( fpid.IsValid() ) { try {