From f2d7bb7b0c7d89a42aaef08a7ab16af73bb03f82 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Mon, 27 May 2019 19:59:48 -0400 Subject: [PATCH] KiCad: Update window title after importing Eagle project --- kicad/mainframe.cpp | 8 ++++++++ kicad/prjconfig.cpp | 10 +--------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/kicad/mainframe.cpp b/kicad/mainframe.cpp index a2123174dd..0d1bdd3cdb 100644 --- a/kicad/mainframe.cpp +++ b/kicad/mainframe.cpp @@ -137,6 +137,14 @@ void KICAD_MANAGER_FRAME::SetProjectFileName( const wxString& aFullProjectProFil fn.MakeAbsolute(); Prj().SetProjectFullName( fn.GetFullPath() ); + + SetTitle( wxString( "KiCad " ) + GetBuildVersion() ); + wxString title = GetTitle() + " " + fn.GetFullPath(); + + if( !fn.IsDirWritable() ) + title += _( " [Read Only]" ); + + SetTitle( title ); } diff --git a/kicad/prjconfig.cpp b/kicad/prjconfig.cpp index 144a3ca9a9..9223a0c941 100644 --- a/kicad/prjconfig.cpp +++ b/kicad/prjconfig.cpp @@ -71,8 +71,6 @@ void KICAD_MANAGER_FRAME::LoadProject( const wxFileName& aProjectFileName ) if( !Kiway().PlayersClose( false ) ) return; - SetTitle( wxString( "KiCad " ) + GetBuildVersion() ); - // Save the project file for the currently loaded project. if( m_active_project ) Prj().ConfigLoad( PgmTop().SysSearch(), GeneralGroupName, s_KicadManagerParams ); @@ -82,15 +80,9 @@ void KICAD_MANAGER_FRAME::LoadProject( const wxFileName& aProjectFileName ) SetProjectFileName( aProjectFileName.GetFullPath() ); Prj().ConfigLoad( PgmTop().SysSearch(), GeneralGroupName, s_KicadManagerParams ); - wxString title = GetTitle() + " " + aProjectFileName.GetFullPath(); - - if( !aProjectFileName.IsDirWritable() ) - title += _( " [Read Only]" ); - else + if( aProjectFileName.IsDirWritable() ) SetMruPath( Prj().GetProjectPath() ); // Only set MRU path if we have write access. Why? - SetTitle( title ); - UpdateFileHistory( aProjectFileName.GetFullPath(), &PgmTop().GetFileHistory() ); m_LeftWin->ReCreateTreePrj();