From c951ca6f47f391dc8a904ff7ecb771c03d50fdf8 Mon Sep 17 00:00:00 2001 From: Ian McInerney Date: Tue, 28 May 2019 00:21:22 +0100 Subject: [PATCH] cvpcb: Added library location to status bar Fixes: lp:1782805 * https://bugs.launchpad.net/kicad/+bug/1782805 --- cvpcb/cvpcb_mainframe.cpp | 32 ++++++++++++++++++++++++++++---- cvpcb/cvpcb_mainframe.h | 1 + 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/cvpcb/cvpcb_mainframe.cpp b/cvpcb/cvpcb_mainframe.cpp index 3ae7b3f151..ea93376a89 100644 --- a/cvpcb/cvpcb_mainframe.cpp +++ b/cvpcb/cvpcb_mainframe.cpp @@ -167,7 +167,7 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent ) : auto bottomPanel = new wxPanel( this ); auto panelSizer = new wxBoxSizer( wxVERTICAL ); - wxFlexGridSizer* fgSizerStatus = new wxFlexGridSizer( 2, 1, 0, 0 ); + wxFlexGridSizer* fgSizerStatus = new wxFlexGridSizer( 3, 1, 0, 0 ); fgSizerStatus->SetFlexibleDirection( wxBOTH ); fgSizerStatus->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); @@ -175,7 +175,10 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent ) : fgSizerStatus->Add( m_statusLine1, 0, 0, 5 ); m_statusLine2 = new wxStaticText( bottomPanel, wxID_ANY, wxEmptyString ); - fgSizerStatus->Add( m_statusLine2, 0, wxBOTTOM, 3 ); + fgSizerStatus->Add( m_statusLine2, 0, 0, 5 ); + + m_statusLine3 = new wxStaticText( bottomPanel, wxID_ANY, wxEmptyString ); + fgSizerStatus->Add( m_statusLine3, 0, wxBOTTOM, 3 ); panelSizer->Add( fgSizerStatus, 1, wxEXPAND|wxLEFT, 2 ); @@ -186,6 +189,7 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent ) : statusFont.SetSymbolicSize( wxFONTSIZE_SMALL ); m_statusLine1->SetFont( statusFont ); m_statusLine2->SetFont( statusFont ); + m_statusLine3->SetFont( statusFont ); // Add buttons: auto buttonsSizer = new wxBoxSizer( wxHORIZONTAL ); @@ -709,6 +713,24 @@ void CVPCB_MAINFRAME::DisplayStatus() } SetStatusText( msg, 1 ); + + + msg.Empty(); + + if( module ) // can be NULL if no netlist loaded + { + FP_LIB_TABLE* fptbl = Prj().PcbFootprintLibs( Kiway() ); + + wxString modLib = module->GetLibNickname(); + + if( fptbl->HasLibrary( modLib ) ) + { + msg = wxString::Format( _( "Library location: %s" ), + fptbl->GetFullURI( modLib ) ); + } + } + + SetStatusText( msg, 2 ); } @@ -959,9 +981,11 @@ wxString CVPCB_MAINFRAME::GetSelectedFootprint() void CVPCB_MAINFRAME::SetStatusText( const wxString& aText, int aNumber ) { - wxASSERT( aNumber < 2 ); + wxASSERT( aNumber < 3 ); - if( aNumber == 1 ) + if( aNumber == 2 ) + m_statusLine3->SetLabel( aText ); + else if( aNumber == 1 ) m_statusLine2->SetLabel( aText ); else m_statusLine1->SetLabel( aText ); diff --git a/cvpcb/cvpcb_mainframe.h b/cvpcb/cvpcb_mainframe.h index 8e2bc3e525..da17d9e39f 100644 --- a/cvpcb/cvpcb_mainframe.h +++ b/cvpcb/cvpcb_mainframe.h @@ -68,6 +68,7 @@ class CVPCB_MAINFRAME : public KIWAY_PLAYER wxTextCtrl* m_tcFilterString; wxStaticText* m_statusLine1; wxStaticText* m_statusLine2; + wxStaticText* m_statusLine3; wxButton* m_saveAndContinue; public: